home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / iimgctx.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  5KB  |  135 lines

  1. //+-------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright 1996 - 1998 Microsoft Corporation. All Rights Reserved.
  5. //
  6. //  File: iimgctx.h
  7. //
  8. //--------------------------------------------------------------------------
  9.  
  10. #ifndef _IImgCtxObjects_H_
  11. #define _IImgCtxObjects_H_
  12.  
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. typedef void (CALLBACK *PFNIMGCTXCALLBACK)(void *, void *);
  17. #ifdef __cplusplus
  18. }
  19. #endif
  20.  
  21. #define IMGCHG_SIZE         0x0001
  22. #define IMGCHG_VIEW         0x0002
  23. #define IMGCHG_COMPLETE     0x0004
  24. #define IMGCHG_ANIMATE      0x0008
  25. #define IMGCHG_MASK         0x000F
  26.  
  27. #define IMGLOAD_NOTLOADED   0x00100000  // Image has not yet been loaded
  28. #define IMGLOAD_LOADING     0x00200000  // Image in the process of being loaded
  29. #define IMGLOAD_STOPPED     0x00400000  // Imaged aborted
  30. #define IMGLOAD_ERROR       0x00800000  // Error loading image
  31. #define IMGLOAD_COMPLETE    0x01000000  // Image loaded
  32. #define IMGLOAD_MASK        0x01F00000
  33.  
  34. #define IMGBITS_NONE        0x02000000
  35. #define IMGBITS_PARTIAL     0x04000000
  36. #define IMGBITS_TOTAL       0x08000000
  37. #define IMGBITS_MASK        0x0E000000
  38.  
  39. #define IMGANIM_ANIMATED    0x10000000
  40. #define IMGANIM_MASK        0x10000000
  41.  
  42. #define IMGTRANS_OPAQUE     0x20000000
  43. #define IMGTRANS_MASK       0x20000000
  44.  
  45. #define DWN_COLORMODE       0x0000003F  // Explicit color mode requested
  46. #define DWN_DOWNLOADONLY    0x00000040  // Download data only, don't decode
  47. #define DWN_FORCEDITHER     0x00000080  // Override automatic dithering
  48. #define DWN_RAWIMAGE        0x00000100  // Disable dithering 
  49.  
  50. /* Definition of interface: IImgCtx */
  51. #undef INTERFACE
  52. #define INTERFACE IImgCtx
  53.  
  54. // {3050f3d7-98b5-11cf-bb82-00aa00bdce0b}
  55. DEFINE_GUID(IID_IImgCtx, 0x3050f3d7, 0x98b5, 0x11cf, 0xbb, 0x82, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x0b);
  56.  
  57. DECLARE_INTERFACE_(IImgCtx, IUnknown)
  58. {
  59. #ifndef NO_BASEINTERFACE_FUNCS
  60.  
  61.     /* IUnknown methods */
  62.     STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
  63.     STDMETHOD_(ULONG, AddRef)(THIS) PURE;
  64.     STDMETHOD_(ULONG, Release)(THIS) PURE;
  65. #endif
  66.  
  67.     /* IImgCtx methods */
  68.  
  69.     /* Initialization/Download methods */
  70.     STDMETHOD(Load)(THIS_ LPCWSTR pszUrl, DWORD dwFlags) PURE;
  71.     STDMETHOD(SelectChanges)(THIS_ ULONG ulChgOn, ULONG ulChgOff, BOOL fSignal) PURE;
  72.     STDMETHOD(SetCallback)(THIS_ PFNIMGCTXCALLBACK pfn, void * pvPrivateData) PURE;
  73.     STDMETHOD(Disconnect)(THIS) PURE;
  74.  
  75.     /* Query methods */
  76.     STDMETHOD(GetUpdateRects)(THIS_ struct tagRECT FAR* prc, struct tagRECT FAR* prcImg, long FAR* pcrc) PURE;
  77.     STDMETHOD(GetStateInfo)(THIS_ ULONG FAR* pulState, struct tagSIZE FAR* psize, BOOL fClearChanges) PURE;
  78.     STDMETHOD(GetPalette)(THIS_ HPALETTE FAR* phpal) PURE;
  79.  
  80.     /* Rendering methods */
  81.     STDMETHOD(Draw)(THIS_ HDC hdc, struct tagRECT FAR* prcBounds) PURE;
  82.     STDMETHOD(Tile)(THIS_ HDC hdc, struct tagPOINT FAR* pptBackOrg, struct tagRECT FAR* prcClip, struct tagSIZE FAR* psize) PURE;
  83.     STDMETHOD(StretchBlt)(THIS_ HDC hdc, int dstX, int dstY, int dstXE, int dstYE, int srcX, int srcY, int srcXE, int srcYE, DWORD dwROP) PURE;
  84. };
  85.  
  86. #ifdef COBJMACROS
  87.  
  88.  
  89. #define IImgCtx_QueryInterface(This,riid,ppvObject)    \
  90.     (This)->lpVtbl -> QueryInterface(This,riid,ppvObject)
  91.  
  92. #define IImgCtx_AddRef(This)    \
  93.     (This)->lpVtbl -> AddRef(This)
  94.  
  95. #define IImgCtx_Release(This)    \
  96.     (This)->lpVtbl -> Release(This)
  97.  
  98. #define IImgCtx_Load(This, pszUrl, dwFlags)    \
  99.     (This)->lpVtbl -> Load(This, pszUrl, dwFlags)
  100.  
  101. #define IImgCtx_Draw(This, hdc, prcBounds)        \
  102.     (This)->lpVtbl -> Draw(This, hdc, prcBounds)
  103.  
  104. #define IImgCtx_Tile(This, hdc, pptBackOrg, prcClip, psize)        \
  105.     (This)->lpVtbl -> Tile(This, hdc, pptBackOrg, prcClip, psize)
  106.  
  107. #define IImgCtx_GetUpdateRects(This, prc, prcImg, pcrc)    \
  108.     (This)->lpVtbl -> GetUpdateRects(This, prc, prcImg, pcrc)
  109.  
  110. #define IImgCtx_GetStateInfo(This, pulState, psize, fClearChanges)    \
  111.     (This)->lpVtbl -> GetStateInfo(This, pulState, psize, fClearChanges)
  112.  
  113. #define IImgCtx_GetPalette(This, phpal)    \
  114.     (This)->lpVtbl -> GetPalette(This, phpal)
  115.     
  116. #define IImgCtx_SelectChanges(This, ulChgOn, ulChgOff, fSignal)    \
  117.     (This)->lpVtbl -> SelectChanges(This, ulChgOn, ulChgOff, fSignal)
  118.  
  119. #define IImgCtx_SetCallback(This, pfnCallback, pvPrivateData)    \
  120.     (This)->lpVtbl -> SetCallback(This, pfnCallback, pvPrivateData)
  121.  
  122. #define IImgCtx_Disconnect(This) \
  123.     (This)->lpVtbl -> Disconnect(This)
  124.  
  125. #define IImgCtx_StretchBlt(This, hdc, dstX, dstY, dstXE, dstYE, srcX, srcY, srcXE, srcYE, dwROP)   \
  126.     (This)->lpVtbl -> StretchBlt(This, hdc, dstX, dstY, dstXE, dstYE, srcX, srcY, srcXE, srcYE, dwROP)
  127.  
  128. #endif /* COBJMACROS */
  129.  
  130.  
  131. // {3050f3d6-98b5-11cf-bb82-00aa00bdce0b}
  132. DEFINE_GUID(CLSID_IImgCtx, 0x3050f3d6, 0x98b5, 0x11cf, 0xbb, 0x82, 0x00, 0xaa, 0x00, 0xbd, 0xce, 0x0b);
  133.  
  134. #endif
  135.