About the Gestalt Manager
With the proliferation of types of Macintoshes, it becomes increasingly
difficult to keep track of which version of ROM, which CPU and what kind of
hardware and software configuration comprise an operating environment.
Formerly, SysEnvirons performed these duties but with System 7.0, Apple
decided to package a comprehensive set of utilities in a new Gestalt Manager. "Gestalt" is a German word for the concept of affirming a whole and complete
situational awareness as opposed to deriving an understanding by analyzing a
situation's individual elements.
type of machine; System file version; CPU; keyboard; type of FPU (if any);
type of MMU (if any); size of available RAM; amount of available virtual
memory; features of the various drivers and managers (including version
numbers); QuickDraw version; and the presence of the A/UX operating system.
Two additional functions, after Gestalt, let your application register new software features with the operating system (NewGestalt) and change a particular Gestalt function to something else of your choosing itself and offer its services to other applications.
Apple recommends its use over both of the earlier pieces of orientation
software.
To use Gestalt, your program passes it a selector code. The selector code is just a request for a specific piece of information. Some selectors are
pre- defined, while others can be application- defined and registered with
sub-types of pre- defined selectors: those that give an indication of a feature's
existence; and those that only provide information. They are referred to as
environmental and informational selectors, respectively.
Once Gestalt gets a request, it looks for an answer and (if successful) returns it in a response parameter. An error code results if it can't find the
requested information.
Apple supplies a strong caveat when it comes to the difference between
environmental and informational selectors. Informational selectors, it says,
are only for educational purposes and should never be employed as an
indication that a feature is actually present.