fallback: move the fallback code into a separate file

Split out the fallback-specific device handling from the more generic
evdev-specific handling (which is supposed to be available for all devices).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2017-09-19 13:57:50 +10:00
parent 4a1a044735
commit 6b99fabfe8
4 changed files with 1705 additions and 1651 deletions

View file

@ -156,6 +156,7 @@ src_libinput = [
'src/libinput-private.h',
'src/evdev.c',
'src/evdev.h',
'src/evdev-fallback.c',
'src/evdev-middle-button.c',
'src/evdev-mt-touchpad.c',
'src/evdev-mt-touchpad.h',

1674
src/evdev-fallback.c Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -345,88 +345,6 @@ evdev_verify_dispatch_type(struct evdev_dispatch *dispatch,
abort();
}
struct fallback_dispatch {
struct evdev_dispatch base;
struct evdev_device *device;
struct libinput_device_config_calibration calibration;
struct {
bool is_enabled;
int angle;
struct matrix matrix;
struct libinput_device_config_rotation config;
} rotation;
struct {
struct device_coords point;
int32_t seat_slot;
struct {
struct device_coords min, max;
struct ratelimit range_warn_limit;
} warning_range;
} abs;
struct {
int slot;
struct mt_slot *slots;
size_t slots_len;
bool want_hysteresis;
struct device_coords hysteresis_margin;
} mt;
struct device_coords rel;
struct {
int state;
} tablet_mode;
/* Bitmask of pressed keys used to ignore initial release events from
* the kernel. */
unsigned long hw_key_mask[NLONGS(KEY_CNT)];
enum evdev_event_type pending_event;
/* true if we're reading events (i.e. not suspended) but we're
ignoring them */
bool ignore_events;
struct {
enum evdev_debounce_state state;
unsigned int button_code;
uint64_t button_up_time;
struct libinput_timer timer;
} debounce;
struct {
enum switch_reliability reliability;
bool is_closed;
bool is_closed_client_state;
/* We allow up to 3 paired keyboards for the lid switch
* listener. Only one keyboard should exist, but that can
* have more than one event node.
*
* Note: this is a sparse list, any element may have a
* non-NULL device.
*/
struct paired_keyboard {
struct evdev_device *device;
struct libinput_event_listener listener;
} paired_keyboard[3];
} lid;
};
static inline struct fallback_dispatch*
fallback_dispatch(struct evdev_dispatch *dispatch)
{
evdev_verify_dispatch_type(dispatch, DISPATCH_FALLBACK);
return container_of(dispatch, struct fallback_dispatch, base);
}
struct evdev_device *
evdev_device_create(struct libinput_seat *seat,
struct udev_device *device);
@ -446,6 +364,9 @@ evdev_init_calibration(struct evdev_device *device,
void
evdev_read_calibration_prop(struct evdev_device *device);
enum switch_reliability
evdev_read_switch_reliability_prop(struct evdev_device *device);
void
evdev_init_sendevents(struct evdev_device *device,
struct evdev_dispatch *dispatch);
@ -469,6 +390,15 @@ evdev_tablet_pad_create(struct evdev_device *device);
struct evdev_dispatch *
evdev_lid_switch_dispatch_create(struct evdev_device *device);
struct evdev_dispatch *
fallback_dispatch_create(struct libinput_device *libinput_device);
bool
evdev_is_fake_mt_device(struct evdev_device *device);
int
evdev_need_mtdev(struct evdev_device *device);
void
evdev_device_led_update(struct evdev_device *device, enum libinput_led leds);
@ -574,6 +504,15 @@ evdev_pointer_notify_physical_button(struct evdev_device *device,
void
evdev_init_natural_scroll(struct evdev_device *device);
void
evdev_init_button_scroll(struct evdev_device *device,
void (*change_scroll_method)(struct evdev_device *));
int
evdev_update_key_down_count(struct evdev_device *device,
int code,
int pressed);
void
evdev_notify_axis(struct evdev_device *device,
uint64_t time,