|
|
Log In | Not a Member? |
Contact ADC |
|
ADC Home > Reference Library > Reference > Hardware & Drivers > I/O Kit Framework Reference
|
IOGraphicsLib.h |
| Includes: |
IOGraphicsLib implements non-kernel task access to IOGraphics family object types - IOFramebuffer and IOAccelerator. These functions implement a graphics family specific API.
A connection to a graphics IOService must be made before these functions are called. A connection is made with the IOServiceOpen function described in IOKitLib.h. An io_connect_t handle is returned by IOServiceOpen, which must be passed to the IOGraphicsLib functions. The appropriate connection type from IOGraphicsTypes.h must be specified in the call to IOServiceOpen. All of the IOFramebuffer functions can only be called from a kIOFBServerConnectType connection. Except as specified below, functions whose names begin with IOFB are IOFramebuffer functions. Functions whose names begin with IOPS are IOAccelerator functions and must be called from connections of type kIOFBEngineControllerConnectType or kIOFBEngineConnectType.
The functions in IOGraphicsLib use a number of special types. The display mode is the screen's resolution and refresh rate. The known display modes are referred to by an index of type IODisplayModeID. The display depth is the number of significant color bits used in representing each pixel. Depths are also referred to by an index value that is 0 for 8 bits, 1 for 15 bits, and 2 for 24 bits. A combination of display mode and depth may have a number of supported pixel formats. The pixel aperture is an index of supported pixel formats for a display mode and depth. This index is of type IOPixelAperture. All of these graphics specific types are defined in IOGraphicsTypes.h.
IODisplayCreateInfoDictionary |
Create a CFDictionary with information about display hardware.
CFDictionaryRef IODisplayCreateInfoDictionary( io_service_t framebuffer, IOOptionBits options );
framebufferoptionsThe returned CFDictionary that should be released by the caller with CFRelease().
The CFDictionary created by this function contains information about the display hardware associated with a framebuffer. The keys for the dictionary are listed in IOGraphicsTypes.h.
IODisplayMatchDictionaries |
Match two display information dictionaries to see if they are for the same display.
SInt32 IODisplayMatchDictionaries( CFDictionaryRef matching1, CFDictionaryRef matching2, IOOptionBits options );
matching1matching2optionsReturns FALSE if the two displays are not equivalent or TRUE if they are.
By comparing two CFDictionaries returned from IODisplayCreateInfoDictionary(), this function determines if the displays are the same. The information compared is what is returned by calling IODisplayCreateInfoDictionary() with an option of kIODisplayMatchingInfo. This includes information such as the vendor, product, and serial number.
IOFBCreateDisplayModeDictionary |
Create a CFDictionary with information about a display mode.
CFDictionaryRef IOFBCreateDisplayModeDictionary( io_service_t framebuffer, IODisplayModeID displayMode );
framebufferdisplayModeThe returned CFDictionary that should be released by the caller with CFRelease().
This function creates a dictionary containing information about a display mode. The display mode properties that are represented by the kernel as OSDictionary, OSArray, OSSet, OSSymbol, OSString, OSData, OSNumber, or OSBoolean are converted to their CF counterparts and put in the dictionary.
IOFBCreateSharedCursor |
Create shared cursor memory.
extern kern_return_t IOFBCreateSharedCursor( io_connect_t connect, unsigned int version, unsigned int maxWidth, unsigned int maxHeight );
connectversionmaxWidthmaxHeightA kern_return_t error code.
This function allocates memory, containing details about the cursor, that can be shared with a calling non-kernel task. The memory contains a StdFBShmem_t structure, which is defined in IOFrameBufferShared.h. This structure contains information on the cursor image, whether it is current shown, its location, etc. The allocated memory can be mapped to the non-kernel task's memory space by calling IOConnectMapMemory() and passing kIOFBCursorMemory for memoryType.
IOFBGetCurrentDisplayModeAndDepth |
Get the current display mode and depth.
extern kern_return_t IOFBGetCurrentDisplayModeAndDepth( io_connect_t connect, IODisplayModeID *displayMode, IOIndex *depth );
connectdisplayModedepthA kern_return_t error code.
The display mode index returned by this function can be used to determine information about the current display mode and its supported pixel formats through calls to IOFBGetDisplayModeInformation(), IOFBGetPixelFormats(), and IOFBGetPixelInformation().
IOFBGetDisplayModeCount |
Get the number of display modes.
kern_return_t IOFBGetDisplayModeCount( io_connect_t connect, UInt32 *count );
connectcountA kern_return_t error code.
IOFBGetDisplayModeCount returns the number of display modes that the IOFramebuffer service is aware of.
IOFBGetDisplayModeInformation |
Get information about a display mode.
kern_return_t IOFBGetDisplayModeInformation( io_connect_t connect, IODisplayModeID displayMode, IODisplayModeInformation *info );
connectdisplayModeinfoA kern_return_t error code.
Display modes are referred to by their index of type IODisplayModeID. This function returns a structure containing the width, height, refresh rate, maximum depth, etc. of a display mode. The IODisplayModeInformation structure is defined in IOGraphicsTypes.h.
IOFBGetDisplayModes |
Get an array of known display modes.
kern_return_t IOFBGetDisplayModes( io_connect_t connect, UInt32 count, IODisplayModeID *allDisplayModes );
connectcountallDisplayModesA kern_return_t error code.
This function returns an array containing the display modes that the framebuffer service is aware of. To get all display modes, pass the count from IOFBGetDisplayModeCount().
IOFBGetFramebufferInformationForAperture |
Get framebuffer information for a pixel format.
extern kern_return_t IOFBGetFramebufferInformationForAperture( io_connect_t connect, IOPixelAperture aperture, IOFramebufferInformation *info );
connectapertureinfoA kern_return_t error code.
This function returns framebuffer information for a pixel format that is supported for the current display mode and depth. The returned IOFrameBufferInformation structure contains details on the physical address of the framebuffer, height, width, etc. This structure is defined in IOGraphicsTypes.h.
IOFBGetFramebufferOffsetForAperture |
Get the byte offset for a framebuffer's VRAM.
extern kern_return_t IOFBGetFramebufferOffsetForAperture( mach_port_t connect, IOPixelAperture aperture, IOByteCount *offset );
connectapertureoffsetA kern_return_t error code.
[place holder]
IOFBGetPixelFormat |
Get pixel format information.
extern kern_return_t IOFBGetPixelFormat( io_connect_t connect, IODisplayModeID displayMode, IOIndex depth, IOPixelAperture aperture, IOPixelEncoding *pixelFormat );
connectdisplayModedepthaperturepixelFormatA kern_return_t error code.
Displayed colors are encoded in framebuffer memory in a variety of ways. IOFBGetPixelFormat returns a pixel encoding array specifying how each bit of a particular pixel should be interpreted. The definition of the IOPixelEncoding array returned and common Apple pixel formats are described in IOGraphicsTypes.h.
IOFBGetPixelFormats |
Get pixel formats that are supported for a display mode and depth.
kern_return_t IOFBGetPixelFormats( io_connect_t connect, IODisplayModeID displayMode, IOIndex depth, UInt32 *mask );
connectdisplayModedepthmaskA kern_return_t error code.
This function returns a mask of all supported pixel formats for a particular display mode and depth. [How should the mask be interpreted?]
IOFBGetPixelInfoDictionary |
Get a CFDictionary with information about a pixel format.
CFDictionaryRef IOFBGetPixelInfoDictionary( CFDictionaryRef modeDictionary, IOIndex depth, IOPixelAperture aperture );
modeDictionarydepthapertureThe returned CFDictionary that should be released by the caller with CFRelease().
This function extracts a CFDictionary containing information about a supported pixel format from a larger CFDictionary describing a display mode. IOFBCreateDisplayModeDictionary() must be called first to generate the CFDictionary for a display mode.
IOFBGetPixelInformation |
Get information about a pixel format.
kern_return_t IOFBGetPixelInformation( io_connect_t connect, IODisplayModeID displayMode, IOIndex depth, IOPixelAperture aperture, IOPixelInformation *pixelInfo );
connectdisplayModedepthaperturepixelInfoA kern_return_t error code.
IOFBGetPixelInformation returns a structure containing information about a pixel format such as the bits per pixel, pixel format, etc. The IOPixelInformation structure is defined in IOGraphicsTypes.h.
IOFBSet256To888Table |
[place holder]
extern kern_return_t IOFBSet256To888Table( io_connect_t connect, const unsigned int *table );
connecttableA kern_return_t error code.
[place holder]
IOFBSet444To555Table |
[place holder]
extern kern_return_t IOFBSet444To555Table( io_connect_t connect, const unsigned char *table );
connecttableA kern_return_t error code.
[place holder]
IOFBSet555To444Table |
[place holder]
extern kern_return_t IOFBSet555To444Table( io_connect_t connect, const unsigned char *table );
connecttableA kern_return_t error code.
[place holder]
IOFBSet888To256Table |
[place holder]
extern kern_return_t IOFBSet888To256Table( io_connect_t connect, const unsigned char *table );
connecttableA kern_return_t error code.
[place holder]
IOFBSetBounds |
Set the location of the framebuffer within display space.
extern kern_return_t IOFBSetBounds( io_connect_t connect, IOGBounds *rect );
connectrectA kern_return_t error code.
If there is more than one screen in use, the locations of the screens relative to each other must be specified. These locations are specified in a "display space" that encompasses all the screens. The bounding regions of the screens within display space indicate their location relative to each other as the cursor moves between them. This function sets the bounding region for a framebuffer within display space. If there is only one screen, this does not need to specified, because by default the screen coordinates and display space coordinates will be the same.
IOFBSetCLUT |
Set the color table.
extern kern_return_t IOFBSetCLUT( io_connect_t connect, UInt32 startIndex, UInt32 numEntries, IOOptionBits options, IOColorEntry *colors );
connectstartIndexnumEntriesoptionscolorsA kern_return_t error code.
Indexed pixel formats require a color table to convert from the index stored in a pixel memory location to a displayed color. IOFBSetCLUT sets one or more entries of the color table.
IOFBSetCursorPosition |
Set the hardware cursor position.
kern_return_t IOFBSetCursorPosition( io_connect_t connect, long int x, long int y );
connectxyA kern_return_t error code.
This function only works with the hardware cursor and will fail if a hardware cursor is not supported.
IOFBSetCursorVisible |
Set the hardware cursor visible or invisible.
kern_return_t IOFBSetCursorVisible( io_connect_t connect, int visible );
connectvisibleA kern_return_t error code.
The hardware cursor can only be set visible or invisible when it is active. Use IOFBSetNewCursor() to activate the hardware cursor.
IOFBSetDisplayModeAndDepth |
Set the current display mode and depth.
kern_return_t IOFBSetDisplayModeAndDepth( io_connect_t connect, IODisplayModeID displayMode, IOIndex depth );
connectdisplayModedepthA kern_return_t error code.
IOFBSetGamma |
Set the gamma data.
extern kern_return_t IOFBSetGamma( io_connect_t connect, UInt32 channelCount, UInt32 dataCount, UInt32 dataWidth, void *data );
connectchannelCountdataCountdataWidthdataA kern_return_t error code.
[place holder]
IOFBSetNewCursor |
Set a new hardware cursor.
kern_return_t IOFBSetNewCursor( io_connect_t connect, void *cursor, IOIndex frame, IOOptionBits options );
connectcursorframeoptionsA kern_return_t error code.
A non-kernel task interacts with the IOFramebuffer service through a slice of shared memory that is created with the IOFBCreateSharedCursor function. The shared memory is a structure of type StdFBShmem_t. In this shared memory several cursor images, or frames may be defined. The maximum number of frames is kIOFBNumCursorFrames. StdFBShmem_t and kIOFBNumCursorFrames are defined in IOFramebufferShared.h. This function sets a new frame to be used as the current cursor image and activates the hardware cursor.
IOFBSetStartupDisplayModeAndDepth |
Set the display mode and depth to use on startup.
kern_return_t IOFBSetStartupDisplayModeAndDepth( io_connect_t connect, IODisplayModeID displayMode, IOIndex depth );
connectdisplayModedepthA kern_return_t error code.
IODisplayDictionaryOptions |
enum { kIODisplayMatchingInfo = 0x00000100, kIODisplayOnlyPreferredName = 0x00000200, kIODisplayNoProductName = 0x00000400 };
kIODisplayMatchingInfo- Include only the keys necessary to match two displays with IODisplayMatchDictionaries().
kIODisplayOnlyPreferredName- The kDisplayProductName property includes only the localized names returned by CFBundleCopyPreferredLocalizationsFromArray().
kIODisplayNoProductName- The kDisplayProductName property is not included in the returned dictionary.
IOCreateDisplayInfoDictionary |
#define IOCreateDisplayInfoDictionary(f,o) \ IODisplayCreateInfoDictionary(f,o)
IOCreateDisplayInfoDictionary() was renamed IODisplayCreateInfoDictionary(). IOCreateDisplayInfoDictionary() is now a macro for IODisplayCreateInfoDictionary() for compatibility with older code.
|