1 /* Generated by wayland-scanner 1.22.0 */
2
3 #ifndef INPUT_TIMESTAMPS_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define INPUT_TIMESTAMPS_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_input_timestamps_unstable_v1 The input_timestamps_unstable_v1 protocol
16 * High-resolution timestamps for input events
17 *
18 * @section page_desc_input_timestamps_unstable_v1 Description
19 *
20 * This protocol specifies a way for a client to request and receive
21 * high-resolution timestamps for input events.
22 *
23 * Warning! The protocol described in this file is experimental and
24 * backward incompatible changes may be made. Backward compatible changes
25 * may be added together with the corresponding interface version bump.
26 * Backward incompatible changes are done by bumping the version number in
27 * the protocol and interface names and resetting the interface version.
28 * Once the protocol is to be declared stable, the 'z' prefix and the
29 * version number in the protocol and interface names are removed and the
30 * interface version number is reset.
31 *
32 * @section page_ifaces_input_timestamps_unstable_v1 Interfaces
33 * - @subpage page_iface_zwp_input_timestamps_manager_v1 - context object for high-resolution input timestamps
34 * - @subpage page_iface_zwp_input_timestamps_v1 - context object for input timestamps
35 * @section page_copyright_input_timestamps_unstable_v1 Copyright
36 * <pre>
37 *
38 * Copyright © 2017 Collabora, Ltd.
39 *
40 * Permission is hereby granted, free of charge, to any person obtaining a
41 * copy of this software and associated documentation files (the "Software"),
42 * to deal in the Software without restriction, including without limitation
43 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
44 * and/or sell copies of the Software, and to permit persons to whom the
45 * Software is furnished to do so, subject to the following conditions:
46 *
47 * The above copyright notice and this permission notice (including the next
48 * paragraph) shall be included in all copies or substantial portions of the
49 * Software.
50 *
51 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
54 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
56 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
57 * DEALINGS IN THE SOFTWARE.
58 * </pre>
59 */
60 struct wl_keyboard;
61 struct wl_pointer;
62 struct wl_touch;
63 struct zwp_input_timestamps_manager_v1;
64 struct zwp_input_timestamps_v1;
65
66 #ifndef ZWP_INPUT_TIMESTAMPS_MANAGER_V1_INTERFACE
67 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_INTERFACE
68 /**
69 * @page page_iface_zwp_input_timestamps_manager_v1 zwp_input_timestamps_manager_v1
70 * @section page_iface_zwp_input_timestamps_manager_v1_desc Description
71 *
72 * A global interface used for requesting high-resolution timestamps
73 * for input events.
74 * @section page_iface_zwp_input_timestamps_manager_v1_api API
75 * See @ref iface_zwp_input_timestamps_manager_v1.
76 */
77 /**
78 * @defgroup iface_zwp_input_timestamps_manager_v1 The zwp_input_timestamps_manager_v1 interface
79 *
80 * A global interface used for requesting high-resolution timestamps
81 * for input events.
82 */
83 extern const struct wl_interface zwp_input_timestamps_manager_v1_interface;
84 #endif
85 #ifndef ZWP_INPUT_TIMESTAMPS_V1_INTERFACE
86 #define ZWP_INPUT_TIMESTAMPS_V1_INTERFACE
87 /**
88 * @page page_iface_zwp_input_timestamps_v1 zwp_input_timestamps_v1
89 * @section page_iface_zwp_input_timestamps_v1_desc Description
90 *
91 * Provides high-resolution timestamp events for a set of subscribed input
92 * events. The set of subscribed input events is determined by the
93 * zwp_input_timestamps_manager_v1 request used to create this object.
94 * @section page_iface_zwp_input_timestamps_v1_api API
95 * See @ref iface_zwp_input_timestamps_v1.
96 */
97 /**
98 * @defgroup iface_zwp_input_timestamps_v1 The zwp_input_timestamps_v1 interface
99 *
100 * Provides high-resolution timestamp events for a set of subscribed input
101 * events. The set of subscribed input events is determined by the
102 * zwp_input_timestamps_manager_v1 request used to create this object.
103 */
104 extern const struct wl_interface zwp_input_timestamps_v1_interface;
105 #endif
106
107 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_DESTROY 0
108 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_KEYBOARD_TIMESTAMPS 1
109 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_POINTER_TIMESTAMPS 2
110 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_TOUCH_TIMESTAMPS 3
111
112
113 /**
114 * @ingroup iface_zwp_input_timestamps_manager_v1
115 */
116 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_DESTROY_SINCE_VERSION 1
117 /**
118 * @ingroup iface_zwp_input_timestamps_manager_v1
119 */
120 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_KEYBOARD_TIMESTAMPS_SINCE_VERSION 1
121 /**
122 * @ingroup iface_zwp_input_timestamps_manager_v1
123 */
124 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_POINTER_TIMESTAMPS_SINCE_VERSION 1
125 /**
126 * @ingroup iface_zwp_input_timestamps_manager_v1
127 */
128 #define ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_TOUCH_TIMESTAMPS_SINCE_VERSION 1
129
130 /** @ingroup iface_zwp_input_timestamps_manager_v1 */
131 static inline void
zwp_input_timestamps_manager_v1_set_user_data(struct zwp_input_timestamps_manager_v1 * zwp_input_timestamps_manager_v1,void * user_data)132 zwp_input_timestamps_manager_v1_set_user_data(struct zwp_input_timestamps_manager_v1 *zwp_input_timestamps_manager_v1, void *user_data)
133 {
134 wl_proxy_set_user_data((struct wl_proxy *) zwp_input_timestamps_manager_v1, user_data);
135 }
136
137 /** @ingroup iface_zwp_input_timestamps_manager_v1 */
138 static inline void *
zwp_input_timestamps_manager_v1_get_user_data(struct zwp_input_timestamps_manager_v1 * zwp_input_timestamps_manager_v1)139 zwp_input_timestamps_manager_v1_get_user_data(struct zwp_input_timestamps_manager_v1 *zwp_input_timestamps_manager_v1)
140 {
141 return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_timestamps_manager_v1);
142 }
143
144 static inline uint32_t
zwp_input_timestamps_manager_v1_get_version(struct zwp_input_timestamps_manager_v1 * zwp_input_timestamps_manager_v1)145 zwp_input_timestamps_manager_v1_get_version(struct zwp_input_timestamps_manager_v1 *zwp_input_timestamps_manager_v1)
146 {
147 return wl_proxy_get_version((struct wl_proxy *) zwp_input_timestamps_manager_v1);
148 }
149
150 /**
151 * @ingroup iface_zwp_input_timestamps_manager_v1
152 *
153 * Informs the server that the client will no longer be using this
154 * protocol object. Existing objects created by this object are not
155 * affected.
156 */
157 static inline void
zwp_input_timestamps_manager_v1_destroy(struct zwp_input_timestamps_manager_v1 * zwp_input_timestamps_manager_v1)158 zwp_input_timestamps_manager_v1_destroy(struct zwp_input_timestamps_manager_v1 *zwp_input_timestamps_manager_v1)
159 {
160 wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_timestamps_manager_v1,
161 ZWP_INPUT_TIMESTAMPS_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_timestamps_manager_v1), WL_MARSHAL_FLAG_DESTROY);
162 }
163
164 /**
165 * @ingroup iface_zwp_input_timestamps_manager_v1
166 *
167 * Creates a new input timestamps object that represents a subscription
168 * to high-resolution timestamp events for all wl_keyboard events that
169 * carry a timestamp.
170 *
171 * If the associated wl_keyboard object is invalidated, either through
172 * client action (e.g. release) or server-side changes, the input
173 * timestamps object becomes inert and the client should destroy it
174 * by calling zwp_input_timestamps_v1.destroy.
175 */
176 static inline struct zwp_input_timestamps_v1 *
zwp_input_timestamps_manager_v1_get_keyboard_timestamps(struct zwp_input_timestamps_manager_v1 * zwp_input_timestamps_manager_v1,struct wl_keyboard * keyboard)177 zwp_input_timestamps_manager_v1_get_keyboard_timestamps(struct zwp_input_timestamps_manager_v1 *zwp_input_timestamps_manager_v1, struct wl_keyboard *keyboard)
178 {
179 struct wl_proxy *id;
180
181 id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_timestamps_manager_v1,
182 ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_KEYBOARD_TIMESTAMPS, &zwp_input_timestamps_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_input_timestamps_manager_v1), 0, NULL, keyboard);
183
184 return (struct zwp_input_timestamps_v1 *) id;
185 }
186
187 /**
188 * @ingroup iface_zwp_input_timestamps_manager_v1
189 *
190 * Creates a new input timestamps object that represents a subscription
191 * to high-resolution timestamp events for all wl_pointer events that
192 * carry a timestamp.
193 *
194 * If the associated wl_pointer object is invalidated, either through
195 * client action (e.g. release) or server-side changes, the input
196 * timestamps object becomes inert and the client should destroy it
197 * by calling zwp_input_timestamps_v1.destroy.
198 */
199 static inline struct zwp_input_timestamps_v1 *
zwp_input_timestamps_manager_v1_get_pointer_timestamps(struct zwp_input_timestamps_manager_v1 * zwp_input_timestamps_manager_v1,struct wl_pointer * pointer)200 zwp_input_timestamps_manager_v1_get_pointer_timestamps(struct zwp_input_timestamps_manager_v1 *zwp_input_timestamps_manager_v1, struct wl_pointer *pointer)
201 {
202 struct wl_proxy *id;
203
204 id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_timestamps_manager_v1,
205 ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_POINTER_TIMESTAMPS, &zwp_input_timestamps_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_input_timestamps_manager_v1), 0, NULL, pointer);
206
207 return (struct zwp_input_timestamps_v1 *) id;
208 }
209
210 /**
211 * @ingroup iface_zwp_input_timestamps_manager_v1
212 *
213 * Creates a new input timestamps object that represents a subscription
214 * to high-resolution timestamp events for all wl_touch events that
215 * carry a timestamp.
216 *
217 * If the associated wl_touch object becomes invalid, either through
218 * client action (e.g. release) or server-side changes, the input
219 * timestamps object becomes inert and the client should destroy it
220 * by calling zwp_input_timestamps_v1.destroy.
221 */
222 static inline struct zwp_input_timestamps_v1 *
zwp_input_timestamps_manager_v1_get_touch_timestamps(struct zwp_input_timestamps_manager_v1 * zwp_input_timestamps_manager_v1,struct wl_touch * touch)223 zwp_input_timestamps_manager_v1_get_touch_timestamps(struct zwp_input_timestamps_manager_v1 *zwp_input_timestamps_manager_v1, struct wl_touch *touch)
224 {
225 struct wl_proxy *id;
226
227 id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_timestamps_manager_v1,
228 ZWP_INPUT_TIMESTAMPS_MANAGER_V1_GET_TOUCH_TIMESTAMPS, &zwp_input_timestamps_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_input_timestamps_manager_v1), 0, NULL, touch);
229
230 return (struct zwp_input_timestamps_v1 *) id;
231 }
232
233 /**
234 * @ingroup iface_zwp_input_timestamps_v1
235 * @struct zwp_input_timestamps_v1_listener
236 */
237 struct zwp_input_timestamps_v1_listener {
238 /**
239 * high-resolution timestamp event
240 *
241 * The timestamp event is associated with the first subsequent
242 * input event carrying a timestamp which belongs to the set of
243 * input events this object is subscribed to.
244 *
245 * The timestamp provided by this event is a high-resolution
246 * version of the timestamp argument of the associated input event.
247 * The provided timestamp is in the same clock domain and is at
248 * least as accurate as the associated input event timestamp.
249 *
250 * The timestamp is expressed as tv_sec_hi, tv_sec_lo, tv_nsec
251 * triples, each component being an unsigned 32-bit value. Whole
252 * seconds are in tv_sec which is a 64-bit value combined from
253 * tv_sec_hi and tv_sec_lo, and the additional fractional part in
254 * tv_nsec as nanoseconds. Hence, for valid timestamps tv_nsec must
255 * be in [0, 999999999].
256 * @param tv_sec_hi high 32 bits of the seconds part of the timestamp
257 * @param tv_sec_lo low 32 bits of the seconds part of the timestamp
258 * @param tv_nsec nanoseconds part of the timestamp
259 */
260 void (*timestamp)(void *data,
261 struct zwp_input_timestamps_v1 *zwp_input_timestamps_v1,
262 uint32_t tv_sec_hi,
263 uint32_t tv_sec_lo,
264 uint32_t tv_nsec);
265 };
266
267 /**
268 * @ingroup iface_zwp_input_timestamps_v1
269 */
270 static inline int
zwp_input_timestamps_v1_add_listener(struct zwp_input_timestamps_v1 * zwp_input_timestamps_v1,const struct zwp_input_timestamps_v1_listener * listener,void * data)271 zwp_input_timestamps_v1_add_listener(struct zwp_input_timestamps_v1 *zwp_input_timestamps_v1,
272 const struct zwp_input_timestamps_v1_listener *listener, void *data)
273 {
274 return wl_proxy_add_listener((struct wl_proxy *) zwp_input_timestamps_v1,
275 (void (**)(void)) listener, data);
276 }
277
278 #define ZWP_INPUT_TIMESTAMPS_V1_DESTROY 0
279
280 /**
281 * @ingroup iface_zwp_input_timestamps_v1
282 */
283 #define ZWP_INPUT_TIMESTAMPS_V1_TIMESTAMP_SINCE_VERSION 1
284
285 /**
286 * @ingroup iface_zwp_input_timestamps_v1
287 */
288 #define ZWP_INPUT_TIMESTAMPS_V1_DESTROY_SINCE_VERSION 1
289
290 /** @ingroup iface_zwp_input_timestamps_v1 */
291 static inline void
zwp_input_timestamps_v1_set_user_data(struct zwp_input_timestamps_v1 * zwp_input_timestamps_v1,void * user_data)292 zwp_input_timestamps_v1_set_user_data(struct zwp_input_timestamps_v1 *zwp_input_timestamps_v1, void *user_data)
293 {
294 wl_proxy_set_user_data((struct wl_proxy *) zwp_input_timestamps_v1, user_data);
295 }
296
297 /** @ingroup iface_zwp_input_timestamps_v1 */
298 static inline void *
zwp_input_timestamps_v1_get_user_data(struct zwp_input_timestamps_v1 * zwp_input_timestamps_v1)299 zwp_input_timestamps_v1_get_user_data(struct zwp_input_timestamps_v1 *zwp_input_timestamps_v1)
300 {
301 return wl_proxy_get_user_data((struct wl_proxy *) zwp_input_timestamps_v1);
302 }
303
304 static inline uint32_t
zwp_input_timestamps_v1_get_version(struct zwp_input_timestamps_v1 * zwp_input_timestamps_v1)305 zwp_input_timestamps_v1_get_version(struct zwp_input_timestamps_v1 *zwp_input_timestamps_v1)
306 {
307 return wl_proxy_get_version((struct wl_proxy *) zwp_input_timestamps_v1);
308 }
309
310 /**
311 * @ingroup iface_zwp_input_timestamps_v1
312 *
313 * Informs the server that the client will no longer be using this
314 * protocol object. After the server processes the request, no more
315 * timestamp events will be emitted.
316 */
317 static inline void
zwp_input_timestamps_v1_destroy(struct zwp_input_timestamps_v1 * zwp_input_timestamps_v1)318 zwp_input_timestamps_v1_destroy(struct zwp_input_timestamps_v1 *zwp_input_timestamps_v1)
319 {
320 wl_proxy_marshal_flags((struct wl_proxy *) zwp_input_timestamps_v1,
321 ZWP_INPUT_TIMESTAMPS_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_input_timestamps_v1), WL_MARSHAL_FLAG_DESTROY);
322 }
323
324 #ifdef __cplusplus
325 }
326 #endif
327
328 #endif
329