swayfx/include/sway/input/input-manager.h

65 lines
1.7 KiB
C
Raw Normal View History

2017-12-16 08:33:22 -05:00
#ifndef _SWAY_INPUT_INPUT_MANAGER_H
#define _SWAY_INPUT_INPUT_MANAGER_H
2017-12-06 08:28:46 -05:00
#include <libinput.h>
2018-04-03 16:16:42 -04:00
#include <wlr/types/wlr_input_inhibitor.h>
2017-12-06 08:28:46 -05:00
#include "sway/server.h"
2017-12-08 08:07:47 -05:00
#include "sway/config.h"
2017-12-06 08:28:46 -05:00
#include "list.h"
2017-12-12 08:29:37 -05:00
/**
* 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 wl_list link;
2018-02-14 14:42:06 -05:00
struct wl_listener device_destroy;
2017-12-12 08:29:37 -05:00
};
2017-12-07 07:31:49 -05:00
struct sway_input_manager {
2017-12-07 09:58:32 -05:00
struct sway_server *server;
2017-12-12 08:29:37 -05:00
struct wl_list devices;
struct wl_list seats;
2018-04-03 16:16:42 -04:00
struct wlr_input_inhibit_manager *inhibit;
struct wl_listener new_input;
2018-04-03 16:16:42 -04:00
struct wl_listener inhibit_activate;
struct wl_listener inhibit_deactivate;
2017-12-06 08:28:46 -05:00
};
2018-04-02 08:49:38 -04:00
struct sway_input_manager *input_manager_create(struct sway_server *server);
2017-12-06 08:28:46 -05:00
2018-04-02 08:49:38 -04:00
bool input_manager_has_focus(struct sway_input_manager *input,
struct sway_container *container);
2017-12-10 11:11:47 -05:00
2018-04-02 08:49:38 -04:00
void input_manager_set_focus(struct sway_input_manager *input,
struct sway_container *container);
2017-12-12 08:29:37 -05:00
2018-04-02 08:49:38 -04:00
void input_manager_configure_xcursor(struct sway_input_manager *input);
2017-12-12 08:29:37 -05:00
2018-04-02 08:49:38 -04:00
void input_manager_apply_input_config(struct sway_input_manager *input,
2017-12-14 11:11:56 -05:00
struct input_config *input_config);
2018-04-02 08:49:38 -04:00
void input_manager_apply_seat_config(struct sway_input_manager *input,
2017-12-14 11:11:56 -05:00
struct seat_config *seat_config);
2017-12-12 08:29:37 -05:00
2018-04-02 08:49:38 -04:00
struct sway_seat *input_manager_get_default_seat(
2018-01-20 14:10:11 -05:00
struct sway_input_manager *input);
struct sway_seat *input_manager_get_seat(struct sway_input_manager *input,
const char *seat_name);
2018-01-30 23:09:21 -05:00
2018-04-02 13:19:58 -04:00
/**
* Gets the last seat the user interacted with
*/
2018-01-30 23:09:21 -05:00
struct sway_seat *input_manager_current_seat(struct sway_input_manager *input);
2018-04-02 13:19:58 -04:00
struct input_config *input_device_get_config(struct sway_input_device *device);
2017-12-06 08:28:46 -05:00
#endif