[PATCH weston 09/20] evdev: expose the generic evdev API

Kristian Høgsberg hoegsberg at gmail.com
Fri Aug 3 10:22:37 PDT 2012


On Fri, Aug 03, 2012 at 02:39:05PM +0300, Pekka Paalanen wrote:
> This API does not depend on udev or launcher-util.
> 
> Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
> ---
>  src/evdev.c |    8 ++++----
>  src/evdev.h |   14 ++++++++++++++
>  2 files changed, 18 insertions(+), 4 deletions(-)
> 
> diff --git a/src/evdev.c b/src/evdev.c
> index 896702d..92ac934 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -31,7 +31,7 @@
>  #include "evdev.h"
>  #include "launcher-util.h"
>  
> -static void
> +void
>  evdev_led_update(struct wl_list *evdev_devices, enum weston_led leds)
>  {
>  	static const struct {
> @@ -468,7 +468,7 @@ evdev_configure_device(struct evdev_input_device *device)
>  	return 0;
>  }
>  
> -static struct evdev_input_device *
> +struct evdev_input_device *
>  evdev_input_device_create(struct weston_seat *seat,
>  			  const char *path, int device_fd)
>  {
> @@ -526,7 +526,7 @@ err1:
>  	return NULL;
>  }
>  
> -static void
> +void
>  evdev_input_device_destroy(struct evdev_input_device *device)
>  {
>  	struct evdev_dispatch *dispatch;
> @@ -584,7 +584,7 @@ device_added(struct udev_device *udev_device, struct drm_seat *master)
>  	wl_list_insert(master->devices_list.prev, &device->link);
>  }
>  
> -static void
> +void
>  evdev_notify_keyboard_focus(struct weston_seat *seat,
>  			    struct wl_list *evdev_devices)
>  {
> diff --git a/src/evdev.h b/src/evdev.h
> index 2455770..66773e7 100644
> --- a/src/evdev.h
> +++ b/src/evdev.h
> @@ -132,4 +132,18 @@ evdev_enable_udev_monitor(struct udev *udev, struct weston_seat *seat_base);
>  void
>  evdev_disable_udev_monitor(struct weston_seat *seat_base);
>  
> +void
> +evdev_led_update(struct wl_list *evdev_devices, enum weston_led leds);
> +
> +struct evdev_input_device *
> +evdev_input_device_create(struct weston_seat *seat,
> +			  const char *path, int device_fd);
> +
> +void
> +evdev_input_device_destroy(struct evdev_input_device *device);
> +
> +void
> +evdev_notify_keyboard_focus(struct weston_seat *seat,
> +			    struct wl_list *evdev_devices);
> +

I'm committing this as-is, but I think the API is a little odd here with the wl_list arg.  It may be cleaner to just make it

  void
  evdev_led_update(struct evdev_input_device *device, enum weston_led leds);

and then do the loop in the drm_seat/android_seat code.  Maybe we
should also just call it an evdev_device instead, shorter not really
ambiguous.

Kristian


More information about the wayland-devel mailing list