Descriptor Suite Callbacks (deprecated Standard Suite)

The standard Descriptor Suite has been deprecated, please use the Action Descriptor Suite Suite defined with the Adobe Plug-in Component Architecture (PICA). More...

Data Structures

struct  WriteDescriptorProcs
 The Write Descriptor Suite, handles all the Put functionality for scripting. More...
struct  ReadDescriptorProcs
 The Read Descriptor Suite, handles all the Get functionality for scripting. More...
struct  PIDescriptorParameters
 Descriptor suite callbacks. More...

Defines

#define kCurrentWriteDescriptorProcsVersion   0
#define kCurrentWriteDescriptorProcsCount   ((sizeof(WriteDescriptorProcs) - offsetof(WriteDescriptorProcs, openWriteDescriptorProc)) / sizeof(void*))
#define kCurrentReadDescriptorProcsVersion   0
#define kCurrentReadDescriptorProcsCount   ((sizeof(ReadDescriptorProcs) - offsetof(ReadDescriptorProcs, openReadDescriptorProc)) / sizeof(void*))
#define kCurrentDescriptorParametersVersion   0

Typedefs

typedef struct WriteDescriptorProcs WriteDescriptorProcs
 The Write Descriptor Suite, handles all the Put functionality for scripting.
typedef struct ReadDescriptorProcs ReadDescriptorProcs
 The Read Descriptor Suite, handles all the Get functionality for scripting.
typedef struct
PIDescriptorParameters 
PIDescriptorParameters
 Descriptor suite callbacks.

WriteDescriptor callbacks

typedef MACPASCAL
PIWriteDescriptor(* 
OpenWriteDescriptorProc )(void)
 Opens a PIWriteDescriptor handle for access to its descriptor array.
typedef MACPASCAL OSErr(* CloseWriteDescriptorProc )(PIWriteDescriptor, PIDescriptorHandle *)
 Creates a new PIDescriptorHandle containing the key/value pairs that have been written to the write descriptor, and closes the PIWriteDescriptor handle.
typedef MACPASCAL OSErr(* PutIntegerProc )(PIWriteDescriptor, DescriptorKeyID, int32)
 Stores an ID and corresponding integer (typeInteger) into a descriptor structure.
typedef MACPASCAL OSErr(* PutFloatProc )(PIWriteDescriptor, DescriptorKeyID, const real64 *)
 Stores an ID and corresponding floating point number (typeFloat) into a descriptor structure.
typedef MACPASCAL OSErr(* PutUnitFloatProc )(PIWriteDescriptor, DescriptorKeyID, DescriptorUnitID, const real64 *)
 Stores an ID and corresponding unit-based floating point number (typeUnitFloat) into a descriptor structure.
typedef MACPASCAL OSErr(* PutBooleanProc )(PIWriteDescriptor, DescriptorKeyID, Boolean)
 Stores an ID and corresponding boolean (typeBoolean) into a descriptor structure.
typedef MACPASCAL OSErr(* PutTextProc )(PIWriteDescriptor, DescriptorKeyID, Handle)
 Stores an ID and corresponding text (typeChar) into a descriptor structure.
typedef MACPASCAL OSErr(* PutAliasProc )(PIWriteDescriptor, DescriptorKeyID, Handle)
 Stores an ID and corresponding alias (typeAlias) into a descriptor structure.
typedef MACPASCAL OSErr(* PutEnumeratedProc )(PIWriteDescriptor, DescriptorKeyID key, DescriptorTypeID type, DescriptorEnumID value)
 Stores an ID and corresponding value from an enumeration (typeEnumerated) into a descriptor structure.
typedef MACPASCAL OSErr(* PutClassProc )(PIWriteDescriptor, DescriptorKeyID, DescriptorTypeID)
 Stores an ID and corresponding class description type (typeClass) into a descriptor structure.
typedef MACPASCAL OSErr(* PutSimpleReferenceProc )(PIWriteDescriptor, DescriptorKeyID, const PIDescriptorSimpleReference *)
 Stores an ID and corresponding basic class, type, name and index (typeObjectReference) into a descriptor structure.
typedef MACPASCAL OSErr(* PutObjectProc )(PIWriteDescriptor, DescriptorKeyID, DescriptorTypeID, PIDescriptorHandle)
 Stores an ID and corresponding object (typeObject) into a descriptor structure.
