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 ICOM_VFIELD(IDirectInputDevice2A
);
38 /* Routines to do DataFormat / WineFormat conversions */
48 int internal_format_size
;
51 extern void fill_DataFormat(void *out
, void *in
, DataFormat
*df
) ;
52 extern DataFormat
*create_DataFormat(DIDATAFORMAT
*wine_format
, LPCDIDATAFORMAT asked_format
, int *offset
) ;
54 /* Used to fill events in the queue */
55 #define GEN_EVENT(offset,data,xtime,seq) \
57 /* If queue_len > 0, queuing is requested -> TRACE the event queued */ \
58 if (This->queue_len > 0) { \
60 TRACE(" queueing %d at offset %d (queue head %d / size %d)\n", \
61 (int) (data), (int) (offset), \
62 (int) (This->queue_head), (int) (This->queue_len)); \
64 nq = This->queue_head+1; \
65 while (nq >= This->queue_len) nq -= 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; \
77 * Callback Data used by specific callback
78 * for EnumObject on 'W' interfaces
81 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallBack
;
83 } device_enumobjects_AtoWcb_data
;
85 extern BOOL
DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA
, LPVOID
);
88 /* Various debug tools */
89 extern void _dump_cooperativelevel_DI(DWORD dwFlags
) ;
90 extern void _dump_EnumObjects_flags(DWORD dwFlags
) ;
91 extern void _dump_DIPROPHEADER(DIPROPHEADER
*diph
) ;
92 extern void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA
*ddoi
) ;
93 extern void _dump_OBJECTINSTANCEW(DIDEVICEOBJECTINSTANCEW
*ddoi
) ;
96 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetDataFormat(
97 LPDIRECTINPUTDEVICE8A iface
,LPCDIDATAFORMAT df
) ;
98 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetCooperativeLevel(
99 LPDIRECTINPUTDEVICE8A iface
,HWND hwnd
,DWORD dwflags
) ;
100 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SetEventNotification(
101 LPDIRECTINPUTDEVICE8A iface
,HANDLE hnd
) ;
102 extern ULONG WINAPI
IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface
) ;
103 extern HRESULT WINAPI
IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface
,REFIID riid
,LPVOID
*ppobj
);
104 extern HRESULT WINAPI
IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface
,REFIID riid
,LPVOID
*ppobj
);
105 extern ULONG WINAPI
IDirectInputDevice2AImpl_AddRef(
106 LPDIRECTINPUTDEVICE8A iface
) ;
107 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumObjects(
108 LPDIRECTINPUTDEVICE8A iface
,
109 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback
,
112 extern HRESULT WINAPI
IDirectInputDevice2WImpl_EnumObjects(
113 LPDIRECTINPUTDEVICE8W iface
,
114 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback
,
117 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetProperty(
118 LPDIRECTINPUTDEVICE8A iface
,
120 LPDIPROPHEADER pdiph
) ;
121 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetObjectInfo(
122 LPDIRECTINPUTDEVICE8A iface
,
123 LPDIDEVICEOBJECTINSTANCEA pdidoi
,
126 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface
,
127 LPDIDEVICEOBJECTINSTANCEW pdidoi
,
130 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetDeviceInfo(
131 LPDIRECTINPUTDEVICE8A iface
,
132 LPDIDEVICEINSTANCEA pdidi
) ;
133 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetDeviceInfo(
134 LPDIRECTINPUTDEVICE8W iface
,
135 LPDIDEVICEINSTANCEW pdidi
) ;
136 extern HRESULT WINAPI
IDirectInputDevice2AImpl_RunControlPanel(
137 LPDIRECTINPUTDEVICE8A iface
,
140 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Initialize(
141 LPDIRECTINPUTDEVICE8A iface
,
145 extern HRESULT WINAPI
IDirectInputDevice2AImpl_CreateEffect(
146 LPDIRECTINPUTDEVICE8A iface
,
149 LPDIRECTINPUTEFFECT
*ppdef
,
150 LPUNKNOWN pUnkOuter
) ;
151 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumEffects(
152 LPDIRECTINPUTDEVICE8A iface
,
153 LPDIENUMEFFECTSCALLBACKA lpCallback
,
156 extern HRESULT WINAPI
IDirectInputDevice2WImpl_EnumEffects(
157 LPDIRECTINPUTDEVICE8W iface
,
158 LPDIENUMEFFECTSCALLBACKW lpCallback
,
161 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetEffectInfo(
162 LPDIRECTINPUTDEVICE8A iface
,
163 LPDIEFFECTINFOA lpdei
,
165 extern HRESULT WINAPI
IDirectInputDevice2WImpl_GetEffectInfo(
166 LPDIRECTINPUTDEVICE8W iface
,
167 LPDIEFFECTINFOW lpdei
,
169 extern HRESULT WINAPI
IDirectInputDevice2AImpl_GetForceFeedbackState(
170 LPDIRECTINPUTDEVICE8A iface
,
172 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SendForceFeedbackCommand(
173 LPDIRECTINPUTDEVICE8A iface
,
175 extern HRESULT WINAPI
IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
176 LPDIRECTINPUTDEVICE8A iface
,
177 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback
,
180 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Escape(
181 LPDIRECTINPUTDEVICE8A iface
,
182 LPDIEFFESCAPE lpDIEEsc
) ;
183 extern HRESULT WINAPI
IDirectInputDevice2AImpl_Poll(
184 LPDIRECTINPUTDEVICE8A iface
) ;
185 extern HRESULT WINAPI
IDirectInputDevice2AImpl_SendDeviceData(
186 LPDIRECTINPUTDEVICE8A iface
,
188 LPCDIDEVICEOBJECTDATA rgdod
,
191 extern HRESULT WINAPI
IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface
,
193 LPDIENUMEFFECTSINFILECALLBACK pec
,
196 extern HRESULT WINAPI
IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface
,
197 LPCWSTR lpszFileName
,
198 LPDIENUMEFFECTSINFILECALLBACK pec
,
201 extern HRESULT WINAPI
IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface
,
204 LPDIFILEEFFECT rgDiFileEft
,
206 extern HRESULT WINAPI
IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface
,
207 LPCWSTR lpszFileName
,
209 LPDIFILEEFFECT rgDiFileEft
,
211 extern HRESULT WINAPI
IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface
,
212 LPDIACTIONFORMATA lpdiaf
,
215 extern HRESULT WINAPI
IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface
,
216 LPDIACTIONFORMATW lpdiaf
,
217 LPCWSTR lpszUserName
,
219 extern HRESULT WINAPI
IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface
,
220 LPDIACTIONFORMATA lpdiaf
,
223 extern HRESULT WINAPI
IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface
,
224 LPDIACTIONFORMATW lpdiaf
,
225 LPCWSTR lpszUserName
,
227 extern HRESULT WINAPI
IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface
,
228 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader
);
229 extern HRESULT WINAPI
IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface
,
230 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader
);
232 #endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */