1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#![allow(
unused_imports,
unused_parens,
clippy::useless_conversion,
clippy::double_parens,
clippy::match_single_binding,
clippy::unused_unit
)]
// GENERATED FILE
pub(crate) mod handshake {
use crate::wire;
/**
This enum denotes context types for the libei context.
A context type of receiver is a libei context receiving events
from the EIS implementation. A context type of sender is a libei context
sending events to the EIS implementation.
*/
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum ContextType {
/** this client receives events from the EIS implementation */
Receiver = 1,
/** this client sends events to the EIS implementation */
Sender = 2,
}
impl From<ContextType> for u32 {
fn from(value: ContextType) -> u32 {
value as u32
}
}
impl wire::OwnedArg for ContextType {
fn parse(buf: &mut wire::ByteStream) -> Result<Self, wire::ParseError> {
match u32::parse(buf)? {
1 => Ok(Self::Receiver),
2 => Ok(Self::Sender),
variant => Err(wire::ParseError::InvalidVariant("ContextType", variant)),
}
}
fn as_arg(&self) -> wire::Arg<'_> {
wire::Arg::Uint32(*self as u32)
}
fn enum_name(&self) -> Option<(&'static str, &'static str)> {
Some((
"context_type",
match self {
Self::Receiver => "receiver",
Self::Sender => "sender",
},
))
}
}
}
pub(crate) mod connection {
use crate::wire;
/**
A reason why a client was disconnected. This enum is intended to
provide information to the client on whether it was disconnected as
part of normal operations or as result of an error on either the client
or EIS implementation side.
A nonzero value describes an error, with the generic value "error" (1) reserved
as fallback.
This enum may be extended in the future, clients must be able to handle
values that are not in their supported version of this enum.
*/
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum DisconnectReason {
/** client was purposely disconnected */
Disconnected = 0,
/** an error caused the disconnection */
Error = 1,
/** sender/receiver client sent request for receiver/sender mode */
Mode = 2,
/** client committed a protocol violation */
Protocol = 3,
/** client sent an invalid value */
Value = 4,
/** error on the transport layer */
Transport = 5,
}
impl From<DisconnectReason> for u32 {
fn from(value: DisconnectReason) -> u32 {
value as u32
}
}
impl wire::OwnedArg for DisconnectReason {
fn parse(buf: &mut wire::ByteStream) -> Result<Self, wire::ParseError> {
match u32::parse(buf)? {
0 => Ok(Self::Disconnected),
1 => Ok(Self::Error),
2 => Ok(Self::Mode),
3 => Ok(Self::Protocol),
4 => Ok(Self::Value),
5 => Ok(Self::Transport),
variant => Err(wire::ParseError::InvalidVariant(
"DisconnectReason",
variant,
)),
}
}
fn as_arg(&self) -> wire::Arg<'_> {
wire::Arg::Uint32(*self as u32)
}
fn enum_name(&self) -> Option<(&'static str, &'static str)> {
Some((
"disconnect_reason",
match self {
Self::Disconnected => "disconnected",
Self::Error => "error",
Self::Mode => "mode",
Self::Protocol => "protocol",
Self::Value => "value",
Self::Transport => "transport",
},
))
}
}
}
pub(crate) mod callback {
use crate::wire;
}
pub(crate) mod pingpong {
use crate::wire;
}
pub(crate) mod seat {
use crate::wire;
}
pub(crate) mod device {
use crate::wire;
/**
If the device type is `ei_device.device_type.virtual`, the device is a
virtual device representing input as applied on the EIS implementation's
screen. A relative virtual device generates input events in logical pixels,
an absolute virtual device generates input events in logical pixels on one
of the device's regions. Virtual devices do not have a `ei_device.dimension` but
it may have an `ei_device.region.`
If the device type is `ei_device.device_type.physical`, the device is a
representation of a physical device as if connected to the EIS
implementation's host computer. A relative physical device generates input
events in mm, an absolute physical device generates input events in mm
within the device's specified physical size. Physical devices do not have
regions and no `ei_device.region` events are sent for such devices.
*/
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum DeviceType {
/** a virtual device */
Virtual = 1,
/** representation of a physical device */
Physical = 2,
}
impl From<DeviceType> for u32 {
fn from(value: DeviceType) -> u32 {
value as u32
}
}
impl wire::OwnedArg for DeviceType {
fn parse(buf: &mut wire::ByteStream) -> Result<Self, wire::ParseError> {
match u32::parse(buf)? {
1 => Ok(Self::Virtual),
2 => Ok(Self::Physical),
variant => Err(wire::ParseError::InvalidVariant("DeviceType", variant)),
}
}
fn as_arg(&self) -> wire::Arg<'_> {
wire::Arg::Uint32(*self as u32)
}
fn enum_name(&self) -> Option<(&'static str, &'static str)> {
Some((
"device_type",
match self {
Self::Virtual => "virtual",
Self::Physical => "physical",
},
))
}
}
}
pub(crate) mod pointer {
use crate::wire;
}
pub(crate) mod pointer_absolute {
use crate::wire;
}
pub(crate) mod scroll {
use crate::wire;
}
pub(crate) mod button {
use crate::wire;
/**
The logical state of a button.
*/
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum ButtonState {
/** the button is logically up */
Released = 0,
/** the button is logically down */
Press = 1,
}
impl From<ButtonState> for u32 {
fn from(value: ButtonState) -> u32 {
value as u32
}
}
impl wire::OwnedArg for ButtonState {
fn parse(buf: &mut wire::ByteStream) -> Result<Self, wire::ParseError> {
match u32::parse(buf)? {
0 => Ok(Self::Released),
1 => Ok(Self::Press),
variant => Err(wire::ParseError::InvalidVariant("ButtonState", variant)),
}
}
fn as_arg(&self) -> wire::Arg<'_> {
wire::Arg::Uint32(*self as u32)
}
fn enum_name(&self) -> Option<(&'static str, &'static str)> {
Some((
"button_state",
match self {
Self::Released => "released",
Self::Press => "press",
},
))
}
}
}
pub(crate) mod keyboard {
use crate::wire;
/**
The logical state of a key.
*/
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum KeyState {
/** the key is logically up */
Released = 0,
/** the key is logically down */
Press = 1,
}
impl From<KeyState> for u32 {
fn from(value: KeyState) -> u32 {
value as u32
}
}
impl wire::OwnedArg for KeyState {
fn parse(buf: &mut wire::ByteStream) -> Result<Self, wire::ParseError> {
match u32::parse(buf)? {
0 => Ok(Self::Released),
1 => Ok(Self::Press),
variant => Err(wire::ParseError::InvalidVariant("KeyState", variant)),
}
}
fn as_arg(&self) -> wire::Arg<'_> {
wire::Arg::Uint32(*self as u32)
}
fn enum_name(&self) -> Option<(&'static str, &'static str)> {
Some((
"key_state",
match self {
Self::Released => "released",
Self::Press => "press",
},
))
}
}
/**
The keymap type describes how the keymap in the `ei_keyboard.keymap` event
should be parsed.
*/
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum KeymapType {
/** a libxkbcommon-compatible XKB keymap */
Xkb = 1,
}
impl From<KeymapType> for u32 {
fn from(value: KeymapType) -> u32 {
value as u32
}
}
impl wire::OwnedArg for KeymapType {
fn parse(buf: &mut wire::ByteStream) -> Result<Self, wire::ParseError> {
match u32::parse(buf)? {
1 => Ok(Self::Xkb),
variant => Err(wire::ParseError::InvalidVariant("KeymapType", variant)),
}
}
fn as_arg(&self) -> wire::Arg<'_> {
wire::Arg::Uint32(*self as u32)
}
fn enum_name(&self) -> Option<(&'static str, &'static str)> {
Some((
"keymap_type",
match self {
Self::Xkb => "xkb",
},
))
}
}
}
pub(crate) mod touchscreen {
use crate::wire;
}