1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef KEYBOARD_CONFIGURATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define KEYBOARD_CONFIGURATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
5
6 #include <stdint.h>
7 #include <stddef.h>
8 #include "wayland-client.h"
9
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13
14 /**
15 * @page page_keyboard_configuration_unstable_v1 The keyboard_configuration_unstable_v1 protocol
16 * @section page_ifaces_keyboard_configuration_unstable_v1 Interfaces
17 * - @subpage page_iface_zcr_keyboard_configuration_v1 - extends wl_keyboard with events for device configuration change
18 * - @subpage page_iface_zcr_keyboard_device_configuration_v1 - extension of wl_keyboard protocol
19 * @section page_copyright_keyboard_configuration_unstable_v1 Copyright
20 * <pre>
21 *
22 * Copyright 2016 The Chromium Authors
23 *
24 * Permission is hereby granted, free of charge, to any person obtaining a
25 * copy of this software and associated documentation files (the "Software"),
26 * to deal in the Software without restriction, including without limitation
27 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
28 * and/or sell copies of the Software, and to permit persons to whom the
29 * Software is furnished to do so, subject to the following conditions:
30 *
31 * The above copyright notice and this permission notice (including the next
32 * paragraph) shall be included in all copies or substantial portions of the
33 * Software.
34 *
35 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
36 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
37 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
38 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
39 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
40 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
41 * DEALINGS IN THE SOFTWARE.
42 * </pre>
43 */
44 struct wl_keyboard;
45 struct zcr_keyboard_configuration_v1;
46 struct zcr_keyboard_device_configuration_v1;
47
48 #ifndef ZCR_KEYBOARD_CONFIGURATION_V1_INTERFACE
49 #define ZCR_KEYBOARD_CONFIGURATION_V1_INTERFACE
50 /**
51 * @page page_iface_zcr_keyboard_configuration_v1 zcr_keyboard_configuration_v1
52 * @section page_iface_zcr_keyboard_configuration_v1_desc Description
53 *
54 * Allows a wl_keyboard to notify device configuration change events of
55 * the keyboard to the client.
56 *
57 * Warning! The protocol described in this file is experimental and
58 * backward incompatible changes may be made. Backward compatible changes
59 * may be added together with the corresponding uinterface version bump.
60 * Backward incompatible changes are done by bumping the version number in
61 * the protocol and uinterface names and resetting the interface version.
62 * Once the protocol is to be declared stable, the 'z' prefix and the
63 * version number in the protocol and interface names are removed and the
64 * interface version number is reset.
65 * @section page_iface_zcr_keyboard_configuration_v1_api API
66 * See @ref iface_zcr_keyboard_configuration_v1.
67 */
68 /**
69 * @defgroup iface_zcr_keyboard_configuration_v1 The zcr_keyboard_configuration_v1 interface
70 *
71 * Allows a wl_keyboard to notify device configuration change events of
72 * the keyboard to the client.
73 *
74 * Warning! The protocol described in this file is experimental and
75 * backward incompatible changes may be made. Backward compatible changes
76 * may be added together with the corresponding uinterface version bump.
77 * Backward incompatible changes are done by bumping the version number in
78 * the protocol and uinterface names and resetting the interface version.
79 * Once the protocol is to be declared stable, the 'z' prefix and the
80 * version number in the protocol and interface names are removed and the
81 * interface version number is reset.
82 */
83 extern const struct wl_interface zcr_keyboard_configuration_v1_interface;
84 #endif
85 #ifndef ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_INTERFACE
86 #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_INTERFACE
87 /**
88 * @page page_iface_zcr_keyboard_device_configuration_v1 zcr_keyboard_device_configuration_v1
89 * @section page_iface_zcr_keyboard_device_configuration_v1_desc Description
90 *
91 * The zcr_keyboard_device_configuration_v1 interface extends the wl_keyboard
92 * interface with events to describe device configuration of a keyboard.
93 * @section page_iface_zcr_keyboard_device_configuration_v1_api API
94 * See @ref iface_zcr_keyboard_device_configuration_v1.
95 */
96 /**
97 * @defgroup iface_zcr_keyboard_device_configuration_v1 The zcr_keyboard_device_configuration_v1 interface
98 *
99 * The zcr_keyboard_device_configuration_v1 interface extends the wl_keyboard
100 * interface with events to describe device configuration of a keyboard.
101 */
102 extern const struct wl_interface zcr_keyboard_device_configuration_v1_interface;
103 #endif
104
105 #ifndef ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
106 #define ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
107 enum zcr_keyboard_configuration_v1_error {
108 /**
109 * the keyboard already has a device configuration object associated
110 */
111 ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_DEVICE_CONFIGURATION_EXISTS = 0,
112 };
113 #endif /* ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM */
114
115 #define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION 0
116
117
118 /**
119 * @ingroup iface_zcr_keyboard_configuration_v1
120 */
121 #define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION_SINCE_VERSION 1
122
123 /** @ingroup iface_zcr_keyboard_configuration_v1 */
124 static inline void
zcr_keyboard_configuration_v1_set_user_data(struct zcr_keyboard_configuration_v1 * zcr_keyboard_configuration_v1,void * user_data)125 zcr_keyboard_configuration_v1_set_user_data(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1, void *user_data)
126 {
127 wl_proxy_set_user_data((struct wl_proxy *) zcr_keyboard_configuration_v1, user_data);
128 }
129
130 /** @ingroup iface_zcr_keyboard_configuration_v1 */
131 static inline void *
zcr_keyboard_configuration_v1_get_user_data(struct zcr_keyboard_configuration_v1 * zcr_keyboard_configuration_v1)132 zcr_keyboard_configuration_v1_get_user_data(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1)
133 {
134 return wl_proxy_get_user_data((struct wl_proxy *) zcr_keyboard_configuration_v1);
135 }
136
137 static inline uint32_t
zcr_keyboard_configuration_v1_get_version(struct zcr_keyboard_configuration_v1 * zcr_keyboard_configuration_v1)138 zcr_keyboard_configuration_v1_get_version(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1)
139 {
140 return wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_configuration_v1);
141 }
142
143 /** @ingroup iface_zcr_keyboard_configuration_v1 */
144 static inline void
zcr_keyboard_configuration_v1_destroy(struct zcr_keyboard_configuration_v1 * zcr_keyboard_configuration_v1)145 zcr_keyboard_configuration_v1_destroy(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1)
146 {
147 wl_proxy_destroy((struct wl_proxy *) zcr_keyboard_configuration_v1);
148 }
149
150 /**
151 * @ingroup iface_zcr_keyboard_configuration_v1
152 *
153 * Create keyboard_device_configuration object.
154 * See zcr_keyboard_device_configuration interface for details.
155 * If the given wl_keyboard object already has a device configuration
156 * object associated, the keyboard_device_configuration_exists protocol
157 * error is raised.
158 */
159 static inline struct zcr_keyboard_device_configuration_v1 *
zcr_keyboard_configuration_v1_get_keyboard_device_configuration(struct zcr_keyboard_configuration_v1 * zcr_keyboard_configuration_v1,struct wl_keyboard * keyboard)160 zcr_keyboard_configuration_v1_get_keyboard_device_configuration(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1, struct wl_keyboard *keyboard)
161 {
162 struct wl_proxy *id;
163
164 id = wl_proxy_marshal_flags((struct wl_proxy *) zcr_keyboard_configuration_v1,
165 ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION, &zcr_keyboard_device_configuration_v1_interface, wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_configuration_v1), 0, NULL, keyboard);
166
167 return (struct zcr_keyboard_device_configuration_v1 *) id;
168 }
169
170 #ifndef ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM
171 #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM
172 /**
173 * @ingroup iface_zcr_keyboard_device_configuration_v1
174 * keyboard types
175 */
176 enum zcr_keyboard_device_configuration_v1_keyboard_type {
177 /**
178 * Physical keyboard
179 */
180 ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_PHYSICAL = 0,
181 /**
182 * Virtual keyboard
183 */
184 ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_VIRTUAL = 1,
185 };
186 #endif /* ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM */
187
188 /**
189 * @ingroup iface_zcr_keyboard_device_configuration_v1
190 * @struct zcr_keyboard_device_configuration_v1_listener
191 */
192 struct zcr_keyboard_device_configuration_v1_listener {
193 /**
194 * keyboard type changed
195 *
196 * Notification that the user is switching to new keyboard type.
197 *
198 * If this event is not received, the cleint has to assume a
199 * physical keyboard is in use.
200 * @param type new device type
201 */
202 void (*type_change)(void *data,
203 struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1,
204 uint32_t type);
205 /**
206 * keyboard layout changed
207 *
208 * Notification that the user is switching to a new keyboard
209 * layout. This is an alternative to keymap event in wl_keyboard
210 * interface. The client responds to one of them, and the other is
211 * ignored.
212 * @param name XKB layout name e.g. us(dvorak)
213 * @since 2
214 */
215 void (*layout_change)(void *data,
216 struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1,
217 const char *name);
218 /**
219 * supported key bits
220 *
221 * Union of supported scan code key bits of all connected
222 * keyboards.
223 * @param key_bits Uint64 key bits
224 * @since 3
225 */
226 void (*supported_key_bits)(void *data,
227 struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1,
228 struct wl_array *key_bits);
229 /**
230 * installed keyboard layout
231 *
232 * Notify that the user installed a new keyboard layout. This
233 * doesn't mean the user is switching to this layout. Actual switch
234 * will be notified through `layout_change` event.
235 *
236 * This event provides a file descriptor to the client which can be
237 * memory-mapped to provide a keyboard mapping description.
238 * Difference between this and wl_keyboards's `keymap` event is
239 * this event will be sent both on client startup and also on
240 * newly-added layout (not on layout switch).
241 * @param name XKB layout name e.g. us(dvorak)
242 * @param format keymap format
243 * @param fd keymap file descriptor
244 * @param size keymap size, in bytes
245 * @since 4
246 */
247 void (*layout_install)(void *data,
248 struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1,
249 const char *name,
250 uint32_t format,
251 int32_t fd,
252 uint32_t size);
253 };
254
255 /**
256 * @ingroup iface_zcr_keyboard_device_configuration_v1
257 */
258 static inline int
zcr_keyboard_device_configuration_v1_add_listener(struct zcr_keyboard_device_configuration_v1 * zcr_keyboard_device_configuration_v1,const struct zcr_keyboard_device_configuration_v1_listener * listener,void * data)259 zcr_keyboard_device_configuration_v1_add_listener(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1,
260 const struct zcr_keyboard_device_configuration_v1_listener *listener, void *data)
261 {
262 return wl_proxy_add_listener((struct wl_proxy *) zcr_keyboard_device_configuration_v1,
263 (void (**)(void)) listener, data);
264 }
265
266 #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY 0
267
268 /**
269 * @ingroup iface_zcr_keyboard_device_configuration_v1
270 */
271 #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE_SINCE_VERSION 1
272 /**
273 * @ingroup iface_zcr_keyboard_device_configuration_v1
274 */
275 #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_LAYOUT_CHANGE_SINCE_VERSION 2
276 /**
277 * @ingroup iface_zcr_keyboard_device_configuration_v1
278 */
279 #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_SUPPORTED_KEY_BITS_SINCE_VERSION 3
280 /**
281 * @ingroup iface_zcr_keyboard_device_configuration_v1
282 */
283 #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_LAYOUT_INSTALL_SINCE_VERSION 4
284
285 /**
286 * @ingroup iface_zcr_keyboard_device_configuration_v1
287 */
288 #define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY_SINCE_VERSION 1
289
290 /** @ingroup iface_zcr_keyboard_device_configuration_v1 */
291 static inline void
zcr_keyboard_device_configuration_v1_set_user_data(struct zcr_keyboard_device_configuration_v1 * zcr_keyboard_device_configuration_v1,void * user_data)292 zcr_keyboard_device_configuration_v1_set_user_data(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1, void *user_data)
293 {
294 wl_proxy_set_user_data((struct wl_proxy *) zcr_keyboard_device_configuration_v1, user_data);
295 }
296
297 /** @ingroup iface_zcr_keyboard_device_configuration_v1 */
298 static inline void *
zcr_keyboard_device_configuration_v1_get_user_data(struct zcr_keyboard_device_configuration_v1 * zcr_keyboard_device_configuration_v1)299 zcr_keyboard_device_configuration_v1_get_user_data(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1)
300 {
301 return wl_proxy_get_user_data((struct wl_proxy *) zcr_keyboard_device_configuration_v1);
302 }
303
304 static inline uint32_t
zcr_keyboard_device_configuration_v1_get_version(struct zcr_keyboard_device_configuration_v1 * zcr_keyboard_device_configuration_v1)305 zcr_keyboard_device_configuration_v1_get_version(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1)
306 {
307 return wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_device_configuration_v1);
308 }
309
310 /**
311 * @ingroup iface_zcr_keyboard_device_configuration_v1
312 */
313 static inline void
zcr_keyboard_device_configuration_v1_destroy(struct zcr_keyboard_device_configuration_v1 * zcr_keyboard_device_configuration_v1)314 zcr_keyboard_device_configuration_v1_destroy(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1)
315 {
316 wl_proxy_marshal_flags((struct wl_proxy *) zcr_keyboard_device_configuration_v1,
317 ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_device_configuration_v1), WL_MARSHAL_FLAG_DESTROY);
318 }
319
320 #ifdef __cplusplus
321 }
322 #endif
323
324 #endif
325