dxgi: Fix a typo in a comment.
[wine.git] / include / d2d1_3.idl
blob9ca42e661e1d76845a5bf61de94c21c5607dcc4e
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";
20 import "d2d1effects_2.idl";
22 interface IDWriteFontFace;
24 typedef enum D2D1_INK_NIB_SHAPE
26 D2D1_INK_NIB_SHAPE_ROUND = 0x0,
27 D2D1_INK_NIB_SHAPE_SQUARE = 0x1,
28 D2D1_INK_NIB_SHAPE_FORCE_DWORD = 0xffffffff
29 } D2D1_INK_NIB_SHAPE;
31 typedef enum D2D1_PATCH_EDGE_MODE
33 D2D1_PATCH_EDGE_MODE_ALIASED = 0x0,
34 D2D1_PATCH_EDGE_MODE_ANTIALIASED = 0x1,
35 D2D1_PATCH_EDGE_MODE_ALIASED_INFLATED = 0x2,
36 D2D1_PATCH_EDGE_MODE_FORCE_DWORD = 0xffffffff
37 } D2D1_PATCH_EDGE_MODE;
39 typedef enum D2D1_ORIENTATION
41 D2D1_ORIENTATION_DEFAULT = 0x1,
42 D2D1_ORIENTATION_FLIP_HORIZONTAL = 0x2,
43 D2D1_ORIENTATION_ROTATE_CLOCKWISE180 = 0x3,
44 D2D1_ORIENTATION_ROTATE_CLOCKWISE180_FLIP_HORIZONTAL = 0x4,
45 D2D1_ORIENTATION_ROTATE_CLOCKWISE90_FLIP_HORIZONTAL = 0x5,
46 D2D1_ORIENTATION_ROTATE_CLOCKWISE270 = 0x6,
47 D2D1_ORIENTATION_ROTATE_CLOCKWISE270_FLIP_HORIZONTAL = 0x7,
48 D2D1_ORIENTATION_ROTATE_CLOCKWISE90 = 0x8,
49 D2D1_ORIENTATION_FORCE_DWORD = 0xffffffff
50 } D2D1_ORIENTATION;
52 typedef enum D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS
54 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_NONE = 0x0,
55 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_DISABLE_DPI_SCALE = 0x1,
56 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS_FORCE_DWORD = 0xffffffff
57 } D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS;
59 typedef enum D2D1_IMAGE_SOURCE_LOADING_OPTIONS
61 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_NONE = 0x0,
62 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_RELEASE_SOURCE = 0x1,
63 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_CACHE_ON_DEMAND = 0x2,
64 D2D1_IMAGE_SOURCE_LOADING_OPTIONS_FORCE_DWORD = 0xffffffff
65 } D2D1_IMAGE_SOURCE_LOADING_OPTIONS;
67 typedef enum D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS
69 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_NONE = 0x0,
70 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_LOW_QUALITY_PRIMARY_CONVERSION = 0x1,
71 D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS_FORCE_DWORD = 0xffffffff
72 } D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS;
74 typedef enum D2D1_SPRITE_OPTIONS
76 D2D1_SPRITE_OPTIONS_NONE = 0x0,
77 D2D1_SPRITE_OPTIONS_CLAMP_TO_SOURCE_RECTANGLE = 0x1,
78 D2D1_SPRITE_OPTIONS_FORCE_DWORD = 0xffffffff
79 } D2D1_SPRITE_OPTIONS;
81 typedef enum D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION
83 D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DEFAULT = 0x0,
84 D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_DISABLE = 0x1,
85 D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION_FORCE_DWORD = 0xffffffff
86 } D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION;
88 typedef struct D2D1_INK_POINT
90 float x;
91 float y;
92 float radius;
93 } D2D1_INK_POINT;
95 typedef struct D2D1_INK_BEZIER_SEGMENT
97 D2D1_INK_POINT point1;
98 D2D1_INK_POINT point2;
99 D2D1_INK_POINT point3;
100 } D2D1_INK_BEZIER_SEGMENT;
102 typedef struct D2D1_INK_STYLE_PROPERTIES
104 D2D1_INK_NIB_SHAPE nibShape;
105 D2D1_MATRIX_3X2_F nibTransform;
106 } D2D1_INK_STYLE_PROPERTIES;
108 typedef struct D2D1_GRADIENT_MESH_PATCH
110 D2D1_POINT_2F point00;
111 D2D1_POINT_2F point01;
112 D2D1_POINT_2F point02;
113 D2D1_POINT_2F point03;
114 D2D1_POINT_2F point10;
115 D2D1_POINT_2F point11;
116 D2D1_POINT_2F point12;
117 D2D1_POINT_2F point13;
118 D2D1_POINT_2F point20;
119 D2D1_POINT_2F point21;
120 D2D1_POINT_2F point22;
121 D2D1_POINT_2F point23;
122 D2D1_POINT_2F point30;
123 D2D1_POINT_2F point31;
124 D2D1_POINT_2F point32;
125 D2D1_POINT_2F point33;
126 D2D1_COLOR_F color00;
127 D2D1_COLOR_F color03;
128 D2D1_COLOR_F color30;
129 D2D1_COLOR_F color33;
130 D2D1_PATCH_EDGE_MODE topEdgeMode;
131 D2D1_PATCH_EDGE_MODE leftEdgeMode;
132 D2D1_PATCH_EDGE_MODE bottomEdgeMode;
133 D2D1_PATCH_EDGE_MODE rightEdgeMode;
134 } D2D1_GRADIENT_MESH_PATCH;
136 typedef struct D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES
138 D2D1_ORIENTATION orientation;
139 float scaleX;
140 float scaleY;
141 D2D1_INTERPOLATION_MODE interpolationMode;
142 D2D1_TRANSFORMED_IMAGE_SOURCE_OPTIONS options;
143 } D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES;
146 object,
147 uuid(bae8b344-23fc-4071-8cb5-d05d6f073848),
148 local,
150 interface ID2D1InkStyle : ID2D1Resource
152 void SetNibTransform(
153 [in] const D2D1_MATRIX_3X2_F *transform
155 void GetNibTransform(
156 [out] D2D1_MATRIX_3X2_F *transform
158 void SetNibShape(
159 [in] D2D1_INK_NIB_SHAPE shape
161 D2D1_INK_NIB_SHAPE GetNibShape();
165 object,
166 uuid(b499923b-7029-478f-a8b3-432c7c5f5312),
167 local,
169 interface ID2D1Ink : ID2D1Resource
171 void SetStartPoint(
172 [in] const D2D1_INK_POINT *start_point
174 D2D1_INK_POINT GetStartPoint();
175 HRESULT AddSegments(
176 [in] const D2D1_INK_BEZIER_SEGMENT *segments,
177 [in] UINT32 segment_count
179 HRESULT RemoveSegmentsAtEnd(
180 [in] UINT32 segment_count
182 HRESULT SetSegments(
183 [in] UINT32 start_segment,
184 [in] const D2D1_INK_BEZIER_SEGMENT *segments,
185 [in] UINT32 segment_count
187 HRESULT SetSegmentAtEnd(
188 [in] const D2D1_INK_BEZIER_SEGMENT *segment
190 UINT32 GetSegmentCount();
191 HRESULT GetSegments(
192 [in] UINT32 start_segment,
193 [out] D2D1_INK_BEZIER_SEGMENT *segments,
194 [in] UINT32 segment_count
196 HRESULT StreamAsGeometry(
197 [in, optional] ID2D1InkStyle *ink_style,
198 [in, optional] const D2D1_MATRIX_3X2_F *world_transform,
199 [in] float flattening_tolerance,
200 [in] ID2D1SimplifiedGeometrySink *geometry_sink
202 HRESULT GetBounds(
203 [in, optional] ID2D1InkStyle *ink_style,
204 [in, optional] const D2D1_MATRIX_3X2_F *world_transform,
205 [out] D2D1_RECT_F *bounds
210 object,
211 uuid(f292e401-c050-4cde-83d7-04962d3b23c2),
212 local,
214 interface ID2D1GradientMesh : ID2D1Resource
216 UINT32 GetPatchCount();
217 HRESULT GetPatches(
218 [in] UINT32 start_index,
219 [out] D2D1_GRADIENT_MESH_PATCH *patches,
220 [in] UINT32 patch_count
225 object,
226 uuid(c9b664e5-74a1-4378-9ac2-eefc37a3f4d8),
227 local,
229 interface ID2D1ImageSource : ID2D1Image
231 HRESULT OfferResources();
232 HRESULT TryReclaimResources(
233 [out] BOOL *resources_discarded
238 object,
239 uuid(77395441-1c8f-4555-8683-f50dab0fe792),
240 local,
242 interface ID2D1ImageSourceFromWic : ID2D1ImageSource
244 HRESULT EnsureCached(
245 [in, optional] const D2D1_RECT_U *rect_to_fill
247 HRESULT TrimCache(
248 [in, optional] const D2D1_RECT_U *rect_to_preserve
250 void GetSource(
251 [out] IWICBitmapSource **source
256 object,
257 uuid(7f1f79e5-2796-416c-8f55-700f911445e5),
258 local,
260 interface ID2D1TransformedImageSource : ID2D1Image
262 void GetSource(
263 [out] ID2D1ImageSource **source
265 void GetProperties(
266 [out] D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *out
271 object,
272 uuid(53dd9855-a3b0-4d5b-82e1-26e25c5e5797),
273 local,
275 interface ID2D1LookupTable3D : ID2D1Resource
280 object,
281 uuid(4dc583bf-3a10-438a-8722-e9765224f1f1),
282 local,
284 interface ID2D1SpriteBatch : ID2D1Resource
286 HRESULT AddSprites(
287 [in] UINT32 sprite_count,
288 [in] const D2D1_RECT_F *destination_rectangles,
289 [in] const D2D1_RECT_U *source_rectangles,
290 [in] const D2D1_COLOR_F *colors,
291 [in] const D2D1_MATRIX_3X2_F *transforms,
292 [in] UINT32 destination_rectangles_stride,
293 [in] UINT32 source_rectangles_stride,
294 [in] UINT32 colors_stride,
295 [in] UINT32 transforms_stride
297 HRESULT SetSprites(
298 [in] UINT32 start_index,
299 [in] UINT32 sprite_count,
300 [in] const D2D1_RECT_F *destination_rectangles,
301 [in] const D2D1_RECT_U *source_rectangles,
302 [in] const D2D1_COLOR_F *colors,
303 [in] const D2D1_MATRIX_3X2_F *transforms,
304 [in] UINT32 destination_rectangles_stride,
305 [in] UINT32 source_rectangles_stride,
306 [in] UINT32 colors_stride,
307 [in] UINT32 transforms_stride
309 HRESULT GetSprites(
310 [in] UINT32 start_index,
311 [in] UINT32 sprite_count,
312 [out, optional] D2D1_RECT_F *destination_rectangles,
313 [out, optional] D2D1_RECT_U *source_rectangles,
314 [out, optional] D2D1_COLOR_F *colors,
315 [out, optional] D2D1_MATRIX_3X2_F *transforms
317 UINT32 GetSpriteCount(void);
318 void Clear(void);
322 object,
323 uuid(af671749-d241-4db8-8e41-dcc2e5c1a438),
324 local,
326 interface ID2D1SvgGlyphStyle : ID2D1Resource
328 HRESULT SetFill(
329 [in, optional] ID2D1Brush *brush
331 void GetFill(
332 [out] ID2D1Brush **brush
334 HRESULT SetStroke(
335 [in, optional] ID2D1Brush *brush,
336 [in] FLOAT stroke_width,
337 [in, optional] const FLOAT *dashes,
338 [in, optional] UINT32 dashes_count,
339 [in] FLOAT dash_offset
341 UINT32 GetStrokeDashesCount(void);
342 void GetStroke(
343 [out, optional] ID2D1Brush **brush,
344 [out, optional] FLOAT *stroke_width,
345 [out, optional] FLOAT *dashes,
346 [in, optional] UINT32 dashes_count,
347 [out, optional] FLOAT *dash_offset
352 object,
353 uuid(394ea6a3-0c34-4321-950b-6ca20f0be6c7),
354 local,
356 interface ID2D1DeviceContext2 : ID2D1DeviceContext1
358 HRESULT CreateInk(
359 [in] const D2D1_INK_POINT *start_point,
360 [out] ID2D1Ink **ink
362 HRESULT CreateInkStyle(
363 [in, optional] const D2D1_INK_STYLE_PROPERTIES *ink_style_properties,
364 [out] ID2D1InkStyle **ink_style
366 HRESULT CreateGradientMesh(
367 [in] const D2D1_GRADIENT_MESH_PATCH *patches,
368 [in] UINT32 patches_count,
369 [out] ID2D1GradientMesh **gradient_mesh
371 HRESULT CreateImageSourceFromWic(
372 [in] IWICBitmapSource *wic_bitmap_source,
373 [in] D2D1_IMAGE_SOURCE_LOADING_OPTIONS loading_options,
374 [in] D2D1_ALPHA_MODE alpha_mode,
375 [out] ID2D1ImageSourceFromWic **image_source
377 HRESULT CreateLookupTable3D(
378 [in] D2D1_BUFFER_PRECISION precision,
379 [in] const UINT32 *extents,
380 [in] const BYTE *data,
381 [in] UINT32 data_count,
382 [in] const UINT32 *strides,
383 [out] ID2D1LookupTable3D **lookup_table
385 HRESULT CreateImageSourceFromDxgi(
386 [in] IDXGISurface **surfaces,
387 [in] UINT32 surface_count,
388 [in] DXGI_COLOR_SPACE_TYPE color_space,
389 [in] D2D1_IMAGE_SOURCE_FROM_DXGI_OPTIONS options,
390 [out] ID2D1ImageSource **image_source
392 HRESULT GetGradientMeshWorldBounds(
393 [in] ID2D1GradientMesh *gradient_mesh,
394 [out] D2D1_RECT_F *bounds
396 void DrawInk(
397 [in] ID2D1Ink *ink,
398 [in] ID2D1Brush *brush,
399 [in, optional] ID2D1InkStyle *ink_style
401 void DrawGradientMesh(
402 [in] ID2D1GradientMesh *gradient_mesh
404 void DrawGdiMetafile(
405 [in] ID2D1GdiMetafile *gdi_metafile,
406 [in, optional] const D2D1_RECT_F *dst_rect,
407 [in, optional] const D2D1_RECT_F *src_rect
409 HRESULT CreateTransformedImageSource(
410 [in] ID2D1ImageSource *source,
411 [in] const D2D1_TRANSFORMED_IMAGE_SOURCE_PROPERTIES *props,
412 [out] ID2D1TransformedImageSource **transformed
417 object,
418 uuid(235a7496-8351-414c-bcd4-6672ab2d8e00),
419 local,
421 interface ID2D1DeviceContext3 : ID2D1DeviceContext2
423 HRESULT CreateSpriteBatch(
424 [out] ID2D1SpriteBatch **sprite_batch
426 void DrawSpriteBatch(
427 [in] ID2D1SpriteBatch *sprite_batch,
428 [in] UINT32 start_index,
429 [in] UINT32 sprite_count,
430 [in] ID2D1Bitmap *bitmap,
431 [in] D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode,
432 [in] D2D1_SPRITE_OPTIONS sprite_options
437 object,
438 uuid(8c427831-3d90-4476-b647-c4fae349e4db),
439 local,
441 interface ID2D1DeviceContext4 : ID2D1DeviceContext3
443 HRESULT CreateSvgGlyphStyle(
444 [out] ID2D1SvgGlyphStyle **svg_glyph_style
446 void DrawText(
447 [in] const WCHAR *string,
448 [in] UINT32 string_length,
449 [in] IDWriteTextFormat *text_format,
450 [in] const D2D1_RECT_F *layout_rect,
451 [in, optional] ID2D1Brush *default_fill_brush,
452 [in, optional] ID2D1SvgGlyphStyle *svg_glyph_style,
453 [in, optional] UINT32 color_palette_index,
454 [in] D2D1_DRAW_TEXT_OPTIONS options,
455 [in] DWRITE_MEASURING_MODE measuring_mode
457 void DrawTextLayout(
458 [in] D2D1_POINT_2F origin,
459 [in] IDWriteTextLayout *text_layout,
460 [in, optional] ID2D1Brush *default_fill_brush,
461 [in, optional] ID2D1SvgGlyphStyle *svg_glyph_style,
462 [in, optional] UINT32 color_palette_index,
463 [in] D2D1_DRAW_TEXT_OPTIONS options
465 void DrawColorBitmapGlyphRun(
466 [in] DWRITE_GLYPH_IMAGE_FORMATS glyph_image_format,
467 [in] D2D1_POINT_2F baseline_origin,
468 [in] const DWRITE_GLYPH_RUN *glyph_run,
469 [in] DWRITE_MEASURING_MODE measuring_mode,
470 [in] D2D1_COLOR_BITMAP_GLYPH_SNAP_OPTION bitmap_snap_option
472 void DrawSvgGlyphRun(
473 [in] D2D1_POINT_2F baseline_origin,
474 [in] const DWRITE_GLYPH_RUN *glyph_run,
475 [in, optional] ID2D1Brush *default_fill_brush,
476 [in, optional] ID2D1SvgGlyphStyle *svg_glyph_style,
477 [in, optional]UINT32 color_palette_index,
478 [in] DWRITE_MEASURING_MODE measuring_mode
480 HRESULT GetColorBitmapGlyphImage(
481 [in] DWRITE_GLYPH_IMAGE_FORMATS glyph_image_format,
482 [in] D2D1_POINT_2F glyph_origin,
483 [in] IDWriteFontFace *font_face,
484 [in] FLOAT font_em_size,
485 [in] UINT16 glyph_index,
486 [in] BOOL is_sideways,
487 [in, optional] const D2D1_MATRIX_3X2_F *world_transform,
488 [in] FLOAT dpi_x,
489 [in] FLOAT dpi_y,
490 [out] D2D1_MATRIX_3X2_F *glyph_transform,
491 [out] ID2D1Image **glyph_image
493 HRESULT GetSvgGlyphImage(
494 [in] D2D1_POINT_2F glyph_origin,
495 [in] IDWriteFontFace *font_face,
496 [in] FLOAT font_em_size,
497 [in] UINT16 glyph_index,
498 [in] BOOL is_sideways,
499 [in, optional] const D2D1_MATRIX_3X2_F *world_transform,
500 [in, optional] ID2D1Brush *default_fill_brush,
501 [in, optional] ID2D1SvgGlyphStyle *svg_glyph_style,
502 [in] UINT32 color_palette_index,
503 [out] D2D1_MATRIX_3X2_F *glyph_transform,
504 [out] ID2D1CommandList **glyph_image
509 object,
510 uuid(a44472e1-8dfb-4e60-8492-6e2861c9ca8b),
511 local,
513 interface ID2D1Device2 : ID2D1Device1
515 HRESULT CreateDeviceContext(
516 [in] D2D1_DEVICE_CONTEXT_OPTIONS options,
517 [out] ID2D1DeviceContext2 **context
519 void FlushDeviceContexts(
520 [in] ID2D1Bitmap *bitmap
522 HRESULT GetDxgiDevice(
523 [out] IDXGIDevice **dxgi_device
528 object,
529 uuid(0869759f-4f00-413f-b03e-2bda45404d0f),
530 local,
532 interface ID2D1Factory3 : ID2D1Factory2
534 HRESULT CreateDevice(
535 [in] IDXGIDevice *dxgi_device,
536 [out] ID2D1Device2 **d2d_device
541 object,
542 uuid(3bab440e-417e-47df-a2e2-bc0be6a00916),
543 local,
545 interface ID2D1CommandSink2 : ID2D1CommandSink1
547 HRESULT DrawInk(
548 [in] ID2D1Ink *ink,
549 [in] ID2D1Brush *brush,
550 [in] ID2D1InkStyle *ink_style
553 HRESULT DrawGradientMesh(
554 [in] ID2D1GradientMesh *gradient_mesh
557 HRESULT DrawGdiMetafile(
558 [in] ID2D1GdiMetafile *gdi_metafile,
559 [in] const D2D1_RECT_F *dest_rect,
560 [in] const D2D1_RECT_F *src_rect
565 object,
566 uuid(18079135-4cf3-4868-bc8e-06067e6d242d),
567 local,
569 interface ID2D1CommandSink3 : ID2D1CommandSink2
571 HRESULT DrawSpriteBatch(
572 [in] ID2D1SpriteBatch *sprite_batch,
573 [in] UINT32 start_index,
574 [in] UINT32 sprite_count,
575 [in] ID2D1Bitmap *bitmap,
576 [in] D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode,
577 [in] D2D1_SPRITE_OPTIONS sprite_options
582 object,
583 uuid(c78a6519-40d6-4218-b2de-beeeb744bb3e),
584 local,
586 interface ID2D1CommandSink4 : ID2D1CommandSink3
588 HRESULT SetPrimitiveBlend2(
589 [in] D2D1_PRIMITIVE_BLEND primitive_blend