1 /* Generated by wayland-scanner 1.18.0 */
3 #ifndef RELATIVE_POINTER_UNSTABLE_V1_CLIENT_PROTOCOL_H
4 #define RELATIVE_POINTER_UNSTABLE_V1_CLIENT_PROTOCOL_H
8 #include "wayland-client.h"
15 * @page page_relative_pointer_unstable_v1 The relative_pointer_unstable_v1
16 * protocol protocol for relative pointer motion events
18 * @section page_desc_relative_pointer_unstable_v1 Description
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).
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.
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
43 * @section page_ifaces_relative_pointer_unstable_v1 Interfaces
44 * - @subpage page_iface_zwp_relative_pointer_manager_v1 - get relative pointer
46 * - @subpage page_iface_zwp_relative_pointer_v1 - relative pointer object
47 * @section page_copyright_relative_pointer_unstable_v1 Copyright
50 * Copyright © 2014 Jonas Ådahl
51 * Copyright © 2015 Red Hat Inc.
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:
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
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.
74 struct zwp_relative_pointer_manager_v1
;
75 struct zwp_relative_pointer_v1
;
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
82 * A global interface used for getting the relative pointer object for a
84 * @section page_iface_zwp_relative_pointer_manager_v1_api API
85 * See @ref iface_zwp_relative_pointer_manager_v1.
88 * @defgroup iface_zwp_relative_pointer_manager_v1 The
89 * zwp_relative_pointer_manager_v1 interface
91 * A global interface used for getting the relative pointer object for a
94 extern const struct wl_interface zwp_relative_pointer_manager_v1_interface
;
96 * @page page_iface_zwp_relative_pointer_v1 zwp_relative_pointer_v1
97 * @section page_iface_zwp_relative_pointer_v1_desc Description
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
103 * @section page_iface_zwp_relative_pointer_v1_api API
104 * See @ref iface_zwp_relative_pointer_v1.
107 * @defgroup iface_zwp_relative_pointer_v1 The zwp_relative_pointer_v1 interface
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
114 extern const struct wl_interface zwp_relative_pointer_v1_interface
;
116 #define ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY 0
117 #define ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER 1
120 * @ingroup iface_zwp_relative_pointer_manager_v1
122 #define ZWP_RELATIVE_POINTER_MANAGER_V1_DESTROY_SINCE_VERSION 1
124 * @ingroup iface_zwp_relative_pointer_manager_v1
126 #define ZWP_RELATIVE_POINTER_MANAGER_V1_GET_RELATIVE_POINTER_SINCE_VERSION 1
128 /** @ingroup iface_zwp_relative_pointer_manager_v1 */
129 static inline void zwp_relative_pointer_manager_v1_set_user_data(
130 struct zwp_relative_pointer_manager_v1
* zwp_relative_pointer_manager_v1
,
132 wl_proxy_set_user_data((struct wl_proxy
*)zwp_relative_pointer_manager_v1
,
136 /** @ingroup iface_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
);
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
);
150 * @ingroup iface_zwp_relative_pointer_manager_v1
152 * Used by the client to notify the server that it will no longer use this
153 * relative pointer manager object.
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
);
160 wl_proxy_destroy((struct wl_proxy
*)zwp_relative_pointer_manager_v1
);
164 * @ingroup iface_zwp_relative_pointer_manager_v1
166 * Create a relative pointer interface given a wl_pointer object. See the
167 * wp_relative_pointer interface for more details.
169 static inline struct zwp_relative_pointer_v1
*
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
) {
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
);
180 return (struct zwp_relative_pointer_v1
*)id
;
184 * @ingroup iface_zwp_relative_pointer_v1
185 * @struct zwp_relative_pointer_v1_listener
187 struct zwp_relative_pointer_v1_listener
{
189 * relative pointer motion
191 * Relative x/y pointer motion from the pointer of the seat
192 * associated with this object.
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
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.
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.
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.
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
226 * @param utime_lo low 32 bits of a 64 bit timestamp with microsecond
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
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
);
240 * @ingroup iface_zwp_relative_pointer_v1
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
);
249 #define ZWP_RELATIVE_POINTER_V1_DESTROY 0
252 * @ingroup iface_zwp_relative_pointer_v1
254 #define ZWP_RELATIVE_POINTER_V1_RELATIVE_MOTION_SINCE_VERSION 1
257 * @ingroup iface_zwp_relative_pointer_v1
259 #define ZWP_RELATIVE_POINTER_V1_DESTROY_SINCE_VERSION 1
261 /** @ingroup iface_zwp_relative_pointer_v1 */
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
);
267 /** @ingroup iface_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
);
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
);
279 * @ingroup iface_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
);
286 wl_proxy_destroy((struct wl_proxy
*)zwp_relative_pointer_v1
);