blob: ff59a8daf05161b288c1e3c6cf2197f59b1bd81a [file] [log] [blame]
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00001/*
2 * Copyright 2000 Lionel Ulmer
Ove Kaavend2d08f02002-06-14 00:39:44 +00003 * Copyright 2000-2001 TransGaming Technologies Inc.
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00004 *
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 Ulmer6301e942000-11-05 20:25:02 +000020#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 */
27typedef struct IDirectInputDevice2AImpl IDirectInputDevice2AImpl;
28struct IDirectInputDevice2AImpl
29{
30 ICOM_VFIELD(IDirectInputDevice2A);
31 DWORD ref;
32 GUID guid;
33};
34
35/* Routines to do DataFormat / WineFormat conversions */
36typedef struct {
37 int size;
38 int offset_in;
39 int offset_out;
40 int value;
41} DataTransform;
42
43typedef struct {
44 int size;
45 int internal_format_size;
46 DataTransform *dt;
47} DataFormat;
48extern void fill_DataFormat(void *out, void *in, DataFormat *df) ;
49extern 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 Julliarde81843b2001-01-28 23:14:25 +000056 DWORD nq; \
57 TRACE(" queueing %d at offset %d (queue head %d / size %d)\n", \
Lionel Ulmer6301e942000-11-05 20:25:02 +000058 (int) (data), (int) (offset), \
Alexandre Julliarde81843b2001-01-28 23:14:25 +000059 (int) (This->queue_head), (int) (This->queue_len)); \
Lionel Ulmer6301e942000-11-05 20:25:02 +000060 \
Alexandre Julliarde81843b2001-01-28 23:14:25 +000061 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 Ulmer6301e942000-11-05 20:25:02 +000069 } \
70 } \
71}
72
73
74/* Various debug tools */
75extern void _dump_cooperativelevel_DI(DWORD dwFlags) ;
76extern void _dump_EnumObjects_flags(DWORD dwFlags) ;
77extern void _dump_DIPROPHEADER(DIPROPHEADER *diph) ;
78extern void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA *ddoi) ;
79
80/* And the stubs */
81extern HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
Ove Kaavend2d08f02002-06-14 00:39:44 +000082 LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) ;
Lionel Ulmer6301e942000-11-05 20:25:02 +000083extern HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
Ove Kaavend2d08f02002-06-14 00:39:44 +000084 LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) ;
Lionel Ulmer6301e942000-11-05 20:25:02 +000085extern HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
Ove Kaavend2d08f02002-06-14 00:39:44 +000086 LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) ;
87extern ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) ;
Lionel Ulmer6301e942000-11-05 20:25:02 +000088extern HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(
Ove Kaavend2d08f02002-06-14 00:39:44 +000089 LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj ) ;
Lionel Ulmer6301e942000-11-05 20:25:02 +000090extern ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
Ove Kaavend2d08f02002-06-14 00:39:44 +000091 LPDIRECTINPUTDEVICE8A iface) ;
Lionel Ulmer6301e942000-11-05 20:25:02 +000092extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
Ove Kaavend2d08f02002-06-14 00:39:44 +000093 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +000094 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
95 LPVOID lpvRef,
96 DWORD dwFlags) ;
97extern HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
Ove Kaavend2d08f02002-06-14 00:39:44 +000098 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +000099 REFGUID rguid,
100 LPDIPROPHEADER pdiph) ;
101extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000102 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000103 LPDIDEVICEOBJECTINSTANCEA pdidoi,
104 DWORD dwObj,
105 DWORD dwHow) ;
106extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000107 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000108 LPDIDEVICEINSTANCEA pdidi) ;
109extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000110 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000111 HWND hwndOwner,
112 DWORD dwFlags) ;
113extern HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000114 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000115 HINSTANCE hinst,
116 DWORD dwVersion,
117 REFGUID rguid) ;
118extern HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000119 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000120 REFGUID rguid,
121 LPCDIEFFECT lpeff,
122 LPDIRECTINPUTEFFECT *ppdef,
123 LPUNKNOWN pUnkOuter) ;
124extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000125 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000126 LPDIENUMEFFECTSCALLBACKA lpCallback,
127 LPVOID lpvRef,
128 DWORD dwFlags) ;
129extern HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000130 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000131 LPDIEFFECTINFOA lpdei,
132 REFGUID rguid) ;
133extern HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000134 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000135 LPDWORD pdwOut) ;
136extern HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000137 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000138 DWORD dwFlags) ;
139extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000140 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000141 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
142 LPVOID lpvRef,
143 DWORD dwFlags) ;
144extern HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000145 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000146 LPDIEFFESCAPE lpDIEEsc) ;
147extern HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000148 LPDIRECTINPUTDEVICE8A iface) ;
Lionel Ulmer6301e942000-11-05 20:25:02 +0000149extern HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
Ove Kaavend2d08f02002-06-14 00:39:44 +0000150 LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000151 DWORD cbObjectData,
Ove Kaavend2d08f02002-06-14 00:39:44 +0000152 LPCDIDEVICEOBJECTDATA rgdod,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000153 LPDWORD pdwInOut,
154 DWORD dwFlags) ;
Ove Kaavend2d08f02002-06-14 00:39:44 +0000155extern HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000156 LPCSTR lpszFileName,
157 LPDIENUMEFFECTSINFILECALLBACK pec,
158 LPVOID pvRef,
159 DWORD dwFlags) ;
Ove Kaavend2d08f02002-06-14 00:39:44 +0000160extern HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
Lionel Ulmer6301e942000-11-05 20:25:02 +0000161 LPCSTR lpszFileName,
162 DWORD dwEntries,
163 LPDIFILEEFFECT rgDiFileEft,
164 DWORD dwFlags) ;
Ove Kaavend2d08f02002-06-14 00:39:44 +0000165extern HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
166 LPDIACTIONFORMATA lpdiaf,
167 LPCSTR lpszUserName,
168 DWORD dwFlags);
169extern HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
170 LPDIACTIONFORMATA lpdiaf,
171 LPCSTR lpszUserName,
172 DWORD dwFlags);
173extern HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface,
174 LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader);
Lionel Ulmer6301e942000-11-05 20:25:02 +0000175
176#endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */