2017-09-23 10:26:01 +02:00
|
|
|
#ifndef WLR_TYPES_WLR_XDG_SHELL_V6_H
|
|
|
|
#define WLR_TYPES_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;
|
2017-09-16 18:35:49 +02:00
|
|
|
struct wl_list clients;
|
|
|
|
uint32_t ping_timeout;
|
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-16 18:35:49 +02:00
|
|
|
struct wlr_xdg_client_v6 {
|
|
|
|
struct wlr_xdg_shell_v6 *shell;
|
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wl_client *client;
|
|
|
|
struct wl_list surfaces;
|
|
|
|
|
|
|
|
struct wl_list link; // wlr_xdg_shell_v6::clients
|
|
|
|
|
|
|
|
uint32_t ping_serial;
|
|
|
|
struct wl_event_source *ping_timer;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
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-17 02:07:19 +02:00
|
|
|
struct wlr_xdg_surface_v6 *parent;
|
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;
|
2017-09-17 01:32:23 +02:00
|
|
|
struct wlr_xdg_toplevel_v6_state state;
|
2017-09-14 22:27:14 +02:00
|
|
|
};
|
|
|
|
|
2017-08-11 15:37:09 +02:00
|
|
|
struct wlr_xdg_surface_v6 {
|
2017-09-16 18:35:49 +02:00
|
|
|
struct wlr_xdg_client_v6 *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-16 18:35:49 +02:00
|
|
|
struct wl_list link; // wlr_xdg_client_v6::surfaces
|
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 commit;
|
|
|
|
struct wl_signal destroy;
|
2017-09-15 14:53:08 +02:00
|
|
|
struct wl_signal ack_configure;
|
2017-09-16 18:35:49 +02:00
|
|
|
struct wl_signal ping_timeout;
|
2017-09-16 14:31:08 +02:00
|
|
|
|
|
|
|
struct wl_signal request_minimize;
|
|
|
|
struct wl_signal request_move;
|
|
|
|
struct wl_signal request_resize;
|
|
|
|
struct wl_signal request_show_window_menu;
|
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-09-16 14:31:08 +02:00
|
|
|
struct wlr_xdg_toplevel_v6_move_event {
|
|
|
|
struct wl_client *client;
|
|
|
|
struct wlr_xdg_surface_v6 *surface;
|
|
|
|
struct wlr_seat_handle *seat_handle;
|
|
|
|
uint32_t serial;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_v6_resize_event {
|
|
|
|
struct wl_client *client;
|
|
|
|
struct wlr_xdg_surface_v6 *surface;
|
|
|
|
struct wlr_seat_handle *seat_handle;
|
|
|
|
uint32_t serial;
|
|
|
|
uint32_t edges;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_v6_show_window_menu_event {
|
|
|
|
struct wl_client *client;
|
|
|
|
struct wlr_xdg_surface_v6 *surface;
|
|
|
|
struct wlr_seat_handle *seat_handle;
|
|
|
|
uint32_t serial;
|
|
|
|
uint32_t x;
|
|
|
|
uint32_t y;
|
|
|
|
};
|
|
|
|
|
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-16 18:35:49 +02:00
|
|
|
/**
|
|
|
|
* Send a ping to the surface. If the surface does not respond in a reasonable
|
|
|
|
* amount of time, the ping_timeout event will be emitted.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_surface_v6_ping(struct wlr_xdg_surface_v6 *surface);
|
|
|
|
|
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
|