Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 5 - Graphics Devices / Graphics Devices Reference
Routines for Graphics Devices / Determining the Characteristics of a Video Device


TestDeviceAttribute

To determine whether the flag bit for an attribute has been set in the gdFlags field of a GDevice record, use the TestDeviceAttribute function.

FUNCTION TestDeviceAttribute (gdh: GDHandle; 
                              attribute: Integer): Boolean;
gdh
A handle to a GDevice record.
attribute
One of the following constants, which represent bits in the gdFlags field of a GDevice record:
           CONST {flag bits for gdFlags field of GDevice record}
            gdDevType      = 0;  {if bit is set to 0, graphics }
                                 { device is black and white; }
                                 { if set to 1, device supports }
                                 { color}
            burstDevice    = 7;  {if bit is set to 1, device }
                                 { supports block transfer}
            ext32Device    = 8;  {if bit is set to 1, device }
                                 { must be used in 32-bit mode}
            ramInit        = 10; {if bit is set to 1, device has }
                                 { been initialized from RAM}
            mainScreen     = 11; {if bit is set to 1, device is }
                                 { the main screen}
            allInit        = 12; {if bit is set to 1, all }
                                 { devices were initialized from }
                                 { 'scrn' resource}
            screenDevice   = 13; {if bit is set to 1, device is }
                                 { a screen}
            noDriver       = 14; {if bit is set to 1, GDevice }
                                 { record has no driver}
            screenActive   = 15; {if bit is set to 1, device is }
                                 { active}
DESCRIPTION
The TestDeviceAttribute function tests a single graphics device attribute to see if its bit is set to 1 and, if so, returns TRUE. Otherwise, TestDeviceAttribute returns FALSE.

SPECIAL CONSIDERATIONS
The TestDeviceAttribute function may move or purge memory blocks in the application heap. Your application should not call this function at interrupt time.

SEE ALSO
Listing 5-3 on page 5-9 illustrates the use of TestDeviceAttribute. Your application can use the SetDeviceAttribute procedure, described on page 5-21, to change any of the flags tested by the TestDeviceAttribute function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996