Callbacks allow Acrobat to call functions in a plug-in. The core API provides macros to
create and destroy callbacks. These include ASCallbackCreateProto(), ASCallbackCreateReplacement(),
and ASCallbackCreateNotification() (defined in PICommon.h), and ASCallbackDestroy().
These macros (which eventually call the macro ASCallbackCreate()) allow compilers to perform
type checking, eliminating an extremely common source of bugs. It is sometimes necessary
for a plug-in to call ASCallbackCreate() directly; for example, when it is passing function
pointers without typedef
s to Mac OS toolbox
routines.
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define ASCallbackCreate (ACROASSERT(gCoreVersion >=CoreHFT_VERSION_2), *((ASCallbackCreateSELPROTO)(gCoreHFT[ASCallbackCreateSEL])))(gExtensionID, (void *)(x))
DescriptionDeprecated in Acrobat 8.0.
File: CorCalls.h |
Line: 480 |
Product availability: PDFL |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define ASCallbackCreate (proc)
File: CorCalls.h |
Line: 351 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define ASCallbackCreateProto ((funcType)ASCallbackCreate(((void*)proc)))
DescriptionDeprecated in Acrobat 8.0.
File: CorCalls.h |
Line: 496 |
Product availability: PDFL |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define ASCallbackCreateProto (proc)
File: CorCalls.h |
Line: 350 |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define ASCallbackCreateReplacement ASCallbackCreateProto(sel##PROTO, proc)
File: ASCalls.h |
Line: 515 |
Product availability: PDFL |
Platform availability: Macintosh, Windows, UNIX |
Syntax
#define ASCallbackDestroy
File: CorCalls.h |
Line: 352 |
Product availability: All |
Platform availability: All |
Syntax
typedef void* ASCallback;
File: CoreExpT.h |
Line: 190 |
Product availability: All |
Platform availability: All |
Syntax
Deprecated as of Acrobat 8.0.
Creates a callback that allows the Acrobat viewer to call a function in a plug-in. All plug-in functions that are called by the Acrobat viewer must be converted to callbacks before being passed to the viewer.
Whenever possible, plug-ins should not call ASCallbackCreate() directly, but should use the macros ASCallbackCreateProto(), ASCallbackCreateNotification(), and ASCallbackCreateReplacement(). These macros (which eventually call ASCallbackCreate()) have two advantages:
-
They allow compilers to perform type checking, eliminating one extremely common source of plug-in bugs.
-
They handle extensionID
automatically.
Plug-ins must use ASCallbackCreate() directly, for example, when calling a Mac toolbox routine that expects a ProcPtr
.
Parameters
| extensionID — | IN/OUT The gExtensionID extension that calls proc . |
|
| proc — | IN/OUT The user-supplied procedure for which a callback is created. |
Returns
| The newly-created callback. |
See Also
Since
File: CorProcs.h |
Line: 194 |
Product availability: All |
Platform availability: All |
Syntax
Deprecated as of Acrobat 8.0.
Destroys a callback.
Parameters
| callback — | IN/OUT The callback to destroy. |
See Also
Since
File: CorProcs.h |
Line: 204 |
© 2004-2013 Adobe Systems Incorporated. All rights reserved.
Thu Jan 21 2016, 11:19 AM IST