Sync with trunk r63831.
[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 <wine/config.h>
23
24 #include <stdarg.h>
25
26 #define WIN32_NO_STATUS
27 #define _INC_WINDOWS
28 #define COM_NO_WINDOWS_H
29
30 #define COBJMACROS
31 #define NONAMELESSUNION
32
33 #include <windef.h>
34 #include <winbase.h>
35 #include <winreg.h>
36 #include <winuser.h>
37 #include <dinput.h>
38 #include <dinputd.h>
39
40 #include <wine/debug.h>
41 #include <wine/list.h>
42 #include <wine/unicode.h>
43
44 WINE_DEFAULT_DEBUG_CHANNEL(dinput);
45
46 /* Implementation specification */
47 typedef struct IDirectInputImpl IDirectInputImpl;
48 struct IDirectInputImpl
49 {
50 IDirectInput7A IDirectInput7A_iface;
51 IDirectInput7W IDirectInput7W_iface;
52 IDirectInput8A IDirectInput8A_iface;
53 IDirectInput8W IDirectInput8W_iface;
54 IDirectInputJoyConfig8 IDirectInputJoyConfig8_iface;
55
56 LONG ref;
57
58 BOOL initialized;
59 CRITICAL_SECTION crit;
60 struct list entry; /* entry into list of all IDirectInputs */
61
62 DWORD evsequence; /* unique sequence number for events */
63 DWORD dwVersion; /* direct input version number */
64 struct list devices_list; /* list of all created dinput devices */
65 };
66
67 /* Function called by all devices that Wine supports */
68 struct dinput_device {
69 const char *name;
70 HRESULT (*enum_deviceA)(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id);
71 HRESULT (*enum_deviceW)(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD version, int id);
72 HRESULT (*create_device)(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPVOID *pdev, int unicode);
73 };
74
75 extern const struct dinput_device mouse_device DECLSPEC_HIDDEN;
76 extern const struct dinput_device keyboard_device DECLSPEC_HIDDEN;
77 extern const struct dinput_device joystick_linux_device DECLSPEC_HIDDEN;
78 extern const struct dinput_device joystick_linuxinput_device DECLSPEC_HIDDEN;
79 extern const struct dinput_device joystick_osx_device DECLSPEC_HIDDEN;
80
81 extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8W) DECLSPEC_HIDDEN;
82 typedef int (*DI_EVENT_PROC)(LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM);
83
84 extern void _copy_diactionformatAtoW(LPDIACTIONFORMATW, LPDIACTIONFORMATA) DECLSPEC_HIDDEN;
85 extern void _copy_diactionformatWtoA(LPDIACTIONFORMATA, LPDIACTIONFORMATW) DECLSPEC_HIDDEN;
86
87 extern HRESULT _configure_devices(IDirectInput8W *iface, LPDICONFIGUREDEVICESCALLBACK lpdiCallback, LPDICONFIGUREDEVICESPARAMSW lpdiCDParams, DWORD dwFlags, LPVOID pvRefData) DECLSPEC_HIDDEN;
88
89 extern WCHAR* get_mapping_path(const WCHAR *device, const WCHAR *username) DECLSPEC_HIDDEN;
90
91 #define IS_DIPROP(x) (((ULONG_PTR)(x) >> 16) == 0)
92
93 #define DIKEYBOARD_MASK 0x81000000
94 #define DIMOUSE_MASK 0x82000000
95 #define DIGENRE_ANY 0xFF000000
96
97 #include "device_private.h"
98
99 #endif /* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */