Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2000 Lionel Ulmer |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 3 | * Copyright 2000-2001 TransGaming Technologies Inc. |
Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 4 | * |
| 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. |
| 9 | * |
| 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. |
| 14 | * |
| 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 |
| 18 | */ |
| 19 | |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 20 | #ifndef __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H |
| 21 | #define __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H |
| 22 | |
| 23 | #include "winbase.h" |
| 24 | #include "dinput.h" |
| 25 | |
| 26 | /* Device implementation */ |
| 27 | typedef struct IDirectInputDevice2AImpl IDirectInputDevice2AImpl; |
| 28 | struct IDirectInputDevice2AImpl |
| 29 | { |
| 30 | ICOM_VFIELD(IDirectInputDevice2A); |
| 31 | DWORD ref; |
| 32 | GUID guid; |
| 33 | }; |
| 34 | |
| 35 | /* Routines to do DataFormat / WineFormat conversions */ |
| 36 | typedef struct { |
| 37 | int size; |
| 38 | int offset_in; |
| 39 | int offset_out; |
| 40 | int value; |
| 41 | } DataTransform; |
| 42 | |
| 43 | typedef struct { |
| 44 | int size; |
| 45 | int internal_format_size; |
| 46 | DataTransform *dt; |
| 47 | } DataFormat; |
| 48 | extern void fill_DataFormat(void *out, void *in, DataFormat *df) ; |
| 49 | extern DataFormat *create_DataFormat(DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_format, int *offset) ; |
| 50 | |
| 51 | /* Used to fill events in the queue */ |
| 52 | #define GEN_EVENT(offset,data,xtime,seq) \ |
| 53 | { \ |
| 54 | /* If queue_len > 0, queuing is requested -> TRACE the event queued */ \ |
| 55 | if (This->queue_len > 0) { \ |
Alexandre Julliard | e81843b | 2001-01-28 23:14:25 +0000 | [diff] [blame] | 56 | DWORD nq; \ |
| 57 | TRACE(" queueing %d at offset %d (queue head %d / size %d)\n", \ |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 58 | (int) (data), (int) (offset), \ |
Alexandre Julliard | e81843b | 2001-01-28 23:14:25 +0000 | [diff] [blame] | 59 | (int) (This->queue_head), (int) (This->queue_len)); \ |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 60 | \ |
Alexandre Julliard | e81843b | 2001-01-28 23:14:25 +0000 | [diff] [blame] | 61 | nq = This->queue_head+1; \ |
| 62 | while (nq >= This->queue_len) nq -= This->queue_len; \ |
| 63 | if ((offset >= 0) && (nq != This->queue_tail)) { \ |
| 64 | This->data_queue[This->queue_head].dwOfs = offset; \ |
| 65 | This->data_queue[This->queue_head].dwData = data; \ |
| 66 | This->data_queue[This->queue_head].dwTimeStamp = xtime; \ |
| 67 | This->data_queue[This->queue_head].dwSequence = seq; \ |
| 68 | This->queue_head = nq; \ |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 69 | } \ |
| 70 | } \ |
| 71 | } |
| 72 | |
| 73 | |
| 74 | /* Various debug tools */ |
| 75 | extern void _dump_cooperativelevel_DI(DWORD dwFlags) ; |
| 76 | extern void _dump_EnumObjects_flags(DWORD dwFlags) ; |
| 77 | extern void _dump_DIPROPHEADER(DIPROPHEADER *diph) ; |
| 78 | extern void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA *ddoi) ; |
| 79 | |
| 80 | /* And the stubs */ |
| 81 | extern HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 82 | LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) ; |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 83 | extern HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 84 | LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) ; |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 85 | extern HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 86 | LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) ; |
| 87 | extern ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) ; |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 88 | extern HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 89 | LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj ) ; |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 90 | extern ULONG WINAPI IDirectInputDevice2AImpl_AddRef( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 91 | LPDIRECTINPUTDEVICE8A iface) ; |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 92 | extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 93 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 94 | LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, |
| 95 | LPVOID lpvRef, |
| 96 | DWORD dwFlags) ; |
| 97 | extern HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 98 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 99 | REFGUID rguid, |
| 100 | LPDIPROPHEADER pdiph) ; |
| 101 | extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 102 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 103 | LPDIDEVICEOBJECTINSTANCEA pdidoi, |
| 104 | DWORD dwObj, |
| 105 | DWORD dwHow) ; |
| 106 | extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 107 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 108 | LPDIDEVICEINSTANCEA pdidi) ; |
| 109 | extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 110 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 111 | HWND hwndOwner, |
| 112 | DWORD dwFlags) ; |
| 113 | extern HRESULT WINAPI IDirectInputDevice2AImpl_Initialize( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 114 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 115 | HINSTANCE hinst, |
| 116 | DWORD dwVersion, |
| 117 | REFGUID rguid) ; |
| 118 | extern HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 119 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 120 | REFGUID rguid, |
| 121 | LPCDIEFFECT lpeff, |
| 122 | LPDIRECTINPUTEFFECT *ppdef, |
| 123 | LPUNKNOWN pUnkOuter) ; |
| 124 | extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 125 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 126 | LPDIENUMEFFECTSCALLBACKA lpCallback, |
| 127 | LPVOID lpvRef, |
| 128 | DWORD dwFlags) ; |
| 129 | extern HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 130 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 131 | LPDIEFFECTINFOA lpdei, |
| 132 | REFGUID rguid) ; |
| 133 | extern HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 134 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 135 | LPDWORD pdwOut) ; |
| 136 | extern HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 137 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 138 | DWORD dwFlags) ; |
| 139 | extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 140 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 141 | LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, |
| 142 | LPVOID lpvRef, |
| 143 | DWORD dwFlags) ; |
| 144 | extern HRESULT WINAPI IDirectInputDevice2AImpl_Escape( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 145 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 146 | LPDIEFFESCAPE lpDIEEsc) ; |
| 147 | extern HRESULT WINAPI IDirectInputDevice2AImpl_Poll( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 148 | LPDIRECTINPUTDEVICE8A iface) ; |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 149 | extern HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData( |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 150 | LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 151 | DWORD cbObjectData, |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 152 | LPCDIDEVICEOBJECTDATA rgdod, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 153 | LPDWORD pdwInOut, |
| 154 | DWORD dwFlags) ; |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 155 | extern HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 156 | LPCSTR lpszFileName, |
| 157 | LPDIENUMEFFECTSINFILECALLBACK pec, |
| 158 | LPVOID pvRef, |
| 159 | DWORD dwFlags) ; |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 160 | extern HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface, |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 161 | LPCSTR lpszFileName, |
| 162 | DWORD dwEntries, |
| 163 | LPDIFILEEFFECT rgDiFileEft, |
| 164 | DWORD dwFlags) ; |
Ove Kaaven | d2d08f0 | 2002-06-14 00:39:44 +0000 | [diff] [blame] | 165 | extern HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface, |
| 166 | LPDIACTIONFORMATA lpdiaf, |
| 167 | LPCSTR lpszUserName, |
| 168 | DWORD dwFlags); |
| 169 | extern HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface, |
| 170 | LPDIACTIONFORMATA lpdiaf, |
| 171 | LPCSTR lpszUserName, |
| 172 | DWORD dwFlags); |
| 173 | extern HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface, |
| 174 | LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader); |
Lionel Ulmer | 6301e94 | 2000-11-05 20:25:02 +0000 | [diff] [blame] | 175 | |
| 176 | #endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */ |