2 * Copyright 2023 Zhiyi Zhang 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
20 import
"d2dbasetypes.h";
22 import
"dcompanimation.idl";
23 import
"dcomptypes.idl";
26 typedef struct _D3DMATRIX
34 pointer_default(unique),
35 uuid(bb8a4953
-2c99
-4f5a
-96f5
-4819027fa3ac
)
37 interface IDCompositionSurface
: IUnknown
39 HRESULT BeginDraw
([in, optional] const RECT
*rect
, [in] REFIID iid
, [out] void **object, [out] POINT
*offset
);
41 HRESULT SuspendDraw
();
43 HRESULT Scroll
([in, optional] const RECT
*scroll
, [in, optional] const RECT
*clip
, [in] int offset_x
, [in] int offset_y
);
49 pointer_default(unique),
50 uuid(ae471c51
-5f53
-4a24
-8d3e
-d0c39c30b3f0
)
52 interface IDCompositionVirtualSurface
: IDCompositionSurface
54 HRESULT Resize
([in] UINT width
, [in] UINT height
);
55 HRESULT Trim
([in, optional, size_is(count
)] const RECT
*rectangles
, [in] UINT count
);
61 pointer_default(unique),
62 uuid(e334bc12
-3937-4e02
-85eb
-fcf4eb30d2c8
)
64 interface IDCompositionSurfaceFactory
: IUnknown
66 HRESULT CreateSurface
([in] UINT width
, [in] UINT height
, [in] DXGI_FORMAT pixel_format
, [in] DXGI_ALPHA_MODE alpha_mode
, [out] IDCompositionSurface
**surface
);
67 HRESULT CreateVirtualSurface
([in] UINT width
, [in] UINT height
, [in] DXGI_FORMAT pixel_format
, [in] DXGI_ALPHA_MODE alpha_mode
, [out] IDCompositionVirtualSurface
**surface
);
73 pointer_default(unique),
74 uuid(64ac3703
-9d3f
-45ec
-a109
-7cac0e7a13a7
)
76 interface IDCompositionClip
: IUnknown
83 pointer_default(unique),
84 uuid(9842ad7d
-d9cf
-4908-aed7
-48b51da5e7c2
)
86 interface IDCompositionRectangleClip
: IDCompositionClip
88 HRESULT SetLeft
([in] float left
);
89 HRESULT SetLeftAnimation
([in] IDCompositionAnimation
*animation
);
90 HRESULT SetTop
([in] float top
);
91 HRESULT SetTopAnimation
([in] IDCompositionAnimation
*animation
);
92 HRESULT SetRight
([in] float right
);
93 HRESULT SetRightAnimation
([in] IDCompositionAnimation
*animation
);
94 HRESULT SetBottom
([in] float bottom
);
95 HRESULT SetBottomAnimation
([in] IDCompositionAnimation
*animation
);
96 HRESULT SetTopLeftRadiusX
([in] float radius
);
97 HRESULT SetTopLeftRadiusXAnimation
([in] IDCompositionAnimation
*animation
);
98 HRESULT SetTopLeftRadiusY
([in] float radius
);
99 HRESULT SetTopLeftRadiusYAnimation
([in] IDCompositionAnimation
*animation
);
100 HRESULT SetTopRightRadiusX
([in] float radius
);
101 HRESULT SetTopRightRadiusXAnimation
([in] IDCompositionAnimation
*animation
);
102 HRESULT SetTopRightRadiusY
([in] float radius
);
103 HRESULT SetTopRightRadiusYAnimation
([in] IDCompositionAnimation
*animation
);
104 HRESULT SetBottomLeftRadiusX
([in] float radius
);
105 HRESULT SetBottomLeftRadiusXAnimation
([in] IDCompositionAnimation
*animation
);
106 HRESULT SetBottomLeftRadiusY
([in] float radius
);
107 HRESULT SetBottomLeftRadiusYAnimation
([in] IDCompositionAnimation
*animation
);
108 HRESULT SetBottomRightRadiusX
([in] float radius
);
109 HRESULT SetBottomRightRadiusXAnimation
([in] IDCompositionAnimation
*animation
);
110 HRESULT SetBottomRightRadiusY
([in] float radius
);
111 HRESULT SetBottomRightRadiusYAnimation
([in] IDCompositionAnimation
*animation
);
117 pointer_default(unique),
118 uuid(ec81b08f
-bfcb
-4e8d
-b193
-a915587999e8
)
120 interface IDCompositionEffect
: IUnknown
127 pointer_default(unique),
128 uuid(71185722-246b
-41f2
-aad1
-0443f7f4bfc2
)
130 interface IDCompositionTransform3D
: IDCompositionEffect
137 pointer_default(unique),
138 uuid(a7929a74
-e6b2
-4bd6
-8b95
-4040119ca34d
)
140 interface IDCompositionEffectGroup
: IDCompositionEffect
142 HRESULT SetOpacity
([in] float opacity
);
143 HRESULT SetOpacityAnimation
([in] IDCompositionAnimation
*animation
);
144 HRESULT SetTransform3D
([in, optional] IDCompositionTransform3D
*transform
);
150 pointer_default(unique),
151 uuid(91636d4b
-9ba1
-4532-aaf7
-e3344994d788
)
153 interface IDCompositionTranslateTransform3D
: IDCompositionTransform3D
155 HRESULT SetOffsetX
([in] float offset
);
156 HRESULT SetOffsetXAnimation
([in] IDCompositionAnimation
*animation
);
157 HRESULT SetOffsetY
([in] float offset
);
158 HRESULT SetOffsetYAnimation
([in] IDCompositionAnimation
*animation
);
159 HRESULT SetOffsetZ
([in] float offset
);
160 HRESULT SetOffsetZAnimation
([in] IDCompositionAnimation
*animation
);
166 pointer_default(unique),
167 uuid(2a9e9ead
-364b
-4b15
-a7c4
-a1997f78b389
)
169 interface IDCompositionScaleTransform3D
: IDCompositionTransform3D
171 HRESULT SetScaleX
([in] float scale
);
172 HRESULT SetScaleXAnimation
([in] IDCompositionAnimation
*animation
);
173 HRESULT SetScaleY
([in] float scale
);
174 HRESULT SetScaleYAnimation
([in] IDCompositionAnimation
*animation
);
175 HRESULT SetScaleZ
([in] float scale
);
176 HRESULT SetScaleZAnimation
([in] IDCompositionAnimation
*animation
);
177 HRESULT SetCenterX
([in] float center
);
178 HRESULT SetCenterXAnimation
([in] IDCompositionAnimation
*animation
);
179 HRESULT SetCenterY
([in] float center
);
180 HRESULT SetCenterYAnimation
([in] IDCompositionAnimation
*animation
);
181 HRESULT SetCenterZ
([in] float center
);
182 HRESULT SetCenterZAnimation
([in] IDCompositionAnimation
*animation
);
188 pointer_default(unique),
189 uuid(d8f5b23f
-d429
-4a91
-b55a
-d2f45fd75b18
)
191 interface IDCompositionRotateTransform3D
: IDCompositionTransform3D
193 HRESULT SetScaleX
([in] float scale
);
194 HRESULT SetScaleXAnimation
([in] IDCompositionAnimation
*animation
);
195 HRESULT SetScaleY
([in] float scale
);
196 HRESULT SetScaleYAnimation
([in] IDCompositionAnimation
*animation
);
197 HRESULT SetScaleZ
([in] float scale
);
198 HRESULT SetScaleZAnimation
([in] IDCompositionAnimation
*animation
);
199 HRESULT SetCenterX
([in] float center
);
200 HRESULT SetCenterXAnimation
([in] IDCompositionAnimation
*animation
);
201 HRESULT SetCenterY
([in] float center
);
202 HRESULT SetCenterYAnimation
([in] IDCompositionAnimation
*animation
);
203 HRESULT SetCenterZ
([in] float center
);
204 HRESULT SetCenterZAnimation
([in] IDCompositionAnimation
*animation
);
210 pointer_default(unique),
211 uuid(4b3363f0
-643b
-41b7
-b6e0
-ccf22d34467c
)
213 interface IDCompositionMatrixTransform3D
: IDCompositionTransform3D
215 /* C++ method: HRESULT SetMatrix(const D3DMATRIX &matrix); Use pointer instead of reference */
216 HRESULT SetMatrix
([in] const D3DMATRIX
*matrix
);
217 HRESULT SetMatrixElement
([in] int row
, [in] int column
, [in] float value
);
218 HRESULT SetMatrixElementAnimation
([in] int row
, [in] int column
, [in] IDCompositionAnimation
*animation
);
224 pointer_default(unique),
225 uuid(fd55faa7
-37e0
-4c20
-95d2
-9be45bc33f55
)
227 interface IDCompositionTransform
: IDCompositionTransform3D
234 pointer_default(unique),
235 uuid(71fde914
-40ef
-45ef
-bd51
-68b037c339f9
)
237 interface IDCompositionScaleTransform
: IDCompositionTransform
239 HRESULT SetScaleX
([in] float scale
);
240 HRESULT SetScaleXAnimation
([in] IDCompositionAnimation
*animation
);
241 HRESULT SetScaleY
([in] float scale
);
242 HRESULT SetScaleYAnimation
([in] IDCompositionAnimation
*animation
);
243 HRESULT SetCenterX
([in] float center
);
244 HRESULT SetCenterXAnimation
([in] IDCompositionAnimation
*animation
);
245 HRESULT SetCenterY
([in] float center
);
246 HRESULT SetCenterYAnimation
([in] IDCompositionAnimation
*animation
);
252 pointer_default(unique),
253 uuid(641ed83c
-ae96
-46c5
-90dc
-32774cc5c6d5
)
255 interface IDCompositionRotateTransform
: IDCompositionTransform
257 HRESULT SetAngle
([in] float angle
);
258 HRESULT SetAngleAnimation
([in] IDCompositionAnimation
*animation
);
259 HRESULT SetCenterX
([in] float center_x
);
260 HRESULT SetCenterXAnimation
([in] IDCompositionAnimation
*animation
);
261 HRESULT SetCenterY
([in] float center_y
);
262 HRESULT SetCenterYAnimation
([in] IDCompositionAnimation
*animation
);
268 pointer_default(unique),
269 uuid(e57aa735
-dcdb
-4c72
-9c61
-0591f58889ee
)
271 interface IDCompositionSkewTransform
: IDCompositionTransform
273 HRESULT SetAngleX
([in] float angle
);
274 HRESULT SetAngleXAnimation
([in] IDCompositionAnimation
*animation
);
275 HRESULT SetAngleY
([in] float angle
);
276 HRESULT SetAngleYAnimation
([in] IDCompositionAnimation
*animation
);
277 HRESULT SetCenterX
([in] float center
);
278 HRESULT SetCenterXAnimation
([in] IDCompositionAnimation
*animation
);
279 HRESULT SetCenterY
([in] float center
);
280 HRESULT SetCenterYAnimation
([in] IDCompositionAnimation
*animation
);
286 pointer_default(unique),
287 uuid(16cdff07
-c503
-419c
-83f2
-0965c7af1fa6
)
289 interface IDCompositionMatrixTransform
: IDCompositionTransform
291 /* C++ method: HRESULT SetMatrix(const D2D_MATRIX_3X2_F &matrix); Use pointer instead of reference */
292 HRESULT SetMatrix
([in] const D2D_MATRIX_3X2_F
*matrix
);
293 HRESULT SetMatrixElement
([in] int row
, [in] int column
, [in] float value
);
294 HRESULT SetMatrixElementAnimation
([in] int row
, [in] int column
, [in] IDCompositionAnimation
*animation
);
300 pointer_default(unique),
301 uuid(06791122-c6f0
-417d
-8323-269e987f5954
)
303 interface IDCompositionTranslateTransform
: IDCompositionTransform
305 HRESULT SetOffsetX
([in] float offset
);
306 HRESULT SetOffsetXAnimation
([in] IDCompositionAnimation
*animation
);
307 HRESULT SetOffsetY
([in] float offset
);
308 HRESULT SetOffsetYAnimation
([in] IDCompositionAnimation
*animation
);
313 uuid(4d93059d
-097b
-4651-9a60
-f0f25116e2f3
),
315 pointer_default(unique)
317 interface IDCompositionVisual
: IUnknown
319 HRESULT SetOffsetX
([in] float offset_x
);
320 HRESULT SetOffsetXAnimation
([in] IDCompositionAnimation
*animation
);
321 HRESULT SetOffsetY
([in] float offset_y
);
322 HRESULT SetOffsetYAnimation
([in] IDCompositionAnimation
*animation
);
323 /* C++ method: HRESULT SetTransform(const D2D_MATRIX_3X2_F &matrix); Use pointer instead of reference */
324 HRESULT SetTransform
([in] const D2D_MATRIX_3X2_F
*matrix
);
325 HRESULT SetTransformObject
([in] IDCompositionTransform
*transform
);
326 HRESULT SetTransformParent
([in] IDCompositionVisual
*visual
);
327 HRESULT SetEffect
([in] IDCompositionEffect
*effect
);
328 HRESULT SetBitmapInterpolationMode
([in] enum DCOMPOSITION_BITMAP_INTERPOLATION_MODE interpolation_mode
);
329 HRESULT SetBorderMode
([in] enum DCOMPOSITION_BORDER_MODE border_mode
);
330 /* C++ method: HRESULT SetClip(const D2D_RECT_F &rect); Use pointer instead of reference */
331 HRESULT SetClip
([in] const D2D_RECT_F
*rect
);
332 HRESULT SetClipObject
([in] IDCompositionClip
*clip
);
333 HRESULT SetContent
([in] IUnknown
*content
);
334 HRESULT AddVisual
([in] IDCompositionVisual
*visual
, [in] BOOL insert_above
, [in] IDCompositionVisual
*reference_visual
);
335 HRESULT RemoveVisual
([in] IDCompositionVisual
*visual
);
336 HRESULT RemoveAllVisuals
();
337 HRESULT SetCompositeMode
([in] enum DCOMPOSITION_COMPOSITE_MODE composite_mode
);
342 uuid(e8de1639
-4331-4b26
-bc5f
-6a321d347a85
),
344 pointer_default(unique)
346 interface IDCompositionVisual2
: IDCompositionVisual
348 HRESULT SetOpacityMode
([in] enum DCOMPOSITION_OPACITY_MODE opacity_mode
);
349 HRESULT SetBackFaceVisibility
([in] enum DCOMPOSITION_BACKFACE_VISIBILITY visibility
);
354 uuid(eacdd04c
-117e-4e17
-88f4
-d1b12b0e3d89
),
356 pointer_default(unique)
358 interface IDCompositionTarget
: IUnknown
360 HRESULT SetRoot
([in] IDCompositionVisual
*visual
);
365 uuid(c37ea93a
-e7aa
-450d
-b16f
-9746cb0407f3
),
367 pointer_default(unique)
369 interface IDCompositionDevice
: IUnknown
372 HRESULT WaitForCommitCompletion
();
373 HRESULT GetFrameStatistics
([out] DCOMPOSITION_FRAME_STATISTICS
*statistics
);
374 HRESULT CreateTargetForHwnd
([in] HWND hwnd
, [in] BOOL topmost
, [out] IDCompositionTarget
**target
);
375 HRESULT CreateVisual
([out] IDCompositionVisual
**visual
);
376 HRESULT CreateSurface
([in] UINT width
, [in] UINT height
, [in] DXGI_FORMAT pixel_format
, [in] DXGI_ALPHA_MODE alpha_mode
, [out] IDCompositionSurface
**surface
);
377 HRESULT CreateVirtualSurface
([in] UINT width
, [in] UINT height
, [in] DXGI_FORMAT pixel_format
, [in] DXGI_ALPHA_MODE alpha_mode
, [out] IDCompositionVirtualSurface
**surface
);
378 HRESULT CreateSurfaceFromHandle
([in] HANDLE handle, [out] IUnknown
**surface
);
379 HRESULT CreateSurfaceFromHwnd
([in] HWND hwnd
, [out] IUnknown
**surface
);
380 HRESULT CreateTranslateTransform
([out] IDCompositionTranslateTransform
**transform
);
381 HRESULT CreateScaleTransform
([out] IDCompositionScaleTransform
**transform
);
382 HRESULT CreateRotateTransform
([out] IDCompositionRotateTransform
**transform
);
383 HRESULT CreateSkewTransform
([out] IDCompositionSkewTransform
**transform
);
384 HRESULT CreateMatrixTransform
([out] IDCompositionMatrixTransform
**transform
);
385 HRESULT CreateTransformGroup
([in, size_is(elements
)] IDCompositionTransform
**transforms
, [in] UINT elements
, [out] IDCompositionTransform
**transform_group
);
386 HRESULT CreateTranslateTransform3D
([out] IDCompositionTranslateTransform3D
**transform_3d
);
387 HRESULT CreateScaleTransform3D
([out] IDCompositionScaleTransform3D
**transform_3d
);
388 HRESULT CreateRotateTransform3D
([out] IDCompositionRotateTransform3D
**transform_3d
);
389 HRESULT CreateMatrixTransform3D
([out] IDCompositionMatrixTransform3D
**transform_3d
);
390 HRESULT CreateTransform3DGroup
([in, size_is(elements
)] IDCompositionTransform3D
**transforms_3d
, [in] UINT elements
, [out] IDCompositionTransform3D
**transform_3d_group
);
391 HRESULT CreateEffectGroup
([out] IDCompositionEffectGroup
**effect_group
);
392 HRESULT CreateRectangleClip
([out] IDCompositionRectangleClip
**clip
);
393 HRESULT CreateAnimation
([out] IDCompositionAnimation
**animation
);
394 HRESULT CheckDeviceState
([out] BOOL
*valid
);
399 uuid(75f6468d
-1b8e
-447c
-9bc6
-75fea80b5b25
),
401 pointer_default(unique)
403 interface IDCompositionDevice2
: IUnknown
406 HRESULT WaitForCommitCompletion
();
407 HRESULT GetFrameStatistics
([out] DCOMPOSITION_FRAME_STATISTICS
*statistics
);
408 HRESULT CreateVisual
([out] IDCompositionVisual2
**visual
);
409 HRESULT CreateSurfaceFactory
([in] IUnknown
*rendering_device
, [out] IDCompositionSurfaceFactory
**surface_factory
);
410 HRESULT CreateSurface
([in] UINT width
, [in] UINT height
, [in] DXGI_FORMAT pixel_format
, [in] DXGI_ALPHA_MODE alpha_mode
, [out] IDCompositionSurface
**surface
);
411 HRESULT CreateVirtualSurface
([in] UINT width
, [in] UINT height
, [in] DXGI_FORMAT pixel_format
, [in] DXGI_ALPHA_MODE alpha_mode
, [out] IDCompositionVirtualSurface
**surface
);
412 HRESULT CreateTranslateTransform
([out] IDCompositionTranslateTransform
**transform
);
413 HRESULT CreateScaleTransform
([out] IDCompositionScaleTransform
**transform
);
414 HRESULT CreateRotateTransform
([out] IDCompositionRotateTransform
**transform
);
415 HRESULT CreateSkewTransform
([out] IDCompositionSkewTransform
**transform
);
416 HRESULT CreateMatrixTransform
([out] IDCompositionMatrixTransform
**transform
);
417 HRESULT CreateTransformGroup
([in, size_is(elements
)] IDCompositionTransform
**transforms
, [in] UINT elements
, [out] IDCompositionTransform
**transform_group
);
418 HRESULT CreateTranslateTransform3D
([out] IDCompositionTranslateTransform3D
**transform_3d
);
419 HRESULT CreateScaleTransform3D
([out] IDCompositionScaleTransform3D
**transform_3d
);
420 HRESULT CreateRotateTransform3D
([out] IDCompositionRotateTransform3D
**transform_3d
);
421 HRESULT CreateMatrixTransform3D
([out] IDCompositionMatrixTransform3D
**transform_3d
);
422 HRESULT CreateTransform3DGroup
([in, size_is(elements
)] IDCompositionTransform3D
**transforms_3d
, [in] UINT elements
, [out] IDCompositionTransform3D
**transform_3d_group
);
423 HRESULT CreateEffectGroup
([out] IDCompositionEffectGroup
**effect_group
);
424 HRESULT CreateRectangleClip
([out] IDCompositionRectangleClip
**clip
);
425 HRESULT CreateAnimation
([out] IDCompositionAnimation
**animation
);
430 uuid(5f4633fe
-1e08
-4cb8
-8c75
-ce24333f5602
),
432 pointer_default(unique)
434 interface IDCompositionDesktopDevice
: IDCompositionDevice2
436 HRESULT CreateTargetForHwnd
([in] HWND hwnd
, [in] BOOL topmost
, [out] IDCompositionTarget
**target
);
437 HRESULT CreateSurfaceFromHandle
([in] HANDLE handle, [out] IUnknown
**surface
);
438 HRESULT CreateSurfaceFromHwnd
([in] HWND hwnd
, [out] IUnknown
**surface
);
441 cpp_quote
("STDAPI DCompositionCreateDevice(IDXGIDevice *dxgi_device, REFIID iid, void **device);")
442 cpp_quote
("STDAPI DCompositionCreateDevice2(IUnknown *rendering_device, REFIID iid, void **device);")