dinput: Move IDirectInput7 WtoA wrappers to ansi.c.
[wine.git] / include / wine / hid.h
blob857dcae18fe0fbb45ee18452c72fe0f7474ff92b
1 /*
2 * Wine internal HID structures
4 * Copyright 2015 Aric Stewart
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __WINE_PARSE_H
22 #define __WINE_PARSE_H
24 #define HID_MAGIC 0x8491759
26 typedef enum __WINE_ELEMENT_TYPE {
27 UnknownElement = 0,
28 ButtonElement,
29 ValueElement,
30 } WINE_ELEMENT_TYPE;
32 typedef struct __WINE_ELEMENT
34 WINE_ELEMENT_TYPE ElementType;
35 UINT valueStartBit;
36 UINT bitCount;
37 union {
38 HIDP_VALUE_CAPS value;
39 HIDP_BUTTON_CAPS button;
40 } caps;
41 } WINE_HID_ELEMENT;
43 typedef struct __WINE_HID_REPORT
45 UCHAR reportID;
46 DWORD bitSize;
47 DWORD elementCount;
48 DWORD elementIdx;
49 } WINE_HID_REPORT;
51 typedef struct __WINE_HID_LINK_COLLECTION_NODE {
52 USAGE LinkUsage;
53 USAGE LinkUsagePage;
54 USHORT Parent;
55 USHORT NumberOfChildren;
56 USHORT NextSibling;
57 USHORT FirstChild;
58 BYTE CollectionType;
59 BYTE IsAlias;
60 } WINE_HID_LINK_COLLECTION_NODE;
62 typedef struct __WINE_HIDP_PREPARSED_DATA
64 DWORD magic;
65 DWORD dwSize;
66 HIDP_CAPS caps;
68 DWORD elementOffset;
69 DWORD nodesOffset;
70 DWORD reportCount[3];
71 BYTE reportIdx[3][256];
73 WINE_HID_REPORT reports[1];
74 } WINE_HIDP_PREPARSED_DATA, *PWINE_HIDP_PREPARSED_DATA;
76 #define HID_INPUT_REPORTS(d) ((d)->reports)
77 #define HID_OUTPUT_REPORTS(d) ((d)->reports + (d)->reportCount[0])
78 #define HID_FEATURE_REPORTS(d) ((d)->reports + (d)->reportCount[0] + (d)->reportCount[1])
79 #define HID_ELEMS(d) ((WINE_HID_ELEMENT*)((BYTE*)(d) + (d)->elementOffset))
80 #define HID_NODES(d) ((WINE_HID_LINK_COLLECTION_NODE*)((BYTE*)(d) + (d)->nodesOffset))
82 #endif /* __WINE_PARSE_H */