mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
1
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
File: AE.h
|
||||
|
||||
Contains: Master include for AE private framework
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2000 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __AE__
|
||||
#define __AE__
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __AEDATAMODEL__
|
||||
#include <AEDataModel.h>
|
||||
#endif
|
||||
|
||||
#ifndef __APPLEEVENTS__
|
||||
#include <AppleEvents.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEPACKOBJECT__
|
||||
#include <AEPackObject.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEOBJECTS__
|
||||
#include <AEObjects.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEREGISTRY__
|
||||
#include <AERegistry.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEUSERTERMTYPES__
|
||||
#include <AEUserTermTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEHELPERS__
|
||||
#include <AEHelpers.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEMACH__
|
||||
#include <AEMach.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#endif /* __AE__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,579 @@
|
||||
/*
|
||||
File: AEHelpers.h
|
||||
|
||||
Contains: AEPrint, AEBuild and AEStream for Carbon
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
/*
|
||||
* Originally from AEGIzmos by Jens Alfke, circa 1992.
|
||||
*/
|
||||
#ifndef __AEHELPERS__
|
||||
#define __AEHELPERS__
|
||||
|
||||
#ifndef __APPLEEVENTS__
|
||||
#include <AppleEvents.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEDATAMODEL__
|
||||
#include <AEDataModel.h>
|
||||
#endif
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AEBuild:
|
||||
*
|
||||
* AEBuild provides a very high level abstraction for building
|
||||
* complete AppleEvents and complex ObjectSpeciers. Using AEBuild it
|
||||
* is easy to produce a textual representation of an AEDesc. The
|
||||
* format is similar to the stdio printf call, where meta data is
|
||||
* extracted from a format string and used to build the final
|
||||
* representation.
|
||||
*
|
||||
* The structure of the format string is described here:
|
||||
*
|
||||
* < describe it >
|
||||
*/
|
||||
/* Syntax Error Codes: */
|
||||
typedef UInt32 AEBuildErrorCode;
|
||||
enum {
|
||||
aeBuildSyntaxNoErr = 0, /* (No error) */
|
||||
aeBuildSyntaxBadToken = 1, /* Illegal character */
|
||||
aeBuildSyntaxBadEOF = 2, /* Unexpected end of format string */
|
||||
aeBuildSyntaxNoEOF = 3, /* Unexpected extra stuff past end */
|
||||
aeBuildSyntaxBadNegative = 4, /* "-" not followed by digits */
|
||||
aeBuildSyntaxMissingQuote = 5, /* Missing close "'" */
|
||||
aeBuildSyntaxBadHex = 6, /* Non-digit in hex string */
|
||||
aeBuildSyntaxOddHex = 7, /* Odd # of hex digits */
|
||||
aeBuildSyntaxNoCloseHex = 8, /* Missing "." */
|
||||
aeBuildSyntaxUncoercedHex = 9, /* Hex string must be coerced to a type */
|
||||
aeBuildSyntaxNoCloseString = 10, /* Missing """ */
|
||||
aeBuildSyntaxBadDesc = 11, /* Illegal descriptor */
|
||||
aeBuildSyntaxBadData = 12, /* Bad data value inside (...) */
|
||||
aeBuildSyntaxNoCloseParen = 13, /* Missing ")" after data value */
|
||||
aeBuildSyntaxNoCloseBracket = 14, /* Expected "," or "]" */
|
||||
aeBuildSyntaxNoCloseBrace = 15, /* Expected "," or "}" */
|
||||
aeBuildSyntaxNoKey = 16, /* Missing keyword in record */
|
||||
aeBuildSyntaxNoColon = 17, /* Missing ":" after keyword in record */
|
||||
aeBuildSyntaxCoercedList = 18, /* Cannot coerce a list */
|
||||
aeBuildSyntaxUncoercedDoubleAt = 19 /* "@@" substitution must be coerced */
|
||||
};
|
||||
|
||||
/* A structure containing error state.*/
|
||||
|
||||
struct AEBuildError {
|
||||
AEBuildErrorCode fError;
|
||||
UInt32 fErrorPos;
|
||||
};
|
||||
typedef struct AEBuildError AEBuildError;
|
||||
/*
|
||||
Create an AEDesc from the format string. AEBuildError can be NULL, in which case
|
||||
no explicit error information will be returned.
|
||||
*/
|
||||
/*
|
||||
* AEBuildDesc()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEBuildDesc(
|
||||
AEDesc * dst,
|
||||
AEBuildError * error, /* can be NULL */
|
||||
const char * src,
|
||||
...);
|
||||
|
||||
|
||||
/* varargs version of AEBuildDesc*/
|
||||
/*
|
||||
* vAEBuildDesc()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
vAEBuildDesc(
|
||||
AEDesc * dst,
|
||||
AEBuildError * error, /* can be NULL */
|
||||
const char * src,
|
||||
va_list args);
|
||||
|
||||
|
||||
|
||||
/* Append parameters to an existing AppleEvent*/
|
||||
/*
|
||||
* AEBuildParameters()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEBuildParameters(
|
||||
AppleEvent * event,
|
||||
AEBuildError * error, /* can be NULL */
|
||||
const char * format,
|
||||
...);
|
||||
|
||||
|
||||
/* varargs version of AEBuildParameters*/
|
||||
/*
|
||||
* vAEBuildParameters()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
vAEBuildParameters(
|
||||
AppleEvent * event,
|
||||
AEBuildError * error, /* can be NULL */
|
||||
const char * format,
|
||||
va_list args);
|
||||
|
||||
|
||||
/* Building an entire Apple event:*/
|
||||
/*
|
||||
* AEBuildAppleEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEBuildAppleEvent(
|
||||
AEEventClass theClass,
|
||||
AEEventID theID,
|
||||
DescType addressType,
|
||||
const void * addressData,
|
||||
long addressLength,
|
||||
short returnID,
|
||||
long transactionID,
|
||||
AppleEvent * result,
|
||||
AEBuildError * error, /* can be NULL */
|
||||
const char * paramsFmt,
|
||||
...);
|
||||
|
||||
|
||||
/* varargs version of AEBuildAppleEvent*/
|
||||
/*
|
||||
* vAEBuildAppleEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
vAEBuildAppleEvent(
|
||||
AEEventClass theClass,
|
||||
AEEventID theID,
|
||||
DescType addressType,
|
||||
const void * addressData,
|
||||
long addressLength,
|
||||
short returnID,
|
||||
long transactionID,
|
||||
AppleEvent * resultEvt,
|
||||
AEBuildError * error, /* can be NULL */
|
||||
const char * paramsFmt,
|
||||
va_list args);
|
||||
|
||||
|
||||
/*
|
||||
* AEPrintDescToHandle
|
||||
*
|
||||
* AEPrintDescToHandle provides a way to turn an AEDesc into a textual
|
||||
* representation. This is most useful for debugging calls to
|
||||
* AEBuildDesc and friends. The Handle returned should be disposed by
|
||||
* the caller. The size of the handle is the actual number of
|
||||
* characters in the string.
|
||||
*/
|
||||
/*
|
||||
* AEPrintDescToHandle()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEPrintDescToHandle(
|
||||
const AEDesc * desc,
|
||||
Handle * result);
|
||||
|
||||
|
||||
/*
|
||||
* AEStream:
|
||||
*
|
||||
* The AEStream interface allows you to build AppleEvents by appending
|
||||
* to an opaque structure (an AEStreamRef) and then turning this
|
||||
* structure into an AppleEvent. The basic idea is to open the
|
||||
* stream, write data, and then close it - closing it produces an
|
||||
* AEDesc, which may be partially complete, or may be a complete
|
||||
* AppleEvent.
|
||||
*/
|
||||
typedef struct OpaqueAEStreamRef* AEStreamRef;
|
||||
/*
|
||||
Create and return an AEStreamRef
|
||||
Returns NULL on memory allocation failure
|
||||
*/
|
||||
/*
|
||||
* AEStreamOpen()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AEStreamRef )
|
||||
AEStreamOpen(void);
|
||||
|
||||
|
||||
/*
|
||||
Closes and disposes of an AEStreamRef, producing
|
||||
results in the desc. You must dispose of the desc yourself.
|
||||
If you just want to dispose of the AEStreamRef, you can pass NULL for desc.
|
||||
*/
|
||||
/*
|
||||
* AEStreamClose()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamClose(
|
||||
AEStreamRef ref,
|
||||
AEDesc * desc);
|
||||
|
||||
|
||||
/*
|
||||
Prepares an AEStreamRef for appending data to a newly created desc.
|
||||
You append data with AEStreamWriteData
|
||||
*/
|
||||
/*
|
||||
* AEStreamOpenDesc()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamOpenDesc(
|
||||
AEStreamRef ref,
|
||||
DescType newType);
|
||||
|
||||
|
||||
/* Append data to the previously opened desc.*/
|
||||
/*
|
||||
* AEStreamWriteData()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamWriteData(
|
||||
AEStreamRef ref,
|
||||
const void * data,
|
||||
Size length);
|
||||
|
||||
|
||||
/*
|
||||
Finish a desc. After this, you can close the stream, or adding new
|
||||
descs, if you're assembling a list.
|
||||
*/
|
||||
/*
|
||||
* AEStreamCloseDesc()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamCloseDesc(AEStreamRef ref);
|
||||
|
||||
|
||||
/* Write data as a desc to the stream*/
|
||||
/*
|
||||
* AEStreamWriteDesc()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamWriteDesc(
|
||||
AEStreamRef ref,
|
||||
DescType newType,
|
||||
const void * data,
|
||||
Size length);
|
||||
|
||||
|
||||
/* Write an entire desc to the stream*/
|
||||
/*
|
||||
* AEStreamWriteAEDesc()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamWriteAEDesc(
|
||||
AEStreamRef ref,
|
||||
const AEDesc * desc);
|
||||
|
||||
|
||||
/*
|
||||
Begin a list. You can then append to the list by doing
|
||||
AEStreamOpenDesc, or AEStreamWriteDesc.
|
||||
*/
|
||||
/*
|
||||
* AEStreamOpenList()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamOpenList(AEStreamRef ref);
|
||||
|
||||
|
||||
/* Finish a list.*/
|
||||
/*
|
||||
* AEStreamCloseList()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamCloseList(AEStreamRef ref);
|
||||
|
||||
|
||||
/*
|
||||
Begin a record. A record usually has type 'reco', however, this is
|
||||
rather generic, and frequently a different type is used.
|
||||
*/
|
||||
/*
|
||||
* AEStreamOpenRecord()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamOpenRecord(
|
||||
AEStreamRef ref,
|
||||
DescType newType);
|
||||
|
||||
|
||||
/* Change the type of a record.*/
|
||||
/*
|
||||
* AEStreamSetRecordType()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamSetRecordType(
|
||||
AEStreamRef ref,
|
||||
DescType newType);
|
||||
|
||||
|
||||
/* Finish a record*/
|
||||
/*
|
||||
* AEStreamCloseRecord()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamCloseRecord(AEStreamRef ref);
|
||||
|
||||
|
||||
/*
|
||||
Add a keyed descriptor to a record. This is analogous to AEPutParamDesc.
|
||||
it can only be used when writing to a record.
|
||||
*/
|
||||
/*
|
||||
* AEStreamWriteKeyDesc()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamWriteKeyDesc(
|
||||
AEStreamRef ref,
|
||||
AEKeyword key,
|
||||
DescType newType,
|
||||
const void * data,
|
||||
Size length);
|
||||
|
||||
|
||||
/*
|
||||
OpenDesc for a keyed record entry. You can use AEStreamWriteData
|
||||
after opening a keyed desc.
|
||||
*/
|
||||
/*
|
||||
* AEStreamOpenKeyDesc()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamOpenKeyDesc(
|
||||
AEStreamRef ref,
|
||||
AEKeyword key,
|
||||
DescType newType);
|
||||
|
||||
|
||||
/* Write a key to the stream - you can follow this with an AEWriteDesc.*/
|
||||
/*
|
||||
* AEStreamWriteKey()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamWriteKey(
|
||||
AEStreamRef ref,
|
||||
AEKeyword key);
|
||||
|
||||
|
||||
/*
|
||||
Create a complete AppleEvent. This creates and returns a new stream.
|
||||
Use this call to populate the meta fields in an AppleEvent record.
|
||||
After this, you can add your records, lists and other parameters.
|
||||
*/
|
||||
/*
|
||||
* AEStreamCreateEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AEStreamRef )
|
||||
AEStreamCreateEvent(
|
||||
AEEventClass clazz,
|
||||
AEEventID id,
|
||||
DescType targetType,
|
||||
const void * targetData,
|
||||
long targetLength,
|
||||
short returnID,
|
||||
long transactionID);
|
||||
|
||||
|
||||
/*
|
||||
This call lets you augment an existing AppleEvent using the stream
|
||||
APIs. This would be useful, for example, in constructing the reply
|
||||
record in an AppleEvent handler. Note that AEStreamOpenEvent will
|
||||
consume the AppleEvent passed in - you can't access it again until the
|
||||
stream is closed. When you're done building the event, AEStreamCloseStream
|
||||
will reconstitute it.
|
||||
*/
|
||||
/*
|
||||
* AEStreamOpenEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AEStreamRef )
|
||||
AEStreamOpenEvent(AppleEvent * event);
|
||||
|
||||
|
||||
/* Mark a keyword as being an optional parameter.*/
|
||||
/*
|
||||
* AEStreamOptionalParam()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEStreamOptionalParam(
|
||||
AEStreamRef ref,
|
||||
AEKeyword key);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AEHELPERS__ */
|
||||
|
||||
@@ -0,0 +1,414 @@
|
||||
/*
|
||||
File: AEInteraction.h
|
||||
|
||||
Contains: AppleEvent functions that deal with Events and interacting with user
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __AEINTERACTION__
|
||||
#define __AEINTERACTION__
|
||||
|
||||
#ifndef __AEDATAMODEL__
|
||||
#include <AEDataModel.h>
|
||||
#endif
|
||||
|
||||
#ifndef __NOTIFICATION__
|
||||
#include <Notification.h>
|
||||
#endif
|
||||
|
||||
#ifndef __EVENTS__
|
||||
#include <Events.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
AppleEvent callbacks.
|
||||
**************************************************************************/
|
||||
typedef CALLBACK_API( Boolean , AEIdleProcPtr )(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn);
|
||||
typedef CALLBACK_API( Boolean , AEFilterProcPtr )(EventRecord *theEvent, long returnID, long transactionID, const AEAddressDesc *sender);
|
||||
typedef STACK_UPP_TYPE(AEIdleProcPtr) AEIdleUPP;
|
||||
typedef STACK_UPP_TYPE(AEFilterProcPtr) AEFilterUPP;
|
||||
|
||||
/**************************************************************************
|
||||
The next couple of calls are basic routines used to create, send,
|
||||
and process AppleEvents.
|
||||
**************************************************************************/
|
||||
/*
|
||||
* AESend()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AESend(
|
||||
const AppleEvent * theAppleEvent,
|
||||
AppleEvent * reply,
|
||||
AESendMode sendMode,
|
||||
AESendPriority sendPriority,
|
||||
long timeOutInTicks,
|
||||
AEIdleUPP idleProc, /* can be NULL */
|
||||
AEFilterUPP filterProc) /* can be NULL */ THREEWORDINLINE(0x303C, 0x0D17, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEProcessAppleEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEProcessAppleEvent(const EventRecord * theEventRecord) THREEWORDINLINE(0x303C, 0x021B, 0xA816);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Note: during event processing, an event handler may realize that it is likely
|
||||
to exceed the client's timeout limit. Passing the reply to this
|
||||
routine causes a wait event to be generated that asks the client
|
||||
for more time.
|
||||
*/
|
||||
/*
|
||||
* AEResetTimer()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEResetTimer(const AppleEvent * reply) THREEWORDINLINE(0x303C, 0x0219, 0xA816);
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
The following three calls are used to allow applications to behave
|
||||
courteously when a user interaction such as a dialog box is needed.
|
||||
**************************************************************************/
|
||||
|
||||
typedef SInt8 AEInteractAllowed;
|
||||
enum {
|
||||
kAEInteractWithSelf = 0,
|
||||
kAEInteractWithLocal = 1,
|
||||
kAEInteractWithAll = 2
|
||||
};
|
||||
|
||||
/*
|
||||
* AEGetInteractionAllowed()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEGetInteractionAllowed(AEInteractAllowed * level) THREEWORDINLINE(0x303C, 0x021D, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AESetInteractionAllowed()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AESetInteractionAllowed(AEInteractAllowed level) THREEWORDINLINE(0x303C, 0x011E, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEInteractWithUser()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEInteractWithUser(
|
||||
long timeOutInTicks,
|
||||
NMRecPtr nmReqPtr,
|
||||
AEIdleUPP idleProc) THREEWORDINLINE(0x303C, 0x061C, 0xA816);
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
The following four calls are available for applications which need more
|
||||
sophisticated control over when and how events are processed. Applications
|
||||
which implement multi-session servers or which implement their own
|
||||
internal event queueing will probably be the major clients of these
|
||||
routines. They can be called from within a handler to prevent the AEM from
|
||||
disposing of the AppleEvent when the handler returns. They can be used to
|
||||
asynchronously process the event (as MacApp does).
|
||||
**************************************************************************/
|
||||
/*
|
||||
* AESuspendTheCurrentEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AESuspendTheCurrentEvent(const AppleEvent * theAppleEvent) THREEWORDINLINE(0x303C, 0x022B, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
Note: The following routine tells the AppleEvent manager that processing
|
||||
is either about to resume or has been completed on a previously suspended
|
||||
event. The procPtr passed in as the dispatcher parameter will be called to
|
||||
attempt to redispatch the event. Several constants for the dispatcher
|
||||
parameter allow special behavior. They are:
|
||||
- kAEUseStandardDispatch means redispatch as if the event was just
|
||||
received, using the standard AppleEvent dispatch mechanism.
|
||||
- kAENoDispatch means ignore the parameter.
|
||||
Use this in the case where the event has been handled and no
|
||||
redispatch is needed.
|
||||
- non nil means call the routine which the dispatcher points to.
|
||||
*/
|
||||
/* Constants for Refcon in AEResumeTheCurrentEvent with kAEUseStandardDispatch */
|
||||
enum {
|
||||
kAEDoNotIgnoreHandler = 0x00000000,
|
||||
kAEIgnoreAppPhacHandler = 0x00000001, /* available only in vers 1.0.1 and greater */
|
||||
kAEIgnoreAppEventHandler = 0x00000002, /* available only in vers 1.0.1 and greater */
|
||||
kAEIgnoreSysPhacHandler = 0x00000004, /* available only in vers 1.0.1 and greater */
|
||||
kAEIgnoreSysEventHandler = 0x00000008, /* available only in vers 1.0.1 and greater */
|
||||
kAEIngoreBuiltInEventHandler = 0x00000010, /* available only in vers 1.0.1 and greater */
|
||||
kAEDontDisposeOnResume = (long)0x80000000 /* available only in vers 1.0.1 and greater */
|
||||
};
|
||||
|
||||
/* Constants for AEResumeTheCurrentEvent */
|
||||
enum {
|
||||
kAENoDispatch = 0, /* dispatch parameter to AEResumeTheCurrentEvent takes a pointer to a dispatch */
|
||||
kAEUseStandardDispatch = (long)0xFFFFFFFF /* table, or one of these two constants */
|
||||
};
|
||||
|
||||
/*
|
||||
* AEResumeTheCurrentEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEResumeTheCurrentEvent(
|
||||
const AppleEvent * theAppleEvent,
|
||||
const AppleEvent * reply,
|
||||
AEEventHandlerUPP dispatcher, /* can be NULL */
|
||||
long handlerRefcon) THREEWORDINLINE(0x303C, 0x0818, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEGetTheCurrentEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEGetTheCurrentEvent(AppleEvent * theAppleEvent) THREEWORDINLINE(0x303C, 0x021A, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AESetTheCurrentEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AESetTheCurrentEvent(const AppleEvent * theAppleEvent) THREEWORDINLINE(0x303C, 0x022C, 0xA816);
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
AppleEvent callbacks.
|
||||
**************************************************************************/
|
||||
/*
|
||||
* NewAEIdleUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AEIdleUPP )
|
||||
NewAEIdleUPP(AEIdleProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppAEIdleProcInfo = 0x00000FD0 }; /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(AEIdleUPP) NewAEIdleUPP(AEIdleProcPtr userRoutine) { return (AEIdleUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAEIdleProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewAEIdleUPP(userRoutine) (AEIdleUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAEIdleProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewAEFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AEFilterUPP )
|
||||
NewAEFilterUPP(AEFilterProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppAEFilterProcInfo = 0x00003FD0 }; /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(AEFilterUPP) NewAEFilterUPP(AEFilterProcPtr userRoutine) { return (AEFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAEFilterProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewAEFilterUPP(userRoutine) (AEFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAEFilterProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeAEIdleUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeAEIdleUPP(AEIdleUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeAEIdleUPP(AEIdleUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeAEIdleUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeAEFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeAEFilterUPP(AEFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeAEFilterUPP(AEFilterUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeAEFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeAEIdleUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
InvokeAEIdleUPP(
|
||||
EventRecord * theEvent,
|
||||
long * sleepTime,
|
||||
RgnHandle * mouseRgn,
|
||||
AEIdleUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(Boolean) InvokeAEIdleUPP(EventRecord * theEvent, long * sleepTime, RgnHandle * mouseRgn, AEIdleUPP userUPP) { return (Boolean)CALL_THREE_PARAMETER_UPP(userUPP, uppAEIdleProcInfo, theEvent, sleepTime, mouseRgn); }
|
||||
#else
|
||||
#define InvokeAEIdleUPP(theEvent, sleepTime, mouseRgn, userUPP) (Boolean)CALL_THREE_PARAMETER_UPP((userUPP), uppAEIdleProcInfo, (theEvent), (sleepTime), (mouseRgn))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeAEFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
InvokeAEFilterUPP(
|
||||
EventRecord * theEvent,
|
||||
long returnID,
|
||||
long transactionID,
|
||||
const AEAddressDesc * sender,
|
||||
AEFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(Boolean) InvokeAEFilterUPP(EventRecord * theEvent, long returnID, long transactionID, const AEAddressDesc * sender, AEFilterUPP userUPP) { return (Boolean)CALL_FOUR_PARAMETER_UPP(userUPP, uppAEFilterProcInfo, theEvent, returnID, transactionID, sender); }
|
||||
#else
|
||||
#define InvokeAEFilterUPP(theEvent, returnID, transactionID, sender, userUPP) (Boolean)CALL_FOUR_PARAMETER_UPP((userUPP), uppAEFilterProcInfo, (theEvent), (returnID), (transactionID), (sender))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewAEIdleProc(userRoutine) NewAEIdleUPP(userRoutine)
|
||||
#define NewAEFilterProc(userRoutine) NewAEFilterUPP(userRoutine)
|
||||
#define CallAEIdleProc(userRoutine, theEvent, sleepTime, mouseRgn) InvokeAEIdleUPP(theEvent, sleepTime, mouseRgn, userRoutine)
|
||||
#define CallAEFilterProc(userRoutine, theEvent, returnID, transactionID, sender) InvokeAEFilterUPP(theEvent, returnID, transactionID, sender, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AEINTERACTION__ */
|
||||
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
File: AEMach.h
|
||||
|
||||
Contains: AppleEvent over mach_msg interfaces
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __AEMACH__
|
||||
#define __AEMACH__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MIXEDMODE__
|
||||
#include <MixedMode.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEDATAMODEL__
|
||||
#include <AEDataModel.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
/*-
|
||||
* AE Mach API --
|
||||
*
|
||||
* AppleEvents on OS X are implemented in terms of mach messages.
|
||||
* To facilitate writing server processes that can send and receive
|
||||
* AppleEvents, the following APIs are provided.
|
||||
*
|
||||
* AppleEvents are directed to a well known port uniquely tied to a
|
||||
* process. The AE framework will discover this port based on the
|
||||
* keyAddressAttr of the event (as specifed in AECreateAppleEvent by
|
||||
* the target parameter.) If a port cannot be found,
|
||||
* procNotFound (-600) will be returned on AESend.
|
||||
*
|
||||
* Of note is a new attribute for an AppleEvent, keyReplyPortAttr.
|
||||
* This specifies the mach_port_t to which an AppleEvent reply
|
||||
* should be directed. By default, replies are sent to the
|
||||
* processes registered port where they are culled from the normal
|
||||
* event stream if there is an outstanding AESend + kAEWaitReply.
|
||||
* But it may be desirable for a client to specify their own port to
|
||||
* receive quued replies.
|
||||
* (In the case of AESendMessage with kAEWaitReply specified, an
|
||||
* anonymous port will be used to block until the reply is received.)
|
||||
*
|
||||
* Not supplied is a convenience routine to block a server and
|
||||
* process AppleEvents. This implementation will be detailed in a
|
||||
* tech note.
|
||||
**/
|
||||
enum {
|
||||
keyReplyPortAttr = FOUR_CHAR_CODE('repp')
|
||||
};
|
||||
|
||||
/* typeReplyPortAttr was misnamed and is deprecated; use keyReplyPortAttr instead. */
|
||||
enum {
|
||||
typeReplyPortAttr = keyReplyPortAttr
|
||||
};
|
||||
|
||||
/*-
|
||||
* Return the mach_port_t that was registered with the bootstrap
|
||||
* server for this process. This port is considered public, and
|
||||
* will be used by other applications to target your process. You
|
||||
* are free to use this mach_port_t to add to a port set, if and
|
||||
* only if, you are not also using routines from HIToolbox. In that
|
||||
* case, HIToolbox retains control of this port and AppleEvents are
|
||||
* dispatched through the main event loop.
|
||||
**/
|
||||
/*
|
||||
* AEGetRegisteredMachPort()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( mach_port_t )
|
||||
AEGetRegisteredMachPort(void);
|
||||
|
||||
|
||||
/*-
|
||||
* Decode a mach_msg into an AppleEvent and its related reply. (The
|
||||
* reply is set up from fields of the event.) You can call this
|
||||
* routine if you wish to dispatch or handle the event yourself. To
|
||||
* return a reply to the sender, you should call:
|
||||
*
|
||||
* AESendMessage(reply, NULL, kAENoReply, kAENormalPriority, kAEDefaultTimeout);
|
||||
*
|
||||
* The contents of the header are invalid after this call.
|
||||
**/
|
||||
/*
|
||||
* AEDecodeMessage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEDecodeMessage(
|
||||
mach_msg_header_t * header,
|
||||
AppleEvent * event,
|
||||
AppleEvent * reply); /* can be NULL */
|
||||
|
||||
|
||||
/*-
|
||||
* Decodes and dispatches an event to an event handler. Handles
|
||||
* packaging and returning the reply to the sender.
|
||||
*
|
||||
* The contents of the header are invalid after this call.
|
||||
**/
|
||||
/*
|
||||
* AEProcessMessage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AEProcessMessage(mach_msg_header_t * header);
|
||||
|
||||
|
||||
/*-
|
||||
* Send an AppleEvent to a target process. If the target is the
|
||||
* current process (as specified by using typeProcessSerialNumber of
|
||||
* { 0, kCurrentProcess } it is dispatched directly to the
|
||||
* appropriate event handler in your process and not serialized.
|
||||
**/
|
||||
/*
|
||||
* AESendMessage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AESendMessage(
|
||||
const AppleEvent * event,
|
||||
AppleEvent * reply, /* can be NULL */
|
||||
AESendMode sendMode,
|
||||
long timeOutInTicks);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AEMACH__ */
|
||||
|
||||
@@ -0,0 +1,821 @@
|
||||
/*
|
||||
File: AEObjects.h
|
||||
|
||||
Contains: Object Support Library Interfaces.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1991-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __AEOBJECTS__
|
||||
#define __AEOBJECTS__
|
||||
|
||||
#ifndef __MACERRORS__
|
||||
#include <MacErrors.h>
|
||||
#endif
|
||||
|
||||
#ifndef __OSUTILS__
|
||||
#include <OSUtils.h>
|
||||
#endif
|
||||
|
||||
#ifndef __APPLEEVENTS__
|
||||
#include <AppleEvents.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
enum {
|
||||
/**** LOGICAL OPERATOR CONSTANTS ****/
|
||||
kAEAND = FOUR_CHAR_CODE('AND '), /* 0x414e4420 */
|
||||
kAEOR = FOUR_CHAR_CODE('OR '), /* 0x4f522020 */
|
||||
kAENOT = FOUR_CHAR_CODE('NOT '), /* 0x4e4f5420 */
|
||||
/**** ABSOLUTE ORDINAL CONSTANTS ****/
|
||||
kAEFirst = FOUR_CHAR_CODE('firs'), /* 0x66697273 */
|
||||
kAELast = FOUR_CHAR_CODE('last'), /* 0x6c617374 */
|
||||
kAEMiddle = FOUR_CHAR_CODE('midd'), /* 0x6d696464 */
|
||||
kAEAny = FOUR_CHAR_CODE('any '), /* 0x616e7920 */
|
||||
kAEAll = FOUR_CHAR_CODE('all '), /* 0x616c6c20 */
|
||||
/**** RELATIVE ORDINAL CONSTANTS ****/
|
||||
kAENext = FOUR_CHAR_CODE('next'), /* 0x6e657874 */
|
||||
kAEPrevious = FOUR_CHAR_CODE('prev'), /* 0x70726576 */
|
||||
/**** KEYWORD CONSTANT ****/
|
||||
keyAECompOperator = FOUR_CHAR_CODE('relo'), /* 0x72656c6f */
|
||||
keyAELogicalTerms = FOUR_CHAR_CODE('term'), /* 0x7465726d */
|
||||
keyAELogicalOperator = FOUR_CHAR_CODE('logc'), /* 0x6c6f6763 */
|
||||
keyAEObject1 = FOUR_CHAR_CODE('obj1'), /* 0x6f626a31 */
|
||||
keyAEObject2 = FOUR_CHAR_CODE('obj2'), /* 0x6f626a32 */
|
||||
/* ... for Keywords for getting fields out of object specifier records. */
|
||||
keyAEDesiredClass = FOUR_CHAR_CODE('want'), /* 0x77616e74 */
|
||||
keyAEContainer = FOUR_CHAR_CODE('from'), /* 0x66726f6d */
|
||||
keyAEKeyForm = FOUR_CHAR_CODE('form'), /* 0x666f726d */
|
||||
keyAEKeyData = FOUR_CHAR_CODE('seld') /* 0x73656c64 */
|
||||
};
|
||||
|
||||
enum {
|
||||
/* ... for Keywords for getting fields out of Range specifier records. */
|
||||
keyAERangeStart = FOUR_CHAR_CODE('star'), /* 0x73746172 */
|
||||
keyAERangeStop = FOUR_CHAR_CODE('stop'), /* 0x73746f70 */
|
||||
/* ... special handler selectors for OSL Callbacks. */
|
||||
keyDisposeTokenProc = FOUR_CHAR_CODE('xtok'), /* 0x78746f6b */
|
||||
keyAECompareProc = FOUR_CHAR_CODE('cmpr'), /* 0x636d7072 */
|
||||
keyAECountProc = FOUR_CHAR_CODE('cont'), /* 0x636f6e74 */
|
||||
keyAEMarkTokenProc = FOUR_CHAR_CODE('mkid'), /* 0x6d6b6964 */
|
||||
keyAEMarkProc = FOUR_CHAR_CODE('mark'), /* 0x6d61726b */
|
||||
keyAEAdjustMarksProc = FOUR_CHAR_CODE('adjm'), /* 0x61646a6d */
|
||||
keyAEGetErrDescProc = FOUR_CHAR_CODE('indc') /* 0x696e6463 */
|
||||
};
|
||||
|
||||
/**** VALUE and TYPE CONSTANTS ****/
|
||||
enum {
|
||||
/* ... possible values for the keyAEKeyForm field of an object specifier. */
|
||||
formAbsolutePosition = FOUR_CHAR_CODE('indx'), /* 0x696e6478 */
|
||||
formRelativePosition = FOUR_CHAR_CODE('rele'), /* 0x72656c65 */
|
||||
formTest = FOUR_CHAR_CODE('test'), /* 0x74657374 */
|
||||
formRange = FOUR_CHAR_CODE('rang'), /* 0x72616e67 */
|
||||
formPropertyID = FOUR_CHAR_CODE('prop'), /* 0x70726f70 */
|
||||
formName = FOUR_CHAR_CODE('name'), /* 0x6e616d65 */
|
||||
/* ... relevant types (some of these are often pared with forms above). */
|
||||
typeObjectSpecifier = FOUR_CHAR_CODE('obj '), /* 0x6f626a20 */
|
||||
typeObjectBeingExamined = FOUR_CHAR_CODE('exmn'), /* 0x65786d6e */
|
||||
typeCurrentContainer = FOUR_CHAR_CODE('ccnt'), /* 0x63636e74 */
|
||||
typeToken = FOUR_CHAR_CODE('toke'), /* 0x746f6b65 */
|
||||
typeRelativeDescriptor = FOUR_CHAR_CODE('rel '), /* 0x72656c20 */
|
||||
typeAbsoluteOrdinal = FOUR_CHAR_CODE('abso'), /* 0x6162736f */
|
||||
typeIndexDescriptor = FOUR_CHAR_CODE('inde'), /* 0x696e6465 */
|
||||
typeRangeDescriptor = FOUR_CHAR_CODE('rang'), /* 0x72616e67 */
|
||||
typeLogicalDescriptor = FOUR_CHAR_CODE('logi'), /* 0x6c6f6769 */
|
||||
typeCompDescriptor = FOUR_CHAR_CODE('cmpd'), /* 0x636d7064 */
|
||||
typeOSLTokenList = FOUR_CHAR_CODE('ostl') /* 0x6F73746C */
|
||||
};
|
||||
|
||||
/* Possible values for flags parameter to AEResolve. They're additive */
|
||||
enum {
|
||||
kAEIDoMinimum = 0x0000,
|
||||
kAEIDoWhose = 0x0001,
|
||||
kAEIDoMarking = 0x0004,
|
||||
kAEPassSubDescs = 0x0008,
|
||||
kAEResolveNestedLists = 0x0010,
|
||||
kAEHandleSimpleRanges = 0x0020,
|
||||
kAEUseRelativeIterators = 0x0040
|
||||
};
|
||||
|
||||
/**** SPECIAL CONSTANTS FOR CUSTOM WHOSE-CLAUSE RESOLUTION */
|
||||
enum {
|
||||
typeWhoseDescriptor = FOUR_CHAR_CODE('whos'), /* 0x77686f73 */
|
||||
formWhose = FOUR_CHAR_CODE('whos'), /* 0x77686f73 */
|
||||
typeWhoseRange = FOUR_CHAR_CODE('wrng'), /* 0x77726e67 */
|
||||
keyAEWhoseRangeStart = FOUR_CHAR_CODE('wstr'), /* 0x77737472 */
|
||||
keyAEWhoseRangeStop = FOUR_CHAR_CODE('wstp'), /* 0x77737470 */
|
||||
keyAEIndex = FOUR_CHAR_CODE('kidx'), /* 0x6b696478 */
|
||||
keyAETest = FOUR_CHAR_CODE('ktst') /* 0x6b747374 */
|
||||
};
|
||||
|
||||
/*
|
||||
used for rewriting tokens in place of 'ccnt' descriptors
|
||||
This record is only of interest to those who, when they...
|
||||
...get ranges as key data in their accessor procs, choose
|
||||
...to resolve them manually rather than call AEResolve again.
|
||||
*/
|
||||
struct ccntTokenRecord {
|
||||
DescType tokenClass;
|
||||
AEDesc token;
|
||||
};
|
||||
typedef struct ccntTokenRecord ccntTokenRecord;
|
||||
typedef ccntTokenRecord * ccntTokenRecPtr;
|
||||
typedef ccntTokenRecPtr * ccntTokenRecHandle;
|
||||
#if OLDROUTINENAMES
|
||||
typedef AEDesc * DescPtr;
|
||||
typedef DescPtr * DescHandle;
|
||||
#endif /* OLDROUTINENAMES */
|
||||
|
||||
/* typedefs providing type checking for procedure pointers */
|
||||
typedef CALLBACK_API( OSErr , OSLAccessorProcPtr )(DescType desiredClass, const AEDesc *container, DescType containerClass, DescType form, const AEDesc *selectionData, AEDesc *value, long accessorRefcon);
|
||||
typedef CALLBACK_API( OSErr , OSLCompareProcPtr )(DescType oper, const AEDesc *obj1, const AEDesc *obj2, Boolean *result);
|
||||
typedef CALLBACK_API( OSErr , OSLCountProcPtr )(DescType desiredType, DescType containerClass, const AEDesc *container, long *result);
|
||||
typedef CALLBACK_API( OSErr , OSLDisposeTokenProcPtr )(AEDesc * unneededToken);
|
||||
typedef CALLBACK_API( OSErr , OSLGetMarkTokenProcPtr )(const AEDesc *dContainerToken, DescType containerClass, AEDesc *result);
|
||||
typedef CALLBACK_API( OSErr , OSLGetErrDescProcPtr )(AEDesc ** appDescPtr);
|
||||
typedef CALLBACK_API( OSErr , OSLMarkProcPtr )(const AEDesc *dToken, const AEDesc *markToken, long index);
|
||||
typedef CALLBACK_API( OSErr , OSLAdjustMarksProcPtr )(long newStart, long newStop, const AEDesc *markToken);
|
||||
typedef STACK_UPP_TYPE(OSLAccessorProcPtr) OSLAccessorUPP;
|
||||
typedef STACK_UPP_TYPE(OSLCompareProcPtr) OSLCompareUPP;
|
||||
typedef STACK_UPP_TYPE(OSLCountProcPtr) OSLCountUPP;
|
||||
typedef STACK_UPP_TYPE(OSLDisposeTokenProcPtr) OSLDisposeTokenUPP;
|
||||
typedef STACK_UPP_TYPE(OSLGetMarkTokenProcPtr) OSLGetMarkTokenUPP;
|
||||
typedef STACK_UPP_TYPE(OSLGetErrDescProcPtr) OSLGetErrDescUPP;
|
||||
typedef STACK_UPP_TYPE(OSLMarkProcPtr) OSLMarkUPP;
|
||||
typedef STACK_UPP_TYPE(OSLAdjustMarksProcPtr) OSLAdjustMarksUPP;
|
||||
/*
|
||||
* NewOSLAccessorUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSLAccessorUPP )
|
||||
NewOSLAccessorUPP(OSLAccessorProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOSLAccessorProcInfo = 0x000FFFE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSLAccessorUPP) NewOSLAccessorUPP(OSLAccessorProcPtr userRoutine) { return (OSLAccessorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLAccessorProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOSLAccessorUPP(userRoutine) (OSLAccessorUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLAccessorProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewOSLCompareUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSLCompareUPP )
|
||||
NewOSLCompareUPP(OSLCompareProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOSLCompareProcInfo = 0x00003FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSLCompareUPP) NewOSLCompareUPP(OSLCompareProcPtr userRoutine) { return (OSLCompareUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLCompareProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOSLCompareUPP(userRoutine) (OSLCompareUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLCompareProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewOSLCountUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSLCountUPP )
|
||||
NewOSLCountUPP(OSLCountProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOSLCountProcInfo = 0x00003FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSLCountUPP) NewOSLCountUPP(OSLCountProcPtr userRoutine) { return (OSLCountUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLCountProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOSLCountUPP(userRoutine) (OSLCountUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLCountProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewOSLDisposeTokenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSLDisposeTokenUPP )
|
||||
NewOSLDisposeTokenUPP(OSLDisposeTokenProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOSLDisposeTokenProcInfo = 0x000000E0 }; /* pascal 2_bytes Func(4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSLDisposeTokenUPP) NewOSLDisposeTokenUPP(OSLDisposeTokenProcPtr userRoutine) { return (OSLDisposeTokenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLDisposeTokenProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOSLDisposeTokenUPP(userRoutine) (OSLDisposeTokenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLDisposeTokenProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewOSLGetMarkTokenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSLGetMarkTokenUPP )
|
||||
NewOSLGetMarkTokenUPP(OSLGetMarkTokenProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOSLGetMarkTokenProcInfo = 0x00000FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSLGetMarkTokenUPP) NewOSLGetMarkTokenUPP(OSLGetMarkTokenProcPtr userRoutine) { return (OSLGetMarkTokenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLGetMarkTokenProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOSLGetMarkTokenUPP(userRoutine) (OSLGetMarkTokenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLGetMarkTokenProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewOSLGetErrDescUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSLGetErrDescUPP )
|
||||
NewOSLGetErrDescUPP(OSLGetErrDescProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOSLGetErrDescProcInfo = 0x000000E0 }; /* pascal 2_bytes Func(4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSLGetErrDescUPP) NewOSLGetErrDescUPP(OSLGetErrDescProcPtr userRoutine) { return (OSLGetErrDescUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLGetErrDescProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOSLGetErrDescUPP(userRoutine) (OSLGetErrDescUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLGetErrDescProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewOSLMarkUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSLMarkUPP )
|
||||
NewOSLMarkUPP(OSLMarkProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOSLMarkProcInfo = 0x00000FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSLMarkUPP) NewOSLMarkUPP(OSLMarkProcPtr userRoutine) { return (OSLMarkUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLMarkProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOSLMarkUPP(userRoutine) (OSLMarkUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLMarkProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewOSLAdjustMarksUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSLAdjustMarksUPP )
|
||||
NewOSLAdjustMarksUPP(OSLAdjustMarksProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOSLAdjustMarksProcInfo = 0x00000FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSLAdjustMarksUPP) NewOSLAdjustMarksUPP(OSLAdjustMarksProcPtr userRoutine) { return (OSLAdjustMarksUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLAdjustMarksProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOSLAdjustMarksUPP(userRoutine) (OSLAdjustMarksUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOSLAdjustMarksProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOSLAccessorUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOSLAccessorUPP(OSLAccessorUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOSLAccessorUPP(OSLAccessorUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOSLAccessorUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOSLCompareUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOSLCompareUPP(OSLCompareUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOSLCompareUPP(OSLCompareUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOSLCompareUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOSLCountUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOSLCountUPP(OSLCountUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOSLCountUPP(OSLCountUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOSLCountUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOSLDisposeTokenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOSLDisposeTokenUPP(OSLDisposeTokenUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOSLDisposeTokenUPP(OSLDisposeTokenUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOSLDisposeTokenUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOSLGetMarkTokenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOSLGetMarkTokenUPP(OSLGetMarkTokenUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOSLGetMarkTokenUPP(OSLGetMarkTokenUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOSLGetMarkTokenUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOSLGetErrDescUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOSLGetErrDescUPP(OSLGetErrDescUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOSLGetErrDescUPP(OSLGetErrDescUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOSLGetErrDescUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOSLMarkUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOSLMarkUPP(OSLMarkUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOSLMarkUPP(OSLMarkUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOSLMarkUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOSLAdjustMarksUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOSLAdjustMarksUPP(OSLAdjustMarksUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOSLAdjustMarksUPP(OSLAdjustMarksUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOSLAdjustMarksUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOSLAccessorUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOSLAccessorUPP(
|
||||
DescType desiredClass,
|
||||
const AEDesc * container,
|
||||
DescType containerClass,
|
||||
DescType form,
|
||||
const AEDesc * selectionData,
|
||||
AEDesc * value,
|
||||
long accessorRefcon,
|
||||
OSLAccessorUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOSLAccessorUPP(DescType desiredClass, const AEDesc * container, DescType containerClass, DescType form, const AEDesc * selectionData, AEDesc * value, long accessorRefcon, OSLAccessorUPP userUPP) { return (OSErr)CALL_SEVEN_PARAMETER_UPP(userUPP, uppOSLAccessorProcInfo, desiredClass, container, containerClass, form, selectionData, value, accessorRefcon); }
|
||||
#else
|
||||
#define InvokeOSLAccessorUPP(desiredClass, container, containerClass, form, selectionData, value, accessorRefcon, userUPP) (OSErr)CALL_SEVEN_PARAMETER_UPP((userUPP), uppOSLAccessorProcInfo, (desiredClass), (container), (containerClass), (form), (selectionData), (value), (accessorRefcon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOSLCompareUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOSLCompareUPP(
|
||||
DescType oper,
|
||||
const AEDesc * obj1,
|
||||
const AEDesc * obj2,
|
||||
Boolean * result,
|
||||
OSLCompareUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOSLCompareUPP(DescType oper, const AEDesc * obj1, const AEDesc * obj2, Boolean * result, OSLCompareUPP userUPP) { return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppOSLCompareProcInfo, oper, obj1, obj2, result); }
|
||||
#else
|
||||
#define InvokeOSLCompareUPP(oper, obj1, obj2, result, userUPP) (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppOSLCompareProcInfo, (oper), (obj1), (obj2), (result))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOSLCountUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOSLCountUPP(
|
||||
DescType desiredType,
|
||||
DescType containerClass,
|
||||
const AEDesc * container,
|
||||
long * result,
|
||||
OSLCountUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOSLCountUPP(DescType desiredType, DescType containerClass, const AEDesc * container, long * result, OSLCountUPP userUPP) { return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppOSLCountProcInfo, desiredType, containerClass, container, result); }
|
||||
#else
|
||||
#define InvokeOSLCountUPP(desiredType, containerClass, container, result, userUPP) (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppOSLCountProcInfo, (desiredType), (containerClass), (container), (result))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOSLDisposeTokenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOSLDisposeTokenUPP(
|
||||
AEDesc * unneededToken,
|
||||
OSLDisposeTokenUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOSLDisposeTokenUPP(AEDesc * unneededToken, OSLDisposeTokenUPP userUPP) { return (OSErr)CALL_ONE_PARAMETER_UPP(userUPP, uppOSLDisposeTokenProcInfo, unneededToken); }
|
||||
#else
|
||||
#define InvokeOSLDisposeTokenUPP(unneededToken, userUPP) (OSErr)CALL_ONE_PARAMETER_UPP((userUPP), uppOSLDisposeTokenProcInfo, (unneededToken))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOSLGetMarkTokenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOSLGetMarkTokenUPP(
|
||||
const AEDesc * dContainerToken,
|
||||
DescType containerClass,
|
||||
AEDesc * result,
|
||||
OSLGetMarkTokenUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOSLGetMarkTokenUPP(const AEDesc * dContainerToken, DescType containerClass, AEDesc * result, OSLGetMarkTokenUPP userUPP) { return (OSErr)CALL_THREE_PARAMETER_UPP(userUPP, uppOSLGetMarkTokenProcInfo, dContainerToken, containerClass, result); }
|
||||
#else
|
||||
#define InvokeOSLGetMarkTokenUPP(dContainerToken, containerClass, result, userUPP) (OSErr)CALL_THREE_PARAMETER_UPP((userUPP), uppOSLGetMarkTokenProcInfo, (dContainerToken), (containerClass), (result))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOSLGetErrDescUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOSLGetErrDescUPP(
|
||||
AEDesc ** appDescPtr,
|
||||
OSLGetErrDescUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOSLGetErrDescUPP(AEDesc ** appDescPtr, OSLGetErrDescUPP userUPP) { return (OSErr)CALL_ONE_PARAMETER_UPP(userUPP, uppOSLGetErrDescProcInfo, appDescPtr); }
|
||||
#else
|
||||
#define InvokeOSLGetErrDescUPP(appDescPtr, userUPP) (OSErr)CALL_ONE_PARAMETER_UPP((userUPP), uppOSLGetErrDescProcInfo, (appDescPtr))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOSLMarkUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOSLMarkUPP(
|
||||
const AEDesc * dToken,
|
||||
const AEDesc * markToken,
|
||||
long index,
|
||||
OSLMarkUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOSLMarkUPP(const AEDesc * dToken, const AEDesc * markToken, long index, OSLMarkUPP userUPP) { return (OSErr)CALL_THREE_PARAMETER_UPP(userUPP, uppOSLMarkProcInfo, dToken, markToken, index); }
|
||||
#else
|
||||
#define InvokeOSLMarkUPP(dToken, markToken, index, userUPP) (OSErr)CALL_THREE_PARAMETER_UPP((userUPP), uppOSLMarkProcInfo, (dToken), (markToken), (index))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOSLAdjustMarksUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOSLAdjustMarksUPP(
|
||||
long newStart,
|
||||
long newStop,
|
||||
const AEDesc * markToken,
|
||||
OSLAdjustMarksUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOSLAdjustMarksUPP(long newStart, long newStop, const AEDesc * markToken, OSLAdjustMarksUPP userUPP) { return (OSErr)CALL_THREE_PARAMETER_UPP(userUPP, uppOSLAdjustMarksProcInfo, newStart, newStop, markToken); }
|
||||
#else
|
||||
#define InvokeOSLAdjustMarksUPP(newStart, newStop, markToken, userUPP) (OSErr)CALL_THREE_PARAMETER_UPP((userUPP), uppOSLAdjustMarksProcInfo, (newStart), (newStop), (markToken))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewOSLAccessorProc(userRoutine) NewOSLAccessorUPP(userRoutine)
|
||||
#define NewOSLCompareProc(userRoutine) NewOSLCompareUPP(userRoutine)
|
||||
#define NewOSLCountProc(userRoutine) NewOSLCountUPP(userRoutine)
|
||||
#define NewOSLDisposeTokenProc(userRoutine) NewOSLDisposeTokenUPP(userRoutine)
|
||||
#define NewOSLGetMarkTokenProc(userRoutine) NewOSLGetMarkTokenUPP(userRoutine)
|
||||
#define NewOSLGetErrDescProc(userRoutine) NewOSLGetErrDescUPP(userRoutine)
|
||||
#define NewOSLMarkProc(userRoutine) NewOSLMarkUPP(userRoutine)
|
||||
#define NewOSLAdjustMarksProc(userRoutine) NewOSLAdjustMarksUPP(userRoutine)
|
||||
#define CallOSLAccessorProc(userRoutine, desiredClass, container, containerClass, form, selectionData, value, accessorRefcon) InvokeOSLAccessorUPP(desiredClass, container, containerClass, form, selectionData, value, accessorRefcon, userRoutine)
|
||||
#define CallOSLCompareProc(userRoutine, oper, obj1, obj2, result) InvokeOSLCompareUPP(oper, obj1, obj2, result, userRoutine)
|
||||
#define CallOSLCountProc(userRoutine, desiredType, containerClass, container, result) InvokeOSLCountUPP(desiredType, containerClass, container, result, userRoutine)
|
||||
#define CallOSLDisposeTokenProc(userRoutine, unneededToken) InvokeOSLDisposeTokenUPP(unneededToken, userRoutine)
|
||||
#define CallOSLGetMarkTokenProc(userRoutine, dContainerToken, containerClass, result) InvokeOSLGetMarkTokenUPP(dContainerToken, containerClass, result, userRoutine)
|
||||
#define CallOSLGetErrDescProc(userRoutine, appDescPtr) InvokeOSLGetErrDescUPP(appDescPtr, userRoutine)
|
||||
#define CallOSLMarkProc(userRoutine, dToken, markToken, index) InvokeOSLMarkUPP(dToken, markToken, index, userRoutine)
|
||||
#define CallOSLAdjustMarksProc(userRoutine, newStart, newStop, markToken) InvokeOSLAdjustMarksUPP(newStart, newStop, markToken, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AEObjectInit()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEObjectInit(void);
|
||||
|
||||
|
||||
/* Not done by inline, but by direct linking into code. It sets up the pack
|
||||
such that further calls can be via inline */
|
||||
/*
|
||||
* AESetObjectCallbacks()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AESetObjectCallbacks(
|
||||
OSLCompareUPP myCompareProc,
|
||||
OSLCountUPP myCountProc,
|
||||
OSLDisposeTokenUPP myDisposeTokenProc,
|
||||
OSLGetMarkTokenUPP myGetMarkTokenProc,
|
||||
OSLMarkUPP myMarkProc,
|
||||
OSLAdjustMarksUPP myAdjustMarksProc,
|
||||
OSLGetErrDescUPP myGetErrDescProcPtr) THREEWORDINLINE(0x303C, 0x0E35, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEResolve()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEResolve(
|
||||
const AEDesc * objectSpecifier,
|
||||
short callbackFlags,
|
||||
AEDesc * theToken) THREEWORDINLINE(0x303C, 0x0536, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEInstallObjectAccessor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEInstallObjectAccessor(
|
||||
DescType desiredClass,
|
||||
DescType containerType,
|
||||
OSLAccessorUPP theAccessor,
|
||||
long accessorRefcon,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0937, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AERemoveObjectAccessor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AERemoveObjectAccessor(
|
||||
DescType desiredClass,
|
||||
DescType containerType,
|
||||
OSLAccessorUPP theAccessor,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0738, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEGetObjectAccessor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEGetObjectAccessor(
|
||||
DescType desiredClass,
|
||||
DescType containerType,
|
||||
OSLAccessorUPP * accessor,
|
||||
long * accessorRefcon,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0939, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEDisposeToken()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEDisposeToken(AEDesc * theToken) THREEWORDINLINE(0x303C, 0x023A, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AECallObjectAccessor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AECallObjectAccessor(
|
||||
DescType desiredClass,
|
||||
const AEDesc * containerToken,
|
||||
DescType containerClass,
|
||||
DescType keyForm,
|
||||
const AEDesc * keyData,
|
||||
AEDesc * token) THREEWORDINLINE(0x303C, 0x0C3B, 0xA816);
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AEOBJECTS__ */
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
File: AEPackObject.h
|
||||
|
||||
Contains: AppleEvents object packing Interfaces.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1991-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __AEPACKOBJECT__
|
||||
#define __AEPACKOBJECT__
|
||||
|
||||
#ifndef __APPLEEVENTS__
|
||||
#include <AppleEvents.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
/* These are the object packing routines. */
|
||||
/*
|
||||
* CreateOffsetDescriptor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
CreateOffsetDescriptor(
|
||||
long theOffset,
|
||||
AEDesc * theDescriptor);
|
||||
|
||||
|
||||
/*
|
||||
* CreateCompDescriptor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
CreateCompDescriptor(
|
||||
DescType comparisonOperator,
|
||||
AEDesc * operand1,
|
||||
AEDesc * operand2,
|
||||
Boolean disposeInputs,
|
||||
AEDesc * theDescriptor);
|
||||
|
||||
|
||||
/*
|
||||
* CreateLogicalDescriptor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
CreateLogicalDescriptor(
|
||||
AEDescList * theLogicalTerms,
|
||||
DescType theLogicOperator,
|
||||
Boolean disposeInputs,
|
||||
AEDesc * theDescriptor);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* CreateObjSpecifier()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
CreateObjSpecifier(
|
||||
DescType desiredClass,
|
||||
AEDesc * theContainer,
|
||||
DescType keyForm,
|
||||
AEDesc * keyData,
|
||||
Boolean disposeInputs,
|
||||
AEDesc * objSpecifier);
|
||||
|
||||
|
||||
/*
|
||||
* CreateRangeDescriptor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in ObjectSupportLib 1.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
CreateRangeDescriptor(
|
||||
AEDesc * rangeStart,
|
||||
AEDesc * rangeStop,
|
||||
Boolean disposeInputs,
|
||||
AEDesc * theDescriptor);
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AEPACKOBJECT__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
File: AEUserTermTypes.h
|
||||
|
||||
Contains: AppleEvents AEUT resource format Interfaces.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1991-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __AEUSERTERMTYPES__
|
||||
#define __AEUSERTERMTYPES__
|
||||
|
||||
#ifndef __CONDITIONALMACROS__
|
||||
#include <ConditionalMacros.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
enum {
|
||||
kAEUserTerminology = FOUR_CHAR_CODE('aeut'), /* 0x61657574 */
|
||||
kAETerminologyExtension = FOUR_CHAR_CODE('aete'), /* 0x61657465 */
|
||||
kAEScriptingSizeResource = FOUR_CHAR_CODE('scsz'), /* 0x7363737a */
|
||||
kAEOSAXSizeResource = FOUR_CHAR_CODE('osiz')
|
||||
};
|
||||
|
||||
enum {
|
||||
kAEUTHasReturningParam = 31, /* if event has a keyASReturning param */
|
||||
kAEUTOptional = 15, /* if something is optional */
|
||||
kAEUTlistOfItems = 14, /* if property or reply is a list. */
|
||||
kAEUTEnumerated = 13, /* if property or reply is of an enumerated type. */
|
||||
kAEUTReadWrite = 12, /* if property is writable. */
|
||||
kAEUTChangesState = 12, /* if an event changes state. */
|
||||
kAEUTTightBindingFunction = 12, /* if this is a tight-binding precedence function. */
|
||||
/* AppleScript 1.3: new bits for reply, direct parameter, parameter, and property flags */
|
||||
kAEUTEnumsAreTypes = 11, /* if the enumeration is a list of types, not constants */
|
||||
kAEUTEnumListIsExclusive = 10, /* if the list of enumerations is a proper set */
|
||||
kAEUTReplyIsReference = 9, /* if the reply is a reference, not a value */
|
||||
kAEUTDirectParamIsReference = 9, /* if the direct parameter is a reference, not a value */
|
||||
kAEUTParamIsReference = 9, /* if the parameter is a reference, not a value */
|
||||
kAEUTPropertyIsReference = 9, /* if the property is a reference, not a value */
|
||||
kAEUTNotDirectParamIsTarget = 8, /* if the direct parameter is not the target of the event */
|
||||
kAEUTParamIsTarget = 8, /* if the parameter is the target of the event */
|
||||
kAEUTApostrophe = 3, /* if a term contains an apostrophe. */
|
||||
kAEUTFeminine = 2, /* if a term is feminine gender. */
|
||||
kAEUTMasculine = 1, /* if a term is masculine gender. */
|
||||
kAEUTPlural = 0 /* if a term is plural. */
|
||||
};
|
||||
|
||||
struct TScriptingSizeResource {
|
||||
short scriptingSizeFlags;
|
||||
unsigned long minStackSize;
|
||||
unsigned long preferredStackSize;
|
||||
unsigned long maxStackSize;
|
||||
unsigned long minHeapSize;
|
||||
unsigned long preferredHeapSize;
|
||||
unsigned long maxHeapSize;
|
||||
};
|
||||
typedef struct TScriptingSizeResource TScriptingSizeResource;
|
||||
enum {
|
||||
kLaunchToGetTerminology = (1 << 15), /* If kLaunchToGetTerminology is 0, 'aete' is read directly from res file. If set to 1, then launch and use 'gdut' to get terminology. */
|
||||
kDontFindAppBySignature = (1 << 14), /* If kDontFindAppBySignature is 0, then find app with signature if lost. If 1, then don't */
|
||||
kAlwaysSendSubject = (1 << 13) /* If kAlwaysSendSubject 0, then send subject when appropriate. If 1, then every event has Subject Attribute */
|
||||
};
|
||||
|
||||
/* old names for above bits. */
|
||||
enum {
|
||||
kReadExtensionTermsMask = (1 << 15)
|
||||
};
|
||||
|
||||
enum {
|
||||
/* AppleScript 1.3: Bit positions for osiz resource */
|
||||
/* AppleScript 1.3: Bit masks for osiz resources */
|
||||
kOSIZDontOpenResourceFile = 15, /* If set, resource file is not opened when osax is loaded */
|
||||
kOSIZdontAcceptRemoteEvents = 14, /* If set, handler will not be called with events from remote machines */
|
||||
kOSIZOpenWithReadPermission = 13, /* If set, file will be opened with read permission only */
|
||||
kOSIZCodeInSharedLibraries = 11 /* If set, loader will look for handler in shared library, not osax resources */
|
||||
};
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __AEUSERTERMTYPES__ */
|
||||
|
||||
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
File: AIFF.h
|
||||
|
||||
Contains: Definition of AIFF file format components.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1989-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __AIFF__
|
||||
#define __AIFF__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
enum {
|
||||
AIFFID = FOUR_CHAR_CODE('AIFF'),
|
||||
AIFCID = FOUR_CHAR_CODE('AIFC'),
|
||||
FormatVersionID = FOUR_CHAR_CODE('FVER'),
|
||||
CommonID = FOUR_CHAR_CODE('COMM'),
|
||||
FORMID = FOUR_CHAR_CODE('FORM'),
|
||||
SoundDataID = FOUR_CHAR_CODE('SSND'),
|
||||
MarkerID = FOUR_CHAR_CODE('MARK'),
|
||||
InstrumentID = FOUR_CHAR_CODE('INST'),
|
||||
MIDIDataID = FOUR_CHAR_CODE('MIDI'),
|
||||
AudioRecordingID = FOUR_CHAR_CODE('AESD'),
|
||||
ApplicationSpecificID = FOUR_CHAR_CODE('APPL'),
|
||||
CommentID = FOUR_CHAR_CODE('COMT'),
|
||||
NameID = FOUR_CHAR_CODE('NAME'),
|
||||
AuthorID = FOUR_CHAR_CODE('AUTH'),
|
||||
CopyrightID = FOUR_CHAR_CODE('(c) '),
|
||||
AnnotationID = FOUR_CHAR_CODE('ANNO')
|
||||
};
|
||||
|
||||
enum {
|
||||
NoLooping = 0,
|
||||
ForwardLooping = 1,
|
||||
ForwardBackwardLooping = 2
|
||||
};
|
||||
|
||||
enum {
|
||||
/* AIFF-C Versions */
|
||||
AIFCVersion1 = (long)0xA2805140
|
||||
};
|
||||
|
||||
/* Compression Names */
|
||||
#define NoneName "\pnot compressed"
|
||||
#define ACE2to1Name "\pACE 2-to-1"
|
||||
#define ACE8to3Name "\pACE 8-to-3"
|
||||
#define MACE3to1Name "\pMACE 3-to-1"
|
||||
#define MACE6to1Name "\pMACE 6-to-1"
|
||||
enum {
|
||||
/* Compression Types */
|
||||
NoneType = FOUR_CHAR_CODE('NONE'),
|
||||
ACE2Type = FOUR_CHAR_CODE('ACE2'),
|
||||
ACE8Type = FOUR_CHAR_CODE('ACE8'),
|
||||
MACE3Type = FOUR_CHAR_CODE('MAC3'),
|
||||
MACE6Type = FOUR_CHAR_CODE('MAC6')
|
||||
};
|
||||
|
||||
typedef unsigned long ID;
|
||||
typedef short MarkerIdType;
|
||||
struct ChunkHeader {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
};
|
||||
typedef struct ChunkHeader ChunkHeader;
|
||||
struct ContainerChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
ID formType;
|
||||
};
|
||||
typedef struct ContainerChunk ContainerChunk;
|
||||
struct FormatVersionChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
unsigned long timestamp;
|
||||
};
|
||||
typedef struct FormatVersionChunk FormatVersionChunk;
|
||||
typedef FormatVersionChunk * FormatVersionChunkPtr;
|
||||
struct CommonChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
short numChannels;
|
||||
unsigned long numSampleFrames;
|
||||
short sampleSize;
|
||||
extended80 sampleRate;
|
||||
};
|
||||
typedef struct CommonChunk CommonChunk;
|
||||
typedef CommonChunk * CommonChunkPtr;
|
||||
struct ExtCommonChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
short numChannels;
|
||||
unsigned long numSampleFrames;
|
||||
short sampleSize;
|
||||
extended80 sampleRate;
|
||||
ID compressionType;
|
||||
char compressionName[1]; /* variable length array, Pascal string */
|
||||
};
|
||||
typedef struct ExtCommonChunk ExtCommonChunk;
|
||||
typedef ExtCommonChunk * ExtCommonChunkPtr;
|
||||
struct SoundDataChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
unsigned long offset;
|
||||
unsigned long blockSize;
|
||||
};
|
||||
typedef struct SoundDataChunk SoundDataChunk;
|
||||
typedef SoundDataChunk * SoundDataChunkPtr;
|
||||
struct Marker {
|
||||
MarkerIdType id;
|
||||
unsigned long position;
|
||||
Str255 markerName;
|
||||
};
|
||||
typedef struct Marker Marker;
|
||||
struct MarkerChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
unsigned short numMarkers;
|
||||
Marker Markers[1]; /* variable length array */
|
||||
};
|
||||
typedef struct MarkerChunk MarkerChunk;
|
||||
typedef MarkerChunk * MarkerChunkPtr;
|
||||
struct AIFFLoop {
|
||||
short playMode;
|
||||
MarkerIdType beginLoop;
|
||||
MarkerIdType endLoop;
|
||||
};
|
||||
typedef struct AIFFLoop AIFFLoop;
|
||||
struct InstrumentChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
UInt8 baseFrequency;
|
||||
UInt8 detune;
|
||||
UInt8 lowFrequency;
|
||||
UInt8 highFrequency;
|
||||
UInt8 lowVelocity;
|
||||
UInt8 highVelocity;
|
||||
short gain;
|
||||
AIFFLoop sustainLoop;
|
||||
AIFFLoop releaseLoop;
|
||||
};
|
||||
typedef struct InstrumentChunk InstrumentChunk;
|
||||
typedef InstrumentChunk * InstrumentChunkPtr;
|
||||
struct MIDIDataChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
UInt8 MIDIdata[1]; /* variable length array */
|
||||
};
|
||||
typedef struct MIDIDataChunk MIDIDataChunk;
|
||||
typedef MIDIDataChunk * MIDIDataChunkPtr;
|
||||
struct AudioRecordingChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
UInt8 AESChannelStatus[24];
|
||||
};
|
||||
typedef struct AudioRecordingChunk AudioRecordingChunk;
|
||||
typedef AudioRecordingChunk * AudioRecordingChunkPtr;
|
||||
struct ApplicationSpecificChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
OSType applicationSignature;
|
||||
UInt8 data[1]; /* variable length array */
|
||||
};
|
||||
typedef struct ApplicationSpecificChunk ApplicationSpecificChunk;
|
||||
typedef ApplicationSpecificChunk * ApplicationSpecificChunkPtr;
|
||||
struct Comment {
|
||||
unsigned long timeStamp;
|
||||
MarkerIdType marker;
|
||||
unsigned short count;
|
||||
char text[1]; /* variable length array, Pascal string */
|
||||
};
|
||||
typedef struct Comment Comment;
|
||||
struct CommentsChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
unsigned short numComments;
|
||||
Comment comments[1]; /* variable length array */
|
||||
};
|
||||
typedef struct CommentsChunk CommentsChunk;
|
||||
typedef CommentsChunk * CommentsChunkPtr;
|
||||
struct TextChunk {
|
||||
ID ckID;
|
||||
long ckSize;
|
||||
char text[1]; /* variable length array, Pascal string */
|
||||
};
|
||||
typedef struct TextChunk TextChunk;
|
||||
typedef TextChunk * TextChunkPtr;
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __AIFF__ */
|
||||
|
||||
@@ -0,0 +1,353 @@
|
||||
/*
|
||||
File: ASDebugging.h
|
||||
|
||||
Contains: AppleScript Debugging Interfaces.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1992-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __ASDEBUGGING__
|
||||
#define __ASDEBUGGING__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __FILES__
|
||||
#include <Files.h>
|
||||
#endif
|
||||
|
||||
#ifndef __COMPONENTS__
|
||||
#include <Components.h>
|
||||
#endif
|
||||
|
||||
#ifndef __APPLEEVENTS__
|
||||
#include <AppleEvents.h>
|
||||
#endif
|
||||
|
||||
#ifndef __APPLESCRIPT__
|
||||
#include <AppleScript.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
Mode Flags
|
||||
**************************************************************************/
|
||||
/* This mode flag can be passed to OSASetProperty or OSASetHandler
|
||||
and will prevent properties or handlers from being defined in a context
|
||||
that doesn't already have bindings for them. An error is returned if
|
||||
a current binding doesn't already exist.
|
||||
*/
|
||||
enum {
|
||||
kOSAModeDontDefine = 0x0001
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
Component Selectors
|
||||
**************************************************************************/
|
||||
enum {
|
||||
kASSelectSetPropertyObsolete = 0x1101,
|
||||
kASSelectGetPropertyObsolete = 0x1102,
|
||||
kASSelectSetHandlerObsolete = 0x1103,
|
||||
kASSelectGetHandlerObsolete = 0x1104,
|
||||
kASSelectGetAppTerminologyObsolete = 0x1105,
|
||||
kASSelectSetProperty = 0x1106,
|
||||
kASSelectGetProperty = 0x1107,
|
||||
kASSelectSetHandler = 0x1108,
|
||||
kASSelectGetHandler = 0x1109,
|
||||
kASSelectGetAppTerminology = 0x110A,
|
||||
kASSelectGetSysTerminology = 0x110B,
|
||||
kASSelectGetPropertyNames = 0x110C,
|
||||
kASSelectGetHandlerNames = 0x110D
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
Context Accessors
|
||||
**************************************************************************/
|
||||
/*
|
||||
* OSASetProperty()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
OSASetProperty(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
OSAID contextID,
|
||||
const AEDesc * variableName,
|
||||
OSAID scriptValueID) FIVEWORDINLINE(0x2F3C, 0x0010, 0x1106, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* OSAGetProperty()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
OSAGetProperty(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
OSAID contextID,
|
||||
const AEDesc * variableName,
|
||||
OSAID * resultingScriptValueID) FIVEWORDINLINE(0x2F3C, 0x0010, 0x1107, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* OSAGetPropertyNames()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
OSAGetPropertyNames(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
OSAID contextID,
|
||||
AEDescList * resultingPropertyNames) FIVEWORDINLINE(0x2F3C, 0x000C, 0x110C, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* OSASetHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
OSASetHandler(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
OSAID contextID,
|
||||
const AEDesc * handlerName,
|
||||
OSAID compiledScriptID) FIVEWORDINLINE(0x2F3C, 0x0010, 0x1108, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* OSAGetHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
OSAGetHandler(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
OSAID contextID,
|
||||
const AEDesc * handlerName,
|
||||
OSAID * resultingCompiledScriptID) FIVEWORDINLINE(0x2F3C, 0x0010, 0x1109, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* OSAGetHandlerNames()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
OSAGetHandlerNames(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
OSAID contextID,
|
||||
AEDescList * resultingHandlerNames) FIVEWORDINLINE(0x2F3C, 0x000C, 0x110D, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* OSAGetAppTerminology()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
OSAGetAppTerminology(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
FSSpec * fileSpec,
|
||||
short terminologyID,
|
||||
Boolean * didLaunch,
|
||||
AEDesc * terminologyList) FIVEWORDINLINE(0x2F3C, 0x0012, 0x110A, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/* Errors:
|
||||
errOSASystemError operation failed
|
||||
*/
|
||||
/*
|
||||
* OSAGetSysTerminology()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
OSAGetSysTerminology(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
short terminologyID,
|
||||
AEDesc * terminologyList) FIVEWORDINLINE(0x2F3C, 0x000A, 0x110B, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/* Errors:
|
||||
errOSASystemError operation failed
|
||||
*/
|
||||
/* Notes on terminology ID
|
||||
|
||||
A terminology ID is derived from script code and language code
|
||||
as follows;
|
||||
|
||||
terminologyID = ((scriptCode & 0x7F) << 8) | (langCode & 0xFF)
|
||||
*/
|
||||
/**************************************************************************
|
||||
Obsolete versions provided for backward compatibility:
|
||||
*/
|
||||
/*
|
||||
* ASSetProperty()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASSetProperty(
|
||||
ComponentInstance scriptingComponent,
|
||||
OSAID contextID,
|
||||
const AEDesc * variableName,
|
||||
OSAID scriptValueID) FIVEWORDINLINE(0x2F3C, 0x000C, 0x1101, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* ASGetProperty()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASGetProperty(
|
||||
ComponentInstance scriptingComponent,
|
||||
OSAID contextID,
|
||||
const AEDesc * variableName,
|
||||
OSAID * resultingScriptValueID) FIVEWORDINLINE(0x2F3C, 0x000C, 0x1102, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* ASSetHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASSetHandler(
|
||||
ComponentInstance scriptingComponent,
|
||||
OSAID contextID,
|
||||
const AEDesc * handlerName,
|
||||
OSAID compiledScriptID) FIVEWORDINLINE(0x2F3C, 0x000C, 0x1103, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* ASGetHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASGetHandler(
|
||||
ComponentInstance scriptingComponent,
|
||||
OSAID contextID,
|
||||
const AEDesc * handlerName,
|
||||
OSAID * resultingCompiledScriptID) FIVEWORDINLINE(0x2F3C, 0x000C, 0x1104, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* ASGetAppTerminology()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASGetAppTerminology(
|
||||
ComponentInstance scriptingComponent,
|
||||
FSSpec * fileSpec,
|
||||
short terminologID,
|
||||
Boolean * didLaunch,
|
||||
AEDesc * terminologyList) FIVEWORDINLINE(0x2F3C, 0x000E, 0x1105, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/* Errors:
|
||||
errOSASystemError operation failed
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASDEBUGGING__ */
|
||||
|
||||
@@ -0,0 +1,363 @@
|
||||
/*
|
||||
File: ASRegistry.h
|
||||
|
||||
Contains: AppleScript Registry constants.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1991-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __ASREGISTRY__
|
||||
#define __ASREGISTRY__
|
||||
|
||||
#ifndef __AEREGISTRY__
|
||||
#include <AERegistry.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEOBJECTS__
|
||||
#include <AEObjects.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
keyAETarget = FOUR_CHAR_CODE('targ'),
|
||||
keySubjectAttr = FOUR_CHAR_CODE('subj'), /* Magic 'returning' parameter: */
|
||||
keyASReturning = FOUR_CHAR_CODE('Krtn'), /* AppleScript Specific Codes: */
|
||||
kASAppleScriptSuite = FOUR_CHAR_CODE('ascr'),
|
||||
kASScriptEditorSuite = FOUR_CHAR_CODE('ToyS'),
|
||||
kASTypeNamesSuite = FOUR_CHAR_CODE('tpnm'), /* dynamic terminologies */
|
||||
typeAETE = FOUR_CHAR_CODE('aete'),
|
||||
typeAEUT = FOUR_CHAR_CODE('aeut'),
|
||||
kGetAETE = FOUR_CHAR_CODE('gdte'),
|
||||
kGetAEUT = FOUR_CHAR_CODE('gdut'),
|
||||
kUpdateAEUT = FOUR_CHAR_CODE('udut'),
|
||||
kUpdateAETE = FOUR_CHAR_CODE('udte'),
|
||||
kCleanUpAEUT = FOUR_CHAR_CODE('cdut'),
|
||||
kASComment = FOUR_CHAR_CODE('cmnt'),
|
||||
kASLaunchEvent = FOUR_CHAR_CODE('noop'),
|
||||
keyScszResource = FOUR_CHAR_CODE('scsz'),
|
||||
typeScszResource = FOUR_CHAR_CODE('scsz'), /* subroutine calls */
|
||||
kASSubroutineEvent = FOUR_CHAR_CODE('psbr'),
|
||||
keyASSubroutineName = FOUR_CHAR_CODE('snam'),
|
||||
kASPrepositionalSubroutine = FOUR_CHAR_CODE('psbr'),
|
||||
keyASPositionalArgs = FOUR_CHAR_CODE('parg')
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Add this parameter to a Get Data result if your app handled the 'as' parameter */
|
||||
keyAppHandledCoercion = FOUR_CHAR_CODE('idas')
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Miscellaneous AppleScript commands */
|
||||
kASStartLogEvent = FOUR_CHAR_CODE('log1'),
|
||||
kASStopLogEvent = FOUR_CHAR_CODE('log0'),
|
||||
kASCommentEvent = FOUR_CHAR_CODE('cmnt')
|
||||
};
|
||||
|
||||
|
||||
/* Operator Events: */
|
||||
enum {
|
||||
/* Binary: */
|
||||
kASAdd = FOUR_CHAR_CODE('+ '),
|
||||
kASSubtract = FOUR_CHAR_CODE('- '),
|
||||
kASMultiply = FOUR_CHAR_CODE('* '),
|
||||
kASDivide = FOUR_CHAR_CODE('/ '),
|
||||
kASQuotient = FOUR_CHAR_CODE('div '),
|
||||
kASRemainder = FOUR_CHAR_CODE('mod '),
|
||||
kASPower = FOUR_CHAR_CODE('^ '),
|
||||
kASEqual = kAEEquals,
|
||||
kASNotEqual = 0xAD202020,
|
||||
kASGreaterThan = kAEGreaterThan,
|
||||
kASGreaterThanOrEqual = kAEGreaterThanEquals,
|
||||
kASLessThan = kAELessThan,
|
||||
kASLessThanOrEqual = kAELessThanEquals,
|
||||
kASComesBefore = FOUR_CHAR_CODE('cbfr'),
|
||||
kASComesAfter = FOUR_CHAR_CODE('cafr'),
|
||||
kASConcatenate = FOUR_CHAR_CODE('ccat'),
|
||||
kASStartsWith = kAEBeginsWith,
|
||||
kASEndsWith = kAEEndsWith,
|
||||
kASContains = kAEContains
|
||||
};
|
||||
|
||||
enum {
|
||||
kASAnd = kAEAND,
|
||||
kASOr = kAEOR, /* Unary: */
|
||||
kASNot = kAENOT,
|
||||
kASNegate = FOUR_CHAR_CODE('neg '),
|
||||
keyASArg = FOUR_CHAR_CODE('arg ')
|
||||
};
|
||||
|
||||
enum {
|
||||
/* event code for the 'error' statement */
|
||||
kASErrorEventCode = FOUR_CHAR_CODE('err '),
|
||||
kOSAErrorArgs = FOUR_CHAR_CODE('erra'),
|
||||
keyAEErrorObject = FOUR_CHAR_CODE('erob'), /* Properties: */
|
||||
pLength = FOUR_CHAR_CODE('leng'),
|
||||
pReverse = FOUR_CHAR_CODE('rvse'),
|
||||
pRest = FOUR_CHAR_CODE('rest'),
|
||||
pInherits = FOUR_CHAR_CODE('c@#^'),
|
||||
pProperties = FOUR_CHAR_CODE('pALL'), /* User-Defined Record Fields: */
|
||||
keyASUserRecordFields = FOUR_CHAR_CODE('usrf'),
|
||||
typeUserRecordFields = typeAEList
|
||||
};
|
||||
|
||||
/* Prepositions: */
|
||||
enum {
|
||||
keyASPrepositionAt = FOUR_CHAR_CODE('at '),
|
||||
keyASPrepositionIn = FOUR_CHAR_CODE('in '),
|
||||
keyASPrepositionFrom = FOUR_CHAR_CODE('from'),
|
||||
keyASPrepositionFor = FOUR_CHAR_CODE('for '),
|
||||
keyASPrepositionTo = FOUR_CHAR_CODE('to '),
|
||||
keyASPrepositionThru = FOUR_CHAR_CODE('thru'),
|
||||
keyASPrepositionThrough = FOUR_CHAR_CODE('thgh'),
|
||||
keyASPrepositionBy = FOUR_CHAR_CODE('by '),
|
||||
keyASPrepositionOn = FOUR_CHAR_CODE('on '),
|
||||
keyASPrepositionInto = FOUR_CHAR_CODE('into'),
|
||||
keyASPrepositionOnto = FOUR_CHAR_CODE('onto'),
|
||||
keyASPrepositionBetween = FOUR_CHAR_CODE('btwn'),
|
||||
keyASPrepositionAgainst = FOUR_CHAR_CODE('agst'),
|
||||
keyASPrepositionOutOf = FOUR_CHAR_CODE('outo'),
|
||||
keyASPrepositionInsteadOf = FOUR_CHAR_CODE('isto'),
|
||||
keyASPrepositionAsideFrom = FOUR_CHAR_CODE('asdf'),
|
||||
keyASPrepositionAround = FOUR_CHAR_CODE('arnd'),
|
||||
keyASPrepositionBeside = FOUR_CHAR_CODE('bsid'),
|
||||
keyASPrepositionBeneath = FOUR_CHAR_CODE('bnth'),
|
||||
keyASPrepositionUnder = FOUR_CHAR_CODE('undr')
|
||||
};
|
||||
|
||||
enum {
|
||||
keyASPrepositionOver = FOUR_CHAR_CODE('over'),
|
||||
keyASPrepositionAbove = FOUR_CHAR_CODE('abve'),
|
||||
keyASPrepositionBelow = FOUR_CHAR_CODE('belw'),
|
||||
keyASPrepositionApartFrom = FOUR_CHAR_CODE('aprt'),
|
||||
keyASPrepositionGiven = FOUR_CHAR_CODE('givn'),
|
||||
keyASPrepositionWith = FOUR_CHAR_CODE('with'),
|
||||
keyASPrepositionWithout = FOUR_CHAR_CODE('wout'),
|
||||
keyASPrepositionAbout = FOUR_CHAR_CODE('abou'),
|
||||
keyASPrepositionSince = FOUR_CHAR_CODE('snce'),
|
||||
keyASPrepositionUntil = FOUR_CHAR_CODE('till')
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Terminology & Dialect things: */
|
||||
kDialectBundleResType = FOUR_CHAR_CODE('Dbdl'), /* AppleScript Classes and Enums: */
|
||||
cConstant = typeEnumerated,
|
||||
cClassIdentifier = pClass,
|
||||
cObjectBeingExamined = typeObjectBeingExamined,
|
||||
cList = typeAEList,
|
||||
cSmallReal = typeSMFloat,
|
||||
cReal = typeFloat,
|
||||
cRecord = typeAERecord,
|
||||
cReference = cObjectSpecifier,
|
||||
cUndefined = FOUR_CHAR_CODE('undf'),
|
||||
cMissingValue = FOUR_CHAR_CODE('msng'),
|
||||
cSymbol = FOUR_CHAR_CODE('symb'),
|
||||
cLinkedList = FOUR_CHAR_CODE('llst'),
|
||||
cVector = FOUR_CHAR_CODE('vect'),
|
||||
cEventIdentifier = FOUR_CHAR_CODE('evnt'),
|
||||
cKeyIdentifier = FOUR_CHAR_CODE('kyid'),
|
||||
cUserIdentifier = FOUR_CHAR_CODE('uid '),
|
||||
cPreposition = FOUR_CHAR_CODE('prep'),
|
||||
cKeyForm = enumKeyForm,
|
||||
cScript = FOUR_CHAR_CODE('scpt'),
|
||||
cHandler = FOUR_CHAR_CODE('hand'),
|
||||
cProcedure = FOUR_CHAR_CODE('proc')
|
||||
};
|
||||
|
||||
enum {
|
||||
cHandleBreakpoint = FOUR_CHAR_CODE('brak')
|
||||
};
|
||||
|
||||
enum {
|
||||
cClosure = FOUR_CHAR_CODE('clsr'),
|
||||
cRawData = FOUR_CHAR_CODE('rdat'),
|
||||
cStringClass = typeChar,
|
||||
cNumber = FOUR_CHAR_CODE('nmbr'),
|
||||
cListElement = FOUR_CHAR_CODE('celm'),
|
||||
cListOrRecord = FOUR_CHAR_CODE('lr '),
|
||||
cListOrString = FOUR_CHAR_CODE('ls '),
|
||||
cListRecordOrString = FOUR_CHAR_CODE('lrs '),
|
||||
cNumberOrString = FOUR_CHAR_CODE('ns '),
|
||||
cNumberOrDateTime = FOUR_CHAR_CODE('nd '),
|
||||
cNumberDateTimeOrString = FOUR_CHAR_CODE('nds '),
|
||||
cAliasOrString = FOUR_CHAR_CODE('sf '),
|
||||
cSeconds = FOUR_CHAR_CODE('scnd'),
|
||||
typeSound = FOUR_CHAR_CODE('snd '),
|
||||
enumBooleanValues = FOUR_CHAR_CODE('boov'), /* Use this instead of typeBoolean to avoid with/without conversion */
|
||||
kAETrue = typeTrue,
|
||||
kAEFalse = typeFalse,
|
||||
enumMiscValues = FOUR_CHAR_CODE('misc'),
|
||||
kASCurrentApplication = FOUR_CHAR_CODE('cura'), /* User-defined property ospecs: */
|
||||
formUserPropertyID = FOUR_CHAR_CODE('usrp')
|
||||
};
|
||||
|
||||
enum {
|
||||
cString = cStringClass /* old name for cStringClass - can't be used in .r files*/
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Global properties: */
|
||||
pASIt = FOUR_CHAR_CODE('it '),
|
||||
pASMe = FOUR_CHAR_CODE('me '),
|
||||
pASResult = FOUR_CHAR_CODE('rslt'),
|
||||
pASSpace = FOUR_CHAR_CODE('spac'),
|
||||
pASReturn = FOUR_CHAR_CODE('ret '),
|
||||
pASTab = FOUR_CHAR_CODE('tab '),
|
||||
pASPi = FOUR_CHAR_CODE('pi '),
|
||||
pASParent = FOUR_CHAR_CODE('pare'),
|
||||
kASInitializeEventCode = FOUR_CHAR_CODE('init'),
|
||||
pASPrintLength = FOUR_CHAR_CODE('prln'),
|
||||
pASPrintDepth = FOUR_CHAR_CODE('prdp'),
|
||||
pASTopLevelScript = FOUR_CHAR_CODE('ascr')
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Considerations */
|
||||
kAECase = FOUR_CHAR_CODE('case'),
|
||||
kAEDiacritic = FOUR_CHAR_CODE('diac'),
|
||||
kAEWhiteSpace = FOUR_CHAR_CODE('whit'),
|
||||
kAEHyphens = FOUR_CHAR_CODE('hyph'),
|
||||
kAEExpansion = FOUR_CHAR_CODE('expa'),
|
||||
kAEPunctuation = FOUR_CHAR_CODE('punc'),
|
||||
kAEZenkakuHankaku = FOUR_CHAR_CODE('zkhk'),
|
||||
kAESmallKana = FOUR_CHAR_CODE('skna'),
|
||||
kAEKataHiragana = FOUR_CHAR_CODE('hika'),
|
||||
kASConsiderReplies = FOUR_CHAR_CODE('rmte'),
|
||||
enumConsiderations = FOUR_CHAR_CODE('cons')
|
||||
};
|
||||
|
||||
/* Considerations bit masks */
|
||||
enum {
|
||||
kAECaseConsiderMask = 0x00000001,
|
||||
kAEDiacriticConsiderMask = 0x00000002,
|
||||
kAEWhiteSpaceConsiderMask = 0x00000004,
|
||||
kAEHyphensConsiderMask = 0x00000008,
|
||||
kAEExpansionConsiderMask = 0x00000010,
|
||||
kAEPunctuationConsiderMask = 0x00000020,
|
||||
kASConsiderRepliesConsiderMask = 0x00000040,
|
||||
kAECaseIgnoreMask = 0x00010000,
|
||||
kAEDiacriticIgnoreMask = 0x00020000,
|
||||
kAEWhiteSpaceIgnoreMask = 0x00040000,
|
||||
kAEHyphensIgnoreMask = 0x00080000,
|
||||
kAEExpansionIgnoreMask = 0x00100000,
|
||||
kAEPunctuationIgnoreMask = 0x00200000,
|
||||
kASConsiderRepliesIgnoreMask = 0x00400000,
|
||||
enumConsidsAndIgnores = FOUR_CHAR_CODE('csig')
|
||||
};
|
||||
|
||||
enum {
|
||||
cCoercion = FOUR_CHAR_CODE('coec'),
|
||||
cCoerceUpperCase = FOUR_CHAR_CODE('txup'),
|
||||
cCoerceLowerCase = FOUR_CHAR_CODE('txlo'),
|
||||
cCoerceRemoveDiacriticals = FOUR_CHAR_CODE('txdc'),
|
||||
cCoerceRemovePunctuation = FOUR_CHAR_CODE('txpc'),
|
||||
cCoerceRemoveHyphens = FOUR_CHAR_CODE('txhy'),
|
||||
cCoerceOneByteToTwoByte = FOUR_CHAR_CODE('txex'),
|
||||
cCoerceRemoveWhiteSpace = FOUR_CHAR_CODE('txws'),
|
||||
cCoerceSmallKana = FOUR_CHAR_CODE('txsk'),
|
||||
cCoerceZenkakuhankaku = FOUR_CHAR_CODE('txze'),
|
||||
cCoerceKataHiragana = FOUR_CHAR_CODE('txkh'), /* Lorax things: */
|
||||
cZone = FOUR_CHAR_CODE('zone'),
|
||||
cMachine = FOUR_CHAR_CODE('mach'),
|
||||
cAddress = FOUR_CHAR_CODE('addr'),
|
||||
cRunningAddress = FOUR_CHAR_CODE('radd'),
|
||||
cStorage = FOUR_CHAR_CODE('stor')
|
||||
};
|
||||
|
||||
enum {
|
||||
/* DateTime things: */
|
||||
pASWeekday = FOUR_CHAR_CODE('wkdy'),
|
||||
pASMonth = FOUR_CHAR_CODE('mnth'),
|
||||
pASDay = FOUR_CHAR_CODE('day '),
|
||||
pASYear = FOUR_CHAR_CODE('year'),
|
||||
pASTime = FOUR_CHAR_CODE('time'),
|
||||
pASDateString = FOUR_CHAR_CODE('dstr'),
|
||||
pASTimeString = FOUR_CHAR_CODE('tstr'), /* Months */
|
||||
cMonth = pASMonth,
|
||||
cJanuary = FOUR_CHAR_CODE('jan '),
|
||||
cFebruary = FOUR_CHAR_CODE('feb '),
|
||||
cMarch = FOUR_CHAR_CODE('mar '),
|
||||
cApril = FOUR_CHAR_CODE('apr '),
|
||||
cMay = FOUR_CHAR_CODE('may '),
|
||||
cJune = FOUR_CHAR_CODE('jun '),
|
||||
cJuly = FOUR_CHAR_CODE('jul '),
|
||||
cAugust = FOUR_CHAR_CODE('aug '),
|
||||
cSeptember = FOUR_CHAR_CODE('sep '),
|
||||
cOctober = FOUR_CHAR_CODE('oct '),
|
||||
cNovember = FOUR_CHAR_CODE('nov '),
|
||||
cDecember = FOUR_CHAR_CODE('dec ')
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Weekdays */
|
||||
cWeekday = pASWeekday,
|
||||
cSunday = FOUR_CHAR_CODE('sun '),
|
||||
cMonday = FOUR_CHAR_CODE('mon '),
|
||||
cTuesday = FOUR_CHAR_CODE('tue '),
|
||||
cWednesday = FOUR_CHAR_CODE('wed '),
|
||||
cThursday = FOUR_CHAR_CODE('thu '),
|
||||
cFriday = FOUR_CHAR_CODE('fri '),
|
||||
cSaturday = FOUR_CHAR_CODE('sat '), /* AS 1.1 Globals: */
|
||||
pASQuote = FOUR_CHAR_CODE('quot'),
|
||||
pASSeconds = FOUR_CHAR_CODE('secs'),
|
||||
pASMinutes = FOUR_CHAR_CODE('min '),
|
||||
pASHours = FOUR_CHAR_CODE('hour'),
|
||||
pASDays = FOUR_CHAR_CODE('days'),
|
||||
pASWeeks = FOUR_CHAR_CODE('week'), /* Writing Code things: */
|
||||
cWritingCodeInfo = FOUR_CHAR_CODE('citl'),
|
||||
pScriptCode = FOUR_CHAR_CODE('pscd'),
|
||||
pLangCode = FOUR_CHAR_CODE('plcd'), /* Magic Tell and End Tell events for logging: */
|
||||
kASMagicTellEvent = FOUR_CHAR_CODE('tell'),
|
||||
kASMagicEndTellEvent = FOUR_CHAR_CODE('tend')
|
||||
};
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ASREGISTRY__ */
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
File: ATS.h
|
||||
|
||||
Contains: Master include for ATS private framework
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __ATS__
|
||||
#define __ATS__
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef __ATSLAYOUTTYPES__
|
||||
#include <ATSLayoutTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSFONT__
|
||||
#include <ATSFont.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSTYPES__
|
||||
#include <ATSTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SCALERSTREAMTYPES__
|
||||
#include <ScalerStreamTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SFNTLAYOUTTYPES__
|
||||
#include <SFNTLayoutTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SFNTTYPES__
|
||||
#include <SFNTTypes.h>
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __ATS__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,709 @@
|
||||
/*
|
||||
File: ATSLayoutTypes.h
|
||||
|
||||
Contains: Apple Type Services layout public structures and constants.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __ATSLAYOUTTYPES__
|
||||
#define __ATSLAYOUTTYPES__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SFNTLAYOUTTYPES__
|
||||
#include <SFNTLayoutTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSTYPES__
|
||||
#include <ATSTypes.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------------- */
|
||||
/* CONSTANTS and related scalar types */
|
||||
/* --------------------------------------------------------------------------- */
|
||||
/* --------------------------------------------------------------------------- */
|
||||
/* Miscellaneous Constants */
|
||||
/* --------------------------------------------------------------------------- */
|
||||
enum {
|
||||
kATSUseGlyphAdvance = 0x7FFFFFFF, /* assignment to use natural glyph advance value */
|
||||
kATSUseLineHeight = 0x7FFFFFFF, /* assignment to use natural line ascent/descent values */
|
||||
kATSNoTracking = (long)0x80000000 /* negativeInfinity */
|
||||
};
|
||||
|
||||
/* --------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Summary:
|
||||
* These values are passed into the ATSUGetGlyphBounds function to
|
||||
* indicate whether the width of the resulting typographic glyph
|
||||
* bounds will be determined using the caret origin, glyph origin in
|
||||
* device space, or glyph origin in fractional absolute positions
|
||||
*/
|
||||
enum {
|
||||
|
||||
/*
|
||||
* Specifies that the width of the typographic glyph bounds will be
|
||||
* determined using the caret origin. The caret origin is halfway
|
||||
* between two characters.
|
||||
*/
|
||||
kATSUseCaretOrigins = 0,
|
||||
|
||||
/*
|
||||
* Specifies that the width of the typographic glyph bounds will be
|
||||
* determined using the glyph origin in device space. This is useful
|
||||
* for adjusting text on the screen.
|
||||
*/
|
||||
kATSUseDeviceOrigins = 1,
|
||||
|
||||
/*
|
||||
* Specifies that the width of the typographic glyph bounds will be
|
||||
* determined using the glyph origin in fractional absolute
|
||||
* positions, which are uncorrected for device display. This provides
|
||||
* the ideal position of laid-out text and is useful for scaling text
|
||||
* on the screen. This origin is also used to get the width of the
|
||||
* typographic bounding rectangle when you call ATSUMeasureText.
|
||||
*/
|
||||
kATSUseFractionalOrigins = 2,
|
||||
kATSUseOriginFlags = 3
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSULayoutOperationSelector
|
||||
*
|
||||
* Summary:
|
||||
* This is used to select which operations to override, or which
|
||||
* operation is currently being run.
|
||||
*/
|
||||
typedef UInt32 ATSULayoutOperationSelector;
|
||||
enum {
|
||||
|
||||
/*
|
||||
* No Layout operation is currently selected.
|
||||
*/
|
||||
kATSULayoutOperationNone = 0x00000000,
|
||||
|
||||
/*
|
||||
* Select the Justification operation.
|
||||
*/
|
||||
kATSULayoutOperationJustification = 0x00000001,
|
||||
|
||||
/*
|
||||
* Select the character morphing operation.
|
||||
*/
|
||||
kATSULayoutOperationMorph = 0x00000002,
|
||||
|
||||
/*
|
||||
* Select the kerning adjustment operation.
|
||||
*/
|
||||
kATSULayoutOperationKerningAdjustment = 0x00000004,
|
||||
|
||||
/*
|
||||
* Select the baseline adjustment operation.
|
||||
*/
|
||||
kATSULayoutOperationBaselineAdjustment = 0x00000008,
|
||||
|
||||
/*
|
||||
* Select the tracking adjustment operation.
|
||||
*/
|
||||
kATSULayoutOperationTrackingAdjustment = 0x00000010,
|
||||
|
||||
/*
|
||||
* Select the period of time after ATSUI has finished all of it's
|
||||
* layout operations.
|
||||
*/
|
||||
kATSULayoutOperationPostLayoutAdjustment = 0x00000020,
|
||||
kATSULayoutOperationAppleReserved = (unsigned long)0xFFFFFFC0
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSULayoutOperationCallbackStatus
|
||||
*
|
||||
* Summary:
|
||||
* One of these must be returned by a
|
||||
* ATSUDLayoutOperationOverrideUPP callback function in order to
|
||||
* indicate ATSUI's status.
|
||||
*/
|
||||
typedef UInt32 ATSULayoutOperationCallbackStatus;
|
||||
enum {
|
||||
|
||||
/*
|
||||
* Return this if the callback function has totally handled the
|
||||
* operation which triggered the callback and does not need ATSUI to
|
||||
* run any further processing for the operation.
|
||||
*/
|
||||
kATSULayoutOperationCallbackStatusHandled = 0x00000000,
|
||||
|
||||
/*
|
||||
* Return this if the callback function has not totally handled the
|
||||
* operation which triggered the callback and needs ATSUI to run it's
|
||||
* own processing.
|
||||
*/
|
||||
kATSULayoutOperationCallbackStatusContinue = 0x00000001
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSLineLayoutOptions
|
||||
*
|
||||
* Summary:
|
||||
* ATSLineLayoutOptions are normally set in an ATSUTextLayout object
|
||||
* via the kATSULineLayoutOptionsTag layout control attribute. They
|
||||
* can also be set in an ATSLineLayoutParams structure and passed
|
||||
* into the ATSLayoutText function for finer control over the line
|
||||
* layout.
|
||||
*/
|
||||
typedef UInt32 ATSLineLayoutOptions;
|
||||
enum {
|
||||
|
||||
/*
|
||||
* No options specified.
|
||||
*/
|
||||
kATSLineNoLayoutOptions = 0x00000000,
|
||||
|
||||
/*
|
||||
* This line option is no longer used.
|
||||
*/
|
||||
kATSLineIsDisplayOnly = 0x00000001, /* obsolete option*/
|
||||
|
||||
/*
|
||||
* Specifies that no hangers to be formed on the line.
|
||||
*/
|
||||
kATSLineHasNoHangers = 0x00000002,
|
||||
|
||||
/*
|
||||
* Specifies that no optical alignment to be performed on the line.
|
||||
*/
|
||||
kATSLineHasNoOpticalAlignment = 0x00000004,
|
||||
|
||||
/*
|
||||
* Specifies that space charcters should not be treated as hangers.
|
||||
*/
|
||||
kATSLineKeepSpacesOutOfMargin = 0x00000008,
|
||||
|
||||
/*
|
||||
* Specifies no post-compensation justification is to be performed.
|
||||
*/
|
||||
kATSLineNoSpecialJustification = 0x00000010,
|
||||
|
||||
/*
|
||||
* Specifies that if the line is the last of a paragraph, it will not
|
||||
* get justified.
|
||||
*/
|
||||
kATSLineLastNoJustification = 0x00000020,
|
||||
|
||||
/*
|
||||
* Specifies that the displayed line glyphs will adjust for device
|
||||
* metrics.
|
||||
*/
|
||||
kATSLineFractDisable = 0x00000040,
|
||||
|
||||
/*
|
||||
* Specifies that the carets at the ends of the line will be
|
||||
* guarenteed to be perpendicular to the baseline.
|
||||
*/
|
||||
kATSLineImposeNoAngleForEnds = 0x00000080,
|
||||
|
||||
/*
|
||||
* Highlights for the line end characters will be extended to 0 and
|
||||
* the specified line width.
|
||||
*/
|
||||
kATSLineFillOutToWidth = 0x00000100,
|
||||
|
||||
/*
|
||||
* Specifies that the tab character width will be automatically
|
||||
* adjusted to fit the specified line width.
|
||||
*/
|
||||
kATSLineTabAdjustEnabled = 0x00000200,
|
||||
|
||||
/*
|
||||
* Specifies that any leading value specified by a font will be
|
||||
* ignored.
|
||||
*/
|
||||
kATSLineIgnoreFontLeading = 0x00000400,
|
||||
|
||||
/*
|
||||
* Specifies that ATS produce antialiased glyph images despite system
|
||||
* preferences or CGContext settings.
|
||||
*/
|
||||
kATSLineApplyAntiAliasing = 0x00000800,
|
||||
|
||||
/*
|
||||
* Specifies that ATS turn-off antialiasing glyph imaging despite
|
||||
* system preferences or CGContext settings (negates
|
||||
* kATSLineApplyAntiAliasing bit if set).
|
||||
*/
|
||||
kATSLineNoAntiAliasing = 0x00001000,
|
||||
|
||||
/*
|
||||
* Specifies that if the line width is not sufficient to hold all its
|
||||
* glyphs, glyph positions are allowed to extend beyond the line's
|
||||
* assigned width so negative justification is not used.
|
||||
*/
|
||||
kATSLineDisableNegativeJustification = 0x00002000,
|
||||
|
||||
/*
|
||||
* Specifies that lines with any integer glyph positioning (due to
|
||||
* either any character non-antialiased or kATSLineFractDisable
|
||||
* specified), not automatically esthetically adjust individual
|
||||
* character positions while rendering to display.
|
||||
*/
|
||||
kATSLineDisableAutoAdjustDisplayPos = 0x00004000,
|
||||
|
||||
/*
|
||||
* Specifies that rendering be done through Quickdraw (default
|
||||
* rendering in ATSUI is through CoreGraphics on MacOSX).
|
||||
*/
|
||||
kATSLineUseQDRendering = 0x00008000,
|
||||
|
||||
/*
|
||||
* Specifies that any Justification operations will not be run.
|
||||
*/
|
||||
kATSLineDisableAllJustification = 0x00010000,
|
||||
|
||||
/*
|
||||
* Specifies that any glyph morphing operations will not be run.
|
||||
*/
|
||||
kATSLineDisableAllGlyphMorphing = 0x00020000,
|
||||
|
||||
/*
|
||||
* Specifies that any kerning adjustment operations will not be run.
|
||||
*/
|
||||
kATSLineDisableAllKerningAdjustments = 0x00040000,
|
||||
|
||||
/*
|
||||
* Specifies that any baseline adjustment operations will not be run.
|
||||
*/
|
||||
kATSLineDisableAllBaselineAdjustments = 0x00080000,
|
||||
|
||||
/*
|
||||
* Specifies that any tracking adjustment operations will not be run.
|
||||
*/
|
||||
kATSLineDisableAllTrackingAdjustments = 0x00100000,
|
||||
|
||||
/*
|
||||
* Convenience constant for turning-off all adjustments.
|
||||
*/
|
||||
kATSLineDisableAllLayoutOperations = kATSLineDisableAllJustification | kATSLineDisableAllGlyphMorphing | kATSLineDisableAllKerningAdjustments | kATSLineDisableAllBaselineAdjustments | kATSLineDisableAllTrackingAdjustments,
|
||||
|
||||
/*
|
||||
* Specifies to optimize for displaying text only. Note, rounded
|
||||
* device metrics will be used instead of fractional path metrics.
|
||||
*/
|
||||
kATSLineUseDeviceMetrics = 0x01000000,
|
||||
|
||||
/*
|
||||
* These bits are reserved by Apple and will result in a invalid
|
||||
* value error if attemped to set. Obsolete constants:
|
||||
*/
|
||||
kATSLineAppleReserved = (unsigned long)0xFEE00000
|
||||
};
|
||||
|
||||
/* --------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSStyleRenderingOptions
|
||||
*
|
||||
* Summary:
|
||||
* ATSStyleRenderingOptions are set in the ATSUStyle object via the
|
||||
* attribute tag kATSUStyleRenderingOptions. They provide finer
|
||||
* control over how the style is rendered.
|
||||
*/
|
||||
typedef UInt32 ATSStyleRenderingOptions;
|
||||
enum {
|
||||
|
||||
/*
|
||||
* No options specified.
|
||||
*/
|
||||
kATSStyleNoOptions = 0x00000000,
|
||||
|
||||
/*
|
||||
* Specifies that ATS produce "unhinted" glyph outlines (default is
|
||||
* hinted glyph outlines).
|
||||
*/
|
||||
kATSStyleNoHinting = 0x00000001,
|
||||
|
||||
/*
|
||||
* Specifies that ATS produce antialiased glyph images despite system
|
||||
* preferences or CGContext settings.
|
||||
*/
|
||||
kATSStyleApplyAntiAliasing = 0x00000002,
|
||||
|
||||
/*
|
||||
* Specifies that ATS turn-off antialiasing glyph imaging despite
|
||||
* system preferences or CGContext settings (negates
|
||||
* kATSStyleApplyAntiAliasing bit if set).
|
||||
*/
|
||||
kATSStyleNoAntiAliasing = 0x00000004,
|
||||
|
||||
/*
|
||||
* These bits are reserved by Apple and will result in a invalid
|
||||
* value error if attemped to set.
|
||||
*/
|
||||
kATSStyleAppleReserved = (unsigned long)0xFFFFFFF8,
|
||||
|
||||
/*
|
||||
* (OBSOLETE) Specifies that ATS produce "hinted" glyph outlines (the
|
||||
* default behavior). THIS NAME IS OBSOLETE. DO NOT USE. It's only
|
||||
* left in for backwards compatibility.
|
||||
*/
|
||||
kATSStyleApplyHints = kATSStyleNoOptions
|
||||
};
|
||||
|
||||
/* --------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ATSGlyphInfoFlags
|
||||
*
|
||||
* Summary:
|
||||
* ATSGlyphInfoFlags are set in the individual ATSLayoutRecord
|
||||
* structures and apply only to the ATSGlyphRef in that structure.
|
||||
* The are used by the layout engine to flag a glyph with specific
|
||||
* properties.
|
||||
*/
|
||||
typedef UInt32 ATSGlyphInfoFlags;
|
||||
enum {
|
||||
|
||||
/*
|
||||
* These bits are Apple reserved and may result in an invalid value
|
||||
* error if attempted to set.
|
||||
*/
|
||||
kATSGlyphInfoAppleReserved = 0x1FFBFFE8,
|
||||
|
||||
/*
|
||||
* The glyph attaches to another glyph.
|
||||
*/
|
||||
kATSGlyphInfoIsAttachment = (unsigned long)0x80000000,
|
||||
|
||||
/*
|
||||
* The glyph can hang off left/top edge of line.
|
||||
*/
|
||||
kATSGlyphInfoIsLTHanger = 0x40000000,
|
||||
|
||||
/*
|
||||
* The glyph can hang off right/bottom edge of line.
|
||||
*/
|
||||
kATSGlyphInfoIsRBHanger = 0x20000000,
|
||||
|
||||
/*
|
||||
* The glyph is not really a glyph at all, but an end-marker designed
|
||||
* to allow the calculation of the previous glyph's advance.
|
||||
*/
|
||||
kATSGlyphInfoTerminatorGlyph = 0x00080000,
|
||||
|
||||
/*
|
||||
* The glyph is a white space glyph.
|
||||
*/
|
||||
kATSGlyphInfoIsWhiteSpace = 0x00040000,
|
||||
|
||||
/*
|
||||
* Glyph has a style specified imposed width (i.e. advance)
|
||||
*/
|
||||
kATSGlyphInfoHasImposedWidth = 0x00000010,
|
||||
|
||||
/*
|
||||
* A three-bit mask, that can be used to get the size of the original
|
||||
* character that spawned this glyph. When a logical 'and' operation
|
||||
* with this mask and an ATSGlyphInfoFlags variable, it will yield
|
||||
* the size in bytes of the original character (0 - 7 bytes possible).
|
||||
*/
|
||||
kATSGlyphInfoByteSizeMask = 0x00000007
|
||||
};
|
||||
|
||||
/* --------------------------------------------------------------------------- */
|
||||
/* STRUCTURED TYPES and related constants */
|
||||
/* --------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSLayoutRecord
|
||||
*
|
||||
* Summary:
|
||||
* The ATSLayoutRecord structure defines all the needed info for a
|
||||
* single glyph during the layout process. This struct must be
|
||||
* declared as the first element of an enclosing glyph record struct
|
||||
* defined by ATSUI DirectAccess clients.
|
||||
*/
|
||||
struct ATSLayoutRecord {
|
||||
|
||||
/*
|
||||
* The glyph ID reference.
|
||||
*/
|
||||
ATSGlyphRef glyphID;
|
||||
|
||||
/*
|
||||
* These flags describe the individual state of the glyph (see above).
|
||||
*/
|
||||
ATSGlyphInfoFlags flags;
|
||||
|
||||
/*
|
||||
* The byte offset of the original character that spawned this glyph.
|
||||
*/
|
||||
ByteCount originalOffset;
|
||||
|
||||
/*
|
||||
* This is the real position that the glyph sits.
|
||||
*/
|
||||
Fixed realPos;
|
||||
};
|
||||
typedef struct ATSLayoutRecord ATSLayoutRecord;
|
||||
/* --------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSTrapezoid
|
||||
*
|
||||
* Summary:
|
||||
* The ATSTrapezoid structure supplies a convenient container for
|
||||
* glyph bounds in trapezoidal form.
|
||||
*/
|
||||
struct ATSTrapezoid {
|
||||
FixedPoint upperLeft;
|
||||
FixedPoint upperRight;
|
||||
FixedPoint lowerRight;
|
||||
FixedPoint lowerLeft;
|
||||
};
|
||||
typedef struct ATSTrapezoid ATSTrapezoid;
|
||||
/* --------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSJustWidthDeltaEntryOverride
|
||||
*
|
||||
* Summary:
|
||||
* The JustWidthDeltaEntryOverride structure specifies values for
|
||||
* the grow and shrink case during justification, both on the left
|
||||
* and on the right. It also contains flags. This particular
|
||||
* structure is used for passing justification overrides to LLC. For
|
||||
* further sfnt resource 'just' table constants and structures, see
|
||||
* SFNTLayoutTypes.h.
|
||||
*/
|
||||
struct ATSJustWidthDeltaEntryOverride {
|
||||
|
||||
/*
|
||||
* ems AW can grow by at most on LT
|
||||
*/
|
||||
Fixed beforeGrowLimit;
|
||||
|
||||
/*
|
||||
* ems AW can shrink by at most on LT
|
||||
*/
|
||||
Fixed beforeShrinkLimit;
|
||||
|
||||
/*
|
||||
* ems AW can grow by at most on RB
|
||||
*/
|
||||
Fixed afterGrowLimit;
|
||||
|
||||
/*
|
||||
* ems AW can shrink by at most on RB
|
||||
*/
|
||||
Fixed afterShrinkLimit;
|
||||
|
||||
/*
|
||||
* flags controlling grow case
|
||||
*/
|
||||
JustificationFlags growFlags;
|
||||
|
||||
/*
|
||||
* flags controlling shrink case
|
||||
*/
|
||||
JustificationFlags shrinkFlags;
|
||||
};
|
||||
typedef struct ATSJustWidthDeltaEntryOverride ATSJustWidthDeltaEntryOverride;
|
||||
/* The JustPriorityOverrides type is an array of 4 width delta records, one per priority level override. */
|
||||
typedef ATSJustWidthDeltaEntryOverride ATSJustPriorityWidthDeltaOverrides[4];
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSULineRef
|
||||
*
|
||||
* Summary:
|
||||
* A reference to a line that is being laid out. This is passed into
|
||||
* the ATSUDirectLayoutOperationOverrideUPP callback function to be
|
||||
* used by the ATSUDirectGetLayoutDataArrayPtrFromLineRef function.
|
||||
* The only way to get a line ref is inside of the callback. The
|
||||
* only time the line ref is valid is inside of the callback.
|
||||
*/
|
||||
typedef struct ATSGlyphVector* ATSULineRef;
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* DirectAccess Layout Callback Definitions */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSUDirectLayoutOperationOverrideProcPtr
|
||||
*
|
||||
* Summary:
|
||||
* Callback definition for a low-level adjustment routine hook.
|
||||
*
|
||||
* Discussion:
|
||||
* This callback can be set in an ATSUTextLayout object by setting
|
||||
* the attribute tag kATSULayoutOperationOverrideUPP and passing in
|
||||
* a ATSULayoutOperationOverrideSpecifier structure into
|
||||
* ATSUSetLayoutAttribute. This callback will be called whenever an
|
||||
* ATSUI call triggers a re-layout for each operation it is
|
||||
* installed for. The operation that triggered the callback will be
|
||||
* set in the iCurrentOperation parameter. The callback function
|
||||
* defined by the developer is only required to do one thing: return
|
||||
* it's status to ATSUI as to what it has done. This is done via the
|
||||
* oCallbackStatus parameter. It needs to tell ATSUI if it had
|
||||
* handled the layout operation or if it still needs ATSUI to run
|
||||
* it's own processes. iOperationCallbackParameterPtr is there in
|
||||
* case there are ever any ATSUDirectLayoutOperationSelector which
|
||||
* require extra parameters to be passed into the callback function.
|
||||
* It is currently unused and will always be set to NULL. iRefCon is
|
||||
* the constant that is set in the ATSUTextLayout object that
|
||||
* spawned the operation by the ATSUSetTextLayoutRefCon() API.
|
||||
* Within the context of the callback itself, only a limited subset
|
||||
* of ATSUI APIs may be called. Basically, only the APIs that have
|
||||
* no chance of triggering a re-layout are allowed to be called. The
|
||||
* reason for this restriction is to prevent runaway recursion. Most
|
||||
* of the APIs that have "create", "get", or "copy" are safe. Any
|
||||
* attempt to call one of the restricted APIs will result in an
|
||||
* immediate return with the kATSUInvalidCallInsideCallbackErr
|
||||
* error. ATSULayoutOperationSelector and
|
||||
* ATSULayoutOperationCallbackStatus are defined in ATSLayoutTypes.i.
|
||||
*/
|
||||
typedef CALLBACK_API_C( OSStatus , ATSUDirectLayoutOperationOverrideProcPtr )(ATSULayoutOperationSelector iCurrentOperation, ATSULineRef iLineRef, UInt32 iRefCon, void *iOperationCallbackParameterPtr, ATSULayoutOperationCallbackStatus *oCallbackStatus);
|
||||
typedef TVECTOR_UPP_TYPE(ATSUDirectLayoutOperationOverrideProcPtr) ATSUDirectLayoutOperationOverrideUPP;
|
||||
/*
|
||||
* NewATSUDirectLayoutOperationOverrideUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( ATSUDirectLayoutOperationOverrideUPP )
|
||||
NewATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppATSUDirectLayoutOperationOverrideProcInfo = 0x0000FFF1 }; /* 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(ATSUDirectLayoutOperationOverrideUPP) NewATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideProcPtr userRoutine) { return userRoutine; }
|
||||
#else
|
||||
#define NewATSUDirectLayoutOperationOverrideUPP(userRoutine) (userRoutine)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeATSUDirectLayoutOperationOverrideUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeATSUDirectLayoutOperationOverrideUPP(ATSUDirectLayoutOperationOverrideUPP) {}
|
||||
#else
|
||||
#define DisposeATSUDirectLayoutOperationOverrideUPP(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeATSUDirectLayoutOperationOverrideUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
InvokeATSUDirectLayoutOperationOverrideUPP(
|
||||
ATSULayoutOperationSelector iCurrentOperation,
|
||||
ATSULineRef iLineRef,
|
||||
UInt32 iRefCon,
|
||||
void * iOperationCallbackParameterPtr,
|
||||
ATSULayoutOperationCallbackStatus * oCallbackStatus,
|
||||
ATSUDirectLayoutOperationOverrideUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSStatus) InvokeATSUDirectLayoutOperationOverrideUPP(ATSULayoutOperationSelector iCurrentOperation, ATSULineRef iLineRef, UInt32 iRefCon, void * iOperationCallbackParameterPtr, ATSULayoutOperationCallbackStatus * oCallbackStatus, ATSUDirectLayoutOperationOverrideUPP userUPP) { return (*userUPP)(iCurrentOperation, iLineRef, iRefCon, iOperationCallbackParameterPtr, oCallbackStatus); }
|
||||
#else
|
||||
#define InvokeATSUDirectLayoutOperationOverrideUPP(iCurrentOperation, iLineRef, iRefCon, iOperationCallbackParameterPtr, oCallbackStatus, userUPP) (*userUPP)(iCurrentOperation, iLineRef, iRefCon, iOperationCallbackParameterPtr, oCallbackStatus)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSULayoutOperationOverrideSpecifier
|
||||
*
|
||||
* Summary:
|
||||
* This structure is used to install a callback for one or more
|
||||
* ATSUI operations. To do this, simply passed one of these
|
||||
* structure into the ATSUSetLayoutControls call with the
|
||||
* kATSULayoutOperationOverrideUPP tag.
|
||||
*/
|
||||
struct ATSULayoutOperationOverrideSpecifier {
|
||||
|
||||
|
||||
/*
|
||||
* A bitfield containing the selector for the operations in which the
|
||||
* callback will be installed for.
|
||||
*/
|
||||
ATSULayoutOperationSelector operationSelector;
|
||||
ATSUDirectLayoutOperationOverrideUPP overrideUPP;
|
||||
|
||||
};
|
||||
typedef struct ATSULayoutOperationOverrideSpecifier ATSULayoutOperationOverrideSpecifier;
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ATSLAYOUTTYPES__ */
|
||||
|
||||
@@ -0,0 +1,369 @@
|
||||
/*
|
||||
File: ATSTypes.h
|
||||
|
||||
Contains: Public interfaces for Apple Type Services components.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1997-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __ATSTYPES__
|
||||
#define __ATSTYPES__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __FILES__
|
||||
#include <Files.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MIXEDMODE__
|
||||
#include <MixedMode.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
typedef UInt32 FMGeneration;
|
||||
/* The FMFontFamily reference represents a collection of fonts with the same design
|
||||
characteristics. It replaces the standard QuickDraw font identifer and may be used
|
||||
with all QuickDraw functions including GetFontName and TextFont. It cannot be used
|
||||
with the Resource Manager to access information from a FOND resource handle. A font
|
||||
reference does not imply a particular script system, nor is the character encoding
|
||||
of a font family determined by an arithmetic mapping of its value.
|
||||
*/
|
||||
typedef SInt16 FMFontFamily;
|
||||
typedef SInt16 FMFontStyle;
|
||||
typedef SInt16 FMFontSize;
|
||||
/*
|
||||
The font family is a collection of fonts, each of which is identified
|
||||
by an FMFont reference that maps to a single object registered with
|
||||
the font database. The font references associated with the font
|
||||
family consist of individual outline and bitmapped fonts that may be
|
||||
used with the font access routines of the Font Manager and ATS.
|
||||
*/
|
||||
typedef UInt32 FMFont;
|
||||
struct FMFontFamilyInstance {
|
||||
FMFontFamily fontFamily;
|
||||
FMFontStyle fontStyle;
|
||||
};
|
||||
typedef struct FMFontFamilyInstance FMFontFamilyInstance;
|
||||
struct FMFontFamilyIterator {
|
||||
UInt32 reserved[16];
|
||||
};
|
||||
typedef struct FMFontFamilyIterator FMFontFamilyIterator;
|
||||
struct FMFontIterator {
|
||||
UInt32 reserved[16];
|
||||
};
|
||||
typedef struct FMFontIterator FMFontIterator;
|
||||
struct FMFontFamilyInstanceIterator {
|
||||
UInt32 reserved[16];
|
||||
};
|
||||
typedef struct FMFontFamilyInstanceIterator FMFontFamilyInstanceIterator;
|
||||
enum {
|
||||
kInvalidGeneration = 0L,
|
||||
kInvalidFontFamily = -1,
|
||||
kInvalidFont = 0L
|
||||
};
|
||||
|
||||
enum {
|
||||
kFMCurrentFilterFormat = 0L
|
||||
};
|
||||
|
||||
typedef UInt32 FMFilterSelector;
|
||||
enum {
|
||||
kFMFontTechnologyFilterSelector = 1L,
|
||||
kFMFontContainerFilterSelector = 2L,
|
||||
kFMGenerationFilterSelector = 3L,
|
||||
kFMFontFamilyCallbackFilterSelector = 4L,
|
||||
kFMFontCallbackFilterSelector = 5L,
|
||||
kFMFontDirectoryFilterSelector = 6L
|
||||
};
|
||||
|
||||
enum {
|
||||
kFMTrueTypeFontTechnology = FOUR_CHAR_CODE('true'),
|
||||
kFMPostScriptFontTechnology = FOUR_CHAR_CODE('typ1')
|
||||
};
|
||||
|
||||
typedef CALLBACK_API( OSStatus , FMFontFamilyCallbackFilterProcPtr )(FMFontFamily iFontFamily, void *iRefCon);
|
||||
typedef CALLBACK_API( OSStatus , FMFontCallbackFilterProcPtr )(FMFont iFont, void *iRefCon);
|
||||
typedef STACK_UPP_TYPE(FMFontFamilyCallbackFilterProcPtr) FMFontFamilyCallbackFilterUPP;
|
||||
typedef STACK_UPP_TYPE(FMFontCallbackFilterProcPtr) FMFontCallbackFilterUPP;
|
||||
/*
|
||||
* NewFMFontFamilyCallbackFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( FMFontFamilyCallbackFilterUPP )
|
||||
NewFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppFMFontFamilyCallbackFilterProcInfo = 0x000003B0 }; /* pascal 4_bytes Func(2_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(FMFontFamilyCallbackFilterUPP) NewFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterProcPtr userRoutine) { return (FMFontFamilyCallbackFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFMFontFamilyCallbackFilterProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewFMFontFamilyCallbackFilterUPP(userRoutine) (FMFontFamilyCallbackFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFMFontFamilyCallbackFilterProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewFMFontCallbackFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( FMFontCallbackFilterUPP )
|
||||
NewFMFontCallbackFilterUPP(FMFontCallbackFilterProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppFMFontCallbackFilterProcInfo = 0x000003F0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(FMFontCallbackFilterUPP) NewFMFontCallbackFilterUPP(FMFontCallbackFilterProcPtr userRoutine) { return (FMFontCallbackFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFMFontCallbackFilterProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewFMFontCallbackFilterUPP(userRoutine) (FMFontCallbackFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFMFontCallbackFilterProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeFMFontFamilyCallbackFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeFMFontFamilyCallbackFilterUPP(FMFontFamilyCallbackFilterUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeFMFontFamilyCallbackFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeFMFontCallbackFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeFMFontCallbackFilterUPP(FMFontCallbackFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeFMFontCallbackFilterUPP(FMFontCallbackFilterUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeFMFontCallbackFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeFMFontFamilyCallbackFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
InvokeFMFontFamilyCallbackFilterUPP(
|
||||
FMFontFamily iFontFamily,
|
||||
void * iRefCon,
|
||||
FMFontFamilyCallbackFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSStatus) InvokeFMFontFamilyCallbackFilterUPP(FMFontFamily iFontFamily, void * iRefCon, FMFontFamilyCallbackFilterUPP userUPP) { return (OSStatus)CALL_TWO_PARAMETER_UPP(userUPP, uppFMFontFamilyCallbackFilterProcInfo, iFontFamily, iRefCon); }
|
||||
#else
|
||||
#define InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userUPP) (OSStatus)CALL_TWO_PARAMETER_UPP((userUPP), uppFMFontFamilyCallbackFilterProcInfo, (iFontFamily), (iRefCon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeFMFontCallbackFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
InvokeFMFontCallbackFilterUPP(
|
||||
FMFont iFont,
|
||||
void * iRefCon,
|
||||
FMFontCallbackFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSStatus) InvokeFMFontCallbackFilterUPP(FMFont iFont, void * iRefCon, FMFontCallbackFilterUPP userUPP) { return (OSStatus)CALL_TWO_PARAMETER_UPP(userUPP, uppFMFontCallbackFilterProcInfo, iFont, iRefCon); }
|
||||
#else
|
||||
#define InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userUPP) (OSStatus)CALL_TWO_PARAMETER_UPP((userUPP), uppFMFontCallbackFilterProcInfo, (iFont), (iRefCon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewFMFontFamilyCallbackFilterProc(userRoutine) NewFMFontFamilyCallbackFilterUPP(userRoutine)
|
||||
#define NewFMFontCallbackFilterProc(userRoutine) NewFMFontCallbackFilterUPP(userRoutine)
|
||||
#define CallFMFontFamilyCallbackFilterProc(userRoutine, iFontFamily, iRefCon) InvokeFMFontFamilyCallbackFilterUPP(iFontFamily, iRefCon, userRoutine)
|
||||
#define CallFMFontCallbackFilterProc(userRoutine, iFont, iRefCon) InvokeFMFontCallbackFilterUPP(iFont, iRefCon, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
struct FMFontDirectoryFilter {
|
||||
SInt16 fontFolderDomain;
|
||||
UInt32 reserved[2];
|
||||
};
|
||||
typedef struct FMFontDirectoryFilter FMFontDirectoryFilter;
|
||||
struct FMFilter {
|
||||
UInt32 format;
|
||||
FMFilterSelector selector;
|
||||
union {
|
||||
FourCharCode fontTechnologyFilter;
|
||||
FSSpec fontContainerFilter;
|
||||
FMGeneration generationFilter;
|
||||
FMFontFamilyCallbackFilterUPP fontFamilyCallbackFilter;
|
||||
FMFontCallbackFilterUPP fontCallbackFilter;
|
||||
FMFontDirectoryFilter fontDirectoryFilter;
|
||||
} filter;
|
||||
};
|
||||
typedef struct FMFilter FMFilter;
|
||||
|
||||
typedef OptionBits ATSOptionFlags;
|
||||
typedef UInt32 ATSGeneration;
|
||||
typedef UInt32 ATSFontContainerRef;
|
||||
typedef UInt32 ATSFontFamilyRef;
|
||||
typedef UInt32 ATSFontRef;
|
||||
typedef UInt16 ATSGlyphRef;
|
||||
typedef Float32 ATSFontSize;
|
||||
enum {
|
||||
kATSGenerationUnspecified = 0L,
|
||||
kATSFontContainerRefUnspecified = 0L,
|
||||
kATSFontFamilyRefUnspecified = 0L,
|
||||
kATSFontRefUnspecified = 0L
|
||||
};
|
||||
|
||||
struct ATSFontMetrics {
|
||||
UInt32 version;
|
||||
Float32 ascent; /* Maximum height above baseline reached by the glyphs in the font */
|
||||
/* or maximum distance to the right of the centerline reached by the glyphs in the font */
|
||||
Float32 descent; /* Maximum depth below baseline reached by the glyphs in the font */
|
||||
/* or maximum distance to the left of the centerline reached by the glyphs in the font */
|
||||
Float32 leading; /* Desired spacing between lines of text */
|
||||
Float32 avgAdvanceWidth;
|
||||
Float32 maxAdvanceWidth; /* Maximum advance width or height of the glyphs in the font */
|
||||
Float32 minLeftSideBearing; /* Minimum left or top side bearing */
|
||||
Float32 minRightSideBearing; /* Minimum right or bottom side bearing */
|
||||
Float32 stemWidth; /* Width of the dominant vertical stems of the glyphs in the font */
|
||||
Float32 stemHeight; /* Vertical width of the dominant horizontal stems of glyphs in the font */
|
||||
Float32 capHeight; /* Height of a capital letter from the baseline to the top of the letter */
|
||||
Float32 xHeight; /* Height of lowercase characters in a font, specifically the letter x, excluding ascenders and descenders */
|
||||
Float32 italicAngle; /* Angle in degrees counterclockwise from the vertical of the dominant vertical strokes of the glyphs in the font */
|
||||
Float32 underlinePosition; /* Distance from the baseline for positioning underlining strokes */
|
||||
Float32 underlineThickness; /* Stroke width for underlining */
|
||||
};
|
||||
typedef struct ATSFontMetrics ATSFontMetrics;
|
||||
enum {
|
||||
kATSItalicQDSkew = (1 << 16) / 4, /* fixed value of 0.25 */
|
||||
kATSBoldQDStretch = (1 << 16) * 3 / 2, /* fixed value of 1.50 */
|
||||
kATSRadiansFactor = 1144 /* fixed value of approx. pi/180 (0.0174560546875) */
|
||||
};
|
||||
|
||||
/* Glyph outline path constants used in ATSFontGetNativeCurveType. */
|
||||
typedef UInt16 ATSCurveType;
|
||||
enum {
|
||||
kATSCubicCurveType = 0x0001,
|
||||
kATSQuadCurveType = 0x0002,
|
||||
kATSOtherCurveType = 0x0003
|
||||
};
|
||||
|
||||
/*
|
||||
This is what the ATSGlyphRef is set to when the glyph is deleted -
|
||||
that is, when the glyph is set to no longer appear when the layout
|
||||
is actually drawn
|
||||
*/
|
||||
enum {
|
||||
kATSDeletedGlyphcode = 0xFFFF
|
||||
};
|
||||
|
||||
struct ATSUCurvePath {
|
||||
UInt32 vectors;
|
||||
UInt32 controlBits[1];
|
||||
Float32Point vector[1];
|
||||
};
|
||||
typedef struct ATSUCurvePath ATSUCurvePath;
|
||||
struct ATSUCurvePaths {
|
||||
UInt32 contours;
|
||||
ATSUCurvePath contour[1];
|
||||
};
|
||||
typedef struct ATSUCurvePaths ATSUCurvePaths;
|
||||
/* Glyph ideal metrics */
|
||||
struct ATSGlyphIdealMetrics {
|
||||
Float32Point advance;
|
||||
Float32Point sideBearing;
|
||||
Float32Point otherSideBearing;
|
||||
};
|
||||
typedef struct ATSGlyphIdealMetrics ATSGlyphIdealMetrics;
|
||||
/* Glyph screen metrics */
|
||||
struct ATSGlyphScreenMetrics {
|
||||
Float32Point deviceAdvance;
|
||||
Float32Point topLeft;
|
||||
UInt32 height;
|
||||
UInt32 width;
|
||||
Float32Point sideBearing;
|
||||
Float32Point otherSideBearing;
|
||||
};
|
||||
typedef struct ATSGlyphScreenMetrics ATSGlyphScreenMetrics;
|
||||
/* Glyph References */
|
||||
|
||||
typedef ATSGlyphRef GlyphID;
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ATSTYPES__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,423 @@
|
||||
/*
|
||||
File: ATSUnicodeDirectAccess.h
|
||||
|
||||
Contains: Public Interfaces/Types for Low Level ATSUI
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2002 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __ATSUNICODEDIRECTACCESS__
|
||||
#define __ATSUNICODEDIRECTACCESS__
|
||||
|
||||
#ifndef __ATSUNICODE__
|
||||
#include <ATSUnicode.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* Constants */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSUDirectDataSelector
|
||||
*
|
||||
* Summary:
|
||||
* These are the data selectors used in the
|
||||
* ATSUDirectGetLayoutDataArrayPtr function to get the needed layout
|
||||
* data array pointer.
|
||||
*/
|
||||
typedef UInt32 ATSUDirectDataSelector;
|
||||
enum {
|
||||
|
||||
/*
|
||||
* Returns the parallel advance delta (delta X) array. (Array Type):
|
||||
* Fixed (Return Time): Constant, unless creation is necessary, or
|
||||
* unless requested by ATSUDirectGetLayoutDataArrayPtrFromTextLayout.
|
||||
* (Creation): This array is created only on demand. Thus, if any
|
||||
* changes are to be made iCreate should be set to true. If the array
|
||||
* had not been previously allocated it will be allocated and
|
||||
* zero-filled when iCreate is set to true.
|
||||
*/
|
||||
kATSUDirectDataAdvanceDeltaFixedArray = 0L,
|
||||
|
||||
/*
|
||||
* Returns the parallel baseline delta (delta Y) array. (Array Type):
|
||||
* Fixed (Return Time): Constant, unless creation is necessary, or
|
||||
* unless requested by ATSUDirectGetLayoutDataArrayPtrFromTextLayout.
|
||||
* (Creation): This array is created only on demand. Thus, if any
|
||||
* changes are to be made iCreate should be set to true. If the array
|
||||
* had not been previously allocated it will be allocated and
|
||||
* zero-filled when iCreate is set to true.
|
||||
*/
|
||||
kATSUDirectDataBaselineDeltaFixedArray = 1L,
|
||||
|
||||
/*
|
||||
* Returns the parallel device delta array for device- specific
|
||||
* tweaking. This is an array of values which are used to adjust
|
||||
* truncated fractional values for devices that do not accept
|
||||
* fractional positioning. It is also used to provide precise
|
||||
* positioning for connected scripts. (Array Type): SInt16 (Return
|
||||
* Time): Constant, unless creation is necessary, or unless requested
|
||||
* by ATSUDirectGetLayoutDataArrayPtrFromTextLayout. (Creation): This
|
||||
* array is created only on demand. Thus, if any changes are to be
|
||||
* made iCreate should be set to true. If the array had not been
|
||||
* previously allocated it will be allocated and zero-filled when
|
||||
* iCreate is set to true.
|
||||
*/
|
||||
kATSUDirectDataDeviceDeltaSInt16Array = 2L,
|
||||
|
||||
/*
|
||||
* Returns the parallel style index array. The indexes setting in the
|
||||
* array are indexes into the the StyleSetting array, which can be
|
||||
* obtained using the
|
||||
* kATSUDirectDataStyleSettingATSUStyleSettingRefArray below. (Array
|
||||
* Type): UInt16 (Return Time): Constant, unless creation is
|
||||
* necessary, or unless requested by
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromTextLayout. (Creation): This
|
||||
* array is created only on demand. Thus, if any changes are to be
|
||||
* made iCreate should be set to true. If the array had not been
|
||||
* previously allocated it will be allocated and zero-filled when
|
||||
* iCreate is set to true.
|
||||
*/
|
||||
kATSUDirectDataStyleIndexUInt16Array = 3L,
|
||||
|
||||
/*
|
||||
* Returns the style setting ref array. (Array Type):
|
||||
* ATSUStyleSettingRef (Return Time): Linear, based on the number of
|
||||
* styles applied to the given line. (Creation): This array is always
|
||||
* present if the layout has any text assigned to it at all. Setting
|
||||
* iCreate has no effect.
|
||||
*/
|
||||
kATSUDirectDataStyleSettingATSUStyleSettingRefArray = 4L,
|
||||
|
||||
/*
|
||||
* Returns the ATSLayoutRecord, version 1 array. This should not be
|
||||
* used directly at all. Rather, use the
|
||||
* kATSUDirectDataLayoutRecordATSLayoutRecordCurrent selector below.
|
||||
* This will ensure that the code will always be using the most
|
||||
* current version of the ATSLayoutRecord, should there ever be a
|
||||
* change. ATSUI will only ensure the most efficient processing will
|
||||
* occur for the latest version of ATSLayoutRecord. (Array Type):
|
||||
* ATSLayoutRecord, version 1 (Return Time): Constant, unless
|
||||
* creation is necessary, or unless requested by
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromTextLayout. (Creation): This
|
||||
* array is always present if the layout has any text assigned to it
|
||||
* at all. Setting iCreate has no effect
|
||||
*/
|
||||
kATSUDirectDataLayoutRecordATSLayoutRecordVersion1 = 100L,
|
||||
|
||||
/*
|
||||
* Returns the ATSLayoutRecord. This will return the most current
|
||||
* version of the ATSLayoutRecord, and the one that's defined in this
|
||||
* file. Always use kATSUDirectDataLayoutRecordATSLayoutRecordCurrent
|
||||
* to get the array of ATSLayoutRecords. (Array Type):
|
||||
* ATSLayoutRecord (Return Time): Constant, unless creation is
|
||||
* necessary, or unless requested by
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromTextLayout. (Creation): This
|
||||
* array is always present if the layout has any text assigned to it
|
||||
* at all. Setting iCreate has no effect.
|
||||
*/
|
||||
kATSUDirectDataLayoutRecordATSLayoutRecordCurrent = kATSUDirectDataLayoutRecordATSLayoutRecordVersion1
|
||||
};
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* Data Types */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* ATSUStyleSettingRef
|
||||
*
|
||||
* Summary:
|
||||
* A reference to a style setting object that represents an
|
||||
* ATSUStyle plus any cached/set information about that style.
|
||||
*/
|
||||
typedef struct ATSStyleSetting* ATSUStyleSettingRef;
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* Direct Accessors */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/*
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromLineRef()
|
||||
*
|
||||
* Summary:
|
||||
* Returns the data pointer specified by iDataSelector and
|
||||
* referenced by iLineRef.
|
||||
*
|
||||
* Discussion:
|
||||
* This function simply returns the data pointer specified by
|
||||
* iDataSelector and referenced by iLineRef. This data pointer
|
||||
* should not be freed directly after it's been used. Rather, it
|
||||
* should be released using ATSUDirectReleaseLayoutDataArrayPtr.
|
||||
* Doing so serves as a signal to ATSUI that the caller is done with
|
||||
* the data and that it can merge it in smoothly and adjust its
|
||||
* internal processes. Furthermore, it may be the case that the
|
||||
* pointer returned may be dynamically allocated one or contain
|
||||
* dynamically allocated data. If it's not properly freed, a memory
|
||||
* leak may result. This function may only be called within the
|
||||
* context of an ATSUDirectLayoutOperationOverrideUPP callback. The
|
||||
* pointer returned points to the exact data referenced by the
|
||||
* ATSUTextLayout object that triggered the callback call. This is
|
||||
* by far the most efficient way to use the direct access calls
|
||||
* because for most requested data, no allocation and copy is done.
|
||||
* Furthermore, because this a direct pointer to the data that ATSUI
|
||||
* will use for it's layout, the data arrays returned by this can be
|
||||
* tweaked and edited. Many of the requested arrays are created by
|
||||
* ATSUI only when necessary. If these arrays are to be altered,
|
||||
* then be sure to set iCreate to true. This will ensure that this
|
||||
* array is created. If the arrays are not created, ATSUI
|
||||
* automatically assumes that all entries in the array are zero. The
|
||||
* pointer returned by this function is only valid within the
|
||||
* context of the callback. Do not attempt to retain it for later
|
||||
* use.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* iLineRef:
|
||||
* The ATSULineRef which was passed into a
|
||||
* ATSUDirectLayoutOperationOverrideUPP callback function as a
|
||||
* parameter.
|
||||
*
|
||||
* iDataSelector:
|
||||
* The selector for the data that is being requested.
|
||||
*
|
||||
* iCreate:
|
||||
* If the ATSULineRef passed in iLineRef does not reference the
|
||||
* requested array, then a zero-filled one will be created and
|
||||
* returned in oLayoutDataArray if this is set to true. For some
|
||||
* ATSUDirectDataSelectors, these cannot be simply created. Thus,
|
||||
* this flag will have no affect on these few
|
||||
* ATSUDirectDataSelectors.
|
||||
*
|
||||
* oLayoutDataArrayPtr:
|
||||
* Upon sucessful return, this parameter will contain a pointer to
|
||||
* an array of the requested values if the ATSULineRef passed in
|
||||
* iLineRef references those values. If this is not the case, then
|
||||
* NULL will be returned, unless iCreate is set to true and the
|
||||
* array can be created. This parameter itself may be set to NULL
|
||||
* if only a count of the entries is needed.
|
||||
*
|
||||
* oLayoutDataCount:
|
||||
* Upon sucessful return, this parameter will contain a count of
|
||||
* the entries in the array returned in oLayoutDataArray.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
ATSUDirectGetLayoutDataArrayPtrFromLineRef(
|
||||
ATSULineRef iLineRef,
|
||||
ATSUDirectDataSelector iDataSelector,
|
||||
Boolean iCreate,
|
||||
void * oLayoutDataArrayPtr[], /* can be NULL */
|
||||
ItemCount * oLayoutDataCount);
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/*
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromTextLayout()
|
||||
*
|
||||
* Summary:
|
||||
* Returns the data pointer specified by iDataSelector and
|
||||
* referenced by iTextLayout for the line starting at iLineOffset.
|
||||
*
|
||||
* Discussion:
|
||||
* This function simply returns the data pointer specified by
|
||||
* iDataSelector and referenced by iTextLayout for the line starting
|
||||
* at iLineOffset. This data pointer should not be freed directly
|
||||
* after it's been used. Rather, it should be released using
|
||||
* ATSUDirectReleaseLayoutDataArrayPtr. Doing so serves as a signal
|
||||
* to ATSUI that the caller is done with the data. Furthermore, it
|
||||
* may be the case that the pointer returned may be dynamically
|
||||
* allocated one or contain dynamically allocated data. If it's not
|
||||
* properly freed, a memory leak may result. This function may not
|
||||
* be called inside the context of an
|
||||
* ATSUDirectLayoutOperationOverrideUPP callback for the
|
||||
* ATSUTextLayout data that triggered the callback. All data
|
||||
* returned will be a copy of the data in the object requested. This
|
||||
* means two things: first of all, this means that it's a very
|
||||
* inefficient way of using the data. All of the selectors that
|
||||
* would have returned in constant time now would be forced to
|
||||
* return in order-n time. Second of all, this means that the
|
||||
* developer cannot change any of the data. Any changes the
|
||||
* developer makes to the arrays returned by this API will have no
|
||||
* effect on the layout. Using the
|
||||
* kATSULayoutOperationPostLayoutAdjustment operation selector
|
||||
* override and the ATSUDirectGetLayoutDataArrayPtrFromLineRef is a
|
||||
* great alternative to using this API. Many of the requested arrays
|
||||
* are created by ATSUI only when necessary. This means that it's
|
||||
* possible that this API will return NULL pointer and a count of 0.
|
||||
* In this case, if there's no error returned, the array simply
|
||||
* doesn't exist and the caller should treat all of the entries in
|
||||
* the array that they would have recieved as being 0.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* iTextLayout:
|
||||
* The ATSUTextLayout object from which the requested data will
|
||||
* come from.
|
||||
*
|
||||
* iLineOffset:
|
||||
* The edge offset that corresponds to the beginning of the range
|
||||
* of text of the line of the requested data. If the text has
|
||||
* multiple lines, then ATSUDirectGetLayoutDataArrayPtrFromLineRef
|
||||
* will need to be called for each of the lines in which the
|
||||
* requested data is needed.
|
||||
*
|
||||
* iDataSelector:
|
||||
* The selector for the data that is being requested.
|
||||
*
|
||||
* oLayoutDataArrayPtr:
|
||||
* Upon sucessful return, this parameter will contain a pointer to
|
||||
* an array of the requested values if the ATSUTextLayout passed
|
||||
* in iTextLayout references those values for the line offset
|
||||
* iLineOffset. If this is not the case, then NULL will be
|
||||
* returned. This parameter itself may be set to NULL if only a
|
||||
* count of the entries is needed.
|
||||
*
|
||||
* oLayoutDataCount:
|
||||
* Upon sucessful return, this parameter will contain a count of
|
||||
* the entries in the array returned in oLayoutDataArray.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
ATSUDirectGetLayoutDataArrayPtrFromTextLayout(
|
||||
ATSUTextLayout iTextLayout,
|
||||
UniCharArrayOffset iLineOffset,
|
||||
ATSUDirectDataSelector iDataSelector,
|
||||
void * oLayoutDataArrayPtr[], /* can be NULL */
|
||||
ItemCount * oLayoutDataCount);
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/*
|
||||
* ATSUDirectReleaseLayoutDataArrayPtr()
|
||||
*
|
||||
* Summary:
|
||||
* Properly releases of an array pointer returned by
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromLineRef() or
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromTextLayout.
|
||||
*
|
||||
* Discussion:
|
||||
* This function is needed to let ATSUI know that the caller is
|
||||
* finished with the pointer that was previously requested by
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromLineRef() or
|
||||
* ATSUDirectGetLayoutDataArrayPtrFromTextLayout(). This is needed
|
||||
* in case ATSUI needs to make any internal adjustments to it's
|
||||
* internal structures.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* iLineRef:
|
||||
* The lineRef from which the layout data array pointer came from.
|
||||
* If the layout data array pointer did not come from a lineRef,
|
||||
* then set this to NULL.
|
||||
*
|
||||
* iDataSelector:
|
||||
* The selector for which iLayoutDataArrayPtr was obtained.
|
||||
*
|
||||
* iLayoutDataArrayPtr:
|
||||
* A pointer to the layout data array which is to be disposed of.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
ATSUDirectReleaseLayoutDataArrayPtr(
|
||||
ATSULineRef iLineRef, /* can be NULL */
|
||||
ATSUDirectDataSelector iDataSelector,
|
||||
void * iLayoutDataArrayPtr[]);
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/*
|
||||
* ATSUDirectAddStyleSettingRef()
|
||||
*
|
||||
* Summary:
|
||||
* This function will fetch a style index for the
|
||||
* ATSUStyleSettingRef passed in.
|
||||
*
|
||||
* Discussion:
|
||||
* This function allows for glyph replacement or substitution from
|
||||
* one layout or line to another layout or line. Not only will it
|
||||
* look up the style index for iStyleSettingRef, but if the
|
||||
* ATSUStyleSettingRef passed in iStyleSettingRef is not yet part of
|
||||
* the line referenced by iLineRef, it will add it. If there is an
|
||||
* outstanding ATSUStyleSettingRef array obtained by using the
|
||||
* kATSUDirectDataStyleSettingATSUStyleSettingRefArray selector, the
|
||||
* pointer obtained for this may no longer be valid after this
|
||||
* function has been called. These pointers should be freed before
|
||||
* calling this function and re-obtained afterwards.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* iLineRef:
|
||||
* An ATSULineRef which was passed into a
|
||||
* ATSUDirectLayoutOperationOverrideUPP callback function as a
|
||||
* parameter.
|
||||
*
|
||||
* iStyleSettingRef:
|
||||
* The ATSUStyleSettingRef to be looked up or added to the
|
||||
* ATSUTextLayout referenced by iTextLayout for the line starting
|
||||
* at the offset iLineOffset.
|
||||
*
|
||||
* oStyleIndex:
|
||||
* Upon sucessful return, this will parameter will be set to the
|
||||
* index of the ATSUStyleSettingRef passed in iStyleSettingRef for
|
||||
* the line referenced by iLineRef. If the ATSUStyleSettingRef
|
||||
* does not exist, in that context, then it will be added and the
|
||||
* new index will be returned here.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
ATSUDirectAddStyleSettingRef(
|
||||
ATSULineRef iLineRef,
|
||||
ATSUStyleSettingRef iStyleSettingRef,
|
||||
UInt16 * oStyleIndex);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ATSUNICODEDIRECTACCESS__ */
|
||||
|
||||
@@ -0,0 +1,552 @@
|
||||
/*
|
||||
File: ATSUnicodeFlattening.h
|
||||
|
||||
Contains: Public interfaces for Apple Type Services for Unicode Imaging
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2002 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __ATSUNICODEFLATTENING__
|
||||
#define __ATSUNICODEFLATTENING__
|
||||
|
||||
#ifndef __ATSUNICODE__
|
||||
#include <ATSUnicode.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* Constants */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/*
|
||||
ATSUFlattenedDataStreamFormat is used to inform the APIs which flatten and
|
||||
unflatten style runs exactly what type of data that they should be generating
|
||||
or parsing.
|
||||
*/
|
||||
typedef UInt32 ATSUFlattenedDataStreamFormat;
|
||||
enum {
|
||||
kATSUDataStreamUnicodeStyledText = FOUR_CHAR_CODE('ustl')
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
ATSUFlattenStyleRunOptions is a bitfield list of options that can be passed
|
||||
into the ATSUFlattenStyleRunsToStream API. Currently, there are no options.
|
||||
This is here for future expansion.
|
||||
*/
|
||||
typedef UInt32 ATSUFlattenStyleRunOptions;
|
||||
enum {
|
||||
kATSUFlattenOptionNoOptionsMask = 0x00000000
|
||||
};
|
||||
|
||||
/*
|
||||
ATSUUnFlattenStyleRunOptions is a bitfield list of options that can be passed
|
||||
into the ATSUUnFlattenStyleRunsToStream API. Currently, there are no options.
|
||||
This is here for future expansion.
|
||||
*/
|
||||
typedef UInt32 ATSUUnFlattenStyleRunOptions;
|
||||
enum {
|
||||
kATSUUnFlattenOptionNoOptionsMask = 0x00000000
|
||||
};
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* Data Types */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
ATSUStyleRunInfo is a structure that contrains an index into an array of
|
||||
unique ATSUStyle objects as well as the length of the run that the style run
|
||||
object covers. This structure is utilized by ATSUUnflattenStyleRunsFromStream()
|
||||
to return the style run info to the caller.
|
||||
*/
|
||||
struct ATSUStyleRunInfo {
|
||||
UniCharCount runLength;
|
||||
ItemCount styleObjectIndex;
|
||||
};
|
||||
typedef struct ATSUStyleRunInfo ATSUStyleRunInfo;
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* 'ustl' structure data structures and definitions */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/*
|
||||
The 'ustl' data structure follows this format:
|
||||
1. Main Data Structure Block Header
|
||||
2. Flattened Text Layout Data
|
||||
3. Flattened Style Run Data
|
||||
4. Flattened Style Data
|
||||
Per the 'ustl' spec, these structures should maintain four-byte alignment.
|
||||
For things that are variable width (such as font names), padding bytes must
|
||||
be added to ensure that this alignment is always kept.
|
||||
*/
|
||||
|
||||
/*
|
||||
structure versioning - the version of the 'ustl' that the ATSUI parsing
|
||||
and generating functions will handle is version 2 or greater. Earlier
|
||||
versions were not completly specified and have been obsoleted.
|
||||
*/
|
||||
enum {
|
||||
kATSFlatDataUstlVersion0 = 0,
|
||||
kATSFlatDataUstlVersion1 = 1,
|
||||
kATSFlatDataUstlVersion2 = 2,
|
||||
kATSFlatDataUstlCurrentVersion = kATSFlatDataUstlVersion2
|
||||
};
|
||||
|
||||
/* ------------------ */
|
||||
/* Block 1 Structures */
|
||||
/* ------------------ */
|
||||
|
||||
/*
|
||||
This is the main data structure block header. It describes the rest
|
||||
of the data and how it is structured.
|
||||
*/
|
||||
struct ATSFlatDataMainHeaderBlock {
|
||||
|
||||
/* the 'ustl' version number. This needs to be the first item in the*/
|
||||
/* data block do as not to confuse parsers of earlier (and possibly*/
|
||||
/* later) versions of the spec *|*/
|
||||
UInt32 version;
|
||||
|
||||
/* the total size of the stream in bytes, including the four bytes in*/
|
||||
/* the version above*/
|
||||
ByteCount sizeOfDataBlock;
|
||||
|
||||
/* offset from the beginning of the stream to the flattened text layout data.*/
|
||||
/* This can be set to 0 if there are no text layouts stored in the stream.*/
|
||||
ByteCount offsetToTextLayouts;
|
||||
|
||||
/* offset from the beginning of the stream to the flattened style run data. */
|
||||
/* This can be set to 0 if there is no flattened style run data in the stream*/
|
||||
ByteCount offsetToStyleRuns;
|
||||
|
||||
/* offset to the flattened style list data. This can be set to 0 if there*/
|
||||
/* is no flattened style list data*/
|
||||
ByteCount offsetToStyleList;
|
||||
};
|
||||
typedef struct ATSFlatDataMainHeaderBlock ATSFlatDataMainHeaderBlock;
|
||||
/* ------------------ */
|
||||
/* Block 2 Structures */
|
||||
/* ------------------ */
|
||||
/*
|
||||
The Block 2 Structures are not currently used by any of ATSUI's internal parsing
|
||||
or packing routines. They are, however, part of the 'ustl' standard and are put
|
||||
here for developer conveniance, as well as to properly define the standard.
|
||||
*/
|
||||
|
||||
/*
|
||||
This is the the main header for block 2. If there is a block 2, then there
|
||||
needs to be one of these. This structure is what the offsetToTextLayouts
|
||||
points to in block 1.
|
||||
*/
|
||||
struct ATSFlatDataTextLayoutDataHeader {
|
||||
|
||||
/* the total size of this particular flattened text layout, including any*/
|
||||
/* padding bytes and such. */
|
||||
ByteCount sizeOfLayoutData;
|
||||
|
||||
/* the number of characters covered by this flattened text layout*/
|
||||
ByteCount textLayoutLength;
|
||||
|
||||
/* the byte offset relative to the start of this structure to the flattened*/
|
||||
/* layout control data. This can be set to zero if there are no layout*/
|
||||
/* controls.*/
|
||||
ByteCount offsetToLayoutControls;
|
||||
|
||||
/* the byte offset, relative to the start of this structure to the*/
|
||||
/* flattened line info. This can be set to zero if there is no line info */
|
||||
/* in this layout.*/
|
||||
ByteCount offsetToLineInfo;
|
||||
|
||||
/* if the offsetToLayoutControls is non-zero, then following this block*/
|
||||
/* there will be a ATSFlattenedLayoutDataFlattenedLayoutControlsHeader*/
|
||||
/* followed by an array of ATSFlattenedLayoutDataFlattenedLayoutControls*/
|
||||
/* structures. If the offsetToLineInfo is non-zero, then following the*/
|
||||
/* flattened layout controls will be a ATSFlatDataLineInfoHeader*/
|
||||
/* structure.*/
|
||||
};
|
||||
typedef struct ATSFlatDataTextLayoutDataHeader ATSFlatDataTextLayoutDataHeader;
|
||||
/*
|
||||
This is the header for the flattened layout controls structure. This is
|
||||
the structure that a non-zero offsetToLayoutControls points to in the
|
||||
ATSFlatDataTextLayoutDataHeader
|
||||
*/
|
||||
struct ATSFlatDataLayoutControlsDataHeader {
|
||||
|
||||
/* the number of flattened layout controls. It is suggested that there be*/
|
||||
/* at least one layout control to output the line direction for the layout*/
|
||||
ItemCount numberOfLayoutControls;
|
||||
|
||||
/* first of possibly many flattened layout controls. There should be one */
|
||||
/* of these for each layout control as determined by the*/
|
||||
/* numberOfLayoutControls above. Of course, if there are no layout controls,*/
|
||||
/* then this structure shouldn't even exist. Each attribute info structure*/
|
||||
/* in the array could be followed by additional padding bytes in order*/
|
||||
/* to maintain four-byte alignment. These padding bytes are not to be*/
|
||||
/* included in the fValueSize member of each structure. */
|
||||
ATSUAttributeInfo controlArray[1];
|
||||
};
|
||||
typedef struct ATSFlatDataLayoutControlsDataHeader ATSFlatDataLayoutControlsDataHeader;
|
||||
struct ATSFlatDataLineInfoData {
|
||||
|
||||
/* the length of this particular line in UniChars*/
|
||||
UniCharCount lineLength;
|
||||
|
||||
/* the number of line controls applied to this line. This can be set*/
|
||||
/* to zero if there are no special line controls applied to this line.*/
|
||||
ItemCount numberOfLineControls;
|
||||
|
||||
/* the numberOfLineControls is non-zero, then following this structure*/
|
||||
/* must be an array of ATSUAttributeInfo structures. There must be one*/
|
||||
/* ATSUAttributeInfo structure for each numberOfLineControls above.*/
|
||||
};
|
||||
typedef struct ATSFlatDataLineInfoData ATSFlatDataLineInfoData;
|
||||
/*
|
||||
This structure is the main data header for the flattened line info data. This
|
||||
is what a non-zero offsetToLineInfo points to in the
|
||||
ATSFlatDataTextLayoutDataHeader structure above.
|
||||
*/
|
||||
struct ATSFlatDataLineInfoHeader {
|
||||
|
||||
/* the number of flattened line info structures that are stored in this*/
|
||||
/* block. This value should really be equal to the number of soft line*/
|
||||
/* breaks in the layout + 1. Of course if numberOfLines is zero, then*/
|
||||
/* this structure shouldn't even be used.*/
|
||||
ItemCount numberOfLines;
|
||||
|
||||
/* the first in a array of ATSFlatDataLineInfoData structures. There*/
|
||||
/* needs to be a ATSFlatDataLineInfoData for each numberOfLines*/
|
||||
/* specified above.*/
|
||||
ATSFlatDataLineInfoData lineInfoArray[1];
|
||||
};
|
||||
typedef struct ATSFlatDataLineInfoHeader ATSFlatDataLineInfoHeader;
|
||||
/* ------------------ */
|
||||
/* Block 3 Structures */
|
||||
/* ------------------ */
|
||||
/*
|
||||
The block 3 structures are used by ATSUI style run flattening and parsing
|
||||
functions, ATSUFlattenStyleRunsToStream and ATSUUnflattenStyleRunsFromStream
|
||||
to represent flattened style run information. These structures go hand and
|
||||
hand with the block 4 structures.
|
||||
*/
|
||||
|
||||
/*
|
||||
This is the data header that appears before the style run data structures.
|
||||
This structure is what a non-zero offsetToStyleRuns in the
|
||||
ATSFlatDataMainHeaderBlock points to in block 1.
|
||||
*/
|
||||
struct ATSFlatDataStyleRunDataHeader {
|
||||
|
||||
/* the number of style run data structures stored in this block*/
|
||||
ItemCount numberOfStyleRuns;
|
||||
|
||||
/* the first in an array of ATSUStyleRunInfo structures. There needs to*/
|
||||
/* be a ATSUStyleRunInfo structure for each numberOfStyleRuns specified*/
|
||||
/* above. This structure is defined in ATSUnicode.h*/
|
||||
ATSUStyleRunInfo styleRunArray[1];
|
||||
};
|
||||
typedef struct ATSFlatDataStyleRunDataHeader ATSFlatDataStyleRunDataHeader;
|
||||
/* ------------------ */
|
||||
/* Block 4 Structures */
|
||||
/* ------------------ */
|
||||
/*
|
||||
The block 4 structures store flattened ATSUStyle objects. This too, is
|
||||
currently used by the ATSUI style run flattening and parsing functions,
|
||||
ATSUFlattenStyleRunsToStream and ATSUUnflattenStyleRunsFromStream.
|
||||
*/
|
||||
|
||||
/*
|
||||
this structure forms the beginning of an individually flattened ATSUStyle
|
||||
object.
|
||||
*/
|
||||
struct ATSFlatDataStyleListStyleDataHeader {
|
||||
|
||||
/* the size of this flattened style object, including these four bytes and*/
|
||||
/* any padding bytes at the end of the structure. Basically, this can be*/
|
||||
/* used to determine where the next structure in the array begins.*/
|
||||
ByteCount sizeOfStyleInfo;
|
||||
|
||||
/* the number of attributes set in this flattened style object. This should */
|
||||
/* be at least one for the font data, although it can be 0 if this is to be*/
|
||||
/* unspecfied.*/
|
||||
ItemCount numberOfSetAttributes;
|
||||
|
||||
/* the number of font features set in the flattened style object. This can*/
|
||||
/* be set to 0 if there are no font features set in the style object. */
|
||||
ItemCount numberOfSetFeatures;
|
||||
|
||||
/* the number of font variations set in the flattened style object. This*/
|
||||
/* can be set to 0 if there are no font variations set in the style object.*/
|
||||
ItemCount numberOfSetVariations;
|
||||
|
||||
/* after this structure header, there is the following data in this block:*/
|
||||
|
||||
/* 1. if the numberOfSetAttributes is non-zero, then there will be an*/
|
||||
/* array of ATSUAttributeInfo structures immediately following the*/
|
||||
/* above header data to store the style attributes. This is a variable*/
|
||||
/* structure array. There must be one ATSUAttributeInfo for*/
|
||||
/* for each numberOfSetAttributes. If numberOfSetAttributes is zero,*/
|
||||
/* then skip to the next data section 2.*/
|
||||
|
||||
/* 2. if the numberOfSetFeatures is non-zero, then there will be an array*/
|
||||
/* of ATSFlatDataStyleListFeatureData structures immediately after*/
|
||||
/* the ATSUAttributeInfo array above (if any). There must be one*/
|
||||
/* ATSFlatDataStyleListFeatureData structure for each */
|
||||
/* numberOfSetFeatures set in the header above. If numberOfSetFeatures*/
|
||||
/* is zero, then skip to the next data section 3.*/
|
||||
|
||||
/* 3. if the numberOfSetVariations is non-zero, then there will be an*/
|
||||
/* array of ATSFlatDataStyleListVariationData immediately after the*/
|
||||
/* ATSFlatDataStyleListFeatureData array above (if any). There must be*/
|
||||
/* one ATSFlatDataStyleListVariationData structure for each */
|
||||
/* numberOfSetVariations set in the header above.*/
|
||||
};
|
||||
typedef struct ATSFlatDataStyleListStyleDataHeader ATSFlatDataStyleListStyleDataHeader;
|
||||
/*
|
||||
this structure is the main header for this block. This structure is what a
|
||||
non-zero offsetToStyleList in the ATSFlatDataMainHeaderBlock points to in
|
||||
block 1.
|
||||
*/
|
||||
struct ATSFlatDataStyleListHeader {
|
||||
|
||||
/* the total number of flattened style objects stored in this block*/
|
||||
ItemCount numberOfStyles;
|
||||
|
||||
/* the first in an array of flattned style entries. The data stored*/
|
||||
/* in them is variably sized, so a simply array access won't do for*/
|
||||
/* iterating through these. However, there must be one of these*/
|
||||
/* ATSFlatDataStyleListStyleDataHeader structures for each */
|
||||
/* numberOfStyles above.*/
|
||||
ATSFlatDataStyleListStyleDataHeader styleDataArray[1];
|
||||
|
||||
};
|
||||
typedef struct ATSFlatDataStyleListHeader ATSFlatDataStyleListHeader;
|
||||
/*
|
||||
this structure stores flattened font feature data. An array of these comes
|
||||
after the array of font data attributes (if any) if the numberOfSetFeatures is
|
||||
non-zero. There must be one of these structures for each numberOfSetFeatures.
|
||||
*/
|
||||
struct ATSFlatDataStyleListFeatureData {
|
||||
|
||||
/* the font feature type*/
|
||||
ATSUFontFeatureType theFeatureType;
|
||||
|
||||
/* the font feature selector*/
|
||||
ATSUFontFeatureSelector theFeatureSelector;
|
||||
};
|
||||
typedef struct ATSFlatDataStyleListFeatureData ATSFlatDataStyleListFeatureData;
|
||||
/*
|
||||
this structure stores the flattened font variation data. An array of these
|
||||
comes after the array of ATSFlatDataStyleListFeatureData structures (if any)
|
||||
if the numberOfSetVariations is non-zero. There must be one of these
|
||||
structures for each numberOfSetFeatures.
|
||||
*/
|
||||
struct ATSFlatDataStyleListVariationData {
|
||||
|
||||
/* the variation axis*/
|
||||
ATSUFontVariationAxis theVariationAxis;
|
||||
|
||||
/* the variation value*/
|
||||
ATSUFontVariationValue theVariationValue;
|
||||
};
|
||||
typedef struct ATSFlatDataStyleListVariationData ATSFlatDataStyleListVariationData;
|
||||
/* ------------------------ */
|
||||
/* Flattened Font Data Info */
|
||||
/* ------------------------ */
|
||||
/*
|
||||
This is somewhat of an addendum to the 'ustl' structure above. These flattened
|
||||
data structures are stored in block 4 as a font attribute with the attribute
|
||||
tag of kATSUFontTag. They can store font data in a few different ways, such as
|
||||
by a FontSync reference or by simple raw font name data. Just as with the
|
||||
'ustl' above, this structure must maintain four byte alignment.
|
||||
*/
|
||||
|
||||
|
||||
/* these are the currenly supported font specifiers. */
|
||||
typedef UInt32 ATSFlatDataFontSpeciferType;
|
||||
enum {
|
||||
/* this specifier allows the storage of font data based on name data. This*/
|
||||
/* uses the stuctures below to store the actual data itself.*/
|
||||
kATSFlattenedFontSpecifierRawNameData = FOUR_CHAR_CODE('namd')
|
||||
};
|
||||
|
||||
/*
|
||||
this is the main header for the font data. It dictates what type of data
|
||||
is stored. The actual data stored must match the type specified by the
|
||||
nameSpecType.
|
||||
*/
|
||||
struct ATSFlatDataFontNameDataHeader {
|
||||
|
||||
/* the type of data that is flattened in this structure*/
|
||||
ATSFlatDataFontSpeciferType nameSpecifierType;
|
||||
|
||||
/* the size of the data that is flattened in this structre, not including */
|
||||
/* any padding bytes that may be necessary to achive the four byte */
|
||||
/* alignment of the data, unless they are specified as part of structure, */
|
||||
/* such as with the ATSFlatDataFontSpecRawNameData structure.*/
|
||||
ByteCount nameSpecifierSize;
|
||||
|
||||
/* after this header comes the flattened font name data which matches*/
|
||||
/* the type specified by the nameSpecifierType above. For instance, if */
|
||||
/* the nameSpecType is kATSFlattenedFontNameSpecifierRawNameData, the*/
|
||||
/* structure that immediately follows this would be a*/
|
||||
/* ATSFlatDataFontNameRawNameDataHeader structure. */
|
||||
|
||||
};
|
||||
typedef struct ATSFlatDataFontNameDataHeader ATSFlatDataFontNameDataHeader;
|
||||
/*
|
||||
the next two structures are only used when the nameSpecType is set to
|
||||
kATSFlattenedFontSpecifierRawNameData. They are setup to store multiple
|
||||
font name table entries for the purposes of reconstructing an ATSUFontID
|
||||
for (hopefully) the same font some time in the future.
|
||||
*/
|
||||
/* this is the structure in which raw font name data is actually stored. */
|
||||
struct ATSFlatDataFontSpecRawNameData {
|
||||
|
||||
/* the type of name being specified*/
|
||||
FontNameCode fontNameType;
|
||||
|
||||
/* the platform type of the font name, whether it be Unicode, Mac, etc. */
|
||||
/* This should be specified if known. If not known, then specify*/
|
||||
/* kFontNoPlatform, but then all matching will be done based on the first*/
|
||||
/* font in the name table matching the other parameters.*/
|
||||
FontPlatformCode fontNamePlatform;
|
||||
|
||||
/* the script code of the font's name based on the platform that was passed*/
|
||||
/* in above. If set to kFontNoScript, then the name will be matched based*/
|
||||
/* on the first font in the name table matching the other font name*/
|
||||
/* parameters.*/
|
||||
FontScriptCode fontNameScript;
|
||||
|
||||
/* the language of the font name. If set to kFontNoLanguage, then the name */
|
||||
/* will be matched based on the first font in the name table matching the*/
|
||||
/* other font name parameters.*/
|
||||
FontLanguageCode fontNameLanguage;
|
||||
|
||||
/* the length of the font name in bytes, not including any padding bytes*/
|
||||
/* added to maintain the four byte alignment*/
|
||||
ByteCount fontNameLength;
|
||||
|
||||
/* after the name length comes the actual font name data itself, plus any*/
|
||||
/* padding bytes needed to maintain the four byte alignment.*/
|
||||
|
||||
};
|
||||
typedef struct ATSFlatDataFontSpecRawNameData ATSFlatDataFontSpecRawNameData;
|
||||
/*
|
||||
this is a header structure that defines some things constant throughout
|
||||
the entire search for the font name, as well as the array of
|
||||
ATSFlatDataFontNameData structures. In order to gaurantee that the same font
|
||||
will be used, more than one name specifer should be stored. The standard ATSUI
|
||||
style run flattening and parsing functions, ATSUFlattenStyleRunsToStream and
|
||||
ATSUUnflattenStyleRunsFromStream. These will store both the font's full name
|
||||
(kFontFullName) as well as the font's manufacturer name (kFontManufacturerName)
|
||||
and match fonts based on both of
|
||||
these.
|
||||
*/
|
||||
struct ATSFlatDataFontSpecRawNameDataHeader {
|
||||
|
||||
/* the number of flattened font names. There must be at least one flattened */
|
||||
/* font name, otherwise the structure is malformed.*/
|
||||
ItemCount numberOfFlattenedNames;
|
||||
|
||||
/* the first in an array of possibly many font name specifiers - depending*/
|
||||
/* on how specific the caller wants this. There must be one */
|
||||
/* ATSFlatDataFontNameData structure for each numberOfFlattenedNames*/
|
||||
/* above.*/
|
||||
ATSFlatDataFontSpecRawNameData nameDataArray[1];
|
||||
|
||||
};
|
||||
typedef struct ATSFlatDataFontSpecRawNameDataHeader ATSFlatDataFontSpecRawNameDataHeader;
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/* Style Flattening and Parsing Functions */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
/*
|
||||
* ATSUFlattenStyleRunsToStream()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
ATSUFlattenStyleRunsToStream(
|
||||
ATSUFlattenedDataStreamFormat iStreamFormat,
|
||||
ATSUFlattenStyleRunOptions iFlattenOptions,
|
||||
ItemCount iNumberOfRunInfo,
|
||||
const ATSUStyleRunInfo iRunInfoArray[],
|
||||
ItemCount iNumberOfStyleObjects,
|
||||
const ATSUStyle iStyleArray[],
|
||||
ByteCount iStreamBufferSize,
|
||||
void * oStreamBuffer,
|
||||
ByteCount * oActualStreamBufferSize);
|
||||
|
||||
|
||||
/*
|
||||
* ATSUUnflattenStyleRunsFromStream()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
ATSUUnflattenStyleRunsFromStream(
|
||||
ATSUFlattenedDataStreamFormat iStreamFormat,
|
||||
ATSUUnFlattenStyleRunOptions iUnflattenOptions,
|
||||
ByteCount iStreamBufferSize,
|
||||
const void * iStreamBuffer,
|
||||
ItemCount iNumberOfRunInfo,
|
||||
ItemCount iNumberOfStyleObjects,
|
||||
ATSUStyleRunInfo oRunInfoArray[],
|
||||
ATSUStyle oStyleArray[],
|
||||
ItemCount * oActualNumberOfRunInfo,
|
||||
ItemCount * oActualNumberOfStyleObjects);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ATSUNICODEFLATTENING__ */
|
||||
|
||||
@@ -0,0 +1,625 @@
|
||||
/*
|
||||
File: AVLTree.h
|
||||
|
||||
Contains: Interfaces for AVL balanced trees.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __AVLTREE__
|
||||
#define __AVLTREE__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MIXEDMODE__
|
||||
#include <MixedMode.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* The visit stage for AVLWalk() walkProcs */
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* AVLTree
|
||||
*
|
||||
* Discussion:
|
||||
* Prototypes for routines which create, destroy, allow for
|
||||
* insertion, deleting, and iteration of routines in an AVL balanced
|
||||
* binary tree.
|
||||
*
|
||||
* An AVL tree is a balanced, binary tree which is fairly fast for
|
||||
* finds and acceptably fast for insertion and deletion. The tree
|
||||
* is kept balanced, so that the heights of any given node's left
|
||||
* and right branches never differ by more than 1, which keeps
|
||||
* performance from being too horribe in the degenerate case.
|
||||
*
|
||||
*
|
||||
* Very loosely based on some public domain source code for doing
|
||||
* avl trees and on the discussion in Sedgewick "Algorithms" book.
|
||||
*/
|
||||
typedef UInt16 AVLVisitStage;
|
||||
enum {
|
||||
kAVLPreOrder = 0,
|
||||
kAVLInOrder = 1,
|
||||
kAVLPostOrder = 2
|
||||
};
|
||||
|
||||
/* The order the tree is walked or disposed of. */
|
||||
typedef UInt16 AVLOrder;
|
||||
enum {
|
||||
kLeftToRight = 0,
|
||||
kRightToLeft = 1
|
||||
};
|
||||
|
||||
/* The type of the node being passed to a callback proc. */
|
||||
typedef UInt16 AVLNodeType;
|
||||
enum {
|
||||
kAVLIsTree = 0,
|
||||
kAVLIsLeftBranch = 1,
|
||||
kAVLIsRightBranch = 2,
|
||||
kAVLIsLeaf = 3,
|
||||
kAVLNullNode = 4
|
||||
};
|
||||
|
||||
enum {
|
||||
errItemAlreadyInTree = -960,
|
||||
errNotValidTree = -961,
|
||||
errItemNotFoundInTree = -962,
|
||||
errCanNotInsertWhileWalkProcInProgress = -963,
|
||||
errTreeIsLocked = -964
|
||||
};
|
||||
|
||||
/* The structure of a tree. It's opaque; don't assume it's 36 bytes in size.*/
|
||||
struct AVLTreeStruct {
|
||||
OSType signature;
|
||||
unsigned long privateStuff[8];
|
||||
};
|
||||
typedef struct AVLTreeStruct AVLTreeStruct;
|
||||
typedef AVLTreeStruct * AVLTreePtr;
|
||||
/*
|
||||
Every tree must have a function which compares the data for two items and returns < 0, 0, or >0
|
||||
for the items - < 0 if the first item is 'before' the second item according to some criteria,
|
||||
== 0 if the two items are identical according to the criteria, or > 0 if the first item is
|
||||
'after' the second item according to the criteria. The comparison function is also passed the
|
||||
node type, but most of the time this can be ignored.
|
||||
*/
|
||||
typedef CALLBACK_API( SInt32 , AVLCompareItemsProcPtr )(AVLTreePtr tree, const void *i1, const void *i2, AVLNodeType nd_typ);
|
||||
/*
|
||||
Every tree must have a itemSizeProc; this routine gets passed a pointer to the item's data and
|
||||
returns the size of the data. If a tree contains records of a fixed size, this function can
|
||||
just return sizeof( that-struct ); otherwise it should calculate the size of the item based on
|
||||
the data for the item.
|
||||
*/
|
||||
typedef CALLBACK_API( UInt32 , AVLItemSizeProcPtr )(AVLTreePtr tree, const void *itemPtr);
|
||||
/*
|
||||
A tree may have an optional disposeItemProc, which gets called whenever an item is removed
|
||||
from the tree ( via AVLRemove() or when AVLDispose() deletes all of the items in the tree ).
|
||||
This might be useful if the nodes in the tree own 'resources' ( like, open files ) which
|
||||
should be released before the item is removed.
|
||||
*/
|
||||
typedef CALLBACK_API( void , AVLDisposeItemProcPtr )(AVLTreePtr tree, const void *dataP);
|
||||
/*
|
||||
The common way to iterate across all of the items in a tree is via AVLWalk(), which takes
|
||||
a walkProcPtr. This function will get called for every item in the tree three times, as
|
||||
the tree is being walked across. First, the walkProc will get called with visitStage ==
|
||||
kAVLPreOrder, at which point internally the node of the tree for the given data has just
|
||||
been reached. Later, this function will get called with visitStage == kAVLInOrder, and
|
||||
lastly this function will get called with visitStage == kAVLPostOrder.
|
||||
The 'minimum' item in the tree will get called with visitStage == kInOrder first, followed
|
||||
by the 'next' item in the tree, up until the last item in the tree structure is called.
|
||||
In general, you'll only care about calls to this function when visitStage == kAVLInOrder.
|
||||
*/
|
||||
typedef CALLBACK_API( OSErr , AVLWalkProcPtr )(AVLTreePtr tree, const void *dataP, AVLVisitStage visitStage, AVLNodeType node, UInt32 level, SInt32 balance, void *refCon);
|
||||
typedef STACK_UPP_TYPE(AVLCompareItemsProcPtr) AVLCompareItemsUPP;
|
||||
typedef STACK_UPP_TYPE(AVLItemSizeProcPtr) AVLItemSizeUPP;
|
||||
typedef STACK_UPP_TYPE(AVLDisposeItemProcPtr) AVLDisposeItemUPP;
|
||||
typedef STACK_UPP_TYPE(AVLWalkProcPtr) AVLWalkUPP;
|
||||
/*
|
||||
* NewAVLCompareItemsUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AVLCompareItemsUPP )
|
||||
NewAVLCompareItemsUPP(AVLCompareItemsProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppAVLCompareItemsProcInfo = 0x00002FF0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes, 2_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(AVLCompareItemsUPP) NewAVLCompareItemsUPP(AVLCompareItemsProcPtr userRoutine) { return (AVLCompareItemsUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAVLCompareItemsProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewAVLCompareItemsUPP(userRoutine) (AVLCompareItemsUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAVLCompareItemsProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewAVLItemSizeUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AVLItemSizeUPP )
|
||||
NewAVLItemSizeUPP(AVLItemSizeProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppAVLItemSizeProcInfo = 0x000003F0 }; /* pascal 4_bytes Func(4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(AVLItemSizeUPP) NewAVLItemSizeUPP(AVLItemSizeProcPtr userRoutine) { return (AVLItemSizeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAVLItemSizeProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewAVLItemSizeUPP(userRoutine) (AVLItemSizeUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAVLItemSizeProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewAVLDisposeItemUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AVLDisposeItemUPP )
|
||||
NewAVLDisposeItemUPP(AVLDisposeItemProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppAVLDisposeItemProcInfo = 0x000003C0 }; /* pascal no_return_value Func(4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(AVLDisposeItemUPP) NewAVLDisposeItemUPP(AVLDisposeItemProcPtr userRoutine) { return (AVLDisposeItemUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAVLDisposeItemProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewAVLDisposeItemUPP(userRoutine) (AVLDisposeItemUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAVLDisposeItemProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewAVLWalkUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AVLWalkUPP )
|
||||
NewAVLWalkUPP(AVLWalkProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppAVLWalkProcInfo = 0x000FEBE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 2_bytes, 2_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(AVLWalkUPP) NewAVLWalkUPP(AVLWalkProcPtr userRoutine) { return (AVLWalkUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAVLWalkProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewAVLWalkUPP(userRoutine) (AVLWalkUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAVLWalkProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeAVLCompareItemsUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeAVLCompareItemsUPP(AVLCompareItemsUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeAVLCompareItemsUPP(AVLCompareItemsUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeAVLCompareItemsUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeAVLItemSizeUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeAVLItemSizeUPP(AVLItemSizeUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeAVLItemSizeUPP(AVLItemSizeUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeAVLItemSizeUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeAVLDisposeItemUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeAVLDisposeItemUPP(AVLDisposeItemUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeAVLDisposeItemUPP(AVLDisposeItemUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeAVLDisposeItemUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeAVLWalkUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeAVLWalkUPP(AVLWalkUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeAVLWalkUPP(AVLWalkUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeAVLWalkUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeAVLCompareItemsUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( SInt32 )
|
||||
InvokeAVLCompareItemsUPP(
|
||||
AVLTreePtr tree,
|
||||
const void * i1,
|
||||
const void * i2,
|
||||
AVLNodeType nd_typ,
|
||||
AVLCompareItemsUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(SInt32) InvokeAVLCompareItemsUPP(AVLTreePtr tree, const void * i1, const void * i2, AVLNodeType nd_typ, AVLCompareItemsUPP userUPP) { return (SInt32)CALL_FOUR_PARAMETER_UPP(userUPP, uppAVLCompareItemsProcInfo, tree, i1, i2, nd_typ); }
|
||||
#else
|
||||
#define InvokeAVLCompareItemsUPP(tree, i1, i2, nd_typ, userUPP) (SInt32)CALL_FOUR_PARAMETER_UPP((userUPP), uppAVLCompareItemsProcInfo, (tree), (i1), (i2), (nd_typ))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeAVLItemSizeUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( UInt32 )
|
||||
InvokeAVLItemSizeUPP(
|
||||
AVLTreePtr tree,
|
||||
const void * itemPtr,
|
||||
AVLItemSizeUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(UInt32) InvokeAVLItemSizeUPP(AVLTreePtr tree, const void * itemPtr, AVLItemSizeUPP userUPP) { return (UInt32)CALL_TWO_PARAMETER_UPP(userUPP, uppAVLItemSizeProcInfo, tree, itemPtr); }
|
||||
#else
|
||||
#define InvokeAVLItemSizeUPP(tree, itemPtr, userUPP) (UInt32)CALL_TWO_PARAMETER_UPP((userUPP), uppAVLItemSizeProcInfo, (tree), (itemPtr))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeAVLDisposeItemUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
InvokeAVLDisposeItemUPP(
|
||||
AVLTreePtr tree,
|
||||
const void * dataP,
|
||||
AVLDisposeItemUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) InvokeAVLDisposeItemUPP(AVLTreePtr tree, const void * dataP, AVLDisposeItemUPP userUPP) { CALL_TWO_PARAMETER_UPP(userUPP, uppAVLDisposeItemProcInfo, tree, dataP); }
|
||||
#else
|
||||
#define InvokeAVLDisposeItemUPP(tree, dataP, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppAVLDisposeItemProcInfo, (tree), (dataP))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeAVLWalkUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeAVLWalkUPP(
|
||||
AVLTreePtr tree,
|
||||
const void * dataP,
|
||||
AVLVisitStage visitStage,
|
||||
AVLNodeType node,
|
||||
UInt32 level,
|
||||
SInt32 balance,
|
||||
void * refCon,
|
||||
AVLWalkUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeAVLWalkUPP(AVLTreePtr tree, const void * dataP, AVLVisitStage visitStage, AVLNodeType node, UInt32 level, SInt32 balance, void * refCon, AVLWalkUPP userUPP) { return (OSErr)CALL_SEVEN_PARAMETER_UPP(userUPP, uppAVLWalkProcInfo, tree, dataP, visitStage, node, level, balance, refCon); }
|
||||
#else
|
||||
#define InvokeAVLWalkUPP(tree, dataP, visitStage, node, level, balance, refCon, userUPP) (OSErr)CALL_SEVEN_PARAMETER_UPP((userUPP), uppAVLWalkProcInfo, (tree), (dataP), (visitStage), (node), (level), (balance), (refCon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewAVLCompareItemsProc(userRoutine) NewAVLCompareItemsUPP(userRoutine)
|
||||
#define NewAVLItemSizeProc(userRoutine) NewAVLItemSizeUPP(userRoutine)
|
||||
#define NewAVLDisposeItemProc(userRoutine) NewAVLDisposeItemUPP(userRoutine)
|
||||
#define NewAVLWalkProc(userRoutine) NewAVLWalkUPP(userRoutine)
|
||||
#define CallAVLCompareItemsProc(userRoutine, tree, i1, i2, nd_typ) InvokeAVLCompareItemsUPP(tree, i1, i2, nd_typ, userRoutine)
|
||||
#define CallAVLItemSizeProc(userRoutine, tree, itemPtr) InvokeAVLItemSizeUPP(tree, itemPtr, userRoutine)
|
||||
#define CallAVLDisposeItemProc(userRoutine, tree, dataP) InvokeAVLDisposeItemUPP(tree, dataP, userRoutine)
|
||||
#define CallAVLWalkProc(userRoutine, tree, dataP, visitStage, node, level, balance, refCon) InvokeAVLWalkUPP(tree, dataP, visitStage, node, level, balance, refCon, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
/*
|
||||
Create an AVL tree. The compareItemsProc and the sizeItemProc are required; disposeItemProc is
|
||||
optional and can be nil. The refCon is stored with the list, and is passed back to the
|
||||
compareItemsProc, sizeItemProc, and disposeItemsProc calls. The allocation of the tree ( and all
|
||||
nodes later added to the list with AVLInsert ) will be created in what is the current zone at the
|
||||
time AVLInit() is called. Always call AVLDispose() to dispose of a list created with AVLInit().
|
||||
*/
|
||||
/*
|
||||
* AVLInit()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLInit(
|
||||
UInt32 flags,
|
||||
AVLCompareItemsUPP compareItemsProc,
|
||||
AVLItemSizeUPP sizeItemProc,
|
||||
AVLDisposeItemUPP disposeItemProc,
|
||||
void * refCon,
|
||||
AVLTreePtr * tree) THREEWORDINLINE(0x303C, 0x0C01, 0xAA80);
|
||||
|
||||
|
||||
/*
|
||||
Dispose of an AVL tree. This will dispose of each item in the tree in the order specified,
|
||||
call the tree's disposeProc proc for each item, and then dispose of the space allocated for
|
||||
the tree itself.
|
||||
*/
|
||||
/*
|
||||
* AVLDispose()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLDispose(
|
||||
AVLTreePtr * tree,
|
||||
AVLOrder order) THREEWORDINLINE(0x303C, 0x0302, 0xAA80);
|
||||
|
||||
|
||||
/*
|
||||
Iterate across all of the items in the tree, in the order specified. kLeftToRight is
|
||||
basically lowest-to-highest order, kRightToLeft is highest-to-lowest order. For each
|
||||
node in the tree, it will call the walkProc with three messages ( at the appropriate
|
||||
time ). First, with kAVLPreOrder when the walking gets to this node in the tree,
|
||||
before handling either the left or right subtree, secondly, with kAVLInOrder after
|
||||
handling one subtree but before handling the other, and lastly with kAVLPostOrder after
|
||||
handling both subtrees. If you want to handle items in order, then only do something
|
||||
if the visit stage is kAVLInOrder. You can only call AVLRemove() from inside a walkProc
|
||||
if visit stage is kAVLPostOrder ( because if you remove a node during the pre or in order
|
||||
stages you will corrupt the list ) OR if you return a non-zero result from the walkProc
|
||||
call which called AVLRemove() to immediately terminate the walkProc. Do not call AVLInsert()
|
||||
to insert a node into the tree from inside a walkProc.
|
||||
The walkProc function gets called with the AVLTreePtr, a pointer to the data for the
|
||||
current node ( which you can change in place as long as you do not affect the order within
|
||||
the tree ), the visit stage, the type of the current node ( leaf node, right or left branch,
|
||||
or full tree ), the level within the tree ( the root is level 1 ), the balance for the
|
||||
current node, and the refCon passed to AVLWalk(). This refCon is different from the one passed
|
||||
into AVLInit(); use AVLGetRefCon() to get that refCon if you want it inside a walkProc.
|
||||
( Most walkProcs will not care about the values for node type, level, or balance. )
|
||||
*/
|
||||
/*
|
||||
* AVLWalk()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLWalk(
|
||||
AVLTreePtr tree,
|
||||
AVLWalkUPP walkProc,
|
||||
AVLOrder order,
|
||||
void * walkRefCon) THREEWORDINLINE(0x303C, 0x0703, 0xAA80);
|
||||
|
||||
|
||||
/* Return the number of items in the given tree.*/
|
||||
/*
|
||||
* AVLCount()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLCount(
|
||||
AVLTreePtr tree,
|
||||
UInt32 * count) THREEWORDINLINE(0x303C, 0x0804, 0xAA80);
|
||||
|
||||
|
||||
/*
|
||||
Return the one-based index-th item from the tree by putting it's data at dataPtr
|
||||
if dataPtr is non-nil, and it's size into *itemSize if itemSize is non-nil.
|
||||
If index is out of range, return errItemNotFoundInTree. ( Internally, this does
|
||||
an AVLWalk(), so the tree can not be modified while this call is in progress ).
|
||||
*/
|
||||
/*
|
||||
* AVLGetIndItem()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLGetIndItem(
|
||||
AVLTreePtr tree,
|
||||
UInt32 index,
|
||||
void * dataPtr,
|
||||
UInt32 * itemSize) THREEWORDINLINE(0x303C, 0x0805, 0xAA80);
|
||||
|
||||
|
||||
/*
|
||||
Insert the given item into the tree. This will call the tree's sizeItemProc
|
||||
to determine how big the item at data is, and then will make a copy of the
|
||||
item and insert it into the tree in the appropriate place. If an item already
|
||||
exists in the tree with the same key ( so that the compareItemsUPP returns 0
|
||||
when asked to compare this item to an existing one ), then it will return
|
||||
errItemNotFoundInTree.
|
||||
*/
|
||||
/*
|
||||
* AVLInsert()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLInsert(
|
||||
AVLTreePtr tree,
|
||||
const void * data) THREEWORDINLINE(0x303C, 0x0406, 0xAA80);
|
||||
|
||||
|
||||
/*
|
||||
Remove any item from the tree with the given key. If dataPtr != nil, then
|
||||
copy the item's data to dataPtr before removing it from the tree. Before
|
||||
removing the item, call the tree's disposeItemProc to let it release anything
|
||||
used by the data in the tree. It is not necessary to fill in a complete
|
||||
record for key, only that the compareItemsProc return 0 when asked to compare
|
||||
the data at key with the node in the tree to be deleted. If the item cannot
|
||||
be found in the tree, this will return errItemNotFoundInTree.
|
||||
*/
|
||||
/*
|
||||
* AVLRemove()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLRemove(
|
||||
AVLTreePtr tree,
|
||||
const void * key,
|
||||
void * dataPtr,
|
||||
UInt32 * itemSize) THREEWORDINLINE(0x303C, 0x0807, 0xAA80);
|
||||
|
||||
|
||||
/*
|
||||
Find the item in the tree with the given key, and return it's data in
|
||||
dataPtr ( if dataPtr != nil ), and it's size in *itemSize ( if itemSize
|
||||
!= nil ). It is not necessary to fill in a complete record for key,
|
||||
only that the compareItemsProc return 0 when asked to compare the data
|
||||
at key with the node in the tree to be deleted. If the item cannot
|
||||
be found in the tree, this will return errItemNotFoundInTree.
|
||||
*/
|
||||
/*
|
||||
* AVLFind()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLFind(
|
||||
AVLTreePtr tree,
|
||||
const void * key,
|
||||
void * dataPtr,
|
||||
UInt32 * itemSize) THREEWORDINLINE(0x303C, 0x0808, 0xAA80);
|
||||
|
||||
|
||||
/*
|
||||
Get the refCon for the given tree ( set in AVLInit ) and return it.
|
||||
If the given tree is invalid, then return nil.
|
||||
*/
|
||||
/*
|
||||
* AVLGetRefcon()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 9.0 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AVLGetRefcon(
|
||||
AVLTreePtr tree,
|
||||
void ** refCon) THREEWORDINLINE(0x303C, 0x0409, 0xAA80);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __AVLTREE__ */
|
||||
|
||||
@@ -0,0 +1,671 @@
|
||||
/*
|
||||
File: Aliases.h
|
||||
|
||||
Contains: Alias Manager Interfaces.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1989-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __ALIASES__
|
||||
#define __ALIASES__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __FILES__
|
||||
#include <Files.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
typedef UInt32 FSAliasInfoBitmap;
|
||||
enum {
|
||||
kFSAliasInfoNone = 0x00000000, /* no valid info*/
|
||||
kFSAliasInfoVolumeCreateDate = 0x00000001, /* volume creation date is valid*/
|
||||
kFSAliasInfoTargetCreateDate = 0x00000002, /* target creation date is valid*/
|
||||
kFSAliasInfoFinderInfo = 0x00000004, /* file type and creator are valid*/
|
||||
kFSAliasInfoIsDirectory = 0x00000008, /* isDirectory boolean is valid*/
|
||||
kFSAliasInfoIDs = 0x00000010, /* parentDirID and nodeID are valid*/
|
||||
kFSAliasInfoFSInfo = 0x00000020, /* filesystemID and signature are valid*/
|
||||
kFSAliasInfoVolumeFlags = 0x00000040 /* volumeIsBootVolume, volumeIsAutomounted, volumeIsEjectable and volumeHasPersistentFileIDs are valid*/
|
||||
};
|
||||
|
||||
enum {
|
||||
rAliasType = FOUR_CHAR_CODE('alis') /* Aliases are stored as resources of this type */
|
||||
};
|
||||
|
||||
enum {
|
||||
/* define alias resolution action rules mask */
|
||||
kARMMountVol = 0x00000001, /* mount the volume automatically */
|
||||
kARMNoUI = 0x00000002, /* no user interface allowed during resolution */
|
||||
kARMMultVols = 0x00000008, /* search on multiple volumes */
|
||||
kARMSearch = 0x00000100, /* search quickly */
|
||||
kARMSearchMore = 0x00000200, /* search further */
|
||||
kARMSearchRelFirst = 0x00000400, /* search target on a relative path first */
|
||||
kARMTryFileIDFirst = 0x00000800 /* search by file id before path */
|
||||
};
|
||||
|
||||
enum {
|
||||
/* define alias record information types */
|
||||
asiZoneName = -3, /* get zone name */
|
||||
asiServerName = -2, /* get server name */
|
||||
asiVolumeName = -1, /* get volume name */
|
||||
asiAliasName = 0, /* get aliased file/folder/volume name */
|
||||
asiParentName = 1 /* get parent folder name */
|
||||
};
|
||||
|
||||
/* ResolveAliasFileWithMountFlags options */
|
||||
enum {
|
||||
kResolveAliasFileNoUI = 0x00000001, /* no user interaction during resolution */
|
||||
kResolveAliasTryFileIDFirst = 0x00000002 /* search by file id before path */
|
||||
};
|
||||
|
||||
/* define the alias record that will be the blackbox for the caller */
|
||||
struct AliasRecord {
|
||||
OSType userType; /* appl stored type like creator type */
|
||||
unsigned short aliasSize; /* alias record size in bytes, for appl usage */
|
||||
};
|
||||
typedef struct AliasRecord AliasRecord;
|
||||
typedef AliasRecord * AliasPtr;
|
||||
typedef AliasPtr * AliasHandle;
|
||||
/* info block to pass to FSCopyAliasInfo */
|
||||
struct FSAliasInfo {
|
||||
UTCDateTime volumeCreateDate;
|
||||
UTCDateTime targetCreateDate;
|
||||
OSType fileType;
|
||||
OSType fileCreator;
|
||||
UInt32 parentDirID;
|
||||
UInt32 nodeID;
|
||||
UInt16 filesystemID;
|
||||
UInt16 signature;
|
||||
Boolean volumeIsBootVolume;
|
||||
Boolean volumeIsAutomounted;
|
||||
Boolean volumeIsEjectable;
|
||||
Boolean volumeHasPersistentFileIDs;
|
||||
Boolean isDirectory;
|
||||
};
|
||||
typedef struct FSAliasInfo FSAliasInfo;
|
||||
typedef FSAliasInfo * FSAliasInfoPtr;
|
||||
/* alias record information type */
|
||||
typedef short AliasInfoType;
|
||||
/*
|
||||
* NewAlias()
|
||||
*
|
||||
* Summary:
|
||||
* create a new alias between fromFile and target, returns alias
|
||||
* record handle
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
NewAlias(
|
||||
const FSSpec * fromFile, /* can be NULL */
|
||||
const FSSpec * target,
|
||||
AliasHandle * alias) TWOWORDINLINE(0x7002, 0xA823);
|
||||
|
||||
|
||||
/*
|
||||
* NewAliasMinimal()
|
||||
*
|
||||
* Summary:
|
||||
* create a minimal new alias for a target and return alias record
|
||||
* handle
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
NewAliasMinimal(
|
||||
const FSSpec * target,
|
||||
AliasHandle * alias) TWOWORDINLINE(0x7008, 0xA823);
|
||||
|
||||
|
||||
/*
|
||||
* NewAliasMinimalFromFullPath()
|
||||
*
|
||||
* Summary:
|
||||
* create a minimal new alias from a target fullpath (optional zone
|
||||
* and server name) and return alias record handle
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
NewAliasMinimalFromFullPath(
|
||||
short fullPathLength,
|
||||
const void * fullPath,
|
||||
ConstStr32Param zoneName,
|
||||
ConstStr31Param serverName,
|
||||
AliasHandle * alias) TWOWORDINLINE(0x7009, 0xA823);
|
||||
|
||||
|
||||
/*
|
||||
* ResolveAlias()
|
||||
*
|
||||
* Summary:
|
||||
* given an alias handle and fromFile, resolve the alias, update the
|
||||
* alias record and return aliased filename and wasChanged flag.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
ResolveAlias(
|
||||
const FSSpec * fromFile, /* can be NULL */
|
||||
AliasHandle alias,
|
||||
FSSpec * target,
|
||||
Boolean * wasChanged) TWOWORDINLINE(0x7003, 0xA823);
|
||||
|
||||
|
||||
/*
|
||||
* GetAliasInfo()
|
||||
*
|
||||
* Summary:
|
||||
* given an alias handle and an index specifying requested alias
|
||||
* information type, return the information from alias record as a
|
||||
* string.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
GetAliasInfo(
|
||||
AliasHandle alias,
|
||||
AliasInfoType index,
|
||||
Str63 theString) TWOWORDINLINE(0x7007, 0xA823);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* IsAliasFile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 8.5 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
IsAliasFile(
|
||||
const FSSpec * fileFSSpec,
|
||||
Boolean * aliasFileFlag,
|
||||
Boolean * folderFlag) TWOWORDINLINE(0x702A, 0xA823);
|
||||
|
||||
|
||||
/*
|
||||
* ResolveAliasWithMountFlags()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 8.5 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
ResolveAliasWithMountFlags(
|
||||
const FSSpec * fromFile, /* can be NULL */
|
||||
AliasHandle alias,
|
||||
FSSpec * target,
|
||||
Boolean * wasChanged,
|
||||
unsigned long mountFlags) TWOWORDINLINE(0x702B, 0xA823);
|
||||
|
||||
|
||||
/*
|
||||
* ResolveAliasFile()
|
||||
*
|
||||
* Summary:
|
||||
* Given a file spec, return target file spec if input file spec is
|
||||
* an alias. It resolves the entire alias chain or one step of the
|
||||
* chain. It returns info about whether the target is a folder or
|
||||
* file; and whether the input file spec was an alias or not.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
ResolveAliasFile(
|
||||
FSSpec * theSpec,
|
||||
Boolean resolveAliasChains,
|
||||
Boolean * targetIsFolder,
|
||||
Boolean * wasAliased) TWOWORDINLINE(0x700C, 0xA823);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ResolveAliasFileWithMountFlags()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
ResolveAliasFileWithMountFlags(
|
||||
FSSpec * theSpec,
|
||||
Boolean resolveAliasChains,
|
||||
Boolean * targetIsFolder,
|
||||
Boolean * wasAliased,
|
||||
unsigned long mountFlags) TWOWORDINLINE(0x7029, 0xA823);
|
||||
|
||||
|
||||
/*
|
||||
* FollowFinderAlias()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
FollowFinderAlias(
|
||||
const FSSpec * fromFile, /* can be NULL */
|
||||
AliasHandle alias,
|
||||
Boolean logon,
|
||||
FSSpec * target,
|
||||
Boolean * wasChanged) TWOWORDINLINE(0x700F, 0xA823);
|
||||
|
||||
|
||||
/*
|
||||
Low Level Routines
|
||||
*/
|
||||
/*
|
||||
* UpdateAlias()
|
||||
*
|
||||
* Summary:
|
||||
* given a fromFile-target pair and an alias handle, update the
|
||||
* alias record pointed to by alias handle to represent target as
|
||||
* the new alias.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
UpdateAlias(
|
||||
const FSSpec * fromFile, /* can be NULL */
|
||||
const FSSpec * target,
|
||||
AliasHandle alias,
|
||||
Boolean * wasChanged) TWOWORDINLINE(0x7006, 0xA823);
|
||||
|
||||
|
||||
|
||||
typedef CALLBACK_API( Boolean , AliasFilterProcPtr )(CInfoPBPtr cpbPtr, Boolean *quitFlag, Ptr myDataPtr);
|
||||
typedef STACK_UPP_TYPE(AliasFilterProcPtr) AliasFilterUPP;
|
||||
/*
|
||||
* NewAliasFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( AliasFilterUPP )
|
||||
NewAliasFilterUPP(AliasFilterProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppAliasFilterProcInfo = 0x00000FD0 }; /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(AliasFilterUPP) NewAliasFilterUPP(AliasFilterProcPtr userRoutine) { return (AliasFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAliasFilterProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewAliasFilterUPP(userRoutine) (AliasFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppAliasFilterProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeAliasFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeAliasFilterUPP(AliasFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeAliasFilterUPP(AliasFilterUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeAliasFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeAliasFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
InvokeAliasFilterUPP(
|
||||
CInfoPBPtr cpbPtr,
|
||||
Boolean * quitFlag,
|
||||
Ptr myDataPtr,
|
||||
AliasFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(Boolean) InvokeAliasFilterUPP(CInfoPBPtr cpbPtr, Boolean * quitFlag, Ptr myDataPtr, AliasFilterUPP userUPP) { return (Boolean)CALL_THREE_PARAMETER_UPP(userUPP, uppAliasFilterProcInfo, cpbPtr, quitFlag, myDataPtr); }
|
||||
#else
|
||||
#define InvokeAliasFilterUPP(cpbPtr, quitFlag, myDataPtr, userUPP) (Boolean)CALL_THREE_PARAMETER_UPP((userUPP), uppAliasFilterProcInfo, (cpbPtr), (quitFlag), (myDataPtr))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewAliasFilterProc(userRoutine) NewAliasFilterUPP(userRoutine)
|
||||
#define CallAliasFilterProc(userRoutine, cpbPtr, quitFlag, myDataPtr) InvokeAliasFilterUPP(cpbPtr, quitFlag, myDataPtr, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
/*
|
||||
* MatchAlias()
|
||||
*
|
||||
* Summary:
|
||||
* Given an alias handle and fromFile, match the alias and return
|
||||
* FSSpecs to the aliased file(s) and needsUpdate flag
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
MatchAlias(
|
||||
const FSSpec * fromFile, /* can be NULL */
|
||||
unsigned long rulesMask,
|
||||
AliasHandle alias,
|
||||
short * aliasCount,
|
||||
FSSpecArrayPtr aliasList,
|
||||
Boolean * needsUpdate,
|
||||
AliasFilterUPP aliasFilter,
|
||||
void * yourDataPtr) TWOWORDINLINE(0x7005, 0xA823);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* ResolveAliasFileWithMountFlagsNoUI()
|
||||
*
|
||||
* Summary:
|
||||
* variation on ResolveAliasFile that does not prompt user with a
|
||||
* dialog
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
ResolveAliasFileWithMountFlagsNoUI(
|
||||
FSSpec * theSpec,
|
||||
Boolean resolveAliasChains,
|
||||
Boolean * targetIsFolder,
|
||||
Boolean * wasAliased,
|
||||
unsigned long mountFlags);
|
||||
|
||||
|
||||
/*
|
||||
* MatchAliasNoUI()
|
||||
*
|
||||
* Summary:
|
||||
* variation on MatchAlias that does not prompt user with a dialog
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
MatchAliasNoUI(
|
||||
const FSSpec * fromFile, /* can be NULL */
|
||||
unsigned long rulesMask,
|
||||
AliasHandle alias,
|
||||
short * aliasCount,
|
||||
FSSpecArrayPtr aliasList,
|
||||
Boolean * needsUpdate,
|
||||
AliasFilterUPP aliasFilter,
|
||||
void * yourDataPtr);
|
||||
|
||||
|
||||
/*
|
||||
* FSNewAliasUnicode()
|
||||
*
|
||||
* Summary:
|
||||
* Creates an alias given a ref to the target's parent directory and
|
||||
* the target's unicode name. If the target does not exist fnfErr
|
||||
* will be returned but the alias will still be created. This
|
||||
* allows the creation of aliases to targets that do not exist.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* fromFile:
|
||||
* The starting point for a relative search.
|
||||
*
|
||||
* targetParentRef:
|
||||
* An FSRef to the parent directory of the target.
|
||||
*
|
||||
* targetNameLength:
|
||||
* Number of Unicode characters in the target's name.
|
||||
*
|
||||
* targetName:
|
||||
* A pointer to the Unicode name.
|
||||
*
|
||||
* inAlias:
|
||||
* A Handle to the newly created alias record.
|
||||
*
|
||||
* isDirectory:
|
||||
* On input, if target does not exist, a flag to indicate whether
|
||||
* or not the target is a directory. On output, if the target did
|
||||
* exist, an flag indicating if the target is a directory. Pass
|
||||
* NULL in the non-existant case if unsure.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
FSNewAliasUnicode(
|
||||
const FSRef * fromFile, /* can be NULL */
|
||||
const FSRef * targetParentRef,
|
||||
UniCharCount targetNameLength,
|
||||
const UniChar * targetName,
|
||||
AliasHandle * inAlias,
|
||||
Boolean * isDirectory); /* can be NULL */
|
||||
|
||||
|
||||
/*
|
||||
* FSNewAliasMinimalUnicode()
|
||||
*
|
||||
* Summary:
|
||||
* Creates a minimal alias given a ref to the target's parent
|
||||
* directory and the target's unicode name. If the target does not
|
||||
* exist fnfErr will be returned but the alias will still be created.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* targetParentRef:
|
||||
* An FSRef to the parent directory of the target.
|
||||
*
|
||||
* targetNameLength:
|
||||
* Number of Unicode characters in the target's name.
|
||||
*
|
||||
* targetName:
|
||||
* A pointer to the Unicode name.
|
||||
*
|
||||
* inAlias:
|
||||
* A Handle to the newly created alias record.
|
||||
*
|
||||
* isDirectory:
|
||||
* On input, if target does not exist, a flag to indicate whether
|
||||
* or not the
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
FSNewAliasMinimalUnicode(
|
||||
const FSRef * targetParentRef,
|
||||
UniCharCount targetNameLength,
|
||||
const UniChar * targetName,
|
||||
AliasHandle * inAlias,
|
||||
Boolean * isDirectory); /* can be NULL */
|
||||
|
||||
|
||||
/*
|
||||
* FSMatchAlias()
|
||||
*
|
||||
* Summary:
|
||||
* Given an alias handle and fromFile, match the alias and return
|
||||
* FSRefs to the aliased file(s) and needsUpdate flag
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
FSMatchAlias(
|
||||
const FSRef * fromFile, /* can be NULL */
|
||||
unsigned long rulesMask,
|
||||
AliasHandle inAlias,
|
||||
short * aliasCount,
|
||||
FSRef * aliasList,
|
||||
Boolean * needsUpdate,
|
||||
AliasFilterUPP aliasFilter,
|
||||
void * yourDataPtr);
|
||||
|
||||
|
||||
/*
|
||||
* FSMatchAliasNoUI()
|
||||
*
|
||||
* Summary:
|
||||
* variation on FSMatchAlias that does not prompt user with a dialog
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
FSMatchAliasNoUI(
|
||||
const FSRef * fromFile, /* can be NULL */
|
||||
unsigned long rulesMask,
|
||||
AliasHandle inAlias,
|
||||
short * aliasCount,
|
||||
FSRef * aliasList,
|
||||
Boolean * needsUpdate,
|
||||
AliasFilterUPP aliasFilter,
|
||||
void * yourDataPtr);
|
||||
|
||||
|
||||
/*
|
||||
* FSCopyAliasInfo()
|
||||
*
|
||||
* Discussion:
|
||||
* This routine will return the requested information from the
|
||||
* passed in aliasHandle. The information is gathered only from the
|
||||
* alias record so it may not match what is on disk (no disk i/o is
|
||||
* performed). The whichInfo paramter is an output parameter that
|
||||
* signifies which fields in the info record contain valid data.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* inAlias:
|
||||
* A handle to the alias record to get the information from.
|
||||
*
|
||||
* targetName:
|
||||
* The name of the target item.
|
||||
*
|
||||
* volumeName:
|
||||
* The name of the volume the target resides on.
|
||||
*
|
||||
* pathString:
|
||||
* POSIX path to target.
|
||||
*
|
||||
* whichInfo:
|
||||
* An indication of which fields in the info block contain valid
|
||||
* data.
|
||||
*
|
||||
* info:
|
||||
* Returned information about the alias.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available in CarbonLib 1.x, is available on Mac OS X version 10.2 and later
|
||||
* Mac OS X: in version 10.2 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
FSCopyAliasInfo(
|
||||
AliasHandle inAlias,
|
||||
HFSUniStr255 * targetName, /* can be NULL */
|
||||
HFSUniStr255 * volumeName, /* can be NULL */
|
||||
CFStringRef * pathString, /* can be NULL */
|
||||
FSAliasInfoBitmap * whichInfo, /* can be NULL */
|
||||
FSAliasInfo * info); /* can be NULL */
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ALIASES__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
File: AppleDiskPartitions.h
|
||||
|
||||
Contains: The Apple disk partition scheme as defined in Inside Macintosh: Volume V.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __APPLEDISKPARTITIONS__
|
||||
#define __APPLEDISKPARTITIONS__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/* Block 0 Definitions */
|
||||
enum {
|
||||
sbSIGWord = 0x4552, /* signature word for Block 0 ('ER') */
|
||||
sbMac = 1 /* system type for Mac */
|
||||
};
|
||||
|
||||
/* Partition Map Signatures */
|
||||
enum {
|
||||
pMapSIG = 0x504D, /* partition map signature ('PM') */
|
||||
pdSigWord = 0x5453, /* partition map signature ('TS') */
|
||||
oldPMSigWord = pdSigWord,
|
||||
newPMSigWord = pMapSIG
|
||||
};
|
||||
|
||||
|
||||
/* Driver Descriptor Map */
|
||||
struct Block0 {
|
||||
UInt16 sbSig; /* unique value for SCSI block 0 */
|
||||
UInt16 sbBlkSize; /* block size of device */
|
||||
UInt32 sbBlkCount; /* number of blocks on device */
|
||||
UInt16 sbDevType; /* device type */
|
||||
UInt16 sbDevId; /* device id */
|
||||
UInt32 sbData; /* not used */
|
||||
UInt16 sbDrvrCount; /* driver descriptor count */
|
||||
UInt32 ddBlock; /* 1st driver's starting block */
|
||||
UInt16 ddSize; /* size of 1st driver (512-byte blks) */
|
||||
UInt16 ddType; /* system type (1 for Mac+) */
|
||||
UInt16 ddPad[243]; /* ARRAY[0..242] OF INTEGER; not used */
|
||||
};
|
||||
typedef struct Block0 Block0;
|
||||
/* Driver descriptor */
|
||||
struct DDMap {
|
||||
UInt32 ddBlock; /* 1st driver's starting block */
|
||||
UInt16 ddSize; /* size of 1st driver (512-byte blks) */
|
||||
UInt16 ddType; /* system type (1 for Mac+) */
|
||||
};
|
||||
typedef struct DDMap DDMap;
|
||||
/* Constants for the ddType field of the DDMap structure. */
|
||||
enum {
|
||||
kDriverTypeMacSCSI = 0x0001,
|
||||
kDriverTypeMacATA = 0x0701,
|
||||
kDriverTypeMacSCSIChained = 0xFFFF,
|
||||
kDriverTypeMacATAChained = 0xF8FF
|
||||
};
|
||||
|
||||
/* Partition Map Entry */
|
||||
struct Partition {
|
||||
UInt16 pmSig; /* unique value for map entry blk */
|
||||
UInt16 pmSigPad; /* currently unused */
|
||||
UInt32 pmMapBlkCnt; /* # of blks in partition map */
|
||||
UInt32 pmPyPartStart; /* physical start blk of partition */
|
||||
UInt32 pmPartBlkCnt; /* # of blks in this partition */
|
||||
UInt8 pmPartName[32]; /* ASCII partition name */
|
||||
UInt8 pmParType[32]; /* ASCII partition type */
|
||||
UInt32 pmLgDataStart; /* log. # of partition's 1st data blk */
|
||||
UInt32 pmDataCnt; /* # of blks in partition's data area */
|
||||
UInt32 pmPartStatus; /* bit field for partition status */
|
||||
UInt32 pmLgBootStart; /* log. blk of partition's boot code */
|
||||
UInt32 pmBootSize; /* number of bytes in boot code */
|
||||
UInt32 pmBootAddr; /* memory load address of boot code */
|
||||
UInt32 pmBootAddr2; /* currently unused */
|
||||
UInt32 pmBootEntry; /* entry point of boot code */
|
||||
UInt32 pmBootEntry2; /* currently unused */
|
||||
UInt32 pmBootCksum; /* checksum of boot code */
|
||||
UInt8 pmProcessor[16]; /* ASCII for the processor type */
|
||||
UInt16 pmPad[188]; /* ARRAY[0..187] OF INTEGER; not used */
|
||||
};
|
||||
typedef struct Partition Partition;
|
||||
|
||||
/* Flags for the pmPartStatus field of the Partition data structure. */
|
||||
enum {
|
||||
kPartitionAUXIsValid = 0x00000001,
|
||||
kPartitionAUXIsAllocated = 0x00000002,
|
||||
kPartitionAUXIsInUse = 0x00000004,
|
||||
kPartitionAUXIsBootValid = 0x00000008,
|
||||
kPartitionAUXIsReadable = 0x00000010,
|
||||
kPartitionAUXIsWriteable = 0x00000020,
|
||||
kPartitionAUXIsBootCodePositionIndependent = 0x00000040,
|
||||
kPartitionIsWriteable = 0x00000020,
|
||||
kPartitionIsMountedAtStartup = 0x40000000,
|
||||
kPartitionIsStartup = (long)0x80000000,
|
||||
kPartitionIsChainCompatible = 0x00000100,
|
||||
kPartitionIsRealDeviceDriver = 0x00000200,
|
||||
kPartitionCanChainToNext = 0x00000400
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/* Well known driver signatures, stored in the first four byte of pmPad. */
|
||||
enum {
|
||||
kPatchDriverSignature = FOUR_CHAR_CODE('ptDR'), /* SCSI and ATA[PI] patch driver */
|
||||
kSCSIDriverSignature = 0x00010600, /* SCSI hard disk driver */
|
||||
kATADriverSignature = FOUR_CHAR_CODE('wiki'), /* ATA hard disk driver */
|
||||
kSCSICDDriverSignature = FOUR_CHAR_CODE('CDvr'), /* SCSI CD-ROM driver */
|
||||
kATAPIDriverSignature = FOUR_CHAR_CODE('ATPI'), /* ATAPI CD-ROM driver */
|
||||
kDriveSetupHFSSignature = FOUR_CHAR_CODE('DSU1') /* Drive Setup HFS partition */
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __APPLEDISKPARTITIONS__ */
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
File: AppleEvents.h
|
||||
|
||||
Contains: AppleEvent Package Interfaces.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1989-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __APPLEEVENTS__
|
||||
#define __APPLEEVENTS__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MIXEDMODE__
|
||||
#include <MixedMode.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
Note: The functions and types for the building and parsing AppleEvent
|
||||
messages has moved to AEDataModel.h
|
||||
*/
|
||||
#ifndef __AEDATAMODEL__
|
||||
#include <AEDataModel.h>
|
||||
#endif
|
||||
|
||||
|
||||
/*Note: The functions for interacting with events has moved to AEInteraction.h*/
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
enum {
|
||||
/* Keywords for Apple event parameters */
|
||||
keyDirectObject = FOUR_CHAR_CODE('----'),
|
||||
keyErrorNumber = FOUR_CHAR_CODE('errn'),
|
||||
keyErrorString = FOUR_CHAR_CODE('errs'),
|
||||
keyProcessSerialNumber = FOUR_CHAR_CODE('psn '), /* Keywords for special handlers */
|
||||
keyPreDispatch = FOUR_CHAR_CODE('phac'), /* preHandler accessor call */
|
||||
keySelectProc = FOUR_CHAR_CODE('selh'), /* more selector call */
|
||||
/* Keyword for recording */
|
||||
keyAERecorderCount = FOUR_CHAR_CODE('recr'), /* available only in vers 1.0.1 and greater */
|
||||
/* Keyword for version information */
|
||||
keyAEVersion = FOUR_CHAR_CODE('vers') /* available only in vers 1.0.1 and greater */
|
||||
};
|
||||
|
||||
/* Event Class */
|
||||
enum {
|
||||
kCoreEventClass = FOUR_CHAR_CODE('aevt')
|
||||
};
|
||||
|
||||
/* Event ID's */
|
||||
enum {
|
||||
kAEOpenApplication = FOUR_CHAR_CODE('oapp'),
|
||||
kAEOpenDocuments = FOUR_CHAR_CODE('odoc'),
|
||||
kAEPrintDocuments = FOUR_CHAR_CODE('pdoc'),
|
||||
kAEQuitApplication = FOUR_CHAR_CODE('quit'),
|
||||
kAEAnswer = FOUR_CHAR_CODE('ansr'),
|
||||
kAEApplicationDied = FOUR_CHAR_CODE('obit'),
|
||||
kAEShowPreferences = FOUR_CHAR_CODE('pref') /* sent by Mac OS X when the user chooses the Preferences item */
|
||||
};
|
||||
|
||||
/* Constants for recording */
|
||||
enum {
|
||||
kAEStartRecording = FOUR_CHAR_CODE('reca'), /* available only in vers 1.0.1 and greater */
|
||||
kAEStopRecording = FOUR_CHAR_CODE('recc'), /* available only in vers 1.0.1 and greater */
|
||||
kAENotifyStartRecording = FOUR_CHAR_CODE('rec1'), /* available only in vers 1.0.1 and greater */
|
||||
kAENotifyStopRecording = FOUR_CHAR_CODE('rec0'), /* available only in vers 1.0.1 and greater */
|
||||
kAENotifyRecording = FOUR_CHAR_CODE('recr') /* available only in vers 1.0.1 and greater */
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AEEventSource is defined as an SInt8 for compatability with pascal.
|
||||
* Important note: keyEventSourceAttr is returned by AttributePtr as a typeShortInteger.
|
||||
* Be sure to pass at least two bytes of storage to AEGetAttributePtr - the result can be
|
||||
* compared directly against the following enums.
|
||||
*/
|
||||
typedef SInt8 AEEventSource;
|
||||
enum {
|
||||
kAEUnknownSource = 0,
|
||||
kAEDirectCall = 1,
|
||||
kAESameProcess = 2,
|
||||
kAELocalProcess = 3,
|
||||
kAERemoteProcess = 4
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
These calls are used to set up and modify the event dispatch table.
|
||||
**************************************************************************/
|
||||
/*
|
||||
* AEInstallEventHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEInstallEventHandler(
|
||||
AEEventClass theAEEventClass,
|
||||
AEEventID theAEEventID,
|
||||
AEEventHandlerUPP handler,
|
||||
long handlerRefcon,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x091F, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AERemoveEventHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AERemoveEventHandler(
|
||||
AEEventClass theAEEventClass,
|
||||
AEEventID theAEEventID,
|
||||
AEEventHandlerUPP handler,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0720, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEGetEventHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEGetEventHandler(
|
||||
AEEventClass theAEEventClass,
|
||||
AEEventID theAEEventID,
|
||||
AEEventHandlerUPP * handler,
|
||||
long * handlerRefcon,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0921, 0xA816);
|
||||
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
These calls are used to set up and modify special hooks into the
|
||||
AppleEvent manager.
|
||||
**************************************************************************/
|
||||
/*
|
||||
* AEInstallSpecialHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEInstallSpecialHandler(
|
||||
AEKeyword functionClass,
|
||||
AEEventHandlerUPP handler,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0500, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AERemoveSpecialHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AERemoveSpecialHandler(
|
||||
AEKeyword functionClass,
|
||||
AEEventHandlerUPP handler,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x0501, 0xA816);
|
||||
|
||||
|
||||
/*
|
||||
* AEGetSpecialHandler()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEGetSpecialHandler(
|
||||
AEKeyword functionClass,
|
||||
AEEventHandlerUPP * handler,
|
||||
Boolean isSysHandler) THREEWORDINLINE(0x303C, 0x052D, 0xA816);
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
This call was added in version 1.0.1. If called with the keyword
|
||||
keyAERecorderCount ('recr'), the number of recorders that are
|
||||
currently active is returned in 'result'
|
||||
(available only in vers 1.0.1 and greater).
|
||||
**************************************************************************/
|
||||
/*
|
||||
* AEManagerInfo()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
AEManagerInfo(
|
||||
AEKeyword keyWord,
|
||||
long * result) THREEWORDINLINE(0x303C, 0x0441, 0xA816);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPLEEVENTS__ */
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
/*
|
||||
File: AppleHelp.h
|
||||
|
||||
Contains: Apple Help
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __APPLEHELP__
|
||||
#define __APPLEHELP__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __FILES__
|
||||
#include <Files.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFSTRING__
|
||||
#include <CFString.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/* AppleHelp Error Codes */
|
||||
enum {
|
||||
kAHInternalErr = -10790,
|
||||
kAHInternetConfigPrefErr = -10791
|
||||
};
|
||||
|
||||
|
||||
typedef SInt16 AHTOCType;
|
||||
enum {
|
||||
kAHTOCTypeUser = 0,
|
||||
kAHTOCTypeDeveloper = 1
|
||||
};
|
||||
|
||||
/*
|
||||
* AHSearch()
|
||||
*
|
||||
* Discussion:
|
||||
* Delivers a request to perform the specified search to the Help
|
||||
* Viewer application.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* bookname:
|
||||
* Optionally, the AppleTitle of the Help book to be searched. If
|
||||
* NULL, all installed Help books are searched.
|
||||
*
|
||||
* query:
|
||||
* The query to be made. This string can, if desired, have boolean
|
||||
* operators or be a natural language phrase.
|
||||
*
|
||||
* Result:
|
||||
* An operating system result code that indicates whether the
|
||||
* request was successfully sent to the Help Viewer application.
|
||||
* Possible values: noErr, paramErr, kAHInternalErr,
|
||||
* kAHInternetConfigPrefErr.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AHSearch(
|
||||
CFStringRef bookname,
|
||||
CFStringRef query);
|
||||
|
||||
|
||||
/*
|
||||
* AHGotoMainTOC()
|
||||
*
|
||||
* Discussion:
|
||||
* Delivers a request to load the main table of contents of
|
||||
* installed help books to the Help Viewer application.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* toctype:
|
||||
* The type of table of contents to be loaded: user or developer.
|
||||
*
|
||||
* Result:
|
||||
* An operating system result code that indicates whether the
|
||||
* request was successfully sent to the Help Viewer application.
|
||||
* Possible values: noErr, paramErr, kAHInternalErr,
|
||||
* kAHInternetConfigPrefErr.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AHGotoMainTOC(AHTOCType toctype);
|
||||
|
||||
|
||||
/*
|
||||
* AHGotoPage()
|
||||
*
|
||||
* Discussion:
|
||||
* Delivers a request to load a specific text/html file to the Help
|
||||
* Viewer application.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* bookname:
|
||||
* Optionally, the AppleTitle of an installed Help book. If NULL,
|
||||
* the path parameter must be a full file: URL to the file to be
|
||||
* opened.
|
||||
*
|
||||
* path:
|
||||
* Optionally, one of two types of paths: 1) a URL-style path to a
|
||||
* file that is relative to the main folder of the book supplied
|
||||
* in the bookname parameter, or 2) if bookname is NULL, a full
|
||||
* file: URL to the file to be opened. If this parameter is NULL,
|
||||
* then bookname must not be NULL, and is used to open the Help
|
||||
* Viewer to the main page of Help content for the specified book.
|
||||
*
|
||||
* anchor:
|
||||
* Optionally, the name of anchor tag to scroll to in the newly
|
||||
* opened file. Can be NULL.
|
||||
*
|
||||
* Result:
|
||||
* An operating system result code that indicates whether the
|
||||
* request was successfully sent to the Help Viewer application.
|
||||
* Possible values: noErr, paramErr, kAHInternalErr,
|
||||
* kAHInternetConfigPrefErr.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AHGotoPage(
|
||||
CFStringRef bookname,
|
||||
CFStringRef path,
|
||||
CFStringRef anchor);
|
||||
|
||||
|
||||
/*
|
||||
* AHLookupAnchor()
|
||||
*
|
||||
* Discussion:
|
||||
* Delivers a request to perform an anchor lookup to the Help Viewer
|
||||
* application. Note: anchor lookups will fail unless you have
|
||||
* indexed your help content with anchor indexing turned on in the
|
||||
* indexing tool's preferences panel.
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* bookname:
|
||||
* Optionally, the AppleTitle of the Help book to searched. If
|
||||
* NULL, the anchor lookup is performed using all installed Help
|
||||
* books.
|
||||
*
|
||||
* anchor:
|
||||
* The name of the anchor tag to look up.
|
||||
*
|
||||
* Result:
|
||||
* An operating system result code that indicates whether the
|
||||
* request was successfully sent to the Help Viewer application.
|
||||
* Possible values: noErr, paramErr, kAHInternalErr,
|
||||
* kAHInternetConfigPrefErr.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AHLookupAnchor(
|
||||
CFStringRef bookname,
|
||||
CFStringRef anchor);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AHRegisterHelpBook()
|
||||
*
|
||||
* Discussion:
|
||||
* Registers a book of Help content such that the book will appear
|
||||
* in the current user's main table of contents (Help Center) in the
|
||||
* Help Viewer application. To be used when help books reside
|
||||
* outside of the known help folders (i.e. help books that are kept
|
||||
* inside of application bundles).
|
||||
*
|
||||
* Parameters:
|
||||
*
|
||||
* appBundleRef:
|
||||
* An FSRef pointer to the bundle within which one or more Help
|
||||
* books is stored. This is likely an FSRef to your application's
|
||||
* main bundle.
|
||||
*
|
||||
* Result:
|
||||
* An operating system result code that indicates whether all help
|
||||
* books contained within the specified bundle were registered.
|
||||
* Possible values: noErr, paramErr, kAHInternalErr, dirNFErr.
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: in CarbonLib 1.1 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSStatus )
|
||||
AHRegisterHelpBook(const FSRef * appBundleRef);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPLEHELP__ */
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
File: AppleScript.h
|
||||
|
||||
Contains: AppleScript Specific Interfaces.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1992-2000 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __APPLESCRIPT__
|
||||
#define __APPLESCRIPT__
|
||||
|
||||
#ifndef __MACERRORS__
|
||||
#include <MacErrors.h>
|
||||
#endif
|
||||
|
||||
#ifndef __OSA__
|
||||
#include <OSA.h>
|
||||
#endif
|
||||
|
||||
#ifndef __TEXTEDIT__
|
||||
#include <TextEdit.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/**************************************************************************
|
||||
Types and Constants
|
||||
**************************************************************************/
|
||||
/*
|
||||
The specific type for the AppleScript instance of the
|
||||
Open Scripting Architecture type.
|
||||
*/
|
||||
enum {
|
||||
typeAppleScript = FOUR_CHAR_CODE('ascr'),
|
||||
kAppleScriptSubtype = typeAppleScript,
|
||||
typeASStorage = typeAppleScript
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
Component Selectors
|
||||
**************************************************************************/
|
||||
|
||||
enum {
|
||||
kASSelectInit = 0x1001,
|
||||
kASSelectSetSourceStyles = 0x1002,
|
||||
kASSelectGetSourceStyles = 0x1003,
|
||||
kASSelectGetSourceStyleNames = 0x1004
|
||||
};
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
OSAGetScriptInfo Selectors
|
||||
**************************************************************************/
|
||||
enum {
|
||||
kASHasOpenHandler = FOUR_CHAR_CODE('hsod')
|
||||
};
|
||||
|
||||
/*
|
||||
This selector is used to query a context as to whether it contains
|
||||
a handler for the kAEOpenDocuments event. This allows "applets" to be
|
||||
distinguished from "droplets." OSAGetScriptInfo returns false if
|
||||
there is no kAEOpenDocuments handler, and returns the error value
|
||||
errOSAInvalidAccess if the input is not a context.
|
||||
*/
|
||||
/**************************************************************************
|
||||
Initialization
|
||||
**************************************************************************/
|
||||
/*
|
||||
* ASInit()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASInit(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
long minStackSize,
|
||||
long preferredStackSize,
|
||||
long maxStackSize,
|
||||
long minHeapSize,
|
||||
long preferredHeapSize,
|
||||
long maxHeapSize) FIVEWORDINLINE(0x2F3C, 0x001C, 0x1001, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
ComponentCallNow(kASSelectInit, 28);
|
||||
This call can be used to explicitly initialize AppleScript. If it is
|
||||
not called, the a scripting size resource is looked for and used. If
|
||||
there is no scripting size resource, then the constants listed below
|
||||
are used. If at any stage (the init call, the size resource, the
|
||||
defaults) any of these parameters are zero, then parameters from the
|
||||
next stage are used. ModeFlags are not currently used.
|
||||
Errors:
|
||||
errOSASystemError initialization failed
|
||||
*/
|
||||
/*
|
||||
These values will be used if ASInit is not called explicitly, or if any
|
||||
of ASInit's parameters are zero:
|
||||
*/
|
||||
enum {
|
||||
kASDefaultMinStackSize = 4 * 1024,
|
||||
kASDefaultPreferredStackSize = 16 * 1024,
|
||||
kASDefaultMaxStackSize = 16 * 1024,
|
||||
kASDefaultMinHeapSize = 4 * 1024,
|
||||
kASDefaultPreferredHeapSize = 16 * 1024,
|
||||
kASDefaultMaxHeapSize = 32L * 1024 * 1024
|
||||
};
|
||||
|
||||
/**************************************************************************
|
||||
Source Styles
|
||||
**************************************************************************/
|
||||
/*
|
||||
* ASSetSourceStyles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASSetSourceStyles(
|
||||
ComponentInstance scriptingComponent,
|
||||
STHandle sourceStyles) FIVEWORDINLINE(0x2F3C, 0x0004, 0x1002, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
ComponentCallNow(kASSelectSetSourceStyles, 4);
|
||||
Errors:
|
||||
errOSASystemError operation failed
|
||||
*/
|
||||
/*
|
||||
* ASGetSourceStyles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASGetSourceStyles(
|
||||
ComponentInstance scriptingComponent,
|
||||
STHandle * resultingSourceStyles) FIVEWORDINLINE(0x2F3C, 0x0004, 0x1003, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
ComponentCallNow(kASSelectGetSourceStyles, 4);
|
||||
Errors:
|
||||
errOSASystemError operation failed
|
||||
*/
|
||||
/*
|
||||
* ASGetSourceStyleNames()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in AppleScriptLib 1.1 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSAError )
|
||||
ASGetSourceStyleNames(
|
||||
ComponentInstance scriptingComponent,
|
||||
long modeFlags,
|
||||
AEDescList * resultingSourceStyleNamesList) FIVEWORDINLINE(0x2F3C, 0x0008, 0x1004, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
ComponentCallNow(kASSelectGetSourceStyleNames, 8);
|
||||
This call returns an AEList of styled text descriptors the names of the
|
||||
source styles in the current dialect. The order of the names corresponds
|
||||
to the order of the source style constants, below. The style of each
|
||||
name is the same as the styles returned by ASGetSourceStyles.
|
||||
|
||||
Errors:
|
||||
errOSASystemError operation failed
|
||||
*/
|
||||
/*
|
||||
Elements of STHandle correspond to following categories of tokens, and
|
||||
accessed through following index constants:
|
||||
*/
|
||||
enum {
|
||||
kASSourceStyleUncompiledText = 0,
|
||||
kASSourceStyleNormalText = 1,
|
||||
kASSourceStyleLanguageKeyword = 2,
|
||||
kASSourceStyleApplicationKeyword = 3,
|
||||
kASSourceStyleComment = 4,
|
||||
kASSourceStyleLiteral = 5,
|
||||
kASSourceStyleUserSymbol = 6,
|
||||
kASSourceStyleObjectSpecifier = 7,
|
||||
kASNumberOfSourceStyles = 8
|
||||
};
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __APPLESCRIPT__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,299 @@
|
||||
/*
|
||||
File: ApplicationServices.h
|
||||
|
||||
Contains: Master include for ApplicationServices public framework
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __APPLICATIONSERVICES__
|
||||
#define __APPLICATIONSERVICES__
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSLAYOUTTYPES__
|
||||
#include <ATSLayoutTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSFONT__
|
||||
#include <ATSFont.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSTYPES__
|
||||
#include <ATSTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SCALERSTREAMTYPES__
|
||||
#include <ScalerStreamTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SFNTLAYOUTTYPES__
|
||||
#include <SFNTLayoutTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SFNTTYPES__
|
||||
#include <SFNTTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
#ifndef __QUICKDRAW__
|
||||
#include <Quickdraw.h>
|
||||
#endif
|
||||
|
||||
#ifndef __QDOFFSCREEN__
|
||||
#include <QDOffscreen.h>
|
||||
#endif
|
||||
|
||||
#ifndef __QDPICTTOCGCONTEXT__
|
||||
#include <QDPictToCGContext.h>
|
||||
#endif
|
||||
|
||||
#ifndef __QUICKDRAWTEXT__
|
||||
#include <QuickdrawText.h>
|
||||
#endif
|
||||
|
||||
#ifndef __FONTS__
|
||||
#include <Fonts.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PALETTES__
|
||||
#include <Palettes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PICTUTILS__
|
||||
#include <PictUtils.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSUNICODE__
|
||||
#include <ATSUnicode.h>
|
||||
#endif
|
||||
|
||||
#ifndef __VIDEO__
|
||||
#include <Video.h>
|
||||
#endif
|
||||
|
||||
#ifndef __DISPLAYS__
|
||||
#include <Displays.h>
|
||||
#endif
|
||||
|
||||
#ifndef __FONTSYNC__
|
||||
#include <FontSync.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSUNICODEFLATTENING__
|
||||
#include <ATSUnicodeFlattening.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ATSUNICODEDIRECTACCESS__
|
||||
#include <ATSUnicodeDirectAccess.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEDATAMODEL__
|
||||
#include <AEDataModel.h>
|
||||
#endif
|
||||
|
||||
#ifndef __APPLEEVENTS__
|
||||
#include <AppleEvents.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEPACKOBJECT__
|
||||
#include <AEPackObject.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEOBJECTS__
|
||||
#include <AEObjects.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEREGISTRY__
|
||||
#include <AERegistry.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEUSERTERMTYPES__
|
||||
#include <AEUserTermTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEHELPERS__
|
||||
#include <AEHelpers.h>
|
||||
#endif
|
||||
|
||||
#ifndef __AEMACH__
|
||||
#include <AEMach.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ICONS__
|
||||
#include <Icons.h>
|
||||
#endif
|
||||
|
||||
#ifndef __INTERNETCONFIG__
|
||||
#include <InternetConfig.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PROCESSES__
|
||||
#include <Processes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGAFFINETRANSFORM__
|
||||
#include <CGAffineTransform.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGBITMAPCONTEXT__
|
||||
#include <CGBitmapContext.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGCOLORSPACE__
|
||||
#include <CGColorSpace.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGFONT__
|
||||
#include <CGFont.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGCONTEXT__
|
||||
#include <CGContext.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGPATTERN__
|
||||
#include <CGPattern.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGDATACONSUMER__
|
||||
#include <CGDataConsumer.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGDATAPROVIDER__
|
||||
#include <CGDataProvider.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGERROR__
|
||||
#include <CGError.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGDIRECTDISPLAY__
|
||||
#include <CGDirectDisplay.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGDIRECTPALETTE__
|
||||
#include <CGDirectPalette.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGREMOTEOPERATION__
|
||||
#include <CGRemoteOperation.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGWINDOWLEVEL__
|
||||
#include <CGWindowLevel.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGGEOMETRY__
|
||||
#include <CGGeometry.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGIMAGE__
|
||||
#include <CGImage.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGPDFCONTEXT__
|
||||
#include <CGPDFContext.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGPDFDOCUMENT__
|
||||
#include <CGPDFDocument.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMTYPES__
|
||||
#include <CMTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMAPPLICATION__
|
||||
#include <CMApplication.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMICCPROFILE__
|
||||
#include <CMICCProfile.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMDEVICEINTEGRATION__
|
||||
#include <CMDeviceIntegration.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMMCOMPONENT__
|
||||
#include <CMMComponent.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMSCRIPTINGPLUGIN__
|
||||
#include <CMScriptingPlugin.h>
|
||||
#endif
|
||||
|
||||
#ifndef __FINDBYCONTENT__
|
||||
#include <FindByContent.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PMCORE__
|
||||
#include <PMCore.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PMDEFINITIONS__
|
||||
#include <PMDefinitions.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CORESERVICES__
|
||||
#include <CoreServices.h>
|
||||
#endif
|
||||
|
||||
#ifndef __LANGUAGEANALYSIS__
|
||||
#include <LanguageAnalysis.h>
|
||||
#endif
|
||||
|
||||
#ifndef __DICTIONARY__
|
||||
#include <Dictionary.h>
|
||||
#endif
|
||||
|
||||
#ifndef __SPEECHSYNTHESIS__
|
||||
#include <SpeechSynthesis.h>
|
||||
#endif
|
||||
|
||||
#ifndef __LAUNCHSERVICES__
|
||||
#include <LaunchServices.h>
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __APPLICATIONSERVICES__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,555 @@
|
||||
/*
|
||||
File: AvailabilityMacros.h
|
||||
|
||||
Copyright: (c) 2001-2005 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
More Info: See TechNote 2064
|
||||
|
||||
Contains: Autoconfiguration of AVAILABLE_ macros for Mac OS X
|
||||
|
||||
This header enables a developer to specify build time
|
||||
constraints on what Mac OS X versions the resulting
|
||||
application will be run. There are two bounds a developer
|
||||
can specify:
|
||||
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
|
||||
The lower bound controls which calls to OS functions will
|
||||
be weak-importing (allowed to be unresolved at launch time).
|
||||
The upper bound controls which OS functionality, if used,
|
||||
will result in a compiler error because that functionality is
|
||||
not available on on any OS is the specifed range.
|
||||
|
||||
For example, suppose an application is compiled with:
|
||||
|
||||
MAC_OS_X_VERSION_MIN_REQUIRED = MAC_OS_X_VERSION_10_2
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED = MAC_OS_X_VERSION_10_3
|
||||
|
||||
and an OS header contains:
|
||||
|
||||
extern void funcA(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER;
|
||||
extern void funcB(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2;
|
||||
extern void funcC(void) AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3;
|
||||
extern void funcD(void) AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER;
|
||||
extern void funcE(void) AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER;
|
||||
extern void funcF(void) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
||||
extern void funcG(void) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
typedef long TypeA DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER;
|
||||
typedef long TypeB DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER;
|
||||
typedef long TypeC DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER;
|
||||
typedef long TypeD DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER;
|
||||
typedef long TypeE DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
Any application code which uses these declarations will get the following:
|
||||
|
||||
compile link run
|
||||
------- ------ -------
|
||||
funcA: normal normal normal
|
||||
funcB: warning normal normal
|
||||
funcC: normal normal normal
|
||||
funcD: normal normal normal
|
||||
funcE: normal normal normal
|
||||
funcF: normal weak on 10.3 normal, on 10.2 (&funcF == NULL)
|
||||
funcG: error error n/a
|
||||
typeA: warning
|
||||
typeB: warning
|
||||
typeC: warning
|
||||
typeD: normal
|
||||
typeE: normal
|
||||
|
||||
|
||||
*/
|
||||
#ifndef __AVAILABILITYMACROS__
|
||||
#define __AVAILABILITYMACROS__
|
||||
|
||||
|
||||
/*
|
||||
* Set up standard Mac OS X versions
|
||||
*/
|
||||
#define MAC_OS_X_VERSION_10_0 1000
|
||||
#define MAC_OS_X_VERSION_10_1 1010
|
||||
#define MAC_OS_X_VERSION_10_2 1020
|
||||
#define MAC_OS_X_VERSION_10_3 1030
|
||||
#define MAC_OS_X_VERSION_10_4 1040
|
||||
#define MAC_OS_X_VERSION_10_5 1050
|
||||
|
||||
|
||||
/*
|
||||
* If min OS not specified, assume 10.1
|
||||
* Note: gcc driver may set _ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED_ based on MACOSX_DEPLOYMENT_TARGET environment variable
|
||||
*/
|
||||
#ifndef MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
||||
#else
|
||||
#if __ppc64__ || __i386__ || __x86_64__
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_4
|
||||
#else
|
||||
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* if max OS not specified, assume largerof(10.5, min)
|
||||
*/
|
||||
#ifndef MAC_OS_X_VERSION_MAX_ALLOWED
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#else
|
||||
#define MAC_OS_X_VERSION_MAX_ALLOWED MAC_OS_X_VERSION_10_5
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Error on bad values
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#error MAC_OS_X_VERSION_MAX_ALLOWED must be >= MAC_OS_X_VERSION_MIN_REQUIRED
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_0
|
||||
#error MAC_OS_X_VERSION_MIN_REQUIRED must be >= MAC_OS_X_VERSION_10_0
|
||||
#endif
|
||||
|
||||
/*
|
||||
* only certain compilers support __attribute__((weak_import))
|
||||
*/
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
|
||||
#define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
|
||||
#elif defined(__MWERKS__) && (__MWERKS__ >= 0x3205) && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1020)
|
||||
#define WEAK_IMPORT_ATTRIBUTE __attribute__((weak_import))
|
||||
#else
|
||||
#define WEAK_IMPORT_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* only certain compilers support __attribute__((deprecated))
|
||||
*/
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||
#define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
||||
#else
|
||||
#define DEPRECATED_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* only certain compilers support __attribute__((unavailable))
|
||||
*/
|
||||
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
|
||||
#define UNAVAILABLE_ATTRIBUTE __attribute__((unavailable))
|
||||
#else
|
||||
#define UNAVAILABLE_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
*
|
||||
* Used on functions introduced in Mac OS X 10.0
|
||||
*/
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on functions introduced in Mac OS X 10.0,
|
||||
* and deprecated in Mac OS X 10.0
|
||||
*/
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.0
|
||||
*/
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_0_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_1
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_1
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* and deprecated in Mac OS X 10.1
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.1
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_1 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.1
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_1
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2,
|
||||
* and deprecated in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* but later deprecated in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_2 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.2
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_2
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.3,
|
||||
* and deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* but later deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2,
|
||||
* but later deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_3 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.3
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.4,
|
||||
* and deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* but later deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2,
|
||||
* but later deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.3,
|
||||
* but later deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_4 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.4
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_4
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.5
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_5
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER UNAVAILABLE_ATTRIBUTE
|
||||
#elif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER WEAK_IMPORT_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.5,
|
||||
* and deprecated in Mac OS X 10.5
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER_BUT_DEPRECATED AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.0,
|
||||
* but later deprecated in Mac OS X 10.5
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.1,
|
||||
* but later deprecated in Mac OS X 10.5
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.2,
|
||||
* but later deprecated in Mac OS X 10.5
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_2_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.3,
|
||||
* but later deprecated in Mac OS X 10.5
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5
|
||||
*
|
||||
* Used on declarations introduced in Mac OS X 10.4,
|
||||
* but later deprecated in Mac OS X 10.5
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
|
||||
*
|
||||
* Used on types deprecated in Mac OS X 10.5
|
||||
*/
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER DEPRECATED_ATTRIBUTE
|
||||
#else
|
||||
#define DEPRECATED_IN_MAC_OS_X_VERSION_10_5_AND_LATER
|
||||
#endif
|
||||
|
||||
#endif /* __AVAILABILITYMACROS__ */
|
||||
|
||||
|
||||
@@ -0,0 +1,593 @@
|
||||
/*
|
||||
File: Balloons.h
|
||||
|
||||
Contains: Balloon Help Package Interfaces.
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1990-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __BALLOONS__
|
||||
#define __BALLOONS__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MACERRORS__
|
||||
#include <MacErrors.h>
|
||||
#endif
|
||||
|
||||
#ifndef __QUICKDRAW__
|
||||
#include <Quickdraw.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MENUS__
|
||||
#include <Menus.h>
|
||||
#endif
|
||||
|
||||
#ifndef __TEXTEDIT__
|
||||
#include <TextEdit.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/*
|
||||
Carbon clients should use MacHelp. The definitions below will NOT work for Carbon and
|
||||
are only defined for those files that need to build pre-Carbon applications.
|
||||
*/
|
||||
/* o.constants*/
|
||||
|
||||
typedef SInt16 BalloonVariant;
|
||||
enum {
|
||||
kTopLeftTipPointsLeftVariant = 0,
|
||||
kTopLeftTipPointsUpVariant = 1,
|
||||
kTopRightTipPointsUpVariant = 2,
|
||||
kTopRightTipPointsRightVariant = 3,
|
||||
kBottomRightTipPointsRightVariant = 4,
|
||||
kBottomRightTipPointsDownVariant = 5,
|
||||
kBottomLeftTipPointsDownVariant = 6,
|
||||
kBottomLeftTipPointsLeftVariant = 7,
|
||||
kBalloonVariantCount = 8
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
hmBalloonHelpVersion = 0x0002 /* The real version of the Help Manager */
|
||||
};
|
||||
|
||||
enum {
|
||||
kHMHelpMenuID = -16490, /* Resource ID and menu ID of help menu */
|
||||
kHMAboutHelpItem = 1, /* help menu item number of About Balloon Help... */
|
||||
kHMShowBalloonsItem = 3 /* help menu item number of Show/Hide Balloons */
|
||||
};
|
||||
|
||||
enum {
|
||||
kHMHelpID = -5696, /* ID of various Help Mgr package resources (in Pack14 range) */
|
||||
kBalloonWDEFID = 126 /* Resource ID of the WDEF proc used in standard balloons */
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Dialog item template type constant */
|
||||
helpItem = 1 /* key value in DITL template that corresponds to the help item */
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
|
||||
hmDefaultOptions = 0, /* default options for help manager resources */
|
||||
hmUseSubIDBit = 0,
|
||||
hmAbsoluteCoordsBit = 1,
|
||||
hmSaveBitsNoWindowBit = 2,
|
||||
hmSaveBitsWindowBit = 3,
|
||||
hmMatchInTitleBit = 4,
|
||||
hmUseSubIDMask = (1 << hmUseSubIDBit), /* treat resID's in resources as subID's of driver base ID (for Desk Accessories) */
|
||||
hmAbsoluteCoordsMask = (1 << hmAbsoluteCoordsBit), /* ignore window port origin and treat rectangles as absolute coords (local to window) */
|
||||
hmSaveBitsNoWindowMask = (1 << hmSaveBitsNoWindowBit), /* don't create a window, just blast bits on screen. No update event is generated */
|
||||
hmSaveBitsWindowMask = (1 << hmSaveBitsWindowBit), /* create a window, but restore bits behind window when window goes away & generate update event */
|
||||
hmMatchInTitleMask = (1 << hmMatchInTitleBit) /* for hwin resources, match string anywhere in window title string */
|
||||
};
|
||||
|
||||
#if OLDROUTINENAMES
|
||||
enum {
|
||||
hmUseSubID = hmUseSubIDMask,
|
||||
hmAbsoluteCoords = hmAbsoluteCoordsMask,
|
||||
hmSaveBitsNoWindow = hmSaveBitsNoWindowMask,
|
||||
hmSaveBitsWindow = hmSaveBitsWindowMask,
|
||||
hmMatchInTitle = hmMatchInTitleMask
|
||||
};
|
||||
|
||||
#endif /* OLDROUTINENAMES */
|
||||
|
||||
enum {
|
||||
/* Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources */
|
||||
kHMStringItem = 1, /* pstring used in resource */
|
||||
kHMPictItem = 2, /* 'PICT' ResID used in resource */
|
||||
kHMStringResItem = 3, /* 'STR#' ResID & index used in resource */
|
||||
kHMTEResItem = 6, /* Styled Text Edit ResID used in resource ('TEXT' & 'styl') */
|
||||
kHMSTRResItem = 7, /* 'STR ' ResID used in resource */
|
||||
kHMSkipItem = 256, /* don't display a balloon */
|
||||
kHMCompareItem = 512, /* Compare pstring in menu item w/ PString in resource item ('hmnu' only) */
|
||||
kHMNamedResourceItem = 1024, /* Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) */
|
||||
kHMTrackCntlItem = 2048 /* Reserved */
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Constants for hmmHelpType's when filling out HMMessageRecord */
|
||||
khmmString = 1, /* help message contains a PString */
|
||||
khmmPict = 2, /* help message contains a resource ID to a 'PICT' resource */
|
||||
khmmStringRes = 3, /* help message contains a res ID & index to a 'STR#' resource */
|
||||
khmmTEHandle = 4, /* help message contains a Text Edit handle */
|
||||
khmmPictHandle = 5, /* help message contains a Picture handle */
|
||||
khmmTERes = 6, /* help message contains a res ID to 'TEXT' & 'styl' resources */
|
||||
khmmSTRRes = 7, /* help message contains a res ID to a 'STR ' resource */
|
||||
kHMEnabledItem = 0 /* item is enabled, but not checked or control value = 0 */
|
||||
};
|
||||
|
||||
enum {
|
||||
/* ResTypes for Styled TE Handles in Resources */
|
||||
kHMTETextResType = FOUR_CHAR_CODE('TEXT'), /* Resource Type of text data for styled TE record w/o style info */
|
||||
kHMTEStyleResType = FOUR_CHAR_CODE('styl') /* Resource Type of style information for styled TE record */
|
||||
};
|
||||
|
||||
enum {
|
||||
kHMDisabledItem = 1, /* item is disabled, grayed in menus or disabled in dialogs */
|
||||
kHMCheckedItem = 2, /* item is enabled, and checked or control value = 1 */
|
||||
kHMOtherItem = 3, /* item is enabled, and control value > 1 */
|
||||
/* Method parameters to pass to HMShowBalloon */
|
||||
kHMRegularWindow = 0, /* Create a regular window floating above all windows */
|
||||
kHMSaveBitsNoWindow = 1, /* Just save the bits and draw (for MDEF calls) */
|
||||
kHMSaveBitsWindow = 2 /* Regular window, save bits behind, AND generate update event */
|
||||
};
|
||||
|
||||
enum {
|
||||
/* Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages */
|
||||
kHMMenuResType = FOUR_CHAR_CODE('hmnu'), /* ResType of help resource for supporting menus */
|
||||
kHMDialogResType = FOUR_CHAR_CODE('hdlg'), /* ResType of help resource for supporting dialogs */
|
||||
kHMWindListResType = FOUR_CHAR_CODE('hwin'), /* ResType of help resource for supporting windows */
|
||||
kHMRectListResType = FOUR_CHAR_CODE('hrct'), /* ResType of help resource for rectangles in windows */
|
||||
kHMOverrideResType = FOUR_CHAR_CODE('hovr'), /* ResType of help resource for overriding system balloons */
|
||||
kHMFinderApplResType = FOUR_CHAR_CODE('hfdr') /* ResType of help resource for custom balloon in Finder */
|
||||
};
|
||||
|
||||
struct HMStringResType {
|
||||
short hmmResID;
|
||||
short hmmIndex;
|
||||
};
|
||||
typedef struct HMStringResType HMStringResType;
|
||||
struct HMMessageRecord {
|
||||
SInt16 hmmHelpType;
|
||||
union {
|
||||
Str255 hmmString;
|
||||
SInt16 hmmPict;
|
||||
TEHandle hmmTEHandle;
|
||||
HMStringResType hmmStringRes;
|
||||
SInt16 hmmPictRes;
|
||||
PicHandle hmmPictHandle;
|
||||
SInt16 hmmTERes;
|
||||
SInt16 hmmSTRRes;
|
||||
} u;
|
||||
};
|
||||
typedef struct HMMessageRecord HMMessageRecord;
|
||||
typedef HMMessageRecord * HMMessageRecPtr;
|
||||
typedef CALLBACK_API( OSErr , TipFunctionProcPtr )(Point tip, RgnHandle structure, Rect *r, BalloonVariant *balloonVariant);
|
||||
typedef STACK_UPP_TYPE(TipFunctionProcPtr) TipFunctionUPP;
|
||||
#if CALL_NOT_IN_CARBON
|
||||
/*
|
||||
* NewTipFunctionUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( TipFunctionUPP )
|
||||
NewTipFunctionUPP(TipFunctionProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppTipFunctionProcInfo = 0x00003FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(TipFunctionUPP) NewTipFunctionUPP(TipFunctionProcPtr userRoutine) { return (TipFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTipFunctionProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewTipFunctionUPP(userRoutine) (TipFunctionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTipFunctionProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeTipFunctionUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeTipFunctionUPP(TipFunctionUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeTipFunctionUPP(TipFunctionUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeTipFunctionUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeTipFunctionUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeTipFunctionUPP(
|
||||
Point tip,
|
||||
RgnHandle structure,
|
||||
Rect * r,
|
||||
BalloonVariant * balloonVariant,
|
||||
TipFunctionUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeTipFunctionUPP(Point tip, RgnHandle structure, Rect * r, BalloonVariant * balloonVariant, TipFunctionUPP userUPP) { return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppTipFunctionProcInfo, tip, structure, r, balloonVariant); }
|
||||
#else
|
||||
#define InvokeTipFunctionUPP(tip, structure, r, balloonVariant, userUPP) (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppTipFunctionProcInfo, (tip), (structure), (r), (balloonVariant))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewTipFunctionProc(userRoutine) NewTipFunctionUPP(userRoutine)
|
||||
#define CallTipFunctionProc(userRoutine, tip, structure, r, balloonVariant) InvokeTipFunctionUPP(tip, structure, r, balloonVariant, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
/* Public Interfaces */
|
||||
#if CALL_NOT_IN_CARBON
|
||||
/*
|
||||
* HMGetHelpMenuHandle()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMGetHelpMenuHandle(MenuRef * mh) THREEWORDINLINE(0x303C, 0x0200, 0xA830);
|
||||
|
||||
|
||||
#define HMGetHelpMenuRef HMGetHelpMenuHandle
|
||||
/*
|
||||
* HMShowBalloon()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMShowBalloon(
|
||||
const HMMessageRecord * inHelpMessage,
|
||||
Point inTip,
|
||||
Rect * inHotRect, /* can be NULL */
|
||||
TipFunctionUPP inTipProc,
|
||||
SInt16 inWindowProcID,
|
||||
BalloonVariant inBalloonVariant,
|
||||
SInt16 inMethod) THREEWORDINLINE(0x303C, 0x0B01, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMShowMenuBalloon()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMShowMenuBalloon(
|
||||
SInt16 itemNum,
|
||||
SInt16 itemMenuID,
|
||||
SInt32 itemFlags,
|
||||
SInt32 itemReserved,
|
||||
Point tip,
|
||||
Rect * alternateRect, /* can be NULL */
|
||||
TipFunctionUPP tipProc,
|
||||
SInt16 theProc,
|
||||
BalloonVariant balloonVariant) THREEWORDINLINE(0x303C, 0x0E05, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMRemoveBalloon()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMRemoveBalloon(void) THREEWORDINLINE(0x303C, 0x0002, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMGetIndHelpMsg()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMGetIndHelpMsg(
|
||||
ResType inWhichResType,
|
||||
SInt16 inWhichResID,
|
||||
SInt16 inMessageIndex,
|
||||
SInt16 inMessageState,
|
||||
UInt32 * outOptions,
|
||||
Point * outTip,
|
||||
Rect * outHotRect,
|
||||
SInt16 * outWindowProcID,
|
||||
BalloonVariant * outBalloonVariant,
|
||||
HMMessageRecord * outHelpMessage,
|
||||
SInt16 * outMessageCount) THREEWORDINLINE(0x303C, 0x1306, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMIsBalloon()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( Boolean )
|
||||
HMIsBalloon(void) THREEWORDINLINE(0x303C, 0x0007, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMGetBalloons()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( Boolean )
|
||||
HMGetBalloons(void) THREEWORDINLINE(0x303C, 0x0003, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMSetBalloons()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMSetBalloons(Boolean flag) THREEWORDINLINE(0x303C, 0x0104, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMSetFont()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMSetFont(SInt16 font) THREEWORDINLINE(0x303C, 0x0108, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMSetFontSize()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMSetFontSize(UInt16 fontSize) THREEWORDINLINE(0x303C, 0x0109, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMGetFont()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMGetFont(SInt16 * font) THREEWORDINLINE(0x303C, 0x020A, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMGetFontSize()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMGetFontSize(UInt16 * fontSize) THREEWORDINLINE(0x303C, 0x020B, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMSetDialogResID()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMSetDialogResID(SInt16 resID) THREEWORDINLINE(0x303C, 0x010C, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMSetMenuResID()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMSetMenuResID(
|
||||
SInt16 menuID,
|
||||
SInt16 resID) THREEWORDINLINE(0x303C, 0x020D, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMBalloonRect()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMBalloonRect(
|
||||
const HMMessageRecord * inMessage,
|
||||
Rect * outRect) THREEWORDINLINE(0x303C, 0x040E, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMBalloonPict()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMBalloonPict(
|
||||
const HMMessageRecord * inMessage,
|
||||
PicHandle * outPict) THREEWORDINLINE(0x303C, 0x040F, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMScanTemplateItems()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMScanTemplateItems(
|
||||
SInt16 whichID,
|
||||
SInt16 whichResFile,
|
||||
ResType whichType) THREEWORDINLINE(0x303C, 0x0410, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMExtractHelpMsg()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMExtractHelpMsg(
|
||||
ResType inType,
|
||||
SInt16 inResID,
|
||||
SInt16 inMessageIndex,
|
||||
SInt16 inMessageState,
|
||||
HMMessageRecord * outMessage) THREEWORDINLINE(0x303C, 0x0711, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMGetDialogResID()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMGetDialogResID(SInt16 * resID) THREEWORDINLINE(0x303C, 0x0213, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMGetMenuResID()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMGetMenuResID(
|
||||
SInt16 menuID,
|
||||
SInt16 * resID) THREEWORDINLINE(0x303C, 0x0314, 0xA830);
|
||||
|
||||
|
||||
/*
|
||||
* HMGetBalloonWindow()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in InterfaceLib 7.1 and later
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
HMGetBalloonWindow(WindowRef * window) THREEWORDINLINE(0x303C, 0x0215, 0xA830);
|
||||
|
||||
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __BALLOONS__ */
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
File: CFArray.h
|
||||
|
||||
Contains: CoreFoundation array collection
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFBag.h
|
||||
|
||||
Contains: CoreFoundation bag collection
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
File: CFBase.h
|
||||
|
||||
Contains: CoreFoundation base types
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFBinaryHeap.h
|
||||
|
||||
Contains: CoreFoundation binary heap
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFBitVector.h
|
||||
|
||||
Contains: CoreFoundation bit vectors
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
File: CFBundle.h
|
||||
|
||||
Contains: CoreFoundation bundle
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CFBUNDLE__
|
||||
#define __CFBUNDLE__
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CFBase.h>
|
||||
|
||||
typedef struct __CFBundle* CFBundleRef;
|
||||
typedef struct __CFBundle* CFPlugInRef;
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __CFBUNDLE__ */
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
File: CFCharacterSet.h
|
||||
|
||||
Contains: CoreFoundation character sets
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFCharacterSet.h>
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
File: CFData.h
|
||||
|
||||
Contains: CoreFoundation block of bytes
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFData.h>
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
File: CFDate.h
|
||||
|
||||
Contains: CoreFoundation date
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CFDATE__
|
||||
#define __CFDATE__
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CFBase.h>
|
||||
|
||||
typedef double CFTimeInterval;
|
||||
typedef CFTimeInterval CFAbsoluteTime;
|
||||
typedef const struct __CFDate* CFDateRef;
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __CFDATE__ */
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
File: CFDictionary.h
|
||||
|
||||
Contains: CoreFoundation dictionary collection
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFMachPort.h
|
||||
|
||||
Contains: CoreFoundation bit vectors
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFMessagePort.h
|
||||
|
||||
Contains: CoreFoundation Message Port
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
File: CFNetwork.h
|
||||
|
||||
Contains: CoreFoundation Network header
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
File: CFNotificationCenter.h
|
||||
|
||||
Contains: CoreFoundation Notification Center
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
File: CFNumber.h
|
||||
|
||||
Contains: CoreFoundation numbers
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFNumber.h>
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFPlugIn.h
|
||||
|
||||
Contains: CoreFoundation plugins
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFPlugInCOM.h
|
||||
|
||||
Contains: CoreFoundation plugins
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFPreferences.h
|
||||
|
||||
Contains: CoreFoundation preferences
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFPropertyList.h
|
||||
|
||||
Contains: CoreFoundation PropertyList
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
File: CFRunLoop.h
|
||||
|
||||
Contains: CoreFoundation binary heap
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CFRUNLOOP__
|
||||
#define __CFRUNLOOP__
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CFBase.h>
|
||||
|
||||
typedef struct __CFRunLoop* CFRunLoopRef;
|
||||
typedef struct __CFRunLoopSource* CFRunLoopSourceRef;
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __CFRUNLOOP__ */
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFSet.h
|
||||
|
||||
Contains: CoreFoundation set collection
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFSocket.h
|
||||
|
||||
Contains: CoreFoundation streams header
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFStream.h
|
||||
|
||||
Contains: CoreFoundation streams header
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
File: CFString.h
|
||||
|
||||
Contains: CoreFoundation strings
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFString.h>
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
File: CFStringEncodingExt.h
|
||||
|
||||
Contains: CoreFoundation string encodings
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFStringEncodingExt.h>
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFTimeZone.h
|
||||
|
||||
Contains: CoreFoundation time zone
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
File: CFTree.h
|
||||
|
||||
Contains: CoreFoundation tree collection
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CFTREE__
|
||||
#define __CFTREE__
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CFBase.h>
|
||||
|
||||
typedef struct __CFTree* CFTreeRef;
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __CFTREE__ */
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
File: CFURL.h
|
||||
|
||||
Contains: CoreFoundation urls
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CoreFoundation/CFURL.h>
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFURLAccess.h
|
||||
|
||||
Contains: CoreFoundation url access
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
File: CFUUID.h
|
||||
|
||||
Contains: CoreFoundation UUIDs
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CFUUID__
|
||||
#define __CFUUID__
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
#include <CFBase.h>
|
||||
|
||||
typedef struct __CFUUID* CFUUIDRef;
|
||||
struct CFUUIDBytes {
|
||||
UInt8 byte0;
|
||||
UInt8 byte1;
|
||||
UInt8 byte2;
|
||||
UInt8 byte3;
|
||||
UInt8 byte4;
|
||||
UInt8 byte5;
|
||||
UInt8 byte6;
|
||||
UInt8 byte7;
|
||||
UInt8 byte8;
|
||||
UInt8 byte9;
|
||||
UInt8 byte10;
|
||||
UInt8 byte11;
|
||||
UInt8 byte12;
|
||||
UInt8 byte13;
|
||||
UInt8 byte14;
|
||||
UInt8 byte15;
|
||||
};
|
||||
typedef struct CFUUIDBytes CFUUIDBytes;
|
||||
/* The CFUUIDBytes struct is a 128-bit struct that contains the
|
||||
raw UUID. A CFUUIDRef can provide such a struct from the
|
||||
CFUUIDGetUUIDBytes() function. This struct is suitable for
|
||||
passing to APIs that expect a raw UUID.
|
||||
*/
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __CFUUID__ */
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
File: CFXMLNode.h
|
||||
|
||||
Contains: CoreFoundation XML Node and XML Tree
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CFXMLNODE__
|
||||
#define __CFXMLNODE__
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <CFTree.h>
|
||||
|
||||
typedef struct __CFTree* CFTreeRef;
|
||||
typedef CFTreeRef CFXMLTreeRef;
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __CFXMLNODE__ */
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
File: CFXMLParser.h
|
||||
|
||||
Contains: CoreFoundation XML parser
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1999-2001 by Apple Computer, Inc., all rights reserved
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,270 @@
|
||||
/*
|
||||
File: CGAffineTransform.h
|
||||
|
||||
Contains: CoreGraphics affine transforms
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGAFFINETRANSFORM_H_
|
||||
#define CGAFFINETRANSFORM_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGGEOMETRY__
|
||||
#include <CGGeometry.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
struct CGAffineTransform {
|
||||
float a;
|
||||
float b;
|
||||
float c;
|
||||
float d;
|
||||
float tx;
|
||||
float ty;
|
||||
};
|
||||
typedef struct CGAffineTransform CGAffineTransform;
|
||||
/* The identity transform: [ 1 0 0 1 0 0 ]. */
|
||||
/*
|
||||
* CGAffineTransformIdentity
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern const CGAffineTransform CGAffineTransformIdentity;
|
||||
/* Return the transform [ a b c d tx ty ]. */
|
||||
/*
|
||||
* CGAffineTransformMake()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformMake(
|
||||
float a,
|
||||
float b,
|
||||
float c,
|
||||
float d,
|
||||
float tx,
|
||||
float ty);
|
||||
|
||||
|
||||
/* Return a transform which translates by `(tx, ty)':
|
||||
* t' = [ 1 0 0 1 tx ty ] */
|
||||
/*
|
||||
* CGAffineTransformMakeTranslation()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformMakeTranslation(
|
||||
float tx,
|
||||
float ty);
|
||||
|
||||
|
||||
/* Return a transform which scales by `(sx, sy)':
|
||||
* t' = [ sx 0 0 sy 0 0 ] */
|
||||
/*
|
||||
* CGAffineTransformMakeScale()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformMakeScale(
|
||||
float sx,
|
||||
float sy);
|
||||
|
||||
|
||||
/* Return a transform which rotates by `angle' radians:
|
||||
* t' = [ cos(angle) sin(angle) -sin(angle) cos(angle) 0 0 ] */
|
||||
/*
|
||||
* CGAffineTransformMakeRotation()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformMakeRotation(float angle);
|
||||
|
||||
|
||||
/* Translate `t' by `(tx, ty)' and return the result:
|
||||
* t' = [ 1 0 0 1 tx ty ] * t */
|
||||
/*
|
||||
* CGAffineTransformTranslate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformTranslate(
|
||||
CGAffineTransform t,
|
||||
float tx,
|
||||
float ty);
|
||||
|
||||
|
||||
/* Scale `t' by `(sx, sy)' and return the result:
|
||||
* t' = [ sx 0 0 sy 0 0 ] * t */
|
||||
/*
|
||||
* CGAffineTransformScale()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformScale(
|
||||
CGAffineTransform t,
|
||||
float sx,
|
||||
float sy);
|
||||
|
||||
|
||||
/* Rotate `t' by `angle' radians and return the result:
|
||||
* t' = [ cos(angle) sin(angle) -sin(angle) cos(angle) 0 0 ] * t */
|
||||
/*
|
||||
* CGAffineTransformRotate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformRotate(
|
||||
CGAffineTransform t,
|
||||
float angle);
|
||||
|
||||
|
||||
/* Invert `t' and return the result. If `t' has zero determinant, then `t'
|
||||
* is returned unchanged. */
|
||||
/*
|
||||
* CGAffineTransformInvert()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformInvert(CGAffineTransform t);
|
||||
|
||||
|
||||
/* Concatenate `t2' to `t1' and returne the result:
|
||||
* t' = t1 * t2 */
|
||||
/*
|
||||
* CGAffineTransformConcat()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGAffineTransform )
|
||||
CGAffineTransformConcat(
|
||||
CGAffineTransform t1,
|
||||
CGAffineTransform t2);
|
||||
|
||||
|
||||
/* Transform `point' by `t' and return the result:
|
||||
* p' = p * t
|
||||
* where p = [ x y 1 ]. */
|
||||
/*
|
||||
* CGPointApplyAffineTransform()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGPoint )
|
||||
CGPointApplyAffineTransform(
|
||||
CGPoint point,
|
||||
CGAffineTransform t);
|
||||
|
||||
|
||||
/* Transform `size' by `t' and return the result:
|
||||
* s' = s * t
|
||||
* where s = [ width height 0 ]. */
|
||||
/*
|
||||
* CGSizeApplyAffineTransform()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGSize )
|
||||
CGSizeApplyAffineTransform(
|
||||
CGSize size,
|
||||
CGAffineTransform t);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGAFFINETRANSFORM_H_ */
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
File: CGBase.h
|
||||
|
||||
Contains: CoreGraphics base types
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGBASE_H_
|
||||
#define CGBASE_H_
|
||||
|
||||
#ifndef __CONDITIONALMACROS__
|
||||
#include <ConditionalMacros.h>
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#if __MWERKS__ > 0x2300
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if !defined(CG_INLINE)
|
||||
# if defined(__GNUC__)
|
||||
# define CG_INLINE static __inline__
|
||||
# elif defined(__MWERKS__)
|
||||
# define CG_INLINE static inline
|
||||
# else
|
||||
# define CG_INLINE static
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CGBASE_H_ */
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
File: CGBitmapContext.h
|
||||
|
||||
Contains: CoreGraphics BitMapContext
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGBITMAPCONTEXT_H_
|
||||
#define CGBITMAPCONTEXT_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGCONTEXT__
|
||||
#include <CGContext.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* Create a bitmap context. The context draws into a bitmap which is
|
||||
* `width' pixels wide and `height' pixels high. The number of components
|
||||
* for each pixel is specified by `colorspace', which also may specify a
|
||||
* destination color profile. The number of bits for each component of a
|
||||
* pixel is specified by `bitsPerComponent', which must be 1, 2, 4, or 8.
|
||||
* Each row of the bitmap consists of `bytesPerRow' bytes, which must be at
|
||||
* least `(width * bitsPerComponent * number of components + 7)/8' bytes.
|
||||
* `data' points a block of memory at least `bytesPerRow * height' bytes.
|
||||
* `alphaInfo' specifies whether the bitmap should contain an alpha
|
||||
* channel, and how it's to be generated. */
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CGBitmapContextCreate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGContextRef )
|
||||
CGBitmapContextCreate(
|
||||
void * data,
|
||||
size_t width,
|
||||
size_t height,
|
||||
size_t bitsPerComponent,
|
||||
size_t bytesPerRow,
|
||||
CGColorSpaceRef colorspace,
|
||||
CGImageAlphaInfo alphaInfo);
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGBITMAPCONTEXT_H_ */
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
/*
|
||||
File: CGColorSpace.h
|
||||
|
||||
Contains: CoreGraphics color space
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
#ifndef CGCOLORSPACE_H_
|
||||
#define CGCOLORSPACE_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGDATAPROVIDER__
|
||||
#include <CGDataProvider.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __CGCOLORSPACE__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __CGCOLORSPACE__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct CGColorSpace* CGColorSpaceRef;
|
||||
enum CGColorRenderingIntent {
|
||||
kCGRenderingIntentDefault = 0,
|
||||
kCGRenderingIntentAbsoluteColorimetric = 1,
|
||||
kCGRenderingIntentRelativeColorimetric = 2,
|
||||
kCGRenderingIntentPerceptual = 3,
|
||||
kCGRenderingIntentSaturation = 4
|
||||
};
|
||||
typedef enum CGColorRenderingIntent CGColorRenderingIntent;
|
||||
|
||||
|
||||
/** Device-dependent color spaces. **/
|
||||
/* Create a DeviceGray colorspace. */
|
||||
/*
|
||||
* CGColorSpaceCreateDeviceGray()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateDeviceGray(void);
|
||||
|
||||
|
||||
/* Create a DeviceRGB colorspace. */
|
||||
/*
|
||||
* CGColorSpaceCreateDeviceRGB()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateDeviceRGB(void);
|
||||
|
||||
|
||||
/* Create a DeviceCMYK colorspace. */
|
||||
/*
|
||||
* CGColorSpaceCreateDeviceCMYK()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateDeviceCMYK(void);
|
||||
|
||||
|
||||
/** Device-independent color spaces. **/
|
||||
/* Create a calibrated gray colorspace. `whitePoint' is an array of 3
|
||||
* numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of
|
||||
* the diffuse white point. `blackPoint' is an array of 3 numbers
|
||||
* specifying the tristimulus value, in CIE 1931 XYZ-space, of the diffuse
|
||||
* black point. `gamma' defines the gamma for the gray component. */
|
||||
/*
|
||||
* CGColorSpaceCreateCalibratedGray()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateCalibratedGray(
|
||||
const float whitePoint[3],
|
||||
const float blackPoint[3],
|
||||
float gamma);
|
||||
|
||||
|
||||
/* Create a calibrated RGB colorspace. `whitePoint' is an array of 3
|
||||
* numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of
|
||||
* the diffuse white point. `blackPoint' is an array of 3 numbers
|
||||
* specifying the tristimulus value, in CIE 1931 XYZ-space, of the diffuse
|
||||
* black point. `gamma' is an array of 3 numbers specifying the gamma for
|
||||
* the red, green, and blue components of the color space. `matrix' is an
|
||||
* array of 9 numbers specifying the linear interpretation of the
|
||||
* gamma-modified RGB values of the colorspace with respect to the final
|
||||
* XYZ representation. */
|
||||
/*
|
||||
* CGColorSpaceCreateCalibratedRGB()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateCalibratedRGB(
|
||||
const float whitePoint[3],
|
||||
const float blackPoint[3],
|
||||
const float gamma[3],
|
||||
const float matrix[9]);
|
||||
|
||||
|
||||
/* Create an L*a*b* colorspace. `whitePoint' is an array of 3 numbers
|
||||
* specifying the tristimulus value, in the CIE 1931 XYZ-space, of the
|
||||
* diffuse white point. `blackPoint' is an array of 3 numbers specifying
|
||||
* the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black
|
||||
* point. `range' is an array of four numbers specifying the range of valid
|
||||
* values for the a* and b* components of the color space. */
|
||||
/*
|
||||
* CGColorSpaceCreateLab()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateLab(
|
||||
const float whitePoint[3],
|
||||
const float blackPoint[3],
|
||||
const float range[4]);
|
||||
|
||||
|
||||
/* Create an ICC-based colorspace. `nComponents' specifies the number of
|
||||
* color components in the color space defined by the ICC profile data.
|
||||
* This must match the number of components actually in the ICC profile,
|
||||
* and must be 1, 3, or 4. `range' is an array of 2*nComponents numbers
|
||||
* specifying the minimum and maximum valid values of the corresponding
|
||||
* color components, so that for color component k, range[2*k] <= c[k] <=
|
||||
* range[2*k+1], where c[k] is the k'th color component. `profile' is a
|
||||
* data provider specifying the ICC profile. `alternate' specifies an
|
||||
* alternate colorspace to be used in case the ICC profile is not
|
||||
* supported. It must have `nComponents' color components. If `alternate'
|
||||
* is NULL, then the color space used will be DeviceGray, DeviceRGB, or
|
||||
* DeviceCMYK, depending on whether `nComponents' is 1, 3, or 4,
|
||||
* respectively. */
|
||||
/*
|
||||
* CGColorSpaceCreateICCBased()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateICCBased(
|
||||
size_t nComponents,
|
||||
const float * range,
|
||||
CGDataProviderRef profile,
|
||||
CGColorSpaceRef alternateSpace);
|
||||
|
||||
|
||||
/** Special colorspaces. **/
|
||||
/* Create an indexed colorspace. A sample value in an indexed color space
|
||||
* is treated as an index into the color table of the color space. `base'
|
||||
* specifies the base color space in which the values in the color table
|
||||
* are to be interpreted. `lastIndex' is an integer which specifies the
|
||||
* maximum valid index value; it must be less than or equal to 255.
|
||||
* `colorTable' is an array of m * (lastIndex + 1) bytes, where m is
|
||||
* the number of color components in the base color space. Each byte
|
||||
* is an unsigned integer in the range 0 to 255 that is scaled to the
|
||||
* range of the corresponding color component in the base color space. */
|
||||
/*
|
||||
* CGColorSpaceCreateIndexed()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateIndexed(
|
||||
CGColorSpaceRef baseSpace,
|
||||
size_t lastIndex,
|
||||
const unsigned char * colorTable);
|
||||
|
||||
|
||||
/* Create a pattern colorspace. `baseSpace' is the underlying colorspace of
|
||||
* the pattern colorspace. For colored patterns, `baseSpace' should be
|
||||
* NULL; for uncolored patterns, `baseSpace' specifies the colorspace of
|
||||
* colors which will be painted through the pattern. */
|
||||
/*
|
||||
* CGColorSpaceCreatePattern()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreatePattern(CGColorSpaceRef baseSpace);
|
||||
|
||||
|
||||
/* Create a CGColorSpace using `platformColorSpaceReference', a pointer to
|
||||
* a platform-specific color space reference. For MacOS X,
|
||||
* `platformColorSpaceReference' should be a pointer to a CMProfileRef. */
|
||||
/*
|
||||
* CGColorSpaceCreateWithPlatformColorSpace()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceCreateWithPlatformColorSpace(void * platformColorSpaceReference);
|
||||
|
||||
|
||||
|
||||
/** Colorspace information. **/
|
||||
/* Return the number of color components supported by the colorspace `cs'. */
|
||||
/*
|
||||
* CGColorSpaceGetNumberOfComponents()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGColorSpaceGetNumberOfComponents(CGColorSpaceRef cs);
|
||||
|
||||
|
||||
/** Retaining & releasing colorspaces. **/
|
||||
/* Increment the retain count of `cs' and return it. All colorspaces are
|
||||
* created with an initial retain count of 1. */
|
||||
/*
|
||||
* CGColorSpaceRetain()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGColorSpaceRetain(CGColorSpaceRef cs);
|
||||
|
||||
|
||||
/* Decrement the retain count of `cs'. If the retain count reaches 0, then
|
||||
* release it and any associated resources. */
|
||||
/*
|
||||
* CGColorSpaceRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGColorSpaceRelease(CGColorSpaceRef cs);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __CGCOLORSPACE__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__CGCOLORSPACE__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGCOLORSPACE_H_ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
File: CGDataConsumer.h
|
||||
|
||||
Contains: CoreGraphics data consumer
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGDATACONSUMER_H_
|
||||
#define CGDATACONSUMER_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFURL__
|
||||
#include <CFURL.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
typedef struct CGDataConsumer* CGDataConsumerRef;
|
||||
typedef CALLBACK_API_C( size_t , CGPutBytesProcPtr )(void *info, const void *buffer, size_t count);
|
||||
typedef CALLBACK_API_C( void , CGReleaseConsumerProcPtr )(void * info);
|
||||
/* Callbacks for accessing data.
|
||||
* `putBytes' copies `count' bytes from `buffer' to the consumer, and
|
||||
* returns the number of bytes copied. It should return 0 if no more data
|
||||
* can be written to the consumer.
|
||||
* `releaseConsumer', if non-NULL, is called when the consumer is freed. */
|
||||
struct CGDataConsumerCallbacks {
|
||||
CGPutBytesProcPtr putBytes;
|
||||
CGReleaseConsumerProcPtr releaseConsumer;
|
||||
};
|
||||
typedef struct CGDataConsumerCallbacks CGDataConsumerCallbacks;
|
||||
/* Create a data consumer using `callbacks' to handle the data. `info' is
|
||||
* passed to each of the callback functions. */
|
||||
/*
|
||||
* CGDataConsumerCreate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataConsumerRef )
|
||||
CGDataConsumerCreate(
|
||||
void * info,
|
||||
const CGDataConsumerCallbacks * callbacks);
|
||||
|
||||
|
||||
/* Create a data consumer which writes data to `url'. */
|
||||
/*
|
||||
* CGDataConsumerCreateWithURL()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataConsumerRef )
|
||||
CGDataConsumerCreateWithURL(CFURLRef url);
|
||||
|
||||
|
||||
/* Increment the retain count of `consumer' and return it. All data
|
||||
* consumers are created with an initial retain count of 1. */
|
||||
/*
|
||||
* CGDataConsumerRetain()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataConsumerRef )
|
||||
CGDataConsumerRetain(CGDataConsumerRef consumer);
|
||||
|
||||
|
||||
/* Decrement the retain count of `consumer'. If the retain count reaches
|
||||
* 0, then release it and any associated resources. */
|
||||
/*
|
||||
* CGDataConsumerRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGDataConsumerRelease(CGDataConsumerRef consumer);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGDATACONSUMER_H_ */
|
||||
|
||||
@@ -0,0 +1,203 @@
|
||||
/*
|
||||
File: CGDataProvider.h
|
||||
|
||||
Contains: CoreGraphics data provider
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGDATAPROVIDER_H_
|
||||
#define CGDATAPROVIDER_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFURL__
|
||||
#include <CFURL.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
typedef struct CGDataProvider* CGDataProviderRef;
|
||||
typedef CALLBACK_API_C( size_t , CGGetBytesProcPtr )(void *info, void *buffer, size_t count);
|
||||
typedef CALLBACK_API_C( void , CGSkipBytesProcPtr )(void *info, size_t count);
|
||||
typedef CALLBACK_API_C( void , CGRewindProcPtr )(void * info);
|
||||
typedef CALLBACK_API_C( void , CGReleaseProviderProcPtr )(void * info);
|
||||
/* Callbacks for sequentially accessing data.
|
||||
* `getBytes' is called to copy `count' bytes from the provider's data to
|
||||
* `buffer'. It should return the number of bytes copied, or 0 if there's
|
||||
* no more data.
|
||||
* `skipBytes' is called to skip ahead in the provider's data by `count' bytes.
|
||||
* `rewind' is called to rewind the provider to the beginning of the data.
|
||||
* `releaseProvider', if non-NULL, is called when the provider is freed. */
|
||||
struct CGDataProviderCallbacks {
|
||||
CGGetBytesProcPtr getBytes;
|
||||
CGSkipBytesProcPtr skipBytes;
|
||||
CGRewindProcPtr rewind;
|
||||
CGReleaseProviderProcPtr releaseProvider;
|
||||
};
|
||||
typedef struct CGDataProviderCallbacks CGDataProviderCallbacks;
|
||||
typedef CALLBACK_API_C( void *, CGGetBytePointerProcPtr )(void * info);
|
||||
typedef CALLBACK_API_C( void , CGReleaseByteProcPtr )(void *info, const void *pointer);
|
||||
typedef CALLBACK_API_C( size_t , CGGetBytesDirectProcPtr )(void *info, void *buffer, size_t offset, size_t count);
|
||||
/* Callbacks for directly accessing data.
|
||||
* `getBytePointer', if non-NULL, is called to return a pointer to the
|
||||
* provider's entire block of data.
|
||||
* `releaseBytePointer', if non-NULL, is called to release a pointer to
|
||||
* the provider's entire block of data.
|
||||
* `getBytes', if non-NULL, is called to copy `count' bytes at offset
|
||||
* `offset' from the provider's data to `buffer'. It should return the
|
||||
* number of bytes copied, or 0 if there's no more data.
|
||||
* `releaseProvider', if non-NULL, is called when the provider is freed.
|
||||
* At least one of `getBytePointer' or `getBytes' must be non-NULL. */
|
||||
struct CGDataProviderDirectAccessCallbacks {
|
||||
CGGetBytePointerProcPtr getBytePointer;
|
||||
CGReleaseByteProcPtr releaseBytePointer;
|
||||
CGGetBytesDirectProcPtr getBytes;
|
||||
CGReleaseProviderProcPtr releaseProvider;
|
||||
};
|
||||
typedef struct CGDataProviderDirectAccessCallbacks CGDataProviderDirectAccessCallbacks;
|
||||
typedef CALLBACK_API_C( void , CGReleaseDataProcPtr )(void *info, const void *data, size_t size);
|
||||
/* Create a sequential-access data provider using `callbacks' to provide
|
||||
* the data. `info' is passed to each of the callback functions. */
|
||||
/*
|
||||
* CGDataProviderCreate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataProviderRef )
|
||||
CGDataProviderCreate(
|
||||
void * info,
|
||||
const CGDataProviderCallbacks * callbacks);
|
||||
|
||||
|
||||
/* Create a direct-access data provider using `callbacks' to supply `size'
|
||||
* bytes of data. `info' is passed to each of the callback functions. */
|
||||
/*
|
||||
* CGDataProviderCreateDirectAccess()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataProviderRef )
|
||||
CGDataProviderCreateDirectAccess(
|
||||
void * info,
|
||||
size_t size,
|
||||
const CGDataProviderDirectAccessCallbacks * callbacks);
|
||||
|
||||
|
||||
/* Create a direct-access data provider using `data', an array of `size'
|
||||
* bytes. `releaseData' is called when the data provider is freed, and is
|
||||
* passed `info' as its first argument. */
|
||||
/*
|
||||
* CGDataProviderCreateWithData()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataProviderRef )
|
||||
CGDataProviderCreateWithData(
|
||||
void * info,
|
||||
const void * data,
|
||||
size_t size,
|
||||
CGReleaseDataProcPtr releaseData);
|
||||
|
||||
|
||||
/* Create a data provider using `url'. */
|
||||
/*
|
||||
* CGDataProviderCreateWithURL()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataProviderRef )
|
||||
CGDataProviderCreateWithURL(CFURLRef url);
|
||||
|
||||
|
||||
/* Increment the retain count of `provider' and return it. All data
|
||||
* providers are created with an initial retain count of 1. */
|
||||
/*
|
||||
* CGDataProviderRetain()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataProviderRef )
|
||||
CGDataProviderRetain(CGDataProviderRef provider);
|
||||
|
||||
|
||||
/* Decrement the retain count of `provider'. If the retain count reaches
|
||||
* 0, then free `provider' and any associated resources. */
|
||||
/*
|
||||
* CGDataProviderRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGDataProviderRelease(CGDataProviderRef provider);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGDATAPROVIDER_H_ */
|
||||
|
||||
@@ -0,0 +1,913 @@
|
||||
/*
|
||||
File: CGDirectDisplay.h
|
||||
|
||||
Contains: CoreGraphics direct display
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGDIRECTDISPLAY_H_
|
||||
#define CGDIRECTDISPLAY_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGGEOMETRY__
|
||||
#include <CGGeometry.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGERROR__
|
||||
#include <CGError.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFARRAY__
|
||||
#include <CFArray.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFSTRING__
|
||||
#include <CFString.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFDICTIONARY__
|
||||
#include <CFDictionary.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
typedef struct _CGDirectDisplayID* CGDirectDisplayID;
|
||||
typedef struct _CGDirectPaletteRef* CGDirectPaletteRef;
|
||||
typedef uint32_t CGDisplayCount;
|
||||
typedef uint32_t CGTableCount;
|
||||
typedef int32_t CGDisplayCoord;
|
||||
typedef uint8_t CGByteValue;
|
||||
typedef uint32_t CGOpenGLDisplayMask;
|
||||
typedef uint32_t CGBeamPosition;
|
||||
typedef int32_t CGMouseDelta;
|
||||
typedef double CGRefreshRate;
|
||||
typedef CGError CGDisplayErr;
|
||||
enum {
|
||||
CGDisplayNoErr = kCGErrorSuccess
|
||||
};
|
||||
|
||||
/* A NULL value points to the main display device as a programming convention */
|
||||
#define kCGDirectMainDisplay ((CGDirectDisplayID)NULL)
|
||||
|
||||
/*
|
||||
* Mechanisms used to find screen IDs
|
||||
* An array length (maxDisplays) and array of CGDirectDisplayIDs are passed in.
|
||||
* Up to maxDisplays of the array are filled in with the displays meeting the
|
||||
* specified criteria. The actual number of displays filled in is returned in
|
||||
* dspyCnt.
|
||||
*
|
||||
* If the dspys array is NULL, maxDisplays is ignored, and *dspyCnt is filled
|
||||
* in with the number of displays meeting the function's requirements.
|
||||
*/
|
||||
/*
|
||||
* CGGetDisplaysWithPoint()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGGetDisplaysWithPoint(
|
||||
CGPoint point,
|
||||
CGDisplayCount maxDisplays,
|
||||
CGDirectDisplayID * dspys,
|
||||
CGDisplayCount * dspyCnt);
|
||||
|
||||
|
||||
/*
|
||||
* CGGetDisplaysWithRect()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGGetDisplaysWithRect(
|
||||
CGRect rect,
|
||||
CGDisplayCount maxDisplays,
|
||||
CGDirectDisplayID * dspys,
|
||||
CGDisplayCount * dspyCnt);
|
||||
|
||||
|
||||
/*
|
||||
* CGGetDisplaysWithOpenGLDisplayMask()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGGetDisplaysWithOpenGLDisplayMask(
|
||||
CGOpenGLDisplayMask mask,
|
||||
CGDisplayCount maxDisplays,
|
||||
CGDirectDisplayID * dspys,
|
||||
CGDisplayCount * dspyCnt);
|
||||
|
||||
|
||||
/*
|
||||
* Get lists of displays. Use this to determine display IDs
|
||||
*
|
||||
* If the activeDspys array is NULL, maxDisplays is ignored, and *dspyCnt is filled
|
||||
* in with the number of displays meeting the function's requirements.
|
||||
*
|
||||
* The first display returned in the list is the main display,
|
||||
* the one with the menu bar.
|
||||
* When mirroring, this will be the largest display,
|
||||
* or if all are the same size, the one with the deepest pixel depth.
|
||||
*/
|
||||
/*
|
||||
* CGGetActiveDisplayList()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGGetActiveDisplayList(
|
||||
CGDisplayCount maxDisplays,
|
||||
CGDirectDisplayID * activeDspys,
|
||||
CGDisplayCount * dspyCnt);
|
||||
|
||||
|
||||
/* Map a display to an OpenGL display mask; returns 0 on invalid display */
|
||||
/*
|
||||
* CGDisplayIDToOpenGLDisplayMask()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGOpenGLDisplayMask )
|
||||
CGDisplayIDToOpenGLDisplayMask(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/* Return screen size and origin in global coords; Empty rect if display is invalid */
|
||||
/*
|
||||
* CGDisplayBounds()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGDisplayBounds(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* CGDisplayPixelsWide()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGDisplayPixelsWide(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* CGDisplayPixelsHigh()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGDisplayPixelsHigh(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* Display mode selection
|
||||
* Display modes are represented as CFDictionaries
|
||||
* All dictionaries and arrays returned via these mechanisms are
|
||||
* owned by the framework and should not be released. The framework
|
||||
* will not release them out from under your application.
|
||||
*
|
||||
* Values associated with the following keys are CFNumber types.
|
||||
* With CFNumberGetValue(), use kCFNumberLongType for best results.
|
||||
*/
|
||||
/*
|
||||
* Keys used in mode dictionaries. Source C strings shown won't change.
|
||||
* Some CFM environments cannot import data variables, and so
|
||||
* duplicate these CFStringRefs locally.
|
||||
*/
|
||||
/*
|
||||
* kCGDisplayWidth
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplayWidth;
|
||||
/*
|
||||
* kCGDisplayHeight
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplayHeight;
|
||||
/*
|
||||
* kCGDisplayMode
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplayMode;
|
||||
/*
|
||||
* kCGDisplayBitsPerPixel
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplayBitsPerPixel;
|
||||
/*
|
||||
* kCGDisplayBitsPerSample
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplayBitsPerSample;
|
||||
/*
|
||||
* kCGDisplaySamplesPerPixel
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplaySamplesPerPixel;
|
||||
/*
|
||||
* kCGDisplayRefreshRate
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplayRefreshRate;
|
||||
/*
|
||||
* kCGDisplayModeUsableForDesktopGUI
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplayModeUsableForDesktopGUI;
|
||||
/*
|
||||
* kCGDisplayIOFlags
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern CFStringRef kCGDisplayIOFlags;
|
||||
/*
|
||||
* Return a CFArray of CFDictionaries describing all display modes.
|
||||
* Returns NULL if the display is invalid.
|
||||
*/
|
||||
/*
|
||||
* CGDisplayAvailableModes()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CFArrayRef )
|
||||
CGDisplayAvailableModes(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* Try to find a display mode of specified depth with dimensions equal or greater than
|
||||
* specified.
|
||||
* If no depth match is found, try for the next larger depth with dimensions equal or greater
|
||||
* than specified. If no luck, then just return the current mode.
|
||||
*
|
||||
* exactmatch, if not NULL, is set to 'true' if an exact match in width, height, and depth is found,
|
||||
* and 'false' otherwise.
|
||||
* Returns NULL if display is invalid.
|
||||
*/
|
||||
/*
|
||||
* CGDisplayBestModeForParameters()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CFDictionaryRef )
|
||||
CGDisplayBestModeForParameters(
|
||||
CGDirectDisplayID display,
|
||||
size_t bitsPerPixel,
|
||||
size_t width,
|
||||
size_t height,
|
||||
boolean_t * exactMatch);
|
||||
|
||||
|
||||
/*
|
||||
* CGDisplayBestModeForParametersAndRefreshRate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CFDictionaryRef )
|
||||
CGDisplayBestModeForParametersAndRefreshRate(
|
||||
CGDirectDisplayID display,
|
||||
size_t bitsPerPixel,
|
||||
size_t width,
|
||||
size_t height,
|
||||
CGRefreshRate refresh,
|
||||
boolean_t * exactMatch);
|
||||
|
||||
|
||||
/*
|
||||
* Return a CFDictionary describing the current display mode.
|
||||
* Returns NULL if display is invalid.
|
||||
*/
|
||||
/*
|
||||
* CGDisplayCurrentMode()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CFDictionaryRef )
|
||||
CGDisplayCurrentMode(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* Switch display mode. Note that after switching,
|
||||
* display parameters and addresses may change.
|
||||
* The selected display mode persists for the life of the program, and automatically
|
||||
* reverts to the permanent setting made by Preferences when the program terminates.
|
||||
* The mode dictionary passed in must be a dictionary vended by other CGDirectDisplay
|
||||
* APIs such as CGDisplayBestModeForParameters() and CGDisplayAvailableModes().
|
||||
*/
|
||||
/*
|
||||
* CGDisplaySwitchToMode()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGDisplaySwitchToMode(
|
||||
CGDirectDisplayID display,
|
||||
CFDictionaryRef mode);
|
||||
|
||||
|
||||
/* Query parameters for current mode */
|
||||
/*
|
||||
* CGDisplayBitsPerPixel()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGDisplayBitsPerPixel(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* CGDisplayBitsPerSample()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGDisplayBitsPerSample(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* CGDisplaySamplesPerPixel()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGDisplaySamplesPerPixel(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* CGDisplayBytesPerRow()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGDisplayBytesPerRow(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* Set a display gamma/transfer function from a formula specifying
|
||||
* min and max values and a gamma for each channel.
|
||||
* Gamma values must be greater than 0.0.
|
||||
* To get an antigamma of 1.6, one would specify a value of (1.0 / 1.6)
|
||||
* Min values must be greater than or equal to 0.0 and less than 1.0.
|
||||
* Max values must be greater than 0.0 and less than or equal to 1.0.
|
||||
* Out of range values, or Max greater than or equal to Min result
|
||||
* in a kCGSRangeCheck error.
|
||||
*
|
||||
* Values are computed by sampling a function for a range of indices from 0 through 1:
|
||||
* value = Min + ((Max - Min) * pow(index, Gamma))
|
||||
* The resulting values are converted to a machine specific format
|
||||
* and loaded into hardware.
|
||||
*/
|
||||
typedef float CGGammaValue;
|
||||
/*
|
||||
* CGSetDisplayTransferByFormula()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGSetDisplayTransferByFormula(
|
||||
CGDirectDisplayID display,
|
||||
CGGammaValue redMin,
|
||||
CGGammaValue redMax,
|
||||
CGGammaValue redGamma,
|
||||
CGGammaValue greenMin,
|
||||
CGGammaValue greenMax,
|
||||
CGGammaValue greenGamma,
|
||||
CGGammaValue blueMin,
|
||||
CGGammaValue blueMax,
|
||||
CGGammaValue blueGamma);
|
||||
|
||||
|
||||
/*
|
||||
* CGGetDisplayTransferByFormula()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGGetDisplayTransferByFormula(
|
||||
CGDirectDisplayID display,
|
||||
CGGammaValue * redMin,
|
||||
CGGammaValue * redMax,
|
||||
CGGammaValue * redGamma,
|
||||
CGGammaValue * greenMin,
|
||||
CGGammaValue * greenMax,
|
||||
CGGammaValue * greenGamma,
|
||||
CGGammaValue * blueMin,
|
||||
CGGammaValue * blueMax,
|
||||
CGGammaValue * blueGamma);
|
||||
|
||||
|
||||
/*
|
||||
* Set a display gamma/transfer function using tables of data for each channel.
|
||||
* Values within each table should have values in the range of 0.0 through 1.0.
|
||||
* The same table may be passed in for red, green, and blue channels. 'tableSize'
|
||||
* indicates the number of entries in each table.
|
||||
* The tables are interpolated as needed to generate the number of samples needed
|
||||
* by hardware.
|
||||
*/
|
||||
/*
|
||||
* CGSetDisplayTransferByTable()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGSetDisplayTransferByTable(
|
||||
CGDirectDisplayID display,
|
||||
CGTableCount tableSize,
|
||||
const CGGammaValue * redTable,
|
||||
const CGGammaValue * greenTable,
|
||||
const CGGammaValue * blueTable);
|
||||
|
||||
|
||||
/*
|
||||
* Get transfer tables. Capacity should contain the number of samples each
|
||||
* array can hold, and *sampleCount is filled in with the number of samples
|
||||
* actually copied in.
|
||||
*/
|
||||
/*
|
||||
* CGGetDisplayTransferByTable()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGGetDisplayTransferByTable(
|
||||
CGDirectDisplayID display,
|
||||
CGTableCount capacity,
|
||||
CGGammaValue * redTable,
|
||||
CGGammaValue * greenTable,
|
||||
CGGammaValue * blueTable,
|
||||
CGTableCount * sampleCount);
|
||||
|
||||
|
||||
/* As a convenience, allow setting of the gamma table by byte values */
|
||||
/*
|
||||
* CGSetDisplayTransferByByteTable()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGSetDisplayTransferByByteTable(
|
||||
CGDirectDisplayID display,
|
||||
CGTableCount tableSize,
|
||||
const CGByteValue * redTable,
|
||||
const CGByteValue * greenTable,
|
||||
const CGByteValue * blueTable);
|
||||
|
||||
|
||||
/* Restore gamma tables of system displays to the user's ColorSync specified values */
|
||||
/*
|
||||
* CGDisplayRestoreColorSyncSettings()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGDisplayRestoreColorSyncSettings(void);
|
||||
|
||||
|
||||
/* Display capture and release */
|
||||
/*
|
||||
* CGDisplayIsCaptured()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( boolean_t )
|
||||
CGDisplayIsCaptured(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* CGDisplayCapture()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGDisplayCapture(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* CGDisplayRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGDisplayRelease(CGDirectDisplayID display);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Capture all displays; this has the nice effect of providing an immersive
|
||||
* environment, and preventing other apps from trying to adjust themselves
|
||||
* to display changes only needed by your app.
|
||||
*/
|
||||
/*
|
||||
* CGCaptureAllDisplays()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGCaptureAllDisplays(void);
|
||||
|
||||
|
||||
/*
|
||||
* Release all captured displays, and restore the display modes to the
|
||||
* user's preferences. May be used in conjunction with CGDisplayCapture()
|
||||
* or CGCaptureAllDisplays().
|
||||
*/
|
||||
/*
|
||||
* CGReleaseAllDisplays()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGReleaseAllDisplays(void);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Returns CoreGraphics raw shield window ID or NULL if not shielded
|
||||
* This value may be used with drawing surface APIs.
|
||||
*/
|
||||
/*
|
||||
* CGShieldingWindowID()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void * )
|
||||
CGShieldingWindowID(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* Returns the window level used for the shield window.
|
||||
* This value may be used with Cocoa windows to position the
|
||||
* Cocoa window in the same window level as the shield window.
|
||||
*/
|
||||
/*
|
||||
* CGShieldingWindowLevel()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int32_t )
|
||||
CGShieldingWindowLevel(void);
|
||||
|
||||
|
||||
/*
|
||||
* Returns base address of display or NULL for an invalid display.
|
||||
* If the display has not been captured, the returned address may refer
|
||||
* to read-only memory.
|
||||
*/
|
||||
/*
|
||||
* CGDisplayBaseAddress()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void * )
|
||||
CGDisplayBaseAddress(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* return address for X,Y in screen coordinates;
|
||||
* (0,0) represents the upper left corner of the display.
|
||||
* returns NULL for an invalid display or out of bounds coordinates
|
||||
* If the display has not been captured, the returned address may refer
|
||||
* to read-only memory.
|
||||
*/
|
||||
/*
|
||||
* CGDisplayAddressForPosition()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void * )
|
||||
CGDisplayAddressForPosition(
|
||||
CGDirectDisplayID display,
|
||||
CGDisplayCoord x,
|
||||
CGDisplayCoord y);
|
||||
|
||||
|
||||
|
||||
/* Mouse Cursor controls */
|
||||
/*
|
||||
* CGDisplayHideCursor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGDisplayHideCursor(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/* increments hide cursor count */
|
||||
/*
|
||||
* CGDisplayShowCursor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGDisplayShowCursor(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/* decrements hide cursor count */
|
||||
/*
|
||||
* Move the cursor to the specified point relative to the display origin
|
||||
* (the upper left corner of the display). Returns CGDisplayNoErr on success.
|
||||
* No events are generated as a result of this move.
|
||||
* Points that would lie outside the desktop are clipped to the desktop.
|
||||
*/
|
||||
/*
|
||||
* CGDisplayMoveCursorToPoint()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGDisplayMoveCursorToPoint(
|
||||
CGDirectDisplayID display,
|
||||
CGPoint point);
|
||||
|
||||
|
||||
/*
|
||||
* Report the mouse position change associated with the last mouse move event
|
||||
* recieved by this application.
|
||||
*/
|
||||
/*
|
||||
* CGGetLastMouseDelta()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGGetLastMouseDelta(
|
||||
CGMouseDelta * deltaX,
|
||||
CGMouseDelta * deltaY);
|
||||
|
||||
|
||||
|
||||
/* Palette controls (8 bit pseudocolor only) */
|
||||
/*
|
||||
* Returns TRUE if the current display mode supports palettes
|
||||
*/
|
||||
/*
|
||||
* CGDisplayCanSetPalette()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( boolean_t )
|
||||
CGDisplayCanSetPalette(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* Set a palette. The current gamma function is applied to the palette
|
||||
* elements before being loaded into hardware.
|
||||
*/
|
||||
/*
|
||||
* CGDisplaySetPalette()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGDisplaySetPalette(
|
||||
CGDirectDisplayID display,
|
||||
CGDirectPaletteRef palette);
|
||||
|
||||
|
||||
/*
|
||||
* Wait until the beam position is outside the range specified by upperScanLine and lowerScanLine.
|
||||
* Note that if upperScanLine and lowerScanLine encompass the entire display height,
|
||||
* the function returns an error.
|
||||
* lowerScanLine must be greater than or equal to upperScanLine.
|
||||
*
|
||||
* Some display systems may not conventional video vertical and horizontal sweep in painting.
|
||||
* These displays report a kCGDisplayRefreshRate of 0 in the CFDictionaryRef returned by
|
||||
* CGDisplayCurrentMode(). On such displays, this function returns at once.
|
||||
*
|
||||
* Some drivers may not implement support for this mechanism.
|
||||
* On such displays, this function returns at once.
|
||||
*
|
||||
* Returns CGDisplayNoErr on success, and an error if display or upperScanLine and
|
||||
* lowerScanLine are invalid.
|
||||
*
|
||||
* The app should set the values of upperScanLine and lowerScanLine to allow enough lead time
|
||||
* for the drawing operation to complete. A common strategy is to wait for the beam to pass
|
||||
* the bottom of the drawing area, allowing almost a full vertical sweep period to perform drawing.
|
||||
* To do this, set upperScanLine to 0, and set lowerScanLine to the bottom of the bounding box:
|
||||
* lowerScanLine = (CGBeamPosition)(cgrect.origin.y + cgrect.size.height);
|
||||
*
|
||||
* IOKit may implement this as a spin-loop on the beam position call used for CGDisplayBeamPosition().
|
||||
* On such system the function is CPU bound, and subject to all the usual scheduling pre-emption.
|
||||
* In particular, attempting to wait for the beam to hit a specific scanline may be an exercise in frustration.
|
||||
*
|
||||
* These functions are advisary in nature, and depend on IOKit and hardware specific drivers to implement
|
||||
* support. If you need extremely precise timing, or access to vertical blanking interrupts,
|
||||
* you should consider writing a device driver to tie into hardware-specific capabilities.
|
||||
*/
|
||||
/*
|
||||
* CGDisplayWaitForBeamPositionOutsideLines()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDisplayErr )
|
||||
CGDisplayWaitForBeamPositionOutsideLines(
|
||||
CGDirectDisplayID display,
|
||||
CGBeamPosition upperScanLine,
|
||||
CGBeamPosition lowerScanLine);
|
||||
|
||||
|
||||
/*
|
||||
* Returns the current beam position on the display. If display is invalid,
|
||||
* or the display does not implement conventional video vertical and horizontal
|
||||
* sweep in painting, or the driver does not implement this functionality, 0 is returned.
|
||||
*/
|
||||
/*
|
||||
* CGDisplayBeamPosition()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGBeamPosition )
|
||||
CGDisplayBeamPosition(CGDirectDisplayID display);
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGDIRECTDISPLAY_H_ */
|
||||
|
||||
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
File: CGDirectPalette.h
|
||||
|
||||
Contains: CoreGraphics direct palette
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGDIRECTPALETTE_H_
|
||||
#define CGDIRECTPALETTE_H_
|
||||
|
||||
#ifndef __CGDIRECTDISPLAY__
|
||||
#include <CGDirectDisplay.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
typedef float CGPaletteBlendFraction;
|
||||
/*
|
||||
* Convenient device color representation
|
||||
*
|
||||
* Values should be in the range from 0.0 to 1.0, where 0.0 is black, and 1.0
|
||||
* is full on for each channel.
|
||||
*/
|
||||
struct CGDeviceColor {
|
||||
float red;
|
||||
float green;
|
||||
float blue;
|
||||
};
|
||||
typedef struct CGDeviceColor CGDeviceColor;
|
||||
struct CGDeviceByteColor {
|
||||
CGByteValue red;
|
||||
CGByteValue green;
|
||||
CGByteValue blue;
|
||||
};
|
||||
typedef struct CGDeviceByteColor CGDeviceByteColor;
|
||||
/*
|
||||
* Create a new palette object representing the default 8 bit color palette.
|
||||
* Release the palette using CGPaletteRelease().
|
||||
*/
|
||||
/*
|
||||
* CGPaletteCreateDefaultColorPalette()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDirectPaletteRef )
|
||||
CGPaletteCreateDefaultColorPalette(void);
|
||||
|
||||
|
||||
/*
|
||||
* Create a copy of the display's current palette, if any.
|
||||
* Returns NULL if the current display mode does not support a palette.
|
||||
* Release the palette using CGPaletteRelease().
|
||||
*/
|
||||
/*
|
||||
* CGPaletteCreateWithDisplay()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDirectPaletteRef )
|
||||
CGPaletteCreateWithDisplay(CGDirectDisplayID display);
|
||||
|
||||
|
||||
/*
|
||||
* Create a new palette with a capacity as specified. Entries are initialized from
|
||||
* the default color palette. Release the palette using CGPaletteRelease().
|
||||
*/
|
||||
/*
|
||||
* CGPaletteCreateWithCapacity()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDirectPaletteRef )
|
||||
CGPaletteCreateWithCapacity(CGTableCount capacity);
|
||||
|
||||
|
||||
/*
|
||||
* Create a new palette with a capacity and contents as specified.
|
||||
* Release the palette using CGPaletteRelease().
|
||||
*/
|
||||
/*
|
||||
* CGPaletteCreateWithSamples()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDirectPaletteRef )
|
||||
CGPaletteCreateWithSamples(
|
||||
CGDeviceColor * sampleTable,
|
||||
CGTableCount sampleCount);
|
||||
|
||||
|
||||
/*
|
||||
* Convenience function:
|
||||
* Create a new palette with a capacity and contents as specified.
|
||||
* Release the palette using CGPaletteRelease().
|
||||
*/
|
||||
/*
|
||||
* CGPaletteCreateWithByteSamples()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDirectPaletteRef )
|
||||
CGPaletteCreateWithByteSamples(
|
||||
CGDeviceByteColor * sampleTable,
|
||||
CGTableCount sampleCount);
|
||||
|
||||
|
||||
/*
|
||||
* Release a palette
|
||||
*/
|
||||
/*
|
||||
* CGPaletteRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGPaletteRelease(CGDirectPaletteRef palette);
|
||||
|
||||
|
||||
/*
|
||||
* Get the color value at the specified index
|
||||
*/
|
||||
/*
|
||||
* CGPaletteGetColorAtIndex()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDeviceColor )
|
||||
CGPaletteGetColorAtIndex(
|
||||
CGDirectPaletteRef palette,
|
||||
CGTableCount index);
|
||||
|
||||
|
||||
/*
|
||||
* Get the index for the specified color value
|
||||
* The index returned is for a palette color with the
|
||||
* lowest RMS error to the specified color.
|
||||
*/
|
||||
/*
|
||||
* CGPaletteGetIndexForColor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGTableCount )
|
||||
CGPaletteGetIndexForColor(
|
||||
CGDirectPaletteRef palette,
|
||||
CGDeviceColor color);
|
||||
|
||||
|
||||
/*
|
||||
* Get the number of samples in the palette
|
||||
*/
|
||||
/*
|
||||
* CGPaletteGetNumberOfSamples()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGTableCount )
|
||||
CGPaletteGetNumberOfSamples(CGDirectPaletteRef palette);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Set the color value at the specified index
|
||||
*/
|
||||
/*
|
||||
* CGPaletteSetColorAtIndex()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGPaletteSetColorAtIndex(
|
||||
CGDirectPaletteRef palette,
|
||||
CGDeviceColor color,
|
||||
CGTableCount index);
|
||||
|
||||
|
||||
/*
|
||||
* Copy a palette
|
||||
*/
|
||||
/*
|
||||
* CGPaletteCreateCopy()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDirectPaletteRef )
|
||||
CGPaletteCreateCopy(CGDirectPaletteRef palette);
|
||||
|
||||
|
||||
/*
|
||||
* Compare two palettes
|
||||
*/
|
||||
/*
|
||||
* CGPaletteIsEqualToPalette()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
CGPaletteIsEqualToPalette(
|
||||
CGDirectPaletteRef palette1,
|
||||
CGDirectPaletteRef palette2);
|
||||
|
||||
|
||||
/*
|
||||
* Create a new palette blended with a fraction of a device color.
|
||||
* Free the resulting palette with CGPaletteRelease()
|
||||
*/
|
||||
/*
|
||||
* CGPaletteCreateFromPaletteBlendedWithColor()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDirectPaletteRef )
|
||||
CGPaletteCreateFromPaletteBlendedWithColor(
|
||||
CGDirectPaletteRef palette,
|
||||
CGPaletteBlendFraction fraction,
|
||||
CGDeviceColor color);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGDIRECTPALETTE_H_ */
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
File: CGError.h
|
||||
|
||||
Contains: CoreGraphics error codes
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
#ifndef CGERROR_H_
|
||||
#define CGERROR_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __CGERROR__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __CGERROR__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Types used for error and error handler */
|
||||
enum CGError {
|
||||
kCGErrorSuccess = 0,
|
||||
kCGErrorFirst = 1000,
|
||||
kCGErrorFailure = kCGErrorFirst,
|
||||
kCGErrorIllegalArgument = 1001,
|
||||
kCGErrorInvalidConnection = 1002,
|
||||
kCGErrorInvalidContext = 1003,
|
||||
kCGErrorCannotComplete = 1004,
|
||||
kCGErrorNameTooLong = 1005,
|
||||
kCGErrorNotImplemented = 1006,
|
||||
kCGErrorRangeCheck = 1007,
|
||||
kCGErrorTypeCheck = 1008,
|
||||
kCGErrorNoCurrentPoint = 1009,
|
||||
kCGErrorInvalidOperation = 1010,
|
||||
kCGErrorNoneAvailable = 1011,
|
||||
kCGErrorLast = kCGErrorNoneAvailable
|
||||
};
|
||||
typedef enum CGError CGError;
|
||||
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __CGERROR__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__CGERROR__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* CGERROR_H_ */
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
File: CGFont.h
|
||||
|
||||
Contains: CoreGraphics font
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
#ifndef CGFONT_H_
|
||||
#define CGFONT_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __CGFONT__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __CGFONT__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct CGFont* CGFontRef;
|
||||
typedef unsigned short CGGlyph;
|
||||
/*** Font creation. ***/
|
||||
/* Create a CGFont using `platformFontReference', a pointer to a
|
||||
* platform-specific font reference. For MacOS X, `platformFontReference'
|
||||
* should be a pointer to an ATSFontRef. */
|
||||
/*
|
||||
* CGFontCreateWithPlatformFont()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGFontRef )
|
||||
CGFontCreateWithPlatformFont(void * platformFontReference);
|
||||
|
||||
|
||||
/*** Retain & release. ***/
|
||||
/* Increment the retain count of `font' and return it. All fonts are
|
||||
* created with an initial retain count of 1. */
|
||||
/*
|
||||
* CGFontRetain()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGFontRef )
|
||||
CGFontRetain(CGFontRef font);
|
||||
|
||||
|
||||
/* Decrement the retain count of `font'. If the retain count reaches 0,
|
||||
* then release it and any associated resources. */
|
||||
/*
|
||||
* CGFontRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGFontRelease(CGFontRef font);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __CGFONT__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__CGFONT__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGFONT_H_ */
|
||||
|
||||
@@ -0,0 +1,563 @@
|
||||
/*
|
||||
File: CGGeometry.h
|
||||
|
||||
Contains: CoreGraphics geometry
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGGEOMETRY_H_
|
||||
#define CGGEOMETRY_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __CGGEOMETRY__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __CGGEOMETRY__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Points. */
|
||||
struct CGPoint {
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
typedef struct CGPoint CGPoint;
|
||||
/* Sizes. */
|
||||
struct CGSize {
|
||||
float width;
|
||||
float height;
|
||||
};
|
||||
typedef struct CGSize CGSize;
|
||||
/* Rectangles. */
|
||||
struct CGRect {
|
||||
CGPoint origin;
|
||||
CGSize size;
|
||||
};
|
||||
typedef struct CGRect CGRect;
|
||||
/* Rectangle edges. */
|
||||
enum CGRectEdge {
|
||||
CGRectMinXEdge = 0,
|
||||
CGRectMinYEdge = 1,
|
||||
CGRectMaxXEdge = 2,
|
||||
CGRectMaxYEdge = 3
|
||||
};
|
||||
typedef enum CGRectEdge CGRectEdge;
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
|
||||
/* The "zero" point -- equivalent to CGPointMake(0, 0). */
|
||||
/*
|
||||
* CGPointZero
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern const CGPoint CGPointZero;
|
||||
/* The "zero" size -- equivalent to CGSizeMake(0, 0). */
|
||||
/*
|
||||
* CGSizeZero
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern const CGSize CGSizeZero;
|
||||
/* The "zero" rectangle -- equivalent to CGRectMake(0, 0, 0, 0). */
|
||||
/*
|
||||
* CGRectZero
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern const CGRect CGRectZero;
|
||||
/* The "empty" rect. This is the rectangle returned when, for example, we
|
||||
* intersect two disjoint rectangles. Note that the null rect is not the
|
||||
* same as the zero rect. */
|
||||
/*
|
||||
* CGRectNull
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
extern const CGRect CGRectNull;
|
||||
|
||||
#else
|
||||
|
||||
#define CGPointZero CGPointMake(0, 0)
|
||||
#define CGSizeZero CGSizeMake(0, 0)
|
||||
#define CGRectZero CGRectMake(0, 0, 0, 0)
|
||||
#define CGRectNull CGRectMake(INFINITY, INFINITY, 0, 0)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Make a point from `(x, y)'. */
|
||||
/*
|
||||
* CGPointMake()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGPoint )
|
||||
CGPointMake(
|
||||
float x,
|
||||
float y);
|
||||
|
||||
|
||||
/* Make a size from `(width, height)'. */
|
||||
/*
|
||||
* CGSizeMake()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGSize )
|
||||
CGSizeMake(
|
||||
float width,
|
||||
float height);
|
||||
|
||||
|
||||
/* Make a rect from `(x, y; width, height)'. */
|
||||
/*
|
||||
* CGRectMake()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGRectMake(
|
||||
float x,
|
||||
float y,
|
||||
float width,
|
||||
float height);
|
||||
|
||||
|
||||
/* Return the leftmost x-value of `rect'. */
|
||||
/*
|
||||
* CGRectGetMinX()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( float )
|
||||
CGRectGetMinX(CGRect rect);
|
||||
|
||||
|
||||
/* Return the midpoint x-value of `rect'. */
|
||||
/*
|
||||
* CGRectGetMidX()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( float )
|
||||
CGRectGetMidX(CGRect rect);
|
||||
|
||||
|
||||
/* Return the rightmost x-value of `rect'. */
|
||||
/*
|
||||
* CGRectGetMaxX()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( float )
|
||||
CGRectGetMaxX(CGRect rect);
|
||||
|
||||
|
||||
/* Return the bottommost y-value of `rect'. */
|
||||
/*
|
||||
* CGRectGetMinY()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( float )
|
||||
CGRectGetMinY(CGRect rect);
|
||||
|
||||
|
||||
/* Return the midpoint y-value of `rect'. */
|
||||
/*
|
||||
* CGRectGetMidY()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( float )
|
||||
CGRectGetMidY(CGRect rect);
|
||||
|
||||
|
||||
/* Return the topmost y-value of `rect'. */
|
||||
/*
|
||||
* CGRectGetMaxY()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( float )
|
||||
CGRectGetMaxY(CGRect rect);
|
||||
|
||||
|
||||
/* Return the width of `rect'. */
|
||||
/*
|
||||
* CGRectGetWidth()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( float )
|
||||
CGRectGetWidth(CGRect rect);
|
||||
|
||||
|
||||
/* Return the height of `rect'. */
|
||||
/*
|
||||
* CGRectGetHeight()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( float )
|
||||
CGRectGetHeight(CGRect rect);
|
||||
|
||||
|
||||
/* Return 1 if `point1' and `point2' are the same, 0 otherwise. */
|
||||
/*
|
||||
* CGPointEqualToPoint()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGPointEqualToPoint(
|
||||
CGPoint point1,
|
||||
CGPoint point2);
|
||||
|
||||
|
||||
/* Return 1 if `size1' and `size2' are the same, 0 otherwise. */
|
||||
/*
|
||||
* CGSizeEqualToSize()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGSizeEqualToSize(
|
||||
CGSize size1,
|
||||
CGSize size2);
|
||||
|
||||
|
||||
/* Return 1 if `rect1' and `rect2' are the same, 0 otherwise. */
|
||||
/*
|
||||
* CGRectEqualToRect()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGRectEqualToRect(
|
||||
CGRect rect1,
|
||||
CGRect rect2);
|
||||
|
||||
|
||||
/* Standardize `rect' -- i.e., convert it to an equivalent rect which has
|
||||
* positive width and height. */
|
||||
/*
|
||||
* CGRectStandardize()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGRectStandardize(CGRect rect);
|
||||
|
||||
|
||||
/* Return 1 if `rect' is empty -- i.e., if it has zero width or height. A
|
||||
* null rect is defined to be empty. */
|
||||
/*
|
||||
* CGRectIsEmpty()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGRectIsEmpty(CGRect rect);
|
||||
|
||||
|
||||
/* Return 1 if `rect' is null -- e.g., the result of intersecting two
|
||||
* disjoint rectangles is a null rect. */
|
||||
/*
|
||||
* CGRectIsNull()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGRectIsNull(CGRect rect);
|
||||
|
||||
|
||||
/* Inset `rect' by `(dx, dy)' -- i.e., offset its origin by `(dx, dy)', and
|
||||
* decrease its size by `(2*dx, 2*dy)'. */
|
||||
/*
|
||||
* CGRectInset()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGRectInset(
|
||||
CGRect rect,
|
||||
float dx,
|
||||
float dy);
|
||||
|
||||
|
||||
/* Expand `rect' to the smallest rect containing it with integral origin
|
||||
* and size. */
|
||||
/*
|
||||
* CGRectIntegral()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGRectIntegral(CGRect rect);
|
||||
|
||||
|
||||
/* Return the union of `r1' and `r2'. */
|
||||
/*
|
||||
* CGRectUnion()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGRectUnion(
|
||||
CGRect r1,
|
||||
CGRect r2);
|
||||
|
||||
|
||||
/* Return the intersection of `r1' and `r2'. This may return a null
|
||||
* rect. */
|
||||
/*
|
||||
* CGRectIntersection()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGRectIntersection(
|
||||
CGRect r1,
|
||||
CGRect r2);
|
||||
|
||||
|
||||
/* Offset `rect' by `(dx, dy)'. */
|
||||
/*
|
||||
* CGRectOffset()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGRectOffset(
|
||||
CGRect rect,
|
||||
float dx,
|
||||
float dy);
|
||||
|
||||
|
||||
/* Make two new rectangles, `slice' and `remainder', by dividing `rect'
|
||||
* with a line that's parallel to one of its sides, specified by `edge' --
|
||||
* either `CGRectMinXEdge', `CGRectMinYEdge', `CGRectMaxXEdge', or
|
||||
* `CGRectMaxYEdge'. The size of `slice' is determined by `amount', which
|
||||
* measures the distance from the specified edge. */
|
||||
/*
|
||||
* CGRectDivide()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGRectDivide(
|
||||
CGRect rect,
|
||||
CGRect * slice,
|
||||
CGRect * remainder,
|
||||
float amount,
|
||||
CGRectEdge edge);
|
||||
|
||||
|
||||
/* Return 1 if `point' is contained in `rect', 0 otherwise. */
|
||||
/*
|
||||
* CGRectContainsPoint()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGRectContainsPoint(
|
||||
CGRect rect,
|
||||
CGPoint point);
|
||||
|
||||
|
||||
/* Return 1 if `rect2' is contained in `rect1', 0 otherwise. `rect2' is
|
||||
* contained in `rect1' if the union of `rect1' and `rect2' is equal to
|
||||
* `rect1'. */
|
||||
/*
|
||||
* CGRectContainsRect()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGRectContainsRect(
|
||||
CGRect rect1,
|
||||
CGRect rect2);
|
||||
|
||||
|
||||
/* Return 1 if `rect1' intersects `rect2', 0 otherwise. `rect1' intersects
|
||||
* `rect2' if the intersection of `rect1' and `rect2' is not the null
|
||||
* rect. */
|
||||
/*
|
||||
* CGRectIntersectsRect()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGRectIntersectsRect(
|
||||
CGRect rect1,
|
||||
CGRect rect2);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __CGGEOMETRY__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__CGGEOMETRY__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGGEOMETRY_H_ */
|
||||
|
||||
@@ -0,0 +1,344 @@
|
||||
/*
|
||||
File: CGImage.h
|
||||
|
||||
Contains: CoreGraphics images
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGIMAGE_H_
|
||||
#define CGIMAGE_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGCOLORSPACE__
|
||||
#include <CGColorSpace.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGDATAPROVIDER__
|
||||
#include <CGDataProvider.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __CGIMAGE__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __CGIMAGE__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef struct CGImage* CGImageRef;
|
||||
enum CGImageAlphaInfo {
|
||||
kCGImageAlphaNone = 0,
|
||||
kCGImageAlphaPremultipliedLast = 1, /* For example, premultiplied RGBA */
|
||||
kCGImageAlphaPremultipliedFirst = 2, /* For example, premultiplied ARGB */
|
||||
kCGImageAlphaLast = 3, /* For example, non-premultiplied RGBA */
|
||||
kCGImageAlphaFirst = 4, /* For example, non-premultiplied ARGB */
|
||||
kCGImageAlphaNoneSkipLast = 5, /* Equivalent to kCGImageAlphaNone. */
|
||||
kCGImageAlphaNoneSkipFirst = 6
|
||||
};
|
||||
typedef enum CGImageAlphaInfo CGImageAlphaInfo;
|
||||
|
||||
|
||||
/* Create an image. */
|
||||
/*
|
||||
* CGImageCreate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGImageRef )
|
||||
CGImageCreate(
|
||||
size_t width,
|
||||
size_t height,
|
||||
size_t bitsPerComponent,
|
||||
size_t bitsPerPixel,
|
||||
size_t bytesPerRow,
|
||||
CGColorSpaceRef colorspace,
|
||||
CGImageAlphaInfo alphaInfo,
|
||||
CGDataProviderRef provider,
|
||||
const float decode[],
|
||||
int shouldInterpolate,
|
||||
CGColorRenderingIntent intent);
|
||||
|
||||
|
||||
/* Create an image mask. */
|
||||
/*
|
||||
* CGImageMaskCreate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGImageRef )
|
||||
CGImageMaskCreate(
|
||||
size_t width,
|
||||
size_t height,
|
||||
size_t bitsPerComponent,
|
||||
size_t bitsPerPixel,
|
||||
size_t bytesPerRow,
|
||||
CGDataProviderRef provider,
|
||||
const float decode[],
|
||||
int shouldInterpolate);
|
||||
|
||||
|
||||
/* Create an image from `source', a data provider of JPEG-encoded data. */
|
||||
/*
|
||||
* CGImageCreateWithJPEGDataProvider()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( CGImageRef )
|
||||
CGImageCreateWithJPEGDataProvider(
|
||||
CGDataProviderRef source,
|
||||
const float decode[],
|
||||
int shouldInterpolate,
|
||||
CGColorRenderingIntent intent);
|
||||
|
||||
|
||||
/* Increment the retain count of `image' and return it. All images are
|
||||
* created with an initial retain count of 1. */
|
||||
/*
|
||||
* CGImageRetain()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGImageRef )
|
||||
CGImageRetain(CGImageRef image);
|
||||
|
||||
|
||||
/* Decrement the retain count of `image'. If the retain count reaches 0,
|
||||
* then release it and any associated resources. */
|
||||
/*
|
||||
* CGImageRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGImageRelease(CGImageRef image);
|
||||
|
||||
|
||||
/* Return 1 if `image' is an image mask, 0 otherwise. */
|
||||
/*
|
||||
* CGImageIsMask()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGImageIsMask(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the width of `image'. */
|
||||
/*
|
||||
* CGImageGetWidth()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGImageGetWidth(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the height of `image'. */
|
||||
/*
|
||||
* CGImageGetHeight()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGImageGetHeight(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the number of bits/component of `image'. */
|
||||
/*
|
||||
* CGImageGetBitsPerComponent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGImageGetBitsPerComponent(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the number of bits/pixel of `image'. */
|
||||
/*
|
||||
* CGImageGetBitsPerPixel()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGImageGetBitsPerPixel(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the number of bytes/row of `image'. */
|
||||
/*
|
||||
* CGImageGetBytesPerRow()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( size_t )
|
||||
CGImageGetBytesPerRow(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the colorspace of `image', or NULL if `image' is an image
|
||||
* mask. */
|
||||
/*
|
||||
* CGImageGetColorSpace()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorSpaceRef )
|
||||
CGImageGetColorSpace(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the alpha info of `image'. */
|
||||
/*
|
||||
* CGImageGetAlphaInfo()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGImageAlphaInfo )
|
||||
CGImageGetAlphaInfo(CGImageRef image);
|
||||
|
||||
|
||||
/*Return the data provider of `image'. */
|
||||
/*
|
||||
* CGImageGetDataProvider()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGDataProviderRef )
|
||||
CGImageGetDataProvider(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the decode array of `image'. */
|
||||
/*
|
||||
* CGImageGetDecode()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( const float * )
|
||||
CGImageGetDecode(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the interpolation parameter of `image'. */
|
||||
/*
|
||||
* CGImageGetShouldInterpolate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGImageGetShouldInterpolate(CGImageRef image);
|
||||
|
||||
|
||||
/* Return the rendering intent of `image'. */
|
||||
/*
|
||||
* CGImageGetRenderingIntent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGColorRenderingIntent )
|
||||
CGImageGetRenderingIntent(CGImageRef image);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __CGIMAGE__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__CGIMAGE__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGIMAGE_H_ */
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
File: CGPDFContext.h
|
||||
|
||||
Contains: CoreGraphics PDF context
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGPDFCONTEXT_H_
|
||||
#define CGPDFCONTEXT_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGCONTEXT__
|
||||
#include <CGContext.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGDATACONSUMER__
|
||||
#include <CGDataConsumer.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFDICTIONARY__
|
||||
#include <CFDictionary.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
/* Create a PDF context, using `consumer' for output. `mediaBox' is the
|
||||
* default page media bounding box; if NULL, then a default page size is
|
||||
* used. `auxiliaryInfo' specifies additional information used by the PDF
|
||||
* context when generating the PDF file. The keys and values in
|
||||
* `auxiliaryInfo' must be CFStrings. The following keys are recognized:
|
||||
* Key Value
|
||||
* -------- --------
|
||||
* Title The document's title.
|
||||
* Author The name of the person who created the document.
|
||||
* Creator If the document was converted to PDF from another format,
|
||||
* the name of the application that created the original
|
||||
* document from which it was converted.
|
||||
*/
|
||||
/*
|
||||
* CGPDFContextCreate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGContextRef )
|
||||
CGPDFContextCreate(
|
||||
CGDataConsumerRef consumer,
|
||||
const CGRect * mediaBox,
|
||||
CFDictionaryRef auxiliaryInfo);
|
||||
|
||||
|
||||
/* Convenience function: create a PDF context, writing to `url'. */
|
||||
/*
|
||||
* CGPDFContextCreateWithURL()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGContextRef )
|
||||
CGPDFContextCreateWithURL(
|
||||
CFURLRef url,
|
||||
const CGRect * mediaBox,
|
||||
CFDictionaryRef auxiliaryInfo);
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGPDFCONTEXT_H_ */
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
File: CGPDFDocument.h
|
||||
|
||||
Contains: CoreGraphics PDF document
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGPDFDOCUMENT_H_
|
||||
#define CGPDFDOCUMENT_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGDATAPROVIDER__
|
||||
#include <CGDataProvider.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGGEOMETRY__
|
||||
#include <CGGeometry.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFURL__
|
||||
#include <CFURL.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
typedef struct CGPDFDocument* CGPDFDocumentRef;
|
||||
/* Create a PDF document, using `provider' to obtain the document's
|
||||
* data. */
|
||||
/*
|
||||
* CGPDFDocumentCreateWithProvider()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGPDFDocumentRef )
|
||||
CGPDFDocumentCreateWithProvider(CGDataProviderRef provider);
|
||||
|
||||
|
||||
/* Create a PDF document from `url'. */
|
||||
/*
|
||||
* CGPDFDocumentCreateWithURL()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGPDFDocumentRef )
|
||||
CGPDFDocumentCreateWithURL(CFURLRef url);
|
||||
|
||||
|
||||
/* Increment the retain count of `document' and return it. All PDF
|
||||
* documents are created with an initial retain count of 1. */
|
||||
/*
|
||||
* CGPDFDocumentRetain()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGPDFDocumentRef )
|
||||
CGPDFDocumentRetain(CGPDFDocumentRef document);
|
||||
|
||||
|
||||
/* Decrement the retain count of `document'. If the retain count reaches 0,
|
||||
* then free it and any associated resources. */
|
||||
/*
|
||||
* CGPDFDocumentRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGPDFDocumentRelease(CGPDFDocumentRef document);
|
||||
|
||||
|
||||
/* Return the number of pages in `document'. */
|
||||
/*
|
||||
* CGPDFDocumentGetNumberOfPages()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGPDFDocumentGetNumberOfPages(CGPDFDocumentRef document);
|
||||
|
||||
|
||||
/* Return the media box of page number `page' in `document'. */
|
||||
/*
|
||||
* CGPDFDocumentGetMediaBox()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGPDFDocumentGetMediaBox(
|
||||
CGPDFDocumentRef document,
|
||||
int page);
|
||||
|
||||
|
||||
/* Return the crop box of page number `page' in `document'. */
|
||||
/*
|
||||
* CGPDFDocumentGetCropBox()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGPDFDocumentGetCropBox(
|
||||
CGPDFDocumentRef document,
|
||||
int page);
|
||||
|
||||
|
||||
/* Return the bleed box of page number `page' in `document'. */
|
||||
/*
|
||||
* CGPDFDocumentGetBleedBox()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGPDFDocumentGetBleedBox(
|
||||
CGPDFDocumentRef document,
|
||||
int page);
|
||||
|
||||
|
||||
/* Return the trim box of page number `page' in `document'. */
|
||||
/*
|
||||
* CGPDFDocumentGetTrimBox()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGPDFDocumentGetTrimBox(
|
||||
CGPDFDocumentRef document,
|
||||
int page);
|
||||
|
||||
|
||||
/* Return the art box of page number `page' in `document'. */
|
||||
/*
|
||||
* CGPDFDocumentGetArtBox()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGRect )
|
||||
CGPDFDocumentGetArtBox(
|
||||
CGPDFDocumentRef document,
|
||||
int page);
|
||||
|
||||
|
||||
/* Return the rotation angle (in degrees) of page number `page' in
|
||||
* `document'. */
|
||||
/*
|
||||
* CGPDFDocumentGetRotationAngle()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( int )
|
||||
CGPDFDocumentGetRotationAngle(
|
||||
CGPDFDocumentRef document,
|
||||
int page);
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGPDFDOCUMENT_H_ */
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
File: CGPattern.h
|
||||
|
||||
Contains: CoreGraphics base types
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGPATTERN_H_
|
||||
#define CGPATTERN_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGCONTEXT__
|
||||
#include <CGContext.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* kCGPatternTilingNoDistortion: The pattern cell is not distorted when
|
||||
* painted, however the spacing between pattern cells may vary by as much
|
||||
* as 1 device pixel.
|
||||
*
|
||||
* kCGPatternTilingConstantSpacingMinimalDistortion: Pattern cells are
|
||||
* spaced consistently, however the pattern cell may be distorted by as
|
||||
* much as 1 device pixel when the pattern is painted.
|
||||
*
|
||||
* kCGPatternTilingConstantSpacing: Pattern cells are spaced consistently
|
||||
* as with kCGPatternTilingConstantSpacingMinimalDistortion, however the
|
||||
* pattern cell may be distorted additionally to permit a more efficient
|
||||
* implementation. */
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __CGPATTERN__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __CGPATTERN__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
enum CGPatternTiling {
|
||||
kCGPatternTilingNoDistortion = 0,
|
||||
kCGPatternTilingConstantSpacingMinimalDistortion = 1,
|
||||
kCGPatternTilingConstantSpacing = 2
|
||||
};
|
||||
typedef enum CGPatternTiling CGPatternTiling;
|
||||
|
||||
|
||||
/* The drawing of the pattern is delegated to the callbacks. The callbacks
|
||||
* may be called one or many times to draw the pattern.
|
||||
*
|
||||
* `version' is the version number of the structure passed in as a
|
||||
* parameter to the CGPattern creation functions. The structure defined
|
||||
* below is version 0.
|
||||
*
|
||||
* `drawPattern' should draw the pattern in the context `c'. `info' is the
|
||||
* parameter originally passed to the CGPattern creation functions.
|
||||
*
|
||||
* `releaseInfo' is called when the pattern is deallocated. */
|
||||
typedef CALLBACK_API_C( void , CGDrawPatternProcPtr )(void *info, CGContextRef c);
|
||||
typedef CALLBACK_API_C( void , CGReleaseInfoProcPtr )(void * info);
|
||||
struct CGPatternCallbacks {
|
||||
unsigned int version;
|
||||
CGDrawPatternProcPtr drawPattern;
|
||||
CGReleaseInfoProcPtr releaseInfo;
|
||||
};
|
||||
typedef struct CGPatternCallbacks CGPatternCallbacks;
|
||||
/* Create a pattern. */
|
||||
/*
|
||||
* CGPatternCreate()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( CGPatternRef )
|
||||
CGPatternCreate(
|
||||
void * info,
|
||||
CGRect bounds,
|
||||
CGAffineTransform matrix,
|
||||
float xStep,
|
||||
float yStep,
|
||||
CGPatternTiling tiling,
|
||||
int isColored,
|
||||
const CGPatternCallbacks * callbacks);
|
||||
|
||||
|
||||
/* Increment the retain count of `pattern' and return it. All patterns are
|
||||
* created with an initial retain count of 1. */
|
||||
/*
|
||||
* CGPatternRetain()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( CGPatternRef )
|
||||
CGPatternRetain(CGPatternRef pattern);
|
||||
|
||||
|
||||
/* Decrement the retain count of `pattern'. If the retain count reaches 0,
|
||||
* then free it and release any associated resources. */
|
||||
/*
|
||||
* CGPatternRelease()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGPatternRelease(CGPatternRef pattern);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __CGPATTERN__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__CGPATTERN__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGPATTERN_H_ */
|
||||
|
||||
@@ -0,0 +1,514 @@
|
||||
/*
|
||||
File: CGRemoteOperation.h
|
||||
|
||||
Contains: CoreGraphics remote operation
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef CGREMOTEOPERATION_H_
|
||||
#define CGREMOTEOPERATION_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGGEOMETRY__
|
||||
#include <CGGeometry.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CGERROR__
|
||||
#include <CGError.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFDATE__
|
||||
#include <CFDate.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFMACHPORT__
|
||||
#include <CFMachPort.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __CGREMOTEOPERATION__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __CGREMOTEOPERATION__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
typedef CGError CGEventErr;
|
||||
enum {
|
||||
CGEventNoErr = kCGErrorSuccess
|
||||
};
|
||||
|
||||
|
||||
/* Screen refresh or drawing notification */
|
||||
/*
|
||||
* Callback function pointer;
|
||||
* Declare your callback function in this form. When an area of the display is
|
||||
* modified or refreshed, your callback function will be invoked with a count
|
||||
* of the number of rectangles in the refreshed areas, and a list of the refreshed
|
||||
* rectangles. The rectangles are in global coordinates.
|
||||
*
|
||||
* Your function should not modify, deallocate or free memory pointed to by rectArray.
|
||||
*
|
||||
* The system continues to accumulate refreshed areas constantly. Whenever new
|
||||
* information is available, your callback function is invoked.The list of rects
|
||||
* passed to the callback function are cleared from the accumulated refreshed area
|
||||
* when the callback is made.
|
||||
*
|
||||
* This callback may be triggered by drawing operations, window movement, and
|
||||
* display reconfiguration.
|
||||
*
|
||||
* Bear in mind that a single rectangle may occupy multiple displays,
|
||||
* either by overlapping the displays, or by residing on coincident displays
|
||||
* when mirroring is active. Use the CGGetDisplaysWithRect() to determine
|
||||
* the displays a rectangle occupies.
|
||||
*/
|
||||
typedef u_int32_t CGRectCount;
|
||||
typedef CALLBACK_API_C( void , CGScreenRefreshCallback )(CGRectCount count, const CGRect *rectArray, void *userParameter);
|
||||
/*
|
||||
* Register a callback function to be invoked when an area of the display
|
||||
* is refreshed, or modified. The function is invoked on the same thread
|
||||
* of execution that is processing events within your application.
|
||||
* userParameter is passed back with each invocation of the callback function.
|
||||
*/
|
||||
/*
|
||||
* CGRegisterScreenRefreshCallback()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGRegisterScreenRefreshCallback(
|
||||
CGScreenRefreshCallback callback,
|
||||
void * userParameter);
|
||||
|
||||
|
||||
/*
|
||||
* Remove a previously registered calback function.
|
||||
* Both the function and the userParameter must match the registered entry to be removed.
|
||||
*/
|
||||
/*
|
||||
* CGUnregisterScreenRefreshCallback()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGUnregisterScreenRefreshCallback(
|
||||
CGScreenRefreshCallback callback,
|
||||
void * userParameter);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* In some applications it may be preferable to have a seperate thread wait for screen refresh data.
|
||||
* This function should be called on a thread seperate from the event processing thread.
|
||||
* If screen refresh callback functions are registered, this function should not be used.
|
||||
* The mechanisms are mutually exclusive.
|
||||
*
|
||||
* Deallocate screen refresh rects using CGReleaseScreenRefreshRects().
|
||||
*
|
||||
* Returns an error code if parameters are invalid or an error occurs in retrieving
|
||||
* dirty screen rects from the server.
|
||||
*/
|
||||
/*
|
||||
* CGWaitForScreenRefreshRects()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGWaitForScreenRefreshRects(
|
||||
CGRect ** pRectArray,
|
||||
CGRectCount * pCount);
|
||||
|
||||
|
||||
/*
|
||||
* Deallocate the list of rects recieved from CGWaitForScreenRefreshRects()
|
||||
*/
|
||||
/*
|
||||
* CGReleaseScreenRefreshRects()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
CGReleaseScreenRefreshRects(CGRect * rectArray);
|
||||
|
||||
|
||||
/*
|
||||
* Posting events: These functions post events into the system. Use for remote
|
||||
* operation and virtualization.
|
||||
*
|
||||
* Note that remote operation requires a valid connection to the server, which
|
||||
* must be owned by either the root/Administrator user or the logged in console
|
||||
* user. This means that your application must be running as root/Administrator
|
||||
* user or the logged in console user.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Synthesize mouse events.
|
||||
* mouseCursorPosition should be the global coordinates the mouse is at for the event.
|
||||
* updateMouseCursor should be TRUE if the on-screen cursor
|
||||
* should be moved to mouseCursorPosition.
|
||||
*
|
||||
* Based on the values entered, the appropriate mouse-down, mouse-up, mouse-move,
|
||||
* or mouse-drag events are generated, by comparing the new state with the current state.
|
||||
*
|
||||
* The current implemementation of the event system supports a maximum of thirty-two buttons.
|
||||
* The buttonCount parameter should be followed by 'buttonCount' boolean_t values
|
||||
* indicating button state. The first value should reflect the state of the primary
|
||||
* button on the mouse. The second value, if any, should reflect the state of the secondary
|
||||
* mouse button (right), if any. A third value woule be the center button, and the remaining
|
||||
* buttons would be in USB device order.
|
||||
*/
|
||||
typedef u_int32_t CGButtonCount;
|
||||
/*
|
||||
* CGPostMouseEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGPostMouseEvent(
|
||||
CGPoint mouseCursorPosition,
|
||||
boolean_t updateMouseCursorPosition,
|
||||
CGButtonCount buttonCount,
|
||||
boolean_t mouseButtonDown,
|
||||
...);
|
||||
|
||||
|
||||
/*
|
||||
* Synthesize scroll wheel events.
|
||||
*
|
||||
* The current implemementation of the event system supports a maximum of three wheels.
|
||||
*
|
||||
* The wheelCount parameter should be followed by 'wheelCount' 32 bit integer values
|
||||
* indicating wheel movements. The first value should reflect the state of the primary
|
||||
* wheel on the mouse. The second value, if any, should reflect the state of a secondary
|
||||
* mouse wheel, if any.
|
||||
*
|
||||
* Wheel movement is represented by small signed integer values,
|
||||
* typically in a range from -10 to +10. Large values may have unexpected results,
|
||||
* depending on the application that processes the event.
|
||||
*/
|
||||
typedef u_int32_t CGWheelCount;
|
||||
/*
|
||||
* CGPostScrollWheelEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGPostScrollWheelEvent(
|
||||
CGWheelCount wheelCount,
|
||||
int32_t wheel1,
|
||||
...);
|
||||
|
||||
|
||||
/*
|
||||
* Synthesize keyboard events. Based on the values entered,
|
||||
* the appropriate key down, key up, and flags changed events are generated.
|
||||
* If keyChar is NUL (0), an apropriate value will be guessed at, based on the
|
||||
* default keymapping.
|
||||
*
|
||||
* All keystrokes needed to generate a character must be entered, including
|
||||
* SHIFT, CONTROL, OPTION, and COMMAND keys. For example, to produce a 'Z',
|
||||
* the SHIFT key must be down, the 'z' key must go down, and then the SHIFT
|
||||
* and 'z' key must be released:
|
||||
* CGPostKeyboardEvent( (CGCharCode)0, (CGKeyCode)56, true ); // shift down
|
||||
* CGPostKeyboardEvent( (CGCharCode)'Z', (CGKeyCode)6, true ); // 'z' down
|
||||
* CGPostKeyboardEvent( (CGCharCode)'Z', (CGKeyCode)6, false ); // 'z' up
|
||||
* CGPostKeyboardEvent( (CGCharCode)0, (CGKeyCode)56, false ); // 'shift up
|
||||
*/
|
||||
typedef u_int16_t CGCharCode;
|
||||
typedef u_int16_t CGKeyCode;
|
||||
/*
|
||||
* CGPostKeyboardEvent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGPostKeyboardEvent(
|
||||
CGCharCode keyChar,
|
||||
CGKeyCode virtualKey,
|
||||
boolean_t keyDown);
|
||||
|
||||
|
||||
/*
|
||||
* Warp the mouse cursor to the desired position in global
|
||||
* coordinates without generating events
|
||||
*/
|
||||
/*
|
||||
* CGWarpMouseCursorPosition()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGWarpMouseCursorPosition(CGPoint newCursorPosition);
|
||||
|
||||
|
||||
/*
|
||||
* Remote operation may want to inhibit local events (events from
|
||||
* the machine's keyboard and mouse). This may be done either as a
|
||||
* explicit request (tracked per app) or as a short term side effect of
|
||||
* posting an event.
|
||||
*
|
||||
* CGInhibitLocalEvents() is typically used for long term remote operation
|
||||
* of a system, as in automated system testing or telecommuting applications.
|
||||
* Local device state changes are discarded.
|
||||
*
|
||||
* Local event inhibition is turned off if the app that requested it terminates.
|
||||
*/
|
||||
/*
|
||||
* CGInhibitLocalEvents()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGInhibitLocalEvents(boolean_t doInhibit);
|
||||
|
||||
|
||||
/*
|
||||
* Set the period of time in seconds that local hardware events (keyboard and mouse)
|
||||
* are supressed after posting an event. Defaults to 0.25 second.
|
||||
*/
|
||||
/*
|
||||
* CGSetLocalEventsSuppressionInterval()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGSetLocalEventsSuppressionInterval(CFTimeInterval seconds);
|
||||
|
||||
|
||||
/*
|
||||
* By default, the flags that indicate modifier key state (Command, Alt, Shift, etc.)
|
||||
* from the system's keyboard and from other event sources are ORed together as an event is
|
||||
* posted into the system, and current key and mouse button state is considered in generating new events.
|
||||
* This function allows your application to enable or disable the
|
||||
* merging of event state. When combining is turned off, the event state propagated in the events
|
||||
* posted by your app reflect state built up only by your app. The state within your app's generated
|
||||
* event will not be combined with the system's current state, so the system-wide state reflecting key
|
||||
* and mouse button state will remain unchanged
|
||||
*
|
||||
* When called with doCombineState equal to FALSE, this function initializes local (per application)
|
||||
* state tracking information to a state of all keys, modifiers, and mouse buttons up.
|
||||
*
|
||||
* When called with doCombineState equal to TRUE, the current global state of keys, modifiers,
|
||||
* and mouse buttons are used in generating events.
|
||||
*/
|
||||
/*
|
||||
* CGEnableEventStateCombining()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGEnableEventStateCombining(boolean_t doCombineState);
|
||||
|
||||
|
||||
/*
|
||||
* By default the system supresses local hardware events from the keyboard and mouse during
|
||||
* a short interval after a synthetic event is posted (see CGSetLocalEventsSuppressionInterval())
|
||||
* and while a synthetic mouse drag (mouse movement with the left/only mouse button down).
|
||||
* Some classes of applications may want to enable events from some of the local hardware.
|
||||
* For example, an app may want to post only mouse events, and so may wish to permit local
|
||||
* keyboard hardware events to pass through.
|
||||
*
|
||||
* This interface lets an app specify a state (event supression interval, or mouse drag), and
|
||||
* a mask of event categories to be passed through.
|
||||
*/
|
||||
enum CGEventFilterMask {
|
||||
kCGEventFilterMaskPermitLocalMouseEvents = 0x00000001, /* Mouse, scroll wheel */
|
||||
kCGEventFilterMaskPermitLocalKeyboardEvents = 0x00000002, /* Alphanumeric keys and Command, Option, Control, Shift, AlphaLock */
|
||||
kCGEventFilterMaskPermitSystemDefinedEvents = 0x00000004, /* Power key, bezel buttons, sticky keys */
|
||||
kCGEventFilterMaskPermitAllEvents = kCGEventFilterMaskPermitLocalMouseEvents | kCGEventFilterMaskPermitLocalKeyboardEvents | kCGEventFilterMaskPermitSystemDefinedEvents
|
||||
};
|
||||
typedef enum CGEventFilterMask CGEventFilterMask;
|
||||
|
||||
enum CGEventSupressionState {
|
||||
kCGEventSupressionStateSupressionInterval = 0,
|
||||
kCGEventSupressionStateRemoteMouseDrag = 1,
|
||||
kCGNumberOfEventSupressionStates = 2
|
||||
};
|
||||
typedef enum CGEventSupressionState CGEventSupressionState;
|
||||
|
||||
/*
|
||||
* CGSetLocalEventsFilterDuringSupressionState()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGSetLocalEventsFilterDuringSupressionState(
|
||||
CGEventFilterMask filter,
|
||||
CGEventSupressionState state);
|
||||
|
||||
|
||||
/*
|
||||
* Helper function to connect or disconnect the mouse and mouse cursor.
|
||||
* CGAssociateMouseAndMouseCursorPosition(false) has the same effect
|
||||
* as the following, without actually modifying the supression interval:
|
||||
*
|
||||
* CGSetLocalEventsSuppressionInterval(MAX_DOUBLE);
|
||||
* CGWarpMouseCursorPosition(currentPosition);
|
||||
*
|
||||
* While disconnected, mouse move and drag events will reflect the current position of
|
||||
* the mouse cursor position, which will not change with mouse movement. Use the
|
||||
* <CoreGraphics/CGDirectDisplay.h> function:
|
||||
*
|
||||
* void CGGetLastMouseDelta( CGMouseDelta * deltaX, CGMouseDelta * deltaY );
|
||||
*
|
||||
* This will report mouse movement associated with the last mouse move or drag event.
|
||||
*
|
||||
* To update the display cursor position, use the function defined in this module:
|
||||
*
|
||||
* CGEventErr CGWarpMouseCursorPosition( CGPoint newCursorPosition );
|
||||
*/
|
||||
/*
|
||||
* CGAssociateMouseAndMouseCursorPosition()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGEventErr )
|
||||
CGAssociateMouseAndMouseCursorPosition(boolean_t connected);
|
||||
|
||||
|
||||
/*
|
||||
* Some classes of applications need to detect when the window server process dies, or
|
||||
* is not running. The easiest way to do this is to use a CFMachPortRef.
|
||||
*
|
||||
* If the CoreGraphics window server is not running, this function returns NULL.
|
||||
* If the server is running, a CFMachPortRef is returned.
|
||||
*
|
||||
* A program can register a callback function to use a CFMachPortRef to determine
|
||||
* when the CoreGraphics window server exits:
|
||||
*
|
||||
* static void handleWindowServerDeath( CFMachPortRef port, void *info )
|
||||
* {
|
||||
* printf( "Window Server port death detected!\n" );
|
||||
* CFRelease( port );
|
||||
* exit( 1 );
|
||||
* }
|
||||
*
|
||||
* static void watchForServerDeath()
|
||||
* {
|
||||
* CFMachPortRef port;
|
||||
*
|
||||
* port = CGWindowServerCFMachPort();
|
||||
* CFMachPortSetInvalidationCallBack( port, handleWindowServerDeath );
|
||||
* }
|
||||
*
|
||||
* Note that when the window server exits, there may be a few seconds during which
|
||||
* no window server is running, until the operating system starts a new
|
||||
* window server/loginwindow pair of processes. This function will return NULL
|
||||
* until a new window server is running.
|
||||
*
|
||||
* Multiple calls to this function may return multiple CFMachPortRefs, each referring
|
||||
* to the same Mach port. Multiple callbacks registered on multiple CFMachPortRefs
|
||||
* obtained in this way may fire in a nondetermanistic manner.
|
||||
*
|
||||
* Your program will need to run a CFRunLoop for the port death
|
||||
* callback to function. A program which does not use a CFRunLoop may use
|
||||
* CFMachPortIsValid(CFMachPortRef port) periodically to check if the port is valid.
|
||||
*/
|
||||
/*
|
||||
* CGWindowServerCFMachPort()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API_C( CFMachPortRef )
|
||||
CGWindowServerCFMachPort(void);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __CGREMOTEOPERATION__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__CGREMOTEOPERATION__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGREMOTEOPERATION_H_ */
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
File: CGWindowLevel.h
|
||||
|
||||
Contains: CoreGraphics window levels
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
#ifndef CGWINDOWLEVEL_H_
|
||||
#define CGWINDOWLEVEL_H_
|
||||
|
||||
#ifndef __CGBASE__
|
||||
#include <CGBase.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#if defined(__fourbyteints__) && !__fourbyteints__
|
||||
#define __CGWINDOWLEVEL__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints on
|
||||
#endif
|
||||
#pragma enumsalwaysint on
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=int
|
||||
#elif PRAGMA_ENUM_PACK
|
||||
#if __option(pack_enums)
|
||||
#define __CGWINDOWLEVEL__RESTORE_PACKED_ENUMS
|
||||
#pragma options(!pack_enums)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Windows may be assigned to a particular level. When assigned to a level,
|
||||
* the window is ordered relative to all other windows in that level.
|
||||
* Windows with a higher level are sorted in front of windows with a lower
|
||||
* level.
|
||||
*
|
||||
* A common set of window levels is defined here for use within higher
|
||||
* level frameworks. The levels are accessed via a key and function,
|
||||
* so that levels may be changed or adjusted in future releases without
|
||||
* breaking binary compatability.
|
||||
*/
|
||||
typedef int32_t CGWindowLevel;
|
||||
typedef int32_t CGWindowLevelKey;
|
||||
enum _CGCommonWindowLevelKey {
|
||||
kCGBaseWindowLevelKey = 0,
|
||||
kCGMinimumWindowLevelKey = 1,
|
||||
kCGDesktopWindowLevelKey = 2,
|
||||
kCGBackstopMenuLevelKey = 3,
|
||||
kCGNormalWindowLevelKey = 4,
|
||||
kCGFloatingWindowLevelKey = 5,
|
||||
kCGTornOffMenuWindowLevelKey = 6,
|
||||
kCGDockWindowLevelKey = 7,
|
||||
kCGMainMenuWindowLevelKey = 8,
|
||||
kCGStatusWindowLevelKey = 9,
|
||||
kCGModalPanelWindowLevelKey = 10,
|
||||
kCGPopUpMenuWindowLevelKey = 11,
|
||||
kCGDraggingWindowLevelKey = 12,
|
||||
kCGScreenSaverWindowLevelKey = 13,
|
||||
kCGMaximumWindowLevelKey = 14,
|
||||
kCGOverlayWindowLevelKey = 15,
|
||||
kCGHelpWindowLevelKey = 16,
|
||||
kCGUtilityWindowLevelKey = 17,
|
||||
kCGDesktopIconWindowLevelKey = 18,
|
||||
kCGNumberOfWindowLevelKeys = 19 /* Internal bookkeeping; must be last */
|
||||
};
|
||||
typedef enum _CGCommonWindowLevelKey _CGCommonWindowLevelKey;
|
||||
|
||||
/*
|
||||
* CGWindowLevelForKey()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CGWindowLevel )
|
||||
CGWindowLevelForKey(CGWindowLevelKey key);
|
||||
|
||||
|
||||
/* number of levels above kCGMaximumWindowLevel reserved for internal use */
|
||||
enum {
|
||||
kCGNumReservedWindowLevels = 16
|
||||
};
|
||||
|
||||
/* Definitions of older constant values as calls */
|
||||
#define kCGBaseWindowLevel CGWindowLevelForKey(kCGBaseWindowLevelKey) /* LONG_MIN */
|
||||
#define kCGMinimumWindowLevel CGWindowLevelForKey(kCGMinimumWindowLevelKey) /* (kCGBaseWindowLevel + 1) */
|
||||
#define kCGDesktopWindowLevel CGWindowLevelForKey(kCGDesktopWindowLevelKey) /* kCGMinimumWindowLevel */
|
||||
#define kCGDesktopIconWindowLevel CGWindowLevelForKey(kCGDesktopIconWindowLevelKey) /* kCGMinimumWindowLevel + 20 */
|
||||
#define kCGBackstopMenuLevel CGWindowLevelForKey(kCGBackstopMenuLevelKey) /* -20 */
|
||||
#define kCGNormalWindowLevel CGWindowLevelForKey(kCGNormalWindowLevelKey) /* 0 */
|
||||
#define kCGFloatingWindowLevel CGWindowLevelForKey(kCGFloatingWindowLevelKey) /* 3 */
|
||||
#define kCGTornOffMenuWindowLevel CGWindowLevelForKey(kCGTornOffMenuWindowLevelKey) /* 3 */
|
||||
#define kCGDockWindowLevel CGWindowLevelForKey(kCGDockWindowLevelKey) /* 10 */
|
||||
#define kCGMainMenuWindowLevel CGWindowLevelForKey(kCGMainMenuWindowLevelKey) /* 20 */
|
||||
#define kCGStatusWindowLevel CGWindowLevelForKey(kCGStatusWindowLevelKey) /* 21 */
|
||||
#define kCGModalPanelWindowLevel CGWindowLevelForKey(kCGModalPanelWindowLevelKey) /* 8 */
|
||||
#define kCGPopUpMenuWindowLevel CGWindowLevelForKey(kCGPopUpMenuWindowLevelKey) /* 101 */
|
||||
#define kCGDraggingWindowLevel CGWindowLevelForKey(kCGDraggingWindowLevelKey) /* 500 */
|
||||
#define kCGScreenSaverWindowLevel CGWindowLevelForKey(kCGScreenSaverWindowLevelKey) /* 1000 */
|
||||
#define kCGOverlayWindowLevel CGWindowLevelForKey(kCGOverlayWindowLevelKey) /* 102 */
|
||||
#define kCGHelpWindowLevel CGWindowLevelForKey(kCGHelpWindowLevelKey) /* 102 */
|
||||
#define kCGUtilityWindowLevel CGWindowLevelForKey(kCGUtilityWindowLevelKey) /* 19 */
|
||||
#define kCGMaximumWindowLevel CGWindowLevelForKey(kCGMaximumWindowLevelKey) /* LONG_MAX - kCGNumReservedWindowLevels */
|
||||
|
||||
#if PRAGMA_ENUM_ALWAYSINT
|
||||
#pragma enumsalwaysint reset
|
||||
#ifdef __CGWINDOWLEVEL__RESTORE_TWOBYTEINTS
|
||||
#pragma fourbyteints off
|
||||
#endif
|
||||
#elif PRAGMA_ENUM_OPTIONS
|
||||
#pragma option enum=reset
|
||||
#elif defined(__CGWINDOWLEVEL__RESTORE_PACKED_ENUMS)
|
||||
#pragma options(pack_enums)
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CGWINDOWLEVEL_H_ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,435 @@
|
||||
/*
|
||||
File: CMCalibrator.h
|
||||
|
||||
Contains: ColorSync Calibration API
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1998-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CMCALIBRATOR__
|
||||
#define __CMCALIBRATOR__
|
||||
|
||||
#ifndef __CMAPPLICATION__
|
||||
#include <CMApplication.h>
|
||||
#endif
|
||||
|
||||
#ifndef __EVENTS__
|
||||
#include <Events.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
typedef CALLBACK_API( void , CalibrateEventProcPtr )(EventRecord * event);
|
||||
typedef STACK_UPP_TYPE(CalibrateEventProcPtr) CalibrateEventUPP;
|
||||
|
||||
/* Interface for new ColorSync monitor calibrators (ColorSync 2.6 and greater) */
|
||||
|
||||
enum {
|
||||
kCalibratorNamePrefix = FOUR_CHAR_CODE('cali')
|
||||
};
|
||||
|
||||
struct CalibratorInfo {
|
||||
UInt32 dataSize; /* Size of this structure - compatibility */
|
||||
CMDisplayIDType displayID; /* Contains an hDC on Win32 */
|
||||
UInt32 profileLocationSize; /* Max size for returned profile location */
|
||||
CMProfileLocation * profileLocationPtr; /* For returning the profile */
|
||||
CalibrateEventUPP eventProc; /* Ignored on Win32 */
|
||||
Boolean isGood; /* true or false */
|
||||
};
|
||||
typedef struct CalibratorInfo CalibratorInfo;
|
||||
typedef CALLBACK_API( Boolean , CanCalibrateProcPtr )(CMDisplayIDType displayID, Str255 errMessage);
|
||||
typedef CALLBACK_API( OSErr , CalibrateProcPtr )(CalibratorInfo * theInfo);
|
||||
typedef STACK_UPP_TYPE(CanCalibrateProcPtr) CanCalibrateUPP;
|
||||
typedef STACK_UPP_TYPE(CalibrateProcPtr) CalibrateUPP;
|
||||
/*
|
||||
* NewCalibrateEventUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CalibrateEventUPP )
|
||||
NewCalibrateEventUPP(CalibrateEventProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppCalibrateEventProcInfo = 0x000000C0 }; /* pascal no_return_value Func(4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(CalibrateEventUPP) NewCalibrateEventUPP(CalibrateEventProcPtr userRoutine) { return (CalibrateEventUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCalibrateEventProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewCalibrateEventUPP(userRoutine) (CalibrateEventUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCalibrateEventProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewCanCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( CanCalibrateUPP )
|
||||
NewCanCalibrateUPP(CanCalibrateProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppCanCalibrateProcInfo = 0x000003D0 }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(CanCalibrateUPP) NewCanCalibrateUPP(CanCalibrateProcPtr userRoutine) { return (CanCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCanCalibrateProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewCanCalibrateUPP(userRoutine) (CanCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCanCalibrateProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( CalibrateUPP )
|
||||
NewCalibrateUPP(CalibrateProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppCalibrateProcInfo = 0x000000E0 }; /* pascal 2_bytes Func(4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(CalibrateUPP) NewCalibrateUPP(CalibrateProcPtr userRoutine) { return (CalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCalibrateProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewCalibrateUPP(userRoutine) (CalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCalibrateProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeCalibrateEventUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeCalibrateEventUPP(CalibrateEventUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeCalibrateEventUPP(CalibrateEventUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeCalibrateEventUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeCanCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeCanCalibrateUPP(CanCalibrateUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeCanCalibrateUPP(CanCalibrateUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeCanCalibrateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeCalibrateUPP(CalibrateUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeCalibrateUPP(CalibrateUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeCalibrateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeCalibrateEventUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
InvokeCalibrateEventUPP(
|
||||
EventRecord * event,
|
||||
CalibrateEventUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) InvokeCalibrateEventUPP(EventRecord * event, CalibrateEventUPP userUPP) { CALL_ONE_PARAMETER_UPP(userUPP, uppCalibrateEventProcInfo, event); }
|
||||
#else
|
||||
#define InvokeCalibrateEventUPP(event, userUPP) CALL_ONE_PARAMETER_UPP((userUPP), uppCalibrateEventProcInfo, (event))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeCanCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
InvokeCanCalibrateUPP(
|
||||
CMDisplayIDType displayID,
|
||||
Str255 errMessage,
|
||||
CanCalibrateUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(Boolean) InvokeCanCalibrateUPP(CMDisplayIDType displayID, Str255 errMessage, CanCalibrateUPP userUPP) { return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppCanCalibrateProcInfo, displayID, errMessage); }
|
||||
#else
|
||||
#define InvokeCanCalibrateUPP(displayID, errMessage, userUPP) (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCanCalibrateProcInfo, (displayID), (errMessage))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeCalibrateUPP(
|
||||
CalibratorInfo * theInfo,
|
||||
CalibrateUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeCalibrateUPP(CalibratorInfo * theInfo, CalibrateUPP userUPP) { return (OSErr)CALL_ONE_PARAMETER_UPP(userUPP, uppCalibrateProcInfo, theInfo); }
|
||||
#else
|
||||
#define InvokeCalibrateUPP(theInfo, userUPP) (OSErr)CALL_ONE_PARAMETER_UPP((userUPP), uppCalibrateProcInfo, (theInfo))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewCalibrateEventProc(userRoutine) NewCalibrateEventUPP(userRoutine)
|
||||
#define NewCanCalibrateProc(userRoutine) NewCanCalibrateUPP(userRoutine)
|
||||
#define NewCalibrateProc(userRoutine) NewCalibrateUPP(userRoutine)
|
||||
#define CallCalibrateEventProc(userRoutine, event) InvokeCalibrateEventUPP(event, userRoutine)
|
||||
#define CallCanCalibrateProc(userRoutine, displayID, errMessage) InvokeCanCalibrateUPP(displayID, errMessage, userRoutine)
|
||||
#define CallCalibrateProc(userRoutine, theInfo) InvokeCalibrateUPP(theInfo, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
/*
|
||||
* CMCalibrateDisplay()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API( OSErr )
|
||||
CMCalibrateDisplay(CalibratorInfo * theInfo);
|
||||
|
||||
|
||||
|
||||
#if OLDROUTINENAMES
|
||||
/* Interface for original ColorSync monitor calibrators (ColorSync 2.5.x) */
|
||||
enum {
|
||||
kOldCalibratorNamePrefix = FOUR_CHAR_CODE('Cali')
|
||||
};
|
||||
|
||||
struct OldCalibratorInfo {
|
||||
CMDisplayIDType displayID; /* Contains an hDC on Win32 */
|
||||
CMProfileLocation profileLocation;
|
||||
CalibrateEventUPP eventProc; /* Ignored on Win32 */
|
||||
UInt32 reserved; /* Unused */
|
||||
UInt32 flags; /* Unused */
|
||||
Boolean isGood; /* true or false */
|
||||
SInt8 byteFiller; /* Unused */
|
||||
};
|
||||
typedef struct OldCalibratorInfo OldCalibratorInfo;
|
||||
typedef CALLBACK_API( Boolean , OldCanCalibrateProcPtr )(CMDisplayIDType displayID);
|
||||
typedef CALLBACK_API( OSErr , OldCalibrateProcPtr )(OldCalibratorInfo * theInfo);
|
||||
typedef STACK_UPP_TYPE(OldCanCalibrateProcPtr) OldCanCalibrateUPP;
|
||||
typedef STACK_UPP_TYPE(OldCalibrateProcPtr) OldCalibrateUPP;
|
||||
#if CALL_NOT_IN_CARBON
|
||||
/*
|
||||
* NewOldCanCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( OldCanCalibrateUPP )
|
||||
NewOldCanCalibrateUPP(OldCanCalibrateProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOldCanCalibrateProcInfo = 0x000000D0 }; /* pascal 1_byte Func(4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OldCanCalibrateUPP) NewOldCanCalibrateUPP(OldCanCalibrateProcPtr userRoutine) { return (OldCanCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOldCanCalibrateProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOldCanCalibrateUPP(userRoutine) (OldCanCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOldCanCalibrateProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewOldCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( OldCalibrateUPP )
|
||||
NewOldCalibrateUPP(OldCalibrateProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppOldCalibrateProcInfo = 0x000000E0 }; /* pascal 2_bytes Func(4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OldCalibrateUPP) NewOldCalibrateUPP(OldCalibrateProcPtr userRoutine) { return (OldCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOldCalibrateProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewOldCalibrateUPP(userRoutine) (OldCalibrateUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppOldCalibrateProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOldCanCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOldCanCalibrateUPP(OldCanCalibrateUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOldCanCalibrateUPP(OldCanCalibrateUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOldCanCalibrateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeOldCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeOldCalibrateUPP(OldCalibrateUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeOldCalibrateUPP(OldCalibrateUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeOldCalibrateUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOldCanCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
InvokeOldCanCalibrateUPP(
|
||||
CMDisplayIDType displayID,
|
||||
OldCanCalibrateUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(Boolean) InvokeOldCanCalibrateUPP(CMDisplayIDType displayID, OldCanCalibrateUPP userUPP) { return (Boolean)CALL_ONE_PARAMETER_UPP(userUPP, uppOldCanCalibrateProcInfo, displayID); }
|
||||
#else
|
||||
#define InvokeOldCanCalibrateUPP(displayID, userUPP) (Boolean)CALL_ONE_PARAMETER_UPP((userUPP), uppOldCanCalibrateProcInfo, (displayID))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeOldCalibrateUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeOldCalibrateUPP(
|
||||
OldCalibratorInfo * theInfo,
|
||||
OldCalibrateUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeOldCalibrateUPP(OldCalibratorInfo * theInfo, OldCalibrateUPP userUPP) { return (OSErr)CALL_ONE_PARAMETER_UPP(userUPP, uppOldCalibrateProcInfo, theInfo); }
|
||||
#else
|
||||
#define InvokeOldCalibrateUPP(theInfo, userUPP) (OSErr)CALL_ONE_PARAMETER_UPP((userUPP), uppOldCalibrateProcInfo, (theInfo))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewOldCanCalibrateProc(userRoutine) NewOldCanCalibrateUPP(userRoutine)
|
||||
#define NewOldCalibrateProc(userRoutine) NewOldCalibrateUPP(userRoutine)
|
||||
#define CallOldCanCalibrateProc(userRoutine, displayID) InvokeOldCanCalibrateUPP(displayID, userRoutine)
|
||||
#define CallOldCalibrateProc(userRoutine, theInfo) InvokeOldCalibrateUPP(theInfo, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
#endif /* OLDROUTINENAMES */
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CMCALIBRATOR__ */
|
||||
|
||||
@@ -0,0 +1,551 @@
|
||||
/*
|
||||
File: CMDeviceIntegration.h
|
||||
|
||||
Contains: Color Management Device Interfaces
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CMDEVICEINTEGRATION__
|
||||
#define __CMDEVICEINTEGRATION__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CFSTRING__
|
||||
#include <CFString.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMAPPLICATION__
|
||||
#include <CMApplication.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMICCPROFILE__
|
||||
#include <CMICCProfile.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=mac68k
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(push, 2)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack(2)
|
||||
#endif
|
||||
|
||||
/*
|
||||
The current versions of the data structure
|
||||
containing information on registered devices.
|
||||
*/
|
||||
enum {
|
||||
cmDeviceInfoVersion1 = 0x00010000,
|
||||
cmDeviceProfileInfoVersion1 = 0x00010000,
|
||||
cmDeviceProfileInfoVersion2 = 0x00020000
|
||||
};
|
||||
|
||||
enum {
|
||||
cmCurrentDeviceInfoVersion = cmDeviceInfoVersion1,
|
||||
cmCurrentProfileInfoVersion = cmDeviceProfileInfoVersion1
|
||||
};
|
||||
|
||||
/*
|
||||
Certain APIs require a device ID or profile ID.
|
||||
In some cases, a "default ID" can be used.
|
||||
*/
|
||||
enum {
|
||||
cmDefaultDeviceID = 0,
|
||||
cmDefaultProfileID = 0
|
||||
};
|
||||
|
||||
/*
|
||||
Possible values for device states accessible by the
|
||||
CMGetDeviceState() and CMSetDeviceState() APIs.
|
||||
*/
|
||||
enum {
|
||||
cmDeviceStateDefault = 0x00000000,
|
||||
cmDeviceStateOffline = 0x00000001,
|
||||
cmDeviceStateBusy = 0x00000002,
|
||||
cmDeviceStateForceNotify = (long)0x80000000,
|
||||
cmDeviceStateDeviceRsvdBits = 0x00FF0000,
|
||||
cmDeviceStateAppleRsvdBits = (long)0xFF00FFFF
|
||||
};
|
||||
|
||||
/*
|
||||
Possible values for flags passed to the
|
||||
CMIterateDeviceProfiles() API.
|
||||
|
||||
"Factory" profiles are registered via the
|
||||
CMSetDeviceFactoryProfiles() API.
|
||||
|
||||
"Custom" profiles are those which are meant to take
|
||||
the place of the factory profiles, as a result of
|
||||
customization or calibration. These profiles are
|
||||
registered via the CMSetDeviceProfiles() API.
|
||||
|
||||
To retrieve all of the the former for all devices,
|
||||
use cmIterateFactoryDeviceProfiles as the flags
|
||||
value when calling CMIterateDeviceProfiles().
|
||||
|
||||
To retrieve only the latter for all devices, use
|
||||
the cmIterateCustomDeviceProfiles, as the flags
|
||||
value when calling CMIterateDeviceProfiles().
|
||||
|
||||
To get the profiles in use for all devices, use
|
||||
cmIterateCurrentDeviceProfiles as the flags value.
|
||||
This will replace the factory profiles with any
|
||||
overrides, yielding the currently used set.
|
||||
|
||||
To get all profiles, without replacement, use
|
||||
cmIterateAllDeviceProfiles.
|
||||
*/
|
||||
enum {
|
||||
cmIterateFactoryDeviceProfiles = 0x00000001,
|
||||
cmIterateCustomDeviceProfiles = 0x00000002,
|
||||
cmIterateCurrentDeviceProfiles = 0x00000003,
|
||||
cmIterateAllDeviceProfiles = 0x00000004,
|
||||
cmIterateDeviceProfilesMask = 0x0000000F
|
||||
};
|
||||
|
||||
/*
|
||||
Errors returned by CMDeviceIntegration APIs
|
||||
*/
|
||||
enum {
|
||||
cmDeviceDBNotFoundErr = -4227, /* Prefs not found/loaded */
|
||||
cmDeviceAlreadyRegistered = -4228, /* Re-registration of device */
|
||||
cmDeviceNotRegistered = -4229, /* Device not found */
|
||||
cmDeviceProfilesNotFound = -4230, /* Profiles not found */
|
||||
cmInternalCFErr = -4231 /* CoreFoundation failure */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
Clients can register for notifications of device evolutions:
|
||||
|
||||
DeviceRegistered A new device was registered
|
||||
DeviceUnregistered A device was unregistered
|
||||
DeviceOnline Change to Online as a result of CMSetDeviceState
|
||||
DeviceOffline Change to Offline as a result of CMSetDeviceState
|
||||
DeviceState Any change to a device state
|
||||
DefaultDevice A default device for any device class changed
|
||||
DeviceProfiles Any change to any device's profiles
|
||||
DefaultDeviceProfile The default profile for any device changed
|
||||
*/
|
||||
#define kCMDeviceRegisteredNotification CFSTR("CMDeviceRegisteredNotification")
|
||||
#define kCMDeviceUnregisteredNotification CFSTR("CMDeviceUnregisteredNotification")
|
||||
#define kCMDeviceOnlineNotification CFSTR("CMDeviceOnlineNotification")
|
||||
#define kCMDeviceOfflineNotification CFSTR("CMDeviceOfflineNotification")
|
||||
#define kCMDeviceStateNotification CFSTR("CMDeviceStateNotification")
|
||||
#define kCMDefaultDeviceNotification CFSTR("CMDefaultDeviceNotification")
|
||||
#define kCMDeviceProfilesNotification CFSTR("CMDeviceProfilesNotification")
|
||||
#define kCMDefaultDeviceProfileNotification CFSTR("CMDefaultDeviceProfileNotification")
|
||||
|
||||
/*
|
||||
Device state data.
|
||||
*/
|
||||
typedef UInt32 CMDeviceState;
|
||||
/*
|
||||
A CMDeviceID must be unique within a device's class.
|
||||
*/
|
||||
typedef UInt32 CMDeviceID;
|
||||
/*
|
||||
A CMDeviceProfileID must only be unique per device.
|
||||
*/
|
||||
typedef UInt32 CMDeviceProfileID;
|
||||
/*
|
||||
DeviceClass type.
|
||||
*/
|
||||
enum {
|
||||
cmScannerDeviceClass = FOUR_CHAR_CODE('scnr'),
|
||||
cmCameraDeviceClass = FOUR_CHAR_CODE('cmra'),
|
||||
cmDisplayDeviceClass = FOUR_CHAR_CODE('mntr'),
|
||||
cmPrinterDeviceClass = FOUR_CHAR_CODE('prtr'),
|
||||
cmProofDeviceClass = FOUR_CHAR_CODE('pruf')
|
||||
};
|
||||
|
||||
typedef OSType CMDeviceClass;
|
||||
/*
|
||||
CMDeviceScope
|
||||
Structure specifying a device's or a device setting's scope.
|
||||
*/
|
||||
struct CMDeviceScope {
|
||||
CFStringRef deviceUser; /* kCFPreferencesCurrentUser | _AnyUser */
|
||||
CFStringRef deviceHost; /* kCFPreferencesCurrentHost | _AnyHost */
|
||||
};
|
||||
typedef struct CMDeviceScope CMDeviceScope;
|
||||
typedef CMDeviceScope CMDeviceProfileScope;
|
||||
/*
|
||||
CMDeviceInfo
|
||||
Structure containing information on a given device.
|
||||
*/
|
||||
struct CMDeviceInfo {
|
||||
UInt32 dataVersion; /* cmDeviceInfoVersion1 */
|
||||
CMDeviceClass deviceClass; /* device class */
|
||||
CMDeviceID deviceID; /* device ID */
|
||||
CMDeviceScope deviceScope; /* device's scope */
|
||||
CMDeviceState deviceState; /* Device State flags */
|
||||
CMDeviceProfileID defaultProfileID; /* Can change */
|
||||
CFDictionaryRef * deviceName; /* Ptr to storage for CFDictionary of */
|
||||
/* localized device names (could be nil) */
|
||||
UInt32 profileCount; /* Count of registered profiles */
|
||||
UInt32 reserved; /* Reserved for use by ColorSync */
|
||||
};
|
||||
typedef struct CMDeviceInfo CMDeviceInfo;
|
||||
typedef CMDeviceInfo * CMDeviceInfoPtr;
|
||||
/*
|
||||
CMDeviceProfileInfo
|
||||
Structure containing information on a device profile.
|
||||
*/
|
||||
struct CMDeviceProfileInfo {
|
||||
UInt32 dataVersion; /* cmDeviceProfileInfoVersion1 */
|
||||
CMDeviceProfileID profileID; /* The identifier for this profile */
|
||||
CMProfileLocation profileLoc; /* The profile's location */
|
||||
CFDictionaryRef profileName; /* CFDictionary of localized profile names */
|
||||
UInt32 reserved; /* Reserved for use by ColorSync */
|
||||
};
|
||||
typedef struct CMDeviceProfileInfo CMDeviceProfileInfo;
|
||||
struct NCMDeviceProfileInfo {
|
||||
UInt32 dataVersion; /* cmDeviceProfileInfoVersion2 */
|
||||
CMDeviceProfileID profileID; /* The identifier for this profile */
|
||||
CMProfileLocation profileLoc; /* The profile's location */
|
||||
CFDictionaryRef profileName; /* CFDictionary of localized profile names */
|
||||
CMDeviceProfileScope profileScope; /* The scope this profile applies to */
|
||||
UInt32 reserved; /* Reserved for use by ColorSync */
|
||||
};
|
||||
typedef struct NCMDeviceProfileInfo NCMDeviceProfileInfo;
|
||||
/*
|
||||
CMDeviceProfileArray
|
||||
Structure containing the profiles for a device.
|
||||
*/
|
||||
struct CMDeviceProfileArray {
|
||||
UInt32 profileCount; /* Count of profiles in array */
|
||||
CMDeviceProfileInfo profiles[1]; /* The profile info records */
|
||||
};
|
||||
typedef struct CMDeviceProfileArray CMDeviceProfileArray;
|
||||
typedef CMDeviceProfileArray * CMDeviceProfileArrayPtr;
|
||||
/*
|
||||
Caller-supplied iterator functions
|
||||
*/
|
||||
typedef CALLBACK_API_C( OSErr , CMIterateDeviceInfoProcPtr )(const CMDeviceInfo *deviceInfo, void *refCon);
|
||||
typedef CALLBACK_API_C( OSErr , CMIterateDeviceProfileProcPtr )(const CMDeviceInfo *deviceInfo, const NCMDeviceProfileInfo *profileInfo, void *refCon);
|
||||
/*
|
||||
Device Registration
|
||||
*/
|
||||
/*
|
||||
* CMRegisterColorDevice()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMRegisterColorDevice(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CFDictionaryRef deviceName,
|
||||
const CMDeviceScope * deviceScope);
|
||||
|
||||
|
||||
/*
|
||||
* CMUnregisterColorDevice()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMUnregisterColorDevice(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID);
|
||||
|
||||
|
||||
/*
|
||||
Default Device accessors
|
||||
*/
|
||||
/*
|
||||
* CMSetDefaultDevice()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMSetDefaultDevice(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetDefaultDevice()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMGetDefaultDevice(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID * deviceID);
|
||||
|
||||
|
||||
/*
|
||||
Device Profile Registration & Access
|
||||
*/
|
||||
/*
|
||||
* CMSetDeviceFactoryProfiles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMSetDeviceFactoryProfiles(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CMDeviceProfileID defaultProfID,
|
||||
const CMDeviceProfileArray * deviceProfiles);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetDeviceFactoryProfiles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMGetDeviceFactoryProfiles(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CMDeviceProfileID * defaultProfID,
|
||||
UInt32 * arraySize,
|
||||
CMDeviceProfileArray * deviceProfiles);
|
||||
|
||||
|
||||
/*
|
||||
* CMSetDeviceProfiles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMSetDeviceProfiles(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
const CMDeviceProfileScope * profileScope,
|
||||
const CMDeviceProfileArray * deviceProfiles);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetDeviceProfiles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMGetDeviceProfiles(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
UInt32 * arraySize,
|
||||
CMDeviceProfileArray * deviceProfiles);
|
||||
|
||||
|
||||
/*
|
||||
* CMSetDeviceDefaultProfileID()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMSetDeviceDefaultProfileID(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CMDeviceProfileID defaultProfID);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetDeviceDefaultProfileID()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMGetDeviceDefaultProfileID(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CMDeviceProfileID * defaultProfID);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetDeviceProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMGetDeviceProfile(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CMDeviceProfileID profileID,
|
||||
CMProfileLocation * deviceProfLoc);
|
||||
|
||||
|
||||
/*
|
||||
* CMSetDeviceProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMSetDeviceProfile(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
const CMDeviceProfileScope * profileScope,
|
||||
CMDeviceProfileID profileID,
|
||||
const CMProfileLocation * deviceProfLoc);
|
||||
|
||||
|
||||
/*
|
||||
Other Device State/Info accessors
|
||||
*/
|
||||
/*
|
||||
* CMSetDeviceState()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMSetDeviceState(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CMDeviceState deviceState);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetDeviceState()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMGetDeviceState(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CMDeviceState * deviceState);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetDeviceInfo()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMGetDeviceInfo(
|
||||
CMDeviceClass deviceClass,
|
||||
CMDeviceID deviceID,
|
||||
CMDeviceInfo * deviceInfo);
|
||||
|
||||
|
||||
/*
|
||||
Device Info & Profile Iterators
|
||||
*/
|
||||
/*
|
||||
* CMIterateColorDevices()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMIterateColorDevices(
|
||||
CMIterateDeviceInfoProcPtr proc,
|
||||
UInt32 * seed,
|
||||
UInt32 * count,
|
||||
void * refCon);
|
||||
|
||||
|
||||
/*
|
||||
* CMIterateDeviceProfiles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: in version 10.1 and later
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMIterateDeviceProfiles(
|
||||
CMIterateDeviceProfileProcPtr proc,
|
||||
UInt32 * seed,
|
||||
UInt32 * count,
|
||||
UInt32 flags,
|
||||
void * refCon);
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_STRUCT_ALIGN
|
||||
#pragma options align=reset
|
||||
#elif PRAGMA_STRUCT_PACKPUSH
|
||||
#pragma pack(pop)
|
||||
#elif PRAGMA_STRUCT_PACK
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CMDEVICEINTEGRATION__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,523 @@
|
||||
/*
|
||||
File: CMMComponent.h
|
||||
|
||||
Contains: ColorSync CMM Component API
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1994-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __CMMCOMPONENT__
|
||||
#define __CMMCOMPONENT__
|
||||
|
||||
#ifndef __QUICKDRAW__
|
||||
#include <Quickdraw.h>
|
||||
#endif
|
||||
|
||||
#ifndef __COMPONENTS__
|
||||
#include <Components.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMAPPLICATION__
|
||||
#include <CMApplication.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
/* Component-based CMM interface version */
|
||||
enum {
|
||||
CMMInterfaceVersion = 1
|
||||
};
|
||||
|
||||
|
||||
/* Component-based CMM function selectors */
|
||||
enum {
|
||||
/* Required */
|
||||
kCMMOpen = -1, /* kComponentOpenSelect,*/
|
||||
kCMMClose = -2, /* kComponentCloseSelect,*/
|
||||
kCMMGetInfo = -4, /* kComponentVersionSelect*/
|
||||
kNCMMInit = 6,
|
||||
kCMMMatchColors = 1,
|
||||
kCMMCheckColors = 2,
|
||||
|
||||
/* Optional */
|
||||
kCMMValidateProfile = 8,
|
||||
kCMMMatchBitmap = 9,
|
||||
kCMMCheckBitmap = 10,
|
||||
kCMMConcatenateProfiles = 5,
|
||||
kCMMConcatInit = 7,
|
||||
kCMMNewLinkProfile = 16,
|
||||
kNCMMConcatInit = 18,
|
||||
kNCMMNewLinkProfile = 19,
|
||||
kCMMGetPS2ColorSpace = 11,
|
||||
kCMMGetPS2ColorRenderingIntent = 12,
|
||||
kCMMGetPS2ColorRendering = 13,
|
||||
kCMMGetPS2ColorRenderingVMSize = 17,
|
||||
|
||||
/* obsolete with ColorSync 2.5 */
|
||||
kCMMFlattenProfile = 14,
|
||||
kCMMUnflattenProfile = 15,
|
||||
|
||||
/* obsolete with ColorSync 2.6 */
|
||||
kCMMInit = 0,
|
||||
kCMMGetNamedColorInfo = 70,
|
||||
kCMMGetNamedColorValue = 71,
|
||||
kCMMGetIndNamedColorValue = 72,
|
||||
kCMMGetNamedColorIndex = 73,
|
||||
kCMMGetNamedColorName = 74,
|
||||
|
||||
/* obsolete with ColorSync 3.0 */
|
||||
kCMMMatchPixMap = 3,
|
||||
kCMMCheckPixMap = 4
|
||||
};
|
||||
|
||||
|
||||
#if TARGET_API_MAC_OS8
|
||||
typedef ComponentInstance CMMComponentInst;
|
||||
#if CALL_NOT_IN_CARBON
|
||||
/*
|
||||
* NCMMInit()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
NCMMInit(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef srcProfile,
|
||||
CMProfileRef dstProfile) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMInit()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMInit(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileHandle srcProfile,
|
||||
CMProfileHandle dstProfile) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0000, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMMatchColors()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMMatchColors(
|
||||
CMMComponentInst cmm,
|
||||
CMColor * colors,
|
||||
UInt32 count) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0001, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMCheckColors()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMCheckColors(
|
||||
CMMComponentInst cmm,
|
||||
CMColor * colors,
|
||||
UInt32 count,
|
||||
UInt32 * result) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMValidateProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMValidateProfile(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef prof,
|
||||
Boolean * valid) FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMFlattenProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMFlattenProfile(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef prof,
|
||||
UInt32 flags,
|
||||
CMFlattenUPP proc,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x0010, 0x000E, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMUnflattenProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMUnflattenProfile(
|
||||
CMMComponentInst cmm,
|
||||
FSSpec * resultFileSpec,
|
||||
CMFlattenUPP proc,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMMatchBitmap()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMMatchBitmap(
|
||||
CMMComponentInst cmm,
|
||||
CMBitmap * bitmap,
|
||||
CMBitmapCallBackUPP progressProc,
|
||||
void * refCon,
|
||||
CMBitmap * matchedBitmap) FIVEWORDINLINE(0x2F3C, 0x0010, 0x0009, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMCheckBitmap()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMCheckBitmap(
|
||||
CMMComponentInst cmm,
|
||||
const CMBitmap * bitmap,
|
||||
CMBitmapCallBackUPP progressProc,
|
||||
void * refCon,
|
||||
CMBitmap * resultBitmap) FIVEWORDINLINE(0x2F3C, 0x0010, 0x000A, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMMatchPixMap()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMMatchPixMap(
|
||||
CMMComponentInst cmm,
|
||||
PixMap * pixMap,
|
||||
CMBitmapCallBackUPP progressProc,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMCheckPixMap()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMCheckPixMap(
|
||||
CMMComponentInst cmm,
|
||||
const PixMap * pixMap,
|
||||
CMBitmapCallBackUPP progressProc,
|
||||
BitMap * bitMap,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x0010, 0x0004, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMConcatInit()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMConcatInit(
|
||||
CMMComponentInst cmm,
|
||||
CMConcatProfileSet * profileSet) FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* NCMMConcatInit()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
NCMMConcatInit(
|
||||
CMMComponentInst cmm,
|
||||
NCMConcatProfileSet * profileSet,
|
||||
CMConcatCallBackUPP proc,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0012, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMNewLinkProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMNewLinkProfile(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef * prof,
|
||||
const CMProfileLocation * targetLocation,
|
||||
CMConcatProfileSet * profileSet) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* NCMMNewLinkProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
NCMMNewLinkProfile(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef prof,
|
||||
NCMConcatProfileSet * profileSet,
|
||||
CMConcatCallBackUPP proc,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x0010, 0x0013, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetPS2ColorSpace()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetPS2ColorSpace(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef srcProf,
|
||||
UInt32 flags,
|
||||
CMFlattenUPP proc,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x0010, 0x000B, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetPS2ColorRenderingIntent()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetPS2ColorRenderingIntent(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef srcProf,
|
||||
UInt32 flags,
|
||||
CMFlattenUPP proc,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x0010, 0x000C, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetPS2ColorRendering()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetPS2ColorRendering(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef srcProf,
|
||||
CMProfileRef dstProf,
|
||||
UInt32 flags,
|
||||
CMFlattenUPP proc,
|
||||
void * refCon) FIVEWORDINLINE(0x2F3C, 0x0014, 0x000D, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetPS2ColorRenderingVMSize()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetPS2ColorRenderingVMSize(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef srcProf,
|
||||
CMProfileRef dstProf,
|
||||
UInt32 * vmSize) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMConcatenateProfiles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMConcatenateProfiles(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileHandle thru,
|
||||
CMProfileHandle dst,
|
||||
CMProfileHandle * newDst) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0005, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetNamedColorInfo()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetNamedColorInfo(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef srcProf,
|
||||
UInt32 * deviceChannels,
|
||||
OSType * deviceColorSpace,
|
||||
OSType * PCSColorSpace,
|
||||
UInt32 * count,
|
||||
StringPtr prefix,
|
||||
StringPtr suffix) FIVEWORDINLINE(0x2F3C, 0x001C, 0x0046, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetNamedColorValue()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetNamedColorValue(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef prof,
|
||||
StringPtr name,
|
||||
CMColor * deviceColor,
|
||||
CMColor * PCSColor) FIVEWORDINLINE(0x2F3C, 0x0010, 0x0047, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetIndNamedColorValue()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetIndNamedColorValue(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef prof,
|
||||
UInt32 index,
|
||||
CMColor * deviceColor,
|
||||
CMColor * PCSColor) FIVEWORDINLINE(0x2F3C, 0x0010, 0x0048, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetNamedColorIndex()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetNamedColorIndex(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef prof,
|
||||
StringPtr name,
|
||||
UInt32 * index) FIVEWORDINLINE(0x2F3C, 0x000C, 0x0049, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
/*
|
||||
* CMMGetNamedColorName()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: not available
|
||||
* CarbonLib: not available
|
||||
* Mac OS X: not available
|
||||
*/
|
||||
EXTERN_API( CMError )
|
||||
CMMGetNamedColorName(
|
||||
CMMComponentInst cmm,
|
||||
CMProfileRef prof,
|
||||
UInt32 index,
|
||||
StringPtr name) FIVEWORDINLINE(0x2F3C, 0x000C, 0x004A, 0x7000, 0xA82A);
|
||||
|
||||
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
#endif /* TARGET_API_MAC_OS8 */
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CMMCOMPONENT__ */
|
||||
|
||||
@@ -0,0 +1,243 @@
|
||||
/*
|
||||
File: CMScriptingPlugin.h
|
||||
|
||||
Contains: ColorSync Scripting Plugin API
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 1998-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
#ifndef __FILES__
|
||||
#include <Files.h>
|
||||
#endif
|
||||
|
||||
#ifndef __CMAPPLICATION__
|
||||
#include <CMApplication.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
enum {
|
||||
/* ColorSync Scripting AppleEvent Errors */
|
||||
cmspInvalidImageFile = -4220, /* Plugin cannot handle this image file type */
|
||||
cmspInvalidImageSpace = -4221, /* Plugin cannot create an image file of this colorspace */
|
||||
cmspInvalidProfileEmbed = -4222, /* Specific invalid profile errors */
|
||||
cmspInvalidProfileSource = -4223,
|
||||
cmspInvalidProfileDest = -4224,
|
||||
cmspInvalidProfileProof = -4225,
|
||||
cmspInvalidProfileLink = -4226
|
||||
};
|
||||
|
||||
|
||||
/**** embedFlags field ****/
|
||||
/* reserved for future use: currently 0 */
|
||||
|
||||
/**** matchFlags field ****/
|
||||
enum {
|
||||
cmspFavorEmbeddedMask = 0x00000001 /* if bit 0 is 0 then use srcProf profile, if 1 then use profile embedded in image if present*/
|
||||
};
|
||||
|
||||
|
||||
/**** scripting plugin entry points ****/
|
||||
typedef CALLBACK_API_C( CMError , ValidateImageProcPtr )(const FSSpec * spec);
|
||||
typedef CALLBACK_API_C( CMError , GetImageSpaceProcPtr )(const FSSpec *spec, OSType *space);
|
||||
typedef CALLBACK_API_C( CMError , ValidateSpaceProcPtr )(const FSSpec *spec, OSType *space);
|
||||
typedef CALLBACK_API_C( CMError , EmbedImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, CMProfileRef embedProf, UInt32 embedFlags);
|
||||
typedef CALLBACK_API_C( CMError , UnembedImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto);
|
||||
typedef CALLBACK_API_C( CMError , MatchImageProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, UInt32 qual, UInt32 srcIntent, CMProfileRef srcProf, CMProfileRef dstProf, CMProfileRef prfProf, UInt32 matchFlags);
|
||||
typedef CALLBACK_API_C( CMError , CountImageProfilesProcPtr )(const FSSpec *spec, UInt32 *count);
|
||||
typedef CALLBACK_API_C( CMError , GetIndImageProfileProcPtr )(const FSSpec *spec, UInt32 index, CMProfileRef *prof);
|
||||
typedef CALLBACK_API_C( CMError , SetIndImageProfileProcPtr )(const FSSpec *specFrom, const FSSpec *specInto, UInt32 index, CMProfileRef prof, UInt32 embedFlags);
|
||||
/**** CSScriptingLib API ****/
|
||||
|
||||
/*
|
||||
* CMValidImage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMValidImage(const FSSpec * spec);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetImageSpace()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMGetImageSpace(
|
||||
const FSSpec * spec,
|
||||
OSType * space);
|
||||
|
||||
|
||||
/*
|
||||
* CMEmbedImage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMEmbedImage(
|
||||
const FSSpec * specFrom,
|
||||
const FSSpec * specInto,
|
||||
Boolean repl,
|
||||
CMProfileRef embProf);
|
||||
|
||||
|
||||
/*
|
||||
* CMUnembedImage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMUnembedImage(
|
||||
const FSSpec * specFrom,
|
||||
const FSSpec * specInto,
|
||||
Boolean repl);
|
||||
|
||||
|
||||
/*
|
||||
* CMMatchImage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMMatchImage(
|
||||
const FSSpec * specFrom,
|
||||
const FSSpec * specInto,
|
||||
Boolean repl,
|
||||
UInt32 qual,
|
||||
CMProfileRef srcProf,
|
||||
UInt32 srcIntent,
|
||||
CMProfileRef dstProf);
|
||||
|
||||
|
||||
/*
|
||||
* CMProofImage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMProofImage(
|
||||
const FSSpec * specFrom,
|
||||
const FSSpec * specInto,
|
||||
Boolean repl,
|
||||
UInt32 qual,
|
||||
CMProfileRef srcProf,
|
||||
UInt32 srcIntent,
|
||||
CMProfileRef dstProf,
|
||||
CMProfileRef prfProf);
|
||||
|
||||
|
||||
/*
|
||||
* CMLinkImage()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMLinkImage(
|
||||
const FSSpec * specFrom,
|
||||
const FSSpec * specInto,
|
||||
Boolean repl,
|
||||
UInt32 qual,
|
||||
CMProfileRef lnkProf,
|
||||
UInt32 lnkIntent);
|
||||
|
||||
|
||||
/*
|
||||
* CMCountImageProfiles()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMCountImageProfiles(
|
||||
const FSSpec * spec,
|
||||
UInt32 * count);
|
||||
|
||||
|
||||
/*
|
||||
* CMGetIndImageProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMGetIndImageProfile(
|
||||
const FSSpec * spec,
|
||||
UInt32 index,
|
||||
CMProfileRef * prof);
|
||||
|
||||
|
||||
/*
|
||||
* CMSetIndImageProfile()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: in CSScriptingLib 2.6 and later
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in 3.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMError )
|
||||
CMSetIndImageProfile(
|
||||
const FSSpec * specFrom,
|
||||
const FSSpec * specInto,
|
||||
Boolean repl,
|
||||
UInt32 index,
|
||||
CMProfileRef prof);
|
||||
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,395 @@
|
||||
/*
|
||||
File: CMTypes.h
|
||||
|
||||
Contains: ColorSync types
|
||||
|
||||
Version: QuickTime 7.3
|
||||
|
||||
Copyright: (c) 2007 (c) 2000-2001 by Apple Computer, Inc., all rights reserved.
|
||||
|
||||
Bugs?: For bug reports, consult the following page on
|
||||
the World Wide Web:
|
||||
|
||||
http://developer.apple.com/bugreporter/
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CMTYPES__
|
||||
#define __CMTYPES__
|
||||
|
||||
#ifndef __MACTYPES__
|
||||
#include <MacTypes.h>
|
||||
#endif
|
||||
|
||||
#ifndef __MIXEDMODE__
|
||||
#include <MixedMode.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* Standard type for ColorSync and other system error codes */
|
||||
|
||||
|
||||
#if PRAGMA_ONCE
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if PRAGMA_IMPORT
|
||||
#pragma import on
|
||||
#endif
|
||||
|
||||
typedef long CMError;
|
||||
/* Abstract data type for memory-based Profile */
|
||||
typedef struct OpaqueCMProfileRef* CMProfileRef;
|
||||
/* Abstract data type for Profile search result */
|
||||
typedef struct OpaqueCMProfileSearchRef* CMProfileSearchRef;
|
||||
/* Abstract data type for BeginMatching(...) reference */
|
||||
typedef struct OpaqueCMMatchRef* CMMatchRef;
|
||||
/* Abstract data type for ColorWorld reference */
|
||||
typedef struct OpaqueCMWorldRef* CMWorldRef;
|
||||
/* Data type for ColorSync DisplayID reference */
|
||||
/* On 8 & 9 this is a AVIDType */
|
||||
/* On X this is a CGSDisplayID */
|
||||
typedef UInt32 CMDisplayIDType;
|
||||
|
||||
/* Caller-supplied flatten function */
|
||||
typedef CALLBACK_API( OSErr , CMFlattenProcPtr )(long command, long *size, void *data, void *refCon);
|
||||
/* Caller-supplied progress function for Bitmap & PixMap matching routines */
|
||||
typedef CALLBACK_API( Boolean , CMBitmapCallBackProcPtr )(long progress, void *refCon);
|
||||
/* Caller-supplied progress function for NCMMConcatInit & NCMMNewLinkProfile routines */
|
||||
typedef CALLBACK_API( Boolean , CMConcatCallBackProcPtr )(long progress, void *refCon);
|
||||
/* Caller-supplied filter function for Profile search */
|
||||
typedef CALLBACK_API( Boolean , CMProfileFilterProcPtr )(CMProfileRef prof, void *refCon);
|
||||
/* Caller-supplied function for profile access */
|
||||
typedef CALLBACK_API( OSErr , CMProfileAccessProcPtr )(long command, long offset, long *size, void *data, void *refCon);
|
||||
typedef STACK_UPP_TYPE(CMFlattenProcPtr) CMFlattenUPP;
|
||||
typedef STACK_UPP_TYPE(CMBitmapCallBackProcPtr) CMBitmapCallBackUPP;
|
||||
typedef STACK_UPP_TYPE(CMConcatCallBackProcPtr) CMConcatCallBackUPP;
|
||||
typedef STACK_UPP_TYPE(CMProfileFilterProcPtr) CMProfileFilterUPP;
|
||||
typedef STACK_UPP_TYPE(CMProfileAccessProcPtr) CMProfileAccessUPP;
|
||||
/*
|
||||
* NewCMFlattenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMFlattenUPP )
|
||||
NewCMFlattenUPP(CMFlattenProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppCMFlattenProcInfo = 0x00003FE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(CMFlattenUPP) NewCMFlattenUPP(CMFlattenProcPtr userRoutine) { return (CMFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewCMFlattenUPP(userRoutine) (CMFlattenUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMFlattenProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewCMBitmapCallBackUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMBitmapCallBackUPP )
|
||||
NewCMBitmapCallBackUPP(CMBitmapCallBackProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppCMBitmapCallBackProcInfo = 0x000003D0 }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(CMBitmapCallBackUPP) NewCMBitmapCallBackUPP(CMBitmapCallBackProcPtr userRoutine) { return (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewCMBitmapCallBackUPP(userRoutine) (CMBitmapCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMBitmapCallBackProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewCMConcatCallBackUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMConcatCallBackUPP )
|
||||
NewCMConcatCallBackUPP(CMConcatCallBackProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppCMConcatCallBackProcInfo = 0x000003D0 }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(CMConcatCallBackUPP) NewCMConcatCallBackUPP(CMConcatCallBackProcPtr userRoutine) { return (CMConcatCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMConcatCallBackProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewCMConcatCallBackUPP(userRoutine) (CMConcatCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMConcatCallBackProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewCMProfileFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMProfileFilterUPP )
|
||||
NewCMProfileFilterUPP(CMProfileFilterProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppCMProfileFilterProcInfo = 0x000003D0 }; /* pascal 1_byte Func(4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(CMProfileFilterUPP) NewCMProfileFilterUPP(CMProfileFilterProcPtr userRoutine) { return (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewCMProfileFilterUPP(userRoutine) (CMProfileFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileFilterProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* NewCMProfileAccessUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( CMProfileAccessUPP )
|
||||
NewCMProfileAccessUPP(CMProfileAccessProcPtr userRoutine);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
enum { uppCMProfileAccessProcInfo = 0x0000FFE0 }; /* pascal 2_bytes Func(4_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(CMProfileAccessUPP) NewCMProfileAccessUPP(CMProfileAccessProcPtr userRoutine) { return (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture()); }
|
||||
#else
|
||||
#define NewCMProfileAccessUPP(userRoutine) (CMProfileAccessUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppCMProfileAccessProcInfo, GetCurrentArchitecture())
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeCMFlattenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeCMFlattenUPP(CMFlattenUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeCMFlattenUPP(CMFlattenUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeCMFlattenUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeCMBitmapCallBackUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeCMBitmapCallBackUPP(CMBitmapCallBackUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeCMBitmapCallBackUPP(CMBitmapCallBackUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeCMBitmapCallBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeCMConcatCallBackUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeCMConcatCallBackUPP(CMConcatCallBackUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeCMConcatCallBackUPP(CMConcatCallBackUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeCMConcatCallBackUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeCMProfileFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeCMProfileFilterUPP(CMProfileFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeCMProfileFilterUPP(CMProfileFilterUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeCMProfileFilterUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* DisposeCMProfileAccessUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( void )
|
||||
DisposeCMProfileAccessUPP(CMProfileAccessUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(void) DisposeCMProfileAccessUPP(CMProfileAccessUPP userUPP) { DisposeRoutineDescriptor((UniversalProcPtr)userUPP); }
|
||||
#else
|
||||
#define DisposeCMProfileAccessUPP(userUPP) DisposeRoutineDescriptor(userUPP)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeCMFlattenUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeCMFlattenUPP(
|
||||
long command,
|
||||
long * size,
|
||||
void * data,
|
||||
void * refCon,
|
||||
CMFlattenUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeCMFlattenUPP(long command, long * size, void * data, void * refCon, CMFlattenUPP userUPP) { return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppCMFlattenProcInfo, command, size, data, refCon); }
|
||||
#else
|
||||
#define InvokeCMFlattenUPP(command, size, data, refCon, userUPP) (OSErr)CALL_FOUR_PARAMETER_UPP((userUPP), uppCMFlattenProcInfo, (command), (size), (data), (refCon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeCMBitmapCallBackUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
InvokeCMBitmapCallBackUPP(
|
||||
long progress,
|
||||
void * refCon,
|
||||
CMBitmapCallBackUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(Boolean) InvokeCMBitmapCallBackUPP(long progress, void * refCon, CMBitmapCallBackUPP userUPP) { return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppCMBitmapCallBackProcInfo, progress, refCon); }
|
||||
#else
|
||||
#define InvokeCMBitmapCallBackUPP(progress, refCon, userUPP) (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMBitmapCallBackProcInfo, (progress), (refCon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeCMConcatCallBackUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
InvokeCMConcatCallBackUPP(
|
||||
long progress,
|
||||
void * refCon,
|
||||
CMConcatCallBackUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(Boolean) InvokeCMConcatCallBackUPP(long progress, void * refCon, CMConcatCallBackUPP userUPP) { return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppCMConcatCallBackProcInfo, progress, refCon); }
|
||||
#else
|
||||
#define InvokeCMConcatCallBackUPP(progress, refCon, userUPP) (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMConcatCallBackProcInfo, (progress), (refCon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeCMProfileFilterUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( Boolean )
|
||||
InvokeCMProfileFilterUPP(
|
||||
CMProfileRef prof,
|
||||
void * refCon,
|
||||
CMProfileFilterUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(Boolean) InvokeCMProfileFilterUPP(CMProfileRef prof, void * refCon, CMProfileFilterUPP userUPP) { return (Boolean)CALL_TWO_PARAMETER_UPP(userUPP, uppCMProfileFilterProcInfo, prof, refCon); }
|
||||
#else
|
||||
#define InvokeCMProfileFilterUPP(prof, refCon, userUPP) (Boolean)CALL_TWO_PARAMETER_UPP((userUPP), uppCMProfileFilterProcInfo, (prof), (refCon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* InvokeCMProfileAccessUPP()
|
||||
*
|
||||
* Availability:
|
||||
* Non-Carbon CFM: available as macro/inline
|
||||
* CarbonLib: in CarbonLib 1.0 and later
|
||||
* Mac OS X: in version 10.0 and later
|
||||
*/
|
||||
EXTERN_API_C( OSErr )
|
||||
InvokeCMProfileAccessUPP(
|
||||
long command,
|
||||
long offset,
|
||||
long * size,
|
||||
void * data,
|
||||
void * refCon,
|
||||
CMProfileAccessUPP userUPP);
|
||||
#if !OPAQUE_UPP_TYPES
|
||||
#ifdef __cplusplus
|
||||
inline DEFINE_API_C(OSErr) InvokeCMProfileAccessUPP(long command, long offset, long * size, void * data, void * refCon, CMProfileAccessUPP userUPP) { return (OSErr)CALL_FIVE_PARAMETER_UPP(userUPP, uppCMProfileAccessProcInfo, command, offset, size, data, refCon); }
|
||||
#else
|
||||
#define InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userUPP) (OSErr)CALL_FIVE_PARAMETER_UPP((userUPP), uppCMProfileAccessProcInfo, (command), (offset), (size), (data), (refCon))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CALL_NOT_IN_CARBON || OLDROUTINENAMES
|
||||
/* support for pre-Carbon UPP routines: New...Proc and Call...Proc */
|
||||
#define NewCMFlattenProc(userRoutine) NewCMFlattenUPP(userRoutine)
|
||||
#define NewCMBitmapCallBackProc(userRoutine) NewCMBitmapCallBackUPP(userRoutine)
|
||||
#define NewCMConcatCallBackProc(userRoutine) NewCMConcatCallBackUPP(userRoutine)
|
||||
#define NewCMProfileFilterProc(userRoutine) NewCMProfileFilterUPP(userRoutine)
|
||||
#define NewCMProfileAccessProc(userRoutine) NewCMProfileAccessUPP(userRoutine)
|
||||
#define CallCMFlattenProc(userRoutine, command, size, data, refCon) InvokeCMFlattenUPP(command, size, data, refCon, userRoutine)
|
||||
#define CallCMBitmapCallBackProc(userRoutine, progress, refCon) InvokeCMBitmapCallBackUPP(progress, refCon, userRoutine)
|
||||
#define CallCMConcatCallBackProc(userRoutine, progress, refCon) InvokeCMConcatCallBackUPP(progress, refCon, userRoutine)
|
||||
#define CallCMProfileFilterProc(userRoutine, prof, refCon) InvokeCMProfileFilterUPP(prof, refCon, userRoutine)
|
||||
#define CallCMProfileAccessProc(userRoutine, command, offset, size, data, refCon) InvokeCMProfileAccessUPP(command, offset, size, data, refCon, userRoutine)
|
||||
#endif /* CALL_NOT_IN_CARBON */
|
||||
|
||||
|
||||
#ifdef PRAGMA_IMPORT_OFF
|
||||
#pragma import off
|
||||
#elif PRAGMA_IMPORT
|
||||
#pragma import reset
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CMTYPES__ */
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* CVBase.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVBase.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@availability Mac OS X 10.4 or later
|
||||
@discussion Here you can find the type declarations for CoreVideo. CoreVideo uses a CVTimeStamp structure to store video display time stamps.
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(__COREVIDEO_CVBASE_H__)
|
||||
#define __COREVIDEO_CVBASE_H__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#include <CoreFoundation/CFBase.h>
|
||||
#else
|
||||
#include <MacTypes.h>
|
||||
#include <CFBase.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define CV_EXPORT CF_EXPORT
|
||||
#define CV_INLINE CF_INLINE
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
#define CVDIRECT3DDEVICE LPDIRECT3DDEVICE9
|
||||
#define CVDIRECT3DTEXTURE LPDIRECT3DTEXTURE9
|
||||
#define CVDIRECT3DSURFACE LPDIRECT3DSURFACE9
|
||||
#define CVDIRECT3D LPDIRECT3D9
|
||||
#endif //TARGET_OS_WIN32
|
||||
|
||||
/*!
|
||||
@typedef CVOptionFlags
|
||||
@abstract Flags to be used for the display and render call back functions.
|
||||
@discussion ***Values to be defined***
|
||||
*/
|
||||
typedef uint64_t CVOptionFlags;
|
||||
|
||||
/*!
|
||||
@struct CVSMPTETime
|
||||
@abstract A structure for holding a SMPTE time.
|
||||
@field subframes
|
||||
The number of subframes in the full message.
|
||||
@field subframeDivisor
|
||||
The number of subframes per frame (typically 80).
|
||||
@field counter
|
||||
The total number of messages received.
|
||||
@field type
|
||||
The kind of SMPTE time using the SMPTE time type constants.
|
||||
@field flags
|
||||
A set of flags that indicate the SMPTE state.
|
||||
@field hours
|
||||
The number of hourse in the full message.
|
||||
@field minutes
|
||||
The number of minutes in the full message.
|
||||
@field seconds
|
||||
The number of seconds in the full message.
|
||||
@field frames
|
||||
The number of frames in the full message.
|
||||
*/
|
||||
struct CVSMPTETime
|
||||
{
|
||||
SInt16 subframes;
|
||||
SInt16 subframeDivisor;
|
||||
UInt32 counter;
|
||||
UInt32 type;
|
||||
UInt32 flags;
|
||||
SInt16 hours;
|
||||
SInt16 minutes;
|
||||
SInt16 seconds;
|
||||
SInt16 frames;
|
||||
};
|
||||
typedef struct CVSMPTETime CVSMPTETime;
|
||||
|
||||
/*!
|
||||
@enum SMPTE Time Types
|
||||
@abstract Constants that describe the type of SMPTE time.
|
||||
@constant kCVSMPTETimeType24
|
||||
24 Frame
|
||||
@constant kCVSMPTETimeType25
|
||||
25 Frame
|
||||
@constant kCVSMPTETimeType30Drop
|
||||
30 Drop Frame
|
||||
@constant kCVSMPTETimeType30
|
||||
30 Frame
|
||||
@constant kCVSMPTETimeType2997
|
||||
29.97 Frame
|
||||
@constant kCVSMPTETimeType2997Drop
|
||||
29.97 Drop Frame
|
||||
@constant kCVSMPTETimeType60
|
||||
60 Frame
|
||||
@constant kCVSMPTETimeType5994
|
||||
59.94 Frame
|
||||
*/
|
||||
enum
|
||||
{
|
||||
kCVSMPTETimeType24 = 0,
|
||||
kCVSMPTETimeType25 = 1,
|
||||
kCVSMPTETimeType30Drop = 2,
|
||||
kCVSMPTETimeType30 = 3,
|
||||
kCVSMPTETimeType2997 = 4,
|
||||
kCVSMPTETimeType2997Drop = 5,
|
||||
kCVSMPTETimeType60 = 6,
|
||||
kCVSMPTETimeType5994 = 7
|
||||
};
|
||||
|
||||
/*!
|
||||
@enum SMPTE State Flags
|
||||
@abstract Flags that describe the SMPTE time state.
|
||||
@constant kCVSMPTETimeValid
|
||||
The full time is valid.
|
||||
@constant kCVSMPTETimeRunning
|
||||
Time is running.
|
||||
*/
|
||||
enum
|
||||
{
|
||||
kCVSMPTETimeValid = (1L << 0),
|
||||
kCVSMPTETimeRunning = (1L << 1)
|
||||
};
|
||||
|
||||
|
||||
enum {
|
||||
kCVTimeIsIndefinite = 1 << 0
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int64_t timeValue;
|
||||
int32_t timeScale;
|
||||
int32_t flags;
|
||||
} CVTime;
|
||||
|
||||
/*!
|
||||
@struct CVTimeStamp
|
||||
@abstract CoreVideo uses a CVTimeStamp structure to store video display time stamps.
|
||||
@discussion This structure is purposely very similar to AudioTimeStamp defined in the CoreAudio framework.
|
||||
Most of the CVTimeStamp struct should be fairly self-explanatory. However, it is probably worth pointing out that unlike the audio time stamps, floats are not used to represent the video equivalent of sample times. This was done partly to avoid precision issues, and partly because QuickTime still uses integers for time values and time scales. In the actual implementation it has turned out to be very convenient to use integers, and we can represent framerates like NTSC (30000/1001 fps) exactly. The mHostTime structure field uses the same Mach absolute time base that is used in CoreAudio, so that clients of the CoreVideo API can synchronize between the two subsystems.
|
||||
@field videoTimeScale The scale (in units per second) of the videoTime and videoPeriod values
|
||||
@field videoTime This represents the start of a frame (or field for interlaced)
|
||||
@field hostTime Host root timebase time
|
||||
@field rateScalar This is the current rate of the device as measured by the timestamps, divided by the nominal rate
|
||||
@field videoPeriod This is the nominal update period of the current output device
|
||||
@field smpteTime SMPTE time representation of the time stamp.
|
||||
@field flags Possible values are:
|
||||
kCVTimeStampVideoTimeValid
|
||||
kCVTimeStampHostTimeValid
|
||||
kCVTimeStampSMPTETimeValid
|
||||
kCVTimeStampVideoPeriodValid
|
||||
kCVTimeStampRateScalarValid
|
||||
There are flags for each field to make it easier to detect interlaced vs progressive output
|
||||
kCVTimeStampTopField
|
||||
kCVTimeStampBottomField
|
||||
Some commonly used combinations of timestamp flags
|
||||
kCVTimeStampVideoHostTimeValid
|
||||
kCVTimeStampIsInterlaced
|
||||
@field version The current CVTimeStamp is version 0.
|
||||
@field reserved Reserved. Do not use.
|
||||
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t version; // Currently will be 0.
|
||||
int32_t videoTimeScale; // Video timescale (units per second)
|
||||
int64_t videoTime; // This represents the start of a frame (or field for interlaced) .. think vsync - still not 100% sure on the name
|
||||
uint64_t hostTime; // Host root timebase time
|
||||
double rateScalar; // Current rate as measured by the timestamps divided by the nominal rate
|
||||
int64_t videoRefreshPeriod; // Hint for nominal output rate
|
||||
CVSMPTETime smpteTime;
|
||||
uint64_t flags;
|
||||
uint64_t reserved;
|
||||
} CVTimeStamp;
|
||||
|
||||
// Flags for the CVTimeStamp structure
|
||||
enum
|
||||
{
|
||||
kCVTimeStampVideoTimeValid = (1L << 0),
|
||||
kCVTimeStampHostTimeValid = (1L << 1),
|
||||
kCVTimeStampSMPTETimeValid = (1L << 2),
|
||||
kCVTimeStampVideoRefreshPeriodValid = (1L << 3),
|
||||
kCVTimeStampRateScalarValid = (1L << 4),
|
||||
|
||||
// There are flags for each field to make it easier to detect interlaced vs progressive output
|
||||
kCVTimeStampTopField = (1L << 16),
|
||||
kCVTimeStampBottomField = (1L << 17)
|
||||
};
|
||||
|
||||
// Some commonly used combinations of timestamp flags
|
||||
enum
|
||||
{
|
||||
kCVTimeStampVideoHostTimeValid = (kCVTimeStampVideoTimeValid | kCVTimeStampHostTimeValid),
|
||||
kCVTimeStampIsInterlaced = (kCVTimeStampTopField | kCVTimeStampBottomField)
|
||||
};
|
||||
|
||||
CV_EXPORT const CVTime kCVZeroTime;
|
||||
CV_EXPORT const CVTime kCVIndefiniteTime;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,171 @@
|
||||
/*
|
||||
* CVBuffer.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVBuffer.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@availability Mac OS X 10.4 or later
|
||||
@discussion CVBufferRef types are abstract and only define ways to attach meta data to buffers (such as timestamps,
|
||||
colorspace information, etc.). CVBufferRefs do not imply any particular kind of data storage. It could
|
||||
be compressed data, image data, etc.
|
||||
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO_CVBUFFER_H__)
|
||||
#define __COREVIDEO_CVBUFFER_H__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#include <QuartzCore/CVBase.h>
|
||||
#include <QuartzCore/CVReturn.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#else
|
||||
#pragma warning (disable: 4068) // ignore unknown pragmas
|
||||
#include <CVBase.h>
|
||||
#include <CVReturn.h>
|
||||
#include <CFDictionary.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#pragma mark CVBufferRef attribute keys
|
||||
|
||||
/* The following two keys are useful with the CoreVideo pool and texture cache APIs so that you can specify
|
||||
an initial set of default buffer attachments to automatically be attached to the buffer when it is created. */
|
||||
#if TARGET_OS_MAC
|
||||
CV_EXPORT const CFStringRef kCVBufferPropagatedAttachmentsKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVBufferNonPropagatedAttachmentsKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
#else
|
||||
#define kCVBufferPropagatedAttachmentsKey CFSTR("PropagatedAttachments")
|
||||
#define kCVBufferNonPropagatedAttachmentsKey CFSTR("NonPropagatedAttachments")
|
||||
#endif
|
||||
|
||||
#pragma mark CVBufferRef attachment keys
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
CV_EXPORT const CFStringRef kCVBufferMovieTimeKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // Generally only available for frames emitted by QuickTime; CFDictionary containing these two keys:
|
||||
CV_EXPORT const CFStringRef kCVBufferTimeValueKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVBufferTimeScaleKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
#else
|
||||
#define kCVBufferMovieTimeKey CFSTR("QTMovieTime")
|
||||
#define kCVBufferTimeValueKey CFSTR("TimeValue")
|
||||
#define kCVBufferTimeScaleKey CFSTR("TimeScale")
|
||||
#endif
|
||||
|
||||
|
||||
#pragma mark CVBufferRef
|
||||
|
||||
enum {
|
||||
kCVAttachmentMode_ShouldNotPropagate = 0,
|
||||
kCVAttachmentMode_ShouldPropagate = 1,
|
||||
};
|
||||
typedef uint32_t CVAttachmentMode;
|
||||
|
||||
/*!
|
||||
@typedef CVBufferRef
|
||||
@abstract Base type for all CoreVideo buffers
|
||||
|
||||
*/
|
||||
typedef struct __CVBuffer *CVBufferRef;
|
||||
|
||||
/*!
|
||||
@function CVBufferRetain
|
||||
@abstract Retains a CVBuffer object
|
||||
@discussion Like CFRetain CVBufferRetain increments the retain count of a CVBuffer object. In contrast to the CF call it is NULL safe.
|
||||
@param buffer A CVBuffer object that you want to retain.
|
||||
@result A CVBuffer object that is the same as the passed in buffer.
|
||||
*/
|
||||
CV_EXPORT CVBufferRef CVBufferRetain(CVBufferRef buffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
/*!
|
||||
@function CVBufferRelease
|
||||
@abstract Release a CVBuffer object
|
||||
@discussion Like CFRetain CVBufferRetain decrements the retain count of a CVBuffer object. If that count consequently becomes zero the memory allocated to the object is deallocated and the object is destroyed. In contrast to the CF call it is NULL safe.
|
||||
@param buffer A CVBuffer object that you want to release.
|
||||
*/
|
||||
CV_EXPORT void CVBufferRelease(CVBufferRef buffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
#pragma mark CVBufferAttachment
|
||||
|
||||
/*!
|
||||
@function CVBufferSetAttachment
|
||||
@abstract Sets or adds a attachment of a CVBuffer object
|
||||
@discussion You can attach any CF object to a CVBuffer object to store additional information. CVBufferGetAttachment stores an attachement identified by a key. If the key doesn't exist, the attachment will be added. If the key does exist, the existing attachment will be replaced. In bouth cases the retain count of the attachment will be incremented. The value can be any CFType but nil has no defined behavior.
|
||||
@param buffer Target CVBuffer object.
|
||||
@param key Key in form of a CFString identifying the desired attachment.
|
||||
@param value Attachment in form af a CF object.
|
||||
@param attachmentMode Specifies which attachment mode is desired for this attachment. A particular attachment key may only exist in
|
||||
a single mode at a time.
|
||||
*/
|
||||
CV_EXPORT void CVBufferSetAttachment(CVBufferRef buffer, CFStringRef key, CFTypeRef value, CVAttachmentMode attachmentMode) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
|
||||
/*!
|
||||
@function CVBufferGetAttachment
|
||||
@abstract Returns a specific attachment of a CVBuffer object
|
||||
@discussion You can attach any CF object to a CVBuffer object to store additional information. CVBufferGetAttachment retrieves an attachement identified by a key.
|
||||
@param buffer Target CVBuffer object.
|
||||
@param key Key in form of a CFString identifying the desired attachment.
|
||||
@param attachmentMode. Returns the mode of the attachment, if desired. May be NULL.
|
||||
@result If found the attachment object
|
||||
*/
|
||||
CV_EXPORT CFTypeRef CVBufferGetAttachment(CVBufferRef buffer, CFStringRef key, CVAttachmentMode *attachmentMode) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVBufferRemoveAttachment
|
||||
@abstract Removes a specific attachment of a CVBuffer object
|
||||
@discussion CVBufferRemoveAttachment removes an attachement identified by a key. If found the attachement is removed and the retain count decremented.
|
||||
@param buffer Target CVBuffer object.
|
||||
@param key Key in form of a CFString identifying the desired attachment.
|
||||
*/
|
||||
CV_EXPORT void CVBufferRemoveAttachment(CVBufferRef buffer, CFStringRef key) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVBufferRemoveAllAttachments
|
||||
@abstract Removes all attachments of a CVBuffer object
|
||||
@discussion While CVBufferRemoveAttachment removes a specific attachement identified by a key CVBufferRemoveAllAttachments removes all attachments of a buffer and decrements their retain counts.
|
||||
@param buffer Target CVBuffer object.
|
||||
*/
|
||||
CV_EXPORT void CVBufferRemoveAllAttachments(CVBufferRef buffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVBufferGetAttachments
|
||||
@abstract Returns all attachments of a CVBuffer object
|
||||
@discussion CVBufferGetAttachments is a convenience call that returns all attachments with their corresponding keys in a CFDictionary.
|
||||
@param buffer Target CVBuffer object.
|
||||
@result A CFDictionary with all buffer attachments identified by there keys. If no attachment is present, the dictionary is empty. Returns NULL
|
||||
for invalid attachment mode.
|
||||
*/
|
||||
CV_EXPORT CFDictionaryRef CVBufferGetAttachments(CVBufferRef buffer, CVAttachmentMode attachmentMode) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVBufferSetAttachments
|
||||
@abstract Sets a set of attachments for a CVBuffer
|
||||
@discussion CVBufferSetAttachments is a convenience call that in turn calls CVBufferSetAttachment for each key and value in the given dictionary. All key value pairs must be in the root level of the dictionary.
|
||||
@param buffer Target CVBuffer object.
|
||||
*/
|
||||
CV_EXPORT void CVBufferSetAttachments(CVBufferRef buffer, CFDictionaryRef theAttachments, CVAttachmentMode attachmentMode) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVBufferPropagateAttachments
|
||||
@abstract Copy all propagatable attachments from one buffer to another.
|
||||
@discussion CVBufferPropagateAttachments is a convenience call that copies all attachments with a mode of kCVAttachmentMode_ShouldPropagate from one
|
||||
buffer to another.
|
||||
@param sourceBuffer CVBuffer to copy attachments from.
|
||||
@param destinationBuffer CVBuffer to copy attachments to.
|
||||
*/
|
||||
CV_EXPORT void CVBufferPropagateAttachments(CVBufferRef sourceBuffer, CVBufferRef destinationBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* CVDirect3DBuffer.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVDirect3DBuffer.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@discussion A CoreVideo buffer derives from a generic buffer and can be an ImageBuffer or PixelBuffer.
|
||||
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO_CVDIRECT3DBUFFER_H__)
|
||||
#define __COREVIDEO_CVDIRECT3DBUFFER_H__ 1
|
||||
|
||||
#include <CVImageBuffer.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define kCVDirect3DBufferWidth CFSTR("Width")
|
||||
#define kCVDirect3DBufferHeight CFSTR("Height")
|
||||
#define kCVDirect3DBufferTarget CFSTR("Direct3DTarget")
|
||||
#define kCVDirect3DBufferInternalFormat CFSTR("Direct3DInternalFormat")
|
||||
#define kCVDirect3DBufferMaximumMipmapLevel CFSTR("MaximumMipmapLevel")
|
||||
|
||||
typedef CVImageBufferRef CVDirect3DBufferRef;
|
||||
|
||||
CV_EXPORT CFTypeID CVDirect3DBufferGetTypeID();
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferRetain
|
||||
@abstract Retains a CVDirect3DBuffer object
|
||||
@discussion Equivalent to CFRetain, but NULL safe
|
||||
@param buffer A CVDirect3DBuffer object that you want to retain.
|
||||
@result A CVDirect3DBuffer object that is the same as the passed in buffer.
|
||||
*/
|
||||
CV_EXPORT CVDirect3DBufferRef CVDirect3DBufferRetain( CVDirect3DBufferRef texture );
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferRelease
|
||||
@abstract Releases a CVDirect3DBuffer object
|
||||
@discussion Equivalent to CFRelease, but NULL safe
|
||||
@param buffer A CVDirect3DBuffer object that you want to release.
|
||||
*/
|
||||
CV_EXPORT void CVDirect3DBufferRelease( CVDirect3DBufferRef texture );
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferCreate
|
||||
@abstract Create a new CVDirect3DBuffer that may be used for D3D rendering purposes
|
||||
@param width The width of the buffer in pixels
|
||||
@param height The height of the buffer in pixels
|
||||
@param attributes A CFDictionaryRef containing other desired attributes of the buffer (texture format, max mipmap level, etc.).
|
||||
May be NULL.
|
||||
@param bufferOut The newly created buffer will be placed here.
|
||||
@result kCVReturnSuccess if the attachment succeeded
|
||||
*/
|
||||
CV_EXPORT CVReturn CVDirect3DBufferCreate(CFAllocatorRef allocator, size_t width, size_t height, void *d3dDevice, CFDictionaryRef attributes, CVDirect3DBufferRef *bufferOut);
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferGetAttributes
|
||||
@param openGLBuffer Target D3D Buffer.
|
||||
@result CVDirect3DBuffer attributes dictionary, NULL if not set.
|
||||
*/
|
||||
CV_EXPORT CFDictionaryRef CVDirect3DBufferGetAttributes(CVDirect3DBufferRef d3DBuffer);
|
||||
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* CVDirect3DBufferPool.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Created by David Eldred based on CVOpenGLBufferPool.h
|
||||
* Copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVDirect3DBufferPool.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@discussion CVDirect3DBufferPool is a utility object for managing a set of CVDirect3DBuffer objects that are going to be recycled.
|
||||
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO__CVDIRECT3DBUFFERPOOL_H__)
|
||||
#define __COREVIDEO__CVDIRECT3DBUFFERPOOL_H__ 1
|
||||
|
||||
#include <CVBase.h>
|
||||
#include <CVReturn.h>
|
||||
#include <CVDirect3DBuffer.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct __CVDirect3DBufferPool *CVDirect3DBufferPoolRef;
|
||||
|
||||
#define kCVDirect3DBufferPoolMinimumBufferCountKey CFSTR("MinimumBufferCount")
|
||||
#define kCVDirect3DBufferPoolMaximumBufferAgeKey CFSTR("MaximumBufferAge")
|
||||
|
||||
CV_EXPORT CFTypeID CVDirect3DBufferPoolGetTypeID();
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferPoolRetain
|
||||
@abstract Retains a CVDirect3DBufferPoolRef object
|
||||
@discussion Equivalent to CFRetain, but NULL safe
|
||||
@param buffer A CVDirect3DBufferPoolRef object that you want to retain.
|
||||
@result A CVDirect3DBufferPoolRef object that is the same as the passed in buffer.
|
||||
*/
|
||||
CV_EXPORT CVDirect3DBufferPoolRef CVDirect3DBufferPoolRetain( CVDirect3DBufferPoolRef pixelBufferPool ); // NULL-safe
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferPoolRelease
|
||||
@abstract Releases a CVDirect3DBufferPoolRef object
|
||||
@discussion Equivalent to CFRelease, but NULL safe
|
||||
@param buffer A CVDirect3DBufferPoolRef object that you want to release.
|
||||
*/
|
||||
CV_EXPORT void CVDirect3DBufferPoolRelease( CVDirect3DBufferPoolRef pixelBufferPool ); // NULL-safe
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferPoolCreate
|
||||
@abstract Creates a new Pixel Buffer pool.
|
||||
@discussion Equivalent to CFRelease, but NULL safe
|
||||
@param allocator The CFAllocatorRef to use for allocating this buffer pool. May be NULL.
|
||||
@param poolAttributes A CFDictionaryRef containing the attributes to be used for the pool itself.
|
||||
@param pixelBufferAttributes A CFDictionaryRef containing the attributes to be used for creating new D3DBuffers within the pool.
|
||||
@param d3dDevice the LPDIRECT3DDEVICE9 to be used for allocation of buffers for this pool
|
||||
@param poolOut The newly created pool will be placed here
|
||||
@result Returns kCVReturnSuccess on success
|
||||
*/
|
||||
CV_EXPORT CVReturn CVDirect3DBufferPoolCreate(CFAllocatorRef allocator,
|
||||
CFDictionaryRef poolAttributes,
|
||||
CFDictionaryRef pixelBufferAttributes,
|
||||
void *d3dDevice,
|
||||
CVDirect3DBufferPoolRef *poolOut);
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferPoolGetAttributes
|
||||
@abstract Returns the pool attributes dictionary for a CVDirect3DBufferPool
|
||||
@param pool The CVDirect3DBufferPoolRef to retrieve the attributes from
|
||||
@result Returns the pool attributes dictionary, or NULL on failure.
|
||||
*/
|
||||
CV_EXPORT CFDictionaryRef CVDirect3DBufferPoolGetAttributes(CVDirect3DBufferPoolRef pool);
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferPoolGetDirect3DBufferAttributes
|
||||
@abstract Returns the attributes of pixel buffers that will be created from this pool.
|
||||
@discussion This function is provided for those cases where you may need to know some information about the buffers that
|
||||
will be created up front.
|
||||
@param pool The CVDirect3DBufferPoolRef to retrieve the attributes from
|
||||
@result Returns the pixel buffer attributes dictionary, or NULL on failure.
|
||||
*/
|
||||
CV_EXPORT CFDictionaryRef CVDirect3DBufferPoolGetDirect3DBufferAttributes(CVDirect3DBufferPoolRef pool);
|
||||
|
||||
/*!
|
||||
@function CVDirect3DBufferPoolCreateDirect3DBuffer
|
||||
@abstract Creates a new D3DBuffer object from the pool.
|
||||
@discussion The function creates a new (attachment-free) CVDirect3DBuffer using the pixel buffer attributes specifed during pool creation.
|
||||
@param allocator The CFAllocatorRef to use for creating the pixel buffer. May be NULL.
|
||||
@param pool The CVDirect3DBufferPool that should create the new CVDirect3DBuffer.
|
||||
@param pixelBufferOut The newly created pixel buffer will be placed here
|
||||
@result Returns kCVReturnSuccess on success
|
||||
*/
|
||||
CV_EXPORT CVReturn CVDirect3DBufferPoolCreateDirect3DBuffer(CFAllocatorRef allocator,
|
||||
CVDirect3DBufferPoolRef pixelBufferPool,
|
||||
CVDirect3DBufferRef *pixelBufferOut);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* CVDirect3DTexture.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVDirect3DTexture.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@discussion A CoreVideo Texture derives from an ImageBuffer, and is used for supplying source image data to Direct3D.
|
||||
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO_CVDIRECT3DTEXTURE_H__)
|
||||
#define __COREVIDEO_CVDIRECT3DTEXTURE_H__ 1
|
||||
|
||||
#include <CVBase.h>
|
||||
#include <CVReturn.h>
|
||||
#include <CVImageBuffer.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#pragma mark CVDirect3DTexture
|
||||
|
||||
/*!
|
||||
@typedef CVDirect3DTextureRef
|
||||
@abstract Direct3D texture based image buffer
|
||||
|
||||
*/
|
||||
typedef CVImageBufferRef CVDirect3DTextureRef;
|
||||
|
||||
CV_EXPORT CFTypeID CVDirect3DTextureGetTypeID();
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureRetain
|
||||
@abstract Retains a CVDirect3DTexture object
|
||||
@discussion Equivalent to CFRetain, but NULL safe
|
||||
@param buffer A CVDirect3DTexture object that you want to retain.
|
||||
@result A CVDirect3DTexture object that is the same as the passed in buffer.
|
||||
*/
|
||||
CV_EXPORT CVDirect3DTextureRef CVDirect3DTextureRetain( CVDirect3DTextureRef texture );
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureRelease
|
||||
@abstract Releases a CVDirect3DTexture object
|
||||
@discussion Equivalent to CFRelease, but NULL safe
|
||||
@param buffer A CVDirect3DTexture object that you want to release.
|
||||
*/
|
||||
CV_EXPORT void CVDirect3DTextureRelease( CVDirect3DTextureRef texture );
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureGetName
|
||||
@abstract Returns the raw texture associated with the CVDirect3DTexture
|
||||
@param image Target CVDirect3DTexture
|
||||
@result an LPDIRECT3DTEXTURE9 pointing to the texture
|
||||
*/
|
||||
CV_EXPORT void* CVDirect3DTextureGetName( CVDirect3DTextureRef image);
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureIsFlipped
|
||||
@abstract Returns whether the image is flipped vertically or not.
|
||||
@param image Target CVDirect3DTexture
|
||||
@result True if 0,0 in the texture is upper left, false if 0,0 is lower left
|
||||
*/
|
||||
CV_EXPORT Boolean CVDirect3DTextureIsFlipped( CVDirect3DTextureRef image);
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureGetCleanTexCoords
|
||||
@abstract Returns convenient texture coordinates for the part of the image that should be displayed
|
||||
@discussion This function automatically takes into account whether or not the texture is flipped. It returns
|
||||
texture coordinate values from 0.0 to 1.0 ready for use in a Direct3D VertexBuffer.
|
||||
@param image Target CVDirect3DTexture
|
||||
@param lowerLeft - array of two floats where the s and t texture coordinates of the lower left corner of the image will be stored
|
||||
@param lowerRight - array of two floats where the s and t texture coordinates of the lower right corner of the image will be stored
|
||||
@param upperRight - array of two floats where the s and t texture coordinates of the upper right corner of the image will be stored
|
||||
@param upperLeft - array of two floats where the s and t texture coordinates of the upper right corner of the image will be stored
|
||||
*/
|
||||
CV_EXPORT void CVDirect3DTextureGetCleanTexCoords( CVDirect3DTextureRef image,
|
||||
float lowerLeft[2],
|
||||
float lowerRight[2],
|
||||
float upperRight[2],
|
||||
float upperLeft[2]);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* CVDirect3DTextureCache.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO__CVDIRECT3DTEXTURECACHE_H__)
|
||||
#define __COREVIDEO__CVDIRECT3DTEXTURECACHE_H__ 1
|
||||
|
||||
#include <CVBase.h>
|
||||
#include <CVReturn.h>
|
||||
#include <CVBuffer.h>
|
||||
#include <CVDirect3DTexture.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@typedef CVDirect3DTextureCacheRef
|
||||
@abstract CoreVideo Direct3D Texture Cache
|
||||
|
||||
*/
|
||||
typedef struct __CVDirect3DTextureCache *CVDirect3DTextureCacheRef;
|
||||
|
||||
CV_EXPORT CFTypeID CVDirect3DTextureCacheGetTypeID();
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureCacheRetain
|
||||
@abstract Retains a CVDirect3DTextureCache object
|
||||
@discussion Equivalent to CFRetain, but NULL safe
|
||||
@param buffer A CVDirect3DTextureCache object that you want to retain.
|
||||
@result A CVDirect3DTextureCache object that is the same as the passed in buffer.
|
||||
*/
|
||||
CV_EXPORT CVDirect3DTextureCacheRef CVDirect3DTextureCacheRetain( CVDirect3DTextureCacheRef textureCache ); // NULL-safe
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureCacheRelease
|
||||
@abstract Releases a CVDirect3DTextureCache object
|
||||
@discussion Equivalent to CFRelease, but NULL safe
|
||||
@param buffer A CVDirect3DTextureCache object that you want to release.
|
||||
*/
|
||||
CV_EXPORT void CVDirect3DTextureCacheRelease( CVDirect3DTextureCacheRef textureCache ); // NULL-safe
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureCacheCreate
|
||||
@abstract Creates a new Texture Cache.
|
||||
@param allocator The CFAllocatorRef to use for allocating the cache. May be NULL.
|
||||
@param cacheAttributes A CFDictionaryRef containing the attributes of the cache itself. May be NULL.
|
||||
@param cglContext The D3D context into which the texture objects will be created
|
||||
@param cglPixelFormat The D3D pixel format object used to create the passed in D3D context
|
||||
@param textureAttributes A CFDictionaryRef containing the attributes to be used for creating the CVDirect3DTexture objects. May be NULL.
|
||||
@param cacheOut The newly created texture cache will be placed here
|
||||
@result Returns kCVReturnSuccess on success
|
||||
*/
|
||||
CV_EXPORT CVReturn CVDirect3DTextureCacheCreate(
|
||||
CFAllocatorRef allocator,
|
||||
CFDictionaryRef cacheAttributes,
|
||||
void *d3dDevice, /*CVDIRECT3DDEVICE*/
|
||||
UInt32 d3dFormat, /*D3DFORMAT*/
|
||||
CFDictionaryRef textureAttributes,
|
||||
CVDirect3DTextureCacheRef *cacheOut);
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureCacheCreateTextureFromImage
|
||||
@abstract Creates a CVDirect3DTexture object from an existing CVImageBuffer
|
||||
@param allocator The CFAllocatorRef to use for allocating the CVDirect3DTexture object. May be NULL.
|
||||
@param sourceImage The CVImageBuffer that you want to create a CVDirect3DTexture from.
|
||||
@param attribuse The desired buffer attributes for the CVDirect3DTexture.
|
||||
@param textureOut The newly created texture object will be placed here.
|
||||
@result Returns kCVReturnSuccess on success
|
||||
*/
|
||||
CV_EXPORT CVReturn CVDirect3DTextureCacheCreateTextureFromImage(CFAllocatorRef allocator,
|
||||
CVDirect3DTextureCacheRef textureCache,
|
||||
CVImageBufferRef sourceImage,
|
||||
CFDictionaryRef *attribs,
|
||||
CVDirect3DTextureRef *textureOut);
|
||||
|
||||
/*!
|
||||
@function CVDirect3DTextureCacheFlush
|
||||
@abstract Performs internal housekeeping/recycling operations
|
||||
@discussion This call must be made periodically to give the texture cache a chance to make D3D calls
|
||||
on the Direct3D context used to create it in order to do housekeeping operations.
|
||||
@param textureCache The texture cache object to flush
|
||||
@param options Currently unused, set to 0.
|
||||
@result Returns kCVReturnSuccess on success
|
||||
*/
|
||||
CV_EXPORT void CVDirect3DTextureCacheFlush(CVDirect3DTextureCacheRef textureCache, CVOptionFlags options);
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* CVHostTime.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVHostTime.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@availability Mac OS X 10.4 or later
|
||||
@discussion Utility functions for retrieving and working with the host time.
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO_CVHOSTTIME_H__)
|
||||
#define __COREVIDEO_CVHOSTTIME_H__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#include <QuartzCore/CVBase.h>
|
||||
#else
|
||||
#include <CVBase.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
@function CVGetCurrentHostTime
|
||||
@abstract Retrieve the current value of the host time base.
|
||||
@discussion On Mac OS X, the host time base for CoreVideo and CoreAudio are identical, and the values returned from either API
|
||||
may be used interchangeably.
|
||||
@result The current host time.
|
||||
*/
|
||||
extern uint64_t CVGetCurrentHostTime() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVGetHostClockFrequency
|
||||
@abstract Retrieve the frequency of the host time base.
|
||||
@discussion On Mac OS X, the host time base for CoreVideo and CoreAudio are identical, and the values returned from either API
|
||||
may be used interchangeably.
|
||||
@result The current host frequency.
|
||||
*/
|
||||
extern double CVGetHostClockFrequency() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVGetHostClockMinimumTimeDelta
|
||||
@abstract Retrieve the smallest possible increment in the host time base.
|
||||
@result The smallest valid increment in the host time base.
|
||||
*/
|
||||
extern uint32_t CVGetHostClockMinimumTimeDelta() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* CVImageBuffer.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVImageBuffer.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@availability Mac OS X 10.4 or later
|
||||
@discussion CVImageBufferRef types are abstract and define various attachments and convenience
|
||||
calls for retreiving image related bits of data.
|
||||
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO_CVIMAGEBUFFER_H__)
|
||||
#define __COREVIDEO_CVIMAGEBUFFER_H__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include <QuartzCore/CVBuffer.h>
|
||||
#else
|
||||
#pragma warning (disable: 4068) // ignore unknown pragmas
|
||||
#include <CVBuffer.h>
|
||||
#include <CGGeometry.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#pragma mark CVImageBufferRef attachment keys
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
CV_EXPORT const CFStringRef kCVImageBufferCGColorSpaceKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CGColorSpaceRef
|
||||
|
||||
CV_EXPORT const CFStringRef kCVImageBufferCleanApertureKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFDictionary containing the following four keys
|
||||
CV_EXPORT const CFStringRef kCVImageBufferCleanApertureWidthKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVImageBufferCleanApertureHeightKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVImageBufferCleanApertureHorizontalOffsetKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVImageBufferCleanApertureVerticalOffsetKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVImageBufferPreferredCleanApertureKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFDictionary containing same keys as kCVImageBufferCleanApertureKey
|
||||
|
||||
CV_EXPORT const CFStringRef kCVImageBufferFieldCountKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVImageBufferFieldDetailKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString with one of the following four values
|
||||
CV_EXPORT const CFStringRef kCVImageBufferFieldDetailTemporalTopFirst AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString
|
||||
CV_EXPORT const CFStringRef kCVImageBufferFieldDetailTemporalBottomFirst AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString
|
||||
CV_EXPORT const CFStringRef kCVImageBufferFieldDetailSpatialFirstLineEarly AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString
|
||||
CV_EXPORT const CFStringRef kCVImageBufferFieldDetailSpatialFirstLineLate AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString
|
||||
|
||||
CV_EXPORT const CFStringRef kCVImageBufferPixelAspectRatioKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFDictionary with the following two keys
|
||||
CV_EXPORT const CFStringRef kCVImageBufferPixelAspectRatioHorizontalSpacingKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVImageBufferPixelAspectRatioVerticalSpacingKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
|
||||
CV_EXPORT const CFStringRef kCVImageBufferDisplayDimensionsKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFDictionary with the following two keys
|
||||
CV_EXPORT const CFStringRef kCVImageBufferDisplayWidthKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVImageBufferDisplayHeightKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
|
||||
CV_EXPORT const CFStringRef kCVImageBufferGammaLevelKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber describing the gamma level
|
||||
CV_EXPORT const CFStringRef kCVImageBufferYCbCrMatrixKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString describing the color matrix for YCbCr->RGB. This key can be one of the following values:
|
||||
CV_EXPORT const CFStringRef kCVImageBufferYCbCrMatrix_ITU_R_709_2 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString
|
||||
CV_EXPORT const CFStringRef kCVImageBufferYCbCrMatrix_ITU_R_601_4 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString
|
||||
CV_EXPORT const CFStringRef kCVImageBufferYCbCrMatrix_SMPTE_240M_1995 AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFString
|
||||
|
||||
#else
|
||||
#define kCVImageBufferCGColorSpaceKey CFSTR("CGColorSpace")
|
||||
|
||||
#define kCVImageBufferCleanApertureKey CFSTR("CVCleanAperture")
|
||||
#define kCVImageBufferCleanApertureWidthKey CFSTR("Width")
|
||||
#define kCVImageBufferCleanApertureHeightKey CFSTR("Height")
|
||||
#define kCVImageBufferCleanApertureHorizontalOffsetKey CFSTR("HorizontalOffset")
|
||||
#define kCVImageBufferCleanApertureVerticalOffsetKey CFSTR("VerticalOffset")
|
||||
#define kCVImageBufferPreferredCleanApertureKey CFSTR("CVPreferredCleanAperture")
|
||||
|
||||
#define kCVImageBufferFieldCountKey CFSTR("CVFieldCount")
|
||||
#define kCVImageBufferFieldDetailKey CFSTR("CVFieldDetail")
|
||||
#define kCVImageBufferFieldDetailTemporalTopFirst CFSTR("TemporalTopFirst")
|
||||
#define kCVImageBufferFieldDetailTemporalBottomFirst CFSTR("TemporalBottomFirst")
|
||||
#define kCVImageBufferFieldDetailSpatialFirstLineEarly CFSTR("SpatialFirstLineEarly")
|
||||
#define kCVImageBufferFieldDetailSpatialFirstLineLate CFSTR("SpatialFirstLineLate")
|
||||
|
||||
#define kCVImageBufferPixelAspectRatioKey CFSTR("CVPixelAspectRatio")
|
||||
#define kCVImageBufferPixelAspectRatioHorizontalSpacingKey CFSTR("HorizontalSpacing")
|
||||
#define kCVImageBufferPixelAspectRatioVerticalSpacingKey CFSTR("VerticalSpacing")
|
||||
|
||||
#define kCVImageBufferDisplayDimensionsKey CFSTR("CVDisplayDimensions")
|
||||
#define kCVImageBufferDisplayWidthKey CFSTR("Width")
|
||||
#define kCVImageBufferDisplayHeightKey CFSTR("Height")
|
||||
|
||||
|
||||
#define kCVImageBufferGammaLevelKey CFSTR("CVImageBufferGammaLevel")
|
||||
#define kCVImageBufferYCbCrMatrixKey CFSTR("CVImageBufferYCbCrMatrix")
|
||||
#define kCVImageBufferYCbCrMatrix_ITU_R_709_2 CFSTR("CVImageBufferYCbCrMatrix_ITU_R_709_2")
|
||||
#define kCVImageBufferYCbCrMatrix_ITU_R_601_4 CFSTR("CVImageBufferYCbCrMatrix_ITU_R_601_4")
|
||||
#define kCVImageBufferYCbCrMatrix_SMPTE_240M_1995 CFSTR("CVImageBufferYCbCrMatrix_SMPTE_240M_1995")
|
||||
|
||||
#endif
|
||||
|
||||
#pragma mark CVImageBufferRef
|
||||
|
||||
/*!
|
||||
@typedef CVImageBufferRef
|
||||
@abstract Base type for all CoreVideo image buffers
|
||||
|
||||
*/
|
||||
typedef CVBufferRef CVImageBufferRef;
|
||||
|
||||
/*!
|
||||
@function CVImageBufferGetEncodedSize
|
||||
@abstract Returns the full encoded dimensions of a CVImageBuffer. For example, for an NTSC DV frame this would be 720x480
|
||||
@discussion Note: When creating a CIImage from a CVImageBuffer, this is the call you should use for retrieving the image size.
|
||||
@param imageBuffer A CVImageBuffer that you wish to retrieve the encoded size from.
|
||||
@result A CGSize returning the full encoded size of the buffer
|
||||
Returns zero size if called with a non-CVImageBufferRef type or NULL.
|
||||
*/
|
||||
CV_EXPORT CGSize CVImageBufferGetEncodedSize(CVImageBufferRef imageBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVImageBufferGetDisplaySize
|
||||
@abstract Returns the nominal output display size (in square pixels) of a CVImageBuffer.
|
||||
For example, for an NTSC DV frame this would be 640x480
|
||||
@param imageBuffer A CVImageBuffer that you wish to retrieve the display size from.
|
||||
@result A CGSize returning the nominal display size of the buffer
|
||||
Returns zero size if called with a non-CVImageBufferRef type or NULL.
|
||||
*/
|
||||
CV_EXPORT CGSize CVImageBufferGetDisplaySize(CVImageBufferRef imageBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVImageBufferGetCleanRect
|
||||
@abstract Returns the source rectangle of a CVImageBuffer that represents the clean aperture
|
||||
of the buffer in encoded pixels. For example, an NTSC DV frame would return a CGRect with an
|
||||
origin of 8,0 and a size of 704,480.
|
||||
Note that the origin of this rect always the lower left corner. This is the same coordinate system as
|
||||
used by CoreImage.
|
||||
@param imageBuffer A CVImageBuffer that you wish to retrieve the display size from.
|
||||
@result A CGSize returning the nominal display size of the buffer
|
||||
Returns zero rect if called with a non-CVImageBufferRef type or NULL.
|
||||
*/
|
||||
CV_EXPORT CGRect CVImageBufferGetCleanRect(CVImageBufferRef imageBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
/*!
|
||||
@function CVImageBufferGetColorSpace
|
||||
@abstract Returns the color space of a CVImageBuffer.
|
||||
@param imageBuffer A CVImageBuffer that you wish to retrieve the color space from.
|
||||
@result A CGColorSpaceRef representing the color space of the buffer.
|
||||
Returns NULL if called with a non-CVImageBufferRef type or NULL.
|
||||
*/
|
||||
CV_EXPORT CGColorSpaceRef CVImageBufferGetColorSpace(CVImageBufferRef imageBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
* CVPixelBuffer.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVPixelBuffer.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@availability Mac OS X 10.4 or later
|
||||
@discussion CVPixelBuffers are CVImageBuffers that hold the pixels in main memory
|
||||
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO_CVPIXELBUFFER_H__)
|
||||
#define __COREVIDEO_CVPIXELBUFFER_H__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#include <QuartzCore/CVImageBuffer.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#else
|
||||
#pragma warning (disable: 4068) // ignore unknown pragmas
|
||||
#include <CVImageBuffer.h>
|
||||
#include <CFArray.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#pragma mark BufferAttributeKeys
|
||||
#if TARGET_OS_MAC
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferPixelFormatTypeKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // A single CFNumber or a CFArray of CFNumbers (OSTypes)
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferMemoryAllocatorKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFAllocatorRef
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferWidthKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferHeightKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferExtendedPixelsLeftKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferExtendedPixelsTopKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferExtendedPixelsRightKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferExtendedPixelsBottomKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferBytesPerRowAlignmentKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFNumber
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferCGBitmapContextCompatibilityKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFBoolean
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferCGImageCompatibilityKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFBoolean
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferOpenGLCompatibilityKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // CFBoolean
|
||||
#else
|
||||
#define kCVPixelBufferPixelFormatTypeKey CFSTR("PixelFormatType")
|
||||
#define kCVPixelBufferMemoryAllocatorKey CFSTR("MemoryAllocator")
|
||||
#define kCVPixelBufferWidthKey CFSTR("Width")
|
||||
#define kCVPixelBufferHeightKey CFSTR("Height")
|
||||
#define kCVPixelBufferExtendedPixelsLeftKey CFSTR("ExtendedPixelsLeft")
|
||||
#define kCVPixelBufferExtendedPixelsTopKey CFSTR("ExtendedPixelsTop")
|
||||
#define kCVPixelBufferExtendedPixelsRightKey CFSTR("ExtendedPixelsRight")
|
||||
#define kCVPixelBufferExtendedPixelsBottomKey CFSTR("ExtendedPixelsBottom")
|
||||
#define kCVPixelBufferBytesPerRowAlignmentKey CFSTR("BytesPerRowAlignment")
|
||||
#define kCVPixelBufferCGBitmapContextCompatibilityKey CFSTR("CGBitmapContextCompatibility")
|
||||
#define kCVPixelBufferCGImageCompatibilityKey CFSTR("CGImageCompatibility")
|
||||
#define kCVPixelBufferOpenGLCompatibilityKey CFSTR("OpenGLCompatibility")
|
||||
#endif
|
||||
/*!
|
||||
@typedef CVPixelBufferRef
|
||||
@abstract Based on the image buffer type. The pixel buffer implements the memory storage for an image buffer.
|
||||
|
||||
*/
|
||||
typedef CVImageBufferRef CVPixelBufferRef;
|
||||
|
||||
CV_EXPORT CFTypeID CVPixelBufferGetTypeID() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferRetain
|
||||
@abstract Retains a CVPixelBuffer object
|
||||
@discussion Equivalent to CFRetain, but NULL safe
|
||||
@param buffer A CVPixelBuffer object that you want to retain.
|
||||
@result A CVPixelBuffer object that is the same as the passed in buffer.
|
||||
*/
|
||||
CV_EXPORT CVPixelBufferRef CVPixelBufferRetain( CVPixelBufferRef texture ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferRelease
|
||||
@abstract Releases a CVPixelBuffer object
|
||||
@discussion Equivalent to CFRelease, but NULL safe
|
||||
@param buffer A CVPixelBuffer object that you want to release.
|
||||
*/
|
||||
CV_EXPORT void CVPixelBufferRelease( CVPixelBufferRef texture ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferCreateResolvedAttributesDictionary
|
||||
@abstract Takes a CFArray of CFDictionary objects describing various pixel buffer attributes and tries to resolve them into a
|
||||
single dictionary.
|
||||
@discussion This is useful when you need to resolve multiple requirements between different potential clients of a buffer.
|
||||
@param attributes CFArray of CFDictionaries containing kCVPixelBuffer key/value pairs.
|
||||
@param resolvedDictionaryOut The resulting dictionary will be placed here.
|
||||
@result Return value that may be useful in discovering why resolution failed.
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferCreateResolvedAttributesDictionary(CFAllocatorRef allocator, CFArrayRef attributes, CFDictionaryRef *resolvedDictionaryOut) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferCreate
|
||||
@abstract Call to create a single PixelBuffer for a given size and pixelFormatType.
|
||||
@discussion Creates a single PixelBuffer for a given size and pixelFormatType. It allocates the necessary memory based on the pixel dimensions, pixelFormatType and extended pixels described in the pixelBufferAttributes. Not all parameters of the pixelBufferAttributes will be used here.
|
||||
@param width Width of the PixelBuffer in pixels.
|
||||
@param height Height of the PixelBuffer in pixels.
|
||||
@param pixelFormatType Pixel format indentified by its respective OSType.
|
||||
@param pixelBufferAttributes A dictionary with additonal attributes for a a pixel buffer. This parameter is optional. See PixelBufferAttributes for more details.
|
||||
@param pixelBufferOut The new pixel buffer will be returned here
|
||||
@result returns kCVReturnSuccess on success.
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferCreate(CFAllocatorRef allocator,
|
||||
size_t width,
|
||||
size_t height,
|
||||
OSType pixelFormatType,
|
||||
CFDictionaryRef pixelBufferAttributes,
|
||||
CVPixelBufferRef *pixelBufferOut) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
typedef void (*CVPixelBufferReleaseBytesCallback)( void *releaseRefCon, const void *baseAddress );
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferCreateWithBytes
|
||||
@abstract Call to create a single PixelBuffer for a given size and pixelFormatType based on a passed in piece of memory.
|
||||
@discussion Creates a single PixelBuffer for a given size and pixelFormatType. Not all parameters of the pixelBufferAttributes will be used here. It requires a release callback function that will be called, when the PixelBuffer gets destroyed so that the owner of the pixels can free the memory.
|
||||
@param width Width of the PixelBuffer in pixels
|
||||
@param height Height of the PixelBuffer in pixels
|
||||
@param pixelFormatType Pixel format indentified by its respective OSType.
|
||||
@param baseAddress Address of the memory storing the pixels.
|
||||
@param bytesPerRow Row bytes of the pixel storage memory.
|
||||
@param releaseCallback CVPixelBufferReleaseBytePointerCallback function that gets called when the PixelBuffer gets destroyed.
|
||||
@param releaseRefCon User data identifying the PixelBuffer for the release callback.
|
||||
@param pixelBufferAttributes A dictionary with additonal attributes for a a pixel buffer. This parameter is optional. See PixelBufferAttributes for more details.
|
||||
@param pixelBufferOut The new pixel buffer will be returned here
|
||||
@result returns kCVReturnSuccess on success.
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferCreateWithBytes(CFAllocatorRef allocator,
|
||||
size_t width,
|
||||
size_t height,
|
||||
OSType pixelFormatType,
|
||||
void *baseAddress,
|
||||
size_t bytesPerRow,
|
||||
CVPixelBufferReleaseBytesCallback releaseCallback,
|
||||
void *releaseRefCon,
|
||||
CFDictionaryRef pixelBufferAttributes,
|
||||
CVPixelBufferRef *pixelBufferOut) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
typedef void (*CVPixelBufferReleasePlanarBytesCallback)( void *releaseRefCon, const void *dataPtr, size_t dataSize, size_t numberOfPlanes, const void *planeAddresses[] );
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferCreateWithPlanarBytes
|
||||
@abstract Call to create a single PixelBuffer in planar format for a given size and pixelFormatType based on a passed in piece of memory.
|
||||
@discussion Creates a single PixelBuffer for a given size and pixelFormatType. Not all parameters of the pixelBufferAttributes will be used here. It requires a release callback function that will be called, when the PixelBuffer gets destroyed so that the owner of the pixels can free the memory.
|
||||
@param width Width of the PixelBuffer in pixels
|
||||
@param height Height of the PixelBuffer in pixels
|
||||
@param pixelFormatType Pixel format indentified by its respective OSType.
|
||||
@param dataPtr Pass a pointer to a plane descriptor block, or NULL.
|
||||
@param dataSize pass size if planes are contiguous, NULL if not.
|
||||
@param numberOfPlanes Number of planes.
|
||||
@param planeBaseAddress Array of base addresses for the planes.
|
||||
@param planeWidth Array of plane widths.
|
||||
@param planeHeight Array of plane heights.
|
||||
@param planeBytesPerRow Array of plane bytesPerRow values.
|
||||
@param releaseCallback CVPixelBufferReleaseBytePointerCallback function that gets called when the PixelBuffer gets destroyed.
|
||||
@param releaseRefCon User data identifying the PixelBuffer for the release callback.
|
||||
@param pixelBufferAttributes A dictionary with additonal attributes for a a pixel buffer. This parameter is optional. See PixelBufferAttributes for more details.
|
||||
@param pixelBufferOut The new pixel buffer will be returned here
|
||||
@result returns kCVReturnSuccess on success.
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferCreateWithPlanarBytes(CFAllocatorRef allocator,
|
||||
size_t width,
|
||||
size_t height,
|
||||
OSType pixelFormatType,
|
||||
void *dataPtr, // pass a pointer to a plane descriptor block, or NULL
|
||||
size_t dataSize, // pass size if planes are contiguous, NULL if not
|
||||
size_t numberOfPlanes,
|
||||
void *planeBaseAddress[],
|
||||
size_t planeWidth[],
|
||||
size_t planeHeight[],
|
||||
size_t planeBytesPerRow[],
|
||||
CVPixelBufferReleasePlanarBytesCallback releaseCallback,
|
||||
void *releaseRefCon,
|
||||
CFDictionaryRef pixelBufferAttributes,
|
||||
CVPixelBufferRef *pixelBufferOut) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferLockBaseAddress
|
||||
@abstract Description Locks the BaseAddress of the PixelBuffer to ensure that the is available.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@param lockFlags No options currently defined, pass 0.
|
||||
@result kCVReturnSuccess if the lock succeeded, or error code on failure
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferLockBaseAddress(CVPixelBufferRef pixelBuffer, CVOptionFlags lockFlags) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferUnlockBaseAddress
|
||||
@abstract Description Unlocks the BaseAddress of the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@param unlockFlags No options currently defined, pass 0.
|
||||
@result kCVReturnSuccess if the unlock succeeded, or error code on failure
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferUnlockBaseAddress(CVPixelBufferRef pixelBuffer, CVOptionFlags unlockFlags) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetWidth
|
||||
@abstract Returns the width of the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@result Width in pixels.
|
||||
*/
|
||||
CV_EXPORT size_t CVPixelBufferGetWidth(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetHeight
|
||||
@abstract Returns the height of the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@result Height in pixels.
|
||||
*/
|
||||
CV_EXPORT size_t CVPixelBufferGetHeight(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetPixelFormatType
|
||||
@abstract Returns the PixelFormatType of the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@result OSType identifying the pixel format by its type.
|
||||
*/
|
||||
CV_EXPORT OSType CVPixelBufferGetPixelFormatType(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetBaseAddress
|
||||
@abstract Returns the base address of the PixelBuffer.
|
||||
@discussion Retrieving the base address for a PixelBuffer requires that the buffer base address be locked
|
||||
via a successful call to CVPixelBufferLockBaseAddress.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@result Base address of the pixels.
|
||||
For chunky buffers, this will return a pointer to the pixel at 0,0 in the buffer
|
||||
For planar buffers this will return a pointer to a PlanarComponentInfo struct (defined in QuickTime).
|
||||
*/
|
||||
CV_EXPORT void *CVPixelBufferGetBaseAddress(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetBytesPerRow
|
||||
@abstract Returns the rowBytes of the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@result Bytes per row of the image data. For planar buffers this will return a rowBytes value such that bytesPerRow * height
|
||||
will cover the entire image including all planes.
|
||||
*/
|
||||
CV_EXPORT size_t CVPixelBufferGetBytesPerRow(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetDataSize
|
||||
@abstract Returns the data size for contigous planes of the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@result Data size used in CVPixelBufferCreateWithPlanarBytes.
|
||||
*/
|
||||
CV_EXPORT size_t CVPixelBufferGetDataSize(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferIsPlanar
|
||||
@abstract Returns if the PixelBuffer is planar.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@result True if the PixelBuffer was created using CVPixelBufferCreateWithPlanarBytes.
|
||||
*/
|
||||
CV_EXPORT Boolean CVPixelBufferIsPlanar(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetPlaneCount
|
||||
@abstract Returns number of planes of the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@result Number of planes. Returns 0 for non-planar CVPixelBufferRefs.
|
||||
*/
|
||||
CV_EXPORT size_t CVPixelBufferGetPlaneCount(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetWidthOfPlane
|
||||
@abstract Returns the width of the plane at planeIndex in the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@param planeIndex Identifying the plane.
|
||||
@result Width in pixels, or 0 for non-planar CVPixelBufferRefs.
|
||||
*/
|
||||
CV_EXPORT size_t CVPixelBufferGetWidthOfPlane(CVPixelBufferRef pixelBuffer, size_t planeIndex) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetHeightOfPlane
|
||||
@abstract Returns the height of the plane at planeIndex in the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@param planeIndex Identifying the plane.
|
||||
@result Height in pixels, or 0 for non-planar CVPixelBufferRefs.
|
||||
*/
|
||||
CV_EXPORT size_t CVPixelBufferGetHeightOfPlane(CVPixelBufferRef pixelBuffer, size_t planeIndex) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetBaseAddressOfPlane
|
||||
@abstract Returns the base address of the plane at planeIndex in the PixelBuffer.
|
||||
@discussion Retrieving the base address for a PixelBuffer requires that the buffer base address be locked
|
||||
via a successful call to CVPixelBufferLockBaseAddress.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@param planeIndex Identifying the plane.
|
||||
@result Base address of the plane, or NULL for non-planar CVPixelBufferRefs.
|
||||
*/
|
||||
CV_EXPORT void *CVPixelBufferGetBaseAddressOfPlane(CVPixelBufferRef pixelBuffer, size_t planeIndex) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetBytesPerRowOfPlane
|
||||
@abstract Returns the row bytes of the plane at planeIndex in the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@param planeIndex Identifying the plane.
|
||||
@result Row bytes of the plane, or NULL for non-planar CVPixelBufferRefs.
|
||||
*/
|
||||
CV_EXPORT size_t CVPixelBufferGetBytesPerRowOfPlane(CVPixelBufferRef pixelBuffer, size_t planeIndex) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferGetExtendedPixels
|
||||
@abstract Returns the size of extended pixels of the PixelBuffer.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
@param extraColumnsOnLeft Returns the pixel row padding to the left. May be NULL.
|
||||
@param extraRowsOnTop Returns the pixel row padding to the top. May be NULL.
|
||||
@param extraColumnsOnRight Returns the pixel row padding to the right. May be NULL.
|
||||
@param extraRowsOnBottom Returns the pixel row padding to the bottom. May be NULL.
|
||||
*/
|
||||
CV_EXPORT void CVPixelBufferGetExtendedPixels(CVPixelBufferRef pixelBuffer,
|
||||
size_t *extraColumnsOnLeft,
|
||||
size_t *extraColumnsOnRight,
|
||||
size_t *extraRowsOnTop,
|
||||
size_t *extraRowsOnBottom) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferFillExtendedPixels
|
||||
@abstract Fills the extended pixels of the PixelBuffer with Zero. This function replicates edge pixels to fill the entire extended region of the image.
|
||||
@param pixelBuffer Target PixelBuffer.
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferFillExtendedPixels(CVPixelBufferRef pixelBuffer) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* CVPixelBufferPool.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVPixelBufferPool.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@availability Mac OS X 10.4 or later
|
||||
@discussion CVPixelBufferPool is a utility object for managing a set of CVPixelBuffer objects that are going to be recycled.
|
||||
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO__CVPIXELBUFFERPOOL_H__)
|
||||
#define __COREVIDEO__CVPIXELBUFFERPOOL_H__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#include <QuartzCore/CVBase.h>
|
||||
#include <QuartzCore/CVReturn.h>
|
||||
#include <QuartzCore/CVPixelBuffer.h>
|
||||
#else
|
||||
#include <CVBase.h>
|
||||
#include <CVReturn.h>
|
||||
#include <CVPixelBuffer.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct __CVPixelBufferPool *CVPixelBufferPoolRef;
|
||||
|
||||
// By default, buffers will age out after one second. If required, setting an age of zero will disable
|
||||
// the age-out mechanism completely.
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferPoolMinimumBufferCountKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelBufferPoolMaximumBufferAgeKey AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
#else
|
||||
#define kCVPixelBufferPoolMinimumBufferCountKey CFSTR("MinimumBufferCount")
|
||||
#define kCVPixelBufferPoolMaximumBufferAgeKey CFSTR("MaximumBufferAge")
|
||||
#endif
|
||||
|
||||
CV_EXPORT CFTypeID CVPixelBufferPoolGetTypeID() AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferPoolRetain
|
||||
@abstract Retains a CVPixelBufferPoolRef object
|
||||
@discussion Equivalent to CFRetain, but NULL safe
|
||||
@param buffer A CVPixelBufferPoolRef object that you want to retain.
|
||||
@result A CVPixelBufferPoolRef object that is the same as the passed in buffer.
|
||||
*/
|
||||
CV_EXPORT CVPixelBufferPoolRef CVPixelBufferPoolRetain( CVPixelBufferPoolRef pixelBufferPool ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // NULL-safe
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferPoolRelease
|
||||
@abstract Releases a CVPixelBufferPoolRef object
|
||||
@discussion Equivalent to CFRelease, but NULL safe
|
||||
@param buffer A CVPixelBufferPoolRef object that you want to release.
|
||||
*/
|
||||
CV_EXPORT void CVPixelBufferPoolRelease( CVPixelBufferPoolRef pixelBufferPool ) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER; // NULL-safe
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferPoolCreate
|
||||
@abstract Creates a new Pixel Buffer pool.
|
||||
@param allocator The CFAllocatorRef to use for allocating this buffer pool. May be NULL.
|
||||
@param attributes A CFDictionaryRef containing the attributes to be used for creating new PixelBuffers within the pool.
|
||||
@param poolOut The newly created pool will be placed here
|
||||
@result Returns kCVReturnSuccess on success
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferPoolCreate(CFAllocatorRef allocator,
|
||||
CFDictionaryRef poolAttributes,
|
||||
CFDictionaryRef pixelBufferAttributes,
|
||||
CVPixelBufferPoolRef *poolOut) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferPoolGetAttributes
|
||||
@abstract Returns the pool attributes dictionary for a CVPixelBufferPool
|
||||
@param pool The CVPixelBufferPoolRef to retrieve the attributes from
|
||||
@result Returns the pool attributes dictionary, or NULL on failure.
|
||||
*/
|
||||
CV_EXPORT CFDictionaryRef CVPixelBufferPoolGetAttributes(CVPixelBufferPoolRef pool) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferPoolGetPixelBufferAttributes
|
||||
@abstract Returns the attributes of pixel buffers that will be created from this pool.
|
||||
@discussion This function is provided for those cases where you may need to know some information about the buffers that
|
||||
will be created up front.
|
||||
@param pool The CVPixelBufferPoolRef to retrieve the attributes from
|
||||
@result Returns the pixel buffer attributes dictionary, or NULL on failure.
|
||||
*/
|
||||
CV_EXPORT CFDictionaryRef CVPixelBufferPoolGetPixelBufferAttributes(CVPixelBufferPoolRef pool) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/*!
|
||||
@function CVPixelBufferPoolCreatePixelBuffer
|
||||
@abstract Creates a new PixelBuffer object from the pool.
|
||||
@discussion The function creates a new (attachment-free) CVPixelBuffer using the pixel buffer attributes specifed during pool creation.
|
||||
@param allocator The CFAllocatorRef to use for creating the pixel buffer. May be NULL.
|
||||
@param pool The CVPixelBufferPool that should create the new CVPixelBuffer.
|
||||
@param pixelBufferOut The newly created pixel buffer will be placed here
|
||||
@result Returns kCVReturnSuccess on success
|
||||
*/
|
||||
CV_EXPORT CVReturn CVPixelBufferPoolCreatePixelBuffer(CFAllocatorRef allocator,
|
||||
CVPixelBufferPoolRef pixelBufferPool,
|
||||
CVPixelBufferRef *pixelBufferOut) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,154 @@
|
||||
/*
|
||||
* CVPixelFormatDescription.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO_CVPIXELFORMATDESCRIPTION_H__)
|
||||
#define __COREVIDEO_CVPIXELFORMATDESCRIPTION_H__
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#include <QuartzCore/CoreVideo.h>
|
||||
#include <CoreFoundation/CFDictionary.h>
|
||||
#include <CoreFoundation/CFArray.h>
|
||||
#else
|
||||
#include <CoreVideo.h>
|
||||
#include <CFDictionary.h>
|
||||
#include <CFArray.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* This document is influenced by Ice Floe #19: http://developer.apple.com/quicktime/icefloe/dispatch019.html */
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
/* The canonical name for the format. This should bethe same as the codec name you'd use in QT */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatName AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* QuickTime/QuickDraw Pixel Format Type constant (OSType) */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatConstant AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* This is the codec type constant, i.e. '2vuy' or k422YpCbCr8CodecType */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatCodecType AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* This is the equivalent Microsoft FourCC code for this pixel format */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatFourCC AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* All buffers have one or more image planes. Each plane may contain a single or an interleaved set of components */
|
||||
/* For simplicity sake, pixel formats that are not planar may place the required format keys at the top
|
||||
level dictionary. */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatPlanes AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* The following keys describe the requirements/layout of a a single image plane. */
|
||||
|
||||
/* Used to assist with allocating memory for pixel formats that don't have an integer value for
|
||||
bytes per pixel */
|
||||
/* Block width is essentially the width in pixels of the smallest "byte addressable" group of pixels */
|
||||
/* This works in close conjunction with BitsPerBlock */
|
||||
/* Examples:
|
||||
8-bit luminance only, BlockWidth would be 1, BitsPerBlock would be 8
|
||||
16-bit 1555 RGB, BlockWidth would be 1, BitsPerBlock would be 16
|
||||
32-bit 8888 ARGB, BlockWidth would be 1, BitsPerBlock would be 32
|
||||
2vuy (CbYCrY), BlockWidth would be 2, BitsPerBlock would be 32
|
||||
1-bit bitmap, BlockWidth would be 8, BitsPerBlock would be 8
|
||||
v210, BlockWidth would be 6, BitsPerBlock would be 128 */
|
||||
/* Values assumed to 1 be one if not present */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatBlockWidth AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatBlockHeight AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* This value must be present. For simple pixel formats this will be equivalent to the traditional
|
||||
bitsPerPixel value. */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatBitsPerBlock AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* Used to state requirements on block multiples. v210 would be '8' here for the horizontal case,
|
||||
to match the standard v210 row alignment value of 48.
|
||||
These may be assumed as 1 if not present. */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatBlockHorizontalAlignment AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatBlockVerticalAlignment AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* Subsampling information for this plane. Assumed to be '1' if not present. */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatHorizontalSubsampling AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatVerticalSubsampling AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* If present, these two keys describe the OpenGL format and type enums you would use to describe this
|
||||
image plane to OpenGL */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatOpenGLFormat AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatOpenGLType AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatOpenGLInternalFormat AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* CGBitmapInfo value, if required */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatCGBitmapInfo AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* Pixel format compatibility flags */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatQDCompatibility AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatCGBitmapContextCompatibility AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatCGImageCompatibility AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatOpenGLCompatibility AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
#endif
|
||||
|
||||
/* This callback routine implements code to handle the functionality of CVPixelBufferFillExtendedPixels.
|
||||
For custom pixel formats where you will never need to use that call, this is not required. */
|
||||
typedef Boolean (*CVFillExtendedPixelsCallBack)( CVPixelBufferRef pixelBuffer, void *refCon);
|
||||
typedef struct {
|
||||
CFIndex version;
|
||||
CVFillExtendedPixelsCallBack fillCallBack;
|
||||
void *refCon;
|
||||
} CVFillExtendedPixelsCallBackData;
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
/* The value for this key is a CFData containing a CVFillExtendedPixelsCallBackData struct */
|
||||
CV_EXPORT const CFStringRef kCVPixelFormatFillExtendedPixelsCallback AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
#endif
|
||||
|
||||
/* Create a description of a pixel format from a provided OSType */
|
||||
CV_EXPORT CFDictionaryRef CVPixelFormatDescriptionCreateWithPixelFormatType(CFAllocatorRef allocator, OSType pixelFormat) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* Get an array containing all known pixel format description dictionaries */
|
||||
CV_EXPORT CFArrayRef CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes(CFAllocatorRef allocator) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
/* Register a new pixel format with CoreVideo */
|
||||
CV_EXPORT void CVPixelFormatDescriptionRegisterDescriptionWithPixelFormatType(CFDictionaryRef description, OSType pixelFormat) AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER;
|
||||
|
||||
#if TARGET_OS_WIN32
|
||||
#define kCVPixelFormatName CFSTR("Name")
|
||||
#define kCVPixelFormatName422YpCbCr8 CFSTR("Component Y'CbCr 8-bit 4:2:2")
|
||||
#define kCVPixelFormatName422YpCbCr10 CFSTR("Component Y'CbCr 10-bit 4:2:2")
|
||||
#define kCVPixelFormatConstant CFSTR("PixelFormat")
|
||||
#define kCVPixelFormatCodecType CFSTR("CodecType")
|
||||
#define kCVPixelFormatFourCC CFSTR("FourCC")
|
||||
#define kCVPixelFormatPlanes CFSTR("Planes")
|
||||
#define kCVPixelFormatComponents CFSTR("ComponentLayout")
|
||||
#define kCVPixelFormatBlockWidth CFSTR("BlockWidth")
|
||||
#define kCVPixelFormatBlockHeight CFSTR("BlockHeight")
|
||||
#define kCVPixelFormatBlockHorizontalAlignment CFSTR("BlockHorizontalAlignment")
|
||||
#define kCVPixelFormatBlockVerticalAlignment CFSTR("BlockVerticalAlignment")
|
||||
#define kCVPixelFormatBitsPerBlock CFSTR("BitsPerBlock")
|
||||
#define kCVPixelFormatHorizontalSubsampling CFSTR("HorizontalSubsampling")
|
||||
#define kCVPixelFormatVerticalSubsampling CFSTR("VerticalSubsampling")
|
||||
#define kCVPixelFormatOpenGLFormat CFSTR("OpenGLFormat")
|
||||
#define kCVPixelFormatOpenGLType CFSTR("OpenGLType")
|
||||
#define kCVPixelFormatOpenGLInternalFormat CFSTR("OpenGLInternalFormat")
|
||||
#define kCVPixelFormatDirect3DFormat CFSTR("D3DFormat")
|
||||
#define kCVPixelFormatDirect3DType CFSTR("D3DType")
|
||||
#define kCVPixelFormatDirect3DInternalFormat CFSTR("D3DInternalFormat")
|
||||
#define kCVPixelFormatQDCompatibility CFSTR("QDCompatibility")
|
||||
#define kCVPixelFormatCGBitmapContextCompatibility CFSTR("CGBitmapContextCompatibility")
|
||||
#define kCVPixelFormatCGImageCompatibility CFSTR("CGImageCompatibility")
|
||||
#define kCVPixelFormatOpenGLCompatibility CFSTR("OpenGLCompatibility")
|
||||
#define kCVPixelFormatDirect3DCompatibility CFSTR("Direct3DCompatibility")
|
||||
#define kCVPixelFormatCGBitmapInfo CFSTR("CGBitmapInfo")
|
||||
#define kCVPixelFormatFillExtendedPixelsCallback CFSTR("FillExtendedPixelsCallback")
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* CVReturn.h
|
||||
* CoreVideo
|
||||
*
|
||||
* Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
/*! @header CVReturn.h
|
||||
@copyright 2004 Apple Computer, Inc. All rights reserved.
|
||||
@availability Mac OS X 10.4 or later
|
||||
@discussion Here you can find all the CoreVideo specific error codes.
|
||||
|
||||
*/
|
||||
|
||||
#if !defined(__COREVIDEO_CVRETURN_H__)
|
||||
#define __COREVIDEO_CVRETURN_H__ 1
|
||||
|
||||
#include <TargetConditionals.h>
|
||||
|
||||
#if TARGET_OS_MAC
|
||||
#include <QuartzCore/CVBase.h>
|
||||
#else
|
||||
#include <CVBase.h>
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
/*!
|
||||
@enum CVReturn
|
||||
@abstract CoreVideo specific error codes
|
||||
|
||||
@constant kCVReturnSuccess Function executed successfully without errors.
|
||||
@constant kCVReturnFirst Placeholder to mark the beginning of the range of CVReturn codes.
|
||||
@constant kCVReturnLast Placeholder to mark the end of the range of CVReturn codes.
|
||||
|
||||
@constant kCVReturnInvalidArgument At least one of the arguments passed in is not valid. Either out of range or the wrong type.
|
||||
@constant kCVReturnAllocationFailed The allocation for a buffer or buffer pool failed. Most likely because of lack of resources.
|
||||
|
||||
@constant kCVReturnInvalidDisplay A CVDisplayLink cannot be created for the given DisplayRef.
|
||||
@constant kCVReturnDisplayLinkAlreadyRunning The CVDisplayLink is already started and running.
|
||||
@constant kCVReturnDisplayLinkNotRunning The CVDisplayLink has not been started.
|
||||
@constant kCVReturnDisplayLinkCallbacksNotSet The render and display callbacks or the output callback is not set. You have to set either the render/display pair or the single output callback.
|
||||
|
||||
@constant kCVReturnInvalidPixelFormat The requested pixelformat is not supported for the CVBuffer type.
|
||||
@constant kCVReturnInvalidSize The requested size (most likely too big) is not supported for the CVBuffer type.
|
||||
@constant kCVReturnInvalidPixelBufferAttributes A CVBuffer cannot be created with the given attributes.
|
||||
@constant kCVReturnPixelBufferNotOpenGLCompatible The Buffer cannot be used with OpenGL as either its size, pixelformat or attributes are not supported by OpenGL.
|
||||
|
||||
@constant kCVReturnPoolAllocationFailed The allocation for the buffer pool failed. Most likely because of lack of resources. Check if your parameters are in range.
|
||||
@constant kCVReturnInvalidPoolAttributes A CVBufferPool cannot be created with the given attributes.
|
||||
*/
|
||||
|
||||
enum _CVReturn
|
||||
{
|
||||
kCVReturnSuccess = 0,
|
||||
|
||||
kCVReturnFirst = -6660,
|
||||
|
||||
kCVReturnError = kCVReturnFirst,
|
||||
kCVReturnInvalidArgument = -6661,
|
||||
kCVReturnAllocationFailed = -6662,
|
||||
|
||||
// DisplayLink related errors
|
||||
kCVReturnInvalidDisplay = -6670,
|
||||
kCVReturnDisplayLinkAlreadyRunning = -6671,
|
||||
kCVReturnDisplayLinkNotRunning = -6672,
|
||||
kCVReturnDisplayLinkCallbacksNotSet = -6673,
|
||||
|
||||
// Buffer related errors
|
||||
kCVReturnInvalidPixelFormat = -6680,
|
||||
kCVReturnInvalidSize = -6681,
|
||||
kCVReturnInvalidPixelBufferAttributes = -6682,
|
||||
kCVReturnPixelBufferNotOpenGLCompatible = -6683,
|
||||
|
||||
// Buffer Pool related errors
|
||||
kCVReturnPoolAllocationFailed = -6690,
|
||||
kCVReturnInvalidPoolAttributes = -6691,
|
||||
|
||||
kCVReturnLast = -6699
|
||||
|
||||
};
|
||||
typedef int32_t CVReturn;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user