Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

223 lines
6.5 KiB

  1. import "oleidl.idl";
  2. import "shobjidl.idl";
  3. import "propidl.idl";
  4. interface IShellImageDataFactory;
  5. interface IShellImageData;
  6. interface IShellImageDataAbort;
  7. interface IHWEventHandler;
  8. // external definitions
  9. cpp_quote("#if !defined(_GDIPLUSPIXELFORMATS_H)")
  10. typedef DWORD PixelFormat;
  11. cpp_quote("#endif")
  12. cpp_quote("#if !defined(_GDIPLUSENUMS_H)")
  13. typedef DWORD InterpolationMode;
  14. cpp_quote("#endif")
  15. cpp_quote("#if !defined(_GDIPLUSHEADERS_H)")
  16. typedef BYTE EncoderParameters;
  17. typedef BYTE Image;
  18. cpp_quote("#endif")
  19. // property bag strings for SetEncoderParams
  20. cpp_quote("#define SHIMGKEY_QUALITY L\"Compression\"")
  21. cpp_quote("#define SHIMGKEY_RAWFORMAT L\"RawDataFormat\"")
  22. cpp_quote("")
  23. // Decode() flags (bit fields)
  24. cpp_quote("#define SHIMGDEC_DEFAULT 0x00000000") // creates a full Image
  25. cpp_quote("#define SHIMGDEC_THUMBNAIL 0x00000001") // decodes only thumbnail image
  26. cpp_quote("#define SHIMGDEC_LOADFULL 0x00000002") // load the whole file into memory
  27. // Some custom error codes
  28. cpp_quote("#define E_NOTVALIDFORANIMATEDIMAGE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x01)") // operation is not valid for animated images, for example IShellImageData::Rotate will fail for animated images with this code
  29. [
  30. helpstring("IShellImageDataFactory"),
  31. uuid(9be8ed5c-edab-4d75-90f3-bd5bdbb21c82),
  32. object,
  33. pointer_default(unique)
  34. ]
  35. interface IShellImageDataFactory : IUnknown
  36. {
  37. HRESULT CreateIShellImageData(
  38. [out] IShellImageData **ppshimg);
  39. // Easy functions for loading and saving from a file or stream
  40. HRESULT CreateImageFromFile(
  41. [in] LPCWSTR pszPath,
  42. [out] IShellImageData **ppshimg);
  43. HRESULT CreateImageFromStream(
  44. [in] IStream *pStream,
  45. [out] IShellImageData **ppshimg);
  46. // looks up the extension in the registry, gets the content type, and looks up the appropriate IMGFMT_*
  47. // value.
  48. HRESULT GetDataFormatFromPath(
  49. [in] LPCWSTR pszPath,
  50. [out] GUID *pDataFormat);
  51. }
  52. [
  53. helpstring("IShellImageData"),
  54. uuid(bfdeec12-8040-4403-a5ea-9e07dafcf530),
  55. object,
  56. pointer_default(unique)
  57. ]
  58. interface IShellImageData : IUnknown
  59. {
  60. // Start the decode process setting state (for thumbnails etc)
  61. HRESULT Decode(
  62. [in] DWORD dwFlags,
  63. [in] ULONG cxDesired,
  64. [in] ULONG cyDesired);
  65. // Draw the current image to the screen
  66. HRESULT Draw(
  67. [in] HDC hdc,
  68. [in] LPRECT prcDest,
  69. [in] LPRECT prcSrc);
  70. // Multipage support
  71. // switches to next frame if it's available
  72. // starts decoder and returns E_PENDING if next frame is not available yet
  73. // will loop or return E_NOMOREDATA based on the image contents
  74. HRESULT NextFrame();
  75. // dumps any animation data, switchs to the next page, and resets the animation data for that page.
  76. // Returns E_NOMOREDATA if there is no next page.
  77. HRESULT NextPage();
  78. HRESULT PrevPage();
  79. //
  80. // Query functions. They return S_OK if condition is true, S_FALSE if not. Use should be
  81. // self-explanatory from function name...
  82. //
  83. HRESULT IsTransparent();
  84. HRESULT IsAnimated();
  85. HRESULT IsVector();
  86. HRESULT IsMultipage();
  87. HRESULT IsEditable();
  88. HRESULT IsPrintable();
  89. HRESULT IsDecoded();
  90. // step through the pages in the image
  91. HRESULT GetCurrentPage(
  92. [out] ULONG *pnPage);
  93. HRESULT GetPageCount(
  94. [out] ULONG *pcPages);
  95. HRESULT SelectPage(
  96. [in] ULONG iPage);
  97. // Fetch information on image
  98. HRESULT GetSize(
  99. [out] SIZE *pSize);
  100. HRESULT GetRawDataFormat(
  101. [out] GUID *pDataFormat);
  102. HRESULT GetPixelFormat(
  103. [out] PixelFormat *pFormat);
  104. HRESULT GetDelay(
  105. [out] DWORD *pdwDelay); // delay can be different for every frame
  106. // dwMode is STGM_* flags
  107. HRESULT GetProperties(
  108. [in] DWORD dwMode,
  109. [out] IPropertySetStorage **ppPropSet);
  110. //
  111. // Rotate with specified angle in 90 degree increments
  112. //
  113. HRESULT Rotate(
  114. [in] DWORD dwAngle);
  115. // Scale with aspect correction when one of the scale factors is 0.
  116. // Scale to specified dimensions if both values are non-zero
  117. // examples: Scale(300, 0) sets X to 300 and Y to the correct scaled value based on X
  118. // Scale(0, 200) sets Y to 200 and X to the correct scaled value based on Y
  119. // Scale(150, 75) sets X to 150 and Y to 75
  120. HRESULT Scale(
  121. [in] ULONG cx,
  122. [in] ULONG cy,
  123. [in] InterpolationMode hints);
  124. HRESULT DiscardEdit();
  125. //
  126. // KENSY
  127. // Instead of Commit we will depend on people to do IPersistFile::Save, IPersistStream::Save,
  128. // etc. Need to give them control over output format and quality among other things...
  129. //
  130. HRESULT SetEncoderParams(
  131. [in] IPropertyBag *pbagEnc);
  132. HRESULT DisplayName(
  133. [in, out] LPWSTR wszName,
  134. [in] UINT cch);
  135. HRESULT GetResolution( // DPI
  136. [out] ULONG *puResolutionX,
  137. [out] ULONG *puResolutionY);
  138. HRESULT GetEncoderParams( // possible values for encoder params, given a format
  139. [in] GUID *pguidFmt,
  140. [out] EncoderParameters **ppEncParams);
  141. // Set a callback abort object; optionally returns previous
  142. HRESULT RegisterAbort(
  143. [in] IShellImageDataAbort *pAbort,
  144. [out,optional] IShellImageDataAbort **ppAbortPrev);
  145. HRESULT CloneFrame( // return a clone of the GDI+ Image being worked on
  146. [out] Image **ppImg);
  147. HRESULT ReplaceFrame( // replace the current frame with a new Image
  148. [in] Image *pImg);
  149. }
  150. [
  151. helpstring("IShellImageDataAbort"),
  152. uuid(53fb8e58-50c0-4003-b4aa-0c8df28e7f3a),
  153. object,
  154. pointer_default(unique)
  155. ]
  156. interface IShellImageDataAbort : IUnknown
  157. {
  158. HRESULT QueryAbort(); // S_OK = continue; S_FALSE = abort
  159. }
  160. [
  161. uuid(0b8aff06-8df0-4f13-8e25-25b2319c436a), // LIBID_ShellImageData
  162. helpstring("Microsoft Shell Image library"),
  163. lcid(0x0000),
  164. version(1.0)
  165. ]
  166. library ShellImageData
  167. {
  168. // CLSID_ShellImageDataFactory
  169. [ uuid(66e4e4fb-f385-4dd0-8d74-a2efd1bc6178) ] coclass ShellImageDataFactory { [default] interface IShellImageDataFactory; }
  170. // CLSID_AutoplayForSlideShow
  171. [ uuid(00E7B358-F65B-4dcf-83DF-CD026B94BFD4) ] coclass AutoplayForSlideShow { [default] interface IHWEventHandler; }
  172. };