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 / Gestalt Manager Reference


Constants

This section lists the Apple-defined Gestalt Manager selector codes, describes the formats of their responses, and lists the constants defined for their return values.

You pass a selector code when you call Gestalt to specify the kind of information you need. Apple defines two distinct kinds of selector codes: environmental selectors, which supply information you can use to control the behavior of your application, and informational selectors, which supply information you can't use to determine what hardware or software features are available.

The selector code constants use a set of suffixes that indicate what format the response value will take. Selectors with the suffix Attr, for example, return a 32-bit response value in which the individual bits represent specific attributes. The constants listed for these response values represent bit numbers. For a more general description of selectors and their response values, see "Interpreting Gestalt Responses" beginning on page 1-9.

The Gestalt function accepts the following environmental selectors.
SelectorResponse bits and response values
gestaltAddressingModeAttrCurrent addressing-mode attributes.
 CONST
gestalt32BitAddressing = 0;
gestalt32BitSysZone = 1;
gestalt32BitCapable = 2;
 The gestalt32BitAddressing attribute indicates that the machine started up with 32-bit addressing. The gestalt32BitSysZone attribute indicates that the system heap has 32-bit clean block headers (regardless of the type of addressing the machine started up in). See the book Inside Macintosh: Memory for more information about 32-bit addressing.
gestaltAliasMgrAttrAlias Manager attributes.
 CONST
gestaltAliasMgrPresent = 0;
gestaltAliasMgrSupportsRemoteAppleTalk = 1;
gestaltAppleEventsAttrThe Apple events attribute.
 CONST
gestaltAppleEventsPresent = 0;
gestaltScriptingSupport = 1;
gestaltOSLInSystem = 2;
gestaltAppleTalkVersionThe version number of the AppleTalk driver (in particular, the .MPP driver) currently installed. The version number is placed into the low-order byte of the result; ignore the three high-order bytes. If an AppleTalk driver is not currently open, the response parameter is 0.
gestaltATalkVersionThe version number of the AppleTalk driver, in the format introduced with AppleTalk version 56. (For a description of AppleTalk, see Inside AppleTalk, second edition.) The version is stored in the high 3 bytes of the return value.
 Byte 3 contains the major revision number, byte 2 contains the minor revision number, and byte 1 contains a constant that represents the release stage.
gestaltATalkVersion
CONST
development = $20;
alpha = $40;
beta = $60;
final = $80;
release = $80;
 For example, if you call Gestalt with the 'atkv' selector when AppleTalk version 57 is loaded, you receive the long integer response value $39008000.

Byte 0 always contains 0.

gestaltAUXVersionThe version of A/UX if it is currently executing. The result is placed into the low-order word of the response parameter. If A/UX is not executing, Gestalt returns gestaltUnknownErr.
gestaltCFMAttrCode Fragment Manager attributes.
 CONST
gestaltCFMPresent = 0;
gestaltCloseViewAttrThe CloseView attributes
 CONST
gestaltCloseViewEnabled = 0;
gestaltCloseViewDisplayMgrFriendly
= 1;
getstaltComponentMgrThe version of the Component Manager.
getstaltCompressionMgrThe version of the Image Compression Manager.
gestaltConnMgrAttrConnection Manager attributes.
 CONST
gestaltConnMgrPresent = 0;
gestaltConnMgrCMSearchFix = 1;
gestaltConnMgrErrorString = 2;
gestaltConnMgrMultiAsyncIO = 3;
 The gestaltConnMgrCMSearchFix bit flag indicates that the fix is present that allows the CMAddSearch routine to work over the mAttn channel.
gestaltCRMAttrCommunications Resource Manager attributes.
 CONST
gestaltCRMPresent = 0;
gestaltCRMPersistentFix = 1;
gestaltCRMToolRsrcCalls = 2;
gestaltCTBVersionThe version number of the Communications Toolbox (in the low-order word of the return value).
gestaltDBAccessMgrAttrThe Data Access Manager attribute.
 CONST
gestaltDBAccessMgrPresent = 0;
gestaltDictionaryMgrAttrThe Dictionary Manager attributes.
 CONST
gestaltDictionaryMgrPresent = 0;
gestaltDisplayMgrAttr The Display Manager attributes.
 CONST
gestaltDisplayMgrPresent = 0;
gestaltDITLExtAttrThe Dialog Manager extensions attributes.
 CONST
gestaltDITLExtPresent = 0;
 If this flag bit is TRUE, then the Dialog Manager extensions included in System 7 are available. See the book Inside Macintosh: Macintosh Toolbox Essentials for details about the Dialog Manager.
