home *** CD-ROM | disk | FTP | other *** search
- /* ----------------------------------------------------------------------
-
- BitDepth XFCN
- version 1.0.2
-
- Written by: Paul Celestin
-
- Copyright © 1993-1996 Celestin Company, Inc.
-
- This XFCN returns the bit depth of the main screen.
-
- 930925 - 1.0.0 - initial release
- 951215 - 1.0.1 - updated for CW7
- 960704 - 1.0.2 - updated for CW9
-
- ---------------------------------------------------------------------- */
-
- #include <A4Stuff.h>
- #include <HyperXCmd.h>
-
- void DoIt(XCmdPtr paramPtr);
-
- pascal void main(XCmdPtr paramPtr)
- {
- long oldA4 = SetCurrentA4();
- DoIt( paramPtr );
- SetA4(oldA4);
- }
-
- void DoIt(XCmdPtr paramPtr)
- {
- Str255 copyright = "\pCopyright © 1993-1996 Celestin Company, Inc.";
- long depth;
- Str255 myString;
- GDHandle curDev;
- PixMapHandle myPixMap;
- SysEnvRec myComputer;
-
- if (paramPtr->paramCount != 0)
- {
- paramPtr->returnValue = PasToZero(paramPtr,"\pNo arguments required!");
- }
- else
- {
- SysEnvirons(2,&myComputer);
- if (myComputer.hasColorQD)
- {
- curDev = GetMainDevice();
- if (curDev != 0)
- {
- myPixMap = (**curDev).gdPMap;
- depth = (**myPixMap).pixelSize;
- }
- else
- depth = 1;
- }
- else depth = 1;
-
- NumToStr(paramPtr,depth,myString);
- paramPtr->returnValue = PasToZero(paramPtr,myString);
- }
-
- }
-