[DINPUT] Sync with Wine Staging 3.3. CORE-14434
[reactos.git] / dll / directx / wine / dinput / dinput_private.h
1 /*
2 * Copyright 2000 Lionel Ulmer
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #ifndef __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H
20 #define __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "dinput.h"
27 #include "dinputd.h"
28 #include "wine/list.h"
29
30 /* Implementation specification */
31 typedef struct IDirectInputImpl IDirectInputImpl;
32 struct IDirectInputImpl
33 {
34 IDirectInput7A IDirectInput7A_iface;
35 IDirectInput7W IDirectInput7W_iface;
36 IDirectInput8A IDirectInput8A_iface;
37 IDirectInput8W IDirectInput8W_iface;
38 IDirectInputJoyConfig8 IDirectInputJoyConfig8_iface;
39
40 LONG ref;
41
42 BOOL initialized;
43 CRITICAL_SECTION crit;
44 struct list entry; /* entry into list of all IDirectInputs */
45
46 DWORD evsequence; /* unique sequence number for events */
47 DWORD dwVersion; /* direct input version number */
48 struct list devices_list; /* list of all created dinput devices */
49 struct list device_players; /* device instance guid to player name */
50 };
51
52 /* Function called by all devices that Wine supports */
53 struct dinput_device {
54 const char *name;
55 HRESULT (*enum_deviceA)(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id);
56 HRESULT (*enum_deviceW)(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD version, int id);
57 HRESULT (*create_device)(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPVOID *pdev, int unicode);
58 };
59
60 struct DevicePlayer {
61 GUID instance_guid;
62 WCHAR username[MAX_PATH];
63 struct list entry;
64 };
65
66 extern const struct dinput_device mouse_device DECLSPEC_HIDDEN;
67 extern const struct dinput_device keyboard_device DECLSPEC_HIDDEN;
68 extern const struct dinput_device joystick_linux_device DECLSPEC_HIDDEN;
69 extern const struct dinput_device joystick_linuxinput_device DECLSPEC_HIDDEN;
70 extern const struct dinput_device joystick_osx_device DECLSPEC_HIDDEN;
71
72 extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W, BOOL) DECLSPEC_HIDDEN;
73 extern void check_dinput_events(void) DECLSPEC_HIDDEN;
74 typedef int (*DI_EVENT_PROC)(LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM);
75
76 extern void _copy_diactionformatAtoW(LPDIACTIONFORMATW, LPDIACTIONFORMATA) DECLSPEC_HIDDEN;
77 extern void _copy_diactionformatWtoA(LPDIACTIONFORMATA, LPDIACTIONFORMATW) DECLSPEC_HIDDEN;
78
79 extern HRESULT _configure_devices(IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) DECLSPEC_HIDDEN;
80
81 extern WCHAR* get_mapping_path(const WCHAR *device, const WCHAR *username) DECLSPEC_HIDDEN;
82
83 #define IS_DIPROP(x) (((ULONG_PTR)(x) >> 16) == 0)
84
85 #define DIKEYBOARD_MASK 0x81000000
86 #define DIMOUSE_MASK 0x82000000
87 #define DIGENRE_ANY 0xFF000000
88
89 #endif /* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */