xref: /reactos/sdk/include/psdk/dinputd.h (revision c2c66aff)
1 /*
2  * Copyright (C) the Wine project
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 #ifndef __DINPUTD_INCLUDED__
20 #define __DINPUTD_INCLUDED__
21 
22 #define COM_NO_WINDOWS_H
23 #include <objbase.h>
24 
25 #ifndef DIRECTINPUT_VERSION
26 #define DIRECTINPUT_VERSION 0x0800
27 #endif
28 
29 DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xEB0D7DFA,0x1990,0x4F27,0xB4,0xD6,0xED,0xF2,0xEE,0xC4,0xA4,0x4C);
30 
31 typedef struct IDirectInputJoyConfig8 *LPDIRECTINPUTJOYCONFIG8;
32 
33 
34 typedef BOOL (CALLBACK *LPDIJOYTYPECALLBACK)(LPCWSTR, LPVOID);
35 
36 #define MAX_JOYSTRING 256
37 #ifndef MAX_JOYSTICKOEMVXDNAME
38 #define MAX_JOYSTICKOEMVXDNAME 260
39 #endif
40 
41 #define JOY_POV_NUMDIRS         4
42 #define JOY_POVVAL_FORWARD      0
43 #define JOY_POVVAL_BACKWARD     1
44 #define JOY_POVVAL_LEFT         2
45 #define JOY_POVVAL_RIGHT        3
46 
47 #define DIERR_NOMOREITEMS       MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NO_MORE_ITEMS)
48 
49 typedef struct joypos_tag
50 {
51     DWORD dwX;
52     DWORD dwY;
53     DWORD dwZ;
54     DWORD dwR;
55     DWORD dwU;
56     DWORD dwV;
57 } JOYPOS, *LPJOYPOS;
58 
59 typedef struct joyrange_tag
60 {
61     JOYPOS jpMin;
62     JOYPOS jpMax;
63     JOYPOS jpCenter;
64 } JOYRANGE, *LPJOYRANGE;
65 
66 typedef struct joyreguservalues_tag
67 {
68     DWORD dwTimeOut;
69     JOYRANGE jrvRanges;
70     JOYPOS jpDeadZone;
71 } JOYREGUSERVALUES, *LPJOYREGUSERVALUES;
72 
73 typedef struct joyreghwsettings_tag
74 {
75     DWORD dwFlags;
76     DWORD dwNumButtons;
77 } JOYREGHWSETTINGS, *LPJOYHWSETTINGS;
78 
79 typedef struct joyreghwvalues_tag
80 {
81     JOYRANGE jrvHardware;
82     DWORD dwPOVValues[JOY_POV_NUMDIRS];
83     DWORD dwCalFlags;
84 } JOYREGHWVALUES, *LPJOYREGHWVALUES;
85 
86 typedef struct joyreghwconfig_tag
87 {
88     JOYREGHWSETTINGS hws;
89     DWORD dwUsageSettings;
90     JOYREGHWVALUES hwv;
91     DWORD dwType;
92     DWORD dwReserved;
93 } JOYREGHWCONFIG, *LPJOYREGHWCONFIG;
94 
95 typedef struct DIJOYTYPEINFO_DX5
96 {
97     DWORD dwSize;
98     JOYREGHWSETTINGS hws;
99     CLSID clsidConfig;
100     WCHAR wszDisplayName[MAX_JOYSTRING];
101     WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
102 } DIJOYTYPEINFO_DX5, *LPDIJOYTYPEINFO_DX5;
103 typedef const DIJOYTYPEINFO_DX5 *LPCDIJOYTYPEINFO_DX5;
104 
105 typedef struct DIJOYTYPEINFO_DX6
106 {
107     DWORD dwSize;
108     JOYREGHWSETTINGS hws;
109     CLSID clsidConfig;
110     WCHAR wszDisplayName[MAX_JOYSTRING];
111     WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
112     WCHAR wszHardwareId[MAX_JOYSTRING];
113     DWORD dwFlags1;
114 } DIJOYTYPEINFO_DX6, *LPDIJOYTYPEINFO_DX6;
115 typedef const DIJOYTYPEINFO_DX6 *LPCDIJOYTYPEINFO_DX6;
116 
117 typedef struct DIJOYTYPEINFO
118 {
119     DWORD dwSize;
120     JOYREGHWSETTINGS hws;
121     CLSID clsidConfig;
122     WCHAR wszDisplayName[MAX_JOYSTRING];
123     WCHAR wszCallout[MAX_JOYSTICKOEMVXDNAME];
124     WCHAR wszHardwareId[MAX_JOYSTRING];
125     DWORD dwFlags1;
126     DWORD dwFlags2;
127     WCHAR wszMapFile[MAX_JOYSTRING];
128 } DIJOYTYPEINFO, *LPDIJOYTYPEINFO;
129 typedef const DIJOYTYPEINFO *LPCDIJOYTYPEINFO;
130 #define DIJC_GUIDINSTANCE       0x00000001
131 #define DIJC_REGHWCONFIGTYPE    0x00000002
132 #define DIJC_GAIN               0x00000004
133 #define DIJC_CALLOUT            0x00000008
134 #define DIJC_WDMGAMEPORT        0x00000010
135 
136 typedef struct DIJOYCONFIG_DX5
137 {
138     DWORD dwSize;
139     GUID guidInstance;
140     JOYREGHWCONFIG hwc;
141     DWORD dwGain;
142     WCHAR wszType[MAX_JOYSTRING];
143     WCHAR wszCallout[MAX_JOYSTRING];
144 } DIJOYCONFIG_DX5, *LPDIJOYCONFIG_DX5;
145 typedef const DIJOYCONFIG_DX5 *LPCDIJOYCONFIG_DX5;
146 
147 typedef struct DIJOYCONFIG
148 {
149     DWORD dwSize;
150     GUID guidInstance;
151     JOYREGHWCONFIG hwc;
152     DWORD dwGain;
153     WCHAR wszType[MAX_JOYSTRING];
154     WCHAR wszCallout[MAX_JOYSTRING];
155     GUID guidGameport;
156 } DIJOYCONFIG, *LPDIJOYCONFIG;
157 typedef const DIJOYCONFIG *LPCDIJOYCONFIG;
158 
159 typedef struct DIJOYUSERVALUES
160 {
161     DWORD dwSize;
162     JOYREGUSERVALUES ruv;
163     WCHAR wszGlobalDriver[MAX_JOYSTRING];
164     WCHAR wszGameportEmulator[MAX_JOYSTRING];
165 } DIJOYUSERVALUES, *LPDIJOYUSERVALUES;
166 typedef const DIJOYUSERVALUES *LPCDIJOYUSERVALUES;
167 
168 
169 /*****************************************************************************
170  * IDirectInputJoyConfig8 interface
171  */
172 #define INTERFACE IDirectInputJoyConfig8
DECLARE_INTERFACE_(IDirectInputJoyConfig8,IUnknown)173 DECLARE_INTERFACE_(IDirectInputJoyConfig8, IUnknown)
174 {
175     /*** IUnknown methods ***/
176     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
177     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
178     STDMETHOD_(ULONG,Release)(THIS) PURE;
179     /*** IDirectInputJoyConfig8 methods ***/
180     STDMETHOD(Acquire)(THIS) PURE;
181     STDMETHOD(Unacquire)(THIS) PURE;
182     STDMETHOD(SetCooperativeLevel)(THIS_ HWND, DWORD) PURE;
183     STDMETHOD(SendNotify)(THIS) PURE;
184     STDMETHOD(EnumTypes)(THIS_ LPDIJOYTYPECALLBACK, LPVOID) PURE;
185     STDMETHOD(GetTypeInfo)(THIS_ LPCWSTR, LPDIJOYTYPEINFO, DWORD) PURE;
186     STDMETHOD(SetTypeInfo)(THIS_ LPCWSTR, LPCDIJOYTYPEINFO, DWORD, LPWSTR) PURE;
187     STDMETHOD(DeleteType)(THIS_ LPCWSTR) PURE;
188     STDMETHOD(GetConfig)(THIS_ UINT, LPDIJOYCONFIG, DWORD) PURE;
189     STDMETHOD(SetConfig)(THIS_ UINT, LPCDIJOYCONFIG, DWORD) PURE;
190     STDMETHOD(DeleteConfig)(THIS_ UINT) PURE;
191     STDMETHOD(GetUserValues)(THIS_ LPDIJOYUSERVALUES, DWORD) PURE;
192     STDMETHOD(SetUserValues)(THIS_ LPCDIJOYUSERVALUES, DWORD) PURE;
193     STDMETHOD(AddNewHardware)(THIS_ HWND, REFGUID) PURE;
194     STDMETHOD(OpenTypeKey)(THIS_ LPCWSTR, DWORD, PHKEY) PURE;
195     STDMETHOD(OpenAppStatusKey)(THIS_ PHKEY) PURE;
196 };
197 #undef INTERFACE
198 
199 #if !defined(__cplusplus) || defined(CINTERFACE)
200 /*** IUnknown methods ***/
201 #define IDirectInputJoyConfig8_QueryInterface(p,a,b)      (p)->lpVtbl->QueryInterface(p,a,b)
202 #define IDirectInputJoyConfig8_AddRef(p)                  (p)->lpVtbl->AddRef(p)
203 #define IDirectInputJoyConfig8_Release(p)                 (p)->lpVtbl->Release(p)
204 /*** IDirectInputJoyConfig8 methods ***/
205 #define IDirectInputJoyConfig8_Acquire(p)                 (p)->lpVtbl->Acquire(p)
206 #define IDirectInputJoyConfig8_Unacquire(p)               (p)->lpVtbl->Unacquire(p)
207 #define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
208 #define IDirectInputJoyConfig8_SendNotify(p)              (p)->lpVtbl->SendNotify(p)
209 #define IDirectInputJoyConfig8_EnumTypes(p,a,b)           (p)->lpVtbl->EnumTypes(p,a,b)
210 #define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c)       (p)->lpVtbl->GetTypeInfo(p,a,b,c)
211 #define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d)     (p)->lpVtbl->SetTypeInfo(p,a,b,c,d)
212 #define IDirectInputJoyConfig8_DeleteType(p,a)            (p)->lpVtbl->DeleteType(p,a)
213 #define IDirectInputJoyConfig8_GetConfig(p,a,b,c)         (p)->lpVtbl->GetConfig(p,a,b,c)
214 #define IDirectInputJoyConfig8_SetConfig(p,a,b,c)         (p)->lpVtbl->SetConfig(p,a,b,c)
215 #define IDirectInputJoyConfig8_DeleteConfig(p,a)          (p)->lpVtbl->DeleteConfig(p,a)
216 #define IDirectInputJoyConfig8_GetUserValues(p,a,b)       (p)->lpVtbl->GetUserValues(p,a,b)
217 #define IDirectInputJoyConfig8_SetUserValues(p,a,b)       (p)->lpVtbl->SetUserValues(p,a,b)
218 #define IDirectInputJoyConfig8_AddNewHardware(p,a,b)      (p)->lpVtbl->AddNewHardware(p,a,b)
219 #define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c)       (p)->lpVtbl->OpenTypeKey(p,a,b,c)
220 #define IDirectInputJoyConfig8_OpenAppStatusKey(p,a)      (p)->lpVtbl->OpenAppStatusKey(p,a)
221 #else
222 /*** IUnknown methods ***/
223 #define IDirectInputJoyConfig8_QueryInterface(p,a,b)      (p)->QueryInterface(a,b)
224 #define IDirectInputJoyConfig8_AddRef(p)                  (p)->AddRef()
225 #define IDirectInputJoyConfig8_Release(p)                 (p)->Release()
226 /*** IDirectInputJoyConfig8 methods ***/
227 #define IDirectInputJoyConfig8_Acquire(p)                 (p)->Acquire()
228 #define IDirectInputJoyConfig8_Unacquire(p)               (p)->Unacquire()
229 #define IDirectInputJoyConfig8_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
230 #define IDirectInputJoyConfig8_SendNotify(p)              (p)->SendNotify()
231 #define IDirectInputJoyConfig8_EnumTypes(p,a,b)           (p)->EnumTypes(a,b)
232 #define IDirectInputJoyConfig8_GetTypeInfo(p,a,b,c)       (p)->GetTypeInfo(a,b,c)
233 #define IDirectInputJoyConfig8_SetTypeInfo(p,a,b,c,d)     (p)->SetTypeInfo(a,b,c,d)
234 #define IDirectInputJoyConfig8_DeleteType(p,a)            (p)->DeleteType(a)
235 #define IDirectInputJoyConfig8_GetConfig(p,a,b,c)         (p)->GetConfig(a,b,c)
236 #define IDirectInputJoyConfig8_SetConfig(p,a,b,c)         (p)->SetConfig(a,b,c)
237 #define IDirectInputJoyConfig8_DeleteConfig(p,a)          (p)->DeleteConfig(a)
238 #define IDirectInputJoyConfig8_GetUserValues(p,a,b)       (p)->GetUserValues(a,b)
239 #define IDirectInputJoyConfig8_SetUserValues(p,a,b)       (p)->SetUserValues(a,b)
240 #define IDirectInputJoyConfig8_AddNewHardware(p,a,b)      (p)->AddNewHardware(a,b)
241 #define IDirectInputJoyConfig8_OpenTypeKey(p,a,b,c)       (p)->OpenTypeKey(a,b,c)
242 #define IDirectInputJoyConfig8_OpenAppStatusKey(p,a)      (p)->OpenAppStatusKey(a)
243 #endif
244 
245 #endif /* __DINPUTD_INCLUDED__ */
246