home *** CD-ROM | disk | FTP | other *** search
- /*
- File: PlfmType.h
-
- Contains: Platform-specific Types
-
- Written by: Vincent Lo
-
- Copyright: ⌐ 1993-94 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <35> 2/16/94 JA Add vanilla XMPPoint, XMPRect structs (cool
- methods moved into optional AltPoint.h.)
- <34> 2/15/94 Té fix 1143649 and some clean up
- <33> 2/7/94 JA Improved cleanliness 12 ways. (Just minor
- tweaks for Tiger Team cleanup.)
- <32> 2/3/94 JA Changed #include <SysEqu.h> to <LowMem.h>.
- Fixed XMPASLMQDGlobals to use
- LMGetCurrentA5.
- <31> 2/1/94 JA Added XMPDouble, XMPExtended. Added include
- of PlfmDef.h. Removed some obsolete unused
- typedefs.
- <30> 1/31/94 JA Moved QuickDraw.h "frame" fix to separate
- QDFix.h to allow for separate
- precompilation.
- <29> 1/26/94 RR Added XMPIdleFrequency
- <28> 1/21/94 CC Replaced XMPTimeStamp and kTimeUnknown with
- XMPChangeID and kXMPUnknownChange.
- <27> 1/21/94 CG Typedefed XMPContainerSuite.
- <26> 1/17/94 NP Removed XMPEventHandlerProcPtr.
- <25> 1/14/94 CC Added type XMPTimeStamp and constant
- kTimeUnknown.
- <24> 1/10/94 NP Redefined XMPIText.
- <23> 12/16/93 Té added typedef for XMPEditor
- <22> 12/10/93 CG Added typedef for XMPClassID.
- <21> 12/7/93 NP Added XMPASLMQDGlobals macro. Added
- kXMPFalse, kXMPTrue and kXMPNULL.
- <20> 12/3/93 Té moved definition of XMPIText from
- XMPTypes.h to here
- <19> 12/2/93 RR Added events to distinguish between click
- in border and click in embedded frame
- <18> 11/30/93 JA Added fix to keep QuickDraw.h from defining
- a "frame" constant (see details below.)
- <17> 11/23/93 VL Added prototype for global operator new.
- <16> 11/19/93 RR Added event contstants mouseDownEmbedded,
- mouseUpEmbedded, Menu and Window
- <15> 10/6/93 JA Moved XMPPoint to new "Point.h". Removed
- unused XMPRectangle.
- <14> 9/24/93 PH Make XMPPaltformType be XMPOSType
- <13> 9/16/93 CC Added XMPPlatformType╔void*, of course!
- <12> 9/16/93 JA Changed XMPPlatformShape to --you guessed
- it-- void*.
- <11> 9/15/93 RR Added XMPCommandID and XMPMenuItemID
- <10> 9/10/93 RR Updated definitions for menu types
- <9> 9/7/93 jpa Changed XMPPlatformTransform to a simple, tasteful void*.
- <8> 6/2/93 NP Synced with Prototype version.
- <7> 5/4/93 NP _PLFMTYPES_ -> _PLFMTYPE_
- <6> 4/29/93 VL 8.3 Name Change.
- <5> 4/28/93 Té add FindWindow partCode constants
- <4> 4/27/93 Té add event constants
- <3> 4/19/93 JBS change XMPShapeData to XMPPlatformShape
- <2> 4/15/93 VL Added XMPScriptCode for files.
- <1> 4/6/93 VL first checked in
-
- To Do:
- 1) What about Handle?
-
- In Progress:
- jpa Moved XMPFileRefNum here from NamSpace.h.
- Added #include of <stdlib.h>.
- */
-
- #ifndef _PLFMTYPE_
- #define _PLFMTYPE_
-
-
- // JPA: Moved QD fix to QDFix.h to allow precompilation of Toolbox headers w/o PlfmType.h.
-
- #ifndef __QDFIX__
- #include "QDFix.h"
- #endif
-
- #ifndef _PLFMDEF_
- #include "PlfmDef.h"
- #endif
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __FILES__
- #include <Files.h>
- #endif
-
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
- #ifndef __MENUS__
- #include <Menus.h>
- #endif
-
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
-
- #ifndef __AEREGISTRY_
- #include <AERegistry.h>
- #endif
-
- #ifndef __LIBRARYMANAGER__
- #include <LibraryManager.h>
- #endif
-
- #ifndef __LIBRARYMANAGERUTILITIES__
- #include <LibraryManagerUtilities.h>
- #endif
-
- #ifndef __LOWMEM__
- #include <LowMem.h> // New replacement for SysEqu.h
- #endif
-
- #include <stdlib.h> // For size_t type
-
- //==============================================================================
- // Classes used by this interface
- //==============================================================================
-
- class XMPPart;
-
- //==============================================================================
- // Scalar Types
- //==============================================================================
-
- // Primitive types
-
- typedef Boolean XMPBoolean; // boolean value. Do not count on its size.
- typedef unsigned char XMPUByte; // unsigned >= 8-bit value
- typedef char XMPSByte; // signed >= 8-bit value
- typedef unsigned short XMPUShort; // unsigned >= 16-bit value
- typedef short XMPSShort; // signed >= 16-bit value
- typedef unsigned long XMPULong; // unsigned >= 32-bit value
- typedef signed long XMPSLong; // signed >= 32-bit value
- typedef float XMPFloat; // Single precision (32-bit) floating point
- typedef double XMPDouble; // Double-precision (64-bit) floating point
- typedef extended XMPExtended; // Extended-precision (80 or 96-bit) FP
- typedef Fixed XMPFixed; // fixed-point (16.16) value
-
- typedef void* XMPPtr; // XMP pointer
- typedef XMPUByte* XMPRawPtr; // generic pointer
-
- // OS specific types
- //
- // The following typedefs are OS specific. They are put together in this file for the
- // time being. However, they can be put into separate files if desired. For example,
- // all the primitive types will be put in XMPPlatformMisc.h;
- // all graphics system types will be put in XMPPlatformGraphics.h;
- // all File system types will be put in XMPPlatformFiles.h; and so on.
- // The advantage of splitting them in separate files is the changing one type will not
- // require recompiling all the files which includea XMPTypes.h. Also, there may be a lot
- // of OS-specific types. If that's the case, we don't want them all in one file.
- //
-
- // Graphics system
-
- typedef Region XMPRegion;
- typedef RgnPtr XMPRgnPtr;
- typedef RgnHandle XMPRgnHandle;
- typedef void* XMPPlatformShape; // Graphics-system-dependent shape data
- typedef XMPFixed XMPCoordinate; // Graphics coordinates; 16.16 fixed by default
-
- typedef struct { XMPFixed m[3][3]; } XMPMatrix; // Transform matrix for translation, scaling,
- // skewing, rotation or any combination.
- // Same as "mapping" in QuickDraw GX.
- typedef void* XMPPlatformTransform; // Graphics-system-dependent transform data
-
- typedef XMPSShort XMPGraphicsSystem; // Type of graphics system
- const XMPGraphicsSystem kXMPQuickDraw = 1; // Macintosh QuickDraw graphics system
- const XMPGraphicsSystem kXMPQuickDrawGX = 2; // Macintosh QuickDraw GX graphics system
-
- // XMPPoint struct. We conditionalize this with a symbol, like the header files, to allow
- // alternate definitions to be included first; they can then #define _POINT_ to keep this one
- // from being defined here.
-
- #ifndef _POINT_
- #define _POINT_
-
- struct XMPPoint { // Fixed-point point.
- XMPCoordinate x, y; // Identical to "gxPoint" in QD GX.
- };
-
- #endif //_POINT_
-
- // XMPRect struct. We conditionalize this with a symbol, like the header files, to allow
- // alternate definitions to be included first; they can then #define _RECT_ to keep this one
- // from being defined here.
-
- #ifndef _RECT_
- #define _RECT_
-
- struct XMPRect {
- XMPCoordinate left, top, // Identical to "gxRect" in QD GX.
- right, bottom;
- };
-
- #endif //_RECT_
-
-
- // File System
-
- typedef FSSpec XMPFileSpec;
- typedef ScriptCode XMPScriptCode;
- typedef XMPSShort XMPFileRefNum;
-
-
- // Runtime
-
- typedef Handle XMPHandle;
-
- typedef TMemoryPool* XMPHeap;
-
- typedef ProcessSerialNumber XMPProcessID;
-
- typedef OSType XMPOSType;
-
- // Windows
-
- typedef WindowPtr XMPPlatformWindow;
- typedef GrafPtr XMPPlatformCanvas;
-
- // Events
-
- typedef XMPUShort XMPEventType;
- typedef EventRecord* XMPEventData;
- typedef XMPULong XMPIdleFrequency;
-
- // Menus
-
- typedef MenuHandle XMPPlatformMenu;
- typedef XMPSShort XMPMenuID;
- typedef XMPSShort XMPMenuItemID;
- typedef XMPSLong XMPCommandID;
- typedef Handle XMPPlatformMenuBar;
-
- // Text
-
- //typedef IntlText XMPIText;
- typedef struct
- {
- ScriptCode theScriptCode;
- LangCode theLangCode;
- XMPULong textLength;
- char theText[1];
- }
- XMPIText;
-
- // Semantic Interface
-
- typedef Handle XMPIcon;
- typedef Handle XMPSound;
-
- typedef AEDesc XMPObjectSpec;
-
-
- // Data Translation
-
- typedef XMPOSType XMPPlatformType; // Host platform file & data type
-
- typedef struct
- {
- char privates[76];
- long randSeed;
- BitMap screenBits;
- Cursor arrow;
- Pattern dkGray;
- Pattern ltGray;
- Pattern gray;
- Pattern black;
- Pattern white;
- GrafPtr thePort;
- }
- XMPQDGlobalRec;
-
-
- // Name Binding
-
- typedef const char* XMPEditor; // An opaque type identifying a specific part editor
- typedef const char* XMPContainerSuite; // An opaque type identifying a specific container suite
-
-
- // Data Interchange
-
- typedef XMPULong XMPChangeID; // Content change IDs
-
-
- //==============================================================================
- // Constants
- //==============================================================================
-
- #define kXMPNULL NULL
-
- const XMPBoolean kXMPFalse = 0;
- const XMPBoolean kXMPTrue = 1;
-
- const XMPMenuID kXMPAppleMenuID = 128;
- const XMPMenuID kXMPFileMenuID = 129;
- const XMPMenuID kXMPEditMenuID = 130;
- const XMPMenuID kXMPOCEFileMenuID = 193;
- const XMPOSType kXMPDASMenuRsrc = 0x44525652; // 'DRVR';
-
- const XMPChangeID kXMPUnknownChange = 0;
-
- enum {
- kXMPEvtNull = nullEvent
- ,kXMPEvtMouseDown = mouseDown
- ,kXMPEvtMouseUp = mouseUp
- ,kXMPEvtKeyDown = keyDown
- ,kXMPEvtKeyUp = keyUp
- ,kXMPEvtAutoKey = autoKey
- ,kXMPEvtUpdate = updateEvt
- ,kXMPEvtDisk = diskEvt
- ,kXMPEvtActivate = activateEvt
- ,kXMPEvtOS = osEvt
-
- // SHOULD THESE BE OFFICIAL TOOLBOX-DEFINED CONSTANTS?
-
- ,kXMPEvtMenu = 98
- ,kXMPEvtMouseDownEmbedded = 99 // A mouse-down in an embedded frame, or the active border
- // Sent to the container
- ,kXMPEvtMouseUpEmbedded = 100 // A mouse-up in an embedded frame, or the active border
- // Sent to the container
- ,kXMPEvtMouseDownBorder = 101 // A mouse-down in an embedded frame, or the active border
- // Sent to the container
- ,kXMPEvtMouseUpBorder = 102 // A mouse-up in an embedded frame, or the active border
- // Sent to the container
- ,kXMPEvtWindow = 103 // Used to offer events in title bar to root part
- // message contains partCode
- };
-
- enum {
- kXMPMDInDesk = inDesk
- ,kXMPMDInMenuBar = inMenuBar
- ,kXMPMDInSysWindow = inSysWindow
- ,kXMPMDInContent = inContent
- ,kXMPMDInDrag = inDrag
- ,kXMPMDInGrow = inGrow
- ,kXMPMDInGoAway = inGoAway
- ,kXMPMDInZoomIn = inZoomIn
- ,kXMPMDInZoomOut = inZoomOut
- };
-
- void* operator new(size_t size, XMPHeap heap);
-
- #define XMPASLMQDGlobals ( *(XMPQDGlobalRec*)( *(char**)LMGetCurrentA5() \
- - sizeof(XMPQDGlobalRec) + sizeof(GrafPtr) ) )
-
- #define ODVersionString "1.0.0a1"
-
- #endif // _PLFMTYPE_
-