diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/backend/noop.h | 24 | ||||
-rw-r--r-- | include/backend/wayland.h | 6 | ||||
-rw-r--r-- | include/wlr/backend/meson.build | 1 | ||||
-rw-r--r-- | include/wlr/backend/noop.h | 31 | ||||
-rw-r--r-- | include/wlr/backend/wayland.h | 10 | ||||
-rw-r--r-- | include/wlr/types/meson.build | 1 | ||||
-rw-r--r-- | include/wlr/types/wlr_data_control_v1.h | 48 | ||||
-rw-r--r-- | include/wlr/types/wlr_relative_pointer_v1.h | 18 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell.h | 9 |
9 files changed, 129 insertions, 19 deletions
diff --git a/include/backend/noop.h b/include/backend/noop.h new file mode 100644 index 00000000..4198baad --- /dev/null +++ b/include/backend/noop.h @@ -0,0 +1,24 @@ +#ifndef BACKEND_NOOP_H +#define BACKEND_NOOP_H + +#include <wlr/backend/noop.h> +#include <wlr/backend/interface.h> + +struct wlr_noop_backend { + struct wlr_backend backend; + struct wl_display *display; + struct wl_list outputs; + bool started; +}; + +struct wlr_noop_output { + struct wlr_output wlr_output; + + struct wlr_noop_backend *backend; + struct wl_list link; +}; + +struct wlr_noop_backend *noop_backend_from_backend( + struct wlr_backend *wlr_backend); + +#endif diff --git a/include/backend/wayland.h b/include/backend/wayland.h index dbc309ca..c41d560a 100644 --- a/include/backend/wayland.h +++ b/include/backend/wayland.h @@ -30,7 +30,7 @@ struct wlr_wl_backend { struct wl_event_source *remote_display_src; struct wl_registry *registry; struct wl_compositor *compositor; - struct zxdg_shell_v6 *shell; + struct xdg_wm_base *xdg_wm_base; struct wl_shm *shm; struct wl_seat *seat; struct wl_pointer *pointer; @@ -47,8 +47,8 @@ struct wlr_wl_output { struct wl_surface *surface; struct wl_callback *frame_callback; - struct zxdg_surface_v6 *xdg_surface; - struct zxdg_toplevel_v6 *xdg_toplevel; + struct xdg_surface *xdg_surface; + struct xdg_toplevel *xdg_toplevel; struct wl_egl_window *egl_window; EGLSurface egl_surface; diff --git a/include/wlr/backend/meson.build b/include/wlr/backend/meson.build index 3d6f0e40..47de62d2 100644 --- a/include/wlr/backend/meson.build +++ b/include/wlr/backend/meson.build @@ -4,6 +4,7 @@ install_headers( 'interface.h', 'libinput.h', 'multi.h', + 'noop.h', 'session.h', 'wayland.h', subdir: 'wlr/backend', diff --git a/include/wlr/backend/noop.h b/include/wlr/backend/noop.h new file mode 100644 index 00000000..592b8f35 --- /dev/null +++ b/include/wlr/backend/noop.h @@ -0,0 +1,31 @@ +/* + * 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_BACKEND_NOOP_H +#define WLR_BACKEND_NOOP_H + +#include <wlr/backend.h> +#include <wlr/types/wlr_output.h> + +/** + * Creates a noop backend. Noop backends do not have a framebuffer and are not + * capable of rendering anything. They are useful for when there's no real + * outputs connected; you can stash your views on a noop output until an output + * is connected. + */ +struct wlr_backend *wlr_noop_backend_create(struct wl_display *display); + +/** + * Create a new noop output. + */ +struct wlr_output *wlr_noop_add_output(struct wlr_backend *backend); + +bool wlr_backend_is_noop(struct wlr_backend *backend); +bool wlr_output_is_noop(struct wlr_output *output); + +#endif diff --git a/include/wlr/backend/wayland.h b/include/wlr/backend/wayland.h index 119ea247..9a47d1ce 100644 --- a/include/wlr/backend/wayland.h +++ b/include/wlr/backend/wayland.h @@ -1,6 +1,5 @@ #ifndef WLR_BACKEND_WAYLAND_H #define WLR_BACKEND_WAYLAND_H - #include <stdbool.h> #include <wayland-client.h> #include <wayland-server.h> @@ -16,8 +15,8 @@ * to NULL for the default behaviour (WAYLAND_DISPLAY env variable or wayland-0 * default) */ -struct wlr_backend *wlr_wl_backend_create(struct wl_display *display, const char *remote, - wlr_renderer_create_func_t create_renderer_func); +struct wlr_backend *wlr_wl_backend_create(struct wl_display *display, + const char *remote, wlr_renderer_create_func_t create_renderer_func); /** * Adds a new output to this backend. You may remove outputs by destroying them. @@ -42,4 +41,9 @@ bool wlr_input_device_is_wl(struct wlr_input_device *device); */ bool wlr_output_is_wl(struct wlr_output *output); +/** + * Sets the title of a wlr_output which is a Wayland window. + */ +void wlr_wl_output_set_title(struct wlr_output *output, const char *title); + #endif diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build index f9075bea..86f128b6 100644 --- a/include/wlr/types/meson.build +++ b/include/wlr/types/meson.build @@ -3,6 +3,7 @@ install_headers( 'wlr_buffer.h', 'wlr_compositor.h', 'wlr_cursor.h', + 'wlr_data_control_v1.h', 'wlr_data_device.h', 'wlr_export_dmabuf_v1.h', 'wlr_foreign_toplevel_management_v1.h', diff --git a/include/wlr/types/wlr_data_control_v1.h b/include/wlr/types/wlr_data_control_v1.h new file mode 100644 index 00000000..50c96736 --- /dev/null +++ b/include/wlr/types/wlr_data_control_v1.h @@ -0,0 +1,48 @@ +/* + * 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_DATA_CONTROL_V1_H +#define WLR_TYPES_WLR_DATA_CONTROL_V1_H + +#include <wayland-server.h> +#include <wlr/types/wlr_seat.h> + +struct wlr_data_control_manager_v1 { + struct wl_global *global; + struct wl_list resources; // wl_resource_get_link + struct wl_list devices; // wlr_data_control_device_v1::link + + struct { + struct wl_signal destroy; + struct wl_signal new_device; // wlr_data_control_device_v1 + } events; + + struct wl_listener display_destroy; +}; + +struct wlr_data_control_device_v1 { + struct wl_resource *resource; + struct wlr_data_control_manager_v1 *manager; + struct wl_list link; // wlr_data_control_manager_v1::devices + + struct wlr_seat *seat; + struct wl_resource *selection_offer_resource; // current selection offer + + struct wl_listener seat_destroy; + struct wl_listener seat_selection; +}; + +struct wlr_data_control_manager_v1 *wlr_data_control_manager_v1_create( + struct wl_display *display); +void wlr_data_control_manager_v1_destroy( + struct wlr_data_control_manager_v1 *manager); + +void wlr_data_control_device_v1_destroy( + struct wlr_data_control_device_v1 *device); + +#endif diff --git a/include/wlr/types/wlr_relative_pointer_v1.h b/include/wlr/types/wlr_relative_pointer_v1.h index f9f91219..076fac56 100644 --- a/include/wlr/types/wlr_relative_pointer_v1.h +++ b/include/wlr/types/wlr_relative_pointer_v1.h @@ -11,19 +11,16 @@ #include <wayland-server.h> - /** * This protocol specifies a set of interfaces used for making clients able to * receive relative pointer events not obstructed by barriers (such as the * monitor edge or pointer constraints). */ - /** * A global interface used for getting the relative pointer object for a given * pointer. */ - struct wlr_relative_pointer_manager_v1 { struct wl_global *global; struct wl_list resources; // wl_resource_get_link() @@ -31,7 +28,7 @@ struct wlr_relative_pointer_manager_v1 { struct { struct wl_signal destroy; - struct wl_signal new_relative_pointer; //wlr_relative_pointer_v1 + struct wl_signal new_relative_pointer; // wlr_relative_pointer_v1 } events; struct wl_listener display_destroy_listener; @@ -39,17 +36,15 @@ struct wlr_relative_pointer_manager_v1 { void *data; }; - /** * A wp_relative_pointer object is an extension to the wl_pointer interface * used for emitting relative pointer events. It shares the same focus as * wl_pointer objects of the same seat and will only emit events when it has * focus. */ - struct wlr_relative_pointer_v1 { struct wl_resource *resource; - struct wl_resource *pointer; + struct wl_resource *pointer_resource; struct wlr_seat *seat; struct wl_list link; // wlr_relative_pointer_manager_v1::relative_pointers @@ -66,14 +61,15 @@ struct wlr_relative_pointer_v1 { struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_manager_v1_create( struct wl_display *display); void wlr_relative_pointer_manager_v1_destroy( - struct wlr_relative_pointer_manager_v1 *relative_pointer_manager); + struct wlr_relative_pointer_manager_v1 *manager); /** * Send a relative motion event to the seat with the same wl_pointer as relative_pointer */ -void wlr_relative_pointer_v1_send_relative_motion( - struct wlr_relative_pointer_v1 *relative_pointer, uint64_t time_msec, - double dx, double dy, double dx_unaccel, double dy_unaccel); +void wlr_relative_pointer_manager_v1_send_relative_motion( + struct wlr_relative_pointer_manager_v1 *manager, struct wlr_seat *seat, + uint64_t time_msec, double dx, double dy, + double dx_unaccel, double dy_unaccel); struct wlr_relative_pointer_v1 *wlr_relative_pointer_v1_from_resource( struct wl_resource *resource); diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index 1bca9ef3..14100fda 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -296,9 +296,14 @@ uint32_t wlr_xdg_toplevel_set_tiled(struct wlr_xdg_surface *surface, uint32_t tiled_edges); /** - * Request that this xdg surface closes. + * Request that this xdg toplevel closes. */ -void wlr_xdg_surface_send_close(struct wlr_xdg_surface *surface); +void wlr_xdg_toplevel_send_close(struct wlr_xdg_surface *surface); + +/** + * Request that this xdg popup closes. + **/ +void wlr_xdg_popup_destroy(struct wlr_xdg_surface *surface); /** * Get the geometry for this positioner based on the anchor rect, gravity, and |