include/mscvpdb.h: Use flexible array members for the rest of structures.
[wine.git] / include / wine / hid.h
blob8200ca9beecc6cb904a9688ea7477441efdf3073
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 #include "ntstatus.h"
25 #define WIN32_NO_STATUS
26 #include "windef.h"
27 #include "winbase.h"
28 #include "winternl.h"
29 #include "hidusage.h"
30 #include "ddk/hidpi.h"
32 #define HID_MAGIC 0x8491759
34 struct hid_collection_node
36 USAGE usage;
37 USAGE usage_page;
38 USHORT parent;
39 USHORT number_of_children;
40 USHORT next_sibling;
41 USHORT first_child;
42 ULONG collection_type;
45 struct hid_value_caps
47 USHORT usage_page;
48 UCHAR report_id;
49 UCHAR start_bit;
50 USHORT bit_size;
51 USHORT report_count;
52 USHORT start_byte;
53 USHORT total_bits;
54 ULONG bit_field;
55 USHORT end_byte;
56 USHORT link_collection;
57 USAGE link_usage_page;
58 USAGE link_usage;
59 ULONG flags;
60 ULONG padding[8];
61 USAGE usage_min;
62 USAGE usage_max;
63 USHORT string_min;
64 USHORT string_max;
65 USHORT designator_min;
66 USHORT designator_max;
67 USHORT data_index_min;
68 USHORT data_index_max;
69 USHORT null_value;
70 USHORT unknown;
71 LONG logical_min;
72 LONG logical_max;
73 LONG physical_min;
74 LONG physical_max;
75 LONG units;
76 LONG units_exp;
79 /* named array continues on next caps */
80 #define HID_VALUE_CAPS_ARRAY_HAS_MORE 0x01
81 #define HID_VALUE_CAPS_IS_CONSTANT 0x02
82 #define HID_VALUE_CAPS_IS_BUTTON 0x04
83 #define HID_VALUE_CAPS_IS_ABSOLUTE 0x08
84 #define HID_VALUE_CAPS_IS_RANGE 0x10
85 #define HID_VALUE_CAPS_IS_STRING_RANGE 0x40
86 #define HID_VALUE_CAPS_IS_DESIGNATOR_RANGE 0x80
88 #define HID_VALUE_CAPS_HAS_NULL(x) (((x)->bit_field & 0x40) != 0)
89 #define HID_VALUE_CAPS_IS_ARRAY(c) (((c)->bit_field & 2) == 0)
91 struct hid_preparsed_data
93 char magic[8];
94 USAGE usage;
95 USAGE usage_page;
96 USHORT unknown[2];
97 USHORT input_caps_start;
98 USHORT input_caps_count;
99 USHORT input_caps_end;
100 USHORT input_report_byte_length;
101 USHORT output_caps_start;
102 USHORT output_caps_count;
103 USHORT output_caps_end;
104 USHORT output_report_byte_length;
105 USHORT feature_caps_start;
106 USHORT feature_caps_count;
107 USHORT feature_caps_end;
108 USHORT feature_report_byte_length;
109 USHORT caps_size;
110 USHORT number_link_collection_nodes;
111 struct hid_value_caps value_caps[1];
112 /* struct hid_collection_node nodes[1] */
115 #define HID_INPUT_VALUE_CAPS(d) ((d)->value_caps + (d)->input_caps_start)
116 #define HID_OUTPUT_VALUE_CAPS(d) ((d)->value_caps + (d)->output_caps_start)
117 #define HID_FEATURE_VALUE_CAPS(d) ((d)->value_caps + (d)->feature_caps_start)
118 #define HID_COLLECTION_NODES(d) (struct hid_collection_node *)((char *)(d)->value_caps + (d)->caps_size)
121 /* Wine-specific Digitizer page usages, not declared in hidusage.h */
122 /* From HID Usage Tables */
123 /* https://usb.org/sites/default/files/hut1_22.pdf */
124 #define HID_USAGE_DIGITIZER_WIDTH ((USAGE) 0x48)
125 #define HID_USAGE_DIGITIZER_HEIGHT ((USAGE) 0x49)
126 #define HID_USAGE_DIGITIZER_CONTACT_ID ((USAGE) 0x51)
127 #define HID_USAGE_DIGITIZER_CONTACT_COUNT ((USAGE) 0x54)
128 #define HID_USAGE_DIGITIZER_CONTACT_COUNT_MAX ((USAGE) 0x55)
129 #define HID_USAGE_DIGITIZER_SCAN_TIME ((USAGE) 0x56)
132 /* Wine-specific Physical Interface Device usages */
133 /* From USB Device Class Definition for Physical Interface Devices */
134 /* https://www.usb.org/sites/default/files/documents/pid1_01.pdf */
135 #define PID_USAGE_UNDEFINED ((USAGE) 0x00)
136 #define PID_USAGE_PID ((USAGE) 0x01)
137 #define PID_USAGE_NORMAL ((USAGE) 0x20)
138 #define PID_USAGE_SET_EFFECT_REPORT ((USAGE) 0x21)
139 #define PID_USAGE_EFFECT_BLOCK_INDEX ((USAGE) 0x22)
140 #define PID_USAGE_PARAMETER_BLOCK_OFFSET ((USAGE) 0x23)
141 #define PID_USAGE_ROM_FLAG ((USAGE) 0x24)
142 #define PID_USAGE_EFFECT_TYPE ((USAGE) 0x25)
143 #define PID_USAGE_ET_CONSTANT_FORCE ((USAGE) 0x26)
144 #define PID_USAGE_ET_RAMP ((USAGE) 0x27)
145 #define PID_USAGE_ET_CUSTOM_FORCE_DATA ((USAGE) 0x28)
146 #define PID_USAGE_ET_SQUARE ((USAGE) 0x30)
147 #define PID_USAGE_ET_SINE ((USAGE) 0x31)
148 #define PID_USAGE_ET_TRIANGLE ((USAGE) 0x32)
149 #define PID_USAGE_ET_SAWTOOTH_UP ((USAGE) 0x33)
150 #define PID_USAGE_ET_SAWTOOTH_DOWN ((USAGE) 0x34)
151 #define PID_USAGE_ET_SPRING ((USAGE) 0x40)
152 #define PID_USAGE_ET_DAMPER ((USAGE) 0x41)
153 #define PID_USAGE_ET_INERTIA ((USAGE) 0x42)
154 #define PID_USAGE_ET_FRICTION ((USAGE) 0x43)
155 #define PID_USAGE_DURATION ((USAGE) 0x50)
156 #define PID_USAGE_SAMPLE_PERIOD ((USAGE) 0x51)
157 #define PID_USAGE_GAIN ((USAGE) 0x52)
158 #define PID_USAGE_TRIGGER_BUTTON ((USAGE) 0x53)
159 #define PID_USAGE_TRIGGER_REPEAT_INTERVAL ((USAGE) 0x54)
160 #define PID_USAGE_AXES_ENABLE ((USAGE) 0x55)
161 #define PID_USAGE_DIRECTION_ENABLE ((USAGE) 0x56)
162 #define PID_USAGE_DIRECTION ((USAGE) 0x57)
163 #define PID_USAGE_TYPE_SPECIFIC_BLOCK_OFFSET ((USAGE) 0x58)
164 #define PID_USAGE_BLOCK_TYPE ((USAGE) 0x59)
165 #define PID_USAGE_SET_ENVELOPE_REPORT ((USAGE) 0x5a)
166 #define PID_USAGE_ATTACK_LEVEL ((USAGE) 0x5b)
167 #define PID_USAGE_ATTACK_TIME ((USAGE) 0x5c)
168 #define PID_USAGE_FADE_LEVEL ((USAGE) 0x5d)
169 #define PID_USAGE_FADE_TIME ((USAGE) 0x5e)
170 #define PID_USAGE_SET_CONDITION_REPORT ((USAGE) 0x5f)
171 #define PID_USAGE_CP_OFFSET ((USAGE) 0x60)
172 #define PID_USAGE_POSITIVE_COEFFICIENT ((USAGE) 0x61)
173 #define PID_USAGE_NEGATIVE_COEFFICIENT ((USAGE) 0x62)
174 #define PID_USAGE_POSITIVE_SATURATION ((USAGE) 0x63)
175 #define PID_USAGE_NEGATIVE_SATURATION ((USAGE) 0x64)
176 #define PID_USAGE_DEAD_BAND ((USAGE) 0x65)
177 #define PID_USAGE_DOWNLOAD_FORCE_SAMPLE ((USAGE) 0x66)
178 #define PID_USAGE_ISOCH_CUSTOM_FORCE_ENABLE ((USAGE) 0x67)
179 #define PID_USAGE_CUSTOM_FORCE_DATA_REPORT ((USAGE) 0x68)
180 #define PID_USAGE_CUSTOM_FORCE_DATA ((USAGE) 0x69)
181 #define PID_USAGE_CUSTOM_FORCE_VENDOR_DEFINED_DATA ((USAGE) 0x6a)
182 #define PID_USAGE_SET_CUSTOM_FORCE_REPORT ((USAGE) 0x6b)
183 #define PID_USAGE_CUSTOM_FORCE_DATA_OFFSET ((USAGE) 0x6c)
184 #define PID_USAGE_SAMPLE_COUNT ((USAGE) 0x6d)
185 #define PID_USAGE_SET_PERIODIC_REPORT ((USAGE) 0x6e)
186 #define PID_USAGE_OFFSET ((USAGE) 0x6f)
187 #define PID_USAGE_MAGNITUDE ((USAGE) 0x70)
188 #define PID_USAGE_PHASE ((USAGE) 0x71)
189 #define PID_USAGE_PERIOD ((USAGE) 0x72)
190 #define PID_USAGE_SET_CONSTANT_FORCE_REPORT ((USAGE) 0x73)
191 #define PID_USAGE_SET_RAMP_FORCE_REPORT ((USAGE) 0x74)
192 #define PID_USAGE_RAMP_START ((USAGE) 0x75)
193 #define PID_USAGE_RAMP_END ((USAGE) 0x76)
194 #define PID_USAGE_EFFECT_OPERATION_REPORT ((USAGE) 0x77)
195 #define PID_USAGE_EFFECT_OPERATION ((USAGE) 0x78)
196 #define PID_USAGE_OP_EFFECT_START ((USAGE) 0x79)
197 #define PID_USAGE_OP_EFFECT_START_SOLO ((USAGE) 0x7a)
198 #define PID_USAGE_OP_EFFECT_STOP ((USAGE) 0x7b)
199 #define PID_USAGE_LOOP_COUNT ((USAGE) 0x7c)
200 #define PID_USAGE_DEVICE_GAIN_REPORT ((USAGE) 0x7d)
201 #define PID_USAGE_DEVICE_GAIN ((USAGE) 0x7e)
202 #define PID_USAGE_POOL_REPORT ((USAGE) 0x7f)
203 #define PID_USAGE_RAM_POOL_SIZE ((USAGE) 0x80)
204 #define PID_USAGE_ROM_POOL_SIZE ((USAGE) 0x81)
205 #define PID_USAGE_ROM_EFFECT_BLOCK_COUNT ((USAGE) 0x82)
206 #define PID_USAGE_SIMULTANEOUS_EFFECTS_MAX ((USAGE) 0x83)
207 #define PID_USAGE_POOL_ALIGNMENT ((USAGE) 0x84)
208 #define PID_USAGE_POOL_MOVE_REPORT ((USAGE) 0x85)
209 #define PID_USAGE_MOVE_SOURCE ((USAGE) 0x86)
210 #define PID_USAGE_MOVE_DESTINATION ((USAGE) 0x87)
211 #define PID_USAGE_MOVE_LENGTH ((USAGE) 0x88)
212 #define PID_USAGE_BLOCK_LOAD_REPORT ((USAGE) 0x89)
213 #define PID_USAGE_BLOCK_LOAD_STATUS ((USAGE) 0x8b)
214 #define PID_USAGE_BLOCK_LOAD_SUCCESS ((USAGE) 0x8c)
215 #define PID_USAGE_BLOCK_LOAD_FULL ((USAGE) 0x8d)
216 #define PID_USAGE_BLOCK_LOAD_ERROR ((USAGE) 0x8e)
217 #define PID_USAGE_BLOCK_HANDLE ((USAGE) 0x8f)
218 #define PID_USAGE_BLOCK_FREE_REPORT ((USAGE) 0x90)
219 #define PID_USAGE_TYPE_SPECIFIC_BLOCK_HANDLE ((USAGE) 0x91)
220 #define PID_USAGE_STATE_REPORT ((USAGE) 0x92)
221 #define PID_USAGE_EFFECT_PLAYING ((USAGE) 0x94)
222 #define PID_USAGE_DEVICE_CONTROL_REPORT ((USAGE) 0x95)
223 #define PID_USAGE_DEVICE_CONTROL ((USAGE) 0x96)
224 #define PID_USAGE_DC_ENABLE_ACTUATORS ((USAGE) 0x97)
225 #define PID_USAGE_DC_DISABLE_ACTUATORS ((USAGE) 0x98)
226 #define PID_USAGE_DC_STOP_ALL_EFFECTS ((USAGE) 0x99)
227 #define PID_USAGE_DC_DEVICE_RESET ((USAGE) 0x9a)
228 #define PID_USAGE_DC_DEVICE_PAUSE ((USAGE) 0x9b)
229 #define PID_USAGE_DC_DEVICE_CONTINUE ((USAGE) 0x9c)
230 #define PID_USAGE_DEVICE_PAUSED ((USAGE) 0x9f)
231 #define PID_USAGE_ACTUATORS_ENABLED ((USAGE) 0xa0)
232 #define PID_USAGE_SAFETY_SWITCH ((USAGE) 0xa4)
233 #define PID_USAGE_ACTUATOR_OVERRIDE_SWITCH ((USAGE) 0xa5)
234 #define PID_USAGE_ACTUATOR_POWER ((USAGE) 0xa6)
235 #define PID_USAGE_START_DELAY ((USAGE) 0xa7)
236 #define PID_USAGE_PARAMETER_BLOCK_SIZE ((USAGE) 0xa8)
237 #define PID_USAGE_DEVICE_MANAGED_POOL ((USAGE) 0xa9)
238 #define PID_USAGE_SHARED_PARAMETER_BLOCKS ((USAGE) 0xaa)
239 #define PID_USAGE_CREATE_NEW_EFFECT_REPORT ((USAGE) 0xab)
240 #define PID_USAGE_RAM_POOL_AVAILABLE ((USAGE) 0xac)
242 #define IOCTL_HID_GET_WINE_RAWINPUT_HANDLE HID_BUFFER_CTL_CODE(300)
244 #endif /* __WINE_PARSE_H */