commit c30e59b
pita
·
2026-07-17 11:49:40 +0000 UTC
parent c316e7e
xml
5 files changed,
+407,
-3223
+0,
-92
1@@ -1,92 +0,0 @@
2-/* Generated by wayland-scanner 1.25.0 */
3-
4-/*
5- * Copyright © 2017 Drew DeVault
6- *
7- * Permission to use, copy, modify, distribute, and sell this
8- * software and its documentation for any purpose is hereby granted
9- * without fee, provided that the above copyright notice appear in
10- * all copies and that both that copyright notice and this permission
11- * notice appear in supporting documentation, and that the name of
12- * the copyright holders not be used in advertising or publicity
13- * pertaining to distribution of the software without specific,
14- * written prior permission. The copyright holders make no
15- * representations about the suitability of this software for any
16- * purpose. It is provided "as is" without express or implied
17- * warranty.
18- *
19- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
22- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
24- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
26- * THIS SOFTWARE.
27- */
28-
29-#include <stdbool.h>
30-#include <stdlib.h>
31-#include <stdint.h>
32-#include "wayland-util.h"
33-
34-#ifndef __has_attribute
35-# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
36-#endif
37-
38-#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
39-#define WL_PRIVATE __attribute__ ((visibility("hidden")))
40-#else
41-#define WL_PRIVATE
42-#endif
43-
44-extern const struct wl_interface wl_output_interface;
45-extern const struct wl_interface wl_surface_interface;
46-extern const struct wl_interface xdg_popup_interface;
47-extern const struct wl_interface zwlr_layer_surface_v1_interface;
48-
49-static const struct wl_interface *wlr_layer_shell_unstable_v1_types[] = {
50- NULL,
51- NULL,
52- NULL,
53- NULL,
54- &zwlr_layer_surface_v1_interface,
55- &wl_surface_interface,
56- &wl_output_interface,
57- NULL,
58- NULL,
59- &xdg_popup_interface,
60-};
61-
62-static const struct wl_message zwlr_layer_shell_v1_requests[] = {
63- { "get_layer_surface", "no?ous", wlr_layer_shell_unstable_v1_types + 4 },
64-};
65-
66-WL_PRIVATE const struct wl_interface zwlr_layer_shell_v1_interface = {
67- "zwlr_layer_shell_v1", 1,
68- 1, zwlr_layer_shell_v1_requests,
69- 0, NULL,
70-};
71-
72-static const struct wl_message zwlr_layer_surface_v1_requests[] = {
73- { "set_size", "uu", wlr_layer_shell_unstable_v1_types + 0 },
74- { "set_anchor", "u", wlr_layer_shell_unstable_v1_types + 0 },
75- { "set_exclusive_zone", "i", wlr_layer_shell_unstable_v1_types + 0 },
76- { "set_margin", "iiii", wlr_layer_shell_unstable_v1_types + 0 },
77- { "set_keyboard_interactivity", "u", wlr_layer_shell_unstable_v1_types + 0 },
78- { "get_popup", "o", wlr_layer_shell_unstable_v1_types + 9 },
79- { "ack_configure", "u", wlr_layer_shell_unstable_v1_types + 0 },
80- { "destroy", "", wlr_layer_shell_unstable_v1_types + 0 },
81-};
82-
83-static const struct wl_message zwlr_layer_surface_v1_events[] = {
84- { "configure", "uuu", wlr_layer_shell_unstable_v1_types + 0 },
85- { "closed", "", wlr_layer_shell_unstable_v1_types + 0 },
86-};
87-
88-WL_PRIVATE const struct wl_interface zwlr_layer_surface_v1_interface = {
89- "zwlr_layer_surface_v1", 1,
90- 8, zwlr_layer_surface_v1_requests,
91- 2, zwlr_layer_surface_v1_events,
92-};
93-
+0,
-563
1@@ -1,563 +0,0 @@
2-/* Generated by wayland-scanner 1.25.0 */
3-
4-#ifndef WLR_LAYER_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H
5-#define WLR_LAYER_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H
6-
7-#include <stdint.h>
8-#include <stddef.h>
9-#include "wayland-client.h"
10-
11-#ifdef __cplusplus
12-extern "C" {
13-#endif
14-
15-/**
16- * @page page_wlr_layer_shell_unstable_v1 The wlr_layer_shell_unstable_v1 protocol
17- * @section page_ifaces_wlr_layer_shell_unstable_v1 Interfaces
18- * - @subpage page_iface_zwlr_layer_shell_v1 - create surfaces that are layers of the desktop
19- * - @subpage page_iface_zwlr_layer_surface_v1 - layer metadata interface
20- * @section page_copyright_wlr_layer_shell_unstable_v1 Copyright
21- * <pre>
22- *
23- * Copyright © 2017 Drew DeVault
24- *
25- * Permission to use, copy, modify, distribute, and sell this
26- * software and its documentation for any purpose is hereby granted
27- * without fee, provided that the above copyright notice appear in
28- * all copies and that both that copyright notice and this permission
29- * notice appear in supporting documentation, and that the name of
30- * the copyright holders not be used in advertising or publicity
31- * pertaining to distribution of the software without specific,
32- * written prior permission. The copyright holders make no
33- * representations about the suitability of this software for any
34- * purpose. It is provided "as is" without express or implied
35- * warranty.
36- *
37- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
38- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
39- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
40- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
41- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
42- * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
43- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
44- * THIS SOFTWARE.
45- * </pre>
46- */
47-struct wl_output;
48-struct wl_surface;
49-struct xdg_popup;
50-struct zwlr_layer_shell_v1;
51-struct zwlr_layer_surface_v1;
52-
53-#ifndef ZWLR_LAYER_SHELL_V1_INTERFACE
54-#define ZWLR_LAYER_SHELL_V1_INTERFACE
55-/**
56- * @page page_iface_zwlr_layer_shell_v1 zwlr_layer_shell_v1
57- * @section page_iface_zwlr_layer_shell_v1_desc Description
58- *
59- * Clients can use this interface to assign the surface_layer role to
60- * wl_surfaces. Such surfaces are assigned to a "layer" of the output and
61- * rendered with a defined z-depth respective to each other. They may also be
62- * anchored to the edges and corners of a screen and specify input handling
63- * semantics. This interface should be suitable for the implementation of
64- * many desktop shell components, and a broad number of other applications
65- * that interact with the desktop.
66- * @section page_iface_zwlr_layer_shell_v1_api API
67- * See @ref iface_zwlr_layer_shell_v1.
68- */
69-/**
70- * @defgroup iface_zwlr_layer_shell_v1 The zwlr_layer_shell_v1 interface
71- *
72- * Clients can use this interface to assign the surface_layer role to
73- * wl_surfaces. Such surfaces are assigned to a "layer" of the output and
74- * rendered with a defined z-depth respective to each other. They may also be
75- * anchored to the edges and corners of a screen and specify input handling
76- * semantics. This interface should be suitable for the implementation of
77- * many desktop shell components, and a broad number of other applications
78- * that interact with the desktop.
79- */
80-extern const struct wl_interface zwlr_layer_shell_v1_interface;
81-#endif
82-#ifndef ZWLR_LAYER_SURFACE_V1_INTERFACE
83-#define ZWLR_LAYER_SURFACE_V1_INTERFACE
84-/**
85- * @page page_iface_zwlr_layer_surface_v1 zwlr_layer_surface_v1
86- * @section page_iface_zwlr_layer_surface_v1_desc Description
87- *
88- * An interface that may be implemented by a wl_surface, for surfaces that
89- * are designed to be rendered as a layer of a stacked desktop-like
90- * environment.
91- *
92- * Layer surface state (size, anchor, exclusive zone, margin, interactivity)
93- * is double-buffered, and will be applied at the time wl_surface.commit of
94- * the corresponding wl_surface is called.
95- * @section page_iface_zwlr_layer_surface_v1_api API
96- * See @ref iface_zwlr_layer_surface_v1.
97- */
98-/**
99- * @defgroup iface_zwlr_layer_surface_v1 The zwlr_layer_surface_v1 interface
100- *
101- * An interface that may be implemented by a wl_surface, for surfaces that
102- * are designed to be rendered as a layer of a stacked desktop-like
103- * environment.
104- *
105- * Layer surface state (size, anchor, exclusive zone, margin, interactivity)
106- * is double-buffered, and will be applied at the time wl_surface.commit of
107- * the corresponding wl_surface is called.
108- */
109-extern const struct wl_interface zwlr_layer_surface_v1_interface;
110-#endif
111-
112-#ifndef ZWLR_LAYER_SHELL_V1_ERROR_ENUM
113-#define ZWLR_LAYER_SHELL_V1_ERROR_ENUM
114-enum zwlr_layer_shell_v1_error {
115- /**
116- * wl_surface has another role
117- */
118- ZWLR_LAYER_SHELL_V1_ERROR_ROLE = 0,
119- /**
120- * layer value is invalid
121- */
122- ZWLR_LAYER_SHELL_V1_ERROR_INVALID_LAYER = 1,
123- /**
124- * wl_surface has a buffer attached or committed
125- */
126- ZWLR_LAYER_SHELL_V1_ERROR_ALREADY_CONSTRUCTED = 2,
127-};
128-#endif /* ZWLR_LAYER_SHELL_V1_ERROR_ENUM */
129-
130-#ifndef ZWLR_LAYER_SHELL_V1_LAYER_ENUM
131-#define ZWLR_LAYER_SHELL_V1_LAYER_ENUM
132-/**
133- * @ingroup iface_zwlr_layer_shell_v1
134- * available layers for surfaces
135- *
136- * These values indicate which layers a surface can be rendered in. They
137- * are ordered by z depth, bottom-most first. Traditional shell surfaces
138- * will typically be rendered between the bottom and top layers.
139- * Fullscreen shell surfaces are typically rendered at the top layer.
140- * Multiple surfaces can share a single layer, and ordering within a
141- * single layer is undefined.
142- */
143-enum zwlr_layer_shell_v1_layer {
144- ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND = 0,
145- ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM = 1,
146- ZWLR_LAYER_SHELL_V1_LAYER_TOP = 2,
147- ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY = 3,
148-};
149-#endif /* ZWLR_LAYER_SHELL_V1_LAYER_ENUM */
150-
151-#define ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE 0
152-
153-
154-/**
155- * @ingroup iface_zwlr_layer_shell_v1
156- */
157-#define ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE_SINCE_VERSION 1
158-
159-/** @ingroup iface_zwlr_layer_shell_v1 */
160-static inline void
161-zwlr_layer_shell_v1_set_user_data(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1, void *user_data)
162-{
163- wl_proxy_set_user_data((struct wl_proxy *) zwlr_layer_shell_v1, user_data);
164-}
165-
166-/** @ingroup iface_zwlr_layer_shell_v1 */
167-static inline void *
168-zwlr_layer_shell_v1_get_user_data(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1)
169-{
170- return wl_proxy_get_user_data((struct wl_proxy *) zwlr_layer_shell_v1);
171-}
172-
173-static inline uint32_t
174-zwlr_layer_shell_v1_get_version(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1)
175-{
176- return wl_proxy_get_version((struct wl_proxy *) zwlr_layer_shell_v1);
177-}
178-
179-/** @ingroup iface_zwlr_layer_shell_v1 */
180-static inline void
181-zwlr_layer_shell_v1_destroy(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1)
182-{
183- wl_proxy_destroy((struct wl_proxy *) zwlr_layer_shell_v1);
184-}
185-
186-/**
187- * @ingroup iface_zwlr_layer_shell_v1
188- *
189- * Create a layer surface for an existing surface. This assigns the role of
190- * layer_surface, or raises a protocol error if another role is already
191- * assigned.
192- *
193- * Creating a layer surface from a wl_surface which has a buffer attached
194- * or committed is a client error, and any attempts by a client to attach
195- * or manipulate a buffer prior to the first layer_surface.configure call
196- * must also be treated as errors.
197- *
198- * You may pass NULL for output to allow the compositor to decide which
199- * output to use. Generally this will be the one that the user most
200- * recently interacted with.
201- *
202- * Clients can specify a namespace that defines the purpose of the layer
203- * surface.
204- */
205-static inline struct zwlr_layer_surface_v1 *
206-zwlr_layer_shell_v1_get_layer_surface(struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1, struct wl_surface *surface, struct wl_output *output, uint32_t layer, const char *namespace)
207-{
208- struct wl_proxy *id;
209-
210- id = wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_shell_v1,
211- ZWLR_LAYER_SHELL_V1_GET_LAYER_SURFACE, &zwlr_layer_surface_v1_interface, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_shell_v1), 0, NULL, surface, output, layer, namespace);
212-
213- return (struct zwlr_layer_surface_v1 *) id;
214-}
215-
216-#ifndef ZWLR_LAYER_SURFACE_V1_ERROR_ENUM
217-#define ZWLR_LAYER_SURFACE_V1_ERROR_ENUM
218-enum zwlr_layer_surface_v1_error {
219- /**
220- * provided surface state is invalid
221- */
222- ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SURFACE_STATE = 0,
223- /**
224- * size is invalid
225- */
226- ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_SIZE = 1,
227- /**
228- * anchor bitfield is invalid
229- */
230- ZWLR_LAYER_SURFACE_V1_ERROR_INVALID_ANCHOR = 2,
231-};
232-#endif /* ZWLR_LAYER_SURFACE_V1_ERROR_ENUM */
233-
234-#ifndef ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM
235-#define ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM
236-enum zwlr_layer_surface_v1_anchor {
237- /**
238- * the top edge of the anchor rectangle
239- */
240- ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP = 1,
241- /**
242- * the bottom edge of the anchor rectangle
243- */
244- ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM = 2,
245- /**
246- * the left edge of the anchor rectangle
247- */
248- ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT = 4,
249- /**
250- * the right edge of the anchor rectangle
251- */
252- ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT = 8,
253-};
254-#endif /* ZWLR_LAYER_SURFACE_V1_ANCHOR_ENUM */
255-
256-/**
257- * @ingroup iface_zwlr_layer_surface_v1
258- * @struct zwlr_layer_surface_v1_listener
259- */
260-struct zwlr_layer_surface_v1_listener {
261- /**
262- * suggest a surface change
263- *
264- * The configure event asks the client to resize its surface.
265- *
266- * Clients should arrange their surface for the new states, and
267- * then send an ack_configure request with the serial sent in this
268- * configure event at some point before committing the new surface.
269- *
270- * The client is free to dismiss all but the last configure event
271- * it received.
272- *
273- * The width and height arguments specify the size of the window in
274- * surface-local coordinates.
275- *
276- * The size is a hint, in the sense that the client is free to
277- * ignore it if it doesn't resize, pick a smaller size (to satisfy
278- * aspect ratio or resize in steps of NxM pixels). If the client
279- * picks a smaller size and is anchored to two opposite anchors
280- * (e.g. 'top' and 'bottom'), the surface will be centered on this
281- * axis.
282- *
283- * If the width or height arguments are zero, it means the client
284- * should decide its own window dimension.
285- */
286- void (*configure)(void *data,
287- struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1,
288- uint32_t serial,
289- uint32_t width,
290- uint32_t height);
291- /**
292- * surface should be closed
293- *
294- * The closed event is sent by the compositor when the surface
295- * will no longer be shown. The output may have been destroyed or
296- * the user may have asked for it to be removed. Further changes to
297- * the surface will be ignored. The client should destroy the
298- * resource after receiving this event, and create a new surface if
299- * they so choose.
300- */
301- void (*closed)(void *data,
302- struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1);
303-};
304-
305-/**
306- * @ingroup iface_zwlr_layer_surface_v1
307- */
308-static inline int
309-zwlr_layer_surface_v1_add_listener(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1,
310- const struct zwlr_layer_surface_v1_listener *listener, void *data)
311-{
312- return wl_proxy_add_listener((struct wl_proxy *) zwlr_layer_surface_v1,
313- (void (**)(void)) listener, data);
314-}
315-
316-#define ZWLR_LAYER_SURFACE_V1_SET_SIZE 0
317-#define ZWLR_LAYER_SURFACE_V1_SET_ANCHOR 1
318-#define ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE 2
319-#define ZWLR_LAYER_SURFACE_V1_SET_MARGIN 3
320-#define ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY 4
321-#define ZWLR_LAYER_SURFACE_V1_GET_POPUP 5
322-#define ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE 6
323-#define ZWLR_LAYER_SURFACE_V1_DESTROY 7
324-
325-/**
326- * @ingroup iface_zwlr_layer_surface_v1
327- */
328-#define ZWLR_LAYER_SURFACE_V1_CONFIGURE_SINCE_VERSION 1
329-/**
330- * @ingroup iface_zwlr_layer_surface_v1
331- */
332-#define ZWLR_LAYER_SURFACE_V1_CLOSED_SINCE_VERSION 1
333-
334-/**
335- * @ingroup iface_zwlr_layer_surface_v1
336- */
337-#define ZWLR_LAYER_SURFACE_V1_SET_SIZE_SINCE_VERSION 1
338-/**
339- * @ingroup iface_zwlr_layer_surface_v1
340- */
341-#define ZWLR_LAYER_SURFACE_V1_SET_ANCHOR_SINCE_VERSION 1
342-/**
343- * @ingroup iface_zwlr_layer_surface_v1
344- */
345-#define ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE_SINCE_VERSION 1
346-/**
347- * @ingroup iface_zwlr_layer_surface_v1
348- */
349-#define ZWLR_LAYER_SURFACE_V1_SET_MARGIN_SINCE_VERSION 1
350-/**
351- * @ingroup iface_zwlr_layer_surface_v1
352- */
353-#define ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY_SINCE_VERSION 1
354-/**
355- * @ingroup iface_zwlr_layer_surface_v1
356- */
357-#define ZWLR_LAYER_SURFACE_V1_GET_POPUP_SINCE_VERSION 1
358-/**
359- * @ingroup iface_zwlr_layer_surface_v1
360- */
361-#define ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE_SINCE_VERSION 1
362-/**
363- * @ingroup iface_zwlr_layer_surface_v1
364- */
365-#define ZWLR_LAYER_SURFACE_V1_DESTROY_SINCE_VERSION 1
366-
367-/** @ingroup iface_zwlr_layer_surface_v1 */
368-static inline void
369-zwlr_layer_surface_v1_set_user_data(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, void *user_data)
370-{
371- wl_proxy_set_user_data((struct wl_proxy *) zwlr_layer_surface_v1, user_data);
372-}
373-
374-/** @ingroup iface_zwlr_layer_surface_v1 */
375-static inline void *
376-zwlr_layer_surface_v1_get_user_data(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1)
377-{
378- return wl_proxy_get_user_data((struct wl_proxy *) zwlr_layer_surface_v1);
379-}
380-
381-static inline uint32_t
382-zwlr_layer_surface_v1_get_version(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1)
383-{
384- return wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1);
385-}
386-
387-/**
388- * @ingroup iface_zwlr_layer_surface_v1
389- *
390- * Sets the size of the surface in surface-local coordinates. The
391- * compositor will display the surface centered with respect to its
392- * anchors.
393- *
394- * If you pass 0 for either value, the compositor will assign it and
395- * inform you of the assignment in the configure event. You must set your
396- * anchor to opposite edges in the dimensions you omit; not doing so is a
397- * protocol error. Both values are 0 by default.
398- *
399- * Size is double-buffered, see wl_surface.commit.
400- */
401-static inline void
402-zwlr_layer_surface_v1_set_size(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t width, uint32_t height)
403-{
404- wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
405- ZWLR_LAYER_SURFACE_V1_SET_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, width, height);
406-}
407-
408-/**
409- * @ingroup iface_zwlr_layer_surface_v1
410- *
411- * Requests that the compositor anchor the surface to the specified edges
412- * and corners. If two orthoginal edges are specified (e.g. 'top' and
413- * 'left'), then the anchor point will be the intersection of the edges
414- * (e.g. the top left corner of the output); otherwise the anchor point
415- * will be centered on that edge, or in the center if none is specified.
416- *
417- * Anchor is double-buffered, see wl_surface.commit.
418- */
419-static inline void
420-zwlr_layer_surface_v1_set_anchor(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t anchor)
421-{
422- wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
423- ZWLR_LAYER_SURFACE_V1_SET_ANCHOR, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, anchor);
424-}
425-
426-/**
427- * @ingroup iface_zwlr_layer_surface_v1
428- *
429- * Requests that the compositor avoids occluding an area of the surface
430- * with other surfaces. The compositor's use of this information is
431- * implementation-dependent - do not assume that this region will not
432- * actually be occluded.
433- *
434- * A positive value is only meaningful if the surface is anchored to an
435- * edge, rather than a corner. The zone is the number of surface-local
436- * coordinates from the edge that are considered exclusive.
437- *
438- * Surfaces that do not wish to have an exclusive zone may instead specify
439- * how they should interact with surfaces that do. If set to zero, the
440- * surface indicates that it would like to be moved to avoid occluding
441- * surfaces with a positive excluzive zone. If set to -1, the surface
442- * indicates that it would not like to be moved to accommodate for other
443- * surfaces, and the compositor should extend it all the way to the edges
444- * it is anchored to.
445- *
446- * For example, a panel might set its exclusive zone to 10, so that
447- * maximized shell surfaces are not shown on top of it. A notification
448- * might set its exclusive zone to 0, so that it is moved to avoid
449- * occluding the panel, but shell surfaces are shown underneath it. A
450- * wallpaper or lock screen might set their exclusive zone to -1, so that
451- * they stretch below or over the panel.
452- *
453- * The default value is 0.
454- *
455- * Exclusive zone is double-buffered, see wl_surface.commit.
456- */
457-static inline void
458-zwlr_layer_surface_v1_set_exclusive_zone(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, int32_t zone)
459-{
460- wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
461- ZWLR_LAYER_SURFACE_V1_SET_EXCLUSIVE_ZONE, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, zone);
462-}
463-
464-/**
465- * @ingroup iface_zwlr_layer_surface_v1
466- *
467- * Requests that the surface be placed some distance away from the anchor
468- * point on the output, in surface-local coordinates. Setting this value
469- * for edges you are not anchored to has no effect.
470- *
471- * The exclusive zone includes the margin.
472- *
473- * Margin is double-buffered, see wl_surface.commit.
474- */
475-static inline void
476-zwlr_layer_surface_v1_set_margin(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, int32_t top, int32_t right, int32_t bottom, int32_t left)
477-{
478- wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
479- ZWLR_LAYER_SURFACE_V1_SET_MARGIN, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, top, right, bottom, left);
480-}
481-
482-/**
483- * @ingroup iface_zwlr_layer_surface_v1
484- *
485- * Set to 1 to request that the seat send keyboard events to this layer
486- * surface. For layers below the shell surface layer, the seat will use
487- * normal focus semantics. For layers above the shell surface layers, the
488- * seat will always give exclusive keyboard focus to the top-most layer
489- * which has keyboard interactivity set to true.
490- *
491- * Layer surfaces receive pointer, touch, and tablet events normally. If
492- * you do not want to receive them, set the input region on your surface
493- * to an empty region.
494- *
495- * Events is double-buffered, see wl_surface.commit.
496- */
497-static inline void
498-zwlr_layer_surface_v1_set_keyboard_interactivity(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t keyboard_interactivity)
499-{
500- wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
501- ZWLR_LAYER_SURFACE_V1_SET_KEYBOARD_INTERACTIVITY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, keyboard_interactivity);
502-}
503-
504-/**
505- * @ingroup iface_zwlr_layer_surface_v1
506- *
507- * This assigns an xdg_popup's parent to this layer_surface. This popup
508- * should have been created via xdg_surface::get_popup with the parent set
509- * to NULL, and this request must be invoked before committing the popup's
510- * initial state.
511- *
512- * See the documentation of xdg_popup for more details about what an
513- * xdg_popup is and how it is used.
514- */
515-static inline void
516-zwlr_layer_surface_v1_get_popup(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, struct xdg_popup *popup)
517-{
518- wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
519- ZWLR_LAYER_SURFACE_V1_GET_POPUP, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, popup);
520-}
521-
522-/**
523- * @ingroup iface_zwlr_layer_surface_v1
524- *
525- * When a configure event is received, if a client commits the
526- * surface in response to the configure event, then the client
527- * must make an ack_configure request sometime before the commit
528- * request, passing along the serial of the configure event.
529- *
530- * If the client receives multiple configure events before it
531- * can respond to one, it only has to ack the last configure event.
532- *
533- * A client is not required to commit immediately after sending
534- * an ack_configure request - it may even ack_configure several times
535- * before its next surface commit.
536- *
537- * A client may send multiple ack_configure requests before committing, but
538- * only the last request sent before a commit indicates which configure
539- * event the client really is responding to.
540- */
541-static inline void
542-zwlr_layer_surface_v1_ack_configure(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1, uint32_t serial)
543-{
544- wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
545- ZWLR_LAYER_SURFACE_V1_ACK_CONFIGURE, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), 0, serial);
546-}
547-
548-/**
549- * @ingroup iface_zwlr_layer_surface_v1
550- *
551- * This request destroys the layer surface.
552- */
553-static inline void
554-zwlr_layer_surface_v1_destroy(struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1)
555-{
556- wl_proxy_marshal_flags((struct wl_proxy *) zwlr_layer_surface_v1,
557- ZWLR_LAYER_SURFACE_V1_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) zwlr_layer_surface_v1), WL_MARSHAL_FLAG_DESTROY);
558-}
559-
560-#ifdef __cplusplus
561-}
562-#endif
563-
564-#endif
+407,
-0
1@@ -0,0 +1,407 @@
2+<?xml version="1.0" encoding="UTF-8"?>
3+<protocol name="wlr_layer_shell_unstable_v1">
4+ <copyright>
5+ Copyright © 2017 Drew DeVault
6+
7+ Permission to use, copy, modify, distribute, and sell this
8+ software and its documentation for any purpose is hereby granted
9+ without fee, provided that the above copyright notice appear in
10+ all copies and that both that copyright notice and this permission
11+ notice appear in supporting documentation, and that the name of
12+ the copyright holders not be used in advertising or publicity
13+ pertaining to distribution of the software without specific,
14+ written prior permission. The copyright holders make no
15+ representations about the suitability of this software for any
16+ purpose. It is provided "as is" without express or implied
17+ warranty.
18+
19+ THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
20+ SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
21+ FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
22+ SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
23+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
24+ AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
25+ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
26+ THIS SOFTWARE.
27+ </copyright>
28+
29+ <interface name="zwlr_layer_shell_v1" version="5">
30+ <description summary="create surfaces that are layers of the desktop">
31+ Clients can use this interface to assign the surface_layer role to
32+ wl_surfaces. Such surfaces are assigned to a "layer" of the output and
33+ rendered with a defined z-depth respective to each other. They may also be
34+ anchored to the edges and corners of a screen and specify input handling
35+ semantics. This interface should be suitable for the implementation of
36+ many desktop shell components, and a broad number of other applications
37+ that interact with the desktop.
38+ </description>
39+
40+ <request name="get_layer_surface">
41+ <description summary="create a layer_surface from a surface">
42+ Create a layer surface for an existing surface. This assigns the role of
43+ layer_surface, or raises a protocol error if another role is already
44+ assigned.
45+
46+ Creating a layer surface from a wl_surface which has a buffer attached
47+ or committed is a client error, and any attempts by a client to attach
48+ or manipulate a buffer prior to the first layer_surface.configure call
49+ must also be treated as errors.
50+
51+ After creating a layer_surface object and setting it up, the client
52+ must perform an initial commit without any buffer attached.
53+ The compositor will reply with a layer_surface.configure event.
54+ The client must acknowledge it and is then allowed to attach a buffer
55+ to map the surface.
56+
57+ You may pass NULL for output to allow the compositor to decide which
58+ output to use. Generally this will be the one that the user most
59+ recently interacted with.
60+
61+ Clients can specify a namespace that defines the purpose of the layer
62+ surface.
63+ </description>
64+ <arg name="id" type="new_id" interface="zwlr_layer_surface_v1"/>
65+ <arg name="surface" type="object" interface="wl_surface"/>
66+ <arg name="output" type="object" interface="wl_output" allow-null="true"/>
67+ <arg name="layer" type="uint" enum="layer" summary="layer to add this surface to"/>
68+ <arg name="namespace" type="string" summary="namespace for the layer surface"/>
69+ </request>
70+
71+ <enum name="error">
72+ <entry name="role" value="0" summary="wl_surface has another role"/>
73+ <entry name="invalid_layer" value="1" summary="layer value is invalid"/>
74+ <entry name="already_constructed" value="2" summary="wl_surface has a buffer attached or committed"/>
75+ </enum>
76+
77+ <enum name="layer">
78+ <description summary="available layers for surfaces">
79+ These values indicate which layers a surface can be rendered in. They
80+ are ordered by z depth, bottom-most first. Traditional shell surfaces
81+ will typically be rendered between the bottom and top layers.
82+ Fullscreen shell surfaces are typically rendered at the top layer.
83+ Multiple surfaces can share a single layer, and ordering within a
84+ single layer is undefined.
85+ </description>
86+
87+ <entry name="background" value="0"/>
88+ <entry name="bottom" value="1"/>
89+ <entry name="top" value="2"/>
90+ <entry name="overlay" value="3"/>
91+ </enum>
92+
93+ <!-- Version 3 additions -->
94+
95+ <request name="destroy" type="destructor" since="3">
96+ <description summary="destroy the layer_shell object">
97+ This request indicates that the client will not use the layer_shell
98+ object any more. Objects that have been created through this instance
99+ are not affected.
100+ </description>
101+ </request>
102+ </interface>
103+
104+ <interface name="zwlr_layer_surface_v1" version="5">
105+ <description summary="layer metadata interface">
106+ An interface that may be implemented by a wl_surface, for surfaces that
107+ are designed to be rendered as a layer of a stacked desktop-like
108+ environment.
109+
110+ Layer surface state (layer, size, anchor, exclusive zone,
111+ margin, interactivity) is double-buffered, and will be applied at the
112+ time wl_surface.commit of the corresponding wl_surface is called.
113+
114+ Attaching a null buffer to a layer surface unmaps it.
115+
116+ Unmapping a layer_surface means that the surface cannot be shown by the
117+ compositor until it is explicitly mapped again. The layer_surface
118+ returns to the state it had right after layer_shell.get_layer_surface.
119+ The client can re-map the surface by performing a commit without any
120+ buffer attached, waiting for a configure event and handling it as usual.
121+ </description>
122+
123+ <request name="set_size">
124+ <description summary="sets the size of the surface">
125+ Sets the size of the surface in surface-local coordinates. The
126+ compositor will display the surface centered with respect to its
127+ anchors.
128+
129+ If you pass 0 for either value, the compositor will assign it and
130+ inform you of the assignment in the configure event. You must set your
131+ anchor to opposite edges in the dimensions you omit; not doing so is a
132+ protocol error. Both values are 0 by default.
133+
134+ Size is double-buffered, see wl_surface.commit.
135+ </description>
136+ <arg name="width" type="uint"/>
137+ <arg name="height" type="uint"/>
138+ </request>
139+
140+ <request name="set_anchor">
141+ <description summary="configures the anchor point of the surface">
142+ Requests that the compositor anchor the surface to the specified edges
143+ and corners. If two orthogonal edges are specified (e.g. 'top' and
144+ 'left'), then the anchor point will be the intersection of the edges
145+ (e.g. the top left corner of the output); otherwise the anchor point
146+ will be centered on that edge, or in the center if none is specified.
147+
148+ Anchor is double-buffered, see wl_surface.commit.
149+ </description>
150+ <arg name="anchor" type="uint" enum="anchor"/>
151+ </request>
152+
153+ <request name="set_exclusive_zone">
154+ <description summary="configures the exclusive geometry of this surface">
155+ Requests that the compositor avoids occluding an area with other
156+ surfaces. The compositor's use of this information is
157+ implementation-dependent - do not assume that this region will not
158+ actually be occluded.
159+
160+ A positive value is only meaningful if the surface is anchored to one
161+ edge or an edge and both perpendicular edges. If the surface is not
162+ anchored, anchored to only two perpendicular edges (a corner), anchored
163+ to only two parallel edges or anchored to all edges, a positive value
164+ will be treated the same as zero.
165+
166+ A positive zone is the distance from the edge in surface-local
167+ coordinates to consider exclusive.
168+
169+ Surfaces that do not wish to have an exclusive zone may instead specify
170+ how they should interact with surfaces that do. If set to zero, the
171+ surface indicates that it would like to be moved to avoid occluding
172+ surfaces with a positive exclusive zone. If set to -1, the surface
173+ indicates that it would not like to be moved to accommodate for other
174+ surfaces, and the compositor should extend it all the way to the edges
175+ it is anchored to.
176+
177+ For example, a panel might set its exclusive zone to 10, so that
178+ maximized shell surfaces are not shown on top of it. A notification
179+ might set its exclusive zone to 0, so that it is moved to avoid
180+ occluding the panel, but shell surfaces are shown underneath it. A
181+ wallpaper or lock screen might set their exclusive zone to -1, so that
182+ they stretch below or over the panel.
183+
184+ The default value is 0.
185+
186+ Exclusive zone is double-buffered, see wl_surface.commit.
187+ </description>
188+ <arg name="zone" type="int"/>
189+ </request>
190+
191+ <request name="set_margin">
192+ <description summary="sets a margin from the anchor point">
193+ Requests that the surface be placed some distance away from the anchor
194+ point on the output, in surface-local coordinates. Setting this value
195+ for edges you are not anchored to has no effect.
196+
197+ The exclusive zone includes the margin.
198+
199+ Margin is double-buffered, see wl_surface.commit.
200+ </description>
201+ <arg name="top" type="int"/>
202+ <arg name="right" type="int"/>
203+ <arg name="bottom" type="int"/>
204+ <arg name="left" type="int"/>
205+ </request>
206+
207+ <enum name="keyboard_interactivity">
208+ <description summary="types of keyboard interaction possible for a layer shell surface">
209+ Types of keyboard interaction possible for layer shell surfaces. The
210+ rationale for this is twofold: (1) some applications are not interested
211+ in keyboard events and not allowing them to be focused can improve the
212+ desktop experience; (2) some applications will want to take exclusive
213+ keyboard focus.
214+ </description>
215+
216+ <entry name="none" value="0">
217+ <description summary="no keyboard focus is possible">
218+ This value indicates that this surface is not interested in keyboard
219+ events and the compositor should never assign it the keyboard focus.
220+
221+ This is the default value, set for newly created layer shell surfaces.
222+
223+ This is useful for e.g. desktop widgets that display information or
224+ only have interaction with non-keyboard input devices.
225+ </description>
226+ </entry>
227+ <entry name="exclusive" value="1">
228+ <description summary="request exclusive keyboard focus">
229+ Request exclusive keyboard focus if this surface is above the shell surface layer.
230+
231+ For the top and overlay layers, the seat will always give
232+ exclusive keyboard focus to the top-most layer which has keyboard
233+ interactivity set to exclusive. If this layer contains multiple
234+ surfaces with keyboard interactivity set to exclusive, the compositor
235+ determines the one receiving keyboard events in an implementation-
236+ defined manner. In this case, no guarantee is made when this surface
237+ will receive keyboard focus (if ever).
238+
239+ For the bottom and background layers, the compositor is allowed to use
240+ normal focus semantics.
241+
242+ This setting is mainly intended for applications that need to ensure
243+ they receive all keyboard events, such as a lock screen or a password
244+ prompt.
245+ </description>
246+ </entry>
247+ <entry name="on_demand" value="2" since="4">
248+ <description summary="request regular keyboard focus semantics">
249+ This requests the compositor to allow this surface to be focused and
250+ unfocused by the user in an implementation-defined manner. The user
251+ should be able to unfocus this surface even regardless of the layer
252+ it is on.
253+
254+ Typically, the compositor will want to use its normal mechanism to
255+ manage keyboard focus between layer shell surfaces with this setting
256+ and regular toplevels on the desktop layer (e.g. click to focus).
257+ Nevertheless, it is possible for a compositor to require a special
258+ interaction to focus or unfocus layer shell surfaces (e.g. requiring
259+ a click even if focus follows the mouse normally, or providing a
260+ keybinding to switch focus between layers).
261+
262+ This setting is mainly intended for desktop shell components (e.g.
263+ panels) that allow keyboard interaction. Using this option can allow
264+ implementing a desktop shell that can be fully usable without the
265+ mouse.
266+ </description>
267+ </entry>
268+ </enum>
269+
270+ <request name="set_keyboard_interactivity">
271+ <description summary="requests keyboard events">
272+ Set how keyboard events are delivered to this surface. By default,
273+ layer shell surfaces do not receive keyboard events; this request can
274+ be used to change this.
275+
276+ This setting is inherited by child surfaces set by the get_popup
277+ request.
278+
279+ Layer surfaces receive pointer, touch, and tablet events normally. If
280+ you do not want to receive them, set the input region on your surface
281+ to an empty region.
282+
283+ Keyboard interactivity is double-buffered, see wl_surface.commit.
284+ </description>
285+ <arg name="keyboard_interactivity" type="uint" enum="keyboard_interactivity"/>
286+ </request>
287+
288+ <request name="get_popup">
289+ <description summary="assign this layer_surface as an xdg_popup parent">
290+ This assigns an xdg_popup's parent to this layer_surface. This popup
291+ should have been created via xdg_surface::get_popup with the parent set
292+ to NULL, and this request must be invoked before committing the popup's
293+ initial state.
294+
295+ See the documentation of xdg_popup for more details about what an
296+ xdg_popup is and how it is used.
297+ </description>
298+ <arg name="popup" type="object" interface="xdg_popup"/>
299+ </request>
300+
301+ <request name="ack_configure">
302+ <description summary="ack a configure event">
303+ When a configure event is received, if a client commits the
304+ surface in response to the configure event, then the client
305+ must make an ack_configure request sometime before the commit
306+ request, passing along the serial of the configure event.
307+
308+ If the client receives multiple configure events before it
309+ can respond to one, it only has to ack the last configure event.
310+
311+ A client is not required to commit immediately after sending
312+ an ack_configure request - it may even ack_configure several times
313+ before its next surface commit.
314+
315+ A client may send multiple ack_configure requests before committing, but
316+ only the last request sent before a commit indicates which configure
317+ event the client really is responding to.
318+ </description>
319+ <arg name="serial" type="uint" summary="the serial from the configure event"/>
320+ </request>
321+
322+ <request name="destroy" type="destructor">
323+ <description summary="destroy the layer_surface">
324+ This request destroys the layer surface.
325+ </description>
326+ </request>
327+
328+ <event name="configure">
329+ <description summary="suggest a surface change">
330+ The configure event asks the client to resize its surface.
331+
332+ Clients should arrange their surface for the new states, and then send
333+ an ack_configure request with the serial sent in this configure event at
334+ some point before committing the new surface.
335+
336+ The client is free to dismiss all but the last configure event it
337+ received.
338+
339+ The width and height arguments specify the size of the window in
340+ surface-local coordinates.
341+
342+ The size is a hint, in the sense that the client is free to ignore it if
343+ it doesn't resize, pick a smaller size (to satisfy aspect ratio or
344+ resize in steps of NxM pixels). If the client picks a smaller size and
345+ is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the
346+ surface will be centered on this axis.
347+
348+ If the width or height arguments are zero, it means the client should
349+ decide its own window dimension.
350+ </description>
351+ <arg name="serial" type="uint"/>
352+ <arg name="width" type="uint"/>
353+ <arg name="height" type="uint"/>
354+ </event>
355+
356+ <event name="closed">
357+ <description summary="surface should be closed">
358+ The closed event is sent by the compositor when the surface will no
359+ longer be shown. The output may have been destroyed or the user may
360+ have asked for it to be removed. Further changes to the surface will be
361+ ignored. The client should destroy the resource after receiving this
362+ event, and create a new surface if they so choose.
363+ </description>
364+ </event>
365+
366+ <enum name="error">
367+ <entry name="invalid_surface_state" value="0" summary="provided surface state is invalid"/>
368+ <entry name="invalid_size" value="1" summary="size is invalid"/>
369+ <entry name="invalid_anchor" value="2" summary="anchor bitfield is invalid"/>
370+ <entry name="invalid_keyboard_interactivity" value="3" summary="keyboard interactivity is invalid"/>
371+ <entry name="invalid_exclusive_edge" value="4" summary="exclusive edge is invalid given the surface anchors"/>
372+ </enum>
373+
374+ <enum name="anchor" bitfield="true">
375+ <entry name="top" value="1" summary="the top edge of the anchor rectangle"/>
376+ <entry name="bottom" value="2" summary="the bottom edge of the anchor rectangle"/>
377+ <entry name="left" value="4" summary="the left edge of the anchor rectangle"/>
378+ <entry name="right" value="8" summary="the right edge of the anchor rectangle"/>
379+ </enum>
380+
381+ <!-- Version 2 additions -->
382+
383+ <request name="set_layer" since="2">
384+ <description summary="change the layer of the surface">
385+ Change the layer that the surface is rendered on.
386+
387+ Layer is double-buffered, see wl_surface.commit.
388+ </description>
389+ <arg name="layer" type="uint" enum="zwlr_layer_shell_v1.layer" summary="layer to move this surface to"/>
390+ </request>
391+
392+ <!-- Version 5 additions -->
393+
394+ <request name="set_exclusive_edge" since="5">
395+ <description summary="set the edge the exclusive zone will be applied to">
396+ Requests an edge for the exclusive zone to apply. The exclusive
397+ edge will be automatically deduced from anchor points when possible,
398+ but when the surface is anchored to a corner, it will be necessary
399+ to set it explicitly to disambiguate, as it is not possible to deduce
400+ which one of the two corner edges should be used.
401+
402+ The edge must be one the surface is anchored to, otherwise the
403+ invalid_exclusive_edge protocol error will be raised.
404+ </description>
405+ <arg name="edge" type="uint" enum="anchor"/>
406+ </request>
407+ </interface>
408+</protocol>
+0,
-2384
1@@ -1,2384 +0,0 @@
2-/* Generated by wayland-scanner 1.25.0 */
3-
4-#ifndef XDG_SHELL_CLIENT_PROTOCOL_H
5-#define XDG_SHELL_CLIENT_PROTOCOL_H
6-
7-#include <stdint.h>
8-#include <stddef.h>
9-#include "wayland-client.h"
10-
11-#ifdef __cplusplus
12-extern "C" {
13-#endif
14-
15-/**
16- * @page page_xdg_shell The xdg_shell protocol
17- * @section page_ifaces_xdg_shell Interfaces
18- * - @subpage page_iface_xdg_wm_base - create desktop-style surfaces
19- * - @subpage page_iface_xdg_positioner - child surface positioner
20- * - @subpage page_iface_xdg_surface - desktop user interface surface base interface
21- * - @subpage page_iface_xdg_toplevel - toplevel surface
22- * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus
23- * @section page_copyright_xdg_shell Copyright
24- * <pre>
25- *
26- * Copyright © 2008-2013 Kristian Høgsberg
27- * Copyright © 2013 Rafael Antognolli
28- * Copyright © 2013 Jasper St. Pierre
29- * Copyright © 2010-2013 Intel Corporation
30- * Copyright © 2015-2017 Samsung Electronics Co., Ltd
31- * Copyright © 2015-2017 Red Hat Inc.
32- *
33- * Permission is hereby granted, free of charge, to any person obtaining a
34- * copy of this software and associated documentation files (the "Software"),
35- * to deal in the Software without restriction, including without limitation
36- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
37- * and/or sell copies of the Software, and to permit persons to whom the
38- * Software is furnished to do so, subject to the following conditions:
39- *
40- * The above copyright notice and this permission notice (including the next
41- * paragraph) shall be included in all copies or substantial portions of the
42- * Software.
43- *
44- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
46- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
47- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
48- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
49- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
50- * DEALINGS IN THE SOFTWARE.
51- * </pre>
52- */
53-struct wl_output;
54-struct wl_seat;
55-struct wl_surface;
56-struct xdg_popup;
57-struct xdg_positioner;
58-struct xdg_surface;
59-struct xdg_toplevel;
60-struct xdg_wm_base;
61-
62-#ifndef XDG_WM_BASE_INTERFACE
63-#define XDG_WM_BASE_INTERFACE
64-/**
65- * @page page_iface_xdg_wm_base xdg_wm_base
66- * @section page_iface_xdg_wm_base_desc Description
67- *
68- * The xdg_wm_base interface is exposed as a global object enabling clients
69- * to turn their wl_surfaces into windows in a desktop environment. It
70- * defines the basic functionality needed for clients and the compositor to
71- * create windows that can be dragged, resized, maximized, etc, as well as
72- * creating transient windows such as popup menus.
73- * @section page_iface_xdg_wm_base_api API
74- * See @ref iface_xdg_wm_base.
75- */
76-/**
77- * @defgroup iface_xdg_wm_base The xdg_wm_base interface
78- *
79- * The xdg_wm_base interface is exposed as a global object enabling clients
80- * to turn their wl_surfaces into windows in a desktop environment. It
81- * defines the basic functionality needed for clients and the compositor to
82- * create windows that can be dragged, resized, maximized, etc, as well as
83- * creating transient windows such as popup menus.
84- */
85-extern const struct wl_interface xdg_wm_base_interface;
86-#endif
87-#ifndef XDG_POSITIONER_INTERFACE
88-#define XDG_POSITIONER_INTERFACE
89-/**
90- * @page page_iface_xdg_positioner xdg_positioner
91- * @section page_iface_xdg_positioner_desc Description
92- *
93- * The xdg_positioner provides a collection of rules for the placement of a
94- * child surface relative to a parent surface. Rules can be defined to ensure
95- * the child surface remains within the visible area's borders, and to
96- * specify how the child surface changes its position, such as sliding along
97- * an axis, or flipping around a rectangle. These positioner-created rules are
98- * constrained by the requirement that a child surface must intersect with or
99- * be at least partially adjacent to its parent surface.
100- *
101- * See the various requests for details about possible rules.
102- *
103- * At the time of the request, the compositor makes a copy of the rules
104- * specified by the xdg_positioner. Thus, after the request is complete the
105- * xdg_positioner object can be destroyed or reused; further changes to the
106- * object will have no effect on previous usages.
107- *
108- * For an xdg_positioner object to be considered complete, it must have a
109- * non-zero size set by set_size, and a non-zero anchor rectangle set by
110- * set_anchor_rect. Passing an incomplete xdg_positioner object when
111- * positioning a surface raises an invalid_positioner error.
112- * @section page_iface_xdg_positioner_api API
113- * See @ref iface_xdg_positioner.
114- */
115-/**
116- * @defgroup iface_xdg_positioner The xdg_positioner interface
117- *
118- * The xdg_positioner provides a collection of rules for the placement of a
119- * child surface relative to a parent surface. Rules can be defined to ensure
120- * the child surface remains within the visible area's borders, and to
121- * specify how the child surface changes its position, such as sliding along
122- * an axis, or flipping around a rectangle. These positioner-created rules are
123- * constrained by the requirement that a child surface must intersect with or
124- * be at least partially adjacent to its parent surface.
125- *
126- * See the various requests for details about possible rules.
127- *
128- * At the time of the request, the compositor makes a copy of the rules
129- * specified by the xdg_positioner. Thus, after the request is complete the
130- * xdg_positioner object can be destroyed or reused; further changes to the
131- * object will have no effect on previous usages.
132- *
133- * For an xdg_positioner object to be considered complete, it must have a
134- * non-zero size set by set_size, and a non-zero anchor rectangle set by
135- * set_anchor_rect. Passing an incomplete xdg_positioner object when
136- * positioning a surface raises an invalid_positioner error.
137- */
138-extern const struct wl_interface xdg_positioner_interface;
139-#endif
140-#ifndef XDG_SURFACE_INTERFACE
141-#define XDG_SURFACE_INTERFACE
142-/**
143- * @page page_iface_xdg_surface xdg_surface
144- * @section page_iface_xdg_surface_desc Description
145- *
146- * An interface that may be implemented by a wl_surface, for
147- * implementations that provide a desktop-style user interface.
148- *
149- * It provides a base set of functionality required to construct user
150- * interface elements requiring management by the compositor, such as
151- * toplevel windows, menus, etc. The types of functionality are split into
152- * xdg_surface roles.
153- *
154- * Creating an xdg_surface does not set the role for a wl_surface. In order
155- * to map an xdg_surface, the client must create a role-specific object
156- * using, e.g., get_toplevel, get_popup. The wl_surface for any given
157- * xdg_surface can have at most one role, and may not be assigned any role
158- * not based on xdg_surface.
159- *
160- * A role must be assigned before any other requests are made to the
161- * xdg_surface object.
162- *
163- * The client must call wl_surface.commit on the corresponding wl_surface
164- * for the xdg_surface state to take effect.
165- *
166- * Creating an xdg_surface from a wl_surface which has a buffer attached or
167- * committed is a client error, and any attempts by a client to attach or
168- * manipulate a buffer prior to the first xdg_surface.configure call must
169- * also be treated as errors.
170- *
171- * After creating a role-specific object and setting it up (e.g. by sending
172- * the title, app ID, size constraints, parent, etc), the client must
173- * perform an initial commit without any buffer attached. The compositor
174- * will reply with initial wl_surface state such as
175- * wl_surface.preferred_buffer_scale followed by an xdg_surface.configure
176- * event. The client must acknowledge it and is then allowed to attach a
177- * buffer to map the surface.
178- *
179- * Mapping an xdg_surface-based role surface is defined as making it
180- * possible for the surface to be shown by the compositor. Note that
181- * a mapped surface is not guaranteed to be visible once it is mapped.
182- *
183- * For an xdg_surface to be mapped by the compositor, the following
184- * conditions must be met:
185- * (1) the client has assigned an xdg_surface-based role to the surface
186- * (2) the client has set and committed the xdg_surface state and the
187- * role-dependent state to the surface
188- * (3) the client has committed a buffer to the surface
189- *
190- * A newly-unmapped surface is considered to have met condition (1) out
191- * of the 3 required conditions for mapping a surface if its role surface
192- * has not been destroyed, i.e. the client must perform the initial commit
193- * again before attaching a buffer.
194- * @section page_iface_xdg_surface_api API
195- * See @ref iface_xdg_surface.
196- */
197-/**
198- * @defgroup iface_xdg_surface The xdg_surface interface
199- *
200- * An interface that may be implemented by a wl_surface, for
201- * implementations that provide a desktop-style user interface.
202- *
203- * It provides a base set of functionality required to construct user
204- * interface elements requiring management by the compositor, such as
205- * toplevel windows, menus, etc. The types of functionality are split into
206- * xdg_surface roles.
207- *
208- * Creating an xdg_surface does not set the role for a wl_surface. In order
209- * to map an xdg_surface, the client must create a role-specific object
210- * using, e.g., get_toplevel, get_popup. The wl_surface for any given
211- * xdg_surface can have at most one role, and may not be assigned any role
212- * not based on xdg_surface.
213- *
214- * A role must be assigned before any other requests are made to the
215- * xdg_surface object.
216- *
217- * The client must call wl_surface.commit on the corresponding wl_surface
218- * for the xdg_surface state to take effect.
219- *
220- * Creating an xdg_surface from a wl_surface which has a buffer attached or
221- * committed is a client error, and any attempts by a client to attach or
222- * manipulate a buffer prior to the first xdg_surface.configure call must
223- * also be treated as errors.
224- *
225- * After creating a role-specific object and setting it up (e.g. by sending
226- * the title, app ID, size constraints, parent, etc), the client must
227- * perform an initial commit without any buffer attached. The compositor
228- * will reply with initial wl_surface state such as
229- * wl_surface.preferred_buffer_scale followed by an xdg_surface.configure
230- * event. The client must acknowledge it and is then allowed to attach a
231- * buffer to map the surface.
232- *
233- * Mapping an xdg_surface-based role surface is defined as making it
234- * possible for the surface to be shown by the compositor. Note that
235- * a mapped surface is not guaranteed to be visible once it is mapped.
236- *
237- * For an xdg_surface to be mapped by the compositor, the following
238- * conditions must be met:
239- * (1) the client has assigned an xdg_surface-based role to the surface
240- * (2) the client has set and committed the xdg_surface state and the
241- * role-dependent state to the surface
242- * (3) the client has committed a buffer to the surface
243- *
244- * A newly-unmapped surface is considered to have met condition (1) out
245- * of the 3 required conditions for mapping a surface if its role surface
246- * has not been destroyed, i.e. the client must perform the initial commit
247- * again before attaching a buffer.
248- */
249-extern const struct wl_interface xdg_surface_interface;
250-#endif
251-#ifndef XDG_TOPLEVEL_INTERFACE
252-#define XDG_TOPLEVEL_INTERFACE
253-/**
254- * @page page_iface_xdg_toplevel xdg_toplevel
255- * @section page_iface_xdg_toplevel_desc Description
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- * A xdg_toplevel by default is responsible for providing the full intended
264- * visual representation of the toplevel, which depending on the window
265- * state, may mean things like a title bar, window controls and drop shadow.
266- *
267- * Unmapping an xdg_toplevel means that the surface cannot be shown
268- * by the compositor until it is explicitly mapped again.
269- * All active operations (e.g., move, resize) are canceled and all
270- * attributes (e.g. title, state, stacking, ...) are discarded for
271- * an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to
272- * the state it had right after xdg_surface.get_toplevel. The client
273- * can re-map the toplevel by performing a commit without any buffer
274- * attached, waiting for a configure event and handling it as usual (see
275- * xdg_surface description).
276- *
277- * Attaching a null buffer to a toplevel unmaps the surface.
278- * @section page_iface_xdg_toplevel_api API
279- * See @ref iface_xdg_toplevel.
280- */
281-/**
282- * @defgroup iface_xdg_toplevel The xdg_toplevel interface
283- *
284- * This interface defines an xdg_surface role which allows a surface to,
285- * among other things, set window-like properties such as maximize,
286- * fullscreen, and minimize, set application-specific metadata like title and
287- * id, and well as trigger user interactive operations such as interactive
288- * resize and move.
289- *
290- * A xdg_toplevel by default is responsible for providing the full intended
291- * visual representation of the toplevel, which depending on the window
292- * state, may mean things like a title bar, window controls and drop shadow.
293- *
294- * Unmapping an xdg_toplevel means that the surface cannot be shown
295- * by the compositor until it is explicitly mapped again.
296- * All active operations (e.g., move, resize) are canceled and all
297- * attributes (e.g. title, state, stacking, ...) are discarded for
298- * an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to
299- * the state it had right after xdg_surface.get_toplevel. The client
300- * can re-map the toplevel by performing a commit without any buffer
301- * attached, waiting for a configure event and handling it as usual (see
302- * xdg_surface description).
303- *
304- * Attaching a null buffer to a toplevel unmaps the surface.
305- */
306-extern const struct wl_interface xdg_toplevel_interface;
307-#endif
308-#ifndef XDG_POPUP_INTERFACE
309-#define XDG_POPUP_INTERFACE
310-/**
311- * @page page_iface_xdg_popup xdg_popup
312- * @section page_iface_xdg_popup_desc Description
313- *
314- * A popup surface is a short-lived, temporary surface. It can be used to
315- * implement for example menus, popovers, tooltips and other similar user
316- * interface concepts.
317- *
318- * A popup can be made to take an explicit grab. See xdg_popup.grab for
319- * details.
320- *
321- * When the popup is dismissed, a popup_done event will be sent out, and at
322- * the same time the surface will be unmapped. See the xdg_popup.popup_done
323- * event for details.
324- *
325- * Explicitly destroying the xdg_popup object will also dismiss the popup and
326- * unmap the surface. Clients that want to dismiss the popup when another
327- * surface of their own is clicked should dismiss the popup using the destroy
328- * request.
329- *
330- * A newly created xdg_popup will be stacked on top of all previously created
331- * xdg_popup surfaces associated with the same xdg_toplevel.
332- *
333- * The parent of an xdg_popup must be mapped (see the xdg_surface
334- * description) before the xdg_popup itself.
335- *
336- * The client must call wl_surface.commit on the corresponding wl_surface
337- * for the xdg_popup state to take effect.
338- * @section page_iface_xdg_popup_api API
339- * See @ref iface_xdg_popup.
340- */
341-/**
342- * @defgroup iface_xdg_popup The xdg_popup interface
343- *
344- * A popup surface is a short-lived, temporary surface. It can be used to
345- * implement for example menus, popovers, tooltips and other similar user
346- * interface concepts.
347- *
348- * A popup can be made to take an explicit grab. See xdg_popup.grab for
349- * details.
350- *
351- * When the popup is dismissed, a popup_done event will be sent out, and at
352- * the same time the surface will be unmapped. See the xdg_popup.popup_done
353- * event for details.
354- *
355- * Explicitly destroying the xdg_popup object will also dismiss the popup and
356- * unmap the surface. Clients that want to dismiss the popup when another
357- * surface of their own is clicked should dismiss the popup using the destroy
358- * request.
359- *
360- * A newly created xdg_popup will be stacked on top of all previously created
361- * xdg_popup surfaces associated with the same xdg_toplevel.
362- *
363- * The parent of an xdg_popup must be mapped (see the xdg_surface
364- * description) before the xdg_popup itself.
365- *
366- * The client must call wl_surface.commit on the corresponding wl_surface
367- * for the xdg_popup state to take effect.
368- */
369-extern const struct wl_interface xdg_popup_interface;
370-#endif
371-
372-#ifndef XDG_WM_BASE_ERROR_ENUM
373-#define XDG_WM_BASE_ERROR_ENUM
374-enum xdg_wm_base_error {
375- /**
376- * given wl_surface has another role
377- */
378- XDG_WM_BASE_ERROR_ROLE = 0,
379- /**
380- * xdg_wm_base was destroyed before children
381- */
382- XDG_WM_BASE_ERROR_DEFUNCT_SURFACES = 1,
383- /**
384- * the client tried to map or destroy a non-topmost popup
385- */
386- XDG_WM_BASE_ERROR_NOT_THE_TOPMOST_POPUP = 2,
387- /**
388- * the client specified an invalid popup parent surface
389- */
390- XDG_WM_BASE_ERROR_INVALID_POPUP_PARENT = 3,
391- /**
392- * the client provided an invalid surface state
393- */
394- XDG_WM_BASE_ERROR_INVALID_SURFACE_STATE = 4,
395- /**
396- * the client provided an invalid positioner
397- */
398- XDG_WM_BASE_ERROR_INVALID_POSITIONER = 5,
399- /**
400- * the client didn’t respond to a ping event in time
401- */
402- XDG_WM_BASE_ERROR_UNRESPONSIVE = 6,
403-};
404-#endif /* XDG_WM_BASE_ERROR_ENUM */
405-
406-/**
407- * @ingroup iface_xdg_wm_base
408- * @struct xdg_wm_base_listener
409- */
410-struct xdg_wm_base_listener {
411- /**
412- * check if the client is alive
413- *
414- * The ping event asks the client if it's still alive. Pass the
415- * serial specified in the event back to the compositor by sending
416- * a "pong" request back with the specified serial. See
417- * xdg_wm_base.pong.
418- *
419- * Compositors can use this to determine if the client is still
420- * alive. It's unspecified what will happen if the client doesn't
421- * respond to the ping request, or in what timeframe. Clients
422- * should try to respond in a reasonable amount of time. The
423- * “unresponsive” error is provided for compositors that wish
424- * to disconnect unresponsive clients.
425- *
426- * A compositor is free to ping in any way it wants, but a client
427- * must always respond to any xdg_wm_base object it created.
428- * @param serial pass this to the pong request
429- */
430- void (*ping)(void *data,
431- struct xdg_wm_base *xdg_wm_base,
432- uint32_t serial);
433-};
434-
435-/**
436- * @ingroup iface_xdg_wm_base
437- */
438-static inline int
439-xdg_wm_base_add_listener(struct xdg_wm_base *xdg_wm_base,
440- const struct xdg_wm_base_listener *listener, void *data)
441-{
442- return wl_proxy_add_listener((struct wl_proxy *) xdg_wm_base,
443- (void (**)(void)) listener, data);
444-}
445-
446-#define XDG_WM_BASE_DESTROY 0
447-#define XDG_WM_BASE_CREATE_POSITIONER 1
448-#define XDG_WM_BASE_GET_XDG_SURFACE 2
449-#define XDG_WM_BASE_PONG 3
450-
451-/**
452- * @ingroup iface_xdg_wm_base
453- */
454-#define XDG_WM_BASE_PING_SINCE_VERSION 1
455-
456-/**
457- * @ingroup iface_xdg_wm_base
458- */
459-#define XDG_WM_BASE_DESTROY_SINCE_VERSION 1
460-/**
461- * @ingroup iface_xdg_wm_base
462- */
463-#define XDG_WM_BASE_CREATE_POSITIONER_SINCE_VERSION 1
464-/**
465- * @ingroup iface_xdg_wm_base
466- */
467-#define XDG_WM_BASE_GET_XDG_SURFACE_SINCE_VERSION 1
468-/**
469- * @ingroup iface_xdg_wm_base
470- */
471-#define XDG_WM_BASE_PONG_SINCE_VERSION 1
472-
473-/** @ingroup iface_xdg_wm_base */
474-static inline void
475-xdg_wm_base_set_user_data(struct xdg_wm_base *xdg_wm_base, void *user_data)
476-{
477- wl_proxy_set_user_data((struct wl_proxy *) xdg_wm_base, user_data);
478-}
479-
480-/** @ingroup iface_xdg_wm_base */
481-static inline void *
482-xdg_wm_base_get_user_data(struct xdg_wm_base *xdg_wm_base)
483-{
484- return wl_proxy_get_user_data((struct wl_proxy *) xdg_wm_base);
485-}
486-
487-static inline uint32_t
488-xdg_wm_base_get_version(struct xdg_wm_base *xdg_wm_base)
489-{
490- return wl_proxy_get_version((struct wl_proxy *) xdg_wm_base);
491-}
492-
493-/**
494- * @ingroup iface_xdg_wm_base
495- *
496- * Destroy this xdg_wm_base object.
497- *
498- * Destroying a bound xdg_wm_base object while there are surfaces
499- * still alive created by this xdg_wm_base object instance is illegal
500- * and will result in a defunct_surfaces error.
501- */
502-static inline void
503-xdg_wm_base_destroy(struct xdg_wm_base *xdg_wm_base)
504-{
505- wl_proxy_marshal_flags((struct wl_proxy *) xdg_wm_base,
506- XDG_WM_BASE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_wm_base), WL_MARSHAL_FLAG_DESTROY);
507-}
508-
509-/**
510- * @ingroup iface_xdg_wm_base
511- *
512- * Create a positioner object. A positioner object is used to position
513- * surfaces relative to some parent surface. See the interface description
514- * and xdg_surface.get_popup for details.
515- */
516-static inline struct xdg_positioner *
517-xdg_wm_base_create_positioner(struct xdg_wm_base *xdg_wm_base)
518-{
519- struct wl_proxy *id;
520-
521- id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_wm_base,
522- XDG_WM_BASE_CREATE_POSITIONER, &xdg_positioner_interface, wl_proxy_get_version((struct wl_proxy *) xdg_wm_base), 0, NULL);
523-
524- return (struct xdg_positioner *) id;
525-}
526-
527-/**
528- * @ingroup iface_xdg_wm_base
529- *
530- * This creates an xdg_surface for the given surface. While xdg_surface
531- * itself is not a role, the corresponding surface may only be assigned
532- * a role extending xdg_surface, such as xdg_toplevel or xdg_popup. It is
533- * illegal to create an xdg_surface for a wl_surface which already has an
534- * assigned role and this will result in a role error.
535- *
536- * This creates an xdg_surface for the given surface. An xdg_surface is
537- * used as basis to define a role to a given surface, such as xdg_toplevel
538- * or xdg_popup. It also manages functionality shared between xdg_surface
539- * based surface roles.
540- *
541- * See the documentation of xdg_surface for more details about what an
542- * xdg_surface is and how it is used.
543- */
544-static inline struct xdg_surface *
545-xdg_wm_base_get_xdg_surface(struct xdg_wm_base *xdg_wm_base, struct wl_surface *surface)
546-{
547- struct wl_proxy *id;
548-
549- id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_wm_base,
550- XDG_WM_BASE_GET_XDG_SURFACE, &xdg_surface_interface, wl_proxy_get_version((struct wl_proxy *) xdg_wm_base), 0, NULL, surface);
551-
552- return (struct xdg_surface *) id;
553-}
554-
555-/**
556- * @ingroup iface_xdg_wm_base
557- *
558- * A client must respond to a ping event with a pong request or
559- * the client may be deemed unresponsive. See xdg_wm_base.ping
560- * and xdg_wm_base.error.unresponsive.
561- */
562-static inline void
563-xdg_wm_base_pong(struct xdg_wm_base *xdg_wm_base, uint32_t serial)
564-{
565- wl_proxy_marshal_flags((struct wl_proxy *) xdg_wm_base,
566- XDG_WM_BASE_PONG, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_wm_base), 0, serial);
567-}
568-
569-#ifndef XDG_POSITIONER_ERROR_ENUM
570-#define XDG_POSITIONER_ERROR_ENUM
571-enum xdg_positioner_error {
572- /**
573- * invalid input provided
574- */
575- XDG_POSITIONER_ERROR_INVALID_INPUT = 0,
576-};
577-#endif /* XDG_POSITIONER_ERROR_ENUM */
578-
579-#ifndef XDG_POSITIONER_ANCHOR_ENUM
580-#define XDG_POSITIONER_ANCHOR_ENUM
581-enum xdg_positioner_anchor {
582- XDG_POSITIONER_ANCHOR_NONE = 0,
583- XDG_POSITIONER_ANCHOR_TOP = 1,
584- XDG_POSITIONER_ANCHOR_BOTTOM = 2,
585- XDG_POSITIONER_ANCHOR_LEFT = 3,
586- XDG_POSITIONER_ANCHOR_RIGHT = 4,
587- XDG_POSITIONER_ANCHOR_TOP_LEFT = 5,
588- XDG_POSITIONER_ANCHOR_BOTTOM_LEFT = 6,
589- XDG_POSITIONER_ANCHOR_TOP_RIGHT = 7,
590- XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT = 8,
591-};
592-#endif /* XDG_POSITIONER_ANCHOR_ENUM */
593-
594-#ifndef XDG_POSITIONER_GRAVITY_ENUM
595-#define XDG_POSITIONER_GRAVITY_ENUM
596-enum xdg_positioner_gravity {
597- XDG_POSITIONER_GRAVITY_NONE = 0,
598- XDG_POSITIONER_GRAVITY_TOP = 1,
599- XDG_POSITIONER_GRAVITY_BOTTOM = 2,
600- XDG_POSITIONER_GRAVITY_LEFT = 3,
601- XDG_POSITIONER_GRAVITY_RIGHT = 4,
602- XDG_POSITIONER_GRAVITY_TOP_LEFT = 5,
603- XDG_POSITIONER_GRAVITY_BOTTOM_LEFT = 6,
604- XDG_POSITIONER_GRAVITY_TOP_RIGHT = 7,
605- XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT = 8,
606-};
607-#endif /* XDG_POSITIONER_GRAVITY_ENUM */
608-
609-#ifndef XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM
610-#define XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM
611-/**
612- * @ingroup iface_xdg_positioner
613- * constraint adjustments
614- *
615- * The constraint adjustment value define ways the compositor will adjust
616- * the position of the surface, if the unadjusted position would result
617- * in the surface being partly constrained.
618- *
619- * Whether a surface is considered 'constrained' is left to the compositor
620- * to determine. For example, the surface may be partly outside the
621- * compositor's defined 'work area', thus necessitating the child surface's
622- * position be adjusted until it is entirely inside the work area.
623- *
624- * The adjustments can be combined, according to a defined precedence: 1)
625- * Flip, 2) Slide, 3) Resize.
626- */
627-enum xdg_positioner_constraint_adjustment {
628- /**
629- * don't move the child surface when constrained
630- *
631- * Don't alter the surface position even if it is constrained on
632- * some axis, for example partially outside the edge of an output.
633- */
634- XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_NONE = 0,
635- /**
636- * move along the x axis until unconstrained
637- *
638- * Slide the surface along the x axis until it is no longer
639- * constrained.
640- *
641- * First try to slide towards the direction of the gravity on the x
642- * axis until either the edge in the opposite direction of the
643- * gravity is unconstrained or the edge in the direction of the
644- * gravity is constrained.
645- *
646- * Then try to slide towards the opposite direction of the gravity
647- * on the x axis until either the edge in the direction of the
648- * gravity is unconstrained or the edge in the opposite direction
649- * of the gravity is constrained.
650- */
651- XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1,
652- /**
653- * move along the y axis until unconstrained
654- *
655- * Slide the surface along the y axis until it is no longer
656- * constrained.
657- *
658- * First try to slide towards the direction of the gravity on the y
659- * axis until either the edge in the opposite direction of the
660- * gravity is unconstrained or the edge in the direction of the
661- * gravity is constrained.
662- *
663- * Then try to slide towards the opposite direction of the gravity
664- * on the y axis until either the edge in the direction of the
665- * gravity is unconstrained or the edge in the opposite direction
666- * of the gravity is constrained.
667- */
668- XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 2,
669- /**
670- * invert the anchor and gravity on the x axis
671- *
672- * Invert the anchor and gravity on the x axis if the surface is
673- * constrained on the x axis. For example, if the left edge of the
674- * surface is constrained, the gravity is 'left' and the anchor is
675- * 'left', change the gravity to 'right' and the anchor to 'right'.
676- *
677- * If the adjusted position also ends up being constrained, the
678- * resulting position of the flip_x adjustment will be the one
679- * before the adjustment.
680- */
681- XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X = 4,
682- /**
683- * invert the anchor and gravity on the y axis
684- *
685- * Invert the anchor and gravity on the y axis if the surface is
686- * constrained on the y axis. For example, if the bottom edge of
687- * the surface is constrained, the gravity is 'bottom' and the
688- * anchor is 'bottom', change the gravity to 'top' and the anchor
689- * to 'top'.
690- *
691- * The adjusted position is calculated given the original anchor
692- * rectangle and offset, but with the new flipped anchor and
693- * gravity values.
694- *
695- * If the adjusted position also ends up being constrained, the
696- * resulting position of the flip_y adjustment will be the one
697- * before the adjustment.
698- */
699- XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y = 8,
700- /**
701- * horizontally resize the surface
702- *
703- * Resize the surface horizontally so that it is completely
704- * unconstrained.
705- */
706- XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X = 16,
707- /**
708- * vertically resize the surface
709- *
710- * Resize the surface vertically so that it is completely
711- * unconstrained.
712- */
713- XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32,
714-};
715-#endif /* XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM */
716-
717-#define XDG_POSITIONER_DESTROY 0
718-#define XDG_POSITIONER_SET_SIZE 1
719-#define XDG_POSITIONER_SET_ANCHOR_RECT 2
720-#define XDG_POSITIONER_SET_ANCHOR 3
721-#define XDG_POSITIONER_SET_GRAVITY 4
722-#define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT 5
723-#define XDG_POSITIONER_SET_OFFSET 6
724-#define XDG_POSITIONER_SET_REACTIVE 7
725-#define XDG_POSITIONER_SET_PARENT_SIZE 8
726-#define XDG_POSITIONER_SET_PARENT_CONFIGURE 9
727-
728-
729-/**
730- * @ingroup iface_xdg_positioner
731- */
732-#define XDG_POSITIONER_DESTROY_SINCE_VERSION 1
733-/**
734- * @ingroup iface_xdg_positioner
735- */
736-#define XDG_POSITIONER_SET_SIZE_SINCE_VERSION 1
737-/**
738- * @ingroup iface_xdg_positioner
739- */
740-#define XDG_POSITIONER_SET_ANCHOR_RECT_SINCE_VERSION 1
741-/**
742- * @ingroup iface_xdg_positioner
743- */
744-#define XDG_POSITIONER_SET_ANCHOR_SINCE_VERSION 1
745-/**
746- * @ingroup iface_xdg_positioner
747- */
748-#define XDG_POSITIONER_SET_GRAVITY_SINCE_VERSION 1
749-/**
750- * @ingroup iface_xdg_positioner
751- */
752-#define XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1
753-/**
754- * @ingroup iface_xdg_positioner
755- */
756-#define XDG_POSITIONER_SET_OFFSET_SINCE_VERSION 1
757-/**
758- * @ingroup iface_xdg_positioner
759- */
760-#define XDG_POSITIONER_SET_REACTIVE_SINCE_VERSION 3
761-/**
762- * @ingroup iface_xdg_positioner
763- */
764-#define XDG_POSITIONER_SET_PARENT_SIZE_SINCE_VERSION 3
765-/**
766- * @ingroup iface_xdg_positioner
767- */
768-#define XDG_POSITIONER_SET_PARENT_CONFIGURE_SINCE_VERSION 3
769-
770-/** @ingroup iface_xdg_positioner */
771-static inline void
772-xdg_positioner_set_user_data(struct xdg_positioner *xdg_positioner, void *user_data)
773-{
774- wl_proxy_set_user_data((struct wl_proxy *) xdg_positioner, user_data);
775-}
776-
777-/** @ingroup iface_xdg_positioner */
778-static inline void *
779-xdg_positioner_get_user_data(struct xdg_positioner *xdg_positioner)
780-{
781- return wl_proxy_get_user_data((struct wl_proxy *) xdg_positioner);
782-}
783-
784-static inline uint32_t
785-xdg_positioner_get_version(struct xdg_positioner *xdg_positioner)
786-{
787- return wl_proxy_get_version((struct wl_proxy *) xdg_positioner);
788-}
789-
790-/**
791- * @ingroup iface_xdg_positioner
792- *
793- * Notify the compositor that the xdg_positioner will no longer be used.
794- */
795-static inline void
796-xdg_positioner_destroy(struct xdg_positioner *xdg_positioner)
797-{
798- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
799- XDG_POSITIONER_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), WL_MARSHAL_FLAG_DESTROY);
800-}
801-
802-/**
803- * @ingroup iface_xdg_positioner
804- *
805- * Set the size of the surface that is to be positioned with the positioner
806- * object. The size is in surface-local coordinates and corresponds to the
807- * window geometry. See xdg_surface.set_window_geometry.
808- *
809- * If a zero or negative size is set the invalid_input error is raised.
810- */
811-static inline void
812-xdg_positioner_set_size(struct xdg_positioner *xdg_positioner, int32_t width, int32_t height)
813-{
814- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
815- XDG_POSITIONER_SET_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, width, height);
816-}
817-
818-/**
819- * @ingroup iface_xdg_positioner
820- *
821- * Specify the anchor rectangle within the parent surface that the child
822- * surface will be placed relative to. The rectangle is relative to the
823- * window geometry as defined by xdg_surface.set_window_geometry of the
824- * parent surface.
825- *
826- * When the xdg_positioner object is used to position a child surface, the
827- * anchor rectangle may not extend outside the window geometry of the
828- * positioned child's parent surface.
829- *
830- * If a negative size is set the invalid_input error is raised.
831- */
832-static inline void
833-xdg_positioner_set_anchor_rect(struct xdg_positioner *xdg_positioner, int32_t x, int32_t y, int32_t width, int32_t height)
834-{
835- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
836- XDG_POSITIONER_SET_ANCHOR_RECT, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, x, y, width, height);
837-}
838-
839-/**
840- * @ingroup iface_xdg_positioner
841- *
842- * Defines the anchor point for the anchor rectangle. The specified anchor
843- * is used derive an anchor point that the child surface will be
844- * positioned relative to. If a corner anchor is set (e.g. 'top_left' or
845- * 'bottom_right'), the anchor point will be at the specified corner;
846- * otherwise, the derived anchor point will be centered on the specified
847- * edge, or in the center of the anchor rectangle if no edge is specified.
848- */
849-static inline void
850-xdg_positioner_set_anchor(struct xdg_positioner *xdg_positioner, uint32_t anchor)
851-{
852- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
853- XDG_POSITIONER_SET_ANCHOR, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, anchor);
854-}
855-
856-/**
857- * @ingroup iface_xdg_positioner
858- *
859- * Defines in what direction a surface should be positioned, relative to
860- * the anchor point of the parent surface. If a corner gravity is
861- * specified (e.g. 'bottom_right' or 'top_left'), then the child surface
862- * will be placed towards the specified gravity; otherwise, the child
863- * surface will be centered over the anchor point on any axis that had no
864- * gravity specified. If the gravity is not in the ‘gravity’ enum, an
865- * invalid_input error is raised.
866- */
867-static inline void
868-xdg_positioner_set_gravity(struct xdg_positioner *xdg_positioner, uint32_t gravity)
869-{
870- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
871- XDG_POSITIONER_SET_GRAVITY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, gravity);
872-}
873-
874-/**
875- * @ingroup iface_xdg_positioner
876- *
877- * Specify how the window should be positioned if the originally intended
878- * position caused the surface to be constrained, meaning at least
879- * partially outside positioning boundaries set by the compositor. The
880- * adjustment is set by constructing a bitmask describing the adjustment to
881- * be made when the surface is constrained on that axis.
882- *
883- * If no bit for one axis is set, the compositor will assume that the child
884- * surface should not change its position on that axis when constrained.
885- *
886- * If more than one bit for one axis is set, the order of how adjustments
887- * are applied is specified in the corresponding adjustment descriptions.
888- *
889- * The default adjustment is none.
890- */
891-static inline void
892-xdg_positioner_set_constraint_adjustment(struct xdg_positioner *xdg_positioner, uint32_t constraint_adjustment)
893-{
894- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
895- XDG_POSITIONER_SET_CONSTRAINT_ADJUSTMENT, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, constraint_adjustment);
896-}
897-
898-/**
899- * @ingroup iface_xdg_positioner
900- *
901- * Specify the surface position offset relative to the position of the
902- * anchor on the anchor rectangle and the anchor on the surface. For
903- * example if the anchor of the anchor rectangle is at (x, y), the surface
904- * has the gravity bottom|right, and the offset is (ox, oy), the calculated
905- * surface position will be (x + ox, y + oy). The offset position of the
906- * surface is the one used for constraint testing. See
907- * set_constraint_adjustment.
908- *
909- * An example use case is placing a popup menu on top of a user interface
910- * element, while aligning the user interface element of the parent surface
911- * with some user interface element placed somewhere in the popup surface.
912- */
913-static inline void
914-xdg_positioner_set_offset(struct xdg_positioner *xdg_positioner, int32_t x, int32_t y)
915-{
916- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
917- XDG_POSITIONER_SET_OFFSET, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, x, y);
918-}
919-
920-/**
921- * @ingroup iface_xdg_positioner
922- *
923- * When set reactive, the surface is reconstrained if the conditions used
924- * for constraining changed, e.g. the parent window moved.
925- *
926- * If the conditions changed and the popup was reconstrained, an
927- * xdg_popup.configure event is sent with updated geometry, followed by an
928- * xdg_surface.configure event.
929- */
930-static inline void
931-xdg_positioner_set_reactive(struct xdg_positioner *xdg_positioner)
932-{
933- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
934- XDG_POSITIONER_SET_REACTIVE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0);
935-}
936-
937-/**
938- * @ingroup iface_xdg_positioner
939- *
940- * Set the parent window geometry the compositor should use when
941- * positioning the popup. The compositor may use this information to
942- * determine the future state the popup should be constrained using. If
943- * this doesn't match the dimension of the parent the popup is eventually
944- * positioned against, the behavior is undefined.
945- *
946- * The arguments are given in the surface-local coordinate space.
947- */
948-static inline void
949-xdg_positioner_set_parent_size(struct xdg_positioner *xdg_positioner, int32_t parent_width, int32_t parent_height)
950-{
951- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
952- XDG_POSITIONER_SET_PARENT_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, parent_width, parent_height);
953-}
954-
955-/**
956- * @ingroup iface_xdg_positioner
957- *
958- * Set the serial of an xdg_surface.configure event this positioner will be
959- * used in response to. The compositor may use this information together
960- * with set_parent_size to determine what future state the popup should be
961- * constrained using.
962- */
963-static inline void
964-xdg_positioner_set_parent_configure(struct xdg_positioner *xdg_positioner, uint32_t serial)
965-{
966- wl_proxy_marshal_flags((struct wl_proxy *) xdg_positioner,
967- XDG_POSITIONER_SET_PARENT_CONFIGURE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_positioner), 0, serial);
968-}
969-
970-#ifndef XDG_SURFACE_ERROR_ENUM
971-#define XDG_SURFACE_ERROR_ENUM
972-enum xdg_surface_error {
973- /**
974- * Surface was not fully constructed
975- */
976- XDG_SURFACE_ERROR_NOT_CONSTRUCTED = 1,
977- /**
978- * Surface was already constructed
979- */
980- XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED = 2,
981- /**
982- * Attaching a buffer to an unconfigured surface
983- */
984- XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER = 3,
985- /**
986- * Invalid serial number when acking a configure event
987- */
988- XDG_SURFACE_ERROR_INVALID_SERIAL = 4,
989- /**
990- * Width or height was zero or negative
991- */
992- XDG_SURFACE_ERROR_INVALID_SIZE = 5,
993- /**
994- * Surface was destroyed before its role object
995- */
996- XDG_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT = 6,
997-};
998-#endif /* XDG_SURFACE_ERROR_ENUM */
999-
1000-/**
1001- * @ingroup iface_xdg_surface
1002- * @struct xdg_surface_listener
1003- */
1004-struct xdg_surface_listener {
1005- /**
1006- * suggest a surface change
1007- *
1008- * The configure event marks the end of a configure sequence. A
1009- * configure sequence is a set of one or more events configuring
1010- * the state of the xdg_surface, including the final
1011- * xdg_surface.configure event.
1012- *
1013- * Where applicable, xdg_surface surface roles will during a
1014- * configure sequence extend this event as a latched state sent as
1015- * events before the xdg_surface.configure event. Such events
1016- * should be considered to make up a set of atomically applied
1017- * configuration states, where the xdg_surface.configure commits
1018- * the accumulated state.
1019- *
1020- * Clients should arrange their surface for the new states, and
1021- * then send an ack_configure request with the serial sent in this
1022- * configure event at some point before committing the new surface.
1023- *
1024- * If the client receives multiple configure events before it can
1025- * respond to one, it is free to discard all but the last event it
1026- * received.
1027- * @param serial serial of the configure event
1028- */
1029- void (*configure)(void *data,
1030- struct xdg_surface *xdg_surface,
1031- uint32_t serial);
1032-};
1033-
1034-/**
1035- * @ingroup iface_xdg_surface
1036- */
1037-static inline int
1038-xdg_surface_add_listener(struct xdg_surface *xdg_surface,
1039- const struct xdg_surface_listener *listener, void *data)
1040-{
1041- return wl_proxy_add_listener((struct wl_proxy *) xdg_surface,
1042- (void (**)(void)) listener, data);
1043-}
1044-
1045-#define XDG_SURFACE_DESTROY 0
1046-#define XDG_SURFACE_GET_TOPLEVEL 1
1047-#define XDG_SURFACE_GET_POPUP 2
1048-#define XDG_SURFACE_SET_WINDOW_GEOMETRY 3
1049-#define XDG_SURFACE_ACK_CONFIGURE 4
1050-
1051-/**
1052- * @ingroup iface_xdg_surface
1053- */
1054-#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1
1055-
1056-/**
1057- * @ingroup iface_xdg_surface
1058- */
1059-#define XDG_SURFACE_DESTROY_SINCE_VERSION 1
1060-/**
1061- * @ingroup iface_xdg_surface
1062- */
1063-#define XDG_SURFACE_GET_TOPLEVEL_SINCE_VERSION 1
1064-/**
1065- * @ingroup iface_xdg_surface
1066- */
1067-#define XDG_SURFACE_GET_POPUP_SINCE_VERSION 1
1068-/**
1069- * @ingroup iface_xdg_surface
1070- */
1071-#define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
1072-/**
1073- * @ingroup iface_xdg_surface
1074- */
1075-#define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1
1076-
1077-/** @ingroup iface_xdg_surface */
1078-static inline void
1079-xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
1080-{
1081- wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data);
1082-}
1083-
1084-/** @ingroup iface_xdg_surface */
1085-static inline void *
1086-xdg_surface_get_user_data(struct xdg_surface *xdg_surface)
1087-{
1088- return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface);
1089-}
1090-
1091-static inline uint32_t
1092-xdg_surface_get_version(struct xdg_surface *xdg_surface)
1093-{
1094- return wl_proxy_get_version((struct wl_proxy *) xdg_surface);
1095-}
1096-
1097-/**
1098- * @ingroup iface_xdg_surface
1099- *
1100- * Destroy the xdg_surface object. An xdg_surface must only be destroyed
1101- * after its role object has been destroyed, otherwise
1102- * a defunct_role_object error is raised.
1103- */
1104-static inline void
1105-xdg_surface_destroy(struct xdg_surface *xdg_surface)
1106-{
1107- wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1108- XDG_SURFACE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_surface), WL_MARSHAL_FLAG_DESTROY);
1109-}
1110-
1111-/**
1112- * @ingroup iface_xdg_surface
1113- *
1114- * This creates an xdg_toplevel object for the given xdg_surface and gives
1115- * the associated wl_surface the xdg_toplevel role.
1116- *
1117- * See the documentation of xdg_toplevel for more details about what an
1118- * xdg_toplevel is and how it is used.
1119- */
1120-static inline struct xdg_toplevel *
1121-xdg_surface_get_toplevel(struct xdg_surface *xdg_surface)
1122-{
1123- struct wl_proxy *id;
1124-
1125- id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1126- XDG_SURFACE_GET_TOPLEVEL, &xdg_toplevel_interface, wl_proxy_get_version((struct wl_proxy *) xdg_surface), 0, NULL);
1127-
1128- return (struct xdg_toplevel *) id;
1129-}
1130-
1131-/**
1132- * @ingroup iface_xdg_surface
1133- *
1134- * This creates an xdg_popup object for the given xdg_surface and gives
1135- * the associated wl_surface the xdg_popup role.
1136- *
1137- * If null is passed as a parent, a parent surface must be specified using
1138- * some other protocol, before committing the initial state.
1139- *
1140- * See the documentation of xdg_popup for more details about what an
1141- * xdg_popup is and how it is used.
1142- */
1143-static inline struct xdg_popup *
1144-xdg_surface_get_popup(struct xdg_surface *xdg_surface, struct xdg_surface *parent, struct xdg_positioner *positioner)
1145-{
1146- struct wl_proxy *id;
1147-
1148- id = wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1149- XDG_SURFACE_GET_POPUP, &xdg_popup_interface, wl_proxy_get_version((struct wl_proxy *) xdg_surface), 0, NULL, parent, positioner);
1150-
1151- return (struct xdg_popup *) id;
1152-}
1153-
1154-/**
1155- * @ingroup iface_xdg_surface
1156- *
1157- * The window geometry of a surface is its "visible bounds" from the
1158- * user's perspective. Client-side decorations often have invisible
1159- * portions like drop-shadows which should be ignored for the
1160- * purposes of aligning, placing and constraining windows. Note that
1161- * in some situations, compositors may clip rendering to the window
1162- * geometry, so the client should avoid putting functional elements
1163- * outside of it.
1164- *
1165- * The window geometry is double-buffered state, see wl_surface.commit.
1166- *
1167- * When maintaining a position, the compositor should treat the (x, y)
1168- * coordinate of the window geometry as the top left corner of the window.
1169- * A client changing the (x, y) window geometry coordinate should in
1170- * general not alter the position of the window.
1171- *
1172- * Once the window geometry of the surface is set, it is not possible to
1173- * unset it, and it will remain the same until set_window_geometry is
1174- * called again, even if a new subsurface or buffer is attached.
1175- *
1176- * If never set, the value is the full bounds of the surface,
1177- * including any subsurfaces. This updates dynamically on every
1178- * commit. This unset is meant for extremely simple clients.
1179- *
1180- * The arguments are given in the surface-local coordinate space of
1181- * the wl_surface associated with this xdg_surface, and may extend outside
1182- * of the wl_surface itself to mark parts of the subsurface tree as part of
1183- * the window geometry.
1184- *
1185- * When applied, the effective window geometry will be the set window
1186- * geometry clamped to the bounding rectangle of the combined
1187- * geometry of the surface of the xdg_surface and the associated
1188- * subsurfaces.
1189- *
1190- * The effective geometry will not be recalculated unless a new call to
1191- * set_window_geometry is done and the new pending surface state is
1192- * subsequently applied.
1193- *
1194- * The width and height of the effective window geometry must be
1195- * greater than zero. Setting an invalid size will raise an
1196- * invalid_size error.
1197- */
1198-static inline void
1199-xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height)
1200-{
1201- wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1202- XDG_SURFACE_SET_WINDOW_GEOMETRY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_surface), 0, x, y, width, height);
1203-}
1204-
1205-/**
1206- * @ingroup iface_xdg_surface
1207- *
1208- * When a configure event is received, if a client commits the
1209- * surface in response to the configure event, then the client
1210- * must make an ack_configure request sometime before the commit
1211- * request, passing along the serial of the configure event.
1212- *
1213- * For instance, for toplevel surfaces the compositor might use this
1214- * information to move a surface to the top left only when the client has
1215- * drawn itself for the maximized or fullscreen state.
1216- *
1217- * If the client receives multiple configure events before it
1218- * can respond to one, it only has to ack the last configure event.
1219- * Acking a configure event that was never sent raises an invalid_serial
1220- * error.
1221- *
1222- * A client is not required to commit immediately after sending
1223- * an ack_configure request - it may even ack_configure several times
1224- * before its next surface commit.
1225- *
1226- * A client may send multiple ack_configure requests before committing, but
1227- * only the last request sent before a commit indicates which configure
1228- * event the client really is responding to.
1229- *
1230- * Sending an ack_configure request consumes the serial number sent with
1231- * the request, as well as serial numbers sent by all configure events
1232- * sent on this xdg_surface prior to the configure event referenced by
1233- * the committed serial.
1234- *
1235- * It is an error to issue multiple ack_configure requests referencing a
1236- * serial from the same configure event, or to issue an ack_configure
1237- * request referencing a serial from a configure event issued before the
1238- * event identified by the last ack_configure request for the same
1239- * xdg_surface. Doing so will raise an invalid_serial error.
1240- */
1241-static inline void
1242-xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
1243-{
1244- wl_proxy_marshal_flags((struct wl_proxy *) xdg_surface,
1245- XDG_SURFACE_ACK_CONFIGURE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_surface), 0, serial);
1246-}
1247-
1248-#ifndef XDG_TOPLEVEL_ERROR_ENUM
1249-#define XDG_TOPLEVEL_ERROR_ENUM
1250-enum xdg_toplevel_error {
1251- /**
1252- * provided value is not a valid variant of the resize_edge enum
1253- */
1254- XDG_TOPLEVEL_ERROR_INVALID_RESIZE_EDGE = 0,
1255- /**
1256- * invalid parent toplevel
1257- */
1258- XDG_TOPLEVEL_ERROR_INVALID_PARENT = 1,
1259- /**
1260- * client provided an invalid min or max size
1261- */
1262- XDG_TOPLEVEL_ERROR_INVALID_SIZE = 2,
1263-};
1264-#endif /* XDG_TOPLEVEL_ERROR_ENUM */
1265-
1266-#ifndef XDG_TOPLEVEL_RESIZE_EDGE_ENUM
1267-#define XDG_TOPLEVEL_RESIZE_EDGE_ENUM
1268-/**
1269- * @ingroup iface_xdg_toplevel
1270- * edge values for resizing
1271- *
1272- * These values are used to indicate which edge of a surface
1273- * is being dragged in a resize operation.
1274- */
1275-enum xdg_toplevel_resize_edge {
1276- XDG_TOPLEVEL_RESIZE_EDGE_NONE = 0,
1277- XDG_TOPLEVEL_RESIZE_EDGE_TOP = 1,
1278- XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM = 2,
1279- XDG_TOPLEVEL_RESIZE_EDGE_LEFT = 4,
1280- XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT = 5,
1281- XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT = 6,
1282- XDG_TOPLEVEL_RESIZE_EDGE_RIGHT = 8,
1283- XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT = 9,
1284- XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT = 10,
1285-};
1286-#endif /* XDG_TOPLEVEL_RESIZE_EDGE_ENUM */
1287-
1288-#ifndef XDG_TOPLEVEL_STATE_ENUM
1289-#define XDG_TOPLEVEL_STATE_ENUM
1290-/**
1291- * @ingroup iface_xdg_toplevel
1292- * types of state on the surface
1293- *
1294- * The different state values used on the surface. This is designed for
1295- * state values like maximized, fullscreen. It is paired with the
1296- * configure event to ensure that both the client and the compositor
1297- * setting the state can be synchronized.
1298- *
1299- * States set in this way are double-buffered, see wl_surface.commit.
1300- */
1301-enum xdg_toplevel_state {
1302- /**
1303- * the surface is maximized
1304- * the surface is maximized
1305- *
1306- * The surface is maximized. The window geometry specified in the
1307- * configure event must be obeyed by the client, or the
1308- * xdg_wm_base.invalid_surface_state error is raised.
1309- *
1310- * The client should draw without shadow or other decoration
1311- * outside of the window geometry.
1312- */
1313- XDG_TOPLEVEL_STATE_MAXIMIZED = 1,
1314- /**
1315- * the surface is fullscreen
1316- * the surface is fullscreen
1317- *
1318- * The surface is fullscreen. The window geometry specified in
1319- * the configure event is a maximum; the client cannot resize
1320- * beyond it. For a surface to cover the whole fullscreened area,
1321- * the geometry dimensions must be obeyed by the client. For more
1322- * details, see xdg_toplevel.set_fullscreen.
1323- */
1324- XDG_TOPLEVEL_STATE_FULLSCREEN = 2,
1325- /**
1326- * the surface is being resized
1327- * the surface is being resized
1328- *
1329- * The surface is being resized. The window geometry specified in
1330- * the configure event is a maximum; the client cannot resize
1331- * beyond it. Clients that have aspect ratio or cell sizing
1332- * configuration can use a smaller size, however.
1333- */
1334- XDG_TOPLEVEL_STATE_RESIZING = 3,
1335- /**
1336- * the surface is now activated
1337- * the surface is now activated
1338- *
1339- * Client window decorations should be painted as if the window
1340- * is active. Do not assume this means that the window actually has
1341- * keyboard or pointer focus.
1342- */
1343- XDG_TOPLEVEL_STATE_ACTIVATED = 4,
1344- /**
1345- * the surface’s left edge is tiled
1346- *
1347- * The window is currently in a tiled layout and the left edge is
1348- * considered to be adjacent to another part of the tiling grid.
1349- *
1350- * The client should draw without shadow or other decoration
1351- * outside of the window geometry on the left edge.
1352- * @since 2
1353- */
1354- XDG_TOPLEVEL_STATE_TILED_LEFT = 5,
1355- /**
1356- * the surface’s right edge is tiled
1357- *
1358- * The window is currently in a tiled layout and the right edge
1359- * is considered to be adjacent to another part of the tiling grid.
1360- *
1361- * The client should draw without shadow or other decoration
1362- * outside of the window geometry on the right edge.
1363- * @since 2
1364- */
1365- XDG_TOPLEVEL_STATE_TILED_RIGHT = 6,
1366- /**
1367- * the surface’s top edge is tiled
1368- *
1369- * The window is currently in a tiled layout and the top edge is
1370- * considered to be adjacent to another part of the tiling grid.
1371- *
1372- * The client should draw without shadow or other decoration
1373- * outside of the window geometry on the top edge.
1374- * @since 2
1375- */
1376- XDG_TOPLEVEL_STATE_TILED_TOP = 7,
1377- /**
1378- * the surface’s bottom edge is tiled
1379- *
1380- * The window is currently in a tiled layout and the bottom edge
1381- * is considered to be adjacent to another part of the tiling grid.
1382- *
1383- * The client should draw without shadow or other decoration
1384- * outside of the window geometry on the bottom edge.
1385- * @since 2
1386- */
1387- XDG_TOPLEVEL_STATE_TILED_BOTTOM = 8,
1388- /**
1389- * surface repaint is suspended
1390- *
1391- * The surface is currently not ordinarily being repainted; for
1392- * example because its content is occluded by another window, or
1393- * its outputs are switched off due to screen locking.
1394- * @since 6
1395- */
1396- XDG_TOPLEVEL_STATE_SUSPENDED = 9,
1397- /**
1398- * the surface’s left edge is constrained
1399- *
1400- * The left edge of the window is currently constrained, meaning
1401- * it shouldn't attempt to resize from that edge. It can for
1402- * example mean it's tiled next to a monitor edge on the
1403- * constrained side of the window.
1404- * @since 7
1405- */
1406- XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT = 10,
1407- /**
1408- * the surface’s right edge is constrained
1409- *
1410- * The right edge of the window is currently constrained, meaning
1411- * it shouldn't attempt to resize from that edge. It can for
1412- * example mean it's tiled next to a monitor edge on the
1413- * constrained side of the window.
1414- * @since 7
1415- */
1416- XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT = 11,
1417- /**
1418- * the surface’s top edge is constrained
1419- *
1420- * The top edge of the window is currently constrained, meaning
1421- * it shouldn't attempt to resize from that edge. It can for
1422- * example mean it's tiled next to a monitor edge on the
1423- * constrained side of the window.
1424- * @since 7
1425- */
1426- XDG_TOPLEVEL_STATE_CONSTRAINED_TOP = 12,
1427- /**
1428- * the surface’s bottom edge is constrained
1429- *
1430- * The bottom edge of the window is currently constrained,
1431- * meaning it shouldn't attempt to resize from that edge. It can
1432- * for example mean it's tiled next to a monitor edge on the
1433- * constrained side of the window.
1434- * @since 7
1435- */
1436- XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM = 13,
1437-};
1438-/**
1439- * @ingroup iface_xdg_toplevel
1440- */
1441-#define XDG_TOPLEVEL_STATE_TILED_LEFT_SINCE_VERSION 2
1442-/**
1443- * @ingroup iface_xdg_toplevel
1444- */
1445-#define XDG_TOPLEVEL_STATE_TILED_RIGHT_SINCE_VERSION 2
1446-/**
1447- * @ingroup iface_xdg_toplevel
1448- */
1449-#define XDG_TOPLEVEL_STATE_TILED_TOP_SINCE_VERSION 2
1450-/**
1451- * @ingroup iface_xdg_toplevel
1452- */
1453-#define XDG_TOPLEVEL_STATE_TILED_BOTTOM_SINCE_VERSION 2
1454-/**
1455- * @ingroup iface_xdg_toplevel
1456- */
1457-#define XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION 6
1458-/**
1459- * @ingroup iface_xdg_toplevel
1460- */
1461-#define XDG_TOPLEVEL_STATE_CONSTRAINED_LEFT_SINCE_VERSION 7
1462-/**
1463- * @ingroup iface_xdg_toplevel
1464- */
1465-#define XDG_TOPLEVEL_STATE_CONSTRAINED_RIGHT_SINCE_VERSION 7
1466-/**
1467- * @ingroup iface_xdg_toplevel
1468- */
1469-#define XDG_TOPLEVEL_STATE_CONSTRAINED_TOP_SINCE_VERSION 7
1470-/**
1471- * @ingroup iface_xdg_toplevel
1472- */
1473-#define XDG_TOPLEVEL_STATE_CONSTRAINED_BOTTOM_SINCE_VERSION 7
1474-#endif /* XDG_TOPLEVEL_STATE_ENUM */
1475-
1476-#ifndef XDG_TOPLEVEL_WM_CAPABILITIES_ENUM
1477-#define XDG_TOPLEVEL_WM_CAPABILITIES_ENUM
1478-enum xdg_toplevel_wm_capabilities {
1479- /**
1480- * show_window_menu is available
1481- */
1482- XDG_TOPLEVEL_WM_CAPABILITIES_WINDOW_MENU = 1,
1483- /**
1484- * set_maximized and unset_maximized are available
1485- */
1486- XDG_TOPLEVEL_WM_CAPABILITIES_MAXIMIZE = 2,
1487- /**
1488- * set_fullscreen and unset_fullscreen are available
1489- */
1490- XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN = 3,
1491- /**
1492- * set_minimized is available
1493- */
1494- XDG_TOPLEVEL_WM_CAPABILITIES_MINIMIZE = 4,
1495-};
1496-#endif /* XDG_TOPLEVEL_WM_CAPABILITIES_ENUM */
1497-
1498-/**
1499- * @ingroup iface_xdg_toplevel
1500- * @struct xdg_toplevel_listener
1501- */
1502-struct xdg_toplevel_listener {
1503- /**
1504- * suggest a surface change
1505- *
1506- * This configure event asks the client to resize its toplevel
1507- * surface or to change its state. The configured state should not
1508- * be applied immediately. See xdg_surface.configure for details.
1509- *
1510- * The width and height arguments specify a hint to the window
1511- * about how its surface should be resized in window geometry
1512- * coordinates. See set_window_geometry.
1513- *
1514- * If the width or height arguments are zero, it means the client
1515- * should decide its own window dimension. This may happen when the
1516- * compositor needs to configure the state of the surface but
1517- * doesn't have any information about any previous or expected
1518- * dimension.
1519- *
1520- * The states listed in the event specify how the width/height
1521- * arguments should be interpreted, and possibly how it should be
1522- * drawn.
1523- *
1524- * Clients must send an ack_configure in response to this event.
1525- * See xdg_surface.configure and xdg_surface.ack_configure for
1526- * details.
1527- */
1528- void (*configure)(void *data,
1529- struct xdg_toplevel *xdg_toplevel,
1530- int32_t width,
1531- int32_t height,
1532- struct wl_array *states);
1533- /**
1534- * surface wants to be closed
1535- *
1536- * The close event is sent by the compositor when the user wants
1537- * the surface to be closed. This should be equivalent to the user
1538- * clicking the close button in client-side decorations, if your
1539- * application has any.
1540- *
1541- * This is only a request that the user intends to close the
1542- * window. The client may choose to ignore this request, or show a
1543- * dialog to ask the user to save their data, etc.
1544- */
1545- void (*close)(void *data,
1546- struct xdg_toplevel *xdg_toplevel);
1547- /**
1548- * recommended window geometry bounds
1549- *
1550- * The configure_bounds event may be sent prior to a
1551- * xdg_toplevel.configure event to communicate the bounds a window
1552- * geometry size is recommended to constrain to.
1553- *
1554- * The passed width and height are in surface coordinate space. If
1555- * width and height are 0, it means bounds is unknown and
1556- * equivalent to as if no configure_bounds event was ever sent for
1557- * this surface.
1558- *
1559- * The bounds can for example correspond to the size of a monitor
1560- * excluding any panels or other shell components, so that a
1561- * surface isn't created in a way that it cannot fit.
1562- *
1563- * The bounds may change at any point, and in such a case, a new
1564- * xdg_toplevel.configure_bounds will be sent, followed by
1565- * xdg_toplevel.configure and xdg_surface.configure.
1566- * @since 4
1567- */
1568- void (*configure_bounds)(void *data,
1569- struct xdg_toplevel *xdg_toplevel,
1570- int32_t width,
1571- int32_t height);
1572- /**
1573- * compositor capabilities
1574- *
1575- * This event advertises the capabilities supported by the
1576- * compositor. If a capability isn't supported, clients should hide
1577- * or disable the UI elements that expose this functionality. For
1578- * instance, if the compositor doesn't advertise support for
1579- * minimized toplevels, a button triggering the set_minimized
1580- * request should not be displayed.
1581- *
1582- * The compositor will ignore requests it doesn't support. For
1583- * instance, a compositor which doesn't advertise support for
1584- * minimized will ignore set_minimized requests.
1585- *
1586- * Compositors must send this event once before the first
1587- * xdg_surface.configure event. When the capabilities change,
1588- * compositors must send this event again and then send an
1589- * xdg_surface.configure event.
1590- *
1591- * The configured state should not be applied immediately. See
1592- * xdg_surface.configure for details.
1593- *
1594- * The capabilities are sent as an array of 32-bit unsigned
1595- * integers in native endianness.
1596- * @param capabilities array of 32-bit capabilities
1597- * @since 5
1598- */
1599- void (*wm_capabilities)(void *data,
1600- struct xdg_toplevel *xdg_toplevel,
1601- struct wl_array *capabilities);
1602-};
1603-
1604-/**
1605- * @ingroup iface_xdg_toplevel
1606- */
1607-static inline int
1608-xdg_toplevel_add_listener(struct xdg_toplevel *xdg_toplevel,
1609- const struct xdg_toplevel_listener *listener, void *data)
1610-{
1611- return wl_proxy_add_listener((struct wl_proxy *) xdg_toplevel,
1612- (void (**)(void)) listener, data);
1613-}
1614-
1615-#define XDG_TOPLEVEL_DESTROY 0
1616-#define XDG_TOPLEVEL_SET_PARENT 1
1617-#define XDG_TOPLEVEL_SET_TITLE 2
1618-#define XDG_TOPLEVEL_SET_APP_ID 3
1619-#define XDG_TOPLEVEL_SHOW_WINDOW_MENU 4
1620-#define XDG_TOPLEVEL_MOVE 5
1621-#define XDG_TOPLEVEL_RESIZE 6
1622-#define XDG_TOPLEVEL_SET_MAX_SIZE 7
1623-#define XDG_TOPLEVEL_SET_MIN_SIZE 8
1624-#define XDG_TOPLEVEL_SET_MAXIMIZED 9
1625-#define XDG_TOPLEVEL_UNSET_MAXIMIZED 10
1626-#define XDG_TOPLEVEL_SET_FULLSCREEN 11
1627-#define XDG_TOPLEVEL_UNSET_FULLSCREEN 12
1628-#define XDG_TOPLEVEL_SET_MINIMIZED 13
1629-
1630-/**
1631- * @ingroup iface_xdg_toplevel
1632- */
1633-#define XDG_TOPLEVEL_CONFIGURE_SINCE_VERSION 1
1634-/**
1635- * @ingroup iface_xdg_toplevel
1636- */
1637-#define XDG_TOPLEVEL_CLOSE_SINCE_VERSION 1
1638-/**
1639- * @ingroup iface_xdg_toplevel
1640- */
1641-#define XDG_TOPLEVEL_CONFIGURE_BOUNDS_SINCE_VERSION 4
1642-/**
1643- * @ingroup iface_xdg_toplevel
1644- */
1645-#define XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION 5
1646-
1647-/**
1648- * @ingroup iface_xdg_toplevel
1649- */
1650-#define XDG_TOPLEVEL_DESTROY_SINCE_VERSION 1
1651-/**
1652- * @ingroup iface_xdg_toplevel
1653- */
1654-#define XDG_TOPLEVEL_SET_PARENT_SINCE_VERSION 1
1655-/**
1656- * @ingroup iface_xdg_toplevel
1657- */
1658-#define XDG_TOPLEVEL_SET_TITLE_SINCE_VERSION 1
1659-/**
1660- * @ingroup iface_xdg_toplevel
1661- */
1662-#define XDG_TOPLEVEL_SET_APP_ID_SINCE_VERSION 1
1663-/**
1664- * @ingroup iface_xdg_toplevel
1665- */
1666-#define XDG_TOPLEVEL_SHOW_WINDOW_MENU_SINCE_VERSION 1
1667-/**
1668- * @ingroup iface_xdg_toplevel
1669- */
1670-#define XDG_TOPLEVEL_MOVE_SINCE_VERSION 1
1671-/**
1672- * @ingroup iface_xdg_toplevel
1673- */
1674-#define XDG_TOPLEVEL_RESIZE_SINCE_VERSION 1
1675-/**
1676- * @ingroup iface_xdg_toplevel
1677- */
1678-#define XDG_TOPLEVEL_SET_MAX_SIZE_SINCE_VERSION 1
1679-/**
1680- * @ingroup iface_xdg_toplevel
1681- */
1682-#define XDG_TOPLEVEL_SET_MIN_SIZE_SINCE_VERSION 1
1683-/**
1684- * @ingroup iface_xdg_toplevel
1685- */
1686-#define XDG_TOPLEVEL_SET_MAXIMIZED_SINCE_VERSION 1
1687-/**
1688- * @ingroup iface_xdg_toplevel
1689- */
1690-#define XDG_TOPLEVEL_UNSET_MAXIMIZED_SINCE_VERSION 1
1691-/**
1692- * @ingroup iface_xdg_toplevel
1693- */
1694-#define XDG_TOPLEVEL_SET_FULLSCREEN_SINCE_VERSION 1
1695-/**
1696- * @ingroup iface_xdg_toplevel
1697- */
1698-#define XDG_TOPLEVEL_UNSET_FULLSCREEN_SINCE_VERSION 1
1699-/**
1700- * @ingroup iface_xdg_toplevel
1701- */
1702-#define XDG_TOPLEVEL_SET_MINIMIZED_SINCE_VERSION 1
1703-
1704-/** @ingroup iface_xdg_toplevel */
1705-static inline void
1706-xdg_toplevel_set_user_data(struct xdg_toplevel *xdg_toplevel, void *user_data)
1707-{
1708- wl_proxy_set_user_data((struct wl_proxy *) xdg_toplevel, user_data);
1709-}
1710-
1711-/** @ingroup iface_xdg_toplevel */
1712-static inline void *
1713-xdg_toplevel_get_user_data(struct xdg_toplevel *xdg_toplevel)
1714-{
1715- return wl_proxy_get_user_data((struct wl_proxy *) xdg_toplevel);
1716-}
1717-
1718-static inline uint32_t
1719-xdg_toplevel_get_version(struct xdg_toplevel *xdg_toplevel)
1720-{
1721- return wl_proxy_get_version((struct wl_proxy *) xdg_toplevel);
1722-}
1723-
1724-/**
1725- * @ingroup iface_xdg_toplevel
1726- *
1727- * This request destroys the role surface and unmaps the surface;
1728- * see "Unmapping" behavior in interface section for details.
1729- */
1730-static inline void
1731-xdg_toplevel_destroy(struct xdg_toplevel *xdg_toplevel)
1732-{
1733- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1734- XDG_TOPLEVEL_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), WL_MARSHAL_FLAG_DESTROY);
1735-}
1736-
1737-/**
1738- * @ingroup iface_xdg_toplevel
1739- *
1740- * Set the "parent" of this surface. This surface should be stacked
1741- * above the parent surface and all other ancestor surfaces.
1742- *
1743- * Parent surfaces should be set on dialogs, toolboxes, or other
1744- * "auxiliary" surfaces, so that the parent is raised when the dialog
1745- * is raised.
1746- *
1747- * Setting a null parent for a child surface unsets its parent. Setting
1748- * a null parent for a surface which currently has no parent is a no-op.
1749- *
1750- * Only mapped surfaces can have child surfaces. Setting a parent which
1751- * is not mapped is equivalent to setting a null parent. If a surface
1752- * becomes unmapped, its children's parent is set to the parent of
1753- * the now-unmapped surface. If the now-unmapped surface has no parent,
1754- * its children's parent is unset. If the now-unmapped surface becomes
1755- * mapped again, its parent-child relationship is not restored.
1756- *
1757- * The parent toplevel must not be one of the child toplevel's
1758- * descendants, and the parent must be different from the child toplevel,
1759- * otherwise the invalid_parent protocol error is raised.
1760- */
1761-static inline void
1762-xdg_toplevel_set_parent(struct xdg_toplevel *xdg_toplevel, struct xdg_toplevel *parent)
1763-{
1764- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1765- XDG_TOPLEVEL_SET_PARENT, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, parent);
1766-}
1767-
1768-/**
1769- * @ingroup iface_xdg_toplevel
1770- *
1771- * Set a short title for the surface.
1772- *
1773- * This string may be used to identify the surface in a task bar,
1774- * window list, or other user interface elements provided by the
1775- * compositor.
1776- *
1777- * The string must be encoded in UTF-8.
1778- */
1779-static inline void
1780-xdg_toplevel_set_title(struct xdg_toplevel *xdg_toplevel, const char *title)
1781-{
1782- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1783- XDG_TOPLEVEL_SET_TITLE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, title);
1784-}
1785-
1786-/**
1787- * @ingroup iface_xdg_toplevel
1788- *
1789- * Set an application identifier for the surface.
1790- *
1791- * The app ID identifies the general class of applications to which
1792- * the surface belongs. The compositor can use this to group multiple
1793- * surfaces together, or to determine how to launch a new application.
1794- *
1795- * For D-Bus activatable applications, the app ID is used as the D-Bus
1796- * service name.
1797- *
1798- * The compositor shell will try to group application surfaces together
1799- * by their app ID. As a best practice, it is suggested to select app
1800- * ID's that match the basename of the application's .desktop file.
1801- * For example, "org.freedesktop.FooViewer" where the .desktop file is
1802- * "org.freedesktop.FooViewer.desktop".
1803- *
1804- * Like other properties, a set_app_id request can be sent after the
1805- * xdg_toplevel has been mapped to update the property.
1806- *
1807- * See the desktop-entry specification [0] for more details on
1808- * application identifiers and how they relate to well-known D-Bus
1809- * names and .desktop files.
1810- *
1811- * [0] https://standards.freedesktop.org/desktop-entry-spec/
1812- */
1813-static inline void
1814-xdg_toplevel_set_app_id(struct xdg_toplevel *xdg_toplevel, const char *app_id)
1815-{
1816- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1817- XDG_TOPLEVEL_SET_APP_ID, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, app_id);
1818-}
1819-
1820-/**
1821- * @ingroup iface_xdg_toplevel
1822- *
1823- * Clients implementing client-side decorations might want to show
1824- * a context menu when right-clicking on the decorations, giving the
1825- * user a menu that they can use to maximize or minimize the window.
1826- *
1827- * This request asks the compositor to pop up such a window menu at
1828- * the given position, relative to the local surface coordinates of
1829- * the parent surface. There are no guarantees as to what menu items
1830- * the window menu contains, or even if a window menu will be drawn
1831- * at all.
1832- *
1833- * This request must be used in response to some sort of user action
1834- * like a button press, key press, or touch down event.
1835- */
1836-static inline void
1837-xdg_toplevel_show_window_menu(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
1838-{
1839- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1840- XDG_TOPLEVEL_SHOW_WINDOW_MENU, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, seat, serial, x, y);
1841-}
1842-
1843-/**
1844- * @ingroup iface_xdg_toplevel
1845- *
1846- * Start an interactive, user-driven move of the surface.
1847- *
1848- * This request must be used in response to some sort of user action
1849- * like a button press, key press, or touch down event. The passed
1850- * serial is used to determine the type of interactive move (touch,
1851- * pointer, etc).
1852- *
1853- * The server may ignore move requests depending on the state of
1854- * the surface (e.g. fullscreen or maximized), or if the passed serial
1855- * is no longer valid.
1856- *
1857- * If triggered, the surface will lose the focus of the device
1858- * (wl_pointer, wl_touch, etc) used for the move. It is up to the
1859- * compositor to visually indicate that the move is taking place, such as
1860- * updating a pointer cursor, during the move. There is no guarantee
1861- * that the device focus will return when the move is completed.
1862- */
1863-static inline void
1864-xdg_toplevel_move(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial)
1865-{
1866- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1867- XDG_TOPLEVEL_MOVE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, seat, serial);
1868-}
1869-
1870-/**
1871- * @ingroup iface_xdg_toplevel
1872- *
1873- * Start a user-driven, interactive resize of the surface.
1874- *
1875- * This request must be used in response to some sort of user action
1876- * like a button press, key press, or touch down event. The passed
1877- * serial is used to determine the type of interactive resize (touch,
1878- * pointer, etc).
1879- *
1880- * The server may ignore resize requests depending on the state of
1881- * the surface (e.g. fullscreen or maximized).
1882- *
1883- * If triggered, the client will receive configure events with the
1884- * "resize" state enum value and the expected sizes. See the "resize"
1885- * enum value for more details about what is required. The client
1886- * must also acknowledge configure events using "ack_configure". After
1887- * the resize is completed, the client will receive another "configure"
1888- * event without the resize state.
1889- *
1890- * If triggered, the surface also will lose the focus of the device
1891- * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
1892- * compositor to visually indicate that the resize is taking place,
1893- * such as updating a pointer cursor, during the resize. There is no
1894- * guarantee that the device focus will return when the resize is
1895- * completed.
1896- *
1897- * The edges parameter specifies how the surface should be resized, and
1898- * is one of the values of the resize_edge enum. Values not matching
1899- * a variant of the enum will cause the invalid_resize_edge protocol error.
1900- * The compositor may use this information to update the surface position
1901- * for example when dragging the top left corner. The compositor may also
1902- * use this information to adapt its behavior, e.g. choose an appropriate
1903- * cursor image.
1904- */
1905-static inline void
1906-xdg_toplevel_resize(struct xdg_toplevel *xdg_toplevel, struct wl_seat *seat, uint32_t serial, uint32_t edges)
1907-{
1908- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1909- XDG_TOPLEVEL_RESIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, seat, serial, edges);
1910-}
1911-
1912-/**
1913- * @ingroup iface_xdg_toplevel
1914- *
1915- * Set a maximum size for the window.
1916- *
1917- * The client can specify a maximum size so that the compositor does
1918- * not try to configure the window beyond this size.
1919- *
1920- * The width and height arguments are in window geometry coordinates.
1921- * See xdg_surface.set_window_geometry.
1922- *
1923- * Values set in this way are double-buffered, see wl_surface.commit.
1924- *
1925- * The compositor can use this information to allow or disallow
1926- * different states like maximize or fullscreen and draw accurate
1927- * animations.
1928- *
1929- * Similarly, a tiling window manager may use this information to
1930- * place and resize client windows in a more effective way.
1931- *
1932- * The client should not rely on the compositor to obey the maximum
1933- * size. The compositor may decide to ignore the values set by the
1934- * client and request a larger size.
1935- *
1936- * If never set, or a value of zero in the request, means that the
1937- * client has no expected maximum size in the given dimension.
1938- * As a result, a client wishing to reset the maximum size
1939- * to an unspecified state can use zero for width and height in the
1940- * request.
1941- *
1942- * Requesting a maximum size to be smaller than the minimum size of
1943- * a surface is illegal and will result in an invalid_size error.
1944- *
1945- * The width and height must be greater than or equal to zero. Using
1946- * strictly negative values for width or height will result in a
1947- * invalid_size error.
1948- */
1949-static inline void
1950-xdg_toplevel_set_max_size(struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height)
1951-{
1952- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1953- XDG_TOPLEVEL_SET_MAX_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, width, height);
1954-}
1955-
1956-/**
1957- * @ingroup iface_xdg_toplevel
1958- *
1959- * Set a minimum size for the window.
1960- *
1961- * The client can specify a minimum size so that the compositor does
1962- * not try to configure the window below this size.
1963- *
1964- * The width and height arguments are in window geometry coordinates.
1965- * See xdg_surface.set_window_geometry.
1966- *
1967- * Values set in this way are double-buffered, see wl_surface.commit.
1968- *
1969- * The compositor can use this information to allow or disallow
1970- * different states like maximize or fullscreen and draw accurate
1971- * animations.
1972- *
1973- * Similarly, a tiling window manager may use this information to
1974- * place and resize client windows in a more effective way.
1975- *
1976- * The client should not rely on the compositor to obey the minimum
1977- * size. The compositor may decide to ignore the values set by the
1978- * client and request a smaller size.
1979- *
1980- * If never set, or a value of zero in the request, means that the
1981- * client has no expected minimum size in the given dimension.
1982- * As a result, a client wishing to reset the minimum size
1983- * to an unspecified state can use zero for width and height in the
1984- * request.
1985- *
1986- * Requesting a minimum size to be larger than the maximum size of
1987- * a surface is illegal and will result in an invalid_size error.
1988- *
1989- * The width and height must be greater than or equal to zero. Using
1990- * strictly negative values for width and height will result in a
1991- * invalid_size error.
1992- */
1993-static inline void
1994-xdg_toplevel_set_min_size(struct xdg_toplevel *xdg_toplevel, int32_t width, int32_t height)
1995-{
1996- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
1997- XDG_TOPLEVEL_SET_MIN_SIZE, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, width, height);
1998-}
1999-
2000-/**
2001- * @ingroup iface_xdg_toplevel
2002- *
2003- * Maximize the surface.
2004- *
2005- * After requesting that the surface should be maximized, the compositor
2006- * will respond by emitting a configure event. Whether this configure
2007- * actually sets the window maximized is subject to compositor policies.
2008- * The client must then update its content, drawing in the configured
2009- * state. The client must also acknowledge the configure when committing
2010- * the new content (see ack_configure).
2011- *
2012- * It is up to the compositor to decide how and where to maximize the
2013- * surface, for example which output and what region of the screen should
2014- * be used.
2015- *
2016- * If the surface was already maximized, the compositor will still emit
2017- * a configure event with the "maximized" state.
2018- *
2019- * If the surface is in a fullscreen state, this request has no direct
2020- * effect. It may alter the state the surface is returned to when
2021- * unmaximized unless overridden by the compositor.
2022- */
2023-static inline void
2024-xdg_toplevel_set_maximized(struct xdg_toplevel *xdg_toplevel)
2025-{
2026- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
2027- XDG_TOPLEVEL_SET_MAXIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0);
2028-}
2029-
2030-/**
2031- * @ingroup iface_xdg_toplevel
2032- *
2033- * Unmaximize the surface.
2034- *
2035- * After requesting that the surface should be unmaximized, the compositor
2036- * will respond by emitting a configure event. Whether this actually
2037- * un-maximizes the window is subject to compositor policies.
2038- * If available and applicable, the compositor will include the window
2039- * geometry dimensions the window had prior to being maximized in the
2040- * configure event. The client must then update its content, drawing it in
2041- * the configured state. The client must also acknowledge the configure
2042- * when committing the new content (see ack_configure).
2043- *
2044- * It is up to the compositor to position the surface after it was
2045- * unmaximized; usually the position the surface had before maximizing, if
2046- * applicable.
2047- *
2048- * If the surface was already not maximized, the compositor will still
2049- * emit a configure event without the "maximized" state.
2050- *
2051- * If the surface is in a fullscreen state, this request has no direct
2052- * effect. It may alter the state the surface is returned to when
2053- * unmaximized unless overridden by the compositor.
2054- */
2055-static inline void
2056-xdg_toplevel_unset_maximized(struct xdg_toplevel *xdg_toplevel)
2057-{
2058- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
2059- XDG_TOPLEVEL_UNSET_MAXIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0);
2060-}
2061-
2062-/**
2063- * @ingroup iface_xdg_toplevel
2064- *
2065- * Make the surface fullscreen.
2066- *
2067- * After requesting that the surface should be fullscreened, the
2068- * compositor will respond by emitting a configure event. Whether the
2069- * client is actually put into a fullscreen state is subject to compositor
2070- * policies. The client must also acknowledge the configure when
2071- * committing the new content (see ack_configure).
2072- *
2073- * The output passed by the request indicates the client's preference as
2074- * to which display it should be set fullscreen on. If this value is NULL,
2075- * it's up to the compositor to choose which display will be used to map
2076- * this surface.
2077- *
2078- * If the surface doesn't cover the whole output, the compositor will
2079- * position the surface in the center of the output and compensate with
2080- * with border fill covering the rest of the output. The content of the
2081- * border fill is undefined, but should be assumed to be in some way that
2082- * attempts to blend into the surrounding area (e.g. solid black).
2083- *
2084- * If the fullscreened surface is not opaque, the compositor must make
2085- * sure that other screen content not part of the same surface tree (made
2086- * up of subsurfaces, popups or similarly coupled surfaces) are not
2087- * visible below the fullscreened surface.
2088- */
2089-static inline void
2090-xdg_toplevel_set_fullscreen(struct xdg_toplevel *xdg_toplevel, struct wl_output *output)
2091-{
2092- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
2093- XDG_TOPLEVEL_SET_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0, output);
2094-}
2095-
2096-/**
2097- * @ingroup iface_xdg_toplevel
2098- *
2099- * Make the surface no longer fullscreen.
2100- *
2101- * After requesting that the surface should be unfullscreened, the
2102- * compositor will respond by emitting a configure event.
2103- * Whether this actually removes the fullscreen state of the client is
2104- * subject to compositor policies.
2105- *
2106- * Making a surface unfullscreen sets states for the surface based on the following:
2107- * * the state(s) it may have had before becoming fullscreen
2108- * * any state(s) decided by the compositor
2109- * * any state(s) requested by the client while the surface was fullscreen
2110- *
2111- * The compositor may include the previous window geometry dimensions in
2112- * the configure event, if applicable.
2113- *
2114- * The client must also acknowledge the configure when committing the new
2115- * content (see ack_configure).
2116- */
2117-static inline void
2118-xdg_toplevel_unset_fullscreen(struct xdg_toplevel *xdg_toplevel)
2119-{
2120- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
2121- XDG_TOPLEVEL_UNSET_FULLSCREEN, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0);
2122-}
2123-
2124-/**
2125- * @ingroup iface_xdg_toplevel
2126- *
2127- * Request that the compositor minimize your surface. There is no
2128- * way to know if the surface is currently minimized, nor is there
2129- * any way to unset minimization on this surface.
2130- *
2131- * If you are looking to throttle redrawing when minimized, please
2132- * instead use the wl_surface.frame event for this, as this will
2133- * also work with live previews on windows in Alt-Tab, Expose or
2134- * similar compositor features.
2135- */
2136-static inline void
2137-xdg_toplevel_set_minimized(struct xdg_toplevel *xdg_toplevel)
2138-{
2139- wl_proxy_marshal_flags((struct wl_proxy *) xdg_toplevel,
2140- XDG_TOPLEVEL_SET_MINIMIZED, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_toplevel), 0);
2141-}
2142-
2143-#ifndef XDG_POPUP_ERROR_ENUM
2144-#define XDG_POPUP_ERROR_ENUM
2145-enum xdg_popup_error {
2146- /**
2147- * tried to grab after being mapped
2148- */
2149- XDG_POPUP_ERROR_INVALID_GRAB = 0,
2150-};
2151-#endif /* XDG_POPUP_ERROR_ENUM */
2152-
2153-/**
2154- * @ingroup iface_xdg_popup
2155- * @struct xdg_popup_listener
2156- */
2157-struct xdg_popup_listener {
2158- /**
2159- * configure the popup surface
2160- *
2161- * This event asks the popup surface to configure itself given
2162- * the configuration. The configured state should not be applied
2163- * immediately. See xdg_surface.configure for details.
2164- *
2165- * The x and y arguments represent the position the popup was
2166- * placed at given the xdg_positioner rule, relative to the upper
2167- * left corner of the window geometry of the parent surface.
2168- *
2169- * For version 2 or older, the configure event for an xdg_popup is
2170- * only ever sent once for the initial configuration. Starting with
2171- * version 3, it may be sent again if the popup is setup with an
2172- * xdg_positioner with set_reactive requested, or in response to
2173- * xdg_popup.reposition requests.
2174- * @param x x position relative to parent surface window geometry
2175- * @param y y position relative to parent surface window geometry
2176- * @param width window geometry width
2177- * @param height window geometry height
2178- */
2179- void (*configure)(void *data,
2180- struct xdg_popup *xdg_popup,
2181- int32_t x,
2182- int32_t y,
2183- int32_t width,
2184- int32_t height);
2185- /**
2186- * popup interaction is done
2187- *
2188- * The popup_done event is sent out when a popup is dismissed by
2189- * the compositor. The client should destroy the xdg_popup object
2190- * at this point.
2191- */
2192- void (*popup_done)(void *data,
2193- struct xdg_popup *xdg_popup);
2194- /**
2195- * signal the completion of a repositioned request
2196- *
2197- * The repositioned event is sent as part of a popup
2198- * configuration sequence, together with xdg_popup.configure and
2199- * lastly xdg_surface.configure to notify the completion of a
2200- * reposition request.
2201- *
2202- * The repositioned event is to notify about the completion of a
2203- * xdg_popup.reposition request. The token argument is the token
2204- * passed in the xdg_popup.reposition request.
2205- *
2206- * Immediately after this event is emitted, xdg_popup.configure and
2207- * xdg_surface.configure will be sent with the updated size and
2208- * position, as well as a new configure serial.
2209- *
2210- * The client should optionally update the content of the popup,
2211- * but must acknowledge the new popup configuration for the new
2212- * position to take effect. See xdg_surface.ack_configure for
2213- * details.
2214- * @param token reposition request token
2215- * @since 3
2216- */
2217- void (*repositioned)(void *data,
2218- struct xdg_popup *xdg_popup,
2219- uint32_t token);
2220-};
2221-
2222-/**
2223- * @ingroup iface_xdg_popup
2224- */
2225-static inline int
2226-xdg_popup_add_listener(struct xdg_popup *xdg_popup,
2227- const struct xdg_popup_listener *listener, void *data)
2228-{
2229- return wl_proxy_add_listener((struct wl_proxy *) xdg_popup,
2230- (void (**)(void)) listener, data);
2231-}
2232-
2233-#define XDG_POPUP_DESTROY 0
2234-#define XDG_POPUP_GRAB 1
2235-#define XDG_POPUP_REPOSITION 2
2236-
2237-/**
2238- * @ingroup iface_xdg_popup
2239- */
2240-#define XDG_POPUP_CONFIGURE_SINCE_VERSION 1
2241-/**
2242- * @ingroup iface_xdg_popup
2243- */
2244-#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1
2245-/**
2246- * @ingroup iface_xdg_popup
2247- */
2248-#define XDG_POPUP_REPOSITIONED_SINCE_VERSION 3
2249-
2250-/**
2251- * @ingroup iface_xdg_popup
2252- */
2253-#define XDG_POPUP_DESTROY_SINCE_VERSION 1
2254-/**
2255- * @ingroup iface_xdg_popup
2256- */
2257-#define XDG_POPUP_GRAB_SINCE_VERSION 1
2258-/**
2259- * @ingroup iface_xdg_popup
2260- */
2261-#define XDG_POPUP_REPOSITION_SINCE_VERSION 3
2262-
2263-/** @ingroup iface_xdg_popup */
2264-static inline void
2265-xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data)
2266-{
2267- wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data);
2268-}
2269-
2270-/** @ingroup iface_xdg_popup */
2271-static inline void *
2272-xdg_popup_get_user_data(struct xdg_popup *xdg_popup)
2273-{
2274- return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup);
2275-}
2276-
2277-static inline uint32_t
2278-xdg_popup_get_version(struct xdg_popup *xdg_popup)
2279-{
2280- return wl_proxy_get_version((struct wl_proxy *) xdg_popup);
2281-}
2282-
2283-/**
2284- * @ingroup iface_xdg_popup
2285- *
2286- * This destroys the popup. Explicitly destroying the xdg_popup
2287- * object will also dismiss the popup, and unmap the surface.
2288- *
2289- * If this xdg_popup is not the "topmost" popup, the
2290- * xdg_wm_base.not_the_topmost_popup protocol error will be sent.
2291- */
2292-static inline void
2293-xdg_popup_destroy(struct xdg_popup *xdg_popup)
2294-{
2295- wl_proxy_marshal_flags((struct wl_proxy *) xdg_popup,
2296- XDG_POPUP_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_popup), WL_MARSHAL_FLAG_DESTROY);
2297-}
2298-
2299-/**
2300- * @ingroup iface_xdg_popup
2301- *
2302- * This request makes the created popup take an explicit grab. An explicit
2303- * grab will be dismissed when the user dismisses the popup, or when the
2304- * client destroys the xdg_popup. This can be done by the user clicking
2305- * outside the surface, using the keyboard, or even locking the screen
2306- * through closing the lid or a timeout.
2307- *
2308- * If the compositor denies the grab, the popup will be immediately
2309- * dismissed.
2310- *
2311- * This request must be used in response to some sort of user action like a
2312- * button press, key press, or touch down event. The serial number of the
2313- * event should be passed as 'serial'.
2314- *
2315- * The parent of a grabbing popup must either be an xdg_toplevel surface or
2316- * another xdg_popup with an explicit grab. If the parent is another
2317- * xdg_popup it means that the popups are nested, with this popup now being
2318- * the topmost popup.
2319- *
2320- * Nested popups must be destroyed in the reverse order they were created
2321- * in, e.g. the only popup you are allowed to destroy at all times is the
2322- * topmost one.
2323- *
2324- * When compositors choose to dismiss a popup, they may dismiss every
2325- * nested grabbing popup as well. When a compositor dismisses popups, it
2326- * will follow the same dismissing order as required from the client.
2327- *
2328- * If the topmost grabbing popup is destroyed, the grab will be returned to
2329- * the parent of the popup, if that parent previously had an explicit grab.
2330- *
2331- * If the parent is a grabbing popup which has already been dismissed, this
2332- * popup will be immediately dismissed. If the parent is a popup that did
2333- * not take an explicit grab, an error will be raised.
2334- *
2335- * During a popup grab, the client owning the grab will receive pointer
2336- * and touch events for all their surfaces as normal (similar to an
2337- * "owner-events" grab in X11 parlance), while the top most grabbing popup
2338- * will always have keyboard focus.
2339- */
2340-static inline void
2341-xdg_popup_grab(struct xdg_popup *xdg_popup, struct wl_seat *seat, uint32_t serial)
2342-{
2343- wl_proxy_marshal_flags((struct wl_proxy *) xdg_popup,
2344- XDG_POPUP_GRAB, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_popup), 0, seat, serial);
2345-}
2346-
2347-/**
2348- * @ingroup iface_xdg_popup
2349- *
2350- * Reposition an already-mapped popup. The popup will be placed given the
2351- * details in the passed xdg_positioner object, and a
2352- * xdg_popup.repositioned followed by xdg_popup.configure and
2353- * xdg_surface.configure will be emitted in response. Any parameters set
2354- * by the previous positioner will be discarded.
2355- *
2356- * The passed token will be sent in the corresponding
2357- * xdg_popup.repositioned event. The new popup position will not take
2358- * effect until the corresponding configure event is acknowledged by the
2359- * client. See xdg_popup.repositioned for details. The token itself is
2360- * opaque, and has no other special meaning.
2361- *
2362- * If multiple reposition requests are sent, the compositor may skip all
2363- * but the last one.
2364- *
2365- * If the popup is repositioned in response to a configure event for its
2366- * parent, the client should send an xdg_positioner.set_parent_configure
2367- * and possibly an xdg_positioner.set_parent_size request to allow the
2368- * compositor to properly constrain the popup.
2369- *
2370- * If the popup is repositioned together with a parent that is being
2371- * resized, but not in response to a configure event, the client should
2372- * send an xdg_positioner.set_parent_size request.
2373- */
2374-static inline void
2375-xdg_popup_reposition(struct xdg_popup *xdg_popup, struct xdg_positioner *positioner, uint32_t token)
2376-{
2377- wl_proxy_marshal_flags((struct wl_proxy *) xdg_popup,
2378- XDG_POPUP_REPOSITION, NULL, wl_proxy_get_version((struct wl_proxy *) xdg_popup), 0, positioner, token);
2379-}
2380-
2381-#ifdef __cplusplus
2382-}
2383-#endif
2384-
2385-#endif
+0,
-184
1@@ -1,184 +0,0 @@
2-/* Generated by wayland-scanner 1.25.0 */
3-
4-/*
5- * Copyright © 2008-2013 Kristian Høgsberg
6- * Copyright © 2013 Rafael Antognolli
7- * Copyright © 2013 Jasper St. Pierre
8- * Copyright © 2010-2013 Intel Corporation
9- * Copyright © 2015-2017 Samsung Electronics Co., Ltd
10- * Copyright © 2015-2017 Red Hat Inc.
11- *
12- * Permission is hereby granted, free of charge, to any person obtaining a
13- * copy of this software and associated documentation files (the "Software"),
14- * to deal in the Software without restriction, including without limitation
15- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16- * and/or sell copies of the Software, and to permit persons to whom the
17- * Software is furnished to do so, subject to the following conditions:
18- *
19- * The above copyright notice and this permission notice (including the next
20- * paragraph) shall be included in all copies or substantial portions of the
21- * Software.
22- *
23- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29- * DEALINGS IN THE SOFTWARE.
30- */
31-
32-#include <stdbool.h>
33-#include <stdlib.h>
34-#include <stdint.h>
35-#include "wayland-util.h"
36-
37-#ifndef __has_attribute
38-# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
39-#endif
40-
41-#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
42-#define WL_PRIVATE __attribute__ ((visibility("hidden")))
43-#else
44-#define WL_PRIVATE
45-#endif
46-
47-extern const struct wl_interface wl_output_interface;
48-extern const struct wl_interface wl_seat_interface;
49-extern const struct wl_interface wl_surface_interface;
50-extern const struct wl_interface xdg_popup_interface;
51-extern const struct wl_interface xdg_positioner_interface;
52-extern const struct wl_interface xdg_surface_interface;
53-extern const struct wl_interface xdg_toplevel_interface;
54-
55-static const struct wl_interface *xdg_shell_types[] = {
56- NULL,
57- NULL,
58- NULL,
59- NULL,
60- &xdg_positioner_interface,
61- &xdg_surface_interface,
62- &wl_surface_interface,
63- &xdg_toplevel_interface,
64- &xdg_popup_interface,
65- &xdg_surface_interface,
66- &xdg_positioner_interface,
67- &xdg_toplevel_interface,
68- &wl_seat_interface,
69- NULL,
70- NULL,
71- NULL,
72- &wl_seat_interface,
73- NULL,
74- &wl_seat_interface,
75- NULL,
76- NULL,
77- &wl_output_interface,
78- &wl_seat_interface,
79- NULL,
80- &xdg_positioner_interface,
81- NULL,
82-};
83-
84-static const struct wl_message xdg_wm_base_requests[] = {
85- { "destroy", "", xdg_shell_types + 0 },
86- { "create_positioner", "n", xdg_shell_types + 4 },
87- { "get_xdg_surface", "no", xdg_shell_types + 5 },
88- { "pong", "u", xdg_shell_types + 0 },
89-};
90-
91-static const struct wl_message xdg_wm_base_events[] = {
92- { "ping", "u", xdg_shell_types + 0 },
93-};
94-
95-WL_PRIVATE const struct wl_interface xdg_wm_base_interface = {
96- "xdg_wm_base", 7,
97- 4, xdg_wm_base_requests,
98- 1, xdg_wm_base_events,
99-};
100-
101-static const struct wl_message xdg_positioner_requests[] = {
102- { "destroy", "", xdg_shell_types + 0 },
103- { "set_size", "ii", xdg_shell_types + 0 },
104- { "set_anchor_rect", "iiii", xdg_shell_types + 0 },
105- { "set_anchor", "u", xdg_shell_types + 0 },
106- { "set_gravity", "u", xdg_shell_types + 0 },
107- { "set_constraint_adjustment", "u", xdg_shell_types + 0 },
108- { "set_offset", "ii", xdg_shell_types + 0 },
109- { "set_reactive", "3", xdg_shell_types + 0 },
110- { "set_parent_size", "3ii", xdg_shell_types + 0 },
111- { "set_parent_configure", "3u", xdg_shell_types + 0 },
112-};
113-
114-WL_PRIVATE const struct wl_interface xdg_positioner_interface = {
115- "xdg_positioner", 7,
116- 10, xdg_positioner_requests,
117- 0, NULL,
118-};
119-
120-static const struct wl_message xdg_surface_requests[] = {
121- { "destroy", "", xdg_shell_types + 0 },
122- { "get_toplevel", "n", xdg_shell_types + 7 },
123- { "get_popup", "n?oo", xdg_shell_types + 8 },
124- { "set_window_geometry", "iiii", xdg_shell_types + 0 },
125- { "ack_configure", "u", xdg_shell_types + 0 },
126-};
127-
128-static const struct wl_message xdg_surface_events[] = {
129- { "configure", "u", xdg_shell_types + 0 },
130-};
131-
132-WL_PRIVATE const struct wl_interface xdg_surface_interface = {
133- "xdg_surface", 7,
134- 5, xdg_surface_requests,
135- 1, xdg_surface_events,
136-};
137-
138-static const struct wl_message xdg_toplevel_requests[] = {
139- { "destroy", "", xdg_shell_types + 0 },
140- { "set_parent", "?o", xdg_shell_types + 11 },
141- { "set_title", "s", xdg_shell_types + 0 },
142- { "set_app_id", "s", xdg_shell_types + 0 },
143- { "show_window_menu", "ouii", xdg_shell_types + 12 },
144- { "move", "ou", xdg_shell_types + 16 },
145- { "resize", "ouu", xdg_shell_types + 18 },
146- { "set_max_size", "ii", xdg_shell_types + 0 },
147- { "set_min_size", "ii", xdg_shell_types + 0 },
148- { "set_maximized", "", xdg_shell_types + 0 },
149- { "unset_maximized", "", xdg_shell_types + 0 },
150- { "set_fullscreen", "?o", xdg_shell_types + 21 },
151- { "unset_fullscreen", "", xdg_shell_types + 0 },
152- { "set_minimized", "", xdg_shell_types + 0 },
153-};
154-
155-static const struct wl_message xdg_toplevel_events[] = {
156- { "configure", "iia", xdg_shell_types + 0 },
157- { "close", "", xdg_shell_types + 0 },
158- { "configure_bounds", "4ii", xdg_shell_types + 0 },
159- { "wm_capabilities", "5a", xdg_shell_types + 0 },
160-};
161-
162-WL_PRIVATE const struct wl_interface xdg_toplevel_interface = {
163- "xdg_toplevel", 7,
164- 14, xdg_toplevel_requests,
165- 4, xdg_toplevel_events,
166-};
167-
168-static const struct wl_message xdg_popup_requests[] = {
169- { "destroy", "", xdg_shell_types + 0 },
170- { "grab", "ou", xdg_shell_types + 22 },
171- { "reposition", "3ou", xdg_shell_types + 24 },
172-};
173-
174-static const struct wl_message xdg_popup_events[] = {
175- { "configure", "iiii", xdg_shell_types + 0 },
176- { "popup_done", "", xdg_shell_types + 0 },
177- { "repositioned", "3u", xdg_shell_types + 0 },
178-};
179-
180-WL_PRIVATE const struct wl_interface xdg_popup_interface = {
181- "xdg_popup", 7,
182- 3, xdg_popup_requests,
183- 3, xdg_popup_events,
184-};
185-