typedef MACPASCAL OSErr(* PutCountProc )(PIWriteDescriptor, DescriptorKeyID, uint32 count)
 Stores an ID and corresponding integer into a descriptor structure.
typedef MACPASCAL OSErr(* PutStringProc )(PIWriteDescriptor, DescriptorKeyID, ConstStr255Param)
 Stores an ID and corresponding string (typeChar) into a descriptor structure.
typedef MACPASCAL OSErr(* PutScopedClassProc )(PIWriteDescriptor, DescriptorKeyID, DescriptorTypeID)
typedef MACPASCAL OSErr(* PutScopedObjectProc )(PIWriteDescriptor, DescriptorKeyID, DescriptorTypeID, PIDescriptorHandle)

ReadDescriptor callbacks

typedef MACPASCAL
PIReadDescriptor(* 
OpenReadDescriptorProc )(PIDescriptorHandle, DescriptorKeyIDArray)
 Creates a new read descriptor.
typedef MACPASCAL OSErr(* CloseReadDescriptorProc )(PIReadDescriptor)
 Closes the PIReadDescriptor handle.
typedef MACPASCAL Boolean(* GetKeyProc )(PIReadDescriptor, DescriptorKeyID *key, DescriptorTypeID *type, int32 *flags)
 Returns the next key in the read descriptor; returns key ID, description type, and flags.
typedef MACPASCAL OSErr(* GetIntegerProc )(PIReadDescriptor, int32 *)
 Returns the next value in the read descriptor as a integer (typeInteger).
typedef MACPASCAL OSErr(* GetFloatProc )(PIReadDescriptor, real64 *)
 Returns the next value in the read descriptor as a float (typeFloat).
typedef MACPASCAL OSErr(* GetUnitFloatProc )(PIReadDescriptor, DescriptorUnitID *, real64 *)
 Returns the next value in the read descriptor as a unit-based floating point number (typeUnitFloat).
typedef MACPASCAL OSErr(* GetBooleanProc )(PIReadDescriptor, Boolean *)
 Returns the next value in the read descriptor as a boolean (typeBoolean).
typedef MACPASCAL OSErr(* GetTextProc )(PIReadDescriptor, Handle *)
 Returns the next value in the read descriptor as a pointer to text (typeChar).
typedef MACPASCAL OSErr(* GetAliasProc )(PIReadDescriptor, Handle *)
 Returns the next value in the read descriptor as an alias (typeAlias).
typedef MACPASCAL OSErr(* GetEnumeratedProc )(PIReadDescriptor, DescriptorEnumID *)
 Returns the next value in the read descriptor as an enumerated description type (typeEnumerated).
typedef MACPASCAL OSErr(* GetClassProc )(PIReadDescriptor, DescriptorTypeID *)
 Returns the next value in the read descriptor as an class description type (typeClass).
typedef MACPASCAL OSErr(* GetSimpleReferenceProc )(PIReadDescriptor, PIDescriptorSimpleReference *)
 Returns the next value in the read descriptor as a basic reference (typeObjectReference).
typedef MACPASCAL OSErr(* GetObjectProc )(PIReadDescriptor, DescriptorTypeID *, PIDescriptorHandle *)
 Returns the next value in the read descriptor as an object, defined by a descriptor type and a handle to the corresponding object (typeObject).
typedef MACPASCAL OSErr(* GetCountProc )(PIReadDescriptor, uint32 *)
 Returns the number of descriptors in a read descriptor structure.
typedef MACPASCAL OSErr(* GetStringProc )(PIReadDescriptor, Str255 *)
 Returns the next value in the read descriptor as a string (typeChar).
typedef MACPASCAL OSErr(* GetPinnedIntegerProc )(PIReadDescriptor, int32 min, int32 max, int32 *)
 Returns the next value in the read descriptor as a pinned integer (typeInteger).
typedef MACPASCAL OSErr(* GetPinnedFloatProc )(PIReadDescriptor, const real64 *min, const real64 *max, real64 *)
 Returns the next value in the read descriptor as a pinned float (typeFloat).
typedef MACPASCAL OSErr(* GetPinnedUnitFloatProc )(PIReadDescriptor, const real64 *min, const real64 *max, DescriptorUnitID *, real64 *)
 Returns the next value in the read descriptor as a pinned unit float (typeUnitFloat).

Detailed Description

The standard Descriptor Suite has been deprecated, please use the Action Descriptor Suite Suite defined with the Adobe Plug-in Component Architecture (PICA).

