2014-12-18 14:42:42 +10:00
|
|
|
/*
|
|
|
|
|
* Copyright © 2014 Red Hat, Inc.
|
|
|
|
|
*
|
2015-06-11 12:09:18 +10:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
* copy of this software and associated documentation files (the "Software"),
|
|
|
|
|
* to deal in the Software without restriction, including without limitation
|
|
|
|
|
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
|
|
|
* and/or sell copies of the Software, and to permit persons to whom the
|
|
|
|
|
* Software is furnished to do so, subject to the following conditions:
|
2014-12-18 14:42:42 +10:00
|
|
|
*
|
2015-06-11 12:09:18 +10:00
|
|
|
* The above copyright notice and this permission notice (including the next
|
|
|
|
|
* paragraph) shall be included in all copies or substantial portions of the
|
|
|
|
|
* Software.
|
|
|
|
|
*
|
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
|
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
|
|
|
* DEALINGS IN THE SOFTWARE.
|
2014-12-18 14:42:42 +10:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _SHARED_H_
|
|
|
|
|
#define _SHARED_H_
|
|
|
|
|
|
2017-02-13 11:07:03 +10:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
2014-12-18 15:02:45 +10:00
|
|
|
#include <libinput.h>
|
|
|
|
|
|
2014-12-18 14:42:42 +10:00
|
|
|
enum tools_backend {
|
|
|
|
|
BACKEND_DEVICE,
|
|
|
|
|
BACKEND_UDEV
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct tools_options {
|
|
|
|
|
enum tools_backend backend;
|
|
|
|
|
const char *device; /* if backend is BACKEND_DEVICE */
|
|
|
|
|
const char *seat; /* if backend is BACKEND_UDEV */
|
2015-06-24 15:12:54 +10:00
|
|
|
int grab; /* EVIOCGRAB */
|
2017-02-13 11:07:03 +10:00
|
|
|
bool show_keycodes; /* show keycodes */
|
2014-12-18 14:42:42 +10:00
|
|
|
|
|
|
|
|
int verbose;
|
|
|
|
|
int tapping;
|
2016-01-22 17:59:19 +10:00
|
|
|
int drag;
|
2015-06-22 11:07:31 +10:00
|
|
|
int drag_lock;
|
2014-12-18 15:10:59 +10:00
|
|
|
int natural_scroll;
|
2014-12-18 15:14:09 +10:00
|
|
|
int left_handed;
|
2015-04-14 12:08:33 +10:00
|
|
|
int middlebutton;
|
2015-01-16 10:16:47 +10:00
|
|
|
enum libinput_config_click_method click_method;
|
2015-04-21 11:57:23 +10:00
|
|
|
enum libinput_config_scroll_method scroll_method;
|
2016-07-21 11:46:05 +10:00
|
|
|
enum libinput_config_tap_button_map tap_map;
|
2015-04-21 18:24:39 +10:00
|
|
|
int scroll_button;
|
2015-04-10 15:45:59 +10:00
|
|
|
double speed;
|
2015-07-08 15:03:06 +10:00
|
|
|
int dwt;
|
2015-08-27 13:13:47 +10:00
|
|
|
enum libinput_config_accel_profile profile;
|
2014-12-18 14:42:42 +10:00
|
|
|
};
|
|
|
|
|
|
2015-06-24 15:07:53 +10:00
|
|
|
struct tools_context {
|
|
|
|
|
struct tools_options options;
|
|
|
|
|
void *user_data;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void tools_init_context(struct tools_context *context);
|
|
|
|
|
int tools_parse_args(int argc, char **argv, struct tools_context *context);
|
|
|
|
|
struct libinput* tools_open_backend(struct tools_context *context);
|
2014-12-18 15:10:09 +10:00
|
|
|
void tools_device_apply_config(struct libinput_device *device,
|
|
|
|
|
struct tools_options *options);
|
2016-12-05 15:31:37 +10:00
|
|
|
void tools_usage(void);
|
2014-12-18 14:42:42 +10:00
|
|
|
|
|
|
|
|
#endif
|