summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-05-06 22:24:50 -0400
committerKristian Høgsberg <krh@bitplanet.net>2013-05-06 22:24:50 -0400
commit4a2a274350596a40b31236807a56a5d7d1505152 (patch)
tree1b8273e63c52bf635ffba7a4988ba42b88fed0cb
parente329f36533c76119308747d73c06731e728ff538 (diff)
downloadweston-4a2a274350596a40b31236807a56a5d7d1505152.tar.gz
weston-4a2a274350596a40b31236807a56a5d7d1505152.tar.bz2
weston-4a2a274350596a40b31236807a56a5d7d1505152.zip
input: Fold wl_seat init/release into weston_seat init/release
-rw-r--r--src/compositor.h6
-rw-r--r--src/input.c48
2 files changed, 19 insertions, 35 deletions
diff --git a/src/compositor.h b/src/compositor.h
index 69d1a6cb..1613b7c2 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -355,12 +355,6 @@ struct wl_seat {
};
void
-wl_seat_init(struct wl_seat *seat);
-
-void
-wl_seat_release(struct wl_seat *seat);
-
-void
wl_seat_set_pointer(struct wl_seat *seat, struct weston_pointer *pointer);
void
wl_seat_set_keyboard(struct wl_seat *seat, struct weston_keyboard *keyboard);
diff --git a/src/input.c b/src/input.c
index 782572bb..8573555d 100644
--- a/src/input.c
+++ b/src/input.c
@@ -356,33 +356,6 @@ weston_touch_release(struct weston_touch *touch)
wl_list_remove(&touch->focus_listener.link);
}
-WL_EXPORT void
-wl_seat_init(struct wl_seat *seat)
-{
- memset(seat, 0, sizeof *seat);
-
- wl_signal_init(&seat->destroy_signal);
-
- seat->selection_data_source = NULL;
- wl_list_init(&seat->base_resource_list);
- wl_signal_init(&seat->selection_signal);
- wl_list_init(&seat->drag_resource_list);
- wl_signal_init(&seat->drag_icon_signal);
-}
-
-WL_EXPORT void
-wl_seat_release(struct wl_seat *seat)
-{
- wl_signal_emit(&seat->destroy_signal, seat);
-
- if (seat->pointer)
- weston_pointer_release(seat->pointer);
- if (seat->keyboard)
- weston_keyboard_release(seat->keyboard);
- if (seat->touch)
- weston_touch_release(seat->touch);
-}
-
static void
seat_send_updated_caps(struct wl_seat *seat)
{
@@ -1554,7 +1527,16 @@ weston_seat_init_touch(struct weston_seat *seat)
WL_EXPORT void
weston_seat_init(struct weston_seat *seat, struct weston_compositor *ec)
{
- wl_seat_init(&seat->seat);
+ memset(seat, 0, sizeof *seat);
+
+ wl_signal_init(&seat->seat.destroy_signal);
+
+ seat->seat.selection_data_source = NULL;
+ wl_list_init(&seat->seat.base_resource_list);
+ wl_signal_init(&seat->seat.selection_signal);
+ wl_list_init(&seat->seat.drag_resource_list);
+ wl_signal_init(&seat->seat.drag_icon_signal);
+
seat->has_pointer = 0;
seat->has_keyboard = 0;
seat->has_touch = 0;
@@ -1599,7 +1581,15 @@ weston_seat_release(struct weston_seat *seat)
xkb_state_unref(seat->xkb_state.state);
xkb_info_destroy(&seat->xkb_info);
- wl_seat_release(&seat->seat);
+ wl_signal_emit(&seat->seat.destroy_signal, seat);
+
+ if (seat->seat.pointer)
+ weston_pointer_release(seat->seat.pointer);
+ if (seat->seat.keyboard)
+ weston_keyboard_release(seat->seat.keyboard);
+ if (seat->seat.touch)
+ weston_touch_release(seat->seat.touch);
+
wl_signal_emit(&seat->destroy_signal, seat);
}