config: add configuration for tablet tool motion

This commit is contained in:
Jens Peters 2024-07-05 06:17:29 +02:00 committed by Johan Malm
parent 8501a1281c
commit a2f25bea1a
7 changed files with 41 additions and 7 deletions

View file

@ -11,6 +11,7 @@
#include "common/font.h"
#include "config/touch.h"
#include "config/tablet.h"
#include "config/tablet-tool.h"
#include "config/libinput.h"
#include "resize-indicator.h"
#include "theme.h"
@ -102,6 +103,9 @@ struct rcxml {
uint16_t button_map_count;
struct button_map_entry button_map[BUTTON_MAP_MAX];
} tablet;
struct tablet_tool_config {
enum motion motion;
} tablet_tool;
/* libinput */
struct wl_list libinput_categories;

View file

@ -0,0 +1,14 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_TABLET_TOOL_CONFIG_H
#define LABWC_TABLET_TOOL_CONFIG_H
#include <stdint.h>
enum motion {
LAB_TABLET_MOTION_ABSOLUTE = 0,
LAB_TABLET_MOTION_RELATIVE,
};
enum motion tablet_parse_motion(const char *name);
#endif /* LABWC_TABLET_TOOL_CONFIG_H */

View file

@ -9,17 +9,12 @@ struct seat;
struct wlr_device;
struct wlr_input_device;
enum lab_tablet_motion_mode {
LAB_TABLET_MOTION_ABSOLUTE = 0,
LAB_TABLET_MOTION_RELATIVE,
};
struct drawing_tablet {
struct wlr_input_device *wlr_input_device;
struct seat *seat;
struct wlr_tablet *tablet;
struct wlr_tablet_v2_tablet *tablet_v2;
enum lab_tablet_motion_mode motion_mode;
enum motion motion_mode;
double x, y, dx, dy;
double distance;
double pressure;