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
Deprecated in Acrobat 8.0.
 ASCallbackCreate
 ASCallbackCreateProto
Deprecated in Acrobat 8.0.
 ASCallbackCreateProto
 ASCallbackCreateReplacement
 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: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASCallbackCreate (ACROASSERT(gCoreVersion >=CoreHFT_VERSION_2), *((ASCallbackCreateSELPROTO)(gCoreHFT[ASCallbackCreateSEL])))(gExtensionID, (void *)(x))

Description

Deprecated in Acrobat 8.0.


File: CorCalls.h
Line: 480
ASCallbackCreate 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASCallbackCreate (proc)

File: CorCalls.h
Line: 351
ASCallbackCreateProto 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASCallbackCreateProto ((funcType)ASCallbackCreate(((void*)proc)))

Description

Deprecated in Acrobat 8.0.


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

Syntax

#define ASCallbackCreateProto (proc)

File: CorCalls.h
Line: 350
ASCallbackCreateReplacement 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASCallbackCreateReplacement ASCallbackCreateProto(sel##PROTO, proc)

File: ASCalls.h
Line: 515
ASCallbackDestroy 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

#define ASCallbackDestroy

File: CorCalls.h
Line: 352

Typedefs Detail
ASCallback 
Product availability: All
Platform availability: All

Syntax

typedef void* ASCallback;

File: CoreExpT.h
Line: 190



Method Detail
ASCallbackCreate()
Product availability: All
Platform availability: All

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

Since

PI_ACROSUPPORT_VERSION >= 0x00020000

File: CorProcs.h
Line: 194
ASCallbackDestroy() 
Product availability: All
Platform availability: All

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