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