1 // Copyright © 2015-2017 winapi-rs developers
2 // Licensed under the Apache License, Version 2.0
3 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
4 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
5 // All files in the project carrying such notice may not be copied, modified, or distributed
6 // except according to those terms
7 //! Mappings for the contents of d2d1.h
8 use ctypes::c_void;
9 use shared::basetsd::{UINT32, UINT64};
10 use shared::dxgi::IDXGISurface;
11 use shared::guiddef::REFIID;
12 use shared::minwindef::{BOOL, DWORD, FLOAT};
13 use shared::windef::{HDC, HWND, RECT};
14 use um::d2dbasetypes::{
15     D2D_COLOR_F, D2D_MATRIX_3X2_F, D2D_POINT_2F, D2D_POINT_2U, D2D_RECT_F, D2D_RECT_U, D2D_SIZE_F,
16     D2D_SIZE_U,
17 };
18 use um::d3dcommon::{D3D_FEATURE_LEVEL_10_0, D3D_FEATURE_LEVEL_9_1};
19 use um::dcommon::{D2D1_PIXEL_FORMAT, DWRITE_MEASURING_MODE};
20 use um::dwrite::{DWRITE_GLYPH_RUN, IDWriteRenderingParams, IDWriteTextFormat, IDWriteTextLayout};
21 use um::unknwnbase::{IUnknown, IUnknownVtbl};
22 use um::wincodec::{IWICBitmap, IWICBitmapSource};
23 use um::winnt::{HRESULT, WCHAR};
24 // Types confirmed affected by the ABI issue:
25 // D2D1_SIZE_F, D2D1_SIZE_U, D2D1_COLOR_F, D2D1_PIXEL_FORMAT, D2D1_POINT_2F
26 pub const D2D1_DEFAULT_FLATTENING_TOLERANCE: FLOAT = 0.25;
27 pub const D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR: DWORD = 0;
28 pub const D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR: DWORD = 1;
29 pub const D2D1_INTERPOLATION_MODE_DEFINITION_CUBIC: DWORD = 2;
30 pub const D2D1_INTERPOLATION_MODE_DEFINITION_MULTI_SAMPLE_LINEAR: DWORD = 3;
31 pub const D2D1_INTERPOLATION_MODE_DEFINITION_ANISOTROPIC: DWORD = 4;
32 pub const D2D1_INTERPOLATION_MODE_DEFINITION_HIGH_QUALITY_CUBIC: DWORD = 5;
33 pub const D2D1_INTERPOLATION_MODE_DEFINITION_FANT: DWORD = 6;
34 pub const D2D1_INTERPOLATION_MODE_DEFINITION_MIPMAP_LINEAR: DWORD = 7;
35 ENUM!{enum D2D1_GAMMA {
36     D2D1_GAMMA_2_2 = 0,
37     D2D1_GAMMA_1_0 = 1,
38 }}
39 ENUM!{enum D2D1_OPACITY_MASK_CONTENT {
40     D2D1_OPACITY_MASK_CONTENT_GRAPHICS = 0,
41     D2D1_OPACITY_MASK_CONTENT_TEXT_NATURAL = 1,
42     D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE = 2,
43 }}
44 ENUM!{enum D2D1_EXTEND_MODE {
45     D2D1_EXTEND_MODE_CLAMP = 0,
46     D2D1_EXTEND_MODE_WRAP = 1,
47     D2D1_EXTEND_MODE_MIRROR = 2,
48 }}
49 ENUM!{enum D2D1_ANTIALIAS_MODE {
50     D2D1_ANTIALIAS_MODE_PER_PRIMITIVE = 0,
51     D2D1_ANTIALIAS_MODE_ALIASED = 1,
52 }}
53 ENUM!{enum D2D1_TEXT_ANTIALIAS_MODE {
54     D2D1_TEXT_ANTIALIAS_MODE_DEFAULT = 0,
55     D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE = 1,
56     D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE = 2,
57     D2D1_TEXT_ANTIALIAS_MODE_ALIASED = 3,
58 }}
59 ENUM!{enum D2D1_BITMAP_INTERPOLATION_MODE {
60     D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR =
61         D2D1_INTERPOLATION_MODE_DEFINITION_NEAREST_NEIGHBOR,
62     D2D1_BITMAP_INTERPOLATION_MODE_LINEAR =
63         D2D1_INTERPOLATION_MODE_DEFINITION_LINEAR,
64 }}
65 ENUM!{enum D2D1_DRAW_TEXT_OPTIONS {
66     D2D1_DRAW_TEXT_OPTIONS_NO_SNAP = 0x00000001,
67     D2D1_DRAW_TEXT_OPTIONS_CLIP = 0x00000002,
68     D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT = 0x00000004,
69     D2D1_DRAW_TEXT_OPTIONS_NONE = 0x00000000,
70 }}
71 pub type D2D1_POINT_2U = D2D_POINT_2U;
72 pub type D2D1_POINT_2F = D2D_POINT_2F;
73 pub type D2D1_RECT_F = D2D_RECT_F;
74 pub type D2D1_RECT_U = D2D_RECT_U;
75 pub type D2D1_SIZE_F = D2D_SIZE_F;
76 pub type D2D1_SIZE_U = D2D_SIZE_U;
77 pub type D2D1_COLOR_F = D2D_COLOR_F;
78 pub type D2D1_MATRIX_3X2_F = D2D_MATRIX_3X2_F;
79 pub type D2D1_TAG = UINT64;
80 STRUCT!{struct D2D1_BITMAP_PROPERTIES {
81     pixelFormat: D2D1_PIXEL_FORMAT,
82     dpiX: FLOAT,
83     dpiY: FLOAT,
84 }}
85 STRUCT!{struct D2D1_GRADIENT_STOP {
86     position: FLOAT,
87     color: D2D1_COLOR_F,
88 }}
89 STRUCT!{struct D2D1_BRUSH_PROPERTIES {
90     opacity: FLOAT,
91     transform: D2D1_MATRIX_3X2_F,
92 }}
93 STRUCT!{struct D2D1_BITMAP_BRUSH_PROPERTIES {
94     extendModeX: D2D1_EXTEND_MODE,
95     extendModeY: D2D1_EXTEND_MODE,
96     interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE,
97 }}
98 STRUCT!{struct D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES {
99     startPoint: D2D1_POINT_2F,
100     endPoint: D2D1_POINT_2F,
101 }}
102 STRUCT!{struct D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES {
103     center: D2D1_POINT_2F,
104     gradientOriginOffset: D2D1_POINT_2F,
105     radiusX: FLOAT,
106     radiusY: FLOAT,
107 }}
108 ENUM!{enum D2D1_ARC_SIZE {
109     D2D1_ARC_SIZE_SMALL = 0,
110     D2D1_ARC_SIZE_LARGE = 1,
111 }}
112 ENUM!{enum D2D1_CAP_STYLE {
113     D2D1_CAP_STYLE_FLAT = 0,
114     D2D1_CAP_STYLE_SQUARE = 1,
115     D2D1_CAP_STYLE_ROUND = 2,
116     D2D1_CAP_STYLE_TRIANGLE = 3,
117 }}
118 ENUM!{enum D2D1_DASH_STYLE {
119     D2D1_DASH_STYLE_SOLID = 0,
120     D2D1_DASH_STYLE_DASH = 1,
121     D2D1_DASH_STYLE_DOT = 2,
122     D2D1_DASH_STYLE_DASH_DOT = 3,
123     D2D1_DASH_STYLE_DASH_DOT_DOT = 4,
124     D2D1_DASH_STYLE_CUSTOM = 5,
125 }}
126 ENUM!{enum D2D1_LINE_JOIN {
127     D2D1_LINE_JOIN_MITER = 0,
128     D2D1_LINE_JOIN_BEVEL = 1,
129     D2D1_LINE_JOIN_ROUND = 2,
130     D2D1_LINE_JOIN_MITER_OR_BEVEL = 3,
131 }}
132 ENUM!{enum D2D1_COMBINE_MODE {
133     D2D1_COMBINE_MODE_UNION = 0,
134     D2D1_COMBINE_MODE_INTERSECT = 1,
135     D2D1_COMBINE_MODE_XOR = 2,
136     D2D1_COMBINE_MODE_EXCLUDE = 3,
137 }}
138 ENUM!{enum D2D1_GEOMETRY_RELATION {
139     D2D1_GEOMETRY_RELATION_UNKNOWN = 0,
140     D2D1_GEOMETRY_RELATION_DISJOINT = 1,
141     D2D1_GEOMETRY_RELATION_IS_CONTAINED = 2,
142     D2D1_GEOMETRY_RELATION_CONTAINS = 3,
143     D2D1_GEOMETRY_RELATION_OVERLAP = 4,
144 }}
145 ENUM!{enum D2D1_GEOMETRY_SIMPLIFICATION_OPTION {
146     D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES = 0,
147     D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES = 1,
148 }}
149 ENUM!{enum D2D1_FIGURE_BEGIN {
150     D2D1_FIGURE_BEGIN_FILLED = 0,
151     D2D1_FIGURE_BEGIN_HOLLOW = 1,
152 }}
153 ENUM!{enum D2D1_FIGURE_END {
154     D2D1_FIGURE_END_OPEN = 0,
155     D2D1_FIGURE_END_CLOSED = 1,
156 }}
157 STRUCT!{struct D2D1_BEZIER_SEGMENT {
158     point1: D2D1_POINT_2F,
159     point2: D2D1_POINT_2F,
160     point3: D2D1_POINT_2F,
161 }}
162 STRUCT!{struct D2D1_TRIANGLE {
163     point1: D2D1_POINT_2F,
164     point2: D2D1_POINT_2F,
165     point3: D2D1_POINT_2F,
166 }}
167 ENUM!{enum D2D1_PATH_SEGMENT {
168     D2D1_PATH_SEGMENT_NONE = 0x00000000,
169     D2D1_PATH_SEGMENT_FORCE_UNSTROKED = 0x00000001,
170     D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN = 0x00000002,
171 }}
172 ENUM!{enum D2D1_SWEEP_DIRECTION {
173     D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE = 0,
174     D2D1_SWEEP_DIRECTION_CLOCKWISE = 1,
175 }}
176 ENUM!{enum D2D1_FILL_MODE {
177     D2D1_FILL_MODE_ALTERNATE = 0,
178     D2D1_FILL_MODE_WINDING = 1,
179 }}
180 STRUCT!{struct D2D1_ARC_SEGMENT {
181     point: D2D1_POINT_2F,
182     size: D2D1_SIZE_F,
183     rotationAngle: FLOAT,
184     sweepDirection: D2D1_SWEEP_DIRECTION,
185     arcSize: D2D1_ARC_SIZE,
186 }}
187 STRUCT!{struct D2D1_QUADRATIC_BEZIER_SEGMENT {
188     point1: D2D1_POINT_2F,
189     point2: D2D1_POINT_2F,
190 }}
191 STRUCT!{struct D2D1_ELLIPSE {
192     point: D2D1_POINT_2F,
193     radiusX: FLOAT,
194     radiusY: FLOAT,
195 }}
196 STRUCT!{struct D2D1_ROUNDED_RECT {
197     rect: D2D1_RECT_F,
198     radiusX: FLOAT,
199     radiusY: FLOAT,
200 }}
201 STRUCT!{struct D2D1_STROKE_STYLE_PROPERTIES {
202     startCap: D2D1_CAP_STYLE,
203     endCap: D2D1_CAP_STYLE,
204     dashCap: D2D1_CAP_STYLE,
205     lineJoin: D2D1_LINE_JOIN,
206     miterLimit: FLOAT,
207     dashStyle: D2D1_DASH_STYLE,
208     dashOffset: FLOAT,
209 }}
210 ENUM!{enum D2D1_LAYER_OPTIONS {
211     D2D1_LAYER_OPTIONS_NONE = 0x00000000,
212     D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE = 0x00000001,
213 }}
214 STRUCT!{struct D2D1_LAYER_PARAMETERS {
215     contentBounds: D2D1_RECT_F,
216     geometricMask: *mut ID2D1Geometry,
217     maskAntialiasMode: D2D1_ANTIALIAS_MODE,
218     maskTransform: D2D1_MATRIX_3X2_F,
219     opacity: FLOAT,
220     opacityBrush: *mut ID2D1Brush,
221     layerOptions: D2D1_LAYER_OPTIONS,
222 }}
223 ENUM!{enum D2D1_WINDOW_STATE {
224     D2D1_WINDOW_STATE_NONE = 0x0000000,
225     D2D1_WINDOW_STATE_OCCLUDED = 0x0000001,
226 }}
227 ENUM!{enum D2D1_RENDER_TARGET_TYPE {
228     D2D1_RENDER_TARGET_TYPE_DEFAULT = 0,
229     D2D1_RENDER_TARGET_TYPE_SOFTWARE = 1,
230     D2D1_RENDER_TARGET_TYPE_HARDWARE = 2,
231 }}
232 ENUM!{enum D2D1_FEATURE_LEVEL {
233     D2D1_FEATURE_LEVEL_DEFAULT = 0,
234     D2D1_FEATURE_LEVEL_9 = D3D_FEATURE_LEVEL_9_1,
235     D2D1_FEATURE_LEVEL_10 = D3D_FEATURE_LEVEL_10_0,
236 }}
237 ENUM!{enum D2D1_RENDER_TARGET_USAGE {
238     D2D1_RENDER_TARGET_USAGE_NONE = 0x00000000,
239     D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING = 0x00000001,
240     D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE = 0x00000002,
241 }}
242 ENUM!{enum D2D1_PRESENT_OPTIONS {
243     D2D1_PRESENT_OPTIONS_NONE = 0x00000000,
244     D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS = 0x00000001,
245     D2D1_PRESENT_OPTIONS_IMMEDIATELY = 0x00000002,
246 }}
247 STRUCT!{struct D2D1_RENDER_TARGET_PROPERTIES {
248     _type: D2D1_RENDER_TARGET_TYPE,
249     pixelFormat: D2D1_PIXEL_FORMAT,
250     dpiX: FLOAT,
251     dpiY: FLOAT,
252     usage: D2D1_RENDER_TARGET_USAGE,
253     minLevel: D2D1_FEATURE_LEVEL,
254 }}
255 STRUCT!{struct D2D1_HWND_RENDER_TARGET_PROPERTIES {
256     hwnd: HWND,
257     pixelSize: D2D1_SIZE_U,
258     presentOptions: D2D1_PRESENT_OPTIONS,
259 }}
260 ENUM!{enum D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS {
261     D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE = 0x00000000,
262     D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE = 0x00000001,
263 }}
264 STRUCT!{struct D2D1_DRAWING_STATE_DESCRIPTION {
265     antialiasMode: D2D1_ANTIALIAS_MODE,
266     textAntialiasMode: D2D1_TEXT_ANTIALIAS_MODE,
267     tag1: D2D1_TAG,
268     tag2: D2D1_TAG,
269     transform: D2D1_MATRIX_3X2_F,
270 }}
271 ENUM!{enum D2D1_DC_INITIALIZE_MODE {
272     D2D1_DC_INITIALIZE_MODE_COPY = 0,
273     D2D1_DC_INITIALIZE_MODE_CLEAR = 1,
274 }}
275 ENUM!{enum D2D1_DEBUG_LEVEL {
276     D2D1_DEBUG_LEVEL_NONE = 0,
277     D2D1_DEBUG_LEVEL_ERROR = 1,
278     D2D1_DEBUG_LEVEL_WARNING = 2,
279     D2D1_DEBUG_LEVEL_INFORMATION = 3,
280 }}
281 ENUM!{enum D2D1_FACTORY_TYPE {
282     D2D1_FACTORY_TYPE_SINGLE_THREADED = 0,
283     D2D1_FACTORY_TYPE_MULTI_THREADED = 1,
284 }}
285 STRUCT!{struct D2D1_FACTORY_OPTIONS {
286     debugLevel: D2D1_DEBUG_LEVEL,
287 }}
288 RIDL!{#[uuid(0x2cd90691, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
289 interface ID2D1Resource(ID2D1ResourceVtbl): IUnknown(IUnknownVtbl) {
290     fn GetFactory(
291         factory: *mut *mut ID2D1Factory,
292     ) -> (),
293 }}
294 RIDL!{#[uuid(0x65019f75, 0x8da2, 0x497c, 0xb3, 0x2c, 0xdf, 0xa3, 0x4e, 0x48, 0xed, 0xe6)]
295 interface ID2D1Image(ID2D1ImageVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
296 }}
297 RIDL!{#[uuid(0xa2296057, 0xea42, 0x4099, 0x98, 0x3b, 0x53, 0x9f, 0xb6, 0x50, 0x54, 0x26)]
298 interface ID2D1Bitmap(ID2D1BitmapVtbl): ID2D1Image(ID2D1ImageVtbl) {
299     #[fixme] fn GetSize() -> D2D1_SIZE_F,
300     #[fixme] fn GetPixelSize() -> D2D1_SIZE_U,
301     #[fixme] fn GetPixelFormat() -> D2D1_PIXEL_FORMAT,
302     fn GetDpi(
303         dpiX: *mut FLOAT,
304         dpiY: *mut FLOAT,
305     ) -> (),
306     fn CopyFromBitmap(
307         destPoint: *const D2D1_POINT_2U,
308         bitmap: *mut ID2D1Bitmap,
309         srcRect: *const D2D1_RECT_U,
310     ) -> HRESULT,
311     fn CopyFromRenderTarget(
312         destPoint: *const D2D1_POINT_2U,
313         renderTarget: *mut ID2D1RenderTarget,
314         srcRect: *const D2D1_RECT_U,
315     ) -> HRESULT,
316     fn CopyFromMemory(
317         dstRect: *const D2D1_RECT_U,
318         srcData: *const c_void,
319         pitch: UINT32,
320     ) -> HRESULT,
321 }}
322 RIDL!{#[uuid(0x2cd906a7, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
323 interface ID2D1GradientStopCollection(ID2D1GradientStopCollectionVtbl):
324     ID2D1Resource(ID2D1ResourceVtbl) {
325     fn GetGradientStopCount() -> UINT32,
326     fn GetGradientStops(
327         gradientStops: *mut D2D1_GRADIENT_STOP,
328         gradientStopsCount: UINT32,
329     ) -> (),
330     fn GetColorInterpolationGamma() -> D2D1_GAMMA,
331     fn GetExtendMode() -> D2D1_EXTEND_MODE,
332 }}
333 RIDL!{#[uuid(0x2cd906a8, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
334 interface ID2D1Brush(ID2D1BrushVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
335     fn SetOpacity(
336         opacity: FLOAT,
337     ) -> (),
338     fn SetTransform(
339         transform: *const D2D1_MATRIX_3X2_F,
340     ) -> (),
341     fn GetOpacity() -> FLOAT,
342     fn GetTransform(
343         transform: *mut D2D1_MATRIX_3X2_F,
344     ) -> (),
345 }}
346 RIDL!{#[uuid(0x2cd906aa, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
347 interface ID2D1BitmapBrush(ID2D1BitmapBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) {
348     fn SetExtendModeX(
349         extendModeX: D2D1_EXTEND_MODE,
350     ) -> (),
351     fn SetExtendModeY(
352         extendModeY: D2D1_EXTEND_MODE,
353     ) -> (),
354     fn SetInterpolationMode(
355         interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE,
356     ) -> (),
357     fn SetBitmap(
358         bitmap: *mut ID2D1Bitmap,
359     ) -> (),
360     fn GetExtendModeX() -> D2D1_EXTEND_MODE,
361     fn GetExtendModeY() -> D2D1_EXTEND_MODE,
362     fn GetInterpolationMode() -> D2D1_BITMAP_INTERPOLATION_MODE,
363     fn GetBitmap(
364         bitmap: *mut *mut ID2D1Bitmap,
365     ) -> (),
366 }}
367 RIDL!{#[uuid(0x2cd906a9, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
368 interface ID2D1SolidColorBrush(ID2D1SolidColorBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) {
369     fn SetColor(
370         color: *const D2D1_COLOR_F,
371     ) -> (),
372     #[fixme] fn GetColor() -> D2D1_COLOR_F,
373 }}
374 RIDL!{#[uuid(0x2cd906ab, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
375 interface ID2D1LinearGradientBrush(ID2D1LinearGradientBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) {
376     fn SetStartPoint(
377         startPoint: D2D1_POINT_2F,
378     ) -> (),
379     fn SetEndPoint(
380         endPoint: D2D1_POINT_2F,
381     ) -> (),
382     #[fixme] fn GetStartPoint() -> D2D1_POINT_2F,
383     #[fixme] fn GetEndPoint() -> D2D1_POINT_2F,
384     fn GetGradientStopCollection(
385         gradientStopCollection: *mut *mut ID2D1GradientStopCollection,
386     ) -> (),
387 }}
388 RIDL!{#[uuid(0x2cd906ac, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
389 interface ID2D1RadialGradientBrush(ID2D1RadialGradientBrushVtbl): ID2D1Brush(ID2D1BrushVtbl) {
390     fn SetCenter(
391         center: D2D1_POINT_2F,
392     ) -> (),
393     fn SetGradientOriginOffset(
394         gradientOriginOffset: D2D1_POINT_2F,
395     ) -> (),
396     fn SetRadiusX(
397         radiusX: FLOAT,
398     ) -> (),
399     fn SetRadiusY(
400         radiusY: FLOAT,
401     ) -> (),
402     #[fixme] fn GetCenter() -> D2D1_POINT_2F,
403     #[fixme] fn GetGradientOriginOffset() -> D2D1_POINT_2F,
404     fn GetRadiusX() -> FLOAT,
405     fn GetRadiusY() -> FLOAT,
406     fn GetGradientStopCollection(
407         gradientStopCollection: *mut *mut ID2D1GradientStopCollection,
408     ) -> (),
409 }}
410 RIDL!{#[uuid(0x2cd9069d, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
411 interface ID2D1StrokeStyle(ID2D1StrokeStyleVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
412     fn GetStartCap() -> D2D1_CAP_STYLE,
413     fn GetEndCap() -> D2D1_CAP_STYLE,
414     fn GetDashCap() -> D2D1_CAP_STYLE,
415     fn GetMiterLimit() -> FLOAT,
416     fn GetLineJoin() -> D2D1_LINE_JOIN,
417     fn GetDashOffset() -> FLOAT,
418     fn GetDashStyle() -> D2D1_DASH_STYLE,
419     fn GetDashesCount() -> UINT32,
420     fn GetDashes(
421         dashes: *mut FLOAT,
422         dashesCount: UINT32,
423     ) -> (),
424 }}
425 RIDL!{#[uuid(0x2cd906a1, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
426 interface ID2D1Geometry(ID2D1GeometryVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
427     fn GetBounds(
428         worldTransform: *const D2D1_MATRIX_3X2_F,
429         bounds: *mut D2D1_RECT_F,
430     ) -> HRESULT,
431     fn GetWidenedBounds(
432         strokeWidth: FLOAT,
433         strokeStyle: *mut ID2D1StrokeStyle,
434         worldTransform: *const D2D1_MATRIX_3X2_F,
435         flatteningTolerance: FLOAT,
436         bounds: *mut D2D1_RECT_F,
437     ) -> HRESULT,
438     fn StrokeContainsPoint(
439         point: D2D1_POINT_2F,
440         strokeWidth: FLOAT,
441         strokeStyle: *mut ID2D1StrokeStyle,
442         worldTransform: *const D2D1_MATRIX_3X2_F,
443         flatteningTolerance: FLOAT,
444         contains: *mut BOOL,
445     ) -> HRESULT,
446     fn FillContainsPoint(
447         point: D2D1_POINT_2F,
448         worldTransform: *const D2D1_MATRIX_3X2_F,
449         flatteningTolerance: FLOAT,
450         contains: *mut BOOL,
451     ) -> HRESULT,
452     fn CompareWithGeometry(
453         inputGeometry: *mut ID2D1Geometry,
454         inputGeometryTransform: *const D2D1_MATRIX_3X2_F,
455         flatteningTolerance: FLOAT,
456         relation: *mut D2D1_GEOMETRY_RELATION,
457     ) -> HRESULT,
458     fn Simplify(
459         simplificationOption: D2D1_GEOMETRY_SIMPLIFICATION_OPTION,
460         worldTransform: *const D2D1_MATRIX_3X2_F,
461         flatteningTolerance: FLOAT,
462         geometrySink: *mut ID2D1SimplifiedGeometrySink,
463     ) -> HRESULT,
464     fn Tessellate(
465         worldTransform: *const D2D1_MATRIX_3X2_F,
466         flatteningTolerance: FLOAT,
467         tessellationSink: *mut ID2D1TessellationSink,
468     ) -> HRESULT,
469     fn CombineWithGeometry(
470         inputGeometry: *mut ID2D1Geometry,
471         combineMode: D2D1_COMBINE_MODE,
472         inputGeometryTransform: *const D2D1_MATRIX_3X2_F,
473         flatteningTolerance: FLOAT,
474         geometrySink: *mut ID2D1SimplifiedGeometrySink,
475     ) -> HRESULT,
476     fn Outline(
477         worldTransform: *const D2D1_MATRIX_3X2_F,
478         flatteningTolerance: FLOAT,
479         geometrySink: *mut ID2D1SimplifiedGeometrySink,
480     ) -> HRESULT,
481     fn ComputeArea(
482         worldTransform: *const D2D1_MATRIX_3X2_F,
483         flatteningTolerance: FLOAT,
484         area: *mut FLOAT,
485     ) -> HRESULT,
486     fn ComputeLength(
487         worldTransform: *const D2D1_MATRIX_3X2_F,
488         flatteningTolerance: FLOAT,
489         length: *mut FLOAT,
490     ) -> HRESULT,
491     fn ComputePointAtLength(
492         length: FLOAT,
493         worldTransform: *const D2D1_MATRIX_3X2_F,
494         flatteningTolerance: FLOAT,
495         point: *mut D2D1_POINT_2F,
496         unitTangentVector: *mut D2D1_POINT_2F,
497     ) -> HRESULT,
498     fn Widen(
499         strokeWidth: FLOAT,
500         strokeStyle: *mut ID2D1StrokeStyle,
501         worldTransform: *const D2D1_MATRIX_3X2_F,
502         flatteningTolerance: FLOAT,
503         geometrySink: *mut ID2D1SimplifiedGeometrySink,
504     ) -> HRESULT,
505 }}
506 RIDL!{#[uuid(0x2cd906a2, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
507 interface ID2D1RectangleGeometry(ID2D1RectangleGeometryVtbl): ID2D1Geometry(ID2D1GeometryVtbl) {
508     fn GetRect(
509         rect: *mut D2D1_RECT_F,
510     ) -> (),
511 }}
512 RIDL!{#[uuid(0x2cd906a3, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
513 interface ID2D1RoundedRectangleGeometry(ID2D1RoundedRectangleGeometryVtbl):
514     ID2D1Geometry(ID2D1GeometryVtbl) {
515     fn GetRoundedRect(
516         roundedRect: *mut D2D1_ROUNDED_RECT,
517     ) -> (),
518 }}
519 RIDL!{#[uuid(0x2cd906a4, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
520 interface ID2D1EllipseGeometry(ID2D1EllipseGeometryVtbl): ID2D1Geometry(ID2D1GeometryVtbl) {
521     fn GetEllipse(
522         ellipse: *mut D2D1_ELLIPSE,
523     ) -> (),
524 }}
525 RIDL!{#[uuid(0x2cd906a6, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
526 interface ID2D1GeometryGroup(ID2D1GeometryGroupVtbl): ID2D1Geometry(ID2D1GeometryVtbl) {
527     fn GetFillMode() -> D2D1_FILL_MODE,
528     fn GetSourceGeometryCount() -> UINT32,
529     fn GetSourceGeometries(
530         geometries: *mut *mut ID2D1Geometry,
531         geometriesCount: UINT32,
532     ) -> (),
533 }}
534 RIDL!{#[uuid(0x2cd906bb, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
535 interface ID2D1TransformedGeometry(ID2D1TransformedGeometryVtbl):
536     ID2D1Geometry(ID2D1GeometryVtbl) {
537     fn GetSourceGeometry(
538         sourceGeometry: *mut *mut ID2D1Geometry,
539     ) -> (),
540     fn GetTransform(
541         transform: *mut D2D1_MATRIX_3X2_F,
542     ) -> (),
543 }}
544 RIDL!{#[uuid(0x2cd9069e, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
545 interface ID2D1SimplifiedGeometrySink(ID2D1SimplifiedGeometrySinkVtbl): IUnknown(IUnknownVtbl) {
546     fn SetFillMode(
547         fillMode: D2D1_FILL_MODE,
548     ) -> (),
549     fn SetSegmentFlags(
550         vertexFlags: D2D1_PATH_SEGMENT,
551     ) -> (),
552     fn BeginFigure(
553         startPoint: D2D1_POINT_2F,
554         figureBegin: D2D1_FIGURE_BEGIN,
555     ) -> (),
556     fn AddLines(
557         points: *const D2D1_POINT_2F,
558         pointsCount: UINT32,
559     ) -> (),
560     fn AddBeziers(
561         beziers: *const D2D1_BEZIER_SEGMENT,
562         beziersCount: UINT32,
563     ) -> (),
564     fn EndFigure(
565         figureEnd: D2D1_FIGURE_END,
566     ) -> (),
567     fn Close() -> HRESULT,
568 }}
569 RIDL!{#[uuid(0x2cd9069f, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
570 interface ID2D1GeometrySink(ID2D1GeometrySinkVtbl):
571     ID2D1SimplifiedGeometrySink(ID2D1SimplifiedGeometrySinkVtbl) {
572     fn AddLine(
573         point: D2D1_POINT_2F,
574     ) -> (),
575     fn AddBezier(
576         bezier: *const D2D1_BEZIER_SEGMENT,
577     ) -> (),
578     fn AddQuadraticBezier(
579         bezier: *const D2D1_QUADRATIC_BEZIER_SEGMENT,
580     ) -> (),
581     fn AddQuadraticBeziers(
582         beziers: *const D2D1_QUADRATIC_BEZIER_SEGMENT,
583         beziersCount: UINT32,
584     ) -> (),
585     fn AddArc(
586         arc: *const D2D1_ARC_SEGMENT,
587     ) -> (),
588 }}
589 RIDL!{#[uuid(0x2cd906c1, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
590 interface ID2D1TessellationSink(ID2D1TessellationSinkVtbl): IUnknown(IUnknownVtbl) {
591     fn AddTriangles(
592         triangles: *const D2D1_TRIANGLE,
593         triangleCount: UINT32,
594     ) -> (),
595     fn Close() -> HRESULT,
596 }}
597 RIDL!{#[uuid(0x2cd906a5, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
598 interface ID2D1PathGeometry(ID2D1PathGeometryVtbl): ID2D1Geometry(ID2D1GeometryVtbl) {
599     fn Open(
600         geometrySink: *mut *mut ID2D1GeometrySink,
601     ) -> HRESULT,
602     fn Stream(
603         geometrySink: *mut ID2D1GeometrySink,
604     ) -> HRESULT,
605     fn GetSegmentCount(
606         count: *mut UINT32,
607     ) -> HRESULT,
608     fn GetFigureCount(
609         count: *mut UINT32,
610     ) -> HRESULT,
611 }}
612 RIDL!{#[uuid(0x2cd906c2, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
613 interface ID2D1Mesh(ID2D1MeshVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
614     fn Open(
615         tessellationSink: *mut *mut ID2D1TessellationSink,
616     ) -> HRESULT,
617 }}
618 RIDL!{#[uuid(0x2cd9069b, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
619 interface ID2D1Layer(ID2D1LayerVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
620     #[fixme] fn GetSize() -> D2D1_SIZE_F,
621 }}
622 RIDL!{#[uuid(0x28506e39, 0xebf6, 0x46a1, 0xbb, 0x47, 0xfd, 0x85, 0x56, 0x5a, 0xb9, 0x57)]
623 interface ID2D1DrawingStateBlock(ID2D1DrawingStateBlockVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
624     fn GetDescription(
625         stateDescription: *mut D2D1_DRAWING_STATE_DESCRIPTION,
626     ) -> (),
627     fn SetDescription(
628         stateDescription: *const D2D1_DRAWING_STATE_DESCRIPTION,
629     ) -> (),
630     fn SetTextRenderingParams(
631         textRenderingParams: *mut IDWriteRenderingParams,
632     ) -> (),
633     fn GetTextRenderingParams(
634         textRenderingParams: *mut *mut IDWriteRenderingParams,
635     ) -> (),
636 }}
637 RIDL!{#[uuid(0x2cd90694, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
638 interface ID2D1RenderTarget(ID2D1RenderTargetVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
639     fn CreateBitmap(
640         size: D2D1_SIZE_U,
641         srcData: *const c_void,
642         pitch: UINT32,
643         bitmapProperties: *const D2D1_BITMAP_PROPERTIES,
644         bitmap: *mut *mut ID2D1Bitmap,
645     ) -> HRESULT,
646     fn CreateBitmapFromWicBitmap(
647         wicBitmapSource: *mut IWICBitmapSource,
648         bitmapProperties: *const D2D1_BITMAP_PROPERTIES,
649         bitmap: *mut *mut ID2D1Bitmap,
650     ) -> HRESULT,
651     fn CreateSharedBitmap(
652         riid: REFIID,
653         data: *const c_void,
654         bitmapProperties: *const D2D1_BITMAP_PROPERTIES,
655         bitmap: *mut *mut ID2D1Bitmap,
656     ) -> HRESULT,
657     fn CreateBitmapBrush(
658         bitmap: *mut ID2D1Bitmap,
659         bitmapBrushProperties: *const D2D1_BITMAP_BRUSH_PROPERTIES,
660         brushProperties: *const D2D1_BRUSH_PROPERTIES,
661         bitmapBrush: *mut *mut ID2D1BitmapBrush,
662     ) -> HRESULT,
663     fn CreateSolidColorBrush(
664         color: *const D2D1_COLOR_F,
665         brushProperties: *const D2D1_BRUSH_PROPERTIES,
666         solidColorBrush: *mut *mut ID2D1SolidColorBrush,
667     ) -> HRESULT,
668     fn CreateGradientStopCollection(
669         gradientStops: *const D2D1_GRADIENT_STOP,
670         gradientStopsCount: UINT32,
671         colorInterpolationGamma: D2D1_GAMMA,
672         extendMode: D2D1_EXTEND_MODE,
673         gradientStopCollection: *mut *mut ID2D1GradientStopCollection,
674     ) -> HRESULT,
675     fn CreateLinearGradientBrush(
676         linearGradientBrushProperties: *const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES,
677         brushProperties: *const D2D1_BRUSH_PROPERTIES,
678         gradientStopCollection: *mut ID2D1GradientStopCollection,
679         linearGradientBrush: *mut *mut ID2D1LinearGradientBrush,
680     ) -> HRESULT,
681     fn CreateRadialGradientBrush(
682         radialGradientBrushProperties: *const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES,
683         brushProperties: *const D2D1_BRUSH_PROPERTIES,
684         gradientStopCollection: *mut ID2D1GradientStopCollection,
685         radialGradientBrush: *mut *mut ID2D1RadialGradientBrush,
686     ) -> HRESULT,
687     fn CreateCompatibleRenderTarget(
688         desiredSize: *const D2D1_SIZE_F,
689         desiredPixelSize: *const D2D1_SIZE_U,
690         desiredFormat: *const D2D1_PIXEL_FORMAT,
691         options: D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS,
692         bitmapRenderTarget: *mut *mut ID2D1BitmapRenderTarget,
693     ) -> HRESULT,
694     fn CreateLayer(
695         size: *const D2D1_SIZE_F,
696         layer: *mut *mut ID2D1Layer,
697     ) -> HRESULT,
698     fn CreateMesh(
699         mesh: *mut *mut ID2D1Mesh,
700     ) -> HRESULT,
701     fn DrawLine(
702         point0: D2D1_POINT_2F,
703         point1: D2D1_POINT_2F,
704         brush: *mut ID2D1Brush,
705         strokeWidth: FLOAT,
706         strokeStype: *mut ID2D1StrokeStyle,
707     ) -> (),
708     fn DrawRectangle(
709         rect: *const D2D1_RECT_F,
710         brush: *mut ID2D1Brush,
711         strokeWidth: FLOAT,
712         strokeStyle: *mut ID2D1StrokeStyle,
713     ) -> (),
714     fn FillRectangle(
715         rect: *const D2D1_RECT_F,
716         brush: *mut ID2D1Brush,
717     ) -> (),
718     fn DrawRoundedRectangle(
719         roundedRect: *const D2D1_ROUNDED_RECT,
720         brush: *mut ID2D1Brush,
721         strokeWidth: FLOAT,
722         strokeStyle: *mut ID2D1StrokeStyle,
723     ) -> (),
724     fn FillRoundedRectangle(
725         roundedRect: *const D2D1_ROUNDED_RECT,
726         brush: *mut ID2D1Brush,
727     ) -> (),
728     fn DrawEllipse(
729         ellipse: *const D2D1_ELLIPSE,
730         brush: *mut ID2D1Brush,
731         strokeWidth: FLOAT,
732         strokeStyle: *mut ID2D1StrokeStyle,
733     ) -> (),
734     fn FillEllipse(
735         ellipse: *const D2D1_ELLIPSE,
736         brush: *mut ID2D1Brush,
737     ) -> (),
738     fn DrawGeometry(
739         geometry: *mut ID2D1Geometry,
740         brush: *mut ID2D1Brush,
741         strokeWidth: FLOAT,
742         strokeStyle: *mut ID2D1StrokeStyle,
743     ) -> (),
744     fn FillGeometry(
745         geometry: *mut ID2D1Geometry,
746         brush: *mut ID2D1Brush,
747         opacityBrush: *mut ID2D1Brush,
748     ) -> (),
749     fn FillMesh(
750         mesh: *mut ID2D1Mesh,
751         brush: *const ID2D1Brush,
752     ) -> (),
753     fn FillOpacityMask(
754         opacityMask: *mut ID2D1Bitmap,
755         brush: *mut ID2D1Brush,
756         content: D2D1_OPACITY_MASK_CONTENT,
757         destinationRectangle: *const D2D1_RECT_F,
758         sourceRectangle: *const D2D1_RECT_F,
759     ) -> (),
760     fn DrawBitmap(
761         bitmap: *mut ID2D1Bitmap,
762         destinationRectangle: *const D2D1_RECT_F,
763         opacity: FLOAT,
764         interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE,
765         sourceRectangle: *const D2D1_RECT_F,
766     ) -> (),
767     fn DrawText(
768         string: *const WCHAR,
769         stringLength: UINT32,
770         textFormat: *mut IDWriteTextFormat,
771         layoutRect: *const D2D1_RECT_F,
772         defaultForegroundBrush: *mut ID2D1Brush,
773         options: D2D1_DRAW_TEXT_OPTIONS,
774         measuringMode: DWRITE_MEASURING_MODE,
775     ) -> (),
776     fn DrawTextLayout(
777         origin: D2D1_POINT_2F,
778         textLayout: *mut IDWriteTextLayout,
779         defaultForegroundBrush: *mut ID2D1Brush,
780         options: D2D1_DRAW_TEXT_OPTIONS,
781     ) -> (),
782     fn DrawGlyphRun(
783         baselineOrigin: D2D1_POINT_2F,
784         glyphRun: *const DWRITE_GLYPH_RUN,
785         foregroundBrush: *mut ID2D1Brush,
786         measuringMode: DWRITE_MEASURING_MODE,
787     ) -> (),
788     fn SetTransform(
789         transform: *const D2D1_MATRIX_3X2_F,
790     ) -> (),
791     fn GetTransform(
792         transform: *mut D2D1_MATRIX_3X2_F,
793     ) -> (),
794     fn SetAntialiasMode(
795         antialiasMode: D2D1_ANTIALIAS_MODE,
796     ) -> (),
797     fn GetAntialiasMode() -> D2D1_ANTIALIAS_MODE,
798     fn SetTextAntialiasMode(
799         textAntialiasMode: D2D1_TEXT_ANTIALIAS_MODE,
800     ) -> (),
801     fn GetTextAntialiasMode() -> D2D1_TEXT_ANTIALIAS_MODE,
802     fn SetTextRenderingParams(
803         textRenderingParams: *mut IDWriteRenderingParams,
804     ) -> (),
805     fn GetTextRenderingParams(
806         textRenderingParams: *mut *mut IDWriteRenderingParams,
807     ) -> (),
808     fn SetTags(
809         tag1: D2D1_TAG,
810         tag2: D2D1_TAG,
811     ) -> (),
812     fn GetTags(
813         tag1: *mut D2D1_TAG,
814         tag2: *mut D2D1_TAG,
815     ) -> (),
816     fn PushLayer(
817         layerParameters: *const D2D1_LAYER_PARAMETERS,
818         layer: *mut ID2D1Layer,
819     ) -> (),
820     fn PopLayer() -> (),
821     fn Flush(
822         tag1: *mut D2D1_TAG,
823         tag2: *mut D2D1_TAG,
824     ) -> HRESULT,
825     fn SaveDrawingState(
826         drawingStateBlock: *mut ID2D1DrawingStateBlock,
827     ) -> (),
828     fn RestoreDrawingState(
829         drawingStateBlock: *mut ID2D1DrawingStateBlock,
830     ) -> (),
831     fn PushAxisAlignedClip(
832         clipRect: *const D2D1_RECT_F,
833         antialiasMode: D2D1_ANTIALIAS_MODE,
834     ) -> (),
835     fn PopAxisAlignedClip() -> (),
836     fn Clear(
837         clearColor: *const D2D1_COLOR_F,
838     ) -> (),
839     fn BeginDraw() -> (),
840     fn EndDraw(
841         tag1: *mut D2D1_TAG,
842         tag2: *mut D2D1_TAG,
843     ) -> HRESULT,
844     #[fixme] fn GetPixelFormat() -> D2D1_PIXEL_FORMAT,
845     fn SetDpi(
846         dpiX: FLOAT,
847         dpiY: FLOAT,
848     ) -> (),
849     fn GetDpi(
850         dpiX: *mut FLOAT,
851         dpiY: *mut FLOAT,
852     ) -> (),
853     #[fixme] fn GetSize() -> D2D1_SIZE_F,
854     #[fixme] fn GetPixelSize() -> D2D1_SIZE_U,
855     fn GetMaximumBitmapSize() -> UINT32,
856     fn IsSupported(
857         renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES,
858     ) -> BOOL,
859 }}
860 RIDL!{#[uuid(0x2cd90695, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
861 interface ID2D1BitmapRenderTarget(ID2D1BitmapRenderTargetVtbl):
862     ID2D1RenderTarget(ID2D1RenderTargetVtbl) {
863     fn GetBitmap(
864         bitmap: *mut *mut ID2D1Bitmap,
865     ) -> HRESULT,
866 }}
867 RIDL!{#[uuid(0x2cd90698, 0x12e2, 0x11dc, 0x9f, 0xed, 0x00, 0x11, 0x43, 0xa0, 0x55, 0xf9)]
868 interface ID2D1HwndRenderTarget(ID2D1HwndRenderTargetVtbl):
869     ID2D1RenderTarget(ID2D1RenderTargetVtbl) {
870     fn CheckWindowState() -> D2D1_WINDOW_STATE,
871     fn Resize(
872         pixelSize: *const D2D1_SIZE_U,
873     ) -> HRESULT,
874     fn GetHwnd() -> HWND,
875 }}
876 RIDL!{#[uuid(0xe0db51c3, 0x6f77, 0x4bae, 0xb3, 0xd5, 0xe4, 0x75, 0x09, 0xb3, 0x58, 0x38)]
877 interface ID2D1GdiInteropRenderTarget(ID2D1GdiInteropRenderTargetVtbl): IUnknown(IUnknownVtbl) {
878     fn GetDC(
879         mode: D2D1_DC_INITIALIZE_MODE,
880         hdc: *mut HDC,
881     ) -> HRESULT,
882     fn ReleaseDC(
883         update: *const RECT,
884     ) -> HRESULT,
885 }}
886 RIDL!{#[uuid(0x1c51bc64, 0xde61, 0x46fd, 0x98, 0x99, 0x63, 0xa5, 0xd8, 0xf0, 0x39, 0x50)]
887 interface ID2D1DCRenderTarget(ID2D1DCRenderTargetVtbl): ID2D1RenderTarget(ID2D1RenderTargetVtbl) {
888     fn BindDC(
889         hDC: HDC,
890         pSubRect: *const RECT,
891     ) -> HRESULT,
892 }}
893 RIDL!{#[uuid(0x06152247, 0x6f50, 0x465a, 0x92, 0x45, 0x11, 0x8b, 0xfd, 0x3b, 0x60, 0x07)]
894 interface ID2D1Factory(ID2D1FactoryVtbl): IUnknown(IUnknownVtbl) {
895     fn ReloadSystemMetrics() -> HRESULT,
896     fn GetDesktopDpi(
897         dpiX: *mut FLOAT,
898         dpiY: *mut FLOAT,
899     ) -> (),
900     fn CreateRectangleGeometry(
901         rectangle: *const D2D1_RECT_F,
902         rectangleGeometry: *mut *mut ID2D1RectangleGeometry,
903     ) -> HRESULT,
904     fn CreateRoundedRectangleGeometry(
905         roundedRectangle: *const D2D1_ROUNDED_RECT,
906         roundedRectangleGeometry: *mut *mut ID2D1RoundedRectangleGeometry,
907     ) -> HRESULT,
908     fn CreateEllipseGeometry(
909         ellipse: *const D2D1_ELLIPSE,
910         ellipseGeometry: *mut *mut ID2D1EllipseGeometry,
911     ) -> HRESULT,
912     fn CreateGeometryGroup(
913         fillMode: D2D1_FILL_MODE,
914         geometries: *mut *mut ID2D1Geometry,
915         geometriesCount: UINT32,
916         geometryGroup: *mut *mut ID2D1GeometryGroup,
917     ) -> HRESULT,
918     fn CreateTransformedGeometry(
919         sourceGeometry: *mut ID2D1Geometry,
920         transform: *const D2D1_MATRIX_3X2_F,
921         transformedGeometry: *mut *mut ID2D1TransformedGeometry,
922     ) -> HRESULT,
923     fn CreatePathGeometry(
924         pathGeometry: *mut *mut ID2D1PathGeometry,
925     ) -> HRESULT,
926     fn CreateStrokeStyle(
927         strokeStyleProperties: *const D2D1_STROKE_STYLE_PROPERTIES,
928         dashes: *const FLOAT,
929         dashesCount: UINT32,
930         strokeStyle: *mut *mut ID2D1StrokeStyle,
931     ) -> HRESULT,
932     fn CreateDrawingStateBlock(
933         drawingStateDescription: *const D2D1_DRAWING_STATE_DESCRIPTION,
934         textRenderingParams: *mut IDWriteRenderingParams,
935         drawingStateBlock: *mut *mut ID2D1DrawingStateBlock,
936     ) -> HRESULT,
937     fn CreateWicBitmapRenderTarget(
938         target: *mut IWICBitmap,
939         renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES,
940         renderTarget: *mut *mut ID2D1RenderTarget,
941     ) -> HRESULT,
942     fn CreateHwndRenderTarget(
943         renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES,
944         hwndRenderTargetProperties: *const D2D1_HWND_RENDER_TARGET_PROPERTIES,
945         hwndRenderTarget: *mut *mut ID2D1HwndRenderTarget,
946     ) -> HRESULT,
947     fn CreateDxgiSurfaceRenderTarget(
948         dxgiSurface: *mut IDXGISurface,
949         renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES,
950         renderTarget: *mut *mut ID2D1RenderTarget,
951     ) -> HRESULT,
952     fn CreateDCRenderTarget(
953         renderTargetProperties: *const D2D1_RENDER_TARGET_PROPERTIES,
954         dcRenderTarget: *mut *mut ID2D1DCRenderTarget,
955     ) -> HRESULT,
956 }}
957 extern "system" {
D2D1CreateFactory( factoryType: D2D1_FACTORY_TYPE, riid: REFIID, pFactoryOptions: *const D2D1_FACTORY_OPTIONS, ppIFactory: *mut *mut c_void, ) -> HRESULT958     pub fn D2D1CreateFactory(
959         factoryType: D2D1_FACTORY_TYPE,
960         riid: REFIID,
961         pFactoryOptions: *const D2D1_FACTORY_OPTIONS,
962         ppIFactory: *mut *mut c_void,
963     ) -> HRESULT;
D2D1MakeRotateMatrix( angle: FLOAT, center: D2D1_POINT_2F, matrix: *mut D2D1_MATRIX_3X2_F, )964     pub fn D2D1MakeRotateMatrix(
965         angle: FLOAT,
966         center: D2D1_POINT_2F,
967         matrix: *mut D2D1_MATRIX_3X2_F,
968     );
D2D1MakeSkewMatrix( angleX: FLOAT, angleY: FLOAT, center: D2D1_POINT_2F, matrix: *mut D2D1_MATRIX_3X2_F, )969     pub fn D2D1MakeSkewMatrix(
970         angleX: FLOAT,
971         angleY: FLOAT,
972         center: D2D1_POINT_2F,
973         matrix: *mut D2D1_MATRIX_3X2_F,
974     );
D2D1IsMatrixInvertible( matrix: *const D2D1_MATRIX_3X2_F, ) -> BOOL975     pub fn D2D1IsMatrixInvertible(
976         matrix: *const D2D1_MATRIX_3X2_F,
977     ) -> BOOL;
D2D1InvertMatrix( matrix: *mut D2D1_MATRIX_3X2_F, ) -> BOOL978     pub fn D2D1InvertMatrix(
979         matrix: *mut D2D1_MATRIX_3X2_F,
980     ) -> BOOL;
D2D1ComputeMaximumScaleFactor( matrix: *const D2D1_MATRIX_3X2_F, ) -> FLOAT981     pub fn D2D1ComputeMaximumScaleFactor(
982         matrix: *const D2D1_MATRIX_3X2_F,
983     ) -> FLOAT;
984 }
985