aboutsummaryrefslogtreecommitdiff
path: root/include/rootston/seat.h
blob: a8397d892443a5ee03292cce62691236defef41e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#ifndef _ROOTSTON_SEAT_H
#define _ROOTSTON_SEAT_H
#include <wayland-server.h>
#include "rootston/input.h"
#include "rootston/keyboard.h"

struct roots_drag_icon {
	struct wlr_surface *surface;
	struct wl_list link; // roots_seat::drag_icons
	bool mapped;

	int32_t sx, sy;

	struct wl_listener surface_destroy;
	struct wl_listener surface_commit;
};

struct roots_seat {
	struct roots_input *input;
	struct wlr_seat *seat;
	struct roots_cursor *cursor;
	struct wl_list drag_icons;
	struct wl_list link;

	struct wl_list views; // roots_seat_view::link
	struct roots_seat_view *focus;

	struct wl_list keyboards;
	struct wl_list pointers;
	struct wl_list touch;
	struct wl_list tablet_tools;
};

struct roots_seat_view {
	struct roots_seat *seat;
	struct roots_view *view;
	struct wl_list link; // roots_seat::views

	struct wl_listener destroy;
};

struct roots_pointer {
	struct roots_seat *seat;
	struct wlr_input_device *device;
	struct wl_list link;
};

struct roots_touch {
	struct roots_seat *seat;
	struct wlr_input_device *device;
	struct wl_list link;
};

struct roots_touch_point {
	struct roots_touch *device;
	int32_t slot;
	double x, y;
	struct wl_list link;
};

struct roots_tablet_tool {
	struct roots_seat *seat;
	struct wlr_input_device *device;
	struct wl_listener axis;
	struct wl_listener proximity;
	struct wl_listener tip;
	struct wl_listener button;
	struct wl_list link;
};

struct roots_seat *roots_seat_create(struct roots_input *input, char *name);

void roots_seat_destroy(struct roots_seat *seat);

void roots_seat_add_device(struct roots_seat *seat,
		struct wlr_input_device *device);

void roots_seat_remove_device(struct roots_seat *seat,
		struct wlr_input_device *device);

void roots_seat_add_view(struct roots_seat *seat, struct roots_view *view);

void roots_seat_remove_view(struct roots_seat *seat, struct roots_view *view);

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);

void roots_seat_focus_view(struct roots_seat *seat, struct roots_view *view);

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);

#endif