4 #include <wayland-server.h>
6 #include "libds/output.h"
10 enum ds_shell_surface_role
12 DS_SHELL_SURFACE_ROLE_NONE,
13 DS_SHELL_SURFACE_ROLE_TOPLEVEL,
14 DS_SHELL_SURFACE_ROLE_POPUP,
19 struct wl_global *global;
21 struct wl_list clients;
23 struct wl_listener display_destroy;
26 struct wl_signal destroy;
27 struct wl_signal new_surface;
30 uint32_t ping_timeout;
33 struct ds_shell_client
35 struct ds_shell *shell;
37 struct wl_resource *resource;
38 struct wl_client *wl_client;
39 struct wl_event_source *ping_timer;
41 struct wl_list shell_surfaces;
43 struct wl_list link; // ds_shell::clients
48 struct ds_shell_toplevel_state
50 bool maximized, fullscreen, resizing, activated;
52 uint32_t width, height;
53 uint32_t max_width, max_height;
54 uint32_t min_width, min_height;
57 struct ds_shell_toplevel_requested
59 bool maximized, minimized, fullscreen;
60 struct ds_output *fullscreen_output;
61 struct wl_listener fullscreen_output_destroy;
64 struct ds_shell_toplevel
66 struct ds_shell_surface *base;
69 struct ds_shell_surface *parent;
70 struct wl_listener parent_unmap;
72 struct ds_shell_toplevel_state current, pending;
73 struct ds_shell_toplevel_requested requested;
79 struct wl_signal request_maximize;
80 struct wl_signal request_fullscreen;
81 struct wl_signal request_minimize;
82 struct wl_signal request_move;
83 struct wl_signal request_resize;
84 struct wl_signal request_show_window_menu;
85 struct wl_signal set_parent;
86 struct wl_signal set_title;
87 struct wl_signal set_app_id;
96 struct ds_shell_surface_state
98 uint32_t configure_serial;
105 struct ds_shell_surface
107 struct ds_shell_client *client;
108 struct ds_surface *surface;
110 enum ds_shell_surface_role role;
113 struct ds_shell_toplevel *toplevel;
114 struct ds_xdg_popup *popup;
117 struct wl_resource *resource;
119 struct wl_event_source *configure_idle;
120 uint32_t scheduled_serial;
121 struct wl_list configure_list;
123 struct ds_shell_surface_state current, pending;
125 struct wl_list link; // ds_shell_client::surfaces
128 struct wl_listener surface_destroy;
129 struct wl_listener surface_commit;
133 struct wl_signal destroy;
134 struct wl_signal ping_timeout;
135 struct wl_signal new_popup;
136 struct wl_signal map;
137 struct wl_signal unmap;
138 struct wl_signal configure;
141 bool added, configured, mapped;
144 struct ds_shell_surface_configure
146 struct ds_shell_surface *shell_surface;
151 struct ds_shell_surface *
152 create_shell_surface(struct ds_shell_client *client, struct ds_surface *surface,
155 void destroy_shell_surface(struct ds_shell_surface *surface);