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 /* 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; \
66 while (nq >= This->queue_len) nq -= This->queue_len; \
67 if ((offset >= 0) && (nq != This->queue_tail)) { \
68 This->data_queue[This->queue_head].dwOfs = offset; \
69 This->data_queue[This->queue_head].dwData = data; \
70 This->data_queue[This->queue_head].dwTimeStamp = xtime; \
71 This->data_queue[This->queue_head].dwSequence = seq; \
72 This->queue_head = nq; \
74 This->overflow = TRUE; \
79 * Callback Data used by specific callback
80 * for EnumObject on 'W' interfaces
83 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallBack
;
85 } device_enumobjects_AtoWcb_data
;
87 extern BOOL
DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA
, LPVOID
);
90 /* Various debug tools */
91 extern void _dump_cooperativelevel_DI(DWORD dwFlags
) ;
92 extern void _dump_EnumObjects_flags(DWORD dwFlags
) ;
93 extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph
) ;
94 extern void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA
*ddoi
) ;
95 extern void _dump_OBJECTINSTANCEW(DIDEVICEOBJECTINSTANCEW
*ddoi
) ;
96 extern void _dump_DIDATAFORMAT(const DIDATAFORMAT
*df
) ;
97 extern const char *_dump_dinput_GUID(const GUID
*guid
) ;
100 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetDataFormat(
101 LPDIRECTINPUTDEVICE8A iface
,LPCDIDATAFORMAT df
) ;
102 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetCooperativeLevel(
103 LPDIRECTINPUTDEVICE8A iface
,HWND hwnd
,DWORD dwflags
) ;
104 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetEventNotification(
105 LPDIRECTINPUTDEVICE8A iface
,HANDLE hnd
) ;
106 extern ULONG WINAPI
IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface
) ;
107 extern HRESULT WINAPI
IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface
,REFIID riid
,LPVOID
*ppobj
);
108 extern HRESULT WINAPI
IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface
,REFIID riid
,LPVOID
*ppobj
);
109 extern ULONG WINAPI
IDirectInputDevice2AImpl_AddRef(
110 LPDIRECTINPUTDEVICE8A iface
) ;
111 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumObjects(
112 LPDIRECTINPUTDEVICE8A iface
,
113 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback
,
116 extern HRESULT WINAPI
IDirectInputDevice2WImpl_EnumObjects(
117 LPDIRECTINPUTDEVICE8W iface
,
118 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback
,
121 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetProperty(
122 LPDIRECTINPUTDEVICE8A iface
,
124 LPDIPROPHEADER pdiph
) ;
125 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetObjectInfo(
126 LPDIRECTINPUTDEVICE8A iface
,
127 LPDIDEVICEOBJECTINSTANCEA pdidoi
,
130 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface
,
131 LPDIDEVICEOBJECTINSTANCEW pdidoi
,
134 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetDeviceInfo(
135 LPDIRECTINPUTDEVICE8A iface
,
136 LPDIDEVICEINSTANCEA pdidi
) ;
137 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetDeviceInfo(
138 LPDIRECTINPUTDEVICE8W iface
,
139 LPDIDEVICEINSTANCEW pdidi
) ;
140 extern HRESULT WINAPI
IDirectInputDevice2AImpl_RunControlPanel(
141 LPDIRECTINPUTDEVICE8A iface
,
144 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Initialize(
145 LPDIRECTINPUTDEVICE8A iface
,
149 extern HRESULT WINAPI
IDirectInputDevice2AImpl_CreateEffect(
150 LPDIRECTINPUTDEVICE8A iface
,
153 LPDIRECTINPUTEFFECT
*ppdef
,
154 LPUNKNOWN pUnkOuter
) ;
155 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumEffects(
156 LPDIRECTINPUTDEVICE8A iface
,
157 LPDIENUMEFFECTSCALLBACKA lpCallback
,
160 extern HRESULT WINAPI
IDirectInputDevice2WImpl_EnumEffects(
161 LPDIRECTINPUTDEVICE8W iface
,
162 LPDIENUMEFFECTSCALLBACKW lpCallback
,
165 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetEffectInfo(
166 LPDIRECTINPUTDEVICE8A iface
,
167 LPDIEFFECTINFOA lpdei
,
169 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetEffectInfo(
170 LPDIRECTINPUTDEVICE8W iface
,
171 LPDIEFFECTINFOW lpdei
,
173 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetForceFeedbackState(
174 LPDIRECTINPUTDEVICE8A iface
,
176 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SendForceFeedbackCommand(
177 LPDIRECTINPUTDEVICE8A iface
,
179 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
180 LPDIRECTINPUTDEVICE8A iface
,
181 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback
,
184 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Escape(
185 LPDIRECTINPUTDEVICE8A iface
,
186 LPDIEFFESCAPE lpDIEEsc
) ;
187 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Poll(
188 LPDIRECTINPUTDEVICE8A iface
) ;
189 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SendDeviceData(
190 LPDIRECTINPUTDEVICE8A iface
,
192 LPCDIDEVICEOBJECTDATA rgdod
,
195 extern HRESULT WINAPI
IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface
,
197 LPDIENUMEFFECTSINFILECALLBACK pec
,
200 extern HRESULT WINAPI
IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface
,
201 LPCWSTR lpszFileName
,
202 LPDIENUMEFFECTSINFILECALLBACK pec
,
205 extern HRESULT WINAPI
IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface
,
208 LPDIFILEEFFECT rgDiFileEft
,
210 extern HRESULT WINAPI
IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface
,
211 LPCWSTR lpszFileName
,
213 LPDIFILEEFFECT rgDiFileEft
,
215 extern HRESULT WINAPI
IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface
,
216 LPDIACTIONFORMATA lpdiaf
,
219 extern HRESULT WINAPI
IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface
,
220 LPDIACTIONFORMATW lpdiaf
,
221 LPCWSTR lpszUserName
,
223 extern HRESULT WINAPI
IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface
,
224 LPDIACTIONFORMATA lpdiaf
,
227 extern HRESULT WINAPI
IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface
,
228 LPDIACTIONFORMATW lpdiaf
,
229 LPCWSTR lpszUserName
,
231 extern HRESULT WINAPI
IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface
,
232 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader
);
233 extern HRESULT WINAPI
IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface
,
234 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader
);
236 #endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */