Mac OS 9
QDOffscreen.h
Go to the documentation of this file.
1 
19 #ifndef __QDOFFSCREEN__
20 #define __QDOFFSCREEN__
21 
22 #ifndef __MACERRORS__
23 #include <MacErrors.h>
24 #endif
25 
26 #ifndef __QUICKDRAW__
27 #include <Quickdraw.h>
28 #endif
29 
30 #if PRAGMA_ONCE
31 #pragma once
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #if PRAGMA_IMPORT
40 #pragma import on
41 #endif
42 
43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = mac68k
45 #elif PRAGMA_STRUCT_PACKPUSH
46 #pragma pack(push, 2)
47 #elif PRAGMA_STRUCT_PACK
48 #pragma pack(2)
49 #endif
50 
51  enum
52  {
53  pixPurgeBit = 0,
54  noNewDeviceBit = 1,
55  useTempMemBit = 2,
56  keepLocalBit = 3,
57  useDistantHdwrMemBit = 4,
58  useLocalHdwrMemBit = 5,
59  pixelsPurgeableBit = 6,
60  pixelsLockedBit = 7,
61  mapPixBit = 16,
62  newDepthBit = 17,
63  alignPixBit = 18,
64  newRowBytesBit = 19,
65  reallocPixBit = 20,
66  clipPixBit = 28,
67  stretchPixBit = 29,
68  ditherPixBit = 30,
69  gwFlagErrBit = 31
70  };
71 
72  enum
73  {
74  pixPurge = 1L << pixPurgeBit,
75  noNewDevice = 1L << noNewDeviceBit,
76  useTempMem = 1L << useTempMemBit,
77  keepLocal = 1L << keepLocalBit,
78  useDistantHdwrMem = 1L << useDistantHdwrMemBit,
79  useLocalHdwrMem = 1L << useLocalHdwrMemBit,
80  pixelsPurgeable = 1L << pixelsPurgeableBit,
81  pixelsLocked = 1L << pixelsLockedBit,
82  kAllocDirectDrawSurface = 1L << 14,
83  mapPix = 1L << mapPixBit,
84  newDepth = 1L << newDepthBit,
85  alignPix = 1L << alignPixBit,
86  newRowBytes = 1L << newRowBytesBit,
87  reallocPix = 1L << reallocPixBit,
88  clipPix = 1L << clipPixBit,
89  stretchPix = 1L << stretchPixBit,
90  ditherPix = 1L << ditherPixBit,
91  gwFlagErr = 1L << gwFlagErrBit
92  };
93 
94  typedef unsigned long GWorldFlags;
95  // Type definition of a GWorldPtr
96  typedef CGrafPtr GWorldPtr;
105  QDErr
106  NewGWorld(GWorldPtr *offscreenGWorld, short PixelDepth, const Rect *boundsRect,
107  CTabHandle cTable, /* can be NULL */
108  GDHandle aGDevice, /* can be NULL */
109  GWorldFlags flags);
110 
111  /* GDevice attribute bits for Carbon and QuickTime 3.0*/
112  enum
113  {
114  deviceIsIndirect = (1L << 0),
115  deviceNeedsLock = (1L << 1),
116  deviceIsStatic = (1L << 2),
117  deviceIsExternalBuffer = (1L << 3),
118  deviceIsDDSurface = (1L << 4),
119  deviceIsDCISurface = (1L << 5),
120  deviceIsGDISurface = (1L << 6),
121  deviceIsAScreen = (1L << 7),
122  deviceIsOverlaySurface = (1L << 8)
123  };
124 
125 #if TARGET_OS_WIN32
126 #if CALL_NOT_IN_CARBON
135  void *
136  GetGDeviceSurface(GDHandle gdh);
137 
146  unsigned long
147  GetGDeviceAttributes(GDHandle gdh);
148 
149  /* to allocate non-mac-rgb GWorlds use QTNewGWorld (ImageCompression.h) */
158  QDErr
159  NewGWorldFromHBITMAP(GWorldPtr *offscreenGWorld, CTabHandle cTable,
160  GDHandle aGDevice, GWorldFlags flags, void *newHBITMAP,
161  void *newHDC);
162 
163 #endif /* CALL_NOT_IN_CARBON */
164 
165 #endif /* TARGET_OS_WIN32 */
166 
175  QDErr
176  NewGWorldFromPtr(GWorldPtr *offscreenGWorld, unsigned long PixelFormat,
177  const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice,
178  GWorldFlags flags, Ptr newBuffer, long rowBytes);
179 
204  Boolean
206 
225  void
227 
236  GWorldFlags
237  UpdateGWorld(GWorldPtr *offscreenGWorld, short pixelDepth,
238  const Rect *boundsRect, CTabHandle cTable,
239  GDHandle aGDevice, /* can be NULL */
240  GWorldFlags flags);
241 
257  void
258  DisposeGWorld(GWorldPtr offscreenGWorld);
259 
273  void
275 
294  void
296 
312  void
314 
336  void
338 
362  void
364 
385  void
387 
398  void
400 
411  void
413 
430  GWorldFlags
432 
453  void
454  SetPixelsState(PixMapHandle pm, GWorldFlags state);
455 
475 
484  long
486 
495  QDErr
496  NewScreenBuffer(const Rect *globalRect, Boolean purgeable, GDHandle *gdh,
497  PixMapHandle *offscreenPixMap);
498 
511  void
513 
530  GDHandle
531  GetGWorldDevice(GWorldPtr offscreenGWorld);
532 
554  Boolean
556 
565  long
567 
576  QDErr
577  NewTempScreenBuffer(const Rect *globalRect, Boolean purgeable, GDHandle *gdh,
578  PixMapHandle *offscreenPixMap);
579 
591  Boolean
593 
617  GetGWorldPixMap(GWorldPtr offscreenGWorld);
618 
619 #if PRAGMA_STRUCT_ALIGN
620 #pragma options align = reset
621 #elif PRAGMA_STRUCT_PACKPUSH
622 #pragma pack(pop)
623 #elif PRAGMA_STRUCT_PACK
624 #pragma pack()
625 #endif
626 
627 #ifdef PRAGMA_IMPORT_OFF
628 #pragma import off
629 #elif PRAGMA_IMPORT
630 #pragma import reset
631 #endif
632 
633 #ifdef __cplusplus
634 }
635 #endif
636 
637 #endif /* __QDOFFSCREEN__ */
638 * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /*/*/ * /
@ cTable
Definition: AERegistry.h:116
OSErr codes.
unsigned char Boolean
Definition: MacTypes.h:318
QDErr NewGWorldFromPtr(GWorldPtr *offscreenGWorld, unsigned long PixelFormat, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags, Ptr newBuffer, long rowBytes)
void DisposeGWorld(GWorldPtr offscreenGWorld)
Dispose of a GDevice structure and substructures.
QDErr NewScreenBuffer(const Rect *globalRect, Boolean purgeable, GDHandle *gdh, PixMapHandle *offscreenPixMap)
void UnlockPixels(PixMapHandle pm)
Unlock the buffer used by an offscreen graphics world.
void CTabChanged(CTabHandle ctab)
Get a new seed (a unique identifier) for the color table.
QDErr NewGWorld(GWorldPtr *offscreenGWorld, short PixelDepth, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags)
void GetGWorld(CGrafPtr *port, GDHandle *gdh)
Get the current graphics world.
void DisposeScreenBuffer(PixMapHandle offscreenPixMap)
DisposeScreenBuffer Dispose of memory for offscreen buffer and color table.
Boolean LockPixels(PixMapHandle pm)
Lock the offscreen buffer in memory for duration of a draw.
void PixPatChanged(PixPatHandle ppat)
Set the patXValid flag to -1.
void SetPixelsState(PixMapHandle pm, GWorldFlags state)
Set state of the pixel map's offscreen buffer.
void SetGWorld(CGrafPtr port, GDHandle gdh)
Set the current graphics world.
GWorldFlags GetPixelsState(PixMapHandle pm)
Get state of the pixel map's offscreen buffer.
PixMapHandle GetGWorldPixMap(GWorldPtr offscreenGWorld)
Get a handle to the pixel map for an offscreen graphics world.
GDHandle GetGWorldDevice(GWorldPtr offscreenGWorld)
Get a handle to the device attached to the offscreen world.
GWorldFlags UpdateGWorld(GWorldPtr *offscreenGWorld, short pixelDepth, const Rect *boundsRect, CTabHandle cTable, GDHandle aGDevice, GWorldFlags flags)
QDErr NewTempScreenBuffer(const Rect *globalRect, Boolean purgeable, GDHandle *gdh, PixMapHandle *offscreenPixMap)
void PortChanged(GrafPtr port)
Notify QuickDraw of a change.
Boolean PixMap32Bit(PixMapHandle pmHandle)
Determine if PixMap requires 32-bit addr mode to access its pixels.
Ptr GetPixBaseAddr(PixMapHandle pm)
Get a pointer to the beginning of the pixel map's pixels.
void GDeviceChanged(GDHandle gdh)
Notify QuickDraw of a graphics device record change.
Boolean QDDone(GrafPtr port)
Ensure that all drawing is done.
void NoPurgePixels(PixMapHandle pm)
Mark the pixel map's offscreen buffer as unpurgeable.
long GetPixRowBytes(PixMapHandle pm)
void AllowPurgePixels(PixMapHandle pm)
AllowPurgePixels Mark the pixel map's offscreen buffer as purgeable.
long OffscreenVersion(void)
Interface to Quickdraw Graphics.
Definition: Quickdraw.h:2261
Definition: Quickdraw.h:1968
Definition: Quickdraw.h:2178
Definition: Quickdraw.h:1648
Definition: Quickdraw.h:2064
Definition: Quickdraw.h:2091
Definition: PPCToolbox.h:168
Definition: MacTypes.h:527