gestaltDragMgrAttrDrag Manager attributes.
 CONST
gestaltDragMgrPresent = 0;
gestaltEasyAccessAttrEasy Access attributes.
 CONST
gestaltEasyAccessOff = 0;
gestaltEasyAccessOn = 1;
gestaltEasyAccessSticky = 2;
gestaltEasyAccessLocked = 3;
gestaltEditionMgrAttrEdition Manager attributes.
 CONST
gestaltEditionMgrPresent = 0;
gestaltEditionMgrTranslationAware
= 1;
gestaltExtToolboxTableThe base address of the second half of the Toolbox trap table if the table is discontiguous. If the table is contiguous, this selector returns 0.
gestaltFinderAttrFinder attributes.
 CONST
gestaltFinderDropEvent = 0;
gestaltFinderMagicPlacement
= 1;
gestaltFinderCallsAEProcess
= 2;
gestaltOSLCompliantFinder = 3;
gestaltFinderSupports4GBVolumes
= 4;
gestaltFinderHandlesCFMFailures
= 5;
gestaltFinderHasClippings = 6;
gestaltFindFolderAttrThe FindFolder function attribute.
 CONST
gestaltFindFolderPresent = 0;
gestaltFirstSlotNumberThe first physical slot.
gestaltFontMgrAttrThe Font Manager attribute.
 CONST
gestaltOutlineFonts = 0;
gestaltFPUTypeA constant that represents the type of floating-point unit currently installed, if any.
 CONST
gestaltNoFPU = 0;
gestalt68881 = 1;
gestalt68882 = 2;
gestalt68040FPU = 3;
gestaltFSAttrFile system attributes.
 CONST
gestaltFullExtFSDispatching = 0;
gestaltHasFSSpecCalls = 1;
gestaltHasFileSystemManager = 2;
gestaltFSMDoesDynamicLoad = 3;
gestaltFSSupports4GBVols = 4;
gestaltHasExtendedDiskInit = 6;
gestaltFXfrMgrAttrThe File Transfer Manager attributes.
 CONST
gestaltFXfrMgrPresent = 0;
gestaltFXfrMgrMultiFile = 1;
gestaltFXfrMgrErrorString = 2;
gestaltHelpMgrAttrThe Help Manager attribute.
 CONST
gestaltHelpMgrPresent = 0;
gestaltIconUtilitiesAttrThe Icon Utilities attribute.
 CONST
gestaltIconUtilitiesPresent = 0;
gestaltKeyboardTypeA constant that represents the type of keyboard.
 CONST
gestaltMacKbd = 1;
gestaltMacAndPad = 2;
gestaltMacPlusKbd = 3;
gestaltExtADBKbd = 4;
gestaltStdADBKbd = 5;
gestaltPrtblADBKbd = 6;
gestaltPrtblISOKbd = 7;
gestaltKeyboardType
gestaltStdISOADBKbd = 8;
gestaltExtISOADBKbd = 9;
gestaltADBKbdII = 10;
gestaltADBISOKbdII = 11;
gestaltPwrBookADBKbd = 12;
gestaltPwrBookISOADBKbd = 13;
gestaltAppleAdjustKeypad = 14;
gestaltAppleAdjustADBKbd = 15;
gestaltAppleAdjustISOKbd = 16;
 If the Apple Desktop Bus (ADB) is in use, there may be multiple keyboards or other ADB devices attached to the machine. The gestaltKeyboardType selector identifies only the type of the keyboard on which the last keystroke occurred.

You cannot use this selector to find out what ADB devices are connected. For that, you can use the Apple Desktop Bus Manager, described in Inside Macintosh: Devices. Note that the ADB keyboard types described by Gestalt do not necessarily map directly to ADB device handler IDs.

Future support for the gestaltKeyboardType selector is not guaranteed. To determine the type of the keyboard last touched without using Gestalt, check the system global variable KbdType, documented in Inside Macintosh: Devices.

 If the Gestalt Manager does not recognize the keyboard type, it returns an error.
gestaltLogicalPageSizeThe logical page size. This value is defined only on machines with the MC68010, MC68020, MC68030, or MC68040 microprocessors. On a machine with the MC68000, Gestalt returns an error when called with this selector.
gestaltLogicalRAMSizeThe amount of logical memory available. This value is the same as that returned by gestaltPhysicalRAMSize when virtual memory is not installed. On some machines, however, this value might be less than the value returned by gestaltPhysicalRAMSize because some RAM may be used by the video display and the Operating System.
gestaltLowMemorySizeThe size (in bytes) of the low-memory area. The low-memory area is used for vectors, global variables, and dispatch tables.
gestaltMiscAttrInformation about miscellaneous pieces of the Operating System or hardware configuration.
 CONST
