2017-09-23 10:26:01 +02:00
|
|
|
#ifndef WLR_TYPES_WLR_XDG_SHELL_V6_H
|
|
|
|
#define WLR_TYPES_WLR_XDG_SHELL_V6_H
|
|
|
|
|
2018-02-12 21:29:23 +01:00
|
|
|
#include <wayland-server.h>
|
2017-09-13 14:44:32 +02:00
|
|
|
#include <wlr/types/wlr_box.h>
|
2017-10-06 12:54:43 +02:00
|
|
|
#include <wlr/types/wlr_seat.h>
|
2017-08-11 15:37:09 +02:00
|
|
|
|
|
|
|
struct wlr_xdg_shell_v6 {
|
|
|
|
struct wl_global *wl_global;
|
2017-09-16 18:35:49 +02:00
|
|
|
struct wl_list clients;
|
2017-10-06 12:54:43 +02:00
|
|
|
struct wl_list popup_grabs;
|
2017-09-16 18:35:49 +02:00
|
|
|
uint32_t ping_timeout;
|
2017-08-11 20:23:53 +02:00
|
|
|
|
2017-12-07 01:08:35 +01:00
|
|
|
struct wl_listener display_destroy;
|
|
|
|
|
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-10-01 12:47:14 +02:00
|
|
|
struct wlr_xdg_popup_v6 {
|
|
|
|
struct wlr_xdg_surface_v6 *base;
|
2018-01-21 21:06:37 +01:00
|
|
|
struct wl_list link;
|
2017-10-01 12:47:14 +02:00
|
|
|
|
|
|
|
struct wl_resource *resource;
|
|
|
|
bool committed;
|
|
|
|
struct wlr_xdg_surface_v6 *parent;
|
|
|
|
struct wlr_seat *seat;
|
|
|
|
struct wlr_box geometry;
|
2017-10-06 12:54:43 +02:00
|
|
|
|
|
|
|
struct wl_list grab_link; // wlr_xdg_popup_grab_v6::popups
|
|
|
|
};
|
|
|
|
|
|
|
|
// each seat gets a popup grab
|
|
|
|
struct wlr_xdg_popup_grab_v6 {
|
|
|
|
struct wl_client *client;
|
|
|
|
struct wlr_seat_pointer_grab pointer_grab;
|
2017-10-07 17:02:11 +02:00
|
|
|
struct wlr_seat_keyboard_grab keyboard_grab;
|
2017-10-06 12:54:43 +02:00
|
|
|
struct wlr_seat *seat;
|
|
|
|
struct wl_list popups;
|
|
|
|
struct wl_list link; // wlr_xdg_shell_v6::popup_grabs
|
2017-10-01 12:47:14 +02:00
|
|
|
};
|
2017-09-16 18:35:49 +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 {
|
2018-03-13 19:57:21 +01:00
|
|
|
bool maximized, fullscreen, resizing, activated;
|
|
|
|
uint32_t width, height;
|
|
|
|
uint32_t max_width, max_height;
|
|
|
|
uint32_t min_width, min_height;
|
2017-09-13 15:19:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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
|
|
|
struct wlr_xdg_surface_v6_configure {
|
|
|
|
struct wl_list link; // wlr_xdg_surface_v6::configure_list
|
|
|
|
uint32_t serial;
|
2018-03-13 19:57:21 +01:00
|
|
|
|
2018-03-13 22:05:35 +01:00
|
|
|
struct wlr_xdg_toplevel_v6_state *toplevel_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-10-01 12:47:14 +02:00
|
|
|
|
|
|
|
union {
|
2018-03-13 22:09:44 +01:00
|
|
|
struct wlr_xdg_toplevel_v6 *toplevel;
|
|
|
|
struct wlr_xdg_popup_v6 *popup;
|
2017-10-01 12:47:14 +02:00
|
|
|
};
|
2017-08-11 20:23:53 +02:00
|
|
|
|
2018-01-21 21:06:37 +01:00
|
|
|
struct wl_list popups; // wlr_xdg_popup_v6::link
|
2017-10-02 15:15:21 +02:00
|
|
|
|
2018-03-10 11:18:50 +01:00
|
|
|
bool added, configured, mapped;
|
2017-11-17 23:52:42 +01:00
|
|
|
uint32_t configure_serial;
|
2017-09-14 22:27:14 +02:00
|
|
|
struct wl_event_source *configure_idle;
|
2017-11-17 23:52:42 +01:00
|
|
|
uint32_t configure_next_serial;
|
2017-09-14 22:27:14 +02:00
|
|
|
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;
|
2018-03-13 19:57:21 +01:00
|
|
|
struct wlr_box *geometry; // TODO: should not be a pointer
|
2017-09-13 14:44:32 +02:00
|
|
|
|
2017-09-11 23:24:55 +02:00
|
|
|
struct wl_listener surface_destroy_listener;
|
|
|
|
|
2017-09-14 14:39:57 +02:00
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
2017-09-16 18:35:49 +02:00
|
|
|
struct wl_signal ping_timeout;
|
2018-01-21 21:06:37 +01:00
|
|
|
struct wl_signal new_popup;
|
2018-03-10 11:18:50 +01:00
|
|
|
struct wl_signal map;
|
|
|
|
struct wl_signal unmap;
|
2017-09-16 14:31:08 +02:00
|
|
|
|
2017-11-09 21:41:11 +01:00
|
|
|
struct wl_signal request_maximize;
|
|
|
|
struct wl_signal request_fullscreen;
|
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 wlr_xdg_surface_v6 *surface;
|
2017-11-07 21:56:11 +01:00
|
|
|
struct wlr_seat_client *seat;
|
2017-09-16 14:31:08 +02:00
|
|
|
uint32_t serial;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_v6_resize_event {
|
|
|
|
struct wlr_xdg_surface_v6 *surface;
|
2017-11-07 21:56:11 +01:00
|
|
|
struct wlr_seat_client *seat;
|
2017-09-16 14:31:08 +02:00
|
|
|
uint32_t serial;
|
|
|
|
uint32_t edges;
|
|
|
|
};
|
|
|
|
|
2017-11-20 17:27:36 +01:00
|
|
|
struct wlr_xdg_toplevel_v6_set_fullscreen_event {
|
|
|
|
struct wlr_xdg_surface_v6 *surface;
|
|
|
|
bool fullscreen;
|
|
|
|
struct wlr_output *output;
|
|
|
|
};
|
|
|
|
|
2017-09-16 14:31:08 +02:00
|
|
|
struct wlr_xdg_toplevel_v6_show_window_menu_event {
|
|
|
|
struct wlr_xdg_surface_v6 *surface;
|
2017-11-07 21:56:11 +01:00
|
|
|
struct wlr_seat_client *seat;
|
2017-09-16 14:31:08 +02:00
|
|
|
uint32_t serial;
|
2017-11-21 09:50:00 +01:00
|
|
|
uint32_t x, y;
|
2017-09-16 14:31:08 +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-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
|
|
|
/**
|
2017-11-17 23:52:42 +01:00
|
|
|
* Request that this toplevel surface be the given size. Returns the associated
|
|
|
|
* configure serial.
|
2017-09-14 22:27:14 +02:00
|
|
|
*/
|
2017-11-17 23:52:42 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_size(struct wlr_xdg_surface_v6 *surface,
|
2017-09-14 22:27:14 +02:00
|
|
|
uint32_t width, uint32_t height);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface show itself in an activated or deactivated
|
2017-11-17 23:52:42 +01:00
|
|
|
* state. Returns the associated configure serial.
|
2017-09-14 22:27:14 +02:00
|
|
|
*/
|
2017-11-17 23:52:42 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_activated(struct wlr_xdg_surface_v6 *surface,
|
2017-09-14 22:27:14 +02:00
|
|
|
bool activated);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface consider itself maximized or not
|
2017-11-17 23:52:42 +01:00
|
|
|
* maximized. Returns the associated configure serial.
|
2017-09-14 22:27:14 +02:00
|
|
|
*/
|
2017-11-17 23:52:42 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_maximized(struct wlr_xdg_surface_v6 *surface,
|
2017-09-14 22:27:14 +02:00
|
|
|
bool maximized);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface consider itself fullscreen or not
|
2017-11-17 23:52:42 +01:00
|
|
|
* fullscreen. Returns the associated configure serial.
|
2017-09-14 22:27:14 +02:00
|
|
|
*/
|
2017-11-17 23:52:42 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_fullscreen(struct wlr_xdg_surface_v6 *surface,
|
2017-09-14 22:27:14 +02:00
|
|
|
bool fullscreen);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface consider itself to be resizing or not
|
2017-11-17 23:52:42 +01:00
|
|
|
* resizing. Returns the associated configure serial.
|
2017-09-14 22:27:14 +02:00
|
|
|
*/
|
2017-11-17 23:52:42 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
2017-09-14 22:27:14 +02:00
|
|
|
bool resizing);
|
|
|
|
|
2017-10-06 15:58:49 +02:00
|
|
|
/**
|
|
|
|
* Request that this toplevel surface closes.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_toplevel_v6_send_close(struct wlr_xdg_surface_v6 *surface);
|
|
|
|
|
2017-11-15 14:03:13 +01:00
|
|
|
/**
|
|
|
|
* Compute the popup position in surface-local coordinates.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_surface_v6_popup_get_position(struct wlr_xdg_surface_v6 *surface,
|
|
|
|
double *popup_sx, double *popup_sy);
|
|
|
|
|
2017-10-09 22:51:55 +02:00
|
|
|
/**
|
|
|
|
* Find a popup within this surface at the surface-local coordinates. Returns
|
|
|
|
* the popup and coordinates in the topmost surface coordinate system or NULL if
|
|
|
|
* no popup is found at that location.
|
|
|
|
*/
|
|
|
|
struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_popup_at(
|
|
|
|
struct wlr_xdg_surface_v6 *surface, double sx, double sy,
|
|
|
|
double *popup_sx, double *popup_sy);
|
2017-11-17 23:52:42 +01:00
|
|
|
|
2017-08-11 15:37:09 +02:00
|
|
|
#endif
|