From f4d97f2e3e8208acd687282823bf7c3814177e20 Mon Sep 17 00:00:00 2001 From: Taekyun Kim Date: Thu, 1 Oct 2015 18:49:54 +0900 Subject: [PATCH] pepper: pepper_xxx_get_compositor() helper functions Change-Id: I4c883dba9875337ffdde8ee9ab20e017fc9eeed8 --- src/lib/pepper/input.c | 12 ++++++++++++ src/lib/pepper/keyboard.c | 6 ++++++ src/lib/pepper/pepper.h | 24 +++++++++++++++++++++--- src/lib/pepper/pointer.c | 6 ++++++ src/lib/pepper/surface.c | 6 ++++++ src/lib/pepper/touch.c | 6 ++++++ 6 files changed, 57 insertions(+), 3 deletions(-) diff --git a/src/lib/pepper/input.c b/src/lib/pepper/input.c index 9fe72cb..27233c5 100644 --- a/src/lib/pepper/input.c +++ b/src/lib/pepper/input.c @@ -109,6 +109,12 @@ pepper_seat_get_resource_list(pepper_seat_t *seat) return &seat->resource_list; } +PEPPER_API pepper_compositor_t * +pepper_seat_get_compositor(pepper_seat_t *seat) +{ + return seat->compositor; +} + PEPPER_API pepper_pointer_t * pepper_seat_get_pointer(pepper_seat_t *seat) { @@ -310,6 +316,12 @@ pepper_input_device_destroy(pepper_input_device_t *device) free(device); } +PEPPER_API pepper_compositor_t * +pepper_input_device_get_compositor(pepper_input_device_t *device) +{ + return device->compositor; +} + PEPPER_API const char * pepper_input_device_get_property(pepper_input_device_t *device, const char *key) { diff --git a/src/lib/pepper/keyboard.c b/src/lib/pepper/keyboard.c index ad85222..55febfc 100644 --- a/src/lib/pepper/keyboard.c +++ b/src/lib/pepper/keyboard.c @@ -140,6 +140,12 @@ pepper_keyboard_get_resource_list(pepper_keyboard_t *keyboard) return &keyboard->resource_list; } +PEPPER_API pepper_compositor_t * +pepper_keyboard_get_compositor(pepper_keyboard_t *keyboard) +{ + return keyboard->seat->compositor; +} + PEPPER_API void pepper_keyboard_set_focus(pepper_keyboard_t *keyboard, pepper_view_t *focus) { diff --git a/src/lib/pepper/pepper.h b/src/lib/pepper/pepper.h index 13d8878..77e68a5 100644 --- a/src/lib/pepper/pepper.h +++ b/src/lib/pepper/pepper.h @@ -224,9 +224,6 @@ pepper_compositor_get_seat_list(pepper_compositor_t *compositor); PEPPER_API const pepper_list_t * pepper_compositor_get_input_device_list(pepper_compositor_t *compositor); -PEPPER_API pepper_compositor_t * -pepper_output_get_compositor(pepper_output_t *output); - PEPPER_API pepper_view_t * pepper_compositor_pick_view(pepper_compositor_t *compositor, double x, double y, double *vx, double *vy); @@ -244,6 +241,9 @@ pepper_output_destroy(pepper_output_t *output); PEPPER_API struct wl_list * pepper_output_get_resource_list(pepper_output_t *output); +PEPPER_API pepper_compositor_t * +pepper_output_get_compositor(pepper_output_t *output); + PEPPER_API void pepper_output_move(pepper_output_t *output, int32_t x, int32_t y); @@ -278,6 +278,9 @@ pepper_seat_destroy(pepper_seat_t *seat); PEPPER_API struct wl_list * pepper_seat_get_resource_list(pepper_seat_t *seat); +PEPPER_API pepper_compositor_t * +pepper_seat_get_compositor(pepper_seat_t *seat); + PEPPER_API const char * pepper_seat_get_name(pepper_seat_t *seat); @@ -299,6 +302,9 @@ pepper_seat_remove_input_device(pepper_seat_t *seat, pepper_input_device_t *devi PEPPER_API const char * pepper_input_device_get_property(pepper_input_device_t *device, const char *key); +PEPPER_API pepper_compositor_t * +pepper_input_device_get_compositor(pepper_input_device_t *device); + /* Pointer. */ struct pepper_pointer_grab { @@ -312,6 +318,9 @@ struct pepper_pointer_grab PEPPER_API struct wl_list * pepper_pointer_get_resource_list(pepper_pointer_t *pointer); +PEPPER_API pepper_compositor_t * +pepper_pointer_get_compositor(pepper_pointer_t *pointer); + PEPPER_API pepper_bool_t pepper_pointer_set_clamp(pepper_pointer_t *pointer, double x0, double y0, double x1, double y1); @@ -364,6 +373,9 @@ struct pepper_keyboard_grab PEPPER_API struct wl_list * pepper_keyboard_get_resource_list(pepper_keyboard_t *keyboard); +PEPPER_API pepper_compositor_t * +pepper_keyboard_get_compositor(pepper_keyboard_t *keyboard); + PEPPER_API void pepper_keyboard_set_focus(pepper_keyboard_t *keyboard, pepper_view_t *focus); @@ -404,6 +416,9 @@ struct pepper_touch_grab PEPPER_API struct wl_list * pepper_touch_get_resource_list(pepper_touch_t *touch); +PEPPER_API pepper_compositor_t * +pepper_touch_get_compositor(pepper_touch_t *touch); + PEPPER_API void pepper_touch_set_focus(pepper_touch_t *touch, pepper_view_t *focus); @@ -435,6 +450,9 @@ pepper_touch_end_grab(pepper_touch_t *touch); PEPPER_API struct wl_resource * pepper_surface_get_resource(pepper_surface_t *surface); +PEPPER_API pepper_compositor_t * +pepper_surface_get_compositor(pepper_surface_t *surface); + PEPPER_API const char * pepper_surface_get_role(pepper_surface_t *surface); diff --git a/src/lib/pepper/pointer.c b/src/lib/pepper/pointer.c index 970984c..d3e4f29 100644 --- a/src/lib/pepper/pointer.c +++ b/src/lib/pepper/pointer.c @@ -236,6 +236,12 @@ pepper_pointer_get_resource_list(pepper_pointer_t *pointer) return &pointer->resource_list; } +PEPPER_API pepper_compositor_t * +pepper_pointer_get_compositor(pepper_pointer_t *pointer) +{ + return pointer->seat->compositor; +} + PEPPER_API pepper_bool_t pepper_pointer_set_clamp(pepper_pointer_t *pointer, double x0, double y0, double x1, double y1) { diff --git a/src/lib/pepper/surface.c b/src/lib/pepper/surface.c index 41d38e4..bbcd61a 100644 --- a/src/lib/pepper/surface.c +++ b/src/lib/pepper/surface.c @@ -439,6 +439,12 @@ pepper_surface_get_resource(pepper_surface_t *surface) return surface->resource; } +PEPPER_API pepper_compositor_t * +pepper_surface_get_compositor(pepper_surface_t *surface) +{ + return surface->compositor; +} + PEPPER_API const char * pepper_surface_get_role(pepper_surface_t *surface) { diff --git a/src/lib/pepper/touch.c b/src/lib/pepper/touch.c index 7dd1c88..0c8b0a6 100644 --- a/src/lib/pepper/touch.c +++ b/src/lib/pepper/touch.c @@ -94,6 +94,12 @@ pepper_touch_get_resource_list(pepper_touch_t *touch) return &touch->resource_list; } +PEPPER_API pepper_compositor_t * +pepper_touch_get_compositor(pepper_touch_t *touch) +{ + return touch->seat->compositor; +} + PEPPER_API void pepper_touch_set_focus(pepper_touch_t *touch, pepper_view_t *focus) { -- 2.7.4