libwine: Set install name to an absolute path for the installed library on Mac OS.
[wine/wine64.git] / dlls / dinput / device_private.h
blob4af99cc6645cd3694a0ee628deace694a122da7c
1 /*
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
23 #include <stdarg.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "dinput.h"
29 typedef struct
31 int size;
32 int offset_in;
33 int offset_out;
34 int value;
35 } DataTransform;
37 typedef struct
39 int size;
40 int internal_format_size;
41 DataTransform *dt;
43 int *offsets; /* object offsets */
44 LPDIDATAFORMAT wine_df; /* wine internal data format */
45 LPDIDATAFORMAT user_df; /* user defined data format */
46 } DataFormat;
48 /* Device implementation */
49 typedef struct IDirectInputDevice2AImpl IDirectInputDevice2AImpl;
50 struct IDirectInputDevice2AImpl
52 const void *lpVtbl;
53 LONG ref;
54 GUID guid;
55 CRITICAL_SECTION crit;
56 HANDLE hEvent;
57 DWORD dwCoopLevel;
58 HWND win;
59 int acquired;
61 LPDIDEVICEOBJECTDATA data_queue; /* buffer for 'GetDeviceData'. */
62 int queue_len; /* size of the queue - set in 'SetProperty' */
63 int queue_head; /* position to write new event into queue */
64 int queue_tail; /* next event to read from queue */
65 BOOL overflow; /* return DI_BUFFEROVERFLOW in 'GetDeviceData' */
67 DataFormat data_format; /* user data format and wine to user format converter */
70 /* Routines to do DataFormat / WineFormat conversions */
71 extern void fill_DataFormat(void *out, const void *in, const DataFormat *df) ;
72 extern HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *format);
73 extern void release_DataFormat(DataFormat *df) ;
74 extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq);
75 /* Helper functions to work with data format */
76 extern int id_to_offset(const DataFormat *df, int id);
77 extern int find_property(const DataFormat *df, LPCDIPROPHEADER ph);
79 /**
80 * Callback Data used by specific callback
81 * for EnumObject on 'W' interfaces
83 typedef struct {
84 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallBack;
85 LPVOID lpvRef;
86 } device_enumobjects_AtoWcb_data;
88 extern BOOL DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
91 /* Various debug tools */
92 extern void _dump_cooperativelevel_DI(DWORD dwFlags) ;
93 extern void _dump_EnumObjects_flags(DWORD dwFlags) ;
94 extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) ;
95 extern void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA *ddoi) ;
96 extern void _dump_OBJECTINSTANCEW(const DIDEVICEOBJECTINSTANCEW *ddoi) ;
97 extern void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) ;
98 extern const char *_dump_dinput_GUID(const GUID *guid) ;
100 /* And the stubs */
101 extern HRESULT WINAPI IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface);
102 extern HRESULT WINAPI IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface);
103 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
104 LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) ;
105 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
106 LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) ;
107 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
108 LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) ;
109 extern ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) ;
110 extern HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj);
111 extern HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface,REFIID riid,LPVOID *ppobj);
112 extern ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
113 LPDIRECTINPUTDEVICE8A iface) ;
114 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
115 LPDIRECTINPUTDEVICE8A iface,
116 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
117 LPVOID lpvRef,
118 DWORD dwFlags) ;
119 extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(
120 LPDIRECTINPUTDEVICE8W iface,
121 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback,
122 LPVOID lpvRef,
123 DWORD dwFlags) ;
124 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph);
125 extern HRESULT WINAPI IDirectInputDevice2AImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIPROPHEADER pdiph);
126 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
127 LPDIRECTINPUTDEVICE8A iface,
128 LPDIDEVICEOBJECTINSTANCEA pdidoi,
129 DWORD dwObj,
130 DWORD dwHow) ;
131 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface,
132 LPDIDEVICEOBJECTINSTANCEW pdidoi,
133 DWORD dwObj,
134 DWORD dwHow);
135 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceData(LPDIRECTINPUTDEVICE8A iface,
136 DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags);
137 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
138 LPDIRECTINPUTDEVICE8A iface,
139 LPDIDEVICEINSTANCEA pdidi) ;
140 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo(
141 LPDIRECTINPUTDEVICE8W iface,
142 LPDIDEVICEINSTANCEW pdidi) ;
143 extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
144 LPDIRECTINPUTDEVICE8A iface,
145 HWND hwndOwner,
146 DWORD dwFlags) ;
147 extern HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
148 LPDIRECTINPUTDEVICE8A iface,
149 HINSTANCE hinst,
150 DWORD dwVersion,
151 REFGUID rguid) ;
152 extern HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
153 LPDIRECTINPUTDEVICE8A iface,
154 REFGUID rguid,
155 LPCDIEFFECT lpeff,
156 LPDIRECTINPUTEFFECT *ppdef,
157 LPUNKNOWN pUnkOuter) ;
158 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
159 LPDIRECTINPUTDEVICE8A iface,
160 LPDIENUMEFFECTSCALLBACKA lpCallback,
161 LPVOID lpvRef,
162 DWORD dwFlags) ;
163 extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
164 LPDIRECTINPUTDEVICE8W iface,
165 LPDIENUMEFFECTSCALLBACKW lpCallback,
166 LPVOID lpvRef,
167 DWORD dwFlags) ;
168 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
169 LPDIRECTINPUTDEVICE8A iface,
170 LPDIEFFECTINFOA lpdei,
171 REFGUID rguid) ;
172 extern HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(
173 LPDIRECTINPUTDEVICE8W iface,
174 LPDIEFFECTINFOW lpdei,
175 REFGUID rguid) ;
176 extern HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
177 LPDIRECTINPUTDEVICE8A iface,
178 LPDWORD pdwOut) ;
179 extern HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
180 LPDIRECTINPUTDEVICE8A iface,
181 DWORD dwFlags) ;
182 extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
183 LPDIRECTINPUTDEVICE8A iface,
184 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
185 LPVOID lpvRef,
186 DWORD dwFlags) ;
187 extern HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
188 LPDIRECTINPUTDEVICE8A iface,
189 LPDIEFFESCAPE lpDIEEsc) ;
190 extern HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
191 LPDIRECTINPUTDEVICE8A iface) ;
192 extern HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
193 LPDIRECTINPUTDEVICE8A iface,
194 DWORD cbObjectData,
195 LPCDIDEVICEOBJECTDATA rgdod,
196 LPDWORD pdwInOut,
197 DWORD dwFlags) ;
198 extern HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
199 LPCSTR lpszFileName,
200 LPDIENUMEFFECTSINFILECALLBACK pec,
201 LPVOID pvRef,
202 DWORD dwFlags) ;
203 extern HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface,
204 LPCWSTR lpszFileName,
205 LPDIENUMEFFECTSINFILECALLBACK pec,
206 LPVOID pvRef,
207 DWORD dwFlags) ;
208 extern HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
209 LPCSTR lpszFileName,
210 DWORD dwEntries,
211 LPDIFILEEFFECT rgDiFileEft,
212 DWORD dwFlags) ;
213 extern HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface,
214 LPCWSTR lpszFileName,
215 DWORD dwEntries,
216 LPDIFILEEFFECT rgDiFileEft,
217 DWORD dwFlags) ;
218 extern HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
219 LPDIACTIONFORMATA lpdiaf,
220 LPCSTR lpszUserName,
221 DWORD dwFlags);
222 extern HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
223 LPDIACTIONFORMATW lpdiaf,
224 LPCWSTR lpszUserName,
225 DWORD dwFlags);
226 extern HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
227 LPDIACTIONFORMATA lpdiaf,
228 LPCSTR lpszUserName,
229 DWORD dwFlags);
230 extern HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
231 LPDIACTIONFORMATW lpdiaf,
232 LPCWSTR lpszUserName,
233 DWORD dwFlags);
234 extern HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface,
235 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader);
236 extern HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface,
237 LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader);
239 #endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */