mirror of
https://cagebreak.project-repo.co/cagebreak.git
synced 2026-08-09 07:09:11 +02:00
This is a major release and includes BREAKING changes! Breaking Changes: * More intuitive switch of focus, next, prev and exchange (#20, 40 in Bugs.md) Cagebreak will probably still feel broadly the same though. * Remove -r flag - This is replaced by output configuration. * Socket disabled by default - The socket is enabled by invoking Cagebreak with the -e flag. * Socket permissions restricted to the user of the Cagebreak process (700) This may require modification of scripts interacting with the socket with different UIDs than the UID of the Cagebreak process. * Rename "Current frame" indicator to "Current tile" Changelog: * Move to wlr_scene * Add events displaying change over the socket * this enables scripting tools * Add support for scaling outputs (thanks to Oliver Friedmann) * Remove -r flag * Add rotation to output configuration * Add cursor enable|disable flag * Add input keyboard configuration * Custom path flag for configuration file * Restrict socket permissions to the user running cagebreak (700) * Fix Issue #31 (resolve some terminology) 38 in Bugs.md * Fix Issue #30 - 39 in Bugs.md * Fix Issue #20 - 40 in Bugs.md * Fix Issue #12 - 41 in Bugs.md (dump + events over socket) * Fix Bugs found via scan-build static analysis (42 - 45 in Bugs.md) * Fix Issue #33 - 46 in Bugs.md * Fix Issue #32 - 47 in Bugs.md * Fix Issue #16 - 48 in Bugs.md * Fix Issue #3 - 49 in Bugs.md (disabling keybinding interpretation for specific keyboards is now possible) * Fix Issue #26 - 50 in Bugs.md * Fix Issue #7 - 51 in Bugs.md (Change cursor to square while Cagebreak is waiting for a key) * Fix config bug for some commands - 52 in Bugs.md * Fix Issue #35 - 53 in Bugs.md (update to wlroots 0.16.1) * Improve FAQ.md (related to some Issues) * Disable outputs when unable to set any mode (crashed previously) * Add Code of Conduct * Print version number on startup
117 lines
2.6 KiB
C
117 lines
2.6 KiB
C
// Copyright 2020 - 2023, project-repo and the cagebreak contributors
|
|
// SPDX -License-Identifier: MIT
|
|
|
|
#ifndef CG_SEAT_H
|
|
#define CG_SEAT_H
|
|
|
|
#include <wayland-server-core.h>
|
|
|
|
struct cg_server;
|
|
struct cg_view;
|
|
struct wlr_cursor;
|
|
struct wlr_input_device;
|
|
struct cg_input_device;
|
|
struct wlr_seat;
|
|
struct wlr_xcursor_manager;
|
|
struct wlr_backend;
|
|
struct wlr_surface;
|
|
struct cg_input_config;
|
|
|
|
#define DEFAULT_XCURSOR "left_ptr"
|
|
#define XCURSOR_SIZE 24
|
|
|
|
struct cg_seat {
|
|
struct wlr_seat *seat;
|
|
struct cg_server *server;
|
|
struct wl_listener destroy;
|
|
|
|
struct wl_list keyboard_groups;
|
|
|
|
uint16_t num_keyboards;
|
|
uint16_t num_pointers;
|
|
uint16_t num_touch;
|
|
|
|
bool enable_cursor;
|
|
struct wlr_cursor *cursor;
|
|
struct cg_tile *cursor_tile;
|
|
struct wlr_xcursor_manager *xcursor_manager;
|
|
struct wl_listener cursor_motion;
|
|
struct wl_listener cursor_motion_absolute;
|
|
struct wl_listener cursor_button;
|
|
struct wl_listener cursor_axis;
|
|
struct wl_listener cursor_frame;
|
|
|
|
int32_t touch_id;
|
|
double touch_lx;
|
|
double touch_ly;
|
|
struct wl_listener touch_down;
|
|
struct wl_listener touch_up;
|
|
struct wl_listener touch_motion;
|
|
|
|
struct wl_list drag_icons;
|
|
struct wl_listener request_start_drag;
|
|
struct wl_listener start_drag;
|
|
|
|
struct wl_listener request_set_cursor;
|
|
struct wl_listener request_set_selection;
|
|
struct wl_listener request_set_primary_selection;
|
|
|
|
uint16_t mode;
|
|
uint16_t default_mode;
|
|
|
|
struct wl_shm *shm; // Shared memory
|
|
|
|
struct cg_view *focused_view;
|
|
};
|
|
|
|
struct cg_keyboard_group {
|
|
struct wlr_keyboard_group *wlr_group;
|
|
struct cg_seat *seat;
|
|
char *identifier;
|
|
int enable_keybindings;
|
|
|
|
struct wl_listener key;
|
|
struct wl_listener modifiers;
|
|
struct wl_list link;
|
|
|
|
struct wl_event_source *key_repeat_timer;
|
|
struct keybinding **repeat_keybinding;
|
|
};
|
|
|
|
struct cg_pointer {
|
|
struct wl_list link; // seat::pointers
|
|
struct cg_seat *seat;
|
|
struct cg_input_device *device;
|
|
};
|
|
|
|
struct cg_touch {
|
|
struct wl_list link; // seat::touch
|
|
struct cg_seat *seat;
|
|
struct cg_input_device *device;
|
|
};
|
|
|
|
struct cg_drag_icon {
|
|
struct wl_list link; // seat::drag_icons
|
|
struct cg_seat *seat;
|
|
struct wlr_drag_icon *wlr_drag_icon;
|
|
struct wlr_scene_tree *scene_tree;
|
|
|
|
/* The drag icon has a position in layout coordinates. */
|
|
double lx, ly;
|
|
|
|
struct wl_listener destroy;
|
|
};
|
|
|
|
struct cg_seat *
|
|
seat_create(struct cg_server *server, struct wlr_backend *backend);
|
|
void
|
|
seat_destroy(struct cg_seat *seat);
|
|
struct cg_view *
|
|
seat_get_focus(const struct cg_seat *seat);
|
|
void
|
|
seat_set_focus(struct cg_seat *seat, struct cg_view *view);
|
|
void
|
|
seat_add_device(struct cg_seat *seat, struct cg_input_device *device);
|
|
void
|
|
seat_remove_device(struct cg_seat *seat, struct cg_input_device *device);
|
|
#endif
|