Vivio Source Code
Distribution
Vivio 5.1 release 12-01-2010
is a self-extracting zip archive containing the VC++ source code and binaries for the Vivio integrated development environment (IDE), Vivio ActiveX player, Vivio
Mozilla Firefox plugin, Vivio installer and the source code for all the
Vivio animations (and more!) accessible via these web pages. All code is distributed
under the terms of the GNU GENERAL PUBLIC LICENSE Version 2.
The simplest option is to
extract the zip
archive to "C:\" so that the "C:\vivio 5.1" directory
contains the following subdirectories:
|
Directory |
Contents |
| vivio 5.1\bin |
| install.exe |
Vivio installer |
| vivio.exe |
Vivio integrated development
environment (IDE) |
| vivio.ocx |
Vivio ActiveX control |
| npvivio.dll |
Vivio Firefox plugin |
| makewww.bat |
script for compiling animations,
executing runtime tests
and populating the www directory |
| makerelease.bat |
script for making this
distribution (run after makewww.bat) |
|
| vivio 5.1\demos |
source code for ALL Vivio
animations organised in a number of
subdirectories |
| vivio 5.1\include |
Vivio include files (.vin) |
| vivio 5.1\src |
| install |
VC++ source code for installer |
| npvivio |
VC++ source code for the Vivio
Firefox plugin |
| vivio |
VC++ source code for the Vivio
integrated development environment
(IDE) |
| vivioAX |
VC++ source code for the Vivio
ActiveX control |
| gecko-sdk |
header files for building the Vivio
Firefox plugin |
| zlib |
binary distribution of the zlib
compression / decompression library
version 1.2.3.0 |
Vivio
was developed using Microsoft Visual Studio
2008 version 9.0. The solution file vivio 5.1\src\vivio.sln contains
4
projects that build vivio.exe, vivio.ocx,
npvivio.dll
and install.exe. Note that many of the files in
the vivio 5.1\src\vivio subdirectory are
also used in the build of vivioAX.ocx and
npvivio.dll (ie. they are
shared).
|
| vivio 5.1\www |
generated web pages to be
copied to external web server; pages can
also be accessed locally. |
If the vivio installer has not
been run, build vivioAX and npvivio before playing
the Vivio animations in the www directory as this will ensure that vivioAX.ocx is
registered and that npvivio.dll is copied to the
Firefox PLUGINS directory.
Using the Vivio Integrated Development Environment (IDE)
The Vivio IDE (double click C:\vivio 5.1\bin\vivio.exe)
allows Vivio programmes to be created, edited,
compiled and executed. When vivio.exe is run for the
first time, it associates the ".viv" extension with
vivio.exe so that clicking on a ".viv" file
automatically opens the file in the Vivio IDE. The
image below gives a typical source file view of a
Vivio animation.

Note the list of open files on
the file name bar. Clicking on a file name brings
the selected file into the foreground so that it can
be edited. A red filename indicates the file is
currently in the foreground, an "*" appended to a
file name indicates that the file has been modified
and a "-" indicates that the file is read ONLY.
Right clicking on a file name displays a context
menu with options "Open #include files", "Save",
"Close" and "Close ALL files except ...".
Notice also the info and rtlog status windows. The
info window displays compilation errors, runtime
errors and any runtime output generated by calls to
the debug(formats, ...) function. The rtlog windows
displays the runtime output generated by calls to
the rtlog(formats, ..) function. The rtlog
function combined with the vivio.exe -r command line
argument can be used to check that a Vivio
animations run correctly (within reason).
If "run" on the left
hand side of the file name bar is clicked, the
program is compiled (if needed) and run as shown below.

Compilation errors are reported in the
info status window. Clicking on
an error in the status window, causes the IDE to
switch to the source file containing the error and position
the cursor on the line containing the error.
The animation is started and
stopped (paused) by clicking the left mouse button
on the animation background. Click
here for further
details on controlling animation playback.

Clicking on any item on the file
name bar will stop animation playback and switch
back to the source file view.
Right Click
Context Menu
Right click on the animation window background to display the
context menu.