gestaltScrollingThrottle = 0;
gestaltSquareMenuBar = 2;
gestaltMixedModeVersionThe version of Mixed Mode Manager.
gestaltMMUTypeA constant that represents the type of MMU currently installed.
 CONST
gestaltNoMMU = 0;
gestaltAMU = 1;
gestalt68851 = 2;
gestalt68030MMU = 3;
gestalt68040MMU = 4;
gestaltEMMU1 = 5;
gestaltNativeCPUtypeNative CPU type.
 CONST
gestaltCPU68000 = $000;
gestaltCPU68010 = $001;
gestaltCPU68020 = $002;
gestaltCPU68030 = $003;
gestaltCPU68040 = $004;

gestaltCPU601 = $101;
 Note, to check whether the native system architecture is a MC680x0 or a PowerPC microprocessor, use the gestaltSysArchitecture selector.
gestaltNotificationMgrAttrThe Notification Manager attribute.
 CONST
gestaltNotificationPresent = 0;
gestaltNuBusConnectorsA bitmap that describes the NuBus\xC5 slot connector locations. On a Macintosh II, for example, the return value would have bits 9 through 14 set, indicating that 6 NuBus slots are present, at locations 9 through 14.
gestaltOSAttrGeneral Operating System attributes, such as whether temporary memory handles are real handles. The low-order bits of the response parameter are interpreted as bit flags. A flag is set to 1 to indicate that the corresponding feature is available. Currently, the following bits are significant:
gestaltOSAttr
CONST
gestaltSysZoneGrowable = 0;
gestaltLaunchCanReturn = 1;
gestaltLaunchFullFileSpec = 2;
gestaltLaunchControl = 3;
gestaltTempMemSupport = 4;
gestaltRealTempMemory = 5;
gestaltTempMemTracked = 6;
 See the book Inside Macintosh: Memory for a full explanation of the temporary memory features, and see the book Inside Macintosh: Processes for a full explanation of the launch control features.
gestaltOSTableThe base address of the Operating System trap dispatch table.
gestaltParityAttrInformation about the machine's parity-checking features.
 CONST
gestaltHasParityCapability = 0;
gestaltParityEnabled = 1;
 Note that parity is not considered to be enabled unless all installed memory is parity RAM.
gestaltPCXAttrPC Exchange attributes.
 CONST
gestaltPCXHas8and16BitFAT = 0;
gestaltPCXHasProDOS = 1;
gestaltPhysicalRAMSizeThe number of bytes of physical RAM currently installed.
gestaltPopupAttrThe attribute of the pop-up control definition.
 CONST gestaltPopupPresent = 0;
gestaltPowerMgrAttrPower Manager attributes.
 CONST
gestaltPMgrExists = 0;
gestaltPMgrCPUIdle = 1;
gestaltPMgrSCC = 2;
gestaltPMgrSound = 3;
gestaltPMgrDispatchExists = 4;
gestaltPPCToolboxAttrProgram-to-Program Communication (PPC) Toolbox attributes. Note that these constants are defined as masks, not bit numbers.
 CONST
gestaltPPCToolboxPresent = $0000;
gestaltPPCSupportsRealTime = $1000;
gestaltPPCSupportsIncoming = $0001;
gestaltPPCSupportsOutgoing = $0002;
gestaltProcessorTypeA constant that represents the type of microprocessor currently running.
 CONST
gestalt68000 = 1;
gestalt68010 = 2;
gestalt68020 = 3;
gestalt68030 = 4;
gestalt68040 = 5;
gestaltQuickdrawFeaturesQuickDraw features.

CONST
gestaltHasColor = 0;
gestaltHasDeepGWorlds = 1;
gestaltHasDirectPixMaps = 2;
gestaltHasGrayishTextOr = 3;
gestaltSupportsMirroring = 4;

gestaltQuickdrawVersionThe version of QuickDraw, encoded as a revision number in the low-order word of the return value. The high-order byte represents the major revision number, and the low-order byte represents the minor revision number. For example, version 1.3 of 32-Bit QuickDraw represents QuickDraw revision 2.3; its response value is $0230.
 CONST
gestaltOriginalQD = $000;
gestalt8BitQD = $100;
gestalt32BitQD = $200;
gestalt32BitQD11 = $210;
gestalt32BitQD12 = $220;
gestalt32BitQD13 = $230;
 Values having a major revision number of 1 or 2 indicate that Color QuickDraw is available, in either the 8-bit or 32-bit version. These results do not, however, indicate whether a color monitor is attached to the system. You must use high-level QuickDraw routines to obtain that information.
