Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: THINK C & 32-bit quickdraw Message-ID: <32503@ucbvax.BERKELEY.EDU> Date: 12 Nov 89 07:24:07 GMT Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 118 As my way of saying thank you, here are the interfaces for 32-bit Quickdraw for THINK C. You may want to save this file and upload it, since it contains tabs and fairly long lines.: > The mac is a detour in the inevitable march of mediocre computers. > drs@bnlux0.bnl.gov (David R. Stampf) --- David Phillip Oster -master of the ad hoc odd hack. Arpa: oster@dewey.soe.berkeley.edu Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu (cut here, call this QuickDraw32Bit.h). /* let's get a real juicy 32 bit discussion going based on this maybe !! by bhamlin@well.sf.ca.us (Brian M. Hamlin) from oster@well.sf.ca.us (David Phillip Oster) */ /* I think that's it - check it out, write something fun. Remember: You don't have to have a 32bit video card, just Sys 6.0.3 or greater on a color-capable machine and the 32bit Quickdraw INIT in your system folder to use these calls ! */ /* hoo-boy, well ANYWAY thanks to Sam Roberts for assembler tweaking. */ #ifndef _QuickDraw32Bit_ #define _QuickDraw32Bit_ #ifndef _Quickdraw_ #include #endif #ifndef _Color_ #include #endif /* New Constants for 32-Bit QuickDraw */ #define ditherCopy 64 /* Dither mode for Copybits */ #define RGBDirect 16 /* 16 & 32 bits/pixel pixelType value */ /* New error codes */ #define rgnOverflowErr -147 /* Region accumulation failed. Resulting region may be currupt */ #define pixmapTooDeepErr -148 /* Pixmap is not 1-bit/pixel for BitmapToRegion */ #define insufficientStackErr -149 /* QuickDraw could not complete the operation */ #define cDepthErr -157 /* invalid pixel depth passed to NewGWorld or UpdateGWorld */ #define pixPurgeMask 1 #define noNewDeviceMask 2 /* Flag bits passed to or returned by Offscreen routines */ enum { pixPurgeBit = 0, nowNewDeviceBit = 1, pixelsPurgeableBit = 6, pixelsLockedBit = 7, mapPixBit = 16, /* set if color table mapping occurred */ newDepthBit = 17, /* set if pixels were scaled to a different depth */ alignPixBit = 18, /* set if pixels were realigned to screen alignment */ newRowBytesBit = 19, /* set if pixmap was reconfigured in a new rowBytes */ reallocPixBit = 20, /* set if offscreen buffer had to be reallocated */ clipPixBit = 28, /* set if pixels were or are to be clipped */ stretchPixBit = 29, /* set if pixels were or are to be stretched/shrinked */ ditherPixBit = 30, gwFlagErrBit = 31 }; typedef enum { pixPurge = 1L << pixPurgeBit, nowNewDevice = 1L << nowNewDeviceBit, pixelsPurgeable = 1L << pixelsPurgeableBit, pixelsLocked = 1L << pixelsLockedBit, mapPix = 1L << mapPixBit, newDepth = 1L << newDepthBit, alignPix = 1L << alignPixBit, newRowBytes = 1L << newRowBytesBit, reallocPix = 1L << reallocPixBit, clipPix = 1L << clipPixBit, stretchPix = 1L << stretchPixBit, ditherPix = 1L << ditherPixBit, gwFlagErr = 1L << gwFlagErrBit }GWorldFlag; typedef long GWorldFlags; /* Type definition of a GWorldPtr */ typedef CGrafPtr GWorldPtr; /* Function Prototypes (necessary to get automatic type coercion -- see LSC User's Manual p.125) */ pascal OSErr BitmapToRegion(RgnHandle, BitMap *); pascal QDErr NewGWorld(GWorldPtr *, short, Rect *, CTabHandle, GDHandle, GWorldFlags); pascal Boolean LockPixels(PixMapHandle); pascal void UnlockPixels(PixMapHandle); pascal GWorldFlags UpdateGWorld(GWorldPtr *, short, Rect *, CTabHandle, GDHandle, GWorldFlags); pascal void DisposeGWorld(GWorldPtr); pascal void GetGWorld(CGrafPtr *, GDHandle *); pascal void SetGWorld(CGrafPtr, GDHandle); pascal void CTabChanged(CTabHandle); pascal void PixPatChanged(PixPatHandle); pascal void PortChanged(GrafPtr); pascal void GDeviceChanged(GDHandle); pascal void AllowPurgePixels(PixMapHandle); pascal void NoPurgePixels(PixMapHandle); pascal GWorldFlags GetPixelsState(PixMapHandle); pascal void SetPixelsState(PixMapHandle, GWorldFlags); pascal Ptr GetPixBaseAddr(PixMapHandle); pascal QDErr NewScreenBuffer(Rect *, Boolean, GDHandle *, PixMapHandle *); pascal void DisposeScreenBuffer(PixMapHandle); pascal GDHandle GetGWorldDevice(GWorldPtr); #endif