1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Request {
5 #[prost(oneof="request::RequestType", tags="1, 2, 3, 4, 5, 6, 7, 8")]
6 pub request_type: ::core::option::Option<request::RequestType>,
7}
8pub mod request {
10 #[allow(clippy::derive_partial_eq_without_eq)]
11#[derive(Clone, PartialEq, ::prost::Oneof)]
12 pub enum RequestType {
13 #[prost(bool, tag="1")]
14 GetKeymap(bool),
15 #[prost(message, tag="2")]
16 SetLayerBinding(super::SetLayerBindingRequest),
17 #[prost(bool, tag="3")]
18 CheckUnsavedChanges(bool),
19 #[prost(bool, tag="4")]
20 SaveChanges(bool),
21 #[prost(bool, tag="5")]
22 DiscardChanges(bool),
23 #[prost(bool, tag="6")]
24 GetPhysicalLayouts(bool),
25 #[prost(uint32, tag="7")]
26 SetActivePhysicalLayout(u32),
27 #[prost(message, tag="8")]
28 MoveLayer(super::MoveLayerRequest),
29 }
30}
31#[allow(clippy::derive_partial_eq_without_eq)]
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct Response {
34 #[prost(oneof="response::ResponseType", tags="1, 2, 3, 4, 5, 6, 7, 8")]
35 pub response_type: ::core::option::Option<response::ResponseType>,
36}
37pub mod response {
39 #[allow(clippy::derive_partial_eq_without_eq)]
40#[derive(Clone, PartialEq, ::prost::Oneof)]
41 pub enum ResponseType {
42 #[prost(message, tag="1")]
43 GetKeymap(super::Keymap),
44 #[prost(enumeration="super::SetLayerBindingResponse", tag="2")]
45 SetLayerBinding(i32),
46 #[prost(bool, tag="3")]
47 CheckUnsavedChanges(bool),
48 #[prost(bool, tag="4")]
49 SaveChanges(bool),
50 #[prost(bool, tag="5")]
51 DiscardChanges(bool),
52 #[prost(message, tag="6")]
53 GetPhysicalLayouts(super::PhysicalLayouts),
54 #[prost(message, tag="7")]
55 SetActivePhysicalLayout(super::SetActivePhysicalLayoutResponse),
56 #[prost(message, tag="8")]
57 MoveLayer(super::MoveLayerResponse),
58 }
59}
60#[allow(clippy::derive_partial_eq_without_eq)]
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct Notification {
63 #[prost(oneof="notification::NotificationType", tags="1")]
64 pub notification_type: ::core::option::Option<notification::NotificationType>,
65}
66pub mod notification {
68 #[allow(clippy::derive_partial_eq_without_eq)]
69#[derive(Clone, PartialEq, ::prost::Oneof)]
70 pub enum NotificationType {
71 #[prost(bool, tag="1")]
72 UnsavedChangesStatusChanged(bool),
73 }
74}
75#[allow(clippy::derive_partial_eq_without_eq)]
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct SetActivePhysicalLayoutResponse {
78 #[prost(oneof="set_active_physical_layout_response::Result", tags="1, 2")]
79 pub result: ::core::option::Option<set_active_physical_layout_response::Result>,
80}
81pub mod set_active_physical_layout_response {
83 #[allow(clippy::derive_partial_eq_without_eq)]
84#[derive(Clone, PartialEq, ::prost::Oneof)]
85 pub enum Result {
86 #[prost(message, tag="1")]
87 Ok(super::Keymap),
88 #[prost(enumeration="super::SetActivePhysicalLayoutErrorCode", tag="2")]
89 Err(i32),
90 }
91}
92#[allow(clippy::derive_partial_eq_without_eq)]
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct MoveLayerResponse {
95 #[prost(oneof="move_layer_response::Result", tags="1, 2")]
96 pub result: ::core::option::Option<move_layer_response::Result>,
97}
98pub mod move_layer_response {
100 #[allow(clippy::derive_partial_eq_without_eq)]
101#[derive(Clone, PartialEq, ::prost::Oneof)]
102 pub enum Result {
103 #[prost(message, tag="1")]
104 Ok(super::Keymap),
105 #[prost(enumeration="super::MoveLayerErrorCode", tag="2")]
106 Err(i32),
107 }
108}
109#[allow(clippy::derive_partial_eq_without_eq)]
110#[derive(Clone, PartialEq, ::prost::Message)]
111pub struct SetLayerBindingRequest {
112 #[prost(int32, tag="1")]
113 pub layer: i32,
114 #[prost(int32, tag="2")]
115 pub key_position: i32,
116 #[prost(message, optional, tag="3")]
117 pub binding: ::core::option::Option<BehaviorBinding>,
118}
119#[allow(clippy::derive_partial_eq_without_eq)]
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct MoveLayerRequest {
122 #[prost(uint32, tag="1")]
123 pub layer: u32,
124 #[prost(uint32, tag="2")]
125 pub dest: u32,
126}
127#[allow(clippy::derive_partial_eq_without_eq)]
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct Keymap {
130 #[prost(message, repeated, tag="1")]
131 pub layers: ::prost::alloc::vec::Vec<Layer>,
132}
133#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct Layer {
136 #[prost(string, tag="1")]
137 pub name: ::prost::alloc::string::String,
138 #[prost(message, repeated, tag="2")]
139 pub bindings: ::prost::alloc::vec::Vec<BehaviorBinding>,
140}
141#[allow(clippy::derive_partial_eq_without_eq)]
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct BehaviorBinding {
144 #[prost(sint32, tag="1")]
145 pub behavior_id: i32,
146 #[prost(uint32, tag="2")]
147 pub param1: u32,
148 #[prost(uint32, tag="3")]
149 pub param2: u32,
150}
151#[allow(clippy::derive_partial_eq_without_eq)]
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct PhysicalLayouts {
154 #[prost(uint32, tag="1")]
155 pub active_layout_index: u32,
156 #[prost(message, repeated, tag="2")]
157 pub layouts: ::prost::alloc::vec::Vec<PhysicalLayout>,
158}
159#[allow(clippy::derive_partial_eq_without_eq)]
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct PhysicalLayout {
162 #[prost(string, tag="1")]
163 pub name: ::prost::alloc::string::String,
164 #[prost(message, repeated, tag="2")]
165 pub keys: ::prost::alloc::vec::Vec<KeyPhysicalAttrs>,
166}
167#[allow(clippy::derive_partial_eq_without_eq)]
168#[derive(Clone, PartialEq, ::prost::Message)]
169pub struct KeyPhysicalAttrs {
170 #[prost(sint32, tag="1")]
171 pub width: i32,
172 #[prost(sint32, tag="2")]
173 pub height: i32,
174 #[prost(sint32, tag="3")]
175 pub x: i32,
176 #[prost(sint32, tag="4")]
177 pub y: i32,
178 #[prost(sint32, tag="5")]
179 pub r: i32,
180 #[prost(sint32, tag="6")]
181 pub rx: i32,
182 #[prost(sint32, tag="7")]
183 pub ry: i32,
184}
185#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
186#[repr(i32)]
187pub enum SetLayerBindingResponse {
188 Success = 0,
189 InvalidLocation = 1,
190 InvalidBehavior = 2,
191 InvalidParameters = 3,
192}
193impl SetLayerBindingResponse {
194 pub fn as_str_name(&self) -> &'static str {
199 match self {
200 SetLayerBindingResponse::Success => "SUCCESS",
201 SetLayerBindingResponse::InvalidLocation => "INVALID_LOCATION",
202 SetLayerBindingResponse::InvalidBehavior => "INVALID_BEHAVIOR",
203 SetLayerBindingResponse::InvalidParameters => "INVALID_PARAMETERS",
204 }
205 }
206 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
208 match value {
209 "SUCCESS" => Some(Self::Success),
210 "INVALID_LOCATION" => Some(Self::InvalidLocation),
211 "INVALID_BEHAVIOR" => Some(Self::InvalidBehavior),
212 "INVALID_PARAMETERS" => Some(Self::InvalidParameters),
213 _ => None,
214 }
215 }
216}
217#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
218#[repr(i32)]
219pub enum MoveLayerErrorCode {
220 MoveLayerErrSuccess = 0,
221 MoveLayerErrGeneric = 1,
222 MoveLayerErrInvalidLayer = 2,
223 MoveLayerErrInvalidDestination = 3,
224}
225impl MoveLayerErrorCode {
226 pub fn as_str_name(&self) -> &'static str {
231 match self {
232 MoveLayerErrorCode::MoveLayerErrSuccess => "MOVE_LAYER_ERR_SUCCESS",
233 MoveLayerErrorCode::MoveLayerErrGeneric => "MOVE_LAYER_ERR_GENERIC",
234 MoveLayerErrorCode::MoveLayerErrInvalidLayer => "MOVE_LAYER_ERR_INVALID_LAYER",
235 MoveLayerErrorCode::MoveLayerErrInvalidDestination => "MOVE_LAYER_ERR_INVALID_DESTINATION",
236 }
237 }
238 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
240 match value {
241 "MOVE_LAYER_ERR_SUCCESS" => Some(Self::MoveLayerErrSuccess),
242 "MOVE_LAYER_ERR_GENERIC" => Some(Self::MoveLayerErrGeneric),
243 "MOVE_LAYER_ERR_INVALID_LAYER" => Some(Self::MoveLayerErrInvalidLayer),
244 "MOVE_LAYER_ERR_INVALID_DESTINATION" => Some(Self::MoveLayerErrInvalidDestination),
245 _ => None,
246 }
247 }
248}
249#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
250#[repr(i32)]
251pub enum SetActivePhysicalLayoutErrorCode {
252 Generic = 0,
253 InvalidLayerIndex = 1,
254}
255impl SetActivePhysicalLayoutErrorCode {
256 pub fn as_str_name(&self) -> &'static str {
261 match self {
262 SetActivePhysicalLayoutErrorCode::Generic => "GENERIC",
263 SetActivePhysicalLayoutErrorCode::InvalidLayerIndex => "INVALID_LAYER_INDEX",
264 }
265 }
266 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
268 match value {
269 "GENERIC" => Some(Self::Generic),
270 "INVALID_LAYER_INDEX" => Some(Self::InvalidLayerIndex),
271 _ => None,
272 }
273 }
274}
275