home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / ocmm.idl < prev    next >
Text File  |  1998-04-25  |  7KB  |  246 lines

  1. //+------------------------------------------------------------------------
  2. //
  3. //  Filter and Bitmap Surface interfaces
  4. //
  5. //  Copyright 1996 - 1998 Microsoft Corporation.
  6. //
  7. //  File:       ocmm.idl
  8. //
  9. //-------------------------------------------------------------------------
  10.  
  11. import "oaidl.idl";
  12. import "oleidl.idl";
  13.  
  14. interface IViewFilter;
  15. interface IViewFilterSite;
  16.  
  17. cpp_quote("// GetStatusBits Flags")
  18. cpp_quote("#define FILTER_STATUS_OPAQUE    (0x00000001)")
  19. cpp_quote("#define FILTER_STATUS_INVISIBLE (0x00000002)")
  20. cpp_quote("#define FILTER_STATUS_SURFACE   (0x00000004)")
  21. cpp_quote("#define FILTER_STATUS_3DSURFACE (0x00000008)")
  22.  
  23. [
  24.     object,
  25.     uuid(3050f2f1-98b5-11cf-bb82-00aa00bdce0b),
  26.     pointer_default(unique),
  27.     local
  28. ]
  29. interface IViewFilter : IUnknown
  30. {
  31.     HRESULT SetSource([in] IViewFilter *pFilter);
  32.     HRESULT GetSource([out] IViewFilter **ppFilter);
  33.     HRESULT SetSite([in] IViewFilterSite *pSink);
  34.     HRESULT GetSite([out] IViewFilterSite **ppSink);
  35.     HRESULT SetPosition(LPCRECT prc);
  36.     HRESULT Draw([in] HDC hdc, [in] LPCRECT prcBounds);
  37.     HRESULT GetStatusBits([out] DWORD *pdwFlags);
  38. }
  39.  
  40. [
  41.     object,
  42.     uuid(3050f372-98b5-11cf-bb82-00aa00bdce0b),
  43.     pointer_default(unique),
  44.     local
  45. ]
  46. interface IViewTransition : IViewFilter
  47. {
  48.     HRESULT Initialize([in] HDC, LPCRECT prc);
  49.     HRESULT Go([in] VARIANT vtimeDuration);
  50. }
  51.  
  52. [
  53.     object,
  54.     uuid(3050f2f4-98b5-11cf-bb82-00aa00bdce0b),
  55.     pointer_default(unique),
  56.     local
  57. ]
  58. interface IViewFilterSite : IUnknown
  59. {
  60.     HRESULT GetDC([in] LPCRECT prc, [in] DWORD dwFlags, [out] HDC *phdc);
  61.     HRESULT ReleaseDC([in] HDC hdc);
  62.     HRESULT InvalidateRect([in] LPCRECT prc, [in] BOOL fErase);
  63.     HRESULT InvalidateRgn([in] HRGN hrgn, [in] BOOL fErase);
  64.     HRESULT OnStatusBitsChange([in] DWORD dwFlags);
  65. }
  66.  
  67. [
  68.     object,
  69.     uuid(3050f373-98b5-11cf-bb82-00aa00bdce0b),
  70.     pointer_default(unique),
  71.     local
  72. ]
  73. interface IViewTransitionSite : IViewFilterSite
  74. {
  75.     HRESULT OnComplete();
  76. }
  77.  
  78.  
  79. cpp_quote("#define SURFACE_LOCK_EXCLUSIVE        0x01")
  80. cpp_quote("#define SURFACE_LOCK_ALLOW_DISCARD    0x02")
  81. cpp_quote("#define SURFACE_LOCK_WAIT             0x04")
  82. cpp_quote("")
  83.  
  84. // BUGBUG: DEFINING NEW ERROR AND STATUS CODES. WHAT'S THE GENERAL PROCEDURE
  85. // FOR THIS? WHAT'S OUR FACILITY CODE? I'M MAKING THIS UP FOR NOW.
  86. // FACILITY CODE FOR SUFACE WILL BE 12 (NOT USED IN WINERROR)
  87.  
  88. cpp_quote("#define E_SURFACE_NOSURFACE             0x8000C000L")
  89. cpp_quote("#define E_SURFACE_UNKNOWN_FORMAT        0x8000C001L")
  90. cpp_quote("#define E_SURFACE_NOTMYPOINTER          0x8000C002L")
  91. cpp_quote("#define E_SURFACE_DISCARDED             0x8000C003L")
  92. cpp_quote("#define E_SURFACE_NODC                  0x8000C004L")
  93. cpp_quote("#define E_SURFACE_NOTMYDC               0x8000C005L")
  94. cpp_quote("#define S_SURFACE_DISCARDED             0x0000C003L")        // Success code
  95. cpp_quote("")
  96.  
  97. typedef GUID BFID;
  98. typedef struct tagRGBQUAD RGBQUAD;
  99.  
  100. cpp_quote("EXTERN_C const GUID BFID_MONOCHROME;")
  101. cpp_quote("EXTERN_C const GUID BFID_RGB_4;")
  102. cpp_quote("EXTERN_C const GUID BFID_RGB_8;")
  103. cpp_quote("EXTERN_C const GUID BFID_RGB_555;")
  104. cpp_quote("EXTERN_C const GUID BFID_RGB_565;")
  105. cpp_quote("EXTERN_C const GUID BFID_RGB_24;")
  106. cpp_quote("EXTERN_C const GUID BFID_RGB_32;")
  107. cpp_quote("EXTERN_C const GUID BFID_RGBA_32;")
  108. cpp_quote("EXTERN_C const GUID BFID_GRAY_8;")
  109. cpp_quote("EXTERN_C const GUID BFID_GRAY_16;")
  110. cpp_quote("")
  111.  
  112. cpp_quote("#define SID_SDirectDraw3 IID_IDirectDraw3")
  113. cpp_quote("")
  114.  
  115. cpp_quote("#define COLOR_NO_TRANSPARENT 0xFFFFFFFF")
  116. cpp_quote("")
  117.  
  118. cpp_quote("#define IMGDECODE_EVENT_PROGRESS 0x01")
  119. cpp_quote("#define IMGDECODE_EVENT_PALETTE 0x02")
  120. cpp_quote("#define IMGDECODE_EVENT_BEGINBITS 0x04")
  121. cpp_quote("#define IMGDECODE_EVENT_BITSCOMPLETE 0x08")
  122. cpp_quote("#define IMGDECODE_EVENT_USEDDRAW 0x10")
  123. cpp_quote("")
  124.  
  125. cpp_quote("#define IMGDECODE_HINT_TOPDOWN 0x01")
  126. cpp_quote("#define IMGDECODE_HINT_BOTTOMUP 0x02")
  127. cpp_quote("#define IMGDECODE_HINT_FULLWIDTH 0x04")
  128. cpp_quote("")
  129.  
  130. cpp_quote("#define MAPMIME_DEFAULT 0")
  131. cpp_quote("#define MAPMIME_CLSID 1")
  132. cpp_quote("#define MAPMIME_DISABLE 2")
  133. cpp_quote("#define MAPMIME_DEFAULT_ALWAYS 3")
  134. cpp_quote("")
  135.  
  136.  
  137. cpp_quote("#define BFID_INDEXED_RGB_8 BFID_RGB_8")
  138. cpp_quote("#define BFID_INDEXED_RGB_4 BFID_RGB_4")
  139. cpp_quote("#define BFID_INDEXED_RGB_1 BFID_MONOCHROME")
  140. cpp_quote("")
  141.  
  142. cpp_quote("EXTERN_C const GUID CLSID_IImageDecodeFilter;")
  143. cpp_quote("")
  144.  
  145.  
  146. //
  147. // TIMER SERVICES
  148. //
  149. cpp_quote("EXTERN_C const GUID NAMEDTIMER_DRAW;")   // in guids.c
  150. cpp_quote("")
  151.  
  152. interface ITimerService;
  153. interface ITimer;
  154. interface ITimerSink;
  155.  
  156. [
  157.     object,
  158.     uuid(3050f35f-98b5-11cf-bb82-00aa00bdce0b),
  159.     pointer_default(unique)
  160. ]
  161. interface ITimerService : IUnknown
  162. {
  163.     HRESULT CreateTimer ( [in] ITimer *pReferenceTimer, 
  164.                           [out] ITimer **ppNewTimer );
  165.     HRESULT GetNamedTimer ( [in] REFGUID rguidName, [out] ITimer **ppTimer );
  166.     HRESULT SetNamedTimerReference ( [in] REFGUID rguidName, 
  167.                      [in] ITimer *pReferenceTimer );
  168. }
  169.  
  170. [
  171.     object,
  172.     uuid(3050f360-98b5-11cf-bb82-00aa00bdce0b),
  173.     pointer_default(unique)
  174. ]
  175. interface ITimer : IUnknown
  176. {
  177.     HRESULT Advise( [in] VARIANT vtimeMin, [in] VARIANT vtimeMax, [in] VARIANT vtimeInterval, 
  178.                        [in] DWORD dwFlags, [in] ITimerSink *pTimerSink, [out] DWORD *pdwCookie);
  179.     HRESULT Unadvise( [in] DWORD dwCookie );
  180.     HRESULT Freeze( [in] BOOL fFreeze );
  181.     HRESULT GetTime( [out] VARIANT *pvtime );
  182. }
  183.  
  184. [
  185.     object,
  186.     uuid(3050f361-98b5-11cf-bb82-00aa00bdce0b),
  187.     pointer_default(unique)
  188. ]
  189. interface ITimerSink : IUnknown
  190. {
  191.     HRESULT OnTimer ( [in] VARIANT vtimeAdvise );
  192. }
  193.  
  194. cpp_quote("#define SID_STimerService IID_ITimerService")
  195. cpp_quote("")
  196.  
  197. interface IMapMIMEToCLSID;
  198. interface IImageDecodeFilter;
  199. interface IImageDecodeEventSink;
  200.  
  201. [
  202.     object,
  203.     uuid( D9E89500-30FA-11d0-B724-00AA006C1A01 ),
  204. //    helpstring( "IMapMIMEToCLSID Interface" ),
  205.     pointer_default( unique )
  206. ]
  207. interface IMapMIMEToCLSID : IUnknown
  208. {
  209.    HRESULT EnableDefaultMappings( BOOL bEnable );
  210.    HRESULT MapMIMEToCLSID( LPCOLESTR pszMIMEType, CLSID* pCLSID );
  211.    HRESULT SetMapping( LPCOLESTR pszMIMEType, DWORD dwMapMode, 
  212.       REFCLSID clsid );
  213. };
  214.  
  215. [
  216.     object,
  217.     uuid( A3CCEDF3-2DE2-11D0-86F4-00A0C913F750 ),
  218. //    helpstring( "IImageDecodeFilter Interface" ),
  219.     pointer_default( unique )
  220. ]
  221. interface IImageDecodeFilter : IUnknown
  222. {
  223.    HRESULT Initialize( IImageDecodeEventSink* pEventSink );
  224.    HRESULT Process( IStream* pStream );
  225.    HRESULT Terminate( HRESULT hrStatus );
  226. };
  227.  
  228. [
  229.     object,
  230.     uuid( BAA342A0-2DED-11d0-86F4-00A0C913F750 ),
  231. //    helpstring( "IImageDecodeEventSink Interface" ),
  232.     pointer_default( unique )
  233. ]
  234. interface IImageDecodeEventSink : IUnknown
  235. {
  236.    HRESULT GetSurface( [in] LONG nWidth, [in] LONG nHeight, [in] REFGUID bfid, 
  237.       [in] ULONG nPasses, [in] DWORD dwHints, 
  238.       [out] IUnknown** ppSurface );
  239.    HRESULT OnBeginDecode( [out] DWORD* pdwEvents, [out] ULONG* pnFormats,
  240.       [out, size_is(,*pnFormats)] BFID** ppFormats );
  241.    HRESULT OnBitsComplete();
  242.    HRESULT OnDecodeComplete( [in] HRESULT hrStatus );
  243.    HRESULT OnPalette();
  244.    HRESULT OnProgress( [in] RECT* pBounds, [in] BOOL bComplete );
  245. };
  246.