user32/tests: Added PrivateExtractIcons test.
[wine.git] / include / dxgi.idl
blobc7ba584ecbf28f0733c7a1d3b3f1c7fd40939e10
1 /*
2 * Copyright 2007 Andras Kovacs
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 "oaidl.idl";
20 import "ocidl.idl";
21 import "dxgitype.h";
23 const UINT _FACDXGI = 0x87a;
25 cpp_quote("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)")
26 cpp_quote("#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)")
27 cpp_quote("#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)")
28 cpp_quote("#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)")
29 cpp_quote("#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)")
30 cpp_quote("#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)")
31 cpp_quote("#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)")
32 cpp_quote("#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)")
34 cpp_quote("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)")
35 cpp_quote("#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)")
36 cpp_quote("#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)")
37 cpp_quote("#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)")
38 cpp_quote("#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)")
39 cpp_quote("#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)")
40 cpp_quote("#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)")
41 cpp_quote("#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)")
42 cpp_quote("#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)")
43 cpp_quote("#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)")
44 cpp_quote("#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)")
45 cpp_quote("#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)")
46 cpp_quote("#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)")
47 cpp_quote("#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)")
49 cpp_quote("#if 0")
50 typedef HANDLE HMONITOR;
51 typedef struct _LUID {
52 DWORD LowPart;
53 LONG HighPart;
54 } LUID, *PLUID;
55 cpp_quote("#endif")
57 typedef UINT DXGI_USAGE;
58 const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L;
59 const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L;
60 const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L;
61 const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L;
62 const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L;
63 const DXGI_USAGE DXGI_USAGE_DISCARD_ON_PRESENT = 0x200L;
64 const DXGI_USAGE DXGI_USAGE_UNORDERED_ACCESS = 0x400L;
66 const UINT DXGI_ENUM_MODES_INTERLACED = 1;
67 const UINT DXGI_ENUM_MODES_SCALING = 2;
69 typedef enum DXGI_SWAP_EFFECT {
70 DXGI_SWAP_EFFECT_DISCARD = 0,
71 DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
72 DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL = 3,
73 DXGI_SWAP_EFFECT_FLIP_DISCARD = 4
74 } DXGI_SWAP_EFFECT;
76 typedef enum DXGI_RESIDENCY {
77 DXGI_RESIDENCY_FULLY_RESIDENT = 1,
78 DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2,
79 DXGI_RESIDENCY_EVICTED_TO_DISK = 3,
80 } DXGI_RESIDENCY;
82 typedef struct DXGI_SURFACE_DESC {
83 UINT Width;
84 UINT Height;
85 DXGI_FORMAT Format;
86 DXGI_SAMPLE_DESC SampleDesc;
87 } DXGI_SURFACE_DESC;
89 typedef struct DXGI_MAPPED_RECT {
90 INT Pitch;
91 BYTE *pBits;
92 } DXGI_MAPPED_RECT;
94 typedef struct DXGI_OUTPUT_DESC {
95 WCHAR DeviceName[32];
96 RECT DesktopCoordinates;
97 BOOL AttachedToDesktop;
98 DXGI_MODE_ROTATION Rotation;
99 HMONITOR Monitor;
100 } DXGI_OUTPUT_DESC;
102 typedef struct DXGI_FRAME_STATISTICS {
103 UINT PresentCount;
104 UINT PresentRefreshCount;
105 UINT SyncRefreshCount;
106 LARGE_INTEGER SyncQPCTime;
107 LARGE_INTEGER SyncGPUTime;
108 } DXGI_FRAME_STATISTICS;
110 typedef struct DXGI_ADAPTER_DESC {
111 WCHAR Description[128];
112 UINT VendorId;
113 UINT DeviceId;
114 UINT SubSysId;
115 UINT Revision;
116 SIZE_T DedicatedVideoMemory;
117 SIZE_T DedicatedSystemMemory;
118 SIZE_T SharedSystemMemory;
119 LUID AdapterLuid;
120 } DXGI_ADAPTER_DESC;
122 typedef enum DXGI_SWAP_CHAIN_FLAG {
123 DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1,
124 DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2,
125 DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4
126 } DXGI_SWAP_CHAIN_FLAG;
128 typedef struct DXGI_SWAP_CHAIN_DESC {
129 DXGI_MODE_DESC BufferDesc;
130 DXGI_SAMPLE_DESC SampleDesc;
131 DXGI_USAGE BufferUsage;
132 UINT BufferCount;
133 HWND OutputWindow;
134 BOOL Windowed;
135 DXGI_SWAP_EFFECT SwapEffect;
136 UINT Flags;
137 } DXGI_SWAP_CHAIN_DESC;
139 typedef struct DXGI_SHARED_RESOURCE {
140 HANDLE Handle;
141 } DXGI_SHARED_RESOURCE;
144 object,
145 local,
146 uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
148 interface IDXGIObject : IUnknown
150 HRESULT SetPrivateData(
151 [in] REFGUID guid,
152 [in] UINT data_size,
153 [in] const void *data
155 HRESULT SetPrivateDataInterface(
156 [in] REFGUID guid,
157 [in] const IUnknown *object
159 HRESULT GetPrivateData(
160 [in] REFGUID guid,
161 [in, out] UINT *data_size,
162 [out] void *data
164 HRESULT GetParent(
165 [in] REFIID riid,
166 [out] void **parent
171 object,
172 local,
173 uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
175 interface IDXGIDeviceSubObject : IDXGIObject
177 HRESULT GetDevice(
178 [in] REFIID riid,
179 [out] void **device
184 object,
185 uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b),
186 local,
187 pointer_default(unique)
189 interface IDXGIResource : IDXGIDeviceSubObject
191 HRESULT GetSharedHandle([out] HANDLE *pSharedHandle);
192 HRESULT GetUsage([out] DXGI_USAGE *pUsage);
193 HRESULT SetEvictionPriority([in] UINT EvictionPriority);
194 HRESULT GetEvictionPriority([out, retval] UINT *pEvictionPriority);
198 object,
199 uuid(9d8e1289-d7b3-465f-8126-250e349af85d),
200 local,
201 pointer_default(unique)
203 interface IDXGIKeyedMutex : IDXGIDeviceSubObject
205 HRESULT AcquireSync([in] UINT64 Key, [in] DWORD dwMilliseconds);
206 HRESULT ReleaseSync([in] UINT64 Key);
210 object,
211 local,
212 uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
214 interface IDXGISurface : IDXGIDeviceSubObject
216 HRESULT GetDesc(
217 [out] DXGI_SURFACE_DESC *desc
219 HRESULT Map(
220 [out] DXGI_MAPPED_RECT *mapped_rect,
221 [in] UINT flags
223 HRESULT Unmap(
228 object,
229 local,
230 uuid(4ae63092-6327-4c1b-80ae-bfe12ea32b86)
232 interface IDXGISurface1 : IDXGISurface
234 HRESULT GetDC(
235 [in] BOOL discard,
236 [out] HDC *hdc
238 HRESULT ReleaseDC(
239 [in] RECT *dirty_rect
244 object,
245 local,
246 uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
248 interface IDXGIOutput : IDXGIObject
250 HRESULT GetDesc(
251 [out] DXGI_OUTPUT_DESC *desc
253 HRESULT GetDisplayModeList(
254 [in] DXGI_FORMAT format,
255 [in] UINT flags,
256 [in, out] UINT *mode_count,
257 [out] DXGI_MODE_DESC *desc
259 HRESULT FindClosestMatchingMode(
260 [in] const DXGI_MODE_DESC *mode,
261 [out] DXGI_MODE_DESC *closest_match,
262 [in] IUnknown *device
264 HRESULT WaitForVBlank(
266 HRESULT TakeOwnership(
267 [in] IUnknown *device,
268 [in] BOOL exclusive
270 void ReleaseOwnership(
272 HRESULT GetGammaControlCapabilities(
273 [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
275 HRESULT SetGammaControl(
276 [in] const DXGI_GAMMA_CONTROL *gamma_control
278 HRESULT GetGammaControl(
279 [out] DXGI_GAMMA_CONTROL *gamma_control
281 HRESULT SetDisplaySurface(
282 [in] IDXGISurface *surface
284 HRESULT GetDisplaySurfaceData(
285 [in] IDXGISurface *surface
287 HRESULT GetFrameStatistics(
288 [out] DXGI_FRAME_STATISTICS *stats
293 object,
294 local,
295 uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
297 interface IDXGIAdapter : IDXGIObject
299 HRESULT EnumOutputs(
300 [in] UINT output_idx,
301 [in, out] IDXGIOutput **output
303 HRESULT GetDesc(
304 [out] DXGI_ADAPTER_DESC *desc
306 HRESULT CheckInterfaceSupport(
307 [in] REFGUID guid,
308 [out] LARGE_INTEGER *umd_version
312 cpp_quote("#define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)")
314 cpp_quote("#define DXGI_PRESENT_TEST __MSABI_LONG(0x00000001U)")
315 cpp_quote("#define DXGI_PRESENT_DO_NOT_SEQUENCE __MSABI_LONG(0x00000002U)")
316 cpp_quote("#define DXGI_PRESENT_RESTART __MSABI_LONG(0x00000004U)")
317 cpp_quote("#define DXGI_PRESENT_DO_NOT_WAIT __MSABI_LONG(0x00000008U)")
318 cpp_quote("#define DXGI_PRESENT_STEREO_PREFER_RIGHT __MSABI_LONG(0x00000010U)")
319 cpp_quote("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO __MSABI_LONG(0x00000020U)")
320 cpp_quote("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT __MSABI_LONG(0x00000040U)")
323 object,
324 local,
325 uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
327 interface IDXGISwapChain : IDXGIDeviceSubObject
329 HRESULT Present(
330 [in] UINT sync_interval,
331 [in] UINT flags
333 HRESULT GetBuffer(
334 [in] UINT buffer_idx,
335 [in] REFIID riid,
336 [in, out] void **surface
338 HRESULT SetFullscreenState(
339 [in] BOOL fullscreen,
340 [in] IDXGIOutput *target
342 HRESULT GetFullscreenState(
343 [out] BOOL *fullscreen,
344 [out] IDXGIOutput **target
346 HRESULT GetDesc(
347 [out] DXGI_SWAP_CHAIN_DESC *desc
349 HRESULT ResizeBuffers(
350 [in] UINT buffer_count,
351 [in] UINT width,
352 [in] UINT height,
353 [in] DXGI_FORMAT format,
354 [in] UINT flags
356 HRESULT ResizeTarget(
357 [in] const DXGI_MODE_DESC *target_mode_desc
359 HRESULT GetContainingOutput(
360 [out] IDXGIOutput **output
362 HRESULT GetFrameStatistics(
363 [out] DXGI_FRAME_STATISTICS *stats
365 HRESULT GetLastPresentCount(
366 [out] UINT *last_present_count
370 cpp_quote("#define DXGI_MWA_NO_WINDOW_CHANGES 0x1")
371 cpp_quote("#define DXGI_MWA_NO_ALT_ENTER 0x2")
372 cpp_quote("#define DXGI_MWA_NO_PRINT_SCREEN 0x4")
373 cpp_quote("#define DXGI_MWA_VALID 0x7")
376 object,
377 local,
378 uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
380 interface IDXGIFactory : IDXGIObject
382 HRESULT EnumAdapters(
383 [in] UINT adapter_idx,
384 [out] IDXGIAdapter **adapter
386 HRESULT MakeWindowAssociation(
387 [in] HWND window,
388 [in] UINT flags
390 HRESULT GetWindowAssociation(
391 [in] HWND *window
393 HRESULT CreateSwapChain(
394 [in] IUnknown *device,
395 [in] DXGI_SWAP_CHAIN_DESC *desc,
396 [out] IDXGISwapChain **swapchain
398 HRESULT CreateSoftwareAdapter(
399 [in] HMODULE swrast,
400 [out] IDXGIAdapter **adapter
404 [local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
405 [local] HRESULT __stdcall CreateDXGIFactory1(REFIID riid, void **factory);
408 object,
409 local,
410 uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
412 interface IDXGIDevice : IDXGIObject
414 HRESULT GetAdapter(
415 [out] IDXGIAdapter **adapter
417 HRESULT CreateSurface(
418 [in] const DXGI_SURFACE_DESC *desc,
419 [in] UINT surface_count,
420 [in] DXGI_USAGE usage,
421 [in] const DXGI_SHARED_RESOURCE *shared_resource,
422 [out] IDXGISurface **surface
424 HRESULT QueryResourceResidency(
425 [in] IUnknown *const *resources,
426 [out] DXGI_RESIDENCY *residency,
427 [in] UINT resource_count
429 HRESULT SetGPUThreadPriority(
430 [in] INT priority
432 HRESULT GetGPUThreadPriority(
433 [out] INT *priority
437 typedef enum DXGI_ADAPTER_FLAG {
438 DXGI_ADAPTER_FLAG_NONE = 0,
439 DXGI_ADAPTER_FLAG_REMOTE = 1,
440 DXGI_ADAPTER_FLAG_FORCE_DWORD = 0xFFFFFFFF
441 } DXGI_ADAPTER_FLAG;
443 typedef struct DXGI_ADAPTER_DESC1 {
444 WCHAR Description[128];
445 UINT VendorId;
446 UINT DeviceId;
447 UINT SubSysId;
448 UINT Revision;
449 SIZE_T DedicatedVideoMemory;
450 SIZE_T DedicatedSystemMemory;
451 SIZE_T SharedSystemMemory;
452 LUID AdapterLuid;
453 UINT Flags;
454 } DXGI_ADAPTER_DESC1;
457 object,
458 uuid(29038f61-3839-4626-91fd-086879011a05),
459 local,
460 pointer_default(unique)
462 interface IDXGIAdapter1 : IDXGIAdapter
464 HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc);
468 object,
469 uuid(77db970f-6276-48ba-ba28-070143b4392c),
470 local,
471 pointer_default(unique)
473 interface IDXGIDevice1 : IDXGIDevice
475 HRESULT SetMaximumFrameLatency([in] UINT MaxLatency);
476 HRESULT GetMaximumFrameLatency([out] UINT *pMaxLatency);
480 object,
481 uuid(770aae78-f26f-4dba-a829-253c83d1b387),
482 local,
483 pointer_default(unique)
485 interface IDXGIFactory1 : IDXGIFactory
487 HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter);
488 BOOL IsCurrent();