wlroots-hyprland/include/wlr/types/wlr_xdg_shell_v6.h

127 lines
2.9 KiB
C
Raw Normal View History

#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>
#include <wayland-server.h>
struct wlr_xdg_shell_v6 {
struct wl_global *wl_global;
struct wl_list wl_resources;
struct wl_list surfaces;
struct {
struct wl_signal new_surface;
} events;
void *data;
};
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,
};
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;
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;
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
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;
};
struct wlr_xdg_surface_v6 {
2017-09-14 22:27:14 +02:00
struct wl_client *client;
struct wl_resource *resource;
struct wlr_surface *surface;
struct wlr_xdg_shell_v6 *shell;
struct wl_list link;
2017-09-12 00:06:19 +02:00
enum wlr_xdg_surface_v6_role role;
struct wlr_xdg_toplevel_v6 *toplevel_state;
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;
struct wl_listener surface_destroy_listener;
struct wl_listener surface_commit_listener;
2017-09-14 14:39:57 +02:00
struct {
struct wl_signal request_minimize;
struct wl_signal commit;
struct wl_signal destroy;
struct wl_signal ack_configure;
2017-09-14 14:39:57 +02:00
} events;
void *data;
};
struct wlr_xdg_shell_v6 *wlr_xdg_shell_v6_create(struct wl_display *display);
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);
#endif