blob: 16b4559800d1dfa8b5b48dc6382a6106605be325 [file] [log] [blame]
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00001/*
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
Jonathan Ernst360a3f92006-05-18 14:49:52 +020016 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000017 */
18
Lionel Ulmer6301e942000-11-05 20:25:02 +000019#ifndef __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H
20#define __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H
21
Alexandre Julliarde37c6e12003-09-05 23:08:26 +000022#include <stdarg.h>
23
24#include "windef.h"
Lionel Ulmer6301e942000-11-05 20:25:02 +000025#include "winbase.h"
26#include "dinput.h"
Vitaliy Margolen448dde92007-07-06 23:36:09 -060027#include "wine/list.h"
Lionel Ulmer6301e942000-11-05 20:25:02 +000028
29/* Implementation specification */
Raphael Junqueirac4050192003-06-16 20:22:13 +000030typedef struct IDirectInputImpl IDirectInputImpl;
31struct IDirectInputImpl
Lionel Ulmer6301e942000-11-05 20:25:02 +000032{
Vitaliy Margolenefdee192007-07-11 22:51:32 -060033 const IDirectInput7AVtbl *lpVtbl;
34 const IDirectInput7WVtbl *lpVtbl7w;
35 const IDirectInput8AVtbl *lpVtbl8a;
36 const IDirectInput8WVtbl *lpVtbl8w;
37
Vitaliy Margolen448dde92007-07-06 23:36:09 -060038 LONG ref;
Lionel Ulmer6301e942000-11-05 20:25:02 +000039
Vitaliy Margolen448dde92007-07-06 23:36:09 -060040 CRITICAL_SECTION crit;
Vitaliy Margolenfe1f1362007-07-06 23:36:18 -060041 struct list entry; /* entry into list of all IDirectInputs */
Christian Costa77c00c92003-06-13 18:55:41 +000042
Vitaliy Margolen448dde92007-07-06 23:36:09 -060043 DWORD evsequence; /* unique sequence number for events */
44 DWORD dwVersion; /* direct input version number */
45 struct list devices_list; /* list of all created dinput devices */
Lionel Ulmer6301e942000-11-05 20:25:02 +000046};
47
48/* Function called by all devices that Wine supports */
Alexandre Julliard6451e222005-03-15 19:36:15 +000049struct dinput_device {
Lionel Ulmer4f640692004-06-04 18:06:37 +000050 const char *name;
Robert Reif6dd763e2005-05-16 08:44:14 +000051 BOOL (*enum_deviceA)(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id);
52 BOOL (*enum_deviceW)(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD version, int id);
Lionel Ulmer4f640692004-06-04 18:06:37 +000053 HRESULT (*create_deviceA)(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev);
54 HRESULT (*create_deviceW)(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev);
Alexandre Julliard6451e222005-03-15 19:36:15 +000055};
Lionel Ulmer6301e942000-11-05 20:25:02 +000056
Alexandre Julliard6451e222005-03-15 19:36:15 +000057extern const struct dinput_device mouse_device;
58extern const struct dinput_device keyboard_device;
59extern const struct dinput_device joystick_linux_device;
60extern const struct dinput_device joystick_linuxinput_device;
Aric Stewart225a4942009-03-10 14:59:20 -050061extern const struct dinput_device joystick_osx_device;
Lionel Ulmer6301e942000-11-05 20:25:02 +000062
Vitaliy Margolen8f28d432007-07-06 23:36:39 -060063extern void check_dinput_hooks(LPDIRECTINPUTDEVICE8A);
Vitaliy Margolen74f2ecc2009-02-21 12:54:37 -070064typedef int (*DI_EVENT_PROC)(LPDIRECTINPUTDEVICE8A, WPARAM, LPARAM);
Vitaliy Margolen722a6862006-09-10 16:47:39 -060065
Marcus Meissner9ce27fc2008-02-15 14:50:15 +010066extern void _dump_diactionformatA(LPDIACTIONFORMATA);
67
Michael Stefaniuc2004db12010-02-02 00:11:49 +010068#define IS_DIPROP(x) (((ULONG_PTR)(x) >> 16) == 0)
69
Lionel Ulmer6301e942000-11-05 20:25:02 +000070#endif /* __WINE_DLLS_DINPUT_DINPUT_PRIVATE_H */