mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-03 13:30:27 +01: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(
|
||||
device,
|
||||
time,
|
||||
AS_MASK(LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL),
|
||||
bit(LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL),
|
||||
source,
|
||||
&wheel_degrees,
|
||||
&discrete);
|
||||
|
|
@ -257,7 +257,7 @@ fallback_flush_wheels(struct fallback_dispatch *dispatch,
|
|||
evdev_notify_axis(
|
||||
device,
|
||||
time,
|
||||
AS_MASK(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL),
|
||||
bit(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL),
|
||||
source,
|
||||
&wheel_degrees,
|
||||
&discrete);
|
||||
|
|
|
|||
|
|
@ -412,7 +412,7 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
|
|||
if (t->scroll.direction != -1) {
|
||||
/* Send stop scroll event */
|
||||
evdev_notify_axis(device, time,
|
||||
AS_MASK(t->scroll.direction),
|
||||
bit(t->scroll.direction),
|
||||
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
||||
&zero,
|
||||
&zero_discrete);
|
||||
|
|
@ -462,7 +462,7 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time)
|
|||
continue;
|
||||
|
||||
evdev_notify_axis(device, time,
|
||||
AS_MASK(axis),
|
||||
bit(axis),
|
||||
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
||||
&normalized,
|
||||
&zero_discrete);
|
||||
|
|
@ -485,7 +485,7 @@ tp_edge_scroll_stop_events(struct tp_dispatch *tp, uint64_t time)
|
|||
tp_for_each_touch(tp, t) {
|
||||
if (t->scroll.direction != -1) {
|
||||
evdev_notify_axis(device, time,
|
||||
AS_MASK(t->scroll.direction),
|
||||
bit(t->scroll.direction),
|
||||
LIBINPUT_POINTER_AXIS_SOURCE_FINGER,
|
||||
&zero,
|
||||
&zero_discrete);
|
||||
|
|
|
|||
|
|
@ -2398,7 +2398,7 @@ evdev_is_scrolling(const struct evdev_device *device,
|
|||
assert(axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL ||
|
||||
axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||
|
||||
return (device->scroll.direction & AS_MASK(axis)) != 0;
|
||||
return (device->scroll.direction & bit(axis)) != 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
|
|
@ -2408,7 +2408,7 @@ evdev_start_scrolling(struct evdev_device *device,
|
|||
assert(axis == LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL ||
|
||||
axis == LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
|
||||
|
||||
device->scroll.direction |= AS_MASK(axis);
|
||||
device->scroll.direction |= bit(axis);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2473,9 +2473,9 @@ evdev_post_scroll(struct evdev_device *device,
|
|||
uint32_t axes = device->scroll.direction;
|
||||
|
||||
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)
|
||||
axes &= ~AS_MASK(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
||||
axes &= ~bit(LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
||||
|
||||
evdev_notify_axis(device,
|
||||
time,
|
||||
|
|
|
|||
|
|
@ -124,7 +124,6 @@ bool list_empty(const struct list *list);
|
|||
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
|
||||
#define ARRAY_FOR_EACH(_arr, _elem) \
|
||||
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 max(a, b) (((a) > (b)) ? (a) : (b))
|
||||
|
|
|
|||
|
|
@ -685,7 +685,7 @@ libinput_event_pointer_has_axis(struct libinput_event_pointer *event,
|
|||
switch (axis) {
|
||||
case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL:
|
||||
case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
|
||||
return !!(event->axes & AS_MASK(axis));
|
||||
return !!(event->axes & bit(axis));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue