SDL 2.0
xdg-shell-client-protocol.h
Go to the documentation of this file.
1/* Generated by wayland-scanner 1.20.0 */
2
3#ifndef XDG_SHELL_CLIENT_PROTOCOL_H
4#define XDG_SHELL_CLIENT_PROTOCOL_H
5
6#include <stdint.h>
7#include <stddef.h>
8#include "wayland-client.h"
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/**
15 * @page page_xdg_shell The xdg_shell protocol
16 * @section page_ifaces_xdg_shell Interfaces
17 * - @subpage page_iface_xdg_wm_base - create desktop-style surfaces
18 * - @subpage page_iface_xdg_positioner - child surface positioner
19 * - @subpage page_iface_xdg_surface - desktop user interface surface base interface
20 * - @subpage page_iface_xdg_toplevel - toplevel surface
21 * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus
22 * @section page_copyright_xdg_shell Copyright
23 * <pre>
24 *
25 * Copyright © 2008-2013 Kristian Høgsberg
26 * Copyright © 2013 Rafael Antognolli
27 * Copyright © 2013 Jasper St. Pierre
28 * Copyright © 2010-2013 Intel Corporation
29 * Copyright © 2015-2017 Samsung Electronics Co., Ltd
30 * Copyright © 2015-2017 Red Hat Inc.
31 *
32 * Permission is hereby granted, free of charge, to any person obtaining a
33 * copy of this software and associated documentation files (the "Software"),
34 * to deal in the Software without restriction, including without limitation
35 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
36 * and/or sell copies of the Software, and to permit persons to whom the
37 * Software is furnished to do so, subject to the following conditions:
38 *
39 * The above copyright notice and this permission notice (including the next
40 * paragraph) shall be included in all copies or substantial portions of the
41 * Software.
42 *
43 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
44 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
46 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
47 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
48 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
49 * DEALINGS IN THE SOFTWARE.
50 * </pre>
51 */
52struct wl_output;
53struct wl_seat;
54struct wl_surface;
55struct xdg_popup;
56struct xdg_positioner;
57struct xdg_surface;
58struct xdg_toplevel;
59struct xdg_wm_base;
60
61#ifndef XDG_WM_BASE_INTERFACE
62#define XDG_WM_BASE_INTERFACE
63/**
64 * @page page_iface_xdg_wm_base xdg_wm_base
65 * @section page_iface_xdg_wm_base_desc Description
66 *
67 * The xdg_wm_base interface is exposed as a global object enabling clients
68 * to turn their wl_surfaces into windows in a desktop environment. It
69 * defines the basic functionality needed for clients and the compositor to
70 * create windows that can be dragged, resized, maximized, etc, as well as
71 * creating transient windows such as popup menus.
72 * @section page_iface_xdg_wm_base_api API
73 * See @ref iface_xdg_wm_base.
74 */
75/**
76 * @defgroup iface_xdg_wm_base The xdg_wm_base interface
77 *
78 * The xdg_wm_base interface is exposed as a global object enabling clients
79 * to turn their wl_surfaces into windows in a desktop environment. It
80 * defines the basic functionality needed for clients and the compositor to
81 * create windows that can be dragged, resized, maximized, etc, as well as
82 * creating transient windows such as popup menus.
83 */
84extern const struct wl_interface xdg_wm_base_interface;
85#endif
86#ifndef XDG_POSITIONER_INTERFACE
87#define XDG_POSITIONER_INTERFACE
88/**
89 * @page page_iface_xdg_positioner xdg_positioner
90 * @section page_iface_xdg_positioner_desc Description
91 *
92 * The xdg_positioner provides a collection of rules for the placement of a
93 * child surface relative to a parent surface. Rules can be defined to ensure
94 * the child surface remains within the visible area's borders, and to
95 * specify how the child surface changes its position, such as sliding along
96 * an axis, or flipping around a rectangle. These positioner-created rules are
97 * constrained by the requirement that a child surface must intersect with or
98 * be at least partially adjacent to its parent surface.
99 *
100 * See the various requests for details about possible rules.
101 *
102 * At the time of the request, the compositor makes a copy of the rules
103 * specified by the xdg_positioner. Thus, after the request is complete the
104 * xdg_positioner object can be destroyed or reused; further changes to the
105 * object will have no effect on previous usages.
106 *
107 * For an xdg_positioner object to be considered complete, it must have a
108 * non-zero size set by set_size, and a non-zero anchor rectangle set by
109 * set_anchor_rect. Passing an incomplete xdg_positioner object when
110 * positioning a surface raises an error.
111 * @section page_iface_xdg_positioner_api API
112 * See @ref iface_xdg_positioner.
113 */
114/**
115 * @defgroup iface_xdg_positioner The xdg_positioner interface
116 *
117 * The xdg_positioner provides a collection of rules for the placement of a
118 * child surface relative to a parent surface. Rules can be defined to ensure
119 * the child surface remains within the visible area's borders, and to
120 * specify how the child surface changes its position, such as sliding along
121 * an axis, or flipping around a rectangle. These positioner-created rules are
122 * constrained by the requirement that a child surface must intersect with or
123 * be at least partially adjacent to its parent surface.
124 *
125 * See the various requests for details about possible rules.
126 *
127 * At the time of the request, the compositor makes a copy of the rules
128 * specified by the xdg_positioner. Thus, after the request is complete the
129 * xdg_positioner object can be destroyed or reused; further changes to the
130 * object will have no effect on previous usages.
131 *
132 * For an xdg_positioner object to be considered complete, it must have a
133 * non-zero size set by set_size, and a non-zero anchor rectangle set by
134 * set_anchor_rect. Passing an incomplete xdg_positioner object when
135 * positioning a surface raises an error.
136 */
137extern const struct wl_interface xdg_positioner_interface;
138#endif
139#ifndef XDG_SURFACE_INTERFACE
140#define XDG_SURFACE_INTERFACE
141/**
142 * @page page_iface_xdg_surface xdg_surface
143 * @section page_iface_xdg_surface_desc Description
144 *
145 * An interface that may be implemented by a wl_surface, for
146 * implementations that provide a desktop-style user interface.
147 *
148 * It provides a base set of functionality required to construct user
149 * interface elements requiring management by the compositor, such as
150 * toplevel windows, menus, etc. The types of functionality are split into
151 * xdg_surface roles.
152 *
153 * Creating an xdg_surface does not set the role for a wl_surface. In order
154 * to map an xdg_surface, the client must create a role-specific object
155 * using, e.g., get_toplevel, get_popup. The wl_surface for any given
156 * xdg_surface can have at most one role, and may not be assigned any role
157 * not based on xdg_surface.
158 *
159 * A role must be assigned before any other requests are made to the
160 * xdg_surface object.
161 *
162 * The client must call wl_surface.commit on the corresponding wl_surface
163 * for the xdg_surface state to take effect.
164 *
165 * Creating an xdg_surface from a wl_surface which has a buffer attached or
166 * committed is a client error, and any attempts by a client to attach or
167 * manipulate a buffer prior to the first xdg_surface.configure call must
168 * also be treated as errors.
169 *
170 * Mapping an xdg_surface-based role surface is defined as making it
171 * possible for the surface to be shown by the compositor. Note that
172 * a mapped surface is not guaranteed to be visible once it is mapped.
173 *
174 * For an xdg_surface to be mapped by the compositor, the following
175 * conditions must be met:
176 * (1) the client has assigned an xdg_surface-based role to the surface
177 * (2) the client has set and committed the xdg_surface state and the
178 * role-dependent state to the surface
179 * (3) the client has committed a buffer to the surface
180 *
181 * A newly-unmapped surface is considered to have met condition (1) out
182 * of the 3 required conditions for mapping a surface if its role surface
183 * has not been destroyed.
184 * @section page_iface_xdg_surface_api API
185 * See @ref iface_xdg_surface.
186 */
187/**
188 * @defgroup iface_xdg_surface The xdg_surface interface
189 *
190 * An interface that may be implemented by a wl_surface, for
191 * implementations that provide a desktop-style user interface.
192 *
193 * It provides a base set of functionality required to construct user
194 * interface elements requiring management by the compositor, such as
195 * toplevel windows, menus, etc. The types of functionality are split into
196 * xdg_surface roles.
197 *
198 * Creating an xdg_surface does not set the role for a wl_surface. In order
199 * to map an xdg_surface, the client must create a role-specific object
200 * using, e.g., get_toplevel, get_popup. The wl_surface for any given
201 * xdg_surface can have at most one role, and may not be assigned any role
202 * not based on xdg_surface.
203 *
204 * A role must be assigned before any other requests are made to the
205 * xdg_surface object.
206 *
207 * The client must call wl_surface.commit on the corresponding wl_surface
208 * for the xdg_surface state to take effect.
209 *
210 * Creating an xdg_surface from a wl_surface which has a buffer attached or
211 * committed is a client error, and any attempts by a client to attach or
212 * manipulate a buffer prior to the first xdg_surface.configure call must
213 * also be treated as errors.
214 *
215 * Mapping an xdg_surface-based role surface is defined as making it
216 * possible for the surface to be shown by the compositor. Note that
217 * a mapped surface is not guaranteed to be visible once it is mapped.
218 *
219 * For an xdg_surface to be mapped by the compositor, the following
220 * conditions must be met:
221 * (1) the client has assigned an xdg_surface-based role to the surface
222 * (2) the client has set and committed the xdg_surface state and the
223 * role-dependent state to the surface
224 * (3) the client has committed a buffer to the surface
225 *
226 * A newly-unmapped surface is considered to have met condition (1) out
227 * of the 3 required conditions for mapping a surface if its role surface
228 * has not been destroyed.
229 */
230extern const struct wl_interface xdg_surface_interface;
231#endif
232#ifndef XDG_TOPLEVEL_INTERFACE
233#define XDG_TOPLEVEL_INTERFACE
234/**
235 * @page page_iface_xdg_toplevel xdg_toplevel
236 * @section page_iface_xdg_toplevel_desc Description
237 *
238 * This interface defines an xdg_surface role which allows a surface to,
239 * among other things, set window-like properties such as maximize,
240 * fullscreen, and minimize, set application-specific metadata like title and
241 * id, and well as trigger user interactive operations such as interactive
242 * resize and move.
243 *
244 * Unmapping an xdg_toplevel means that the surface cannot be shown
245 * by the compositor until it is explicitly mapped again.
246 * All active operations (e.g., move, resize) are canceled and all
247 * attributes (e.g. title, state, stacking, ...) are discarded for
248 * an xdg_toplevel surface when it is unmapped.
249 *
250 * Attaching a null buffer to a toplevel unmaps the surface.
251 * @section page_iface_xdg_toplevel_api API
252 * See @ref iface_xdg_toplevel.
253 */
254/**
255 * @defgroup iface_xdg_toplevel The xdg_toplevel interface
256 *
257 * This interface defines an xdg_surface role which allows a surface to,
258 * among other things, set window-like properties such as maximize,
259 * fullscreen, and minimize, set application-specific metadata like title and
260 * id, and well as trigger user interactive operations such as interactive
261 * resize and move.
262 *
263 * Unmapping an xdg_toplevel means that the surface cannot be shown
264 * by the compositor until it is explicitly mapped again.
265 * All active operations (e.g., move, resize) are canceled and all
266 * attributes (e.g. title, state, stacking, ...) are discarded for
267 * an xdg_toplevel surface when it is unmapped.
268 *
269 * Attaching a null buffer to a toplevel unmaps the surface.
270 */
271extern const struct wl_interface xdg_toplevel_interface;
272#endif
273#ifndef XDG_POPUP_INTERFACE
274#define XDG_POPUP_INTERFACE
275/**
276 * @page page_iface_xdg_popup xdg_popup
277 * @section page_iface_xdg_popup_desc Description
278 *
279 * A popup surface is a short-lived, temporary surface. It can be used to
280 * implement for example menus, popovers, tooltips and other similar user
281 * interface concepts.
282 *
283 * A popup can be made to take an explicit grab. See xdg_popup.grab for
284 * details.
285 *
286 * When the popup is dismissed, a popup_done event will be sent out, and at
287 * the same time the surface will be unmapped. See the xdg_popup.popup_done
288 * event for details.
289 *
290 * Explicitly destroying the xdg_popup object will also dismiss the popup and
291 * unmap the surface. Clients that want to dismiss the popup when another
292 * surface of their own is clicked should dismiss the popup using the destroy
293 * request.
294 *
295 * The parent surface must have either the xdg_toplevel or xdg_popup surface
296 * role.
297 *
298 * A newly created xdg_popup will be stacked on top of all previously created
299 * xdg_popup surfaces associated with the same xdg_toplevel.
300 *
301 * The parent of an xdg_popup must be mapped (see the xdg_surface
302 * description) before the xdg_popup itself.
303 *
304 * The x and y arguments passed when creating the popup object specify
305 * where the top left of the popup should be placed, relative to the
306 * local surface coordinates of the parent surface. See
307 * xdg_surface.get_popup. An xdg_popup must intersect with or be at least
308 * partially adjacent to its parent surface.
309 *
310 * The client must call wl_surface.commit on the corresponding wl_surface
311 * for the xdg_popup state to take effect.
312 * @section page_iface_xdg_popup_api API
313 * See @ref iface_xdg_popup.
314 */
315/**
316 * @defgroup iface_xdg_popup The xdg_popup interface
317 *
318 * A popup surface is a short-lived, temporary surface. It can be used to
319 * implement for example menus, popovers, tooltips and other similar user
320 * interface concepts.
321 *
322 * A popup can be made to take an explicit grab. See xdg_popup.grab for
323 * details.
324 *
325 * When the popup is dismissed, a popup_done event will be sent out, and at
326 * the same time the surface will be unmapped. See the xdg_popup.popup_done
327 * event for details.
328 *
329 * Explicitly destroying the xdg_popup object will also dismiss the popup and
330 * unmap the surface. Clients that want to dismiss the popup when another
331 * surface of their own is clicked should dismiss the popup using the destroy
332 * request.
333 *
334 * The parent surface must have either the xdg_toplevel or xdg_popup surface
335 * role.
336 *
337 * A newly created xdg_popup will be stacked on top of all previously created
338 * xdg_popup surfaces associated with the same xdg_toplevel.
339 *
340 * The parent of an xdg_popup must be mapped (see the xdg_surface
341 * description) before the xdg_popup itself.
342 *
343 * The x and y arguments passed when creating the popup object specify
344 * where the top left of the popup should be placed, relative to the
345 * local surface coordinates of the parent surface. See
346 * xdg_surface.get_popup. An xdg_popup must intersect with or be at least
347 * partially adjacent to its parent surface.
348 *
349 * The client must call wl_surface.commit on the corresponding wl_surface
350 * for the xdg_popup state to take effect.
351 */
352extern const struct wl_interface xdg_popup_interface;
353#endif
354
355#ifndef XDG_WM_BASE_ERROR_ENUM
356#define XDG_WM_BASE_ERROR_ENUM
358 /**
359 * given wl_surface has another role
360 */
362 /**
363 * xdg_wm_base was destroyed before children
364 */
366 /**
367 * the client tried to map or destroy a non-topmost popup
368 */
370 /**
371 * the client specified an invalid popup parent surface
372 */
374 /**
375 * the client provided an invalid surface state
376 */
378 /**
379 * the client provided an invalid positioner
380 */
382};
383#endif /* XDG_WM_BASE_ERROR_ENUM */
384
385/**
386 * @ingroup iface_xdg_wm_base
387 * @struct xdg_wm_base_listener
388 */
390 /**
391 * check if the client is alive
392 *
393 * The ping event asks the client if it's still alive. Pass the
394 * serial specified in the event back to the compositor by sending
395 * a "pong" request back with the specified serial. See
396 * xdg_wm_base.ping.
397 *
398 * Compositors can use this to determine if the client is still
399 * alive. It's unspecified what will happen if the client doesn't
400 * respond to the ping request, or in what timeframe. Clients
401 * should try to respond in a reasonable amount of time.
402 *
403 * A compositor is free to ping in any way it wants, but a client
404 * must always respond to any xdg_wm_base object it created.
405 * @param serial pass this to the pong request
406 */
407 void (*ping)(void *data,
408 struct xdg_wm_base *xdg_wm_base,
409 uint32_t serial);
410};
411
412/**
413 * @ingroup iface_xdg_wm_base
414 */
415static inline int
416xdg_wm_base_add_listener(struct xdg_wm_base *xdg_wm_base,
417 const struct xdg_wm_base_listener *listener, void *data)
418{
419 return wl_proxy_add_listener((struct wl_proxy *) xdg_wm_base,
420 (void (**)(void)) listener, data);
421}
422
423#define XDG_WM_BASE_DESTROY 0
424#define XDG_WM_BASE_CREATE_POSITIONER 1
425#define XDG_WM_BASE_GET_XDG_SURFACE 2
426#define XDG_WM_BASE_PONG 3
427
428/**
429 * @ingroup iface_xdg_wm_base
430 */
431#define XDG_WM_BASE_PING_SINCE_VERSION 1
432
433/**
434 * @ingroup iface_xdg_wm_base
435 */
436#define XDG_WM_BASE_DESTROY_SINCE_VERSION 1
437/**
438 * @ingroup iface_xdg_wm_base
439 */
440#define XDG_WM_BASE_CREATE_POSITIONER_SINCE_VERSION 1
441/**
442 * @ingroup iface_xdg_wm_base
443 */
444#define XDG_WM_BASE_GET_XDG_SURFACE_SINCE_VERSION 1
445/**
446 * @ingroup iface_xdg_wm_base
447 */
448#define XDG_WM_BASE_PONG_SINCE_VERSION 1
449
450/** @ingroup iface_xdg_wm_base */
451static inline void
452xdg_wm_base_set_user_data(struct xdg_wm_base *xdg_wm_base, void *user_data)
453{
454 wl_proxy_set_user_data((struct wl_proxy *) xdg_wm_base, user_data);
455}
456
457/** @ingroup iface_xdg_wm_base */
458static inline void *
459xdg_wm_base_get_user_data(struct xdg_wm_base *xdg_wm_base)
460{
461 return wl_proxy_get_user_data((struct wl_proxy *) xdg_wm_base);
462}
463
464static inline uint32_t
465xdg_wm_base_get_version(struct xdg_wm_base *xdg_wm_base)
466{
467 return wl_proxy_get_version((struct wl_proxy *) xdg_wm_base);
468}
469
470/**
471 * @ingroup iface_xdg_wm_base
472 *
473 * Destroy this xdg_wm_base object.
474 *
475 * Destroying a bound xdg_wm_base object while there are surfaces
476 * still alive created by this xdg_wm_base object instance is illegal
477 * and will result in a protocol error.
478 */
479static inline void
480xdg_wm_base_destroy(struct xdg_wm_base *xdg_wm_base)
481{
482 wl_proxy_marshal_flags((struct wl_proxy *) xdg_wm_base,
483 XDG_WM_BASE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_wm_base), WL_MARSHAL_FLAG_DESTROY);
484}
485
486/**
487 * @ingroup iface_xdg_wm_base
488 *
489 * Create a positioner object. A positioner object is used to position
490 * surfaces relative to some parent surface. See the interface description
491 * and xdg_surface.get_popup for details.
492 */
493static inline struct xdg_positioner *
494xdg_wm_base_create_positioner(struct xdg_wm_base *xdg_wm_base)
495{
496 struct wl_proxy *id;
497
498 id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_wm_base,
499 XDG_WM_BASE_CREATE_POSITIONER, &xdg_positioner_interface, wl_proxy_get_version((struct wl_proxy *) xdg_wm_base), 0, NULL);
500
501 return (struct xdg_positioner *) id;
502}
503
504/**
505 * @ingroup iface_xdg_wm_base
506 *
507 * This creates an xdg_surface for the given surface. While xdg_surface
508 * itself is not a role, the corresponding surface may only be assigned
509 * a role extending xdg_surface, such as xdg_toplevel or xdg_popup.
510 *
511 * This creates an xdg_surface for the given surface. An xdg_surface is
512 * used as basis to define a role to a given surface, such as xdg_toplevel
513 * or xdg_popup. It also manages functionality shared between xdg_surface
514 * based surface roles.
515 *
516 * See the documentation of xdg_surface for more details about what an
517 * xdg_surface is and how it is used.
518 */
519static inline struct xdg_surface *
520xdg_wm_base_get_xdg_surface(struct xdg_wm_base *xdg_wm_base, struct wl_surface *surface)
521{
522 struct wl_proxy *id;
523
524 id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_wm_base,
525 XDG_WM_BASE_GET_XDG_SURFACE, &xdg_surface_interface, wl_proxy_get_version((struct wl_proxy *) xdg_wm_base), 0, NULL, surface);
526
527 return (struct xdg_surface *) id;
528}
529
530/**
531 * @ingroup iface_xdg_wm_base
532 *
533 * A client must respond to a ping event with a pong request or
534 * the client may be deemed unresponsive. See xdg_wm_base.ping.
535 */
536static inline void
537xdg_wm_base_pong(struct xdg_wm_base *xdg_wm_base, uint32_t serial)
538{
539 wl_proxy_marshal_flags((struct wl_proxy *) xdg_wm_base,
540 XDG_WM_BASE_PONG, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_wm_base), 0, serial);
541}
542
543#ifndef XDG_POSITIONER_ERROR_ENUM
544#define XDG_POSITIONER_ERROR_ENUM
546 /**
547 * invalid input provided
548 */
550};
551#endif /* XDG_POSITIONER_ERROR_ENUM */
552
553#ifndef XDG_POSITIONER_ANCHOR_ENUM
554#define XDG_POSITIONER_ANCHOR_ENUM
565};
566#endif /* XDG_POSITIONER_ANCHOR_ENUM */
567
568#ifndef XDG_POSITIONER_GRAVITY_ENUM
569#define XDG_POSITIONER_GRAVITY_ENUM
580};
581#endif /* XDG_POSITIONER_GRAVITY_ENUM */
582
583#ifndef XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM
584#define XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM
585/**
586 * @ingroup iface_xdg_positioner
587 * constraint adjustments
588 *
589 * The constraint adjustment value define ways the compositor will adjust
590 * the position of the surface, if the unadjusted position would result
591 * in the surface being partly constrained.
592 *
593 * Whether a surface is considered 'constrained' is left to the compositor
594 * to determine. For example, the surface may be partly outside the
595 * compositor's defined 'work area', thus necessitating the child surface's
596 * position be adjusted until it is entirely inside the work area.
597 *
598 * The adjustments can be combined, according to a defined precedence: 1)
599 * Flip, 2) Slide, 3) Resize.
600 */
602 /**
603 * don't move the child surface when constrained
604 *
605 * Don't alter the surface position even if it is constrained on
606 * some axis, for example partially outside the edge of an output.
607 */
609 /**
610 * move along the x axis until unconstrained
611 *
612 * Slide the surface along the x axis until it is no longer
613 * constrained.
614 *
615 * First try to slide towards the direction of the gravity on the x
616 * axis until either the edge in the opposite direction of the
617 * gravity is unconstrained or the edge in the direction of the
618 * gravity is constrained.
619 *
620 * Then try to slide towards the opposite direction of the gravity
621 * on the x axis until either the edge in the direction of the
622 * gravity is unconstrained or the edge in the opposite direction
623 * of the gravity is constrained.
624 */
626 /**
627 * move along the y axis until unconstrained
628 *
629 * Slide the surface along the y axis until it is no longer
630 * constrained.
631 *
632 * First try to slide towards the direction of the gravity on the y
633 * axis until either the edge in the opposite direction of the
634 * gravity is unconstrained or the edge in the direction of the
635 * gravity is constrained.
636 *
637 * Then try to slide towards the opposite direction of the gravity
638 * on the y axis until either the edge in the direction of the
639 * gravity is unconstrained or the edge in the opposite direction
640 * of the gravity is constrained.
641 */
643 /**
644 * invert the anchor and gravity on the x axis
645 *
646 * Invert the anchor and gravity on the x axis if the surface is
647 * constrained on the x axis. For example, if the left edge of the
648 * surface is constrained, the gravity is 'left' and the anchor is
649 * 'left', change the gravity to 'right' and the anchor to 'right'.
650 *
651 * If the adjusted position also ends up being constrained, the
652 * resulting position of the flip_x adjustment will be the one
653 * before the adjustment.
654 */
656 /**
657 * invert the anchor and gravity on the y axis
658 *
659 * Invert the anchor and gravity on the y axis if the surface is
660 * constrained on the y axis. For example, if the bottom edge of
661 * the surface is constrained, the gravity is 'bottom' and the
662 * anchor is 'bottom', change the gravity to 'top' and the anchor
663 * to 'top'.
664 *
665 * The adjusted position is calculated given the original anchor
666 * rectangle and offset, but with the new flipped anchor and
667 * gravity values.
668 *
669 * If the adjusted position also ends up being constrained, the
670 * resulting position of the flip_y adjustment will be the one
671 * before the adjustment.
672 */
674 /**
675 * horizontally resize the surface
676 *
677 * Resize the surface horizontally so that it is completely
678 * unconstrained.
679 */
681 /**
682 * vertically resize the surface
683 *
684 * Resize the surface vertically so that it is completely
685 * unconstrained.
686 */
688};
689#endif /* XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM */
690
691#define XDG_POSITIONER_DESTROY 0
692#define XDG_POSITIONER_SET_SIZE 1
693#define XDG_POSITIONER_SET_ANCHOR_RECT 2
694#define XDG_POSITIONER_SET_ANCHOR 3
695#define XDG_POSITIONER_SET_GRAVITY 4
696#define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT 5
697#define XDG_POSITIONER_SET_OFFSET 6
698
699
700/**
701 * @ingroup iface_xdg_positioner
702 */
703#define XDG_POSITIONER_DESTROY_SINCE_VERSION 1
704/**
705 * @ingroup iface_xdg_positioner
706 */
707#define XDG_POSITIONER_SET_SIZE_SINCE_VERSION 1
708/**
709 * @ingroup iface_xdg_positioner
710 */
711#define XDG_POSITIONER_SET_ANCHOR_RECT_SINCE_VERSION 1
712/**
713 * @ingroup iface_xdg_positioner
714 */
715#define XDG_POSITIONER_SET_ANCHOR_SINCE_VERSION 1
716/**
717 * @ingroup iface_xdg_positioner
718 */
719#define XDG_POSITIONER_SET_GRAVITY_SINCE_VERSION 1
720/**
721 * @ingroup iface_xdg_positioner
722 */
723#define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1
724/**
725 * @ingroup iface_xdg_positioner
726 */
727#define XDG_POSITIONER_SET_OFFSET_SINCE_VERSION 1
728
729/** @ingroup iface_xdg_positioner */
730static inline void
731xdg_positioner_set_user_data(struct xdg_positioner *xdg_positioner, void *user_data)
732{
733 wl_proxy_set_user_data((struct wl_proxy *) xdg_positioner, user_data);
734}
735
736/** @ingroup iface_xdg_positioner */
737static inline void *
738xdg_positioner_get_user_data(struct xdg_positioner *xdg_positioner)
739{
740 return wl_proxy_get_user_data((struct wl_proxy *) xdg_positioner);
741}
742
743static inline uint32_t
744xdg_positioner_get_version(struct xdg_positioner *xdg_positioner)
745{
746 return wl_proxy_get_version((struct wl_proxy *) xdg_positioner);
747}
748
749/**
750 * @ingroup iface_xdg_positioner
751 *
752 * Notify the compositor that the xdg_positioner will no longer be used.
753 */
754static inline void
755xdg_positioner_destroy(struct xdg_positioner *xdg_positioner)
756{
757 wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
758 XDG_POSITIONER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), WL_MARSHAL_FLAG_DESTROY);
759}
760
761/**
762 * @ingroup iface_xdg_positioner
763 *
764 * Set the size of the surface that is to be positioned with the positioner
765 * object. The size is in surface-local coordinates and corresponds to the
766 * window geometry. See xdg_surface.set_window_geometry.
767 *
768 * If a zero or negative size is set the invalid_input error is raised.
769 */
770static inline void
771xdg_positioner_set_size(struct xdg_positioner *xdg_positioner, int32_t width, int32_t height)
772{
773 wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
774 XDG_POSITIONER_SET_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, width, height);
775}
776
777/**
778 * @ingroup iface_xdg_positioner
779 *
780 * Specify the anchor rectangle within the parent surface that the child
781 * surface will be placed relative to. The rectangle is relative to the
782 * window geometry as defined by xdg_surface.set_window_geometry of the
783 * parent surface.
784 *
785 * When the xdg_positioner object is used to position a child surface, the
786 * anchor rectangle may not extend outside the window geometry of the
787 * positioned child's parent surface.
788 *
789 * If a negative size is set the invalid_input error is raised.
790 */
791static inline void
792xdg_positioner_set_anchor_rect(struct xdg_positioner *xdg_positioner, int32_t x, int32_t y, int32_t width, int32_t height)
793{
794 wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
795 XDG_POSITIONER_SET_ANCHOR_RECT, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, x, y, width, height);
796}
797
798/**
799 * @ingroup iface_xdg_positioner
800 *
801 * Defines the anchor point for the anchor rectangle. The specified anchor
802 * is used derive an anchor point that the child surface will be
803 * positioned relative to. If a corner anchor is set (e.g. 'top_left' or
804 * 'bottom_right'), the anchor point will be at the specified corner;
805 * otherwise, the derived anchor point will be centered on the specified
806 * edge, or in the center of the anchor rectangle if no edge is specified.
807 */
808static inline void
809xdg_positioner_set_anchor(struct xdg_positioner *xdg_positioner, uint32_t anchor)
810{
811 wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
812 XDG_POSITIONER_SET_ANCHOR, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, anchor);
813}
814
815/**
816 * @ingroup iface_xdg_positioner
817 *
818 * Defines in what direction a surface should be positioned, relative to
819 * the anchor point of the parent surface. If a corner gravity is
820 * specified (e.g. 'bottom_right' or 'top_left'), then the child surface
821 * will be placed towards the specified gravity; otherwise, the child
822 * surface will be centered over the anchor point on any axis that had no
823 * gravity specified.
824 */
825static inline void
826xdg_positioner_set_gravity(struct xdg_positioner *xdg_positioner, uint32_t gravity)
827{
828 wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
829 XDG_POSITIONER_SET_GRAVITY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, gravity);
830}
831
832/**
833 * @ingroup iface_xdg_positioner
834 *
835 * Specify how the window should be positioned if the originally intended
836 * position caused the surface to be constrained, meaning at least
837 * partially outside positioning boundaries set by the compositor. The
838 * adjustment is set by constructing a bitmask describing the adjustment to
839 * be made when the surface is constrained on that axis.
840 *
841 * If no bit for one axis is set, the compositor will assume that the child
842 * surface should not change its position on that axis when constrained.
843 *
844 * If more than one bit for one axis is set, the order of how adjustments
845 * are applied is specified in the corresponding adjustment descriptions.
846 *
847 * The default adjustment is none.
848 */
849static inline void
850xdg_positioner_set_constraint_adjustment(struct xdg_positioner *xdg_positioner, uint32_t constraint_adjustment)
851{
852 wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
853 XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, constraint_adjustment);
854}
855
856/**
857 * @ingroup iface_xdg_positioner
858 *
859 * Specify the surface position offset relative to the position of the
860 * anchor on the anchor rectangle and the anchor on the surface. For
861 * example if the anchor of the anchor rectangle is at (x, y), the surface
862 * has the gravity bottom|right, and the offset is (ox, oy), the calculated
863 * surface position will be (x + ox, y + oy). The offset position of the
864 * surface is the one used for constraint testing. See
865 * set_constraint_adjustment.
866 *
867 * An example use case is placing a popup menu on top of a user interface
868 * element, while aligning the user interface element of the parent surface
869 * with some user interface element placed somewhere in the popup surface.
870 */
871static inline void
872xdg_positioner_set_offset(struct xdg_positioner *xdg_positioner, int32_t x, int32_t y)
873{
874 wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
875 XDG_POSITIONER_SET_OFFSET, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, x, y);
876}
877
878#ifndef XDG_SURFACE_ERROR_ENUM
879#define XDG_SURFACE_ERROR_ENUM
884};
885#endif /* XDG_SURFACE_ERROR_ENUM */
886
887/**
888 * @ingroup iface_xdg_surface
889 * @struct xdg_surface_listener
890 */
892 /**
893 * suggest a surface change
894 *
895 * The configure event marks the end of a configure sequence. A
896 * configure sequence is a set of one or more events configuring
897 * the state of the xdg_surface, including the final
898 * xdg_surface.configure event.
899 *
900 * Where applicable, xdg_surface surface roles will during a
901 * configure sequence extend this event as a latched state sent as
902 * events before the xdg_surface.configure event. Such events
903 * should be considered to make up a set of atomically applied
904 * configuration states, where the xdg_surface.configure commits
905 * the accumulated state.
906 *
907 * Clients should arrange their surface for the new states, and
908 * then send an ack_configure request with the serial sent in this
909 * configure event at some point before committing the new surface.
910 *
911 * If the client receives multiple configure events before it can
912 * respond to one, it is free to discard all but the last event it
913 * received.
914 * @param serial serial of the configure event
915 */
917 struct xdg_surface *xdg_surface,
918 uint32_t serial);
919};
920
921/**
922 * @ingroup iface_xdg_surface
923 */
924static inline int
925xdg_surface_add_listener(struct xdg_surface *xdg_surface,
926 const struct xdg_surface_listener *listener, void *data)
927{
928 return wl_proxy_add_listener((struct wl_proxy *) xdg_surface,
929 (void (**)(void)) listener, data);
930}
931
932#define XDG_SURFACE_DESTROY 0
933#define XDG_SURFACE_GET_TOPLEVEL 1
934#define XDG_SURFACE_GET_POPUP 2
935#define XDG_SURFACE_SET_WINDOW_GEOMETRY 3
936#define XDG_SURFACE_ACK_CONFIGURE 4
937
938/**
939 * @ingroup iface_xdg_surface
940 */
941#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1
942
943/**
944 * @ingroup iface_xdg_surface
945 */
946#define XDG_SURFACE_DESTROY_SINCE_VERSION 1
947/**
948 * @ingroup iface_xdg_surface
949 */
950#define XDG_SURFACE_GET_TOPLEVEL_SINCE_VERSION 1
951/**
952 * @ingroup iface_xdg_surface
953 */
954#define XDG_SURFACE_GET_POPUP_SINCE_VERSION 1
955/**
956 * @ingroup iface_xdg_surface
957 */
958#define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
959/**
960 * @ingroup iface_xdg_surface
961 */
962#define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1
963
964/** @ingroup iface_xdg_surface */
965static inline void
966xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
967{
968 wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data);
969}
970
971/** @ingroup iface_xdg_surface */
972static inline void *
973xdg_surface_get_user_data(struct xdg_surface *xdg_surface)
974{
975 return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface);
976}
977
978static inline uint32_t
979xdg_surface_get_version(struct xdg_surface *xdg_surface)
980{
981 return wl_proxy_get_version((struct wl_proxy *) xdg_surface);
982}
983
984/**
985 * @ingroup iface_xdg_surface
986 *
987 * Destroy the xdg_surface object. An xdg_surface must only be destroyed
988 * after its role object has been destroyed.
989 */
990static inline void
991xdg_surface_destroy(struct xdg_surface *xdg_surface)
992{
993 wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
994 XDG_SURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_surface), WL_MARSHAL_FLAG_DESTROY);
995}
996
997/**
998 * @ingroup iface_xdg_surface
999 *
1000 * This creates an xdg_toplevel object for the given xdg_surface and gives
1001 * the associated wl_surface the xdg_toplevel role.
1002 *
1003 * See the documentation of xdg_toplevel for more details about what an
1004 * xdg_toplevel is and how it is used.
1005 */
1006static inline struct xdg_toplevel *
1007xdg_surface_get_toplevel(struct xdg_surface *xdg_surface)
1008{
1009 struct wl_proxy *id;
1010
1011 id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1012 XDG_SURFACE_GET_TOPLEVEL, &xdg_toplevel_interface, wl_proxy_get_version((struct wl_proxy *) xdg_surface), 0, NULL);
1013
1014 return (struct xdg_toplevel *) id;
1015}
1016
1017/**
1018 * @ingroup iface_xdg_surface
1019 *
1020 * This creates an xdg_popup object for the given xdg_surface and gives
1021 * the associated wl_surface the xdg_popup role.
1022 *
1023 * If null is passed as a parent, a parent surface must be specified using
1024 * some other protocol, before committing the initial state.
1025 *
1026 * See the documentation of xdg_popup for more details about what an
1027 * xdg_popup is and how it is used.
1028 */
1029static inline struct xdg_popup *
1030xdg_surface_get_popup(struct xdg_surface *xdg_surface, struct xdg_surface *parent, struct xdg_positioner *positioner)
1031{
1032 struct wl_proxy *id;
1033
1034 id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1035 XDG_SURFACE_GET_POPUP, &xdg_popup_interface, wl_proxy_get_version((struct wl_proxy *) xdg_surface), 0, NULL, parent, positioner);
1036
1037 return (struct xdg_popup *) id;
1038}
1039
1040/**
1041 * @ingroup iface_xdg_surface
1042 *
1043 * The window geometry of a surface is its "visible bounds" from the
1044 * user's perspective. Client-side decorations often have invisible
1045 * portions like drop-shadows which should be ignored for the
1046 * purposes of aligning, placing and constraining windows.
1047 *
1048 * The window geometry is double buffered, and will be applied at the
1049 * time wl_surface.commit of the corresponding wl_surface is called.
1050 *
1051 * When maintaining a position, the compositor should treat the (x, y)
1052 * coordinate of the window geometry as the top left corner of the window.
1053 * A client changing the (x, y) window geometry coordinate should in
1054 * general not alter the position of the window.
1055 *
1056 * Once the window geometry of the surface is set, it is not possible to
1057 * unset it, and it will remain the same until set_window_geometry is
1058 * called again, even if a new subsurface or buffer is attached.
1059 *
1060 * If never set, the value is the full bounds of the surface,
1061 * including any subsurfaces. This updates dynamically on every
1062 * commit. This unset is meant for extremely simple clients.
1063 *
1064 * The arguments are given in the surface-local coordinate space of
1065 * the wl_surface associated with this xdg_surface.
1066 *
1067 * The width and height must be greater than zero. Setting an invalid size
1068 * will raise an error. When applied, the effective window geometry will be
1069 * the set window geometry clamped to the bounding rectangle of the
1070 * combined geometry of the surface of the xdg_surface and the associated
1071 * subsurfaces.
1072 */
1073static inline void
1075{
1076 wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1077 XDG_SURFACE_SET_WINDOW_GEOMETRY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_surface), 0, x, y, width, height);
1078}
1079
1080/**
1081 * @ingroup iface_xdg_surface
1082 *
1083 * When a configure event is received, if a client commits the
1084 * surface in response to the configure event, then the client
1085 * must make an ack_configure request sometime before the commit
1086 * request, passing along the serial of the configure event.
1087 *
1088 * For instance, for toplevel surfaces the compositor might use this
1089 * information to move a surface to the top left only when the client has
1090 * drawn itself for the maximized or fullscreen state.
1091 *
1092 * If the client receives multiple configure events before it
1093 * can respond to one, it only has to ack the last configure event.
1094 *
1095 * A client is not required to commit immediately after sending
1096 * an ack_configure request - it may even ack_configure several times
1097 * before its next surface commit.
1098 *
1099 * A client may send multiple ack_configure requests before committing, but
1100 * only the last request sent before a commit indicates which configure
1101 * event the client really is responding to.
1102 */
1103static inline void
1104xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
1105{
1106 wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1107 XDG_SURFACE_ACK_CONFIGURE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_surface), 0, serial);
1108}
1109
1110#ifndef XDG_TOPLEVEL_RESIZE_EDGE_ENUM
1111#define XDG_TOPLEVEL_RESIZE_EDGE_ENUM
1112/**
1113 * @ingroup iface_xdg_toplevel
1114 * edge values for resizing
1115 *
1116 * These values are used to indicate which edge of a surface
1117 * is being dragged in a resize operation.
1118 */
1129};
1130#endif /* XDG_TOPLEVEL_RESIZE_EDGE_ENUM */
1131
1132#ifndef XDG_TOPLEVEL_STATE_ENUM
1133#define XDG_TOPLEVEL_STATE_ENUM
1134/**
1135 * @ingroup iface_xdg_toplevel
1136 * types of state on the surface
1137 *
1138 * The different state values used on the surface. This is designed for
1139 * state values like maximized, fullscreen. It is paired with the
1140 * configure event to ensure that both the client and the compositor
1141 * setting the state can be synchronized.
1142 *
1143 * States set in this way are double-buffered. They will get applied on
1144 * the next commit.
1145 */
1147 /**
1148 * the surface is maximized
1149 * the surface is maximized
1150 *
1151 * The surface is maximized. The window geometry specified in the
1152 * configure event must be obeyed by the client.
1153 */
1155 /**
1156 * the surface is fullscreen
1157 * the surface is fullscreen
1158 *
1159 * The surface is fullscreen. The window geometry specified in
1160 * the configure event is a maximum; the client cannot resize
1161 * beyond it. For a surface to cover the whole fullscreened area,
1162 * the geometry dimensions must be obeyed by the client. For more
1163 * details, see xdg_toplevel.set_fullscreen.
1164 */
1166 /**
1167 * the surface is being resized
1168 * the surface is being resized
1169 *
1170 * The surface is being resized. The window geometry specified in
1171 * the configure event is a maximum; the client cannot resize
1172 * beyond it. Clients that have aspect ratio or cell sizing
1173 * configuration can use a smaller size, however.
1174 */
1176 /**
1177 * the surface is now activated
1178 * the surface is now activated
1179 *
1180 * Client window decorations should be painted as if the window
1181 * is active. Do not assume this means that the window actually has
1182 * keyboard or pointer focus.
1183 */
1185};
1186#endif /* XDG_TOPLEVEL_STATE_ENUM */
1187
1188/**
1189 * @ingroup iface_xdg_toplevel
1190 * @struct xdg_toplevel_listener
1191 */
1193 /**
1194 * suggest a surface change
1195 *
1196 * This configure event asks the client to resize its toplevel
1197 * surface or to change its state. The configured state should not
1198 * be applied immediately. See xdg_surface.configure for details.
1199 *
1200 * The width and height arguments specify a hint to the window
1201 * about how its surface should be resized in window geometry
1202 * coordinates. See set_window_geometry.
1203 *
1204 * If the width or height arguments are zero, it means the client
1205 * should decide its own window dimension. This may happen when the
1206 * compositor needs to configure the state of the surface but
1207 * doesn't have any information about any previous or expected
1208 * dimension.
1209 *
1210 * The states listed in the event specify how the width/height
1211 * arguments should be interpreted, and possibly how it should be
1212 * drawn.
1213 *
1214 * Clients must send an ack_configure in response to this event.
1215 * See xdg_surface.configure and xdg_surface.ack_configure for
1216 * details.
1217 */
1219 struct xdg_toplevel *xdg_toplevel,
1220 int32_t width,
1222 struct wl_array *states);
1223 /**
1224 * surface wants to be closed
1225 *
1226 * The close event is sent by the compositor when the user wants
1227 * the surface to be closed. This should be equivalent to the user
1228 * clicking the close button in client-side decorations, if your
1229 * application has any.
1230 *
1231 * This is only a request that the user intends to close the
1232 * window. The client may choose to ignore this request, or show a
1233 * dialog to ask the user to save their data, etc.
1234 */
1235 void (*close)(void *data,
1236 struct xdg_toplevel *xdg_toplevel);
1237};
1238
1239/**
1240 * @ingroup iface_xdg_toplevel
1241 */
1242static inline int
1243xdg_toplevel_add_listener(struct xdg_toplevel *xdg_toplevel,
1244 const struct xdg_toplevel_listener *listener, void *data)
1245{
1246 return wl_proxy_add_listener((struct wl_proxy *) xdg_toplevel,
1247 (void (**)(void)) listener, data);
1248}
1249
1250#define XDG_TOPLEVEL_DESTROY 0
1251#define XDG_TOPLEVEL_SET_PARENT 1
1252#define XDG_TOPLEVEL_SET_TITLE 2
1253#define XDG_TOPLEVEL_SET_APP_ID 3
1254#define XDG_TOPLEVEL_SHOW_WINDOW_MENU 4
1255#define XDG_TOPLEVEL_MOVE 5
1256#define XDG_TOPLEVEL_RESIZE 6
1257#define XDG_TOPLEVEL_SET_MAX_SIZE 7
1258#define XDG_TOPLEVEL_SET_MIN_SIZE 8
1259#define XDG_TOPLEVEL_SET_MAXIMIZED 9
1260#define XDG_TOPLEVEL_UNSET_MAXIMIZED 10
1261#define XDG_TOPLEVEL_SET_FULLSCREEN 11
1262#define XDG_TOPLEVEL_UNSET_FULLSCREEN 12
1263#define XDG_TOPLEVEL_SET_MINIMIZED 13
1264
1265/**
1266 * @ingroup iface_xdg_toplevel
1267 */
1268#define XDG_TOPLEVEL_CONFIGURE_SINCE_VERSION 1
1269/**
1270 * @ingroup iface_xdg_toplevel
1271 */
1272#define XDG_TOPLEVEL_CLOSE_SINCE_VERSION 1
1273
1274/**
1275 * @ingroup iface_xdg_toplevel
1276 */
1277#define XDG_TOPLEVEL_DESTROY_SINCE_VERSION 1
1278/**
1279 * @ingroup iface_xdg_toplevel
1280 */
1281#define XDG_TOPLEVEL_SET_PARENT_SINCE_VERSION 1
1282/**
1283 * @ingroup iface_xdg_toplevel
1284 */
1285#define XDG_TOPLEVEL_SET_TITLE_SINCE_VERSION 1
1286/**
1287 * @ingroup iface_xdg_toplevel
1288 */
1289#define XDG_TOPLEVEL_SET_APP_ID_SINCE_VERSION 1
1290/**
1291 * @ingroup iface_xdg_toplevel
1292 */
1293#define XDG_TOPLEVEL_SHOW_WINDOW_MENU_SINCE_VERSION 1
1294/**
1295 * @ingroup iface_xdg_toplevel
1296 */
1297#define XDG_TOPLEVEL_MOVE_SINCE_VERSION 1
1298/**
1299 * @ingroup iface_xdg_toplevel
1300 */
1301#define XDG_TOPLEVEL_RESIZE_SINCE_VERSION 1
1302/**
1303 * @ingroup iface_xdg_toplevel
1304 */
1305#define XDG_TOPLEVEL_SET_MAX_SIZE_SINCE_VERSION 1
1306/**
1307 * @ingroup iface_xdg_toplevel
1308 */
1309#define XDG_TOPLEVEL_SET_MIN_SIZE_SINCE_VERSION 1
1310/**
1311 * @ingroup iface_xdg_toplevel
1312 */
1313#define XDG_TOPLEVEL_SET_MAXIMIZED_SINCE_VERSION 1
1314/**
1315 * @ingroup iface_xdg_toplevel
1316 */
1317#define XDG_TOPLEVEL_UNSET_MAXIMIZED_SINCE_VERSION 1
1318/**
1319 * @ingroup iface_xdg_toplevel
1320 */
1321#define XDG_TOPLEVEL_SET_FULLSCREEN_SINCE_VERSION 1
1322/**
1323 * @ingroup iface_xdg_toplevel
1324 */
1325#define XDG_TOPLEVEL_UNSET_FULLSCREEN_SINCE_VERSION 1
1326/**
1327 * @ingroup iface_xdg_toplevel
1328 */
1329#define XDG_TOPLEVEL_SET_MINIMIZED_SINCE_VERSION 1
1330
1331/** @ingroup iface_xdg_toplevel */
1332static inline void
1333xdg_toplevel_set_user_data(struct xdg_toplevel *xdg_toplevel, void *user_data)
1334{
1335 wl_proxy_set_user_data((struct wl_proxy *) xdg_toplevel, user_data);
1336}
1337
1338/** @ingroup iface_xdg_toplevel */
1339static inline void *
1340xdg_toplevel_get_user_data(struct xdg_toplevel *xdg_toplevel)
1341{
1342 return wl_proxy_get_user_data((struct wl_proxy *) xdg_toplevel);
1343}
1344
1345static inline uint32_t
1346xdg_toplevel_get_version(struct xdg_toplevel *xdg_toplevel)
1347{
1348 return wl_proxy_get_version((struct wl_proxy *) xdg_toplevel);
1349}
1350
1351/**
1352 * @ingroup iface_xdg_toplevel
1353 *
1354 * This request destroys the role surface and unmaps the surface;
1355 * see "Unmapping" behavior in interface section for details.
1356 */
1357static inline void
1358xdg_toplevel_destroy(struct xdg_toplevel *xdg_toplevel)
1359{
1360 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1361 XDG_TOPLEVEL_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), WL_MARSHAL_FLAG_DESTROY);
1362}
1363
1364/**
1365 * @ingroup iface_xdg_toplevel
1366 *
1367 * Set the "parent" of this surface. This surface should be stacked
1368 * above the parent surface and all other ancestor surfaces.
1369 *
1370 * Parent windows should be set on dialogs, toolboxes, or other
1371 * "auxiliary" surfaces, so that the parent is raised when the dialog
1372 * is raised.
1373 *
1374 * Setting a null parent for a child window removes any parent-child
1375 * relationship for the child. Setting a null parent for a window which
1376 * currently has no parent is a no-op.
1377 *
1378 * If the parent is unmapped then its children are managed as
1379 * though the parent of the now-unmapped parent has become the
1380 * parent of this surface. If no parent exists for the now-unmapped
1381 * parent then the children are managed as though they have no
1382 * parent surface.
1383 */
1384static inline void
1385xdg_toplevel_set_parent(struct xdg_toplevel *xdg_toplevel, struct xdg_toplevel *parent)
1386{
1387 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1388 XDG_TOPLEVEL_SET_PARENT, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, parent);
1389}
1390
1391/**
1392 * @ingroup iface_xdg_toplevel
1393 *
1394 * Set a short title for the surface.
1395 *
1396 * This string may be used to identify the surface in a task bar,
1397 * window list, or other user interface elements provided by the
1398 * compositor.
1399 *
1400 * The string must be encoded in UTF-8.
1401 */
1402static inline void
1403xdg_toplevel_set_title(struct xdg_toplevel *xdg_toplevel, const char *title)
1404{
1405 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1406 XDG_TOPLEVEL_SET_TITLE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, title);
1407}
1408
1409/**
1410 * @ingroup iface_xdg_toplevel
1411 *
1412 * Set an application identifier for the surface.
1413 *
1414 * The app ID identifies the general class of applications to which
1415 * the surface belongs. The compositor can use this to group multiple
1416 * surfaces together, or to determine how to launch a new application.
1417 *
1418 * For D-Bus activatable applications, the app ID is used as the D-Bus
1419 * service name.
1420 *
1421 * The compositor shell will try to group application surfaces together
1422 * by their app ID. As a best practice, it is suggested to select app
1423 * ID's that match the basename of the application's .desktop file.
1424 * For example, "org.freedesktop.FooViewer" where the .desktop file is
1425 * "org.freedesktop.FooViewer.desktop".
1426 *
1427 * See the desktop-entry specification [0] for more details on
1428 * application identifiers and how they relate to well-known D-Bus
1429 * names and .desktop files.
1430 *
1431 * [0] http://standards.freedesktop.org/desktop-entry-spec/
1432 */
1433static inline void
1434xdg_toplevel_set_app_id(struct xdg_toplevel *xdg_toplevel, const char *app_id)
1435{
1436 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1437 XDG_TOPLEVEL_SET_APP_ID, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, app_id);
1438}
1439
1440/**
1441 * @ingroup iface_xdg_toplevel
1442 *
1443 * Clients implementing client-side decorations might want to show
1444 * a context menu when right-clicking on the decorations, giving the
1445 * user a menu that they can use to maximize or minimize the window.
1446 *
1447 * This request asks the compositor to pop up such a window menu at
1448 * the given position, relative to the local surface coordinates of
1449 * the parent surface. There are no guarantees as to what menu items
1450 * the window menu contains.
1451 *
1452 * This request must be used in response to some sort of user action
1453 * like a button press, key press, or touch down event.
1454 */
1455static inline void
1456xdg_toplevel_show_window_menu(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
1457{
1458 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1459 XDG_TOPLEVEL_SHOW_WINDOW_MENU, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, seat, serial, x, y);
1460}
1461
1462/**
1463 * @ingroup iface_xdg_toplevel
1464 *
1465 * Start an interactive, user-driven move of the surface.
1466 *
1467 * This request must be used in response to some sort of user action
1468 * like a button press, key press, or touch down event. The passed
1469 * serial is used to determine the type of interactive move (touch,
1470 * pointer, etc).
1471 *
1472 * The server may ignore move requests depending on the state of
1473 * the surface (e.g. fullscreen or maximized), or if the passed serial
1474 * is no longer valid.
1475 *
1476 * If triggered, the surface will lose the focus of the device
1477 * (wl_pointer, wl_touch, etc) used for the move. It is up to the
1478 * compositor to visually indicate that the move is taking place, such as
1479 * updating a pointer cursor, during the move. There is no guarantee
1480 * that the device focus will return when the move is completed.
1481 */
1482static inline void
1483xdg_toplevel_move(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial)
1484{
1485 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1486 XDG_TOPLEVEL_MOVE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, seat, serial);
1487}
1488
1489/**
1490 * @ingroup iface_xdg_toplevel
1491 *
1492 * Start a user-driven, interactive resize of the surface.
1493 *
1494 * This request must be used in response to some sort of user action
1495 * like a button press, key press, or touch down event. The passed
1496 * serial is used to determine the type of interactive resize (touch,
1497 * pointer, etc).
1498 *
1499 * The server may ignore resize requests depending on the state of
1500 * the surface (e.g. fullscreen or maximized).
1501 *
1502 * If triggered, the client will receive configure events with the
1503 * "resize" state enum value and the expected sizes. See the "resize"
1504 * enum value for more details about what is required. The client
1505 * must also acknowledge configure events using "ack_configure". After
1506 * the resize is completed, the client will receive another "configure"
1507 * event without the resize state.
1508 *
1509 * If triggered, the surface also will lose the focus of the device
1510 * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
1511 * compositor to visually indicate that the resize is taking place,
1512 * such as updating a pointer cursor, during the resize. There is no
1513 * guarantee that the device focus will return when the resize is
1514 * completed.
1515 *
1516 * The edges parameter specifies how the surface should be resized,
1517 * and is one of the values of the resize_edge enum. The compositor
1518 * may use this information to update the surface position for
1519 * example when dragging the top left corner. The compositor may also
1520 * use this information to adapt its behavior, e.g. choose an
1521 * appropriate cursor image.
1522 */
1523static inline void
1524xdg_toplevel_resize(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial, uint32_t edges)
1525{
1526 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1527 XDG_TOPLEVEL_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, seat, serial, edges);
1528}
1529
1530/**
1531 * @ingroup iface_xdg_toplevel
1532 *
1533 * Set a maximum size for the window.
1534 *
1535 * The client can specify a maximum size so that the compositor does
1536 * not try to configure the window beyond this size.
1537 *
1538 * The width and height arguments are in window geometry coordinates.
1539 * See xdg_surface.set_window_geometry.
1540 *
1541 * Values set in this way are double-buffered. They will get applied
1542 * on the next commit.
1543 *
1544 * The compositor can use this information to allow or disallow
1545 * different states like maximize or fullscreen and draw accurate
1546 * animations.
1547 *
1548 * Similarly, a tiling window manager may use this information to
1549 * place and resize client windows in a more effective way.
1550 *
1551 * The client should not rely on the compositor to obey the maximum
1552 * size. The compositor may decide to ignore the values set by the
1553 * client and request a larger size.
1554 *
1555 * If never set, or a value of zero in the request, means that the
1556 * client has no expected maximum size in the given dimension.
1557 * As a result, a client wishing to reset the maximum size
1558 * to an unspecified state can use zero for width and height in the
1559 * request.
1560 *
1561 * Requesting a maximum size to be smaller than the minimum size of
1562 * a surface is illegal and will result in a protocol error.
1563 *
1564 * The width and height must be greater than or equal to zero. Using
1565 * strictly negative values for width and height will result in a
1566 * protocol error.
1567 */
1568static inline void
1569xdg_toplevel_set_max_size(struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height)
1570{
1571 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1572 XDG_TOPLEVEL_SET_MAX_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, width, height);
1573}
1574
1575/**
1576 * @ingroup iface_xdg_toplevel
1577 *
1578 * Set a minimum size for the window.
1579 *
1580 * The client can specify a minimum size so that the compositor does
1581 * not try to configure the window below this size.
1582 *
1583 * The width and height arguments are in window geometry coordinates.
1584 * See xdg_surface.set_window_geometry.
1585 *
1586 * Values set in this way are double-buffered. They will get applied
1587 * on the next commit.
1588 *
1589 * The compositor can use this information to allow or disallow
1590 * different states like maximize or fullscreen and draw accurate
1591 * animations.
1592 *
1593 * Similarly, a tiling window manager may use this information to
1594 * place and resize client windows in a more effective way.
1595 *
1596 * The client should not rely on the compositor to obey the minimum
1597 * size. The compositor may decide to ignore the values set by the
1598 * client and request a smaller size.
1599 *
1600 * If never set, or a value of zero in the request, means that the
1601 * client has no expected minimum size in the given dimension.
1602 * As a result, a client wishing to reset the minimum size
1603 * to an unspecified state can use zero for width and height in the
1604 * request.
1605 *
1606 * Requesting a minimum size to be larger than the maximum size of
1607 * a surface is illegal and will result in a protocol error.
1608 *
1609 * The width and height must be greater than or equal to zero. Using
1610 * strictly negative values for width and height will result in a
1611 * protocol error.
1612 */
1613static inline void
1614xdg_toplevel_set_min_size(struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height)
1615{
1616 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1617 XDG_TOPLEVEL_SET_MIN_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, width, height);
1618}
1619
1620/**
1621 * @ingroup iface_xdg_toplevel
1622 *
1623 * Maximize the surface.
1624 *
1625 * After requesting that the surface should be maximized, the compositor
1626 * will respond by emitting a configure event with the "maximized" state
1627 * and the required window geometry. The client should then update its
1628 * content, drawing it in a maximized state, i.e. without shadow or other
1629 * decoration outside of the window geometry. The client must also
1630 * acknowledge the configure when committing the new content (see
1631 * ack_configure).
1632 *
1633 * It is up to the compositor to decide how and where to maximize the
1634 * surface, for example which output and what region of the screen should
1635 * be used.
1636 *
1637 * If the surface was already maximized, the compositor will still emit
1638 * a configure event with the "maximized" state.
1639 *
1640 * If the surface is in a fullscreen state, this request has no direct
1641 * effect. It will alter the state the surface is returned to when
1642 * unmaximized if not overridden by the compositor.
1643 */
1644static inline void
1645xdg_toplevel_set_maximized(struct xdg_toplevel *xdg_toplevel)
1646{
1647 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1648 XDG_TOPLEVEL_SET_MAXIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0);
1649}
1650
1651/**
1652 * @ingroup iface_xdg_toplevel
1653 *
1654 * Unmaximize the surface.
1655 *
1656 * After requesting that the surface should be unmaximized, the compositor
1657 * will respond by emitting a configure event without the "maximized"
1658 * state. If available, the compositor will include the window geometry
1659 * dimensions the window had prior to being maximized in the configure
1660 * event. The client must then update its content, drawing it in a
1661 * regular state, i.e. potentially with shadow, etc. The client must also
1662 * acknowledge the configure when committing the new content (see
1663 * ack_configure).
1664 *
1665 * It is up to the compositor to position the surface after it was
1666 * unmaximized; usually the position the surface had before maximizing, if
1667 * applicable.
1668 *
1669 * If the surface was already not maximized, the compositor will still
1670 * emit a configure event without the "maximized" state.
1671 *
1672 * If the surface is in a fullscreen state, this request has no direct
1673 * effect. It will alter the state the surface is returned to when
1674 * unmaximized if not overridden by the compositor.
1675 */
1676static inline void
1677xdg_toplevel_unset_maximized(struct xdg_toplevel *xdg_toplevel)
1678{
1679 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1680 XDG_TOPLEVEL_UNSET_MAXIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0);
1681}
1682
1683/**
1684 * @ingroup iface_xdg_toplevel
1685 *
1686 * Make the surface fullscreen.
1687 *
1688 * After requesting that the surface should be fullscreened, the
1689 * compositor will respond by emitting a configure event with the
1690 * "fullscreen" state and the fullscreen window geometry. The client must
1691 * also acknowledge the configure when committing the new content (see
1692 * ack_configure).
1693 *
1694 * The output passed by the request indicates the client's preference as
1695 * to which display it should be set fullscreen on. If this value is NULL,
1696 * it's up to the compositor to choose which display will be used to map
1697 * this surface.
1698 *
1699 * If the surface doesn't cover the whole output, the compositor will
1700 * position the surface in the center of the output and compensate with
1701 * with border fill covering the rest of the output. The content of the
1702 * border fill is undefined, but should be assumed to be in some way that
1703 * attempts to blend into the surrounding area (e.g. solid black).
1704 *
1705 * If the fullscreened surface is not opaque, the compositor must make
1706 * sure that other screen content not part of the same surface tree (made
1707 * up of subsurfaces, popups or similarly coupled surfaces) are not
1708 * visible below the fullscreened surface.
1709 */
1710static inline void
1711xdg_toplevel_set_fullscreen(struct xdg_toplevel *xdg_toplevel, struct wl_output *output)
1712{
1713 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1714 XDG_TOPLEVEL_SET_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, output);
1715}
1716
1717/**
1718 * @ingroup iface_xdg_toplevel
1719 *
1720 * Make the surface no longer fullscreen.
1721 *
1722 * After requesting that the surface should be unfullscreened, the
1723 * compositor will respond by emitting a configure event without the
1724 * "fullscreen" state.
1725 *
1726 * Making a surface unfullscreen sets states for the surface based on the following:
1727 * * the state(s) it may have had before becoming fullscreen
1728 * * any state(s) decided by the compositor
1729 * * any state(s) requested by the client while the surface was fullscreen
1730 *
1731 * The compositor may include the previous window geometry dimensions in
1732 * the configure event, if applicable.
1733 *
1734 * The client must also acknowledge the configure when committing the new
1735 * content (see ack_configure).
1736 */
1737static inline void
1738xdg_toplevel_unset_fullscreen(struct xdg_toplevel *xdg_toplevel)
1739{
1740 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1741 XDG_TOPLEVEL_UNSET_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0);
1742}
1743
1744/**
1745 * @ingroup iface_xdg_toplevel
1746 *
1747 * Request that the compositor minimize your surface. There is no
1748 * way to know if the surface is currently minimized, nor is there
1749 * any way to unset minimization on this surface.
1750 *
1751 * If you are looking to throttle redrawing when minimized, please
1752 * instead use the wl_surface.frame event for this, as this will
1753 * also work with live previews on windows in Alt-Tab, Expose or
1754 * similar compositor features.
1755 */
1756static inline void
1757xdg_toplevel_set_minimized(struct xdg_toplevel *xdg_toplevel)
1758{
1759 wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1760 XDG_TOPLEVEL_SET_MINIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0);
1761}
1762
1763#ifndef XDG_POPUP_ERROR_ENUM
1764#define XDG_POPUP_ERROR_ENUM
1766 /**
1767 * tried to grab after being mapped
1768 */
1770};
1771#endif /* XDG_POPUP_ERROR_ENUM */
1772
1773/**
1774 * @ingroup iface_xdg_popup
1775 * @struct xdg_popup_listener
1776 */
1778 /**
1779 * configure the popup surface
1780 *
1781 * This event asks the popup surface to configure itself given
1782 * the configuration. The configured state should not be applied
1783 * immediately. See xdg_surface.configure for details.
1784 *
1785 * The x and y arguments represent the position the popup was
1786 * placed at given the xdg_positioner rule, relative to the upper
1787 * left corner of the window geometry of the parent surface.
1788 * @param x x position relative to parent surface window geometry
1789 * @param y y position relative to parent surface window geometry
1790 * @param width window geometry width
1791 * @param height window geometry height
1792 */
1794 struct xdg_popup *xdg_popup,
1795 int32_t x,
1796 int32_t y,
1797 int32_t width,
1798 int32_t height);
1799 /**
1800 * popup interaction is done
1801 *
1802 * The popup_done event is sent out when a popup is dismissed by
1803 * the compositor. The client should destroy the xdg_popup object
1804 * at this point.
1805 */
1807 struct xdg_popup *xdg_popup);
1808};
1809
1810/**
1811 * @ingroup iface_xdg_popup
1812 */
1813static inline int
1814xdg_popup_add_listener(struct xdg_popup *xdg_popup,
1815 const struct xdg_popup_listener *listener, void *data)
1816{
1817 return wl_proxy_add_listener((struct wl_proxy *) xdg_popup,
1818 (void (**)(void)) listener, data);
1819}
1820
1821#define XDG_POPUP_DESTROY 0
1822#define XDG_POPUP_GRAB 1
1823
1824/**
1825 * @ingroup iface_xdg_popup
1826 */
1827#define XDG_POPUP_CONFIGURE_SINCE_VERSION 1
1828/**
1829 * @ingroup iface_xdg_popup
1830 */
1831#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1
1832
1833/**
1834 * @ingroup iface_xdg_popup
1835 */
1836#define XDG_POPUP_DESTROY_SINCE_VERSION 1
1837/**
1838 * @ingroup iface_xdg_popup
1839 */
1840#define XDG_POPUP_GRAB_SINCE_VERSION 1
1841
1842/** @ingroup iface_xdg_popup */
1843static inline void
1844xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data)
1845{
1846 wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data);
1847}
1848
1849/** @ingroup iface_xdg_popup */
1850static inline void *
1851xdg_popup_get_user_data(struct xdg_popup *xdg_popup)
1852{
1853 return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup);
1854}
1855
1856static inline uint32_t
1857xdg_popup_get_version(struct xdg_popup *xdg_popup)
1858{
1859 return wl_proxy_get_version((struct wl_proxy *) xdg_popup);
1860}
1861
1862/**
1863 * @ingroup iface_xdg_popup
1864 *
1865 * This destroys the popup. Explicitly destroying the xdg_popup
1866 * object will also dismiss the popup, and unmap the surface.
1867 *
1868 * If this xdg_popup is not the "topmost" popup, a protocol error
1869 * will be sent.
1870 */
1871static inline void
1872xdg_popup_destroy(struct xdg_popup *xdg_popup)
1873{
1874 wl_proxy_marshal_flags((struct wl_proxy *) xdg_popup,
1875 XDG_POPUP_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_popup), WL_MARSHAL_FLAG_DESTROY);
1876}
1877
1878/**
1879 * @ingroup iface_xdg_popup
1880 *
1881 * This request makes the created popup take an explicit grab. An explicit
1882 * grab will be dismissed when the user dismisses the popup, or when the
1883 * client destroys the xdg_popup. This can be done by the user clicking
1884 * outside the surface, using the keyboard, or even locking the screen
1885 * through closing the lid or a timeout.
1886 *
1887 * If the compositor denies the grab, the popup will be immediately
1888 * dismissed.
1889 *
1890 * This request must be used in response to some sort of user action like a
1891 * button press, key press, or touch down event. The serial number of the
1892 * event should be passed as 'serial'.
1893 *
1894 * The parent of a grabbing popup must either be an xdg_toplevel surface or
1895 * another xdg_popup with an explicit grab. If the parent is another
1896 * xdg_popup it means that the popups are nested, with this popup now being
1897 * the topmost popup.
1898 *
1899 * Nested popups must be destroyed in the reverse order they were created
1900 * in, e.g. the only popup you are allowed to destroy at all times is the
1901 * topmost one.
1902 *
1903 * When compositors choose to dismiss a popup, they may dismiss every
1904 * nested grabbing popup as well. When a compositor dismisses popups, it
1905 * will follow the same dismissing order as required from the client.
1906 *
1907 * The parent of a grabbing popup must either be another xdg_popup with an
1908 * active explicit grab, or an xdg_popup or xdg_toplevel, if there are no
1909 * explicit grabs already taken.
1910 *
1911 * If the topmost grabbing popup is destroyed, the grab will be returned to
1912 * the parent of the popup, if that parent previously had an explicit grab.
1913 *
1914 * If the parent is a grabbing popup which has already been dismissed, this
1915 * popup will be immediately dismissed. If the parent is a popup that did
1916 * not take an explicit grab, an error will be raised.
1917 *
1918 * During a popup grab, the client owning the grab will receive pointer
1919 * and touch events for all their surfaces as normal (similar to an
1920 * "owner-events" grab in X11 parlance), while the top most grabbing popup
1921 * will always have keyboard focus.
1922 */
1923static inline void
1924xdg_popup_grab(struct xdg_popup *xdg_popup, struct wl_seat *seat, uint32_t serial)
1925{
1926 wl_proxy_marshal_flags((struct wl_proxy *) xdg_popup,
1927 XDG_POPUP_GRAB, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_popup), 0, seat, serial);
1928}
1929
1930#ifdef __cplusplus
1931}
1932#endif
1933
1934#endif
unsigned int uint32_t
signed int int32_t
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
GLuint id
#define NULL
Definition: begin_code.h:167
EGLSurface surface
Definition: eglext.h:248
static void xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data)
static int xdg_popup_add_listener(struct xdg_popup *xdg_popup, const struct xdg_popup_listener *listener, void *data)
static void xdg_popup_grab(struct xdg_popup *xdg_popup, struct wl_seat *seat, uint32_t serial)
static void xdg_popup_destroy(struct xdg_popup *xdg_popup)
static void * xdg_popup_get_user_data(struct xdg_popup *xdg_popup)
static void xdg_positioner_set_constraint_adjustment(struct xdg_positioner *xdg_positioner, uint32_t constraint_adjustment)
xdg_positioner_constraint_adjustment
static void * xdg_positioner_get_user_data(struct xdg_positioner *xdg_positioner)
static void xdg_positioner_destroy(struct xdg_positioner *xdg_positioner)
static void xdg_positioner_set_anchor_rect(struct xdg_positioner *xdg_positioner, int32_t x, int32_t y, int32_t width, int32_t height)
static void xdg_positioner_set_offset(struct xdg_positioner *xdg_positioner, int32_t x, int32_t y)
static void xdg_positioner_set_anchor(struct xdg_positioner *xdg_positioner, uint32_t anchor)
static void xdg_positioner_set_size(struct xdg_positioner *xdg_positioner, int32_t width, int32_t height)
static void xdg_positioner_set_user_data(struct xdg_positioner *xdg_positioner, void *user_data)
static void xdg_positioner_set_gravity(struct xdg_positioner *xdg_positioner, uint32_t gravity)
@ XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y
@ XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X
@ XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X
@ XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y
@ XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_NONE
@ XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X
@ XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y
static int xdg_surface_add_listener(struct xdg_surface *xdg_surface, const struct xdg_surface_listener *listener, void *data)
static struct xdg_popup * xdg_surface_get_popup(struct xdg_surface *xdg_surface, struct xdg_surface *parent, struct xdg_positioner *positioner)
static void * xdg_surface_get_user_data(struct xdg_surface *xdg_surface)
static void xdg_surface_destroy(struct xdg_surface *xdg_surface)
static struct xdg_toplevel * xdg_surface_get_toplevel(struct xdg_surface *xdg_surface)
static void xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
static void xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height)
static void xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
static void xdg_toplevel_set_title(struct xdg_toplevel *xdg_toplevel, const char *title)
static void xdg_toplevel_set_app_id(struct xdg_toplevel *xdg_toplevel, const char *app_id)
static void xdg_toplevel_set_fullscreen(struct xdg_toplevel *xdg_toplevel, struct wl_output *output)
static void xdg_toplevel_set_max_size(struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height)
static void * xdg_toplevel_get_user_data(struct xdg_toplevel *xdg_toplevel)
static void xdg_toplevel_set_maximized(struct xdg_toplevel *xdg_toplevel)
static void xdg_toplevel_resize(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial, uint32_t edges)
static void xdg_toplevel_unset_maximized(struct xdg_toplevel *xdg_toplevel)
static void xdg_toplevel_set_minimized(struct xdg_toplevel *xdg_toplevel)
static void xdg_toplevel_move(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial)
static void xdg_toplevel_set_user_data(struct xdg_toplevel *xdg_toplevel, void *user_data)
static int xdg_toplevel_add_listener(struct xdg_toplevel *xdg_toplevel, const struct xdg_toplevel_listener *listener, void *data)
static void xdg_toplevel_set_min_size(struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height)
static void xdg_toplevel_set_parent(struct xdg_toplevel *xdg_toplevel, struct xdg_toplevel *parent)
static void xdg_toplevel_show_window_menu(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
static void xdg_toplevel_destroy(struct xdg_toplevel *xdg_toplevel)
static void xdg_toplevel_unset_fullscreen(struct xdg_toplevel *xdg_toplevel)
@ XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM
@ XDG_TOPLEVEL_RESIZE_EDGE_RIGHT
@ XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT
@ XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT
@ XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT
@ XDG_TOPLEVEL_RESIZE_EDGE_NONE
@ XDG_TOPLEVEL_RESIZE_EDGE_LEFT
@ XDG_TOPLEVEL_RESIZE_EDGE_TOP
@ XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT
@ XDG_TOPLEVEL_STATE_MAXIMIZED
@ XDG_TOPLEVEL_STATE_ACTIVATED
@ XDG_TOPLEVEL_STATE_FULLSCREEN
@ XDG_TOPLEVEL_STATE_RESIZING
static struct xdg_positioner * xdg_wm_base_create_positioner(struct xdg_wm_base *xdg_wm_base)
static void xdg_wm_base_destroy(struct xdg_wm_base *xdg_wm_base)
static void xdg_wm_base_set_user_data(struct xdg_wm_base *xdg_wm_base, void *user_data)
static int xdg_wm_base_add_listener(struct xdg_wm_base *xdg_wm_base, const struct xdg_wm_base_listener *listener, void *data)
static void * xdg_wm_base_get_user_data(struct xdg_wm_base *xdg_wm_base)
static struct xdg_surface * xdg_wm_base_get_xdg_surface(struct xdg_wm_base *xdg_wm_base, struct wl_surface *surface)
static void xdg_wm_base_pong(struct xdg_wm_base *xdg_wm_base, uint32_t serial)
void(* configure)(void *data, struct xdg_popup *xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height)
void(* popup_done)(void *data, struct xdg_popup *xdg_popup)
void(* configure)(void *data, struct xdg_surface *xdg_surface, uint32_t serial)
void(* configure)(void *data, struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height, struct wl_array *states)
void(* close)(void *data, struct xdg_toplevel *xdg_toplevel)
void(* ping)(void *data, struct xdg_wm_base *xdg_wm_base, uint32_t serial)
#define XDG_TOPLEVEL_RESIZE
#define XDG_TOPLEVEL_UNSET_MAXIMIZED
#define XDG_POSITIONER_SET_ANCHOR
const struct wl_interface xdg_positioner_interface
@ XDG_SURFACE_ERROR_NOT_CONSTRUCTED
@ XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED
@ XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER
#define XDG_SURFACE_GET_TOPLEVEL
#define XDG_POSITIONER_SET_GRAVITY
#define XDG_TOPLEVEL_UNSET_FULLSCREEN
#define XDG_POPUP_DESTROY
static uint32_t xdg_popup_get_version(struct xdg_popup *xdg_popup)
#define XDG_POSITIONER_DESTROY
#define XDG_POPUP_GRAB
#define XDG_TOPLEVEL_SET_PARENT
const struct wl_interface xdg_wm_base_interface
#define XDG_TOPLEVEL_SET_MINIMIZED
const struct wl_interface xdg_toplevel_interface
#define XDG_TOPLEVEL_SET_APP_ID
@ XDG_POSITIONER_ANCHOR_TOP_RIGHT
@ XDG_POSITIONER_ANCHOR_BOTTOM
@ XDG_POSITIONER_ANCHOR_TOP_LEFT
@ XDG_POSITIONER_ANCHOR_RIGHT
@ XDG_POSITIONER_ANCHOR_TOP
@ XDG_POSITIONER_ANCHOR_LEFT
@ XDG_POSITIONER_ANCHOR_BOTTOM_LEFT
@ XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT
@ XDG_POSITIONER_ANCHOR_NONE
#define XDG_WM_BASE_GET_XDG_SURFACE
#define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT
static uint32_t xdg_positioner_get_version(struct xdg_positioner *xdg_positioner)
@ XDG_WM_BASE_ERROR_INVALID_POSITIONER
@ XDG_WM_BASE_ERROR_INVALID_POPUP_PARENT
@ XDG_WM_BASE_ERROR_DEFUNCT_SURFACES
@ XDG_WM_BASE_ERROR_INVALID_SURFACE_STATE
@ XDG_WM_BASE_ERROR_NOT_THE_TOPMOST_POPUP
@ XDG_WM_BASE_ERROR_ROLE
#define XDG_POSITIONER_SET_SIZE
#define XDG_TOPLEVEL_DESTROY
#define XDG_TOPLEVEL_SET_MAXIMIZED
#define XDG_TOPLEVEL_SET_TITLE
@ XDG_POPUP_ERROR_INVALID_GRAB
#define XDG_TOPLEVEL_SET_MAX_SIZE
#define XDG_SURFACE_SET_WINDOW_GEOMETRY
#define XDG_POSITIONER_SET_ANCHOR_RECT
const struct wl_interface xdg_popup_interface
@ XDG_POSITIONER_GRAVITY_LEFT
@ XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT
@ XDG_POSITIONER_GRAVITY_NONE
@ XDG_POSITIONER_GRAVITY_RIGHT
@ XDG_POSITIONER_GRAVITY_BOTTOM_LEFT
@ XDG_POSITIONER_GRAVITY_TOP
@ XDG_POSITIONER_GRAVITY_BOTTOM
@ XDG_POSITIONER_GRAVITY_TOP_LEFT
@ XDG_POSITIONER_GRAVITY_TOP_RIGHT
#define XDG_TOPLEVEL_MOVE
#define XDG_SURFACE_ACK_CONFIGURE
static uint32_t xdg_toplevel_get_version(struct xdg_toplevel *xdg_toplevel)
static uint32_t xdg_surface_get_version(struct xdg_surface *xdg_surface)
@ XDG_POSITIONER_ERROR_INVALID_INPUT
#define XDG_TOPLEVEL_SET_FULLSCREEN
static uint32_t xdg_wm_base_get_version(struct xdg_wm_base *xdg_wm_base)
#define XDG_WM_BASE_PONG
#define XDG_POSITIONER_SET_OFFSET
#define XDG_TOPLEVEL_SHOW_WINDOW_MENU
#define XDG_SURFACE_GET_POPUP
#define XDG_TOPLEVEL_SET_MIN_SIZE
#define XDG_SURFACE_DESTROY
#define XDG_WM_BASE_CREATE_POSITIONER
const struct wl_interface xdg_surface_interface
#define XDG_WM_BASE_DESTROY