gestaltQuickTimeVersionThe QuickTime version.
gestaltRealtimeMgrAttrRealtime Manager attributes.
 CONST
gestaltRealtimeMgrPresent = 0;
gestaltResourceMgrAttrThe Resource Manager attribute.
 CONST
gestaltPartialRsrcs = 0;
gestaltScrapMgrAttrScrap Manager attributes.
 CONST
gestaltScrapMgrTranslationAware
= 0;
gestaltTranslationMgrHintOrder
= 1;
gestaltScriptCountThe number of script systems currently active.
gestaltScriptMgrVersionThe version number of the Script Manager (in the low-order word of the return value).
gestaltSerialAttrSerial hardware attributes of the machine, such as whether or not the GPIa line is connected and can be used for external clocking.
 CONST
gestaltHasGPIaToDCDa = 0;
gestaltHasGPIaToRTxCa = 1;
gestaltHasGPIaToDCDb = 2;
gestaltSlotAttrSlot Manager attributes.
 CONST
gestaltSlotMgrExists = 0;
gestaltNuBusPresent = 1;
gestaltSESlotPresent = 2;
gestaltSE30SlotPresent = 3;
gestaltPortableSlotPresent = 4;
gestaltSoundAttrSound attributes.
 CONST
gestaltStereoCapability = 0;
gestaltStereoMixing = 1;
gestaltSoundIOMgrPresent = 3;
gestaltBuiltInSoundInput = 4;
gestaltHasSoundInputDevice = 5;
gestaltPlayAndRecord = 6;
gestalt16BitSoundIO = 7;
gestaltStereoInput = 8;
gestaltLineLevelInput = 9;
gestaltSndPlayDoubleBuffer = 10;
gestaltMultiChannels = 11
gestalt16BitAudioSupport = 12;
gestaltSoundAttr
If the bit gestaltStereoCapability is TRUE, the available hardware can play stereo sounds. The bit gestaltStereoMixing indicates that the sound hardware of the machine mixes both left and right channels of stereo sound into a single audio signal for the internal speaker. The gestaltSoundIOMgrPresent bit indicates that the new sound input routines are available, and the
gestaltBuiltInSoundInput bit indicates that a built-in sound input device is available. The gestaltHasSoundInputDevice bit indicates that some sound input device is available.

Note, bits 7 through 12 are not defined for versions of the Sound Manager prior to version 3.0.

gestaltSpeechAttrSpeech Manager attributes.
 CONST
getaltSpeechMgrPresent = 0;
getaltSpeechHasPPCGlue = 1;
gestaltStandardFileAttrStandard File Package attributes.
 CONST
gestaltStandardFile58 = 0;
gestaltStandardFileTranslationAware
= 1;
gestaltStandardFileHasColorIcons
= 2;
 If the gestaltStandardFile58 flag bit is set, you can call the four new procedures--StandardPutFile, StandardGetFile, CustomPutFile, and CustomGetFile--introduced with System 7. (The name of the constant reflects the enabling of selectors 5 through 8 on the trap macro that handles the Standard File Package.)
gestaltStdNBPAttrInformation about the StandardNBP (Name-Binding Protocol) function.
 CONST
gestaltStdNBPPresent = 0;
gestaltSysArchitectureThe native system architecture.
 CONST
gestalt68k = 1;
gestaltPowerPC = 2;
 If the gestalt68k flag bit is set, the native microprocessor is a MC680x0 chip. If the gestaltPowerPC flag bit is set, the native microprocessor is a PowerPC chip.
gestaltTEAttrTextEdit attributes.
 CONST
gestaltTEHasGetHiliteRgn = 0;
gestaltTermMgrAttrTerminal Manager attributes.
 CONST
gestaltTermMgrPresent = 0;
gestaltTermMgrErrorString = 2;
gestaltTextEditVersionA constant that indicates which version of TextEdit is present.
 CONST
gestaltTE1 = 1;
gestaltTE2 = 2;
gestaltTE3 = 3;
gestaltTE4 = 4;
gestaltTE5 = 5;
gestaltThreadMgrAttThread Manager attributes.
 CONST
gestaltThreadMgrPresent = 0;
gestaltSpecificMatchSupport = 1;
gestaltTimeMgrVersionA constant that indicates which version of the Time Manager is present.
 CONST
gestaltStandardTimeMgr = 1;
gestaltRevisedTimeMgr = 2;
gestaltExtendedTimeMgr = 3;
gestaltToolboxTableThe base address of the Toolbox trap dispatch table.
gestaltTranslationAttrThe Translation Manager attributes.
 CONST
