The major new feature added in VTeX 6.3 is GeXX. The second "X" stands for eXtensible. With GeXX you can supplement the existing set of the PostScript operators with new constructs, implemented in C or C++.
This feature is applicable to both VTeX/Windows and VTeX/Linux implementations. The terminology in this document is tailored to Windows users; Linux users should have no problem with it as long as they translate a few platform-dependant terms; for example, Dynamic Libraries (DLL)'s under Linux are just Shared Objects (.SO's).}
To enrich VTeX with new GeX operators, you should
VTeX 6.3+ distributions includes an example of such an extension for drawing the PieCharts.
Note: To be visible to the VTeX compiler, the extension DLL's should be placed into the VTEX\BIN\GEX subdirectory.
An extention DLL must export the following three functions:
The code above adds new PostScript operator piechart. Notice that .extend will define it in the current top PostScript dictionary.
An extension operator should be declared as an int function; its solo argument is the GeX interface structure, gexi. The function should return 0 in case of success, and a non-zero value otherwise (triggering a PostScript internal error).
The gexi structure provides the plugin author with full access to the GeX imaging machinery, and, via the .tkread/.tkwrite extentions, to the TeX tokens.
The detailed description of the interface is provided in the Pdf version of the documentation; here we only show the flavor of the code one can write. Here is (a very crude) example of sine curve drawing plugin.
Even if writing GeX plugin's requires some programming work, it is much simpler than doing graphics programming in PSTricks, MetaPost, or GnuPlot.
To load an extension .DLL, execute the .extend operator:
string .extend ==> integer
where the string argument contains the name of the .DLL file with the language extentions, the returned integer is the number of extention operators loaded. Upon successful execution of .extend the newly defined operators become available in the current PostScript environment.
The .extend operator will fail with an error if
PieChart implements MS Word-like PieChart in VTeX. The implementation consists of
Here is a sample code for using PieChart:
and a sample PieChart produced by this extension:
VTeX distribution contains the full source of this plugin.