#define BAD_SELECTOR
0
#define HFTEntryReplaceable
(
0x00000001
)
#define HFT_ERROR_NO_VERSION
(
0xFFFFFFFF
)
#define kHFT_IN_BETA_FLAG
0x80000000
typedef
ASUns32
ASVersion
;
typedef
HFTEntry
*
HFT
;
typedef
const
HFTDataRec
*
HFTData
;
typedef
void
*
HFTEntry
;
typedef
ASInt32
Selector
;
Note: The version numeric type has changed in Acrobat 6.0.
HFT
HFTServerProvideHFTProc(
HFTServer
hftServer
,
ASVersion
version
,
void
*
rock
);
hftServer | The HFT server associated with this proc.
|
version | The HFT version being requested.
|
rock | User-supplied data passed in the call to HFTServerNew().
|
| |
Set to
sizeof(HFTDataRec) | |
The version number.
| |
const void * hftProcs ; | Optional. This should point to an HFT array of function pointers.
|
|
void
HFTDestroy(
HFT
hft
);
hft | The HFT to destroy.
|
Gets the HFTEntry that was replaced by the specified HFTEntry in the specified entry. Plug-ins should generally not use this method directly, but use the CALL_REPLACED_PROC
macro instead.
It is necessary to specify both a selector (the index of an entry in the HFT's table of callback pointers) and an HFTEntry (a callback pointer) because a method may be replaced several times, and the various replacement methods are kept in a linked list. The selector determines which linked list is examined, and the HFTEntry determines the entry in the linked list to return.
HFTEntry
HFTGetReplacedEntry(
HFT
hft
,
Selector
sel
,
HFTEntry
oldEntry
);
hft | The HFT in which a replaced entry is retrieved. See HFTReplaceEntry() for more information.
|
sel | The selector whose previous value is obtained. See HFTReplaceEntry() for more information.
|
oldEntry | The HFTEntry for which the previous value is obtained.
|
NULL
is returned if the entry has not been replaced. ASVersion
HFTGetVersion(
HFT
hft
);
hft | The HFT whose version is obtained.
|
HFT_ERROR_NO_VERSION
otherwise. ASBool
HFTIsValid(
HFT
hft
);
hft | IN/OUT The HFT to test.
|
HFT
HFTNew(
HFTServer
hftServer
,
ASTCount
numSelectors
);
hftServer | The HFT server for the HFT being created. The HFT server must have been created previously using HFTServerNew().
|
numSelectors |
HFT
HFTNewEx(
HFTServer
hftServer
,
HFTData
data
);
hftServer | The HFT server for the HFT being created. The HFT server must have been created previously using HFTServerNew().
|
data |
Replaces the specified entry in the specified HFT. This allows a plug-in to override and replace certain methods in Acrobat's API. See Replaceable Methods for a list of replaceable methods. This method can be used from anywhere in the plug-in, but it makes the most sense for most plug-ins to replace methods in the importReplaceAndRegisterCallback() procedure. Plug-ins register their HFTs in the export callback, but the code to populate the function table is only executed when the first client requests the HFT.
Plug-ins can use the REPLACE
macro instead of calling HFTReplaceEntry() directly.
All plug-ins, and Acrobat itself, share a single copy of each HFT. As a result, when a plug-in replaces the implementation of a method, all other plug-ins and Acrobat also use the new implementation of that method. In addition, once a method's implementation has been replaced, there is no way to remove the new implementation without restarting Acrobat.
Note: The CALL_REPLACED_PROC
macro is available to call the previous HFT entry function that was replaced.
void
HFTReplaceEntry(
HFT
hft
,
Selector
sel
,
HFTEntry
newEntry
,
ASFlagBits
flags
);
hft | The HFT in which a method is replaced. Use ASExtensionMgrGetHFT() to get the HFT, given its name. For the HFTs built into the Acrobat viewer, global variables containing the HFTs have been defined, so you can skip calling ASExtensionMgrGetHFT() for these HFTs.
|
sel | The entry in the HFT to replace, derived from the method's name by appending
SEL . For example, to replace AVAlert, sel must be AVAlertSEL . |
newEntry | The function to replace the current one. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro.
|
flags | The new entry's properties. Currently, only HFTEntryReplaceable is defined.
|
A new version of HFTReplaceEntry() that adds the extension argument.
Plug-ins can use the REPLACE macro instead of calling HFTReplaceEntryEx directly.
Note: The CALL_REPLACED_PROC macro is available to call the previous HFT entry function that was replaced.
void
HFTReplaceEntryEx(
HFT
hft
,
Selector
sel
,
HFTEntry
newEntry
,
ASExtension
extension
,
ASFlagBits
flags
);
hft | The HFT in which a method is replaced. Use ASExtensionMgrGetHFT() to get the HFT, given its name. For the HFTs built into the Acrobat viewer, global variables containing the HFTs have been defined, so you can skip calling ASExtensionMgrGetHFT() for these HFTs.
|
sel | The entry in the HFT to replace, derived from the method's name by appending
SEL . For example, to replace AVAlert, sel must be AVAlertSEL . |
newEntry | The function to replace the current one. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro.
|
extension | Plug-ins should pass in
gExtensionID for this parameter (see the code for the Acrobat 5.0 version of the REPLACE macro). This parameter is stored by Acrobat so that any entries that were replaced by a plug-in can be unreplaced in the event that the plug-in unloads. |
flags | The new entry's properties. Currently, only
HFTEntryReplaceable is defined. |
oldEntry
item from hft
at sel
if the extension fields match. It allows HFT replacements to be undone in cases such as with the DigSig plug-in, which replaces a method that Acrobat could use after DigSig unloads. void
HFTUnreplaceEntry(
HFT
hft
,
Selector
sel
,
HFTEntry
oldEntry
,
ASExtension
extension
);
hft | The HFT in which a method is un-replaced. Use ASExtensionMgrGetHFT() to get the HFT, given its name. For the HFTs built into the Acrobat viewer, global variables containing the HFTs have been defined, so you can skip calling ASExtensionMgrGetHFT() for these HFTs.
|
sel | The entry in the HFT to un-replace, derived from the method's name by appending
SEL . For example, to replace AVAlert, sel must be AVAlertSEL . |
oldEntry | The old function to be replaced. The function pointer must be converted to an HFTEntry using the ASCallbackCreateReplacement() macro.
|
extension | An object of type ASExtension.
|