TweetFollow Us on Twitter

MACINTOSH C
MACINTOSH C: A Hobbyist's Guide To Programming the Mac OS in C
Version 2.3

© 2000 K. J. Bricknell

Go to Contents

(Chapter 6)

THE APPEARANCE MANAGER

A link to the associated demonstration program listing is at the bottom of this page




Introduction

The Appearance Manager, which was first introduced with Mac OS 8.0, had implications for the Menu Manager, the Window Manager, the Control Manager, and the Dialog Manager. The relatively minor implications in respect of the Menu Manager and Window Manager were incorporated into Chapter 3 - Menus and Chapter 4 - Windows. The most profound impact of the Appearance Manager, however, has been in the area of user interface objects known as controls, which are addressed at Chapter 7 - Introduction to Controls and at Chapter 14 - More on Controls. Accordingly, as a preparation for what is to come, this chapter now formally introduces the Appearance Manager, a component of the system software which represents the most significant improvement in the Macintosh user experience since the introduction of System 7.

Although introduced with Mac OS 8.0, the Appearance Manager's full impact on the Macintosh user experience was not scheduled to be realised until the release of Mac OS 8.5. Mac OS 8.5 was to be the first release to include several switchable themes, one of which (the Platinum theme) had, in fact, been included in Mac OS 8.0. The concept of switchable themes was the main driving force behind the creation of the Appearance Manager.

Essentially, a theme was intended to be an interface "look" that spanned all elements of the user interface (windows, menus, dialog boxes, controls, background colours, alert icons, etc), tying them together with a certain graphic design. Fig 1 shows the same window as it would have appeared in the three themes originally intended to be included in Mac OS 8.5. If one of these themes had been selected by the user, all elements of the user interface (menus, windows, controls, etc.) would have appeared in that theme.

(Themes)

The two additional themes (High Tech and Gizmo) shown at Fig 1 were included in pre-release versions of Mac OS 8.5; however, prior to final release, these two themes were deleted. The reasons for this decision by Apple remain tantalisingly obscure.

Themes - New Definition

Mac OS 8.5 did, in fact, introduce a theme scheme, though one of an entirely different flavour to that described above. This is reflected in the Appearance control panel introduced with Mac OS 8.5, in which the Platinum theme is now referred to as the Platinum appearance. An appearance (new definition) is now simply one component of a broader set of user preferences known as a theme (new definition). With the release of Mac OS 8.5, therefore, the term "theme" took on an entirely new meaning.

Under Mac OS 8.5 and later, an individual theme is a set of user preferences encompassing:

  • An appearance (which unifies the look of human interface objects such as windows, dialog boxes, alert boxes, menus, controls, etc.), together with a highlight colour (for selected text) and a variation colour (for menus and controls). (As of Mac OS 8.6, Platinum remains the only appearance provided by Apple.)

  • A large system font (for menus and headings), a small system font (for explanatory text and labels), a views font (for lists and icons), and an option to turn anti-aliasing of fonts on screen on or off.

  • A desktop picture and desktop pattern.

  • Sound preferences relating to opening menus and choosing items, dragging and resizing windows, interacting with controls, and clicking, dragging, and dropping in the Finder.

  • Scrolling preference (smart scrolling on or off) and collapse-window preference (double-click title bar to collapse window on or off).

Theme-Compliance

Another significant terminological change ushered in by Mac OS 8.5 was that, whereas Apple documentation previously spoke of making applications appearance-compliant, documentation released following the release of Mac OS 8.5 speaks of making applications theme-compliant. It is assumed that the reason for this change is that, while the vast bulk of the measures required to make an application theme-compliant relate to unifying the look of the application's user interface elements (the province of an appearance), there are additional measures that the application may take, or may have to take:

  • In response to the user changing the system and/or views fonts, using the Fonts tab of the Appearance control panel, while the application is running. (This consideration does not apply if the application uses standard human interface elements (that is, system-defined windows, controls, and menus), since the fonts used for these elements automatically change with the theme change. However, some applications may use custom human interface elements and may, for example, draw their own text in a dialog box. In such cases, the application must ensure that the fonts used match the corresponding system fonts in the current theme.)

  • To cause theme-compliant sounds to accompany, for example, the opening and closing of the application's windows and the manipulation by the user of custom human interface elements.

  • To support the proportional scroll boxes the user expects when Smart Scrolling is selected on in the Options tab of the Appearance control panel.

