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