aboutsummaryrefslogtreecommitdiff
path: root/include/sway/input/input-manager.h
blob: 7d7c463f3d597f49d3775e4c69aa7d8e39c7fff6 (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
#ifndef _SWAY_INPUT_MANAGER_H
#define _SWAY_INPUT_MANAGER_H
#include <libinput.h>
#include "sway/server.h"
#include "sway/config.h"
#include "list.h"

extern struct input_config *current_input_config;

/**
 * The global singleton input manager
 * TODO: make me not a global
 */
extern struct sway_input_manager *input_manager;

struct sway_input_device {
	char *identifier;
	struct wlr_input_device *wlr_device;
	struct input_config *config;
	struct sway_keyboard *keyboard; // managed by the seat
	struct wl_list link;
};

struct sway_input_manager {
	struct wl_listener input_add;
	struct wl_listener input_remove;
	struct sway_server *server;
	struct wl_list devices;
	struct wl_list seats;
};

struct sway_input_manager *sway_input_manager_create(
		struct sway_server *server);

bool sway_input_manager_has_focus(struct sway_input_manager *input,
		swayc_t *container);

void sway_input_manager_set_focus(struct sway_input_manager *input,
		swayc_t *container);

void sway_input_manager_configure_xcursor(struct sway_input_manager *input);

void sway_input_manager_apply_config(struct sway_input_manager *input,
		struct input_config *config);

#endif