include: Add defines for ID2D1Device2.
[wine.git] / include / d2d1_3.idl
blobc96821ae27652d5153b9686e87271c0724a0b487
1 /*
2 * Copyright 2022 Ziqing Hui for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 import "d2d1_2.idl";
21 typedef enum D2D1_INK_NIB_SHAPE
23 D2D1_INK_NIB_SHAPE_ROUND = 0x0,
24 D2D1_INK_NIB_SHAPE_SQUARE = 0x1,
25 D2D1_INK_NIB_SHAPE_FORCE_DWORD = 0xffffffff
26 } D2D1_INK_NIB_SHAPE;
28 typedef enum D2D1_PATCH_EDGE_MODE
30 D2D1_PATCH_EDGE_MODE_ALIASED = 0x0,
31 D2D1_PATCH_EDGE_MODE_ANTIALIASED = 0x1,
32 D2D1_PATCH_EDGE_MODE_ALIASED_INFLATED = 0x2,
33 D2D1_PATCH_EDGE_MODE_FORCE_DWORD = 0xffffffff
34 } D2D1_PATCH_EDGE_MODE;
36 typedef enum D2D1_ORIENTATION
38 D2D1_ORIENTATION_DEFAULT = 0x1,
39 D2D1_ORIENTATION_FLIP_HORIZONTAL = 0x2,
40 D2D1_ORIENTATION_ROTATE_CLOCKWISE180 = 0x3,
41 D2D1_ORIENTATION_ROTATE_CLOCKWISE180_FLIP_HORIZONTAL = 0x4,
42 D2D1_ORIENTATION_ROTATE_CLOCKWISE90_FLIP_HORIZONTAL = 0x5,
43 D2D1_ORIENTATION_ROTATE_CLOCKWISE270 = 0x6,
44 D2D1_ORIENTATION_ROTATE_CLOCKWISE270_FLIP_HORIZONTAL = 0x7,
45 D2D1_ORIENTATION_ROTATE_CLOCKWISE90 = 0x8,
46 D2D1_ORIENTATION_FORCE_DWORD = 0xffffffff
47 } D2D1_ORIENTATION;
49 typedef enum D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS
51 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE = 0x0,
52 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_DISABLE_DPI_SCALE = 0x1,
53 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_FORCE_DWORD = 0xffffffff
54 } D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS;
56 typedef enum D2D1_IMAGE_SOURCE_LOADING_OPTIONS
58 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_NONE = 0x0,
59 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_RELEASE_SOURCE = 0x1,
60 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_CACHE_ON_DEMAND = 0x2,
61 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_FORCE_DWORD = 0xffffffff
62 } D2D1_IMAGE_SOURCE_LOADING_OPTIONS;
64 typedef enum D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS
66 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_NONE = 0x0,
67 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_LOW_QUALITY_PRIMARY_CONVERSION = 0x1,
68 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_FORCE_DWORD = 0xffffffff
69 } D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS;
71 typedef struct D2D1_INK_POINT
73 float x;
74 float y;
75 float radius;
76 } D2D1_INK_POINT;
78 typedef struct D2D1_INK_BEZIER_SEGMENT
80 D2D1_INK_POINT point1;
81 D2D1_INK_POINT point2;
82 D2D1_INK_POINT point3;
83 } D2D1_INK_BEZIER_SEGMENT;
85 typedef struct D2D1_INK_STYLE_PROPERTIES
87 D2D1_INK_NIB_SHAPE nibShape;
88 D2D1_MATRIX_3X2_F nibTransform;
89 } D2D1_INK_STYLE_PROPERTIES;
91 typedef struct D2D1_GRADIENT_MESH_PATCH
93 D2D1_POINT_2F point00;
94 D2D1_POINT_2F point01;
95 D2D1_POINT_2F point02;
96 D2D1_POINT_2F point03;
97 D2D1_POINT_2F point10;
98 D2D1_POINT_2F point11;
99 D2D1_POINT_2F point12;
100 D2D1_POINT_2F point13;
101 D2D1_POINT_2F point20;
102 D2D1_POINT_2F point21;
103 D2D1_POINT_2F point22;
104 D2D1_POINT_2F point23;
105 D2D1_POINT_2F point30;
106 D2D1_POINT_2F point31;
107 D2D1_POINT_2F point32;
108 D2D1_POINT_2F point33;
109 D2D1_COLOR_F color00;
110 D2D1_COLOR_F color03;
111 D2D1_COLOR_F color30;
112 D2D1_COLOR_F color33;
113 D2D1_PATCH_EDGE_MODE topEdgeMode;
114 D2D1_PATCH_EDGE_MODE leftEdgeMode;
115 D2D1_PATCH_EDGE_MODE bottomEdgeMode;
116 D2D1_PATCH_EDGE_MODE rightEdgeMode;
117 } D2D1_GRADIENT_MESH_PATCH;
119 typedef struct D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES
121 D2D1_ORIENTATION orientation;
122 float scaleX;
123 float scaleY;
124 D2D1_INTERPOLATION_MODE interpolationMode;
125 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS options;
126 } D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES;
129 object,
130 uuid(bae8b344-23fc-4071-8cb5-d05d6f073848),
131 local,
133 interface ID2D1InkStyle : ID2D1Resource
135 void SetNibTransform(
136 [in] const D2D1_MATRIX_3X2_F *transform
138 void GetNibTransform(
139 [out] D2D1_MATRIX_3X2_F *transform
141 void SetNibShape(
142 [in] D2D1_INK_NIB_SHAPE shape
144 D2D1_INK_NIB_SHAPE GetNibShape();
148 object,
149 uuid(b499923b-7029-478f-a8b3-432c7c5f5312),
150 local,
152 interface ID2D1Ink : ID2D1Resource
154 void SetStartPoint(
155 [in] const D2D1_INK_POINT *start_point
157 D2D1_INK_POINT GetStartPoint();
158 HRESULT AddSegments(
159 [in] const D2D1_INK_BEZIER_SEGMENT *segments,
160 [in] UINT32 segment_count
162 HRESULT RemoveSegmentsAtEnd(
163 [in] UINT32 segment_count
165 HRESULT SetSegments(
166 [in] UINT32 start_segment,
167 [in] const D2D1_INK_BEZIER_SEGMENT *segments,
168 [in] UINT32 segment_count
170 HRESULT SetSegmentAtEnd(
171 [in] const D2D1_INK_BEZIER_SEGMENT *segment
173 UINT32 GetSegmentCount();
174 HRESULT GetSegments(
175 [in] UINT32 start_segment,
176 [out] D2D1_INK_BEZIER_SEGMENT *segments,
177 [in] UINT32 segment_count
179 HRESULT StreamAsGeometry(
180 [in, optional] ID2D1InkStyle *ink_style,
181 [in, optional] const D2D1_MATRIX_3X2_F *world_transform,
182 [in] float flattening_tolerance,
183 [in] ID2D1SimplifiedGeometrySink *geometry_sink
185 HRESULT GetBounds(
186 [in, optional] ID2D1InkStyle *ink_style,
187 [in, optional] const D2D1_MATRIX_3X2_F *world_transform,
188 [out] D2D1_RECT_F *bounds
193 object,
194 uuid(f292e401-c050-4cde-83d7-04962d3b23c2),
195 local,
197 interface ID2D1GradientMesh : ID2D1Resource
199 UINT32 GetPatchCount();
200 HRESULT GetPatches(
201 [in] UINT32 start_index,
202 [out] D2D1_GRADIENT_MESH_PATCH *patches,
203 [in] UINT32 patch_count
208 object,
209 uuid(c9b664e5-74a1-4378-9ac2-eefc37a3f4d8),
210 local,
212 interface ID2D1ImageSource : ID2D1Image
214 HRESULT OfferResources();
215 HRESULT TryReclaimResources(
216 [out] BOOL *resources_discarded
221 object,
222 uuid(77395441-1c8f-4555-8683-f50dab0fe792),
223 local,
225 interface ID2D1ImageSourceFromWic : ID2D1ImageSource
227 HRESULT EnsureCached(
228 [in, optional] const D2D1_RECT_U *rect_to_fill
230 HRESULT TrimCache(
231 [in, optional] const D2D1_RECT_U *rect_to_preserve
233 void GetSource(
234 [out] IWICBitmapSource **source
239 object,
240 uuid(7f1f79e5-2796-416c-8f55-700f911445e5),
241 local,
243 interface ID2D1TransformedImageSource : ID2D1Image
245 void GetSource(
246 [out] ID2D1ImageSource **source
248 void GetProperties(
249 [out] D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *out
254 object,
255 uuid(53dd9855-a3b0-4d5b-82e1-26e25c5e5797),
256 local,
258 interface ID2D1LookupTable3D : ID2D1Resource
263 object,
264 uuid(394ea6a3-0c34-4321-950b-6ca20f0be6c7),
265 local,
267 interface ID2D1DeviceContext2 : ID2D1DeviceContext1
269 HRESULT CreateInk(
270 [in] const D2D1_INK_POINT *start_point,
271 [out] ID2D1Ink **ink
273 HRESULT CreateInkStyle(
274 [in, optional] const D2D1_INK_STYLE_PROPERTIES *ink_style_properties,
275 [out] ID2D1InkStyle **ink_style
277 HRESULT CreateGradientMesh(
278 [in] const D2D1_GRADIENT_MESH_PATCH *patches,
279 [in] UINT32 patches_count,
280 [out] ID2D1GradientMesh **gradient_mesh
282 HRESULT CreateImageSourceFromWic(
283 [in] IWICBitmapSource *wic_bitmap_source,
284 [in] D2D1_IMAGE_SOURCE_LOADING_OPTIONS loading_options,
285 [in] D2D1_ALPHA_MODE alpha_mode,
286 [out] ID2D1ImageSourceFromWic **image_source
288 HRESULT CreateLookupTable3D(
289 [in] D2D1_BUFFER_PRECISION precision,
290 [in] const UINT32 *extents,
291 [in] const BYTE *data,
292 [in] UINT32 data_count,
293 [in] const UINT32 *strides,
294 [out] ID2D1LookupTable3D **lookup_table
296 HRESULT CreateImageSourceFromDxgi(
297 [in] IDXGISurface **surfaces,
298 [in] UINT32 surface_count,
299 [in] DXGI_COLOR_SPACE_TYPE color_space,
300 [in] D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS options,
301 [out] ID2D1ImageSource **image_source
303 HRESULT GetGradientMeshWorldBounds(
304 [in] ID2D1GradientMesh *gradient_mesh,
305 [out] D2D1_RECT_F *bounds
307 void DrawInk(
308 [in] ID2D1Ink *ink,
309 [in] ID2D1Brush *brush,
310 [in, optional] ID2D1InkStyle *ink_style
312 void DrawGradientMesh(
313 [in] ID2D1GradientMesh *gradient_mesh
315 void DrawGdiMetafile(
316 [in] ID2D1GdiMetafile *gdi_metafile,
317 [in, optional] const D2D1_RECT_F *dst_rect,
318 [in, optional] const D2D1_RECT_F *src_rect
320 HRESULT CreateTransformedImageSource(
321 [in] ID2D1ImageSource *source,
322 [in] const D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *props,
323 [out] ID2D1TransformedImageSource **transformed
328 object,
329 uuid(a44472e1-8dfb-4e60-8492-6e2861c9ca8b),
330 local,
332 interface ID2D1Device2 : ID2D1Device1
334 HRESULT CreateDeviceContext(
335 [in] D2D1_DEVICE_CONTEXT_OPTIONS options,
336 [out] ID2D1DeviceContext2 **context
338 void FlushDeviceContexts(
339 [in] ID2D1Bitmap *bitmap
341 HRESULT GetDxgiDevice(
342 [out] IDXGIDevice **dxgi_device