[PATCH weston v1 05/17] clients: add missing getters for input objects

Marek Chalupa mchqwerty at gmail.com
Fri Dec 5 05:36:38 PST 2014


We need get wayland objects from toytoolkit display
(there already are display_get_output, input_get_seat, ...),
so that we can use them in the tests. This patch adds:

  display_get_input()
  input_get_wl_pointer()
  input_get_wl_keyboard()
  input_get_wl_touch()

Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
---
 clients/window.c | 24 ++++++++++++++++++++++++
 clients/window.h | 12 ++++++++++++
 2 files changed, 36 insertions(+)

diff --git a/clients/window.c b/clients/window.c
index cc1e272..8dbf878 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -5211,6 +5211,24 @@ input_destroy(struct input *input)
 	free(input);
 }
 
+struct wl_pointer *
+input_get_wl_pointer(struct input *input)
+{
+	return input->pointer;
+}
+
+struct wl_keyboard *
+input_get_wl_keyboard(struct input *input)
+{
+	return input->keyboard;
+}
+
+struct wl_touch *
+input_get_wl_touch(struct input *input)
+{
+	return input->touch;
+}
+
 static void
 init_workspace_manager(struct display *d, uint32_t id)
 {
@@ -5664,6 +5682,12 @@ display_get_output(struct display *display)
 	return container_of(display->output_list.next, struct output, link);
 }
 
+struct input *
+display_get_input(struct display *display)
+{
+	return container_of(display->input_list.next, struct input, link);
+}
+
 struct wl_compositor *
 display_get_compositor(struct display *display)
 {
diff --git a/clients/window.h b/clients/window.h
index 5247f19..20d3fa0 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -93,6 +93,9 @@ display_get_compositor(struct display *display);
 struct output *
 display_get_output(struct display *display);
 
+struct input *
+display_get_input(struct display *display);
+
 uint32_t
 display_get_serial(struct display *display);
 
@@ -613,6 +616,15 @@ output_get_allocation(struct output *output, struct rectangle *allocation);
 struct wl_output *
 output_get_wl_output(struct output *output);
 
+struct wl_pointer *
+input_get_wl_pointer(struct input *input);
+
+struct wl_keyboard *
+input_get_wl_keyboard(struct input *input);
+
+struct wl_touch *
+input_get_wl_touch(struct input *input);
+
 enum wl_output_transform
 output_get_transform(struct output *output);
 
-- 
2.1.0



More information about the wayland-devel mailing list