Framework | ApplicationServices/ApplicationServices.h |
Companion guide | |
Declared in | CGDirectDisplay.h CGDirectPalette.h CGDisplayConfiguration.h CGDisplayFade.h CGError.h CGRemoteOperation.h CGSession.h CGWindowLevel.h |
Note: This document was previously titled Quartz Services Reference. Some information related to low-level events has been moved from this document into Quartz Event Services Reference.
Quartz Display Services provides direct access to certain low-level features in the Mac OS X window server related to the configuration and control of display hardware. For example, you can use Quartz Display Services to:
Examine and change display mode properties such as width, height, and pixel depth
Configure a set of displays in a single operation
Capture one or more displays for exclusive use
Perform fade effects
Activate display mirroring
Configure gamma color correction tables and color palettes
Receive notification of screen update operations
CGMainDisplayID
CGGetOnlineDisplayList
CGGetActiveDisplayList
CGGetDisplaysWithOpenGLDisplayMask
CGGetDisplaysWithPoint
CGGetDisplaysWithRect
CGOpenGLDisplayMaskToDisplayID
CGDisplayIDToOpenGLDisplayMask
CGDisplayCapture
CGDisplayCaptureWithOptions
CGDisplayRelease
CGDisplayIsCaptured
CGCaptureAllDisplays
CGCaptureAllDisplaysWithOptions
CGReleaseAllDisplays
CGShieldingWindowID
CGShieldingWindowLevel
CGDisplayAddressForPosition
CGDisplayBaseAddress
CGDisplayGetDrawingContext
CGBeginDisplayConfiguration
CGCancelDisplayConfiguration
CGCompleteDisplayConfiguration
CGConfigureDisplayMirrorOfDisplay
CGConfigureDisplayMode
CGConfigureDisplayOrigin
CGRestorePermanentDisplayConfiguration
CGConfigureDisplayStereoOperation
CGDisplaySetStereoOperation
CGDisplayCopyColorSpace
CGDisplayIOServicePort
CGDisplayIsActive
CGDisplayIsAlwaysInMirrorSet
CGDisplayIsAsleep
CGDisplayIsBuiltin
CGDisplayIsInHWMirrorSet
CGDisplayIsInMirrorSet
CGDisplayIsMain
CGDisplayIsOnline
CGDisplayIsStereo
CGDisplayMirrorsDisplay
CGDisplayModelNumber
CGDisplayPrimaryDisplay
CGDisplayRotation
CGDisplayScreenSize
CGDisplaySerialNumber
CGDisplayUnitNumber
CGDisplayUsesOpenGLAcceleration
CGDisplayVendorNumber
These functions are used to register and unregister a callback function for notification of display configuration changes.
CGDisplayBounds
CGDisplayPixelsHigh
CGDisplayPixelsWide
CGDisplayBitsPerPixel
CGDisplayBitsPerSample
CGDisplaySamplesPerPixel
CGDisplayBytesPerRow
CGDisplayAvailableModes
CGDisplayBestModeForParameters
CGDisplayBestModeForParametersAndRefreshRate
CGDisplayBestModeForParametersAndRefreshRateWithProperty
CGDisplayCurrentMode
CGDisplaySwitchToMode
CGSetDisplayTransferByFormula
CGGetDisplayTransferByFormula
CGSetDisplayTransferByTable
CGGetDisplayTransferByTable
CGSetDisplayTransferByByteTable
CGDisplayRestoreColorSyncSettings
CGDisplayGammaTableCapacity
CGPaletteCreateDefaultColorPalette
CGPaletteCreateFromPaletteBlendedWithColor
CGPaletteCreateWithByteSamples
CGPaletteCreateWithCapacity
CGPaletteCreateWithDisplay
CGPaletteCreateWithSamples
CGPaletteCreateCopy
CGPaletteRelease
CGPaletteGetColorAtIndex
CGPaletteGetIndexForColor
CGPaletteGetNumberOfSamples
CGPaletteIsEqualToPalette
CGPaletteSetColorAtIndex
CGDisplayCanSetPalette
CGDisplaySetPalette
CGConfigureDisplayFadeEffect
CGAcquireDisplayFadeReservation
CGDisplayFade
CGDisplayFadeOperationInProgress
CGReleaseDisplayFadeReservation
These functions are advisory in nature and depend on IO Kit and hardware-specific drivers to implement support. If you need extremely precise timing, or access to vertical blanking interrupts, you should consider writing a device driver to tie into hardware-specific capabilities.
CGDisplayHideCursor
CGDisplayShowCursor
CGDisplayMoveCursorToPoint
CGCursorIsVisible
CGCursorIsDrawnInFramebuffer
CGAssociateMouseAndMouseCursorPosition
CGWarpMouseCursorPosition
CGGetLastMouseDelta
You can use these functions to find out what areas on local displays are changing their appearance as the result of operations such as drawing, window movement or scrolling, and display reconfiguration.
CGRegisterScreenRefreshCallback
CGUnregisterScreenRefreshCallback
CGWaitForScreenRefreshRects
CGScreenRegisterMoveCallback
CGScreenUnregisterMoveCallback
CGWaitForScreenUpdateRects
CGReleaseScreenRefreshRects
Reserves the fade hardware for a specified time interval.
CGError CGAcquireDisplayFadeReservation ( CGDisplayReservationInterval seconds, CGDisplayFadeReservationToken *pNewToken );
The desired number of seconds to reserve the fade hardware. An application can specify any value in the interval (0, kCGMaxDisplayReservationInterval]
.
A pointer to storage (provided by the caller) for a fade reservation token. On return, the storage contains a new token.
Returns kCGErrorNoneAvailable
if another fade reservation is in effect. Otherwise, returns kCGErrorSuccess
.
Before performing a fade operation, an application must reserve the fade hardware for a specified period of time. Quartz returns a token that represents a new fade reservation. The application uses this token as an argument in subsequent calls to other display fade functions.
During the fade reservation interval, the application has exclusive rights to use the fade hardware. At the end of the interval, the token becomes invalid and the hardware automatically returns to a normal state. Typically the application calls CGReleaseDisplayFadeReservation
to release the fade reservation before it expires.
CGDisplayFade.h
Connects or disconnects the mouse and cursor while an application is in the foreground.
CGError CGAssociateMouseAndMouseCursorPosition ( boolean_t connected );
Pass true
if the mouse and cursor should be connected; otherwise, pass false
.
A result code. See “Quartz Display Services Result Codes.”
When you call this function to disconnect the cursor and mouse, all events received by your application have a constant absolute location but contain mouse delta (change in X and Y) data. You may hide the cursor or change it into something appropriate for your application. You can reposition the cursor by using the function CGDisplayMoveCursorToPoint
or the function CGWarpMouseCursorPosition
.
CGRemoteOperation.h
Begins a new set of display configuration changes.
CGError CGBeginDisplayConfiguration ( CGDisplayConfigRef *pConfigRef );
A pointer to storage you provide for a display configuration. On return, your storage contains a new display configuration.
A result code. If the object is successfully created, the result is kCGErrorSuccess
. For other possible values, see “Quartz Display Services Result Codes.”
This function creates a display configuration object that provides a context for a set of display configuration changes. After you specify the desired changes, you use CGCompleteDisplayConfiguration
to apply them in a single transaction.
CGDisplayConfiguration.h
Cancels a set of display configuration changes.
CGError CGCancelDisplayConfiguration ( CGDisplayConfigRef configRef );
The display configuration to cancel. On return, the configuration is cancelled and is no longer valid.
A result code. See “Quartz Display Services Result Codes.”
This function is used to abandon a display configuration. As a side effect, the display configuration object is released.
CGDisplayConfiguration.h
Captures all attached displays.
CGDisplayErr CGCaptureAllDisplays ( void );
A result code. See “Quartz Display Services Result Codes.”
This function captures all attached displays in a single operation. This operation provides an immersive environment for your application, and it prevents other applications from trying to adjust to display changes.
CGDirectDisplay.h
Captures all attached displays, using the specified options.
CGDisplayErr CGCaptureAllDisplaysWithOptions ( CGCaptureOptions options );
The options to use. See “Display Capture Options.”
A result code. See “Quartz Display Services Result Codes.”
This function allows you to specify one or more options to use during capture of all attached displays.
CGDirectDisplay.h
Completes a set of display configuration changes.
CGError CGCompleteDisplayConfiguration ( CGDisplayConfigRef configRef, CGConfigureOption option );
The display configuration with the desired changes. On return, this configuration is no longer valid.
The scope of the display configuration changes. Pass one of the constants listed in “Display Configuration Scopes.”
A result code. See “Quartz Display Services Result Codes.”
This function applies a set of display configuration changes as a single atomic transaction. The duration or scope of the changes depends on the value of the option
parameter. The possible scopes are fully described in “Display Configuration Scopes.”
A configuration change may fail if an unsupported display mode is requested, or if another application is running in full-screen mode.
CGDisplayConfiguration.h
Modifies the settings of the built-in fade effect that occurs during a display configuration.
CGError CGConfigureDisplayFadeEffect ( CGDisplayConfigRef configRef, CGDisplayFadeInterval fadeOutSeconds, CGDisplayFadeInterval fadeInSeconds, float fadeRed, float fadeGreen, float fadeBlue );
A display configuration, acquired by calling CGBeginDisplayConfiguration
.
The time in seconds to fade from the normal display to the specified fade color. The fade out is completed before the display configuration is changed. If the interval is 0, Quartz applies the color immediately.
Time in seconds to return from the specified fade color to the normal display. The fade-in is run asynchronously after the display configuration is changed.
An intensity value in the interval [0, 1] that represents the red component of the desired blend color.
An intensity value in the interval [0, 1] that represents the green component of the desired blend color.
An intensity value in the interval [0, 1] that represents the blue component of the desired blend color.
A result code. See “Quartz Display Services Result Codes.”
This function provides a way to customize the built-in fade effect that Quartz performs when displays are reconfigured. The default time settings for this fade effect are 0.3 seconds to fade out, and 0.5 seconds to fade back in. The default fade color is French Blue for a normal desktop, and black for a captured display.
Before using this function, you need to call CGBeginDisplayConfiguration
to acquire the display configuration token for the desired display. No fade reservation is needed—when you call CGCompleteDisplayConfiguration
, Quartz reserves the fade hardware (assuming it is available) and performs the fade.
Calling this function modifies the fade behavior for a single display configuration, and has no permanent effect.
CGDisplayFade.h
Changes the configuration of a mirroring set.
CGError CGConfigureDisplayMirrorOfDisplay ( CGDisplayConfigRef configRef, CGDirectDisplayID display, CGDirectDisplayID masterDisplay );
A display configuration, acquired by calling CGBeginDisplayConfiguration
.
The display to add to a mirroring set.
A display in a mirroring set, or kCGNullDirectDisplay
to disable mirroring. To specify the main display, use CGMainDisplayID
.
A result code. See “Quartz Display Services Result Codes.”
Display mirroring and display matte generation are implemented either in hardware (preferred) or software, at the discretion of the device driver.
Hardware mirroring
With hardware mirroring enabled, all drawing is directed to the primary display—see CGDisplayPrimaryDisplay
.
If the device driver selects hardware matte generation, the display bounds and rowbytes values are adjusted to reflect the active drawable area.
Software mirroring
In this form of mirroring, identical content is drawn into each display in the mirroring set. Applications that use the window system need not be concerned about mirroring, as the window system takes care of all flushing of window content to the appropriate displays.
Applications that draw directly to the display, as with display capture, must make sure to draw the same content to all mirrored displays in a software mirror set. When drawing to software mirrored displays using a full screen OpenGL context (not drawing through a window), you should create shared OpenGL contexts for each display and re-render for each display.
You can use the function CGGetActiveDisplayList
to determine which displays are active, or drawable. This automatically gives your application the correct view of the current displays.
CGDisplayConfiguration.h
Configures the display mode of a display.
CGError CGConfigureDisplayMode ( CGDisplayConfigRef configRef, CGDirectDisplayID display, CFDictionaryRef mode );
A display configuration, acquired by calling CGBeginDisplayConfiguration
.
The display being configured.
A display mode dictionary (see the discussion below).
A result code. See “Quartz Display Services Result Codes.”
A display mode is a set of properties such as width, height, pixel depth, and refresh rate, and options such as stretched LCD panel filling.
The display mode you provide must be one of the following:
A dictionary returned by one of the CGDisplayBestMode
functions, such as CGDisplayBestModeForParameters
.
A dictionary in the array returned by CGDisplayAvailableModes
.
If you use this function to change the mode of a display in a mirroring set, Quartz may adjust the bounds, resolutions, and depth of the other displays in the set to a safe mode, with matching depth and the smallest enclosing size.
CGDisplayConfiguration.h
Configures the origin of a display in global display (desktop) coordinates.
CGError CGConfigureDisplayOrigin ( CGDisplayConfigRef configRef, CGDirectDisplayID display, CGDisplayCoord x, CGDisplayCoord y );
A display configuration, acquired by calling CGBeginDisplayConfiguration
.
The display being configured.
The desired x-coordinate for the upper left corner of the display.
The desired y-coordinate for the upper left corner of the display.
A result code. See “Quartz Display Services Result Codes.”
In Quartz, the upper left corner of a display is called the origin. The origin of a display is always specified in global display (desktop) coordinates. The origin of the main or primary display is (0,0).
The new origin is placed as close as possible to the requested location, without overlapping or leaving a gap between displays.
If you use this function to change the origin of a mirrored display, the display may be removed from the mirroring set.
CGDisplayConfiguration.h
Enables or disables stereo operation for a display, as part of a display configuration.
CGError CGConfigureDisplayStereoOperation ( CGDisplayConfigRef configRef, CGDirectDisplayID display, boolean_t stereo, boolean_t forceBlueLine );
A display configuration, acquired by calling CGBeginDisplayConfiguration
.
The display being configured.
Pass true
if you want to enable stereo operation. To disable it, pass false
.
When in stereo operation, a display may need to generate a special stereo sync signal as part of the video output. The sync signal consists of a blue line which occupies the first 25% of the last scanline for the left eye view, and the first 75% of the last scanline for the right eye view. The remainder of the scanline is black. To force the display to generate this sync signal, pass true
; otherwise, pass false
.
A result code. See “Quartz Display Services Result Codes.”
The system normally detects the presence of a stereo window and automatically switches a display containing a stereo window to stereo operation. This function provides a mechanism to force a display to stereo operation, and to set options (blue line sync signal) when in stereo operation.
On success, the display resolution, mirroring mode, and available display modes may change due to hardware-specific capabilities and limitations. You should check these settings to verify that they are appropriate for your application.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether the mouse cursor is drawn in frame buffer memory.
boolean_t CGCursorIsDrawnInFramebuffer ( void );
If true
, the cursor is drawn in frame buffer memory; otherwise, false
.
This function returns a Boolean value that indicates whether or not the cursor is drawn in the frame buffer. (The cursor could exist in an overlay plane or a similar mechanism that puts pixels on-screen without altering frame buffer content.) If the cursor is drawn in the frame buffer, it is read back along with window data.
The reported Boolean value is based on the union of the state of the cursor on all displays. If the cursor is drawn in the frame buffer on any display, the function returns true
.
CGRemoteOperation.h
Returns a Boolean value indicating whether the mouse cursor is visible.
boolean_t CGCursorIsVisible ( void );
If true
, the cursor is visible on any display; otherwise, false
.
To hide or show the cursor, you can use the functions CGDisplayHideCursor
and CGDisplayShowCursor
.
CGRemoteOperation.h
Returns the address in frame buffer memory that corresponds to a position on an online display.
void * CGDisplayAddressForPosition ( CGDirectDisplayID display, CGDisplayCoord x, CGDisplayCoord y );
The display to access.
The x-coordinate of a position in global display space. The origin is the upper left corner of the main display.
The y-coordinate of a position in global display space. The origin is the upper left corner of the main display, and the y-axis is oriented down.
The address in frame buffer memory that corresponds to the specified position. If the display ID is invalid or the point lies outside the bounds of the display, the return value is NULL
.
If the display has not been captured, the returned address may refer to read-only memory.
CGDirectDisplay.h
Returns information about the currently available display modes.
CFArrayRef CGDisplayAvailableModes ( CGDirectDisplayID display );
The display to access.
An array of dictionaries with display mode information, or NULL
if the display is invalid. The array is owned by the system and you should not release it. Each dictionary in the array contains information about a mode that the display supports. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.
CGDirectDisplay.h
Returns the base address in frame buffer memory of an online display.
void * CGDisplayBaseAddress ( CGDirectDisplayID display );
The display to access.
The base address in frame buffer memory of the specified display. If the display ID is invalid, the return value is NULL
.
If the display has not been captured, the returned address may refer to read-only memory.
CGDirectDisplay.h
Returns the current beam position on a display.
CGBeamPosition CGDisplayBeamPosition ( CGDirectDisplayID display );
The display to access.
The current beam position on the specified display. If the display does not implement conventional video vertical and horizontal sweep in painting, or the driver does not implement this functionality, 0 is returned.
This function returns the number of the scan line on which the beam is currently positioned, expressed as a non-negative integer. The value increases as the beam moves lower on the display.
CGDirectDisplay.h
Returns information about the display mode closest to a specified depth and screen size.
CFDictionaryRef CGDisplayBestModeForParameters ( CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, boolean_t *exactMatch );
The display to optimize.
Optimal display depth in bits per pixel. Note that this value is not the same as pixel depth, which is the number of bits per channel or component.
Optimal display width in pixel units.
Optimal display height in pixel units.
A pointer to a Boolean variable. On return, its value is true
if an exact match in display depth, width, and height is found; otherwise, false
. If this information is not needed, pass NULL
.
A display mode dictionary, or NULL
if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the display mode closest to the specified depth and screen size. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.
This function tries to find an optimal display mode for the specified display. The function first tries to find a mode with the specified pixel depth and dimensions equal to or greater than the specified width and height. If no depth match is found, it tries to find a mode with greater depth and the same or greater dimensions. If a suitable display mode is not found, this function simply returns the current display mode.
CGDirectDisplay.h
Returns information about the display mode closest to a specified depth, screen size, and refresh rate.
CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRate ( CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, CGRefreshRate refresh, boolean_t *exactMatch );
The display to access.
Optimal display depth, in bits per pixel. Note that this value is not the same as pixel depth, which is the number of bits per channel or component.
Optimal display width, in pixel units.
Optimal display height, in pixel units.
Optimal display refresh rate, in frames per second.
A pointer to a Boolean variable. On return, its value is true
if an exact match in display depth, width, height, and refresh rate is found; otherwise, false
. If this information is not needed, pass NULL
.
A display mode dictionary, or NULL
if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the display mode closest to the specified depth, screen size, and refresh rate. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.
This function searches the list of available display modes for a mode that comes closest to satisfying these criteria:
Has a pixel depth equal to or greater than the specified depth
Has dimensions equal to or greater than the specified height and width
Uses a refresh rate equal to or near the specified rate
If a suitable display mode is not found, this function simply returns the current display mode.
CGDirectDisplay.h
Returns information about the display mode closest to a specified depth, screen size, and refresh rate, with a required property.
CFDictionaryRef CGDisplayBestModeForParametersAndRefreshRateWithProperty ( CGDirectDisplayID display, size_t bitsPerPixel, size_t width, size_t height, CGRefreshRate refresh, CFStringRef property, boolean_t *exactMatch );
The display to access.
Optimal display depth, in bits per pixel. Note that this value is not the same as pixel depth, which is the number of bits per channel or component.
Optimal display width, in pixels.
Optimal display height, in pixels.
Optimal display refresh rate, in refreshes per second.
A required display mode property. For a list of the properties you can specify, see “Display Mode Optional Properties.”
A pointer to a Boolean variable. On return, its value is true
if an exact match in display depth, width, height, refresh rate, and property is found; otherwise, false
. If this information is not needed, pass NULL
.
A display mode dictionary, or NULL
if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the display mode with the specified property that comes closest to the specified depth, screen size, and refresh rate. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.
This function searches the list of available display modes for a mode that includes the specified property and comes closest to satisfying these criteria:
Has a pixel depth equal to or greater than the specified depth
Has dimensions equal to or greater than the specified height and width
Uses a refresh rate equal to or near the specified rate
If no matching display mode is found, this function simply returns the current display mode.
CGDirectDisplay.h
Returns the number of bits used to represent a pixel in the frame buffer.
size_t CGDisplayBitsPerPixel ( CGDirectDisplayID display );
The display to access.
The number of bits used to represent a pixel in the frame buffer.
CGDirectDisplay.h
Returns the number of bits used to represent a pixel component in the frame buffer.
size_t CGDisplayBitsPerSample ( CGDirectDisplayID display );
The display to access.
The number of bits used to represent a pixel component such as a color value in the frame buffer.
CGDirectDisplay.h
Returns the bounds of a display in global display space.
CGRect CGDisplayBounds ( CGDirectDisplayID display );
The display to access.
The bounds of the display, expressed as a rectangle in the global display coordinate space (relative to the upper left corner of the main display).
CGDirectDisplay.h
Returns the number of bytes per row in a display.
size_t CGDisplayBytesPerRow ( CGDirectDisplayID display );
The display to access.
The number of bytes per row in the display. This number also represents the stride between pixels in the same column of the display.
CGDirectDisplay.h
Returns a Boolean value indicating whether the current display mode supports palettes.
boolean_t CGDisplayCanSetPalette ( CGDirectDisplayID display );
The display to access.
If true
, the current display mode supports palettes; otherwise, false
.
Palettes are supported in any display selected to run in a 256-color display mode.
CGDirectDisplay.h
Captures a display for exclusive use by an application.
CGDisplayErr CGDisplayCapture ( CGDirectDisplayID display );
The display to capture.
A result code. See “Quartz Display Services Result Codes.”
When an application captures a display, Quartz does not allow other applications and system services to use the display or change its configuration.
If hardware or software mirroring is in effect, the easiest way to capture the primary display and all mirrored displays is to use the function CGCaptureAllDisplays
. In case of software mirroring, applications that draw directly to the display must make sure to draw the same content to all displays in the mirror set.
CGDirectDisplay.h
Captures a display for exclusive use by an application, using the specified options.
CGDisplayErr CGDisplayCaptureWithOptions ( CGDirectDisplayID display, CGCaptureOptions options );
The display to capture.
The options to use. See “Display Capture Options.”
A result code. See “Quartz Display Services Result Codes.”
This function allows you to specify one or more options to use during capture of a display.
CGDirectDisplay.h
Returns the color space for a display.
CGColorSpaceRef CGDisplayCopyColorSpace ( CGDirectDisplayID display );
The display whose color space you want to obtain.
The current color space for the specified display. The caller is responsible for releasing the color space with the CGColorSpaceRelease
function.
This function returns a display-dependent ICC-based color space. You can use this function when rendering content for a specific display in order to produce color-matched output for that display.
CGDisplayConfiguration.h
Returns information about the current display mode.
CFDictionaryRef CGDisplayCurrentMode ( CGDirectDisplayID display );
The display to access.
A display mode dictionary, or NULL
if the display is invalid. The dictionary is owned by the system and you should not release it. The dictionary contains information about the current display mode. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.
CGDirectDisplay.h
Performs a single fade operation.
CGError CGDisplayFade ( CGDisplayFadeReservationToken myToken, CGDisplayFadeInterval seconds, CGDisplayBlendFraction startBlend, CGDisplayBlendFraction endBlend, float redBlend, float greenBlend, float blueBlend, boolean_t synchronous );
A reservation token for the fade hardware, acquired by calling CGAcquireDisplayFadeReservation
.
The desired number of seconds for the fade operation. You should use a value in the interval [0, kCGMaxDisplayReservationInterval
]. If the value is 0, the ending blend color is applied immediately.
An intensity value in the interval [0, 1] that specifies the alpha component of the desired blend color at the beginning of the fade operation. See “Display Fade Blend Fractions.”
An intensity value in the interval [0, 1] that specifies the alpha component of the desired blend color at the end of the fade operation. See “Display Fade Blend Fractions.”
An intensity value in the interval [0, 1] that specifies the red component of the desired blend color.
An intensity value in the interval [0, 1] that specifies the green component of the desired blend color.
An intensity value in the interval [0, 1] that specifies the blue component of the desired blend color.
Pass true
if you want the fade operation to be synchronous; otherwise, pass false
. If a fade operation is synchronous, the function does not return until the operation is complete.
A result code. See “Quartz Display Services Result Codes.”
Over the fade operation time interval, Quartz interpolates a blending coefficient between the starting and ending values given, applying a nonlinear (sine-based) bias term. Using this coefficient, the video output is blended with the specified color.
The following example shows how to perform a two-second synchronous fade-out to black:
CGDisplayFade ( |
myToken, |
2.0, // 2 seconds |
kCGDisplayBlendNormal, // starting state |
kCGDisplayBlendSolidColor, // ending state |
0.0, 0.0, 0.0, // black |
true // wait for completion |
); |
To perform a two-second asynchronous fade-in from black:
CGDisplayFade ( |
myToken, |
2.0, // 2 seconds |
kCGDisplayBlendSolidColor, // starting state |
kCGDisplayBlendNormal, // ending state |
0.0, 0.0, 0.0, // black |
false // don't wait for completion |
); |
If you specify an asynchronous fade operation, it’s safe to call CGReleaseDisplayFadeReservation
immediately after this function returns.
CGDisplayFade.h
Returns a Boolean value indicating whether a fade operation is currently in progress.
boolean_t CGDisplayFadeOperationInProgress ( void );
If true
, a fade operation is currently in progress; otherwise, false
.
You may call this function from any task running on the system. The calling task need not have a valid fade reservation.
CGDisplayFade.h
Returns the capacity, or number of entries, in the gamma table for a display.
CGTableCount CGDisplayGammaTableCapacity ( CGDirectDisplayID display );
CGDirectDisplay.h
Returns a graphics context suitable for drawing to a captured display.
CGContextRef CGDisplayGetDrawingContext ( CGDirectDisplayID display );
The display to access.
A Quartz graphics context suitable for drawing to a captured display, or NULL
if the display has not been captured. The context is owned by the system and you should not release it.
After capturing a display or changing the configuration of a captured display, you can use this function to obtain the current graphics context for the display. The graphics context remains valid while the display is captured and the display configuration is unchanged. Releasing the captured display or reconfiguring the display invalidates the context. To determine when the display configuration is changing, you can use the function CGDisplayRegisterReconfigurationCallback
to register a display reconfiguration callback.
CGDirectDisplay.h
Hides the mouse cursor, and increments the hide cursor count.
CGDisplayErr CGDisplayHideCursor ( CGDirectDisplayID display );
This parameter is not used. By default, you may pass kCGDirectMainDisplay
.
A result code. See “Quartz Display Services Result Codes.”
This function hides the cursor regardless of its current location; the display
parameter is ignored. In most cases, the caller must be the foreground application to affect the cursor.
CGDirectDisplay.h
Maps a display ID to an OpenGL display mask.
CGOpenGLDisplayMask CGDisplayIDToOpenGLDisplayMask ( CGDirectDisplayID display );
The display ID to be converted.
The OpenGL display mask that corresponds to the specified display.
OpenGL sometimes identifies a display using a bitmask with one bit set. This function maps a display ID to the corresponding OpenGL display mask.
CGDirectDisplay.h
Returns the I/O Kit service port of the specified display.
io_service_t CGDisplayIOServicePort ( CGDirectDisplayID display );
The display to access.
The I/O Kit service port for the specified display.
An I/O Kit service port can be passed to I/O Kit to obtain additional information about the display.
The port is owned by the graphics system, and should not be destroyed.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is active.
boolean_t CGDisplayIsActive ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is active; otherwise, false
.
An active display is connected, awake, and available for drawing. In a hardware mirroring set, only the primary display is active.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is always in a mirroring set.
boolean_t CGDisplayIsAlwaysInMirrorSet ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is in a mirroring set and cannot be removed from this set.
Some hardware configurations support the connection of auxiliary displays that always mirror the main display, and therefore cannot be removed from the mirroring set to which they belong.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is sleeping (and is therefore not drawable.)
boolean_t CGDisplayIsAsleep ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is in sleep mode; otherwise, false
.
A display is sleeping when its frame buffer and the attached monitor are in reduced power mode. A sleeping display is still considered to be a part of global display (desktop) space, but it is not drawable.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is built-in, such as the internal display in portable systems.
boolean_t CGDisplayIsBuiltin ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is considered to be a built-in display; otherwise, false
.
Portable systems typically identify the internal LCD panel as a built-in display.
Note that it is possible and reasonable for a system to have no displays marked as built-in. For example, a portable system running with the lid closed may report no built-in displays.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is captured.
boolean_t CGDisplayIsCaptured ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is captured; otherwise, false
.
CGDirectDisplay.h
Returns a Boolean value indicating whether a display is in a hardware mirroring set.
boolean_t CGDisplayIsInHWMirrorSet ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is a member of a hardware mirroring set; otherwise, false
.
When hardware mirroring is enabled, the contents of a single frame buffer are rendered in all displays in the hardware mirroring set. All drawing operations are directed to the primary display in the set—see CGDisplayPrimaryDisplay
.
For more information about display mirroring, see CGConfigureDisplayMirrorOfDisplay
.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is in a mirroring set.
boolean_t CGDisplayIsInMirrorSet ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is a member of a software or hardware mirroring set; otherwise, false
.
For more information about display mirroring, see CGConfigureDisplayMirrorOfDisplay
.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is the main display.
boolean_t CGDisplayIsMain ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is currently the main display; otherwise, false
.
For information about the characteristics of a main display, see CGMainDisplayID
.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is connected or online.
boolean_t CGDisplayIsOnline ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is connected; otherwise, false
.
A display is considered connected or online when the frame buffer hardware is connected to a monitor.
You can use this function to determine if someone has hot-plugged a display to the system. Note that hot-plugging is a hardware feature that may not be present on all displays.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether a display is running in a stereo graphics mode.
boolean_t CGDisplayIsStereo ( CGDirectDisplayID display );
The display to access.
If true
, the specified display is running in a stereo graphics mode; otherwise, false
.
CGDisplayConfiguration.h
For a secondary display in a mirroring set, returns the primary display.
CGDirectDisplayID CGDisplayMirrorsDisplay ( CGDirectDisplayID display );
A secondary display in a mirroring set.
Returns the primary display in the mirroring set. Returns kCGNullDirectDisplay
if the specified display is actually the primary display or is not in a mirroring set.
For more information about display mirroring, see CGConfigureDisplayMirrorOfDisplay
.
CGDisplayConfiguration.h
Returns the model number of a display monitor.
uint32_t CGDisplayModelNumber ( CGDirectDisplayID display );
The display to access.
A model number for the monitor associated with the specified display, or a constant to indicate an exception—see the discussion below.
This function uses I/O Kit to identify the monitor associated with the specified display. The return value depends on the following:
If I/O Kit can identify the monitor, the product ID code for the monitor is returned.
If I/O Kit can’t identify the monitor, kDisplayProductIDGeneric
is returned.
If no monitor is connected, a value of 0xFFFFFFFF
is returned.
CGDisplayConfiguration.h
Moves the mouse cursor to a specified point relative to the display origin (the upper left corner of the display).
CGDisplayErr CGDisplayMoveCursorToPoint ( CGDirectDisplayID display, CGPoint point );
The display to access.
The coordinates of a point in local display space. The origin is the upper left corner of the specified display.
A result code. See “Quartz Display Services Result Codes.”
No events are generated as a result of this move. Points that would lie outside the desktop are clipped to the desktop.
CGDirectDisplay.h
Returns the display height in pixel units.
size_t CGDisplayPixelsHigh ( CGDirectDisplayID display );
The display to access.
The display height in pixel units.
CGDirectDisplay.h
Returns the display width in pixel units.
size_t CGDisplayPixelsWide ( CGDirectDisplayID display );
The display to access.
The display width in pixel units.
CGDirectDisplay.h
Returns the primary display in a hardware mirroring set.
CGDirectDisplayID CGDisplayPrimaryDisplay ( CGDirectDisplayID display );
A display in a hardware mirror set.
The primary display in the mirror set. If display
is not hardware-mirrored, this function simply returns display
.
In hardware mirroring, the contents of a single frame buffer are rendered in two or more displays simultaneously. The mirrored displays are said to be in a hardware mirroring set.
At the discretion of the device driver, one of the displays in a hardware mirroring set is designated as the primary display. The device driver binds the drawing engine, hardware accelerator, and 3D engine to the primary display, and directs all drawing operations to this display.
CGDisplayConfiguration.h
Registers a callback function to be invoked whenever a local display is reconfigured.
CGError CGDisplayRegisterReconfigurationCallback ( CGDisplayReconfigurationCallBack proc, void *userInfo );
A pointer to the callback function to be registered.
A pointer to user-defined data, or NULL
. The userInfo
argument is passed back to the callback function each time it’s invoked.
Whenever local displays are reconfigured, the callback function you register is invoked twice for each display that’s added, removed, or currently online—once before the reconfiguration, and once after the reconfiguration. For more information, see the callback type CGDisplayReconfigurationCallBack
.
A callback function may be registered multiple times with different user-defined data pointers, resulting in multiple registration entries. For each registration, when notification is no longer needed you should remove the registration by calling the function CGDisplayRemoveReconfigurationCallback
.
CGDisplayConfiguration.h
Releases a captured display.
CGDisplayErr CGDisplayRelease ( CGDirectDisplayID display );
The display to release.
A result code. See “Quartz Display Services Result Codes.”
CGDirectDisplay.h
Removes the registration of a callback function that’s invoked whenever a local display is reconfigured.
CGError CGDisplayRemoveReconfigurationCallback ( CGDisplayReconfigurationCallBack proc, void *userInfo );
A pointer to the callback function associated with the registration to be removed.
A pointer to user-defined data associated with the registration to be removed, or NULL
. This is the same pointer that’s passed to the function CGDisplayRegisterReconfigurationCallback
when registering the callback.
When you call this function, the two arguments must match the registered entry to be removed.
CGDisplayConfiguration.h
Restores the gamma tables to the values in the user’s ColorSync display profile.
void CGDisplayRestoreColorSyncSettings ( void );
CGDirectDisplay.h
Returns the rotation angle of a display in degrees.
double CGDisplayRotation ( CGDirectDisplayID display );
The display to access.
The rotation angle of the display in degrees, or 0 if the display is not valid.
This function returns the rotation angle of a display in a clockwise direction. For example, if the specified display is rotated clockwise 90 degrees then this function returns 90.0. After a 90 degree clockwise rotation, the physical bottom of the display is on the left side and the physical top is on the right side.
CGDisplayConfiguration.h
Returns the number of color components used to represent a pixel.
size_t CGDisplaySamplesPerPixel ( CGDirectDisplayID display );
The display to access.
The number of color components used to represent a pixel.
CGDirectDisplay.h
Returns the width and height of a display in millimeters.
CGSize CGDisplayScreenSize ( CGDirectDisplayID display );
The display to access.
The size of the specified display in millimeters, or 0 if the display is not valid.
If Extended Display Identification Data (EDID) for the display device is not available, the size is estimated based on the device width and height in pixels from CGDisplayBounds
, with an assumed resolution of 2.835 pixels/mm or 72 DPI, a reasonable guess for displays predating EDID support.
CGDisplayConfiguration.h
Returns the serial number of a display monitor.
uint32_t CGDisplaySerialNumber ( CGDirectDisplayID display );
The display to access.
A serial number for the monitor associated with the specified display, or a constant to indicate an exception—see the discussion below.
This function uses I/O Kit to identify the monitor associated with the specified display.
If I/O Kit can identify the monitor:
If the manufacturer has encoded a serial number for the monitor, the number is returned.
If there is no encoded serial number,
0x00000000
is returned.
If I/O Kit cannot identify the monitor:
If a monitor is connected to the display, 0x00000000
is returned.
If no monitor is connected to the display hardware, a value of 0xFFFFFFFF
is returned.
Note that a serial number is meaningful only in conjunction with a specific vendor and product or model.
CGDisplayConfiguration.h
Sets the palette for a display.
CGDisplayErr CGDisplaySetPalette ( CGDirectDisplayID display, const CGDirectPaletteRef palette );
The display to access.
The display palette to set.
A result code. See “Quartz Display Services Result Codes.”
CGDirectDisplay.h
Immediately enables or disables stereo operation for a display.
CGError CGDisplaySetStereoOperation ( CGDirectDisplayID display, boolean_t stereo, boolean_t forceBlueLine, CGConfigureOption option );
The display being configured.
Pass true
if you want to enable stereo operation. To disable it, pass false
.
When in stereo operation, a display may need to generate a special stereo sync signal as part of the video output. The sync signal consists of a blue line which occupies the first 25% of the last scanline for the left eye view, and the first 75% of the last scanline for the right eye view. The remainder of the scanline is black. To force the display to generate this sync signal, pass true
; otherwise pass false
.
A constant that specifies the scope of the display configuration changes. For more information, see “Display Configuration Scopes.”
A result code. See “Quartz Display Services Result Codes.”
The system normally detects the presence of a stereo window and automatically switches a display containing a stereo window to stereo operation. This function provides a mechanism to force a display to stereo operation immediately, and to set options (blue line sync signal) when in stereo operation.
On success, the display resolution, mirroring mode, and available display modes may change due to hardware-specific capabilities and limitations. You should check these settings to verify that they are appropriate for your application.
CGDisplayConfiguration.h
Decrements the hide cursor count, and shows the mouse cursor if the count is zero.
CGDisplayErr CGDisplayShowCursor ( CGDirectDisplayID display );
This parameter is not used. By default, you may pass kCGDirectMainDisplay
.
A result code. See “Quartz Display Services Result Codes.”
If the hide cursor count is zero, this function shows the cursor regardless of its current location; the display
parameter is ignored. In most cases, the caller must be the foreground application to affect the cursor.
CGDirectDisplay.h
Switches a display to a different mode.
CGDisplayErr CGDisplaySwitchToMode ( CGDirectDisplayID display, CFDictionaryRef mode );
The display to access.
A display mode dictionary that contains information about the display mode to set. The dictionary passed in must be a dictionary returned by another Quartz display function such as CGDisplayAvailableModes
or CGDisplayBestModeForParameters
. For a list of the properties in a display mode dictionary, see “Display Mode Standard Properties” and “Display Mode Optional Properties.” For general information about using dictionaries, see CFDictionary Reference.
A result code. See “Quartz Display Services Result Codes.”
This function switches the display mode of the specified display. The operation is always synchronous; the function does not return until the mode switch is complete. Note that after switching, display parameters and addresses may change.
The selected display mode persists for the life of the calling program. When the program terminates, the display mode automatically reverts to the permanent setting in the Displays panel of System Preferences.
When changing the display mode of a display in a mirroring set, other displays in the mirroring set will be assigned a mode that's capable of mirroring the bounds of the display being adjusted. To avoid this automatic behavior, you can use the following procedure: call CGBeginDisplayConfiguration
, call CGConfigureDisplayMode
for each display to explicitly set the mode, and finally call CGCompleteDisplayConfiguration
.
CGDirectDisplay.h
Returns the logical unit number of a display.
uint32_t CGDisplayUnitNumber ( CGDirectDisplayID display );
The display to access.
A logical unit number for the specified display.
The logical unit number represents a particular node in the I/O Kit device tree associated with the display’s frame buffer. For a particular hardware configuration, this value will not change when the attached monitor is changed.
The unit number will change if the I/O Kit device tree changes, as when hardware is reconfigured, drivers are replaced, or significant changes occur to I/O Kit, so it should not be assumed to be invariant across login sessions.
For more information about I/O Kit, see the Apple publication “I/O Kit Fundamentals”.
CGDisplayConfiguration.h
Returns a Boolean value indicating whether Quartz is using OpenGL-based window acceleration (Quartz Extreme) to render in a display.
boolean_t CGDisplayUsesOpenGLAcceleration ( CGDirectDisplayID display );
The display to access.
If true
, Quartz Extreme is used to render in the specified display; otherwise, false
.
Quartz Extreme is an OpenGL-based, hardware-accelerated window compositor available in Mac OS X version 10.2 and later. Quartz Extreme requires a minimum hardware configuration to operate.
The information this function provides is typically used to adjust the demands of drawing operations to the capabilities of the display hardware. For example, an application running on an unaccelerated system could disable live window-resizing.
CGDisplayConfiguration.h
Returns the vendor number of the specified display's monitor.
uint32_t CGDisplayVendorNumber ( CGDirectDisplayID display );
The display to access.
A vendor number for the monitor associated with the specified display, or a constant to indicate an exception—see the discussion below.
This function uses I/O Kit to identify the monitor associated with the specified display.
There are three cases:
If I/O Kit can identify the monitor, the vendor ID is returned.
If I/O Kit cannot identify the monitor, kDisplayVendorIDUnknown
is returned.
If there is no monitor associated with the display, 0xFFFFFFFF
is returned.
CGDisplayConfiguration.h
Waits until the beam position moves outside a region in a display screen. This function is not designed for VBL drawing synchronization.
CGDisplayErr CGDisplayWaitForBeamPositionOutsideLines ( CGDirectDisplayID display, CGBeamPosition upperScanLine, CGBeamPosition lowerScanLine );
The display to access.
The upper scan line number.
The lower scan line number.
A result code. See “Quartz Display Services Result Codes.”
This function waits until the beam position is outside the range specified by the arguments upperScanLine
and lowerScanLine
. If the value of upperScanLine
is greater than the value of lowerScanLine
, or if upperScanLine
and lowerScanLine
encompass the entire display height, this function returns an error.
Some displays may not use conventional video vertical and horizontal sweep in painting. These displays report a kCGDisplayRefreshRate
of 0 in the dictionary returned by CGDisplayCurrentMode
. Also, some display device drivers may not implement support for this mechanism. On such displays, this function returns at once.
CGDirectDisplay.h
Provides a list of displays that are active (or drawable).
CGDisplayErr CGGetActiveDisplayList ( CGDisplayCount maxDisplays, CGDirectDisplayID *activeDspys, CGDisplayCount *dspyCnt );
The size of the activeDspys
array. This value determines the maximum number of displays that can be returned.
A pointer to storage provided by the caller for an array of display IDs. On return, the array contains a list of active displays. If you pass NULL
, on return the display count contains the total number of active displays.
A pointer to a display count variable provided by the caller. On return, the display count contains the actual number of displays returned in the activeDspys
array. This value is at most maxDisplays
.
A result code. See “Quartz Display Services Result Codes.”
The first entry in the list of active displays is the main display. In case of mirroring, the first entry is the largest drawable display or, if all are the same size, the display with the greatest pixel depth.
Note that when hardware mirroring is being used between displays, only the primary display is active and appears in the list. When software mirroring is being used, all the mirrored displays are active and appear in the list. For more information about mirroring, see CGConfigureDisplayMirrorOfDisplay
.
CGDirectDisplay.h
Provides a list of displays that corresponds to the bits set in an OpenGL display mask.
CGDisplayErr CGGetDisplaysWithOpenGLDisplayMask ( CGOpenGLDisplayMask mask, CGDisplayCount maxDisplays, CGDirectDisplayID *dspys, CGDisplayCount *dspyCnt );
An OpenGL display mask that identifies one or more displays.
The size of the dspys
array. This value determines the maximum number of displays that can be returned.
A pointer to storage provided by the caller for an array of display IDs. On return, the array contains a list of displays that corresponds to the bits set in the mask. If you pass NULL
, on return the display count contains the total number of displays specified in the mask.
A pointer to a display count variable provided by the caller. On return, the display count contains the actual number of displays returned in the dspys
array. This value is at most maxDisplays
.
A result code. See “Quartz Display Services Result Codes.”
CGDirectDisplay.h
Provides a list of online displays with bounds that include the specified point.
CGDisplayErr CGGetDisplaysWithPoint ( CGPoint point, CGDisplayCount maxDisplays, CGDirectDisplayID *dspys, CGDisplayCount *dspyCnt );
The coordinates of a point in global display space. The origin is the upper left corner of the main display.
The size of the dspys
array. This value determines the maximum number of displays that can be returned.
A pointer to storage provided by the caller for an array of display IDs. On return, the array contains a list of displays with bounds that include the point. If you pass NULL
, on return the display count contains the total number of displays with bounds that include the point.
A pointer to a display count variable provided by the caller. On return, the display count contains the actual number of displays returned in the dspys
array. This value is at most maxDisplays
.
A result code. See “Quartz Display Services Result Codes.”
CGDirectDisplay.h
Gets a list of online displays with bounds that intersect the specified rectangle.
CGDisplayErr CGGetDisplaysWithRect ( CGRect rect, CGDisplayCount maxDisplays, CGDirectDisplayID *dspys, CGDisplayCount *dspyCnt );
The location and size of a rectangle in global display space. The origin is the upper left corner of the main display.
The size of the dspys array. This value determines the maximum number of displays that can be returned in the dspys parameter. Generally, you should specify a number greater than 0 for this parameter. If you specify 0, the value returned in dspyCnt is undefined and this function sets the dspys parameter to NULL
.
A pointer to storage provided by the caller for an array of display IDs. On return, the array contains a list of displays whose bounds intersect the specified rectangle.
A pointer to a display count variable provided by the caller. On return, this variable contains the number of displays that were returned in the dspys parameter. You must provide a non-NULL
value for this parameter.
A result code. See “Quartz Display Services Result Codes.”
CGDirectDisplay.h
Gets the coefficients of the gamma transfer formula for a display.
CGDisplayErr CGGetDisplayTransferByFormula ( CGDirectDisplayID display, CGGammaValue *redMin, CGGammaValue *redMax, CGGammaValue *redGamma, CGGammaValue *greenMin, CGGammaValue *greenMax, CGGammaValue *greenGamma, CGGammaValue *blueMin, CGGammaValue *blueMax, CGGammaValue *blueGamma );
The display to access.
The minimum value of the red channel in the gamma table. The value is a number in the interval [0, redMax).
The maximum value of the red channel in the gamma table. The value is a number in the interval (redMin, 1].
A positive value used to compute the red channel in the gamma table.
The minimum value of the green channel in the gamma table. The value is a number in the interval [0, greenMax).
The maximum value of the green channel in the gamma table. The value is a number in the interval (greenMin, 1].
A positive value used to compute the green channel in the gamma table.
The minimum value of the blue channel in the gamma table. The value is a number in the interval [0, blueMax).
The maximum value of the blue channel in the gamma table. The value is a number in the interval (blueMin, 1].
A positive value used to compute the blue channel in the gamma table.
A result code. See “Quartz Display Services Result Codes.”
For information about the gamma transfer formula, see the description of the function CGSetDisplayTransferByFormula
.
CGDirectDisplay.h
Gets the values in the RGB gamma tables for a display.
CGDisplayErr CGGetDisplayTransferByTable ( CGDirectDisplayID display, CGTableCount capacity, CGGammaValue *redTable, CGGammaValue *greenTable, CGGammaValue *blueTable, CGTableCount *sampleCount );
The display to access.
The number of entries each table can hold.
A pointer to an array of type CGGammaValue
with size capacity
. On return, the array contains the values of the red channel in the display’s gamma table.
A pointer to an array of type CGGammaValue
with size capacity
. On return, the array contains the values of the green channel in the display’s gamma table.
A pointer to an array of type CGGammaValue
with size capacity
. On return, the array contains the values of the blue channel in the display’s gamma table.
The number of samples actually copied into each array.
A result code. See “Quartz Display Services Result Codes.”
CGDirectDisplay.h
Reports the change in mouse position since the last mouse movement event received by the application.
void CGGetLastMouseDelta ( CGMouseDelta *deltaX, CGMouseDelta *deltaY );
A pointer to a CGMouseDelta
variable. On return, this variable contains the horizontal change in the mouse position since the last mouse movement event.
A pointer to a CGMouseDelta
variable. On return, this variable contains the vertical change in the mouse position since the last mouse movement event.
This function is not recommended for general use. Instead, you should use the mouse tracking functions in the Carbon Event Manager.
CGDirectDisplay.h
Provides a list of displays that are online (active, mirrored, or sleeping).
CGDisplayErr CGGetOnlineDisplayList ( CGDisplayCount maxDisplays, CGDirectDisplayID *onlineDspys, CGDisplayCount *dspyCnt );
The size of the onlineDspys
array. This value determines the maximum number of display IDs that can be returned.
A pointer to storage provided by the caller for an array of display IDs. On return, the array contains a list of the online displays. If you pass NULL
, on return the display count contains the total number of online displays.
A pointer to a display count variable provided by the caller. On return, the display count contains the actual number of displays returned in the onlineDspys
array. This value is at most maxDisplays
.
A result code. See “Quartz Display Services Result Codes.”
If the frame buffer hardware is connected, a display is considered connected or online.
When hardware mirroring is used, a display can be online but not active or drawable. Programs which manipulate display settings such as the palette or gamma tables need access to all displays, including hardware mirrors which are not drawable.
CGDirectDisplay.h
Returns the display ID of the main display.
CGDirectDisplayID CGMainDisplayID ( void );
The display ID assigned to the main display.
The main display is the display with its screen location at (0,0) in global coordinates. In a system without display mirroring, the display with the menu bar is typically the main display.
If mirroring is enabled and the menu bar appears on more than one display, this function provides a reliable way to find the main display.
In case of hardware mirroring, the drawable display becomes the main display. In case of software mirroring, the display with the highest resolution and deepest pixel depth typically becomes the main display.
CGDirectDisplay.h
Maps an OpenGL display mask to a display ID.
CGDirectDisplayID CGOpenGLDisplayMaskToDisplayID ( CGOpenGLDisplayMask mask );
The OpenGL display mask to be converted.
The display ID assigned to the specified display mask, or kCGNullDirectDisplay
if no display matches the mask.
OpenGL sometimes identifies a display using a bitmask with one bit set. This function maps such a display mask to the corresponding display ID. If you pass in a mask with multiple bits set, this function returns a display ID matching one of these bits.
CGDirectDisplay.h
Returns a copy of a specified display palette.
CGDirectPaletteRef CGPaletteCreateCopy ( CGDirectPaletteRef palette );
The display palette to copy.
A new display palette object. When you no longer need the palette, you should release it using the function CGPaletteRelease
.
CGDirectPalette.h
Returns a new display palette representing the default 8-bit color palette.
CGDirectPaletteRef CGPaletteCreateDefaultColorPalette ( void );
A new display palette object. When you no longer need the palette, you should release it using the function CGPaletteRelease
.
Palettes are used with 256 color display modes. The default palette is the old default 8-bit Mac OS palette, with white at index 0 and black at index 255.
CGDirectPalette.h
Returns a new tinted display palette. The new palette is derived from an existing palette blended with a solid color, at a specified level of intensity.
CGDirectPaletteRef CGPaletteCreateFromPaletteBlendedWithColor ( CGDirectPaletteRef palette, CGPaletteBlendFraction fraction, CGDeviceColor color );
The palette to blend.
A value between 0 and 1 that represents the blend intensity. See CGPaletteBlendFraction
.
The blend color. See CGDeviceColor
.
A new display palette object. When you no longer need the palette, you should release it using the function CGPaletteRelease
.
CGDirectPalette.h
Returns a new display palette using 8-bit sample data.
CGDirectPaletteRef CGPaletteCreateWithByteSamples ( CGDeviceByteColor *sampleTable, CGTableCount sampleCount );
A color table with integer values that represent the intensity of the red,green, and blue components in each table entry. Each value ranges from 0 (no color) to 255 (full intensity). See CGDeviceByteColor
.
The number of entries in the specified color table.
A new display palette object. When you no longer need the palette, you should release it using the function CGPaletteRelease
.
CGDirectPalette.h
Returns a new display palette with a specified capacity. The new palette is initialized from the default color palette.
CGDirectPaletteRef CGPaletteCreateWithCapacity ( CGTableCount capacity );
The number of entries in the new palette.
A new display palette object. When you no longer need the palette, you should release it using the function CGPaletteRelease
.
CGDirectPalette.h
Returns a copy of the current palette for a display.
CGDirectPaletteRef CGPaletteCreateWithDisplay ( CGDirectDisplayID display );
The display to access.
A new display palette object, or NULL
if the current display mode does not support a palette. When you no longer need the palette, you should release it using the function CGPaletteRelease
.
CGDirectPalette.h
Returns a new display palette using RGB sample data.
CGDirectPaletteRef CGPaletteCreateWithSamples ( CGDeviceColor *sampleTable, CGTableCount sampleCount );
A color table with floating point values that represent the intensity of the red,green, and blue components in each table entry. Each value ranges from 0 (no color) to 1 (full intensity). See CGDeviceColor
.
The number of entries in the specified color table.
A new display palette object. When you no longer need the palette, you should release it using the function CGPaletteRelease
.
CGDirectPalette.h
Returns the color value at the specified index.
CGDeviceColor CGPaletteGetColorAtIndex ( CGDirectPaletteRef palette, CGTableCount index );
The display palette to access.
The zero-based index of the desired palette entry.
A color value. See CGDeviceColor
.
CGDirectPalette.h
Returns the index of the display palette entry that most closely matches a specified color value.
CGTableCount CGPaletteGetIndexForColor ( CGDirectPaletteRef palette, CGDeviceColor color );
The display palette to access.
The color value to match. See CGDeviceColor
.
The index of the display palette entry that most closely matches the specified color value.
CGDirectPalette.h
Returns the number of colors in a display palette.
CGTableCount CGPaletteGetNumberOfSamples ( CGDirectPaletteRef palette );
The display palette to access.
The number of colors in the specified display palette.
CGDirectPalette.h
Returns a Boolean value indicating whether two display palettes are equal.
Boolean CGPaletteIsEqualToPalette ( CGDirectPaletteRef palette1, CGDirectPaletteRef palette2 );
The first display palette to compare.
The second display palette to compare.
If true
, the two specified display palettes are equal; otherwise, false
.
CGDirectPalette.h
Decrements the retain count of a display palette.
void CGPaletteRelease ( CGDirectPaletteRef palette );
The display palette to release.
CGDirectPalette.h
Updates the color value at the specified index in a display palette.
void CGPaletteSetColorAtIndex ( CGDirectPaletteRef palette, CGDeviceColor color, CGTableCount index );
The display palette to access.
The new color value.
The index of the palette entry to update.
CGDirectPalette.h
Registers a callback function to be invoked when local displays are refreshed or modified.
CGError CGRegisterScreenRefreshCallback ( CGScreenRefreshCallback function, void *userParameter );
A pointer to the callback function to be registered.
A pointer to user-defined data, or NULL
. The userParameter
argument is passed back to the callback function each time it’s invoked.
A result code. See “Quartz Display Services Result Codes.”
A callback function may be registered multiple times with different user-defined data pointers, resulting in multiple registration entries. For each registration, when notification is no longer needed you should call the function CGUnregisterScreenRefreshCallback
to remove the registration.
The callback function you register is invoked only if your application has an active event loop. The callback is invoked in the same thread of execution that is processing events within your application.
In Mac OS X v10.4 and earlier, the result code returned by this function is a random value and should be ignored. In Mac OS X v10.5 and later, the result code is valid.
CGRemoteOperation.h
Releases all captured displays.
CGDisplayErr CGReleaseAllDisplays ( void );
A result code. See “Quartz Display Services Result Codes.”
This function releases all captured displays and restores the display modes to the user's preferences. It may be used in conjunction with any of the functions that capture displays, such as CGCaptureAllDisplays
.
CGDirectDisplay.h
Releases a display fade reservation, and unfades the display if needed.
CGError CGReleaseDisplayFadeReservation ( CGDisplayFadeReservationToken myToken );
The current fade reservation token to be released. On return, the reservation token is no longer valid and should be discarded.
A result code. See “Quartz Display Services Result Codes.”
If you call this function while an asynchronous fade operation is running, there are two possible outcomes:
If the ending blend value is kCGDisplayBlendNormal
, the fade operation is allowed to run to completion.
If the ending blend value is not kCGDisplayBlendNormal
, the fade operation is terminated immediately and the display is returned to normal.
In both cases, the reservation is actually released when the fade operation completes.
CGDisplayFade.h
Deallocates a list of rectangles that represent changed areas on local displays.
void CGReleaseScreenRefreshRects ( CGRect *rectArray );
A list of rectangles obtained by calling CGWaitForScreenRefreshRects
or CGWaitForScreenUpdateRects
.
CGRemoteOperation.h
Restores the permanent display configuration settings for the current user.
void CGRestorePermanentDisplayConfiguration ( void );
This function provides a convenient way to restore the permanent display configuration.
Applications that temporarily change the display configuration—such as applications and games that switch to full-screen display mode—can use this function to undo the changes.
CGDisplayConfiguration.h
Registers a callback function to be invoked when an area of the display is moved.
CGError CGScreenRegisterMoveCallback ( CGScreenUpdateMoveCallback function, void *userParameter );
A pointer to the callback function to be registered.
A pointer to user-defined data, or NULL
. The userParameter
argument is passed back to the callback function each time it’s invoked.
A result code. See “Quartz Display Services Result Codes.”
A callback function may be registered multiple times with different user-defined data pointers, resulting in multiple registration entries. For each registration, when notification is no longer needed you should remove the registration by calling the function CGScreenUnregisterMoveCallback
.
The callback function you register is invoked only if your application has an active event loop. The callback is invoked in the same thread of execution that is processing events within your application.
This function is implemented in Mac OS X version 10.4.3 and later.
CGRemoteOperation.h
Removes a previously registered callback function invoked when an area of the display is moved.
void CGScreenUnregisterMoveCallback ( CGScreenUpdateMoveCallback function, void *userParameter );
A pointer to the callback function to be unregistered.
A pointer to user-defined data, or NULL
. You should pass the same value you used when you registered the callback function.
A result code. See “Quartz Display Services Result Codes.”
When you call this function, the two arguments must match the registered entry to be removed.
CGRemoteOperation.h
Returns information about the caller’s window server session.
CFDictionaryRef CGSessionCopyCurrentDictionary ( void );
A window server session dictionary, or NULL
if the caller is not running within a Quartz GUI session or the window server is disabled. You should release the dictionary when you are finished using it. For information about the key-value pairs in this dictionary, see “Window Server Session Properties.”
CGSession.h
Sets the byte values in the 8-bit RGB gamma tables for a display.
CGDisplayErr CGSetDisplayTransferByByteTable ( CGDirectDisplayID display, CGTableCount tableSize, const CGByteValue *redTable, const CGByteValue *greenTable, const CGByteValue *blueTable );
The display to access.
The number of entries in each table.
An array of size tableSize
containing the byte values of the red channel in the display’s gamma table.
An array of size tableSize
containing the byte values of the green channel in the display’s gamma table.
An array of size tableSize
containing the byte values of the blue channel in the display’s gamma table.
A result code. See “Quartz Display Services Result Codes.”
The same table may be passed in for the red, green, and blue channels. The tables are interpolated as needed to generate the number of samples required by the graphics hardware.
CGDirectDisplay.h
Sets the gamma function for a display, by specifying the coefficients of the gamma transfer formula.
CGDisplayErr CGSetDisplayTransferByFormula ( CGDirectDisplayID display, CGGammaValue redMin, CGGammaValue redMax, CGGammaValue redGamma, CGGammaValue greenMin, CGGammaValue greenMax, CGGammaValue greenGamma, CGGammaValue blueMin, CGGammaValue blueMax, CGGammaValue blueGamma );
The display to access.
The minimum value of the red channel in the gamma table. The value should be a number in the interval [0, redMax).
The maximum value of the red channel in the gamma table. The value should be a number in the interval (redMin, 1].
A positive value used to compute the red channel in the gamma table.
The minimum value of the green channel in the gamma table. The value should be a number in the interval [0, greenMax).
The maximum value of the green channel in the gamma table. The value should be a number in the interval (greenMin, 1].
A positive value used to compute the green channel in the gamma table.
The minimum value of the blue channel in the gamma table. The value should be a number in the interval [0, blueMax).
The maximum value of the blue channel in the gamma table. The value should be a number in the interval (blueMin, 1].
A positive value used to compute the blue channel in the gamma table.
A result code. See “Quartz Display Services Result Codes.”
This function uses the specified parameter values to compute a gamma correction table for the specified display. The values in the table are computed by sampling the following gamma transfer formula for a range of indices from 0 to 1:
value = Min + ((Max - Min) * pow(index, Gamma)) |
The resulting values are converted to a machine-specific format and loaded into display hardware.
CGDirectDisplay.h
Sets the color gamma function for a display, by specifying the values in the RGB gamma tables.
CGDisplayErr CGSetDisplayTransferByTable ( CGDirectDisplayID display, CGTableCount tableSize, const CGGammaValue *redTable, const CGGammaValue *greenTable, const CGGammaValue *blueTable );
The display to access.
The number of entries in each table.
An array of size tableSize
containing the values of the red channel in the display’s gamma table. The values should be in the range 0.0 to 1.0.
An array of size tableSize
containing the values of the green channel in the display’s gamma table. The values should be in the range 0.0 to 1.0.
An array of size tableSize
containing the values of the blue channel in the display’s gamma table. The values should be in the range 0.0 to 1.0.
A result code. See “Quartz Display Services Result Codes.”
The same table may be passed in for the red, green, and blue channels. The tables are interpolated as needed to generate the number of samples required by the graphics hardware.
CGDirectDisplay.h
Returns the window ID of the shield window for a captured display.
uint32_t CGShieldingWindowID ( CGDirectDisplayID display );
The display to access.
The window ID of the shield window for the specified display, or NULL
if the display is not shielded.
To prevent updates by direct-to-screen programs (such as Classic), Quartz draws a shield window that fills the entire screen of a captured display.
This function is not recommended for use in applications. Note that the graphics context associated with this window is not a full-featured drawing context. To get a full-featured drawing context for a captured display, you should use the function CGDisplayGetDrawingContext
.
CGDirectDisplay.h
Returns the window level of the shield window for a captured display.
int32_t CGShieldingWindowLevel ( void );
The window level of the shield window for a captured display.
This function returns a value that is sometimes used to position a window over the shield window for a captured display. Attempting to position a window over a captured display may be unsuccessful—or may present undesirable results such as illegible or invisible content—because of interactions between full-screen graphics (such as OpenGL full-screen drawing contexts) and the graphics hardware. Because of these limitations, and because the implementation of display capture may change in the future, this technique is not recommended.
CGDirectDisplay.h
Removes a previously registered callback function invoked when local displays are refreshed or modified.
void CGUnregisterScreenRefreshCallback ( CGScreenRefreshCallback function, void *userParameter );
A pointer to the callback function to be unregistered.
A pointer to user-defined data, or NULL
. You should pass the same value you used when you registered the callback function.
When you call this function, the two arguments must match the registered entry to be removed.
CGRemoteOperation.h
Waits for screen refresh operations.
CGError CGWaitForScreenRefreshRects ( CGRect **pRectArray, CGRectCount *pCount );
A pointer to a CGRect*
variable. On return, the variable contains an array of rectangles that bound the refreshed areas, specified in global coordinates. When you no longer need the array, you should deallocate it by calling CGReleaseScreenRefreshRects
.
A pointer to a CGRectCount
variable. On return, the variable contains the number of entries in the returned array of rectangles.
A result code. See “Quartz Display Services Result Codes.”
In some applications it may be preferable to wait for screen refresh data synchronously, using this function. You should call this function in a thread other than the main event-processing thread.
As an alternative, Quartz also supports asynchronous notification—see CGRegisterScreenRefreshCallback
. If refresh callback functions are registered, this function should not be used.
CGRemoteOperation.h
Waits for screen update operations.
CGError CGWaitForScreenUpdateRects ( CGScreenUpdateOperation requestedOperations, CGScreenUpdateOperation *currentOperation, CGRect **pRectArray, size_t *pCount, CGScreenUpdateMoveDelta *pDelta );
The desired types of screen update operations. There are several possible choices:
Specify kCGScreenUpdateOperationRefresh
if you want all move operations to be returned as refresh operations.
Specify (kCGScreenUpdateOperationRefresh | kCGScreenUpdateOperationMove)
if you want to distinguish between move and refresh operations.
Add kCGScreenUpdateOperationReducedDirtyRectangleCount
to the screen operations if you want to minimize the number of rectangles returned to represent changed areas of the display.
A pointer to a CGScreenUpdateOperation
variable. On return, the variable indicates the type of update operation (refresh or move).
A pointer to a CGRect*
variable. On return, the variable contains an array of rectangles that bound the updated areas, specified in global coordinates. When you no longer need the array, you should deallocate it by calling CGReleaseScreenRefreshRects
.
A pointer to a size_t
variable. On return, the variable contains the number of entries in the returned array of rectangles.
A pointer to a CGScreenUpdateMoveDelta
variable. On return, if the value of the currentOperation
parameter is kCGScreenUpdateOperationMove
the variable contains the distance moved.
A result code. See “Quartz Display Services Result Codes.”
In some applications it may be preferable to wait for screen update data synchronously, using this function. You should call this function in a thread other than the main event-processing thread.
As an alternative, Quartz also supports asynchronous notification—see CGRegisterScreenRefreshCallback
and CGScreenRegisterMoveCallback
. If refresh or move callback functions are registered, this function should not be used.
This function is implemented in Mac OS X version 10.4.3 and later.
CGRemoteOperation.h
Moves the mouse cursor without generating events.
CGError CGWarpMouseCursorPosition ( CGPoint newCursorPosition );
The new mouse cursor position in global display coordinates.
A result code. See “Quartz Display Services Result Codes.”
You can use this function to 'warp' or alter the cursor position without generating or posting an event. For example, this function is often used to move the cursor position back to the center of the screen by games that do not want the cursor pinned by display edges.
CGRemoteOperation.h
Returns the window level that corresponds to one of the standard window types.
CGWindowLevel CGWindowLevelForKey ( CGWindowLevelKey key );
A window level key constant that represents one of the standard window types. See “Window Level Keys.”
The window level that corresponds to the specified key.
This function is not recommended for use in applications. (This function is provided for application frameworks that create and manage windows, such as Carbon and Cocoa.)
CGWindowLevel.h
Returns a Core Foundation mach port (CFMachPort) that corresponds to the Mac OS X window server.
CFMachPortRef CGWindowServerCFMachPort ( void );
A Core Foundation mach port, or NULL
if the window server is not running. When you no longer need the port, you should release it using the function CFRelease
.
You can use this function to detect if the window server process exits or is not running. If this function returns NULL
, the window server is not running. This code example shows how to register a callback function to detect when the window server exits:
static void handleWindowServerDeath( CFMachPortRef port, void *info ) |
{ |
printf( "Window Server port death detected!\n" ); |
CFRelease(port); |
exit(1); |
} |
static void watchForWindowServerDeath() |
{ |
CFMachPortRef port = CGWindowServerCFMachPort(); |
CFMachPortSetInvalidationCallBack(port, handleWindowServerDeath); |
} |
Note that this callback will not work unless your program has an active run loop.
CGRemoteOperation.h
A client-supplied callback function that’s invoked whenever the configuration of a local display is changed.
typedef void (*CGDisplayReconfigurationCallBack) ( CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *userInfo );
If you name your function MyDisplayReconfigurationCallBack
, you would declare it like this:
void MyDisplayReconfigurationCallBack ( CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *userInfo );
The display being reconfigured.
Flags that indicate which display configuration parameters are changing.
The userInfo
argument passed to the function CGDisplayRegisterReconfigurationCallback
when the callback function is registered.
To register a display reconfiguration callback function, you call the function CGDisplayRegisterReconfigurationCallback
. Quartz invokes your callback function when:
Your application calls a function to reconfigure a local display.
Your application is listening for events in the event-processing thread, and another application calls a function to reconfigure a local display.
The user changes the display hardware configuration—for example, by disconnecting a display or changing a system preferences setting.
Before display reconfiguration, Quartz invokes your callback function once for each online display to indicate a pending configuration change. The flags
argument is always set to kCGDisplayBeginConfigurationFlag
. Other than the display ID, this callback does not carry other per-display information, as details of how a reconfiguration affects a particular device rely on device-specific behaviors which may not be exposed by a device driver.
After display reconfiguration, Quartz invokes your callback function once for each added, removed, and online display. At this time, all display state reported by Core Graphics, QuickDraw, and the Carbon Display Manager will be up to date. This callback runs after the Carbon Display Manager notification callbacks. The flags
argument indicates how the display configuration has changed. Note that in the case of removed displays, calls into Quartz with the removed display ID will fail.
The following code example illustrates how to test for specific conditions:
void MyDisplayReconfigurationCallBack ( |
CGDirectDisplayID display, |
CGDisplayChangeSummaryFlags flags, |
void *userInfo) |
{ |
if (flags & kCGDisplayAddFlag) { |
// display has been added |
} |
else if (flags & kCGDisplayRemoveFlag) { |
// display has been removed |
} |
} |
Your callback function should avoid attempting to change display configurations, and should not raise exceptions or perform a non-local return such as calling longjmp
. When you are finished using a callback registration, you should call the function CGDisplayRemoveReconfigurationCallback
to remove it.
CGDisplayConfiguration.h
A client-supplied callback function that’s invoked when an area of the display is modified or refreshed.
typedef void (*CGScreenRefreshCallback) ( CGRectCount count, const CGRect * rectArray, void * userParameter );
If you name your function MyScreenRefreshCallback
, you would declare it like this:
void MyScreenRefreshCallback ( CGRectCount count, const CGRect * rectArray, void * userParameter );
The number of rectangles in the rectArray
parameter.
A list of the rectangles in the refreshed areas, specified in global coordinates. You should not modify or deallocate memory pointed to by rectArray
.
The user data you specify when you register this callback.
To register a screen refresh callback function, you call the function CGRegisterScreenRefreshCallback
. Quartz invokes your callback function when operations such as drawing, window movement, scrolling, or display reconfiguration occur on local displays. When you are finished using a callback registration, you should call the function CGUnregisterScreenRefreshCallback
to remove it.
Note that a single rectangle may occupy multiple displays, either by overlapping the displays or by residing on coincident displays when mirroring is active. You can use the function CGGetDisplaysWithRect
to determine the displays a rectangle occupies.
CGRemoteOperation.h
A client-supplied callback function that’s invoked when an area of the display is moved.
typedef void (*CGScreenUpdateMoveCallback) ( CGScreenUpdateMoveDelta delta, CGRectCount count, const CGRect * rectArray, void * userParameter );
If you name your function MyScreenUpdateMoveCallback
, you would declare it like this:
void MyScreenUpdateMoveCallback ( CGScreenUpdateMoveDelta delta, CGRectCount count, const CGRect * rectArray, void * userParameter );
The distance the display area has moved.
The number of rectangles in the rectArray
parameter.
A list of the rectangles in the moved areas, specified in global coordinates. The rectangles describe the area prior to the move operation. You should not modify or deallocate memory pointed to by rectArray
.
The user data you specify when you register this callback.
To register a screen move callback function, you call the function CGScreenRegisterMoveCallback
. Quartz invokes your callback function when operations such as window movement or scrolling occur on local displays. When you are finished using a callback registration, you should call the function CGScreenUnregisterMoveCallback
to remove it.
Note that a single rectangle may occupy multiple displays, either by overlapping the displays or by residing on coincident displays when mirroring is active. You can use the function CGGetDisplaysWithRect
to determine the displays a rectangle occupies.
CGRemoteOperation.h
Represents a horizontal scan line on a monitor that uses a scanning electron beam to refresh the screen.
typedef uint32_t CGBeamPosition;
CRT and analog-driven displays use a horizontal scanning beam to refresh the screen. The beam position is a number assigned to a horizontal scan line on the screen. Scan lines are numbered 0
to n-1
from top of screen, where n
represents the total number of scan lines.
The concept of beam position does not apply to flat-panel LCD displays. While all displays have some concept of scan lines with respect to the frame buffer, LCD displays may not use linear scanning to refresh the screen.
CGDirectDisplay.h
Represents a unit of information in a byte-addressable array or data structure.
typedef uint8_t CGByteValue;
Quartz uses CGByteValue
to represent integer-based color values in a display palette or a gamma table. For example, see CGDeviceByteColor
.
CGDirectDisplay.h
Represents a color in a Quartz display palette, using 8-bit integer components.
struct CGDeviceByteColor { CGByteValue red; CGByteValue green; CGByteValue blue; }; typedef struct CGDeviceByteColor CGDeviceByteColor;
red
The red component of a palette entry.
green
The green component of a palette entry.
blue
The blue component of a palette entry.
This data structure consists of three integer values that represent the intensity of the red,green, and blue components in a display palette entry. Each component ranges from 0 (no color) to 255 (full intensity).
Quartz provides CGDeviceByteColor
to allow you to create a display palette using integer-based sample data. Once loaded, you can retrieve color data from the palette only as entries of type CGDeviceColor
.
For more information about display palettes, see CGDirectPaletteRef
.
CGDirectPalette.h
Represents a color in a Quartz display palette.
struct CGDeviceColor { float red; float green; float blue; }; typedef struct CGDeviceColor CGDeviceColor;
red
The red component of a palette entry.
green
The green component of a palette entry.
blue
The blue component of a palette entry.
This data structure consists of three floating point values that represent the intensity of the red,green, and blue components in a display palette entry. Each component ranges from 0 (no color) to 1 (full intensity). Values outside this range are clamped to 0 or 1 when the palette is created.
Quartz uses CGDeviceColor
as the canonical form for a color entry in a display palette. Palette entries can be created and retrieved in this form.
For more information about display palettes, see CGDirectPaletteRef
.
CGDirectPalette.h
Represents a unique identifier for an attached display.
typedef uint32_t CGDirectDisplayID;
In Quartz, the term display refers to a graphics hardware system consisting of a framebuffer, a color correction (gamma) table or color palette, and possibly an attached monitor. If no monitor is attached, a display is characterized as offline.
When a monitor is attached, Quartz assigns a unique display identifier (ID). A display ID can persist across processes and system reboot, and typically remains constant as long as certain display parameters do not change.
When assigning a display ID, Quartz considers the following parameters:
vendor
model
serial number
position in the I/O Kit registry
For information about how to obtain a display ID, see “Finding Displays.”
CGDirectDisplay.h
Defines a reference to a Quartz 8-bit display palette.
typedef struct _CGDirectPaletteRef * CGDirectPaletteRef;
A display palette is a bounded set of color values available for display. Some display operating modes have a maximum color depth of 8 bits (256 colors). The CGDirectPalette API is designed for application and game developers that want to create and use display palettes for these older displays.
Quartz uses reference counting to manage display palettes. See “Working With Color Palettes” for more information.
CGDirectDisplay.h
Represents the percentage of blend color used in a fade operation.
typedef float CGDisplayBlendFraction;
The blend fraction ranges from 0 (no color) to 1 (full intensity). If you specify 0, the blend color is not applied. If you specify 1, the user sees only the blend color on the screen.
In a fade operation, Quartz blends a color specified by the application with the current contents of the frame buffer. The blend color can be applied both at the beginning and the end of a fade operation.
Color blending during a fade operation is analogous to alpha blending in Quartz 2D, and the visual appearance is similar. However, the implementation is quite different. In a fade operation, the blend color is applied at the very end of the graphics pipeline, as the frame buffer is transferred to video output.
For example, the Universal Access preference panel in Mac OS X allows you to select a flashing screen effect (sometimes called a visual bell) to accompany the system alert sound. When you select this option, the system uses a Quartz fade operation to produce the flash. The blend color is applied using a blend fraction of 0.5 or 50%.
CGDisplayFade.h
Defines a reference to a display configuration transaction.
typedef struct _CGDisplayConfigRef * CGDisplayConfigRef;
This data type makes it possible to
create a new display configuration transaction using the function CGBeginDisplayConfiguration
record a set of configuration changes, each bound to one or more displays
apply the changes in a single transaction using the function CGCompleteDisplayConfiguration
, or discard the changes using the function CGCancelDisplayConfiguration
There are no restrictions on the order in which you accumulate configuration changes in a transaction.
Configuration changes sometimes conflict with each other. For example, a new origin might be rendered invalid by a subsequent configuration change.
If possible, Quartz uses a “best fit” strategy to resolve conflicts between configuration changes. For example, when you change the resolution of a single display in a two-display system, Quartz automatically re-tiles the displays to prevent separation or overlap of the adjoining edges.
CGDisplayConfiguration.h
Represents a coordinate position in global display space.
typedef int32_t CGDisplayCoord;
Quartz uses CGDisplayCoord
to represent the x- and y-coordinates of points in the per-display coordinate system. The origin is defined as the upper-left corner of the screen.
This data type is also used in functions that need to find the address of a specific pixel and monitor. For example, the function CGDisplayAddressForPosition
finds the address in frame buffer memory that corresponds to a given position or point.
CGDirectDisplay.h
Represents the number of displays in various lists.
typedef uint32_t CGDisplayCount;
Quartz uses CGDisplayCount
to represent a count of either the current or the maximum number of displays in a display list. For example, see the function CGGetActiveDisplayList
.
CGDirectDisplay.h
Defines a uniform type for result codes returned by functions in Quartz Display Services.
typedef CGError CGDisplayErr;
CGDirectDisplay.h
Represents the duration in seconds of a fade operation or a fade hardware reservation.
typedef float CGDisplayFadeInterval;
Quartz uses this data type to specify the duration of both fade-out and fade-in operations. Values may range from zero to kCGMaxDisplayReservationInterval
seconds. A zero value means fade immediately—see CGDisplayFade
.
CGDisplayFade.h
Defines a token issued by Quartz when reserving one or more displays for a fade operation during a specified interval.
typedef uint32_t CGDisplayFadeReservationToken;
Quartz lets you reserve the display hardware to perform a fade operation. Fade reservations are valid for up to 15 seconds. Only one token is needed for both fade-out and fade-in.
You should release a fade reservation immediately when you no longer need it. If the reservation expires, releasing it is safe but not necessary.
CGDisplayFade.h
Represents the time interval for a fade reservation.
typedef float CGDisplayReservationInterval;
A fade reservation interval is a period of time during which a specific display is reserved for a fade operation. Fade reservation intervals range from 1 to kCGMaxDisplayReservationInterval
seconds.
For more information about fade reservations, see the function CGAcquireDisplayFadeReservation
. Fade reservation tokens are discussed in CGDisplayFadeReservationToken
.
CGDisplayFade.h
Defines a uniform type for result codes returned by functions in Quartz Services.
typedef int32_t CGError;
CGError.h
Represents information used to map a color generated in software to a color supported by the display hardware.
typedef float CGGammaValue;
In Mac OS X, the Display panel in System Preferences is used to set the default gamma for a display. Quartz also allows an application to provide its own custom gamma information, using functions such as CGSetDisplayTransferByTable
and CGSetDisplayTransferByFormula
.
These functions take CGGammaValue
arguments that specify
a set of gamma table entries ranging from 0 to 1
the positive real coefficients in a gamma equation
CGDirectDisplay.h
Represents a change in mouse position, in mouse units.
typedef int32_t CGMouseDelta;
A mouse unit is a hardware-specific unit of measure, and generally has higher resolution than pixel units.
Note that the function CGGetLastMouseDelta
is no longer recommended—instead, you should use mouse tracking functions in the Carbon Event Manager.
CGDirectDisplay.h
Defines a bitmask used in OpenGL to specify a set of attached displays.
typedef uint32_t CGOpenGLDisplayMask;
In Mac OS X, OpenGL can provide information about the capabilities of the hardware renderers driving a specified set of displays. A 32-bit mask is used to specify the displays—each bit in the mask represents a single display.
To learn how to find the mask bit that corresponds to a given display, see the function CGDisplayIDToOpenGLDisplayMask
.
CGDirectDisplay.h
Represents the intensity of a solid color used to tint a display palette.
typedef float CGPaletteBlendFraction;
A palette blend-fraction value can range from 0 (no color) to 1 (full intensity). At full intensity, the palette is completely washed out by the color.
For more information, see the function CGPaletteCreateFromPaletteBlendedWithColor
.
CGDirectPalette.h
Represents the size of an array of Quartz rectangles.
typedef uint32_t CGRectCount;
For example, see the function CGWaitForScreenRefreshRects
.
CGRemoteOperation.h
Represents a display’s refresh rate in frames per second.
typedef double CGRefreshRate;
When requesting a new display mode, you can specify a desired refresh rate as a hint to Quartz. For example, see the function CGDisplayBestModeForParametersAndRefreshRate
.
CGDirectDisplay.h
Represents the distance a region on the screen moves in pixel units.
struct _CGScreenUpdateMoveDelta { int32_t dX, dY; }; typedef struct _CGScreenUpdateMoveDelta CGScreenUpdateMoveDelta;
Move operation notifications are restricted to changes that move a region by an integer number of pixels. The fields dX
and dY
describe the direction of movement:
Positive values of dX
indicate movement to the right.
Negative values of dX
indicate movement to the left.
Positive values of dY
indicate movement downward.
Negative values of dY
indicate movement upward.
CGRemoteOperation.h
Defines a uniform type to represent the number of entries in a table.
typedef uint32_t CGTableCount;
CGDirectDisplay.h
Represents a level assigned to a window by an application framework.
typedef int32_t CGWindowLevel;
In Mac OS X, application frameworks support the concept of multiple window levels (or layers). Window levels are assigned and managed by each individual framework.
Note that in an Aqua-compliant application, each document window exists in its own layer. As a result, windows created by different applications can be interleaved.
CGWindowLevel.h
Specify configuration parameters when capturing displays.
enum { kCGCaptureNoOptions = 0, kCGCaptureNoFill = (1 << 0) }; typedef uint32_t CGCaptureOptions;
kCGCaptureNoOptions
Specifies that the system should use the default fill behavior, which is fill with black.
Available in Mac OS X v10.3 and later.
Declared in CGDirectDisplay.h
.
kCGCaptureNoFill
Disables fill with black.
Available in Mac OS X v10.3 and later.
Declared in CGDirectDisplay.h
.
For information about how these constants are used, see the functions CGDisplayCaptureWithOptions
and CGCaptureAllDisplaysWithOptions
.
Specify the configuration parameters passed to a display reconfiguration callback function.
enum { kCGDisplayBeginConfigurationFlag = (1 << 0), kCGDisplayMovedFlag = (1 << 1), kCGDisplaySetMainFlag = (1 << 2), kCGDisplaySetModeFlag = (1 << 3), kCGDisplayAddFlag = (1 << 4), kCGDisplayRemoveFlag = (1 << 5), kCGDisplayEnabledFlag = (1 << 8), kCGDisplayDisabledFlag = (1 << 9), kCGDisplayMirrorFlag = (1 << 10), kCGDisplayUnMirrorFlag = (1 << 11), kCGDisplayDesktopShapeChangedFlag = (1 << 12) }; typedef u_int32_t CGDisplayChangeSummaryFlags;
kCGDisplayBeginConfigurationFlag
The display configuration is about to change.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplayMovedFlag
The location of the upper-left corner of the display in global display space has changed.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplaySetMainFlag
The display is now the main display.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplaySetModeFlag
The display mode has changed.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplayAddFlag
The display has been added to the active display list.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplayRemoveFlag
The display has been removed from the active display list.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplayEnabledFlag
The display has been enabled.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplayDisabledFlag
The display has been disabled.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplayMirrorFlag
The display is now mirroring another display.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplayUnMirrorFlag
The display is no longer mirroring another display.
Available in Mac OS X v10.3 and later.
Declared in CGDisplayConfiguration.h
.
kCGDisplayDesktopShapeChangedFlag
The shape of the desktop (the union of display areas) has changed.
Available in Mac OS X v10.5 and later.
Declared in CGDisplayConfiguration.h
.
For information about how these constants are used, see the callback CGDisplayReconfigurationCallBack
.
Specify the scope of the changes in a display configuration transaction.
enum { kCGConfigureForAppOnly = 0, kCGConfigureForSession = 1, kCGConfigurePermanently = 2 };
kCGConfigureForAppOnly
Specifies that changes persist for the lifetime of the current application. After the application terminates, the display configuration settings revert to the current login session.
Available in Mac OS X v10.2 and later.
Declared in CGDisplayConfiguration.h
.
kCGConfigureForSession
Specifies that changes persist for the lifetime of the current login session. After the current session terminates, the displays revert to the last saved permanent configuration.
Available in Mac OS X v10.2 and later.
Declared in CGDisplayConfiguration.h
.
kCGConfigurePermanently
Specifies that changes persist in future login sessions by the same user. If the requested changes cannot be supported by the Aqua UI (resolution and pixel depth constraints apply), the settings for the current login session are used instead, and any changes have session scope.
Available in Mac OS X v10.2 and later.
Declared in CGDisplayConfiguration.h
.
For information about how these constants are used, see the function CGCompleteDisplayConfiguration
.
Specify the lower and upper bounds for blend color fractions during a display fade operation.
#define kCGDisplayBlendNormal (0.0) #define kCGDisplayBlendSolidColor (1.0)
kCGDisplayBlendNormal
Specifies that the blend color is not applied at the start or end of a fade operation.
Available in Mac OS X v10.2 and later.
Declared in CGDisplayFade.h
.
kCGDisplayBlendSolidColor
Specifies that the user sees only the blend color at the start or end of a fade operation.
Available in Mac OS X v10.2 and later.
Declared in CGDisplayFade.h
.
For general information about blend fractions, see the data type CGDisplayBlendFraction
. For information about how these constants are used, see the function CGDisplayFade
.
Specifies values relating to fade operations.
#define kCGMaxDisplayReservationInterval (15.0) #define kCGDisplayFadeReservationInvalidToken (0)
kCGMaxDisplayReservationInterval
Specifies the maximum number of seconds for fade hardware reservations and display fade operations. For general information about fade intervals, see the data type CGDisplayFadeInterval
.
Available in Mac OS X v10.2 and later.
Declared in CGDisplayFade.h
.
kCGDisplayFadeReservationInvalidToken
Specifies an invalid fade reservation token. For general information about fade reservation tokens, see the data type CGDisplayFadeReservationToken
.
Available in Mac OS X v10.2 and later.
Declared in CGDisplayFade.h
.
Default values for a display ID.
#define kCGDirectMainDisplay (CGMainDisplayID()) #define kCGNullDirectDisplay ((CGDirectDisplayID)0)
kCGDirectMainDisplay
Specifies the current main display ID.
Available in Mac OS X v10.0 and later.
Declared in CGDirectDisplay.h
.
kCGNullDirectDisplay
Specifies a value that will never correspond to actual hardware.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
Specify keys for the standard properties in a display mode dictionary.
#define kCGDisplayWidth CFSTR("Width") #define kCGDisplayHeight CFSTR("Height") #define kCGDisplayMode CFSTR("Mode") #define kCGDisplayBitsPerPixel CFSTR("BitsPerPixel") #define kCGDisplayBitsPerSample CFSTR("BitsPerSample") #define kCGDisplaySamplesPerPixel CFSTR("SamplesPerPixel") #define kCGDisplayRefreshRate CFSTR("RefreshRate") #define kCGDisplayModeUsableForDesktopGUICFSTR("UsableForDesktopGUI") #define kCGDisplayIOFlags CFSTR("IOFlags") #define kCGDisplayBytesPerRow CFSTR("kCGDisplayBytesPerRow")
kCGDisplayWidth
Specifies a CFNumber integer value that represents the width of the display in pixels.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayHeight
Specifies a CFNumber integer value that represents the height of the display in pixels.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayMode
Specifies a CFNumber integer value that represents the I/O Kit display mode number.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayBitsPerPixel
Specifies a CFNumber integer value that represents the number of bits in a pixel.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayBitsPerSample
Specifies a CFNumber integer value that represents the number of bits in an individual sample (for example, a color value in an RGB pixel).
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplaySamplesPerPixel
Specifies a CFNumber integer value that represents the number of samples in a pixel.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayRefreshRate
Specifies a CFNumber double-precision floating point value that represents the refresh rate of a CRT display. Some displays may not use conventional video vertical and horizontal sweep in painting the screen; these displays report a refresh rate of 0.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayModeUsableForDesktopGUI
Specifies a CFBoolean value that indicates whether the display is suitable for use with the Mac OS X graphical user interface. The criteria include factors such as sufficient width and height and adequate pixel depth.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayIOFlags
Specifies a CFNumber integer value that contains the I/O Kit display mode flags. For more information, see the header file IOKit/IOGraphicsTypes.h
.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayBytesPerRow
Specifies a CFNumber integer value that represents the number of bytes in a row on the display.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
To learn how to use these keys to access the values in a display mode dictionary, see CFDictionary Reference.
Specify keys for optional properties in a display mode dictionary.
#define kCGDisplayModeIsSafeForHardware CFSTR ("kCGDisplayModeIsSafeForHardware") #define kCGDisplayModeIsInterlaced CFSTR("kCGDisplayModeIsInterlaced") #define kCGDisplayModeIsStretched CFSTR("kCGDisplayModeIsStretched") #define kCGDisplayModeIsTelevisionOutput CFSTR ("kCGDisplayModeIsTelevisionOutput")
kCGDisplayModeIsSafeForHardware
Specifies a CFBoolean value indicating that the display mode doesn't need a confirmation dialog to be set.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayModeIsInterlaced
Specifies a CFBoolean value indicating that the I/O Kit interlace mode flag is set.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayModeIsStretched
Specifies a CFBoolean value indicating that the I/O Kit stretched mode flag is set.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
kCGDisplayModeIsTelevisionOutput
Specifies a CFBoolean value indicating that the I/O Kit television output mode flag is set.
Available in Mac OS X v10.2 and later.
Declared in CGDirectDisplay.h
.
A given key is present in a display mode dictionary only if the property applies, and is always associated with a value of kCFBooleanTrue
. Keys not relevant to a particular display mode will not appear in the mode dictionary.
Specifies window level constants.
#define kCGNumReservedWindowLevels (16)
kCGNumReservedWindowLevels
The number of window levels reserved by Apple for internal use. Application frameworks such as Carbon and Cocoa use this constant during compilation
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
Specify types of screen update operations.
enum _CGScreenUpdateOperation { kCGScreenUpdateOperationRefresh = 0, kCGScreenUpdateOperationMove = (1 << 0), kCGScreenUpdateOperationReducedDirtyRectangleCount = (1 << 31) }; typedef uint32_t CGScreenUpdateOperation;
kCGScreenUpdateOperationRefresh
Specifies a screen refresh operation.
Available in Mac OS X v10.3 and later.
Declared in CGRemoteOperation.h
.
kCGScreenUpdateOperationMove
Specifies a screen move operation.
Available in Mac OS X v10.3 and later.
Declared in CGRemoteOperation.h
.
kCGScreenUpdateOperationReducedDirtyRectangleCount
When presented as part of the requested operations to the function CGWaitForScreenUpdateRects
, specifies that the function should try to minimize the number of rectangles returned to represent the changed areas of the display. The function may combine adjacent rectangles within a larger bounding rectangle, which may include unmodified areas of the display.
Available in Mac OS X v10.4 and later.
Declared in CGRemoteOperation.h
.
For information about how these constants are used, see the function CGWaitForScreenUpdateRects
.
Keys that represent the standard window levels in Mac OS X. Quartz includes these keys to support application frameworks such as Carbon and Cocoa. Applications do not need to use them directly.
enum _CGCommonWindowLevelKey { kCGBaseWindowLevelKey = 0, kCGMinimumWindowLevelKey, kCGDesktopWindowLevelKey, kCGBackstopMenuLevelKey, kCGNormalWindowLevelKey, kCGFloatingWindowLevelKey, kCGTornOffMenuWindowLevelKey, kCGDockWindowLevelKey, kCGMainMenuWindowLevelKey, kCGStatusWindowLevelKey, kCGModalPanelWindowLevelKey, kCGPopUpMenuWindowLevelKey, kCGDraggingWindowLevelKey, kCGScreenSaverWindowLevelKey, kCGMaximumWindowLevelKey, kCGOverlayWindowLevelKey, kCGHelpWindowLevelKey, kCGUtilityWindowLevelKey, kCGDesktopIconWindowLevelKey, kCGCursorWindowLevelKey, kCGNumberOfWindowLevelKeys }; typedef int32_t CGWindowLevelKey;
kCGBaseWindowLevelKey
The base key used to define window levels. Do not use.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGMinimumWindowLevelKey
The lowest available window level.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGDesktopWindowLevelKey
The level for the desktop.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGBackstopMenuLevelKey
The level of the backstop menu.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGNormalWindowLevelKey
The level for normal windows.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGFloatingWindowLevelKey
The level for floating windows.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGTornOffMenuWindowLevelKey
The level for torn off menus.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGDockWindowLevelKey
The level for the dock.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGMainMenuWindowLevelKey
The level for the menus displayed in the menu bar.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGStatusWindowLevelKey
The level for status windows.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGModalPanelWindowLevelKey
The level for modal panels.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGPopUpMenuWindowLevelKey
The level for pop-up menus.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGDraggingWindowLevelKey
The level for a window being dragged.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGScreenSaverWindowLevelKey
The level for screen savers.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGMaximumWindowLevelKey
The highest allowed window level.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
kCGOverlayWindowLevelKey
The level for overlay windows.
Available in Mac OS X v10.1 and later.
Declared in CGWindowLevel.h
.
kCGHelpWindowLevelKey
The level for help windows.
Available in Mac OS X v10.1 and later.
Declared in CGWindowLevel.h
.
kCGUtilityWindowLevelKey
The level for utility windows.
Available in Mac OS X v10.1 and later.
Declared in CGWindowLevel.h
.
kCGDesktopIconWindowLevelKey
The level for desktop icons.
Available in Mac OS X v10.1 and later.
Declared in CGWindowLevel.h
.
kCGCursorWindowLevelKey
The level for the cursor.
Available in Mac OS X v10.2 and later.
Declared in CGWindowLevel.h
.
kCGNumberOfWindowLevelKeys
The total number of window levels.
Available in Mac OS X v10.0 and later.
Declared in CGWindowLevel.h
.
Specify keys for the standard properties in a window server session dictionary.
#define kCGSessionUserIDKey CFSTR("kCGSSessionUserIDKey") #define kCGSessionUserNameKey CFSTR("kCGSSessionUserNameKey") #define kCGSessionConsoleSetKey CFSTR("kCGSSessionConsoleSetKey") #define kCGSessionOnConsoleKey CFSTR("kCGSSessionOnConsoleKey") #define kCGSessionLoginDoneKey CFSTR("kCGSessionLoginDoneKey")
kCGSessionUserIDKey
Specifies a CFNumber 32-bit unsigned integer value that encodes a user ID for the session's current user.
Available in Mac OS X v10.3 and later.
Declared in CGSession.h
.
kCGSessionUserNameKey
Specifies a CFString value that encodes the session's short user name as set by the login operation.
Available in Mac OS X v10.3 and later.
Declared in CGSession.h
.
kCGSessionConsoleSetKey
Specifies a CFNumber 32-bit unsigned integer value that represents a set of hardware composing a console.
Available in Mac OS X v10.3 and later.
Declared in CGSession.h
.
kCGSessionOnConsoleKey
Specifies a CFBoolean value indicating whether the session is on a console.
Available in Mac OS X v10.3 and later.
Declared in CGSession.h
.
kCGSessionLoginDoneKey
Specifies a CFBoolean value indicating whether the login operation has been done.
Available in Mac OS X v10.3 and later.
Declared in CGSession.h
.
To learn how to use these keys to access the values in a session dictionary, see CFDictionary Reference.
This table lists the result codes returned by functions in Quartz Display Services.
© 2006, 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-11-19)