From 5c81d5495ce697301cde7010574ffe8d2a4fe666 Mon Sep 17 00:00:00 2001 From: Sean Vig Date: Sat, 24 Aug 2024 22:48:24 -0400 Subject: [PATCH] Update protocol files --- ...pointer-constraints-unstable-v1-protocol.h | 36 ++- wlroots/include/xdg-shell-protocol.h | 306 +++++++++++++++++- 2 files changed, 340 insertions(+), 2 deletions(-) diff --git a/wlroots/include/pointer-constraints-unstable-v1-protocol.h b/wlroots/include/pointer-constraints-unstable-v1-protocol.h index cd12cf17..616a73d6 100644 --- a/wlroots/include/pointer-constraints-unstable-v1-protocol.h +++ b/wlroots/include/pointer-constraints-unstable-v1-protocol.h @@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.22.0 */ +/* Generated by wayland-scanner 1.23.0 */ #ifndef POINTER_CONSTRAINTS_UNSTABLE_V1_SERVER_PROTOCOL_H #define POINTER_CONSTRAINTS_UNSTABLE_V1_SERVER_PROTOCOL_H @@ -241,6 +241,22 @@ enum zwp_pointer_constraints_v1_error { */ ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED = 1, }; +/** + * @ingroup iface_zwp_pointer_constraints_v1 + * Validate a zwp_pointer_constraints_v1 error value. + * + * @return true on success, false on error. + * @ref zwp_pointer_constraints_v1_error + */ +static inline bool +zwp_pointer_constraints_v1_error_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case ZWP_POINTER_CONSTRAINTS_V1_ERROR_ALREADY_CONSTRAINED: + return version >= 1; + default: + return false; + } +} #endif /* ZWP_POINTER_CONSTRAINTS_V1_ERROR_ENUM */ #ifndef ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM @@ -273,6 +289,24 @@ enum zwp_pointer_constraints_v1_lifetime { */ ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT = 2, }; +/** + * @ingroup iface_zwp_pointer_constraints_v1 + * Validate a zwp_pointer_constraints_v1 lifetime value. + * + * @return true on success, false on error. + * @ref zwp_pointer_constraints_v1_lifetime + */ +static inline bool +zwp_pointer_constraints_v1_lifetime_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT: + return version >= 1; + case ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_PERSISTENT: + return version >= 1; + default: + return false; + } +} #endif /* ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ENUM */ /** diff --git a/wlroots/include/xdg-shell-protocol.h b/wlroots/include/xdg-shell-protocol.h index 184572b5..43490333 100644 --- a/wlroots/include/xdg-shell-protocol.h +++ b/wlroots/include/xdg-shell-protocol.h @@ -1,4 +1,4 @@ -/* Generated by wayland-scanner 1.22.0 */ +/* Generated by wayland-scanner 1.23.0 */ #ifndef XDG_SHELL_SERVER_PROTOCOL_H #define XDG_SHELL_SERVER_PROTOCOL_H @@ -260,6 +260,10 @@ extern const struct wl_interface xdg_surface_interface; * id, and well as trigger user interactive operations such as interactive * resize and move. * + * A xdg_toplevel by default is responsible for providing the full intended + * visual representation of the toplevel, which depending on the window + * state, may mean things like a title bar, window controls and drop shadow. + * * Unmapping an xdg_toplevel means that the surface cannot be shown * by the compositor until it is explicitly mapped again. * All active operations (e.g., move, resize) are canceled and all @@ -283,6 +287,10 @@ extern const struct wl_interface xdg_surface_interface; * id, and well as trigger user interactive operations such as interactive * resize and move. * + * A xdg_toplevel by default is responsible for providing the full intended + * visual representation of the toplevel, which depending on the window + * state, may mean things like a title bar, window controls and drop shadow. + * * Unmapping an xdg_toplevel means that the surface cannot be shown * by the compositor until it is explicitly mapped again. * All active operations (e.g., move, resize) are canceled and all @@ -393,6 +401,34 @@ enum xdg_wm_base_error { */ XDG_WM_BASE_ERROR_UNRESPONSIVE = 6, }; +/** + * @ingroup iface_xdg_wm_base + * Validate a xdg_wm_base error value. + * + * @return true on success, false on error. + * @ref xdg_wm_base_error + */ +static inline bool +xdg_wm_base_error_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_WM_BASE_ERROR_ROLE: + return version >= 1; + case XDG_WM_BASE_ERROR_DEFUNCT_SURFACES: + return version >= 1; + case XDG_WM_BASE_ERROR_NOT_THE_TOPMOST_POPUP: + return version >= 1; + case XDG_WM_BASE_ERROR_INVALID_POPUP_PARENT: + return version >= 1; + case XDG_WM_BASE_ERROR_INVALID_SURFACE_STATE: + return version >= 1; + case XDG_WM_BASE_ERROR_INVALID_POSITIONER: + return version >= 1; + case XDG_WM_BASE_ERROR_UNRESPONSIVE: + return version >= 1; + default: + return false; + } +} #endif /* XDG_WM_BASE_ERROR_ENUM */ /** @@ -500,6 +536,22 @@ enum xdg_positioner_error { */ XDG_POSITIONER_ERROR_INVALID_INPUT = 0, }; +/** + * @ingroup iface_xdg_positioner + * Validate a xdg_positioner error value. + * + * @return true on success, false on error. + * @ref xdg_positioner_error + */ +static inline bool +xdg_positioner_error_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_POSITIONER_ERROR_INVALID_INPUT: + return version >= 1; + default: + return false; + } +} #endif /* XDG_POSITIONER_ERROR_ENUM */ #ifndef XDG_POSITIONER_ANCHOR_ENUM @@ -515,6 +567,38 @@ enum xdg_positioner_anchor { XDG_POSITIONER_ANCHOR_TOP_RIGHT = 7, XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT = 8, }; +/** + * @ingroup iface_xdg_positioner + * Validate a xdg_positioner anchor value. + * + * @return true on success, false on error. + * @ref xdg_positioner_anchor + */ +static inline bool +xdg_positioner_anchor_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_POSITIONER_ANCHOR_NONE: + return version >= 1; + case XDG_POSITIONER_ANCHOR_TOP: + return version >= 1; + case XDG_POSITIONER_ANCHOR_BOTTOM: + return version >= 1; + case XDG_POSITIONER_ANCHOR_LEFT: + return version >= 1; + case XDG_POSITIONER_ANCHOR_RIGHT: + return version >= 1; + case XDG_POSITIONER_ANCHOR_TOP_LEFT: + return version >= 1; + case XDG_POSITIONER_ANCHOR_BOTTOM_LEFT: + return version >= 1; + case XDG_POSITIONER_ANCHOR_TOP_RIGHT: + return version >= 1; + case XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT: + return version >= 1; + default: + return false; + } +} #endif /* XDG_POSITIONER_ANCHOR_ENUM */ #ifndef XDG_POSITIONER_GRAVITY_ENUM @@ -530,6 +614,38 @@ enum xdg_positioner_gravity { XDG_POSITIONER_GRAVITY_TOP_RIGHT = 7, XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT = 8, }; +/** + * @ingroup iface_xdg_positioner + * Validate a xdg_positioner gravity value. + * + * @return true on success, false on error. + * @ref xdg_positioner_gravity + */ +static inline bool +xdg_positioner_gravity_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_POSITIONER_GRAVITY_NONE: + return version >= 1; + case XDG_POSITIONER_GRAVITY_TOP: + return version >= 1; + case XDG_POSITIONER_GRAVITY_BOTTOM: + return version >= 1; + case XDG_POSITIONER_GRAVITY_LEFT: + return version >= 1; + case XDG_POSITIONER_GRAVITY_RIGHT: + return version >= 1; + case XDG_POSITIONER_GRAVITY_TOP_LEFT: + return version >= 1; + case XDG_POSITIONER_GRAVITY_BOTTOM_LEFT: + return version >= 1; + case XDG_POSITIONER_GRAVITY_TOP_RIGHT: + return version >= 1; + case XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT: + return version >= 1; + default: + return false; + } +} #endif /* XDG_POSITIONER_GRAVITY_ENUM */ #ifndef XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM @@ -638,6 +754,34 @@ enum xdg_positioner_constraint_adjustment { */ XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32, }; +/** + * @ingroup iface_xdg_positioner + * Validate a xdg_positioner constraint_adjustment value. + * + * @return true on success, false on error. + * @ref xdg_positioner_constraint_adjustment + */ +static inline bool +xdg_positioner_constraint_adjustment_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_NONE: + return version >= 1; + case XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X: + return version >= 1; + case XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y: + return version >= 1; + case XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X: + return version >= 1; + case XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y: + return version >= 1; + case XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X: + return version >= 1; + case XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y: + return version >= 1; + default: + return false; + } +} #endif /* XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_ENUM */ /** @@ -889,6 +1033,32 @@ enum xdg_surface_error { */ XDG_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT = 6, }; +/** + * @ingroup iface_xdg_surface + * Validate a xdg_surface error value. + * + * @return true on success, false on error. + * @ref xdg_surface_error + */ +static inline bool +xdg_surface_error_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_SURFACE_ERROR_NOT_CONSTRUCTED: + return version >= 1; + case XDG_SURFACE_ERROR_ALREADY_CONSTRUCTED: + return version >= 1; + case XDG_SURFACE_ERROR_UNCONFIGURED_BUFFER: + return version >= 1; + case XDG_SURFACE_ERROR_INVALID_SERIAL: + return version >= 1; + case XDG_SURFACE_ERROR_INVALID_SIZE: + return version >= 1; + case XDG_SURFACE_ERROR_DEFUNCT_ROLE_OBJECT: + return version >= 1; + default: + return false; + } +} #endif /* XDG_SURFACE_ERROR_ENUM */ /** @@ -1086,6 +1256,26 @@ enum xdg_toplevel_error { */ XDG_TOPLEVEL_ERROR_INVALID_SIZE = 2, }; +/** + * @ingroup iface_xdg_toplevel + * Validate a xdg_toplevel error value. + * + * @return true on success, false on error. + * @ref xdg_toplevel_error + */ +static inline bool +xdg_toplevel_error_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_TOPLEVEL_ERROR_INVALID_RESIZE_EDGE: + return version >= 1; + case XDG_TOPLEVEL_ERROR_INVALID_PARENT: + return version >= 1; + case XDG_TOPLEVEL_ERROR_INVALID_SIZE: + return version >= 1; + default: + return false; + } +} #endif /* XDG_TOPLEVEL_ERROR_ENUM */ #ifndef XDG_TOPLEVEL_RESIZE_EDGE_ENUM @@ -1108,6 +1298,38 @@ enum xdg_toplevel_resize_edge { XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT = 9, XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT = 10, }; +/** + * @ingroup iface_xdg_toplevel + * Validate a xdg_toplevel resize_edge value. + * + * @return true on success, false on error. + * @ref xdg_toplevel_resize_edge + */ +static inline bool +xdg_toplevel_resize_edge_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_TOPLEVEL_RESIZE_EDGE_NONE: + return version >= 1; + case XDG_TOPLEVEL_RESIZE_EDGE_TOP: + return version >= 1; + case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM: + return version >= 1; + case XDG_TOPLEVEL_RESIZE_EDGE_LEFT: + return version >= 1; + case XDG_TOPLEVEL_RESIZE_EDGE_TOP_LEFT: + return version >= 1; + case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_LEFT: + return version >= 1; + case XDG_TOPLEVEL_RESIZE_EDGE_RIGHT: + return version >= 1; + case XDG_TOPLEVEL_RESIZE_EDGE_TOP_RIGHT: + return version >= 1; + case XDG_TOPLEVEL_RESIZE_EDGE_BOTTOM_RIGHT: + return version >= 1; + default: + return false; + } +} #endif /* XDG_TOPLEVEL_RESIZE_EDGE_ENUM */ #ifndef XDG_TOPLEVEL_STATE_ENUM @@ -1172,6 +1394,9 @@ enum xdg_toplevel_state { * * The window is currently in a tiled layout and the left edge is * considered to be adjacent to another part of the tiling grid. + * + * The client should draw without shadow or other decoration + * outside of the window geometry on the left edge. * @since 2 */ XDG_TOPLEVEL_STATE_TILED_LEFT = 5, @@ -1180,6 +1405,9 @@ enum xdg_toplevel_state { * * The window is currently in a tiled layout and the right edge * is considered to be adjacent to another part of the tiling grid. + * + * The client should draw without shadow or other decoration + * outside of the window geometry on the right edge. * @since 2 */ XDG_TOPLEVEL_STATE_TILED_RIGHT = 6, @@ -1188,6 +1416,9 @@ enum xdg_toplevel_state { * * The window is currently in a tiled layout and the top edge is * considered to be adjacent to another part of the tiling grid. + * + * The client should draw without shadow or other decoration + * outside of the window geometry on the top edge. * @since 2 */ XDG_TOPLEVEL_STATE_TILED_TOP = 7, @@ -1196,6 +1427,9 @@ enum xdg_toplevel_state { * * The window is currently in a tiled layout and the bottom edge * is considered to be adjacent to another part of the tiling grid. + * + * The client should draw without shadow or other decoration + * outside of the window geometry on the bottom edge. * @since 2 */ XDG_TOPLEVEL_STATE_TILED_BOTTOM = 8, @@ -1229,6 +1463,38 @@ enum xdg_toplevel_state { * @ingroup iface_xdg_toplevel */ #define XDG_TOPLEVEL_STATE_SUSPENDED_SINCE_VERSION 6 +/** + * @ingroup iface_xdg_toplevel + * Validate a xdg_toplevel state value. + * + * @return true on success, false on error. + * @ref xdg_toplevel_state + */ +static inline bool +xdg_toplevel_state_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_TOPLEVEL_STATE_MAXIMIZED: + return version >= 1; + case XDG_TOPLEVEL_STATE_FULLSCREEN: + return version >= 1; + case XDG_TOPLEVEL_STATE_RESIZING: + return version >= 1; + case XDG_TOPLEVEL_STATE_ACTIVATED: + return version >= 1; + case XDG_TOPLEVEL_STATE_TILED_LEFT: + return version >= 2; + case XDG_TOPLEVEL_STATE_TILED_RIGHT: + return version >= 2; + case XDG_TOPLEVEL_STATE_TILED_TOP: + return version >= 2; + case XDG_TOPLEVEL_STATE_TILED_BOTTOM: + return version >= 2; + case XDG_TOPLEVEL_STATE_SUSPENDED: + return version >= 6; + default: + return false; + } +} #endif /* XDG_TOPLEVEL_STATE_ENUM */ #ifndef XDG_TOPLEVEL_WM_CAPABILITIES_ENUM @@ -1251,6 +1517,28 @@ enum xdg_toplevel_wm_capabilities { */ XDG_TOPLEVEL_WM_CAPABILITIES_MINIMIZE = 4, }; +/** + * @ingroup iface_xdg_toplevel + * Validate a xdg_toplevel wm_capabilities value. + * + * @return true on success, false on error. + * @ref xdg_toplevel_wm_capabilities + */ +static inline bool +xdg_toplevel_wm_capabilities_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_TOPLEVEL_WM_CAPABILITIES_WINDOW_MENU: + return version >= 1; + case XDG_TOPLEVEL_WM_CAPABILITIES_MAXIMIZE: + return version >= 1; + case XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN: + return version >= 1; + case XDG_TOPLEVEL_WM_CAPABILITIES_MINIMIZE: + return version >= 1; + default: + return false; + } +} #endif /* XDG_TOPLEVEL_WM_CAPABILITIES_ENUM */ /** @@ -1780,6 +2068,22 @@ enum xdg_popup_error { */ XDG_POPUP_ERROR_INVALID_GRAB = 0, }; +/** + * @ingroup iface_xdg_popup + * Validate a xdg_popup error value. + * + * @return true on success, false on error. + * @ref xdg_popup_error + */ +static inline bool +xdg_popup_error_is_valid(uint32_t value, uint32_t version) { + switch (value) { + case XDG_POPUP_ERROR_INVALID_GRAB: + return version >= 1; + default: + return false; + } +} #endif /* XDG_POPUP_ERROR_ENUM */ /**