evdev: Reference count input device's seat capabilities

When the only input device of a certain seat capability is unplugged,
stop advertising the capability.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
diff --git a/src/compositor.h b/src/compositor.h
index d8a6a73..5ed348b 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -461,6 +461,9 @@
 	struct weston_pointer *pointer;
 	struct weston_keyboard *keyboard;
 	struct weston_touch *touch;
+	int pointer_device_count;
+	int keyboard_device_count;
+	int touch_device_count;
 
 	struct weston_output *output; /* constraint */
 
@@ -1124,11 +1127,17 @@
 		 const char *seat_name);
 void
 weston_seat_init_pointer(struct weston_seat *seat);
+void
+weston_seat_release_pointer(struct weston_seat *seat);
 int
 weston_seat_init_keyboard(struct weston_seat *seat, struct xkb_keymap *keymap);
 void
+weston_seat_release_keyboard(struct weston_seat *seat);
+void
 weston_seat_init_touch(struct weston_seat *seat);
 void
+weston_seat_release_touch(struct weston_seat *seat);
+void
 weston_seat_repick(struct weston_seat *seat);
 
 void