ivi-shell: don't load controller modules
controller modules can be loaded as weston modules from the main function of weston. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
0707b0e5d4
commit
0c1bbb9e52
@@ -2012,43 +2012,3 @@ static struct ivi_layout_interface ivi_layout_interface = {
|
|||||||
.surface_get_size = ivi_layout_surface_get_size,
|
.surface_get_size = ivi_layout_surface_get_size,
|
||||||
.surface_dump = ivi_layout_surface_dump,
|
.surface_dump = ivi_layout_surface_dump,
|
||||||
};
|
};
|
||||||
|
|
||||||
int
|
|
||||||
load_controller_modules(struct weston_compositor *compositor, const char *modules,
|
|
||||||
int *argc, char *argv[])
|
|
||||||
{
|
|
||||||
const char *p, *end;
|
|
||||||
char buffer[256];
|
|
||||||
int (*controller_module_init)(struct weston_compositor *compositor,
|
|
||||||
int *argc, char *argv[],
|
|
||||||
const struct ivi_layout_interface *interface,
|
|
||||||
size_t interface_version);
|
|
||||||
|
|
||||||
if (modules == NULL)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
p = modules;
|
|
||||||
while (*p) {
|
|
||||||
end = strchrnul(p, ',');
|
|
||||||
snprintf(buffer, sizeof buffer, "%.*s", (int)(end - p), p);
|
|
||||||
|
|
||||||
controller_module_init =
|
|
||||||
wet_load_module_entrypoint(buffer,
|
|
||||||
"controller_module_init");
|
|
||||||
if (!controller_module_init)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (controller_module_init(compositor, argc, argv,
|
|
||||||
&ivi_layout_interface,
|
|
||||||
sizeof(struct ivi_layout_interface)) != 0) {
|
|
||||||
weston_log("ivi-shell: Initialization of controller module fails");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
p = end;
|
|
||||||
while (*p == ',')
|
|
||||||
p++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|||||||
+4
-24
@@ -69,7 +69,6 @@ struct ivi_shell_surface
|
|||||||
|
|
||||||
struct ivi_shell_setting
|
struct ivi_shell_setting
|
||||||
{
|
{
|
||||||
char *ivi_module;
|
|
||||||
int developermode;
|
int developermode;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -413,20 +412,8 @@ ivi_shell_setting_create(struct ivi_shell_setting *dest,
|
|||||||
struct weston_config *config = wet_get_config(compositor);
|
struct weston_config *config = wet_get_config(compositor);
|
||||||
struct weston_config_section *section;
|
struct weston_config_section *section;
|
||||||
|
|
||||||
const struct weston_option ivi_shell_options[] = {
|
|
||||||
{ WESTON_OPTION_STRING, "ivi-module", 0, &dest->ivi_module },
|
|
||||||
};
|
|
||||||
|
|
||||||
parse_options(ivi_shell_options, ARRAY_LENGTH(ivi_shell_options),
|
|
||||||
argc, argv);
|
|
||||||
|
|
||||||
section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
|
section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
|
||||||
|
|
||||||
if (!dest->ivi_module &&
|
|
||||||
weston_config_section_get_string(section, "ivi-module",
|
|
||||||
&dest->ivi_module, NULL) < 0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
weston_config_section_get_bool(section, "developermode",
|
weston_config_section_get_bool(section, "developermode",
|
||||||
&dest->developermode, 0);
|
&dest->developermode, 0);
|
||||||
|
|
||||||
@@ -512,29 +499,22 @@ wet_shell_init(struct weston_compositor *compositor,
|
|||||||
wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener);
|
wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener);
|
||||||
|
|
||||||
if (input_panel_setup(shell) < 0)
|
if (input_panel_setup(shell) < 0)
|
||||||
goto out_settings;
|
goto out;
|
||||||
|
|
||||||
shell->text_backend = text_backend_init(compositor);
|
shell->text_backend = text_backend_init(compositor);
|
||||||
if (!shell->text_backend)
|
if (!shell->text_backend)
|
||||||
goto out_settings;
|
goto out;
|
||||||
|
|
||||||
if (wl_global_create(compositor->wl_display,
|
if (wl_global_create(compositor->wl_display,
|
||||||
&ivi_application_interface, 1,
|
&ivi_application_interface, 1,
|
||||||
shell, bind_ivi_application) == NULL)
|
shell, bind_ivi_application) == NULL)
|
||||||
goto out_settings;
|
goto out;
|
||||||
|
|
||||||
ivi_layout_init_with_compositor(compositor);
|
ivi_layout_init_with_compositor(compositor);
|
||||||
shell_add_bindings(compositor, shell);
|
shell_add_bindings(compositor, shell);
|
||||||
|
|
||||||
/* Call module_init of ivi-modules which are defined in weston.ini */
|
|
||||||
if (load_controller_modules(compositor, setting.ivi_module,
|
|
||||||
argc, argv) < 0)
|
|
||||||
goto out_settings;
|
|
||||||
|
|
||||||
retval = 0;
|
retval = 0;
|
||||||
|
|
||||||
out_settings:
|
out:
|
||||||
free(setting.ivi_module);
|
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user