comctl32: Add implementation of LVS_EX_ONECLICKACTIVATE.
[wine] / dlls / dxgi / adapter.c
1 /*
2  * Copyright 2008 Henri Verbeet for CodeWeavers
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
20 #include "config.h"
21 #include "wine/port.h"
22
23 #include "dxgi_private.h"
24
25 WINE_DEFAULT_DEBUG_CHANNEL(dxgi);
26
27 /* IUnknown methods */
28
29 static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IDXGIAdapter *iface, REFIID riid, void **object)
30 {
31     TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
32
33     if (IsEqualGUID(riid, &IID_IUnknown)
34             || IsEqualGUID(riid, &IID_IDXGIObject)
35             || IsEqualGUID(riid, &IID_IDXGIAdapter))
36     {
37         IUnknown_AddRef(iface);
38         *object = iface;
39         return S_OK;
40     }
41
42     WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
43
44     *object = NULL;
45     return E_NOINTERFACE;
46 }
47
48 static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IDXGIAdapter *iface)
49 {
50     struct dxgi_adapter *This = (struct dxgi_adapter *)iface;
51     ULONG refcount = InterlockedIncrement(&This->refcount);
52
53     TRACE("%p increasing refcount to %u\n", This, refcount);
54
55     return refcount;
56 }
57
58 static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter *iface)
59 {
60     struct dxgi_adapter *This = (struct dxgi_adapter *)iface;
61     ULONG refcount = InterlockedDecrement(&This->refcount);
62
63     TRACE("%p decreasing refcount to %u\n", This, refcount);
64
65     if (!refcount)
66     {
67         HeapFree(GetProcessHeap(), 0, This);
68     }
69
70     return refcount;
71 }
72
73 /* IDXGIObject methods */
74
75 static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter *iface,
76         REFGUID guid, UINT data_size, const void *data)
77 {
78     FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
79
80     return E_NOTIMPL;
81 }
82
83 static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter *iface,
84         REFGUID guid, const IUnknown *object)
85 {
86     FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object);
87
88     return E_NOTIMPL;
89 }
90
91 static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IDXGIAdapter *iface,
92         REFGUID guid, UINT *data_size, void *data)
93 {
94     FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data);
95
96     return E_NOTIMPL;
97 }
98
99 static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter *iface, REFIID riid, void **parent)
100 {
101     FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent);
102
103     return E_NOTIMPL;
104 }
105
106 /* IDXGIAdapter methods */
107
108 static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IDXGIAdapter *iface, UINT output_idx, IDXGIOutput **output)
109 {
110     FIXME("iface %p, output_idx %u, output %p stub!\n", iface, output_idx, output);
111
112     return E_NOTIMPL;
113 }
114
115 static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IDXGIAdapter *iface, DXGI_ADAPTER_DESC *desc)
116 {
117     FIXME("iface %p, desc %p stub!\n", iface, desc);
118
119     return E_NOTIMPL;
120 }
121
122 static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IDXGIAdapter *iface,
123         REFGUID guid, LARGE_INTEGER *umd_version)
124 {
125     FIXME("iface %p, guid %s, umd_version %p stub!\n", iface, debugstr_guid(guid), umd_version);
126
127     return E_NOTIMPL;
128 }
129
130 const struct IDXGIAdapterVtbl dxgi_adapter_vtbl =
131 {
132     /* IUnknown methods */
133     dxgi_adapter_QueryInterface,
134     dxgi_adapter_AddRef,
135     dxgi_adapter_Release,
136     /* IDXGIObject methods */
137     dxgi_adapter_SetPrivateData,
138     dxgi_adapter_SetPrivateDataInterface,
139     dxgi_adapter_GetPrivateData,
140     dxgi_adapter_GetParent,
141     /* IDXGIAdapter methods */
142     dxgi_adapter_EnumOutputs,
143     dxgi_adapter_GetDesc,
144     dxgi_adapter_CheckInterfaceSupport,
145 };