From ce9bc3518517468b6726d9ea38820bb72fee976d Mon Sep 17 00:00:00 2001 From: Emre Ucan Date: Thu, 25 Jan 2018 14:36:10 +0100 Subject: [PATCH] ivi-shell: register ivi_layout_interface Signed-off-by: Emre Ucan Reviewed-by: Pekka Paalanen --- ivi-shell/ivi-layout-export.h | 13 +++++++++++++ ivi-shell/ivi-layout.c | 6 ++++++ ivi-shell/ivi-shell.c | 2 -- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h index 277ac59e..c15c7f83 100644 --- a/ivi-shell/ivi-layout-export.h +++ b/ivi-shell/ivi-layout-export.h @@ -59,6 +59,7 @@ extern "C" { #include "stdbool.h" #include "compositor.h" +#include "plugin-registry.h" #define IVI_SUCCEEDED (0) #define IVI_FAILED (-1) @@ -140,6 +141,8 @@ enum ivi_layout_transition_type{ IVI_LAYOUT_TRANSITION_MAX, }; +#define IVI_LAYOUT_API_NAME "ivi_layout_api_v1" + struct ivi_layout_interface { /** @@ -572,6 +575,16 @@ struct ivi_layout_interface { struct ivi_layout_layer *removelayer); }; +static inline const struct ivi_layout_interface * +ivi_layout_get_api(struct weston_compositor *compositor) +{ + const void *api; + api = weston_plugin_api_get(compositor, IVI_LAYOUT_API_NAME, + sizeof(struct ivi_layout_interface)); + + return (const struct ivi_layout_interface *)api; +} + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 394179b8..a11b6585 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1906,6 +1906,8 @@ ivi_layout_surface_create(struct weston_surface *wl_surface, return ivisurf; } +static struct ivi_layout_interface ivi_layout_interface; + void ivi_layout_init_with_compositor(struct weston_compositor *ec) { @@ -1934,6 +1936,10 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec) layout->transitions = ivi_layout_transition_set_create(ec); wl_list_init(&layout->pending_transition_list); + + weston_plugin_api_register(ec, IVI_LAYOUT_API_NAME, + &ivi_layout_interface, + sizeof(struct ivi_layout_interface)); } static struct ivi_layout_interface ivi_layout_interface = { diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 766a1fd1..c0969546 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -425,8 +425,6 @@ ivi_shell_setting_create(struct ivi_shell_setting *dest, if (!dest->ivi_module && weston_config_section_get_string(section, "ivi-module", &dest->ivi_module, NULL) < 0) { - weston_log("Error: ivi-shell: No ivi-module set\n"); - result = -1; } weston_config_section_get_bool(section, "developermode",