winapi_ui_automation/um/
d2d1_3.rs

1// Licensed under the Apache License, Version 2.0
2// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4// All files in the project carrying such notice may not be copied, modified, or distributed
5// except according to those terms.
6//! Mappings for the contents of d2d1_3.h
7use ctypes::c_void;
8use shared::basetsd::{UINT16, UINT32, UINT64};
9use shared::dxgi::{IDXGIDevice, IDXGISurface};
10use shared::dxgitype::DXGI_COLOR_SPACE_TYPE;
11use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT};
12use shared::ntdef::WCHAR;
13use shared::winerror::HRESULT;
14use um::d2d1::{
15    D2D1_BITMAP_INTERPOLATION_MODE, D2D1_COLOR_F, D2D1_DRAW_TEXT_OPTIONS, D2D1_GAMMA_1_0,
16    D2D1_GAMMA_2_2, D2D1_MATRIX_3X2_F, D2D1_POINT_2F, D2D1_RECT_F, D2D1_RECT_U, D2D1_SIZE_F,
17    ID2D1Bitmap, ID2D1Brush, ID2D1Image, ID2D1ImageVtbl, ID2D1Resource, ID2D1ResourceVtbl,
18    ID2D1SimplifiedGeometrySink,
19};
20use um::d2d1_1::{
21    D2D1_BUFFER_PRECISION, D2D1_DEVICE_CONTEXT_OPTIONS, D2D1_INTERPOLATION_MODE,
22    D2D1_PRIMITIVE_BLEND, ID2D1ColorContext, ID2D1ColorContextVtbl, ID2D1CommandList,
23    ID2D1GdiMetafile, ID2D1GdiMetafileSink, ID2D1GdiMetafileSinkVtbl, ID2D1GdiMetafileVtbl,
24};
25use um::d2d1_2::{
26    ID2D1CommandSink1, ID2D1CommandSink1Vtbl, ID2D1Device1, ID2D1Device1Vtbl, ID2D1DeviceContext1,
27    ID2D1DeviceContext1Vtbl, ID2D1Factory2, ID2D1Factory2Vtbl,
28};
29use um::d2d1effects::D2D1_BLEND_MODE;
30use um::d2d1svg::ID2D1SvgDocument;
31use um::dcommon::{D2D1_ALPHA_MODE, DWRITE_GLYPH_IMAGE_FORMATS, DWRITE_MEASURING_MODE};
32use um::dwrite::{DWRITE_GLYPH_RUN, IDWriteFontFace, IDWriteTextFormat, IDWriteTextLayout};
33use um::objidlbase::IStream;
34use um::wincodec::IWICBitmapSource;
35ENUM!{enum D2D1_INK_NIB_SHAPE {
36    D2D1_INK_NIB_SHAPE_ROUND = 0,
37    D2D1_INK_NIB_SHAPE_SQUARE = 1,
38}}
39ENUM!{enum D2D1_ORIENTATION {
40    D2D1_ORIENTATION_DEFAULT = 1,
41    D2D1_ORIENTATION_FLIP_HORIZONTAL = 2,
42    D2D1_ORIENTATION_ROTATE_CLOCKWISE180 = 3,
43    D2D1_ORIENTATION_ROTATE_CLOCKWISE180_FLIP_HORIZONTAL = 4,
44    D2D1_ORIENTATION_ROTATE_CLOCKWISE90_FLIP_HORIZONTAL = 5,
45    D2D1_ORIENTATION_ROTATE_CLOCKWISE270 = 6,
46    D2D1_ORIENTATION_ROTATE_CLOCKWISE270_FLIP_HORIZONTAL = 7,
47    D2D1_ORIENTATION_ROTATE_CLOCKWISE90 = 8,
48}}
49ENUM!{enum D2D1_IMAGE_SOURCE_LOADING_OPTIONS {
50    D2D1_IMAGE_SOURCE_LOADING_OPTIONS_NONE = 0,
51    D2D1_IMAGE_SOURCE_LOADING_OPTIONS_RELEASE_SOURCE = 1,
52    D2D1_IMAGE_SOURCE_LOADING_OPTIONS_CACHE_ON_DEMAND = 2,
53}}
54ENUM!{enum D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS {
55    D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_NONE = 0,
56    D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_LOW_QUALITY_PRIMARY_CONVERSION = 1,
57}}
58ENUM!{enum D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS {
59    D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE = 0,
60    D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_DISABLE_DPI_SCALE = 1,
61}}
62STRUCT!{struct D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES {
63    orientation: D2D1_ORIENTATION,
64    scaleX: FLOAT,
65    scaleY: FLOAT,
66    interpolationMode: D2D1_INTERPOLATION_MODE,
67    options: D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS,
68}}
69STRUCT!{struct D2D1_INK_POINT {
70    x: FLOAT,
71    y: FLOAT,
72    radius: FLOAT,
73}}
74STRUCT!{struct D2D1_INK_BEZIER_SEGMENT {
75    point1: D2D1_INK_POINT,
76    point2: D2D1_INK_POINT,
77    point3: D2D1_INK_POINT,
78}}
79STRUCT!{struct D2D1_INK_STYLE_PROPERTIES {
80    nibShape: D2D1_INK_NIB_SHAPE,
81    nibTransform: D2D1_MATRIX_3X2_F,
82}}
83ENUM!{enum D2D1_PATCH_EDGE_MODE {
84    D2D1_PATCH_EDGE_MODE_ALIASED = 0,
85    D2D1_PATCH_EDGE_MODE_ANTIALIASED = 1,
86    D2D1_PATCH_EDGE_MODE_ALIASED_INFLATED = 2,
87}}
88STRUCT!{struct D2D1_GRADIENT_MESH_PATCH {
89    point00: D2D1_POINT_2F,
90    point01: D2D1_POINT_2F,
91    point02: D2D1_POINT_2F,
92    point03: D2D1_POINT_2F,
93    point10: D2D1_POINT_2F,
94    point11: D2D1_POINT_2F,
95    point12: D2D1_POINT_2F,
96    point13: D2D1_POINT_2F,
97    point20: D2D1_POINT_2F,
98    point21: D2D1_POINT_2F,
99    point22: D2D1_POINT_2F,
100    point23: D2D1_POINT_2F,
101    point30: D2D1_POINT_2F,
102    point31: D2D1_POINT_2F,
103    point32: D2D1_POINT_2F,
104    point33: D2D1_POINT_2F,
105    color00: D2D1_COLOR_F,
106    color03: D2D1_COLOR_F,
107    color30: D2D1_COLOR_F,
108    color33: D2D1_COLOR_F,
109    topEdgeMode: D2D1_PATCH_EDGE_MODE,
110    leftEdgeMode: D2D1_PATCH_EDGE_MODE,
111    bottomEdgeMode: D2D1_PATCH_EDGE_MODE,
112    rightEdgeMode: D2D1_PATCH_EDGE_MODE,
113}}
114ENUM!{enum D2D1_SPRITE_OPTIONS {
115    D2D1_SPRITE_OPTIONS_NONE = 0,
116    D2D1_SPRITE_OPTIONS_CLAMP_TO_SOURCE_RECTANGLE = 1,
117}}
118ENUM!{enum D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION {
119    D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DEFAULT = 0,
120    D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DISABLE = 1,
121}}
122ENUM!{enum D2D1_GAMMA1 {
123    D2D1_GAMMA1_G22 = D2D1_GAMMA_2_2,
124    D2D1_GAMMA1_G10 = D2D1_GAMMA_1_0,
125    D2D1_GAMMA1_G2084 = 2,
126}}
127STRUCT!{struct D2D1_SIMPLE_COLOR_PROFILE {
128    redPrimary: D2D1_POINT_2F,
129    greenPrimary: D2D1_POINT_2F,
130    bluePrimary: D2D1_POINT_2F,
131    whitePointXZ: D2D1_POINT_2F,
132    gamma: D2D1_GAMMA1,
133}}
134ENUM!{enum D2D1_COLOR_CONTEXT_TYPE {
135    D2D1_COLOR_CONTEXT_TYPE_ICC = 0,
136    D2D1_COLOR_CONTEXT_TYPE_SIMPLE = 1,
137    D2D1_COLOR_CONTEXT_TYPE_DXGI = 2,
138}}
139DEFINE_GUID!{IID_ID2D1InkStyle,
140    0xbae8b344, 0x23fc, 0x4071, 0x8c, 0xb5, 0xd0, 0x5d, 0x6f, 0x07, 0x38, 0x48}
141DEFINE_GUID!{IID_ID2D1Ink,
142    0xb499923b, 0x7029, 0x478f, 0xa8, 0xb3, 0x43, 0x2c, 0x7c, 0x5f, 0x53, 0x12}
143DEFINE_GUID!{IID_ID2D1GradientMesh,
144    0xf292e401, 0xc050, 0x4cde, 0x83, 0xd7, 0x04, 0x96, 0x2d, 0x3b, 0x23, 0xc2}
145DEFINE_GUID!{IID_ID2D1ImageSource,
146    0xc9b664e5, 0x74a1, 0x4378, 0x9a, 0xc2, 0xee, 0xfc, 0x37, 0xa3, 0xf4, 0xd8}
147DEFINE_GUID!{IID_ID2D1ImageSourceFromWic,
148    0x77395441, 0x1c8f, 0x4555, 0x86, 0x83, 0xf5, 0x0d, 0xab, 0x0f, 0xe7, 0x92}
149DEFINE_GUID!{IID_ID2D1TransformedImageSource,
150    0x7f1f79e5, 0x2796, 0x416c, 0x8f, 0x55, 0x70, 0x0f, 0x91, 0x14, 0x45, 0xe5}
151DEFINE_GUID!{IID_ID2D1LookupTable3D,
152    0x53dd9855, 0xa3b0, 0x4d5b, 0x82, 0xe1, 0x26, 0xe2, 0x5c, 0x5e, 0x57, 0x97}
153DEFINE_GUID!{IID_ID2D1DeviceContext2,
154    0x394ea6a3, 0x0c34, 0x4321, 0x95, 0x0b, 0x6c, 0xa2, 0x0f, 0x0b, 0xe6, 0xc7}
155DEFINE_GUID!{IID_ID2D1Device2,
156    0xa44472e1, 0x8dfb, 0x4e60, 0x84, 0x92, 0x6e, 0x28, 0x61, 0xc9, 0xca, 0x8b}
157DEFINE_GUID!{IID_ID2D1Factory3,
158    0x0869759f, 0x4f00, 0x413f, 0xb0, 0x3e, 0x2b, 0xda, 0x45, 0x40, 0x4d, 0x0f}
159DEFINE_GUID!{IID_ID2D1CommandSink2,
160    0x3bab440e, 0x417e, 0x47df, 0xa2, 0xe2, 0xbc, 0x0b, 0xe6, 0xa0, 0x09, 0x16}
161DEFINE_GUID!{IID_ID2D1GdiMetafile1,
162    0x2e69f9e8, 0xdd3f, 0x4bf9, 0x95, 0xba, 0xc0, 0x4f, 0x49, 0xd7, 0x88, 0xdf}
163DEFINE_GUID!{IID_ID2D1GdiMetafileSink1,
164    0xfd0ecb6b, 0x91e6, 0x411e, 0x86, 0x55, 0x39, 0x5e, 0x76, 0x0f, 0x91, 0xb4}
165DEFINE_GUID!{IID_ID2D1SpriteBatch,
166    0x4dc583bf, 0x3a10, 0x438a, 0x87, 0x22, 0xe9, 0x76, 0x52, 0x24, 0xf1, 0xf1}
167DEFINE_GUID!{IID_ID2D1DeviceContext3,
168    0x235a7496, 0x8351, 0x414c, 0xbc, 0xd4, 0x66, 0x72, 0xab, 0x2d, 0x8e, 0x00}
169DEFINE_GUID!{IID_ID2D1Device3,
170    0x852f2087, 0x802c, 0x4037, 0xab, 0x60, 0xff, 0x2e, 0x7e, 0xe6, 0xfc, 0x01}
171DEFINE_GUID!{IID_ID2D1Factory4,
172    0xbd4ec2d2, 0x0662, 0x4bee, 0xba, 0x8e, 0x6f, 0x29, 0xf0, 0x32, 0xe0, 0x96}
173DEFINE_GUID!{IID_ID2D1CommandSink3,
174    0x18079135, 0x4cf3, 0x4868, 0xbc, 0x8e, 0x06, 0x06, 0x7e, 0x6d, 0x24, 0x2d}
175DEFINE_GUID!{IID_ID2D1SvgGlyphStyle,
176    0xaf671749, 0xd241, 0x4db8, 0x8e, 0x41, 0xdc, 0xc2, 0xe5, 0xc1, 0xa4, 0x38}
177DEFINE_GUID!{IID_ID2D1DeviceContext4,
178    0x8c427831, 0x3d90, 0x4476, 0xb6, 0x47, 0xc4, 0xfa, 0xe3, 0x49, 0xe4, 0xdb}
179DEFINE_GUID!{IID_ID2D1Device4,
180    0xd7bdb159, 0x5683, 0x4a46, 0xbc, 0x9c, 0x72, 0xdc, 0x72, 0x0b, 0x85, 0x8b}
181DEFINE_GUID!{IID_ID2D1Factory5,
182    0xc4349994, 0x838e, 0x4b0f, 0x8c, 0xab, 0x44, 0x99, 0x7d, 0x9e, 0xea, 0xcc}
183DEFINE_GUID!{IID_ID2D1CommandSink4,
184    0xc78a6519, 0x40d6, 0x4218, 0xb2, 0xde, 0xbe, 0xee, 0xb7, 0x44, 0xbb, 0x3e}
185DEFINE_GUID!{IID_ID2D1ColorContext1,
186    0x1ab42875, 0xc57f, 0x4be9, 0xbd, 0x85, 0x9c, 0xd7, 0x8d, 0x6f, 0x55, 0xee}
187DEFINE_GUID!{IID_ID2D1DeviceContext5,
188    0x7836d248, 0x68cc, 0x4df6, 0xb9, 0xe8, 0xde, 0x99, 0x1b, 0xf6, 0x2e, 0xb7}
189DEFINE_GUID!{IID_ID2D1Device5,
190    0xd55ba0a4, 0x6405, 0x4694, 0xae, 0xf5, 0x08, 0xee, 0x1a, 0x43, 0x58, 0xb4}
191DEFINE_GUID!{IID_ID2D1Factory6,
192    0xf9976f46, 0xf642, 0x44c1, 0x97, 0xca, 0xda, 0x32, 0xea, 0x2a, 0x26, 0x35}
193DEFINE_GUID!{IID_ID2D1CommandSink5,
194    0x7047dd26, 0xb1e7, 0x44a7, 0x95, 0x9a, 0x83, 0x49, 0xe2, 0x14, 0x4f, 0xa8}
195DEFINE_GUID!{IID_ID2D1DeviceContext6,
196    0x985f7e37, 0x4ed0, 0x4a19, 0x98, 0xa3, 0x15, 0xb0, 0xed, 0xfd, 0xe3, 0x06}
197DEFINE_GUID!{IID_ID2D1Device6,
198    0x7bfef914, 0x2d75, 0x4bad, 0xbe, 0x87, 0xe1, 0x8d, 0xdb, 0x07, 0x7b, 0x6d}
199DEFINE_GUID!{IID_ID2D1Factory7,
200    0xbdc2bdd3, 0xb96c, 0x4de6, 0xbd, 0xf7, 0x99, 0xd4, 0x74, 0x54, 0x54, 0xde}
201RIDL!{#[uuid(0xbae8b344, 0x23fc, 0x4071, 0x8c, 0xb5, 0xd0, 0x5d, 0x6f, 0x07, 0x38, 0x48)]
202interface ID2D1InkStyle(ID2D1InkStyleVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
203    fn SetNibTransform(
204        transform: *const D2D1_MATRIX_3X2_F,
205    ) -> (),
206    fn GetNibTransform(
207        transform: *mut D2D1_MATRIX_3X2_F,
208    ) -> (),
209    fn SetNibShape(
210        nibShape: D2D1_INK_NIB_SHAPE,
211    ) -> (),
212    fn GetNibShape() -> D2D1_INK_NIB_SHAPE,
213}}
214RIDL!{#[uuid(0xb499923b, 0x7029, 0x478f, 0xa8, 0xb3, 0x43, 0x2c, 0x7c, 0x5f, 0x53, 0x12)]
215interface ID2D1Ink(ID2D1InkVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
216    fn SetStartPoint(
217        startPoint: *const D2D1_INK_POINT,
218    ) -> (),
219    fn GetStartPoint() -> D2D1_INK_POINT,
220    fn AddSegments(
221        segments: *const D2D1_INK_BEZIER_SEGMENT,
222        segmentsCount: UINT32,
223    ) -> HRESULT,
224    fn RemoveSegmentsAtEnd(
225        segmentsCount: UINT32,
226    ) -> HRESULT,
227    fn SetSegments(
228        startSegment: UINT32,
229        segments: *const D2D1_INK_BEZIER_SEGMENT,
230        segmentsCount: UINT32,
231    ) -> HRESULT,
232    fn SetSegmentAtEnd(
233        segment: *const D2D1_INK_BEZIER_SEGMENT,
234    ) -> HRESULT,
235    fn GetSegmentCount() -> UINT32,
236    fn GetSegments(
237        startSegment: UINT32,
238        segments: *mut D2D1_INK_BEZIER_SEGMENT,
239        segmentsCount: UINT32,
240    ) -> HRESULT,
241    fn StreamAsGeometry(
242        inkStyle: *mut ID2D1InkStyle,
243        worldTransform: *const D2D1_MATRIX_3X2_F,
244        flatteningTolerance: FLOAT,
245        geometrySink: *mut ID2D1SimplifiedGeometrySink,
246    ) -> HRESULT,
247    fn GetBounds(
248        inkStyle: *mut ID2D1InkStyle,
249        worldTransform: *const D2D1_MATRIX_3X2_F,
250        bounds: *mut D2D1_RECT_F,
251    ) -> HRESULT,
252}}
253RIDL!{#[uuid(0xf292e401, 0xc050, 0x4cde, 0x83, 0xd7, 0x04, 0x96, 0x2d, 0x3b, 0x23, 0xc2)]
254interface ID2D1GradientMesh(ID2D1GradientMeshVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
255    fn GetPatchCount() -> UINT32,
256    fn GetPatches(
257        startIndex: UINT32,
258        patches: *mut D2D1_GRADIENT_MESH_PATCH,
259        patchesCount: UINT32,
260    ) -> HRESULT,
261}}
262RIDL!{#[uuid(0xc9b664e5, 0x74a1, 0x4378, 0x9a, 0xc2, 0xee, 0xfc, 0x37, 0xa3, 0xf4, 0xd8)]
263interface ID2D1ImageSource(ID2D1ImageSourceVtbl): ID2D1Image(ID2D1ImageVtbl) {
264    fn OfferResources() -> HRESULT,
265    fn TryReclaimResources(
266        resourcesDiscarded: *mut BOOL,
267    ) -> HRESULT,
268}}
269RIDL!{#[uuid(0x77395441, 0x1c8f, 0x4555, 0x86, 0x83, 0xf5, 0x0d, 0xab, 0x0f, 0xe7, 0x92)]
270interface ID2D1ImageSourceFromWic(ID2D1ImageSourceFromWicVtbl):
271    ID2D1ImageSource(ID2D1ImageSourceVtbl) {
272    fn EnsureCached(
273        rectangleToFill: *const D2D1_RECT_U,
274    ) -> HRESULT,
275    fn TrimCache(
276        rectangleToPreserve: *const D2D1_RECT_U,
277    ) -> HRESULT,
278    fn GetSource(
279        wicBitmapSource: *mut *mut IWICBitmapSource,
280    ) -> (),
281}}
282RIDL!{#[uuid(0x7f1f79e5, 0x2796, 0x416c, 0x8f, 0x55, 0x70, 0x0f, 0x91, 0x14, 0x45, 0xe5)]
283interface ID2D1TransformedImageSource(ID2D1TransformedImageSourceVtbl):
284    ID2D1Image(ID2D1ImageVtbl) {
285    fn GetSource(
286        imageSource: *mut *mut ID2D1ImageSource,
287    ) -> (),
288    fn GetProperties(
289        properties: *mut D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES,
290    ) -> (),
291}}
292RIDL!{#[uuid(0x53dd9855, 0xa3b0, 0x4d5b, 0x82, 0xe1, 0x26, 0xe2, 0x5c, 0x5e, 0x57, 0x97)]
293interface ID2D1LookupTable3D(ID2D1LookupTable3DVtbl): ID2D1Resource(ID2D1ResourceVtbl) {}}
294RIDL!{#[uuid(0x394ea6a3, 0x0c34, 0x4321, 0x95, 0x0b, 0x6c, 0xa2, 0x0f, 0x0b, 0xe6, 0xc7)]
295interface ID2D1DeviceContext2(ID2D1DeviceContext2Vtbl):
296    ID2D1DeviceContext1(ID2D1DeviceContext1Vtbl) {
297    fn CreateInk(
298        startPoint: *const D2D1_INK_POINT,
299        ink: *mut *mut ID2D1Ink,
300    ) -> HRESULT,
301    fn CreateInkStyle(
302        inkStyleProperties: *const D2D1_INK_STYLE_PROPERTIES,
303        inkStyle: *mut *mut ID2D1InkStyle,
304    ) -> HRESULT,
305    fn CreateGradientMesh(
306        patches: *const D2D1_GRADIENT_MESH_PATCH,
307        patchesCount: UINT32,
308        gradientMesh: *mut *mut ID2D1GradientMesh,
309    ) -> HRESULT,
310    fn CreateImageSourceFromWic(
311        wicBitmapSource: *mut IWICBitmapSource,
312        loadingOptions: D2D1_IMAGE_SOURCE_LOADING_OPTIONS,
313        alphaMode: D2D1_ALPHA_MODE,
314        imageSource: *mut *mut ID2D1ImageSourceFromWic,
315    ) -> HRESULT,
316    fn CreateLookupTable3D(
317        precision: D2D1_BUFFER_PRECISION,
318        extents: *const UINT32,
319        data: *const BYTE,
320        dataCount: UINT32,
321        strides: *const UINT32,
322        lookupTable: *mut *mut ID2D1LookupTable3D,
323    ) -> HRESULT,
324    fn CreateImageSourceFromDxgi(
325        surfaces: *const *mut IDXGISurface,
326        surfaceCount: UINT32,
327        colorSpace: DXGI_COLOR_SPACE_TYPE,
328        options: D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS,
329        imageSource: *mut *mut ID2D1ImageSource,
330    ) -> HRESULT,
331    fn GetGradientMeshWorldBounds(
332        gradientMesh: *mut ID2D1GradientMesh,
333        pBounds: *mut D2D1_RECT_F,
334    ) -> HRESULT,
335    fn DrawInk(
336        ink: *mut ID2D1Ink,
337        brush: *mut ID2D1Brush,
338        inkStyle: *mut ID2D1InkStyle,
339    ) -> (),
340    fn DrawGradientMesh(
341        gradientMesh: *mut ID2D1GradientMesh,
342    ) -> (),
343    fn DrawGdiMetafile(
344        gdiMetafile: *mut ID2D1GdiMetafile,
345        destinationRectangle: *const D2D1_RECT_F,
346        sourceRectangle: *const D2D1_RECT_F,
347    ) -> (),
348    fn CreateTransformedImageSource(
349        imageSource: *mut ID2D1ImageSource,
350        properties: *const D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES,
351        transformedImageSource: *mut *mut ID2D1TransformedImageSource,
352    ) -> HRESULT,
353}}
354RIDL!{#[uuid(0xa44472e1, 0x8dfb, 0x4e60, 0x84, 0x92, 0x6e, 0x28, 0x61, 0xc9, 0xca, 0x8b)]
355interface ID2D1Device2(ID2D1Device2Vtbl): ID2D1Device1(ID2D1Device1Vtbl) {
356    fn CreateDeviceContext(
357        options: D2D1_DEVICE_CONTEXT_OPTIONS,
358        deviceContext2: *mut *mut ID2D1DeviceContext2,
359    ) -> HRESULT,
360    fn FlushDeviceContexts(
361        bitmap: *mut ID2D1Bitmap,
362    ) -> (),
363    fn GetDxgiDevice(
364        dxgiDevice: *mut *mut IDXGIDevice,
365    ) -> HRESULT,
366}}
367RIDL!{#[uuid(0x0869759f, 0x4f00, 0x413f, 0xb0, 0x3e, 0x2b, 0xda, 0x45, 0x40, 0x4d, 0x0f)]
368interface ID2D1Factory3(ID2D1Factory3Vtbl): ID2D1Factory2(ID2D1Factory2Vtbl) {
369    fn CreateDevice(
370        dxgiDevice: *mut IDXGIDevice,
371        d2dDevice2: *mut *mut ID2D1Device2,
372    ) -> HRESULT,
373}}
374RIDL!{#[uuid(0x3bab440e, 0x417e, 0x47df, 0xa2, 0xe2, 0xbc, 0x0b, 0xe6, 0xa0, 0x09, 0x16)]
375interface ID2D1CommandSink2(ID2D1CommandSink2Vtbl): ID2D1CommandSink1(ID2D1CommandSink1Vtbl) {
376    fn DrawInk(
377        ink: *mut ID2D1Ink,
378        brush: *mut ID2D1Brush,
379        inkStyle: *mut ID2D1InkStyle,
380    ) -> (),
381    fn DrawGradientMesh(
382        gradientMesh: *mut ID2D1GradientMesh,
383    ) -> (),
384    fn DrawGdiMetafile(
385        gdiMetafile: *mut ID2D1GdiMetafile,
386        destinationRectangle: *const D2D1_RECT_F,
387        sourceRectangle: *const D2D1_RECT_F,
388    ) -> (),
389}}
390RIDL!{#[uuid(0x2e69f9e8, 0xdd3f, 0x4bf9, 0x95, 0xba, 0xc0, 0x4f, 0x49, 0xd7, 0x88, 0xdf)]
391interface ID2D1GdiMetafile1(ID2D1GdiMetafile1Vtbl): ID2D1GdiMetafile(ID2D1GdiMetafileVtbl) {
392    fn GetDpi(
393        dpiX: *mut FLOAT,
394        dpiY: *mut FLOAT,
395    ) -> HRESULT,
396    fn GetSourceBounds(
397        bounds: *mut D2D1_RECT_F,
398    ) -> HRESULT,
399}}
400RIDL!{#[uuid(0xfd0ecb6b, 0x91e6, 0x411e, 0x86, 0x55, 0x39, 0x5e, 0x76, 0x0f, 0x91, 0xb4)]
401interface ID2D1GdiMetafileSink1(ID2D1GdiMetafileSink1Vtbl):
402    ID2D1GdiMetafileSink(ID2D1GdiMetafileSinkVtbl) {
403    fn ProcessRecord(
404        recordType: DWORD,
405        recordData: *const c_void,
406        recordDataSize: DWORD,
407        flags: UINT32,
408    ) -> HRESULT,
409}}
410RIDL!{#[uuid(0x4dc583bf, 0x3a10, 0x438a, 0x87, 0x22, 0xe9, 0x76, 0x52, 0x24, 0xf1, 0xf1)]
411interface ID2D1SpriteBatch(ID2D1SpriteBatchVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
412    fn AddSprites(
413        spriteCount: UINT32,
414        destinationRectangle: *const D2D1_RECT_F,
415        sourceRectangles: *const D2D1_RECT_U,
416        colors: *const D2D1_COLOR_F,
417        transforms: *const D2D1_MATRIX_3X2_F,
418        destinationRectanglesStride: UINT32,
419        sourceRectanglesStride: UINT32,
420        colorsStride: UINT32,
421        transformsStride: D2D1_MATRIX_3X2_F,
422    ) -> HRESULT,
423    fn SetSprites(
424        startIndex: UINT32,
425        spriteCount: UINT32,
426        destinationRectangle: *const D2D1_RECT_F,
427        sourceRectangles: *const D2D1_RECT_U,
428        colors: *const D2D1_COLOR_F,
429        transforms: *const D2D1_MATRIX_3X2_F,
430        destinationRectanglesStride: UINT32,
431        sourceRectanglesStride: UINT32,
432        colorsStride: UINT32,
433        transformsStride: D2D1_MATRIX_3X2_F,
434    ) -> HRESULT,
435    fn GetSprites(
436        startIndex: UINT32,
437        spriteCount: UINT32,
438        destinationRectangle: *mut D2D1_RECT_F,
439        sourceRectangles: *mut D2D1_RECT_U,
440        colors: *mut D2D1_COLOR_F,
441        transforms: *mut D2D1_MATRIX_3X2_F,
442    ) -> HRESULT,
443    fn GetSpriteCount() -> UINT32,
444    fn Clear() -> (),
445}}
446RIDL!{#[uuid(0x235a7496, 0x8351, 0x414c, 0xbc, 0xd4, 0x66, 0x72, 0xab, 0x2d, 0x8e, 0x00)]
447interface ID2D1DeviceContext3(ID2D1DeviceContext3Vtbl):
448    ID2D1DeviceContext2(ID2D1DeviceContext2Vtbl) {
449    fn CreateSpriteBatch(
450        spriteBatch: *mut *mut ID2D1SpriteBatch,
451    ) -> HRESULT,
452    fn DrawSpriteBatch(
453        spriteBatch: *mut ID2D1SpriteBatch,
454        startIndex: UINT32,
455        spriteCount: UINT32,
456        bitmap: *mut ID2D1Bitmap,
457        interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE,
458        spriteOptions: D2D1_SPRITE_OPTIONS,
459    ) -> (),
460}}
461RIDL!{#[uuid(0x852f2087, 0x802c, 0x4037, 0xab, 0x60, 0xff, 0x2e, 0x7e, 0xe6, 0xfc, 0x01)]
462interface ID2D1Device3(ID2D1Device3Vtbl): ID2D1Device2(ID2D1Device2Vtbl) {
463    fn CreateDeviceContext(
464        options: D2D1_DEVICE_CONTEXT_OPTIONS,
465        deviceContext3: *mut *mut ID2D1DeviceContext3,
466    ) -> HRESULT,
467}}
468RIDL!{#[uuid(0xbd4ec2d2, 0x0662, 0x4bee, 0xba, 0x8e, 0x6f, 0x29, 0xf0, 0x32, 0xe0, 0x96)]
469interface ID2D1Factory4(ID2D1Factory4Vtbl): ID2D1Factory3(ID2D1Factory3Vtbl) {
470    fn CreateDevice(
471        dxgiDevice: *mut IDXGIDevice,
472        d2dDevice3: *mut *mut ID2D1Device3,
473    ) -> HRESULT,
474}}
475RIDL!{#[uuid(0x18079135, 0x4cf3, 0x4868, 0xbc, 0x8e, 0x06, 0x06, 0x7e, 0x6d, 0x24, 0x2d)]
476interface ID2D1CommandSink3(ID2D1CommandSink3Vtbl): ID2D1CommandSink2(ID2D1CommandSink2Vtbl) {
477    fn DrawSpriteBatch(
478        spriteBatch: *mut ID2D1SpriteBatch,
479        startIndex: UINT32,
480        spriteCount: UINT32,
481        bitmap: *mut ID2D1Bitmap,
482        interpolationMode: D2D1_BITMAP_INTERPOLATION_MODE,
483        spriteOptions: D2D1_SPRITE_OPTIONS,
484    ) -> (),
485}}
486RIDL!{#[uuid(0xaf671749, 0xd241, 0x4db8, 0x8e, 0x41, 0xdc, 0xc2, 0xe5, 0xc1, 0xa4, 0x38)]
487interface ID2D1SvgGlyphStyle(ID2D1SvgGlyphStyleVtbl): ID2D1Resource(ID2D1ResourceVtbl) {
488    fn SetFill(
489        brush: *mut ID2D1Brush,
490    ) -> HRESULT,
491    fn GetFill(
492        brush: *mut *mut ID2D1Brush,
493    ) -> (),
494    fn SetStroke(
495        brush: *mut ID2D1Brush,
496        strokeWidth: FLOAT,
497        dashes: *const FLOAT,
498        dashesCount: UINT32,
499        dashOffset: FLOAT,
500    ) -> HRESULT,
501    fn GetStrokeDashesCount() -> UINT32,
502    fn GetStroke(
503        brush: *mut *mut ID2D1Brush,
504        strokeWidth: *mut FLOAT,
505        dashes: *mut FLOAT,
506        dashesCount: UINT32,
507        dashOffset: *mut FLOAT,
508    ) -> (),
509}}
510RIDL!{#[uuid(0x8c427831, 0x3d90, 0x4476, 0xb6, 0x47, 0xc4, 0xfa, 0xe3, 0x49, 0xe4, 0xdb)]
511interface ID2D1DeviceContext4(ID2D1DeviceContext4Vtbl):
512    ID2D1DeviceContext3(ID2D1DeviceContext3Vtbl) {
513    fn CreateSvgGlyphStyle(
514        svgGlyphStyle: *mut *mut ID2D1SvgGlyphStyle,
515    ) -> HRESULT,
516    fn DrawText(
517        string: *const WCHAR,
518        stringLength: UINT32,
519        textFormat: *mut IDWriteTextFormat,
520        layoutRect: *const D2D1_RECT_F,
521        defaultFillBrush: *mut ID2D1Brush,
522        svgGlyphStyle: *mut ID2D1SvgGlyphStyle,
523        colorPaletteIndex: UINT32,
524        options: D2D1_DRAW_TEXT_OPTIONS,
525        measuringMode: DWRITE_MEASURING_MODE,
526    ) -> (),
527    fn DrawTextLayout(
528        origin: D2D1_POINT_2F,
529        textLayout: *mut IDWriteTextLayout,
530        defaultFillBrush: *mut ID2D1Brush,
531        svgGlyphStyle: *mut ID2D1SvgGlyphStyle,
532        colorPaletteIndex: UINT32,
533        options: D2D1_DRAW_TEXT_OPTIONS,
534    ) -> (),
535    fn DrawColorBitmapGlyphRun(
536        glyphImageFormat: DWRITE_GLYPH_IMAGE_FORMATS,
537        baselineOrigin: D2D1_POINT_2F,
538        glyphRun: *const DWRITE_GLYPH_RUN,
539        measuringMode: DWRITE_MEASURING_MODE,
540        bitmapSnapOption: D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION,
541    ) -> (),
542    fn DrawSvgGlyphRun(
543        baselineOrigin: D2D1_POINT_2F,
544        glyphRun: *const DWRITE_GLYPH_RUN,
545        defaultFillBrush: *mut ID2D1Brush,
546        svgGlyphStyle: *mut ID2D1SvgGlyphStyle,
547        colorPaletteIndex: UINT32,
548        measuringMode: DWRITE_MEASURING_MODE,
549    ) -> (),
550    fn GetColorBitmapGlyphImage(
551        glyphImageFormat: DWRITE_GLYPH_IMAGE_FORMATS,
552        glyphOrigin: D2D1_POINT_2F,
553        fontFace: *mut IDWriteFontFace,
554        fontEmSize: FLOAT,
555        glyphIndex: UINT16,
556        isSideways: BOOL,
557        worldTransform: *const D2D1_MATRIX_3X2_F,
558        dpiX: FLOAT,
559        dpiY: FLOAT,
560        glyphTransform: *mut D2D1_MATRIX_3X2_F,
561        glyphImage: *mut *mut ID2D1Image,
562    ) -> HRESULT,
563    fn GetSvgGlyphImage(
564        glyphImageFormat: DWRITE_GLYPH_IMAGE_FORMATS,
565        glyphOrigin: D2D1_POINT_2F,
566        fontFace: *mut IDWriteFontFace,
567        fontEmSize: FLOAT,
568        glyphIndex: UINT16,
569        isSideways: BOOL,
570        worldTransform: *const D2D1_MATRIX_3X2_F,
571        defaultFillBrush: *mut ID2D1Brush,
572        svgGlyphStyle: *mut ID2D1SvgGlyphStyle,
573        colorPaletteIndex: UINT32,
574        glyphTransform: *mut D2D1_MATRIX_3X2_F,
575        glyphImage: *mut *mut ID2D1CommandList,
576    ) -> HRESULT,
577}}
578RIDL!{#[uuid(0xd7bdb159, 0x5683, 0x4a46, 0xbc, 0x9c, 0x72, 0xdc, 0x72, 0x0b, 0x85, 0x8b)]
579interface ID2D1Device4(ID2D1Device4Vtbl): ID2D1Device3(ID2D1Device3Vtbl) {
580    fn CreateDeviceContext(
581        options: D2D1_DEVICE_CONTEXT_OPTIONS,
582        deviceContext4: *mut *mut ID2D1DeviceContext4,
583    ) -> HRESULT,
584    fn SetMaximumColorGlyphCacheMemory(
585        maximumInBytes: UINT64,
586    ) -> (),
587    fn GetMaximumColorGlyphCacheMemory() -> UINT64,
588}}
589RIDL!{#[uuid(0xc4349994, 0x838e, 0x4b0f, 0x8c, 0xab, 0x44, 0x99, 0x7d, 0x9e, 0xea, 0xcc)]
590interface ID2D1Factory5(ID2D1Factory5Vtbl): ID2D1Factory4(ID2D1Factory4Vtbl) {
591    fn CreateDevice(
592        dxgiDevice: *mut IDXGIDevice,
593        d2dDevice4: *mut *mut ID2D1Device4,
594    ) -> HRESULT,
595}}
596RIDL!{#[uuid(0xc78a6519, 0x40d6, 0x4218, 0xb2, 0xde, 0xbe, 0xee, 0xb7, 0x44, 0xbb, 0x3e)]
597interface ID2D1CommandSink4(ID2D1CommandSink4Vtbl): ID2D1CommandSink3(ID2D1CommandSink3Vtbl) {
598    fn SetPrimitiveBlend2(
599        primitiveBlend: D2D1_PRIMITIVE_BLEND,
600    ) -> HRESULT,
601}}
602RIDL!{#[uuid(0x1ab42875, 0xc57f, 0x4be9, 0xbd, 0x85, 0x9c, 0xd7, 0x8d, 0x6f, 0x55, 0xee)]
603interface ID2D1ColorContext1(ID2D1ColorContext1Vtbl): ID2D1ColorContext(ID2D1ColorContextVtbl) {
604    fn GetColorContextType() -> D2D1_COLOR_CONTEXT_TYPE,
605    fn GetDXGIColorSpace() -> DXGI_COLOR_SPACE_TYPE,
606    fn GetSimpleColorProfile(
607        simpleProfile: *mut D2D1_SIMPLE_COLOR_PROFILE,
608    ) -> HRESULT,
609}}
610RIDL!{#[uuid(0x7836d248, 0x68cc, 0x4df6, 0xb9, 0xe8, 0xde, 0x99, 0x1b, 0xf6, 0x2e, 0xb7)]
611interface ID2D1DeviceContext5(ID2D1DeviceContext5Vtbl):
612    ID2D1DeviceContext4(ID2D1DeviceContext4Vtbl) {
613    fn CreateSvgDocument(
614        inputXmlStream: *mut IStream,
615        viewportSize: D2D1_SIZE_F,
616        svgDocument: *mut *mut ID2D1SvgDocument,
617    ) -> HRESULT,
618    fn DrawSvgDocument(
619        svgDocument: *mut ID2D1SvgDocument,
620    ) -> (),
621    fn CreateColorContextFromDxgiColorSpace(
622        colorSpace: DXGI_COLOR_SPACE_TYPE,
623        colorContext: *mut *mut ID2D1ColorContext1,
624    ) -> HRESULT,
625    fn CreateColorContextFromSimpleColorProfile(
626        simpleProfile: *const D2D1_SIMPLE_COLOR_PROFILE,
627        colorContext: *mut *mut ID2D1ColorContext1,
628    ) -> HRESULT,
629}}
630RIDL!{#[uuid(0xd55ba0a4, 0x6405, 0x4694, 0xae, 0xf5, 0x08, 0xee, 0x1a, 0x43, 0x58, 0xb4)]
631interface ID2D1Device5(ID2D1Device5Vtbl): ID2D1Device4(ID2D1Device4Vtbl) {
632    fn CreateDeviceContext(
633        options: D2D1_DEVICE_CONTEXT_OPTIONS,
634        deviceContext5: *mut *mut ID2D1DeviceContext5,
635    ) -> HRESULT,
636}}
637RIDL!{#[uuid(0xf9976f46, 0xf642, 0x44c1, 0x97, 0xca, 0xda, 0x32, 0xea, 0x2a, 0x26, 0x35)]
638interface ID2D1Factory6(ID2D1Factory6Vtbl): ID2D1Factory5(ID2D1Factory5Vtbl) {
639    fn CreateDevice(
640        dxgiDevice: *mut IDXGIDevice,
641        d2dDevice5: *mut *mut ID2D1Device5,
642    ) -> HRESULT,
643}}
644RIDL!{#[uuid(0x7047dd26, 0xb1e7, 0x44a7, 0x95, 0x9a, 0x83, 0x49, 0xe2, 0x14, 0x4f, 0xa8)]
645interface ID2D1CommandSink5(ID2D1CommandSink5Vtbl): ID2D1CommandSink4(ID2D1CommandSink4Vtbl) {
646    fn BlendImage(
647        image: *mut ID2D1Image,
648        blendMode: D2D1_BLEND_MODE,
649        targetOffset: *const D2D1_POINT_2F,
650        imageRectangle: *const D2D1_RECT_F,
651        interpolationMode: D2D1_INTERPOLATION_MODE,
652    ) -> HRESULT,
653}}
654RIDL!{#[uuid(0x985f7e37, 0x4ed0, 0x4a19, 0x98, 0xa3, 0x15, 0xb0, 0xed, 0xfd, 0xe3, 0x06)]
655interface ID2D1DeviceContext6(ID2D1DeviceContext6Vtbl):
656    ID2D1DeviceContext5(ID2D1DeviceContext5Vtbl) {
657    fn BlendImage(
658        image: *mut ID2D1Image,
659        blendMode: D2D1_BLEND_MODE,
660        targetOffset: *const D2D1_POINT_2F,
661        imageRectangle: *const D2D1_RECT_F,
662        interpolationMode: D2D1_INTERPOLATION_MODE,
663    ) -> HRESULT,
664}}
665RIDL!{#[uuid(0x7bfef914, 0x2d75, 0x4bad, 0xbe, 0x87, 0xe1, 0x8d, 0xdb, 0x07, 0x7b, 0x6d)]
666interface ID2D1Device6(ID2D1Device6Vtbl): ID2D1Device5(ID2D1Device5Vtbl) {
667    fn CreateDeviceContext(
668        options: D2D1_DEVICE_CONTEXT_OPTIONS,
669        deviceContext6: *mut *mut ID2D1DeviceContext6,
670    ) -> HRESULT,
671}}
672RIDL!{#[uuid(0xbdc2bdd3, 0xb96c, 0x4de6, 0xbd, 0xf7, 0x99, 0xd4, 0x74, 0x54, 0x54, 0xde)]
673interface ID2D1Factory7(ID2D1Factory7Vtbl): ID2D1Factory6(ID2D1Factory6Vtbl) {
674    fn CreateDevice(
675        dxgiDevice: *mut IDXGIDevice,
676        d2dDevice6: *mut *mut ID2D1Device6,
677    ) -> HRESULT,
678}}
679extern "system" {
680    pub fn D2D1GetGradientMeshInteriorPointsFromCoonsPatch(
681        pPoint0: *const D2D1_POINT_2F,
682        pPoint1: *const D2D1_POINT_2F,
683        pPoint2: *const D2D1_POINT_2F,
684        pPoint3: *const D2D1_POINT_2F,
685        pPoint4: *const D2D1_POINT_2F,
686        pPoint5: *const D2D1_POINT_2F,
687        pPoint6: *const D2D1_POINT_2F,
688        pPoint7: *const D2D1_POINT_2F,
689        pPoint8: *const D2D1_POINT_2F,
690        pPoint9: *const D2D1_POINT_2F,
691        pPoint10: *const D2D1_POINT_2F,
692        pPoint11: *const D2D1_POINT_2F,
693        pTensorPoint11: *mut D2D1_POINT_2F,
694        pTensorPoint12: *mut D2D1_POINT_2F,
695        pTensorPoint21: *mut D2D1_POINT_2F,
696        pTensorPoint22: *mut D2D1_POINT_2F,
697    );
698}