2017-08-11 15:37:09 +02:00
|
|
|
#ifndef _WLR_XDG_SHELL_V6_H
|
|
|
|
#define _WLR_XDG_SHELL_V6_H
|
2017-09-13 14:44:32 +02:00
|
|
|
#include <wlr/types/wlr_box.h>
|
2017-08-11 15:37:09 +02:00
|
|
|
#include <wayland-server.h>
|
|
|
|
|
|
|
|
struct wlr_xdg_shell_v6 {
|
|
|
|
struct wl_global *wl_global;
|
|
|
|
struct wl_list wl_resources;
|
|
|
|
struct wl_list surfaces;
|
2017-08-11 20:23:53 +02:00
|
|
|
|
2017-09-15 14:53:08 +02:00
|
|
|
struct {
|
|
|
|
struct wl_signal new_surface;
|
|
|
|
} events;
|
|
|
|
|
2017-08-11 20:23:53 +02:00
|
|
|
void *data;
|
2017-08-11 15:37:09 +02:00
|
|
|
};
|
|
|
|
|
2017-09-12 00:06:19 +02:00
|
|
|
enum wlr_xdg_surface_v6_role {
|
|
|
|
WLR_XDG_SURFACE_V6_ROLE_NONE,
|
|
|
|
WLR_XDG_SURFACE_V6_ROLE_TOPLEVEL,
|
|
|
|
WLR_XDG_SURFACE_V6_ROLE_POPUP,
|
|
|
|
};
|
|
|
|
|
2017-09-13 15:19:10 +02:00
|
|
|
struct wlr_xdg_toplevel_v6_state {
|
|
|
|
bool maximized;
|
|
|
|
bool fullscreen;
|
|
|
|
bool resizing;
|
|
|
|
bool activated;
|
|
|
|
|
2017-09-14 22:27:14 +02:00
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
|
2017-09-13 15:19:10 +02:00
|
|
|
uint32_t max_width;
|
|
|
|
uint32_t max_height;
|
|
|
|
|
|
|
|
uint32_t min_width;
|
|
|
|
uint32_t min_height;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_v6 {
|
2017-09-14 22:27:14 +02:00
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wlr_xdg_surface_v6 *base;
|
2017-09-15 13:50:13 +02:00
|
|
|
bool added;
|
2017-09-14 22:27:14 +02:00
|
|
|
struct wlr_xdg_toplevel_v6_state next; // client protocol requests
|
|
|
|
struct wlr_xdg_toplevel_v6_state pending; // user configure requests
|
2017-09-13 15:19:10 +02:00
|
|
|
struct wlr_xdg_toplevel_v6_state current;
|
|
|
|
};
|
|
|
|
|
2017-09-14 22:27:14 +02:00
|
|
|
// TODO split up into toplevel and popup configure
|
|
|
|
struct wlr_xdg_surface_v6_configure {
|
|
|
|
struct wl_list link; // wlr_xdg_surface_v6::configure_list
|
|
|
|
uint32_t serial;
|
|
|
|
struct wlr_xdg_toplevel_v6_state *state;
|
|
|
|
};
|
|
|
|
|
2017-08-11 15:37:09 +02:00
|
|
|
struct wlr_xdg_surface_v6 {
|
2017-09-14 22:27:14 +02:00
|
|
|
struct wl_client *client;
|
2017-08-11 15:37:09 +02:00
|
|
|
struct wl_resource *resource;
|
2017-09-12 12:18:52 +02:00
|
|
|
struct wlr_surface *surface;
|
2017-09-15 14:53:08 +02:00
|
|
|
struct wlr_xdg_shell_v6 *shell;
|
2017-08-11 15:37:09 +02:00
|
|
|
struct wl_list link;
|
2017-09-12 00:06:19 +02:00
|
|
|
enum wlr_xdg_surface_v6_role role;
|
2017-09-13 15:19:10 +02:00
|
|
|
struct wlr_xdg_toplevel_v6 *toplevel_state;
|
2017-08-11 20:23:53 +02:00
|
|
|
|
2017-09-15 14:53:08 +02:00
|
|
|
bool configured;
|
2017-09-14 22:27:14 +02:00
|
|
|
struct wl_event_source *configure_idle;
|
|
|
|
struct wl_list configure_list;
|
|
|
|
|
2017-09-12 12:36:16 +02:00
|
|
|
char *title;
|
|
|
|
char *app_id;
|
|
|
|
|
2017-09-13 14:44:32 +02:00
|
|
|
bool has_next_geometry;
|
|
|
|
struct wlr_box *next_geometry;
|
|
|
|
struct wlr_box *geometry;
|
|
|
|
|
2017-09-11 23:24:55 +02:00
|
|
|
struct wl_listener surface_destroy_listener;
|
2017-09-12 12:18:52 +02:00
|
|
|
struct wl_listener surface_commit_listener;
|
2017-09-11 23:24:55 +02:00
|
|
|
|
2017-09-14 14:39:57 +02:00
|
|
|
struct {
|
|
|
|
struct wl_signal request_minimize;
|
|
|
|
struct wl_signal commit;
|
|
|
|
struct wl_signal destroy;
|
2017-09-15 14:53:08 +02:00
|
|
|
struct wl_signal ack_configure;
|
2017-09-14 14:39:57 +02:00
|
|
|
} events;
|
|
|
|
|
2017-08-11 20:23:53 +02:00
|
|
|
void *data;
|
2017-08-11 15:37:09 +02:00
|
|
|
};
|
|
|
|
|
2017-08-15 15:33:54 +02:00
|
|
|
struct wlr_xdg_shell_v6 *wlr_xdg_shell_v6_create(struct wl_display *display);
|
2017-08-11 15:37:09 +02:00
|
|
|
void wlr_xdg_shell_v6_destroy(struct wlr_xdg_shell_v6 *xdg_shell);
|
|
|
|
|
2017-09-14 22:27:14 +02:00
|
|
|
/**
|
|
|
|
* Request that this toplevel surface be the given size.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
uint32_t width, uint32_t height);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface show itself in an activated or deactivated
|
|
|
|
* state.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
bool activated);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface consider itself maximized or not
|
|
|
|
* maximized.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
bool maximized);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface consider itself fullscreen or not
|
|
|
|
* fullscreen.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
bool fullscreen);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface consider itself to be resizing or not
|
|
|
|
* resizing.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
bool resizing);
|
|
|
|
|
2017-08-11 15:37:09 +02:00
|
|
|
#endif
|