LayoutToolAvailability Future Layout tool plug-ins are just custom Layout tools. To the user, they behave like Layout's built-in tools (the tools activated by the Move, Rotate and Scale buttons, for example). Support for this class isn't complete. Activation Function XCALL_( int ) MyLayoutTool( int version, GlobalFunc *global,
LWLayoutTool *local, void *serverData );
The local argument to a Layout tool's activation function is an LWLayoutTool. typedef struct st_LWLayoutTool {
LWInstance instance;
LWLayoutToolFuncs *tool;
} LWLayoutTool;
The activation function fills in the instance field and the callbacks of the tool field and returns. As with handlers, the remaining interaction between Layout and the plug-in takes place through the callbacks.
Tool Functions The tool field of the LWLayoutTool is a pointer to an LWLayoutToolFuncs. typedef struct st_LWLayoutToolFuncs {
void (*done) (LWInstance);
void (*draw) (LWInstance, LWCustomObjAccess *);
const char * (*help) (LWInstance, LWToolEvent *);
int (*dirty) (LWInstance);
int (*count) (LWInstance, LWToolEvent *);
int (*handle) (LWInstance, LWToolEvent *, int i,
LWDVector pos);
int (*start) (LWInstance, LWToolEvent *);
int (*adjust) (LWInstance, LWToolEvent *, int i);
int (*down) (LWInstance, LWToolEvent *);
void (*move) (LWInstance, LWToolEvent *);
void (*up) (LWInstance, LWToolEvent *);
void (*event) (LWInstance, int code);
LWXPanelID (*panel) (LWInstance);
} LWLayoutToolFuncs;
|