d2d1_1.h 69 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417
  1. /**
  2. * This file has no copyright assigned and is placed in the Public Domain.
  3. * This file is part of the mingw-w64 runtime package.
  4. * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  5. */
  6. #ifndef _D2D1_1_H_
  7. #define _D2D1_1_H_
  8. #include <d2d1.h>
  9. #include <d2d1effects.h>
  10. #include <dxgi.h>
  11. #include <winapifamily.h>
  12. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
  13. typedef interface ID2D1ColorContext ID2D1ColorContext;
  14. typedef interface IWICColorContext IWICColorContext;
  15. typedef interface IWICImagingFactory IWICImagingFactory;
  16. typedef interface IPrintDocumentPackageTarget IPrintDocumentPackageTarget;
  17. typedef interface IDWriteFactory IDWriteFactory;
  18. typedef struct D2D1_PROPERTY_BINDING D2D1_PROPERTY_BINDING;
  19. #ifndef D2D_USE_C_DEFINITIONS
  20. interface ID2D1Device;
  21. interface ID2D1Effect;
  22. #else
  23. typedef interface ID2D1Device ID2D1Device;
  24. typedef interface ID2D1Effect ID2D1Effect;
  25. #endif
  26. typedef struct DWRITE_GLYPH_RUN_DESCRIPTION DWRITE_GLYPH_RUN_DESCRIPTION;
  27. typedef HRESULT (CALLBACK *PD2D1_EFFECT_FACTORY)(IUnknown**);
  28. typedef D2D_RECT_L D2D1_RECT_L;
  29. typedef enum D2D1_PROPERTY_TYPE {
  30. D2D1_PROPERTY_TYPE_UNKNOWN = 0,
  31. D2D1_PROPERTY_TYPE_STRING = 1,
  32. D2D1_PROPERTY_TYPE_BOOL = 2,
  33. D2D1_PROPERTY_TYPE_UINT32 = 3,
  34. D2D1_PROPERTY_TYPE_INT32 = 4,
  35. D2D1_PROPERTY_TYPE_FLOAT = 5,
  36. D2D1_PROPERTY_TYPE_VECTOR2 = 6,
  37. D2D1_PROPERTY_TYPE_VECTOR3 = 7,
  38. D2D1_PROPERTY_TYPE_VECTOR4 = 8,
  39. D2D1_PROPERTY_TYPE_BLOB = 9,
  40. D2D1_PROPERTY_TYPE_IUNKNOWN = 10,
  41. D2D1_PROPERTY_TYPE_ENUM = 11,
  42. D2D1_PROPERTY_TYPE_ARRAY = 12,
  43. D2D1_PROPERTY_TYPE_CLSID = 13,
  44. D2D1_PROPERTY_TYPE_MATRIX_3X2 = 14,
  45. D2D1_PROPERTY_TYPE_MATRIX_4X3 = 15,
  46. D2D1_PROPERTY_TYPE_MATRIX_4X4 = 16,
  47. D2D1_PROPERTY_TYPE_MATRIX_5X4 = 17,
  48. D2D1_PROPERTY_TYPE_COLOR_CONTEXT = 18,
  49. D2D1_PROPERTY_TYPE_FORCE_DWORD = 0xffffffff
  50. } D2D1_PROPERTY_TYPE;
  51. typedef enum D2D1_PROPERTY {
  52. D2D1_PROPERTY_CLSID = 0x80000000,
  53. D2D1_PROPERTY_DISPLAYNAME = 0x80000001,
  54. D2D1_PROPERTY_AUTHOR = 0x80000002,
  55. D2D1_PROPERTY_CATEGORY = 0x80000003,
  56. D2D1_PROPERTY_DESCRIPTION = 0x80000004,
  57. D2D1_PROPERTY_INPUTS = 0x80000005,
  58. D2D1_PROPERTY_CACHED = 0x80000006,
  59. D2D1_PROPERTY_PRECISION = 0x80000007,
  60. D2D1_PROPERTY_MIN_INPUTS = 0x80000008,
  61. D2D1_PROPERTY_MAX_INPUTS = 0x80000009,
  62. D2D1_PROPERTY_FORCE_DWORD = 0xffffffff
  63. } D2D1_PROPERTY;
  64. typedef enum D2D1_SUBPROPERTY {
  65. D2D1_SUBPROPERTY_DISPLAYNAME = 0x80000000,
  66. D2D1_SUBPROPERTY_ISREADONLY = 0x80000001,
  67. D2D1_SUBPROPERTY_MIN = 0x80000002,
  68. D2D1_SUBPROPERTY_MAX = 0x80000003,
  69. D2D1_SUBPROPERTY_DEFAULT = 0x80000004,
  70. D2D1_SUBPROPERTY_FIELDS = 0x80000005,
  71. D2D1_SUBPROPERTY_INDEX = 0x80000006,
  72. D2D1_SUBPROPERTY_FORCE_DWORD = 0xffffffff
  73. } D2D1_SUBPROPERTY;
  74. typedef enum D2D1_CHANNEL_DEPTH {
  75. D2D1_CHANNEL_DEPTH_DEFAULT = 0,
  76. D2D1_CHANNEL_DEPTH_1 = 1,
  77. D2D1_CHANNEL_DEPTH_4 = 4,
  78. D2D1_CHANNEL_DEPTH_FORCE_DWORD = 0xffffffff
  79. } D2D1_CHANNEL_DEPTH;
  80. typedef enum D2D1_BUFFER_PRECISION {
  81. D2D1_BUFFER_PRECISION_UNKNOWN = 0,
  82. D2D1_BUFFER_PRECISION_8BPC_UNORM = 1,
  83. D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB = 2,
  84. D2D1_BUFFER_PRECISION_16BPC_UNORM = 3,
  85. D2D1_BUFFER_PRECISION_16BPC_FLOAT = 4,
  86. D2D1_BUFFER_PRECISION_32BPC_FLOAT = 5,
  87. D2D1_BUFFER_PRECISION_FORCE_DWORD = 0xffffffff
  88. } D2D1_BUFFER_PRECISION;
  89. typedef enum D2D1_COLOR_SPACE {
  90. D2D1_COLOR_SPACE_CUSTOM = 0,
  91. D2D1_COLOR_SPACE_SRGB = 1,
  92. D2D1_COLOR_SPACE_SCRGB = 2,
  93. D2D1_COLOR_SPACE_FORCE_DWORD = 0xffffffff
  94. } D2D1_COLOR_SPACE;
  95. typedef enum D2D1_DEVICE_CONTEXT_OPTIONS {
  96. D2D1_DEVICE_CONTEXT_OPTIONS_NONE = 0,
  97. D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS = 1,
  98. D2D1_DEVICE_CONTEXT_OPTIONS_FORCE_DWORD = 0xffffffff
  99. } D2D1_DEVICE_CONTEXT_OPTIONS;
  100. DEFINE_ENUM_FLAG_OPERATORS(D2D1_DEVICE_CONTEXT_OPTIONS);
  101. typedef enum D2D1_BITMAP_OPTIONS {
  102. D2D1_BITMAP_OPTIONS_NONE = 0x00000000,
  103. D2D1_BITMAP_OPTIONS_TARGET = 0x00000001,
  104. D2D1_BITMAP_OPTIONS_CANNOT_DRAW = 0x00000002,
  105. D2D1_BITMAP_OPTIONS_CPU_READ = 0x00000004,
  106. D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE = 0x00000008,
  107. D2D1_BITMAP_OPTIONS_FORCE_DWORD = 0xffffffff
  108. } D2D1_BITMAP_OPTIONS;
  109. DEFINE_ENUM_FLAG_OPERATORS(D2D1_BITMAP_OPTIONS);
  110. typedef enum D2D1_MAP_OPTIONS {
  111. D2D1_MAP_OPTIONS_NONE = 0,
  112. D2D1_MAP_OPTIONS_READ = 1,
  113. D2D1_MAP_OPTIONS_WRITE = 2,
  114. D2D1_MAP_OPTIONS_DISCARD = 4,
  115. D2D1_MAP_OPTIONS_FORCE_DWORD = 0xffffffff
  116. } D2D1_MAP_OPTIONS;
  117. DEFINE_ENUM_FLAG_OPERATORS(D2D1_MAP_OPTIONS);
  118. typedef enum D2D1_COLOR_INTERPOLATION_MODE {
  119. D2D1_COLOR_INTERPOLATION_MODE_STRAIGHT = 0,
  120. D2D1_COLOR_INTERPOLATION_MODE_PREMULTIPLIED = 1,
  121. D2D1_COLOR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
  122. } D2D1_COLOR_INTERPOLATION_MODE;
  123. typedef enum D2D1_INTERPOLATION_MODE {
  124. D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR = D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR,
  125. D2D1_INTERPOLATION_MODE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR,
  126. D2D1_INTERPOLATION_MODE_CUBIC = D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC,
  127. D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR,
  128. D2D1_INTERPOLATION_MODE_ANISOTROPIC = D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC,
  129. D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC,
  130. D2D1_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
  131. } D2D1_INTERPOLATION_MODE;
  132. typedef enum D2D1_COMPOSITE_MODE {
  133. D2D1_COMPOSITE_MODE_SOURCE_OVER = 0,
  134. D2D1_COMPOSITE_MODE_DESTINATION_OVER = 1,
  135. D2D1_COMPOSITE_MODE_SOURCE_IN = 2,
  136. D2D1_COMPOSITE_MODE_DESTINATION_IN = 3,
  137. D2D1_COMPOSITE_MODE_SOURCE_OUT = 4,
  138. D2D1_COMPOSITE_MODE_DESTINATION_OUT = 5,
  139. D2D1_COMPOSITE_MODE_SOURCE_ATOP = 6,
  140. D2D1_COMPOSITE_MODE_DESTINATION_ATOP = 7,
  141. D2D1_COMPOSITE_MODE_XOR = 8,
  142. D2D1_COMPOSITE_MODE_PLUS = 9,
  143. D2D1_COMPOSITE_MODE_SOURCE_COPY = 10,
  144. D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY = 11,
  145. D2D1_COMPOSITE_MODE_MASK_INVERT = 12,
  146. D2D1_COMPOSITE_MODE_FORCE_DWORD = 0xffffffff
  147. } D2D1_COMPOSITE_MODE;
  148. typedef enum D2D1_PRIMITIVE_BLEND {
  149. D2D1_PRIMITIVE_BLEND_SOURCE_OVER = 0,
  150. D2D1_PRIMITIVE_BLEND_COPY = 1,
  151. D2D1_PRIMITIVE_BLEND_MIN = 2,
  152. D2D1_PRIMITIVE_BLEND_ADD = 3,
  153. D2D1_PRIMITIVE_BLEND_FORCE_DWORD = 0xffffffff
  154. } D2D1_PRIMITIVE_BLEND;
  155. typedef enum D2D1_THREADING_MODE {
  156. D2D1_THREADING_MODE_SINGLE_THREADED = D2D1_FACTORY_TYPE_SINGLE_THREADED,
  157. D2D1_THREADING_MODE_MULTI_THREADED = D2D1_FACTORY_TYPE_MULTI_THREADED,
  158. D2D1_THREADING_MODE_FORCE_DWORD = 0xffffffff
  159. } D2D1_THREADING_MODE;
  160. typedef enum D2D1_UNIT_MODE {
  161. D2D1_UNIT_MODE_DIPS = 0,
  162. D2D1_UNIT_MODE_PIXELS = 1,
  163. D2D1_UNIT_MODE_FORCE_DWORD = 0xffffffff
  164. } D2D1_UNIT_MODE;
  165. typedef enum D2D1_LAYER_OPTIONS1 {
  166. D2D1_LAYER_OPTIONS1_NONE = 0,
  167. D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND = 1,
  168. D2D1_LAYER_OPTIONS1_IGNORE_ALPHA = 2,
  169. D2D1_LAYER_OPTIONS1_FORCE_DWORD = 0xffffffff
  170. } D2D1_LAYER_OPTIONS1;
  171. DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS1);
  172. typedef enum D2D1_PRINT_FONT_SUBSET_MODE {
  173. D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT = 0,
  174. D2D1_PRINT_FONT_SUBSET_MODE_EACHPAGE = 1,
  175. D2D1_PRINT_FONT_SUBSET_MODE_NONE = 2,
  176. D2D1_PRINT_FONT_SUBSET_MODE_FORCE_DWORD = 0xffffffff
  177. } D2D1_PRINT_FONT_SUBSET_MODE;
  178. typedef enum D2D1_STROKE_TRANSFORM_TYPE {
  179. D2D1_STROKE_TRANSFORM_TYPE_NORMAL = 0,
  180. D2D1_STROKE_TRANSFORM_TYPE_FIXED = 1,
  181. D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE = 2,
  182. D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD = 0xffffffff
  183. } D2D1_STROKE_TRANSFORM_TYPE;
  184. typedef struct D2D1_BITMAP_PROPERTIES1 {
  185. D2D1_PIXEL_FORMAT pixelFormat;
  186. FLOAT dpiX;
  187. FLOAT dpiY;
  188. D2D1_BITMAP_OPTIONS bitmapOptions;
  189. ID2D1ColorContext *colorContext;
  190. } D2D1_BITMAP_PROPERTIES1;
  191. typedef struct D2D1_MAPPED_RECT {
  192. UINT32 pitch;
  193. BYTE *bits;
  194. } D2D1_MAPPED_RECT;
  195. typedef struct D2D1_IMAGE_BRUSH_PROPERTIES {
  196. D2D1_RECT_F sourceRectangle;
  197. D2D1_EXTEND_MODE extendModeX;
  198. D2D1_EXTEND_MODE extendModeY;
  199. D2D1_INTERPOLATION_MODE interpolationMode;
  200. } D2D1_IMAGE_BRUSH_PROPERTIES;
  201. typedef struct D2D1_BITMAP_BRUSH_PROPERTIES1 {
  202. D2D1_EXTEND_MODE extendModeX;
  203. D2D1_EXTEND_MODE extendModeY;
  204. D2D1_INTERPOLATION_MODE interpolationMode;
  205. } D2D1_BITMAP_BRUSH_PROPERTIES1;
  206. typedef D2D_MATRIX_4X3_F D2D1_MATRIX_4X3_F;
  207. typedef D2D_MATRIX_4X4_F D2D1_MATRIX_4X4_F;
  208. typedef D2D_MATRIX_5X4_F D2D1_MATRIX_5X4_F;
  209. typedef D2D_VECTOR_2F D2D1_VECTOR_2F;
  210. typedef D2D_VECTOR_3F D2D1_VECTOR_3F;
  211. typedef D2D_VECTOR_4F D2D1_VECTOR_4F;
  212. typedef struct D2D1_LAYER_PARAMETERS1 {
  213. D2D1_RECT_F contentBounds;
  214. ID2D1Geometry *geometricMask;
  215. D2D1_ANTIALIAS_MODE maskAntialiasMode;
  216. D2D1_MATRIX_3X2_F maskTransform;
  217. FLOAT opacity;
  218. ID2D1Brush *opacityBrush;
  219. D2D1_LAYER_OPTIONS1 layerOptions;
  220. } D2D1_LAYER_PARAMETERS1;
  221. typedef struct D2D1_RENDERING_CONTROLS {
  222. D2D1_BUFFER_PRECISION bufferPrecision;
  223. D2D1_SIZE_U tileSize;
  224. } D2D1_RENDERING_CONTROLS;
  225. typedef struct D2D1_EFFECT_INPUT_DESCRIPTION {
  226. ID2D1Effect *effect;
  227. UINT32 inputIndex;
  228. D2D1_RECT_F inputRectangle;
  229. } D2D1_EFFECT_INPUT_DESCRIPTION;
  230. typedef struct D2D1_PRINT_CONTROL_PROPERTIES {
  231. D2D1_PRINT_FONT_SUBSET_MODE fontSubset;
  232. FLOAT rasterDPI;
  233. D2D1_COLOR_SPACE colorSpace;
  234. } D2D1_PRINT_CONTROL_PROPERTIES;
  235. typedef struct D2D1_CREATION_PROPERTIES {
  236. D2D1_THREADING_MODE threadingMode;
  237. D2D1_DEBUG_LEVEL debugLevel;
  238. D2D1_DEVICE_CONTEXT_OPTIONS options;
  239. } D2D1_CREATION_PROPERTIES;
  240. typedef struct D2D1_STROKE_STYLE_PROPERTIES1 {
  241. D2D1_CAP_STYLE startCap;
  242. D2D1_CAP_STYLE endCap;
  243. D2D1_CAP_STYLE dashCap;
  244. D2D1_LINE_JOIN lineJoin;
  245. FLOAT miterLimit;
  246. D2D1_DASH_STYLE dashStyle;
  247. FLOAT dashOffset;
  248. D2D1_STROKE_TRANSFORM_TYPE transformType;
  249. } D2D1_STROKE_STYLE_PROPERTIES1;
  250. typedef struct D2D1_DRAWING_STATE_DESCRIPTION1 {
  251. D2D1_ANTIALIAS_MODE antialiasMode;
  252. D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode;
  253. D2D1_TAG tag1;
  254. D2D1_TAG tag2;
  255. D2D1_MATRIX_3X2_F transform;
  256. D2D1_PRIMITIVE_BLEND primitiveBlend;
  257. D2D1_UNIT_MODE unitMode;
  258. } D2D1_DRAWING_STATE_DESCRIPTION1;
  259. typedef struct D2D1_POINT_DESCRIPTION {
  260. D2D1_POINT_2F point;
  261. D2D1_POINT_2F unitTangentVector;
  262. UINT32 endSegment;
  263. UINT32 endFigure;
  264. FLOAT lengthToEndSegment;
  265. } D2D1_POINT_DESCRIPTION;
  266. #ifndef D2D_USE_C_DEFINITIONS
  267. interface ID2D1Properties : public IUnknown
  268. {
  269. STDMETHOD_(UINT32, GetPropertyCount)() CONST PURE;
  270. STDMETHOD(GetPropertyName)(UINT32 index, PWSTR name, UINT32 nameCount) CONST PURE;
  271. STDMETHOD_(UINT32, GetPropertyNameLength)(UINT32 index) CONST PURE;
  272. STDMETHOD_(D2D1_PROPERTY_TYPE, GetType)(UINT32 index) CONST PURE;
  273. STDMETHOD_(UINT32, GetPropertyIndex)(PCWSTR name) CONST PURE;
  274. STDMETHOD(SetValueByName)(PCWSTR name, D2D1_PROPERTY_TYPE type, CONST BYTE *data, UINT32 dataSize) PURE;
  275. STDMETHOD(SetValue)(UINT32 index, D2D1_PROPERTY_TYPE type, CONST BYTE *data, UINT32 dataSize) PURE;
  276. STDMETHOD(GetValueByName)(PCWSTR name, D2D1_PROPERTY_TYPE type, BYTE *data, UINT32 dataSize) CONST PURE;
  277. STDMETHOD(GetValue)(UINT32 index, D2D1_PROPERTY_TYPE type, BYTE *data, UINT32 dataSize) CONST PURE;
  278. STDMETHOD_(UINT32, GetValueSize)(UINT32 index) CONST PURE;
  279. STDMETHOD(GetSubProperties)(UINT32 index, ID2D1Properties **subProperties) CONST PURE;
  280. HRESULT SetValueByName(PCWSTR name, CONST BYTE *data, UINT32 dataSize) {
  281. return SetValueByName(name, D2D1_PROPERTY_TYPE_UNKNOWN, data, dataSize);
  282. }
  283. HRESULT SetValue(UINT32 index, CONST BYTE *data, UINT32 dataSize) {
  284. return SetValue(index, D2D1_PROPERTY_TYPE_UNKNOWN, data, dataSize);
  285. }
  286. HRESULT GetValueByName(PCWSTR name, BYTE *data, UINT32 dataSize) CONST {
  287. return GetValueByName(name, D2D1_PROPERTY_TYPE_UNKNOWN, data, dataSize);
  288. }
  289. HRESULT GetValue(UINT32 index, BYTE *data, UINT32 dataSize) CONST {
  290. return GetValue(index, D2D1_PROPERTY_TYPE_UNKNOWN, data, dataSize);
  291. }
  292. template<typename T>
  293. HRESULT GetValueByName(PCWSTR propertyName, T *value) const {
  294. return GetValueByName(propertyName, reinterpret_cast<BYTE*>(value), sizeof(*value));
  295. }
  296. template<typename T>
  297. T GetValueByName(PCWSTR propertyName) const {
  298. T ret;
  299. GetValueByName(propertyName, reinterpret_cast<BYTE*>(&ret), sizeof(ret));
  300. return ret;
  301. }
  302. template<typename T>
  303. HRESULT SetValueByName(PCWSTR propertyName, const T &value) {
  304. return SetValueByName(propertyName, reinterpret_cast<const BYTE*>(&value), sizeof(value));
  305. }
  306. template<typename T>
  307. HRESULT GetValue(T index, BYTE *data, UINT32 dataSize) CONST {
  308. return GetValue(static_cast<UINT32>(index), data, dataSize);
  309. }
  310. template<typename T, typename U>
  311. HRESULT GetValue(U index, T *value) const {
  312. return GetValue(static_cast<UINT32>(index), reinterpret_cast<BYTE*>(value), sizeof(*value));
  313. }
  314. template<typename T, typename U>
  315. T GetValue(U index) const {
  316. T ret;
  317. GetValue(static_cast<UINT32>(index), reinterpret_cast<BYTE*>(&ret), sizeof(ret));
  318. return ret;
  319. }
  320. template<typename T>
  321. HRESULT SetValue(T index, CONST BYTE *data, UINT32 dataSize) {
  322. return SetValue(static_cast<UINT32>(index), data, dataSize);
  323. }
  324. template<typename T, typename U>
  325. HRESULT SetValue(U index, const T &value) {
  326. return SetValue(static_cast<UINT32>(index), reinterpret_cast<const BYTE*>(&value), sizeof(value));
  327. }
  328. template<typename T>
  329. HRESULT GetPropertyName(T index, PWSTR name, UINT32 nameCount) CONST {
  330. return GetPropertyName(static_cast<UINT32>(index), name, nameCount);
  331. }
  332. template<typename T>
  333. UINT32 GetPropertyNameLength(T index) CONST {
  334. return GetPropertyNameLength(static_cast<UINT32>(index));
  335. }
  336. template<typename T>
  337. D2D1_PROPERTY_TYPE GetType(T index) CONST {
  338. return GetType(static_cast<UINT32>(index));
  339. }
  340. template<typename T>
  341. UINT32 GetValueSize(T index) CONST {
  342. return GetValueSize(static_cast<UINT32>(index));
  343. }
  344. template<typename T>
  345. HRESULT GetSubProperties(T index, ID2D1Properties **subProperties) CONST {
  346. return GetSubProperties(static_cast<UINT32>(index), subProperties);
  347. }
  348. };
  349. #else
  350. typedef interface ID2D1Properties ID2D1Properties;
  351. /* FIXME: Add full C declaration */
  352. #endif
  353. DEFINE_GUID(IID_ID2D1Properties,0x483473d7,0xcd46,0x4f9d,0x9d,0x3a,0x31,0x12,0xaa,0x80,0x15,0x9d);
  354. __CRT_UUID_DECL(ID2D1Properties,0x483473d7,0xcd46,0x4f9d,0x9d,0x3a,0x31,0x12,0xaa,0x80,0x15,0x9d);
  355. #ifndef D2D_USE_C_DEFINITIONS
  356. interface ID2D1GdiMetafileSink : public IUnknown
  357. {
  358. STDMETHOD(ProcessRecord)(DWORD recordType, CONST void *recordData, DWORD recordDataSize) PURE;
  359. };
  360. #else
  361. typedef interface ID2D1GdiMetafileSink ID2D1GdiMetafileSink;
  362. /* FIXME: Add full C declaration */
  363. #endif
  364. DEFINE_GUID(IID_ID2D1GdiMetafileSink, 0x82237326,0x8111,0x4f7c,0xbc,0xf4,0xb5,0xc1,0x17,0x55,0x64,0xfe);
  365. __CRT_UUID_DECL(ID2D1GdiMetafileSink, 0x82237326,0x8111,0x4f7c,0xbc,0xf4,0xb5,0xc1,0x17,0x55,0x64,0xfe);
  366. #ifndef D2D_USE_C_DEFINITIONS
  367. interface ID2D1GdiMetafile : public ID2D1Resource
  368. {
  369. STDMETHOD(Stream)(ID2D1GdiMetafileSink *sink) PURE;
  370. STDMETHOD(GetBounds)(D2D1_RECT_F *bounds) PURE;
  371. };
  372. #else
  373. typedef interface ID2D1GdiMetafile ID2D1GdiMetafile;
  374. /* FIXME: Add full C declaration */
  375. #endif
  376. DEFINE_GUID(IID_ID2D1GdiMetafile, 0x2f543dc3,0xcfc1,0x4211,0x86,0x4f,0xcf,0xd9,0x1c,0x6f,0x33,0x95);
  377. __CRT_UUID_DECL(ID2D1GdiMetafile, 0x2f543dc3,0xcfc1,0x4211,0x86,0x4f,0xcf,0xd9,0x1c,0x6f,0x33,0x95);
  378. #ifndef D2D_USE_C_DEFINITIONS
  379. interface ID2D1StrokeStyle1 : public ID2D1StrokeStyle
  380. {
  381. STDMETHOD_(D2D1_STROKE_TRANSFORM_TYPE, GetStrokeTransformType)() CONST PURE;
  382. };
  383. #else
  384. typedef interface ID2D1StrokeStyle1 ID2D1StrokeStyle1;
  385. /* FIXME: Add full C declaration */
  386. #endif
  387. DEFINE_GUID(IID_ID2D1StrokeStyle1, 0x10a72a66,0xe91c,0x43f4,0x99,0x3f,0xdd,0xf4,0xb8,0x2b,0x0b,0x4a);
  388. __CRT_UUID_DECL(ID2D1StrokeStyle1, 0x10a72a66,0xe91c,0x43f4,0x99,0x3f,0xdd,0xf4,0xb8,0x2b,0x0b,0x4a);
  389. #ifndef D2D_USE_C_DEFINITIONS
  390. interface ID2D1CommandSink : public IUnknown
  391. {
  392. STDMETHOD(BeginDraw)() PURE;
  393. STDMETHOD(EndDraw)() PURE;
  394. STDMETHOD(SetAntialiasMode)(D2D1_ANTIALIAS_MODE antialiasMode) PURE;
  395. STDMETHOD(SetTags)(D2D1_TAG tag1, D2D1_TAG tag2) PURE;
  396. STDMETHOD(SetTextAntialiasMode)(D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode) PURE;
  397. STDMETHOD(SetTextRenderingParams)(IDWriteRenderingParams *textRenderingParams) PURE;
  398. STDMETHOD(SetTransform)(CONST D2D1_MATRIX_3X2_F *transform) PURE;
  399. STDMETHOD(SetPrimitiveBlend)(D2D1_PRIMITIVE_BLEND primitiveBlend) PURE;
  400. STDMETHOD(SetUnitMode)(D2D1_UNIT_MODE unitMode) PURE;
  401. STDMETHOD(Clear)(CONST D2D1_COLOR_F *color) PURE;
  402. STDMETHOD(DrawGlyphRun)(D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
  403. CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription, ID2D1Brush *foregroundBrush,
  404. DWRITE_MEASURING_MODE measuringMode) PURE;
  405. STDMETHOD(DrawLine)(D2D1_POINT_2F point0, D2D1_POINT_2F point1, ID2D1Brush *brush, FLOAT strokeWidth,
  406. ID2D1StrokeStyle *strokeStyle) PURE;
  407. STDMETHOD(DrawGeometry)(ID2D1Geometry *geometry, ID2D1Brush *brush, FLOAT strokeWidth, ID2D1StrokeStyle *strokeStyle) PURE;
  408. STDMETHOD(DrawRectangle)(CONST D2D1_RECT_F *rect, ID2D1Brush *brush, FLOAT strokeWidth, ID2D1StrokeStyle *strokeStyle) PURE;
  409. STDMETHOD(DrawBitmap)(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F *destinationRectangle, FLOAT opacity,
  410. D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F *sourceRectangle,
  411. CONST D2D1_MATRIX_4X4_F *perspectiveTransform) PURE;
  412. STDMETHOD(DrawImage)(ID2D1Image *image, CONST D2D1_POINT_2F *targetOffset, CONST D2D1_RECT_F *imageRectangle,
  413. D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode) PURE;
  414. STDMETHOD(DrawGdiMetafile)(ID2D1GdiMetafile *gdiMetafile, CONST D2D1_POINT_2F *targetOffset) PURE;
  415. STDMETHOD(FillMesh)(ID2D1Mesh *mesh, ID2D1Brush *brush) PURE;
  416. STDMETHOD(FillOpacityMask)(ID2D1Bitmap *opacityMask, ID2D1Brush *brush, CONST D2D1_RECT_F *destinationRectangle,
  417. CONST D2D1_RECT_F *sourceRectangle) PURE;
  418. STDMETHOD(FillGeometry)(ID2D1Geometry *geometry, ID2D1Brush *brush, ID2D1Brush *opacityBrush) PURE;
  419. STDMETHOD(FillRectangle)(CONST D2D1_RECT_F *rect, ID2D1Brush *brush) PURE;
  420. STDMETHOD(PushAxisAlignedClip)(CONST D2D1_RECT_F *clipRect, D2D1_ANTIALIAS_MODE antialiasMode) PURE;
  421. STDMETHOD(PushLayer)(CONST D2D1_LAYER_PARAMETERS1 *layerParameters1, ID2D1Layer *layer) PURE;
  422. STDMETHOD(PopAxisAlignedClip)() PURE;
  423. STDMETHOD(PopLayer)() PURE;
  424. };
  425. #else
  426. typedef interface ID2D1CommandSink ID2D1CommandSink;
  427. #endif
  428. DEFINE_GUID(IID_ID2D1CommandSink, 0x54d7898a,0xa061,0x40a7,0xbe,0xc7,0xe4,0x65,0xbc,0xba,0x2c,0x4f);
  429. __CRT_UUID_DECL(ID2D1CommandSink, 0x54d7898a,0xa061,0x40a7,0xbe,0xc7,0xe4,0x65,0xbc,0xba,0x2c,0x4f);
  430. #ifndef D2D_USE_C_DEFINITIONS
  431. interface ID2D1CommandList : public ID2D1Image
  432. {
  433. STDMETHOD(Stream)(ID2D1CommandSink *sink) PURE;
  434. STDMETHOD(Close)() PURE;
  435. };
  436. #else
  437. typedef interface ID2D1CommandList ID2D1CommandList;
  438. #endif
  439. DEFINE_GUID(IID_ID2D1CommandList, 0xb4f34a19,0x2383,0x4d76,0x94,0xf6,0xec,0x34,0x36,0x57,0xc3,0xdc);
  440. __CRT_UUID_DECL(ID2D1CommandList, 0xb4f34a19,0x2383,0x4d76,0x94,0xf6,0xec,0x34,0x36,0x57,0xc3,0xdc);
  441. #ifndef D2D_USE_C_DEFINITIONS
  442. interface ID2D1PrintControl : public IUnknown
  443. {
  444. STDMETHOD(AddPage)(ID2D1CommandList *commandList, D2D_SIZE_F pageSize, IStream *pagePrintTicketStream,
  445. D2D1_TAG *tag1 = NULL, D2D1_TAG *tag2 = NULL) PURE;
  446. STDMETHOD(Close)() PURE;
  447. };
  448. #else
  449. typedef interface ID2D1PrintControl ID2D1PrintControl;
  450. #endif
  451. DEFINE_GUID(IID_ID2D1PrintControl, 0x2c1d867d,0xc290,0x41c8,0xae,0x7e,0x34,0xa9,0x87,0x02,0xe9,0xa5);
  452. __CRT_UUID_DECL(ID2D1PrintControl, 0x2c1d867d,0xc290,0x41c8,0xae,0x7e,0x34,0xa9,0x87,0x02,0xe9,0xa5);
  453. #ifndef D2D_USE_C_DEFINITIONS
  454. interface ID2D1Effect : public ID2D1Properties
  455. {
  456. STDMETHOD_(void, SetInput)(UINT32 index, ID2D1Image *input, BOOL invalidate=TRUE) PURE;
  457. STDMETHOD(SetInputCount)(UINT32 inputCount) PURE;
  458. STDMETHOD_(void, GetInput)(UINT32 index, ID2D1Image **input) CONST PURE;
  459. STDMETHOD_(UINT32, GetInputCount)() CONST PURE;
  460. STDMETHOD_(void, GetOutput)(ID2D1Image **outputImage) CONST PURE;
  461. void SetInputEffect(UINT32 index, ID2D1Effect *inputEffect, BOOL invalidate=TRUE) {
  462. ID2D1Image *output = NULL;
  463. if(inputEffect)
  464. inputEffect->GetOutput(&output);
  465. SetInput(index, output, invalidate);
  466. if(output)
  467. output->Release();
  468. }
  469. };
  470. #else
  471. typedef interface ID2D1Effect ID2D1Effect;
  472. /* FIXME: Add full C declaration */
  473. #endif
  474. DEFINE_GUID(IID_ID2D1Effect,0x28211a43,0x7d89,0x476f,0x81,0x81,0x2d,0x61,0x59,0xb2,0x20,0xad);
  475. __CRT_UUID_DECL(ID2D1Effect,0x28211a43,0x7d89,0x476f,0x81,0x81,0x2d,0x61,0x59,0xb2,0x20,0xad);
  476. #endif
  477. #ifndef D2D_USE_C_DEFINITIONS
  478. interface ID2D1Bitmap1 : public ID2D1Bitmap
  479. {
  480. STDMETHOD_(void, GetColorContext)(ID2D1ColorContext **colorContext) CONST PURE;
  481. STDMETHOD_(D2D1_BITMAP_OPTIONS, GetOptions)() CONST PURE;
  482. STDMETHOD(GetSurface)(IDXGISurface **dxgiSurface) CONST PURE;
  483. STDMETHOD(Map)(D2D1_MAP_OPTIONS options, D2D1_MAPPED_RECT *mappedRect) PURE;
  484. STDMETHOD(Unmap)() PURE;
  485. };
  486. #else
  487. typedef interface ID2D1Bitmap1 ID2D1Bitmap1;
  488. typedef struct ID2D1Bitmap1Vtbl {
  489. ID2D1BitmapVtbl Base;
  490. STDMETHOD_(void, GetColorContext)(ID2D1Bitmap1 *This, ID2D1ColorContext **colorContext) PURE;
  491. STDMETHOD_(D2D1_BITMAP_OPTIONS, GetOptions)(ID2D1Bitmap1 *This) PURE;
  492. STDMETHOD(GetSurface)(ID2D1Bitmap1 *This, IDXGISurface **dxgiSurface) PURE;
  493. STDMETHOD(Map)(ID2D1Bitmap1 *This, D2D1_MAP_OPTIONS options, D2D1_MAPPED_RECT *mappedRect) PURE;
  494. STDMETHOD(Unmap)(ID2D1Bitmap1 *This) PURE;
  495. }
  496. ID2D1Bitmap1Vtbl;
  497. interface ID2D1Bitmap1 {
  498. const ID2D1Bitmap1Vtbl *lpVtbl;
  499. };
  500. /*** IUnknown methods ***/
  501. #define ID2D1Bitmap1_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
  502. #define ID2D1Bitmap1_AddRef(This) (This)->lpVtbl->AddRef(This)
  503. #define ID2D1Bitmap1_Release(This) (This)->lpVtbl->Release(This)
  504. /*** ID2D1Resource methods ***/
  505. #define ID2D1Bitmap1_GetFactory(This,factory) (This)->lpVtbl->GetFactory(This,factory)
  506. /*** ID2D1Bitmap methods ***/
  507. #define ID2D1Bitmap1_GetSize(This) ID2D1Bitmap1_GetSize_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support
  508. #define ID2D1Bitmap1_GetPixelSize(This) ID2D1Bitmap1_GetPixelSize_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support
  509. #define ID2D1Bitmap1_GetPixelFormat(This) ID2D1Bitmap1_GetPixelFormat_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support
  510. #define ID2D1Bitmap1_GetDpi(This,dpi_x,dpi_y) (This)->lpVtbl->GetDpi(This,dpi_x,dpi_y)
  511. #define ID2D1Bitmap1_CopyFromBitmap(This,dst_point,bitmap,src_rect) (This)->lpVtbl->CopyFromBitmap(This,dst_point,bitmap,src_rect)
  512. #define ID2D1Bitmap1_CopyFromRenderTarget(This,dst_point,render_target,src_rect) (This)->lpVtbl->CopyFromRenderTarget(This,dst_point,render_target,src_rect)
  513. #define ID2D1Bitmap1_CopyFromMemory(This,dst_rect,src_data,pitch) (This)->lpVtbl->CopyFromMemory(This,dst_rect,src_data,pitch)
  514. /*** ID2D1Bitmap1 methods ***/
  515. #define ID2D1Bitmap1_GetColorContext(This,context) (This)->lpVtbl->GetColorContext(This,context)
  516. #define ID2D1Bitmap1_GetOptions(This) (This)->lpVtbl->GetOptions(This)
  517. #define ID2D1Bitmap1_GetSurface(This,surface) (This)->lpVtbl->GetSurface(This,surface)
  518. #define ID2D1Bitmap1_Map(This,options,mapped_rect) (This)->lpVtbl->Map(This,options,mapped_rect)
  519. #define ID2D1Bitmap1_Unmap(This) (This)->lpVtbl->Unmap(This)
  520. #endif
  521. DEFINE_GUID(IID_ID2D1Bitmap1, 0xa898a84c,0x3873,0x4588,0xb0,0x8b,0xeb,0xbf,0x97,0x8d,0xf0,0x41);
  522. __CRT_UUID_DECL(ID2D1Bitmap1, 0xa898a84c,0x3873,0x4588,0xb0,0x8b,0xeb,0xbf,0x97,0x8d,0xf0,0x41);
  523. #ifndef D2D_USE_C_DEFINITIONS
  524. interface ID2D1ImageBrush : public ID2D1Brush
  525. {
  526. STDMETHOD_(void, SetImage)(ID2D1Image *image) PURE;
  527. STDMETHOD_(void, SetExtendModeX)(D2D1_EXTEND_MODE extendModeX) PURE;
  528. STDMETHOD_(void, SetExtendModeY)(D2D1_EXTEND_MODE extendModeY) PURE;
  529. STDMETHOD_(void, SetInterpolationMode)(D2D1_INTERPOLATION_MODE interpolationMode) PURE;
  530. STDMETHOD_(void, SetSourceRectangle)(CONST D2D1_RECT_F *sourceRectangle) PURE;
  531. STDMETHOD_(void, GetImage)(ID2D1Image **image) CONST PURE;
  532. STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)() CONST PURE;
  533. STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)() CONST PURE;
  534. STDMETHOD_(D2D1_INTERPOLATION_MODE, GetInterpolationMode)() CONST PURE;
  535. STDMETHOD_(void, GetSourceRectangle)(D2D1_RECT_F *sourceRectangle) CONST PURE;
  536. };
  537. #else
  538. typedef interface ID2D1ImageBrush ID2D1ImageBrush;
  539. /* FIXME: Add full C declaration */
  540. #endif
  541. DEFINE_GUID(IID_ID2D1ImageBrush, 0xfe9e984d,0x3f95,0x407c,0xb5,0xdb,0xcb,0x94,0xd4,0xe8,0xf8,0x7c);
  542. __CRT_UUID_DECL(ID2D1ImageBrush, 0xfe9e984d,0x3f95,0x407c,0xb5,0xdb,0xcb,0x94,0xd4,0xe8,0xf8,0x7c);
  543. #ifndef D2D_USE_C_DEFINITIONS
  544. interface ID2D1BitmapBrush1 : public ID2D1BitmapBrush
  545. {
  546. STDMETHOD_(void, SetInterpolationMode1)(D2D1_INTERPOLATION_MODE interpolationMode) PURE;
  547. STDMETHOD_(D2D1_INTERPOLATION_MODE, GetInterpolationMode1)() CONST PURE;
  548. };
  549. #else
  550. typedef interface ID2D1BitmapBrush1 ID2D1BitmapBrush1;
  551. /* FIXME: Add full C declaration */
  552. #endif
  553. DEFINE_GUID(IID_ID2D1BitmapBrush1, 0x41343a53,0xe41a,0x49a2,0x91,0xcd,0x21,0x79,0x3b,0xbb,0x62,0xe5);
  554. __CRT_UUID_DECL(ID2D1BitmapBrush1, 0x41343a53,0xe41a,0x49a2,0x91,0xcd,0x21,0x79,0x3b,0xbb,0x62,0xe5);
  555. #ifndef D2D_USE_C_DEFINITIONS
  556. interface ID2D1GradientStopCollection1 : public ID2D1GradientStopCollection
  557. {
  558. STDMETHOD_(void, GetGradientStops1)(D2D1_GRADIENT_STOP *gradientStops, UINT32 gradientStopsCount) CONST PURE;
  559. STDMETHOD_(D2D1_COLOR_SPACE, GetPreInterpolationSpace)() CONST PURE;
  560. STDMETHOD_(D2D1_COLOR_SPACE, GetPostInterpolationSpace)() CONST PURE;
  561. STDMETHOD_(D2D1_BUFFER_PRECISION, GetBufferPrecision)() CONST PURE;
  562. STDMETHOD_(D2D1_COLOR_INTERPOLATION_MODE, GetColorInterpolationMode)() CONST PURE;
  563. };
  564. #else
  565. typedef interface ID2D1GradientStopCollection1 ID2D1GradientStopCollection1;
  566. /* FIXME: Add full C declaration */
  567. #endif
  568. DEFINE_GUID(IID_ID2D1GradientStopCollection1, 0xae1572f4,0x5dd0,0x4777,0x99,0x8b,0x92,0x79,0x47,0x2a,0xe6,0x3b);
  569. __CRT_UUID_DECL(ID2D1GradientStopCollection1, 0xae1572f4,0x5dd0,0x4777,0x99,0x8b,0x92,0x79,0x47,0x2a,0xe6,0x3b);
  570. #ifndef D2D_USE_C_DEFINITIONS
  571. interface ID2D1ColorContext : public ID2D1Resource
  572. {
  573. STDMETHOD_(D2D1_COLOR_SPACE, GetColorSpace)() CONST PURE;
  574. STDMETHOD_(UINT32, GetProfileSize)() CONST PURE;
  575. STDMETHOD(GetProfile)(BYTE *profile, UINT32 profileSize) CONST PURE;
  576. };
  577. #else
  578. typedef interface ID2D1ColorContext ID2D1ColorContext;
  579. #endif
  580. DEFINE_GUID(IID_ID2D1ColorContext, 0x1c4820bb,0x5771,0x4518,0xa5,0x81,0x2f,0xe4,0xdd,0x0e,0xc6,0x57);
  581. __CRT_UUID_DECL(ID2D1ColorContext, 0x1c4820bb,0x5771,0x4518,0xa5,0x81,0x2f,0xe4,0xdd,0x0e,0xc6,0x57);
  582. #ifndef D2D_USE_C_DEFINITIONS
  583. interface ID2D1DeviceContext : public ID2D1RenderTarget
  584. {
  585. STDMETHOD(CreateBitmap)(D2D1_SIZE_U size, CONST void *sourceData, UINT32 pitch,
  586. CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties, ID2D1Bitmap1 **bitmap) PURE;
  587. using ID2D1RenderTarget::CreateBitmap;
  588. STDMETHOD(CreateBitmapFromWicBitmap)(IWICBitmapSource *wicBitmapSource,
  589. CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties, ID2D1Bitmap1 **bitmap) PURE;
  590. using ID2D1RenderTarget::CreateBitmapFromWicBitmap;
  591. STDMETHOD(CreateColorContext)(D2D1_COLOR_SPACE space, CONST BYTE *profile, UINT32 profileSize,
  592. ID2D1ColorContext **colorContext) PURE;
  593. STDMETHOD(CreateColorContextFromFilename)(PCWSTR filename, ID2D1ColorContext **colorContext) PURE;
  594. STDMETHOD(CreateColorContextFromWicColorContext)(IWICColorContext *wicColorContext, ID2D1ColorContext **colorContext) PURE;
  595. STDMETHOD(CreateBitmapFromDxgiSurface)(IDXGISurface *surface, CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
  596. ID2D1Bitmap1 **bitmap) PURE;
  597. STDMETHOD(CreateEffect)(REFCLSID effectId, ID2D1Effect **effect) PURE;
  598. STDMETHOD(CreateGradientStopCollection)(CONST D2D1_GRADIENT_STOP *straightAlphaGradientStops,
  599. UINT32 straightAlphaGradientStopsCount, D2D1_COLOR_SPACE preInterpolationSpace,
  600. D2D1_COLOR_SPACE postInterpolationSpace, D2D1_BUFFER_PRECISION bufferPrecision,
  601. D2D1_EXTEND_MODE extendMode, D2D1_COLOR_INTERPOLATION_MODE colorInterpolationMode,
  602. ID2D1GradientStopCollection1 **gradientStopCollection1) PURE;
  603. using ID2D1RenderTarget::CreateGradientStopCollection;
  604. STDMETHOD(CreateImageBrush)(ID2D1Image *image, CONST D2D1_IMAGE_BRUSH_PROPERTIES *imageBrushProperties,
  605. CONST D2D1_BRUSH_PROPERTIES *brushProperties, ID2D1ImageBrush **imageBrush) PURE;
  606. STDMETHOD(CreateBitmapBrush)(ID2D1Bitmap *bitmap, CONST D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties,
  607. CONST D2D1_BRUSH_PROPERTIES *brushProperties, ID2D1BitmapBrush1 **bitmapBrush) PURE;
  608. using ID2D1RenderTarget::CreateBitmapBrush;
  609. STDMETHOD(CreateCommandList)(ID2D1CommandList **commandList) PURE;
  610. STDMETHOD_(BOOL, IsDxgiFormatSupported)(DXGI_FORMAT format) CONST PURE;
  611. STDMETHOD_(BOOL, IsBufferPrecisionSupported)(D2D1_BUFFER_PRECISION bufferPrecision) CONST PURE;
  612. STDMETHOD(GetImageLocalBounds)(ID2D1Image *image, D2D1_RECT_F *localBounds) CONST PURE;
  613. STDMETHOD(GetImageWorldBounds)(ID2D1Image *image, D2D1_RECT_F *worldBounds) CONST PURE;
  614. STDMETHOD(GetGlyphRunWorldBounds)(D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
  615. DWRITE_MEASURING_MODE measuringMode, D2D1_RECT_F *bounds) CONST PURE;
  616. STDMETHOD_(void, GetDevice)(ID2D1Device **device) CONST PURE;
  617. STDMETHOD_(void, SetTarget)(ID2D1Image *image) PURE;
  618. STDMETHOD_(void, GetTarget)(ID2D1Image **image) CONST PURE;
  619. STDMETHOD_(void, SetRenderingControls)(CONST D2D1_RENDERING_CONTROLS *renderingControls) PURE;
  620. STDMETHOD_(void, GetRenderingControls)(D2D1_RENDERING_CONTROLS *renderingControls) CONST PURE;
  621. STDMETHOD_(void, SetPrimitiveBlend)(D2D1_PRIMITIVE_BLEND primitiveBlend) PURE;
  622. STDMETHOD_(D2D1_PRIMITIVE_BLEND, GetPrimitiveBlend)() CONST PURE;
  623. STDMETHOD_(void, SetUnitMode)(D2D1_UNIT_MODE unitMode) PURE;
  624. STDMETHOD_(D2D1_UNIT_MODE, GetUnitMode)() CONST PURE;
  625. STDMETHOD_(void, DrawGlyphRun)(D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
  626. CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription, ID2D1Brush *foregroundBrush,
  627. DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL) PURE;
  628. using ID2D1RenderTarget::DrawGlyphRun;
  629. STDMETHOD_(void, DrawImage)(ID2D1Image *image, CONST D2D1_POINT_2F *targetOffset = NULL,
  630. CONST D2D1_RECT_F *imageRectangle = NULL, D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
  631. D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) PURE;
  632. STDMETHOD_(void, DrawGdiMetafile)(ID2D1GdiMetafile *gdiMetafile, CONST D2D1_POINT_2F *targetOffset = NULL) PURE;
  633. STDMETHOD_(void, DrawBitmap)(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F *destinationRectangle, FLOAT opacity,
  634. D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F *sourceRectangle = NULL,
  635. CONST D2D1_MATRIX_4X4_F *perspectiveTransform = NULL) PURE;
  636. using ID2D1RenderTarget::DrawBitmap;
  637. STDMETHOD_(void, PushLayer)(CONST D2D1_LAYER_PARAMETERS1 *layerParameters, ID2D1Layer *layer) PURE;
  638. using ID2D1RenderTarget::PushLayer;
  639. STDMETHOD(InvalidateEffectInputRectangle)(ID2D1Effect *effect, UINT32 input, CONST D2D1_RECT_F *inputRectangle) PURE;
  640. STDMETHOD(GetEffectInvalidRectangleCount)(ID2D1Effect *effect, UINT32 *rectangleCount) PURE;
  641. STDMETHOD(GetEffectInvalidRectangles)(ID2D1Effect *effect, D2D1_RECT_F *rectangles, UINT32 rectanglesCount) PURE;
  642. STDMETHOD(GetEffectRequiredInputRectangles)(ID2D1Effect *renderEffect, CONST D2D1_RECT_F *renderImageRectangle,
  643. CONST D2D1_EFFECT_INPUT_DESCRIPTION *inputDescriptions, D2D1_RECT_F *requiredInputRects, UINT32 inputCount) PURE;
  644. STDMETHOD_(void, FillOpacityMask)(ID2D1Bitmap *opacityMask, ID2D1Brush *brush, CONST D2D1_RECT_F *destinationRectangle = NULL,
  645. CONST D2D1_RECT_F *sourceRectangle = NULL) PURE;
  646. using ID2D1RenderTarget::FillOpacityMask;
  647. HRESULT CreateBitmap(D2D1_SIZE_U size, CONST void *sourceData, UINT32 pitch, CONST D2D1_BITMAP_PROPERTIES1 &bitmapProperties,
  648. ID2D1Bitmap1 **bitmap) {
  649. return CreateBitmap(size, sourceData, pitch, &bitmapProperties, bitmap);
  650. }
  651. HRESULT CreateBitmapFromWicBitmap(IWICBitmapSource *wicBitmapSource, CONST D2D1_BITMAP_PROPERTIES1 &bitmapProperties,
  652. ID2D1Bitmap1 **bitmap) {
  653. return CreateBitmapFromWicBitmap(wicBitmapSource, &bitmapProperties, bitmap);
  654. }
  655. HRESULT CreateBitmapFromWicBitmap(IWICBitmapSource *wicBitmapSource, ID2D1Bitmap1 **bitmap) {
  656. return CreateBitmapFromWicBitmap(wicBitmapSource, NULL, bitmap);
  657. }
  658. HRESULT CreateBitmapFromDxgiSurface(IDXGISurface *surface, CONST D2D1_BITMAP_PROPERTIES1 &bitmapProperties,
  659. ID2D1Bitmap1 **bitmap) {
  660. return CreateBitmapFromDxgiSurface(surface, &bitmapProperties, bitmap);
  661. }
  662. HRESULT CreateImageBrush(ID2D1Image *image, CONST D2D1_IMAGE_BRUSH_PROPERTIES &imageBrushProperties,
  663. CONST D2D1_BRUSH_PROPERTIES &brushProperties, ID2D1ImageBrush **imageBrush) {
  664. return CreateImageBrush(image, &imageBrushProperties, &brushProperties, imageBrush);
  665. }
  666. HRESULT CreateImageBrush(ID2D1Image *image, CONST D2D1_IMAGE_BRUSH_PROPERTIES &imageBrushProperties,
  667. ID2D1ImageBrush **imageBrush) {
  668. return CreateImageBrush(image,&imageBrushProperties, NULL, imageBrush);
  669. }
  670. HRESULT CreateBitmapBrush(ID2D1Bitmap *bitmap, ID2D1BitmapBrush1 **bitmapBrush) {
  671. return CreateBitmapBrush(bitmap, NULL, NULL, bitmapBrush);
  672. }
  673. HRESULT CreateBitmapBrush(ID2D1Bitmap *bitmap, CONST D2D1_BITMAP_BRUSH_PROPERTIES1 &bitmapBrushProperties,
  674. ID2D1BitmapBrush1 **bitmapBrush) {
  675. return CreateBitmapBrush(bitmap, &bitmapBrushProperties, NULL, bitmapBrush);
  676. }
  677. HRESULT CreateBitmapBrush(ID2D1Bitmap *bitmap, CONST D2D1_BITMAP_BRUSH_PROPERTIES1 &bitmapBrushProperties,
  678. CONST D2D1_BRUSH_PROPERTIES &brushProperties, ID2D1BitmapBrush1 **bitmapBrush) {
  679. return CreateBitmapBrush(bitmap, &bitmapBrushProperties, &brushProperties, bitmapBrush);
  680. }
  681. void DrawImage(ID2D1Effect *effect, CONST D2D1_POINT_2F *targetOffset = NULL, CONST D2D1_RECT_F *imageRectangle = NULL,
  682. D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
  683. D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
  684. ID2D1Image *output = NULL;
  685. effect->GetOutput(&output);
  686. DrawImage(output, targetOffset, imageRectangle, interpolationMode, compositeMode);
  687. output->Release();
  688. }
  689. void DrawImage(ID2D1Image *image, D2D1_INTERPOLATION_MODE interpolationMode,
  690. D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
  691. DrawImage(image, NULL, NULL, interpolationMode, compositeMode);
  692. }
  693. void DrawImage(ID2D1Effect *effect, D2D1_INTERPOLATION_MODE interpolationMode,
  694. D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
  695. DrawImage(effect, NULL, NULL, interpolationMode, compositeMode);
  696. }
  697. void DrawImage(ID2D1Image *image, D2D1_POINT_2F targetOffset,
  698. D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
  699. D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
  700. DrawImage(image, &targetOffset, NULL, interpolationMode, compositeMode);
  701. }
  702. void DrawImage(ID2D1Effect *effect, D2D1_POINT_2F targetOffset,
  703. D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
  704. D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
  705. DrawImage(effect, &targetOffset, NULL, interpolationMode, compositeMode);
  706. }
  707. void DrawImage(ID2D1Image *image, D2D1_POINT_2F targetOffset, CONST D2D1_RECT_F &imageRectangle,
  708. D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
  709. D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
  710. DrawImage(image, &targetOffset, &imageRectangle, interpolationMode, compositeMode);
  711. }
  712. void DrawImage(ID2D1Effect *effect, D2D1_POINT_2F targetOffset, CONST D2D1_RECT_F &imageRectangle,
  713. D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
  714. D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
  715. DrawImage(effect, &targetOffset, &imageRectangle, interpolationMode, compositeMode);
  716. }
  717. void PushLayer(CONST D2D1_LAYER_PARAMETERS1 &layerParameters, ID2D1Layer *layer) {
  718. PushLayer(&layerParameters, layer);
  719. }
  720. void DrawGdiMetafile(ID2D1GdiMetafile *gdiMetafile, D2D1_POINT_2F targetOffset) {
  721. DrawGdiMetafile(gdiMetafile, &targetOffset);
  722. }
  723. void DrawBitmap(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F &destinationRectangle, FLOAT opacity,
  724. D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F *sourceRectangle = NULL,
  725. CONST D2D1_MATRIX_4X4_F *perspectiveTransform = NULL) {
  726. DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, sourceRectangle, perspectiveTransform);
  727. }
  728. void DrawBitmap(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F &destinationRectangle, FLOAT opacity,
  729. D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F &sourceRectangle,
  730. CONST D2D1_MATRIX_4X4_F *perspectiveTransform = NULL) {
  731. DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, &sourceRectangle, perspectiveTransform);
  732. }
  733. void DrawBitmap(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F &destinationRectangle, FLOAT opacity,
  734. D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F &sourceRectangle,
  735. CONST D2D1_MATRIX_4X4_F &perspectiveTransform) {
  736. DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, &sourceRectangle, &perspectiveTransform);
  737. }
  738. void FillOpacityMask(ID2D1Bitmap *opacityMask, ID2D1Brush *brush, CONST D2D1_RECT_F &destinationRectangle,
  739. CONST D2D1_RECT_F *sourceRectangle = NULL) {
  740. FillOpacityMask(opacityMask, brush, &destinationRectangle, sourceRectangle);
  741. }
  742. void FillOpacityMask(ID2D1Bitmap *opacityMask, ID2D1Brush *brush, CONST D2D1_RECT_F &destinationRectangle,
  743. CONST D2D1_RECT_F &sourceRectangle) {
  744. FillOpacityMask(opacityMask, brush, &destinationRectangle, &sourceRectangle);
  745. }
  746. void SetRenderingControls(CONST D2D1_RENDERING_CONTROLS &renderingControls) {
  747. return SetRenderingControls(&renderingControls);
  748. }
  749. };
  750. #else
  751. typedef interface ID2D1DeviceContext ID2D1DeviceContext;
  752. typedef struct ID2D1DeviceContextVtbl {
  753. struct ID2D1RenderTargetVtbl Base;
  754. STDMETHOD(CreateBitmap)(ID2D1DeviceContext *This, D2D1_SIZE_U size,
  755. CONST void *sourceData, UINT32 pitch,
  756. CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
  757. ID2D1Bitmap1 **bitmap) PURE;
  758. STDMETHOD(CreateBitmapFromWicBitmap)(ID2D1DeviceContext *This,
  759. IWICBitmapSource *wicBitmapSource,
  760. CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
  761. ID2D1Bitmap1 **bitmap) PURE;
  762. STDMETHOD(CreateColorContext)(ID2D1DeviceContext *This,
  763. D2D1_COLOR_SPACE space, CONST BYTE *profile, UINT32 profileSize,
  764. ID2D1ColorContext **colorContext) PURE;
  765. STDMETHOD(CreateColorContextFromFilename)(ID2D1DeviceContext *This,
  766. PCWSTR filename, ID2D1ColorContext **colorContext) PURE;
  767. STDMETHOD(CreateColorContextFromWicColorContext)(ID2D1DeviceContext *This,
  768. IWICColorContext *wicColorContext,
  769. ID2D1ColorContext **colorContext) PURE;
  770. STDMETHOD(CreateBitmapFromDxgiSurface)(ID2D1DeviceContext *This,
  771. IDXGISurface *surface, CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
  772. ID2D1Bitmap1 **bitmap) PURE;
  773. STDMETHOD(CreateEffect)(ID2D1DeviceContext *This, REFCLSID effectId,
  774. ID2D1Effect **effect) PURE;
  775. STDMETHOD(CreateGradientStopCollection)(ID2D1DeviceContext *This,
  776. CONST D2D1_GRADIENT_STOP *straightAlphaGradientStops,
  777. UINT32 straightAlphaGradientStopsCount,
  778. D2D1_COLOR_SPACE preInterpolationSpace,
  779. D2D1_COLOR_SPACE postInterpolationSpace,
  780. D2D1_BUFFER_PRECISION bufferPrecision,
  781. D2D1_EXTEND_MODE extendMode,
  782. D2D1_COLOR_INTERPOLATION_MODE colorInterpolationMode,
  783. ID2D1GradientStopCollection1 **gradientStopCollection1) PURE;
  784. STDMETHOD(CreateImageBrush)(ID2D1DeviceContext *This,
  785. struct ID2D1Image *image,
  786. CONST D2D1_IMAGE_BRUSH_PROPERTIES *imageBrushProperties,
  787. CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  788. ID2D1ImageBrush **imageBrush) PURE;
  789. STDMETHOD(CreateBitmapBrush)(ID2D1DeviceContext *This, ID2D1Bitmap *bitmap,
  790. CONST D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties,
  791. CONST D2D1_BRUSH_PROPERTIES *brushProperties,
  792. ID2D1BitmapBrush1 **bitmapBrush) PURE;
  793. STDMETHOD(CreateCommandList)(ID2D1DeviceContext *This,
  794. ID2D1CommandList **commandList) PURE;
  795. STDMETHOD_(BOOL, IsDxgiFormatSupported)(ID2D1DeviceContext *This,
  796. DXGI_FORMAT format) PURE;
  797. STDMETHOD_(BOOL, IsBufferPrecisionSupported)(ID2D1DeviceContext *This,
  798. D2D1_BUFFER_PRECISION bufferPrecision) PURE;
  799. STDMETHOD(GetImageLocalBounds)(ID2D1DeviceContext *This,
  800. struct ID2D1Image *image, D2D1_RECT_F *localBounds) PURE;
  801. STDMETHOD(GetImageWorldBounds)(ID2D1DeviceContext *This,
  802. struct ID2D1Image *image, D2D1_RECT_F *worldBounds) PURE;
  803. STDMETHOD(GetGlyphRunWorldBounds)(ID2D1DeviceContext *This,
  804. D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
  805. DWRITE_MEASURING_MODE measuringMode, D2D1_RECT_F *bounds) PURE;
  806. STDMETHOD_(void, GetDevice)(ID2D1DeviceContext *This,
  807. ID2D1Device **device) PURE;
  808. STDMETHOD_(void, SetTarget)(ID2D1DeviceContext *This,
  809. struct ID2D1Image *image) PURE;
  810. STDMETHOD_(void, GetTarget)(ID2D1DeviceContext *This,
  811. struct ID2D1Image **image) PURE;
  812. STDMETHOD_(void, SetRenderingControls)(ID2D1DeviceContext *This,
  813. CONST D2D1_RENDERING_CONTROLS *renderingControls) PURE;
  814. STDMETHOD_(void, GetRenderingControls)(ID2D1DeviceContext *This,
  815. D2D1_RENDERING_CONTROLS *renderingControls) PURE;
  816. STDMETHOD_(void, SetPrimitiveBlend)(ID2D1DeviceContext *This,
  817. D2D1_PRIMITIVE_BLEND primitiveBlend) PURE;
  818. STDMETHOD_(D2D1_PRIMITIVE_BLEND, GetPrimitiveBlend)(ID2D1DeviceContext *This) PURE;
  819. STDMETHOD_(void, SetUnitMode)(ID2D1DeviceContext *This,
  820. D2D1_UNIT_MODE unitMode) PURE;
  821. STDMETHOD_(D2D1_UNIT_MODE, GetUnitMode)(ID2D1DeviceContext *This) PURE;
  822. STDMETHOD_(void, DrawGlyphRun)(ID2D1DeviceContext *This,
  823. D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
  824. CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription,
  825. ID2D1Brush *foregroundBrush, DWRITE_MEASURING_MODE measuringMode) PURE;
  826. STDMETHOD_(void, DrawImage)(ID2D1DeviceContext *This,
  827. struct ID2D1Image *image, CONST D2D1_POINT_2F *targetOffset,
  828. CONST D2D1_RECT_F *imageRectangle,
  829. D2D1_INTERPOLATION_MODE interpolationMode,
  830. D2D1_COMPOSITE_MODE compositeMode) PURE;
  831. STDMETHOD_(void, DrawGdiMetafile)(ID2D1DeviceContext *This,
  832. ID2D1GdiMetafile *gdiMetafile, CONST D2D1_POINT_2F *targetOffset) PURE;
  833. STDMETHOD_(void, DrawBitmap)(ID2D1DeviceContext *This,
  834. ID2D1Bitmap *bitmap, CONST D2D1_RECT_F *destinationRectangle,
  835. FLOAT opacity, D2D1_INTERPOLATION_MODE interpolationMode,
  836. CONST D2D1_RECT_F *sourceRectangle,
  837. CONST D2D1_MATRIX_4X4_F *perspectiveTransform) PURE;
  838. STDMETHOD_(void, PushLayer)(ID2D1DeviceContext *This,
  839. CONST D2D1_LAYER_PARAMETERS1 *layerParameters, ID2D1Layer *layer) PURE;
  840. STDMETHOD(InvalidateEffectInputRectangle)(ID2D1DeviceContext *This,
  841. ID2D1Effect *effect, UINT32 input,
  842. CONST D2D1_RECT_F *inputRectangle) PURE;
  843. STDMETHOD(GetEffectInvalidRectangleCount)(ID2D1DeviceContext *This,
  844. ID2D1Effect *effect, UINT32 *rectangleCount) PURE;
  845. STDMETHOD(GetEffectInvalidRectangles)(ID2D1DeviceContext *This,
  846. ID2D1Effect *effect, D2D1_RECT_F *rectangles,
  847. UINT32 rectanglesCount) PURE;
  848. STDMETHOD(GetEffectRequiredInputRectangles)(ID2D1DeviceContext *This,
  849. ID2D1Effect *renderEffect, CONST D2D1_RECT_F *renderImageRectangle,
  850. CONST D2D1_EFFECT_INPUT_DESCRIPTION *inputDescriptions,
  851. D2D1_RECT_F *requiredInputRects, UINT32 inputCount) PURE;
  852. STDMETHOD_(void, FillOpacityMask)(ID2D1DeviceContext *This,
  853. ID2D1Bitmap *opacityMask, ID2D1Brush *brush,
  854. CONST D2D1_RECT_F *destinationRectangle,
  855. CONST D2D1_RECT_F *sourceRectangle) PURE;
  856. }
  857. ID2D1DeviceContextVtbl;
  858. interface ID2D1DeviceContext {
  859. const ID2D1DeviceContextVtbl *lpVtbl;
  860. };
  861. /*** IUnknown methods ***/
  862. #define ID2D1DeviceContext_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
  863. #define ID2D1DeviceContext_AddRef(This) (This)->lpVtbl->AddRef(This)
  864. #define ID2D1DeviceContext_Release(This) (This)->lpVtbl->Release(This)
  865. /*** ID2D1Resource methods ***/
  866. #define ID2D1DeviceContext_GetFactory(This,factory) (This)->lpVtbl->GetFactory(This,factory)
  867. /*** ID2D1RenderTarget methods ***/
  868. #define ID2D1DeviceContext_CreateSharedBitmap(This,iid,data,desc,bitmap) (This)->lpVtbl->CreateSharedBitmap(This,iid,data,desc,bitmap)
  869. #define ID2D1DeviceContext_CreateSolidColorBrush(This,color,desc,brush) (This)->lpVtbl->CreateSolidColorBrush(This,color,desc,brush)
  870. #define ID2D1DeviceContext_CreateLinearGradientBrush(This,gradient_brush_desc,brush_desc,gradient,brush) (This)->lpVtbl->CreateLinearGradientBrush(This,gradient_brush_desc,brush_desc,gradient,brush)
  871. #define ID2D1DeviceContext_CreateRadialGradientBrush(This,gradient_brush_desc,brush_desc,gradient,brush) (This)->lpVtbl->CreateRadialGradientBrush(This,gradient_brush_desc,brush_desc,gradient,brush)
  872. #define ID2D1DeviceContext_CreateCompatibleRenderTarget(This,size,pixel_size,format,options,render_target) (This)->lpVtbl->CreateCompatibleRenderTarget(This,size,pixel_size,format,options,render_target)
  873. #define ID2D1DeviceContext_CreateLayer(This,size,layer) (This)->lpVtbl->CreateLayer(This,size,layer)
  874. #define ID2D1DeviceContext_CreateMesh(This,mesh) (This)->lpVtbl->CreateMesh(This,mesh)
  875. #define ID2D1DeviceContext_DrawLine(This,p0,p1,brush,stroke_width,stroke_style) (This)->lpVtbl->DrawLine(This,p0,p1,brush,stroke_width,stroke_style)
  876. #define ID2D1DeviceContext_DrawRectangle(This,rect,brush,stroke_width,stroke_style) (This)->lpVtbl->DrawRectangle(This,rect,brush,stroke_width,stroke_style)
  877. #define ID2D1DeviceContext_FillRectangle(This,rect,brush) (This)->lpVtbl->FillRectangle(This,rect,brush)
  878. #define ID2D1DeviceContext_DrawRoundedRectangle(This,rect,brush,stroke_width,stroke_style) (This)->lpVtbl->DrawRoundedRectangle(This,rect,brush,stroke_width,stroke_style)
  879. #define ID2D1DeviceContext_FillRoundedRectangle(This,rect,brush) (This)->lpVtbl->FillRoundedRectangle(This,rect,brush)
  880. #define ID2D1DeviceContext_DrawEllipse(This,ellipse,brush,stroke_width,stroke_style) (This)->lpVtbl->DrawEllipse(This,ellipse,brush,stroke_width,stroke_style)
  881. #define ID2D1DeviceContext_FillEllipse(This,ellipse,brush) (This)->lpVtbl->FillEllipse(This,ellipse,brush)
  882. #define ID2D1DeviceContext_DrawGeometry(This,geometry,brush,stroke_width,stroke_style) (This)->lpVtbl->DrawGeometry(This,geometry,brush,stroke_width,stroke_style)
  883. #define ID2D1DeviceContext_FillGeometry(This,geometry,brush,opacity_brush) (This)->lpVtbl->FillGeometry(This,geometry,brush,opacity_brush)
  884. #define ID2D1DeviceContext_FillMesh(This,mesh,brush) (This)->lpVtbl->FillMesh(This,mesh,brush)
  885. #define ID2D1DeviceContext_DrawText(This,string,string_len,text_format,layout_rect,brush,options,measuring_mode) (This)->lpVtbl->DrawText(This,string,string_len,text_format,layout_rect,brush,options,measuring_mode)
  886. #define ID2D1DeviceContext_DrawTextLayout(This,origin,layout,brush,options) (This)->lpVtbl->DrawTextLayout(This,origin,layout,brush,options)
  887. #define ID2D1DeviceContext_SetTransform(This,transform) (This)->lpVtbl->SetTransform(This,transform)
  888. #define ID2D1DeviceContext_GetTransform(This,transform) (This)->lpVtbl->GetTransform(This,transform)
  889. #define ID2D1DeviceContext_SetAntialiasMode(This,antialias_mode) (This)->lpVtbl->SetAntialiasMode(This,antialias_mode)
  890. #define ID2D1DeviceContext_GetAntialiasMode(This) (This)->lpVtbl->GetAntialiasMode(This)
  891. #define ID2D1DeviceContext_SetTextAntialiasMode(This,antialias_mode) (This)->lpVtbl->SetTextAntialiasMode(This,antialias_mode)
  892. #define ID2D1DeviceContext_GetTextAntialiasMode(This) (This)->lpVtbl->GetTextAntialiasMode(This)
  893. #define ID2D1DeviceContext_SetTextRenderingParams(This,text_rendering_params) (This)->lpVtbl->SetTextRenderingParams(This,text_rendering_params)
  894. #define ID2D1DeviceContext_GetTextRenderingParams(This,text_rendering_params) (This)->lpVtbl->GetTextRenderingParams(This,text_rendering_params)
  895. #define ID2D1DeviceContext_SetTags(This,tag1,tag2) (This)->lpVtbl->SetTags(This,tag1,tag2)
  896. #define ID2D1DeviceContext_GetTags(This,tag1,tag2) (This)->lpVtbl->GetTags(This,tag1,tag2)
  897. #define ID2D1DeviceContext_PopLayer(This) (This)->lpVtbl->PopLayer(This)
  898. #define ID2D1DeviceContext_Flush(This,tag1,tag2) (This)->lpVtbl->Flush(This,tag1,tag2)
  899. #define ID2D1DeviceContext_SaveDrawingState(This,state_block) (This)->lpVtbl->SaveDrawingState(This,state_block)
  900. #define ID2D1DeviceContext_RestoreDrawingState(This,state_block) (This)->lpVtbl->RestoreDrawingState(This,state_block)
  901. #define ID2D1DeviceContext_PushAxisAlignedClip(This,clip_rect,antialias_mode) (This)->lpVtbl->PushAxisAlignedClip(This,clip_rect,antialias_mode)
  902. #define ID2D1DeviceContext_PopAxisAlignedClip(This) (This)->lpVtbl->PopAxisAlignedClip(This)
  903. #define ID2D1DeviceContext_Clear(This,color) (This)->lpVtbl->Clear(This,color)
  904. #define ID2D1DeviceContext_BeginDraw(This) (This)->lpVtbl->BeginDraw(This)
  905. #define ID2D1DeviceContext_EndDraw(This,tag1,tag2) (This)->lpVtbl->EndDraw(This,tag1,tag2)
  906. #define ID2D1DeviceContext_GetPixelFormat(This) ID2D1DeviceContext_GetPixelFormat_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support
  907. #define ID2D1DeviceContext_SetDpi(This,dpi_x,dpi_y) (This)->lpVtbl->SetDpi(This,dpi_x,dpi_y)
  908. #define ID2D1DeviceContext_GetDpi(This,dpi_x,dpi_y) (This)->lpVtbl->GetDpi(This,dpi_x,dpi_y)
  909. #define ID2D1DeviceContext_GetSize(This) ID2D1DeviceContext_GetSize_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support
  910. #define ID2D1DeviceContext_GetPixelSize(This) ID2D1DeviceContext_GetPixelSize_define_WIDL_C_INLINE_WRAPPERS_for_aggregate_return_support
  911. #define ID2D1DeviceContext_GetMaximumBitmapSize(This) (This)->lpVtbl->GetMaximumBitmapSize(This)
  912. #define ID2D1DeviceContext_IsSupported(This,desc) (This)->lpVtbl->IsSupported(This,desc)
  913. /*** ID2D1DeviceContext methods ***/
  914. #define ID2D1DeviceContext_CreateBitmap(This,size,src_data,pitch,desc,bitmap) (This)->lpVtbl->ID2D1DeviceContext_CreateBitmap(This,size,src_data,pitch,desc,bitmap)
  915. #define ID2D1DeviceContext_CreateBitmapFromWicBitmap(This,bitmap_source,desc,bitmap) (This)->lpVtbl->ID2D1DeviceContext_CreateBitmapFromWicBitmap(This,bitmap_source,desc,bitmap)
  916. #define ID2D1DeviceContext_CreateColorContext(This,space,profile,profile_size,color_context) (This)->lpVtbl->CreateColorContext(This,space,profile,profile_size,color_context)
  917. #define ID2D1DeviceContext_CreateColorContextFromFilename(This,filename,color_context) (This)->lpVtbl->CreateColorContextFromFilename(This,filename,color_context)
  918. #define ID2D1DeviceContext_CreateColorContextFromWicColorContext(This,wic_color_context,color_context) (This)->lpVtbl->CreateColorContextFromWicColorContext(This,wic_color_context,color_context)
  919. #define ID2D1DeviceContext_CreateBitmapFromDxgiSurface(This,surface,desc,bitmap) (This)->lpVtbl->CreateBitmapFromDxgiSurface(This,surface,desc,bitmap)
  920. #define ID2D1DeviceContext_CreateEffect(This,effect_id,effect) (This)->lpVtbl->CreateEffect(This,effect_id,effect)
  921. #define ID2D1DeviceContext_CreateGradientStopCollection(This,stops,stop_count,preinterpolation_space,postinterpolation_space,buffer_precision,extend_mode,color_interpolation_mode,gradient) (This)->lpVtbl->ID2D1DeviceContext_CreateGradientStopCollection(This,stops,stop_count,preinterpolation_space,postinterpolation_space,buffer_precision,extend_mode,color_interpolation_mode,gradient)
  922. #define ID2D1DeviceContext_CreateImageBrush(This,image,image_brush_desc,brush_desc,brush) (This)->lpVtbl->CreateImageBrush(This,image,image_brush_desc,brush_desc,brush)
  923. #define ID2D1DeviceContext_CreateBitmapBrush(This,bitmap,bitmap_brush_desc,brush_desc,bitmap_brush) (This)->lpVtbl->ID2D1DeviceContext_CreateBitmapBrush(This,bitmap,bitmap_brush_desc,brush_desc,bitmap_brush)
  924. #define ID2D1DeviceContext_CreateCommandList(This,command_list) (This)->lpVtbl->CreateCommandList(This,command_list)
  925. #define ID2D1DeviceContext_IsDxgiFormatSupported(This,format) (This)->lpVtbl->IsDxgiFormatSupported(This,format)
  926. #define ID2D1DeviceContext_IsBufferPrecisionSupported(This,buffer_precision) (This)->lpVtbl->IsBufferPrecisionSupported(This,buffer_precision)
  927. #define ID2D1DeviceContext_GetImageLocalBounds(This,image,local_bounds) (This)->lpVtbl->GetImageLocalBounds(This,image,local_bounds)
  928. #define ID2D1DeviceContext_GetImageWorldBounds(This,image,world_bounds) (This)->lpVtbl->GetImageWorldBounds(This,image,world_bounds)
  929. #define ID2D1DeviceContext_GetGlyphRunWorldBounds(This,baseline_origin,glyph_run,measuring_mode,bounds) (This)->lpVtbl->GetGlyphRunWorldBounds(This,baseline_origin,glyph_run,measuring_mode,bounds)
  930. #define ID2D1DeviceContext_GetDevice(This,device) (This)->lpVtbl->GetDevice(This,device)
  931. #define ID2D1DeviceContext_SetTarget(This,target) (This)->lpVtbl->SetTarget(This,target)
  932. #define ID2D1DeviceContext_GetTarget(This,target) (This)->lpVtbl->GetTarget(This,target)
  933. #define ID2D1DeviceContext_SetRenderingControls(This,rendering_controls) (This)->lpVtbl->SetRenderingControls(This,rendering_controls)
  934. #define ID2D1DeviceContext_GetRenderingControls(This,rendering_controls) (This)->lpVtbl->GetRenderingControls(This,rendering_controls)
  935. #define ID2D1DeviceContext_SetPrimitiveBlend(This,primitive_blend) (This)->lpVtbl->SetPrimitiveBlend(This,primitive_blend)
  936. #define ID2D1DeviceContext_GetPrimitiveBlend(This) (This)->lpVtbl->GetPrimitiveBlend(This)
  937. #define ID2D1DeviceContext_SetUnitMode(This,unit_mode) (This)->lpVtbl->SetUnitMode(This,unit_mode)
  938. #define ID2D1DeviceContext_GetUnitMode(This) (This)->lpVtbl->GetUnitMode(This)
  939. #define ID2D1DeviceContext_DrawGlyphRun(This,baseline_origin,glyph_run,glyph_run_desc,brush,measuring_mode) (This)->lpVtbl->ID2D1DeviceContext_DrawGlyphRun(This,baseline_origin,glyph_run,glyph_run_desc,brush,measuring_mode)
  940. #define ID2D1DeviceContext_DrawImage(This,image,target_offset,image_rect,interpolation_mode,composite_mode) (This)->lpVtbl->DrawImage(This,image,target_offset,image_rect,interpolation_mode,composite_mode)
  941. #define ID2D1DeviceContext_DrawGdiMetafile(This,metafile,target_offset) (This)->lpVtbl->DrawGdiMetafile(This,metafile,target_offset)
  942. #define ID2D1DeviceContext_DrawBitmap(This,bitmap,dst_rect,opacity,interpolation_mode,src_rect,perspective_transform) (This)->lpVtbl->ID2D1DeviceContext_DrawBitmap(This,bitmap,dst_rect,opacity,interpolation_mode,src_rect,perspective_transform)
  943. #define ID2D1DeviceContext_PushLayer(This,layer_parameters,layer) (This)->lpVtbl->ID2D1DeviceContext_PushLayer(This,layer_parameters,layer)
  944. #define ID2D1DeviceContext_InvalidateEffectInputRectangle(This,effect,input,input_rect) (This)->lpVtbl->InvalidateEffectInputRectangle(This,effect,input,input_rect)
  945. #define ID2D1DeviceContext_GetEffectInvalidRectangleCount(This,effect,rect_count) (This)->lpVtbl->GetEffectInvalidRectangleCount(This,effect,rect_count)
  946. #define ID2D1DeviceContext_GetEffectInvalidRectangles(This,effect,rectangles,rect_count) (This)->lpVtbl->GetEffectInvalidRectangles(This,effect,rectangles,rect_count)
  947. #define ID2D1DeviceContext_GetEffectRequiredInputRectangles(This,effect,image_rect,desc,input_rect,input_count) (This)->lpVtbl->GetEffectRequiredInputRectangles(This,effect,image_rect,desc,input_rect,input_count)
  948. #define ID2D1DeviceContext_FillOpacityMask(This,mask,brush,dst_rect,src_rect) (This)->lpVtbl->ID2D1DeviceContext_FillOpacityMask(This,mask,brush,dst_rect,src_rect)
  949. #endif
  950. DEFINE_GUID(IID_ID2D1DeviceContext, 0xe8f7fe7a,0x191c,0x466d,0xad,0x95,0x97,0x56,0x78,0xbd,0xa9,0x98);
  951. __CRT_UUID_DECL(ID2D1DeviceContext, 0xe8f7fe7a,0x191c,0x466d,0xad,0x95,0x97,0x56,0x78,0xbd,0xa9,0x98);
  952. #ifndef D2D_USE_C_DEFINITIONS
  953. interface ID2D1Device : public ID2D1Resource
  954. {
  955. STDMETHOD(CreateDeviceContext)(D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext **deviceContext) PURE;
  956. STDMETHOD(CreatePrintControl)(IWICImagingFactory *wicFactory, IPrintDocumentPackageTarget *documentTarget,
  957. CONST D2D1_PRINT_CONTROL_PROPERTIES *printControlProperties, ID2D1PrintControl **printControl) PURE;
  958. STDMETHOD_(void, SetMaximumTextureMemory)(UINT64 maximumInBytes) PURE;
  959. STDMETHOD_(UINT64, GetMaximumTextureMemory)() CONST PURE;
  960. STDMETHOD_(void, ClearResources)(UINT32 millisecondsSinceUse = 0) PURE;
  961. HRESULT CreatePrintControl(IWICImagingFactory *wicFactory, IPrintDocumentPackageTarget *documentTarget,
  962. CONST D2D1_PRINT_CONTROL_PROPERTIES &printControlProperties, ID2D1PrintControl **printControl) {
  963. return CreatePrintControl(wicFactory, documentTarget, &printControlProperties, printControl);
  964. }
  965. };
  966. #else
  967. typedef interface ID2D1Device ID2D1Device;
  968. typedef struct ID2D1DeviceVtbl {
  969. struct ID2D1ResourceVtbl Base;
  970. STDMETHOD(CreateDeviceContext)(ID2D1Device *This,
  971. D2D1_DEVICE_CONTEXT_OPTIONS options,
  972. ID2D1DeviceContext **deviceContext) PURE;
  973. STDMETHOD(CreatePrintControl)(ID2D1Device *This,
  974. IWICImagingFactory *wicFactory,
  975. IPrintDocumentPackageTarget *documentTarget,
  976. CONST D2D1_PRINT_CONTROL_PROPERTIES *printControlProperties,
  977. ID2D1PrintControl **printControl) PURE;
  978. STDMETHOD_(void, SetMaximumTextureMemory)(ID2D1Device *This,
  979. UINT64 maximumInBytes) PURE;
  980. STDMETHOD_(UINT64, GetMaximumTextureMemory)(ID2D1Device *This) PURE;
  981. STDMETHOD_(void, ClearResources)(ID2D1Device *This,
  982. UINT32 millisecondsSinceUse) PURE;
  983. }
  984. ID2D1DeviceVtbl;
  985. interface ID2D1Device {
  986. const ID2D1DeviceVtbl *lpVtbl;
  987. };
  988. /*** IUnknown methods ***/
  989. #define ID2D1Device_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
  990. #define ID2D1Device_AddRef(This) (This)->lpVtbl->AddRef(This)
  991. #define ID2D1Device_Release(This) (This)->lpVtbl->Release(This)
  992. /*** ID2D1Resource methods ***/
  993. #define ID2D1Device_GetFactory(This,factory) (This)->lpVtbl->GetFactory(This,factory)
  994. /*** ID2D1Device methods ***/
  995. #define ID2D1Device_CreateDeviceContext(This,options,context) (This)->lpVtbl->CreateDeviceContext(This,options,context)
  996. #define ID2D1Device_CreatePrintControl(This,wic_factory,document_target,desc,print_control) (This)->lpVtbl->CreatePrintControl(This,wic_factory,document_target,desc,print_control)
  997. #define ID2D1Device_SetMaximumTextureMemory(This,max_texture_memory) (This)->lpVtbl->SetMaximumTextureMemory(This,max_texture_memory)
  998. #define ID2D1Device_GetMaximumTextureMemory(This) (This)->lpVtbl->GetMaximumTextureMemory(This)
  999. #define ID2D1Device_ClearResources(This,msec_since_use) (This)->lpVtbl->ClearResources(This,msec_since_use)
  1000. #endif
  1001. DEFINE_GUID(IID_ID2D1Device, 0x47dd575d,0xac05,0x4cdd,0x80,0x49,0x9b,0x02,0xcd,0x16,0xf4,0x4c);
  1002. __CRT_UUID_DECL(ID2D1Device, 0x47dd575d,0xac05,0x4cdd,0x80,0x49,0x9b,0x02,0xcd,0x16,0xf4,0x4c);
  1003. #ifndef D2D_USE_C_DEFINITIONS
  1004. interface ID2D1DrawingStateBlock1 : public ID2D1DrawingStateBlock
  1005. {
  1006. STDMETHOD_(void, GetDescription)(D2D1_DRAWING_STATE_DESCRIPTION1 *stateDescription) CONST PURE;
  1007. using ID2D1DrawingStateBlock::GetDescription;
  1008. STDMETHOD_(void, SetDescription)(CONST D2D1_DRAWING_STATE_DESCRIPTION1 *stateDescription) PURE;
  1009. using ID2D1DrawingStateBlock::SetDescription;
  1010. };
  1011. #else
  1012. typedef interface ID2D1DrawingStateBlock1 ID2D1DrawingStateBlock1;
  1013. /* FIXME: Add full C declaration */
  1014. #endif
  1015. DEFINE_GUID(IID_ID2D1DrawingStateBlock1, 0x689f1f85,0xc72e,0x4e33,0x8f,0x19,0x85,0x75,0x4e,0xfd,0x5a,0xce);
  1016. __CRT_UUID_DECL(ID2D1DrawingStateBlock1, 0x689f1f85,0xc72e,0x4e33,0x8f,0x19,0x85,0x75,0x4e,0xfd,0x5a,0xce);
  1017. #ifndef D2D_USE_C_DEFINITIONS
  1018. interface ID2D1PathGeometry1 : public ID2D1PathGeometry
  1019. {
  1020. STDMETHOD(ComputePointAndSegmentAtLength)(FLOAT length, UINT32 startSegment, CONST D2D1_MATRIX_3X2_F *worldTransform,
  1021. FLOAT flatteningTolerance, D2D1_POINT_DESCRIPTION *pointDescription) CONST PURE;
  1022. HRESULT ComputePointAndSegmentAtLength(FLOAT length, UINT32 startSegment, CONST D2D1_MATRIX_3X2_F &worldTransform,
  1023. FLOAT flatteningTolerance, D2D1_POINT_DESCRIPTION *pointDescription) CONST {
  1024. return ComputePointAndSegmentAtLength(length, startSegment, &worldTransform, flatteningTolerance, pointDescription);
  1025. }
  1026. HRESULT ComputePointAndSegmentAtLength(FLOAT length, UINT32 startSegment, CONST D2D1_MATRIX_3X2_F *worldTransform,
  1027. D2D1_POINT_DESCRIPTION *pointDescription) CONST {
  1028. return ComputePointAndSegmentAtLength(length, startSegment, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE,
  1029. pointDescription);
  1030. }
  1031. HRESULT ComputePointAndSegmentAtLength(FLOAT length, UINT32 startSegment, CONST D2D1_MATRIX_3X2_F &worldTransform,
  1032. D2D1_POINT_DESCRIPTION *pointDescription) CONST {
  1033. return ComputePointAndSegmentAtLength(length, startSegment, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE,
  1034. pointDescription);
  1035. }
  1036. };
  1037. #else
  1038. typedef interface ID2D1PathGeometry1 ID2D1PathGeometry1;
  1039. /* FIXME: Add full C declaration */
  1040. #endif
  1041. DEFINE_GUID(IID_ID2D1PathGeometry1, 0x62baa2d2,0xab54,0x41b7,0xb8,0x72,0x78,0x7e,0x01,0x06,0xa4,0x21);
  1042. __CRT_UUID_DECL(ID2D1PathGeometry1, 0x62baa2d2,0xab54,0x41b7,0xb8,0x72,0x78,0x7e,0x01,0x06,0xa4,0x21);
  1043. #ifndef D2D_USE_C_DEFINITIONS
  1044. interface ID2D1Factory1 : public ID2D1Factory
  1045. {
  1046. STDMETHOD(CreateDevice)(IDXGIDevice *dxgiDevice, ID2D1Device **d2dDevice) PURE;
  1047. STDMETHOD(CreateStrokeStyle)(CONST D2D1_STROKE_STYLE_PROPERTIES1 *strokeStyleProperties,
  1048. CONST FLOAT *dashes, UINT32 dashesCount, ID2D1StrokeStyle1 **strokeStyle) PURE;
  1049. using ID2D1Factory::CreateStrokeStyle;
  1050. STDMETHOD(CreatePathGeometry)(ID2D1PathGeometry1 **pathGeometry) PURE;
  1051. using ID2D1Factory::CreatePathGeometry;
  1052. STDMETHOD(CreateDrawingStateBlock)(CONST D2D1_DRAWING_STATE_DESCRIPTION1 *drawingStateDescription,
  1053. IDWriteRenderingParams *textRenderingParams, ID2D1DrawingStateBlock1 **drawingStateBlock) PURE;
  1054. using ID2D1Factory::CreateDrawingStateBlock;
  1055. STDMETHOD(CreateGdiMetafile)(IStream *metafileStream, ID2D1GdiMetafile **metafile) PURE;
  1056. STDMETHOD(RegisterEffectFromStream)(REFCLSID classId, IStream *propertyXml, CONST D2D1_PROPERTY_BINDING *bindings,
  1057. UINT32 bindingsCount, CONST PD2D1_EFFECT_FACTORY effectFactory) PURE;
  1058. STDMETHOD(RegisterEffectFromString)(REFCLSID classId, PCWSTR propertyXml, CONST D2D1_PROPERTY_BINDING *bindings,
  1059. UINT32 bindingsCount, CONST PD2D1_EFFECT_FACTORY effectFactory) PURE;
  1060. STDMETHOD(UnregisterEffect)(REFCLSID classId) PURE;
  1061. STDMETHOD(GetRegisteredEffects)(CLSID *effects, UINT32 effectsCount, UINT32 *effectsReturned,
  1062. UINT32 *effectsRegistered) CONST PURE;
  1063. STDMETHOD(GetEffectProperties)(REFCLSID effectId, ID2D1Properties **properties) CONST PURE;
  1064. HRESULT CreateStrokeStyle(CONST D2D1_STROKE_STYLE_PROPERTIES1 &strokeStyleProperties, CONST FLOAT *dashes,
  1065. UINT32 dashesCount, ID2D1StrokeStyle1 **strokeStyle) {
  1066. return CreateStrokeStyle(&strokeStyleProperties, dashes, dashesCount, strokeStyle);
  1067. }
  1068. HRESULT CreateDrawingStateBlock(CONST D2D1_DRAWING_STATE_DESCRIPTION1 &drawingStateDescription,
  1069. ID2D1DrawingStateBlock1 **drawingStateBlock) {
  1070. return CreateDrawingStateBlock(&drawingStateDescription, NULL, drawingStateBlock);
  1071. }
  1072. HRESULT CreateDrawingStateBlock(ID2D1DrawingStateBlock1 **drawingStateBlock) {
  1073. return CreateDrawingStateBlock(NULL, NULL, drawingStateBlock);
  1074. }
  1075. };
  1076. #else
  1077. typedef interface ID2D1Factory1 ID2D1Factory1;
  1078. typedef struct ID2D1Factory1Vtbl {
  1079. ID2D1FactoryVtbl Base;
  1080. STDMETHOD(CreateDevice)(ID2D1Factory1 *This, IDXGIDevice *dxgiDevice,
  1081. ID2D1Device **d2dDevice) PURE;
  1082. STDMETHOD(CreateStrokeStyle)(ID2D1Factory1 *This,
  1083. CONST D2D1_STROKE_STYLE_PROPERTIES1 *strokeStyleProperties,
  1084. CONST FLOAT *dashes, UINT32 dashesCount,
  1085. ID2D1StrokeStyle1 **strokeStyle) PURE;
  1086. STDMETHOD(CreatePathGeometry)(ID2D1Factory1 *This,
  1087. ID2D1PathGeometry1 **pathGeometry) PURE;
  1088. STDMETHOD(CreateDrawingStateBlock)(ID2D1Factory1 *This,
  1089. CONST D2D1_DRAWING_STATE_DESCRIPTION1 *drawingStateDescription,
  1090. IDWriteRenderingParams *textRenderingParams,
  1091. ID2D1DrawingStateBlock1 **drawingStateBlock) PURE;
  1092. STDMETHOD(CreateGdiMetafile)(ID2D1Factory1 *This, IStream *metafileStream,
  1093. ID2D1GdiMetafile **metafile) PURE;
  1094. STDMETHOD(RegisterEffectFromStream)(ID2D1Factory1 *This, REFCLSID classId,
  1095. IStream *propertyXml, CONST D2D1_PROPERTY_BINDING *bindings,
  1096. UINT32 bindingsCount,
  1097. CONST PD2D1_EFFECT_FACTORY effectFactory) PURE;
  1098. STDMETHOD(RegisterEffectFromString)(ID2D1Factory1 *This,
  1099. REFCLSID classId, PCWSTR propertyXml,
  1100. CONST D2D1_PROPERTY_BINDING *bindings, UINT32 bindingsCount,
  1101. CONST PD2D1_EFFECT_FACTORY effectFactory) PURE;
  1102. STDMETHOD(UnregisterEffect)(ID2D1Factory1 *This, REFCLSID classId) PURE;
  1103. STDMETHOD(GetRegisteredEffects)(ID2D1Factory1 *This, CLSID *effects,
  1104. UINT32 effectsCount, UINT32 *effectsReturned,
  1105. UINT32 *effectsRegistered) PURE;
  1106. STDMETHOD(GetEffectProperties)(ID2D1Factory1 *This, REFCLSID effectId,
  1107. ID2D1Properties **properties) PURE;
  1108. } ID2D1Factory1Vtbl;
  1109. interface ID2D1Factory1 {
  1110. const ID2D1Factory1Vtbl *lpVtbl;
  1111. };
  1112. #define ID2D1Factory1_QueryInterface(this,A,B) (this)->lpVtbl->Base.Base.QueryInterface((IUnknown *)(this),A,B)
  1113. #define ID2D1Factory1_AddRef(this) (this)->lpVtbl->Base.Base.AddRef((IUnknown *)(this))
  1114. #define ID2D1Factory1_Release(this) (this)->lpVtbl->Base.Base.Release((IUnknown *)(this))
  1115. #define ID2D1Factory1_CreateDevice(this,A,B) (this)->lpVtbl->CreateDevice(this,A,B)
  1116. #define ID2D1Factory1_CreateStrokeStyle(this,A,B,C,D) (this)->lpVtbl->CreateStrokeStyle(this,A,B,C,D)
  1117. #define ID2D1Factory1_CreatePathGeometry(this,A) (this)->lpVbtl->CreatePathGeometry(this,A)
  1118. #define ID2D1Factory1_CreateDrawingStateBlock(this,A,B, C) (this)->lpVtbl->CreateDrawingStateBlock(this,A,B,C)
  1119. #define ID2D1Factory1_CreateGdiMetafile(this,A,B) (this)->lpVtbl->CreateGdiMetafile(this,A,B)
  1120. #define ID2D1Factory1_RegisterEffectFromStream(this,A,B,C,D,E) (this)->lpVtbl->RegisterEffectFromStream(this,A,B,C,D,E)
  1121. #define ID2D1Factory1_RegisterEffectFromString(this,A,B,C,D,E) (this)->lpVtbl->RegisterEffectFromString(this,A,B,C,D,E)
  1122. #define ID2D1Factory1_UnregisterEffect(this,A) (this)->lpVtbl->UnregisterEffect(this,A)
  1123. #define ID2D1Factory1_GetRegisteredEffects(this,A,B,C,D) (this)->lpVtbl->GetRegisteredEffects(this,A,B,C,D)
  1124. #define ID2D1Factory1_GetEffectProperties(this,A,B) (this)->lpVtbl->GetEffectProperties(this,A,B)
  1125. #endif
  1126. DEFINE_GUID(IID_ID2D1Factory1, 0xbb12d362,0xdaee,0x4b9a,0xaa,0x1d,0x14,0xba,0x40,0x1c,0xfa,0x1f);
  1127. __CRT_UUID_DECL(ID2D1Factory1, 0xbb12d362,0xdaee,0x4b9a,0xaa,0x1d,0x14,0xba,0x40,0x1c,0xfa,0x1f);
  1128. #ifndef D2D_USE_C_DEFINITIONS
  1129. interface ID2D1Multithread : public IUnknown
  1130. {
  1131. STDMETHOD_(BOOL, GetMultithreadProtected)() CONST PURE;
  1132. STDMETHOD_(void, Enter)() PURE;
  1133. STDMETHOD_(void, Leave)() PURE;
  1134. };
  1135. #else
  1136. typedef interface ID2D1Multithread ID2D1Multithread;
  1137. typedef struct ID2D1MultithreadVtbl {
  1138. IUnknownVtbl Base;
  1139. STDMETHOD_(BOOL, GetMultithreadProtected)(ID2D1Multithread *This) PURE;
  1140. STDMETHOD_(void, Enter)(ID2D1Multithread *This) PURE;
  1141. STDMETHOD_(void, Leave)(ID2D1Multithread *This) PURE;
  1142. } ID2D1MultithreadVtbl;
  1143. interface ID2D1Multithread {
  1144. ID2D1MultithreadVtbl *lpVtbl;
  1145. };
  1146. #define ID2D1Multithread_QueryInterface(this,A,B) (this)->lpVtbl->Base.QueryInterface((IUnknown *)(this),A,B)
  1147. #define ID2D1Multithread_AddRef(this) (this)->lpVtbl->Base.AddRef((IUnknown *)(this))
  1148. #define ID2D1Multithread_Release(this) (this)->lpVtbl->Base.Release((IUnknown *)(this))
  1149. #define ID2D1Mutlithread_GetMultithreadProtected(this) (this)->lpVtbl->GetMultihreadProtected(this)
  1150. #define ID2D1Multithread_Enter(this) (this)->lpVtbl->Enter(this)
  1151. #define ID2D1Multithread_Leave(this) (this)->lpVtbl->Leave(this)
  1152. #endif
  1153. DEFINE_GUID(IID_ID2D1Multithread, 0x31e6e7bc,0xe0ff,0x4d46,0x8c,0x64,0xa0,0xa8,0xc4,0x1c,0x15,0xd3);
  1154. __CRT_UUID_DECL(ID2D1Multithread, 0x31e6e7bc,0xe0ff,0x4d46,0x8c,0x64,0xa0,0xa8,0xc4,0x1c,0x15,0xd3);
  1155. #include <d2d1_1helper.h>
  1156. #endif