gestaltTranslationMgrExists = 0;
gestaltTSMgrVersionThe version of the Text Services.
gestaltVersionThe version of the Gestalt Manager (in the low-order word of the return value). The current version is 1, corresponding to a returned value of $0001.
gestaltVMAttrThe virtual memory attributes.
 CONST
gestaltVMPresent = 0;

The Gestalt function also accepts the following informational selectors.

WARNING
Never infer the existence of certain hardware or software features from the responses that Gestalt returns when you pass it an informational selector.
SelectorMeaning
gestaltHardwareAttrLow-level hardware configuration attributes.
 CONST
gestaltHasVIA1 = 0;
gestaltHasVIA2 = 1;
gestaltHasASC = 3;
gestaltHasSCC = 4;
gestaltHasSCSI = 7;
gestaltHasSoftPowerOff = 19;
gestaltHasSCSI961 = 21;
gestaltHasSCSI962 = 22;
gestaltHasUniversalROM = 24;
 The gestaltHasSCSI bit means the machine is equipped with a SCSI implementation based on the 53C80 chip, which was introduced in the Macintosh Plus. This bit is 0 on computers with a different SCSI implementation. Those computers set the gestaltHasSCSI961 or gestaltHasSCSI962 bit to report a SCSI implementation based on the 53C96 chip installed on an internal or external bus, respectively.

The gestaltHasSCC bit is normally returned as 0 on the Macintosh IIfx and Macintosh Quadra 900 computers, which have intelligent I/O processors that isolate the hardware and make direct access to the SCC impossible. However, if the user has used the Compatibility Switch control panel to enable compatibility mode, gestaltHasSCC is set.

gestaltMachineIconThe icon family resource ID for the current type of Macintosh.
gestaltMachineTypeA constant that indicates the model of computer.
 CONST
gestaltClassic = 1;
gestaltMacXL = 2;
gestaltMac512KE = 3;
gestaltMacPlus = 4;
gestaltMacSE = 5;
gestaltMacII = 6;
gestaltMacIIx = 7;
gestaltMacIIcx = 8;
gestaltMacSE030 = 9;
gestaltPortable = 10;
gestaltMachineType

 

gestaltMacIIci = 11;
gestaltMacIIfx = 13;
gestaltMacClassic = 17;
gestaltMacIIsi = 18;
gestaltMacLC = 19;
gestaltQuadra900 = 20;
gestaltPowerBook170 = 21;
gestaltQuadra700 = 22;
gestaltClassicII = 23;
gestaltPowerBook100 = 24;
gestaltPowerBook140 = 25;
gestaltQuadra950 = 26;
gestaltMacLCIII = 27;
gestaltPowerBookDuo210 = 29;
gestaltMacCentris650 = 30;
gestaltPowerBookDuo230 = 32;
gestaltPowerBook180 = 33;
gestaltPowerBook160 = 34;
gestaltMacQuadra800 = 35;
gestaltMacLCII = 37;
gestaltPowerBookDuo250 = 38;
gestaltMacIIvi = 44;
gestaltPerforma600 = 45;
gestaltMacIIvx = 48;
gestaltMacColorClassic = 49;
gestaltPowerBook165c = 50;
gestaltMacCentris610 = 52;
gestaltMacQuadra610 = 53;
gestaltPowerBook145 = 54;
gestaltMacLC520 = 56;
gestaltMacCentris660AV = 60;
gestaltPowerBook180c = 71;
gestaltPowerBookDuo270c = 77;
gestaltMacQuadra840AV = 78;
gestaltPowerBook165 = 84;
gestaltMacTV = 88;
gestaltMacLC475 = 89;
gestaltMacLC575 = 92;
gestaltMacQuadra605 = 94;
gestaltPowerMac8100_80 = 65;
gestaltPowerMac6100_60 = 75;
gestaltPowerMac7100_66 = 112;
 To obtain a string containing the machine's name, you can pass the returned value to the GetIndString procedure as an index into the resource of type 'STR#' in the System file having the resource ID defined by the constant kMachineNameStrID.
 CONST
kMachineNameStrID = -16395;
gestaltROMSizeThe size of the installed ROM, in bytes. The value is returned in only one word.
gestaltROMVersionThe version number of the installed ROM (in the low-order word of the return value).
gestaltSystemVersionThe version number of the currently active System file, represented as four hexadecimal digits in the low-order word of the return value. For example, if your application is running in version 7.0.1, then Gestalt returns the value $0701. Ignore the high-order word of the returned value.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996