msvcrt: Fix _vswprintf* arguments.
[wine] / include / dxgi.idl
1 /*
2  * Copyright 2007 Andras Kovacs
3  *
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.
8  *
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.
13  *
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
17  */
18
19 import "oaidl.idl";
20 import "ocidl.idl";
21 import "dxgitype.h";
22
23 const UINT _FACDXGI = 0x87a;
24
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)")
33
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)")
48
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")
56
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
64 const UINT DXGI_ENUM_MODES_INTERLACED               = 1;
65 const UINT DXGI_ENUM_MODES_SCALING                  = 2;
66
67 typedef enum DXGI_SWAP_EFFECT {
68     DXGI_SWAP_EFFECT_DISCARD    = 0,
69     DXGI_SWAP_EFFECT_SEQUENTIAL = 1,
70 } DXGI_SWAP_EFFECT;
71
72 typedef enum DXGI_RESIDENCY {
73     DXGI_RESIDENCY_FULLY_RESIDENT               = 1,
74     DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY    = 2,
75     DXGI_RESIDENCY_EVICTED_TO_DISK              = 3,
76 } DXGI_RESIDENCY;
77
78 typedef struct DXGI_SURFACE_DESC {
79     UINT Width;
80     UINT Height;
81     DXGI_FORMAT Format;
82     DXGI_SAMPLE_DESC SampleDesc;
83 } DXGI_SURFACE_DESC;
84
85 typedef struct DXGI_MAPPED_RECT {
86     INT Pitch;
87     BYTE *pBits;
88 } DXGI_MAPPED_RECT;
89
90 typedef struct DXGI_OUTPUT_DESC {
91     WCHAR DeviceName[32];
92     RECT DesktopCoordinates;
93     BOOL AttachedToDesktop;
94     DXGI_MODE_ROTATION Rotation;
95     HMONITOR Monitor;
96 } DXGI_OUTPUT_DESC;
97
98 typedef struct DXGI_FRAME_STATISTICS {
99     UINT PresentCount;
100     UINT PresentRefreshCount;
101     UINT SyncRefreshCount;
102     LARGE_INTEGER SyncQPCTime;
103     LARGE_INTEGER SyncGPUTime;
104 } DXGI_FRAME_STATISTICS;
105
106 typedef struct DXGI_ADAPTER_DESC {
107     WCHAR Description[128];
108     UINT VendorId;
109     UINT DeviceId;
110     UINT SubSysId;
111     UINT Revision;
112     SIZE_T DedicatedVideoMemory;
113     SIZE_T DedicatedSystemMemory;
114     SIZE_T SharedSystemMemory;
115     LUID AdapterLuid;
116 } DXGI_ADAPTER_DESC;
117
118 typedef enum DXGI_SWAP_CHAIN_FLAG {
119     DXGI_SWAP_CHAIN_FLAG_NONPREROTATED      = 1,
120     DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH  = 2,
121     DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE     = 4
122 } DXGI_SWAP_CHAIN_FLAG;
123
124 typedef struct DXGI_SWAP_CHAIN_DESC {
125     DXGI_MODE_DESC BufferDesc;
126     DXGI_SAMPLE_DESC SampleDesc;
127     DXGI_USAGE BufferUsage;
128     UINT BufferCount;
129     HWND OutputWindow;
130     BOOL Windowed;
131     DXGI_SWAP_EFFECT SwapEffect;
132     UINT Flags;
133 } DXGI_SWAP_CHAIN_DESC;
134
135 typedef struct DXGI_SHARED_RESOURCE {
136     HANDLE Handle;
137 } DXGI_SHARED_RESOURCE;
138
139 [
140     object,
141     local,
142     uuid(aec22fb8-76f3-4639-9be0-28eb43a67a2e)
143 ]
144 interface IDXGIObject : IUnknown
145 {
146     HRESULT SetPrivateData(
147         [in] REFGUID guid,
148         [in] UINT data_size,
149         [in] const void *data
150     );
151     HRESULT SetPrivateDataInterface(
152         [in] REFGUID guid,
153         [in] const IUnknown *object
154     );
155     HRESULT GetPrivateData(
156         [in] REFGUID guid,
157         [in, out] UINT *data_size,
158         [out] void *data
159     );
160     HRESULT GetParent(
161         [in] REFIID riid,
162         [out] void **parent
163     );
164 }
165
166 [
167     object,
168     local,
169     uuid(3d3e0379-f9de-4d58-bb6c-18d62992f1a6)
170 ]
171 interface IDXGIDeviceSubObject : IDXGIObject
172 {
173     HRESULT GetDevice(
174         [in] REFIID riid,
175         [out] void **device
176     );
177 }
178
179 [
180     object,
181     uuid(035f3ab4-482e-4e50-b41f-8a7f8bd8960b),
182     local,
183     pointer_default(unique)
184 ]
185 interface IDXGIResource : IDXGIDeviceSubObject
186 {
187     HRESULT GetSharedHandle([out] HANDLE *pSharedHandle);
188     HRESULT GetUsage([out] DXGI_USAGE *pUsage);
189     HRESULT SetEvictionPriority([in] UINT EvictionPriority);
190     HRESULT GetEvictionPriority([out, retval] UINT *pEvictionPriority);
191 }
192
193 [
194     object,
195     local,
196     uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec)
197 ]
198 interface IDXGISurface : IDXGIDeviceSubObject
199 {
200     HRESULT GetDesc(
201         [out] DXGI_SURFACE_DESC *desc
202     );
203     HRESULT Map(
204         [out] DXGI_MAPPED_RECT *mapped_rect,
205         [in] UINT flags
206     );
207     HRESULT Unmap(
208     );
209 }
210
211 [
212     object,
213     local,
214     uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa)
215 ]
216 interface IDXGIOutput : IDXGIObject
217 {
218     HRESULT GetDesc(
219         [out] DXGI_OUTPUT_DESC *desc
220     );
221     HRESULT GetDisplayModeList(
222         [in] DXGI_FORMAT format,
223         [in] UINT flags,
224         [in, out] UINT *mode_count,
225         [out] DXGI_MODE_DESC *desc
226     );
227     HRESULT FindClosestMatchingMode(
228         [in] const DXGI_MODE_DESC *mode,
229         [out] DXGI_MODE_DESC *closest_match,
230         [in] IUnknown *device
231     );
232     HRESULT WaitForVBlank(
233     );
234     HRESULT TakeOwnership(
235         [in] IUnknown *device,
236         [in] BOOL exclusive
237     );
238     void ReleaseOwnership(
239     );
240     HRESULT GetGammaControlCapabilities(
241         [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps
242     );
243     HRESULT SetGammaControl(
244         [in] const DXGI_GAMMA_CONTROL *gamma_control
245     );
246     HRESULT GetGammaControl(
247         [out] DXGI_GAMMA_CONTROL *gamma_control
248     );
249     HRESULT SetDisplaySurface(
250         [in] IDXGISurface *surface
251     );
252     HRESULT GetDisplaySurfaceData(
253         [in] IDXGISurface *surface
254     );
255     HRESULT GetFrameStatistics(
256         [out] DXGI_FRAME_STATISTICS *stats
257     );
258 }
259
260 [
261     object,
262     local,
263     uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0)
264 ]
265 interface IDXGIAdapter : IDXGIObject
266 {
267     HRESULT EnumOutputs(
268         [in] UINT output_idx,
269         [in, out] IDXGIOutput **output
270     );
271     HRESULT GetDesc(
272         [out] DXGI_ADAPTER_DESC *desc
273     );
274     HRESULT CheckInterfaceSupport(
275         [in] REFGUID guid,
276         [out] LARGE_INTEGER *umd_version
277     );
278 }
279
280 [
281     object,
282     local,
283     uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a)
284 ]
285 interface IDXGISwapChain : IDXGIDeviceSubObject
286 {
287     HRESULT Present(
288         [in] UINT sync_interval,
289         [in] UINT flags
290     );
291     HRESULT GetBuffer(
292         [in] UINT buffer_idx,
293         [in] REFIID riid,
294         [in, out] void **surface
295     );
296     HRESULT SetFullscreenState(
297         [in] BOOL fullscreen,
298         [in] IDXGIOutput *target
299     );
300     HRESULT GetFullscreenState(
301         [out] BOOL *fullscreen,
302         [out] IDXGIOutput **target
303     );
304     HRESULT GetDesc(
305         [out] DXGI_SWAP_CHAIN_DESC *desc
306     );
307     HRESULT ResizeBuffers(
308         [in] UINT buffer_count,
309         [in] UINT width,
310         [in] UINT height,
311         [in] DXGI_FORMAT format,
312         [in] UINT flags
313     );
314     HRESULT ResizeTarget(
315         [in] const DXGI_MODE_DESC *target_mode_desc
316     );
317     HRESULT GetContainingOutput(
318         [out] IDXGIOutput **output
319     );
320     HRESULT GetFrameStatistics(
321         [out] DXGI_FRAME_STATISTICS *stats
322     );
323     HRESULT GetLastPresentCount(
324         [out] UINT *last_present_count
325     );
326 }
327
328 cpp_quote("#define DXGI_MWA_NO_WINDOW_CHANGES  0x1")
329 cpp_quote("#define DXGI_MWA_NO_ALT_ENTER       0x2")
330 cpp_quote("#define DXGI_MWA_NO_PRINT_SCREEN    0x4")
331 cpp_quote("#define DXGI_MWA_VALID              0x7")
332
333 [
334     object,
335     local,
336     uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369)
337 ]
338 interface IDXGIFactory : IDXGIObject
339 {
340     HRESULT EnumAdapters(
341         [in] UINT adapter_idx,
342         [out] IDXGIAdapter **adapter
343     );
344     HRESULT MakeWindowAssociation(
345         [in] HWND window,
346         [in] UINT flags
347     );
348     HRESULT GetWindowAssociation(
349         [in] HWND *window
350     );
351     HRESULT CreateSwapChain(
352         [in] IUnknown *device,
353         [in] DXGI_SWAP_CHAIN_DESC *desc,
354         [out] IDXGISwapChain **swapchain
355     );
356     HRESULT CreateSoftwareAdapter(
357         [in] HMODULE swrast,
358         [out] IDXGIAdapter **adapter
359     );
360 }
361
362 [local] HRESULT __stdcall CreateDXGIFactory(REFIID riid, void **factory);
363
364 [
365     object,
366     local,
367     uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c)
368 ]
369 interface IDXGIDevice : IDXGIObject
370 {
371     HRESULT GetAdapter(
372         [out] IDXGIAdapter **adapter
373     );
374     HRESULT CreateSurface(
375         [in] const DXGI_SURFACE_DESC *desc,
376         [in] UINT surface_count,
377         [in] DXGI_USAGE usage,
378         [in] const DXGI_SHARED_RESOURCE *shared_resource,
379         [out] IDXGISurface **surface
380     );
381     HRESULT QueryResourceResidency(
382         [in] IUnknown *const *resources,
383         [out] DXGI_RESIDENCY *residency,
384         [in] UINT resource_count
385     );
386     HRESULT SetGPUThreadPriority(
387         [in] INT priority
388     );
389     HRESULT GetGPUThreadPriority(
390         [out] INT *priority
391     );
392 }
393
394 typedef enum DXGI_ADAPTER_FLAG {
395     DXGI_ADAPTER_FLAG_NONE         = 0,
396     DXGI_ADAPTER_FLAG_REMOTE       = 1,
397     DXGI_ADAPTER_FLAG_FORCE_DWORD  = 0xFFFFFFFF
398 } DXGI_ADAPTER_FLAG;
399
400 typedef struct DXGI_ADAPTER_DESC1 {
401     WCHAR  Description[128];
402     UINT   VendorId;
403     UINT   DeviceId;
404     UINT   SubSysId;
405     UINT   Revision;
406     SIZE_T DedicatedVideoMemory;
407     SIZE_T DedicatedSystemMemory;
408     SIZE_T SharedSystemMemory;
409     LUID   AdapterLuid;
410     UINT   Flags;
411 } DXGI_ADAPTER_DESC1;
412
413 [
414     object,
415     uuid(29038f61-3839-4626-91fd-086879011a05),
416     local,
417     pointer_default(unique)
418 ]
419 interface IDXGIAdapter1 : IDXGIAdapter
420 {
421     HRESULT GetDesc1([out] DXGI_ADAPTER_DESC1 *pDesc);
422 }
423
424 [
425     object,
426     uuid(770aae78-f26f-4dba-a829-253c83d1b387),
427     local,
428     pointer_default(unique)
429  ]
430 interface IDXGIFactory1 : IDXGIFactory
431 {
432     HRESULT EnumAdapters1([in] UINT Adapter, [out] IDXGIAdapter1 **ppAdapter);
433     BOOL IsCurrent();
434 }