The Appearance Manager

The Appearance Manager, whose influence is evident to a greater or lesser extent in all Macintosh C demonstration programs and in many chapters of this book:

  • Coordinates the look of human interface elements and provides the underlying support for themes, particularly appearances.

  • Enables you to adapt your application's custom human interface elements (if any) to the coordinated system-wide look, that is, to make those elements theme-compliant.

Appearance Manager Versions

The version of the Appearance Manager delivered with Mac OS 8.5 (Version 1.1) is included in the System file. Previous versions were delivered as extensions. These extensions can be installed and used on Macintoshes and Power Macintoshes running System 7.1 through 7.6.1 (as well as Power Macintoshes running Mac OS 8.0 or 8.1), meaning that theme-compliant applications running on the System 7 systems can present their human interface elements in the chosen appearance.

The Appearance Manager versions delivered as extensions are Versions 1.0, 1.0.1, 1.0.2, and 1.0.3. Version 1.0.2 or, preferably, Version 1.0.3 must be used on Macintoshes and Power Macintoshes running System 7.1 through 7.6.1. Versions 1.0 and 1.0.1 were delivered with, respectively, Mac OS 8.0 and 8.1; however, it is advisable to upgrade to Version 1.0.2 or, preferably, Version 1.0.3 on such systems.

The only difference between Versions 1.0.1 and 1.0.2 is that Version 1.0.2 contains extra code (for backward compatibility) and the ".Keyboard" font. The ".Keyboard" font is used to display keyboard glyphs in menus.

The only difference between Versions 1.0.2 and 1.0.3 is that Version 1.0.3 no longer contains the ".Keyboard" font. In Version 1.0.3, this font is delivered as a separate suitcase, which should be installed into the Fonts folder in the System folder. The purpose of this latter is to avoid a font ID conflict between the ".Keyboard" font and Microsoft Internet Explorer's Arial font.

New Definition Functions

To provide a system-wide coordination of look and behaviour, new theme-compliant definition functions were introduced with the Appearance Manager to replace the old pre-Appearance Manager definition functions for menu bars, menus, windows, and controls. In addition, many new theme-compliant control definition functions for new types of controls (slider controls, focus rings, group boxes, etc.) were introduced to obviate the necessity for developers to provide their own.

Mapping of Pre-Appearance Definition Functions

Another way in which the Appearance Manager achieved a unified look and behaviour was by mapping the following standard pre-Appearance definition functions to their theme-compliant equivalents:

  • The menu bar definition function (MBDF) with resource ID 0.

  • The menu definition function (MDEF) with resource ID 0.

  • The window definition function (WDEF) with resource ID 0. (Document windows).

  • The window definition function (WDEF) with resource ID 124. (Utility windows).

  • The control definition function (CDEF) with resource ID 0. (Buttons, checkboxes, and radio buttons).

  • The control definition function (CDEF) with resource ID 1. (Scroll bars).

  • The control definition function (CDEF) with resource ID 63. (Pop-up menus).
Mapping is implemented by a set of mapper definition functions. The mappers have the same resource ID as the pre-Appearance definition functions to which they relate.

Under Mac OS 8.5 (Appearance Version 1.1), mapping on a system-wide basis is permanently on. In earlier versions of the Appearance Manager:

  • Mapping on a system-wide basis only occurs when the user has selected system-wide Appearance on in the Appearance control panel.

  • You can ensure that mapping on an individual application basis will occur when the user has selected system-wide Appearance off in the Appearance control panel by calling the function RegisterAppearanceClient within your application.
