source: trunk/src/dinput/device_private.h@ 22015

Last change on this file since 22015 was 9016, checked in by sandervl, 23 years ago

Wine resync; added missing bugfix

File size: 6.6 KB
Line 
1/*
2 * Copyright 2000 Lionel Ulmer
3 * Copyright 2000-2001 TransGaming Technologies Inc.
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
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 */
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) { \
56 DWORD nq; \
57 TRACE(" queueing %d at offset %d (queue head %d / size %d)\n", \
58 (int) (data), (int) (offset), \
59 (int) (This->queue_head), (int) (This->queue_len)); \
60 \
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; \
69 } \
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(
82 LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) ;
83extern HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
84 LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) ;
85extern HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
86 LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) ;
87extern ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) ;
88extern HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(
89 LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj ) ;
90extern ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
91 LPDIRECTINPUTDEVICE8A iface) ;
92extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
93 LPDIRECTINPUTDEVICE8A iface,
94 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
95 LPVOID lpvRef,
96 DWORD dwFlags) ;
97extern HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
98 LPDIRECTINPUTDEVICE8A iface,
99 REFGUID rguid,
100 LPDIPROPHEADER pdiph) ;
101extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
102 LPDIRECTINPUTDEVICE8A iface,
103 LPDIDEVICEOBJECTINSTANCEA pdidoi,
104 DWORD dwObj,
105 DWORD dwHow) ;
106extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
107 LPDIRECTINPUTDEVICE8A iface,
108 LPDIDEVICEINSTANCEA pdidi) ;
109extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
110 LPDIRECTINPUTDEVICE8A iface,
111 HWND hwndOwner,
112 DWORD dwFlags) ;
113extern HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
114 LPDIRECTINPUTDEVICE8A iface,
115 HINSTANCE hinst,
116 DWORD dwVersion,
117 REFGUID rguid) ;
118extern HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
119 LPDIRECTINPUTDEVICE8A iface,
120 REFGUID rguid,
121 LPCDIEFFECT lpeff,
122 LPDIRECTINPUTEFFECT *ppdef,
123 LPUNKNOWN pUnkOuter) ;
124extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
125 LPDIRECTINPUTDEVICE8A iface,
126 LPDIENUMEFFECTSCALLBACKA lpCallback,
127 LPVOID lpvRef,
128 DWORD dwFlags) ;
129extern HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
130 LPDIRECTINPUTDEVICE8A iface,
131 LPDIEFFECTINFOA lpdei,
132 REFGUID rguid) ;
133extern HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
134 LPDIRECTINPUTDEVICE8A iface,
135 LPDWORD pdwOut) ;
136extern HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
137 LPDIRECTINPUTDEVICE8A iface,
138 DWORD dwFlags) ;
139extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
140 LPDIRECTINPUTDEVICE8A iface,
141 LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
142 LPVOID lpvRef,
143 DWORD dwFlags) ;
144extern HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
145 LPDIRECTINPUTDEVICE8A iface,
146 LPDIEFFESCAPE lpDIEEsc) ;
147extern HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
148 LPDIRECTINPUTDEVICE8A iface) ;
149extern HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
150 LPDIRECTINPUTDEVICE8A iface,
151 DWORD cbObjectData,
152 LPCDIDEVICEOBJECTDATA rgdod,
153 LPDWORD pdwInOut,
154 DWORD dwFlags) ;
155extern HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
156 LPCSTR lpszFileName,
157 LPDIENUMEFFECTSINFILECALLBACK pec,
158 LPVOID pvRef,
159 DWORD dwFlags) ;
160extern HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
161 LPCSTR lpszFileName,
162 DWORD dwEntries,
163 LPDIFILEEFFECT rgDiFileEft,
164 DWORD dwFlags) ;
165extern 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);
175
176#ifdef __WIN32OS2__
177#define DECL_GLOBAL_CONSTRUCTOR(a) void a()
178#endif
179
180#endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */
Note: See TracBrowser for help on using the repository browser.