Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 1 - Gestalt Manager


Summary of the Gestalt Manager

Pascal Summary

Constants

Environmental Selector Codes

CONST
   gestaltAddressingModeAttr     = 'addr';   {addressing-mode attributes}
   gestaltAliasMgrAttr           = 'alis';   {Alias Manager attributes}
   gestaltAppleEventsAttr        = 'evnt';   {Apple events attributes}
   gestaltAppleTalkVersion       = 'atlk';   {old format AppleTalk version}
   gestaltATalkVersion           = 'atkv'    {new format AppleTalk version}
   gestaltAUXVersion             = 'a/ux';   {A/UX version, if present}
   gestaltCFMAttr                = 'cfrg';   {Code Fragment Manager attr}
   gestaltCloseViewAttr          = 'BSDa';   {CloseView attributes}
   gestaltComponentMgr           = 'cpnt';   {Component Manager version}
   gestaltCompressionMgr         = 'icmp'    {Image Compression Manager }
                                             { version}
   gestaltConnMgrAttr            = 'conn';   {Connection Manager attributes}
   gestaltCRMAttr                = 'crm ';   {Communication Resource }
                                             { Manager attr}
   gestaltCTBVersion             = 'ctbv';   {Comm Toolbox version}
   gestaltDBAccessMgrAttr        = 'dbac';   {Data Access Manager attributes}
   gestaltDictionaryMgrAttr      = 'dict';   {Dictionary Manager attributes}
   gestaltDisplayMgrAttr         = 'dply';   {Display Manager attributes}
   gestaltDisplayMgrVers         = 'dplv';   {Display Manager version}
   gestaltDITLExtAttr            = 'ditl';   {Dialog Manager extensions}
   gestaltDragMgrAttr            = 'drag';   {Drag Manager attributes}
   gestaltEasyAccessAttr         = 'easy';   {Easy Access attributes}
   gestaltEditionMgrAttr         = 'edtn';   {Edition Manager attributes}
   gestaltExtToolboxTable        = 'xttt';   {Toolbox trap dispatch table}
   gestaltFinderAttr             = 'fndr'    {Finder attributes}
   gestaltFindFolderAttr         = 'fold';   {FindFolder attributes}
   gestaltFirstSlotNumber        = 'slt1';   {first physical slot}
   gestaltFontMgrAttr            = 'font';   {Font Manager attributes}
   gestaltFPUType                = 'fpu ';   {floating-point unit type}
   gestaltFSAttr                 = 'fs  ';   {file system attributes}
   gestaltFXfrMgrAttr            = 'fxfr';   {File Transfer Manager attr}
   gestaltHardwareAttr           = 'hdwr';   {hardware attributes}
   gestaltHelpMgrAttr            = 'help';   {Help Manager attributes}
   gestaltIconUtilitiesAttr      = 'icon';   {Icon Utilities attributes}
   gestaltKeyboardType           = 'kbd ';   {keyboard type code}
   gestaltLogicalPageSize        = 'pgsz';   {logical page size}
   gestaltLogicalRAMSize         = 'lram';   {logical RAM size}
   gestaltLowMemorySize          = 'lmem';   {size of low memory}
   gestaltMiscAttr               = 'misc';   {miscellaneous attributes}
   gestaltMixedModeVersion       = 'mixd';   {MixedMode version}
   gestaltMMUType                = 'mmu ';   {MMU type}
   gestaltNativeCPUtype          = 'cput';   {Native CPU type}
   gestaltNotificationMgrAttr    = 'nmgr';   {Notification Manager attr}
   gestaltNuBusConnectors        = 'sltc';   {NuBus connector bitmap}
   getstaltNuBusSlotCount        = 'nubs';   {count of logical NuBus slots}
   gestaltOSAttr                 = 'os  ';   {Operating System attributes}
   gestaltOSTable                = 'ostt';   {base address of Operating }
                                             { System trap dispatch table}
   gestaltParityAttr             = 'prty';   {parity attributes}
   gestaltPCXAttr                = 'pcxg';   {PC exchange attributes}
   gestaltPhysicalRAMSize        = 'ram ';   {physical RAM size}
   gestaltPopupAttr              = 'pop!';   {pop-up 'CDEF' attributes}
   gestaltPowerMgrAttr           = 'powr';   {Power Manager attributes}
   gestaltPPCToolboxAttr         = 'ppc ';   {PPC Toolbox attributes}
   gestaltProcessorType          = 'proc';   {microprocessor type code}
   gestaltQuickdrawFeatures      = 'qdrw';   {QuickDraw features}
   gestaltQuickdrawVersion       = 'qd  ';   {QuickDraw version}
   gestaltQuickTime              = 'qtim';   {QuickTime version}
   gestaltRealtimeAttr           = 'rtmr';   {Realtime Manager attributes}
   gestaltResourceMgrAttr        = 'rsrc';   {Resource Manager attributes}
   gestaltScrapMgrAttr           = 'scra';   {Scrap Manager attributes}
   gestaltScriptCount            = 'scr#';   {number of active script }
                                             { systems}
   gestaltScriptMgrVersion       = 'scri';   {Script Manager version}
   gestaltSerialAttr             = 'ser ';   {serial hardware attributes}
   gestaltSoundAttr              = 'snd ';   {sound attributes}
   gestaltSpeechAttr             = 'ttsc';   {Speech Manager attributes}
   gestaltStandardFileAttr       = 'stdf';   {Standard File attributes}
   gestaltStdNBPAttr             = 'nlup';   {StandardNBP attributes}
   gestaltSysArchitecture        = 'sysa';   {native system architecture}
   gestaltTEAttr                 = 'teat';   {TextEdit attributes}
   gestaltTermMgrAttr            = 'term';   {Terminal Manager attributes}
   gestaltTextEditVersion        = 'te  ';   {TextEdit version code}
   gestaltThreadMgrAtt           = 'thds';   {Thread Manager attributes}
   gestaltTimeMgrVersion         = 'tmgr';   {Time Manager version code}
   gestaltTranslationAttr        = 'xlat';   {Translation Manager attributes}
   gestaltTSMgrVersion           = 'tsmv';   {Text Services Manager version}
   gestaltToolboxTable           = 'tbtt';   {base address of Toolbox trap }
                                             { dispatch table}
   gestaltVersion                = 'vers';   {Gestalt version}
   gestaltVMAttr                 = 'vm  ';   {virtual memory attributes}

Informational Selector Codes

CONST
   gestaltHardwareAttr           = 'hdwr';   {hardware attributes}
   gestaltMachineIcon            = 'micn';   {machine 'ICON'/'cicn' res ID}
   gestaltMachineType            = 'mach';   {Macintosh model code}
   gestaltROMSize                = 'rom ';   {ROM size}
   gestaltROMVersion             = 'romv';   {ROM version}
   gestaltSystemVersion          = 'sysv';   {System file version number}

Environmental Selector Response Values