Of course, no mapping occurs if your application specifies the new theme-compliant definition functions, which means that those definition functions will be called directly. The left side of Figure 2 shows the ways by which it is determined how, and whether, mapping will occur for a standard definition function, in this case for the pre-Appearance WDEF for document windows (resource ID 0). The right side of Fig 2 shows the theme-compliant control definition function being called directly.

(Mapping and calling directly)

The RegisterAppearanceClient Function

The following describes the RegisterAppearanceClient function.

Function Description
RegisterAppearanceClient This function must be called at the beginning of your application, prior to initialising or drawing any onscreen elements or invoking any definition functions, such as the menu bar.

Under Appearance Manager 1.0.3 and earlier, applications that call this function will continue to have the chosen appearance when system-wide appearance is selected off in the Appearance control panel.

This function automatically maps standard pre-Appearance definition functions to their theme-compliant equivalents. Although they will not make use of mapping, applications that specify theme-compliant definition function IDs directly should also call this function in order to receive Appearance Manager Apple events (see Chapter 10 - Apple Events).

Disadvantages of Calling a Definition Function Via a Mapper

When an theme-compliant definition function is called via the mappers, the associated object may have a slightly different look and behaviour than is the case when it is called directly. For example:

  • Since a standard pre-Appearance WDEF cannot specify the inclusion of a horizontal zoom box, when a pre-Appearance WDEF is mapped to an theme-compliant WDEF, the resulting window will not have a horizontal zoom box.

  • It is never necessary to call DrawGrowIcon to have the grow icon drawn in a window's size box when an theme-compliant WDEF is called directly. However, when it is called via the mapper, DrawGrowIcon must be called once for the grow icon to be drawn.

  • When the theme-compliant WDEF for modal and movable modal dialog boxes is called via the mapper, the three-pixel-wide space between the content region and the structure region created by the pre-Appearance WDEF will remain. This space created certain difficulties in the past. When the theme-compliant WDEF is called directly, the three-pixel-wide space is banished.
For these reasons, and to eliminate the overhead involved in calling an theme-compliant definition function through the mappers, it is best to call the theme-compliant definition function directly.

Mapping of Custom Definition Functions

Custom definition functions cannot be automatically mapped to theme-compliant equivalents. However, the Appearance Manager does provide ways to coordinate custom user interface elements with the correct appearance. For example, calling DrawThemeListBoxFrame would create an theme-compliant frame for a custom list box.

Checking For the Presence of Appearance Manager

Before calling any functions dependent upon the Appearance Manager's presence, your application should check for the presence of the Appearance Manager.

The Gestalt function (see Chapter 23 - Miscellany) may be used to acquire a wide range of information about the operating environment, and may be used to determine:

  • Whether the Appearance Manager and its functions are present.

  • Whether the Macintosh is currently in compatibility mode, that is, whether the user has switched system-wide Appearance off in the Appearance control panel. . (This applies only under Appearance Manager 1.0.3 and earlier.)

  • The version of the Appearance Manager that is present.
You pass a selector in the selector parameter of Gestalt and the function returns a response in the response parameter. The following example shows how to, in sequence, check that the Appearance Manager is present, determine whether system-wide Appearance is on, and determine the version of the Appearance Manager that is present.

     OSErr    osError;
     SInt32   response;
     Boolean  appearancePresent    = false;
     Boolean  appearance101present = false;
     Boolean  appearance110present = false;
     Boolean  inCompatibilityMode  = false;

     osError = Gestalt(gestaltAppearanceAttr,&response);

     // If Gestalt returns no error and the bit in response represented by the constant
     // gestaltAppearanceExists is set, proceed, otherwise exit with an error message.

     if(osError == noErr && (BitTst(&response,31 - gestaltAppearanceExists)))
     {
       // At least Version 1.0 is present.  Set a flag.

       appearancePresent = true;

       // If the bit in response represented by the constant gestaltAppearanceCompatMode
       // is set, system-wide Appearance is off.  The result of this check will be
       // relevant only where Versions 1.0 through 1.0.3 are present.

       if(BitTst(&response,31 - gestaltAppearanceCompatMode))
         inCompatibilityMode = true;

       // Call Gestalt again with the gestaltAppearanceVersion selector.

       Gestalt(gestaltAppearanceVersion,&response);

       // If the low order word in response is 0x0101, Version 1.0.1, 1.0.2, or 1.0.3 is
       // present. If the low order word in response is 0x0110, Version 1.1 is available.

       if(response == 0x00000101)
         gAppearance101present = true;
       else if(response == 0x00000110)
         gAppearance110present = true;
     }
     else
     {
       // Present nil-Appearance error alert presented here, then exit.
     }