The Descriptor suite provides all the callbacks related to scripting. It is divided into two sub-suites, WriteDescriptorProcs and ReadDescriptorProcs, located in PIDescriptorParameters.

The standard Descriptor Suite is found as a pointer in the parameter blocks of the plug-in modules. Since the Descriptor Suite is composed of two sub-suites, you must reference the routines through one of these. You can access the routines within the Descriptor Suite in the following manner:

    DLLExport MACPASCAL void PluginMain (const int16 selector,
                                         void *exportParamBlock,
                                         int32 *data,
                                         int16 *result)
    {
        ...

        // Get the Descriptor Suite from the parameter block
        PIDescriptorParameters *descParams =
                    ((ExportRecordPtr)exportParamBlock)->descriptorParameters;

        // Verify we found the suite.
        if (descParams == NULL) return err;

        // Get the Write Descriptor Suite
        WriteDescriptorProcs* writeProcs = descParams->writeDescriptorProcs;

        // Verify we found that too.
        if (writeProcs == NULL) return err;

        // Call the routine to open a write descriptor.
        token = writeProcs->openWriteDescriptorProc();
    }

Define Documentation

#define kCurrentWriteDescriptorProcsCount   ((sizeof(WriteDescriptorProcs) - offsetof(WriteDescriptorProcs, openWriteDescriptorProc)) / sizeof(void*))
#define kCurrentReadDescriptorProcsCount   ((sizeof(ReadDescriptorProcs) - offsetof(ReadDescriptorProcs, openReadDescriptorProc)) / sizeof(void*))

Typedef Documentation

typedef MACPASCAL PIWriteDescriptor(* OpenWriteDescriptorProc)(void)

Opens a PIWriteDescriptor handle for access to its descriptor array.

Returns:
NULL if unable to allocate the memory for the handle. If an error occurs at any time after OpenWriteDescriptorProc, the PIDescriptor writeToken and the new PIDescriptor handle should be be disposed of using DisposePIHandleProc from the Handle Suite.

Creates a new PIDescriptorHandle containing the key/value pairs that have been written to the write descriptor, and closes the PIWriteDescriptor handle.

Return the new PIDescriptorHandle to the host in PIDescriptorParameters::descriptor.

Parameters:
PIWriteDescriptorThe write descriptor to close.
PIDescriptorHandle[OUT] Newly created PIDescriptorHandle.
Returns:
NULL if unable to allocate the memory for the new handle.
typedef MACPASCAL OSErr(* PutIntegerProc)(PIWriteDescriptor, DescriptorKeyID, int32)

Stores an ID and corresponding integer (typeInteger) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
int32The integer to write.
Returns:
Non-zero error if failure.
typedef MACPASCAL OSErr(* PutFloatProc)(PIWriteDescriptor, DescriptorKeyID, const real64 *)

Stores an ID and corresponding floating point number (typeFloat) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
real64The floating point number to write.
Returns:
Non-zero error if failure.
typedef MACPASCAL OSErr(* PutUnitFloatProc)(PIWriteDescriptor, DescriptorKeyID, DescriptorUnitID, const real64 *)

Stores an ID and corresponding unit-based floating point number (typeUnitFloat) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
DescriptorUnitIDThe units to write.
real64The floating point number to write.
Returns:
Non-zero error if failure.
typedef MACPASCAL OSErr(* PutBooleanProc)(PIWriteDescriptor, DescriptorKeyID, Boolean)

Stores an ID and corresponding boolean (typeBoolean) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
BooleanThe boolean to write.
Returns:
Non-zero error if failure.
typedef MACPASCAL OSErr(* PutTextProc)(PIWriteDescriptor, DescriptorKeyID, Handle)

Stores an ID and corresponding text (typeChar) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
HandleA pointer to the text to write.
Returns:
Non-zero error if failure.
typedef MACPASCAL OSErr(* PutAliasProc)(PIWriteDescriptor, DescriptorKeyID, Handle)

Stores an ID and corresponding alias (typeAlias) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
HandleA pointer to the alias to write.
Returns:
Non-zero error if failure.

Stores an ID and corresponding value from an enumeration (typeEnumerated) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
keyThe key to write.
typeThe enumeration type.
valueThe value from the enumeration to write.
Returns:
Non-zero error if failure.

Stores an ID and corresponding class description type (typeClass) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
DescriptorTypeIDThe class type.
Returns:
Non-zero error if failure.

