1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef VSYNC_FEEDBACK_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define VSYNC_FEEDBACK_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_vsync_feedback_unstable_v1 The vsync_feedback_unstable_v1 protocol
16  * Protocol for providing vertical synchronization timing
17  *
18  * @section page_desc_vsync_feedback_unstable_v1 Description
19  *
20  * This protocol specifies a set of interfaces used to inform the client about
21  * vertical synchronization timing in a precise way and without unnecessary
22  * overhead.
23  *
24  * Warning! The protocol described in this file is experimental and backward
25  * incompatible changes may be made. Backward compatible changes may be added
26  * together with the corresponding interface version bump. Backward
27  * incompatible changes are done by bumping the version number in the protocol
28  * and interface names and resetting the interface version. Once the protocol
29  * is to be declared stable, the version number in the protocol is removed and
30  * the interface version number is reset.
31  *
32  * @section page_ifaces_vsync_feedback_unstable_v1 Interfaces
33  * - @subpage page_iface_zcr_vsync_feedback_v1 - Protocol for providing vertical synchronization timing
34  * - @subpage page_iface_zcr_vsync_timing_v1 -
35  * @section page_copyright_vsync_feedback_unstable_v1 Copyright
36  * <pre>
37  *
38  * Copyright 2016 The Chromium Authors
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_output;
61 struct zcr_vsync_feedback_v1;
62 struct zcr_vsync_timing_v1;
63 
64 #ifndef ZCR_VSYNC_FEEDBACK_V1_INTERFACE
65 #define ZCR_VSYNC_FEEDBACK_V1_INTERFACE
66 /**
67  * @page page_iface_zcr_vsync_feedback_v1 zcr_vsync_feedback_v1
68  * @section page_iface_zcr_vsync_feedback_v1_desc Description
69  *
70  * The global interface that allows clients to subscribe for vertical
71  * synchronization timing data for given wl_output.
72  * @section page_iface_zcr_vsync_feedback_v1_api API
73  * See @ref iface_zcr_vsync_feedback_v1.
74  */
75 /**
76  * @defgroup iface_zcr_vsync_feedback_v1 The zcr_vsync_feedback_v1 interface
77  *
78  * The global interface that allows clients to subscribe for vertical
79  * synchronization timing data for given wl_output.
80  */
81 extern const struct wl_interface zcr_vsync_feedback_v1_interface;
82 #endif
83 #ifndef ZCR_VSYNC_TIMING_V1_INTERFACE
84 #define ZCR_VSYNC_TIMING_V1_INTERFACE
85 /**
86  * @page page_iface_zcr_vsync_timing_v1 zcr_vsync_timing_v1
87  * @section page_iface_zcr_vsync_timing_v1_api API
88  * See @ref iface_zcr_vsync_timing_v1.
89  */
90 /**
91  * @defgroup iface_zcr_vsync_timing_v1 The zcr_vsync_timing_v1 interface
92  */
93 extern const struct wl_interface zcr_vsync_timing_v1_interface;
94 #endif
95 
96 #define ZCR_VSYNC_FEEDBACK_V1_DESTROY 0
97 #define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING 1
98 
99 
100 /**
101  * @ingroup iface_zcr_vsync_feedback_v1
102  */
103 #define ZCR_VSYNC_FEEDBACK_V1_DESTROY_SINCE_VERSION 1
104 /**
105  * @ingroup iface_zcr_vsync_feedback_v1
106  */
107 #define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING_SINCE_VERSION 1
108 
109 /** @ingroup iface_zcr_vsync_feedback_v1 */
110 static inline void
zcr_vsync_feedback_v1_set_user_data(struct zcr_vsync_feedback_v1 * zcr_vsync_feedback_v1,void * user_data)111 zcr_vsync_feedback_v1_set_user_data(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1, void *user_data)
112 {
113 	wl_proxy_set_user_data((struct wl_proxy *) zcr_vsync_feedback_v1, user_data);
114 }
115 
116 /** @ingroup iface_zcr_vsync_feedback_v1 */
117 static inline void *
zcr_vsync_feedback_v1_get_user_data(struct zcr_vsync_feedback_v1 * zcr_vsync_feedback_v1)118 zcr_vsync_feedback_v1_get_user_data(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1)
119 {
120 	return wl_proxy_get_user_data((struct wl_proxy *) zcr_vsync_feedback_v1);
121 }
122 
123 static inline uint32_t
zcr_vsync_feedback_v1_get_version(struct zcr_vsync_feedback_v1 * zcr_vsync_feedback_v1)124 zcr_vsync_feedback_v1_get_version(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1)
125 {
126 	return wl_proxy_get_version((struct wl_proxy *) zcr_vsync_feedback_v1);
127 }
128 
129 /**
130  * @ingroup iface_zcr_vsync_feedback_v1
131  *
132  * Destroy this vsync feedback object. Existing vsync timing objects shall
133  * not be affected by this request.
134  */
135 static inline void
zcr_vsync_feedback_v1_destroy(struct zcr_vsync_feedback_v1 * zcr_vsync_feedback_v1)136 zcr_vsync_feedback_v1_destroy(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1)
137 {
138 	wl_proxy_marshal_flags((struct wl_proxy *) zcr_vsync_feedback_v1,
139 			 ZCR_VSYNC_FEEDBACK_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_vsync_feedback_v1), WL_MARSHAL_FLAG_DESTROY);
140 }
141 
142 /**
143  * @ingroup iface_zcr_vsync_feedback_v1
144  *
145  * Create a new vsync timing object that represents a subscription to
146  * vertical synchronization timing updates of given wl_output object.
147  *
148  * The newly created object will immediately signal an update to notify
149  * the subscriber of initial timing parameters.
150  */
151 static inline struct zcr_vsync_timing_v1 *
zcr_vsync_feedback_v1_get_vsync_timing(struct zcr_vsync_feedback_v1 * zcr_vsync_feedback_v1,struct wl_output * output)152 zcr_vsync_feedback_v1_get_vsync_timing(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1, struct wl_output *output)
153 {
154 	struct wl_proxy *id;
155 
156 	id = wl_proxy_marshal_flags((struct wl_proxy *) zcr_vsync_feedback_v1,
157 			 ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING, &zcr_vsync_timing_v1_interface, wl_proxy_get_version((struct wl_proxy *) zcr_vsync_feedback_v1), 0, NULL, output);
158 
159 	return (struct zcr_vsync_timing_v1 *) id;
160 }
161 
162 /**
163  * @ingroup iface_zcr_vsync_timing_v1
164  * @struct zcr_vsync_timing_v1_listener
165  */
166 struct zcr_vsync_timing_v1_listener {
167 	/**
168 	 * vsync timing updated
169 	 *
170 	 * Notifies client that vertical synchronization timing of given
171 	 * wl_output has changed.
172 	 *
173 	 * Timing information consists of two data, timebase and interval.
174 	 * Timebase is an absolute timestamp of the vsync event that caused
175 	 * the timing to change. Interval is a period of time between
176 	 * subsequent vsync events.
177 	 *
178 	 * The unit of all above mentioned time values shall be
179 	 * microseconds and absolute timestamps should match the realm of
180 	 * the primary system monotonic counter, i.e. the POSIX
181 	 * clock_gettime(CLOCK_MONOTONIC). Data type of both values is
182 	 * defined to be a 64-bit unsigned integer, but since the biggest
183 	 * unsigned integer datatype defined by the Wayland protocol is the
184 	 * 32-bit uint, both timebase and interval are split into most
185 	 * significant and least significant part, suffixed by "_h" and
186 	 * "_l" respectively.
187 	 * @param timebase_l new vsync timebase (lower 32 bits)
188 	 * @param timebase_h new vsync timebase (upper 32 bits)
189 	 * @param interval_l new vsync interval (lower 32 bits)
190 	 * @param interval_h new vsync interval (upper 32 bits)
191 	 */
192 	void (*update)(void *data,
193 		       struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1,
194 		       uint32_t timebase_l,
195 		       uint32_t timebase_h,
196 		       uint32_t interval_l,
197 		       uint32_t interval_h);
198 };
199 
200 /**
201  * @ingroup iface_zcr_vsync_timing_v1
202  */
203 static inline int
zcr_vsync_timing_v1_add_listener(struct zcr_vsync_timing_v1 * zcr_vsync_timing_v1,const struct zcr_vsync_timing_v1_listener * listener,void * data)204 zcr_vsync_timing_v1_add_listener(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1,
205 				 const struct zcr_vsync_timing_v1_listener *listener, void *data)
206 {
207 	return wl_proxy_add_listener((struct wl_proxy *) zcr_vsync_timing_v1,
208 				     (void (**)(void)) listener, data);
209 }
210 
211 #define ZCR_VSYNC_TIMING_V1_DESTROY 0
212 
213 /**
214  * @ingroup iface_zcr_vsync_timing_v1
215  */
216 #define ZCR_VSYNC_TIMING_V1_UPDATE_SINCE_VERSION 1
217 
218 /**
219  * @ingroup iface_zcr_vsync_timing_v1
220  */
221 #define ZCR_VSYNC_TIMING_V1_DESTROY_SINCE_VERSION 1
222 
223 /** @ingroup iface_zcr_vsync_timing_v1 */
224 static inline void
zcr_vsync_timing_v1_set_user_data(struct zcr_vsync_timing_v1 * zcr_vsync_timing_v1,void * user_data)225 zcr_vsync_timing_v1_set_user_data(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1, void *user_data)
226 {
227 	wl_proxy_set_user_data((struct wl_proxy *) zcr_vsync_timing_v1, user_data);
228 }
229 
230 /** @ingroup iface_zcr_vsync_timing_v1 */
231 static inline void *
zcr_vsync_timing_v1_get_user_data(struct zcr_vsync_timing_v1 * zcr_vsync_timing_v1)232 zcr_vsync_timing_v1_get_user_data(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1)
233 {
234 	return wl_proxy_get_user_data((struct wl_proxy *) zcr_vsync_timing_v1);
235 }
236 
237 static inline uint32_t
zcr_vsync_timing_v1_get_version(struct zcr_vsync_timing_v1 * zcr_vsync_timing_v1)238 zcr_vsync_timing_v1_get_version(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1)
239 {
240 	return wl_proxy_get_version((struct wl_proxy *) zcr_vsync_timing_v1);
241 }
242 
243 /**
244  * @ingroup iface_zcr_vsync_timing_v1
245  *
246  * Destroy this vsync timing object.
247  */
248 static inline void
zcr_vsync_timing_v1_destroy(struct zcr_vsync_timing_v1 * zcr_vsync_timing_v1)249 zcr_vsync_timing_v1_destroy(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1)
250 {
251 	wl_proxy_marshal_flags((struct wl_proxy *) zcr_vsync_timing_v1,
252 			 ZCR_VSYNC_TIMING_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zcr_vsync_timing_v1), WL_MARSHAL_FLAG_DESTROY);
253 }
254 
255 #ifdef  __cplusplus
256 }
257 #endif
258 
259 #endif
260