![]() |
Adobe Photoshop SDK |
|
Using PICA Callback SuitesThese callbacks are accessed through the Adobe Plug-in Component Architecture (PICA). See PICA Callback Suites for a list of PICA callback suites defined specifically for Photoshop. PICA is a plug-in architecture used by a number of Adobe Systems applications. A plug-in is a file containing a computer program and resources that extend the functionality of a host application. PICA provides a common plug-in management core to the host application and a standard interface for plug-ins. The host’s application programming interface (API) is exposed to plug-ins via "suites." A suite is simply a pointer to a data structure that provides an interface to some common object, often a collection of function pointers. Plug-ins can extend the host API by providing their own function suites. Before they can be used, suites must be "acquired"; when no longer needed, suites are "released". This guarantees that the functions are available to the plug-in. An acquired suite is actually a pointer to a structure with the suite’s function pointers. The plug-in acquires a suite from the PICA Basic Suite, To call one of the suite functions, the syntax is: sSuite->function(); So to use a suite function, the plug-in must acquire the suite, call the suite function, and then release the suite when finished: // Pointer to the ADM (Adobe Dialog Manager) Basic Suite ADMBasicSuite *sADMBasic; // Acquire the ADM Basic Suite filterParamBlock->sSPBasic->AcquireSuite( kADMBasicSuite, kADMBasicSuiteVersion, &sADMBasic ); // Call its Beep() function sADMBasic->Beep( ); // Release the suite filterParamBlock->sSPBasic->ReleaseSuite( kADMBasicSuite, kADMBasicSuiteVersion ); The convention used by this SDK is for suite variables to be global in scope and indicated by a small ‘s’ followed by the suite name, e.g. PICA plug-ins are loaded into and unloaded from memory as needed. When a plug-in adds an ADM dialog it remains in memory until the dialog is disposed. |