CONST
   {gestaltAddressingModeAttr response bits}
   gestalt32BitAddressing        = 0;        {booted in 32-bit mode}
   gestalt32BitSysZone           = 1;        {32-bit compatible system zone}
   gestalt32BitCapable           = 2;        {machine is 32-bit capable}
   {gestaltAliasMgrAttr response bits}
   gestaltAliasMgrPresent        = 0;        {Alias Manager is present}
   gestaltAliasMgrSupportsRemoteAppletalk    {Alias Manager knows about }
                                 = 1;        { remote AppleTalk}
   {gestaltAppleEventsAttr response bits}
   gestaltAppleEventsPresent     = 0;        {Apple events available}
   gestaltScriptingSupport       = 1;
   gestaltOSLInSystem            = 2;        {OSL in system}
   {gestaltATalkVersion release stage constants}
   development                   = $20;      {development}
   alpha                         = $40;      {alpha}
   beta                          = $60;      {beta}
   final                         = $80;      {final}
   release                       = $80;      {release}
   {gestaltCFMAttr response bits}
   gestaltsCFMPresent            = 0;     {Code Fragment Manager present}
   {gestaltCloseViewAttr response bits}
   gestaltCloseViewEnabled       = 0;     {CloseView enabled}
   gestaltCloseViewDisplayMgrFriendly
                                 = 1;     {CloseView compatible with }
                                          { Display Manger}
   {gestaltConnMgrAttr response bits}
   gestaltConnMgrPresent         = 0;     {Connection Manager present}
   gestaltConnMgrCMSearchFix     = 1;     {CMAddSearch fix present}
   gestaltConnMgrErrorString     = 2;     {has CMGetErrorString}
   gestaltConnMgrMultiAsyncIO    = 3;     {has CMNewIOPB, CMDisposeIOPB, }
                                          { CMPBRead, CMPBWrite,and }
                                          { CMPBIOKill}
   {gestaltCRMAttr response bits}
   gestaltCRMPresent             = 0;     {Communication Resource Manager }
                                          { present}
   gestaltCRMPersistentFix       = 1;     {fix for persistent tools}
   gestaltCRMToolRsrcCalls       = 2;     {tool resource calls available}
   {gestaltDBAccessMgrAttr response bits}
   gestaltDBAccessMgrPresent     = 0;        {Data Access Manager present}
   {gestaltDisplayMgrAttr response bits}
   gestaltDisplayMgrPresent      = 0;        {Display Manager Present}
   {gestaltDictionaryMgrAttr response bits}
   gestaltDictionaryMgrPresent   = 0;        {Dictionary Manager present}
   {gestaltDITLExtAttr response bits}
   gestaltDITLExtPresent         = 0;        {Dialog Manager extensions }
                                             { present}
   {gestaltDragMgrATtr response bits}
   gestaltDragMgrPresent         = 0;        {Drag Manager present}
   {gestaltEasyAccessAttr response bits}
   gestaltEasyAccessOff          = 0;        {Easy Access present but off}
   gestaltEasyAccessOn           = 1;        {Easy Access on}
   gestaltEasyAccessSticky       = 2;        {Easy Access sticky}
   gestaltEasyAccessLocked       = 3;        {Easy Access locked}
   {gestaltEditionMgrAttr response bits}
   gestaltEditionMgrPresent      = 0;        {Edition Manager present}
   gestaltEditionMgrTranslationAware         {Edition Manager aware of }
                                 = 1;        { Translation Manager}
   {gestaltFinderAttr response bits}
   gestaltFinderDropEvent        = 0;        {Finder recognizes drop event}
   gestaltFinderMagicPlacement   = 1;        {Finder supports magic icon }
                                             { placement}
   gestaltFinderCallsAEProcess   = 2;        {Finder calls }
                                             { AEProcessAppleEvent}
   gestaltFinderOSLCompliantFinder
                                 = 3;        {Finder is scriptable and }
                                             { recordable}
   getstaltFinderSupports4GBVolumes
                                 = 4;        {Finder handles 4GB volumes}
   getstaltFinderHandlesCFMFailures
                                 = 5;        {Finder handles Code Fragment }
                                             { Manager errors}
   getstaltFinderHasClippings    = 6;        {Finder supports Drag Manager }
                                             { cliping files}
   {gestaltFindFolderAttr response bits}
   gestaltFindFolderPresent      = 0;        {FindFolder available}
   {gestaltFontMgrAttr response values}
   gestaltOutlineFonts           = 0;        {outline fonts supported}
   {gestaltFPUType response values}
   gestaltNoFPU                  = 0;        {no FPU}
   gestalt68881                  = 1;        {Motorola 68881 FPU}
   gestalt68882                  = 2;        {Motorola 68882 FPU}
   gestalt68040FPU               = 3;        {built-in 68040 }
                                             { floating-point processing}
   {gestaltFSAttr response bits}
   gestaltFullExtFSDispatching   = 0;        {new HFSDispatch available}
   gestaltHasFSSpecCalls         = 1;        {has FSSpec calls}
   gestaltHasFileSystemManager   = 2;        {has File System Manager}
   gestaltHasFileSystemManager   = 3;        {supports dynamic loading}
   gestaltFSSupports4GBVols      = 4;        {supports 4 gigabyte volume}
   gestaltHasExtendedDiskInit    = 6;        {has extended disk }
                                             { initialization calls}
   {gestaltFXfrMgrAttr response bits}
   gestaltFXfrMgrPresent         = 0;        {File Transfer Manager present}
   gestaltFXfrMgrMultiFile       = 1;        {supports FTSend and FTReceive}
   gestaltFXfrMgrErrorString     = 2;        {supports FTGetErrorString}
   {gestaltHelpMgrAttr response bits}
   gestaltHelpMgrPresent         = 0;        {Help Manager present}
   {gestaltIconUtilitiesAttr response value}
   gestaltIconUtilitiePresents   = 0;        {Icon Utilities are present}
   {gestaltKeyboardType response values}
   gestaltMacKbd                 = 1;        {Macintosh}
   gestaltMacAndPad              = 2;        {Macintosh with keypad}
   gestaltMacPlusKbd             = 3;        {Macintosh Plus}
   gestaltExtADBKbd              = 4;        {extended ADB}
   gestaltStdADBKbd              = 5;        {standard ADB}
   gestaltPrtblADBKbd            = 6;        {Portable ADB}
   gestaltPrtblISOKbd            = 7;        {Portable ISO ADB}
   gestaltStdISOADBKbd           = 8;        {ISO standard ADB}
   gestaltExtISOADBKbd           = 9;        {ISO extended ADB}
   gestaltADBKbdII               = 10;       {ADB II}
   gestaltADBISOKbdII            = 11;       {ISO ADB II}
   gestaltPwrBookADBKbd          = 12;       {PowerBook ADB}
   gestaltPwrBookISOADBKbd       = 13;       {PowerBook ISO ADB}
   gestaltAppleAdjustKeypad      = 14;       {Adjustable Keypad}
   gestaltAppleAdjustADBKbd      = 15;       {Adjustable ADB}
   gestaltAppleAdjustISOKbd      = 16;       {Adjustable ISO}
   {gestaltMiscAttr response bits}
   gestaltScrollingThrottle      = 0;        {scrolling throttle is on}
   gestaltSquareMenuBar          = 2;        {menu bar is square}
   {gestaltMMUType response values}
   gestaltNoMMU                  = 0;        {no MMU}
   gestaltAMU                    = 1;        {Mac II address management unit}
   gestalt68851                  = 2;        {Motorola 68851 PMMU}
   gestalt68030MMU               = 3;        {built-in 68030 MMU}
   gestalt68040MMU               = 4;        {built-in 68040 MMU}
   gestaltEMMU1                  = 5;        {emulated MMU type 1}
   {gestaltNativeCPUtype response values}
   gestaltCPU68000               = $000;     {Macintosh 68000 CPU}
   gestaltCPU68010               = $001;     {Macintosh 68010 CPU}
   gestaltCPU68020               = $002;     {Macintosh 68020 CPU}
   gestaltCPU68030               = $003;     {Macintosh 68030 CPU}
   gestaltCPU68040               = $004;     {Macintosh 68040 CPU}
   gestaltCPU601                 = $101;     {PowerPC 601 CPU}
   {gestaltNotificationMgrAttr response bits}
   gestaltNotificationPresent    = 0;        {Notification Manager present}
   {gestaltOSAttr response bits}
   gestaltSysZoneGrowable        = 0;        {system heap can grow}
   gestaltLaunchCanReturn        = 1;        {can return from launch}
   gestaltLaunchFullFileSpec     = 2;        {LaunchApplication available}
   gestaltLaunchControl          = 3;        {Process Manager available}
   gestaltTempMemSupport         = 4;        {temporary memory support }
                                             { available}
   gestaltRealTempMemory         = 5;        {temporary memory handles are }
                                             { real}
   gestaltTempMemTracked         = 6;        {temporary memory handles are}
                                             { tracked}
   {gestaltParityAttr response bits}
   gestaltHasParityCapability    = 0;        {machine can check parity}
   gestaltParityEnabled          = 1;        {parity RAM is installed}
   {gestaltPCXAttr response bits}
   gestaltPCXHas8and16BitFat     = 0;        {PC exchange supports both }
                                             { 8 and 16 bit FATs}
   gestaltPCXHasProDOS           = 1;        {PC exchange supports ProDos}
   {gestaltPopupAttr response bits}
   gestaltPopupPresent           = 0;        {pop-up 'CDEF' is present}
   {gestaltPowerMgrAttr response bits}
   gestaltPMgrExists             = 0;        {Power Manager is present}
   gestaltPMgrCPUIdle            = 1;        {CPU can idle}
   gestaltPMgrSCC                = 2;        {Power Manager can stop SCC }
                                             { clock}
   gestaltPMgrSound              = 3;        {Power Manager can turn off }
                                             { sound power}
   gestaltPMgrDispatchExists     = 4;        {Power Manager dispatch exists}
   {gestaltPPCToolboxAttr response masks}
   gestaltPPCToolboxPresent      = $0000;    {PPC Toolbox is present; 
                                             { PPCInit has been called}
   gestaltPPCSupportsRealTime    = $1000;    {supports real-time delivery}
   gestaltPPCSupportsIncoming    = $0001;    {accepts sessions from remote }
                                             { computers}
   gestaltPPCSupportsOutGoing    = $0002;    {can initiate sessions with }
                                             { remote computers}
   {gestaltProcessorType response values}
   gestalt68000                  = 1;        {68000 microprocessor}
   gestalt68010                  = 2;        {68010 microprocessor}
   gestalt68020                  = 3;        {68020 microprocessor}
   gestalt68030                  = 4;        {68030 microprocessor}
   gestalt68040                  = 5;        {68040 microprocessor}
   {gestaltQuickdrawFeatures response bits}
   gestaltHasColor               = 0;        {Color QuickDraw present}
   gestaltHasDeepGWorlds         = 1;        {graphics worlds can be deeper }
                                             { than 1 bit}
   gestaltHasDirectPixMaps       = 2;        {PixMaps can be direct }
                                             { (16- or 32-bit)}
   gestaltHasGrayishTextOr       = 3;        {supports text mode }
                                             { grayishTextOr}
   gestaltSupportsMirroring      = 4;        {supports video mirroring }
                                             { using the Display Manager}
   {gestaltQuickdrawVersion response values}
   gestaltOriginalQD             = $000;     {original 1-bit QuickDraw}
   gestalt8BitQD                 = $100;     {8-bit QuickDraw}
   gestalt32BitQD                = $200;     {32-Bit QuickDraw vers. 1.0}
   gestalt32BitQD11              = $210;     {32-Bit QuickDraw vers. 1.1}
   gestalt32BitQD12              = $220;     {32-Bit QuickDraw vers. 1.2}
   gestalt32BitQD13              = $230;     {32-Bit QuickDraw vers. 1.3}
   {gestaltRealtimeAttr response bits}
   gestaltRealtimeMgrPresent     = 0;        {Realtime Manager present}
   {gestaltResourceMgrAttr response bits}
   gestaltPartialRsrcs           = 0;        {partial resources supported}
   {gestaltScrapMgrAttr response bits}
   gestaltScrapMgrTranslationAware
                                 = 0;        {aware of Translation Manager}
   gestaltTranslationMgrHintOrder
                                 = 1;        {hint order reversal present}
   {gestaltSerialAttr response bits}
   gestaltHasGPIaToDCDa          = 0;        {GPI connected to DCD on port A}
   gestaltHasGPIaToRTxCa         = 1;        {GPI connected to RTxC on }
                                             { port A}
   gestaltHasGPIaToDCDb          = 2;        {GPI connected to DCD on port B}
   {gestaltSoundAttr response bits}
   gestaltStereoCapability       = 0;        {stereo capability present}
   gestaltStereoMixing           = 1;        {stereo mixing on internal }
                                             { speaker}
   gestaltSoundIOMgrPresent      = 3;        {sound input routines present}
   gestaltBuiltInSoundInput      = 4;        {built-in input device present}
   gestaltHasSoundInputDevice    = 5;        {sound input device present}
   gestaltPlayAndRecord          = 6;        {built-in hardware can play }
                                             { and record simultaneously}
   getstalt16BitSoundIO          = 7;        {sound hardware can play and }
                                             { record 16-bit samples}
   getstaltStereoInput           = 8;        {sound hardware can }
                                             { record steore}
   getstaltSndPlayDoubleBuffer   = 10;       {SndPlayDouble buffer present} 
   getstaltMultiChannels         = 11;       {multiple channel support}
   getstalt16BitAudioSuuport     = 12;       {16-bit audio data supported}
   {gestaltSpeechAttr response bits}
   gestaltSpeechMgrPresent       = 0;        {Speech Manager present}
   gestaltSpeechHasPPCGlue       = 1;        {Speech Manager has native PPC }
                                             { glue for API}
   {gestaltStandardFileAttr response bits}
   getaltStandardFile58          = 0;        {has functions new with 7.0}
   gestaltStandardFileTranslationAware
                                 = 1;        {aware of Translation Manager}
   gestaltStandardFileHasColorIcons
                                 = 2;        {dialog boxes use small color }
                                             { icons}
   {gestaltStdNBPAttr response bits}
   gestaltStdNBPPresent          = 0;        {StandardNBP is present}
   {gestaltSysArchitecture response bits}
   gestalt68k                    = 1;        {MC680x0 architecture}
   gestaltPowerPC                = 2;        {PowerPC architecture}
   {gestaltTEAttr response bits}
   gestaltTEHasGetHiliteRgn      = 0;        {TextEdit has TEGetHiliteRgn}
   {gestaltTermMgrAttr response bits}
   gestaltTermMgrPresent         = 0;        {Terminal Manager present}
   gestaltTermMgrErrorString     = 2;        {supports error string }
                                             { function}
   {gestaltTextEditVersion response values}
   gestaltTE1                    = 1;        {in MacIIci ROM}
   gestaltTE2                    = 2;        {with 6.0.4 scripts on Mac IIci}
   gestaltTE3                    = 3;        {with 6.0.4 scripts on other }
                                             { machines}
   gestaltTE4                    = 4;        {in 6.0.5 and 7.0}
   gestaltTE5                    = 5;        {TextWidthHook available}
   {gestaltThreadMgrAttr response bits}
   gestaltThreadMgrPresent       = 0;        {Thread Manger present}
   gestaltSpecificMatchSupport   = 1;        {Thread Manager supports }
                                             { exact match creation option}
   {gestaltTimeMgrVersion response values}
   gestaltStandardTimeMgr        = 1;        {standard Time Manager}
   gestaltRevisedTimeMgr         = 2;        {revised Time Manager}
   gestaltExtendedTimeMgr        = 3;        {extended Time Manager}
   {getstaltTranslationAttr response codes}
   gestaltTranslationMgrExists   = 0;        {Translation Manager present}
   {gestaltVMAttr response bits}
   gestaltVMPresent              = 0;        {virtual memory present}

Informational Selector Response Values

CONST
   {gestaltHardwareAttr response bits}
   gestaltHasVIA1                = 0;        {has VIA1 chip}
   gestaltHasVIA2                = 1;        {has VIA2 chip}
   gestaltHasASC                 = 3;        {has Apple sound chip}
   gestaltHasSCC                 = 4;        {has SCC}
   gestaltHasSCSI                = 7;        {has SCSI}
   gestaltHasSoftPowerOff        = 19;       {capable of software power off}
   gestaltHasSCSI961             = 21;       {has 53C96 SCSI on internal bus}
   gestaltHasSCSI962             = 22;       {has 53C96 SCSI on external bus}
   gestaltHasUniversalROM        = 24;       {has universal ROM}
   {gestaltMachineType response values}
   gestaltClassic                = 1;        {Macintosh 128K}
   gestaltMacXL                  = 2;        {Macintosh XL}
   gestaltMac512KE               = 3;        {Macintosh 512K enhanced}
   gestaltMacPlus                = 4;        {Macintosh Plus}
   gestaltMacSE                  = 5;        {Macintosh SE}
   gestaltMacII                  = 6;        {Macintosh II}
   gestaltMacIIx                 = 7;        {Macintosh IIx}
   gestaltMacIIcx                = 8;        {Macintosh IIcx}
   gestaltMacSE030               = 9;        {Macintosh SE/30}
   gestaltPortable               = 10;       {Macintosh Portable}
   gestaltMacIIci                = 11;       {Macintosh IIci}
   gestaltMacIIfx                = 13;       {Macintosh IIfx}
   gestaltMacClassic             = 17;       {Macintosh Classic}
   gestaltMacIIsi                = 18;       {Macintosh IIsi}
   gestaltMacLC                  = 19;       {Macintosh LC}
   gestaltQuadra900              = 20;       {Macintosh Quadra 900}
   gestaltPowerBook170           = 21;       {Macintosh PowerBook 170}
   gestaltQuadra700              = 22;       {Macintosh Quadra 700}
   gestaltClassicII              = 23;       {Macintosh Classic II}
   gestaltPowerBook100           = 24;       {Macintosh PowerBook 100}
   gestaltPowerBook140           = 25;       {Macintosh PowerBook 140}
   gestaltQuadra950              = 26;       {Macintosh Quadra 950}
   gestaltMacLCIII               = 27;       {Macintosh LC III}
   gestaltPowerBookDuo210        = 29;       {Macintosh PowerBook Duo 210}
   gestaltMacCentris650          = 30;       {Macintosh Centris 650}
   gestaltPowerBookDuo230        = 32;       {Macintosh PowerBook Duo 230}
   gestaltPowerBook180           = 33;       {Macintosh PowerBook 180}
   gestaltPowerBook160           = 34;       {Macintosh PowerBook 160}
   gestaltMacQuadra800           = 35;       {Macintosh Quadra 800}
   gestaltMacLCII                = 37;       {Macintosh LC II}
   gestaltPowerBookDuo250        = 38;       {Macintosh PowerBook Duo 230}
   gestaltMacIIvi                = 44;       {Macintosh IIvi}
   gestaltPerforma600            = 45;       {Macintosh Performa 600}
   gestaltMacIIvx                = 48;       {Macintosh IIvx}
   gestaltMacColorClassic        = 49;       {Macintosh Color Classic}
   gestaltPowerBook165c          = 50;       {Macintosh PowerBook 165c}
   gestaltMacCentris610          = 52;       {Macintosh Centris 610}
   gestaltMacQuadra610           = 53;       {Macintosh Quadra 610}
   gestaltPowerBook145           = 54;       {Macintosh PowerBook 145}
   getstaltMacLC520              = 56;       {Macintosh LC 520}
   getstaltMacCentris660AV       = 60;       {Macintosh Centris 660 AV}
   getstaltPowerBook180c         = 71;       {Macintosh PowerBook 180c}
   getstaltPowerBookDuo270c      = 77;       {Maciintosh PowerBook Duo 270c}
   getstaltMacQuadra840AV        = 78;       {Macintosh Quadra 840 AV}
   getstaltPowerBook165          = 84;       {Macintosh PowerBook 165}
   getstaltMacTV                 = 88;       {Macintosh TV}
   getstaltMacLC475              = 89;       {Macintosh LC 475}
   getstaltMacLC575              = 92;       {Macintosh LC 575}
   getstaltMacQuadra605          = 94;       {Macintosh Quadra 605}
   getstaltPowerMac8100_80       = 65;       {Power Macintosh 8100/80}
   getstaltPowerMac6100_60       = 75;       {Power Macintosh 6100/60}
   getstaltPowerMac7100_66       = 112;      {Power Macintosh 7100/66}
   kMachineNameStrID             = -16395;   {'STR#' resource that }
                                             { contains machine names}

SysEnvirons Constants

CONST
   curSysEnvVers                 = 2;        {current SysEnvirons version}
   {machine types}
   envXL                         = -2;       {Macintosh XL}
   envMac                        = -1;       {Macintosh with 64K ROM}
   envMachUnknown                = 0;        {unknown model, after }
                                             { Macintosh IIfx}
   env512KE                      = 1;        {Macintosh 512K enhanced}
   envMacPlus                    = 2;        {Macintosh Plus}
   envSE                         = 3;        {Macintosh SE}
   envMacII                      = 4;        {Macintosh II}
   envMacIIx                     = 5;        {Macintosh IIx}
   envMacIIcx                    = 6;        {Macintosh IIcx}
   envSE30                       = 7;        {Macintosh SE30}
   envPortable                   = 8;        {Macintosh Portable}
   envMacIIci                    = 9;        {Macintosh IIci}
   envMacIIfx                    = 11;       {Macintosh IIfx}
   {system environment record microprocessor codes}
   envCPUUnknown                 = 0;        {unknown microprocessor}
   env68000                      = 1;        {68000 microprocessor}
   env68010                      = 2;        {68010 microprocessor}
   env68020                      = 3;        {68020 microprocessor}
   env68030                      = 4;        {68030 microprocessor}
   env68040                      = 5;        {68040 microprocessor}
   {system environment record keyBoardType codes}
   envUnknownKbd                 =  0;       {Macintosh Plus with keypad}
   envMacKbd                     =  1;       {Macintosh}
   envMacAndPad                  =  2;       {Macintosh with keypad}
   envMacPlusKbd                 =  3;       {Macintosh Plus}
   envAExtendKbd                 =  4;       {Apple extended}
   envStandADBKbd                =  5;       {standard ADB}
   envPrtblADBKbd                =  6;       {Macintosh Portable ADB}
   envPrtblISOKbd                =  7;       {Macintosh Portable ISO}
   envStdISOADBKbd               =  8;       {standard ISO ADB}
   envExtISOADBKbd               =  9;       {extended ISO ADB}

Data Types

TYPE SysEnvRec =                 {system environment record}
RECORD
    environsVersion: Integer;    {SysEnvirons version number}
    machineType:     Integer;    {Macintosh model code}
    systemVersion:   Integer;    {System file version number}
    processor:       Integer;    {microprocessor type code}
    hasFPU:          Boolean;    {floating-point unit flag}
    hasColorQD:      Boolean;    {Color QuickDraw flag}
    keyBoardType:    Integer;    {keyboard type code}
    atDrvrVersNum:   Integer;    {AppleTalk driver version number}
    sysVRefNum:      Integer;    {working directory reference number of }
                                 { folder or volume containing open }
                                 { System file}
END;

Gestalt Manager Routines

Getting Information About the Operating Environment

FUNCTION Gestalt	(selector: OSType; 
			VAR response: LongInt): OSErr;
FUNCTION SysEnvirons	(versionRequested: Integer;
			VAR theWorld: SysEnvRec): OSErr;

Adding a Selector Code

FUNCTION NewGestalt	(selector: OSType; 
			gestaltFunction: SelectorFunctionUUP): OSErr;

Modifying a Selector Function

FUNCTION ReplaceGestalt	(selector: OSType; 
			gestaltFunction: SelectorFunctionUUP; 
			VAR oldGestaltFunction: SelectorFunctionUUP)
			: OSErr;

Application-Defined Routines

FUNCTION MySelectorFunction
			(selector: OSType; VAR response: LongInt)
			: OSErr;

C Summary

Constants

Environmental Selector Codes

#define gestaltAddressingModeAttr   'addr'   /*addressing-mode attributes*/
#define gestaltAliasMgrAttr         'alis'   /*Alias Manager attributes*/
#define gestaltAppleEventsAttr      'evnt'   /*Apple events attributes*/
#define gestaltAppleTalkVersion     'atlk'   /*old format AppleTalk version*/
#define gestaltATalkVersion         'atkv'   /*new format AppleTalk version*/
#define gestaltAUXVersion           'a/ux'   /*A/UX version, if present*/
#define gestaltCFMAttr              'cfrg'   /*Code Fragment Manager attr*/
#definegestaltCloseViewAttr         'BSDa'   /*CloseView attributes*/
#define gestaltComponentMgr         'cpnt'   /*Component Manager version*/
#define gestaltCompressionMgr       'icmp'   /*Image Compression Manager */
                                             /* version*/
#define gestaltConnMgrAttr          'conn'   /*Connection Manager attr*/
#define gestaltCRMAttr              'crm '   /*Comm Resource Manager attr*/
#define gestaltCTBVersion           'ctbv'   /*Comm Toolbox version*/
#define gestaltDBAccessMgrAttr      'dbac'   /*Data Access Manager attr*/
#define gestaltDictionaryMgrAttr    'dict'   /*Dictionary Manager attr*/
#define gestaltDisplayMgrAttr       'dply'   /*Display Manager attributes*/
#define gestaltDisplayMgrVers       'dplv'   /*Display Manager version*/
#define gestaltDITLExtAttr          'ditl'   /*Dialog Manager extensions*/
#define gestaltDragMgrAttr          'drag'   /*Drag Manager attributes*/
#define gestaltEasyAccessAttr       'easy'   /*Easy Access attributes*/
#define gestaltEditionMgrAttr       'edtn'   /*Edition Manager attributes*/
#define gestaltExtToolboxTable      'xttt'   /*Toolbox trap dispatch table*/
#define gestaltFinderAttr           'fndr'   /*Finder attributes*/
#define gestaltFindFolderAttr       'fold'   /*FindFolder attributes*/
#define gestaltFirstSlotNumber      'slt1'   /*first physical slot*/
#define gestaltFontMgrAttr          'font'   /*Font Manager attributes*/
#define gestaltFPUType              'fpu '   /*floating-point unit type*/
#define gestaltFSAttr               'fs  '   /*file system attributes*/
#define gestaltFXfrMgrAttr          'fxfr'   /*File Transfer Manager attr*/
#define gestaltHelpMgrAttr          'help'   /*Help Manager attributes*/
#define gestaltKeyboardType         'kbd '   /*keyboard type code*/
#define gestaltLogicalPageSize      'pgsz'   /*logical page size*/
#define gestaltLogicalRAMSize       'lram'   /*logical RAM size*/
#define gestaltLowMemorySize        'lmem'   /*size of low memory*/
#define gestaltMiscAttr             'misc'   /*miscellaneous attributes*/
#define gestaltMixedModeVersion     'mixd'   /*MixedMode version*/
#define gestaltMMUType              'mmu '   /*MMU type*/
#define gestaltNativeCPUtype        'cput'   /*Native CPU type*/
#define gestaltNotificationMgrAttr  'nmgr'   /*Notification Manager attr*/
#define gestaltNuBusConnectors      'sltc'   /*NuBus connector bitmap*/
#define getstaltNuBusSlotCount      'nubs'   /*count of logical NuBus slots*/
#define gestaltOSAttr               'os  '   /*Operating System attributes*/
#define gestaltOSTable              'ostt'   /*base address of Operating */
                                             /* System trap dispatch table*/
#define gestaltParityAttr           'prty'   /*parity attributes*/
#define gestaltPCXAttr              'pcxg'   /*PC exchange attributes*/
#define gestaltPhysicalRAMSize      'ram '   /*physical RAM size*/
#define gestaltPopupAttr            'pop!'   /*pop-up 'CDEF' attributes*/
#define gestaltPowerMgrAttr         'powr'   /*Power Manager attributes*/
#define gestaltPPCToolboxAttr       'ppc '   /*PPC Toolbox attributes*/
#define gestaltProcessorType        'proc'   /*microprocessor type code*/
#define gestaltQuickdrawFeatures    'qdrw'   /*QuickDraw features*/
#define gestaltQuickdrawVersion     'qd  '   /*QuickDraw version*/
#define gestaltQuickTime            'qtim'   /*QuickTime version*/
#define gestaltRealtimeAttr         'rtmr'   /*Realtime Manager attributes*/
#define gestaltResourceMgrAttr      'rsrc'   /*Resource Manager attributes*/
#define gestaltScrapMgrAttr         'scra'   /*Scrap Manager attributes*/
#define gestaltScriptCount          'scr#'   /*number of active script */
                                             /* systems*/
#define gestaltScriptMgrVersion     'scri'   /*Script Manager version*/
#define gestaltSerialAttr           'ser '   /*serial hardware attributes*/
#define gestaltSoundAttr            'snd '   /*sound attributes*/
#define gestaltSpeechAttr           'ttsc'   /*Speech Manager attributes*/
#define gestaltStandardFileAttr     'stdf'   /*Standard File attributes*/
#define gestaltStdNBPAttr           'nlup'   /*StandardNBP attributes*/
#define gestaltSysArchitecture      'sysa'   /*native system architecture*/
#define gestaltTEAttr               'teat'   /*TextEdit attributes*/
#define gestaltTermMgrAttr          'term'   /*Terminal Manager attributes*/
#define gestaltTextEditVersion      'te  '   /*TextEdit version code*/
#define gestaltThreadMgrAttr        'thds'   /*Thread Manager attributes*/
#define gestaltTimeMgrVersion       'tmgr'   /*Time Manager version code*/
#define gestaltToolboxTable         'tbtt'   /*base address of Toolbox */
                                             /* trap dispatch table*/
#define gestaltTranslationAttr      'xlat'   /*Translation Manager */
                                             /* attributes*/
#define gestaltTSMgrVersion         'tsmv'   /*Text Services Manager */
                                             /* version*/
#define getstaltIconUtilities       'icon'   /*Icon Utilities attributes*/
#define gestaltVersion              'vers'   /*Gestalt version*/
#define gestaltVMAttr               'vm  '   /*virtual memory attributes*/

Informational Selector Codes

#define gestaltHardwareAttr         'hdwr'   /*hardware attributes*/
#define gestaltMachineIcon          'micn'   /*machine 'ICON'/'cicn' res ID*/
#define gestaltMachineType          'mach'   /*Macintosh model code*/
#define gestaltROMSize              'rom '   /*ROM size*/
#define gestaltROMVersion           'romv'   /*ROM version*/
#define gestaltSystemVersion        'sysv'   /*System file version number*/

Environmental Selector Response Values

enum {
   /*gestaltAddressingModeAttr response bits*/
   gestalt32BitAddressing           = 0,     /*booted in 32-bit mode*/
   gestalt32BitSysZone              = 1,     /*32-bit compatible system */
                                             /* zone*/
   gestalt32BitCapable              = 2      /*machine is 32-bit capable*/
};
enum {
   /*gestaltAliasMgrAttr response bits*/
   gestaltAliasMgrPresent           = 0,     /*Alias Manager present*/
   gestaltAliasMgrSupportsRemoteAppletalk    /*Alias Manager knows about */
                                    = 1      /* remote Appletalk*/
};
enum {
   /*gestaltAppleEventsAttr response bits*/
   gestaltAppleEventsPresent        = 0,     /*Apple Events available*/
   gestaltScriptingSupport          = 1,
   gestaltOSLInSystem               = 2      /*OSL in system*/
};
enum {
   /*gestaltATalkVersion release stage constants*/
   development                      = $20,      /*development*/
   alpha                            = $40,      /*alpha*/
   beta                             = $60,      /*beta*/
   final                            = $80,      /*final*/
   release                          = $80       /*release*/
};
enum {
   /*gestaltCFMAttr response bits*/
   gestaltCFMPresent                = 0      /*Code Fragment Manager */
                                             /* present*/
};
enum {
   /*gestaltCloseViewAttr response bits*/
   gestaltCloseViewEnabled          = 0,     /*CloseView enabled*/
   gestaltCloseViewDisplayMgrFriendly
                                    = 1      /*CloseView compatible with */
                                             /* Display Manger*/
};
enum {
   /*gestaltConnMgrAttr response bits*/
   gestaltConnMgrPresent            = 0,     /*Connection Manager present*/
   gestaltConnMgrCMSearchFix        = 1,     /*CMAddSearch fix present*/
   gestaltConnMgrErrorString        = 2,     /*has CMGetErrorString*/
   gestaltConnMgrMultiAsyncIO       = 3      /*has CMNewIOPB, */
                                             /* CMDisposeIOPB, CMPBRead, */
                                             /* CMPBWrite, CMPBIOKill*/
};
enum {
   /*gestaltCRMAttr response bits*/
   gestaltCRMPresent                = 0,     /*Comm Resource Manager */
                                             /* present*/
   gestaltCRMPersistentFix          = 1,     /*fix for persistent tools*/
   gestaltCRMToolRsrcCalls          = 2      /*tool resource calls */
                                             /* available*/
};
enum {
   /*gestaltDBAccessMgrAttr response bits*/
   gestaltDBAccessMgrPresent        = 0      /*Data Access Manager present*/
};
enum {
   /*gestaltDictionaryMgrAttr response bits*/
   gestaltDictionaryMgrPresent      = 0      /*Dictionary Manager present*/
};
enum {
   /*gestaltDisplayMgrAttr response bits*/
   gestaltDisplayMgrPresent         = 0      /*Display Manager Present*/
};
enum {
   /*gestaltDITLExtAttr response bits*/
   gestaltDITLExtPresent            = 0      /*Dialog Manager extensions */
                                             /* present*/
};
enum {
   /*gestaltDragMgrAttr response bits*/
   gestaltDragMgrPresent            = 0      /*Drag Manager present*/
};
enum {
   /*gestaltEasyAccessAttr response bits*/
   gestaltEasyAccessOff             = 0,     /*Easy Access present but off*/
   gestaltEasyAccessOn              = 1,     /*Easy Access on*/
   gestaltEasyAccessSticky          = 2,     /*Easy Access sticky*/
   gestaltEasyAccessLocked          = 3      /*Easy Access locked*/
};
enum {
   /*gestaltEditionMgrAttr response bits*/
   gestaltEditionMgrPresent         = 0,     /*Edition Manager present*/
   gestaltEditionMgrTranslationAware = 1     /*Edition Manager aware of */
                                             /* Translation Manager*/
};
enum {
   /*gestaltFinderAttr response bits*/
   gestaltFinderDropEvent        = 0,        /*Finder recognizes drop event*/
   gestaltFinderMagicPlacement   = 1,        /*Finder supports magic icon */
                                             /* placement*/
   gestaltFinderCallsAEProcess   = 2,        /*Finder calls */
                                             /* AEProcessAppleEvent*/
   gestaltFinderOSLCompliantFinder
                                 = 3,        /*Finder is scriptable and */
                                             /* recordable*/
   getstaltFinderSupports4GBVolumes
                                 = 4,        /*Finder handles 4GB volumes*/
   getstaltFinderHandlesCFMFailures
                                 = 5,        /*Finder handles Code */
                                             / *Fragment Manager errors*/
   getstaltFinderHasClippings    = 6         /*Finder supports Drag */
                                             /* Manager cliping files*/
enum {
   /*gestaltFindFolderAttr response bits*/
   gestaltFindFolderPresent         = 0      /*FindFolder available*/
};
enum {
   /*gestaltFontMgrAttr response bits*/
   gestaltOutlineFonts              = 0      /*outline fonts supported*/
};
enum {
   /*gestaltFPUType response values*/
   gestaltNoFPU                     = 0,     /*no FPU*/
   gestalt68881                     = 1,     /*Motorola 68881 FPU*/
   gestalt68882                     = 2,     /*Motorola 68882 FPU*/
   gestalt68040FPU                  = 3      /*built-in 68040 */
                                             /* floating-point processing*/
};
enum {
   /*gestaltFSAttr response bits*/
   gestaltFullExtFSDispatching      = 0,     /*new HFSDispatch available*/
   gestaltHasFSSpecCalls            = 1,     /*has FSSpec calls*/
   gestaltHasFileSystemManager      = 2,     /*has File System Manager*/
   gestaltHasFileSystemManager      = 3,     /*supports dynamic loading*/
   gestaltFSSupports4GBVols         = 4,     /*supports 4 gigabyte volume*/
   gestaltHasExtendedDiskInit       = 6      /*has extended disk */
                                             /* initialization calls*/
};
enum {
   /*gestaltFXfrMgrAttr response bits*/
   gestaltFXfrMgrPresent            = 0,     /*File Transfer Manager */
                                             /* present*/
   gestaltFXfrMgrMultiFile          = 1,     /*supports FTSend and */
                                             /* FTReceive*/
   gestaltFXfrMgrErrorString        = 2      /*supports FTGetErrorString*/
};
enum {
   /*gestaltHelpMgrAttr response bits/*
   gestaltHelpMgrPresent            = 0      /*Help Manager present*/
};
enum {
   /*gestaltIconUtilitiesAttr response bits*/
   gestaltIconUtilitiesPresent      =  0     /*icon utilities present*/
};
enum {
   /*gestaltKeyboardType response values*/
   gestaltMacKbd                    = 1,     /*Macintosh*/
   gestaltMacAndPad                 = 2,     /*Macintosh with keypad*/
   gestaltMacPlusKbd                = 3,     /*Macintosh Plus*/
   gestaltExtADBKbd                 = 4,     /*extended ADB*/
   gestaltStdADBKbd                 = 5,     /*standard ADB*/
   gestaltPrtblADBKbd               = 6,     /*Portable ADB */
   gestaltPrtblISOKbd               = 7,     /*Portable ISO ADB*/
   gestaltStdISOADBKbd              = 8,     /*ISO standard ADB*/
   gestaltExtISOADBKbd              = 9,     /*ISO extended ADB*/
   gestaltADBKbdII                  = 10,    /*ADB II*/
   gestaltADBISOKbdII               = 11,    /*ISO ADB II*/
   gestaltPwrBookADBKbd             = 12,    /*PowerBook ADB*/
   gestaltPwrBookISOADBKbd          = 13,    /*PowerBook ISO ADB*/
   gestaltAppleAdjustKeypad         = 14,    /*Adjustable Keypad*/
   gestaltAppleAdjustADBKbd         = 15,    /*Adjustable ADB*/
   gestaltAppleAdjustISOKbd         = 16     /*Adjustable ISO*/
};
enum {
   /*gestaltMiscAttr return bits*/
   gestaltScrollingThrottle         = 0,     /*scrolling throttle is on*/
   gestaltSquareMenuBar             = 2      /*menu bar is square*/
};
enum {
   /*gestaltMMUType return values*/
   gestaltNoMMU                     = 0,     /*no MMU*/
   gestaltAMU                       = 1,     /*Mac II address management */
                                             /* unit*/
   gestalt68851                     = 2,     /*Motorola 68851 PMMU*/
   gestalt68030MMU                  = 3,     /*built-in 68030 MMU*/
   gestalt68040MMU                  = 4,     /*built-in 68040 MMU*/
   gestaltEMMU1                     = 5      /*emulated MMU type 1*/
};
enum {
   /*gestaltNativeCPUtype response values*/
   gestaltCPU68000                  = $000,  /*Macintosh 68000 CPU*/
   gestaltCPU68010                  = $001,  /*Macintosh 68010 CPU*/
   gestaltCPU68020                  = $002,  /*Macintosh 68020 CPU*/
   gestaltCPU68030                  = $003,  /*Macintosh 68030 CPU*/
   gestaltCPU68040                  = $004,  /*Macintosh 68040 CPU*/
   gestaltCPU601                    = $101,  /*PowerPC 601 CPU*/
};
enum {
   /*gestaltNotificationMgrAttr response bits*/
   gestaltNotificationPresent       = 0      /*Notification Manager present*/
};
enum {
   /*gestaltOSAttr response bits*/
   gestaltSysZoneGrowable           = 0,     /*system heap can grow*/
   gestaltLaunchCanReturn           = 1,     /*can return from launch*/
   gestaltLaunchFullFileSpec        = 2,     /*LaunchApplication available*/
   gestaltLaunchControl             = 3,     /*Process Manager available*/
   gestaltTempMemSupport            = 4,     /*temporary memory support */
                                             /* available*/
   gestaltRealTempMemory            = 5,     /*temporary memory handles */
                                             /* are real*/
   gestaltTempMemTracked            = 6,     /*temporary memory handles */
                                             /* are tracked*/
};
enum {
   /*gestaltParityAttr response bits*/
   gestaltHasParityCapability       = 0,     /*machine can check parity*/
   gestaltParityEnabled             = 1      /*parity RAM is installed*/
};
enum {
   /*gestaltPCXAttr response bits*/
   gestaltPCXHas8and16BitFat        = 0,     /*PC exchange supports both */
                                             /* 8 and 16 bit FATs*/
   /*gestaltPCXHasProDOS            = 1      /*PC exchange supports ProDos*/
};
enum {
   /*gestaltPopupAttr response bits*/
   gestaltPopupPresent              = 0      /*pop-up 'CDEF' is present*/
};
enum {
   /*gestaltPowerMgrAttr response bits*/
   gestaltPMgrExists                = 0,     /*Power Manager is present*/
   gestaltPMgrCPUIdle               = 1,     /*CPU can idle*/
   gestaltPMgrSCC                   = 2,     /*Power Manager can stop SCC */
                                             /* clock*/
   gestaltPMgrSound                 = 3,     /*Power Manager can turn off */
                                             /* sound power*/
   gestaltPMgrDispatchExists        = 4      /*Power Mgr dispatch exists*/
};
enum {
   /* gestaltPPCToolboxAttr response bits*/
   gestaltPPCToolboxPresent         = 0x0000, /*PPC Toolbox is present; */
                                              /* PPCInit has been called*/
   gestaltPPCSupportsRealTime       = 0x1000, /*supports real-time delivery*/
   gestaltPPCSupportsIncoming       = 0x0001, /*accepts sessions from */
                                              /* remote computers*/
   gestaltPPCSupportsOutGoing       = 0x0002  /*can initiate sessions with */
                                              /* remote computers*/
};
enum {
   /*gestaltProcessorType response values*/
   gestalt68000                     = 1,     /*68000 microprocessor*/
   gestalt68010                     = 2,     /*68010 microprocessor*/
   gestalt68020                     = 3,     /*68020 microprocessor*/
   gestalt68030                     = 4,     /*68030 microprocessor*/
   gestalt68040                     = 5      /*68040 microprocessor*/
};
enum {
   /*gestaltQuickdrawFeatures response bits*/
   gestaltHasColor                  = 0,     /*Color QuickDraw present*/
   gestaltHasDeepGWorlds            = 1,     /*graphics worlds can be */
                                             /* deeper than 1 bit*/
   gestaltHasDirectPixMaps          = 2,     /*PixMaps can be direct */
                                             /* (16- or 32-bit)*/
   gestaltHasGrayishTextOr          = 3,     /*supports text mode */
                                             /* grayishTextOr*/
   gestaltSupportsMirroring         = 4      /*supports video mirroring */
                                             /* using the Display Manager*/
};
enum {
   /*gestaltQuickdrawVersion response values*/
   gestaltOriginalQD                = 0x000, /*original 1-bit QuickDraw*/
   gestalt8BitQD                    = 0x100, /*8-bit QuickDraw*/
   gestalt32BitQD                   = 0x200, /*32-Bit QuickDraw vers. 1.0*/
   gestalt32BitQD11                 = 0x210, /*32-Bit QuickDraw vers. 1.1*/
   gestalt32BitQD12                 = 0x220, /*32-Bit QuickDraw vers. 1.2*/
   gestalt32BitQD13                 = 0x230  /*32-Bit QuickDraw vers. 1.3*/
};
enum {
   /*gestaltRealtimeAttr response bits*/
   gestaltRealtimeMgrPresent        = 0      /*Realtime Manager present*/
};
enum {
   /*gestaltResourceMgrAttr response bits*/
   gestaltPartialRsrcs              = 0      /*partial resources supported*/
};
enum {
   /*gestaltScrapMgrAttr response bits*/
   gestaltScrapMgrTranslationAware  = 0,     /*aware of Translation Manager*/
   gestaltTrasnlationMgrHintOrder   = 1      /*hint order reversal present*/
};
enum {
   /*gestaltSerialAttr response bits*/
   gestaltHasGPIaToDCDa             = 0,     /*GPI connected to DCD on */
                                             /* port A*/
   gestaltHasGPIaToRTxCa            = 1,     /*GPI connected to RTxC on */
                                             /* port A*/
   gestaltHasGPIbToDCDb             = 2      /*GPI connected to DCD on */
                                             /* port B*/
};
enum {
   /*gestaltSoundAttr response bits*/
   gestaltStereoCapability          = 0,     /*stereo capability present*/
   gestaltStereoMixing              = 1,     /*stereo mixing on internal */
                                             /* speaker*/
   gestaltSoundIOMgrPresent         = 3,     /*sound input routines present*/
   gestaltBuiltInSoundInput         = 4,     /*built-in input device */
                                             /* present*/
   gestaltHasSoundInputDevice       = 5,     /*sound input device present*/
   gestaltPlayAndRecord             = 6,     /*built-in hardware can play */
                                             /* and record simultaneously*/
   getstalt16BitSoundIO             = 7,     /*sound hardware can play and */
                                             /* record 16-bit samples*/
   getstaltStereoInput              = 8,     /*sound hardware can */
                                             /* record steore*/
   getstaltSndPlayDoubleBuffer      = 10,    /*SndPlayDouble buffer present*/ 
   getstaltMultiChannels            = 11,    /*multiple channel support*/
   getstalt16BitAudioSuuport        = 12     /*16-bit audio data supported*/
};
enum {
   /*gestaltSpeechAttr response bits*/
   gestaltSpeechMgrPresent          = 0,     /*Speech Manager present*/
   gestaltSpeechHasPPCGlue          = 1      /*Speech Manager has native *
                                             /* PPC glue for API*/
};
enum {
   /*gestaltStandardFileAttr response bits*/
   getaltStandardFile58                = 0,  /*has functions new with 7.0*/
   gestaltStandardFileTranslationAware = 1,  /*aware of Translation Manager*/
   gestaltStandardFileHasColorIcons    = 2   /*dialog boxes use small */
                                             /* color icons*/
};
enum {
   /*gestaltStdNBPAttr response bits*/
   gestaltStdNBPPresent             = 0      /*StandardNBP is present*/
};
enum {
   /*gestaltSysArchitecture response bits*/
   gestalt68k                       = 1,     /*MC680x0 architecture*/
   gestaltPowerPC                   = 2      /*PowerPC architecture*/
};
enum {
   /*gestaltTEAttr response bits*/
   gestaltTEHasGetHiliteRgn         = 0      /*TextEdit has TEGetHiliteRgn*/
};
enum {
   /*gestaltTermMgrAttr response bits*/
   gestaltTermMgrPresent            = 0,     /*Terminal Manager present*/
   gestaltTermMgrErrorString        = 2      /*supports error string */
                                             /* function*/
};
enum {
   /*gestaltTextEditVersion response codes */
   gestaltTE1                       = 1,     /*in MacIIci ROM*/
   gestaltTE2                       = 2,     /*with 6.0.4 scripts on */
                                             /* MacIIci*/
   gestaltTE3                       = 3,     /*with 6.0.4 scripts on*/
                                             /* other machines*/
   gestaltTE4                       = 4,     /*in 6.0.5 and 7.0*/
   gestaltTE5                       = 5      /*TextWidthHook available*/
};
enum {
   /*gestaltThreadMgrAttr response bits*/
   gestaltThreadMgrPresent          = 0,     /*Thread Manager present*/
   gestaltSpecificMatchSupports     = 1      /*Thread Manager supports */
                                             /* exact match creation option*/
};
enum {
   /*gestaltTimeMgrVersion response codes*/
   gestaltStandardTimeMgr           = 1,     /*standard Time Manager*/
   gestaltRevisedTimeMgr            = 2,     /*revised Time Manager*/
   gestaltExtendedTimeMgr           = 3      /*extended Time Manager*/
};
enum {
   /*getstaltTranslationAttr response codes*/
   gestaltTranslationMgrExists      = 0      /*Translation Manager present*/
};
enum {
   /*gestaltVMAttr response bits*/
   gestaltVMPresent                 = 0      /*virtual memory present*/
};

Informational Selector Response Values

enum {
   /*gestaltHardwareAttr response bits*/
   gestaltHasVIA1                   = 0,     /*has VIA1 chip*/
   gestaltHasVIA2                   = 1,     /*has VIA2 chip*/
   gestaltHasASC                    = 3,     /*has Apple Sound Chip*/
   gestaltHasSCC                    = 4,     /*has SCC*/
   gestaltHasSCSI                   = 7,     /*has SCSI*/
   gestaltHasSoftPowerOff           = 19,    /*capable of software power */
                                             /* off*/
   gestaltHasSCSI961                = 21,    /*has 53C96 SCSI on internal */
                                             /* bus*/
   gestaltHasSCSI962                = 22,    /*has 53C96 SCSI on external */
                                             /* bus*/
   gestaltHasUniversalROM           = 24     /*has universal ROM*/
};

enum {
   /*gestaltMachineType response codes*/
   gestaltClassic                   = 1,     /*Macintosh 128K*/
   gestaltMacXL                     = 2,     /*Macintosh XL*/
   gestaltMac512KE                  = 3,     /*Macintosh 512K enhanced*/
   gestaltMacPlus                   = 4,     /*Macintosh Plus*/
   gestaltMacSE                     = 5,     /*Macintosh SE*/
   gestaltMacII                     = 6,     /*Macintosh II*/
   gestaltMacIIx                    = 7,     /*Macintosh IIx*/
   gestaltMacIIcx                   = 8,     /*Macintosh IIcx*/
   gestaltMacSE030                  = 9,     /*Macintosh SE/30*/
   gestaltPortable                  = 10,    /*Macintosh Portable*/
   gestaltMacIIci                   = 11,    /*Macintosh IIci*/
   gestaltMacIIfx                   = 13,    /*Macintosh IIfx*/
   gestaltMacClassic                = 17,    /*Macintosh Classic*/
   gestaltMacIIsi                   = 18,    /*Macintosh IIsi*/
   gestaltMacLC                     = 19,    /*Macintosh LC*/
   gestaltQuadra900                 = 20,    /*Macintosh Quadra 900*/
   gestaltPowerBook170              = 21,    /*Macintosh PowerBook 170*/
   gestaltQuadra700                 = 22,    /*Macintosh Quadra 700*/
   gestaltClassicII                 = 23,    /*Macintosh Classic II*/
   gestaltPowerBook100              = 24,    /*Macintosh PowerBook 100*/
   gestaltPowerBook140              = 25,    /*Macintosh PowerBook 140*/
   gestaltQuadra950                 = 26,    /*Macintosh Quadra 950*/
   gestaltMacLCIII                  = 27,    /*Macintosh LC III*/
   gestaltPowerBook210              = 29,    /*Macintosh PowerBook Duo 210*/
   gestaltMacCentris650             = 30,    /*Macintosh Centris 650*/
   gestaltPowerBook230              = 32,    /*Macintosh PowerBook Duo 230*/
   gestaltPowerBook180              = 33,    /*Macintosh PowerBook 180*/
   gestaltPowerBook160              = 34,    /*Macintosh PowerBook 160*/
   gestaltMacQuadra800              = 35,    /*Macintosh Quadra 800*/
   gestaltMacLCII                   = 37,    /*Macintosh LC II*/
   gestaltPowerBookDuo250           = 38,    /*Macintosh PowerBook Duo 230*/
   gestaltMacIIvi                   = 44,    /*Macintosh IIvi*/
   gestaltPerforma600               = 45,    /*Macintosh Performa 600*/
   gestaltMacIIvx                   = 48,    /*Macintosh IIvx*/
   gestaltMacColorClassic           = 49,    /*Macintosh Color Classic*/
   gestaltPowerBook165c             = 50,    /*Macintosh PowerBook 165c*/
   gestaltMacCentris610             = 52,    /*Macintosh Centris 610*/
   gestaltMacQuadra610              = 53,    /*Macintosh Quadra 610*/
   gestaltPowerBook145              = 54,    /*Macintosh PowerBook 145*/
   getstaltMacLC520                 = 56,    /*Macintosh LC 520*/
   getstaltMacCentris660AV          = 60,    /*Macintosh Centris 660 AV*/
   getstaltPowerBook180c            = 71,    /*Macintosh PowerBook 180c*/
   getstaltPowerBookDuo270c         = 77,    /*Macintosh PowerBook Duo 270c*/
   getstaltMacQuadra840AV           = 78,    /*Macintosh Quadra 840 AV*/
   getstaltPowerBook165             = 84,    /*Macintosh PowerBook 165*/
   getstaltMacTV                    = 88,    /*Macintosh TV*/
   getstaltMacLC475                 = 89,    /*Macintosh LC 475*/
   getstaltMacLC575                 = 92,    /*Macintosh LC 575*/
   getstaltMacQuadra605             = 94,    /*Macintosh Quadra 605*/
   getstaltPowerMac8100_80          = 65,    /*Power Macintosh 8100/80*/
   getstaltPowerMac6100_60          = 75,    /*Power Macintosh 6100/60*/
   getstaltPowerMac7100_66          = 112    /*Power Macintosh 7100/66*/

};
enum {
   kMachineNameStrID                = -16395 /*'STR#' resource that */
};                                           /* contains machine names*/

SysEnvirons Constants

enum {
   curSysEnvVers                    = 2      /*current SysEnvirons version*/
};
enum {
   /*machine types*/
   envXL                            = -2,    /*Macintosh XL*/
   envMac                           = -1,    /*Macintosh with 64K ROM*/
   envMachUnknown                   = 0,     /*unknown model, after */
                                             /* Macintosh IIfx*/
   env512KE                         = 1,     /*Macintosh 512K enhanced*/
   envMacPlus                       = 2,     /*Macintosh Plus*/
   envSE                            = 3,     /*Macintosh SE*/
   envMacII                         = 4,     /*Macintosh II*/
   envMacIIx                        = 5,     /*Macintosh IIx*/
   envMacIIcx                       = 6,     /*Macintosh IIcx*/
   envSE30                          = 7,     /*Macintosh SE30*/
   envPortable                      = 8,     /*Macintosh Portable*/
   envMacIIci                       = 9,     /*Macintosh IIci*/
   envMacIIfx                       = 11,    /*Macintosh IIfx*/
   envMacClassic                    = 15,    /*Macintosh Classic*/
   envMacIIsi                       = 16,    /*Macintosh IIsi*/
   envMacLC                         = 17,    /*Macintosh LC*/
   envMacQuadra900                  = 18,    /*Macintosh Quadra 900*/
   envMacPowerBook170               = 19,    /*Macintosh PowerBook 170*/
   envMacQuadra700                  = 20,    /*Macintosh Quadra 700*/
   envMacClassicII                  = 21,    /*Macintosh Classic II*/
   envMacPowerBook100               = 22,    /*Macintosh PowerBook 100*/
   envMacPowerBook140               = 23,    /*Macintosh PowerBook 140*/
   envMacQuadra950                  = 24,    /*Macintosh Quadra 950*/
   envMacLCII                       = 35,    /*Macintosh LC II*/
   envMacPowerBook145               = 52     /*Macintosh PowerBook 145*/
};
enum {
   /*CPU types*/
   envCPUUnknown                    = 0,     /*unknown microprocessor*/
   env68000                         = 1,     /*68000 microprocessor*/
   env68010                         = 2,     /*68010 microprocessor*/
   env68020                         = 3,     /*68020 microprocessor*/
   env68030                         = 4,     /*68030 microprocessor*/
   env68040                         = 5,     /*68040 microprocessor*/
};
enum {
   /*keyboard types*/
   envUnknownKbd                    = 0,     /*Macintosh Plus with keypad*/
   envMacKbd                        = 1,     /*Macintosh*/
   envMacAndPad                     = 2,     /*Macintosh with keypad*/
   envMacPlusKbd                    = 3,     /*Macintosh Plus*/
   envAExtendKbd                    = 4,     /*Apple extended*/
   envStandADBKbd                   = 5,     /*standard ADB*/
   envPrtblADBKbd                   = 6,     /*Macintosh Portable ADB*/
   envPrtblISOKbd                   = 7,     /*Macintosh Portable ISO*/
   envStdISOADBKbd                  = 8,     /*standard ISO ADB */
   envExtISOADBKbd                  = 9      /*extended ISO ADB*/
};

Data Types

struct SysEnvRec {                        /*system environment record*/
    short            environsVersion;     /*SysEnvirons version number*/
    short            machineType;         /*Macintosh model code*/
    short            systemVersion;       /*System file version number*/
    short            processor;           /*microprocessor type code*/
    Boolean          hasFPU;              /*floating-point unit flag*/
    Boolean          hasColorQD;          /*Color QuickDraw flag*/
    short            keyBoardType;        /*keyboard type code*/
    short            atDrvrVersNum;       /*AppleTalk driver version number*/
    short            sysVRefNum           /*working-directory reference */
                                          /* number of folder or volume */
                                          /* containing open System file*/
};
typedef struct SysEnvRec SysEnvRec;

Gestalt Manager Routines

Getting Information About the Operating Environment

pascal OSErr Gestalt	(OSType selector, long *response);
pascal OSErr SysEnvirons(short versionRequested, SysEnvRec *theWorld);

Adding a Selector Code

pascal OSErr NewGestalt	(OSType selector,
			SelectorFunctionUUP gestaltFunction);

Modifying a Selector Function

pascal OSErr ReplaceGestalt
			(OSType selector,
			SelectorFunctionUUP gestaltFunction,
			SelectorFunctionUUP *oldGestaltFunction); 

Application-Defined Routines

pascal OSErr MySelectorFunc
			(OSType selector, long *response);

Assembly-Language Summary

Data Structures

SysEnvRec Data Structure
0environsVersionwordSysEnvirons version number
2machineTypewordMacintosh model code
4systemVersionwordSystem file version number
6processorwordmicroprocessor type code
8hasFPUbytefloating-point unit flag
9hasColorQDbyteColor QuickDraw flag
10keyBoardTypewordkeyboard type code
12atDrvrVersNumwordAppleTalk driver version number
14sysVRefNumwordworking-directory reference number of directory or volume containing open System file

Result Codes
noErr0No error
memFullErr-108Ran out of memory
envNotPresent-5500SysEnvirons trap not present
envBadVers-5501Nonpositive version number passed
envVersTooBig-5502Requested version of SysEnvirons not available
gestaltUnknownErr-5550Could not obtain the response
gestaltUndefSelectorErr-5551Undefined selector
gestaltDupSelectorErr-5552Selector already exists
gestaltLocationErr-5553Function not in system heap


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996