1 /* Generated by wayland-scanner 1.22.0 */
2 
3 #ifndef RELATIVE_POINTER_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define RELATIVE_POINTER_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_relative_pointer_unstable_v1 The relative_pointer_unstable_v1 protocol
16  * protocol for relative pointer motion events
17  *
18  * @section page_desc_relative_pointer_unstable_v1 Description
19  *
20  * This protocol specifies a set of interfaces used for making clients able to
21  * receive relative pointer events not obstructed by barriers (such as the
22  * monitor edge or other pointer barriers).
23  *
24  * To start receiving relative pointer events, a client must first bind the
25  * global interface "wp_relative_pointer_manager" which, if a compositor
26  * supports relative pointer motion events, is exposed by the registry. After
27  * having created the relative pointer manager proxy object, the client uses
28  * it to create the actual relative pointer object using the
29  * "get_relative_pointer" request given a wl_pointer. The relative pointer
30  * motion events will then, when applicable, be transmitted via the proxy of
31  * the newly created relative pointer object. See the documentation of the
32  * relative pointer interface for more details.
33  *
34  * Warning! The protocol described in this file is experimental and backward
35  * incompatible changes may be made. Backward compatible changes may be added
36  * together with the corresponding interface version bump. Backward
37  * incompatible changes are done by bumping the version number in the protocol
38  * and interface names and resetting the interface version. Once the protocol
39  * is to be declared stable, the 'z' prefix and the version number in the
40  * protocol and interface names are removed and the interface version number is
41  * reset.
42  *
43  * @section page_ifaces_relative_pointer_unstable_v1 Interfaces
44  * - @subpage page_iface_zwp_relative_pointer_manager_v1 - get relative pointer objects
45  * - @subpage page_iface_zwp_relative_pointer_v1 - relative pointer object
46  * @section page_copyright_relative_pointer_unstable_v1 Copyright
47  * <pre>
48  *
49  * Copyright © 2014      Jonas Ådahl
50  * Copyright © 2015      Red Hat Inc.
51  *
52  * Permission is hereby granted, free of charge, to any person obtaining a
53  * copy of this software and associated documentation files (the "Software"),
54  * to deal in the Software without restriction, including without limitation
55  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
56  * and/or sell copies of the Software, and to permit persons to whom the
57  * Software is furnished to do so, subject to the following conditions:
58  *
59  * The above copyright notice and this permission notice (including the next
60  * paragraph) shall be included in all copies or substantial portions of the
61  * Software.
62  *
63  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
66  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
68  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
69  * DEALINGS IN THE SOFTWARE.
70  * </pre>
71  */
72 struct wl_pointer;
73 struct zwp_relative_pointer_manager_v1;
74 struct zwp_relative_pointer_v1;
75 
76 #ifndef ZWP_RELATIVE_POINTER_MANAGER_V1_INTERFACE
77 #define ZWP_RELATIVE_POINTER_MANAGER_V1_INTERFACE
78 /**
79  * @page page_iface_zwp_relative_pointer_manager_v1 zwp_relative_pointer_manager_v1
80  * @section page_iface_zwp_relative_pointer_manager_v1_desc Description
81  *
82  * A global interface used for getting the relative pointer object for a
83  * given pointer.
84  * @section page_iface_zwp_relative_pointer_manager_v1_api API
85  * See @ref iface_zwp_relative_pointer_manager_v1.
86  */
87 /**
88  * @defgroup iface_zwp_relative_pointer_manager_v1 The zwp_relative_pointer_manager_v1 interface
89  *
90  * A global interface used for getting the relative pointer object for a
91  * given pointer.
92  */
93 extern const struct wl_interface zwp_relative_pointer_manager_v1_interface;
94 #endif
95 #ifndef ZWP_RELATIVE_POINTER_V1_INTERFACE
96 #define ZWP_RELATIVE_POINTER_V1_INTERFACE
97 /**
98  * @page page_iface_zwp_relative_pointer_v1 zwp_relative_pointer_v1
99  * @section page_iface_zwp_relative_pointer_v1_desc Description
100  *
101  * A wp_relative_pointer object is an extension to the wl_pointer interface
102  * used for emitting relative pointer events. It shares the same focus as
103  * wl_pointer objects of the same seat and will only emit events when it has
104  * focus.
105  * @section page_iface_zwp_relative_pointer_v1_api API
106  * See @ref iface_zwp_relative_pointer_v1.
107  */
108 /**
109  * @defgroup iface_zwp_relative_pointer_v1 The zwp_relative_pointer_v1 interface
110  *
111  * A wp_relative_pointer object is an extension to the wl_pointer interface
112  * used for emitting relative pointer events. It shares the same focus as
113  * wl_pointer objects of the same seat and will only emit events when it has
114  * focus.
115  */
116 extern const struct wl_interface zwp_relative_pointer_v1_interface;
117 #endif
118 
119 #define ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY 0
120 #define ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER 1
121 
122 
123 /**
124  * @ingroup iface_zwp_relative_pointer_manager_v1
125  */
126 #define ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY_SINCE_VERSION 1
127 /**
128  * @ingroup iface_zwp_relative_pointer_manager_v1
129  */
130 #define ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER_SINCE_VERSION 1
131 
132 /** @ingroup iface_zwp_relative_pointer_manager_v1 */
133 static inline void
zwp_relative_pointer_manager_v1_set_user_data(struct zwp_relative_pointer_manager_v1 * zwp_relative_pointer_manager_v1,void * user_data)134 zwp_relative_pointer_manager_v1_set_user_data(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1, void *user_data)
135 {
136 	wl_proxy_set_user_data((struct wl_proxy *) zwp_relative_pointer_manager_v1, user_data);
137 }
138 
139 /** @ingroup iface_zwp_relative_pointer_manager_v1 */
140 static inline void *
zwp_relative_pointer_manager_v1_get_user_data(struct zwp_relative_pointer_manager_v1 * zwp_relative_pointer_manager_v1)141 zwp_relative_pointer_manager_v1_get_user_data(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1)
142 {
143 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_relative_pointer_manager_v1);
144 }
145 
146 static inline uint32_t
zwp_relative_pointer_manager_v1_get_version(struct zwp_relative_pointer_manager_v1 * zwp_relative_pointer_manager_v1)147 zwp_relative_pointer_manager_v1_get_version(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1)
148 {
149 	return wl_proxy_get_version((struct wl_proxy *) zwp_relative_pointer_manager_v1);
150 }
151 
152 /**
153  * @ingroup iface_zwp_relative_pointer_manager_v1
154  *
155  * Used by the client to notify the server that it will no longer use this
156  * relative pointer manager object.
157  */
158 static inline void
zwp_relative_pointer_manager_v1_destroy(struct zwp_relative_pointer_manager_v1 * zwp_relative_pointer_manager_v1)159 zwp_relative_pointer_manager_v1_destroy(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1)
160 {
161 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_relative_pointer_manager_v1,
162 			 ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_relative_pointer_manager_v1), WL_MARSHAL_FLAG_DESTROY);
163 }
164 
165 /**
166  * @ingroup iface_zwp_relative_pointer_manager_v1
167  *
168  * Create a relative pointer interface given a wl_pointer object. See the
169  * wp_relative_pointer interface for more details.
170  */
171 static inline struct zwp_relative_pointer_v1 *
zwp_relative_pointer_manager_v1_get_relative_pointer(struct zwp_relative_pointer_manager_v1 * zwp_relative_pointer_manager_v1,struct wl_pointer * pointer)172 zwp_relative_pointer_manager_v1_get_relative_pointer(struct zwp_relative_pointer_manager_v1 *zwp_relative_pointer_manager_v1, struct wl_pointer *pointer)
173 {
174 	struct wl_proxy *id;
175 
176 	id = wl_proxy_marshal_flags((struct wl_proxy *) zwp_relative_pointer_manager_v1,
177 			 ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER, &zwp_relative_pointer_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwp_relative_pointer_manager_v1), 0, NULL, pointer);
178 
179 	return (struct zwp_relative_pointer_v1 *) id;
180 }
181 
182 /**
183  * @ingroup iface_zwp_relative_pointer_v1
184  * @struct zwp_relative_pointer_v1_listener
185  */
186 struct zwp_relative_pointer_v1_listener {
187 	/**
188 	 * relative pointer motion
189 	 *
190 	 * Relative x/y pointer motion from the pointer of the seat
191 	 * associated with this object.
192 	 *
193 	 * A relative motion is in the same dimension as regular wl_pointer
194 	 * motion events, except they do not represent an absolute
195 	 * position. For example, moving a pointer from (x, y) to (x', y')
196 	 * would have the equivalent relative motion (x' - x, y' - y). If a
197 	 * pointer motion caused the absolute pointer position to be
198 	 * clipped by for example the edge of the monitor, the relative
199 	 * motion is unaffected by the clipping and will represent the
200 	 * unclipped motion.
201 	 *
202 	 * This event also contains non-accelerated motion deltas. The
203 	 * non-accelerated delta is, when applicable, the regular pointer
204 	 * motion delta as it was before having applied motion acceleration
205 	 * and other transformations such as normalization.
206 	 *
207 	 * Note that the non-accelerated delta does not represent 'raw'
208 	 * events as they were read from some device. Pointer motion
209 	 * acceleration is device- and configuration-specific and
210 	 * non-accelerated deltas and accelerated deltas may have the same
211 	 * value on some devices.
212 	 *
213 	 * Relative motions are not coupled to wl_pointer.motion events,
214 	 * and can be sent in combination with such events, but also
215 	 * independently. There may also be scenarios where
216 	 * wl_pointer.motion is sent, but there is no relative motion. The
217 	 * order of an absolute and relative motion event originating from
218 	 * the same physical motion is not guaranteed.
219 	 *
220 	 * If the client needs button events or focus state, it can receive
221 	 * them from a wl_pointer object of the same seat that the
222 	 * wp_relative_pointer object is associated with.
223 	 * @param utime_hi high 32 bits of a 64 bit timestamp with microsecond granularity
224 	 * @param utime_lo low 32 bits of a 64 bit timestamp with microsecond granularity
225 	 * @param dx the x component of the motion vector
226 	 * @param dy the y component of the motion vector
227 	 * @param dx_unaccel the x component of the unaccelerated motion vector
228 	 * @param dy_unaccel the y component of the unaccelerated motion vector
229 	 */
230 	void (*relative_motion)(void *data,
231 				struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1,
232 				uint32_t utime_hi,
233 				uint32_t utime_lo,
234 				wl_fixed_t dx,
235 				wl_fixed_t dy,
236 				wl_fixed_t dx_unaccel,
237 				wl_fixed_t dy_unaccel);
238 };
239 
240 /**
241  * @ingroup iface_zwp_relative_pointer_v1
242  */
243 static inline int
zwp_relative_pointer_v1_add_listener(struct zwp_relative_pointer_v1 * zwp_relative_pointer_v1,const struct zwp_relative_pointer_v1_listener * listener,void * data)244 zwp_relative_pointer_v1_add_listener(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1,
245 				     const struct zwp_relative_pointer_v1_listener *listener, void *data)
246 {
247 	return wl_proxy_add_listener((struct wl_proxy *) zwp_relative_pointer_v1,
248 				     (void (**)(void)) listener, data);
249 }
250 
251 #define ZWP_RELATIVE_POINTER_V1_DESTROY 0
252 
253 /**
254  * @ingroup iface_zwp_relative_pointer_v1
255  */
256 #define ZWP_RELATIVE_POINTER_V1_RELATIVE_MOTION_SINCE_VERSION 1
257 
258 /**
259  * @ingroup iface_zwp_relative_pointer_v1
260  */
261 #define ZWP_RELATIVE_POINTER_V1_DESTROY_SINCE_VERSION 1
262 
263 /** @ingroup iface_zwp_relative_pointer_v1 */
264 static inline void
zwp_relative_pointer_v1_set_user_data(struct zwp_relative_pointer_v1 * zwp_relative_pointer_v1,void * user_data)265 zwp_relative_pointer_v1_set_user_data(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1, void *user_data)
266 {
267 	wl_proxy_set_user_data((struct wl_proxy *) zwp_relative_pointer_v1, user_data);
268 }
269 
270 /** @ingroup iface_zwp_relative_pointer_v1 */
271 static inline void *
zwp_relative_pointer_v1_get_user_data(struct zwp_relative_pointer_v1 * zwp_relative_pointer_v1)272 zwp_relative_pointer_v1_get_user_data(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1)
273 {
274 	return wl_proxy_get_user_data((struct wl_proxy *) zwp_relative_pointer_v1);
275 }
276 
277 static inline uint32_t
zwp_relative_pointer_v1_get_version(struct zwp_relative_pointer_v1 * zwp_relative_pointer_v1)278 zwp_relative_pointer_v1_get_version(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1)
279 {
280 	return wl_proxy_get_version((struct wl_proxy *) zwp_relative_pointer_v1);
281 }
282 
283 /**
284  * @ingroup iface_zwp_relative_pointer_v1
285  */
286 static inline void
zwp_relative_pointer_v1_destroy(struct zwp_relative_pointer_v1 * zwp_relative_pointer_v1)287 zwp_relative_pointer_v1_destroy(struct zwp_relative_pointer_v1 *zwp_relative_pointer_v1)
288 {
289 	wl_proxy_marshal_flags((struct wl_proxy *) zwp_relative_pointer_v1,
290 			 ZWP_RELATIVE_POINTER_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwp_relative_pointer_v1), WL_MARSHAL_FLAG_DESTROY);
291 }
292 
293 #ifdef  __cplusplus
294 }
295 #endif
296 
297 #endif
298