Colours, Patterns, and the Current Appearance

The Appearance Manager provides drawing primitives, and the means to set the colours and patterns, needed to draw consistently in the current appearance. Using these drawing primitives, colours, and patterns makes it easier to create visual entities and custom definition functions that are consistent with the current appearance.

Drawing Appearance Primitives

The Appearance Manager provides functions for drawing Appearance primitives. As will become apparent at Chapter 7 - Introduction to Controls and at Chapter 14 - More on Controls, most of these primitives relate to certain controls. The control definition functions for these controls call these primitives when drawing the relevant control. For example, the control definition function for a primary group box calls the primitive DrawThemePrimaryGroup to draw the theme-compliant visual representation of that control.

Your application might use these primitives to, for example:

  • Draw a theme-compliant image of a placard, window header, edit text field frame, etc., when you don't want to use a control.

  • Assist you in making a custom list box theme-compliant by using DrawThemeListBoxFrame to draw the frame and DrawThemeFocusRect to draw the focus ring.
The following are examples of functions that draw Appearance primitives. Those appearing on a light blue background are available only in Appearance Version 1.0.1 through 1.0.3 and later. Those appearing on a dark blue background are available only in Appearance Version 1.1 and later.

Function Description
DrawThemePrimaryGroup Draws a primary group box frame consistent with the current appearance.
DrawThemeSecondaryGroup Draws a secondary group box frame consistent with the current appearance. Allows you to nest a secondary group box frame within the primary group box frame.
DrawThemeSeparator Draws a separator line consistent with the current appearance. The orientation of the rectangle determines where the separator line is drawn. If the rectangle is wider than it is tall, the separator line is horizontal; otherwise it is vertical.
DrawThemeWindowHeader Draws a window header consistent with the current appearance. This function draws a window header such as that used by the Finder. The window header is drawn inside the rectangle that is passed.
DrawThemeWindowListViewHeader Draws a window list view header, such as that used by the Finder, consistent with the current appearance. The header is drawn inside the rectangle that is passed in. A window list view header is drawn without a line on its bottom edge, so that bevel buttons can be placed against it without overlapping.
DrawThemePlacard Draws a placard consistent with the current appearance.
DrawThemeEditTextFrame Draws an edit text field frame consistent with the current appearance. The rectangle passed in should be the same as the one passed in the function DrawThemeFocusRect (see below) so you get the correct focus look for your edit text field control. You should not use these frames for items other than edit text fields.
DrawThemeListBoxFrame Draws a list box frame consistent with the current appearance. The rectangle passed in should be the same as the one passed into the function DrawThemeFocusRect (see below) so that you get the correct focus look for your list box.
DrawThemeFocusRect Draws or erases a focus ring around a specified rectangle consistent with the current theme. To achieve the right look, you should first call DrawThemeEditTextFrame or DrawThemeListBoxFrame and then call DrawThemeFocusRect, passing the same rectangle in the inRect parameter. If you use DrawThemeFocusRect to erase the focus ring around an edit text field frame or list box frame, you will have to redraw the edit text field frame or list box frame because there is typically an overlap.
DrawThemeModelessDialogFrame Draws a modeless dialog box frame, like the one drawn by the Dialog Manager, consistent with the current appearance. This function may be used to make a custom modeless dialog box theme-compliant. The purpose of the modeless dialog frame is to assist in making modeless dialog windows visually distinguishable from normal document windows.
DrawThemeGenericWell Draws an image well frame consistent with the current appearance. Image well frames are for use with custom image well controls. You can specify that the center of the well be filled with white
DrawThemeFocusRegion Draws or erases an theme-compliant focus ring around a specified region. Ensure that Appearance 1.0.1 or later is present before calling this function.
DrawThemeTabPane Draws a tab-pane consistent with the current appearance.
DrawThemeTab Draws a tab consistent with the current appearance.

