![]() |
Adobe Photoshop SDK |
|
Using Non-Suite CallbacksThese callbacks are found directly in the various plug-in parameter block structures. For the list of direct callbacks available in Photoshop, see Non-Suite Callbacks. For example, TestAbortProc abortProc; // A pointer to the TestAbortProc callback. The host passes the parameter block to the main entry point of the Filter plug-in. The plug-in can use this to callback to test whether the user has aborted the plug-in execution. In the // parameters passed into PluginMain that need to be global to the project FilterRecord *gFilterRecord = NULL; int32 *gDataHandle = NULL; int16 *gResult = NULL; // all errors go here DLLExport MACPASCAL void PluginMain(const int16 selector, void * filterRecord, int32 * data, int16 * result) { // update our global parameters gFilterRecord = (FilterRecordPtr)filterRecord; gDataHandle = data; gResult = result; ... // see if the user has aborted if (gFilterRecord->abortProc()) { *gResult = userCanceledErr; return; } ... } |