2 * Copyright 2000 Lionel Ulmer
3 * Copyright 2000-2001 TransGaming Technologies Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H
21 #define __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H
29 /* Device implementation */
30 typedef struct IDirectInputDevice2AImpl IDirectInputDevice2AImpl;
31 struct IDirectInputDevice2AImpl
33 const IDirectInputDevice2AVtbl *lpVtbl;
38 /* Routines to do DataFormat / WineFormat conversions */
48 int internal_format_size;
51 extern void fill_DataFormat(void *out, const void *in, DataFormat *df) ;
52 extern DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_format, int *offset) ;
53 extern void release_DataFormat(DataFormat *df) ;
55 /* Used to fill events in the queue */
56 #define GEN_EVENT(offset,data,xtime,seq) \
58 /* If queue_len > 0, queuing is requested -> TRACE the event queued */ \
59 if (This->queue_len > 0) { \
61 TRACE(" queueing %d at offset %d (queue head %d / size %d)\n", \
62 (int) (data), (int) (offset), \
63 (int) (This->queue_head), (int) (This->queue_len)); \
65 nq = (This->queue_head+1) % This->queue_len; \
66 if ((offset >= 0) && (nq != This->queue_tail)) { \
67 This->data_queue[This->queue_head].dwOfs = offset; \
68 This->data_queue[This->queue_head].dwData = data; \
69 This->data_queue[This->queue_head].dwTimeStamp = xtime; \
70 This->data_queue[This->queue_head].dwSequence = seq; \
71 This->queue_head = nq; \
73 This->overflow = TRUE; \
78 * Callback Data used by specific callback
79 * for EnumObject on 'W' interfaces
82 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallBack;
84 } device_enumobjects_AtoWcb_data;
86 extern BOOL DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
89 /* Various debug tools */
90 extern void _dump_cooperativelevel_DI(DWORD dwFlags) ;
91 extern void _dump_EnumObjects_flags(DWORD dwFlags) ;
92 extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) ;
93 extern void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA *ddoi) ;
94 extern void _dump_OBJECTINSTANCEW(DIDEVICEOBJECTINSTANCEW *ddoi) ;
95 extern void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) ;
96 extern const char *_dump_dinput_GUID(const GUID *guid) ;
99 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
100 LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) ;
101 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
102 LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) ;
103 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
104 LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) ;
105 extern ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) ;
106 extern HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj);
107 extern HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface,REFIID riid,LPVOID *ppobj);
108 extern ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
109 LPDIRECTINPUTDEVICE8A iface) ;
110 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
111 LPDIRECTINPUTDEVICE8A iface,
112 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
115 extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(
116 LPDIRECTINPUTDEVICE8W iface,
117 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback,
120 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
121 LPDIRECTINPUTDEVICE8A iface,
123 LPDIPROPHEADER pdiph) ;
124 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
125 LPDIRECTINPUTDEVICE8A iface,
126 LPDIDEVICEOBJECTINSTANCEA pdidoi,
129 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface,
130 LPDIDEVICEOBJECTINSTANCEW pdidoi,
133 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
134 LPDIRECTINPUTDEVICE8A iface,
135 LPDIDEVICEINSTANCEA pdidi) ;
136 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo(
137 LPDIRECTINPUTDEVICE8W iface,
138 LPDIDEVICEINSTANCEW pdidi) ;
139 extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
140 LPDIRECTINPUTDEVICE8A iface,
143 extern HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
144 LPDIRECTINPUTDEVICE8A iface,
148 extern HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
149 LPDIRECTINPUTDEVICE8A iface,
152 LPDIRECTINPUTEFFECT *ppdef,
153 LPUNKNOWN pUnkOuter) ;
154 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
155 LPDIRECTINPUTDEVICE8A iface,
156 LPDIENUMEFFECTSCALLBACKA lpCallback,
159 extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
160 LPDIRECTINPUTDEVICE8W iface,
161 LPDIENUMEFFECTSCALLBACKW lpCallback,
164 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
165 LPDIRECTINPUTDEVICE8A iface,
166 LPDIEFFECTINFOA lpdei,
168 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(
169 LPDIRECTINPUTDEVICE8W iface,
170 LPDIEFFECTINFOW lpdei,
172 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
173 LPDIRECTINPUTDEVICE8A iface,
175 extern HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
176 LPDIRECTINPUTDEVICE8A iface,
178 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
179 LPDIRECTINPUTDEVICE8A iface,
180 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
183 extern HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
184 LPDIRECTINPUTDEVICE8A iface,
185 LPDIEFFESCAPE lpDIEEsc) ;
186 extern HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
187 LPDIRECTINPUTDEVICE8A iface) ;
188 extern HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
189 LPDIRECTINPUTDEVICE8A iface,
191 LPCDIDEVICEOBJECTDATA rgdod,
194 extern HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
196 LPDIENUMEFFECTSINFILECALLBACK pec,
199 extern HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface,
200 LPCWSTR lpszFileName,
201 LPDIENUMEFFECTSINFILECALLBACK pec,
204 extern HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
207 LPDIFILEEFFECT rgDiFileEft,
209 extern HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface,
210 LPCWSTR lpszFileName,
212 LPDIFILEEFFECT rgDiFileEft,
214 extern HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
215 LPDIACTIONFORMATA lpdiaf,
218 extern HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
219 LPDIACTIONFORMATW lpdiaf,
220 LPCWSTR lpszUserName,
222 extern HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
223 LPDIACTIONFORMATA lpdiaf,
226 extern HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
227 LPDIACTIONFORMATW lpdiaf,
228 LPCWSTR lpszUserName,
230 extern HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface,
231 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader);
232 extern HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface,
233 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader);
235 #endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */