Merge: Add a new API to return wheel click angle value
authorJengHyun Kang <jhyuni.kang@samsung.com>
Thu, 24 Nov 2016 05:44:21 +0000 (14:44 +0900)
committerJengHyun Kang <jhyuni.kang@samsung.com>
Thu, 24 Nov 2016 05:44:21 +0000 (14:44 +0900)
Change-Id: I0acfebb7b0173a4b00fa4d4b926cb8102b8bdcf0

configure.ac
src/evdev.c
src/evdev.h
src/libinput-private.h
src/libinput.c
src/libinput.h

index 47e15944c0329788e13aa67790dce40544aa952d..6714861eb91635d1e9017ada26e4d74376ebaeae 100644 (file)
@@ -195,6 +195,16 @@ if test "x$build_tests" = "xyes"; then
                AC_DEFINE_UNQUOTED(ADDR2LINE, ["$ADDR2LINE"], [Path to addr2line])
        fi
 fi
+
+# Check for ttrace header files
+PKG_CHECK_MODULES(TTRACE,
+               [ttrace],
+               [have_ttrace="yes"], [have_ttrace="no"])
+
+if test "x$have_ttrace" = "xyes"; then
+       AC_DEFINE(ENABLE_TTRACE, 1, [ttrace available])
+fi
+
 AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$HAVE_LIBUNWIND" = xyes])
 
 AC_ARG_ENABLE(libwacom,
index b654a0fb772b1dad1a1c143aac976c8646395aab..a90c73a1e9cae7af20cb6085bff79aed4cba4301 100644 (file)
@@ -1686,6 +1686,12 @@ evdev_init_natural_scroll(struct evdev_device *device)
        device->base.config.natural_scroll = &device->scroll.config_natural;
 }
 
+int
+evdev_scroll_get_wheel_click_angle(struct evdev_device *device)
+{
+       return device->scroll.wheel_click_angle.x;
+}
+
 static int
 evdev_rotation_config_is_available(struct libinput_device *device)
 {
index a28f9464f111c195c7f81a147888f58d7ddda3b5..62ad8aab0a03b1ae3b074bf0e54ab955f5100828 100644 (file)
@@ -481,6 +481,9 @@ evdev_pointer_notify_physical_button(struct evdev_device *device,
 void
 evdev_init_natural_scroll(struct evdev_device *device);
 
+int
+evdev_scroll_get_wheel_click_angle(struct evdev_device *device);
+
 void
 evdev_notify_axis(struct evdev_device *device,
                  uint64_t time,
index 407fa934db2c1379a31a50e248f2627f0ba1ee81..f76532f5a61a57d0ed0f9c534501497a6f001db2 100644 (file)
 #include "libinput.h"
 #include "libinput-util.h"
 
+#ifdef ENABLE_TTRACE
+#include <ttrace.h>
+
+#define TRACE_INPUT_BEGIN(NAME) traceBegin(TTRACE_TAG_INPUT, "INPUT:LIBINPUT:"#NAME)
+#define TRACE_INPUT_END() traceEnd(TTRACE_TAG_INPUT)
+#else
+#define TRACE_INPUT_BEGIN(NAME)
+#define TRACE_INPUT_END()
+#endif
+
 #if LIBINPUT_VERSION_MICRO >= 90
 #define HTTP_DOC_LINK "https://wayland.freedesktop.org/libinput/doc/latest/"
 #else
index 01fbd0fcd1a0c415d848173ccea43abc1b0555c9..1c06c3b6ce6ea4aefba94abaef580165b34012f8 100644 (file)
@@ -3882,6 +3882,12 @@ libinput_device_config_scroll_get_default_natural_scroll_enabled(struct libinput
        return device->config.natural_scroll->get_default_enabled(device);
 }
 
+LIBINPUT_EXPORT int
+libinput_device_config_scroll_get_wheel_click_angle(struct libinput_device *device)
+{
+       return evdev_scroll_get_wheel_click_angle((struct evdev_device *) device);
+}
+
 LIBINPUT_EXPORT int
 libinput_device_config_left_handed_is_available(struct libinput_device *device)
 {
index 2e8dc194146dd5d620e50dc64a327c5c183000ef..ad1bc8a289749ae5bdf491b283305f1975280f76 100644 (file)
@@ -4676,6 +4676,9 @@ libinput_device_config_scroll_get_natural_scroll_enabled(struct libinput_device
 int
 libinput_device_config_scroll_get_default_natural_scroll_enabled(struct libinput_device *device);
 
+int
+libinput_device_config_scroll_get_wheel_click_angle(struct libinput_device *device);
+
 /**
  * @ingroup config
  *