home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-12-12 | 1.5 KB | 54 lines | [TEXT/KAHL] |
- //----------------------------------------------------------------------------------
- // File : grayCDEF.c
- // Date : September 26, 1994
- // Author : Jim Stout
- // Purpose : support routines for CDEF's that can be disabled
- //----------------------------------------------------------------------------------
- #include <GestaltEqu.h>
- #include <Palettes.h>
- #include <Traps.h>
-
- #include "grayCDEF.h"
- #include "miscCDEF.h"
-
- //----------------------------------------------------------------------------------
- // Returns true if a System 7 style gray color was available and returns the
- // grayish color in theGray
- //----------------------------------------------------------------------------------
-
- extern Boolean getGray(RGBColor *rgbGray)
- {
- RGBColor rgbBack;
- GDHandle hThisDevice;
-
- GetForeColor(rgbGray);
- if(getOSVers() >= 0x0700) {
- GetBackColor(&rgbBack);
- hThisDevice = GetGDevice();
- if(GetGray(hThisDevice,&rgbBack,rgbGray))
- return true;
- }
- return false;
- }
-
- //----------------------------------------------------------------------------------
- // Return true if Gestalt says GrayishTextOr mode is present
- //----------------------------------------------------------------------------------
-
- Boolean haveGrayText (void)
- {
- OSErr err;
- short bit = gestaltHasGrayishTextOr;
- long gResult;
- Boolean result = false;
-
- if(trapAvailable(_Gestalt)) {
- err = Gestalt(gestaltQuickdrawFeatures,&gResult);
- if(err == noErr) {
- if(BitTst(&gResult, 31-bit))
- result = true;
- }
- }
- return(result);
- }
-