2002-03-09 23:29:33 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2000 Lionel Ulmer
|
2002-06-14 00:39:44 +00:00
|
|
|
* Copyright 2000-2001 TransGaming Technologies Inc.
|
2002-03-09 23:29:33 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 12:49:52 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-09 23:29:33 +00:00
|
|
|
*/
|
|
|
|
|
2000-11-05 20:25:02 +00:00
|
|
|
#ifndef __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H
|
|
|
|
#define __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H
|
|
|
|
|
2003-09-05 23:08:26 +00:00
|
|
|
#include <stdarg.h>
|
|
|
|
|
|
|
|
#include "windef.h"
|
2000-11-05 20:25:02 +00:00
|
|
|
#include "winbase.h"
|
|
|
|
#include "dinput.h"
|
|
|
|
|
|
|
|
/* Device implementation */
|
|
|
|
typedef struct IDirectInputDevice2AImpl IDirectInputDevice2AImpl;
|
|
|
|
struct IDirectInputDevice2AImpl
|
|
|
|
{
|
2006-10-15 17:29:30 +00:00
|
|
|
const void *lpVtbl;
|
|
|
|
LONG ref;
|
|
|
|
GUID guid;
|
2006-10-15 17:29:48 +00:00
|
|
|
HANDLE hEvent;
|
2006-10-15 17:30:07 +00:00
|
|
|
DWORD dwCoopLevel;
|
|
|
|
HWND win;
|
2006-12-01 17:54:42 +00:00
|
|
|
int acquired;
|
2000-11-05 20:25:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Routines to do DataFormat / WineFormat conversions */
|
|
|
|
typedef struct {
|
|
|
|
int size;
|
|
|
|
int offset_in;
|
|
|
|
int offset_out;
|
|
|
|
int value;
|
|
|
|
} DataTransform;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int size;
|
|
|
|
int internal_format_size;
|
|
|
|
DataTransform *dt;
|
|
|
|
} DataFormat;
|
2004-09-02 20:09:54 +00:00
|
|
|
extern void fill_DataFormat(void *out, const void *in, DataFormat *df) ;
|
2004-06-02 00:36:54 +00:00
|
|
|
extern DataFormat *create_DataFormat(const DIDATAFORMAT *wine_format, LPCDIDATAFORMAT asked_format, int *offset) ;
|
2004-09-02 20:09:54 +00:00
|
|
|
extern void release_DataFormat(DataFormat *df) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
|
|
|
|
/* Used to fill events in the queue */
|
|
|
|
#define GEN_EVENT(offset,data,xtime,seq) \
|
|
|
|
{ \
|
|
|
|
/* If queue_len > 0, queuing is requested -> TRACE the event queued */ \
|
|
|
|
if (This->queue_len > 0) { \
|
2004-09-08 01:23:57 +00:00
|
|
|
int nq; \
|
2001-01-28 23:14:25 +00:00
|
|
|
TRACE(" queueing %d at offset %d (queue head %d / size %d)\n", \
|
2000-11-05 20:25:02 +00:00
|
|
|
(int) (data), (int) (offset), \
|
2001-01-28 23:14:25 +00:00
|
|
|
(int) (This->queue_head), (int) (This->queue_len)); \
|
2000-11-05 20:25:02 +00:00
|
|
|
\
|
2006-07-22 19:11:33 +00:00
|
|
|
nq = (This->queue_head+1) % This->queue_len; \
|
2001-01-28 23:14:25 +00:00
|
|
|
if ((offset >= 0) && (nq != This->queue_tail)) { \
|
|
|
|
This->data_queue[This->queue_head].dwOfs = offset; \
|
|
|
|
This->data_queue[This->queue_head].dwData = data; \
|
|
|
|
This->data_queue[This->queue_head].dwTimeStamp = xtime; \
|
|
|
|
This->data_queue[This->queue_head].dwSequence = seq; \
|
|
|
|
This->queue_head = nq; \
|
2004-09-13 18:03:30 +00:00
|
|
|
} else \
|
|
|
|
This->overflow = TRUE; \
|
2000-11-05 20:25:02 +00:00
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
2003-06-16 20:22:13 +00:00
|
|
|
/**
|
|
|
|
* Callback Data used by specific callback
|
|
|
|
* for EnumObject on 'W' interfaces
|
|
|
|
*/
|
|
|
|
typedef struct {
|
|
|
|
LPDIENUMDEVICEOBJECTSCALLBACKW lpCallBack;
|
|
|
|
LPVOID lpvRef;
|
|
|
|
} device_enumobjects_AtoWcb_data;
|
|
|
|
|
|
|
|
extern BOOL DIEnumDevicesCallbackAtoW(LPCDIDEVICEOBJECTINSTANCEA, LPVOID);
|
|
|
|
|
2000-11-05 20:25:02 +00:00
|
|
|
|
|
|
|
/* Various debug tools */
|
|
|
|
extern void _dump_cooperativelevel_DI(DWORD dwFlags) ;
|
|
|
|
extern void _dump_EnumObjects_flags(DWORD dwFlags) ;
|
2004-08-31 18:51:23 +00:00
|
|
|
extern void _dump_DIPROPHEADER(LPCDIPROPHEADER diph) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern void _dump_OBJECTINSTANCEA(DIDEVICEOBJECTINSTANCEA *ddoi) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern void _dump_OBJECTINSTANCEW(DIDEVICEOBJECTINSTANCEW *ddoi) ;
|
2004-06-02 00:36:54 +00:00
|
|
|
extern void _dump_DIDATAFORMAT(const DIDATAFORMAT *df) ;
|
|
|
|
extern const char *_dump_dinput_GUID(const GUID *guid) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
|
|
|
|
/* And the stubs */
|
2006-12-01 17:54:42 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_Acquire(LPDIRECTINPUTDEVICE8A iface);
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface);
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,LPCDIDATAFORMAT df ) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,HWND hwnd,DWORD dwflags ) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,HANDLE hnd ) ;
|
|
|
|
extern ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface,REFIID riid,LPVOID *ppobj);
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface,REFIID riid,LPVOID *ppobj);
|
2000-11-05 20:25:02 +00:00
|
|
|
extern ULONG WINAPI IDirectInputDevice2AImpl_AddRef(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
|
|
|
|
LPVOID lpvRef,
|
|
|
|
DWORD dwFlags) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(
|
|
|
|
LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback,
|
|
|
|
LPVOID lpvRef,
|
|
|
|
DWORD dwFlags) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
REFGUID rguid,
|
|
|
|
LPDIPROPHEADER pdiph) ;
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDIDEVICEOBJECTINSTANCEA pdidoi,
|
|
|
|
DWORD dwObj,
|
|
|
|
DWORD dwHow) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPDIDEVICEOBJECTINSTANCEW pdidoi,
|
|
|
|
DWORD dwObj,
|
|
|
|
DWORD dwHow);
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceInfo(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDIDEVICEINSTANCEA pdidi) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceInfo(
|
|
|
|
LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPDIDEVICEINSTANCEW pdidi) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
HWND hwndOwner,
|
|
|
|
DWORD dwFlags) ;
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
HINSTANCE hinst,
|
|
|
|
DWORD dwVersion,
|
|
|
|
REFGUID rguid) ;
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
REFGUID rguid,
|
|
|
|
LPCDIEFFECT lpeff,
|
|
|
|
LPDIRECTINPUTEFFECT *ppdef,
|
|
|
|
LPUNKNOWN pUnkOuter) ;
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDIENUMEFFECTSCALLBACKA lpCallback,
|
|
|
|
LPVOID lpvRef,
|
|
|
|
DWORD dwFlags) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(
|
|
|
|
LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPDIENUMEFFECTSCALLBACKW lpCallback,
|
|
|
|
LPVOID lpvRef,
|
|
|
|
DWORD dwFlags) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDIEFFECTINFOA lpdei,
|
|
|
|
REFGUID rguid) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(
|
|
|
|
LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPDIEFFECTINFOW lpdei,
|
|
|
|
REFGUID rguid) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDWORD pdwOut) ;
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
DWORD dwFlags) ;
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback,
|
|
|
|
LPVOID lpvRef,
|
|
|
|
DWORD dwFlags) ;
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_Escape(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDIEFFESCAPE lpDIEEsc) ;
|
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_Poll(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface) ;
|
2000-11-05 20:25:02 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(
|
2002-06-14 00:39:44 +00:00
|
|
|
LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
DWORD cbObjectData,
|
2002-06-14 00:39:44 +00:00
|
|
|
LPCDIDEVICEOBJECTDATA rgdod,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPDWORD pdwInOut,
|
|
|
|
DWORD dwFlags) ;
|
2002-06-14 00:39:44 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPCSTR lpszFileName,
|
|
|
|
LPDIENUMEFFECTSINFILECALLBACK pec,
|
|
|
|
LPVOID pvRef,
|
|
|
|
DWORD dwFlags) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPCWSTR lpszFileName,
|
|
|
|
LPDIENUMEFFECTSINFILECALLBACK pec,
|
|
|
|
LPVOID pvRef,
|
|
|
|
DWORD dwFlags) ;
|
2002-06-14 00:39:44 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface,
|
2000-11-05 20:25:02 +00:00
|
|
|
LPCSTR lpszFileName,
|
|
|
|
DWORD dwEntries,
|
|
|
|
LPDIFILEEFFECT rgDiFileEft,
|
|
|
|
DWORD dwFlags) ;
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPCWSTR lpszFileName,
|
|
|
|
DWORD dwEntries,
|
|
|
|
LPDIFILEEFFECT rgDiFileEft,
|
|
|
|
DWORD dwFlags) ;
|
2002-06-14 00:39:44 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice8AImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface,
|
|
|
|
LPDIACTIONFORMATA lpdiaf,
|
|
|
|
LPCSTR lpszUserName,
|
|
|
|
DWORD dwFlags);
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice8WImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPDIACTIONFORMATW lpdiaf,
|
|
|
|
LPCWSTR lpszUserName,
|
|
|
|
DWORD dwFlags);
|
2002-06-14 00:39:44 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice8AImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface,
|
|
|
|
LPDIACTIONFORMATA lpdiaf,
|
|
|
|
LPCSTR lpszUserName,
|
|
|
|
DWORD dwFlags);
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice8WImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPDIACTIONFORMATW lpdiaf,
|
|
|
|
LPCWSTR lpszUserName,
|
|
|
|
DWORD dwFlags);
|
2002-06-14 00:39:44 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface,
|
|
|
|
LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader);
|
2003-06-16 20:22:13 +00:00
|
|
|
extern HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface,
|
|
|
|
LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader);
|
2000-11-05 20:25:02 +00:00
|
|
|
|
|
|
|
#endif /* __WINE_DLLS_DINPUT_DINPUTDEVICE_PRIVATE_H */
|