[PATCH libinput 08/16] filter: move create_pointer_accelerator_filter down in the file
Peter Hutterer
peter.hutterer at who-t.net
Tue Aug 4 23:32:37 PDT 2015
No functional changes, just moving code in preparation for filter patches
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/filter.c | 70 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 35 insertions(+), 35 deletions(-)
diff --git a/src/filter.c b/src/filter.c
index 29bf8e5..bc73d50 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -362,41 +362,6 @@ accelerator_set_speed(struct motion_filter *filter,
return true;
}
-struct motion_filter_interface accelerator_interface = {
- accelerator_filter,
- accelerator_restart,
- accelerator_destroy,
- accelerator_set_speed,
-};
-
-struct motion_filter *
-create_pointer_accelerator_filter(accel_profile_func_t profile,
- int dpi)
-{
- struct pointer_accelerator *filter;
-
- filter = zalloc(sizeof *filter);
- if (filter == NULL)
- return NULL;
-
- filter->base.interface = &accelerator_interface;
-
- filter->profile = profile;
- filter->last_velocity = 0.0;
-
- filter->trackers =
- calloc(NUM_POINTER_TRACKERS, sizeof *filter->trackers);
- filter->cur_tracker = 0;
-
- filter->threshold = DEFAULT_THRESHOLD;
- filter->accel = DEFAULT_ACCELERATION;
- filter->incline = DEFAULT_INCLINE;
-
- filter->dpi_factor = dpi/(double)DEFAULT_MOUSE_DPI;
-
- return &filter->base;
-}
-
/**
* Custom acceleration function for mice < 1000dpi.
* At slow motion, a single device unit causes a one-pixel movement.
@@ -576,3 +541,38 @@ touchpad_lenovo_x230_accel_profile(struct motion_filter *filter,
return factor * TP_MAGIC_SLOWDOWN / TP_MAGIC_LOW_RES_FACTOR;
}
+
+struct motion_filter_interface accelerator_interface = {
+ accelerator_filter,
+ accelerator_restart,
+ accelerator_destroy,
+ accelerator_set_speed,
+};
+
+struct motion_filter *
+create_pointer_accelerator_filter(accel_profile_func_t profile,
+ int dpi)
+{
+ struct pointer_accelerator *filter;
+
+ filter = zalloc(sizeof *filter);
+ if (filter == NULL)
+ return NULL;
+
+ filter->base.interface = &accelerator_interface;
+
+ filter->profile = profile;
+ filter->last_velocity = 0.0;
+
+ filter->trackers =
+ calloc(NUM_POINTER_TRACKERS, sizeof *filter->trackers);
+ filter->cur_tracker = 0;
+
+ filter->threshold = DEFAULT_THRESHOLD;
+ filter->accel = DEFAULT_ACCELERATION;
+ filter->incline = DEFAULT_INCLINE;
+
+ filter->dpi_factor = dpi/(double)DEFAULT_MOUSE_DPI;
+
+ return &filter->base;
+}
--
2.4.3
More information about the wayland-devel
mailing list