KWayland

wayland-xdg-shell-v5-client-protocol.h
1 /*
2  * This file is *NOT* autogenerated.
3  * It contains XDGShellV5 with method names modified to be not clashing with XDG stable
4  * Strings inside the sent protocol remain the same
5  */
6 #ifndef ZXDG_SHELL_V5_UNSTABLE_V5_CLIENT_PROTOCOL_H
7 #define ZXDG_SHELL_V5_UNSTABLE_V5_CLIENT_PROTOCOL_H
8 
9 #include "wayland-client.h"
10 #include <stddef.h>
11 #include <stdint.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /**
18  * @page page_zxdg_shell_v5_unstable_v5 The zxdg_shell_v5_unstable_v5 protocol
19  * @section page_ifaces_zxdg_shell_v5_unstable_v5 Interfaces
20  * - @subpage page_iface_xdg_shell - create desktop-style surfaces
21  * - @subpage page_iface_xdg_surface - A desktop window
22  * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus
23  * @section page_copyright_zxdg_shell_v5_unstable_v5 Copyright
24  * <pre>
25  *
26  * SPDX-FileCopyrightText: 2008-2013 Kristian Høgsberg
27  * SPDX-FileCopyrightText: 2013 Rafael Antognolli
28  * SPDX-FileCopyrightText: 2013 Jasper St. Pierre
29  * SPDX-FileCopyrightText: 2010-2013 Intel Corporation
30  *
31  * SPDX-License-Identifier: MIT
32  * </pre>
33  */
34 struct wl_output;
35 struct wl_seat;
36 struct wl_surface;
37 
38 struct xdg_surface;
39 struct xdg_popup;
40 struct xdg_shell;
41 
42 /**
43  * @page page_iface_xdg_shell zxdg_shell_v5
44  * @section page_iface_zxdg_shell_v5_desc Description
45  *
46  * xdg_shell allows clients to turn a wl_surface into a "real window"
47  * which can be dragged, resized, stacked, and moved around by the
48  * user. Everything about this interface is suited towards traditional
49  * desktop environments.
50  * @section page_iface_zxdg_shell_v5_api API
51  * See @ref iface_xdg_shell.
52  */
53 /**
54  * @defgroup iface_xdg_shell The xdg_shell interface
55  *
56  * xdg_shell allows clients to turn a wl_surface into a "real window"
57  * which can be dragged, resized, stacked, and moved around by the
58  * user. Everything about this interface is suited towards traditional
59  * desktop environments.
60  */
61 extern const struct wl_interface zxdg_shell_v5_interface;
62 /**
63  * @page page_iface_xdg_surface zxdg_surface_v5
64  * @section page_iface_zxdg_surface_v5_desc Description
65  *
66  * An interface that may be implemented by a wl_surface, for
67  * implementations that provide a desktop-style user interface.
68  *
69  * It provides requests to treat surfaces like windows, allowing to set
70  * properties like maximized, fullscreen, minimized, and to move and resize
71  * them, and associate metadata like title and app id.
72  *
73  * The client must call wl_surface.commit on the corresponding wl_surface
74  * for the xdg_surface state to take effect. Prior to committing the new
75  * state, it can set up initial configuration, such as maximizing or setting
76  * a window geometry.
77  *
78  * Even without attaching a buffer the compositor must respond to initial
79  * committed configuration, for instance sending a configure event with
80  * expected window geometry if the client maximized its surface during
81  * initialization.
82  *
83  * For a surface to be mapped by the compositor the client must have
84  * committed both an xdg_surface state and a buffer.
85  * @section page_iface_zxdg_surface_v5_api API
86  * See @ref iface_xdg_surface.
87  */
88 /**
89  * @defgroup iface_xdg_surface The xdg_surface interface
90  *
91  * An interface that may be implemented by a wl_surface, for
92  * implementations that provide a desktop-style user interface.
93  *
94  * It provides requests to treat surfaces like windows, allowing to set
95  * properties like maximized, fullscreen, minimized, and to move and resize
96  * them, and associate metadata like title and app id.
97  *
98  * The client must call wl_surface.commit on the corresponding wl_surface
99  * for the xdg_surface state to take effect. Prior to committing the new
100  * state, it can set up initial configuration, such as maximizing or setting
101  * a window geometry.
102  *
103  * Even without attaching a buffer the compositor must respond to initial
104  * committed configuration, for instance sending a configure event with
105  * expected window geometry if the client maximized its surface during
106  * initialization.
107  *
108  * For a surface to be mapped by the compositor the client must have
109  * committed both an xdg_surface state and a buffer.
110  */
111 extern const struct wl_interface zxdg_surface_v5_interface;
112 /**
113  * @page page_iface_xdg_popup zxdg_popup_v5
114  * @section page_iface_zxdg_popup_v5_desc Description
115  *
116  * A popup surface is a short-lived, temporary surface that can be
117  * used to implement menus. It takes an explicit grab on the surface
118  * that will be dismissed when the user dismisses the popup. This can
119  * be done by the user clicking outside the surface, using the keyboard,
120  * or even locking the screen through closing the lid or a timeout.
121  *
122  * When the popup is dismissed, a popup_done event will be sent out,
123  * and at the same time the surface will be unmapped. The zxdg_popup_v5
124  * object is now inert and cannot be reactivated, so clients should
125  * destroy it. Explicitly destroying the xdg_popup object will also
126  * dismiss the popup and unmap the surface.
127  *
128  * Clients will receive events for all their surfaces during this
129  * grab (which is an "owner-events" grab in X11 parlance). This is
130  * done so that users can navigate through submenus and other
131  * "nested" popup windows without having to dismiss the topmost
132  * popup.
133  *
134  * Clients that want to dismiss the popup when another surface of
135  * their own is clicked should dismiss the popup using the destroy
136  * request.
137  *
138  * The parent surface must have either an xdg_surface or zxdg_popup_v5
139  * role.
140  *
141  * Specifying an xdg_popup for the parent means that the popups are
142  * nested, with this popup now being the topmost popup. Nested
143  * popups must be destroyed in the reverse order they were created
144  * in, e.g. the only popup you are allowed to destroy at all times
145  * is the topmost one.
146  *
147  * If there is an existing popup when creating a new popup, the
148  * parent must be the current topmost popup.
149  *
150  * A parent surface must be mapped before the new popup is mapped.
151  *
152  * When compositors choose to dismiss a popup, they will likely
153  * dismiss every nested popup as well. When a compositor dismisses
154  * popups, it will follow the same dismissing order as required
155  * from the client.
156  *
157  * The x and y arguments passed when creating the popup object specify
158  * where the top left of the popup should be placed, relative to the
159  * local surface coordinates of the parent surface. See
160  * xdg_shell.get_xdg_popup.
161  *
162  * The client must call wl_surface.commit on the corresponding wl_surface
163  * for the xdg_popup state to take effect.
164  *
165  * For a surface to be mapped by the compositor the client must have
166  * committed both the xdg_popup state and a buffer.
167  * @section page_iface_zxdg_popup_v5_api API
168  * See @ref iface_xdg_popup.
169  */
170 /**
171  * @defgroup iface_xdg_popup The xdg_popup interface
172  *
173  * A popup surface is a short-lived, temporary surface that can be
174  * used to implement menus. It takes an explicit grab on the surface
175  * that will be dismissed when the user dismisses the popup. This can
176  * be done by the user clicking outside the surface, using the keyboard,
177  * or even locking the screen through closing the lid or a timeout.
178  *
179  * When the popup is dismissed, a popup_done event will be sent out,
180  * and at the same time the surface will be unmapped. The zxdg_popup_v5
181  * object is now inert and cannot be reactivated, so clients should
182  * destroy it. Explicitly destroying the xdg_popup object will also
183  * dismiss the popup and unmap the surface.
184  *
185  * Clients will receive events for all their surfaces during this
186  * grab (which is an "owner-events" grab in X11 parlance). This is
187  * done so that users can navigate through submenus and other
188  * "nested" popup windows without having to dismiss the topmost
189  * popup.
190  *
191  * Clients that want to dismiss the popup when another surface of
192  * their own is clicked should dismiss the popup using the destroy
193  * request.
194  *
195  * The parent surface must have either an xdg_surface or zxdg_popup_v5
196  * role.
197  *
198  * Specifying an xdg_popup for the parent means that the popups are
199  * nested, with this popup now being the topmost popup. Nested
200  * popups must be destroyed in the reverse order they were created
201  * in, e.g. the only popup you are allowed to destroy at all times
202  * is the topmost one.
203  *
204  * If there is an existing popup when creating a new popup, the
205  * parent must be the current topmost popup.
206  *
207  * A parent surface must be mapped before the new popup is mapped.
208  *
209  * When compositors choose to dismiss a popup, they will likely
210  * dismiss every nested popup as well. When a compositor dismisses
211  * popups, it will follow the same dismissing order as required
212  * from the client.
213  *
214  * The x and y arguments passed when creating the popup object specify
215  * where the top left of the popup should be placed, relative to the
216  * local surface coordinates of the parent surface. See
217  * xdg_shell.get_xdg_popup.
218  *
219  * The client must call wl_surface.commit on the corresponding wl_surface
220  * for the xdg_popup state to take effect.
221  *
222  * For a surface to be mapped by the compositor the client must have
223  * committed both the xdg_popup state and a buffer.
224  */
225 extern const struct wl_interface zxdg_popup_v5_interface;
226 
227 #ifndef ZXDG_SHELL_V5_VERSION_ENUM
228 #define ZXDG_SHELL_V5_VERSION_ENUM
229 /**
230  * @ingroup iface_zxdg_shell_v5
231  * latest protocol version
232  *
233  * The 'current' member of this enum gives the version of the
234  * protocol. Implementations can compare this to the version
235  * they implement using static_assert to ensure the protocol and
236  * implementation versions match.
237  */
238 enum zxdg_shell_v5_version {
239  /**
240  * Always the latest version
241  */
243 };
244 #endif /* ZXDG_SHELL_V5_VERSION_ENUM */
245 
246 #ifndef ZXDG_SHELL_V5_ERROR_ENUM
247 #define ZXDG_SHELL_V5_ERROR_ENUM
248 enum zxdg_shell_v5_error {
249  /**
250  * given wl_surface has another role
251  */
252  ZXDG_SHELL_V5_ERROR_ROLE = 0,
253  /**
254  * xdg_shell was destroyed before children
255  */
256  ZXDG_SHELL_V5_ERROR_DEFUNCT_SURFACES = 1,
257  /**
258  * the client tried to map or destroy a non-topmost popup
259  */
260  ZXDG_SHELL_V5_ERROR_NOT_THE_TOPMOST_POPUP = 2,
261  /**
262  * the client specified an invalid popup parent surface
263  */
264  ZXDG_SHELL_V5_ERROR_INVALID_POPUP_PARENT = 3,
265 };
266 #endif /* ZXDG_SHELL_V5_ERROR_ENUM */
267 
268 /**
269  * @ingroup iface_zxdg_shell_v5
270  * @struct zxdg_shell_v5_listener
271  */
272 struct zxdg_shell_v5_listener {
273  /**
274  * check if the client is alive
275  *
276  * The ping event asks the client if it's still alive. Pass the
277  * serial specified in the event back to the compositor by sending
278  * a "pong" request back with the specified serial.
279  *
280  * Compositors can use this to determine if the client is still
281  * alive. It's unspecified what will happen if the client doesn't
282  * respond to the ping request, or in what timeframe. Clients
283  * should try to respond in a reasonable amount of time.
284  *
285  * A compositor is free to ping in any way it wants, but a client
286  * must always respond to any xdg_shell object it created.
287  * @param serial pass this to the pong request
288  */
289  void (*ping)(void *data, struct xdg_shell *xdg_shell, uint32_t serial);
290 };
291 
292 /**
293  * @ingroup iface_zxdg_shell_v5
294  */
295 static inline int zxdg_shell_v5_add_listener(struct xdg_shell *xdg_shell, const struct zxdg_shell_v5_listener *listener, void *data)
296 {
297  return wl_proxy_add_listener((struct wl_proxy *)xdg_shell, (void (**)(void))listener, data);
298 }
299 
300 #define ZXDG_SHELL_V5_DESTROY 0
301 #define ZXDG_SHELL_V5_USE_UNSTABLE_VERSION 1
302 #define ZXDG_SHELL_V5_GET_ZXDG_SURFACE_V5 2
303 #define ZXDG_SHELL_V5_GET_ZXDG_POPUP_V5 3
304 #define ZXDG_SHELL_V5_PONG 4
305 
306 /**
307  * @ingroup iface_zxdg_shell_v5
308  */
309 #define ZXDG_SHELL_V5_PING_SINCE_VERSION 1
310 
311 /**
312  * @ingroup iface_zxdg_shell_v5
313  */
314 #define ZXDG_SHELL_V5_DESTROY_SINCE_VERSION 1
315 /**
316  * @ingroup iface_zxdg_shell_v5
317  */
318 #define ZXDG_SHELL_V5_USE_UNSTABLE_VERSION_SINCE_VERSION 1
319 /**
320  * @ingroup iface_zxdg_shell_v5
321  */
322 #define ZXDG_SHELL_V5_GET_ZXDG_SURFACE_V5_SINCE_VERSION 1
323 /**
324  * @ingroup iface_zxdg_shell_v5
325  */
326 #define ZXDG_SHELL_V5_GET_ZXDG_POPUP_V5_SINCE_VERSION 1
327 /**
328  * @ingroup iface_zxdg_shell_v5
329  */
330 #define ZXDG_SHELL_V5_PONG_SINCE_VERSION 1
331 
332 /** @ingroup iface_xdg_shell */
333 static inline void zxdg_shell_v5_set_user_data(struct xdg_shell *xdg_shell, void *user_data)
334 {
335  wl_proxy_set_user_data((struct wl_proxy *)xdg_shell, user_data);
336 }
337 
338 /** @ingroup iface_xdg_shell */
339 static inline void *zxdg_shell_v5_get_user_data(struct xdg_shell *xdg_shell)
340 {
341  return wl_proxy_get_user_data((struct wl_proxy *)xdg_shell);
342 }
343 
344 static inline uint32_t zxdg_shell_v5_get_version(struct xdg_shell *xdg_shell)
345 {
346  return wl_proxy_get_version((struct wl_proxy *)xdg_shell);
347 }
348 
349 /**
350  * @ingroup iface_zxdg_shell_v5
351  *
352  * Destroy this xdg_shell object.
353  *
354  * Destroying a bound xdg_shell object while there are surfaces
355  * still alive created by this xdg_shell object instance is illegal
356  * and will result in a protocol error.
357  */
358 static inline void zxdg_shell_v5_destroy(struct xdg_shell *xdg_shell)
359 {
360  wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_DESTROY);
361 
362  wl_proxy_destroy((struct wl_proxy *)xdg_shell);
363 }
364 
365 /**
366  * @ingroup iface_zxdg_shell_v5
367  *
368  * Negotiate the unstable version of the interface. This
369  * mechanism is in place to ensure client and server agree on the
370  * unstable versions of the protocol that they speak or exit
371  * cleanly if they don't agree. This request will go away once
372  * the xdg-shell protocol is stable.
373  */
374 static inline void zxdg_shell_v5_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version)
375 {
376  wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_USE_UNSTABLE_VERSION, version);
377 }
378 
379 /**
380  * @ingroup iface_zxdg_shell_v5
381  *
382  * This creates an xdg_surface for the given surface and gives it the
383  * xdg_surface role. A wl_surface can only be given an xdg_surface role
384  * once. If get_xdg_surface is called with a wl_surface that already has
385  * an active xdg_surface associated with it, or if it had any other role,
386  * an error is raised.
387  *
388  * See the documentation of xdg_surface for more details about what an
389  * xdg_surface is and how it is used.
390  */
391 static inline struct xdg_surface *zxdg_shell_v5_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface)
392 {
393  struct wl_proxy *id;
394 
395  id = wl_proxy_marshal_constructor((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_GET_ZXDG_SURFACE_V5, &zxdg_surface_v5_interface, NULL, surface);
396 
397  return (struct xdg_surface *)id;
398 }
399 
400 /**
401  * @ingroup iface_zxdg_shell_v5
402  *
403  * This creates an xdg_popup for the given surface and gives it the
404  * xdg_popup role. A wl_surface can only be given an xdg_popup role
405  * once. If get_xdg_popup is called with a wl_surface that already has
406  * an active xdg_popup associated with it, or if it had any other role,
407  * an error is raised.
408  *
409  * This request must be used in response to some sort of user action
410  * like a button press, key press, or touch down event.
411  *
412  * See the documentation of xdg_popup for more details about what an
413  * xdg_popup is and how it is used.
414  */
415 static inline struct xdg_popup *zxdg_shell_v5_get_xdg_popup(struct xdg_shell *xdg_shell,
416  struct wl_surface *surface,
417  struct wl_surface *parent,
418  struct wl_seat *seat,
419  uint32_t serial,
420  int32_t x,
421  int32_t y)
422 {
423  struct wl_proxy *id;
424 
425  id = wl_proxy_marshal_constructor((struct wl_proxy *)xdg_shell,
426  ZXDG_SHELL_V5_GET_ZXDG_POPUP_V5,
427  &zxdg_popup_v5_interface,
428  NULL,
429  surface,
430  parent,
431  seat,
432  serial,
433  x,
434  y);
435 
436  return (struct xdg_popup *)id;
437 }
438 
439 /**
440  * @ingroup iface_zxdg_shell_v5
441  *
442  * A client must respond to a ping event with a pong request or
443  * the client may be deemed unresponsive.
444  */
445 static inline void zxdg_shell_v5_pong(struct xdg_shell *xdg_shell, uint32_t serial)
446 {
447  wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_PONG, serial);
448 }
449 
450 #ifndef ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM
451 #define ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM
452 /**
453  * @ingroup iface_zxdg_surface_v5
454  * edge values for resizing
455  *
456  * These values are used to indicate which edge of a surface
457  * is being dragged in a resize operation.
458  */
459 enum zxdg_surface_v5_resize_edge {
460  ZXDG_SURFACE_V5_RESIZE_EDGE_NONE = 0,
461  ZXDG_SURFACE_V5_RESIZE_EDGE_TOP = 1,
462  ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM = 2,
463  ZXDG_SURFACE_V5_RESIZE_EDGE_LEFT = 4,
464  ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_LEFT = 5,
465  ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_LEFT = 6,
466  ZXDG_SURFACE_V5_RESIZE_EDGE_RIGHT = 8,
467  ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_RIGHT = 9,
468  ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_RIGHT = 10,
469 };
470 #endif /* ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM */
471 
472 #ifndef ZXDG_SURFACE_V5_STATE_ENUM
473 #define ZXDG_SURFACE_V5_STATE_ENUM
474 /**
475  * @ingroup iface_zxdg_surface_v5
476  * the surface is now activated
477  *
478  * Client window decorations should be painted as if the window is
479  * active. Do not assume this means that the window actually has
480  * keyboard or pointer focus.
481  */
482 enum zxdg_surface_v5_state {
483  /**
484  * the surface is maximized
485  */
487  /**
488  * the surface is fullscreen
489  */
491  /**
492  * the surface is being resized
493  */
495  /**
496  * the surface is now activated
497  */
499 };
500 #endif /* ZXDG_SURFACE_V5_STATE_ENUM */
501 
502 /**
503  * @ingroup iface_zxdg_surface_v5
504  * @struct zxdg_surface_v5_listener
505  */
506 struct zxdg_surface_v5_listener {
507  /**
508  * suggest a surface change
509  *
510  * The configure event asks the client to resize its surface or
511  * to change its state.
512  *
513  * The width and height arguments specify a hint to the window
514  * about how its surface should be resized in window geometry
515  * coordinates. See set_window_geometry.
516  *
517  * If the width or height arguments are zero, it means the client
518  * should decide its own window dimension. This may happen when the
519  * compositor need to configure the state of the surface but
520  * doesn't have any information about any previous or expected
521  * dimension.
522  *
523  * The states listed in the event specify how the width/height
524  * arguments should be interpreted, and possibly how it should be
525  * drawn.
526  *
527  * Clients should arrange their surface for the new size and
528  * states, and then send a ack_configure request with the serial
529  * sent in this configure event at some point before committing the
530  * new surface.
531  *
532  * If the client receives multiple configure events before it can
533  * respond to one, it is free to discard all but the last event it
534  * received.
535  */
536  void (*configure)(void *data, struct xdg_surface *xdg_surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial);
537  /**
538  * surface wants to be closed
539  *
540  * The close event is sent by the compositor when the user wants
541  * the surface to be closed. This should be equivalent to the user
542  * clicking the close button in client-side decorations, if your
543  * application has any...
544  *
545  * This is only a request that the user intends to close your
546  * window. The client may choose to ignore this request, or show a
547  * dialog to ask the user to save their data...
548  */
549  void (*close)(void *data, struct xdg_surface *xdg_surface);
550 };
551 
552 /**
553  * @ingroup iface_zxdg_surface_v5
554  */
555 static inline int zxdg_surface_v5_add_listener(struct xdg_surface *xdg_surface, const struct zxdg_surface_v5_listener *listener, void *data)
556 {
557  return wl_proxy_add_listener((struct wl_proxy *)xdg_surface, (void (**)(void))listener, data);
558 }
559 
560 #define ZXDG_SURFACE_V5_DESTROY 0
561 #define ZXDG_SURFACE_V5_SET_PARENT 1
562 #define ZXDG_SURFACE_V5_SET_TITLE 2
563 #define ZXDG_SURFACE_V5_SET_APP_ID 3
564 #define ZXDG_SURFACE_V5_SHOW_WINDOW_MENU 4
565 #define ZXDG_SURFACE_V5_MOVE 5
566 #define ZXDG_SURFACE_V5_RESIZE 6
567 #define ZXDG_SURFACE_V5_ACK_CONFIGURE 7
568 #define ZXDG_SURFACE_V5_SET_WINDOW_GEOMETRY 8
569 #define ZXDG_SURFACE_V5_SET_MAXIMIZED 9
570 #define ZXDG_SURFACE_V5_UNSET_MAXIMIZED 10
571 #define ZXDG_SURFACE_V5_SET_FULLSCREEN 11
572 #define ZXDG_SURFACE_V5_UNSET_FULLSCREEN 12
573 #define ZXDG_SURFACE_V5_SET_MINIMIZED 13
574 
575 /**
576  * @ingroup iface_zxdg_surface_v5
577  */
578 #define ZXDG_SURFACE_V5_CONFIGURE_SINCE_VERSION 1
579 /**
580  * @ingroup iface_zxdg_surface_v5
581  */
582 #define ZXDG_SURFACE_V5_CLOSE_SINCE_VERSION 1
583 
584 /**
585  * @ingroup iface_zxdg_surface_v5
586  */
587 #define ZXDG_SURFACE_V5_DESTROY_SINCE_VERSION 1
588 /**
589  * @ingroup iface_zxdg_surface_v5
590  */
591 #define ZXDG_SURFACE_V5_SET_PARENT_SINCE_VERSION 1
592 /**
593  * @ingroup iface_zxdg_surface_v5
594  */
595 #define ZXDG_SURFACE_V5_SET_TITLE_SINCE_VERSION 1
596 /**
597  * @ingroup iface_zxdg_surface_v5
598  */
599 #define ZXDG_SURFACE_V5_SET_APP_ID_SINCE_VERSION 1
600 /**
601  * @ingroup iface_zxdg_surface_v5
602  */
603 #define ZXDG_SURFACE_V5_SHOW_WINDOW_MENU_SINCE_VERSION 1
604 /**
605  * @ingroup iface_zxdg_surface_v5
606  */
607 #define ZXDG_SURFACE_V5_MOVE_SINCE_VERSION 1
608 /**
609  * @ingroup iface_zxdg_surface_v5
610  */
611 #define ZXDG_SURFACE_V5_RESIZE_SINCE_VERSION 1
612 /**
613  * @ingroup iface_zxdg_surface_v5
614  */
615 #define ZXDG_SURFACE_V5_ACK_CONFIGURE_SINCE_VERSION 1
616 /**
617  * @ingroup iface_zxdg_surface_v5
618  */
619 #define ZXDG_SURFACE_V5_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
620 /**
621  * @ingroup iface_zxdg_surface_v5
622  */
623 #define ZXDG_SURFACE_V5_SET_MAXIMIZED_SINCE_VERSION 1
624 /**
625  * @ingroup iface_zxdg_surface_v5
626  */
627 #define ZXDG_SURFACE_V5_UNSET_MAXIMIZED_SINCE_VERSION 1
628 /**
629  * @ingroup iface_zxdg_surface_v5
630  */
631 #define ZXDG_SURFACE_V5_SET_FULLSCREEN_SINCE_VERSION 1
632 /**
633  * @ingroup iface_zxdg_surface_v5
634  */
635 #define ZXDG_SURFACE_V5_UNSET_FULLSCREEN_SINCE_VERSION 1
636 /**
637  * @ingroup iface_zxdg_surface_v5
638  */
639 #define ZXDG_SURFACE_V5_SET_MINIMIZED_SINCE_VERSION 1
640 
641 /** @ingroup iface_xdg_surface */
642 static inline void zxdg_surface_v5_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
643 {
644  wl_proxy_set_user_data((struct wl_proxy *)xdg_surface, user_data);
645 }
646 
647 /** @ingroup iface_xdg_surface */
648 static inline void *zxdg_surface_v5_get_user_data(struct xdg_surface *xdg_surface)
649 {
650  return wl_proxy_get_user_data((struct wl_proxy *)xdg_surface);
651 }
652 
653 static inline uint32_t zxdg_surface_v5_get_version(struct xdg_surface *xdg_surface)
654 {
655  return wl_proxy_get_version((struct wl_proxy *)xdg_surface);
656 }
657 
658 /**
659  * @ingroup iface_zxdg_surface_v5
660  *
661  * Unmap and destroy the window. The window will be effectively
662  * hidden from the user's point of view, and all state like
663  * maximization, fullscreen, and so on, will be lost.
664  */
665 static inline void zxdg_surface_v5_destroy(struct xdg_surface *xdg_surface)
666 {
667  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_DESTROY);
668 
669  wl_proxy_destroy((struct wl_proxy *)xdg_surface);
670 }
671 
672 /**
673  * @ingroup iface_zxdg_surface_v5
674  *
675  * Set the "parent" of this surface. This window should be stacked
676  * above a parent. The parent surface must be mapped as long as this
677  * surface is mapped.
678  *
679  * Parent windows should be set on dialogs, toolboxes, or other
680  * "auxiliary" surfaces, so that the parent is raised when the dialog
681  * is raised.
682  */
683 static inline void zxdg_surface_v5_set_parent(struct xdg_surface *xdg_surface, struct xdg_surface *parent)
684 {
685  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_PARENT, parent);
686 }
687 
688 /**
689  * @ingroup iface_zxdg_surface_v5
690  *
691  * Set a short title for the surface.
692  *
693  * This string may be used to identify the surface in a task bar,
694  * window list, or other user interface elements provided by the
695  * compositor.
696  *
697  * The string must be encoded in UTF-8.
698  */
699 static inline void zxdg_surface_v5_set_title(struct xdg_surface *xdg_surface, const char *title)
700 {
701  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_TITLE, title);
702 }
703 
704 /**
705  * @ingroup iface_zxdg_surface_v5
706  *
707  * Set an application identifier for the surface.
708  *
709  * The app ID identifies the general class of applications to which
710  * the surface belongs. The compositor can use this to group multiple
711  * surfaces together, or to determine how to launch a new application.
712  *
713  * For D-Bus activatable applications, the app ID is used as the D-Bus
714  * service name.
715  *
716  * The compositor shell will try to group application surfaces together
717  * by their app ID. As a best practice, it is suggested to select app
718  * ID's that match the basename of the application's .desktop file.
719  * For example, "org.freedesktop.FooViewer" where the .desktop file is
720  * "org.freedesktop.FooViewer.desktop".
721  *
722  * See the desktop-entry specification [0] for more details on
723  * application identifiers and how they relate to well-known D-Bus
724  * names and .desktop files.
725  *
726  * [0] http://standards.freedesktop.org/desktop-entry-spec/
727  */
728 static inline void zxdg_surface_v5_set_app_id(struct xdg_surface *xdg_surface, const char *app_id)
729 {
730  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_APP_ID, app_id);
731 }
732 
733 /**
734  * @ingroup iface_zxdg_surface_v5
735  *
736  * Clients implementing client-side decorations might want to show
737  * a context menu when right-clicking on the decorations, giving the
738  * user a menu that they can use to maximize or minimize the window.
739  *
740  * This request asks the compositor to pop up such a window menu at
741  * the given position, relative to the local surface coordinates of
742  * the parent surface. There are no guarantees as to what menu items
743  * the window menu contains.
744  *
745  * This request must be used in response to some sort of user action
746  * like a button press, key press, or touch down event.
747  */
748 static inline void zxdg_surface_v5_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
749 {
750  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SHOW_WINDOW_MENU, seat, serial, x, y);
751 }
752 
753 /**
754  * @ingroup iface_zxdg_surface_v5
755  *
756  * Start an interactive, user-driven move of the surface.
757  *
758  * This request must be used in response to some sort of user action
759  * like a button press, key press, or touch down event. The passed
760  * serial is used to determine the type of interactive move (touch,
761  * pointer, etc).
762  *
763  * The server may ignore move requests depending on the state of
764  * the surface (e.g. fullscreen or maximized), or if the passed serial
765  * is no longer valid.
766  *
767  * If triggered, the surface will lose the focus of the device
768  * (wl_pointer, wl_touch, etc) used for the move. It is up to the
769  * compositor to visually indicate that the move is taking place, such as
770  * updating a pointer cursor, during the move. There is no guarantee
771  * that the device focus will return when the move is completed.
772  */
773 static inline void zxdg_surface_v5_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial)
774 {
775  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_MOVE, seat, serial);
776 }
777 
778 /**
779  * @ingroup iface_zxdg_surface_v5
780  *
781  * Start a user-driven, interactive resize of the surface.
782  *
783  * This request must be used in response to some sort of user action
784  * like a button press, key press, or touch down event. The passed
785  * serial is used to determine the type of interactive resize (touch,
786  * pointer, etc).
787  *
788  * The server may ignore resize requests depending on the state of
789  * the surface (e.g. fullscreen or maximized).
790  *
791  * If triggered, the client will receive configure events with the
792  * "resize" state enum value and the expected sizes. See the "resize"
793  * enum value for more details about what is required. The client
794  * must also acknowledge configure events using "ack_configure". After
795  * the resize is completed, the client will receive another "configure"
796  * event without the resize state.
797  *
798  * If triggered, the surface also will lose the focus of the device
799  * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
800  * compositor to visually indicate that the resize is taking place,
801  * such as updating a pointer cursor, during the resize. There is no
802  * guarantee that the device focus will return when the resize is
803  * completed.
804  *
805  * The edges parameter specifies how the surface should be resized,
806  * and is one of the values of the resize_edge enum. The compositor
807  * may use this information to update the surface position for
808  * example when dragging the top left corner. The compositor may also
809  * use this information to adapt its behavior, e.g. choose an
810  * appropriate cursor image.
811  */
812 static inline void zxdg_surface_v5_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
813 {
814  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_RESIZE, seat, serial, edges);
815 }
816 
817 /**
818  * @ingroup iface_zxdg_surface_v5
819  *
820  * When a configure event is received, if a client commits the
821  * surface in response to the configure event, then the client
822  * must make an ack_configure request sometime before the commit
823  * request, passing along the serial of the configure event.
824  *
825  * For instance, the compositor might use this information to move
826  * a surface to the top left only when the client has drawn itself
827  * for the maximized or fullscreen state.
828  *
829  * If the client receives multiple configure events before it
830  * can respond to one, it only has to ack the last configure event.
831  *
832  * A client is not required to commit immediately after sending
833  * an ack_configure request - it may even ack_configure several times
834  * before its next surface commit.
835  *
836  * The compositor expects that the most recently received
837  * ack_configure request at the time of a commit indicates which
838  * configure event the client is responding to.
839  */
840 static inline void zxdg_surface_v5_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
841 {
842  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_ACK_CONFIGURE, serial);
843 }
844 
845 /**
846  * @ingroup iface_zxdg_surface_v5
847  *
848  * The window geometry of a window is its "visible bounds" from the
849  * user's perspective. Client-side decorations often have invisible
850  * portions like drop-shadows which should be ignored for the
851  * purposes of aligning, placing and constraining windows.
852  *
853  * The window geometry is double buffered, and will be applied at the
854  * time wl_surface.commit of the corresponding wl_surface is called.
855  *
856  * Once the window geometry of the surface is set once, it is not
857  * possible to unset it, and it will remain the same until
858  * set_window_geometry is called again, even if a new subsurface or
859  * buffer is attached.
860  *
861  * If never set, the value is the full bounds of the surface,
862  * including any subsurfaces. This updates dynamically on every
863  * commit. This unset mode is meant for extremely simple clients.
864  *
865  * If responding to a configure event, the window geometry in here
866  * must respect the sizing negotiations specified by the states in
867  * the configure event.
868  *
869  * The arguments are given in the surface local coordinate space of
870  * the wl_surface associated with this xdg_surface.
871  *
872  * The width and height must be greater than zero.
873  */
874 static inline void zxdg_surface_v5_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height)
875 {
876  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_WINDOW_GEOMETRY, x, y, width, height);
877 }
878 
879 /**
880  * @ingroup iface_zxdg_surface_v5
881  *
882  * Maximize the surface.
883  *
884  * After requesting that the surface should be maximized, the compositor
885  * will respond by emitting a configure event with the "maximized" state
886  * and the required window geometry. The client should then update its
887  * content, drawing it in a maximized state, i.e. without shadow or other
888  * decoration outside of the window geometry. The client must also
889  * acknowledge the configure when committing the new content (see
890  * ack_configure).
891  *
892  * It is up to the compositor to decide how and where to maximize the
893  * surface, for example which output and what region of the screen should
894  * be used.
895  *
896  * If the surface was already maximized, the compositor will still emit
897  * a configure event with the "maximized" state.
898  */
899 static inline void zxdg_surface_v5_set_maximized(struct xdg_surface *xdg_surface)
900 {
901  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_MAXIMIZED);
902 }
903 
904 /**
905  * @ingroup iface_zxdg_surface_v5
906  *
907  * Unmaximize the surface.
908  *
909  * After requesting that the surface should be unmaximized, the compositor
910  * will respond by emitting a configure event without the "maximized"
911  * state. If available, the compositor will include the window geometry
912  * dimensions the window had prior to being maximized in the configure
913  * request. The client must then update its content, drawing it in a
914  * regular state, i.e. potentially with shadow, etc. The client must also
915  * acknowledge the configure when committing the new content (see
916  * ack_configure).
917  *
918  * It is up to the compositor to position the surface after it was
919  * unmaximized; usually the position the surface had before maximizing, if
920  * applicable.
921  *
922  * If the surface was already not maximized, the compositor will still
923  * emit a configure event without the "maximized" state.
924  */
925 static inline void zxdg_surface_v5_unset_maximized(struct xdg_surface *xdg_surface)
926 {
927  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_UNSET_MAXIMIZED);
928 }
929 
930 /**
931  * @ingroup iface_zxdg_surface_v5
932  *
933  * Make the surface fullscreen.
934  *
935  * You can specify an output that you would prefer to be fullscreen.
936  * If this value is NULL, it's up to the compositor to choose which
937  * display will be used to map this surface.
938  *
939  * If the surface doesn't cover the whole output, the compositor will
940  * position the surface in the center of the output and compensate with
941  * black borders filling the rest of the output.
942  */
943 static inline void zxdg_surface_v5_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output)
944 {
945  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_FULLSCREEN, output);
946 }
947 
948 /**
949  * @ingroup iface_zxdg_surface_v5
950  */
951 static inline void zxdg_surface_v5_unset_fullscreen(struct xdg_surface *xdg_surface)
952 {
953  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_UNSET_FULLSCREEN);
954 }
955 
956 /**
957  * @ingroup iface_zxdg_surface_v5
958  *
959  * Request that the compositor minimize your surface. There is no
960  * way to know if the surface is currently minimized, nor is there
961  * any way to unset minimization on this surface.
962  *
963  * If you are looking to throttle redrawing when minimized, please
964  * instead use the wl_surface.frame event for this, as this will
965  * also work with live previews on windows in Alt-Tab, Expose or
966  * similar compositor features.
967  */
968 static inline void zxdg_surface_v5_set_minimized(struct xdg_surface *xdg_surface)
969 {
970  wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_MINIMIZED);
971 }
972 
973 /**
974  * @ingroup iface_zxdg_popup_v5
975  * @struct zxdg_popup_v5_listener
976  */
977 struct zxdg_popup_v5_listener {
978  /**
979  * popup interaction is done
980  *
981  * The popup_done event is sent out when a popup is dismissed by
982  * the compositor. The client should destroy the xdg_popup object
983  * at this point.
984  */
985  void (*popup_done)(void *data, struct xdg_popup *xdg_popup);
986 };
987 
988 /**
989  * @ingroup iface_zxdg_popup_v5
990  */
991 static inline int zxdg_popup_v5_add_listener(struct xdg_popup *xdg_popup, const struct zxdg_popup_v5_listener *listener, void *data)
992 {
993  return wl_proxy_add_listener((struct wl_proxy *)xdg_popup, (void (**)(void))listener, data);
994 }
995 
996 #define ZXDG_POPUP_V5_DESTROY 0
997 
998 /**
999  * @ingroup iface_zxdg_popup_v5
1000  */
1001 #define ZXDG_POPUP_V5_POPUP_DONE_SINCE_VERSION 1
1002 
1003 /**
1004  * @ingroup iface_zxdg_popup_v5
1005  */
1006 #define ZXDG_POPUP_V5_DESTROY_SINCE_VERSION 1
1007 
1008 /** @ingroup iface_xdg_popup */
1009 static inline void zxdg_popup_v5_set_user_data(struct xdg_popup *xdg_popup, void *user_data)
1010 {
1011  wl_proxy_set_user_data((struct wl_proxy *)xdg_popup, user_data);
1012 }
1013 
1014 /** @ingroup iface_xdg_popup */
1015 static inline void *zxdg_popup_v5_get_user_data(struct xdg_popup *xdg_popup)
1016 {
1017  return wl_proxy_get_user_data((struct wl_proxy *)xdg_popup);
1018 }
1019 
1020 static inline uint32_t zxdg_popup_v5_get_version(struct xdg_popup *xdg_popup)
1021 {
1022  return wl_proxy_get_version((struct wl_proxy *)xdg_popup);
1023 }
1024 
1025 /**
1026  * @ingroup iface_zxdg_popup_v5
1027  *
1028  * This destroys the popup. Explicitly destroying the zxdg_popup_v5
1029  * object will also dismiss the popup, and unmap the surface.
1030  *
1031  * If this xdg_popup is not the "topmost" popup, a protocol error
1032  * will be sent.
1033  */
1034 static inline void zxdg_popup_v5_destroy(struct xdg_popup *xdg_popup)
1035 {
1036  wl_proxy_marshal((struct wl_proxy *)xdg_popup, ZXDG_POPUP_V5_DESTROY);
1037 
1038  wl_proxy_destroy((struct wl_proxy *)xdg_popup);
1039 }
1040 
1041 #ifdef __cplusplus
1042 }
1043 #endif
1044 
1045 #endif
KGuiItem configure()
const QList< QKeySequence > & close()
@ ZXDG_SURFACE_V5_STATE_MAXIMIZED
the surface is maximized
@ ZXDG_SHELL_V5_VERSION_CURRENT
Always the latest version.
@ ZXDG_SURFACE_V5_STATE_RESIZING
the surface is being resized
@ ZXDG_SURFACE_V5_STATE_FULLSCREEN
the surface is fullscreen
@ ZXDG_SURFACE_V5_STATE_ACTIVATED
the surface is now activated
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Jan 30 2023 03:56:25 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.