wlroots-hyprland/include/rootston/seat.h

184 lines
4.4 KiB
C
Raw Normal View History

2018-02-12 21:29:23 +01:00
#ifndef ROOTSTON_SEAT_H
#define ROOTSTON_SEAT_H
#include <wayland-server-core.h>
2017-11-03 14:01:34 +01:00
#include "rootston/input.h"
#include "rootston/keyboard.h"
#include "rootston/layers.h"
#include "rootston/switch.h"
#include "rootston/text_input.h"
2017-11-03 14:01:34 +01:00
struct roots_seat {
struct roots_input *input;
struct wlr_seat *seat;
2017-11-05 15:20:11 +01:00
struct roots_cursor *cursor;
struct wl_list link; // roots_input::seats
2017-11-07 21:56:11 +01:00
2017-11-15 14:34:35 +01:00
// coordinates of the first touch point if it exists
int32_t touch_id;
double touch_x, touch_y;
2017-11-15 12:43:30 +01:00
// If the focused layer is set, views cannot receive keyboard focus
2018-09-14 19:32:33 +02:00
struct wlr_layer_surface_v1 *focused_layer;
struct roots_input_method_relay im_relay;
2018-04-03 18:50:05 +02:00
// If non-null, only this client can receive input events
struct wl_client *exclusive_client;
2017-11-17 12:45:07 +01:00
struct wl_list views; // roots_seat_view::link
2017-11-19 18:15:11 +01:00
bool has_focus;
2017-11-04 18:12:35 +01:00
struct roots_drag_icon *drag_icon; // can be NULL
2017-11-03 14:01:34 +01:00
struct wl_list keyboards;
2017-11-04 18:12:35 +01:00
struct wl_list pointers;
struct wl_list switches;
2017-11-04 18:12:35 +01:00
struct wl_list touch;
2018-06-18 09:30:32 +02:00
struct wl_list tablets;
struct wl_list tablet_pads;
struct wl_listener request_set_selection;
struct wl_listener request_set_primary_selection;
2019-01-30 18:36:19 +01:00
struct wl_listener request_start_drag;
struct wl_listener start_drag;
struct wl_listener destroy;
2017-11-04 18:12:35 +01:00
};
2017-11-17 12:45:07 +01:00
struct roots_seat_view {
struct roots_seat *seat;
struct roots_view *view;
2018-01-17 01:04:26 +01:00
bool has_button_grab;
2018-01-22 00:24:53 +01:00
double grab_sx;
double grab_sy;
2018-01-17 01:04:26 +01:00
2017-11-17 12:45:07 +01:00
struct wl_list link; // roots_seat::views
2018-03-13 12:31:45 +01:00
struct wl_listener view_unmap;
struct wl_listener view_destroy;
2017-11-17 12:45:07 +01:00
};
struct roots_drag_icon {
struct roots_seat *seat;
struct wlr_drag_icon *wlr_drag_icon;
double x, y;
struct wl_listener surface_commit;
2018-06-06 05:01:43 +02:00
struct wl_listener map;
2018-06-06 00:17:42 +02:00
struct wl_listener unmap;
struct wl_listener destroy;
};
2017-11-04 18:12:35 +01:00
struct roots_pointer {
struct roots_seat *seat;
struct wlr_input_device *device;
struct wl_listener device_destroy;
2017-11-04 18:12:35 +01:00
struct wl_list link;
};
struct roots_touch {
struct roots_seat *seat;
struct wlr_input_device *device;
struct wl_listener device_destroy;
2017-11-04 18:12:35 +01:00
struct wl_list link;
};
2018-06-18 09:30:32 +02:00
struct roots_tablet {
2017-11-04 18:12:35 +01:00
struct roots_seat *seat;
struct wlr_input_device *device;
struct wlr_tablet_v2_tablet *tablet_v2;
struct wl_listener device_destroy;
2017-11-04 18:12:35 +01:00
struct wl_listener axis;
struct wl_listener proximity;
struct wl_listener tip;
struct wl_listener button;
2017-11-03 14:01:34 +01:00
struct wl_list link;
};
struct roots_tablet_pad {
struct wl_list link;
struct wlr_tablet_v2_tablet_pad *tablet_v2_pad;
struct roots_seat *seat;
struct wlr_input_device *device;
struct wl_listener device_destroy;
struct wl_listener attach;
struct wl_listener button;
struct wl_listener ring;
struct wl_listener strip;
2018-06-18 09:30:32 +02:00
struct roots_tablet *tablet;
struct wl_listener tablet_destroy;
2017-11-03 14:01:34 +01:00
};
2018-06-18 09:30:32 +02:00
struct roots_tablet_tool {
2018-05-02 09:26:34 +02:00
struct wl_list link;
struct wl_list tool_link;
struct wlr_tablet_v2_tablet_tool *tablet_v2_tool;
struct roots_seat *seat;
double tilt_x, tilt_y;
2018-05-02 09:26:34 +02:00
2018-05-17 09:59:37 +02:00
struct wl_listener set_cursor;
2018-05-02 09:26:34 +02:00
struct wl_listener tool_destroy;
2018-06-18 09:30:32 +02:00
struct roots_tablet *current_tablet;
2018-05-02 09:26:34 +02:00
struct wl_listener tablet_destroy;
};
struct roots_pointer_constraint {
struct wlr_pointer_constraint_v1 *constraint;
struct wl_listener destroy;
};
2017-11-03 14:01:34 +01:00
struct roots_seat *roots_seat_create(struct roots_input *input, char *name);
void roots_seat_destroy(struct roots_seat *seat);
2017-11-04 18:12:35 +01:00
void roots_seat_add_device(struct roots_seat *seat,
struct wlr_input_device *device);
2017-11-03 14:01:34 +01:00
2017-11-07 21:56:11 +01:00
void roots_seat_configure_cursor(struct roots_seat *seat);
void roots_seat_configure_xcursor(struct roots_seat *seat);
bool roots_seat_has_meta_pressed(struct roots_seat *seat);
struct roots_view *roots_seat_get_focus(struct roots_seat *seat);
2017-11-19 18:15:11 +01:00
2017-11-19 19:21:18 +01:00
void roots_seat_set_focus(struct roots_seat *seat, struct roots_view *view);
void roots_seat_set_focus_layer(struct roots_seat *seat,
2018-09-14 19:32:33 +02:00
struct wlr_layer_surface_v1 *layer);
2017-11-19 19:21:18 +01:00
void roots_seat_cycle_focus(struct roots_seat *seat);
2017-11-07 21:56:11 +01:00
void roots_seat_begin_move(struct roots_seat *seat, struct roots_view *view);
void roots_seat_begin_resize(struct roots_seat *seat, struct roots_view *view,
uint32_t edges);
void roots_seat_begin_rotate(struct roots_seat *seat, struct roots_view *view);
2018-02-08 13:13:33 +01:00
void roots_seat_end_compositor_grab(struct roots_seat *seat);
2018-01-17 01:04:26 +01:00
struct roots_seat_view *roots_seat_view_from_view( struct roots_seat *seat,
struct roots_view *view);
void roots_drag_icon_update_position(struct roots_drag_icon *icon);
void roots_drag_icon_damage_whole(struct roots_drag_icon *icon);
2018-01-17 01:04:26 +01:00
2018-04-03 18:50:05 +02:00
void roots_seat_set_exclusive_client(struct roots_seat *seat,
struct wl_client *client);
bool roots_seat_allow_input(struct roots_seat *seat,
struct wl_resource *resource);
2017-11-03 14:01:34 +01:00
#endif