input skeleton

This commit is contained in:
Tony Crisci 2017-12-06 08:28:46 -05:00
parent 3fe64482bb
commit 338a0399f8
4 changed files with 25 additions and 0 deletions

18
include/sway/input.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef _SWAY_INPUT_H
#define _SWAY_INPUT_H
#include <libinput.h>
#include "sway/server.h"
#include "config.h"
#include "list.h"
struct sway_input {
list_t *input_devices;
};
struct input_config *new_input_config(const char* identifier);
char* libinput_dev_unique_id(struct libinput_device *dev);
struct sway_input *sway_input_create(struct sway_server *server);
#endif

View file

@ -29,6 +29,7 @@ xkbcommon = dependency('xkbcommon')
pango = dependency('pango') pango = dependency('pango')
pixman = dependency('pixman-1') pixman = dependency('pixman-1')
libcap = dependency('libcap') libcap = dependency('libcap')
libinput = dependency('libinput')
math = cc.find_library('m') math = cc.find_library('m')
git = find_program('git', required: false) git = find_program('git', required: false)
a2x = find_program('a2x', required: false) a2x = find_program('a2x', required: false)

View file

@ -2,6 +2,7 @@ sway_sources = files(
'main.c', 'main.c',
'server.c', 'server.c',
'commands.c', 'commands.c',
'input/input.c',
'commands/exit.c', 'commands/exit.c',
'commands/exec.c', 'commands/exec.c',
'commands/exec_always.c', 'commands/exec_always.c',
@ -25,6 +26,7 @@ sway_deps = [
wlroots, wlroots,
libcap, libcap,
math, math,
libinput,
] ]
executable( executable(

View file

@ -11,6 +11,7 @@
// TODO WLR: make Xwayland optional // TODO WLR: make Xwayland optional
#include <wlr/xwayland.h> #include <wlr/xwayland.h>
#include "sway/server.h" #include "sway/server.h"
#include "sway/input.h"
#include "log.h" #include "log.h"
bool server_init(struct sway_server *server) { bool server_init(struct sway_server *server) {
@ -58,6 +59,9 @@ bool server_init(struct sway_server *server) {
wlr_backend_destroy(server->backend); wlr_backend_destroy(server->backend);
return false; return false;
} }
server->input = sway_input_create(server);
return true; return true;
} }