summaryrefslogtreecommitdiff
path: root/src/evdev-mt-touchpad-buttons.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2016-01-25 15:29:11 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2016-01-25 15:29:11 +1000
commitde3f1fa6fa23cebef17640dc1eb4ea8df270ecd9 (patch)
tree0eb7ae087e9dd10fc2b962a8879d6906773a674a /src/evdev-mt-touchpad-buttons.c
parent6920a42fd4ec8dfa633ef5bc1865f994afc63693 (diff)
parentb6f59d0e3b2e38abd0c79e36a5971dc7ea1e2b16 (diff)
downloadlibinput-tablet-support.tar.gz
Merge branch 'master' into tablet-supporttablet-support
Diffstat (limited to 'src/evdev-mt-touchpad-buttons.c')
-rw-r--r--src/evdev-mt-touchpad-buttons.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/evdev-mt-touchpad-buttons.c b/src/evdev-mt-touchpad-buttons.c
index 8822e08c..82c99c76 100644
--- a/src/evdev-mt-touchpad-buttons.c
+++ b/src/evdev-mt-touchpad-buttons.c
@@ -78,47 +78,54 @@ button_event_to_str(enum button_event event) {
}
static inline bool
-is_inside_bottom_button_area(struct tp_dispatch *tp, struct tp_touch *t)
+is_inside_bottom_button_area(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return t->point.y >= tp->buttons.bottom_area.top_edge;
}
static inline bool
-is_inside_bottom_right_area(struct tp_dispatch *tp, struct tp_touch *t)
+is_inside_bottom_right_area(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return is_inside_bottom_button_area(tp, t) &&
t->point.x > tp->buttons.bottom_area.rightbutton_left_edge;
}
static inline bool
-is_inside_bottom_left_area(struct tp_dispatch *tp, struct tp_touch *t)
+is_inside_bottom_left_area(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return is_inside_bottom_button_area(tp, t) &&
!is_inside_bottom_right_area(tp, t);
}
static inline bool
-is_inside_top_button_area(struct tp_dispatch *tp, struct tp_touch *t)
+is_inside_top_button_area(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return t->point.y <= tp->buttons.top_area.bottom_edge;
}
static inline bool
-is_inside_top_right_area(struct tp_dispatch *tp, struct tp_touch *t)
+is_inside_top_right_area(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return is_inside_top_button_area(tp, t) &&
t->point.x > tp->buttons.top_area.rightbutton_left_edge;
}
static inline bool
-is_inside_top_left_area(struct tp_dispatch *tp, struct tp_touch *t)
+is_inside_top_left_area(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return is_inside_top_button_area(tp, t) &&
t->point.x < tp->buttons.top_area.leftbutton_right_edge;
}
static inline bool
-is_inside_top_middle_area(struct tp_dispatch *tp, struct tp_touch *t)
+is_inside_top_middle_area(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return is_inside_top_button_area(tp, t) &&
t->point.x >= tp->buttons.top_area.leftbutton_right_edge &&
@@ -1042,13 +1049,15 @@ tp_post_button_events(struct tp_dispatch *tp, uint64_t time)
}
int
-tp_button_touch_active(struct tp_dispatch *tp, struct tp_touch *t)
+tp_button_touch_active(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return t->button.state == BUTTON_STATE_AREA;
}
bool
-tp_button_is_inside_softbutton_area(struct tp_dispatch *tp, struct tp_touch *t)
+tp_button_is_inside_softbutton_area(const struct tp_dispatch *tp,
+ const struct tp_touch *t)
{
return is_inside_top_button_area(tp, t) ||
is_inside_bottom_button_area(tp, t);