Technical Information for Legacy Plug-In Developers
IntroductionAuto-Illustrator has had the ability to extend its functionality through plug-ins from pre-release 0.1d-r10. As of 0.1d-14, there have been four different types of plug-ins: General, Generate, Degenerate and Transform. The categorisation of all plug-ins is dependant upon their location within the Plug-Ins folder inside the application folder. These plug-ins appear in Auto-Illustrator's Filter menu.
![]() Plug-In developers are strongly encouraged to support cross-platform development. You should strongly consider building both Macintosh and Win32 versions of your plug-ins. A plug-in is a single stand-alone executable binary file. On Windows, this means a self-contained valid Win32 .EXE binary (see note 1). On Macintosh, plug-ins must have a creator type of APPL (ie, a standard Application). Upon launching, it reads a temporary file off disk containing the current document artwork, makes appropriate modifications or additions, and creates a new temporary file before quitting. Auto-Illustrator waits for this second temporary file to exist, and then imports that, replacing the previous document with the new one. Using this system, a plug-in can do anything to the entire document (including erase everything). Because of this, plug-ins must be able to understand the data structure of the first temporary file, in order to recreate it in the second. If you dont do that, a user will loose all their existing artwork when they launch your plugin. If that isn't your intention, that's a bad thing.
A note on future compatabilityAs of b0.4-r19, there was a new format for Plug-In systems. The xeoObject standard does not rely on standalone executables for Plug-Ins, and so is not covered in this document. However, all versions of Auto-Illustrator will support the existing standalone executable style of plug-in as well as the new xeoObject style. Documentation on xeoObjects can be found here.
Temporary FilesOn a Macintosh, temporary files are stored in the system's Temporary Items folder. This is a hidden folder on the user's startup volume. You must make appropriate system calls to know the location of that folder. In REALbasic, this folder item accessible using the TemporaryFolder Function, which returns an appropriate FolderItem.On Windows, temporary files are stored in the system's Temporary directory, which is usually WINDOWS\TEMP. Again, this will vary depending on system architecture, and you should use appropriate system calls to determine the correct location of that directory. You might be able to rely on the TEMP Environment variable to tell you that location - this is not officially confirmed by Signwave. The filename of the first temporary file containing the initial document contents is swAI-plugin-export.aut. The format of this file is exactly the same as a regular Auto-Illustrator .aut file, as generated by a File | Save As... action. These are standard text files (see note 2) and you should examine a range of existing .aut files to see how these represent the document artwork. This document only briefly explains them. A plug-in must create the second temporary file called swAI-plugin-import.aut in the temporary folder, and then quit immediately.
![]()
Temporary File FormatAs of b0.2-r17, the format of .aut files changed. Plug-In developers must not use the file format of .aut files from versions before b0.2-r17, either for reading the first temporary file, or writing the second. Each object in a document is represented by a single line in an .aut file. Some objects are not visible to the user, but should still be maintained. Each line contains a series of NAME=VALUE pairs. Each pair is separated by a single space character (0x20). Each object is of a specific type. The type is determined by the first data pair, which is a TYPE declaration. At time of authoring (b0.4-r19) there are three visible types of objects usable, and one invisible. These are:
TYPE=TEXT : This object contains COLOUR, WEIGHT, FONT, GROUPS, TEXT and PATH data TYPE=BUG : This object contains COLOUR, WEIGHT, AGE, DIRECTION and DEAD data TYPE=DIMENSIONS : This object contains WIDTH, HEIGHT and COLOUR data
Data types and formats
Important considerationsYour plug-ins should not rely on any other software being installed on your computer: Users of your plug-in may not have it installed. This may also apply to dynamically linked libraries unless you are sure they are part of a standard operating system install.Your plug-in doesn't have to quit immediately. You could pop open a dialog box, accept user input in any manner of ways, wait until they have clicked an Okay button, and then generate the second temporary file before quitting. You should always be aware that Auto-Illustrator will resume operations as soon as it sees this second temporary file, so make sure your plug-ins quits itself as soon as it has created this file. Use the right icon for your plug-ins. If you use a different plug-in icon from the existing icons bundled with Auto-Illustrator, users might get confused and not realise it is a plug-in, thus putting it in the wrong place. Call your plug-in something sensible. The filename is what appears in the Filter menu (although the .exe extension is not shown on Windows systems). You can do anything with plug-ins. The Swap Artwork plug-in uses a TCP/IP socket to swap artwork data with another machine on the Internet, for example. Exploit the possibilities by creating plug-ins that users will find stimulating and fun to use. A plug-in doesn't even have to generate any new artwork, remember! You should play safe. When your plug-in launches, if it can't find the first temporary file, it shouldn't throw an error message saying "Can't find temporary file!". This is usually an indication that somebody has tried running your plug-in from outside of Auto-Illustrator. Of course this makes no sense, so in this situation it is wise to show an error message saying "This is an Auto-Illustrator plug-in. Place it in the Plug-Ins folder in the Auto-Illustrator application folder, and access it from the Filter menu" (for example). Make sure you ask your users to place your plug-in in the correct folder in the Plug-Ins folder. Do you want your plug-in to be categorised as Generate, Degenerate, Transform, or General (ie, just listed at the bottom of the Filter menu)?
A final word...If you write a plug-in for Auto-Illustrator and it works well, let us know. We'll promote it, and are keen to see third parties extending our software.
NotesNote 1Under Windows, DOS-style .EXE executables might also be usable. However, this theory has not been tested and no guarantee can be made that plug-ins authored in this fashion will work on other systems.
Note 2
Note 3
Note 4
|
|