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
7 use ctypes::c_void;
8 use shared::basetsd::{UINT16, UINT32, UINT64};
9 use shared::dxgi::{IDXGIDevice, IDXGISurface};
10 use shared::dxgitype::DXGI_COLOR_SPACE_TYPE;
11 use shared::minwindef::{BOOL, BYTE, DWORD, FLOAT};
12 use shared::ntdef::WCHAR;
13 use shared::winerror::HRESULT;
14 use 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 };
20 use 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 };
25 use um::d2d1_2::{
26     ID2D1CommandSink1, ID2D1CommandSink1Vtbl, ID2D1Device1, ID2D1Device1Vtbl, ID2D1DeviceContext1,
27     ID2D1DeviceContext1Vtbl, ID2D1Factory2, ID2D1Factory2Vtbl,
28 };
29 use um::d2d1effects::D2D1_BLEND_MODE;
30 use um::d2d1svg::ID2D1SvgDocument;
31 use um::dcommon::{D2D1_ALPHA_MODE, DWRITE_GLYPH_IMAGE_FORMATS, DWRITE_MEASURING_MODE};
32 use um::dwrite::{DWRITE_GLYPH_RUN, IDWriteFontFace, IDWriteTextFormat, IDWriteTextLayout};
33 use um::objidlbase::IStream;
34 use um::wincodec::IWICBitmapSource;
35 ENUM!{enum D2D1_INK_NIB_SHAPE {
36     D2D1_INK_NIB_SHAPE_ROUND = 0,
37     D2D1_INK_NIB_SHAPE_SQUARE = 1,
38 }}
39 ENUM!{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 }}
49 ENUM!{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 }}
54 ENUM!{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 }}
58 ENUM!{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 }}
62 STRUCT!{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 }}
69 STRUCT!{struct D2D1_INK_POINT {
70     x: FLOAT,
71     y: FLOAT,
72     radius: FLOAT,
73 }}
74 STRUCT!{struct D2D1_INK_BEZIER_SEGMENT {
75     point1: D2D1_INK_POINT,
76     point2: D2D1_INK_POINT,
77     point3: D2D1_INK_POINT,
78 }}
79 STRUCT!{struct D2D1_INK_STYLE_PROPERTIES {
80     nibShape: D2D1_INK_NIB_SHAPE,
81     nibTransform: D2D1_MATRIX_3X2_F,
82 }}
83 ENUM!{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 }}
88 STRUCT!{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 }}
114 ENUM!{enum D2D1_SPRITE_OPTIONS {
115     D2D1_SPRITE_OPTIONS_NONE = 0,
116     D2D1_SPRITE_OPTIONS_CLAMP_TO_SOURCE_RECTANGLE = 1,
117 }}
118 ENUM!{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 }}
122 ENUM!{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 }}
127 STRUCT!{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 }}
134 ENUM!{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 }}
139 DEFINE_GUID!{IID_ID2D1InkStyle,
140     0xbae8b344, 0x23fc, 0x4071, 0x8c, 0xb5, 0xd0, 0x5d, 0x6f, 0x07, 0x38, 0x48}
141 DEFINE_GUID!{IID_ID2D1Ink,
142     0xb499923b, 0x7029, 0x478f, 0xa8, 0xb3, 0x43, 0x2c, 0x7c, 0x5f, 0x53, 0x12}
143 DEFINE_GUID!{IID_ID2D1GradientMesh,
144     0xf292e401, 0xc050, 0x4cde, 0x83, 0xd7, 0x04, 0x96, 0x2d, 0x3b, 0x23, 0xc2}
145 DEFINE_GUID!{IID_ID2D1ImageSource,
146     0xc9b664e5, 0x74a1, 0x4378, 0x9a, 0xc2, 0xee, 0xfc, 0x37, 0xa3, 0xf4, 0xd8}
147 DEFINE_GUID!{IID_ID2D1ImageSourceFromWic,
148     0x77395441, 0x1c8f, 0x4555, 0x86, 0x83, 0xf5, 0x0d, 0xab, 0x0f, 0xe7, 0x92}
149 DEFINE_GUID!{IID_ID2D1TransformedImageSource,
150     0x7f1f79e5, 0x2796, 0x416c, 0x8f, 0x55, 0x70, 0x0f, 0x91, 0x14, 0x45, 0xe5}
151 DEFINE_GUID!{IID_ID2D1LookupTable3D,
152     0x53dd9855, 0xa3b0, 0x4d5b, 0x82, 0xe1, 0x26, 0xe2, 0x5c, 0x5e, 0x57, 0x97}
153 DEFINE_GUID!{IID_ID2D1DeviceContext2,
154     0x394ea6a3, 0x0c34, 0x4321, 0x95, 0x0b, 0x6c, 0xa2, 0x0f, 0x0b, 0xe6, 0xc7}
155 DEFINE_GUID!{IID_ID2D1Device2,
156     0xa44472e1, 0x8dfb, 0x4e60, 0x84, 0x92, 0x6e, 0x28, 0x61, 0xc9, 0xca, 0x8b}
157 DEFINE_GUID!{IID_ID2D1Factory3,
158     0x0869759f, 0x4f00, 0x413f, 0xb0, 0x3e, 0x2b, 0xda, 0x45, 0x40, 0x4d, 0x0f}
159 DEFINE_GUID!{IID_ID2D1CommandSink2,
160     0x3bab440e, 0x417e, 0x47df, 0xa2, 0xe2, 0xbc, 0x0b, 0xe6, 0xa0, 0x09, 0x16}
161 DEFINE_GUID!{IID_ID2D1GdiMetafile1,
162     0x2e69f9e8, 0xdd3f, 0x4bf9, 0x95, 0xba, 0xc0, 0x4f, 0x49, 0xd7, 0x88, 0xdf}
163 DEFINE_GUID!{IID_ID2D1GdiMetafileSink1,
164     0xfd0ecb6b, 0x91e6, 0x411e, 0x86, 0x55, 0x39, 0x5e, 0x76, 0x0f, 0x91, 0xb4}
165 DEFINE_GUID!{IID_ID2D1SpriteBatch,
166     0x4dc583bf, 0x3a10, 0x438a, 0x87, 0x22, 0xe9, 0x76, 0x52, 0x24, 0xf1, 0xf1}
167 DEFINE_GUID!{IID_ID2D1DeviceContext3,
168     0x235a7496, 0x8351, 0x414c, 0xbc, 0xd4, 0x66, 0x72, 0xab, 0x2d, 0x8e, 0x00}
169 DEFINE_GUID!{IID_ID2D1Device3,
170     0x852f2087, 0x802c, 0x4037, 0xab, 0x60, 0xff, 0x2e, 0x7e, 0xe6, 0xfc, 0x01}
171 DEFINE_GUID!{IID_ID2D1Factory4,
172     0xbd4ec2d2, 0x0662, 0x4bee, 0xba, 0x8e, 0x6f, 0x29, 0xf0, 0x32, 0xe0, 0x96}
173 DEFINE_GUID!{IID_ID2D1CommandSink3,
174     0x18079135, 0x4cf3, 0x4868, 0xbc, 0x8e, 0x06, 0x06, 0x7e, 0x6d, 0x24, 0x2d}
175 DEFINE_GUID!{IID_ID2D1SvgGlyphStyle,
176     0xaf671749, 0xd241, 0x4db8, 0x8e, 0x41, 0xdc, 0xc2, 0xe5, 0xc1, 0xa4, 0x38}
177 DEFINE_GUID!{IID_ID2D1DeviceContext4,
178     0x8c427831, 0x3d90, 0x4476, 0xb6, 0x47, 0xc4, 0xfa, 0xe3, 0x49, 0xe4, 0xdb}
179 DEFINE_GUID!{IID_ID2D1Device4,
180     0xd7bdb159, 0x5683, 0x4a46, 0xbc, 0x9c, 0x72, 0xdc, 0x72, 0x0b, 0x85, 0x8b}
181 DEFINE_GUID!{IID_ID2D1Factory5,
182     0xc4349994, 0x838e, 0x4b0f, 0x8c, 0xab, 0x44, 0x99, 0x7d, 0x9e, 0xea, 0xcc}
183 DEFINE_GUID!{IID_ID2D1CommandSink4,
184     0xc78a6519, 0x40d6, 0x4218, 0xb2, 0xde, 0xbe, 0xee, 0xb7, 0x44, 0xbb, 0x3e}
185 DEFINE_GUID!{IID_ID2D1ColorContext1,
186     0x1ab42875, 0xc57f, 0x4be9, 0xbd, 0x85, 0x9c, 0xd7, 0x8d, 0x6f, 0x55, 0xee}
187 DEFINE_GUID!{IID_ID2D1DeviceContext5,
188     0x7836d248, 0x68cc, 0x4df6, 0xb9, 0xe8, 0xde, 0x99, 0x1b, 0xf6, 0x2e, 0xb7}
189 DEFINE_GUID!{IID_ID2D1Device5,
190     0xd55ba0a4, 0x6405, 0x4694, 0xae, 0xf5, 0x08, 0xee, 0x1a, 0x43, 0x58, 0xb4}
191 DEFINE_GUID!{IID_ID2D1Factory6,
192     0xf9976f46, 0xf642, 0x44c1, 0x97, 0xca, 0xda, 0x32, 0xea, 0x2a, 0x26, 0x35}
193 DEFINE_GUID!{IID_ID2D1CommandSink5,
194     0x7047dd26, 0xb1e7, 0x44a7, 0x95, 0x9a, 0x83, 0x49, 0xe2, 0x14, 0x4f, 0xa8}
195 DEFINE_GUID!{IID_ID2D1DeviceContext6,
196     0x985f7e37, 0x4ed0, 0x4a19, 0x98, 0xa3, 0x15, 0xb0, 0xed, 0xfd, 0xe3, 0x06}
197 DEFINE_GUID!{IID_ID2D1Device6,
198     0x7bfef914, 0x2d75, 0x4bad, 0xbe, 0x87, 0xe1, 0x8d, 0xdb, 0x07, 0x7b, 0x6d}
199 DEFINE_GUID!{IID_ID2D1Factory7,
200     0xbdc2bdd3, 0xb96c, 0x4de6, 0xbd, 0xf7, 0x99, 0xd4, 0x74, 0x54, 0x54, 0xde}
201 RIDL!{#[uuid(0xbae8b344, 0x23fc, 0x4071, 0x8c, 0xb5, 0xd0, 0x5d, 0x6f, 0x07, 0x38, 0x48)]
202 interface 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 }}
214 RIDL!{#[uuid(0xb499923b, 0x7029, 0x478f, 0xa8, 0xb3, 0x43, 0x2c, 0x7c, 0x5f, 0x53, 0x12)]
215 interface 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 }}
253 RIDL!{#[uuid(0xf292e401, 0xc050, 0x4cde, 0x83, 0xd7, 0x04, 0x96, 0x2d, 0x3b, 0x23, 0xc2)]
254 interface 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 }}
262 RIDL!{#[uuid(0xc9b664e5, 0x74a1, 0x4378, 0x9a, 0xc2, 0xee, 0xfc, 0x37, 0xa3, 0xf4, 0xd8)]
263 interface ID2D1ImageSource(ID2D1ImageSourceVtbl): ID2D1Image(ID2D1ImageVtbl) {
264     fn OfferResources() -> HRESULT,
265     fn TryReclaimResources(
266         resourcesDiscarded: *mut BOOL,
267     ) -> HRESULT,
268 }}
269 RIDL!{#[uuid(0x77395441, 0x1c8f, 0x4555, 0x86, 0x83, 0xf5, 0x0d, 0xab, 0x0f, 0xe7, 0x92)]
270 interface 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 }}
282 RIDL!{#[uuid(0x7f1f79e5, 0x2796, 0x416c, 0x8f, 0x55, 0x70, 0x0f, 0x91, 0x14, 0x45, 0xe5)]
283 interface 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 }}
292 RIDL!{#[uuid(0x53dd9855, 0xa3b0, 0x4d5b, 0x82, 0xe1, 0x26, 0xe2, 0x5c, 0x5e, 0x57, 0x97)]
293 interface ID2D1LookupTable3D(ID2D1LookupTable3DVtbl): ID2D1Resource(ID2D1ResourceVtbl) {}}
294 RIDL!{#[uuid(0x394ea6a3, 0x0c34, 0x4321, 0x95, 0x0b, 0x6c, 0xa2, 0x0f, 0x0b, 0xe6, 0xc7)]
295 interface 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 }}
354 RIDL!{#[uuid(0xa44472e1, 0x8dfb, 0x4e60, 0x84, 0x92, 0x6e, 0x28, 0x61, 0xc9, 0xca, 0x8b)]
355 interface 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 }}
367 RIDL!{#[uuid(0x0869759f, 0x4f00, 0x413f, 0xb0, 0x3e, 0x2b, 0xda, 0x45, 0x40, 0x4d, 0x0f)]
368 interface ID2D1Factory3(ID2D1Factory3Vtbl): ID2D1Factory2(ID2D1Factory2Vtbl) {
369     fn CreateDevice(
370         dxgiDevice: *mut IDXGIDevice,
371         d2dDevice2: *mut *mut ID2D1Device2,
372     ) -> HRESULT,
373 }}
374 RIDL!{#[uuid(0x3bab440e, 0x417e, 0x47df, 0xa2, 0xe2, 0xbc, 0x0b, 0xe6, 0xa0, 0x09, 0x16)]
375 interface 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 }}
390 RIDL!{#[uuid(0x2e69f9e8, 0xdd3f, 0x4bf9, 0x95, 0xba, 0xc0, 0x4f, 0x49, 0xd7, 0x88, 0xdf)]
391 interface 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 }}
400 RIDL!{#[uuid(0xfd0ecb6b, 0x91e6, 0x411e, 0x86, 0x55, 0x39, 0x5e, 0x76, 0x0f, 0x91, 0xb4)]
401 interface 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 }}
410 RIDL!{#[uuid(0x4dc583bf, 0x3a10, 0x438a, 0x87, 0x22, 0xe9, 0x76, 0x52, 0x24, 0xf1, 0xf1)]
411 interface 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 }}
446 RIDL!{#[uuid(0x235a7496, 0x8351, 0x414c, 0xbc, 0xd4, 0x66, 0x72, 0xab, 0x2d, 0x8e, 0x00)]
447 interface 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 }}
461 RIDL!{#[uuid(0x852f2087, 0x802c, 0x4037, 0xab, 0x60, 0xff, 0x2e, 0x7e, 0xe6, 0xfc, 0x01)]
462 interface ID2D1Device3(ID2D1Device3Vtbl): ID2D1Device2(ID2D1Device2Vtbl) {
463     fn CreateDeviceContext(
464         options: D2D1_DEVICE_CONTEXT_OPTIONS,
465         deviceContext3: *mut *mut ID2D1DeviceContext3,
466     ) -> HRESULT,
467 }}
468 RIDL!{#[uuid(0xbd4ec2d2, 0x0662, 0x4bee, 0xba, 0x8e, 0x6f, 0x29, 0xf0, 0x32, 0xe0, 0x96)]
469 interface ID2D1Factory4(ID2D1Factory4Vtbl): ID2D1Factory3(ID2D1Factory3Vtbl) {
470     fn CreateDevice(
471         dxgiDevice: *mut IDXGIDevice,
472         d2dDevice3: *mut *mut ID2D1Device3,
473     ) -> HRESULT,
474 }}
475 RIDL!{#[uuid(0x18079135, 0x4cf3, 0x4868, 0xbc, 0x8e, 0x06, 0x06, 0x7e, 0x6d, 0x24, 0x2d)]
476 interface 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 }}
486 RIDL!{#[uuid(0xaf671749, 0xd241, 0x4db8, 0x8e, 0x41, 0xdc, 0xc2, 0xe5, 0xc1, 0xa4, 0x38)]
487 interface 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 }}
510 RIDL!{#[uuid(0x8c427831, 0x3d90, 0x4476, 0xb6, 0x47, 0xc4, 0xfa, 0xe3, 0x49, 0xe4, 0xdb)]
511 interface 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 }}
578 RIDL!{#[uuid(0xd7bdb159, 0x5683, 0x4a46, 0xbc, 0x9c, 0x72, 0xdc, 0x72, 0x0b, 0x85, 0x8b)]
579 interface 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 }}
589 RIDL!{#[uuid(0xc4349994, 0x838e, 0x4b0f, 0x8c, 0xab, 0x44, 0x99, 0x7d, 0x9e, 0xea, 0xcc)]
590 interface ID2D1Factory5(ID2D1Factory5Vtbl): ID2D1Factory4(ID2D1Factory4Vtbl) {
591     fn CreateDevice(
592         dxgiDevice: *mut IDXGIDevice,
593         d2dDevice4: *mut *mut ID2D1Device4,
594     ) -> HRESULT,
595 }}
596 RIDL!{#[uuid(0xc78a6519, 0x40d6, 0x4218, 0xb2, 0xde, 0xbe, 0xee, 0xb7, 0x44, 0xbb, 0x3e)]
597 interface ID2D1CommandSink4(ID2D1CommandSink4Vtbl): ID2D1CommandSink3(ID2D1CommandSink3Vtbl) {
598     fn SetPrimitiveBlend2(
599         primitiveBlend: D2D1_PRIMITIVE_BLEND,
600     ) -> HRESULT,
601 }}
602 RIDL!{#[uuid(0x1ab42875, 0xc57f, 0x4be9, 0xbd, 0x85, 0x9c, 0xd7, 0x8d, 0x6f, 0x55, 0xee)]
603 interface 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 }}
610 RIDL!{#[uuid(0x7836d248, 0x68cc, 0x4df6, 0xb9, 0xe8, 0xde, 0x99, 0x1b, 0xf6, 0x2e, 0xb7)]
611 interface 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 }}
630 RIDL!{#[uuid(0xd55ba0a4, 0x6405, 0x4694, 0xae, 0xf5, 0x08, 0xee, 0x1a, 0x43, 0x58, 0xb4)]
631 interface ID2D1Device5(ID2D1Device5Vtbl): ID2D1Device4(ID2D1Device4Vtbl) {
632     fn CreateDeviceContext(
633         options: D2D1_DEVICE_CONTEXT_OPTIONS,
634         deviceContext5: *mut *mut ID2D1DeviceContext5,
635     ) -> HRESULT,
636 }}
637 RIDL!{#[uuid(0xf9976f46, 0xf642, 0x44c1, 0x97, 0xca, 0xda, 0x32, 0xea, 0x2a, 0x26, 0x35)]
638 interface ID2D1Factory6(ID2D1Factory6Vtbl): ID2D1Factory5(ID2D1Factory5Vtbl) {
639     fn CreateDevice(
640         dxgiDevice: *mut IDXGIDevice,
641         d2dDevice5: *mut *mut ID2D1Device5,
642     ) -> HRESULT,
643 }}
644 RIDL!{#[uuid(0x7047dd26, 0xb1e7, 0x44a7, 0x95, 0x9a, 0x83, 0x49, 0xe2, 0x14, 0x4f, 0xa8)]
645 interface 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 }}
654 RIDL!{#[uuid(0x985f7e37, 0x4ed0, 0x4a19, 0x98, 0xa3, 0x15, 0xb0, 0xed, 0xfd, 0xe3, 0x06)]
655 interface 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 }}
665 RIDL!{#[uuid(0x7bfef914, 0x2d75, 0x4bad, 0xbe, 0x87, 0xe1, 0x8d, 0xdb, 0x07, 0x7b, 0x6d)]
666 interface ID2D1Device6(ID2D1Device6Vtbl): ID2D1Device5(ID2D1Device5Vtbl) {
667     fn CreateDeviceContext(
668         options: D2D1_DEVICE_CONTEXT_OPTIONS,
669         deviceContext6: *mut *mut ID2D1DeviceContext6,
670     ) -> HRESULT,
671 }}
672 RIDL!{#[uuid(0xbdc2bdd3, 0xb96c, 0x4de6, 0xbd, 0xf7, 0x99, 0xd4, 0x74, 0x54, 0x54, 0xde)]
673 interface ID2D1Factory7(ID2D1Factory7Vtbl): ID2D1Factory6(ID2D1Factory6Vtbl) {
674     fn CreateDevice(
675         dxgiDevice: *mut IDXGIDevice,
676         d2dDevice6: *mut *mut ID2D1Device6,
677     ) -> HRESULT,
678 }}
679 extern "system" {
D2D1GetGradientMeshInteriorPointsFromCoonsPatch( pPoint0: *const D2D1_POINT_2F, pPoint1: *const D2D1_POINT_2F, pPoint2: *const D2D1_POINT_2F, pPoint3: *const D2D1_POINT_2F, pPoint4: *const D2D1_POINT_2F, pPoint5: *const D2D1_POINT_2F, pPoint6: *const D2D1_POINT_2F, pPoint7: *const D2D1_POINT_2F, pPoint8: *const D2D1_POINT_2F, pPoint9: *const D2D1_POINT_2F, pPoint10: *const D2D1_POINT_2F, pPoint11: *const D2D1_POINT_2F, pTensorPoint11: *mut D2D1_POINT_2F, pTensorPoint12: *mut D2D1_POINT_2F, pTensorPoint21: *mut D2D1_POINT_2F, pTensorPoint22: *mut D2D1_POINT_2F, )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 }
699