[PATCH libinput 1/6] filter: rename motion_filter_destroy to filter_destroy

Hans de Goede hdegoede at redhat.com
Mon Jul 7 23:47:43 PDT 2014


Hi,

On 07/08/2014 01:21 AM, Peter Hutterer wrote:
> For better consistency with filter_dispatch(). And move the things around to keep
> the consumable API together.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

Looks good, you may add my Reviewed-by for patches 1-3.

Regards,

Hans


> ---
>  src/evdev-mt-touchpad.c |  2 +-
>  src/evdev.c             |  2 +-
>  src/filter.c            | 18 +++++++++---------
>  src/filter.h            |  4 ++--
>  4 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
> index fc2a5ab..0b06810 100644
> --- a/src/evdev-mt-touchpad.c
> +++ b/src/evdev-mt-touchpad.c
> @@ -577,7 +577,7 @@ tp_destroy(struct evdev_dispatch *dispatch)
>  	tp_destroy_tap(tp);
>  	tp_destroy_buttons(tp);
>  
> -	motion_filter_destroy(tp->filter);
> +	filter_destroy(tp->filter);
>  	free(tp->touches);
>  	free(tp);
>  }
> diff --git a/src/evdev.c b/src/evdev.c
> index 183c200..f980812 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -943,7 +943,7 @@ evdev_device_destroy(struct evdev_device *device)
>  	if (dispatch)
>  		dispatch->interface->destroy(dispatch);
>  
> -	motion_filter_destroy(device->pointer.filter);
> +	filter_destroy(device->pointer.filter);
>  	libinput_seat_unref(device->base.seat);
>  	libevdev_free(device->evdev);
>  	free(device->mt.slots);
> diff --git a/src/filter.c b/src/filter.c
> index 3221d19..51cc0e9 100644
> --- a/src/filter.c
> +++ b/src/filter.c
> @@ -38,6 +38,15 @@ filter_dispatch(struct motion_filter *filter,
>  	filter->interface->filter(filter, motion, data, time);
>  }
>  
> +void
> +filter_destroy(struct motion_filter *filter)
> +{
> +	if (!filter)
> +		return;
> +
> +	filter->interface->destroy(filter);
> +}
> +
>  /*
>   * Default parameters for pointer acceleration profiles.
>   */
> @@ -332,15 +341,6 @@ create_pointer_accelator_filter(accel_profile_func_t profile)
>  	return &filter->base;
>  }
>  
> -void
> -motion_filter_destroy(struct motion_filter *filter)
> -{
> -	if (!filter)
> -		return;
> -
> -	filter->interface->destroy(filter);
> -}
> -
>  static inline double
>  calc_penumbral_gradient(double x)
>  {
> diff --git a/src/filter.h b/src/filter.h
> index c0219ee..e670e1b 100644
> --- a/src/filter.h
> +++ b/src/filter.h
> @@ -35,6 +35,8 @@ void
>  filter_dispatch(struct motion_filter *filter,
>  		struct motion_params *motion,
>  		void *data, uint64_t time);
> +void
> +filter_destroy(struct motion_filter *filter);
>  
>  
>  struct motion_filter_interface {
> @@ -59,8 +61,6 @@ typedef double (*accel_profile_func_t)(struct motion_filter *filter,
>  struct motion_filter *
>  create_pointer_accelator_filter(accel_profile_func_t filter);
>  
> -void
> -motion_filter_destroy(struct motion_filter *filter);
>  
>  /*
>   * Pointer acceleration profiles.
> 


More information about the wayland-devel mailing list