Stores an ID and corresponding basic class, type, name and index (typeObjectReference) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
PIDescriptorSimpleReferenceThe basic reference to write.
Returns:
Non-zero error if failure.

Stores an ID and corresponding object (typeObject) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
DescriptorTypeIDThe type of object to write.
PIDescriptorHandleThe object to write.
Returns:
Non-zero error if failure.
typedef MACPASCAL OSErr(* PutCountProc)(PIWriteDescriptor, DescriptorKeyID, uint32 count)

Stores an ID and corresponding integer into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
uint32The integer to write.
Returns:
Non-zero error if failure.
typedef MACPASCAL OSErr(* PutStringProc)(PIWriteDescriptor, DescriptorKeyID, ConstStr255Param)

Stores an ID and corresponding string (typeChar) into a descriptor structure.

Parameters:
PIWriteDescriptorThe descriptor to write into
DescriptorKeyIDThe key to write.
ConstStr255ParamThe string to write.
Returns:
Non-zero error if failure.

Creates a new read descriptor.

Parameters:
PIDescriptorHandlePointer to a list of key/value pairs, usually passed through PIDescriptorParameters::descriptor.
DescriptorKeyIDArrayNULL-terminated array you can provide to automatically track which keys have been returned. This array is updated in GetKeyProc. As each key is returned, it is changed to the null string ("\0") in the array.
Note:
This DescriptorKeyIDArray must be NULL-terminated, or the automatic array processor will read and write beyond the end of the array, which will likely crash the host.
Returns:
The newly created read descriptor; or NULL, if unable to allocate the memory for the new handle.
typedef MACPASCAL OSErr(* CloseReadDescriptorProc)(PIReadDescriptor)

Closes the PIReadDescriptor handle.

Parameters:
PIReadDescriptorThe read descriptor to close.
Returns:
The most major error that occurred during reading, if any.
Note:
Errors that occur in Get routines and GetKeyProc are sticky, meaning an error keeps getting returned until another more drastic error supercedes it. This way a plug-in can check for any major errors after it has read all the data.

typedef MACPASCAL Boolean(* GetKeyProc)(PIReadDescriptor, DescriptorKeyID *key, DescriptorTypeID *type, int32 *flags)

Returns the next key in the read descriptor; returns key ID, description type, and flags.

During this call, the DescriptorKeyIDArray, which was passed into OpenReadDescriptorProc, is updated. As each key is returned GetKeyProc changes it value to the null string ("\0") in the DescriptorKeyIDArray. If the plug-in gets to CloseReadDescriptorProc and this array is not empty, it indicates any key the plug-in expected but was not given. You can subsequently coerce missing information or request it in a dialog from the user (as long as playInfo | plugInDialogSilent).

Parameters:
PIReadDescriptorThe descriptor to read from.
key[OUT] Returned key.
type[OUT] Type of the key, based on the routine used to put the key into the descriptor. See the various Get and Put routines for their types.
flags[OUT] See Flags returned by GetKeyProc.
Returns:
TRUE if there are keys remaining; FALSE if there are no more keys.
typedef MACPASCAL OSErr(* GetIntegerProc)(PIReadDescriptor, int32 *)

Returns the next value in the read descriptor as a integer (typeInteger).

Parameters:
PIReadDescriptorThe descriptor to read from.
int32[OUT] Returned integer value.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetFloatProc)(PIReadDescriptor, real64 *)

Returns the next value in the read descriptor as a float (typeFloat).

Parameters:
PIReadDescriptorThe descriptor to read from.
real64[OUT] Returned float value.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetUnitFloatProc)(PIReadDescriptor, DescriptorUnitID *, real64 *)

Returns the next value in the read descriptor as a unit-based floating point number (typeUnitFloat).

Parameters:
PIReadDescriptorThe descriptor to read from.
DescriptorUnitID[OUT] Returned unit type.
real64[OUT] Returned float value.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetBooleanProc)(PIReadDescriptor, Boolean *)

Returns the next value in the read descriptor as a boolean (typeBoolean).

Parameters:
PIReadDescriptorThe descriptor to read from.
Boolean[OUT] Returned boolean value.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetTextProc)(PIReadDescriptor, Handle *)

Returns the next value in the read descriptor as a pointer to text (typeChar).