Fig 3 and Fig 4 show examples, in the Platinum appearance, of images drawn in both the active and inactive modes using the Appearance primitives.

(Images drawn with Appearance primitives)

(Modeless dialog frame drawn with primitive)

Draw State Constants

The following constants are passed in the inState parameter of all of these functions (except DrawThemeFocusRect and DrawThemeFocusRegion) to specify whether the primitive should be drawn in the active or deactivated mode.

Constant Value Description
kThemeStateDisabled 0 Draw the primitive in the inactive mode.
kThemeStateActive 1 Draw the primitive in the active mode.

DrawThemeFocusRect and DrawThemeFocusRegion either draw or erase the focus rectangle depending on whether true or false is passed in the inHasFocus parameter.

Another draw state constant (kThemeStatePressed) is available to draw certain primitives in the pressed mode; however, the primitives listed above can only be drawn in the active and inactive modes.

Drawing in Colours and Patterns Consistent With the Current Appearance

The following functions are those used to draw using colours/patterns consistent with the current appearance. (Patterns are explained at Chapter 11 - QuickDraw Preliminaries.) The reference to colours and patterns reflects the fact that, depending on the current appearance, either a colour or a pattern may be used for the drawing.

Function Description
SetThemeWindowBackground Sets the theme-compliant colour/pattern that the window background will be repainted to when PaintOne is called. This function sets the colour/pattern to which the Window Manager will erase the window background.

See also Theme-Compliant Brush Type Constants, below.

SetThemeBackground Sets an element's background colour/pattern to comply with the current appearance. This function should be called each time you wish to draw an element in a specified brush constant using Appearance Manager draw functions.

See also Theme-Compliant Brush Type Constants, below.

SetThemePen Sets an element's pen pattern or colour to comply with the current appearance. This function should be called each time you wish to draw an element in a specified brush constant using Appearance Manager draw functions.

See also Theme-Compliant Brush Type Constants, below.

SetThemeTextColor Sets an element's foreground colour for drawing text to comply with the current appearance. This function is typically used inside a DeviceLoop drawing procedure to set the foreground colour for drawing text in order to coordinate with the current appearance.

See also Theme-Compliant Text Colour Constants, below.

Theme-Compliant Brush Type Constants

The following constants, which are of type ThemeBrush, may be passed in the inBrush parameter of calls to SetThemeWindowBackground, SetThemeBackground, and SetThemePen to specify theme-compliant colours or patterns for user interface elements. For reasons explained above, these constants can represent either a straight colour or a pattern.

Constant Description
kThemeBrushDialogBackgroundActive
kThemeBrushDialogBackgroundInactive
An active dialog box's background colour/ pattern.
An inactive dialog box's background colour or pattern.
kThemeBrushAlertBackgroundActive
kThemeBrushAlertBackgroundInactive
An active alert box's background colour/pattern.
An inactive alert box's background colour/pattern.
kThemeBrushModelessDialogBackgroundActive
kThemeBrushModelessDialogBackgroundInactive
An active modeless dialog box's background colour/pattern.
An inactive modeless dialog box's background colour/pattern.
kThemeBrushUtilityWindowBackgroundActive
kThemeBrushUtilityWindowBackgroundInactive
An active utility window's background colour/pattern.
An inactive utility window's background colour/pattern.
kThemeBrushListViewSortColumnBackground The background colour/pattern of the column upon which a list view is sorted.
kThemeBrushListViewBackground The background colour/pattern of a list view column that is not being sorted upon.
kThemeBrushListViewSeparator A list view separator's colour/pattern.
kThemeBrushDocumentWindowBackground A document window's background colour/pattern.
kThemeBrushFinderWindowBackground A Finder window's background colour/pattern. Generally, you should not use this constant unless you are trying to create a window that matches the Finder window.

