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 
7 #ifndef _D2D1_1_H_
8 #define _D2D1_1_H_
9 
10 #include <d2d1.h>
11 #include <d2d1effects.h>
12 #include <dxgi.h>
13 
14 #include <winapifamily.h>
15 
16 #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
17 
18 typedef interface ID2D1ColorContext ID2D1ColorContext;
19 typedef interface IWICColorContext IWICColorContext;
20 typedef interface IWICImagingFactory IWICImagingFactory;
21 typedef interface IPrintDocumentPackageTarget IPrintDocumentPackageTarget;
22 typedef interface IDWriteFactory IDWriteFactory;
23 
24 typedef struct D2D1_PROPERTY_BINDING D2D1_PROPERTY_BINDING;
25 
26 #ifndef D2D_USE_C_DEFINITIONS
27 interface ID2D1Device;
28 interface ID2D1Effect;
29 #else
30 typedef interface ID2D1Device ID2D1Device;
31 typedef interface ID2D1Effect ID2D1Effect;
32 #endif
33 
34 typedef struct DWRITE_GLYPH_RUN_DESCRIPTION DWRITE_GLYPH_RUN_DESCRIPTION;
35 
36 typedef HRESULT (CALLBACK *PD2D1_EFFECT_FACTORY)(IUnknown**);
37 
38 typedef D2D_RECT_L D2D1_RECT_L;
39 
40 typedef enum D2D1_PROPERTY_TYPE {
41     D2D1_PROPERTY_TYPE_UNKNOWN       = 0,
42     D2D1_PROPERTY_TYPE_STRING        = 1,
43     D2D1_PROPERTY_TYPE_BOOL          = 2,
44     D2D1_PROPERTY_TYPE_UINT32        = 3,
45     D2D1_PROPERTY_TYPE_INT32         = 4,
46     D2D1_PROPERTY_TYPE_FLOAT         = 5,
47     D2D1_PROPERTY_TYPE_VECTOR2       = 6,
48     D2D1_PROPERTY_TYPE_VECTOR3       = 7,
49     D2D1_PROPERTY_TYPE_VECTOR4       = 8,
50     D2D1_PROPERTY_TYPE_BLOB          = 9,
51     D2D1_PROPERTY_TYPE_IUNKNOWN      = 10,
52     D2D1_PROPERTY_TYPE_ENUM          = 11,
53     D2D1_PROPERTY_TYPE_ARRAY         = 12,
54     D2D1_PROPERTY_TYPE_CLSID         = 13,
55     D2D1_PROPERTY_TYPE_MATRIX_3X2    = 14,
56     D2D1_PROPERTY_TYPE_MATRIX_4X3    = 15,
57     D2D1_PROPERTY_TYPE_MATRIX_4X4    = 16,
58     D2D1_PROPERTY_TYPE_MATRIX_5X4    = 17,
59     D2D1_PROPERTY_TYPE_COLOR_CONTEXT = 18,
60     D2D1_PROPERTY_TYPE_FORCE_DWORD   = 0xffffffff
61 } D2D1_PROPERTY_TYPE;
62 
63 typedef enum D2D1_CHANNEL_DEPTH {
64     D2D1_CHANNEL_DEPTH_DEFAULT = 0,
65     D2D1_CHANNEL_DEPTH_1       = 1,
66     D2D1_CHANNEL_DEPTH_4       = 4,
67     D2D1_CHANNEL_DEPTH_FORCE_DWORD = 0xffffffff
68 } D2D1_CHANNEL_DEPTH;
69 
70 typedef enum D2D1_BUFFER_PRECISION {
71     D2D1_BUFFER_PRECISION_UNKNOWN         = 0,
72     D2D1_BUFFER_PRECISION_8BPC_UNORM      = 1,
73     D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB = 2,
74     D2D1_BUFFER_PRECISION_16BPC_UNORM     = 3,
75     D2D1_BUFFER_PRECISION_16BPC_FLOAT     = 4,
76     D2D1_BUFFER_PRECISION_32BPC_FLOAT     = 5,
77     D2D1_BUFFER_PRECISION_FORCE_DWORD     = 0xffffffff
78 } D2D1_BUFFER_PRECISION;
79 
80 typedef enum D2D1_COLOR_SPACE {
81     D2D1_COLOR_SPACE_CUSTOM = 0,
82     D2D1_COLOR_SPACE_SRGB   = 1,
83     D2D1_COLOR_SPACE_SCRGB  = 2,
84     D2D1_COLOR_SPACE_FORCE_DWORD = 0xffffffff
85 } D2D1_COLOR_SPACE;
86 
87 typedef enum D2D1_DEVICE_CONTEXT_OPTIONS {
88     D2D1_DEVICE_CONTEXT_OPTIONS_NONE                               = 0,
89     D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS = 1,
90     D2D1_DEVICE_CONTEXT_OPTIONS_FORCE_DWORD = 0xffffffff
91 } D2D1_DEVICE_CONTEXT_OPTIONS;
92 
93 DEFINE_ENUM_FLAG_OPERATORS(D2D1_DEVICE_CONTEXT_OPTIONS);
94 
95 typedef enum D2D1_BITMAP_OPTIONS {
96     D2D1_BITMAP_OPTIONS_NONE           = 0x00000000,
97     D2D1_BITMAP_OPTIONS_TARGET         = 0x00000001,
98     D2D1_BITMAP_OPTIONS_CANNOT_DRAW    = 0x00000002,
99     D2D1_BITMAP_OPTIONS_CPU_READ       = 0x00000004,
100     D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE = 0x00000008,
101     D2D1_BITMAP_OPTIONS_FORCE_DWORD = 0xffffffff
102 } D2D1_BITMAP_OPTIONS;
103 
104 DEFINE_ENUM_FLAG_OPERATORS(D2D1_BITMAP_OPTIONS);
105 
106 typedef enum D2D1_MAP_OPTIONS {
107     D2D1_MAP_OPTIONS_NONE    = 0,
108     D2D1_MAP_OPTIONS_READ    = 1,
109     D2D1_MAP_OPTIONS_WRITE   = 2,
110     D2D1_MAP_OPTIONS_DISCARD = 4,
111     D2D1_MAP_OPTIONS_FORCE_DWORD = 0xffffffff
112 } D2D1_MAP_OPTIONS;
113 
114 DEFINE_ENUM_FLAG_OPERATORS(D2D1_MAP_OPTIONS);
115 
116 typedef enum D2D1_COLOR_INTERPOLATION_MODE {
117     D2D1_COLOR_INTERPOLATION_MODE_STRAIGHT      = 0,
118     D2D1_COLOR_INTERPOLATION_MODE_PREMULTIPLIED = 1,
119     D2D1_COLOR_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
120 } D2D1_COLOR_INTERPOLATION_MODE;
121 
122 typedef enum D2D1_INTERPOLATION_MODE {
123     D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR    = D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR,
124     D2D1_INTERPOLATION_MODE_LINEAR              = D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR,
125     D2D1_INTERPOLATION_MODE_CUBIC               = D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC,
126     D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR,
127     D2D1_INTERPOLATION_MODE_ANISOTROPIC         = D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC,
128     D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC  = D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC,
129     D2D1_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff
130 } D2D1_INTERPOLATION_MODE;
131 
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 
149 typedef enum D2D1_PRIMITIVE_BLEND {
150     D2D1_PRIMITIVE_BLEND_SOURCE_OVER = 0,
151     D2D1_PRIMITIVE_BLEND_COPY        = 1,
152     D2D1_PRIMITIVE_BLEND_MIN         = 2,
153     D2D1_PRIMITIVE_BLEND_ADD         = 3,
154     D2D1_PRIMITIVE_BLEND_FORCE_DWORD = 0xffffffff
155 } D2D1_PRIMITIVE_BLEND;
156 
157 typedef enum D2D1_UNIT_MODE {
158     D2D1_UNIT_MODE_DIPS   = 0,
159     D2D1_UNIT_MODE_PIXELS = 1,
160     D2D1_UNIT_MODE_FORCE_DWORD = 0xffffffff
161 } D2D1_UNIT_MODE;
162 
163 typedef enum D2D1_LAYER_OPTIONS1 {
164     D2D1_LAYER_OPTIONS1_NONE                       = 0,
165     D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND = 1,
166     D2D1_LAYER_OPTIONS1_IGNORE_ALPHA               = 2,
167     D2D1_LAYER_OPTIONS1_FORCE_DWORD = 0xffffffff
168 } D2D1_LAYER_OPTIONS1;
169 
170 DEFINE_ENUM_FLAG_OPERATORS(D2D1_LAYER_OPTIONS1);
171 
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 
179 typedef enum D2D1_STROKE_TRANSFORM_TYPE {
180     D2D1_STROKE_TRANSFORM_TYPE_NORMAL   = 0,
181     D2D1_STROKE_TRANSFORM_TYPE_FIXED    = 1,
182     D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE = 2,
183     D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD = 0xffffffff
184 } D2D1_STROKE_TRANSFORM_TYPE;
185 
186 typedef struct D2D1_BITMAP_PROPERTIES1 {
187     D2D1_PIXEL_FORMAT pixelFormat;
188     FLOAT dpiX;
189     FLOAT dpiY;
190     D2D1_BITMAP_OPTIONS bitmapOptions;
191     ID2D1ColorContext *colorContext;
192 } D2D1_BITMAP_PROPERTIES1;
193 
194 typedef struct D2D1_MAPPED_RECT {
195     UINT32 pitch;
196     BYTE *bits;
197 } D2D1_MAPPED_RECT;
198 
199 typedef struct D2D1_IMAGE_BRUSH_PROPERTIES {
200     D2D1_RECT_F sourceRectangle;
201     D2D1_EXTEND_MODE extendModeX;
202     D2D1_EXTEND_MODE extendModeY;
203     D2D1_INTERPOLATION_MODE interpolationMode;
204 } D2D1_IMAGE_BRUSH_PROPERTIES;
205 
206 typedef struct D2D1_BITMAP_BRUSH_PROPERTIES1 {
207     D2D1_EXTEND_MODE extendModeX;
208     D2D1_EXTEND_MODE extendModeY;
209     D2D1_INTERPOLATION_MODE interpolationMode;
210 } D2D1_BITMAP_BRUSH_PROPERTIES1;
211 
212 typedef D2D_MATRIX_4X3_F D2D1_MATRIX_4X3_F;
213 typedef D2D_MATRIX_4X4_F D2D1_MATRIX_4X4_F;
214 typedef D2D_MATRIX_5X4_F D2D1_MATRIX_5X4_F;
215 typedef D2D_VECTOR_2F D2D1_VECTOR_2F;
216 typedef D2D_VECTOR_3F D2D1_VECTOR_3F;
217 typedef D2D_VECTOR_4F D2D1_VECTOR_4F;
218 
219 typedef struct D2D1_LAYER_PARAMETERS1 {
220     D2D1_RECT_F contentBounds;
221     ID2D1Geometry *geometricMask;
222     D2D1_ANTIALIAS_MODE maskAntialiasMode;
223     D2D1_MATRIX_3X2_F maskTransform;
224     FLOAT opacity;
225     ID2D1Brush *opacityBrush;
226     D2D1_LAYER_OPTIONS1 layerOptions;
227 } D2D1_LAYER_PARAMETERS1;
228 
229 typedef struct D2D1_RENDERING_CONTROLS {
230     D2D1_BUFFER_PRECISION bufferPrecision;
231     D2D1_SIZE_U tileSize;
232 } D2D1_RENDERING_CONTROLS;
233 
234 typedef struct D2D1_EFFECT_INPUT_DESCRIPTION {
235     ID2D1Effect *effect;
236     UINT32 inputIndex;
237     D2D1_RECT_F inputRectangle;
238 } D2D1_EFFECT_INPUT_DESCRIPTION;
239 
240 typedef struct D2D1_PRINT_CONTROL_PROPERTIES {
241     D2D1_PRINT_FONT_SUBSET_MODE fontSubset;
242     FLOAT rasterDPI;
243     D2D1_COLOR_SPACE colorSpace;
244 } D2D1_PRINT_CONTROL_PROPERTIES;
245 
246 typedef struct D2D1_STROKE_STYLE_PROPERTIES1 {
247     D2D1_CAP_STYLE startCap;
248     D2D1_CAP_STYLE endCap;
249     D2D1_CAP_STYLE dashCap;
250     D2D1_LINE_JOIN lineJoin;
251     FLOAT miterLimit;
252     D2D1_DASH_STYLE dashStyle;
253     FLOAT dashOffset;
254     D2D1_STROKE_TRANSFORM_TYPE transformType;
255 } D2D1_STROKE_STYLE_PROPERTIES1;
256 
257 typedef struct D2D1_DRAWING_STATE_DESCRIPTION1 {
258     D2D1_ANTIALIAS_MODE antialiasMode;
259     D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode;
260     D2D1_TAG tag1;
261     D2D1_TAG tag2;
262     D2D1_MATRIX_3X2_F transform;
263     D2D1_PRIMITIVE_BLEND primitiveBlend;
264     D2D1_UNIT_MODE unitMode;
265 } D2D1_DRAWING_STATE_DESCRIPTION1;
266 
267 typedef struct D2D1_POINT_DESCRIPTION {
268     D2D1_POINT_2F point;
269     D2D1_POINT_2F unitTangentVector;
270     UINT32 endSegment;
271     UINT32 endFigure;
272     FLOAT lengthToEndSegment;
273 } D2D1_POINT_DESCRIPTION;
274 
275 #ifndef D2D_USE_C_DEFINITIONS
276 
277 interface ID2D1Properties : public IUnknown
278 {
279     STDMETHOD_(UINT32, GetPropertyCount)() CONST PURE;
280     STDMETHOD(GetPropertyName)(UINT32 index, PWSTR name, UINT32 nameCount) CONST PURE;
281     STDMETHOD_(UINT32, GetPropertyNameLength)(UINT32 index) CONST PURE;
282     STDMETHOD_(D2D1_PROPERTY_TYPE, GetType)(UINT32 index) CONST PURE;
283     STDMETHOD_(UINT32, GetPropertyIndex)(PCWSTR name) CONST PURE;
284     STDMETHOD(SetValueByName)(PCWSTR name, D2D1_PROPERTY_TYPE type, CONST BYTE *data, UINT32 dataSize) PURE;
285     STDMETHOD(SetValue)(UINT32 index, D2D1_PROPERTY_TYPE type, CONST BYTE *data, UINT32 dataSize) PURE;
286     STDMETHOD(GetValueByName)(PCWSTR name, D2D1_PROPERTY_TYPE type, BYTE *data, UINT32 dataSize) CONST PURE;
287     STDMETHOD(GetValue)(UINT32 index, D2D1_PROPERTY_TYPE type, BYTE *data, UINT32 dataSize) CONST PURE;
288     STDMETHOD_(UINT32, GetValueSize)(UINT32 index) CONST PURE;
289     STDMETHOD(GetSubProperties)(UINT32 index, ID2D1Properties **subProperties) CONST PURE;
290 
SetValueByName(PCWSTR name,CONST BYTE * data,UINT32 dataSize)291     HRESULT SetValueByName(PCWSTR name, CONST BYTE *data, UINT32 dataSize) {
292         return SetValueByName(name, D2D1_PROPERTY_TYPE_UNKNOWN, data, dataSize);
293     }
294 
SetValue(UINT32 index,CONST BYTE * data,UINT32 dataSize)295     HRESULT SetValue(UINT32 index, CONST BYTE *data, UINT32 dataSize) {
296         return SetValue(index, D2D1_PROPERTY_TYPE_UNKNOWN, data, dataSize);
297     }
298 
GetValueByName(PCWSTR name,BYTE * data,UINT32 dataSize)299     HRESULT GetValueByName(PCWSTR name, BYTE *data, UINT32 dataSize) CONST {
300         return GetValueByName(name, D2D1_PROPERTY_TYPE_UNKNOWN, data, dataSize);
301     }
302 
GetValue(UINT32 index,BYTE * data,UINT32 dataSize)303     HRESULT GetValue(UINT32 index, BYTE *data, UINT32 dataSize) CONST {
304         return GetValue(index, D2D1_PROPERTY_TYPE_UNKNOWN, data, dataSize);
305     }
306 
307     template<typename T>
GetValueByName(PCWSTR propertyName,T * value)308     HRESULT GetValueByName(PCWSTR propertyName, T *value) const {
309         return GetValueByName(propertyName, reinterpret_cast<BYTE*>(value), sizeof(*value));
310     }
311 
312     template<typename T>
GetValueByName(PCWSTR propertyName)313     T GetValueByName(PCWSTR propertyName) const {
314         T ret;
315         GetValueByName(propertyName, reinterpret_cast<BYTE*>(&ret), sizeof(ret));
316         return ret;
317     }
318 
319     template<typename T>
SetValueByName(PCWSTR propertyName,const T & value)320     HRESULT SetValueByName(PCWSTR propertyName, const T &value) {
321         return SetValueByName(propertyName, reinterpret_cast<const BYTE*>(&value), sizeof(value));
322     }
323 
324     template<typename T>
GetValue(T index,BYTE * data,UINT32 dataSize)325     HRESULT GetValue(T index, BYTE *data, UINT32 dataSize) CONST {
326         return GetValue(static_cast<UINT32>(index), data, dataSize);
327     }
328 
329     template<typename T, typename U>
GetValue(U index,T * value)330     HRESULT GetValue(U index, T *value) const {
331         return GetValue(static_cast<UINT32>(index), reinterpret_cast<BYTE*>(value), sizeof(*value));
332     }
333 
334     template<typename T, typename U>
GetValue(U index)335     T GetValue(U index) const {
336         T ret;
337         GetValue(static_cast<UINT32>(index), reinterpret_cast<BYTE*>(&ret), sizeof(ret));
338         return ret;
339     }
340 
341     template<typename T>
SetValue(T index,CONST BYTE * data,UINT32 dataSize)342     HRESULT SetValue(T index, CONST BYTE *data, UINT32 dataSize) {
343         return SetValue(static_cast<UINT32>(index), data, dataSize);
344     }
345 
346     template<typename T, typename U>
SetValue(U index,const T & value)347     HRESULT SetValue(U index, const T &value) {
348         return SetValue(static_cast<UINT32>(index), reinterpret_cast<const BYTE*>(&value), sizeof(value));
349     }
350 
351     template<typename T>
GetPropertyName(T index,PWSTR name,UINT32 nameCount)352     HRESULT GetPropertyName(T index, PWSTR name, UINT32 nameCount) CONST {
353         return GetPropertyName(static_cast<UINT32>(index), name, nameCount);
354     }
355 
356     template<typename T>
GetPropertyNameLength(T index)357     UINT32 GetPropertyNameLength(T index) CONST {
358         return GetPropertyNameLength(static_cast<UINT32>(index));
359     }
360 
361     template<typename T>
GetType(T index)362     D2D1_PROPERTY_TYPE GetType(T index) CONST {
363         return GetType(static_cast<UINT32>(index));
364     }
365 
366     template<typename T>
GetValueSize(T index)367     UINT32 GetValueSize(T index) CONST {
368         return GetValueSize(static_cast<UINT32>(index));
369     }
370 
371     template<typename T>
GetSubProperties(T index,ID2D1Properties ** subProperties)372     HRESULT GetSubProperties(T index, ID2D1Properties **subProperties) CONST {
373         return GetSubProperties(static_cast<UINT32>(index), subProperties);
374     }
375 };
376 
377 #else
378 
379 typedef interface ID2D1Properties ID2D1Properties;
380 /* FIXME: Add full C declaration */
381 
382 #endif
383 
384 DEFINE_GUID(IID_ID2D1Properties,0x483473d7,0xcd46,0x4f9d,0x9d,0x3a,0x31,0x12,0xaa,0x80,0x15,0x9d);
385 __CRT_UUID_DECL(ID2D1Properties,0x483473d7,0xcd46,0x4f9d,0x9d,0x3a,0x31,0x12,0xaa,0x80,0x15,0x9d);
386 
387 #ifndef D2D_USE_C_DEFINITIONS
388 
389 interface ID2D1GdiMetafileSink : public IUnknown
390 {
391     STDMETHOD(ProcessRecord)(DWORD recordType, CONST void *recordData, DWORD recordDataSize) PURE;
392 };
393 
394 #else
395 
396 typedef interface ID2D1GdiMetafileSink ID2D1GdiMetafileSink;
397 /* FIXME: Add full C declaration */
398 
399 #endif
400 
401 DEFINE_GUID(IID_ID2D1GdiMetafileSink, 0x82237326,0x8111,0x4f7c,0xbc,0xf4,0xb5,0xc1,0x17,0x55,0x64,0xfe);
402 __CRT_UUID_DECL(ID2D1GdiMetafileSink, 0x82237326,0x8111,0x4f7c,0xbc,0xf4,0xb5,0xc1,0x17,0x55,0x64,0xfe);
403 
404 #ifndef D2D_USE_C_DEFINITIONS
405 
406 interface ID2D1GdiMetafile : public ID2D1Resource
407 {
408     STDMETHOD(Stream)(ID2D1GdiMetafileSink *sink) PURE;
409     STDMETHOD(GetBounds)(D2D1_RECT_F *bounds) PURE;
410 };
411 
412 #else
413 
414 typedef interface ID2D1GdiMetafile ID2D1GdiMetafile;
415 /* FIXME: Add full C declaration */
416 
417 #endif
418 
419 DEFINE_GUID(IID_ID2D1GdiMetafile, 0x2f543dc3,0xcfc1,0x4211,0x86,0x4f,0xcf,0xd9,0x1c,0x6f,0x33,0x95);
420 __CRT_UUID_DECL(ID2D1GdiMetafile, 0x2f543dc3,0xcfc1,0x4211,0x86,0x4f,0xcf,0xd9,0x1c,0x6f,0x33,0x95);
421 
422 #ifndef D2D_USE_C_DEFINITIONS
423 
424 interface ID2D1StrokeStyle1 : public ID2D1StrokeStyle
425 {
426     STDMETHOD_(D2D1_STROKE_TRANSFORM_TYPE, GetStrokeTransformType)() CONST PURE;
427 };
428 
429 #else
430 
431 typedef interface ID2D1StrokeStyle1 ID2D1StrokeStyle1;
432 /* FIXME: Add full C declaration */
433 
434 #endif
435 
436 DEFINE_GUID(IID_ID2D1StrokeStyle1, 0x10a72a66,0xe91c,0x43f4,0x99,0x3f,0xdd,0xf4,0xb8,0x2b,0x0b,0x4a);
437 __CRT_UUID_DECL(ID2D1StrokeStyle1, 0x10a72a66,0xe91c,0x43f4,0x99,0x3f,0xdd,0xf4,0xb8,0x2b,0x0b,0x4a);
438 
439 #ifndef D2D_USE_C_DEFINITIONS
440 
441 interface ID2D1CommandSink : public IUnknown
442 {
443     STDMETHOD(BeginDraw)() PURE;
444     STDMETHOD(EndDraw)() PURE;
445     STDMETHOD(SetAntialiasMode)(D2D1_ANTIALIAS_MODE antialiasMode) PURE;
446     STDMETHOD(SetTags)(D2D1_TAG tag1, D2D1_TAG tag2) PURE;
447     STDMETHOD(SetTextAntialiasMode)(D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode) PURE;
448     STDMETHOD(SetTextRenderingParams)(IDWriteRenderingParams *textRenderingParams) PURE;
449     STDMETHOD(SetTransform)(CONST D2D1_MATRIX_3X2_F *transform) PURE;
450     STDMETHOD(SetPrimitiveBlend)(D2D1_PRIMITIVE_BLEND primitiveBlend) PURE;
451     STDMETHOD(SetUnitMode)(D2D1_UNIT_MODE unitMode) PURE;
452     STDMETHOD(Clear)(CONST D2D1_COLOR_F *color) PURE;
453     STDMETHOD(DrawGlyphRun)(D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
454             CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription, ID2D1Brush *foregroundBrush,
455             DWRITE_MEASURING_MODE measuringMode) PURE;
456     STDMETHOD(DrawLine)(D2D1_POINT_2F point0, D2D1_POINT_2F point1, ID2D1Brush *brush, FLOAT strokeWidth,
457             ID2D1StrokeStyle *strokeStyle) PURE;
458     STDMETHOD(DrawGeometry)(ID2D1Geometry *geometry, ID2D1Brush *brush, FLOAT strokeWidth, ID2D1StrokeStyle *strokeStyle) PURE;
459     STDMETHOD(DrawRectangle)(CONST D2D1_RECT_F *rect, ID2D1Brush *brush, FLOAT strokeWidth, ID2D1StrokeStyle *strokeStyle) PURE;
460     STDMETHOD(DrawBitmap)(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F *destinationRectangle, FLOAT opacity,
461             D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F *sourceRectangle,
462             CONST D2D1_MATRIX_4X4_F *perspectiveTransform) PURE;
463     STDMETHOD(DrawImage)(ID2D1Image *image, CONST D2D1_POINT_2F *targetOffset, CONST D2D1_RECT_F *imageRectangle,
464             D2D1_INTERPOLATION_MODE interpolationMode, D2D1_COMPOSITE_MODE compositeMode) PURE;
465     STDMETHOD(DrawGdiMetafile)(ID2D1GdiMetafile *gdiMetafile, CONST D2D1_POINT_2F *targetOffset) PURE;
466     STDMETHOD(FillMesh)(ID2D1Mesh *mesh, ID2D1Brush *brush) PURE;
467     STDMETHOD(FillOpacityMask)(ID2D1Bitmap *opacityMask, ID2D1Brush *brush, CONST D2D1_RECT_F *destinationRectangle,
468             CONST D2D1_RECT_F *sourceRectangle) PURE;
469     STDMETHOD(FillGeometry)(ID2D1Geometry *geometry, ID2D1Brush *brush, ID2D1Brush *opacityBrush) PURE;
470     STDMETHOD(FillRectangle)(CONST D2D1_RECT_F *rect, ID2D1Brush *brush) PURE;
471     STDMETHOD(PushAxisAlignedClip)(CONST D2D1_RECT_F *clipRect, D2D1_ANTIALIAS_MODE antialiasMode) PURE;
472     STDMETHOD(PushLayer)(CONST D2D1_LAYER_PARAMETERS1 *layerParameters1, ID2D1Layer *layer) PURE;
473     STDMETHOD(PopAxisAlignedClip)() PURE;
474     STDMETHOD(PopLayer)() PURE;
475 };
476 
477 #else
478 
479 typedef interface ID2D1CommandSink ID2D1CommandSink;
480 
481 #endif
482 
483 DEFINE_GUID(IID_ID2D1CommandSink, 0x54d7898a,0xa061,0x40a7,0xbe,0xc7,0xe4,0x65,0xbc,0xba,0x2c,0x4f);
484 __CRT_UUID_DECL(ID2D1CommandSink, 0x54d7898a,0xa061,0x40a7,0xbe,0xc7,0xe4,0x65,0xbc,0xba,0x2c,0x4f);
485 
486 #ifndef D2D_USE_C_DEFINITIONS
487 
488 interface ID2D1CommandList : public ID2D1Image
489 {
490     STDMETHOD(Stream)(ID2D1CommandSink *sink) PURE;
491     STDMETHOD(Close)() PURE;
492 };
493 
494 #else
495 
496 typedef interface ID2D1CommandList ID2D1CommandList;
497 
498 #endif
499 
500 DEFINE_GUID(IID_ID2D1CommandList, 0xb4f34a19,0x2383,0x4d76,0x94,0xf6,0xec,0x34,0x36,0x57,0xc3,0xdc);
501 __CRT_UUID_DECL(ID2D1CommandList, 0xb4f34a19,0x2383,0x4d76,0x94,0xf6,0xec,0x34,0x36,0x57,0xc3,0xdc);
502 
503 #ifndef D2D_USE_C_DEFINITIONS
504 
505 interface ID2D1PrintControl : public IUnknown
506 {
507     STDMETHOD(AddPage)(ID2D1CommandList *commandList, D2D_SIZE_F pageSize, IStream *pagePrintTicketStream,
508             D2D1_TAG *tag1 = NULL, D2D1_TAG *tag2 = NULL) PURE;
509     STDMETHOD(Close)() PURE;
510 };
511 
512 #else
513 
514 typedef interface ID2D1PrintControl ID2D1PrintControl;
515 
516 #endif
517 
518 DEFINE_GUID(IID_ID2D1PrintControl, 0x2c1d867d,0xc290,0x41c8,0xae,0x7e,0x34,0xa9,0x87,0x02,0xe9,0xa5);
519 __CRT_UUID_DECL(ID2D1PrintControl, 0x2c1d867d,0xc290,0x41c8,0xae,0x7e,0x34,0xa9,0x87,0x02,0xe9,0xa5);
520 
521 #ifndef D2D_USE_C_DEFINITIONS
522 
523 interface ID2D1Effect : public ID2D1Properties
524 {
525     STDMETHOD_(void, SetInput)(UINT32 index, ID2D1Image *input, BOOL invalidate=TRUE) PURE;
526     STDMETHOD(SetInputCount)(UINT32 inputCount) PURE;
527     STDMETHOD_(void, GetInput)(UINT32 index, ID2D1Image **input) CONST PURE;
528     STDMETHOD_(UINT32, GetInputCount)() CONST PURE;
529     STDMETHOD_(void, GetOutput)(ID2D1Image **outputImage) CONST PURE;
530 
531     void SetInputEffect(UINT32 index, ID2D1Effect *inputEffect, BOOL invalidate=TRUE) {
532         ID2D1Image *output = NULL;
533         if(inputEffect)
534             inputEffect->GetOutput(&output);
535         SetInput(index, output, invalidate);
536         if(output)
537             output->Release();
538     }
539 };
540 
541 #else
542 
543 typedef interface ID2D1Effect ID2D1Effect;
544 /* FIXME: Add full C declaration */
545 
546 #endif
547 
548 DEFINE_GUID(IID_ID2D1Effect,0x28211a43,0x7d89,0x476f,0x81,0x81,0x2d,0x61,0x59,0xb2,0x20,0xad);
549 __CRT_UUID_DECL(ID2D1Effect,0x28211a43,0x7d89,0x476f,0x81,0x81,0x2d,0x61,0x59,0xb2,0x20,0xad);
550 
551 #endif
552 
553 #ifndef D2D_USE_C_DEFINITIONS
554 
555 interface ID2D1Bitmap1 : public ID2D1Bitmap
556 {
557     STDMETHOD_(void, GetColorContext)(ID2D1ColorContext **colorContext) CONST PURE;
558     STDMETHOD_(D2D1_BITMAP_OPTIONS, GetOptions)() CONST PURE;
559     STDMETHOD(GetSurface)(IDXGISurface **dxgiSurface) CONST PURE;
560     STDMETHOD(Map)(D2D1_MAP_OPTIONS options, D2D1_MAPPED_RECT *mappedRect) PURE;
561     STDMETHOD(Unmap)() PURE;
562 };
563 
564 #else
565 
566 typedef interface ID2D1Bitmap1 ID2D1Bitmap1;
567 /* FIXME: Add full C declaration */
568 
569 #endif
570 
571 DEFINE_GUID(IID_ID2D1Bitmap1, 0xa898a84c,0x3873,0x4588,0xb0,0x8b,0xeb,0xbf,0x97,0x8d,0xf0,0x41);
572 __CRT_UUID_DECL(ID2D1Bitmap1, 0xa898a84c,0x3873,0x4588,0xb0,0x8b,0xeb,0xbf,0x97,0x8d,0xf0,0x41);
573 
574 #ifndef D2D_USE_C_DEFINITIONS
575 
576 interface ID2D1ImageBrush : public ID2D1Brush
577 {
578     STDMETHOD_(void, SetImage)(ID2D1Image *image) PURE;
579     STDMETHOD_(void, SetExtendModeX)(D2D1_EXTEND_MODE extendModeX) PURE;
580     STDMETHOD_(void, SetExtendModeY)(D2D1_EXTEND_MODE extendModeY) PURE;
581     STDMETHOD_(void, SetInterpolationMode)(D2D1_INTERPOLATION_MODE interpolationMode) PURE;
582     STDMETHOD_(void, SetSourceRectangle)(CONST D2D1_RECT_F *sourceRectangle) PURE;
583     STDMETHOD_(void, GetImage)(ID2D1Image **image) CONST PURE;
584     STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeX)() CONST PURE;
585     STDMETHOD_(D2D1_EXTEND_MODE, GetExtendModeY)() CONST PURE;
586     STDMETHOD_(D2D1_INTERPOLATION_MODE, GetInterpolationMode)() CONST PURE;
587     STDMETHOD_(void, GetSourceRectangle)(D2D1_RECT_F *sourceRectangle) CONST PURE;
588 };
589 
590 #else
591 
592 typedef interface ID2D1ImageBrush ID2D1ImageBrush;
593 /* FIXME: Add full C declaration */
594 
595 #endif
596 
597 DEFINE_GUID(IID_ID2D1ImageBrush, 0xfe9e984d,0x3f95,0x407c,0xb5,0xdb,0xcb,0x94,0xd4,0xe8,0xf8,0x7c);
598 __CRT_UUID_DECL(ID2D1ImageBrush, 0xfe9e984d,0x3f95,0x407c,0xb5,0xdb,0xcb,0x94,0xd4,0xe8,0xf8,0x7c);
599 
600 #ifndef D2D_USE_C_DEFINITIONS
601 
602 interface ID2D1BitmapBrush1 : public ID2D1BitmapBrush
603 {
604     STDMETHOD_(void, SetInterpolationMode1)(D2D1_INTERPOLATION_MODE interpolationMode) PURE;
605     STDMETHOD_(D2D1_INTERPOLATION_MODE, GetInterpolationMode1)() CONST PURE;
606 };
607 
608 #else
609 
610 typedef interface ID2D1BitmapBrush1 ID2D1BitmapBrush1;
611 /* FIXME: Add full C declaration */
612 
613 #endif
614 
615 DEFINE_GUID(IID_ID2D1BitmapBrush1, 0x41343a53,0xe41a,0x49a2,0x91,0xcd,0x21,0x79,0x3b,0xbb,0x62,0xe5);
616 __CRT_UUID_DECL(ID2D1BitmapBrush1, 0x41343a53,0xe41a,0x49a2,0x91,0xcd,0x21,0x79,0x3b,0xbb,0x62,0xe5);
617 
618 #ifndef D2D_USE_C_DEFINITIONS
619 
620 interface ID2D1GradientStopCollection1 : public ID2D1GradientStopCollection
621 {
622     STDMETHOD_(void, GetGradientStops1)(D2D1_GRADIENT_STOP *gradientStops, UINT32 gradientStopsCount) CONST PURE;
623     STDMETHOD_(D2D1_COLOR_SPACE, GetPreInterpolationSpace)() CONST PURE;
624     STDMETHOD_(D2D1_COLOR_SPACE, GetPostInterpolationSpace)() CONST PURE;
625     STDMETHOD_(D2D1_BUFFER_PRECISION, GetBufferPrecision)() CONST PURE;
626     STDMETHOD_(D2D1_COLOR_INTERPOLATION_MODE, GetColorInterpolationMode)() CONST PURE;
627 };
628 
629 #else
630 
631 typedef interface ID2D1GradientStopCollection1 ID2D1GradientStopCollection1;
632 /* FIXME: Add full C declaration */
633 
634 #endif
635 
636 DEFINE_GUID(IID_ID2D1GradientStopCollection1, 0xae1572f4,0x5dd0,0x4777,0x99,0x8b,0x92,0x79,0x47,0x2a,0xe6,0x3b);
637 __CRT_UUID_DECL(ID2D1GradientStopCollection1, 0xae1572f4,0x5dd0,0x4777,0x99,0x8b,0x92,0x79,0x47,0x2a,0xe6,0x3b);
638 
639 #ifndef D2D_USE_C_DEFINITIONS
640 
641 interface ID2D1ColorContext : public ID2D1Resource
642 {
643     STDMETHOD_(D2D1_COLOR_SPACE, GetColorSpace)() CONST PURE;
644     STDMETHOD_(UINT32, GetProfileSize)() CONST PURE;
645     STDMETHOD(GetProfile)(BYTE *profile, UINT32 profileSize) CONST PURE;
646 };
647 
648 #else
649 
650 typedef interface ID2D1ColorContext ID2D1ColorContext;
651 
652 #endif
653 
654 DEFINE_GUID(IID_ID2D1ColorContext, 0x1c4820bb,0x5771,0x4518,0xa5,0x81,0x2f,0xe4,0xdd,0x0e,0xc6,0x57);
655 __CRT_UUID_DECL(ID2D1ColorContext, 0x1c4820bb,0x5771,0x4518,0xa5,0x81,0x2f,0xe4,0xdd,0x0e,0xc6,0x57);
656 
657 #ifndef D2D_USE_C_DEFINITIONS
658 
659 interface ID2D1DeviceContext : public ID2D1RenderTarget
660 {
661     STDMETHOD(CreateBitmap)(D2D1_SIZE_U size, CONST void *sourceData, UINT32 pitch,
662             CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties, ID2D1Bitmap1 **bitmap) PURE;
663     using ID2D1RenderTarget::CreateBitmap;
664 
665     STDMETHOD(CreateBitmapFromWicBitmap)(IWICBitmapSource *wicBitmapSource,
666             CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties, ID2D1Bitmap1 **bitmap) PURE;
667     using ID2D1RenderTarget::CreateBitmapFromWicBitmap;
668 
669     STDMETHOD(CreateColorContext)(D2D1_COLOR_SPACE space, CONST BYTE *profile, UINT32 profileSize,
670             ID2D1ColorContext **colorContext) PURE;
671     STDMETHOD(CreateColorContextFromFilename)(PCWSTR filename, ID2D1ColorContext **colorContext) PURE;
672     STDMETHOD(CreateColorContextFromWicColorContext)(IWICColorContext *wicColorContext, ID2D1ColorContext **colorContext) PURE;
673     STDMETHOD(CreateBitmapFromDxgiSurface)(IDXGISurface *surface, CONST D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
674             ID2D1Bitmap1 **bitmap) PURE;
675     STDMETHOD(CreateEffect)(REFCLSID effectId, ID2D1Effect **effect) PURE;
676 
677     STDMETHOD(CreateGradientStopCollection)(CONST D2D1_GRADIENT_STOP *straightAlphaGradientStops,
678         UINT32 straightAlphaGradientStopsCount, D2D1_COLOR_SPACE preInterpolationSpace,
679         D2D1_COLOR_SPACE postInterpolationSpace, D2D1_BUFFER_PRECISION bufferPrecision,
680         D2D1_EXTEND_MODE extendMode, D2D1_COLOR_INTERPOLATION_MODE colorInterpolationMode,
681         ID2D1GradientStopCollection1 **gradientStopCollection1) PURE;
682     using ID2D1RenderTarget::CreateGradientStopCollection;
683 
684     STDMETHOD(CreateImageBrush)(ID2D1Image *image, CONST D2D1_IMAGE_BRUSH_PROPERTIES *imageBrushProperties,
685             CONST D2D1_BRUSH_PROPERTIES *brushProperties, ID2D1ImageBrush **imageBrush) PURE;
686 
687     STDMETHOD(CreateBitmapBrush)(ID2D1Bitmap *bitmap, CONST D2D1_BITMAP_BRUSH_PROPERTIES1 *bitmapBrushProperties,
688             CONST D2D1_BRUSH_PROPERTIES *brushProperties, ID2D1BitmapBrush1 **bitmapBrush) PURE;
689     using ID2D1RenderTarget::CreateBitmapBrush;
690 
691     STDMETHOD(CreateCommandList)(ID2D1CommandList **commandList) PURE;
692     STDMETHOD_(BOOL, IsDxgiFormatSupported)(DXGI_FORMAT format) CONST PURE;
693     STDMETHOD_(BOOL, IsBufferPrecisionSupported)(D2D1_BUFFER_PRECISION bufferPrecision) CONST PURE;
694     STDMETHOD(GetImageLocalBounds)(ID2D1Image *image, D2D1_RECT_F *localBounds) CONST PURE;
695     STDMETHOD(GetImageWorldBounds)(ID2D1Image *image, D2D1_RECT_F *worldBounds) CONST PURE;
696     STDMETHOD(GetGlyphRunWorldBounds)(D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
697             DWRITE_MEASURING_MODE measuringMode, D2D1_RECT_F *bounds) CONST PURE;
698     STDMETHOD_(void, GetDevice)(ID2D1Device **device) CONST PURE;
699     STDMETHOD_(void, SetTarget)(ID2D1Image *image) PURE;
700     STDMETHOD_(void, GetTarget)(ID2D1Image **image) CONST PURE;
701     STDMETHOD_(void, SetRenderingControls)(CONST D2D1_RENDERING_CONTROLS *renderingControls) PURE;
702     STDMETHOD_(void, GetRenderingControls)(D2D1_RENDERING_CONTROLS *renderingControls) CONST PURE;
703     STDMETHOD_(void, SetPrimitiveBlend)(D2D1_PRIMITIVE_BLEND primitiveBlend) PURE;
704     STDMETHOD_(D2D1_PRIMITIVE_BLEND, GetPrimitiveBlend)() CONST PURE;
705     STDMETHOD_(void, SetUnitMode)(D2D1_UNIT_MODE unitMode) PURE;
706     STDMETHOD_(D2D1_UNIT_MODE, GetUnitMode)() CONST PURE;
707 
708     STDMETHOD_(void, DrawGlyphRun)(D2D1_POINT_2F baselineOrigin, CONST DWRITE_GLYPH_RUN *glyphRun,
709             CONST DWRITE_GLYPH_RUN_DESCRIPTION *glyphRunDescription, ID2D1Brush *foregroundBrush,
710             DWRITE_MEASURING_MODE measuringMode = DWRITE_MEASURING_MODE_NATURAL) PURE;
711     using ID2D1RenderTarget::DrawGlyphRun;
712 
713     STDMETHOD_(void, DrawImage)(ID2D1Image *image, CONST D2D1_POINT_2F *targetOffset = NULL,
714             CONST D2D1_RECT_F *imageRectangle = NULL, D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
715             D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) PURE;
716     STDMETHOD_(void, DrawGdiMetafile)(ID2D1GdiMetafile *gdiMetafile, CONST D2D1_POINT_2F *targetOffset = NULL) PURE;
717 
718     STDMETHOD_(void, DrawBitmap)(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F *destinationRectangle, FLOAT opacity,
719             D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F *sourceRectangle = NULL,
720             CONST D2D1_MATRIX_4X4_F *perspectiveTransform = NULL) PURE;
721     using ID2D1RenderTarget::DrawBitmap;
722 
723     STDMETHOD_(void, PushLayer)(CONST D2D1_LAYER_PARAMETERS1 *layerParameters, ID2D1Layer *layer) PURE;
724     using ID2D1RenderTarget::PushLayer;
725 
726     STDMETHOD(InvalidateEffectInputRectangle)(ID2D1Effect *effect, UINT32 input, CONST D2D1_RECT_F *inputRectangle) PURE;
727     STDMETHOD(GetEffectInvalidRectangleCount)(ID2D1Effect *effect, UINT32 *rectangleCount) PURE;
728     STDMETHOD(GetEffectInvalidRectangles)(ID2D1Effect *effect, D2D1_RECT_F *rectangles, UINT32 rectanglesCount) PURE;
729     STDMETHOD(GetEffectRequiredInputRectangles)(ID2D1Effect *renderEffect, CONST D2D1_RECT_F *renderImageRectangle,
730             CONST D2D1_EFFECT_INPUT_DESCRIPTION *inputDescriptions, D2D1_RECT_F *requiredInputRects, UINT32 inputCount) PURE;
731 
732     STDMETHOD_(void, FillOpacityMask)(ID2D1Bitmap *opacityMask, ID2D1Brush *brush, CONST D2D1_RECT_F *destinationRectangle = NULL,
733             CONST D2D1_RECT_F *sourceRectangle = NULL) PURE;
734     using ID2D1RenderTarget::FillOpacityMask;
735 
CreateBitmap(D2D1_SIZE_U size,CONST void * sourceData,UINT32 pitch,CONST D2D1_BITMAP_PROPERTIES1 & bitmapProperties,ID2D1Bitmap1 ** bitmap)736     HRESULT CreateBitmap(D2D1_SIZE_U size, CONST void *sourceData, UINT32 pitch, CONST D2D1_BITMAP_PROPERTIES1 &bitmapProperties,
737             ID2D1Bitmap1 **bitmap) {
738         return CreateBitmap(size, sourceData, pitch, &bitmapProperties, bitmap);
739     }
740 
CreateBitmapFromWicBitmap(IWICBitmapSource * wicBitmapSource,CONST D2D1_BITMAP_PROPERTIES1 & bitmapProperties,ID2D1Bitmap1 ** bitmap)741     HRESULT CreateBitmapFromWicBitmap(IWICBitmapSource *wicBitmapSource, CONST D2D1_BITMAP_PROPERTIES1 &bitmapProperties,
742             ID2D1Bitmap1 **bitmap) {
743         return CreateBitmapFromWicBitmap(wicBitmapSource, &bitmapProperties, bitmap);
744     }
745 
CreateBitmapFromWicBitmap(IWICBitmapSource * wicBitmapSource,ID2D1Bitmap1 ** bitmap)746     HRESULT CreateBitmapFromWicBitmap(IWICBitmapSource *wicBitmapSource, ID2D1Bitmap1 **bitmap) {
747         return CreateBitmapFromWicBitmap(wicBitmapSource, NULL, bitmap);
748     }
749 
CreateBitmapFromDxgiSurface(IDXGISurface * surface,CONST D2D1_BITMAP_PROPERTIES1 & bitmapProperties,ID2D1Bitmap1 ** bitmap)750     HRESULT CreateBitmapFromDxgiSurface(IDXGISurface *surface, CONST D2D1_BITMAP_PROPERTIES1 &bitmapProperties,
751         ID2D1Bitmap1 **bitmap) {
752         return CreateBitmapFromDxgiSurface(surface, &bitmapProperties, bitmap);
753     }
754 
CreateImageBrush(ID2D1Image * image,CONST D2D1_IMAGE_BRUSH_PROPERTIES & imageBrushProperties,CONST D2D1_BRUSH_PROPERTIES & brushProperties,ID2D1ImageBrush ** imageBrush)755     HRESULT CreateImageBrush(ID2D1Image *image, CONST D2D1_IMAGE_BRUSH_PROPERTIES &imageBrushProperties,
756         CONST D2D1_BRUSH_PROPERTIES &brushProperties, ID2D1ImageBrush **imageBrush) {
757         return CreateImageBrush(image, &imageBrushProperties, &brushProperties, imageBrush);
758     }
759 
CreateImageBrush(ID2D1Image * image,CONST D2D1_IMAGE_BRUSH_PROPERTIES & imageBrushProperties,ID2D1ImageBrush ** imageBrush)760     HRESULT CreateImageBrush(ID2D1Image *image, CONST D2D1_IMAGE_BRUSH_PROPERTIES &imageBrushProperties,
761         ID2D1ImageBrush **imageBrush) {
762         return CreateImageBrush(image,&imageBrushProperties, NULL, imageBrush);
763     }
764 
CreateBitmapBrush(ID2D1Bitmap * bitmap,ID2D1BitmapBrush1 ** bitmapBrush)765     HRESULT CreateBitmapBrush(ID2D1Bitmap *bitmap, ID2D1BitmapBrush1 **bitmapBrush) {
766         return CreateBitmapBrush(bitmap, NULL, NULL, bitmapBrush);
767     }
768 
CreateBitmapBrush(ID2D1Bitmap * bitmap,CONST D2D1_BITMAP_BRUSH_PROPERTIES1 & bitmapBrushProperties,ID2D1BitmapBrush1 ** bitmapBrush)769     HRESULT CreateBitmapBrush(ID2D1Bitmap *bitmap, CONST D2D1_BITMAP_BRUSH_PROPERTIES1 &bitmapBrushProperties,
770             ID2D1BitmapBrush1 **bitmapBrush) {
771         return CreateBitmapBrush(bitmap, &bitmapBrushProperties, NULL, bitmapBrush);
772     }
773 
CreateBitmapBrush(ID2D1Bitmap * bitmap,CONST D2D1_BITMAP_BRUSH_PROPERTIES1 & bitmapBrushProperties,CONST D2D1_BRUSH_PROPERTIES & brushProperties,ID2D1BitmapBrush1 ** bitmapBrush)774     HRESULT CreateBitmapBrush(ID2D1Bitmap *bitmap, CONST D2D1_BITMAP_BRUSH_PROPERTIES1 &bitmapBrushProperties,
775             CONST D2D1_BRUSH_PROPERTIES &brushProperties, ID2D1BitmapBrush1 **bitmapBrush) {
776         return CreateBitmapBrush(bitmap, &bitmapBrushProperties, &brushProperties, bitmapBrush);
777     }
778 
779     void DrawImage(ID2D1Effect *effect, CONST D2D1_POINT_2F *targetOffset = NULL, CONST D2D1_RECT_F *imageRectangle = NULL,
780             D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
781             D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
782         ID2D1Image *output = NULL;
783         effect->GetOutput(&output);
784         DrawImage(output, targetOffset, imageRectangle, interpolationMode, compositeMode);
785         output->Release();
786     }
787 
788     void DrawImage(ID2D1Image *image, D2D1_INTERPOLATION_MODE interpolationMode,
789             D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
790         DrawImage(image, NULL, NULL, interpolationMode, compositeMode);
791     }
792 
793     void DrawImage(ID2D1Effect *effect, D2D1_INTERPOLATION_MODE interpolationMode,
794             D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
795         DrawImage(effect, NULL, NULL, interpolationMode, compositeMode);
796     }
797 
798     void DrawImage(ID2D1Image *image, D2D1_POINT_2F targetOffset,
799             D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
800             D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
801         DrawImage(image, &targetOffset, NULL, interpolationMode, compositeMode);
802     }
803 
804     void DrawImage(ID2D1Effect *effect, D2D1_POINT_2F targetOffset,
805             D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
806             D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
807         DrawImage(effect, &targetOffset, NULL, interpolationMode, compositeMode);
808     }
809 
810     void DrawImage(ID2D1Image *image, D2D1_POINT_2F targetOffset, CONST D2D1_RECT_F &imageRectangle,
811             D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
812             D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
813         DrawImage(image, &targetOffset, &imageRectangle, interpolationMode, compositeMode);
814     }
815 
816     void DrawImage(ID2D1Effect *effect, D2D1_POINT_2F targetOffset, CONST D2D1_RECT_F &imageRectangle,
817             D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE_LINEAR,
818             D2D1_COMPOSITE_MODE compositeMode = D2D1_COMPOSITE_MODE_SOURCE_OVER) {
819         DrawImage(effect, &targetOffset, &imageRectangle, interpolationMode, compositeMode);
820     }
821 
PushLayer(CONST D2D1_LAYER_PARAMETERS1 & layerParameters,ID2D1Layer * layer)822     void PushLayer(CONST D2D1_LAYER_PARAMETERS1 &layerParameters, ID2D1Layer *layer) {
823         PushLayer(&layerParameters, layer);
824     }
825 
DrawGdiMetafile(ID2D1GdiMetafile * gdiMetafile,D2D1_POINT_2F targetOffset)826     void DrawGdiMetafile(ID2D1GdiMetafile *gdiMetafile, D2D1_POINT_2F targetOffset) {
827         DrawGdiMetafile(gdiMetafile, &targetOffset);
828     }
829 
830     void DrawBitmap(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F &destinationRectangle, FLOAT opacity,
831             D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F *sourceRectangle = NULL,
832             CONST D2D1_MATRIX_4X4_F *perspectiveTransform = NULL) {
833         DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, sourceRectangle, perspectiveTransform);
834     }
835 
836     void DrawBitmap(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F &destinationRectangle, FLOAT opacity,
837             D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F &sourceRectangle,
838             CONST D2D1_MATRIX_4X4_F *perspectiveTransform = NULL) {
839         DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, &sourceRectangle, perspectiveTransform);
840     }
841 
DrawBitmap(ID2D1Bitmap * bitmap,CONST D2D1_RECT_F & destinationRectangle,FLOAT opacity,D2D1_INTERPOLATION_MODE interpolationMode,CONST D2D1_RECT_F & sourceRectangle,CONST D2D1_MATRIX_4X4_F & perspectiveTransform)842     void DrawBitmap(ID2D1Bitmap *bitmap, CONST D2D1_RECT_F &destinationRectangle, FLOAT opacity,
843             D2D1_INTERPOLATION_MODE interpolationMode, CONST D2D1_RECT_F &sourceRectangle,
844             CONST D2D1_MATRIX_4X4_F &perspectiveTransform) {
845         DrawBitmap(bitmap, &destinationRectangle, opacity, interpolationMode, &sourceRectangle, &perspectiveTransform);
846     }
847 
848     void FillOpacityMask(ID2D1Bitmap *opacityMask, ID2D1Brush *brush, CONST D2D1_RECT_F &destinationRectangle,
849             CONST D2D1_RECT_F *sourceRectangle = NULL) {
850         FillOpacityMask(opacityMask, brush, &destinationRectangle, sourceRectangle);
851     }
852 
FillOpacityMask(ID2D1Bitmap * opacityMask,ID2D1Brush * brush,CONST D2D1_RECT_F & destinationRectangle,CONST D2D1_RECT_F & sourceRectangle)853     void FillOpacityMask(ID2D1Bitmap *opacityMask, ID2D1Brush *brush, CONST D2D1_RECT_F &destinationRectangle,
854             CONST D2D1_RECT_F &sourceRectangle) {
855         FillOpacityMask(opacityMask, brush, &destinationRectangle, &sourceRectangle);
856     }
857 
SetRenderingControls(CONST D2D1_RENDERING_CONTROLS & renderingControls)858     void SetRenderingControls(CONST D2D1_RENDERING_CONTROLS &renderingControls) {
859         return SetRenderingControls(&renderingControls);
860     }
861 };
862 
863 
864 #else
865 
866 typedef interface ID2D1DeviceContext ID2D1DeviceContext;
867 /* FIXME: Add full C declaration */
868 
869 #endif
870 
871 DEFINE_GUID(IID_ID2D1DeviceContext, 0xe8f7fe7a,0x191c,0x466d,0xad,0x95,0x97,0x56,0x78,0xbd,0xa9,0x98);
872 __CRT_UUID_DECL(ID2D1DeviceContext, 0xe8f7fe7a,0x191c,0x466d,0xad,0x95,0x97,0x56,0x78,0xbd,0xa9,0x98);
873 
874 #ifndef D2D_USE_C_DEFINITIONS
875 
876 interface ID2D1Device : public ID2D1Resource
877 {
878     STDMETHOD(CreateDeviceContext)(D2D1_DEVICE_CONTEXT_OPTIONS options, ID2D1DeviceContext **deviceContext) PURE;
879     STDMETHOD(CreatePrintControl)(IWICImagingFactory *wicFactory, IPrintDocumentPackageTarget *documentTarget,
880             CONST D2D1_PRINT_CONTROL_PROPERTIES *printControlProperties, ID2D1PrintControl **printControl) PURE;
881     STDMETHOD_(void, SetMaximumTextureMemory)(UINT64 maximumInBytes) PURE;
882     STDMETHOD_(UINT64, GetMaximumTextureMemory)() CONST PURE;
883     STDMETHOD_(void, ClearResources)(UINT32 millisecondsSinceUse = 0) PURE;
884 
CreatePrintControl(IWICImagingFactory * wicFactory,IPrintDocumentPackageTarget * documentTarget,CONST D2D1_PRINT_CONTROL_PROPERTIES & printControlProperties,ID2D1PrintControl ** printControl)885     HRESULT CreatePrintControl(IWICImagingFactory *wicFactory, IPrintDocumentPackageTarget *documentTarget,
886             CONST D2D1_PRINT_CONTROL_PROPERTIES &printControlProperties, ID2D1PrintControl **printControl) {
887         return CreatePrintControl(wicFactory, documentTarget, &printControlProperties, printControl);
888     }
889 };
890 
891 #else
892 
893 typedef interface ID2D1Device ID2D1Device;
894 /* FIXME: Add full C declaration */
895 
896 #endif
897 
898 DEFINE_GUID(IID_ID2D1Device, 0x47dd575d,0xac05,0x4cdd,0x80,0x49,0x9b,0x02,0xcd,0x16,0xf4,0x4c);
899 __CRT_UUID_DECL(ID2D1Device, 0x47dd575d,0xac05,0x4cdd,0x80,0x49,0x9b,0x02,0xcd,0x16,0xf4,0x4c);
900 
901 #ifndef D2D_USE_C_DEFINITIONS
902 
903 interface ID2D1DrawingStateBlock1 : public ID2D1DrawingStateBlock
904 {
905     STDMETHOD_(void, GetDescription)(D2D1_DRAWING_STATE_DESCRIPTION1 *stateDescription) CONST PURE;
906     using ID2D1DrawingStateBlock::GetDescription;
907 
908     STDMETHOD_(void, SetDescription)(CONST D2D1_DRAWING_STATE_DESCRIPTION1 *stateDescription) PURE;
909     using ID2D1DrawingStateBlock::SetDescription;
910 };
911 
912 #else
913 
914 typedef interface ID2D1DrawingStateBlock1 ID2D1DrawingStateBlock1;
915 /* FIXME: Add full C declaration */
916 
917 #endif
918 
919 DEFINE_GUID(IID_ID2D1DrawingStateBlock1, 0x689f1f85,0xc72e,0x4e33,0x8f,0x19,0x85,0x75,0x4e,0xfd,0x5a,0xce);
920 __CRT_UUID_DECL(ID2D1DrawingStateBlock1, 0x689f1f85,0xc72e,0x4e33,0x8f,0x19,0x85,0x75,0x4e,0xfd,0x5a,0xce);
921 
922 #ifndef D2D_USE_C_DEFINITIONS
923 
924 interface ID2D1PathGeometry1 : public ID2D1PathGeometry
925 {
926     STDMETHOD(ComputePointAndSegmentAtLength)(FLOAT length, UINT32 startSegment, CONST D2D1_MATRIX_3X2_F *worldTransform,
927             FLOAT flatteningTolerance, D2D1_POINT_DESCRIPTION *pointDescription) CONST PURE;
928 
ComputePointAndSegmentAtLength(FLOAT length,UINT32 startSegment,CONST D2D1_MATRIX_3X2_F & worldTransform,FLOAT flatteningTolerance,D2D1_POINT_DESCRIPTION * pointDescription)929     HRESULT ComputePointAndSegmentAtLength(FLOAT length, UINT32 startSegment, CONST D2D1_MATRIX_3X2_F &worldTransform,
930             FLOAT flatteningTolerance, D2D1_POINT_DESCRIPTION *pointDescription) CONST {
931         return ComputePointAndSegmentAtLength(length, startSegment, &worldTransform, flatteningTolerance, pointDescription);
932     }
933 
ComputePointAndSegmentAtLength(FLOAT length,UINT32 startSegment,CONST D2D1_MATRIX_3X2_F * worldTransform,D2D1_POINT_DESCRIPTION * pointDescription)934     HRESULT ComputePointAndSegmentAtLength(FLOAT length, UINT32 startSegment, CONST D2D1_MATRIX_3X2_F *worldTransform,
935             D2D1_POINT_DESCRIPTION *pointDescription) CONST {
936         return ComputePointAndSegmentAtLength(length, startSegment, worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE,
937                                               pointDescription);
938     }
939 
ComputePointAndSegmentAtLength(FLOAT length,UINT32 startSegment,CONST D2D1_MATRIX_3X2_F & worldTransform,D2D1_POINT_DESCRIPTION * pointDescription)940     HRESULT ComputePointAndSegmentAtLength(FLOAT length, UINT32 startSegment, CONST D2D1_MATRIX_3X2_F &worldTransform,
941             D2D1_POINT_DESCRIPTION *pointDescription) CONST {
942         return ComputePointAndSegmentAtLength(length, startSegment, &worldTransform, D2D1_DEFAULT_FLATTENING_TOLERANCE,
943                                               pointDescription);
944     }
945 };
946 
947 #else
948 
949 typedef interface ID2D1PathGeometry1 ID2D1PathGeometry1;
950 /* FIXME: Add full C declaration */
951 
952 #endif
953 
954 DEFINE_GUID(IID_ID2D1PathGeometry1, 0x62baa2d2,0xab54,0x41b7,0xb8,0x72,0x78,0x7e,0x01,0x06,0xa4,0x21);
955 __CRT_UUID_DECL(ID2D1PathGeometry1, 0x62baa2d2,0xab54,0x41b7,0xb8,0x72,0x78,0x7e,0x01,0x06,0xa4,0x21);
956 
957 #ifndef D2D_USE_C_DEFINITIONS
958 
959 interface ID2D1Factory1 : public ID2D1Factory
960 {
961     STDMETHOD(CreateDevice)(IDXGIDevice *dxgiDevice, ID2D1Device **d2dDevice) PURE;
962 
963     STDMETHOD(CreateStrokeStyle)(CONST D2D1_STROKE_STYLE_PROPERTIES1 *strokeStyleProperties,
964             CONST FLOAT *dashes, UINT32 dashesCount, ID2D1StrokeStyle1 **strokeStyle) PURE;
965     using ID2D1Factory::CreateStrokeStyle;
966 
967     STDMETHOD(CreatePathGeometry)(ID2D1PathGeometry1 **pathGeometry) PURE;
968     using ID2D1Factory::CreatePathGeometry;
969 
970     STDMETHOD(CreateDrawingStateBlock)(CONST D2D1_DRAWING_STATE_DESCRIPTION1 *drawingStateDescription,
971             IDWriteRenderingParams *textRenderingParams, ID2D1DrawingStateBlock1 **drawingStateBlock) PURE;
972     using ID2D1Factory::CreateDrawingStateBlock;
973 
974     STDMETHOD(CreateGdiMetafile)(IStream *metafileStream, ID2D1GdiMetafile **metafile) PURE;
975     STDMETHOD(RegisterEffectFromStream)(REFCLSID classId, IStream *propertyXml, CONST D2D1_PROPERTY_BINDING *bindings,
976             UINT32 bindingsCount, CONST PD2D1_EFFECT_FACTORY effectFactory) PURE;
977     STDMETHOD(RegisterEffectFromString)(REFCLSID classId, PCWSTR propertyXml, CONST D2D1_PROPERTY_BINDING *bindings,
978             UINT32 bindingsCount, CONST PD2D1_EFFECT_FACTORY effectFactory) PURE;
979     STDMETHOD(UnregisterEffect)(REFCLSID classId) PURE;
980     STDMETHOD(GetRegisteredEffects)(CLSID *effects, UINT32 effectsCount, UINT32 *effectsReturned,
981             UINT32 *effectsRegistered) CONST PURE;
982     STDMETHOD(GetEffectProperties)(REFCLSID effectId, ID2D1Properties **properties) CONST PURE;
983 
CreateStrokeStyle(CONST D2D1_STROKE_STYLE_PROPERTIES1 & strokeStyleProperties,CONST FLOAT * dashes,UINT32 dashesCount,ID2D1StrokeStyle1 ** strokeStyle)984     HRESULT CreateStrokeStyle(CONST D2D1_STROKE_STYLE_PROPERTIES1 &strokeStyleProperties, CONST FLOAT *dashes,
985             UINT32 dashesCount, ID2D1StrokeStyle1 **strokeStyle) {
986         return CreateStrokeStyle(&strokeStyleProperties, dashes, dashesCount, strokeStyle);
987     }
988 
CreateDrawingStateBlock(CONST D2D1_DRAWING_STATE_DESCRIPTION1 & drawingStateDescription,ID2D1DrawingStateBlock1 ** drawingStateBlock)989     HRESULT CreateDrawingStateBlock(CONST D2D1_DRAWING_STATE_DESCRIPTION1 &drawingStateDescription,
990             ID2D1DrawingStateBlock1 **drawingStateBlock) {
991         return CreateDrawingStateBlock(&drawingStateDescription, NULL, drawingStateBlock);
992     }
993 
CreateDrawingStateBlock(ID2D1DrawingStateBlock1 ** drawingStateBlock)994     HRESULT CreateDrawingStateBlock(ID2D1DrawingStateBlock1 **drawingStateBlock) {
995         return CreateDrawingStateBlock(NULL, NULL, drawingStateBlock);
996     }
997 };
998 
999 #else
1000 
1001 typedef interface ID2D1Factory1 ID2D1Factory1;
1002 /* FIXME: Add full C declaration */
1003 
1004 #endif
1005 
1006 DEFINE_GUID(IID_ID2D1Factory1, 0xbb12d362,0xdaee,0x4b9a,0xaa,0x1d,0x14,0xba,0x40,0x1c,0xfa,0x1f);
1007 __CRT_UUID_DECL(ID2D1Factory1, 0xbb12d362,0xdaee,0x4b9a,0xaa,0x1d,0x14,0xba,0x40,0x1c,0xfa,0x1f);
1008 
1009 #ifndef D2D_USE_C_DEFINITIONS
1010 
1011 interface ID2D1Multithread : public IUnknown
1012 {
1013     STDMETHOD_(BOOL, GetMultithreadProtected)() CONST PURE;
1014     STDMETHOD_(void, Enter)() PURE;
1015     STDMETHOD_(void, Leave)() PURE;
1016 };
1017 
1018 #else
1019 
1020 typedef interface ID2D1Multithread ID2D1Multithread;
1021 /* FIXME: Add full C declaration */
1022 
1023 #endif
1024 
1025 DEFINE_GUID(IID_ID2D1Multithread, 0x31e6e7bc,0xe0ff,0x4d46,0x8c,0x64,0xa0,0xa8,0xc4,0x1c,0x15,0xd3);
1026 __CRT_UUID_DECL(ID2D1Multithread, 0x31e6e7bc,0xe0ff,0x4d46,0x8c,0x64,0xa0,0xa8,0xc4,0x1c,0x15,0xd3);
1027 
1028 #include <d2d1_1helper.h>
1029 
1030 #endif
1031