File indexing completed on 2024-12-29 05:01:02

0001 /*
0002  * This file is *NOT* autogenerated.
0003  * It contains XDGShellV5 with method names modified to be not clashing with XDG stable
0004  * Strings inside the sent protocol remain the same
0005  */
0006 #ifndef ZXDG_SHELL_V5_UNSTABLE_V5_CLIENT_PROTOCOL_H
0007 #define ZXDG_SHELL_V5_UNSTABLE_V5_CLIENT_PROTOCOL_H
0008 
0009 #include "wayland-client.h"
0010 #include <stddef.h>
0011 #include <stdint.h>
0012 
0013 #ifdef __cplusplus
0014 extern "C" {
0015 #endif
0016 
0017 /**
0018  * @page page_zxdg_shell_v5_unstable_v5 The zxdg_shell_v5_unstable_v5 protocol
0019  * @section page_ifaces_zxdg_shell_v5_unstable_v5 Interfaces
0020  * - @subpage page_iface_xdg_shell - create desktop-style surfaces
0021  * - @subpage page_iface_xdg_surface - A desktop window
0022  * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus
0023  * @section page_copyright_zxdg_shell_v5_unstable_v5 Copyright
0024  * <pre>
0025  *
0026  * SPDX-FileCopyrightText: 2008-2013 Kristian Høgsberg
0027  * SPDX-FileCopyrightText: 2013 Rafael Antognolli
0028  * SPDX-FileCopyrightText: 2013 Jasper St. Pierre
0029  * SPDX-FileCopyrightText: 2010-2013 Intel Corporation
0030  *
0031  * SPDX-License-Identifier: MIT
0032  * </pre>
0033  */
0034 struct wl_output;
0035 struct wl_seat;
0036 struct wl_surface;
0037 
0038 struct xdg_surface;
0039 struct xdg_popup;
0040 struct xdg_shell;
0041 
0042 /**
0043  * @page page_iface_xdg_shell zxdg_shell_v5
0044  * @section page_iface_zxdg_shell_v5_desc Description
0045  *
0046  * xdg_shell allows clients to turn a wl_surface into a "real window"
0047  * which can be dragged, resized, stacked, and moved around by the
0048  * user. Everything about this interface is suited towards traditional
0049  * desktop environments.
0050  * @section page_iface_zxdg_shell_v5_api API
0051  * See @ref iface_xdg_shell.
0052  */
0053 /**
0054  * @defgroup iface_xdg_shell The xdg_shell interface
0055  *
0056  * xdg_shell allows clients to turn a wl_surface into a "real window"
0057  * which can be dragged, resized, stacked, and moved around by the
0058  * user. Everything about this interface is suited towards traditional
0059  * desktop environments.
0060  */
0061 extern const struct wl_interface zxdg_shell_v5_interface;
0062 /**
0063  * @page page_iface_xdg_surface zxdg_surface_v5
0064  * @section page_iface_zxdg_surface_v5_desc Description
0065  *
0066  * An interface that may be implemented by a wl_surface, for
0067  * implementations that provide a desktop-style user interface.
0068  *
0069  * It provides requests to treat surfaces like windows, allowing to set
0070  * properties like maximized, fullscreen, minimized, and to move and resize
0071  * them, and associate metadata like title and app id.
0072  *
0073  * The client must call wl_surface.commit on the corresponding wl_surface
0074  * for the xdg_surface state to take effect. Prior to committing the new
0075  * state, it can set up initial configuration, such as maximizing or setting
0076  * a window geometry.
0077  *
0078  * Even without attaching a buffer the compositor must respond to initial
0079  * committed configuration, for instance sending a configure event with
0080  * expected window geometry if the client maximized its surface during
0081  * initialization.
0082  *
0083  * For a surface to be mapped by the compositor the client must have
0084  * committed both an xdg_surface state and a buffer.
0085  * @section page_iface_zxdg_surface_v5_api API
0086  * See @ref iface_xdg_surface.
0087  */
0088 /**
0089  * @defgroup iface_xdg_surface The xdg_surface interface
0090  *
0091  * An interface that may be implemented by a wl_surface, for
0092  * implementations that provide a desktop-style user interface.
0093  *
0094  * It provides requests to treat surfaces like windows, allowing to set
0095  * properties like maximized, fullscreen, minimized, and to move and resize
0096  * them, and associate metadata like title and app id.
0097  *
0098  * The client must call wl_surface.commit on the corresponding wl_surface
0099  * for the xdg_surface state to take effect. Prior to committing the new
0100  * state, it can set up initial configuration, such as maximizing or setting
0101  * a window geometry.
0102  *
0103  * Even without attaching a buffer the compositor must respond to initial
0104  * committed configuration, for instance sending a configure event with
0105  * expected window geometry if the client maximized its surface during
0106  * initialization.
0107  *
0108  * For a surface to be mapped by the compositor the client must have
0109  * committed both an xdg_surface state and a buffer.
0110  */
0111 extern const struct wl_interface zxdg_surface_v5_interface;
0112 /**
0113  * @page page_iface_xdg_popup zxdg_popup_v5
0114  * @section page_iface_zxdg_popup_v5_desc Description
0115  *
0116  * A popup surface is a short-lived, temporary surface that can be
0117  * used to implement menus. It takes an explicit grab on the surface
0118  * that will be dismissed when the user dismisses the popup. This can
0119  * be done by the user clicking outside the surface, using the keyboard,
0120  * or even locking the screen through closing the lid or a timeout.
0121  *
0122  * When the popup is dismissed, a popup_done event will be sent out,
0123  * and at the same time the surface will be unmapped. The zxdg_popup_v5
0124  * object is now inert and cannot be reactivated, so clients should
0125  * destroy it. Explicitly destroying the xdg_popup object will also
0126  * dismiss the popup and unmap the surface.
0127  *
0128  * Clients will receive events for all their surfaces during this
0129  * grab (which is an "owner-events" grab in X11 parlance). This is
0130  * done so that users can navigate through submenus and other
0131  * "nested" popup windows without having to dismiss the topmost
0132  * popup.
0133  *
0134  * Clients that want to dismiss the popup when another surface of
0135  * their own is clicked should dismiss the popup using the destroy
0136  * request.
0137  *
0138  * The parent surface must have either an xdg_surface or zxdg_popup_v5
0139  * role.
0140  *
0141  * Specifying an xdg_popup for the parent means that the popups are
0142  * nested, with this popup now being the topmost popup. Nested
0143  * popups must be destroyed in the reverse order they were created
0144  * in, e.g. the only popup you are allowed to destroy at all times
0145  * is the topmost one.
0146  *
0147  * If there is an existing popup when creating a new popup, the
0148  * parent must be the current topmost popup.
0149  *
0150  * A parent surface must be mapped before the new popup is mapped.
0151  *
0152  * When compositors choose to dismiss a popup, they will likely
0153  * dismiss every nested popup as well. When a compositor dismisses
0154  * popups, it will follow the same dismissing order as required
0155  * from the client.
0156  *
0157  * The x and y arguments passed when creating the popup object specify
0158  * where the top left of the popup should be placed, relative to the
0159  * local surface coordinates of the parent surface. See
0160  * xdg_shell.get_xdg_popup.
0161  *
0162  * The client must call wl_surface.commit on the corresponding wl_surface
0163  * for the xdg_popup state to take effect.
0164  *
0165  * For a surface to be mapped by the compositor the client must have
0166  * committed both the xdg_popup state and a buffer.
0167  * @section page_iface_zxdg_popup_v5_api API
0168  * See @ref iface_xdg_popup.
0169  */
0170 /**
0171  * @defgroup iface_xdg_popup The xdg_popup interface
0172  *
0173  * A popup surface is a short-lived, temporary surface that can be
0174  * used to implement menus. It takes an explicit grab on the surface
0175  * that will be dismissed when the user dismisses the popup. This can
0176  * be done by the user clicking outside the surface, using the keyboard,
0177  * or even locking the screen through closing the lid or a timeout.
0178  *
0179  * When the popup is dismissed, a popup_done event will be sent out,
0180  * and at the same time the surface will be unmapped. The zxdg_popup_v5
0181  * object is now inert and cannot be reactivated, so clients should
0182  * destroy it. Explicitly destroying the xdg_popup object will also
0183  * dismiss the popup and unmap the surface.
0184  *
0185  * Clients will receive events for all their surfaces during this
0186  * grab (which is an "owner-events" grab in X11 parlance). This is
0187  * done so that users can navigate through submenus and other
0188  * "nested" popup windows without having to dismiss the topmost
0189  * popup.
0190  *
0191  * Clients that want to dismiss the popup when another surface of
0192  * their own is clicked should dismiss the popup using the destroy
0193  * request.
0194  *
0195  * The parent surface must have either an xdg_surface or zxdg_popup_v5
0196  * role.
0197  *
0198  * Specifying an xdg_popup for the parent means that the popups are
0199  * nested, with this popup now being the topmost popup. Nested
0200  * popups must be destroyed in the reverse order they were created
0201  * in, e.g. the only popup you are allowed to destroy at all times
0202  * is the topmost one.
0203  *
0204  * If there is an existing popup when creating a new popup, the
0205  * parent must be the current topmost popup.
0206  *
0207  * A parent surface must be mapped before the new popup is mapped.
0208  *
0209  * When compositors choose to dismiss a popup, they will likely
0210  * dismiss every nested popup as well. When a compositor dismisses
0211  * popups, it will follow the same dismissing order as required
0212  * from the client.
0213  *
0214  * The x and y arguments passed when creating the popup object specify
0215  * where the top left of the popup should be placed, relative to the
0216  * local surface coordinates of the parent surface. See
0217  * xdg_shell.get_xdg_popup.
0218  *
0219  * The client must call wl_surface.commit on the corresponding wl_surface
0220  * for the xdg_popup state to take effect.
0221  *
0222  * For a surface to be mapped by the compositor the client must have
0223  * committed both the xdg_popup state and a buffer.
0224  */
0225 extern const struct wl_interface zxdg_popup_v5_interface;
0226 
0227 #ifndef ZXDG_SHELL_V5_VERSION_ENUM
0228 #define ZXDG_SHELL_V5_VERSION_ENUM
0229 /**
0230  * @ingroup iface_zxdg_shell_v5
0231  * latest protocol version
0232  *
0233  * The 'current' member of this enum gives the version of the
0234  * protocol.  Implementations can compare this to the version
0235  * they implement using static_assert to ensure the protocol and
0236  * implementation versions match.
0237  */
0238 enum zxdg_shell_v5_version {
0239     /**
0240      * Always the latest version
0241      */
0242     ZXDG_SHELL_V5_VERSION_CURRENT = 5,
0243 };
0244 #endif /* ZXDG_SHELL_V5_VERSION_ENUM */
0245 
0246 #ifndef ZXDG_SHELL_V5_ERROR_ENUM
0247 #define ZXDG_SHELL_V5_ERROR_ENUM
0248 enum zxdg_shell_v5_error {
0249     /**
0250      * given wl_surface has another role
0251      */
0252     ZXDG_SHELL_V5_ERROR_ROLE = 0,
0253     /**
0254      * xdg_shell was destroyed before children
0255      */
0256     ZXDG_SHELL_V5_ERROR_DEFUNCT_SURFACES = 1,
0257     /**
0258      * the client tried to map or destroy a non-topmost popup
0259      */
0260     ZXDG_SHELL_V5_ERROR_NOT_THE_TOPMOST_POPUP = 2,
0261     /**
0262      * the client specified an invalid popup parent surface
0263      */
0264     ZXDG_SHELL_V5_ERROR_INVALID_POPUP_PARENT = 3,
0265 };
0266 #endif /* ZXDG_SHELL_V5_ERROR_ENUM */
0267 
0268 /**
0269  * @ingroup iface_zxdg_shell_v5
0270  * @struct zxdg_shell_v5_listener
0271  */
0272 struct zxdg_shell_v5_listener {
0273     /**
0274      * check if the client is alive
0275      *
0276      * The ping event asks the client if it's still alive. Pass the
0277      * serial specified in the event back to the compositor by sending
0278      * a "pong" request back with the specified serial.
0279      *
0280      * Compositors can use this to determine if the client is still
0281      * alive. It's unspecified what will happen if the client doesn't
0282      * respond to the ping request, or in what timeframe. Clients
0283      * should try to respond in a reasonable amount of time.
0284      *
0285      * A compositor is free to ping in any way it wants, but a client
0286      * must always respond to any xdg_shell object it created.
0287      * @param serial pass this to the pong request
0288      */
0289     void (*ping)(void *data, struct xdg_shell *xdg_shell, uint32_t serial);
0290 };
0291 
0292 /**
0293  * @ingroup iface_zxdg_shell_v5
0294  */
0295 static inline int zxdg_shell_v5_add_listener(struct xdg_shell *xdg_shell, const struct zxdg_shell_v5_listener *listener, void *data)
0296 {
0297     return wl_proxy_add_listener((struct wl_proxy *)xdg_shell, (void (**)(void))listener, data);
0298 }
0299 
0300 #define ZXDG_SHELL_V5_DESTROY 0
0301 #define ZXDG_SHELL_V5_USE_UNSTABLE_VERSION 1
0302 #define ZXDG_SHELL_V5_GET_ZXDG_SURFACE_V5 2
0303 #define ZXDG_SHELL_V5_GET_ZXDG_POPUP_V5 3
0304 #define ZXDG_SHELL_V5_PONG 4
0305 
0306 /**
0307  * @ingroup iface_zxdg_shell_v5
0308  */
0309 #define ZXDG_SHELL_V5_PING_SINCE_VERSION 1
0310 
0311 /**
0312  * @ingroup iface_zxdg_shell_v5
0313  */
0314 #define ZXDG_SHELL_V5_DESTROY_SINCE_VERSION 1
0315 /**
0316  * @ingroup iface_zxdg_shell_v5
0317  */
0318 #define ZXDG_SHELL_V5_USE_UNSTABLE_VERSION_SINCE_VERSION 1
0319 /**
0320  * @ingroup iface_zxdg_shell_v5
0321  */
0322 #define ZXDG_SHELL_V5_GET_ZXDG_SURFACE_V5_SINCE_VERSION 1
0323 /**
0324  * @ingroup iface_zxdg_shell_v5
0325  */
0326 #define ZXDG_SHELL_V5_GET_ZXDG_POPUP_V5_SINCE_VERSION 1
0327 /**
0328  * @ingroup iface_zxdg_shell_v5
0329  */
0330 #define ZXDG_SHELL_V5_PONG_SINCE_VERSION 1
0331 
0332 /** @ingroup iface_xdg_shell */
0333 static inline void zxdg_shell_v5_set_user_data(struct xdg_shell *xdg_shell, void *user_data)
0334 {
0335     wl_proxy_set_user_data((struct wl_proxy *)xdg_shell, user_data);
0336 }
0337 
0338 /** @ingroup iface_xdg_shell */
0339 static inline void *zxdg_shell_v5_get_user_data(struct xdg_shell *xdg_shell)
0340 {
0341     return wl_proxy_get_user_data((struct wl_proxy *)xdg_shell);
0342 }
0343 
0344 static inline uint32_t zxdg_shell_v5_get_version(struct xdg_shell *xdg_shell)
0345 {
0346     return wl_proxy_get_version((struct wl_proxy *)xdg_shell);
0347 }
0348 
0349 /**
0350  * @ingroup iface_zxdg_shell_v5
0351  *
0352  * Destroy this xdg_shell object.
0353  *
0354  * Destroying a bound xdg_shell object while there are surfaces
0355  * still alive created by this xdg_shell object instance is illegal
0356  * and will result in a protocol error.
0357  */
0358 static inline void zxdg_shell_v5_destroy(struct xdg_shell *xdg_shell)
0359 {
0360     wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_DESTROY);
0361 
0362     wl_proxy_destroy((struct wl_proxy *)xdg_shell);
0363 }
0364 
0365 /**
0366  * @ingroup iface_zxdg_shell_v5
0367  *
0368  * Negotiate the unstable version of the interface.  This
0369  * mechanism is in place to ensure client and server agree on the
0370  * unstable versions of the protocol that they speak or exit
0371  * cleanly if they don't agree.  This request will go away once
0372  * the xdg-shell protocol is stable.
0373  */
0374 static inline void zxdg_shell_v5_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version)
0375 {
0376     wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_USE_UNSTABLE_VERSION, version);
0377 }
0378 
0379 /**
0380  * @ingroup iface_zxdg_shell_v5
0381  *
0382  * This creates an xdg_surface for the given surface and gives it the
0383  * xdg_surface role. A wl_surface can only be given an xdg_surface role
0384  * once. If get_xdg_surface is called with a wl_surface that already has
0385  * an active xdg_surface associated with it, or if it had any other role,
0386  * an error is raised.
0387  *
0388  * See the documentation of xdg_surface for more details about what an
0389  * xdg_surface is and how it is used.
0390  */
0391 static inline struct xdg_surface *zxdg_shell_v5_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface)
0392 {
0393     struct wl_proxy *id;
0394 
0395     id = wl_proxy_marshal_constructor((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_GET_ZXDG_SURFACE_V5, &zxdg_surface_v5_interface, NULL, surface);
0396 
0397     return (struct xdg_surface *)id;
0398 }
0399 
0400 /**
0401  * @ingroup iface_zxdg_shell_v5
0402  *
0403  * This creates an xdg_popup for the given surface and gives it the
0404  * xdg_popup role. A wl_surface can only be given an xdg_popup role
0405  * once. If get_xdg_popup is called with a wl_surface that already has
0406  * an active xdg_popup associated with it, or if it had any other role,
0407  * an error is raised.
0408  *
0409  * This request must be used in response to some sort of user action
0410  * like a button press, key press, or touch down event.
0411  *
0412  * See the documentation of xdg_popup for more details about what an
0413  * xdg_popup is and how it is used.
0414  */
0415 static inline struct xdg_popup *zxdg_shell_v5_get_xdg_popup(struct xdg_shell *xdg_shell,
0416                                                             struct wl_surface *surface,
0417                                                             struct wl_surface *parent,
0418                                                             struct wl_seat *seat,
0419                                                             uint32_t serial,
0420                                                             int32_t x,
0421                                                             int32_t y)
0422 {
0423     struct wl_proxy *id;
0424 
0425     id = wl_proxy_marshal_constructor((struct wl_proxy *)xdg_shell,
0426                                       ZXDG_SHELL_V5_GET_ZXDG_POPUP_V5,
0427                                       &zxdg_popup_v5_interface,
0428                                       NULL,
0429                                       surface,
0430                                       parent,
0431                                       seat,
0432                                       serial,
0433                                       x,
0434                                       y);
0435 
0436     return (struct xdg_popup *)id;
0437 }
0438 
0439 /**
0440  * @ingroup iface_zxdg_shell_v5
0441  *
0442  * A client must respond to a ping event with a pong request or
0443  * the client may be deemed unresponsive.
0444  */
0445 static inline void zxdg_shell_v5_pong(struct xdg_shell *xdg_shell, uint32_t serial)
0446 {
0447     wl_proxy_marshal((struct wl_proxy *)xdg_shell, ZXDG_SHELL_V5_PONG, serial);
0448 }
0449 
0450 #ifndef ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM
0451 #define ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM
0452 /**
0453  * @ingroup iface_zxdg_surface_v5
0454  * edge values for resizing
0455  *
0456  * These values are used to indicate which edge of a surface
0457  * is being dragged in a resize operation.
0458  */
0459 enum zxdg_surface_v5_resize_edge {
0460     ZXDG_SURFACE_V5_RESIZE_EDGE_NONE = 0,
0461     ZXDG_SURFACE_V5_RESIZE_EDGE_TOP = 1,
0462     ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM = 2,
0463     ZXDG_SURFACE_V5_RESIZE_EDGE_LEFT = 4,
0464     ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_LEFT = 5,
0465     ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_LEFT = 6,
0466     ZXDG_SURFACE_V5_RESIZE_EDGE_RIGHT = 8,
0467     ZXDG_SURFACE_V5_RESIZE_EDGE_TOP_RIGHT = 9,
0468     ZXDG_SURFACE_V5_RESIZE_EDGE_BOTTOM_RIGHT = 10,
0469 };
0470 #endif /* ZXDG_SURFACE_V5_RESIZE_EDGE_ENUM */
0471 
0472 #ifndef ZXDG_SURFACE_V5_STATE_ENUM
0473 #define ZXDG_SURFACE_V5_STATE_ENUM
0474 /**
0475  * @ingroup iface_zxdg_surface_v5
0476  * the surface is now activated
0477  *
0478  * Client window decorations should be painted as if the window is
0479  * active. Do not assume this means that the window actually has
0480  * keyboard or pointer focus.
0481  */
0482 enum zxdg_surface_v5_state {
0483     /**
0484      * the surface is maximized
0485      */
0486     ZXDG_SURFACE_V5_STATE_MAXIMIZED = 1,
0487     /**
0488      * the surface is fullscreen
0489      */
0490     ZXDG_SURFACE_V5_STATE_FULLSCREEN = 2,
0491     /**
0492      * the surface is being resized
0493      */
0494     ZXDG_SURFACE_V5_STATE_RESIZING = 3,
0495     /**
0496      * the surface is now activated
0497      */
0498     ZXDG_SURFACE_V5_STATE_ACTIVATED = 4,
0499 };
0500 #endif /* ZXDG_SURFACE_V5_STATE_ENUM */
0501 
0502 /**
0503  * @ingroup iface_zxdg_surface_v5
0504  * @struct zxdg_surface_v5_listener
0505  */
0506 struct zxdg_surface_v5_listener {
0507     /**
0508      * suggest a surface change
0509      *
0510      * The configure event asks the client to resize its surface or
0511      * to change its state.
0512      *
0513      * The width and height arguments specify a hint to the window
0514      * about how its surface should be resized in window geometry
0515      * coordinates. See set_window_geometry.
0516      *
0517      * If the width or height arguments are zero, it means the client
0518      * should decide its own window dimension. This may happen when the
0519      * compositor need to configure the state of the surface but
0520      * doesn't have any information about any previous or expected
0521      * dimension.
0522      *
0523      * The states listed in the event specify how the width/height
0524      * arguments should be interpreted, and possibly how it should be
0525      * drawn.
0526      *
0527      * Clients should arrange their surface for the new size and
0528      * states, and then send a ack_configure request with the serial
0529      * sent in this configure event at some point before committing the
0530      * new surface.
0531      *
0532      * If the client receives multiple configure events before it can
0533      * respond to one, it is free to discard all but the last event it
0534      * received.
0535      */
0536     void (*configure)(void *data, struct xdg_surface *xdg_surface, int32_t width, int32_t height, struct wl_array *states, uint32_t serial);
0537     /**
0538      * surface wants to be closed
0539      *
0540      * The close event is sent by the compositor when the user wants
0541      * the surface to be closed. This should be equivalent to the user
0542      * clicking the close button in client-side decorations, if your
0543      * application has any...
0544      *
0545      * This is only a request that the user intends to close your
0546      * window. The client may choose to ignore this request, or show a
0547      * dialog to ask the user to save their data...
0548      */
0549     void (*close)(void *data, struct xdg_surface *xdg_surface);
0550 };
0551 
0552 /**
0553  * @ingroup iface_zxdg_surface_v5
0554  */
0555 static inline int zxdg_surface_v5_add_listener(struct xdg_surface *xdg_surface, const struct zxdg_surface_v5_listener *listener, void *data)
0556 {
0557     return wl_proxy_add_listener((struct wl_proxy *)xdg_surface, (void (**)(void))listener, data);
0558 }
0559 
0560 #define ZXDG_SURFACE_V5_DESTROY 0
0561 #define ZXDG_SURFACE_V5_SET_PARENT 1
0562 #define ZXDG_SURFACE_V5_SET_TITLE 2
0563 #define ZXDG_SURFACE_V5_SET_APP_ID 3
0564 #define ZXDG_SURFACE_V5_SHOW_WINDOW_MENU 4
0565 #define ZXDG_SURFACE_V5_MOVE 5
0566 #define ZXDG_SURFACE_V5_RESIZE 6
0567 #define ZXDG_SURFACE_V5_ACK_CONFIGURE 7
0568 #define ZXDG_SURFACE_V5_SET_WINDOW_GEOMETRY 8
0569 #define ZXDG_SURFACE_V5_SET_MAXIMIZED 9
0570 #define ZXDG_SURFACE_V5_UNSET_MAXIMIZED 10
0571 #define ZXDG_SURFACE_V5_SET_FULLSCREEN 11
0572 #define ZXDG_SURFACE_V5_UNSET_FULLSCREEN 12
0573 #define ZXDG_SURFACE_V5_SET_MINIMIZED 13
0574 
0575 /**
0576  * @ingroup iface_zxdg_surface_v5
0577  */
0578 #define ZXDG_SURFACE_V5_CONFIGURE_SINCE_VERSION 1
0579 /**
0580  * @ingroup iface_zxdg_surface_v5
0581  */
0582 #define ZXDG_SURFACE_V5_CLOSE_SINCE_VERSION 1
0583 
0584 /**
0585  * @ingroup iface_zxdg_surface_v5
0586  */
0587 #define ZXDG_SURFACE_V5_DESTROY_SINCE_VERSION 1
0588 /**
0589  * @ingroup iface_zxdg_surface_v5
0590  */
0591 #define ZXDG_SURFACE_V5_SET_PARENT_SINCE_VERSION 1
0592 /**
0593  * @ingroup iface_zxdg_surface_v5
0594  */
0595 #define ZXDG_SURFACE_V5_SET_TITLE_SINCE_VERSION 1
0596 /**
0597  * @ingroup iface_zxdg_surface_v5
0598  */
0599 #define ZXDG_SURFACE_V5_SET_APP_ID_SINCE_VERSION 1
0600 /**
0601  * @ingroup iface_zxdg_surface_v5
0602  */
0603 #define ZXDG_SURFACE_V5_SHOW_WINDOW_MENU_SINCE_VERSION 1
0604 /**
0605  * @ingroup iface_zxdg_surface_v5
0606  */
0607 #define ZXDG_SURFACE_V5_MOVE_SINCE_VERSION 1
0608 /**
0609  * @ingroup iface_zxdg_surface_v5
0610  */
0611 #define ZXDG_SURFACE_V5_RESIZE_SINCE_VERSION 1
0612 /**
0613  * @ingroup iface_zxdg_surface_v5
0614  */
0615 #define ZXDG_SURFACE_V5_ACK_CONFIGURE_SINCE_VERSION 1
0616 /**
0617  * @ingroup iface_zxdg_surface_v5
0618  */
0619 #define ZXDG_SURFACE_V5_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
0620 /**
0621  * @ingroup iface_zxdg_surface_v5
0622  */
0623 #define ZXDG_SURFACE_V5_SET_MAXIMIZED_SINCE_VERSION 1
0624 /**
0625  * @ingroup iface_zxdg_surface_v5
0626  */
0627 #define ZXDG_SURFACE_V5_UNSET_MAXIMIZED_SINCE_VERSION 1
0628 /**
0629  * @ingroup iface_zxdg_surface_v5
0630  */
0631 #define ZXDG_SURFACE_V5_SET_FULLSCREEN_SINCE_VERSION 1
0632 /**
0633  * @ingroup iface_zxdg_surface_v5
0634  */
0635 #define ZXDG_SURFACE_V5_UNSET_FULLSCREEN_SINCE_VERSION 1
0636 /**
0637  * @ingroup iface_zxdg_surface_v5
0638  */
0639 #define ZXDG_SURFACE_V5_SET_MINIMIZED_SINCE_VERSION 1
0640 
0641 /** @ingroup iface_xdg_surface */
0642 static inline void zxdg_surface_v5_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
0643 {
0644     wl_proxy_set_user_data((struct wl_proxy *)xdg_surface, user_data);
0645 }
0646 
0647 /** @ingroup iface_xdg_surface */
0648 static inline void *zxdg_surface_v5_get_user_data(struct xdg_surface *xdg_surface)
0649 {
0650     return wl_proxy_get_user_data((struct wl_proxy *)xdg_surface);
0651 }
0652 
0653 static inline uint32_t zxdg_surface_v5_get_version(struct xdg_surface *xdg_surface)
0654 {
0655     return wl_proxy_get_version((struct wl_proxy *)xdg_surface);
0656 }
0657 
0658 /**
0659  * @ingroup iface_zxdg_surface_v5
0660  *
0661  * Unmap and destroy the window. The window will be effectively
0662  * hidden from the user's point of view, and all state like
0663  * maximization, fullscreen, and so on, will be lost.
0664  */
0665 static inline void zxdg_surface_v5_destroy(struct xdg_surface *xdg_surface)
0666 {
0667     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_DESTROY);
0668 
0669     wl_proxy_destroy((struct wl_proxy *)xdg_surface);
0670 }
0671 
0672 /**
0673  * @ingroup iface_zxdg_surface_v5
0674  *
0675  * Set the "parent" of this surface. This window should be stacked
0676  * above a parent. The parent surface must be mapped as long as this
0677  * surface is mapped.
0678  *
0679  * Parent windows should be set on dialogs, toolboxes, or other
0680  * "auxiliary" surfaces, so that the parent is raised when the dialog
0681  * is raised.
0682  */
0683 static inline void zxdg_surface_v5_set_parent(struct xdg_surface *xdg_surface, struct xdg_surface *parent)
0684 {
0685     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_PARENT, parent);
0686 }
0687 
0688 /**
0689  * @ingroup iface_zxdg_surface_v5
0690  *
0691  * Set a short title for the surface.
0692  *
0693  * This string may be used to identify the surface in a task bar,
0694  * window list, or other user interface elements provided by the
0695  * compositor.
0696  *
0697  * The string must be encoded in UTF-8.
0698  */
0699 static inline void zxdg_surface_v5_set_title(struct xdg_surface *xdg_surface, const char *title)
0700 {
0701     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_TITLE, title);
0702 }
0703 
0704 /**
0705  * @ingroup iface_zxdg_surface_v5
0706  *
0707  * Set an application identifier for the surface.
0708  *
0709  * The app ID identifies the general class of applications to which
0710  * the surface belongs. The compositor can use this to group multiple
0711  * surfaces together, or to determine how to launch a new application.
0712  *
0713  * For D-Bus activatable applications, the app ID is used as the D-Bus
0714  * service name.
0715  *
0716  * The compositor shell will try to group application surfaces together
0717  * by their app ID.  As a best practice, it is suggested to select app
0718  * ID's that match the basename of the application's .desktop file.
0719  * For example, "org.freedesktop.FooViewer" where the .desktop file is
0720  * "org.freedesktop.FooViewer.desktop".
0721  *
0722  * See the desktop-entry specification [0] for more details on
0723  * application identifiers and how they relate to well-known D-Bus
0724  * names and .desktop files.
0725  *
0726  * [0] http://standards.freedesktop.org/desktop-entry-spec/
0727  */
0728 static inline void zxdg_surface_v5_set_app_id(struct xdg_surface *xdg_surface, const char *app_id)
0729 {
0730     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_APP_ID, app_id);
0731 }
0732 
0733 /**
0734  * @ingroup iface_zxdg_surface_v5
0735  *
0736  * Clients implementing client-side decorations might want to show
0737  * a context menu when right-clicking on the decorations, giving the
0738  * user a menu that they can use to maximize or minimize the window.
0739  *
0740  * This request asks the compositor to pop up such a window menu at
0741  * the given position, relative to the local surface coordinates of
0742  * the parent surface. There are no guarantees as to what menu items
0743  * the window menu contains.
0744  *
0745  * This request must be used in response to some sort of user action
0746  * like a button press, key press, or touch down event.
0747  */
0748 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)
0749 {
0750     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SHOW_WINDOW_MENU, seat, serial, x, y);
0751 }
0752 
0753 /**
0754  * @ingroup iface_zxdg_surface_v5
0755  *
0756  * Start an interactive, user-driven move of the surface.
0757  *
0758  * This request must be used in response to some sort of user action
0759  * like a button press, key press, or touch down event. The passed
0760  * serial is used to determine the type of interactive move (touch,
0761  * pointer, etc).
0762  *
0763  * The server may ignore move requests depending on the state of
0764  * the surface (e.g. fullscreen or maximized), or if the passed serial
0765  * is no longer valid.
0766  *
0767  * If triggered, the surface will lose the focus of the device
0768  * (wl_pointer, wl_touch, etc) used for the move. It is up to the
0769  * compositor to visually indicate that the move is taking place, such as
0770  * updating a pointer cursor, during the move. There is no guarantee
0771  * that the device focus will return when the move is completed.
0772  */
0773 static inline void zxdg_surface_v5_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial)
0774 {
0775     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_MOVE, seat, serial);
0776 }
0777 
0778 /**
0779  * @ingroup iface_zxdg_surface_v5
0780  *
0781  * Start a user-driven, interactive resize of the surface.
0782  *
0783  * This request must be used in response to some sort of user action
0784  * like a button press, key press, or touch down event. The passed
0785  * serial is used to determine the type of interactive resize (touch,
0786  * pointer, etc).
0787  *
0788  * The server may ignore resize requests depending on the state of
0789  * the surface (e.g. fullscreen or maximized).
0790  *
0791  * If triggered, the client will receive configure events with the
0792  * "resize" state enum value and the expected sizes. See the "resize"
0793  * enum value for more details about what is required. The client
0794  * must also acknowledge configure events using "ack_configure". After
0795  * the resize is completed, the client will receive another "configure"
0796  * event without the resize state.
0797  *
0798  * If triggered, the surface also will lose the focus of the device
0799  * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
0800  * compositor to visually indicate that the resize is taking place,
0801  * such as updating a pointer cursor, during the resize. There is no
0802  * guarantee that the device focus will return when the resize is
0803  * completed.
0804  *
0805  * The edges parameter specifies how the surface should be resized,
0806  * and is one of the values of the resize_edge enum. The compositor
0807  * may use this information to update the surface position for
0808  * example when dragging the top left corner. The compositor may also
0809  * use this information to adapt its behavior, e.g. choose an
0810  * appropriate cursor image.
0811  */
0812 static inline void zxdg_surface_v5_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
0813 {
0814     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_RESIZE, seat, serial, edges);
0815 }
0816 
0817 /**
0818  * @ingroup iface_zxdg_surface_v5
0819  *
0820  * When a configure event is received, if a client commits the
0821  * surface in response to the configure event, then the client
0822  * must make an ack_configure request sometime before the commit
0823  * request, passing along the serial of the configure event.
0824  *
0825  * For instance, the compositor might use this information to move
0826  * a surface to the top left only when the client has drawn itself
0827  * for the maximized or fullscreen state.
0828  *
0829  * If the client receives multiple configure events before it
0830  * can respond to one, it only has to ack the last configure event.
0831  *
0832  * A client is not required to commit immediately after sending
0833  * an ack_configure request - it may even ack_configure several times
0834  * before its next surface commit.
0835  *
0836  * The compositor expects that the most recently received
0837  * ack_configure request at the time of a commit indicates which
0838  * configure event the client is responding to.
0839  */
0840 static inline void zxdg_surface_v5_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
0841 {
0842     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_ACK_CONFIGURE, serial);
0843 }
0844 
0845 /**
0846  * @ingroup iface_zxdg_surface_v5
0847  *
0848  * The window geometry of a window is its "visible bounds" from the
0849  * user's perspective. Client-side decorations often have invisible
0850  * portions like drop-shadows which should be ignored for the
0851  * purposes of aligning, placing and constraining windows.
0852  *
0853  * The window geometry is double buffered, and will be applied at the
0854  * time wl_surface.commit of the corresponding wl_surface is called.
0855  *
0856  * Once the window geometry of the surface is set once, it is not
0857  * possible to unset it, and it will remain the same until
0858  * set_window_geometry is called again, even if a new subsurface or
0859  * buffer is attached.
0860  *
0861  * If never set, the value is the full bounds of the surface,
0862  * including any subsurfaces. This updates dynamically on every
0863  * commit. This unset mode is meant for extremely simple clients.
0864  *
0865  * If responding to a configure event, the window geometry in here
0866  * must respect the sizing negotiations specified by the states in
0867  * the configure event.
0868  *
0869  * The arguments are given in the surface local coordinate space of
0870  * the wl_surface associated with this xdg_surface.
0871  *
0872  * The width and height must be greater than zero.
0873  */
0874 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)
0875 {
0876     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_WINDOW_GEOMETRY, x, y, width, height);
0877 }
0878 
0879 /**
0880  * @ingroup iface_zxdg_surface_v5
0881  *
0882  * Maximize the surface.
0883  *
0884  * After requesting that the surface should be maximized, the compositor
0885  * will respond by emitting a configure event with the "maximized" state
0886  * and the required window geometry. The client should then update its
0887  * content, drawing it in a maximized state, i.e. without shadow or other
0888  * decoration outside of the window geometry. The client must also
0889  * acknowledge the configure when committing the new content (see
0890  * ack_configure).
0891  *
0892  * It is up to the compositor to decide how and where to maximize the
0893  * surface, for example which output and what region of the screen should
0894  * be used.
0895  *
0896  * If the surface was already maximized, the compositor will still emit
0897  * a configure event with the "maximized" state.
0898  */
0899 static inline void zxdg_surface_v5_set_maximized(struct xdg_surface *xdg_surface)
0900 {
0901     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_MAXIMIZED);
0902 }
0903 
0904 /**
0905  * @ingroup iface_zxdg_surface_v5
0906  *
0907  * Unmaximize the surface.
0908  *
0909  * After requesting that the surface should be unmaximized, the compositor
0910  * will respond by emitting a configure event without the "maximized"
0911  * state. If available, the compositor will include the window geometry
0912  * dimensions the window had prior to being maximized in the configure
0913  * request. The client must then update its content, drawing it in a
0914  * regular state, i.e. potentially with shadow, etc. The client must also
0915  * acknowledge the configure when committing the new content (see
0916  * ack_configure).
0917  *
0918  * It is up to the compositor to position the surface after it was
0919  * unmaximized; usually the position the surface had before maximizing, if
0920  * applicable.
0921  *
0922  * If the surface was already not maximized, the compositor will still
0923  * emit a configure event without the "maximized" state.
0924  */
0925 static inline void zxdg_surface_v5_unset_maximized(struct xdg_surface *xdg_surface)
0926 {
0927     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_UNSET_MAXIMIZED);
0928 }
0929 
0930 /**
0931  * @ingroup iface_zxdg_surface_v5
0932  *
0933  * Make the surface fullscreen.
0934  *
0935  * You can specify an output that you would prefer to be fullscreen.
0936  * If this value is NULL, it's up to the compositor to choose which
0937  * display will be used to map this surface.
0938  *
0939  * If the surface doesn't cover the whole output, the compositor will
0940  * position the surface in the center of the output and compensate with
0941  * black borders filling the rest of the output.
0942  */
0943 static inline void zxdg_surface_v5_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output)
0944 {
0945     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_FULLSCREEN, output);
0946 }
0947 
0948 /**
0949  * @ingroup iface_zxdg_surface_v5
0950  */
0951 static inline void zxdg_surface_v5_unset_fullscreen(struct xdg_surface *xdg_surface)
0952 {
0953     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_UNSET_FULLSCREEN);
0954 }
0955 
0956 /**
0957  * @ingroup iface_zxdg_surface_v5
0958  *
0959  * Request that the compositor minimize your surface. There is no
0960  * way to know if the surface is currently minimized, nor is there
0961  * any way to unset minimization on this surface.
0962  *
0963  * If you are looking to throttle redrawing when minimized, please
0964  * instead use the wl_surface.frame event for this, as this will
0965  * also work with live previews on windows in Alt-Tab, Expose or
0966  * similar compositor features.
0967  */
0968 static inline void zxdg_surface_v5_set_minimized(struct xdg_surface *xdg_surface)
0969 {
0970     wl_proxy_marshal((struct wl_proxy *)xdg_surface, ZXDG_SURFACE_V5_SET_MINIMIZED);
0971 }
0972 
0973 /**
0974  * @ingroup iface_zxdg_popup_v5
0975  * @struct zxdg_popup_v5_listener
0976  */
0977 struct zxdg_popup_v5_listener {
0978     /**
0979      * popup interaction is done
0980      *
0981      * The popup_done event is sent out when a popup is dismissed by
0982      * the compositor. The client should destroy the xdg_popup object
0983      * at this point.
0984      */
0985     void (*popup_done)(void *data, struct xdg_popup *xdg_popup);
0986 };
0987 
0988 /**
0989  * @ingroup iface_zxdg_popup_v5
0990  */
0991 static inline int zxdg_popup_v5_add_listener(struct xdg_popup *xdg_popup, const struct zxdg_popup_v5_listener *listener, void *data)
0992 {
0993     return wl_proxy_add_listener((struct wl_proxy *)xdg_popup, (void (**)(void))listener, data);
0994 }
0995 
0996 #define ZXDG_POPUP_V5_DESTROY 0
0997 
0998 /**
0999  * @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