The APPL attachment (Applet Linkage Data) allows plug-ins that generate content based in a set of input parameters to offer re-editability by saving those parameters to the layer and having Chasys Draw IES automatically invoke the relevant plug-in when the layer is double-clicked with the Hand tool. The metadata consists of a host-defined header followed by plug-in-defined data of arbitrary length:
#define META_APPL_VERSION 0x0001
struct meta_APPL_Obj
{
unsigned short version; //APPL version
unsigned short unused_1; //unused, set to zero
unsigned char type;
unsigned char unused_2[15];
wchar_t name[32];
wchar_t file[32];
char unused_3[256-(4+16+128)];
};
The plug-in requests metadata of size sizeof(meta_APPL_Obj)+size_of_plugin_data. The plug-in then proceeds to fill the header with the type, a name (e.g. “Draw Ball”) and its filename minus the path as the file (e.g. “efx_DrawBall.dll”). The plug-in may then use the extra space to store its parameters, which it will use to re-render the image (e.g. a colored ball) when the host invokes it.
It’s not mandatory that you use a magic number in your data structure, but it’s highly advisable.
Sample Code
Here’s some sample code that illustrates the use of APPL metadata:
TAGS: Chasys Draw IES Source Code, Attachment, Metadata, APPL