mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-08 10:08:05 +02:00
Drop the AS_MASK macro, replace with bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6bbe03a086
commit
7db3233f11
5 changed files with 10 additions and 11 deletions
|
|
@ -238,7 +238,7 @@ fallback_flush_wheels(struct fallback_dispatch *dispatch,
|
||||||
evdev_notify_axis(
|
evdev_notify_axis(
|
||||||
device,
|
device,
|
||||||
time,
|
time,
|
||||||
AS_MASK(LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL),
|
bit(LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL),
|
||||||
source,
|
source,
|
||||||
&wheel_degrees,
|
&wheel_degrees,
|
||||||
&discrete);
|
&discrete);
|
||||||
|
|
@ -257,7 +257,7 @@ fallback_flush_wheels(struct fallback_dispatch *dispatch,
|
||||||
evdev_notify_axis(
|
evdev_notify_axis(
|
||||||
device,
|
device,
|
||||||
time,
|
time,
|
||||||
AS_MASK(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL),
|
bit(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL),
|
||||||
source,
|
source,
|
||||||
&wheel_degrees,
|
&wheel_degrees,
|
||||||
&discrete);
|
&discrete);
|
||||||
|
|
|
||||||
|
|
@ -412,7 +412,7 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
|
||||||
if (t->scroll.direction != -1) {
|
if (t->scroll.direction != -1) {
|
||||||
/* Send stop scroll event */
|
/* Send stop scroll event */
|
||||||
evdev_notify_axis(device, time,
|
evdev_notify_axis(device, time,
|
||||||
AS_MASK(t->scroll.direction),
|
bit(t->scroll.direction),
|
||||||
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
||||||
&zero,
|
&zero,
|
||||||
&zero_discrete);
|
&zero_discrete);
|
||||||
|
|
@ -462,7 +462,7 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
evdev_notify_axis(device, time,
|
evdev_notify_axis(device, time,
|
||||||
AS_MASK(axis),
|
bit(axis),
|
||||||
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
||||||
&normalized,
|
&normalized,
|
||||||
&zero_discrete);
|
&zero_discrete);
|
||||||
|
|
@ -485,7 +485,7 @@ tp_edge_scroll_stop_events(struct tp_dispatch *tp, uint64_t time)
|
||||||
tp_for_each_touch(tp, t) {
|
tp_for_each_touch(tp, t) {
|
||||||
if (t->scroll.direction != -1) {
|
if (t->scroll.direction != -1) {
|
||||||
evdev_notify_axis(device, time,
|
evdev_notify_axis(device, time,
|
||||||
AS_MASK(t->scroll.direction),
|
bit(t->scroll.direction),
|
||||||
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
||||||
&zero,
|
&zero,
|
||||||
&zero_discrete);
|
&zero_discrete);
|
||||||
|
|
|
||||||
|
|
@ -2398,7 +2398,7 @@ evdev_is_scrolling(const struct evdev_device *device,
|
||||||
assert(axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL ||
|
assert(axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL ||
|
||||||
axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||||
|
|
||||||
return (device->scroll.direction & AS_MASK(axis)) != 0;
|
return (device->scroll.direction & bit(axis)) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
|
@ -2408,7 +2408,7 @@ evdev_start_scrolling(struct evdev_device *device,
|
||||||
assert(axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL ||
|
assert(axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL ||
|
||||||
axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||||
|
|
||||||
device->scroll.direction |= AS_MASK(axis);
|
device->scroll.direction |= bit(axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -2473,9 +2473,9 @@ evdev_post_scroll(struct evdev_device *device,
|
||||||
uint32_t axes = device->scroll.direction;
|
uint32_t axes = device->scroll.direction;
|
||||||
|
|
||||||
if (event.y == 0.0)
|
if (event.y == 0.0)
|
||||||
axes &= ~AS_MASK(LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
axes &= ~bit(LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||||
if (event.x == 0.0)
|
if (event.x == 0.0)
|
||||||
axes &= ~AS_MASK(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
axes &= ~bit(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
||||||
|
|
||||||
evdev_notify_axis(device,
|
evdev_notify_axis(device,
|
||||||
time,
|
time,
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,6 @@ bool list_empty(const struct list *list);
|
||||||
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
||||||
#define ARRAY_FOR_EACH(_arr, _elem) \
|
#define ARRAY_FOR_EACH(_arr, _elem) \
|
||||||
for (size_t _i = 0; _i < ARRAY_LENGTH(_arr) && (_elem = &_arr[_i]); _i++)
|
for (size_t _i = 0; _i < ARRAY_LENGTH(_arr) && (_elem = &_arr[_i]); _i++)
|
||||||
#define AS_MASK(v) (1 << (v))
|
|
||||||
|
|
||||||
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
||||||
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
||||||
|
|
|
||||||
|
|
@ -685,7 +685,7 @@ libinput_event_pointer_has_axis(struct libinput_event_pointer *event,
|
||||||
switch (axis) {
|
switch (axis) {
|
||||||
case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL:
|
case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL:
|
||||||
case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
|
case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
|
||||||
return !!(event->axes & AS_MASK(axis));
|
return !!(event->axes & bit(axis));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue