LayerAS_Layer
ObjectASCallback

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 typedefs to Mac OS toolbox routines.



Define Summary
 Define
 ASCallbackCreate
 ASCallbackCreateProto
 ASCallbackDestroy
Typedef Summary
 Typedef
 ASCallback
Method Summary
 Method
 
ASCallback ASCallbackCreate(ASExtension extensionID, void* proc)
Deprecated as of Acrobat 8.0.
 
Deprecated as of Acrobat 8.0.
Defines Detail
ASCallbackCreate 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASCallbackCreate (proc)

File: CorCalls.h
Line: 353
ASCallbackCreateProto 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASCallbackCreateProto (proc)

File: CorCalls.h
Line: 352
ASCallbackDestroy 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASCallbackDestroy

File: CorCalls.h
Line: 354

Typedefs Detail
ASCallback 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef void* ASCallback;

File: CoreExpT.h
Line: 194



Method Detail
ASCallbackCreate()
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASCallback ASCallbackCreate(ASExtension extensionID, void* proc)

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:

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

ASCallbackDestroy
AVAppRegisterNotification
AVAppUnregisterNotification
ASCallbackDestroy
ASCallbackCreateReplacement
ASCallbackCreateProto

ACCB2
DEBUG
ASCallbackCreate

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

Note

If you call ASCallbackCreate() directly, you are actually invoking the ASCallbackCreate() macro, not this HFT routine. The ASCallbackCreate() macro takes only one parameter, the proc, and passes that information into this underlying HFT routine as the second argument. The first argument is always set to gExtensionID, which should be the extension identifier of your plug-in.

File: CorProcs.h
Line: 194
ASCallbackDestroy() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void ASCallbackDestroy(ASCallback callback)

Deprecated as of Acrobat 8.0.

Destroys a callback.

Parameters

callback — 

IN/OUT The callback to destroy.

See Also

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

File: CorProcs.h
Line: 204