Parameters:
PIReadDescriptorThe descriptor to read from.
Handle[OUT] Returned pointer to text.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetAliasProc)(PIReadDescriptor, Handle *)

Returns the next value in the read descriptor as an alias (typeAlias).

Parameters:
PIReadDescriptorThe descriptor to read from.
Handle[OUT] Handle to the alias returned.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetEnumeratedProc)(PIReadDescriptor, DescriptorEnumID *)

Returns the next value in the read descriptor as an enumerated description type (typeEnumerated).

Parameters:
PIReadDescriptorThe descriptor to read from.
DescriptorEnumID[OUT] Returned enumerated description type.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetClassProc)(PIReadDescriptor, DescriptorTypeID *)

Returns the next value in the read descriptor as an class description type (typeClass).

Parameters:
PIReadDescriptorThe descriptor to read from.
DescriptorTypeID[OUT] Returned class description type.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.

Returns the next value in the read descriptor as a basic reference (typeObjectReference).

Parameters:
PIReadDescriptorThe descriptor to read from.
PIDescriptorSimpleReference[OUT] Returned basic reference.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.

Returns the next value in the read descriptor as an object, defined by a descriptor type and a handle to the corresponding object (typeObject).

Parameters:
PIReadDescriptorThe descriptor to read from.
DescriptorTypeID[OUT] The type of the object.
PIDescriptorHandle[OUT] Handle to the object.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetCountProc)(PIReadDescriptor, uint32 *)

Returns the number of descriptors in a read descriptor structure.

Parameters:
PIReadDescriptorThe descriptor to get the count from.
uint32[OUT] The number of descriptors found.
Returns:
Non-zero error if failure.
typedef MACPASCAL OSErr(* GetStringProc)(PIReadDescriptor, Str255 *)

Returns the next value in the read descriptor as a string (typeChar).

Parameters:
PIReadDescriptorThe descriptor to read from.
Str255[OUT] Returned string value.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type.
typedef MACPASCAL OSErr(* GetPinnedIntegerProc)(PIReadDescriptor, int32 min, int32 max, int32 *)

Returns the next value in the read descriptor as a pinned integer (typeInteger).

This routine returns a int32 from a descriptor structure. If the value is out of the range provide by min and max, it returns coercedParamErr and stores either the minimum or maximum value in the returned integer parameter, whichever is closer.

Parameters:
PIReadDescriptorThe descriptor to read from.
minThe minimum value to pin the integer to.
maxThe maximum value to pin the integer to.
int32[OUT] Returned integer value.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type, or if the integer was out of range.
typedef MACPASCAL OSErr(* GetPinnedFloatProc)(PIReadDescriptor, const real64 *min, const real64 *max, real64 *)

Returns the next value in the read descriptor as a pinned float (typeFloat).

This routine returns a floating point number from a descriptor structure. If the value is out of the range provide by min and max, it returns coercedParamErr and stores either the minimum or maximum value in the returned float parameter, whichever is closer.

Parameters:
PIReadDescriptorThe descriptor to read from.
minThe minimum value to pin the integer to.
maxThe maximum value to pin the integer to.
real64[OUT] Returned float value.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type, or if the floating point number was out of range.
typedef MACPASCAL OSErr(* GetPinnedUnitFloatProc)(PIReadDescriptor, const real64 *min, const real64 *max, DescriptorUnitID *, real64 *)

Returns the next value in the read descriptor as a pinned unit float (typeUnitFloat).

This routine returns a floating point number from a descriptor structure. If the value is out of the range provide by min and max, it returns coercedParamErr and stores either the minimum or maximum value in the returned float parameter, whichever is closer.

Parameters:
PIReadDescriptorThe descriptor to read from.
minThe minimum value to pin the integer to.
maxThe maximum value to pin the integer to.
DescriptorUnitIDThe unit for the floating point returned.
real64[OUT] Returned float value.
Returns:
  • paramErr if the call is made for the wrong type, unless the parameter can be coerced;
  • coercedParamErr if the parameter could be coerced to this type, or if the floating point number was out of range.

The Write Descriptor Suite, handles all the Put functionality for scripting.

Make sure to check its version number and number of routines for compatibility before using its callbacks.

The Read Descriptor Suite, handles all the Get functionality for scripting.

Make sure to check its version number and number of routines for compatibility before using its callbacks.

Descriptor suite callbacks.

The suite is divided into two sub-suites, one for read, one for write, that define the set of available routines for the Descriptor Suite.