summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Teyfel <mteyfel@de.adit-jv.com>2017-12-21 16:10:13 +0100
committerMichael Teyfel <mteyfel@de.adit-jv.com>2019-04-08 14:41:47 +0200
commit7f286a27564fe8e8101afee3295b7a2b7b52a605 (patch)
tree13f91f69027f7bfd52a6c9a206b578ad063b3b06
parent4640972010e88343079d960f666dfb18bc971de1 (diff)
downloadwayland-ivi-extension-7f286a27564fe8e8101afee3295b7a2b7b52a605.tar.gz
ivi-controller: load id-agent module
Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
-rw-r--r--weston-ivi-shell/src/ivi-controller.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
index 8faec2a..fd6c7d8 100644
--- a/weston-ivi-shell/src/ivi-controller.c
+++ b/weston-ivi-shell/src/ivi-controller.c
@@ -2170,6 +2170,38 @@ launch_client_process(void *data)
free(shell->ivi_client_name);
}
+static int load_id_agent_module(struct ivishell *shell)
+{
+ struct weston_config *config = wet_get_config(shell->compositor);
+ struct weston_config_section *section;
+ char *id_agent_module = NULL;
+
+ int (*id_agent_module_init)(struct weston_compositor *compositor,
+ const struct ivi_layout_interface *interface);
+
+ section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
+
+ if (weston_config_section_get_string(section, "ivi-id-agent-module",
+ &id_agent_module, NULL) < 0) {
+ /* input events are handled by weston's default grabs */
+ weston_log("ivi-controller: No ivi-id-agent-module set\n");
+ return 0;
+ }
+
+ id_agent_module_init = wet_load_module_entrypoint(id_agent_module, "id_agent_module_init");
+ if (!id_agent_module_init)
+ return -1;
+
+ if (id_agent_module_init(shell->compositor, shell->interface) != 0) {
+ weston_log("ivi-controller: Initialization of id-agent module failed\n");
+ return -1;
+ }
+
+ free(id_agent_module);
+
+ return 0;
+}
+
WL_EXPORT int
wet_module_init(struct weston_compositor *compositor,
int *argc, char *argv[])
@@ -2226,5 +2258,9 @@ wet_module_init(struct weston_compositor *compositor,
wl_event_loop_add_idle(loop, launch_client_process, shell);
}
+ if (load_id_agent_module(shell) < 0) {
+ weston_log("ivi-controller: id-agent module not loaded\n");
+ }
+
return 0;
}