mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-20 06:59:42 -05:00
Merge branch 'master' into xwayland-dnd
This commit is contained in:
commit
6710de9878
40 changed files with 991 additions and 258 deletions
|
|
@ -46,6 +46,4 @@ struct wlr_egl *wlr_backend_get_egl(struct wlr_backend *backend);
|
|||
*/
|
||||
struct wlr_renderer *wlr_backend_get_renderer(struct wlr_backend *backend);
|
||||
|
||||
uint32_t usec_to_msec(uint64_t usec);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@
|
|||
#include <wayland-server.h>
|
||||
#include <wlr/render/wlr_renderer.h>
|
||||
|
||||
struct wlr_surface;
|
||||
|
||||
struct wlr_compositor {
|
||||
struct wl_global *wl_global;
|
||||
struct wl_list wl_resources;
|
||||
|
|
@ -22,4 +24,8 @@ void wlr_compositor_destroy(struct wlr_compositor *wlr_compositor);
|
|||
struct wlr_compositor *wlr_compositor_create(struct wl_display *display,
|
||||
struct wlr_renderer *renderer);
|
||||
|
||||
bool wlr_surface_is_subsurface(struct wlr_surface *surface);
|
||||
|
||||
struct wlr_subsurface *wlr_subsurface_from_surface(struct wlr_surface *surface);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -54,6 +54,8 @@ struct wlr_cursor {
|
|||
struct wl_signal tablet_tool_tip;
|
||||
struct wl_signal tablet_tool_button;
|
||||
} events;
|
||||
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct wlr_cursor *wlr_cursor_create();
|
||||
|
|
|
|||
25
include/wlr/types/wlr_input_inhibitor.h
Normal file
25
include/wlr/types/wlr_input_inhibitor.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef WLR_TYPES_INPUT_INHIBITOR_H
|
||||
#define WLR_TYPES_INPUT_INHIBITOR_H
|
||||
#include <wayland-server.h>
|
||||
|
||||
struct wlr_input_inhibit_manager {
|
||||
struct wl_global *wl_global;
|
||||
struct wl_client *active_client;
|
||||
struct wl_resource *active_inhibitor;
|
||||
|
||||
struct wl_listener display_destroy;
|
||||
|
||||
struct {
|
||||
struct wl_signal activate; // struct wlr_input_inhibit_manager *
|
||||
struct wl_signal deactivate; // struct wlr_input_inhibit_manager *
|
||||
} events;
|
||||
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct wlr_input_inhibit_manager *wlr_input_inhibit_manager_create(
|
||||
struct wl_display *display);
|
||||
void wlr_input_inhibit_manager_destroy(
|
||||
struct wlr_input_inhibit_manager *manager);
|
||||
|
||||
#endif
|
||||
|
|
@ -112,8 +112,15 @@ struct wlr_surface;
|
|||
void wlr_output_enable(struct wlr_output *output, bool enable);
|
||||
void wlr_output_create_global(struct wlr_output *output);
|
||||
void wlr_output_destroy_global(struct wlr_output *output);
|
||||
/**
|
||||
* Sets the output mode.
|
||||
*/
|
||||
bool wlr_output_set_mode(struct wlr_output *output,
|
||||
struct wlr_output_mode *mode);
|
||||
/**
|
||||
* Sets a custom mode on the output. If modes are available, they are preferred.
|
||||
* Setting `refresh` to zero lets the backend pick a preferred value.
|
||||
*/
|
||||
bool wlr_output_set_custom_mode(struct wlr_output *output, int32_t width,
|
||||
int32_t height, int32_t refresh);
|
||||
void wlr_output_set_transform(struct wlr_output *output,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ struct wlr_output_layout {
|
|||
struct wl_signal change;
|
||||
struct wl_signal destroy;
|
||||
} events;
|
||||
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct wlr_output_layout_output_state;
|
||||
|
|
@ -32,6 +34,11 @@ struct wlr_output_layout_output {
|
|||
} events;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a wlr_output_layout, which can be used to describing outputs in
|
||||
* physical space relative to one another, and perform various useful operations
|
||||
* on that state.
|
||||
*/
|
||||
struct wlr_output_layout *wlr_output_layout_create();
|
||||
|
||||
void wlr_output_layout_destroy(struct wlr_output_layout *layout);
|
||||
|
|
|
|||
|
|
@ -537,6 +537,7 @@ bool wlr_seat_touch_has_grab(struct wlr_seat *seat);
|
|||
*/
|
||||
bool wlr_seat_validate_grab_serial(struct wlr_seat *seat, uint32_t serial);
|
||||
|
||||
struct wlr_seat_client *wlr_seat_client_from_resource(struct wl_resource *resource);
|
||||
struct wlr_seat_client *wlr_seat_client_from_resource(
|
||||
struct wl_resource *resource);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -122,20 +122,24 @@ void wlr_surface_make_subsurface(struct wlr_surface *surface,
|
|||
struct wlr_surface *parent, uint32_t id);
|
||||
|
||||
/**
|
||||
* Get the top of the subsurface tree for this surface.
|
||||
* Get the root of the subsurface tree for this surface.
|
||||
*/
|
||||
struct wlr_surface *wlr_surface_get_main_surface(struct wlr_surface *surface);
|
||||
struct wlr_surface *wlr_surface_get_root_surface(struct wlr_surface *surface);
|
||||
|
||||
/**
|
||||
* Find a subsurface within this surface at the surface-local coordinates.
|
||||
* Returns the surface and coordinates in the topmost surface coordinate system
|
||||
* or NULL if no subsurface is found at that location.
|
||||
* Check if the surface accepts input events at the given surface-local
|
||||
* coordinates. Does not check the surface's subsurfaces.
|
||||
*/
|
||||
struct wlr_subsurface *wlr_surface_subsurface_at(struct wlr_surface *surface,
|
||||
double sx, double sy, double *sub_x, double *sub_y);
|
||||
bool wlr_surface_point_accepts_input(struct wlr_surface *surface,
|
||||
double sx, double sy);
|
||||
|
||||
bool wlr_surface_point_accepts_input(
|
||||
struct wlr_surface *surface, double sx, double sy);
|
||||
/**
|
||||
* Find a surface in this surface's tree that accepts input events 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_surface_surface_at(struct wlr_surface *surface,
|
||||
double sx, double sy, double *sub_x, double *sub_y);
|
||||
|
||||
void wlr_surface_send_enter(struct wlr_surface *surface,
|
||||
struct wlr_output *output);
|
||||
|
|
|
|||
|
|
@ -142,13 +142,13 @@ void wlr_wl_shell_surface_configure(struct wlr_wl_shell_surface *surface,
|
|||
enum wl_shell_surface_resize edges, int32_t width, int32_t height);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* Find a surface within this wl-shell 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_wl_shell_surface *wlr_wl_shell_surface_popup_at(
|
||||
struct wlr_surface *wlr_wl_shell_surface_surface_at(
|
||||
struct wlr_wl_shell_surface *surface, double sx, double sy,
|
||||
double *popup_sx, double *popup_sy);
|
||||
double *sub_sx, double *sub_sy);
|
||||
|
||||
bool wlr_surface_is_wl_shell_surface(struct wlr_surface *surface);
|
||||
|
||||
|
|
|
|||
32
include/wlr/types/wlr_xdg_output.h
Normal file
32
include/wlr/types/wlr_xdg_output.h
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#ifndef WLR_TYPES_WLR_XDG_OUTPUT_H
|
||||
#define WLR_TYPES_WLR_XDG_OUTPUT_H
|
||||
#include <wayland-server.h>
|
||||
#include <wlr/types/wlr_output_layout.h>
|
||||
|
||||
struct wlr_xdg_output {
|
||||
struct wl_list link;
|
||||
struct wl_list resources;
|
||||
|
||||
struct wlr_xdg_output_manager *manager;
|
||||
struct wlr_output_layout_output *layout_output;
|
||||
|
||||
struct wl_listener destroy;
|
||||
};
|
||||
|
||||
struct wlr_xdg_output_manager {
|
||||
struct wl_global *global;
|
||||
|
||||
struct wlr_output_layout *layout;
|
||||
|
||||
struct wl_list outputs;
|
||||
|
||||
struct wl_listener layout_add;
|
||||
struct wl_listener layout_change;
|
||||
struct wl_listener layout_destroy;
|
||||
};
|
||||
|
||||
struct wlr_xdg_output_manager *wlr_xdg_output_manager_create(
|
||||
struct wl_display *display, struct wlr_output_layout *layout);
|
||||
void wlr_xdg_output_manager_destroy(struct wlr_xdg_output_manager *manager);
|
||||
|
||||
#endif
|
||||
|
|
@ -215,19 +215,19 @@ uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_surface *surface,
|
|||
void wlr_xdg_surface_send_close(struct wlr_xdg_surface *surface);
|
||||
|
||||
/**
|
||||
* Compute the popup position in surface-local coordinates.
|
||||
* Compute the popup position in its parent's surface-local coordinate system.
|
||||
*/
|
||||
void wlr_xdg_surface_popup_get_position(struct wlr_xdg_surface *surface,
|
||||
double *popup_sx, double *popup_sy);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* 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_xdg_surface *wlr_xdg_surface_popup_at(
|
||||
struct wlr_surface *wlr_xdg_surface_surface_at(
|
||||
struct wlr_xdg_surface *surface, double sx, double sy,
|
||||
double *popup_sx, double *popup_sy);
|
||||
double *sub_x, double *sub_y);
|
||||
|
||||
bool wlr_surface_is_xdg_surface(struct wlr_surface *surface);
|
||||
|
||||
|
|
|
|||
|
|
@ -233,19 +233,19 @@ uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface,
|
|||
void wlr_xdg_surface_v6_send_close(struct wlr_xdg_surface_v6 *surface);
|
||||
|
||||
/**
|
||||
* Compute the popup position in surface-local coordinates.
|
||||
* Compute the popup position in its parent's surface-local coordinate system.
|
||||
*/
|
||||
void wlr_xdg_surface_v6_popup_get_position(struct wlr_xdg_surface_v6 *surface,
|
||||
double *popup_sx, double *popup_sy);
|
||||
|
||||
/**
|
||||
* 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.
|
||||
* 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_xdg_surface_v6 *wlr_xdg_surface_v6_popup_at(
|
||||
struct wlr_surface *wlr_xdg_surface_v6_surface_at(
|
||||
struct wlr_xdg_surface_v6 *surface, double sx, double sy,
|
||||
double *popup_sx, double *popup_sy);
|
||||
double *sub_x, double *sub_y);
|
||||
|
||||
/**
|
||||
* Get the geometry for this positioner based on the anchor rect, gravity, and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue