1c2c66affSColin Finck /* 2c2c66affSColin Finck * Copyright 2009, Aric Stewart, CodeWeavers 3c2c66affSColin Finck * 4c2c66affSColin Finck * This library is free software; you can redistribute it and/or 5c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public 6c2c66affSColin Finck * License as published by the Free Software Foundation; either 7c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version. 8c2c66affSColin Finck * 9c2c66affSColin Finck * This library is distributed in the hope that it will be useful, 10c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of 11c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12c2c66affSColin Finck * Lesser General Public License for more details. 13c2c66affSColin Finck * 14c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public 15c2c66affSColin Finck * License along with this library; if not, write to the Free Software 16c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17c2c66affSColin Finck */ 18c2c66affSColin Finck 19c2c66affSColin Finck #ifndef __WINE_DLLS_DINPUT_JOYSTICK_PRIVATE_H 20c2c66affSColin Finck #define __WINE_DLLS_DINPUT_JOYSTICK_PRIVATE_H 21c2c66affSColin Finck 227016dd6dSAmine Khaldi #include <stdarg.h> 237016dd6dSAmine Khaldi 247016dd6dSAmine Khaldi #include "windef.h" 257016dd6dSAmine Khaldi #include "winbase.h" 267016dd6dSAmine Khaldi #include "dinput.h" 277016dd6dSAmine Khaldi #include "wine/list.h" 287016dd6dSAmine Khaldi #include "wine/unicode.h" 297016dd6dSAmine Khaldi #include "dinput_private.h" 307016dd6dSAmine Khaldi #include "device_private.h" 317016dd6dSAmine Khaldi 32c2c66affSColin Finck /* Number of objects in the default data format */ 33c2c66affSColin Finck #define MAX_PROPS 164 34c2c66affSColin Finck struct JoystickGenericImpl; 35c2c66affSColin Finck 36*41c8c312SAmine Khaldi /* Number of buttons for which to allow remapping */ 37*41c8c312SAmine Khaldi #define MAX_MAP_BUTTONS 32 38*41c8c312SAmine Khaldi 39c2c66affSColin Finck typedef void joy_polldev_handler(LPDIRECTINPUTDEVICE8A iface); 40c2c66affSColin Finck 41c2c66affSColin Finck typedef struct JoystickGenericImpl 42c2c66affSColin Finck { 43c2c66affSColin Finck struct IDirectInputDeviceImpl base; 44c2c66affSColin Finck 45c2c66affSColin Finck ObjProps props[MAX_PROPS]; 46c2c66affSColin Finck DIDEVCAPS devcaps; 47c2c66affSColin Finck DIJOYSTATE2 js; /* wine data */ 48c2c66affSColin Finck GUID guidProduct; 49c2c66affSColin Finck GUID guidInstance; 50c2c66affSColin Finck char *name; 51c2c66affSColin Finck int device_axis_count; /* Total number of axes in the device */ 52c2c66affSColin Finck int *axis_map; /* User axes remapping */ 53*41c8c312SAmine Khaldi int button_map[MAX_MAP_BUTTONS]; /* User button remapping */ 54c2c66affSColin Finck LONG deadzone; /* Default dead-zone */ 55c2c66affSColin Finck 56c2c66affSColin Finck joy_polldev_handler *joy_polldev; 57c2c66affSColin Finck } JoystickGenericImpl; 58c2c66affSColin Finck 59c2c66affSColin Finck LONG joystick_map_axis(ObjProps *props, int val) DECLSPEC_HIDDEN; 60c2c66affSColin Finck HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_map) DECLSPEC_HIDDEN; 61c2c66affSColin Finck 62c2c66affSColin Finck DWORD joystick_map_pov(const POINTL *p) DECLSPEC_HIDDEN; 63c2c66affSColin Finck 64c2c66affSColin Finck BOOL device_disabled_registry(const char* name) DECLSPEC_HIDDEN; 65c2c66affSColin Finck 66c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, 67c2c66affSColin Finck LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow) DECLSPEC_HIDDEN; 68c2c66affSColin Finck 69c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8A iface, 70c2c66affSColin Finck LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow) DECLSPEC_HIDDEN; 71c2c66affSColin Finck 72c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph) DECLSPEC_HIDDEN; 73c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPDIPROPHEADER pdiph) DECLSPEC_HIDDEN; 74c2c66affSColin Finck 75c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_GetCapabilities(LPDIRECTINPUTDEVICE8A iface, LPDIDEVCAPS lpDIDevCaps) DECLSPEC_HIDDEN; 76c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_GetCapabilities(LPDIRECTINPUTDEVICE8W iface, LPDIDEVCAPS lpDIDevCaps) DECLSPEC_HIDDEN; 77c2c66affSColin Finck 78c2c66affSColin Finck void _dump_DIDEVCAPS(const DIDEVCAPS *lpDIDevCaps) DECLSPEC_HIDDEN; 79c2c66affSColin Finck 80c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIPROPHEADER ph) DECLSPEC_HIDDEN; 81c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_SetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIPROPHEADER ph) DECLSPEC_HIDDEN; 82c2c66affSColin Finck 83c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8A iface, 84c2c66affSColin Finck LPDIDEVICEINSTANCEA pdidi) DECLSPEC_HIDDEN; 85c2c66affSColin Finck 86c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_GetDeviceInfo( LPDIRECTINPUTDEVICE8W iface, 87c2c66affSColin Finck LPDIDEVICEINSTANCEW pdidi) DECLSPEC_HIDDEN; 88c2c66affSColin Finck 89c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_Poll(LPDIRECTINPUTDEVICE8A iface) DECLSPEC_HIDDEN; 90c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_Poll(LPDIRECTINPUTDEVICE8W iface) DECLSPEC_HIDDEN; 91c2c66affSColin Finck 92c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_GetDeviceState(LPDIRECTINPUTDEVICE8A iface, DWORD len, LPVOID ptr) DECLSPEC_HIDDEN; 93c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface, DWORD len, LPVOID ptr) DECLSPEC_HIDDEN; 94c2c66affSColin Finck 95c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface, LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN; 96c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN; 97c2c66affSColin Finck 98c2c66affSColin Finck HRESULT WINAPI JoystickAGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface, LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN; 99c2c66affSColin Finck HRESULT WINAPI JoystickWGenericImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) DECLSPEC_HIDDEN; 100c2c66affSColin Finck 101c2c66affSColin Finck DWORD typeFromGUID(REFGUID guid) DECLSPEC_HIDDEN; 102c2c66affSColin Finck void dump_DIEFFECT(LPCDIEFFECT eff, REFGUID guid, DWORD dwFlags) DECLSPEC_HIDDEN; 103*41c8c312SAmine Khaldi BOOL is_xinput_device(const DIDEVCAPS *devcaps, WORD vid, WORD pid) DECLSPEC_HIDDEN; 104c2c66affSColin Finck 105c2c66affSColin Finck #endif /* __WINE_DLLS_DINPUT_JOYSTICK_PRIVATE_H */ 106