2 * Copyright 2017 Lucian Poston
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
21 interface ID2D1Device
;
22 interface ID2D1StrokeStyle1
;
23 interface ID2D1PathGeometry1
;
24 interface ID2D1DrawingStateBlock1
;
25 interface ID2D1GdiMetafile
;
26 interface ID2D1Properties
;
28 typedef enum D2D1_STROKE_TRANSFORM_TYPE
30 D2D1_STROKE_TRANSFORM_TYPE_NORMAL
= 0x0,
31 D2D1_STROKE_TRANSFORM_TYPE_FIXED
= 0x1,
32 D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE
= 0x2,
33 D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD
= 0xffffffff,
34 } D2D1_STROKE_TRANSFORM_TYPE
;
36 typedef enum D2D1_PRIMITIVE_BLEND
38 D2D1_PRIMITIVE_BLEND_SOURCE_OVER
= 0x0,
39 D2D1_PRIMITIVE_BLEND_COPY
= 0x1,
40 D2D1_PRIMITIVE_BLEND_MIN
= 0x2,
41 D2D1_PRIMITIVE_BLEND_ADD
= 0x3,
42 D2D1_PRIMITIVE_BLEND_MAX
= 0x4,
43 D2D1_PRIMITIVE_BLEND_FORCE_DWORD
= 0xffffffff,
44 } D2D1_PRIMITIVE_BLEND
;
46 typedef enum D2D1_UNIT_MODE
48 D2D1_UNIT_MODE_DIPS
= 0x0,
49 D2D1_UNIT_MODE_PIXELS
= 0x1,
50 D2D1_UNIT_MODE_FORCE_DWORD
= 0xffffffff,
53 typedef struct D2D1_PROPERTY_BINDING D2D1_PROPERTY_BINDING
;
55 typedef struct D2D1_STROKE_STYLE_PROPERTIES1
57 D2D1_CAP_STYLE startCap
;
58 D2D1_CAP_STYLE endCap
;
59 D2D1_CAP_STYLE dashCap
;
60 D2D1_LINE_JOIN lineJoin
;
62 D2D1_DASH_STYLE dashStyle
;
64 D2D1_STROKE_TRANSFORM_TYPE transformType
;
65 } D2D1_STROKE_STYLE_PROPERTIES1
;
67 typedef struct D2D1_DRAWING_STATE_DESCRIPTION1
69 D2D1_ANTIALIAS_MODE antialiasMode
;
70 D2D1_TEXT_ANTIALIAS_MODE textAntialiasMode
;
73 D2D1_MATRIX_3X2_F transform
;
74 D2D1_PRIMITIVE_BLEND primitiveBlend
;
75 D2D1_UNIT_MODE unitMode
;
76 } D2D1_DRAWING_STATE_DESCRIPTION1
;
78 typedef HRESULT (__stdcall
*PD2D1_EFFECT_FACTORY
)(IUnknown
**effect
);
82 uuid(bb12d362
-daee
-4b9a
-aa1d
-14ba401cfa1f
),
85 interface ID2D1Factory1
: ID2D1Factory
88 [in] IDXGIDevice
*dxgi_device
,
89 [out] ID2D1Device
**device
91 HRESULT CreateStrokeStyle
(
92 [in] const D2D1_STROKE_STYLE_PROPERTIES1
*desc
,
93 [in, size_is(dash_count
)] const float *dashes
,
94 [in] UINT32 dash_count
,
95 [out] ID2D1StrokeStyle1
**stroke_style
97 HRESULT CreatePathGeometry
(
98 [out] ID2D1PathGeometry1
**geometry
100 HRESULT CreateDrawingStateBlock
(
101 [in] const D2D1_DRAWING_STATE_DESCRIPTION1
*desc
,
102 [in] IDWriteRenderingParams
*text_rendering_params
,
103 [out] ID2D1DrawingStateBlock1
**state_block
105 HRESULT CreateGdiMetafile
(
106 [in] IStream
*stream
,
107 [out] ID2D1GdiMetafile
**metafile
109 HRESULT RegisterEffectFromStream
(
110 [in] REFCLSID effect_id
,
111 [in] IStream
*property_xml
,
112 [in, size_is(binding_count
)] const D2D1_PROPERTY_BINDING
*bindings
,
113 [in] UINT32 binding_count
,
114 [in] PD2D1_EFFECT_FACTORY effect_factory
116 HRESULT RegisterEffectFromString
(
117 [in] REFCLSID effect_id
,
118 [in] const WCHAR
*property_xml
,
119 [in, size_is(binding_count
)] const D2D1_PROPERTY_BINDING
*bindings
,
120 [in] UINT32 binding_count
,
121 [in] PD2D1_EFFECT_FACTORY effect_factory
123 HRESULT UnregisterEffect
(
124 [in] REFCLSID effect_id
126 HRESULT GetRegisteredEffects
(
127 [out, size_is(effect_count
)] CLSID
*effects
,
128 [in] UINT32 effect_count
,
129 [out] UINT32
*returned
,
130 [out] UINT32
*registered
132 HRESULT GetEffectProperties
(
133 [in] REFCLSID effect_id
,
134 [out] ID2D1Properties
**props