mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-27 01:40:49 -05:00
merge in upstream
This commit is contained in:
commit
3576eec3cf
154 changed files with 4860 additions and 4410 deletions
|
|
@ -22,7 +22,8 @@
|
|||
* a DRM backend, other kinds of backends raise SIGABRT).
|
||||
*/
|
||||
struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
|
||||
struct wlr_session *session, int gpu_fd, struct wlr_backend *parent,
|
||||
struct wlr_session *session, struct wlr_device *dev,
|
||||
struct wlr_backend *parent,
|
||||
wlr_renderer_create_func_t create_renderer_func);
|
||||
|
||||
bool wlr_backend_is_drm(struct wlr_backend *backend);
|
||||
|
|
|
|||
|
|
@ -11,9 +11,11 @@ struct session_impl;
|
|||
struct wlr_device {
|
||||
int fd;
|
||||
dev_t dev;
|
||||
struct wl_signal signal;
|
||||
|
||||
struct wl_list link;
|
||||
|
||||
struct {
|
||||
struct wl_signal change;
|
||||
} events;
|
||||
};
|
||||
|
||||
struct wlr_session {
|
||||
|
|
@ -22,7 +24,6 @@ struct wlr_session {
|
|||
* Signal for when the session becomes active/inactive.
|
||||
* It's called when we swap virtual terminal.
|
||||
*/
|
||||
struct wl_signal session_signal;
|
||||
bool active;
|
||||
|
||||
/*
|
||||
|
|
@ -38,13 +39,20 @@ struct wlr_session {
|
|||
|
||||
struct wl_list devices;
|
||||
|
||||
struct wl_display *display;
|
||||
struct wl_listener display_destroy;
|
||||
|
||||
struct {
|
||||
struct wl_signal active;
|
||||
struct wl_signal add_drm_card; // struct wlr_session_add_event
|
||||
struct wl_signal destroy;
|
||||
} events;
|
||||
};
|
||||
|
||||
struct wlr_session_add_event {
|
||||
const char *path;
|
||||
};
|
||||
|
||||
/*
|
||||
* Opens a session, taking control of the current virtual terminal.
|
||||
* This should not be called if another program is already in control
|
||||
|
|
@ -74,21 +82,21 @@ void wlr_session_destroy(struct wlr_session *session);
|
|||
*
|
||||
* Returns -errno on error.
|
||||
*/
|
||||
int wlr_session_open_file(struct wlr_session *session, const char *path);
|
||||
struct wlr_device *wlr_session_open_file(struct wlr_session *session,
|
||||
const char *path);
|
||||
|
||||
/*
|
||||
* Closes a file previously opened with wlr_session_open_file.
|
||||
*/
|
||||
void wlr_session_close_file(struct wlr_session *session, int fd);
|
||||
void wlr_session_close_file(struct wlr_session *session,
|
||||
struct wlr_device *device);
|
||||
|
||||
void wlr_session_signal_add(struct wlr_session *session, int fd,
|
||||
struct wl_listener *listener);
|
||||
/*
|
||||
* Changes the virtual terminal.
|
||||
*/
|
||||
bool wlr_session_change_vt(struct wlr_session *session, unsigned vt);
|
||||
|
||||
size_t wlr_session_find_gpus(struct wlr_session *session,
|
||||
size_t ret_len, int *ret);
|
||||
size_t ret_len, struct wlr_device **ret);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
#ifndef WLR_CONFIG_H
|
||||
#define WLR_CONFIG_H
|
||||
|
||||
#mesondefine WLR_HAS_EGLMESAEXT_H
|
||||
|
||||
#mesondefine WLR_HAS_LIBCAP
|
||||
|
||||
#mesondefine WLR_HAS_SYSTEMD
|
||||
#mesondefine WLR_HAS_ELOGIND
|
||||
|
||||
#mesondefine WLR_HAS_LIBSEAT
|
||||
|
||||
#mesondefine WLR_HAS_X11_BACKEND
|
||||
|
||||
#mesondefine WLR_HAS_XWAYLAND
|
||||
|
|
|
|||
|
|
@ -15,9 +15,9 @@
|
|||
#define WLR_DMABUF_MAX_PLANES 4
|
||||
|
||||
enum wlr_dmabuf_attributes_flags {
|
||||
WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT = 1,
|
||||
WLR_DMABUF_ATTRIBUTES_FLAGS_INTERLACED = 2,
|
||||
WLR_DMABUF_ATTRIBUTES_FLAGS_BOTTOM_FIRST = 4,
|
||||
WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT = 1 << 0,
|
||||
WLR_DMABUF_ATTRIBUTES_FLAGS_INTERLACED = 1 << 1,
|
||||
WLR_DMABUF_ATTRIBUTES_FLAGS_BOTTOM_FIRST = 1 << 2,
|
||||
};
|
||||
|
||||
struct wlr_dmabuf_attributes {
|
||||
|
|
|
|||
|
|
@ -15,15 +15,14 @@
|
|||
#ifndef EGL_NO_X11
|
||||
#define EGL_NO_X11
|
||||
#endif
|
||||
#ifndef EGL_NO_PLATFORM_SPECIFIC_TYPES
|
||||
#define EGL_NO_PLATFORM_SPECIFIC_TYPES
|
||||
#endif
|
||||
|
||||
#include <wlr/config.h>
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
#if WLR_HAS_EGLMESAEXT_H
|
||||
// TODO: remove eglmesaext.h
|
||||
#include <EGL/eglmesaext.h>
|
||||
#endif
|
||||
#include <pixman.h>
|
||||
#include <stdbool.h>
|
||||
#include <wayland-server-core.h>
|
||||
|
|
@ -42,8 +41,10 @@ struct wlr_egl {
|
|||
EGLDisplay display;
|
||||
EGLConfig config;
|
||||
EGLContext context;
|
||||
EGLDeviceEXT device; // may be EGL_NO_DEVICE_EXT
|
||||
|
||||
struct {
|
||||
// Display extensions
|
||||
bool bind_wayland_display_wl;
|
||||
bool buffer_age_ext;
|
||||
bool image_base_khr;
|
||||
|
|
@ -51,6 +52,9 @@ struct wlr_egl {
|
|||
bool image_dmabuf_import_ext;
|
||||
bool image_dmabuf_import_modifiers_ext;
|
||||
bool swap_buffers_with_damage;
|
||||
|
||||
// Device extensions
|
||||
bool device_drm_ext;
|
||||
} exts;
|
||||
|
||||
struct {
|
||||
|
|
@ -67,12 +71,14 @@ struct wlr_egl {
|
|||
PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC eglExportDMABUFImageQueryMESA;
|
||||
PFNEGLEXPORTDMABUFIMAGEMESAPROC eglExportDMABUFImageMESA;
|
||||
PFNEGLDEBUGMESSAGECONTROLKHRPROC eglDebugMessageControlKHR;
|
||||
PFNEGLQUERYDISPLAYATTRIBEXTPROC eglQueryDisplayAttribEXT;
|
||||
PFNEGLQUERYDEVICESTRINGEXTPROC eglQueryDeviceStringEXT;
|
||||
} procs;
|
||||
|
||||
struct wl_display *wl_display;
|
||||
|
||||
struct wlr_drm_format_set dmabuf_formats;
|
||||
EGLBoolean **external_only_dmabuf_formats;
|
||||
struct wlr_drm_format_set dmabuf_texture_formats;
|
||||
struct wlr_drm_format_set dmabuf_render_formats;
|
||||
};
|
||||
|
||||
// TODO: Allocate and return a wlr_egl
|
||||
|
|
@ -117,9 +123,15 @@ EGLImageKHR wlr_egl_create_image_from_dmabuf(struct wlr_egl *egl,
|
|||
struct wlr_dmabuf_attributes *attributes, bool *external_only);
|
||||
|
||||
/**
|
||||
* Get the available dmabuf formats
|
||||
* Get DMA-BUF formats suitable for sampling usage.
|
||||
*/
|
||||
const struct wlr_drm_format_set *wlr_egl_get_dmabuf_formats(struct wlr_egl *egl);
|
||||
const struct wlr_drm_format_set *wlr_egl_get_dmabuf_texture_formats(
|
||||
struct wlr_egl *egl);
|
||||
/**
|
||||
* Get DMA-BUF formats suitable for rendering usage.
|
||||
*/
|
||||
const struct wlr_drm_format_set *wlr_egl_get_dmabuf_render_formats(
|
||||
struct wlr_egl *egl);
|
||||
|
||||
bool wlr_egl_export_image_to_dmabuf(struct wlr_egl *egl, EGLImageKHR image,
|
||||
int32_t width, int32_t height, uint32_t flags,
|
||||
|
|
@ -161,4 +173,6 @@ bool wlr_egl_swap_buffers(struct wlr_egl *egl, EGLSurface surface,
|
|||
|
||||
bool wlr_egl_destroy_surface(struct wlr_egl *egl, EGLSurface surface);
|
||||
|
||||
int wlr_egl_dup_drm_fd(struct wlr_egl *egl);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -21,14 +21,6 @@ struct wlr_egl *wlr_gles2_renderer_get_egl(struct wlr_renderer *renderer);
|
|||
bool wlr_gles2_renderer_check_ext(struct wlr_renderer *renderer,
|
||||
const char *ext);
|
||||
|
||||
struct wlr_texture *wlr_gles2_texture_from_pixels(struct wlr_egl *egl,
|
||||
enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height,
|
||||
const void *data);
|
||||
struct wlr_texture *wlr_gles2_texture_from_wl_drm(struct wlr_egl *egl,
|
||||
struct wl_resource *data);
|
||||
struct wlr_texture *wlr_gles2_texture_from_dmabuf(struct wlr_egl *egl,
|
||||
struct wlr_dmabuf_attributes *attribs);
|
||||
|
||||
struct wlr_gles2_texture_attribs {
|
||||
GLenum target; /* either GL_TEXTURE_2D or GL_TEXTURE_EXTERNAL_OES */
|
||||
GLuint tex;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@
|
|||
#ifndef EGL_NO_X11
|
||||
#define EGL_NO_X11
|
||||
#endif
|
||||
#ifndef EGL_NO_PLATFORM_SPECIFIC_TYPES
|
||||
#define EGL_NO_PLATFORM_SPECIFIC_TYPES
|
||||
#endif
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
|
|
@ -27,6 +30,8 @@
|
|||
#include <wlr/render/dmabuf.h>
|
||||
|
||||
struct wlr_renderer_impl {
|
||||
bool (*bind_buffer)(struct wlr_renderer *renderer,
|
||||
struct wlr_buffer *buffer);
|
||||
void (*begin)(struct wlr_renderer *renderer, uint32_t width,
|
||||
uint32_t height);
|
||||
void (*end)(struct wlr_renderer *renderer);
|
||||
|
|
@ -39,15 +44,15 @@ struct wlr_renderer_impl {
|
|||
const float color[static 4], const float matrix[static 9]);
|
||||
void (*render_ellipse_with_matrix)(struct wlr_renderer *renderer,
|
||||
const float color[static 4], const float matrix[static 9]);
|
||||
const enum wl_shm_format *(*formats)(
|
||||
const enum wl_shm_format *(*get_shm_texture_formats)(
|
||||
struct wlr_renderer *renderer, size_t *len);
|
||||
bool (*format_supported)(struct wlr_renderer *renderer,
|
||||
enum wl_shm_format fmt);
|
||||
bool (*resource_is_wl_drm_buffer)(struct wlr_renderer *renderer,
|
||||
struct wl_resource *resource);
|
||||
void (*wl_drm_buffer_get_size)(struct wlr_renderer *renderer,
|
||||
struct wl_resource *buffer, int *width, int *height);
|
||||
const struct wlr_drm_format_set *(*get_dmabuf_formats)(
|
||||
const struct wlr_drm_format_set *(*get_dmabuf_texture_formats)(
|
||||
struct wlr_renderer *renderer);
|
||||
const struct wlr_drm_format_set *(*get_dmabuf_render_formats)(
|
||||
struct wlr_renderer *renderer);
|
||||
enum wl_shm_format (*preferred_read_format)(struct wlr_renderer *renderer);
|
||||
bool (*read_pixels)(struct wlr_renderer *renderer, enum wl_shm_format fmt,
|
||||
|
|
@ -67,6 +72,7 @@ struct wlr_renderer_impl {
|
|||
bool (*blit_dmabuf)(struct wlr_renderer *renderer,
|
||||
struct wlr_dmabuf_attributes *dst,
|
||||
struct wlr_dmabuf_attributes *src);
|
||||
int (*get_drm_fd)(struct wlr_renderer *renderer);
|
||||
};
|
||||
|
||||
void wlr_renderer_init(struct wlr_renderer *renderer,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ enum wlr_renderer_read_pixels_flags {
|
|||
|
||||
struct wlr_renderer_impl;
|
||||
struct wlr_drm_format_set;
|
||||
struct wlr_buffer;
|
||||
|
||||
struct wlr_renderer {
|
||||
const struct wlr_renderer_impl *impl;
|
||||
|
|
@ -35,7 +36,7 @@ struct wlr_renderer {
|
|||
struct wlr_renderer *wlr_renderer_autocreate(struct wlr_egl *egl, EGLenum platform,
|
||||
void *remote_display, EGLint *config_attribs, EGLint visual_id);
|
||||
|
||||
void wlr_renderer_begin(struct wlr_renderer *r, int width, int height);
|
||||
void wlr_renderer_begin(struct wlr_renderer *r, uint32_t width, uint32_t height);
|
||||
void wlr_renderer_end(struct wlr_renderer *r);
|
||||
void wlr_renderer_clear(struct wlr_renderer *r, const float color[static 4]);
|
||||
/**
|
||||
|
|
@ -82,10 +83,11 @@ void wlr_render_ellipse(struct wlr_renderer *r, const struct wlr_box *box,
|
|||
void wlr_render_ellipse_with_matrix(struct wlr_renderer *r,
|
||||
const float color[static 4], const float matrix[static 9]);
|
||||
/**
|
||||
* Returns a list of pixel formats supported by this renderer.
|
||||
* Get the shared-memory formats supporting import usage. Buffers allocated
|
||||
* with a format from this list may be imported via wlr_texture_from_pixels.
|
||||
*/
|
||||
const enum wl_shm_format *wlr_renderer_get_formats(struct wlr_renderer *r,
|
||||
size_t *len);
|
||||
const enum wl_shm_format *wlr_renderer_get_shm_texture_formats(
|
||||
struct wlr_renderer *r, size_t *len);
|
||||
/**
|
||||
* Returns true if this wl_buffer is a wl_drm buffer.
|
||||
*/
|
||||
|
|
@ -97,9 +99,10 @@ bool wlr_renderer_resource_is_wl_drm_buffer(struct wlr_renderer *renderer,
|
|||
void wlr_renderer_wl_drm_buffer_get_size(struct wlr_renderer *renderer,
|
||||
struct wl_resource *buffer, int *width, int *height);
|
||||
/**
|
||||
* Get the available DMA-BUF formats.
|
||||
* Get the DMA-BUF formats supporting sampling usage. Buffers allocated with
|
||||
* a format from this list may be imported via wlr_texture_from_dmabuf.
|
||||
*/
|
||||
const struct wlr_drm_format_set *wlr_renderer_get_dmabuf_formats(
|
||||
const struct wlr_drm_format_set *wlr_renderer_get_dmabuf_texture_formats(
|
||||
struct wlr_renderer *renderer);
|
||||
/**
|
||||
* Reads out of pixels of the currently bound surface into data. `stride` is in
|
||||
|
|
@ -117,11 +120,6 @@ bool wlr_renderer_read_pixels(struct wlr_renderer *r, enum wl_shm_format fmt,
|
|||
*/
|
||||
bool wlr_renderer_blit_dmabuf(struct wlr_renderer *r,
|
||||
struct wlr_dmabuf_attributes *dst, struct wlr_dmabuf_attributes *src);
|
||||
/**
|
||||
* Checks if a format is supported.
|
||||
*/
|
||||
bool wlr_renderer_format_supported(struct wlr_renderer *r,
|
||||
enum wl_shm_format fmt);
|
||||
/**
|
||||
* Creates necessary shm and invokes the initialization of the implementation.
|
||||
*
|
||||
|
|
@ -130,6 +128,13 @@ bool wlr_renderer_format_supported(struct wlr_renderer *r,
|
|||
bool wlr_renderer_init_wl_display(struct wlr_renderer *r,
|
||||
struct wl_display *wl_display);
|
||||
|
||||
/**
|
||||
* Obtains the FD of the DRM device used for rendering, or -1 if unavailable.
|
||||
*
|
||||
* The caller doesn't have ownership of the FD, it must not close it.
|
||||
*/
|
||||
int wlr_renderer_get_drm_fd(struct wlr_renderer *r);
|
||||
|
||||
/**
|
||||
* Destroys this wlr_renderer. Textures must be destroyed separately.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ struct wlr_texture {
|
|||
/**
|
||||
* Create a new texture from raw pixel data. `stride` is in bytes. The returned
|
||||
* texture is mutable.
|
||||
*
|
||||
* Should not be called in a rendering block like renderer_begin()/end() or
|
||||
* between attaching a renderer to an output and committing it.
|
||||
*/
|
||||
struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
|
||||
enum wl_shm_format wl_fmt, uint32_t stride, uint32_t width, uint32_t height,
|
||||
|
|
@ -32,12 +35,18 @@ struct wlr_texture *wlr_texture_from_pixels(struct wlr_renderer *renderer,
|
|||
/**
|
||||
* Create a new texture from a wl_drm resource. The returned texture is
|
||||
* immutable.
|
||||
*
|
||||
* Should not be called in a rendering block like renderer_begin()/end() or
|
||||
* between attaching a renderer to an output and committing it.
|
||||
*/
|
||||
struct wlr_texture *wlr_texture_from_wl_drm(struct wlr_renderer *renderer,
|
||||
struct wl_resource *data);
|
||||
|
||||
/**
|
||||
* Create a new texture from a DMA-BUF. The returned texture is immutable.
|
||||
*
|
||||
* Should not be called in a rendering block like renderer_begin()/end() or
|
||||
* between attaching a renderer to an output and committing it.
|
||||
*/
|
||||
struct wlr_texture *wlr_texture_from_dmabuf(struct wlr_renderer *renderer,
|
||||
struct wlr_dmabuf_attributes *attribs);
|
||||
|
|
@ -58,6 +67,9 @@ bool wlr_texture_is_opaque(struct wlr_texture *texture);
|
|||
/**
|
||||
* Update a texture with raw pixels. The texture must be mutable, and the input
|
||||
* data must have the same pixel format that the texture was created with.
|
||||
*
|
||||
* Should not be called in a rendering block like renderer_begin()/end() or
|
||||
* between attaching a renderer to an output and committing it.
|
||||
*/
|
||||
bool wlr_texture_write_pixels(struct wlr_texture *texture,
|
||||
uint32_t stride, uint32_t width, uint32_t height,
|
||||
|
|
|
|||
|
|
@ -103,6 +103,11 @@ struct wlr_client_buffer {
|
|||
|
||||
struct wlr_renderer;
|
||||
|
||||
/**
|
||||
* Get a client buffer from a generic buffer. If the buffer isn't a client
|
||||
* buffer, returns NULL.
|
||||
*/
|
||||
struct wlr_client_buffer *wlr_client_buffer_get(struct wlr_buffer *buffer);
|
||||
/**
|
||||
* Check if a resource is a wl_buffer resource.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ struct wlr_drag {
|
|||
struct wl_signal destroy;
|
||||
} events;
|
||||
|
||||
struct wl_listener point_destroy;
|
||||
struct wl_listener source_destroy;
|
||||
struct wl_listener seat_client_destroy;
|
||||
struct wl_listener icon_destroy;
|
||||
|
|
|
|||
|
|
@ -29,12 +29,11 @@ struct wlr_export_dmabuf_frame_v1 {
|
|||
struct wlr_export_dmabuf_manager_v1 *manager;
|
||||
struct wl_list link; // wlr_export_dmabuf_manager_v1::frames
|
||||
|
||||
struct wlr_dmabuf_attributes attribs;
|
||||
struct wlr_output *output;
|
||||
|
||||
bool cursor_locked;
|
||||
|
||||
struct wl_listener output_precommit;
|
||||
struct wl_listener output_commit;
|
||||
};
|
||||
|
||||
struct wlr_export_dmabuf_manager_v1 *wlr_export_dmabuf_manager_v1_create(
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ struct wlr_foreign_toplevel_handle_v1 {
|
|||
|
||||
char *title;
|
||||
char *app_id;
|
||||
struct wlr_foreign_toplevel_handle_v1 *parent;
|
||||
struct wl_list outputs; // wlr_foreign_toplevel_v1_output
|
||||
uint32_t state; // wlr_foreign_toplevel_v1_state
|
||||
|
||||
|
|
@ -104,6 +105,12 @@ struct wlr_foreign_toplevel_manager_v1 *wlr_foreign_toplevel_manager_v1_create(
|
|||
|
||||
struct wlr_foreign_toplevel_handle_v1 *wlr_foreign_toplevel_handle_v1_create(
|
||||
struct wlr_foreign_toplevel_manager_v1 *manager);
|
||||
/* Destroy the given toplevel handle, sending the closed event to any
|
||||
* client. Also, if the destroyed toplevel is set as a parent of any
|
||||
* other valid toplevel, clients still holding a handle to both are
|
||||
* sent a parent signal with NULL parent. If this is not desired, the
|
||||
* caller should ensure that any child toplevels are destroyed before
|
||||
* the parent. */
|
||||
void wlr_foreign_toplevel_handle_v1_destroy(
|
||||
struct wlr_foreign_toplevel_handle_v1 *toplevel);
|
||||
|
||||
|
|
@ -126,4 +133,14 @@ void wlr_foreign_toplevel_handle_v1_set_activated(
|
|||
void wlr_foreign_toplevel_handle_v1_set_fullscreen(
|
||||
struct wlr_foreign_toplevel_handle_v1* toplevel, bool fullscreen);
|
||||
|
||||
/* Set the parent of a toplevel. If the parent changed from its previous
|
||||
* value, also sends a parent event to all clients that hold handles to
|
||||
* both toplevel and parent (no message is sent to clients that have
|
||||
* previously destroyed their parent handle). NULL is allowed as the
|
||||
* parent, meaning no parent exists. */
|
||||
void wlr_foreign_toplevel_handle_v1_set_parent(
|
||||
struct wlr_foreign_toplevel_handle_v1 *toplevel,
|
||||
struct wlr_foreign_toplevel_handle_v1 *parent);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -21,6 +21,10 @@ struct wlr_gamma_control_v1 {
|
|||
struct wlr_output *output;
|
||||
struct wl_list link;
|
||||
|
||||
uint16_t *table;
|
||||
size_t ramp_size;
|
||||
|
||||
struct wl_listener output_commit_listener;
|
||||
struct wl_listener output_destroy_listener;
|
||||
|
||||
void *data;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@
|
|||
#ifndef WLR_TYPES_WLR_INPUT_DEVICE_H
|
||||
#define WLR_TYPES_WLR_INPUT_DEVICE_H
|
||||
|
||||
#include <wayland-server-core.h>
|
||||
|
||||
enum wlr_button_state {
|
||||
WLR_BUTTON_RELEASED,
|
||||
WLR_BUTTON_PRESSED,
|
||||
|
|
@ -23,14 +25,6 @@ enum wlr_input_device_type {
|
|||
WLR_INPUT_DEVICE_SWITCH,
|
||||
};
|
||||
|
||||
/* Note: these are circular dependencies */
|
||||
#include <wlr/types/wlr_keyboard.h>
|
||||
#include <wlr/types/wlr_pointer.h>
|
||||
#include <wlr/types/wlr_touch.h>
|
||||
#include <wlr/types/wlr_tablet_tool.h>
|
||||
#include <wlr/types/wlr_tablet_pad.h>
|
||||
#include <wlr/types/wlr_switch.h>
|
||||
|
||||
struct wlr_input_device_impl;
|
||||
|
||||
struct wlr_input_device {
|
||||
|
|
|
|||
|
|
@ -12,28 +12,28 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wayland-server-protocol.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#define WLR_LED_COUNT 3
|
||||
|
||||
enum wlr_keyboard_led {
|
||||
WLR_LED_NUM_LOCK = 1,
|
||||
WLR_LED_CAPS_LOCK = 2,
|
||||
WLR_LED_SCROLL_LOCK = 4,
|
||||
WLR_LED_NUM_LOCK = 1 << 0,
|
||||
WLR_LED_CAPS_LOCK = 1 << 1,
|
||||
WLR_LED_SCROLL_LOCK = 1 << 2,
|
||||
};
|
||||
|
||||
#define WLR_MODIFIER_COUNT 8
|
||||
|
||||
enum wlr_keyboard_modifier {
|
||||
WLR_MODIFIER_SHIFT = 1,
|
||||
WLR_MODIFIER_CAPS = 2,
|
||||
WLR_MODIFIER_CTRL = 4,
|
||||
WLR_MODIFIER_ALT = 8,
|
||||
WLR_MODIFIER_MOD2 = 16,
|
||||
WLR_MODIFIER_MOD3 = 32,
|
||||
WLR_MODIFIER_LOGO = 64,
|
||||
WLR_MODIFIER_MOD5 = 128,
|
||||
WLR_MODIFIER_SHIFT = 1 << 0,
|
||||
WLR_MODIFIER_CAPS = 1 << 1,
|
||||
WLR_MODIFIER_CTRL = 1 << 2,
|
||||
WLR_MODIFIER_ALT = 1 << 3,
|
||||
WLR_MODIFIER_MOD2 = 1 << 4,
|
||||
WLR_MODIFIER_MOD3 = 1 << 5,
|
||||
WLR_MODIFIER_LOGO = 1 << 6,
|
||||
WLR_MODIFIER_MOD5 = 1 << 7,
|
||||
};
|
||||
|
||||
#define WLR_KEYBOARD_KEYS_CAP 32
|
||||
|
|
@ -91,16 +91,11 @@ struct wlr_keyboard {
|
|||
void *data;
|
||||
};
|
||||
|
||||
enum wlr_key_state {
|
||||
WLR_KEY_RELEASED,
|
||||
WLR_KEY_PRESSED,
|
||||
};
|
||||
|
||||
struct wlr_event_keyboard_key {
|
||||
uint32_t time_msec;
|
||||
uint32_t keycode;
|
||||
bool update_state; // if backend doesn't update modifiers on its own
|
||||
enum wlr_key_state state;
|
||||
enum wl_keyboard_key_state state;
|
||||
};
|
||||
|
||||
bool wlr_keyboard_set_keymap(struct wlr_keyboard *kb,
|
||||
|
|
|
|||
|
|
@ -138,6 +138,10 @@ struct wlr_layer_surface_v1 *wlr_layer_surface_v1_from_wlr_surface(
|
|||
void wlr_layer_surface_v1_for_each_surface(struct wlr_layer_surface_v1 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
/* Calls the iterator function for each popup of this surface */
|
||||
void wlr_layer_surface_v1_for_each_popup(struct wlr_layer_surface_v1 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
/**
|
||||
* Find a surface within this layer-surface tree at the given surface-local
|
||||
* coordinates. Returns the surface and coordinates in the leaf surface
|
||||
|
|
|
|||
|
|
@ -164,9 +164,11 @@ struct wlr_output {
|
|||
// Emitted right before commit
|
||||
struct wl_signal precommit; // wlr_output_event_precommit
|
||||
// Emitted right after commit
|
||||
struct wl_signal commit;
|
||||
struct wl_signal commit; // wlr_output_event_commit
|
||||
// Emitted right after the buffer has been presented to the user
|
||||
struct wl_signal present; // wlr_output_event_present
|
||||
// Emitted after a client bound the wl_output global
|
||||
struct wl_signal bind; // wlr_output_event_bind
|
||||
struct wl_signal enable;
|
||||
struct wl_signal mode;
|
||||
struct wl_signal scale;
|
||||
|
|
@ -199,6 +201,12 @@ struct wlr_output_event_precommit {
|
|||
struct timespec *when;
|
||||
};
|
||||
|
||||
struct wlr_output_event_commit {
|
||||
struct wlr_output *output;
|
||||
uint32_t committed; // bitmask of enum wlr_output_state_field
|
||||
struct timespec *when;
|
||||
};
|
||||
|
||||
enum wlr_output_present_flag {
|
||||
// The presentation was synchronized to the "vertical retrace" by the
|
||||
// display hardware such that tearing does not happen.
|
||||
|
|
@ -228,6 +236,11 @@ struct wlr_output_event_present {
|
|||
uint32_t flags; // enum wlr_output_present_flag
|
||||
};
|
||||
|
||||
struct wlr_output_event_bind {
|
||||
struct wlr_output *output;
|
||||
struct wl_resource *resource;
|
||||
};
|
||||
|
||||
struct wlr_surface;
|
||||
|
||||
/**
|
||||
|
|
@ -342,8 +355,7 @@ bool wlr_output_preferred_read_format(struct wlr_output *output,
|
|||
* the screen that has changed since the last frame.
|
||||
*
|
||||
* Compositors implementing damage tracking should call this function with the
|
||||
* damaged region in output-buffer-local coordinates (ie. scaled and
|
||||
* transformed).
|
||||
* damaged region in output-buffer-local coordinates.
|
||||
*
|
||||
* This region is not to be confused with the renderer's buffer damage, ie. the
|
||||
* region compositors need to repaint. Compositors usually need to repaint more
|
||||
|
|
@ -392,8 +404,7 @@ size_t wlr_output_get_gamma_size(struct wlr_output *output);
|
|||
void wlr_output_set_gamma(struct wlr_output *output, size_t size,
|
||||
const uint16_t *r, const uint16_t *g, const uint16_t *b);
|
||||
/**
|
||||
* Exports the output's current back-buffer as a DMA-BUF (ie. the buffer that
|
||||
* will be displayed on next commit).
|
||||
* Exports the last committed buffer as a DMA-BUF.
|
||||
*
|
||||
* The caller is responsible for cleaning up the DMA-BUF attributes.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -124,10 +124,10 @@ struct wlr_output *wlr_output_layout_get_center_output(
|
|||
struct wlr_output_layout *layout);
|
||||
|
||||
enum wlr_direction {
|
||||
WLR_DIRECTION_UP = 1,
|
||||
WLR_DIRECTION_DOWN = 2,
|
||||
WLR_DIRECTION_LEFT = 4,
|
||||
WLR_DIRECTION_RIGHT = 8,
|
||||
WLR_DIRECTION_UP = 1 << 0,
|
||||
WLR_DIRECTION_DOWN = 1 << 1,
|
||||
WLR_DIRECTION_LEFT = 1 << 2,
|
||||
WLR_DIRECTION_RIGHT = 1 << 3,
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ struct wlr_output_power_v1 {
|
|||
struct wl_list link;
|
||||
|
||||
struct wl_listener output_destroy_listener;
|
||||
struct wl_listener output_enable_listener;
|
||||
struct wl_listener output_commit_listener;
|
||||
|
||||
void *data;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wayland-server-protocol.h>
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
|
||||
struct wlr_pointer_impl;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ struct wlr_screencopy_frame_v1 {
|
|||
|
||||
struct wlr_output *output;
|
||||
struct wl_listener output_precommit;
|
||||
struct wl_listener output_commit;
|
||||
struct wl_listener output_destroy;
|
||||
struct wl_listener output_enable;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
#include <wayland-server-core.h>
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
#include <wlr/types/wlr_keyboard.h>
|
||||
#include <wlr/types/wlr_pointer.h>
|
||||
#include <wlr/types/wlr_surface.h>
|
||||
|
||||
#define WLR_SERIAL_RINGSET_SIZE 128
|
||||
|
|
|
|||
|
|
@ -67,6 +67,15 @@ struct wlr_surface_role {
|
|||
void (*precommit)(struct wlr_surface *surface);
|
||||
};
|
||||
|
||||
struct wlr_surface_output {
|
||||
struct wlr_surface *surface;
|
||||
struct wlr_output *output;
|
||||
|
||||
struct wl_list link; // wlr_surface::current_outputs
|
||||
struct wl_listener bind;
|
||||
struct wl_listener destroy;
|
||||
};
|
||||
|
||||
struct wlr_surface {
|
||||
struct wl_resource *resource;
|
||||
struct wlr_renderer *renderer;
|
||||
|
|
@ -126,6 +135,8 @@ struct wlr_surface {
|
|||
// wlr_subsurface::parent_pending_link
|
||||
struct wl_list subsurface_pending_list;
|
||||
|
||||
struct wl_list current_outputs; // wlr_surface_output::link
|
||||
|
||||
struct wl_listener renderer_destroy;
|
||||
|
||||
void *data;
|
||||
|
|
|
|||
|
|
@ -48,8 +48,6 @@ struct wlr_xdg_client {
|
|||
};
|
||||
|
||||
struct wlr_xdg_positioner {
|
||||
struct wl_resource *resource;
|
||||
|
||||
struct wlr_box anchor_rect;
|
||||
enum xdg_positioner_anchor anchor;
|
||||
enum xdg_positioner_gravity gravity;
|
||||
|
|
@ -124,6 +122,7 @@ struct wlr_xdg_toplevel {
|
|||
|
||||
struct wlr_xdg_toplevel_state client_pending;
|
||||
struct wlr_xdg_toplevel_state server_pending;
|
||||
struct wlr_xdg_toplevel_state last_acked;
|
||||
struct wlr_xdg_toplevel_state current;
|
||||
|
||||
char *title;
|
||||
|
|
|
|||
|
|
@ -1,374 +0,0 @@
|
|||
/*
|
||||
* This protocol is obsolete and will be removed in a future version. The
|
||||
* recommended replacement is xdg-shell.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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
|
||||
|
||||
#ifndef WLR_TYPES_WLR_XDG_SHELL_V6_H
|
||||
#define WLR_TYPES_WLR_XDG_SHELL_V6_H
|
||||
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/types/wlr_box.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include "xdg-shell-unstable-v6-protocol.h"
|
||||
|
||||
/**
|
||||
* An interface enabling clients to turn their wl_surfaces into windows in a
|
||||
* desktop environment.
|
||||
*/
|
||||
struct wlr_xdg_shell_v6 {
|
||||
struct wl_global *global;
|
||||
struct wl_list clients;
|
||||
struct wl_list popup_grabs;
|
||||
uint32_t ping_timeout;
|
||||
|
||||
struct wl_listener display_destroy;
|
||||
|
||||
struct {
|
||||
/**
|
||||
* The `new_surface` event signals that a client has requested to
|
||||
* create a new shell surface. At this point, the surface is ready to
|
||||
* be configured but is not mapped or ready receive input events. The
|
||||
* surface will be ready to be managed on the `map` event.
|
||||
*/
|
||||
struct wl_signal new_surface;
|
||||
struct wl_signal destroy;
|
||||
} events;
|
||||
|
||||
void *data;
|
||||
};
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
struct wlr_xdg_positioner_v6 {
|
||||
struct wlr_box anchor_rect;
|
||||
enum zxdg_positioner_v6_anchor anchor;
|
||||
enum zxdg_positioner_v6_gravity gravity;
|
||||
enum zxdg_positioner_v6_constraint_adjustment constraint_adjustment;
|
||||
|
||||
struct {
|
||||
int32_t width, height;
|
||||
} size;
|
||||
|
||||
struct {
|
||||
int32_t x, y;
|
||||
} offset;
|
||||
};
|
||||
|
||||
struct wlr_xdg_popup_v6 {
|
||||
struct wlr_xdg_surface_v6 *base;
|
||||
struct wl_list link;
|
||||
|
||||
struct wl_resource *resource;
|
||||
bool committed;
|
||||
struct wlr_xdg_surface_v6 *parent;
|
||||
struct wlr_seat *seat;
|
||||
|
||||
// Position of the popup relative to the upper left corner of the window
|
||||
// geometry of the parent surface
|
||||
struct wlr_box geometry;
|
||||
|
||||
struct wlr_xdg_positioner_v6 positioner;
|
||||
|
||||
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;
|
||||
struct wlr_seat_keyboard_grab keyboard_grab;
|
||||
struct wlr_seat_touch_grab touch_grab;
|
||||
struct wlr_seat *seat;
|
||||
struct wl_list popups;
|
||||
struct wl_list link; // wlr_xdg_shell_v6::popup_grabs
|
||||
struct wl_listener seat_destroy;
|
||||
};
|
||||
|
||||
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, fullscreen, resizing, activated;
|
||||
uint32_t width, height;
|
||||
uint32_t max_width, max_height;
|
||||
uint32_t min_width, min_height;
|
||||
|
||||
// Since the fullscreen request may be made before the toplevel's surface
|
||||
// is mapped, this is used to store the requested fullscreen output (if
|
||||
// any) for wlr_xdg_toplevel_v6::client_pending.
|
||||
struct wlr_output *fullscreen_output;
|
||||
struct wl_listener fullscreen_output_destroy;
|
||||
};
|
||||
|
||||
/**
|
||||
* 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
|
||||
* emitted. The `unmap` event is guaranteed to be emitted before the `destroy`
|
||||
* event if the view is destroyed when mapped.
|
||||
*/
|
||||
struct wlr_xdg_toplevel_v6 {
|
||||
struct wl_resource *resource;
|
||||
struct wlr_xdg_surface_v6 *base;
|
||||
struct wlr_xdg_surface_v6 *parent;
|
||||
bool added;
|
||||
|
||||
struct wlr_xdg_toplevel_v6_state client_pending;
|
||||
struct wlr_xdg_toplevel_v6_state server_pending;
|
||||
struct wlr_xdg_toplevel_v6_state current;
|
||||
|
||||
char *title;
|
||||
char *app_id;
|
||||
|
||||
struct {
|
||||
struct wl_signal request_maximize;
|
||||
struct wl_signal request_fullscreen;
|
||||
struct wl_signal request_minimize;
|
||||
struct wl_signal request_move;
|
||||
struct wl_signal request_resize;
|
||||
struct wl_signal request_show_window_menu;
|
||||
struct wl_signal set_parent;
|
||||
struct wl_signal set_title;
|
||||
struct wl_signal set_app_id;
|
||||
} events;
|
||||
};
|
||||
|
||||
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 *toplevel_state;
|
||||
};
|
||||
|
||||
struct wlr_xdg_surface_v6 {
|
||||
struct wlr_xdg_client_v6 *client;
|
||||
struct wl_resource *resource;
|
||||
struct wlr_surface *surface;
|
||||
struct wl_list link; // wlr_xdg_client_v6::surfaces
|
||||
enum wlr_xdg_surface_v6_role role;
|
||||
|
||||
union {
|
||||
struct wlr_xdg_toplevel_v6 *toplevel;
|
||||
struct wlr_xdg_popup_v6 *popup;
|
||||
};
|
||||
|
||||
struct wl_list popups; // wlr_xdg_popup_v6::link
|
||||
|
||||
bool added, configured, mapped;
|
||||
uint32_t configure_serial;
|
||||
struct wl_event_source *configure_idle;
|
||||
uint32_t configure_next_serial;
|
||||
struct wl_list configure_list;
|
||||
|
||||
bool has_next_geometry;
|
||||
struct wlr_box next_geometry;
|
||||
struct wlr_box geometry;
|
||||
|
||||
struct wl_listener surface_destroy;
|
||||
struct wl_listener surface_commit;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
struct wl_signal ping_timeout;
|
||||
struct wl_signal new_popup;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
struct wl_signal map;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
struct wl_signal unmap;
|
||||
} events;
|
||||
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct wlr_xdg_toplevel_v6_move_event {
|
||||
struct wlr_xdg_surface_v6 *surface;
|
||||
struct wlr_seat_client *seat;
|
||||
uint32_t serial;
|
||||
};
|
||||
|
||||
struct wlr_xdg_toplevel_v6_resize_event {
|
||||
struct wlr_xdg_surface_v6 *surface;
|
||||
struct wlr_seat_client *seat;
|
||||
uint32_t serial;
|
||||
uint32_t edges;
|
||||
};
|
||||
|
||||
struct wlr_xdg_toplevel_v6_set_fullscreen_event {
|
||||
struct wlr_xdg_surface_v6 *surface;
|
||||
bool fullscreen;
|
||||
struct wlr_output *output;
|
||||
};
|
||||
|
||||
struct wlr_xdg_toplevel_v6_show_window_menu_event {
|
||||
struct wlr_xdg_surface_v6 *surface;
|
||||
struct wlr_seat_client *seat;
|
||||
uint32_t serial;
|
||||
uint32_t x, y;
|
||||
};
|
||||
|
||||
struct wlr_xdg_shell_v6 *wlr_xdg_shell_v6_create(struct wl_display *display);
|
||||
|
||||
/**
|
||||
* 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);
|
||||
|
||||
/**
|
||||
* Request that this toplevel surface be the given size. Returns the associated
|
||||
* configure serial.
|
||||
*/
|
||||
uint32_t 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. Returns the associated configure serial.
|
||||
*/
|
||||
uint32_t 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. Returns the associated configure serial.
|
||||
*/
|
||||
uint32_t 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. Returns the associated configure serial.
|
||||
*/
|
||||
uint32_t 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. Returns the associated configure serial.
|
||||
*/
|
||||
uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
||||
bool resizing);
|
||||
|
||||
/**
|
||||
* Request that this xdg surface closes.
|
||||
*/
|
||||
void wlr_xdg_surface_v6_send_close(struct wlr_xdg_surface_v6 *surface);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
struct wlr_surface *wlr_xdg_surface_v6_surface_at(
|
||||
struct wlr_xdg_surface_v6 *surface, double sx, double sy,
|
||||
double *sub_x, double *sub_y);
|
||||
|
||||
/**
|
||||
* Get the geometry for this positioner based on the anchor rect, gravity, and
|
||||
* size of this positioner.
|
||||
*/
|
||||
struct wlr_box wlr_xdg_positioner_v6_get_geometry(
|
||||
struct wlr_xdg_positioner_v6 *positioner);
|
||||
|
||||
/**
|
||||
* Get the anchor point for this popup in the toplevel parent's coordinate system.
|
||||
*/
|
||||
void wlr_xdg_popup_v6_get_anchor_point(struct wlr_xdg_popup_v6 *popup,
|
||||
int *toplevel_sx, int *toplevel_sy);
|
||||
|
||||
/**
|
||||
* Convert the given coordinates in the popup coordinate system to the toplevel
|
||||
* surface coordinate system.
|
||||
*/
|
||||
void wlr_xdg_popup_v6_get_toplevel_coords(struct wlr_xdg_popup_v6 *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_v6_unconstrain_from_box(struct wlr_xdg_popup_v6 *popup,
|
||||
struct wlr_box *toplevel_sx_box);
|
||||
|
||||
/**
|
||||
Invert the right/left anchor and gravity for this positioner. This can be
|
||||
used to "flip" the positioner around the anchor rect in the x direction.
|
||||
*/
|
||||
void wlr_positioner_v6_invert_x(
|
||||
struct wlr_xdg_positioner_v6 *positioner);
|
||||
|
||||
/**
|
||||
Invert the top/bottom anchor and gravity for this positioner. This can be
|
||||
used to "flip" the positioner around the anchor rect in the y direction.
|
||||
*/
|
||||
void wlr_positioner_v6_invert_y(
|
||||
struct wlr_xdg_positioner_v6 *positioner);
|
||||
|
||||
bool wlr_surface_is_xdg_surface_v6(struct wlr_surface *surface);
|
||||
|
||||
struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_from_wlr_surface(
|
||||
struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Get the surface geometry.
|
||||
* 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).
|
||||
*
|
||||
* The x and y value can be <0
|
||||
*/
|
||||
void wlr_xdg_surface_v6_get_geometry(struct wlr_xdg_surface_v6 *surface, struct wlr_box *box);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each surface and popup in the xdg-surface tree, with the
|
||||
* surface's position relative to the root xdg-surface. The function is called
|
||||
* from root to leaves (in rendering order).
|
||||
*/
|
||||
void wlr_xdg_surface_v6_for_each_surface(struct wlr_xdg_surface_v6 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
/**
|
||||
* Call `iterator` on each popup in the xdg-surface tree, with the popup's
|
||||
* position relative to the root xdg-surface. The function is called from root
|
||||
* to leaves (in rendering order).
|
||||
*/
|
||||
void wlr_xdg_surface_v6_for_each_popup(struct wlr_xdg_surface_v6 *surface,
|
||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||
|
||||
#endif
|
||||
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
enum wlr_edges {
|
||||
WLR_EDGE_NONE = 0,
|
||||
WLR_EDGE_TOP = 1,
|
||||
WLR_EDGE_BOTTOM = 2,
|
||||
WLR_EDGE_LEFT = 4,
|
||||
WLR_EDGE_RIGHT = 8,
|
||||
WLR_EDGE_TOP = 1 << 0,
|
||||
WLR_EDGE_BOTTOM = 1 << 1,
|
||||
WLR_EDGE_LEFT = 1 << 2,
|
||||
WLR_EDGE_RIGHT = 1 << 3,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ struct wlr_xwayland_cursor;
|
|||
struct wlr_xwayland_server {
|
||||
pid_t pid;
|
||||
struct wl_client *client;
|
||||
struct wl_event_source *sigusr1_source;
|
||||
struct wl_event_source *pipe_source;
|
||||
int wm_fd[2], wl_fd[2];
|
||||
|
||||
time_t server_start;
|
||||
|
|
@ -84,7 +84,6 @@ struct wlr_xwayland {
|
|||
|
||||
struct wl_listener server_ready;
|
||||
struct wl_listener server_destroy;
|
||||
struct wl_listener client_destroy;
|
||||
struct wl_listener seat_destroy;
|
||||
|
||||
void *data;
|
||||
|
|
@ -173,6 +172,7 @@ struct wlr_xwayland_surface {
|
|||
bool modal;
|
||||
bool fullscreen;
|
||||
bool maximized_vert, maximized_horz;
|
||||
bool minimized;
|
||||
|
||||
bool has_alpha;
|
||||
|
||||
|
|
@ -181,6 +181,7 @@ struct wlr_xwayland_surface {
|
|||
struct wl_signal request_configure;
|
||||
struct wl_signal request_move;
|
||||
struct wl_signal request_resize;
|
||||
struct wl_signal request_minimize;
|
||||
struct wl_signal request_maximize;
|
||||
struct wl_signal request_fullscreen;
|
||||
struct wl_signal request_activate;
|
||||
|
|
@ -196,6 +197,7 @@ struct wlr_xwayland_surface {
|
|||
struct wl_signal set_hints;
|
||||
struct wl_signal set_decorations;
|
||||
struct wl_signal set_override_redirect;
|
||||
struct wl_signal set_geometry;
|
||||
struct wl_signal ping_timeout;
|
||||
} events;
|
||||
|
||||
|
|
@ -221,6 +223,11 @@ struct wlr_xwayland_resize_event {
|
|||
uint32_t edges;
|
||||
};
|
||||
|
||||
struct wlr_xwayland_minimize_event {
|
||||
struct wlr_xwayland_surface *surface;
|
||||
bool minimize;
|
||||
};
|
||||
|
||||
struct wlr_xwayland_server *wlr_xwayland_server_create(
|
||||
struct wl_display *display, struct wlr_xwayland_server_options *options);
|
||||
void wlr_xwayland_server_destroy(struct wlr_xwayland_server *server);
|
||||
|
|
@ -229,9 +236,6 @@ void wlr_xwayland_server_destroy(struct wlr_xwayland_server *server);
|
|||
*
|
||||
* The server supports a lazy mode in which Xwayland is only started when a
|
||||
* client tries to connect.
|
||||
*
|
||||
* Note: wlr_xwayland will setup a global SIGUSR1 handler on the compositor
|
||||
* process.
|
||||
*/
|
||||
struct wlr_xwayland *wlr_xwayland_create(struct wl_display *wl_display,
|
||||
struct wlr_compositor *compositor, bool lazy);
|
||||
|
|
@ -245,11 +249,22 @@ void wlr_xwayland_set_cursor(struct wlr_xwayland *wlr_xwayland,
|
|||
void wlr_xwayland_surface_activate(struct wlr_xwayland_surface *surface,
|
||||
bool activated);
|
||||
|
||||
/**
|
||||
* Restack surface relative to sibling.
|
||||
* If sibling is NULL, then the surface is moved to the top or the bottom
|
||||
* of the stack (depending on the mode).
|
||||
*/
|
||||
void wlr_xwayland_surface_restack(struct wlr_xwayland_surface *surface,
|
||||
struct wlr_xwayland_surface *sibling, enum xcb_stack_mode_t mode);
|
||||
|
||||
void wlr_xwayland_surface_configure(struct wlr_xwayland_surface *surface,
|
||||
int16_t x, int16_t y, uint16_t width, uint16_t height);
|
||||
|
||||
void wlr_xwayland_surface_close(struct wlr_xwayland_surface *surface);
|
||||
|
||||
void wlr_xwayland_surface_set_minimized(struct wlr_xwayland_surface *surface,
|
||||
bool minimized);
|
||||
|
||||
void wlr_xwayland_surface_set_maximized(struct wlr_xwayland_surface *surface,
|
||||
bool maximized);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue