diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-07-28 14:45:51 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-08-11 09:19:55 +1000 |
commit | 4cdcf5cc381c6cfbe552b642e56e1c6a68263876 (patch) | |
tree | d69a72b8dfa5f8abfdd4d73d05d0d20fba102e08 | |
parent | 5ec449f7dce7df4ac685449bc152a2e92289cb53 (diff) |
filter: move create_pointer_accelerator_filter down in the file
No functional changes, just moving code in preparation for filter patches
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com>
-rw-r--r-- | src/filter.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/filter.c b/src/filter.c index 4c00dbb..38d0d36 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; +} |