diff options
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/backend/session.h | 2 | ||||
-rw-r--r-- | include/wlr/types/wlr_cursor.h | 16 | ||||
-rw-r--r-- | include/wlr/types/wlr_data_device.h | 5 | ||||
-rw-r--r-- | include/wlr/types/wlr_keyboard.h | 3 | ||||
-rw-r--r-- | include/wlr/types/wlr_output.h | 6 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 15 | ||||
-rw-r--r-- | include/wlr/types/wlr_surface.h | 9 | ||||
-rw-r--r-- | include/wlr/types/wlr_wl_shell.h | 6 | ||||
-rw-r--r-- | include/wlr/types/wlr_xcursor_manager.h | 53 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell_v6.h | 14 | ||||
-rw-r--r-- | include/wlr/xcursor.h | 2 | ||||
-rw-r--r-- | include/wlr/xwayland.h | 1 |
12 files changed, 110 insertions, 22 deletions
diff --git a/include/wlr/backend/session.h b/include/wlr/backend/session.h index 94002bc5..5c822ea9 100644 --- a/include/wlr/backend/session.h +++ b/include/wlr/backend/session.h @@ -79,6 +79,6 @@ void wlr_session_signal_add(struct wlr_session *session, int fd, 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[static ret_len]); + size_t ret_len, int *ret); #endif diff --git a/include/wlr/types/wlr_cursor.h b/include/wlr/types/wlr_cursor.h index 1aac2b94..0db32eb2 100644 --- a/include/wlr/types/wlr_cursor.h +++ b/include/wlr/types/wlr_cursor.h @@ -6,7 +6,6 @@ #include <wlr/types/wlr_output_layout.h> #include <wlr/types/wlr_input_device.h> #include <wlr/types/wlr_box.h> -#include <wlr/xcursor.h> struct wlr_cursor_state; @@ -60,9 +59,22 @@ void wlr_cursor_warp_absolute(struct wlr_cursor *cur, void wlr_cursor_move(struct wlr_cursor *cur, struct wlr_input_device *dev, double delta_x, double delta_y); +/** + * Set the cursor image. stride is given in bytes. If pixels is NULL, hides the + * cursor. + * + * If scale isn't zero, the image is only set on outputs having the provided + * scale. + */ void wlr_cursor_set_image(struct wlr_cursor *cur, const uint8_t *pixels, int32_t stride, uint32_t width, uint32_t height, int32_t hotspot_x, - int32_t hotspot_y); + int32_t hotspot_y, uint32_t scale); + +/** + * Set the cursor surface. The surface can be committed to update the cursor + * image. The surface position is substracted from the hotspot. A NULL surface + * commit hides the cursor. + */ void wlr_cursor_set_surface(struct wlr_cursor *cur, struct wlr_surface *surface, int32_t hotspot_x, int32_t hotspot_y); diff --git a/include/wlr/types/wlr_data_device.h b/include/wlr/types/wlr_data_device.h index 691e2df8..f45c15a2 100644 --- a/include/wlr/types/wlr_data_device.h +++ b/include/wlr/types/wlr_data_device.h @@ -75,6 +75,11 @@ struct wlr_data_device_manager *wlr_data_device_manager_create( struct wl_display *display); /** + * Destroys a wlr_data_device_manager and removes its wl_data_device_manager global. + */ +void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager); + +/** * Creates a new wl_data_offer if there is a wl_data_source currently set as * the seat selection and sends it to the seat client, followed by the * wl_data_device.selection() event. If there is no current selection, the diff --git a/include/wlr/types/wlr_keyboard.h b/include/wlr/types/wlr_keyboard.h index af837ff5..e2d50b03 100644 --- a/include/wlr/types/wlr_keyboard.h +++ b/include/wlr/types/wlr_keyboard.h @@ -28,6 +28,8 @@ enum wlr_keyboard_modifier { WLR_MODIFIER_MOD5 = 128, }; +#define WLR_KEYBOARD_KEYS_CAP 32 + struct wlr_keyboard_impl; struct wlr_keyboard { @@ -41,6 +43,7 @@ struct wlr_keyboard { xkb_led_index_t led_indexes[WLR_LED_COUNT]; xkb_mod_index_t mod_indexes[WLR_MODIFIER_COUNT]; + uint32_t keycodes[WLR_KEYBOARD_KEYS_CAP]; struct { xkb_mod_mask_t depressed; xkb_mod_mask_t latched; diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index e6323f9c..cf000019 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -14,7 +14,7 @@ struct wlr_output_mode { struct wlr_output_cursor { struct wlr_output *output; - int32_t x, y; + double x, y; bool enabled; uint32_t width, height; int32_t hotspot_x, hotspot_y; @@ -43,6 +43,7 @@ struct wlr_output { char name[16]; char make[48]; char model[16]; + char serial[16]; uint32_t scale; int32_t width, height; int32_t phys_width, phys_height; // mm @@ -95,7 +96,8 @@ bool wlr_output_cursor_set_image(struct wlr_output_cursor *cursor, int32_t hotspot_x, int32_t hotspot_y); void wlr_output_cursor_set_surface(struct wlr_output_cursor *cursor, struct wlr_surface *surface, int32_t hotspot_x, int32_t hotspot_y); -bool wlr_output_cursor_move(struct wlr_output_cursor *cursor, int x, int y); +bool wlr_output_cursor_move(struct wlr_output_cursor *cursor, + double x, double y); void wlr_output_cursor_destroy(struct wlr_output_cursor *cursor); #endif diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index b8b467d2..a5f00402 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -1,6 +1,6 @@ #ifndef WLR_TYPES_WLR_SEAT_H #define WLR_TYPES_WLR_SEAT_H - +#include <time.h> #include <wlr/types/wlr_surface.h> #include <wlr/types/wlr_input_device.h> #include <wlr/types/wlr_keyboard.h> @@ -45,9 +45,7 @@ struct wlr_keyboard_grab_interface { struct wlr_surface *surface); void (*key)(struct wlr_seat_keyboard_grab *grab, uint32_t time, uint32_t key, uint32_t state); - void (*modifiers)(struct wlr_seat_keyboard_grab *grab, - uint32_t mods_depressed, uint32_t mods_latched, - uint32_t mods_locked, uint32_t group); + void (*modifiers)(struct wlr_seat_keyboard_grab *grab); void (*cancel)(struct wlr_seat_keyboard_grab *grab); }; @@ -111,6 +109,7 @@ struct wlr_seat { struct wl_list clients; char *name; uint32_t capabilities; + struct timespec last_event; struct wlr_data_device *data_device; // TODO needed? struct wlr_data_source *selection_source; @@ -296,17 +295,13 @@ void wlr_seat_keyboard_notify_key(struct wlr_seat *seat, uint32_t time, * Send the modifier state to focused keyboard resources. Compositors should use * `wlr_seat_keyboard_notify_modifiers()` to respect any keyboard grabs. */ -void wlr_seat_keyboard_send_modifiers(struct wlr_seat *seat, - uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, - uint32_t group); +void wlr_seat_keyboard_send_modifiers(struct wlr_seat *seat); /** * Notify the seat that the modifiers for the keyboard have changed. Defers to * any keyboard grabs. */ -void wlr_seat_keyboard_notify_modifiers(struct wlr_seat *seat, - uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, - uint32_t group); +void wlr_seat_keyboard_notify_modifiers(struct wlr_seat *seat); /** * Notify the seat that the keyboard focus has changed and request it to be the diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index ea4184aa..cea53109 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -1,10 +1,10 @@ #ifndef WLR_TYPES_WLR_SURFACE_H #define WLR_TYPES_WLR_SURFACE_H - #include <wayland-server.h> #include <pixman.h> #include <stdint.h> #include <stdbool.h> +#include <wlr/types/wlr_output.h> struct wlr_frame_callback { struct wl_resource *resource; @@ -135,4 +135,11 @@ struct wlr_surface *wlr_surface_get_main_surface(struct wlr_surface *surface); */ struct wlr_subsurface *wlr_surface_subsurface_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); + +void wlr_surface_send_leave(struct wlr_surface *surface, + struct wlr_output *output); + #endif diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h index 4e814817..24936a34 100644 --- a/include/wlr/types/wlr_wl_shell.h +++ b/include/wlr/types/wlr_wl_shell.h @@ -42,6 +42,8 @@ struct wlr_wl_shell_popup_grab { enum wlr_wl_shell_surface_state { WLR_WL_SHELL_SURFACE_STATE_NONE, WLR_WL_SHELL_SURFACE_STATE_TOPLEVEL, + WLR_WL_SHELL_SURFACE_STATE_MAXIMIZED, + WLR_WL_SHELL_SURFACE_STATE_FULLSCREEN, WLR_WL_SHELL_SURFACE_STATE_TRANSIENT, WLR_WL_SHELL_SURFACE_STATE_POPUP, }; @@ -93,14 +95,14 @@ struct wlr_wl_shell_surface { struct wlr_wl_shell_surface_move_event { struct wl_client *client; struct wlr_wl_shell_surface *surface; - struct wlr_seat_handle *seat_handle; + struct wlr_seat_client *seat; uint32_t serial; }; struct wlr_wl_shell_surface_resize_event { struct wl_client *client; struct wlr_wl_shell_surface *surface; - struct wlr_seat_handle *seat_handle; + struct wlr_seat_client *seat; uint32_t serial; enum wl_shell_surface_resize edges; }; diff --git a/include/wlr/types/wlr_xcursor_manager.h b/include/wlr/types/wlr_xcursor_manager.h new file mode 100644 index 00000000..c78a6e8d --- /dev/null +++ b/include/wlr/types/wlr_xcursor_manager.h @@ -0,0 +1,53 @@ +#ifndef WLR_TYPES_WLR_XCURSOR_MANAGER_H +#define WLR_TYPES_WLR_XCURSOR_MANAGER_H + +#include <wayland-server.h> +#include <wlr/types/wlr_cursor.h> +#include <wlr/xcursor.h> + +/** + * A scaled XCursor theme. + */ +struct wlr_xcursor_manager_theme { + uint32_t scale; + struct wlr_xcursor_theme *theme; + struct wl_list link; +}; + +/** + * Manage multiple XCursor themes with different scales and set `wlr_cursor` + * images. + * + * This manager can be used to display cursor images on multiple outputs having + * different scale factors. + */ +struct wlr_xcursor_manager { + char *name; + uint32_t size; + struct wl_list scaled_themes; // wlr_xcursor_manager_theme::link +}; + +/** + * Create a new XCursor manager. After initialization, scaled themes need to be + * loaded with `wlr_xcursor_manager_load`. `size` is the unscaled cursor theme + * size. + */ +struct wlr_xcursor_manager *wlr_xcursor_manager_create(const char *name, + uint32_t size); + +void wlr_xcursor_manager_destroy(struct wlr_xcursor_manager *manager); + +int wlr_xcursor_manager_load(struct wlr_xcursor_manager *manager, + uint32_t scale); + +struct wlr_xcursor *wlr_xcursor_manager_get_xcursor( + struct wlr_xcursor_manager *manager, const char *name, uint32_t scale); + +/** + * Set a `wlr_cursor` image. The manager uses all currently loaded scaled + * themes. + */ +void wlr_xcursor_manager_set_cursor_image(struct wlr_xcursor_manager *manager, + const char *name, struct wlr_cursor *cursor); + +#endif diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index b0de41e2..e3982003 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -126,6 +126,8 @@ struct wlr_xdg_surface_v6 { struct wl_signal ack_configure; struct wl_signal ping_timeout; + 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; @@ -138,14 +140,14 @@ struct wlr_xdg_surface_v6 { struct wlr_xdg_toplevel_v6_move_event { struct wl_client *client; struct wlr_xdg_surface_v6 *surface; - struct wlr_seat_handle *seat_handle; + struct wlr_seat_client *seat; uint32_t serial; }; struct wlr_xdg_toplevel_v6_resize_event { struct wl_client *client; struct wlr_xdg_surface_v6 *surface; - struct wlr_seat_handle *seat_handle; + struct wlr_seat_client *seat; uint32_t serial; uint32_t edges; }; @@ -153,7 +155,7 @@ struct wlr_xdg_toplevel_v6_resize_event { struct wlr_xdg_toplevel_v6_show_window_menu_event { struct wl_client *client; struct wlr_xdg_surface_v6 *surface; - struct wlr_seat_handle *seat_handle; + struct wlr_seat_client *seat; uint32_t serial; uint32_t x; uint32_t y; @@ -208,6 +210,12 @@ void wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface, void wlr_xdg_toplevel_v6_send_close(struct wlr_xdg_surface_v6 *surface); /** + * 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); + +/** * 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. diff --git a/include/wlr/xcursor.h b/include/wlr/xcursor.h index c12d5405..b6362b06 100644 --- a/include/wlr/xcursor.h +++ b/include/wlr/xcursor.h @@ -61,7 +61,7 @@ struct wlr_xcursor_theme *wlr_xcursor_theme_load(const char *name, int size); void wlr_xcursor_theme_destroy(struct wlr_xcursor_theme *theme); struct wlr_xcursor *wlr_xcursor_theme_get_cursor( - struct wlr_xcursor_theme *theme, const char *name); + struct wlr_xcursor_theme *theme, const char *name); int wlr_xcursor_frame(struct wlr_xcursor *cursor, uint32_t time); diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index bea97394..6518b703 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -29,6 +29,7 @@ struct wlr_xwayland { struct wlr_xwayland_cursor *cursor; struct { + struct wl_signal ready; struct wl_signal new_surface; } events; |