Theme-Compliant Text Colour Constants

Constants of type ThemeTextColor may be passed in the inColor parameter of the function SetThemeTextColor to specify theme-compliant text colours for user interface elements in their active, inactive, and highlighted states. Some of these constants are as follows:

Constant Description
kThemeTextColorWindowHeaderActive
kThemeTextColorWindowHeaderInactive
Text colour for active window header.
Text colour for inactive window header.
kThemeTextColorPlacardActive
kThemeTextColorPlacardInactive
kThemeTextColorPlacardPressed
Text colour for active placard.
Text colour for inactive placard.
Text colour for highlighted placard.
kThemeListViewTextColor Text colour for list view.

Saving and Setting the Colour Graphics Port Drawing State

Chapter 12 - Drawing With QuickDraw addresses certain measures which need to be taken consequential to the fact that both colours and patterns can be used by the Appearance functions SetThemeWindowBackground, SetThemeBackground, and SetThemePen. These measures have to do with saving, restoring, and normalising the drawing state of the graphics port.

Version 1.1 of the Appearance Manager introduced new functions which simplify this process. These functions, the uses of which are addressed at Chapter 12, are as follows:

Constant Description
GetThemeDrawingState Obtain the drawing state of the current colour graphics port.
SetThemeDrawingState Set the drawing state of the current graphics port.
NormalizeThemeDrawingState Set the current colour graphics port to the default drawing state.
DisposeThemeDrawingState Release the memory associated with a reference to a graphics port's drawing state.

Theme-Compliant Cursors

Version 1.1 of the Appearance Manager introduced cursors that can change appearance with an appearance change. The associated functions, the uses of which are addressed at Chapter 13 Ń Offscreen Graphics Worlds, Pictures, Cursors, and Icons, are as follows:

Constant Description
SetThemeCursor Sets the cursor to a version of the cursor consistent with the current appearance.
SetAnimatedThemeCursor Animates a version of the cursor that is consistent with the current appearance.

Appearance Manager Apple Events

As previously stated, your application may need to respond to the user changing the system and/or views fonts using the Fonts tab in the Appearance control panel. In addition, because an appearance change might result in a change to menu bar height, window structure dimensions, and colours and patterns currently in use, your application may also need to respond to the user changing the current appearance using the Appearance tab in the Appearance control panel..

Provided you have called RegisterAppearanceClient, your application is advised of font and appearance changes via Appearance Manager Apple events. Appearance Manager Apple events are addressed at Chapter 10 Ń Apple Events.

Theme-Compliant Applications

Making a New Application Theme-Compliant

The main consideration involved in making your application theme-compliant is to allow the system to do as much of your interface work as possible. The following lists the actions required to make a new application theme-compliant:

  • Call RegisterAppearanceClient early in your application code, prior to drawing any on-screen elements or invoking any definition functions. For many applications, this will be the only action required to render the application fully theme-compliant.

  • Use the system-supplied theme-compliant menu and window definition functions.

  • As will be explained at Chapter 7 - Introduction to Controls and at Chapter 14 - More on Controls, use the system-supplied theme-compliant control definition functions.

  • As will be explained at Chapter 8 - Dialogs and Alerts:

    • Use the new 'dlgx' and 'alrx' resources to supplement your 'DLOG' and 'ALRT' resources.

    • Enable embedding and theme-compliant backgrounds.

    In addition, and because the Appearance Manager introduces a movable modal alert and simplifies the handling of movable modal alert and dialog boxes, make all your alerts and dialogs movable. Also use the StandardAlert routine, introduced with the Appearance Manager, to create your alerts whenever possible.

  • Where you absolutely cannot use the system-supplied definition functions, use Appearance Manager functions in your custom definition functions to ensure that your custom human interface elements are theme-compliant.

  • Use Appearance Manager functions and constants to get any colours/patterns you need to draw consistently with the current appearance, and to draw theme-compliant visual entities such as window headers when you don't want to use a control of that type.

  • Because the measurements of standard interface objects may vary from appearance to appearance, make no assumptions about the dimensions of menus, windows, or controls. (For example, if you assume an unchanging menu bar height in order to position your windows, you could end up with the menu bar overlapping your windows after an appearance change.) Use Appearance Manager functions such as GetThemeMenuBarHeight to obtain the measurements used in the current appearance.

  • Use the Appearance Manager functions SetThemeCursor and SetAnimatedThemeCursor to ensure that your application's cursors are theme-compliant.