|
Context Menu -
when running an animation - some items
may be disabled depending on the context |
| Play forwards |
Play animation forwards |
| Play backwards |
Play animation backwards |
| Stop |
Stop animation |
| Play to next
checkpoint |
Play animation forwards
until the next checkpoint is reached. Checkpoint
are added programmatically. |
| Play to
previous checkpoint |
Play animation backwards
until the previous checkpoint is reached. |
| Snap to next
checkpoint |
Snap forward to the next
checkpoint. Can be used to quickly position
animation to a point of interest. |
| Snap to
previous checkpoint |
Snap backwards to the previous
checkpoint. |
| Reset animation |
Resets animation |
| Copy as
enhanced metafile |
Used to paste a copy of the
animation (as a metafile) into other
applications (eg. Microsoft Word). The
advantage of using a metafile is that the
image is "vector based" and will scale correctly, unlike a bitmap.
Note that some applications are still unable
to handle enhanced metafiles correctly. |
| Full screen |
Animation is displayed full
screen. To return to the original view,
right click for context menu and select
"Normal screen". F11 can also be used to
switch between full screen and normal screen |
| Show/Hide player
tool tips |
Show or Hide player tool tips
which are displayed when the animation is
started and stopped etc. |
| Show/Hide shuttle |
Show or hide a circular shuttle
that can be used to control animation
playback (consult the following
link for further details). |
| Vivio
animations page |
Display Vivio animations
page (in default browser) |
| Vivio player help page |
Display Vivio player help page (in
default browser) |
| Vivio home page |
Display Vivio home page (in
default browser) |
| Vivio version |
Shows Vivio version and
build date |
Menus
|
File Menu -
some items may be disabled depending on the
context |
| New |
Create a new .viv or
.vin file. |
| Open |
Open existing .viv or
.vin file. |
| Open
#include files |
Open all include files
referenced by active file. |
| Close |
Close active file. |
| Save |
Save active file. |
| Save As... |
Save active file with a
different name. |
| Print |
Print active source file or animation. |
| < recent
files > |
Lists last four .viv projects opened. |
| Exit |
Exit. |
|
Edit Menu - some
items may be disabled depending on the
context |
| Undo |
Undo last edit
operation. |
| Redo |
Redo last undone edit
operation. |
| Copy |
Copy selection to
clipboard. |
| Cut |
Cut selection. |
| Paste |
Paste selection. |
| Add code
template |
Add code template
into file. |
| Find |
Find text string in
active file. |
| Replace |
Replace text string in
active file. |
| Find in
Files |
Find text string in all
open files. |
| Replace in
Files |
Replace text string in
all open files. |
| Increase
indent |
Increase indentation of
selected text. |
| Decrease
indent |
Decrease indention of
selected text. |
| Comment |
Comment selected text. |
| Uncomment |
Uncomment selected text. |
|
View Menu -
some items may be disabled depending on the
context |
| Vcode |
Show .dec file containing
the source code and decoded vcode. Only
available after animation has been compiled. |
| JIT |
Show .x86 file containing
the source code, decoded vcode and
disassembled generated x86 code. Only available
after animation has been compiled and JITted
(or run). |
| Compile and JIT |
Compile and JIT
(just-in-time compile) animation. |
| Debug |
not yet implemented. |
| Run |
Compile, JIT and run animation. |
|
Options Menu -
some items may be disabled depending on the
context |
| Line
numbers |
Display line numbers in
editor. |
| Font size |
Set font size. |
| Window size |
Set window size. |
| Always compile
when run |
Always compile animation
when run. If this is not set, then the
animation is ONLY re-compiled if one of the
source files is changed |
| Clear args when
run |
Vivio has arguments that
can persist between animation runs. If set,
the arguments are cleared before each
animation run. |
| SSE2 |
Generate SSE2 floating point code if CPU
supports it. |
| Runtime
array bounds checking |
JIT compiler
generates code for runtime array bounds
checking (NB. the Vivio ActiveX player
and Firefox plugin never generates array bound checking code
as it is assumed that the possibility of
such errors would have been removed during
development). |
| Compressed |
Generate a compressed
vcode file. |
| Use RDTSC
for statistics |
Use x86 RDTSC (read time
stamp counter) instead of
QueryPerformanceCounter(...) to collect
real-time statistics.
QueryPerformanceCounter() works across all
CPUS, but is quite inefficient and can, in
some cases, slow the
animation and perturb the collected
statistics.
RDTSC is more efficient, but does not
work consistently across all CPUs,
particularly older mobile CPUs such as
the Pentium M where the rate at which
the time stamp counter is clocked slows
with the CPU clock as it enters power save modes.
Use of RDTSC is known to work on
a 2.16GHz T2600 Core Duo and a 3.00GHz
Pentium 4. |
| Show/Hide update
rectangles |
Shows/Hides the display area
updated from frame to frame during
animation playback. Can help determine
if additional layers might improve
playback performance. |
| Show/Hide player
tool tips |
Shows/Hides player tool tips
which are displayed when the animation is
started and stopped etc. |
| Include
directories... |
Sets the directories that compiler
searches when accessing include files.
By default, the path ..\vivio
5.1\include is searched. |
| Layers |
Allows individual
layers in a multi-layer animation to be
hidden or displayed. |
| Shuttle |
Show/Hide a circular shuttle
that can be used to control animation
playback (click here
for further details). |
| Statistics |
Show/Hide the real-time
statistics window. |
|
Help Menu |
| Vivio
animations page |
Display Vivio animations
page (in default browser) |
| Vivio help page |
Display Vivio player help
page (in default browser) |
| Vivio home page |
Display Vivio home page (in
default browser) |
| About Vivio |
Show copyright dialog |
Command Line Arguments
Vivio.exe can be executed with
command line arguments - normally via a batch file
(for an example see vivio 5.1\bin\makewww.bat).
The following command line arguments are allowed.
| vivio [-args
x=1 y=2] fn.viv |
open fn.viv with the args
passed as name value pairs |
| vivio [-args
x=1 y=2] -c fn.viv |
compile fn.viv; vivio.exe
will compile the source file silently
without showing the application window
unless there is a compilation error when it
will show the application window and report the error. |
| vivio [-args
x=1 y=2] -c *.viv |
compile *.viv; vivio.exe will
compile all matching source files; the
application window is not shown unless there
is a compilation error. |
| vivio [-args
x=1 y=2] -cd fn.viv |
compile fn.viv and generate
decode file fn.dec; the application window
is not shown unless there is an error. |
| vivio [-args
x=1 y=2] -c 23 24 25 fn.viv |
compile fn.viv and check
that compiler errors 23, 24 and 25 are
generated in order; the application window
is shown ONLY if the errors numbers do not
match. |
| vivio [-args
x=1 y=2] -r s0 s1 s2 s3 fn.viv |
compile, run and check
run time log generated at runtime by calls
to the rlog(formats, ...) function matches
the concatenation of string arguments s0 s1
and s2; the application window
is shown ONLY if they do not match. |
Finally
It is possible to drop files (with extension
.viv or .vin) directly into the Vivio IDE.
This Vivio release was developed
in C++ using Microsoft Visual Studio 2008 Version
9.0.21022.8
This Vivio release is work in
progress. Vivio is far from an industrial
strength piece of software, but it should be a more
than a useful trouble free tool if kept within the scope
and complexity of the existing examples. Enjoy!
|