QDOffscreen.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:10k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       QDOffscreen.h
  3.  
  4.      Contains:   Quickdraw Offscreen GWorld Interfaces.
  5.  
  6.      Version:    Technology: Mac OS 8
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QDOFFSCREEN__
  18. #define __QDOFFSCREEN__
  19. #ifndef __MACERRORS__
  20. #include "MacErrors.h"
  21. #endif
  22. #ifndef __QUICKDRAW__
  23. #include "Quickdraw.h"
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35.     #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37.     #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39.     #pragma pack(2)
  40. #endif
  41. enum {
  42.     pixPurgeBit                 = 0,
  43.     noNewDeviceBit              = 1,
  44.     useTempMemBit               = 2,
  45.     keepLocalBit                = 3,
  46.     useDistantHdwrMemBit        = 4,
  47.     useLocalHdwrMemBit          = 5,
  48.     pixelsPurgeableBit          = 6,
  49.     pixelsLockedBit             = 7,
  50.     mapPixBit                   = 16,
  51.     newDepthBit                 = 17,
  52.     alignPixBit                 = 18,
  53.     newRowBytesBit              = 19,
  54.     reallocPixBit               = 20,
  55.     clipPixBit                  = 28,
  56.     stretchPixBit               = 29,
  57.     ditherPixBit                = 30,
  58.     gwFlagErrBit                = 31
  59. };
  60. enum {
  61.     pixPurge                    = 1L << pixPurgeBit,
  62.     noNewDevice                 = 1L << noNewDeviceBit,
  63.     useTempMem                  = 1L << useTempMemBit,
  64.     keepLocal                   = 1L << keepLocalBit,
  65.     useDistantHdwrMem           = 1L << useDistantHdwrMemBit,
  66.     useLocalHdwrMem             = 1L << useLocalHdwrMemBit,
  67.     pixelsPurgeable             = 1L << pixelsPurgeableBit,
  68.     pixelsLocked                = 1L << pixelsLockedBit,
  69.     kAllocDirectDrawSurface     = 1L << 14,
  70.     mapPix                      = 1L << mapPixBit,
  71.     newDepth                    = 1L << newDepthBit,
  72.     alignPix                    = 1L << alignPixBit,
  73.     newRowBytes                 = 1L << newRowBytesBit,
  74.     reallocPix                  = 1L << reallocPixBit,
  75.     clipPix                     = 1L << clipPixBit,
  76.     stretchPix                  = 1L << stretchPixBit,
  77.     ditherPix                   = 1L << ditherPixBit,
  78.     gwFlagErr                   = 1L << gwFlagErrBit
  79. };
  80. typedef unsigned long                   GWorldFlags;
  81. /* Type definition of a GWorldPtr */
  82. typedef CGrafPtr                        GWorldPtr;
  83. EXTERN_API( QDErr )
  84. NewGWorld                       (GWorldPtr *            offscreenGWorld,
  85.                                  short                  PixelDepth,
  86.                                  const Rect *           boundsRect,
  87.                                  CTabHandle             cTable, /* can be NULL */
  88.                                  GDHandle               aGDevice, /* can be NULL */
  89.                                  GWorldFlags            flags)                              FOURWORDINLINE(0x203C, 0x0016, 0x0000, 0xAB1D);
  90. /* GDevice attribute bits for Carbon and QuickTime 3.0*/
  91. enum {
  92.     deviceIsIndirect            = (1L << 0),
  93.     deviceNeedsLock             = (1L << 1),
  94.     deviceIsStatic              = (1L << 2),
  95.     deviceIsExternalBuffer      = (1L << 3),
  96.     deviceIsDDSurface           = (1L << 4),
  97.     deviceIsDCISurface          = (1L << 5),
  98.     deviceIsGDISurface          = (1L << 6),
  99.     deviceIsAScreen             = (1L << 7),
  100.     deviceIsOverlaySurface      = (1L << 8)
  101. };
  102. #if TARGET_OS_WIN32
  103. #if CALL_NOT_IN_CARBON
  104. EXTERN_API( void *)
  105. GetGDeviceSurface               (GDHandle               gdh);
  106. EXTERN_API( unsigned long )
  107. GetGDeviceAttributes            (GDHandle               gdh);
  108. /* to allocate non-mac-rgb GWorlds use QTNewGWorld (ImageCompression.h) */
  109. EXTERN_API( QDErr )
  110. NewGWorldFromHBITMAP            (GWorldPtr *            offscreenGWorld,
  111.                                  CTabHandle             cTable,
  112.                                  GDHandle               aGDevice,
  113.                                  GWorldFlags            flags,
  114.                                  void *                 newHBITMAP,
  115.                                  void *                 newHDC);
  116. #endif  /* CALL_NOT_IN_CARBON */
  117. #endif  /* TARGET_OS_WIN32 */
  118. #if CALL_NOT_IN_CARBON
  119. EXTERN_API( QDErr )
  120. NewGWorldFromPtr                (GWorldPtr *            offscreenGWorld,
  121.                                  unsigned long          PixelFormat,
  122.                                  const Rect *           boundsRect,
  123.                                  CTabHandle             cTable,
  124.                                  GDHandle               aGDevice,
  125.                                  GWorldFlags            flags,
  126.                                  Ptr                    newBuffer,
  127.                                  long                   rowBytes);
  128. #endif  /* CALL_NOT_IN_CARBON */
  129. EXTERN_API( Boolean )
  130. LockPixels                      (PixMapHandle           pm)                                 FOURWORDINLINE(0x203C, 0x0004, 0x0001, 0xAB1D);
  131. EXTERN_API( void )
  132. UnlockPixels                    (PixMapHandle           pm)                                 FOURWORDINLINE(0x203C, 0x0004, 0x0002, 0xAB1D);
  133. EXTERN_API( GWorldFlags )
  134. UpdateGWorld                    (GWorldPtr *            offscreenGWorld,
  135.                                  short                  pixelDepth,
  136.                                  const Rect *           boundsRect,
  137.                                  CTabHandle             cTable,
  138.                                  GDHandle               aGDevice, /* can be NULL */
  139.                                  GWorldFlags            flags)                              FOURWORDINLINE(0x203C, 0x0016, 0x0003, 0xAB1D);
  140. EXTERN_API( void )
  141. DisposeGWorld                   (GWorldPtr              offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0004, 0xAB1D);
  142. EXTERN_API( void )
  143. GetGWorld                       (CGrafPtr *             port,
  144.                                  GDHandle *             gdh)                                FOURWORDINLINE(0x203C, 0x0008, 0x0005, 0xAB1D);
  145. EXTERN_API( void )
  146. SetGWorld                       (CGrafPtr               port,
  147.                                  GDHandle               gdh)                                FOURWORDINLINE(0x203C, 0x0008, 0x0006, 0xAB1D);
  148. EXTERN_API( void )
  149. CTabChanged                     (CTabHandle             ctab)                               FOURWORDINLINE(0x203C, 0x0004, 0x0007, 0xAB1D);
  150. EXTERN_API( void )
  151. PixPatChanged                   (PixPatHandle           ppat)                               FOURWORDINLINE(0x203C, 0x0004, 0x0008, 0xAB1D);
  152. EXTERN_API( void )
  153. PortChanged                     (GrafPtr                port)                               FOURWORDINLINE(0x203C, 0x0004, 0x0009, 0xAB1D);
  154. EXTERN_API( void )
  155. GDeviceChanged                  (GDHandle               gdh)                                FOURWORDINLINE(0x203C, 0x0004, 0x000A, 0xAB1D);
  156. EXTERN_API( void )
  157. AllowPurgePixels                (PixMapHandle           pm)                                 FOURWORDINLINE(0x203C, 0x0004, 0x000B, 0xAB1D);
  158. EXTERN_API( void )
  159. NoPurgePixels                   (PixMapHandle           pm)                                 FOURWORDINLINE(0x203C, 0x0004, 0x000C, 0xAB1D);
  160. EXTERN_API( GWorldFlags )
  161. GetPixelsState                  (PixMapHandle           pm)                                 FOURWORDINLINE(0x203C, 0x0004, 0x000D, 0xAB1D);
  162. EXTERN_API( void )
  163. SetPixelsState                  (PixMapHandle           pm,
  164.                                  GWorldFlags            state)                              FOURWORDINLINE(0x203C, 0x0008, 0x000E, 0xAB1D);
  165. EXTERN_API( Ptr )
  166. GetPixBaseAddr                  (PixMapHandle           pm)                                 FOURWORDINLINE(0x203C, 0x0004, 0x000F, 0xAB1D);
  167. EXTERN_API( long )
  168. GetPixRowBytes                  (PixMapHandle           pm)                                 FOURWORDINLINE(0x203C, 0x0004, 0x0018, 0xAB1D);
  169. EXTERN_API( QDErr )
  170. NewScreenBuffer                 (const Rect *           globalRect,
  171.                                  Boolean                purgeable,
  172.                                  GDHandle *             gdh,
  173.                                  PixMapHandle *         offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x000E, 0x0010, 0xAB1D);
  174. EXTERN_API( void )
  175. DisposeScreenBuffer             (PixMapHandle           offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x0004, 0x0011, 0xAB1D);
  176. EXTERN_API( GDHandle )
  177. GetGWorldDevice                 (GWorldPtr              offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0012, 0xAB1D);
  178. EXTERN_API( Boolean )
  179. QDDone                          (GrafPtr                port)                               FOURWORDINLINE(0x203C, 0x0004, 0x0013, 0xAB1D);
  180. EXTERN_API( long )
  181. OffscreenVersion                (void)                                                      TWOWORDINLINE(0x7014, 0xAB1D);
  182. EXTERN_API( QDErr )
  183. NewTempScreenBuffer             (const Rect *           globalRect,
  184.                                  Boolean                purgeable,
  185.                                  GDHandle *             gdh,
  186.                                  PixMapHandle *         offscreenPixMap)                    FOURWORDINLINE(0x203C, 0x000E, 0x0015, 0xAB1D);
  187. EXTERN_API( Boolean )
  188. PixMap32Bit                     (PixMapHandle           pmHandle)                           FOURWORDINLINE(0x203C, 0x0004, 0x0016, 0xAB1D);
  189. EXTERN_API( PixMapHandle )
  190. GetGWorldPixMap                 (GWorldPtr              offscreenGWorld)                    FOURWORDINLINE(0x203C, 0x0004, 0x0017, 0xAB1D);
  191. #if PRAGMA_STRUCT_ALIGN
  192.     #pragma options align=reset
  193. #elif PRAGMA_STRUCT_PACKPUSH
  194.     #pragma pack(pop)
  195. #elif PRAGMA_STRUCT_PACK
  196.     #pragma pack()
  197. #endif
  198. #ifdef PRAGMA_IMPORT_OFF
  199. #pragma import off
  200. #elif PRAGMA_IMPORT
  201. #pragma import reset
  202. #endif
  203. #ifdef __cplusplus
  204. }
  205. #endif
  206. #endif /* __QDOFFSCREEN__ */