2018-06-10 12:15:26 +02:00
|
|
|
#ifndef WLR_TYPES_WLR_XDG_DECORATION_V1
|
|
|
|
#define WLR_TYPES_WLR_XDG_DECORATION_V1
|
|
|
|
|
2019-07-27 10:53:54 +02:00
|
|
|
#include <wayland-server-core.h>
|
2018-06-10 12:15:26 +02:00
|
|
|
#include <wlr/types/wlr_xdg_shell.h>
|
|
|
|
|
|
|
|
enum wlr_xdg_toplevel_decoration_v1_mode {
|
|
|
|
WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_NONE = 0,
|
|
|
|
WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE = 1,
|
|
|
|
WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_decoration_manager_v1 {
|
|
|
|
struct wl_global *global;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list decorations; // wlr_xdg_toplevel_decoration.link
|
2018-06-10 12:15:26 +02:00
|
|
|
|
|
|
|
struct wl_listener display_destroy;
|
|
|
|
|
|
|
|
struct {
|
2023-08-23 20:12:12 +02:00
|
|
|
struct wl_signal new_toplevel_decoration; // struct wlr_xdg_toplevel_decoration
|
2018-08-26 23:23:12 +02:00
|
|
|
struct wl_signal destroy;
|
2018-06-10 12:15:26 +02:00
|
|
|
} events;
|
|
|
|
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_decoration_v1_configure {
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_xdg_toplevel_decoration.configure_list
|
2018-06-10 12:15:26 +02:00
|
|
|
struct wlr_xdg_surface_configure *surface_configure;
|
|
|
|
enum wlr_xdg_toplevel_decoration_v1_mode mode;
|
|
|
|
};
|
|
|
|
|
2021-09-30 19:46:08 +02:00
|
|
|
struct wlr_xdg_toplevel_decoration_v1_state {
|
|
|
|
enum wlr_xdg_toplevel_decoration_v1_mode mode;
|
|
|
|
};
|
|
|
|
|
2018-06-10 12:15:26 +02:00
|
|
|
struct wlr_xdg_toplevel_decoration_v1 {
|
|
|
|
struct wl_resource *resource;
|
2023-08-19 19:10:36 +02:00
|
|
|
struct wlr_xdg_toplevel * toplevel;
|
2018-06-10 12:15:26 +02:00
|
|
|
struct wlr_xdg_decoration_manager_v1 *manager;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_xdg_decoration_manager_v1.link
|
2018-06-10 12:15:26 +02:00
|
|
|
|
2021-09-30 19:46:08 +02:00
|
|
|
struct wlr_xdg_toplevel_decoration_v1_state current, pending;
|
|
|
|
|
|
|
|
enum wlr_xdg_toplevel_decoration_v1_mode scheduled_mode;
|
|
|
|
enum wlr_xdg_toplevel_decoration_v1_mode requested_mode;
|
|
|
|
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list configure_list; // wlr_xdg_toplevel_decoration_v1_configure.link
|
2018-06-10 12:15:26 +02:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
|
|
|
struct wl_signal request_mode;
|
|
|
|
} events;
|
|
|
|
|
xdg-{shell,decoration}: improve events
This commit changes the behavior of `new_*` signals to better match
their names (see https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3608).
wlr_xdg_shell.events.new_surface is now emitted when an xdg_surface is
created, and wlr_xdg_shell.events.new_{toplevel,popup} events are
introduced to get notified when an xdg_{toplevel,popup} is created.
Same applies to
`wlr_xdg_decoration_manager_v1.events.new_toplevel_decoration`. As a
result, wlr_xdg_surface.added and wlr_xdg_toplevel_decoration_v1.added
are removed, as we no longer need to track whether the corresponding
event was emitted.
Additionally, this commit changes the behavior of
wlr_xdg_surface.events.destroy: it is now emitted when the xdg_surface
is destroyed, as the name suggests.
wlr_xdg_{toplevel,popup}.events.destroy events are added to get
notified when an xdg_{toplevel,popup} is destroyed.
2023-09-05 15:14:25 +02:00
|
|
|
struct wl_listener toplevel_destroy;
|
2018-06-10 12:15:26 +02:00
|
|
|
struct wl_listener surface_configure;
|
|
|
|
struct wl_listener surface_ack_configure;
|
|
|
|
struct wl_listener surface_commit;
|
|
|
|
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_decoration_manager_v1 *
|
|
|
|
wlr_xdg_decoration_manager_v1_create(struct wl_display *display);
|
|
|
|
|
|
|
|
uint32_t wlr_xdg_toplevel_decoration_v1_set_mode(
|
|
|
|
struct wlr_xdg_toplevel_decoration_v1 *decoration,
|
|
|
|
enum wlr_xdg_toplevel_decoration_v1_mode mode);
|
|
|
|
|
|
|
|
#endif
|