2018-07-13 14:40:56 +02:00
|
|
|
/*
|
|
|
|
* This an unstable interface of wlroots. No guarantees are made regarding the
|
|
|
|
* future consistency of this API.
|
|
|
|
*/
|
|
|
|
#ifndef WLR_USE_UNSTABLE
|
|
|
|
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
|
|
|
|
#endif
|
|
|
|
|
2018-02-14 12:40:13 +01:00
|
|
|
#ifndef WLR_TYPES_WLR_XDG_SHELL_H
|
|
|
|
#define WLR_TYPES_WLR_XDG_SHELL_H
|
2021-07-01 22:36:01 +02:00
|
|
|
|
2019-07-27 10:53:54 +02:00
|
|
|
#include <wayland-server-core.h>
|
2022-01-13 09:55:09 +01:00
|
|
|
#include <wlr/types/wlr_compositor.h>
|
2021-07-01 22:36:01 +02:00
|
|
|
#include <wlr/types/wlr_seat.h>
|
|
|
|
#include <wlr/util/box.h>
|
2018-04-15 03:17:40 +02:00
|
|
|
#include "xdg-shell-protocol.h"
|
2018-02-14 12:40:13 +01:00
|
|
|
|
|
|
|
struct wlr_xdg_shell {
|
2018-07-08 20:21:31 +02:00
|
|
|
struct wl_global *global;
|
2022-05-11 13:57:51 +02:00
|
|
|
uint32_t version;
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wl_list clients;
|
|
|
|
struct wl_list popup_grabs;
|
|
|
|
uint32_t ping_timeout;
|
|
|
|
|
|
|
|
struct wl_listener display_destroy;
|
|
|
|
|
|
|
|
struct {
|
2018-05-28 17:16:33 +02:00
|
|
|
/**
|
|
|
|
* The `new_surface` event signals that a client has requested to
|
|
|
|
* create a new shell surface. At this point, the surface is ready to
|
2018-05-28 19:12:53 +02:00
|
|
|
* be configured but is not mapped or ready receive input events. The
|
|
|
|
* surface will be ready to be managed on the `map` event.
|
2018-05-28 17:16:33 +02:00
|
|
|
*/
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wl_signal new_surface;
|
2018-08-26 23:23:12 +02:00
|
|
|
struct wl_signal destroy;
|
2018-02-14 12:40:13 +01:00
|
|
|
} events;
|
|
|
|
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_client {
|
|
|
|
struct wlr_xdg_shell *shell;
|
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wl_client *client;
|
|
|
|
struct wl_list surfaces;
|
|
|
|
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_xdg_shell.clients
|
2018-02-14 12:40:13 +01:00
|
|
|
|
|
|
|
uint32_t ping_serial;
|
|
|
|
struct wl_event_source *ping_timer;
|
|
|
|
};
|
|
|
|
|
2022-02-06 21:39:50 +01:00
|
|
|
struct wlr_xdg_positioner_rules {
|
2018-04-15 03:17:40 +02:00
|
|
|
struct wlr_box anchor_rect;
|
|
|
|
enum xdg_positioner_anchor anchor;
|
|
|
|
enum xdg_positioner_gravity gravity;
|
|
|
|
enum xdg_positioner_constraint_adjustment constraint_adjustment;
|
|
|
|
|
2022-04-12 10:45:21 +02:00
|
|
|
bool reactive;
|
|
|
|
|
|
|
|
bool has_parent_configure_serial;
|
|
|
|
uint32_t parent_configure_serial;
|
|
|
|
|
2018-04-15 03:17:40 +02:00
|
|
|
struct {
|
|
|
|
int32_t width, height;
|
2022-04-12 10:45:21 +02:00
|
|
|
} size, parent_size;
|
2018-04-15 03:17:40 +02:00
|
|
|
|
|
|
|
struct {
|
|
|
|
int32_t x, y;
|
|
|
|
} offset;
|
|
|
|
};
|
2018-04-14 21:47:51 +02:00
|
|
|
|
2022-02-06 21:39:50 +01:00
|
|
|
struct wlr_xdg_positioner {
|
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wlr_xdg_positioner_rules rules;
|
|
|
|
};
|
|
|
|
|
2022-04-13 19:22:14 +02:00
|
|
|
struct wlr_xdg_popup_state {
|
|
|
|
// Position of the popup relative to the upper left corner of
|
|
|
|
// the window geometry of the parent surface
|
|
|
|
struct wlr_box geometry;
|
2022-04-12 10:45:21 +02:00
|
|
|
|
|
|
|
bool reactive;
|
2022-04-13 19:22:14 +02:00
|
|
|
};
|
|
|
|
|
2022-06-21 06:42:58 +02:00
|
|
|
enum wlr_xdg_popup_configure_field {
|
|
|
|
WLR_XDG_POPUP_CONFIGURE_REPOSITION_TOKEN = 1 << 0,
|
|
|
|
};
|
|
|
|
|
2022-03-05 17:32:35 +01:00
|
|
|
struct wlr_xdg_popup_configure {
|
2022-06-21 06:42:58 +02:00
|
|
|
uint32_t fields; // enum wlr_xdg_popup_configure_field
|
2022-03-05 17:32:35 +01:00
|
|
|
struct wlr_box geometry;
|
|
|
|
struct wlr_xdg_positioner_rules rules;
|
2022-04-13 19:40:23 +02:00
|
|
|
uint32_t reposition_token;
|
2022-03-05 17:32:35 +01:00
|
|
|
};
|
|
|
|
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wlr_xdg_popup {
|
|
|
|
struct wlr_xdg_surface *base;
|
|
|
|
struct wl_list link;
|
|
|
|
|
|
|
|
struct wl_resource *resource;
|
|
|
|
bool committed;
|
2018-04-14 21:47:51 +02:00
|
|
|
struct wlr_surface *parent;
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wlr_seat *seat;
|
2018-03-27 04:11:41 +02:00
|
|
|
|
2022-03-05 17:32:35 +01:00
|
|
|
struct wlr_xdg_popup_configure scheduled;
|
|
|
|
|
2022-04-13 19:22:14 +02:00
|
|
|
struct wlr_xdg_popup_state current, pending;
|
2018-02-14 12:40:13 +01:00
|
|
|
|
2022-04-13 19:40:23 +02:00
|
|
|
struct {
|
|
|
|
struct wl_signal reposition;
|
|
|
|
} events;
|
|
|
|
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list grab_link; // wlr_xdg_popup_grab.popups
|
2018-02-14 12:40:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// each seat gets a popup grab
|
|
|
|
struct wlr_xdg_popup_grab {
|
|
|
|
struct wl_client *client;
|
|
|
|
struct wlr_seat_pointer_grab pointer_grab;
|
|
|
|
struct wlr_seat_keyboard_grab keyboard_grab;
|
2019-08-08 03:51:15 +02:00
|
|
|
struct wlr_seat_touch_grab touch_grab;
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wlr_seat *seat;
|
|
|
|
struct wl_list popups;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_xdg_shell.popup_grabs
|
2017-12-30 17:16:00 +01:00
|
|
|
struct wl_listener seat_destroy;
|
2018-02-14 12:40:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum wlr_xdg_surface_role {
|
|
|
|
WLR_XDG_SURFACE_ROLE_NONE,
|
|
|
|
WLR_XDG_SURFACE_ROLE_TOPLEVEL,
|
|
|
|
WLR_XDG_SURFACE_ROLE_POPUP,
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_state {
|
2018-03-15 20:15:09 +01:00
|
|
|
bool maximized, fullscreen, resizing, activated;
|
2018-05-27 14:16:32 +02:00
|
|
|
uint32_t tiled; // enum wlr_edges
|
2018-03-15 20:15:09 +01:00
|
|
|
uint32_t width, height;
|
|
|
|
uint32_t max_width, max_height;
|
|
|
|
uint32_t min_width, min_height;
|
2021-09-16 13:04:56 +02:00
|
|
|
};
|
|
|
|
|
2022-05-06 19:52:56 +02:00
|
|
|
enum wlr_xdg_toplevel_wm_capabilities {
|
|
|
|
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_WINDOW_MENU = 1 << 0,
|
|
|
|
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_MAXIMIZE = 1 << 1,
|
|
|
|
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN = 1 << 2,
|
|
|
|
WLR_XDG_TOPLEVEL_WM_CAPABILITIES_MINIMIZE = 1 << 3,
|
|
|
|
};
|
|
|
|
|
2022-05-06 19:20:33 +02:00
|
|
|
enum wlr_xdg_toplevel_configure_field {
|
|
|
|
WLR_XDG_TOPLEVEL_CONFIGURE_BOUNDS = 1 << 0,
|
2022-05-06 19:52:56 +02:00
|
|
|
WLR_XDG_TOPLEVEL_CONFIGURE_WM_CAPABILITIES = 1 << 1,
|
2022-05-06 19:20:33 +02:00
|
|
|
};
|
|
|
|
|
2021-09-16 13:04:56 +02:00
|
|
|
struct wlr_xdg_toplevel_configure {
|
2022-05-06 19:20:33 +02:00
|
|
|
uint32_t fields; // enum wlr_xdg_toplevel_configure_field
|
2021-09-16 13:04:56 +02:00
|
|
|
bool maximized, fullscreen, resizing, activated;
|
|
|
|
uint32_t tiled; // enum wlr_edges
|
|
|
|
uint32_t width, height;
|
2022-05-06 19:20:33 +02:00
|
|
|
struct {
|
|
|
|
uint32_t width, height;
|
|
|
|
} bounds;
|
2022-05-06 19:52:56 +02:00
|
|
|
uint32_t wm_capabilities; // enum wlr_xdg_toplevel_wm_capabilities
|
2021-09-16 13:04:56 +02:00
|
|
|
};
|
2019-03-25 02:09:55 +01:00
|
|
|
|
2021-09-16 13:04:56 +02:00
|
|
|
struct wlr_xdg_toplevel_requested {
|
|
|
|
bool maximized, minimized, fullscreen;
|
2019-03-25 02:09:55 +01:00
|
|
|
struct wlr_output *fullscreen_output;
|
|
|
|
struct wl_listener fullscreen_output_destroy;
|
2018-02-14 12:40:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel {
|
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wlr_xdg_surface *base;
|
|
|
|
bool added;
|
2018-03-27 16:25:02 +02:00
|
|
|
|
2022-01-08 20:52:53 +01:00
|
|
|
struct wlr_xdg_toplevel *parent;
|
2019-08-15 02:36:08 +02:00
|
|
|
struct wl_listener parent_unmap;
|
|
|
|
|
2021-09-16 13:04:56 +02:00
|
|
|
struct wlr_xdg_toplevel_state current, pending;
|
|
|
|
|
|
|
|
// Properties to be sent to the client in the next configure event.
|
|
|
|
struct wlr_xdg_toplevel_configure scheduled;
|
|
|
|
|
|
|
|
// Properties that the client has requested. Intended to be checked
|
2022-01-08 20:52:58 +01:00
|
|
|
// by the compositor on surface map and state change requests (such as
|
2022-05-24 18:46:59 +02:00
|
|
|
// xdg_toplevel.set_fullscreen) and handled accordingly.
|
2021-09-16 13:04:56 +02:00
|
|
|
struct wlr_xdg_toplevel_requested requested;
|
2018-03-27 16:25:02 +02:00
|
|
|
|
|
|
|
char *title;
|
|
|
|
char *app_id;
|
|
|
|
|
|
|
|
struct {
|
2022-04-11 20:33:15 +02:00
|
|
|
// Note: as per xdg-shell protocol, the compositor has to
|
|
|
|
// handle state requests by sending a configure event,
|
|
|
|
// even if it didn't actually change the state. Therefore,
|
|
|
|
// every compositor implementing xdg-shell support *must*
|
|
|
|
// listen to these signals and schedule a configure event
|
|
|
|
// immediately or at some time in the future; not doing so
|
|
|
|
// is a protocol violation.
|
2018-03-27 16:25:02 +02:00
|
|
|
struct wl_signal request_maximize;
|
|
|
|
struct wl_signal request_fullscreen;
|
2022-04-11 20:33:15 +02:00
|
|
|
|
2018-03-27 16:25:02 +02:00
|
|
|
struct wl_signal request_minimize;
|
|
|
|
struct wl_signal request_move;
|
|
|
|
struct wl_signal request_resize;
|
|
|
|
struct wl_signal request_show_window_menu;
|
2018-06-06 16:08:06 +02:00
|
|
|
struct wl_signal set_parent;
|
2018-07-22 21:34:51 +02:00
|
|
|
struct wl_signal set_title;
|
|
|
|
struct wl_signal set_app_id;
|
2018-03-27 16:25:02 +02:00
|
|
|
} events;
|
2018-02-14 12:40:13 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_surface_configure {
|
2018-06-10 12:15:26 +02:00
|
|
|
struct wlr_xdg_surface *surface;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_xdg_surface.configure_list
|
2018-02-14 12:40:13 +01:00
|
|
|
uint32_t serial;
|
2018-03-15 20:15:09 +01:00
|
|
|
|
2022-03-05 17:32:35 +01:00
|
|
|
union {
|
|
|
|
struct wlr_xdg_toplevel_configure *toplevel_configure;
|
|
|
|
struct wlr_xdg_popup_configure *popup_configure;
|
|
|
|
};
|
2018-02-14 12:40:13 +01:00
|
|
|
};
|
|
|
|
|
2021-07-29 22:03:14 +02:00
|
|
|
struct wlr_xdg_surface_state {
|
|
|
|
uint32_t configure_serial;
|
|
|
|
struct wlr_box geometry;
|
|
|
|
};
|
|
|
|
|
2018-04-12 05:09:13 +02:00
|
|
|
/**
|
|
|
|
* An xdg-surface is a user interface element requiring management by the
|
|
|
|
* compositor. An xdg-surface alone isn't useful, a role should be assigned to
|
|
|
|
* it in order to map it.
|
|
|
|
*
|
|
|
|
* When a surface has a role and is ready to be displayed, the `map` event is
|
|
|
|
* emitted. When a surface should no longer be displayed, the `unmap` event is
|
2018-05-03 22:59:43 +02:00
|
|
|
* emitted. The `unmap` event is guaranteed to be emitted before the `destroy`
|
2018-04-12 05:09:13 +02:00
|
|
|
* event if the view is destroyed when mapped.
|
|
|
|
*/
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wlr_xdg_surface {
|
|
|
|
struct wlr_xdg_client *client;
|
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wlr_surface *surface;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_xdg_client.surfaces
|
2018-02-14 12:40:13 +01:00
|
|
|
enum wlr_xdg_surface_role role;
|
|
|
|
|
|
|
|
union {
|
2018-03-15 20:15:09 +01:00
|
|
|
struct wlr_xdg_toplevel *toplevel;
|
|
|
|
struct wlr_xdg_popup *popup;
|
2018-02-14 12:40:13 +01:00
|
|
|
};
|
|
|
|
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list popups; // wlr_xdg_popup.link
|
2018-02-14 12:40:13 +01:00
|
|
|
|
2018-03-15 20:15:09 +01:00
|
|
|
bool added, configured, mapped;
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wl_event_source *configure_idle;
|
2021-09-30 21:44:38 +02:00
|
|
|
uint32_t scheduled_serial;
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wl_list configure_list;
|
|
|
|
|
2021-09-30 20:58:36 +02:00
|
|
|
struct wlr_xdg_surface_state current, pending;
|
2021-07-29 22:03:14 +02:00
|
|
|
|
2018-07-07 23:45:16 +02:00
|
|
|
struct wl_listener surface_destroy;
|
|
|
|
struct wl_listener surface_commit;
|
2018-02-14 12:40:13 +01:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
|
|
|
struct wl_signal ping_timeout;
|
|
|
|
struct wl_signal new_popup;
|
2018-05-28 17:16:33 +02:00
|
|
|
/**
|
|
|
|
* The `map` event signals that the shell surface is ready to be
|
|
|
|
* managed by the compositor and rendered on the screen. At this point,
|
|
|
|
* the surface has configured its properties, has had the opportunity
|
|
|
|
* to bind to the seat to receive input events, and has a buffer that
|
|
|
|
* is ready to be rendered. You can now safely add this surface to a
|
|
|
|
* list of views.
|
|
|
|
*/
|
2018-03-15 20:15:09 +01:00
|
|
|
struct wl_signal map;
|
2018-05-28 17:16:33 +02:00
|
|
|
/**
|
|
|
|
* The `unmap` event signals that the surface is no longer in a state
|
|
|
|
* where it should be shown on the screen. This might happen if the
|
|
|
|
* surface no longer has a displayable buffer because either the
|
|
|
|
* surface has been hidden or is about to be destroyed.
|
|
|
|
*/
|
2018-03-15 20:15:09 +01:00
|
|
|
struct wl_signal unmap;
|
2018-06-10 12:15:26 +02:00
|
|
|
|
|
|
|
// for protocol extensions
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_signal configure; // struct wlr_xdg_surface_configure
|
|
|
|
struct wl_signal ack_configure; // struct wlr_xdg_surface_configure
|
2018-02-14 12:40:13 +01:00
|
|
|
} events;
|
|
|
|
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_move_event {
|
2022-01-08 20:52:54 +01:00
|
|
|
struct wlr_xdg_toplevel *toplevel;
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wlr_seat_client *seat;
|
|
|
|
uint32_t serial;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_resize_event {
|
2022-01-08 20:52:54 +01:00
|
|
|
struct wlr_xdg_toplevel *toplevel;
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wlr_seat_client *seat;
|
|
|
|
uint32_t serial;
|
|
|
|
uint32_t edges;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_xdg_toplevel_show_window_menu_event {
|
2022-01-08 20:52:54 +01:00
|
|
|
struct wlr_xdg_toplevel *toplevel;
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wlr_seat_client *seat;
|
|
|
|
uint32_t serial;
|
|
|
|
uint32_t x, y;
|
|
|
|
};
|
|
|
|
|
2022-05-11 13:57:51 +02:00
|
|
|
/**
|
|
|
|
* Create the xdg_wm_base global with the specified version.
|
|
|
|
*/
|
|
|
|
struct wlr_xdg_shell *wlr_xdg_shell_create(struct wl_display *display,
|
|
|
|
uint32_t version);
|
2018-02-14 12:40:13 +01:00
|
|
|
|
2022-05-24 18:46:59 +02:00
|
|
|
/** Get the corresponding struct wlr_xdg_surface from a resource.
|
2019-12-24 13:59:38 +01:00
|
|
|
*
|
|
|
|
* Aborts if the resource doesn't have the correct type. Returns NULL if the
|
|
|
|
* resource is inert.
|
|
|
|
*/
|
2018-04-14 21:47:51 +02:00
|
|
|
struct wlr_xdg_surface *wlr_xdg_surface_from_resource(
|
|
|
|
struct wl_resource *resource);
|
2022-01-08 20:52:52 +01:00
|
|
|
|
2022-05-24 18:46:59 +02:00
|
|
|
/** Get the corresponding struct wlr_xdg_popup from a resource.
|
2022-01-08 20:52:52 +01:00
|
|
|
*
|
|
|
|
* Aborts if the resource doesn't have the correct type. Returns NULL if the
|
|
|
|
* resource is inert.
|
|
|
|
*/
|
|
|
|
struct wlr_xdg_popup *wlr_xdg_popup_from_resource(
|
2018-04-14 22:50:05 +02:00
|
|
|
struct wl_resource *resource);
|
2022-01-08 20:52:51 +01:00
|
|
|
|
2022-05-24 18:46:59 +02:00
|
|
|
/** Get the corresponding struct wlr_xdg_toplevel from a resource.
|
2022-01-08 20:52:51 +01:00
|
|
|
*
|
|
|
|
* Aborts if the resource doesn't have the correct type. Returns NULL if the
|
|
|
|
* resource is inert.
|
|
|
|
*/
|
|
|
|
struct wlr_xdg_toplevel *wlr_xdg_toplevel_from_resource(
|
2018-06-10 12:15:26 +02:00
|
|
|
struct wl_resource *resource);
|
2018-04-14 21:47:51 +02:00
|
|
|
|
2022-05-24 18:46:59 +02:00
|
|
|
/** Get the corresponding struct wlr_xdg_positioner from a resource.
|
2022-02-06 21:39:50 +01:00
|
|
|
*
|
|
|
|
* Aborts if the resource doesn't have the correct type.
|
|
|
|
*/
|
|
|
|
struct wlr_xdg_positioner *wlr_xdg_positioner_from_resource(
|
|
|
|
struct wl_resource *resource);
|
|
|
|
|
2018-02-14 12:40:13 +01: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_ping(struct wlr_xdg_surface *surface);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that this toplevel surface be the given size. Returns the associated
|
|
|
|
* configure serial.
|
|
|
|
*/
|
2022-01-08 20:52:51 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_set_size(struct wlr_xdg_toplevel *toplevel,
|
2018-02-14 12:40:13 +01:00
|
|
|
uint32_t width, uint32_t height);
|
|
|
|
|
|
|
|
/**
|
2022-01-08 20:52:51 +01:00
|
|
|
* Request that this toplevel show itself in an activated or deactivated
|
2018-02-14 12:40:13 +01:00
|
|
|
* state. Returns the associated configure serial.
|
|
|
|
*/
|
2022-01-08 20:52:51 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_set_activated(struct wlr_xdg_toplevel *toplevel,
|
2018-02-14 12:40:13 +01:00
|
|
|
bool activated);
|
|
|
|
|
|
|
|
/**
|
2022-01-08 20:52:51 +01:00
|
|
|
* Request that this toplevel consider itself maximized or not
|
2018-02-14 12:40:13 +01:00
|
|
|
* maximized. Returns the associated configure serial.
|
|
|
|
*/
|
2022-01-08 20:52:51 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_set_maximized(struct wlr_xdg_toplevel *toplevel,
|
2018-02-14 12:40:13 +01:00
|
|
|
bool maximized);
|
|
|
|
|
|
|
|
/**
|
2022-01-08 20:52:51 +01:00
|
|
|
* Request that this toplevel consider itself fullscreen or not
|
2018-02-14 12:40:13 +01:00
|
|
|
* fullscreen. Returns the associated configure serial.
|
|
|
|
*/
|
2022-01-08 20:52:51 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_set_fullscreen(struct wlr_xdg_toplevel *toplevel,
|
2018-02-14 12:40:13 +01:00
|
|
|
bool fullscreen);
|
|
|
|
|
|
|
|
/**
|
2022-01-08 20:52:51 +01:00
|
|
|
* Request that this toplevel consider itself to be resizing or not
|
2018-02-14 12:40:13 +01:00
|
|
|
* resizing. Returns the associated configure serial.
|
|
|
|
*/
|
2022-01-08 20:52:51 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_toplevel *toplevel,
|
2018-02-14 12:40:13 +01:00
|
|
|
bool resizing);
|
|
|
|
|
2018-05-27 14:16:32 +02:00
|
|
|
/**
|
2022-01-08 20:52:51 +01:00
|
|
|
* Request that this toplevel consider itself in a tiled layout and some
|
2018-05-27 14:16:32 +02:00
|
|
|
* edges are adjacent to another part of the tiling grid. `tiled_edges` is a
|
2022-05-24 18:46:59 +02:00
|
|
|
* bitfield of enum wlr_edges. Returns the associated configure serial.
|
2018-05-27 14:16:32 +02:00
|
|
|
*/
|
2022-01-08 20:52:51 +01:00
|
|
|
uint32_t wlr_xdg_toplevel_set_tiled(struct wlr_xdg_toplevel *toplevel,
|
2018-05-27 14:16:32 +02:00
|
|
|
uint32_t tiled_edges);
|
|
|
|
|
2022-05-06 19:20:33 +02:00
|
|
|
/**
|
|
|
|
* Configure the recommended bounds for the client's window geometry size.
|
|
|
|
* Returns the associated configure serial.
|
|
|
|
*/
|
|
|
|
uint32_t wlr_xdg_toplevel_set_bounds(struct wlr_xdg_toplevel *toplevel,
|
|
|
|
int32_t width, int32_t height);
|
|
|
|
|
2022-05-06 19:52:56 +02:00
|
|
|
/**
|
|
|
|
* Configure the window manager capabilities for this toplevel. `caps` is a
|
|
|
|
* bitfield of `enum wlr_xdg_toplevel_wm_capabilities`. Returns the associated
|
|
|
|
* configure serial.
|
|
|
|
*/
|
|
|
|
uint32_t wlr_xdg_toplevel_set_wm_capabilities(struct wlr_xdg_toplevel *toplevel,
|
|
|
|
uint32_t caps);
|
|
|
|
|
2018-02-14 12:40:13 +01:00
|
|
|
/**
|
2022-01-08 20:52:52 +01:00
|
|
|
* Request that this toplevel closes.
|
2018-02-14 12:40:13 +01:00
|
|
|
*/
|
2022-01-08 20:52:51 +01:00
|
|
|
void wlr_xdg_toplevel_send_close(struct wlr_xdg_toplevel *toplevel);
|
2019-01-13 15:22:49 +01:00
|
|
|
|
2021-01-05 20:14:47 +01:00
|
|
|
/**
|
|
|
|
* Sets the parent of this toplevel. Parent can be NULL.
|
|
|
|
*/
|
2022-01-08 20:52:51 +01:00
|
|
|
void wlr_xdg_toplevel_set_parent(struct wlr_xdg_toplevel *toplevel,
|
|
|
|
struct wlr_xdg_toplevel *parent);
|
2021-01-05 20:14:47 +01:00
|
|
|
|
2019-01-13 15:22:49 +01:00
|
|
|
/**
|
2022-01-08 20:52:52 +01:00
|
|
|
* Request that this popup closes.
|
2019-01-13 15:22:49 +01:00
|
|
|
**/
|
2022-01-08 20:52:52 +01:00
|
|
|
void wlr_xdg_popup_destroy(struct wlr_xdg_popup *popup);
|
2018-02-14 12:40:13 +01:00
|
|
|
|
2021-06-01 13:42:25 +02:00
|
|
|
/**
|
|
|
|
* Get the position for this popup in the surface parent's coordinate system.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_popup_get_position(struct wlr_xdg_popup *popup,
|
|
|
|
double *popup_sx, double *popup_sy);
|
2022-02-06 21:39:50 +01:00
|
|
|
|
2018-04-15 03:34:50 +02:00
|
|
|
/**
|
2022-02-06 21:39:50 +01:00
|
|
|
* Get the geometry based on positioner rules.
|
2018-04-15 03:34:50 +02:00
|
|
|
*/
|
2022-02-06 21:39:50 +01:00
|
|
|
void wlr_xdg_positioner_rules_get_geometry(
|
2022-02-07 12:22:48 +01:00
|
|
|
const struct wlr_xdg_positioner_rules *rules, struct wlr_box *box);
|
2018-04-15 03:34:50 +02:00
|
|
|
|
|
|
|
/**
|
2022-02-07 12:22:48 +01:00
|
|
|
* Unconstrain the box from the constraint area according to positioner rules.
|
2018-04-15 03:34:50 +02:00
|
|
|
*/
|
2022-02-07 12:22:48 +01:00
|
|
|
void wlr_xdg_positioner_rules_unconstrain_box(
|
|
|
|
const struct wlr_xdg_positioner_rules *rules,
|
|
|
|
const struct wlr_box *constraint, struct wlr_box *box);
|
2018-04-15 03:34:50 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Convert the given coordinates in the popup coordinate system to the toplevel
|
|
|
|
* surface coordinate system.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_popup_get_toplevel_coords(struct wlr_xdg_popup *popup,
|
|
|
|
int popup_sx, int popup_sy, int *toplevel_sx, int *toplevel_sy);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the geometry of this popup to unconstrain it according to its
|
|
|
|
* xdg-positioner rules. The box should be in the popup's root toplevel parent
|
|
|
|
* surface coordinate system.
|
|
|
|
*/
|
|
|
|
void wlr_xdg_popup_unconstrain_from_box(struct wlr_xdg_popup *popup,
|
2022-02-07 12:22:48 +01:00
|
|
|
const struct wlr_box *toplevel_space_box);
|
2018-04-15 03:34:50 +02:00
|
|
|
|
2018-02-14 12:40:13 +01:00
|
|
|
/**
|
2018-04-04 23:45:24 +02:00
|
|
|
* Find a surface within this xdg-surface tree at the given surface-local
|
|
|
|
* coordinates. Returns the surface and coordinates in the leaf surface
|
|
|
|
* coordinate system or NULL if no surface is found at that location.
|
2018-02-14 12:40:13 +01:00
|
|
|
*/
|
2018-04-04 23:45:24 +02:00
|
|
|
struct wlr_surface *wlr_xdg_surface_surface_at(
|
2018-02-14 12:40:13 +01:00
|
|
|
struct wlr_xdg_surface *surface, double sx, double sy,
|
2018-04-04 23:45:24 +02:00
|
|
|
double *sub_x, double *sub_y);
|
2018-02-14 12:40:13 +01:00
|
|
|
|
2021-01-07 15:04:08 +01:00
|
|
|
/**
|
|
|
|
* Find a surface within this xdg-surface's popup tree at the given
|
|
|
|
* surface-local coordinates. Returns the surface and coordinates in the leaf
|
|
|
|
* surface coordinate system or NULL if no surface is found at that location.
|
|
|
|
*/
|
|
|
|
struct wlr_surface *wlr_xdg_surface_popup_surface_at(
|
|
|
|
struct wlr_xdg_surface *surface, double sx, double sy,
|
|
|
|
double *sub_x, double *sub_y);
|
|
|
|
|
2022-07-01 20:37:34 +02:00
|
|
|
/**
|
|
|
|
* Returns true if the surface has the xdg surface role.
|
|
|
|
*/
|
2018-04-03 02:39:33 +02:00
|
|
|
bool wlr_surface_is_xdg_surface(struct wlr_surface *surface);
|
|
|
|
|
2022-07-01 20:37:34 +02:00
|
|
|
/**
|
|
|
|
* Get a struct wlr_xdg_surface from a struct wlr_surface.
|
|
|
|
* Asserts that the surface has the xdg surface role.
|
|
|
|
* May return NULL even if the surface has the xdg surface role if the
|
|
|
|
* corresponding xdg surface has been destroyed.
|
|
|
|
*/
|
2018-04-03 02:39:33 +02:00
|
|
|
struct wlr_xdg_surface *wlr_xdg_surface_from_wlr_surface(
|
|
|
|
struct wlr_surface *surface);
|
|
|
|
|
2018-06-01 13:27:10 +02:00
|
|
|
/**
|
|
|
|
* Get the surface geometry.
|
2022-05-24 18:46:59 +02:00
|
|
|
*
|
2018-06-01 13:27:10 +02:00
|
|
|
* This is either the geometry as set by the client, or defaulted to the bounds
|
|
|
|
* of the surface + the subsurfaces (as specified by the protocol).
|
|
|
|
*
|
2022-05-24 18:46:59 +02:00
|
|
|
* The x and y value can be < 0.
|
2018-06-01 13:27:10 +02:00
|
|
|
*/
|
2018-06-10 12:15:26 +02:00
|
|
|
void wlr_xdg_surface_get_geometry(struct wlr_xdg_surface *surface,
|
|
|
|
struct wlr_box *box);
|
2018-06-01 13:27:10 +02:00
|
|
|
|
2018-04-05 02:10:47 +02:00
|
|
|
/**
|
2021-09-25 18:40:12 +02:00
|
|
|
* Call `iterator` on each mapped surface and popup in the xdg-surface tree
|
|
|
|
* (whether or not this xdg-surface is mapped), with the surface's position
|
|
|
|
* relative to the root xdg-surface. The function is called from root to leaves
|
|
|
|
* (in rendering order).
|
2018-04-05 02:10:47 +02:00
|
|
|
*/
|
|
|
|
void wlr_xdg_surface_for_each_surface(struct wlr_xdg_surface *surface,
|
2018-06-10 12:15:26 +02:00
|
|
|
wlr_surface_iterator_func_t iterator, void *user_data);
|
|
|
|
|
2021-01-07 14:41:24 +01:00
|
|
|
/**
|
2021-09-25 18:40:12 +02:00
|
|
|
* Call `iterator` on each mapped popup's surface and popup's subsurface in the
|
|
|
|
* xdg-surface tree (whether or not this xdg-surface is mapped), with the
|
|
|
|
* surfaces's position relative to the root xdg-surface. The function is called
|
|
|
|
* from root to leaves (in rendering order).
|
2021-01-07 14:41:24 +01:00
|
|
|
*/
|
|
|
|
void wlr_xdg_surface_for_each_popup_surface(struct wlr_xdg_surface *surface,
|
|
|
|
wlr_surface_iterator_func_t iterator, void *user_data);
|
|
|
|
|
2018-06-10 12:15:26 +02:00
|
|
|
/**
|
|
|
|
* Schedule a surface configuration. This should only be called by protocols
|
|
|
|
* extending the shell.
|
|
|
|
*/
|
|
|
|
uint32_t wlr_xdg_surface_schedule_configure(struct wlr_xdg_surface *surface);
|
2018-04-05 02:10:47 +02:00
|
|
|
|
2018-02-14 12:40:13 +01:00
|
|
|
#endif
|