]> git.mdlowis.com Git - proto/labwc.git/commitdiff
input: move function to config
authorJens Peters <jp7677@gmail.com>
Wed, 17 Jan 2024 18:01:06 +0000 (19:01 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Mon, 22 Jan 2024 21:50:18 +0000 (21:50 +0000)
This function is only about rc, so fits better
in config.

include/config/tablet.h
include/input/tablet.h
src/config/tablet.c
src/input/tablet.c
src/input/tablet_pad.c

index 6498b91cbe9ff78c2e6ce01361eb1b44d9be669b..8e0c7c6779f3580040ab3e0565af86a332207d1e 100644 (file)
@@ -22,5 +22,6 @@ enum rotation tablet_parse_rotation(int value);
 uint32_t tablet_button_from_str(const char *button);
 void tablet_button_mapping_add(uint32_t from, uint32_t to);
 void tablet_load_default_button_mappings(void);
+uint32_t tablet_get_mapped_button(uint32_t src_button);
 
 #endif /* LABWC_TABLET_CONFIG_H */
index c5f5a8e987f85141d11b425b33ec094351ccde41..d0678c065aa2fc1a682cceea5834078f0a3249bd 100644 (file)
@@ -21,7 +21,6 @@ struct drawing_tablet {
        } handlers;
 };
 
-uint32_t tablet_get_mapped_button(uint32_t src_button);
 void tablet_init(struct seat *seat, struct wlr_input_device *wlr_input_device);
 
 #endif /* LABWC_TABLET_H */
index 8ac6a0b5a9591187a2a2fd466cbc3110317e3a3d..95e253cf059d548a2ad95a187b115479c79c63f7 100644 (file)
@@ -105,3 +105,17 @@ tablet_load_default_button_mappings(void)
        tablet_button_mapping_add(BTN_STYLUS, BTN_RIGHT);
        tablet_button_mapping_add(BTN_STYLUS2, BTN_MIDDLE);
 }
+
+uint32_t
+tablet_get_mapped_button(uint32_t src_button)
+{
+       struct button_map_entry *map_entry;
+       for (size_t i = 0; i < rc.tablet.button_map_count; i++) {
+               map_entry = &rc.tablet.button_map[i];
+               if (map_entry->from == src_button) {
+                       return map_entry->to;
+               }
+       }
+       wlr_log(WLR_DEBUG, "no button map target for 0x%x", src_button);
+       return 0;
+}
index 0a24d619393397d383f14c0c4033183f4c2b5d2f..b4a18334f01d4db332881e792b2646fa3ad87c87 100644 (file)
@@ -86,20 +86,6 @@ handle_axis(struct wl_listener *listener, void *data)
        // Ignore other events
 }
 
-uint32_t
-tablet_get_mapped_button(uint32_t src_button)
-{
-       struct button_map_entry *map_entry;
-       for (size_t i = 0; i < rc.tablet.button_map_count; i++) {
-               map_entry = &rc.tablet.button_map[i];
-               if (map_entry->from == src_button) {
-                       return map_entry->to;
-               }
-       }
-       wlr_log(WLR_DEBUG, "no button map target for 0x%x", src_button);
-       return 0;
-}
-
 static void
 handle_tip(struct wl_listener *listener, void *data)
 {
index 3c1b2a9b4fbb92d09ecdb3d58fe56cd9853d0dee..29cde1e4396fdf5a1fd7080b17b5d0ccd6d813da 100644 (file)
@@ -7,7 +7,6 @@
 #include "common/mem.h"
 #include "config/rcxml.h"
 #include "input/cursor.h"
-#include "input/tablet.h"
 #include "input/tablet_pad.h"
 
 static void