1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef KEYBOARD_EXTENSION_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define KEYBOARD_EXTENSION_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_extension_unstable_v1 The keyboard_extension_unstable_v1 protocol
16  * @section page_ifaces_keyboard_extension_unstable_v1 Interfaces
17  * - @subpage page_iface_zcr_keyboard_extension_v1 - extends wl_keyboard with ack_key events
18  * - @subpage page_iface_zcr_extended_keyboard_v1 - extension of wl_keyboard protocol
19  * @section page_copyright_keyboard_extension_unstable_v1 Copyright
20  * <pre>
21  *
22  * Copyright 2017 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_extended_keyboard_v1;
46 struct zcr_keyboard_extension_v1;
47 
48 #ifndef ZCR_KEYBOARD_EXTENSION_V1_INTERFACE
49 #define ZCR_KEYBOARD_EXTENSION_V1_INTERFACE
50 /**
51  * @page page_iface_zcr_keyboard_extension_v1 zcr_keyboard_extension_v1
52  * @section page_iface_zcr_keyboard_extension_v1_desc Description
53  *
54  * Allows a wl_keyboard to send ack_key requests for each key event of
55  * the keyboard to the server.
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_extension_v1_api API
66  * See @ref iface_zcr_keyboard_extension_v1.
67  */
68 /**
69  * @defgroup iface_zcr_keyboard_extension_v1 The zcr_keyboard_extension_v1 interface
70  *
71  * Allows a wl_keyboard to send ack_key requests for each key event of
72  * the keyboard to the server.
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_extension_v1_interface;
84 #endif
85 #ifndef ZCR_EXTENDED_KEYBOARD_V1_INTERFACE
86 #define ZCR_EXTENDED_KEYBOARD_V1_INTERFACE
87 /**
88  * @page page_iface_zcr_extended_keyboard_v1 zcr_extended_keyboard_v1
89  * @section page_iface_zcr_extended_keyboard_v1_desc Description
90  *
91  * The zcr_extended_keyboard_v1 interface extends the wl_keyboard interface
92  * with requests to notify whether sent key events are handled or not by
93  * the client. If no such an acknowledgment request is sent in a specified
94  * amount of time, then the event is assumed to be handled.
95  * @section page_iface_zcr_extended_keyboard_v1_api API
96  * See @ref iface_zcr_extended_keyboard_v1.
97  */
98 /**
99  * @defgroup iface_zcr_extended_keyboard_v1 The zcr_extended_keyboard_v1 interface
100  *
101  * The zcr_extended_keyboard_v1 interface extends the wl_keyboard interface
102  * with requests to notify whether sent key events are handled or not by
103  * the client. If no such an acknowledgment request is sent in a specified
104  * amount of time, then the event is assumed to be handled.
105  */
106 extern const struct wl_interface zcr_extended_keyboard_v1_interface;
107 #endif
108 
109 #ifndef ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM
110 #define ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM
111 enum zcr_keyboard_extension_v1_error {
112 	/**
113 	 * the keyboard already has an extended_keyboard object associated
114 	 */
115 	ZCR_KEYBOARD_EXTENSION_V1_ERROR_EXTENDED_KEYBOARD_EXISTS = 0,
116 };
117 #endif /* ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM */
118 
119 #define ZCR_KEYBOARD_EXTENSION_V1_GET_EXTENDED_KEYBOARD 0
120 
121 
122 /**
123  * @ingroup iface_zcr_keyboard_extension_v1
124  */
125 #define ZCR_KEYBOARD_EXTENSION_V1_GET_EXTENDED_KEYBOARD_SINCE_VERSION 1
126 
127 /** @ingroup iface_zcr_keyboard_extension_v1 */
128 static inline void
zcr_keyboard_extension_v1_set_user_data(struct zcr_keyboard_extension_v1 * zcr_keyboard_extension_v1,void * user_data)129 zcr_keyboard_extension_v1_set_user_data(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1, void *user_data)
130 {
131 	wl_proxy_set_user_data((struct wl_proxy *) zcr_keyboard_extension_v1, user_data);
132 }
133 
134 /** @ingroup iface_zcr_keyboard_extension_v1 */
135 static inline void *
zcr_keyboard_extension_v1_get_user_data(struct zcr_keyboard_extension_v1 * zcr_keyboard_extension_v1)136 zcr_keyboard_extension_v1_get_user_data(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1)
137 {
138 	return wl_proxy_get_user_data((struct wl_proxy *) zcr_keyboard_extension_v1);
139 }
140 
141 static inline uint32_t
zcr_keyboard_extension_v1_get_version(struct zcr_keyboard_extension_v1 * zcr_keyboard_extension_v1)142 zcr_keyboard_extension_v1_get_version(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1)
143 {
144 	return wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_extension_v1);
145 }
146 
147 /** @ingroup iface_zcr_keyboard_extension_v1 */
148 static inline void
zcr_keyboard_extension_v1_destroy(struct zcr_keyboard_extension_v1 * zcr_keyboard_extension_v1)149 zcr_keyboard_extension_v1_destroy(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1)
150 {
151 	wl_proxy_destroy((struct wl_proxy *) zcr_keyboard_extension_v1);
152 }
153 
154 /**
155  * @ingroup iface_zcr_keyboard_extension_v1
156  *
157  * Create extended_keyboard object.
158  * See zcr_extended_keyboard interface for details.
159  * If the given wl_keyboard object already has a extended_keyboard object
160  * associated, the extended_keyboard_exists protocol error is raised.
161  */
162 static inline struct zcr_extended_keyboard_v1 *
zcr_keyboard_extension_v1_get_extended_keyboard(struct zcr_keyboard_extension_v1 * zcr_keyboard_extension_v1,struct wl_keyboard * keyboard)163 zcr_keyboard_extension_v1_get_extended_keyboard(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1, struct wl_keyboard *keyboard)
164 {
165 	struct wl_proxy *id;
166 
167 	id = wl_proxy_marshal_flags((struct wl_proxy *) zcr_keyboard_extension_v1,
168 			 ZCR_KEYBOARD_EXTENSION_V1_GET_EXTENDED_KEYBOARD, &zcr_extended_keyboard_v1_interface, wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_extension_v1), 0, NULL, keyboard);
169 
170 	return (struct zcr_extended_keyboard_v1 *) id;
171 }
172 
173 #ifndef ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM
174 #define ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM
175 /**
176  * @ingroup iface_zcr_extended_keyboard_v1
177  * whether a key event is handled by client or not
178  */
179 enum zcr_extended_keyboard_v1_handled_state {
180 	ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_NOT_HANDLED = 0,
181 	ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_HANDLED = 1,
182 };
183 #endif /* ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM */
184 
185 /**
186  * @ingroup iface_zcr_extended_keyboard_v1
187  * @struct zcr_extended_keyboard_v1_listener
188  */
189 struct zcr_extended_keyboard_v1_listener {
190 	/**
191 	 * peek a key event
192 	 *
193 	 * A key event which will be soon delivered to the application
194 	 * via wl_keyboard::key. If text_input consumes the key event,
195 	 * wl_keyboard::key is not delivered, but this event is still
196 	 * delivered to the application. All arguments are the exactly same
197 	 * one of the following wl_keyboard::key, including serial.
198 	 * @param serial serial number of the key event
199 	 * @param time timestamp with millisecond granularity
200 	 * @param key key that produced the event
201 	 * @param state physical state of the key
202 	 * @since 2
203 	 */
204 	void (*peek_key)(void *data,
205 			 struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1,
206 			 uint32_t serial,
207 			 uint32_t time,
208 			 uint32_t key,
209 			 uint32_t state);
210 };
211 
212 /**
213  * @ingroup iface_zcr_extended_keyboard_v1
214  */
215 static inline int
zcr_extended_keyboard_v1_add_listener(struct zcr_extended_keyboard_v1 * zcr_extended_keyboard_v1,const struct zcr_extended_keyboard_v1_listener * listener,void * data)216 zcr_extended_keyboard_v1_add_listener(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1,
217 				      const struct zcr_extended_keyboard_v1_listener *listener, void *data)
218 {
219 	return wl_proxy_add_listener((struct wl_proxy *) zcr_extended_keyboard_v1,
220 				     (void (**)(void)) listener, data);
221 }
222 
223 #define ZCR_EXTENDED_KEYBOARD_V1_DESTROY 0
224 #define ZCR_EXTENDED_KEYBOARD_V1_ACK_KEY 1
225 
226 /**
227  * @ingroup iface_zcr_extended_keyboard_v1
228  */
229 #define ZCR_EXTENDED_KEYBOARD_V1_PEEK_KEY_SINCE_VERSION 2
230 
231 /**
232  * @ingroup iface_zcr_extended_keyboard_v1
233  */
234 #define ZCR_EXTENDED_KEYBOARD_V1_DESTROY_SINCE_VERSION 1
235 /**
236  * @ingroup iface_zcr_extended_keyboard_v1
237  */
238 #define ZCR_EXTENDED_KEYBOARD_V1_ACK_KEY_SINCE_VERSION 1
239 
240 /** @ingroup iface_zcr_extended_keyboard_v1 */
241 static inline void
zcr_extended_keyboard_v1_set_user_data(struct zcr_extended_keyboard_v1 * zcr_extended_keyboard_v1,void * user_data)242 zcr_extended_keyboard_v1_set_user_data(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1, void *user_data)
243 {
244 	wl_proxy_set_user_data((struct wl_proxy *) zcr_extended_keyboard_v1, user_data);
245 }
246 
247 /** @ingroup iface_zcr_extended_keyboard_v1 */
248 static inline void *
zcr_extended_keyboard_v1_get_user_data(struct zcr_extended_keyboard_v1 * zcr_extended_keyboard_v1)249 zcr_extended_keyboard_v1_get_user_data(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1)
250 {
251 	return wl_proxy_get_user_data((struct wl_proxy *) zcr_extended_keyboard_v1);
252 }
253 
254 static inline uint32_t
zcr_extended_keyboard_v1_get_version(struct zcr_extended_keyboard_v1 * zcr_extended_keyboard_v1)255 zcr_extended_keyboard_v1_get_version(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1)
256 {
257 	return wl_proxy_get_version((struct wl_proxy *) zcr_extended_keyboard_v1);
258 }
259 
260 /**
261  * @ingroup iface_zcr_extended_keyboard_v1
262  */
263 static inline void
zcr_extended_keyboard_v1_destroy(struct zcr_extended_keyboard_v1 * zcr_extended_keyboard_v1)264 zcr_extended_keyboard_v1_destroy(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1)
265 {
266 	wl_proxy_marshal_flags((struct wl_proxy *) zcr_extended_keyboard_v1,
267 			 ZCR_EXTENDED_KEYBOARD_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_extended_keyboard_v1), WL_MARSHAL_FLAG_DESTROY);
268 }
269 
270 /**
271  * @ingroup iface_zcr_extended_keyboard_v1
272  */
273 static inline void
zcr_extended_keyboard_v1_ack_key(struct zcr_extended_keyboard_v1 * zcr_extended_keyboard_v1,uint32_t serial,uint32_t handled)274 zcr_extended_keyboard_v1_ack_key(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1, uint32_t serial, uint32_t handled)
275 {
276 	wl_proxy_marshal_flags((struct wl_proxy *) zcr_extended_keyboard_v1,
277 			 ZCR_EXTENDED_KEYBOARD_V1_ACK_KEY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_extended_keyboard_v1), 0, serial, handled);
278 }
279 
280 #ifdef  __cplusplus
281 }
282 #endif
283 
284 #endif
285