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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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 extern HHOOK set_dinput_hook(int hook_id, LPVOID proc);
57 /* Used to fill events in the queue */
58 #define GEN_EVENT(offset,data,xtime,seq) \
60 /* If queue_len > 0, queuing is requested -> TRACE the event queued */ \
61 if (This->queue_len > 0) { \
63 TRACE(" queueing %d at offset %d (queue head %d / size %d)\n", \
64 (int) (data), (int) (offset), \
65 (int) (This->queue_head), (int) (This->queue_len)); \
67 nq = This->queue_head+1; \
68 while (nq >= This->queue_len) nq -= This->queue_len; \
69 if ((offset >= 0) && (nq != This->queue_tail)) { \
70 This->data_queue[This->queue_head].dwOfs = offset; \
71 This->data_queue[This->queue_head].dwData = data; \
72 This->data_queue[This->queue_head].dwTimeStamp = xtime; \
73 This->data_queue[This->queue_head].dwSequence = seq; \
74 This->queue_head = nq; \
76 This->overflow = TRUE; \
81 * Callback Data used by specific callback
82 * for EnumObject on 'W' interfaces
85 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallBack;
87 } device_enumobjects_AtoWcb_data;
89 extern BOOL DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
92 /* Various debug tools */
93 extern void _dump_cooperativelevel_DI(DWORD dwFlags) ;
94 extern void _dump_EnumObjects_flags(DWORD dwFlags) ;
95 extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) ;
96 extern void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA *ddoi) ;
97 extern void _dump_OBJECTINSTANCEW(DIDEVICEOBJECTINSTANCEW *ddoi) ;
98 extern void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) ;
99 extern const char *_dump_dinput_GUID(const GUID *guid) ;
102 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
103 LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) ;
104 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
105 LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) ;
106 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
107 LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) ;
108 extern ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) ;
109 extern HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj);
110 extern HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface,REFIID riid,LPVOID *ppobj);
111 extern ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
112 LPDIRECTINPUTDEVICE8A iface) ;
113 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
114 LPDIRECTINPUTDEVICE8A iface,
115 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
118 extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(
119 LPDIRECTINPUTDEVICE8W iface,
120 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback,
123 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
124 LPDIRECTINPUTDEVICE8A iface,
126 LPDIPROPHEADER pdiph) ;
127 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
128 LPDIRECTINPUTDEVICE8A iface,
129 LPDIDEVICEOBJECTINSTANCEA pdidoi,
132 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface,
133 LPDIDEVICEOBJECTINSTANCEW pdidoi,
136 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
137 LPDIRECTINPUTDEVICE8A iface,
138 LPDIDEVICEINSTANCEA pdidi) ;
139 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo(
140 LPDIRECTINPUTDEVICE8W iface,
141 LPDIDEVICEINSTANCEW pdidi) ;
142 extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
143 LPDIRECTINPUTDEVICE8A iface,
146 extern HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
147 LPDIRECTINPUTDEVICE8A iface,
151 extern HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
152 LPDIRECTINPUTDEVICE8A iface,
155 LPDIRECTINPUTEFFECT *ppdef,
156 LPUNKNOWN pUnkOuter) ;
157 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
158 LPDIRECTINPUTDEVICE8A iface,
159 LPDIENUMEFFECTSCALLBACKA lpCallback,
162 extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
163 LPDIRECTINPUTDEVICE8W iface,
164 LPDIENUMEFFECTSCALLBACKW lpCallback,
167 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
168 LPDIRECTINPUTDEVICE8A iface,
169 LPDIEFFECTINFOA lpdei,
171 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(
172 LPDIRECTINPUTDEVICE8W iface,
173 LPDIEFFECTINFOW lpdei,
175 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
176 LPDIRECTINPUTDEVICE8A iface,
178 extern HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
179 LPDIRECTINPUTDEVICE8A iface,
181 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
182 LPDIRECTINPUTDEVICE8A iface,
183 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
186 extern HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
187 LPDIRECTINPUTDEVICE8A iface,
188 LPDIEFFESCAPE lpDIEEsc) ;
189 extern HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
190 LPDIRECTINPUTDEVICE8A iface) ;
191 extern HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
192 LPDIRECTINPUTDEVICE8A iface,
194 LPCDIDEVICEOBJECTDATA rgdod,
197 extern HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
199 LPDIENUMEFFECTSINFILECALLBACK pec,
202 extern HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface,
203 LPCWSTR lpszFileName,
204 LPDIENUMEFFECTSINFILECALLBACK pec,
207 extern HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
210 LPDIFILEEFFECT rgDiFileEft,
212 extern HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface,
213 LPCWSTR lpszFileName,
215 LPDIFILEEFFECT rgDiFileEft,
217 extern HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
218 LPDIACTIONFORMATA lpdiaf,
221 extern HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
222 LPDIACTIONFORMATW lpdiaf,
223 LPCWSTR lpszUserName,
225 extern HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
226 LPDIACTIONFORMATA lpdiaf,
229 extern HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
230 LPDIACTIONFORMATW lpdiaf,
231 LPCWSTR lpszUserName,
233 extern HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface,
234 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader);
235 extern HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface,
236 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader);
238 #endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */