Using Non-Suite Callbacks

These 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, abortProc is found in FilterRecord, the parameter block structure for a Filter plug-in. (It is also found in the parameter block structure for other plug-in modules.)

    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 Dissolve sample code, this appears somewhat like this:

    // 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;
            }
      ...
    }