Mac-Carbon

 view release on metacpan or  search on metacpan

OSA/OSA.xs  view on Meta::CPAN

OSASetDefaultScriptingComponent(genericScriptingComponent, scriptingSubType)
	ComponentInstance genericScriptingComponent
	OSType				scriptingSubType

=item OSAGetScriptingComponent GENERICSCRIPTINGCOMPONENT, SCRIPTINGSUBTYPE

The OSAGetScriptingComponent function returns an instance of the scripting
component identified by the
SCRIPTINGSUBTYPE parameter. Each instance of the generic scripting component
keeps track of a single instance of each component subtype, so
OSAGetScriptingComponent always returns the same instance of a specified
scripting component that the generic scripting component uses for standard
scripting component routines.
Return C<undef> if an error was detected.

=cut
ComponentInstance
OSAGetScriptingComponent(genericScriptingComponent, scriptingSubType)
	ComponentInstance genericScriptingComponent
	OSType 				scriptingSubType
	CODE:
	if (gMacPerl_OSErr = (short) OSAGetScriptingComponent(genericScriptingComponent, scriptingSubType, &RETVAL)) {
		XSRETURN_UNDEF;
	}
	OUTPUT:
	RETVAL

=item OSAGetScriptingComponentFromStored GENERICSCRIPTINGCOMPONENT, SCRIPTDATA

The OSAGetScriptingComponentFromStored function returns the subtype code for the
scripting component that created the script
data specified by the SCRIPTDATA parameter. 
Return C<undef> if an error was detected.

=cut
OSType
OSAGetScriptingComponentFromStored(genericScriptingComponent, scriptData)
	ComponentInstance genericScriptingComponent
	AEDesc				scriptData
	CODE:
	if (gMacPerl_OSErr = (short) OSAGetScriptingComponentFromStored(genericScriptingComponent, &scriptData, &RETVAL)) {
		XSRETURN_UNDEF;
	}
	OUTPUT:
	RETVAL

=item OSAGenericToRealID GENERICSCRIPTINGCOMPONENT, GENERICSCRIPTID

Given a GENERICSCRIPTID (that is, a script ID returned by a call to a standard
component routine via the generic scripting component), the OSAGenericToRealID
function returns the equivalent component-specific script ID and the component
instance that created that script ID as an array.

=cut
void
OSAGenericToRealID(genericScriptingComponent, genericScriptID)
	ComponentInstance genericScriptingComponent
	OSAID					genericScriptID
	PREINIT:
	ComponentInstance	exactScriptingComponent;
	PPCODE:
	if (gMacPerl_OSErr = (short) OSAGenericToRealID(genericScriptingComponent, &genericScriptID, &exactScriptingComponent)) {
		XSRETURN_EMPTY;
	}
	XS_XPUSH(OSAID, genericScriptID);
	XS_XPUSH(ComponentInstance, exactScriptingComponent);

	
=item OSARealToGenericID GENERICSCRIPTINGCOMPONENT, THESCRIPTID, THEEXACTCOMPONENT

The OSARealToGenericID function performs the reverse of the task performed by
OSAGenericToRealID(). Given a component-specific SCRIPTID and an exact scripting
component instance (that is, the component instance that created the
component-specific script ID), the OSARealToGenericID function returns the
corresponding generic script ID.
Return C<undef> if an error was detected.

=cut
OSAID
OSARealToGenericID(genericScriptingComponent, theScriptID, theExactComponent)
	ComponentInstance genericScriptingComponent
	OSAID					theScriptID
	ComponentInstance theExactComponent
	CODE:
	RETVAL = theScriptID;
	if (gMacPerl_OSErr = (short) OSARealToGenericID(genericScriptingComponent, &RETVAL, theExactComponent)) {
		XSRETURN_UNDEF;
	}
	OUTPUT:
	RETVAL

=back

=cut



( run in 1.141 second using v1.01-cache-2.11-cpan-5511b514fd6 )