Making Old Applications Theme-Compliant

Ultimately, the task of making an old non-theme-compliant application fully theme-compliant will involve all of the steps listed at Making a New Application Theme-Compliant, above.

The task may be phased, however, by taking one simple initial step. That step is to simply insert a call to RegisterAppearanceClient early in your code. This will cause the mappers to invoke the new definition functions.

When converting an application under Versions 1.0 through 1.0.3 of the Appearance Manager, be sure to select system-wide Appearance off in the Appearance control panel. This puts your system back into the old System 7 look for applications that have not adopted Appearance, which makes it easy for you to tell where you have implemented the new look and where you still have work to do. (If you are running with system-wide Appearance selected on, you will not be able to distinguish the changes you've made from those performed automatically by the system.)

Memory Requirements

Some appearances may use simple rectangular shapes, and some may use complex, non-rectangular shapes, for their interface elements. Accordingly, the variable length Region structures in which the descriptions of these shapes are stored will occupy more or less memory depending on the current appearance. If your application's memory usage is fine-tuned on the basis of an appearance which uses simple rectangular shapes for its interface elements, you will need to increase the heap size to account for the possibility that the user will choose an appearance whose interface element shapes are more complex.


Main Constants, Data Types, and Functions

In the following:

  • Those items appearing in light blue are available only only with Appearance Version 1.0.1 through 1.0.3 and later.

  • Those items appearing in dark blue are available only with Appearance Version 1.1 and later.

Constants

Checking For Appearance, Appearance Functions, and Version

gestaltAppearanceAttr        = FOUR_CHAR_CODE('appr')
gestaltAppearanceExists      = 0
gestaltAppearanceCompatMode  = 1
gestaltAppearanceVersion     = FOUR_CHAR_CODE('apvr')

Theme-Compliant Brush Type Constants

kThemeBrushDialogBackgroundActive           = 1
kThemeBrushDialogBackgroundInactive         = 2
kThemeBrushAlertBackgroundActive            = 3
kThemeBrushAlertBackgroundInactive          = 4
kThemeBrushModelessDialogBackgroundActive   = 5
kThemeBrushModelessDialogBackgroundInactive = 6
kThemeBrushUtilityWindowBackgroundActive    = 7
kThemeBrushUtilityWindowBackgroundInactive  = 8
kThemeBrushListViewSortColumnBackground     = 9
kThemeBrushListViewBackground               = 10
kThemeBrushListViewSeparator                = 12
kThemeBrushDocumentWindowBackground         = 15
kThemeBrushFinderWindowBackground           = 16

Theme-Compliant Text Colour Constants

kThemeTextColorWindowHeaderActive           = 7
kThemeTextColorWindowHeaderInactive         = 8
kThemeTextColorPlacardActive                = 9
kThemeTextColorPlacardInactive              = 10
kThemeTextColorPlacardPressed               = 11
kThemeTextColorListView                     = 22

Theme-Compliant Draw State Constants (For Primitives)

kThemeStateDisabled  = 0
kThemeStateActive    = 1
kThemeStatePressed   = 2

Theme Cursor Constants

kThemeArrowCursor                 = 0
kThemeCopyArrowCursor             = 1
kThemeAliasArrowCursor            = 2
kThemeContextualMenuArrowCursor   = 3
kThemeIBeamCursor                 = 4
kThemeCrossCursor                 = 5
kThemePlusCursor                  = 6
kThemeWatchCursor                 = 7   // Can animate
kThemeClosedHandCursor            = 8
kThemeOpenHandCursor              = 9
kThemePointingHandCursor          = 10
kThemeCountingUpHandCursor        = 11  // Can animate
kThemeCountingDownHandCursor      = 12  // Can animate
kThemeCountingUpAndDownHandCursor = 13  // Can animate
kThemeSpinningCursor              = 14  // Can animate
kThemeResizeLeftCursor            = 15
kThemeResizeRightCursor           = 16
kThemeResizeLeftRightCursor       = 17

Data Types

typedef UInt32 ThemeDrawState;
typedef SInt16 ThemeBrush;
typedef SInt16 ThemeTextColor;

Functions

Initialising the Appearance Manager

OSStatus	RegisterAppearanceClient(void);

Drawing Appearance Primitives

OSStatus  DrawThemeWindowHeader(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemeWindowListViewHeader(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemePlacard(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemeEditTextFrame(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemeListBoxFrame(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemeFocusRect(const Rect *inRect,Boolean inHasFocus)
OSStatus  DrawThemePrimaryGroup(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemeSecondaryGroup(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemeSeparator(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemeModelessDialogFrame(const Rect *inRect,ThemeDrawState inState)
OSStatus  DrawThemeGenericWell(const Rect *inRect,ThemeDrawState inState,
          Boolean inFillCenter)
OSStatus  DrawThemeFocusRegion(RgnHandle inRegion,Boolean inHasFocus)
OSStatus  DrawThemeTab(const Rect *inRect,ThemeTabStyle inStyle,
          ThemeTabDirection inDirection,ThemeTabTitleDrawUPP labelProc,UInt32 userData);
OSStatus  DrawThemeTabPane(const Rect *inRect,ThemeDrawState inState);

Drawing in Colours and Patterns Consistent With the Current Theme

OSStatus  SetThemeWindowBackground(WindowPtr inWindow,ThemeBrush inBrush,Boolean inUpdate)
OSStatus  SetThemeBackground(ThemeBrush inBrush,SInt16 inDepth,Boolean inIsColorDevice)
OSStatus  SetThemePen(ThemeBrush inBrush,SInt16 inDepth,Boolean inIsColorDevice)
OSStatus  SetThemeTextColor(ThemeTextColor inColor,SInt16 inDepth,Boolean inIsColorDevice)
OSStatus  GetThemeAccentColors(CTabHandle *outColors);
OSStatus  IsThemeInColor(SInt16 inDepth,Boolean inIsColorDevice)

Saving and Setting the Colour Graphics Port Drawing State

OSStatus  NormalizeThemeDrawingState(void);
OSStatus  GetThemeDrawingState(ThemeDrawingState *outState);
OSStatus  SetThemeDrawingState(ThemeDrawingState inState,Boolean inDisposeNow);
OSStatus  DisposeThemeDrawingState(ThemeDrawingState inState);

Setting Appearance Cursors

OSStatus  SetThemeCursor(ThemeCursor inCursor);
OSStatus  SetAnimatedThemeCursor(ThemeCursorinCursor,UInt32 inAnimationStep);
 

Go to Demo

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »

Price Scanner via MacPrices.net

Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more
Apple Watch Ultra 2 now available at Apple fo...
Apple has, for the first time, begun offering Certified Refurbished Apple Watch Ultra 2 models in their online store for $679, or $120 off MSRP. Each Watch includes Apple’s standard one-year warranty... Read more
AT&T has the iPhone 14 on sale for only $...
AT&T has the 128GB Apple iPhone 14 available for only $5.99 per month for new and existing customers when you activate unlimited service and use AT&T’s 36 month installment plan. The fine... Read more
Amazon is offering a $100 discount on every M...
Amazon is offering a $100 instant discount on each configuration of Apple’s new 13″ M3 MacBook Air, in Midnight, this weekend. These are the lowest prices currently available for new 13″ M3 MacBook... Read more

Jobs Board

Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
IT Systems Engineer ( *Apple* Platforms) - S...
IT Systems Engineer ( Apple Platforms) at SpaceX Hawthorne, CA SpaceX was founded under the belief that a future where humanity is out exploring the stars is Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.