hmi-controller: load as weston module

weston loads hmi-controller as a weston module.
IVI-shell does not need to load it explicitly.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Emre Ucan 7 years ago committed by Pekka Paalanen
parent a9db8d7d64
commit ffaf09eb2f
  1. 36
      ivi-shell/hmi-controller.c
  2. 2
      ivi-shell/weston.ini.in

@ -148,12 +148,6 @@ struct launcher_info {
int32_t index; int32_t index;
}; };
int
controller_module_init(struct weston_compositor *ec,
int *argc, char *argv[],
const struct ivi_layout_interface *interface,
size_t interface_version);
/***************************************************************************** /*****************************************************************************
* local functions * local functions
****************************************************************************/ ****************************************************************************/
@ -766,17 +760,26 @@ hmi_controller_destroy(struct wl_listener *listener, void *data)
* ivi_hmi_controller_home is requested. * ivi_hmi_controller_home is requested.
*/ */
static struct hmi_controller * static struct hmi_controller *
hmi_controller_create(struct weston_compositor *ec, hmi_controller_create(struct weston_compositor *ec)
const struct ivi_layout_interface *interface)
{ {
struct link_layer *tmp_link_layer = NULL; struct link_layer *tmp_link_layer = NULL;
int32_t panel_height = 0; int32_t panel_height = 0;
struct hmi_controller *hmi_ctrl = MEM_ALLOC(sizeof(*hmi_ctrl)); struct hmi_controller *hmi_ctrl;
const struct ivi_layout_interface *interface;
struct hmi_controller_layer *base_layer = NULL; struct hmi_controller_layer *base_layer = NULL;
struct hmi_controller_layer *application_layer = NULL; struct hmi_controller_layer *application_layer = NULL;
struct weston_output *output; struct weston_output *output;
int32_t i;
int32_t i = 0; interface = ivi_layout_get_api(ec);
if (!interface) {
weston_log("Cannot use ivi_layout_interface.\n");
return NULL;
}
hmi_ctrl = MEM_ALLOC(sizeof(*hmi_ctrl));
i = 0;
wl_array_init(&hmi_ctrl->ui_widgets); wl_array_init(&hmi_ctrl->ui_widgets);
hmi_ctrl->layout_mode = IVI_HMI_CONTROLLER_LAYOUT_MODE_TILING; hmi_ctrl->layout_mode = IVI_HMI_CONTROLLER_LAYOUT_MODE_TILING;
@ -1954,20 +1957,13 @@ launch_hmi_client_process(void *data)
* exported functions * exported functions
****************************************************************************/ ****************************************************************************/
WL_EXPORT int WL_EXPORT int
controller_module_init(struct weston_compositor *ec, wet_module_init(struct weston_compositor *ec,
int *argc, char *argv[], int *argc, char *argv[])
const struct ivi_layout_interface *interface,
size_t interface_version)
{ {
struct hmi_controller *hmi_ctrl = NULL; struct hmi_controller *hmi_ctrl = NULL;
struct wl_event_loop *loop = NULL; struct wl_event_loop *loop = NULL;
if (interface_version < sizeof(struct ivi_layout_interface)) { hmi_ctrl = hmi_controller_create(ec);
weston_log("ivi-shell: version mismatch of controller interface\n");
return -1;
}
hmi_ctrl = hmi_controller_create(ec, interface);
if (hmi_ctrl == NULL) if (hmi_ctrl == NULL)
return -1; return -1;

@ -1,8 +1,8 @@
[core] [core]
shell=@plugin_prefix@ivi-shell.so shell=@plugin_prefix@ivi-shell.so
modules=@plugin_prefix@hmi-controller.so
[ivi-shell] [ivi-shell]
ivi-module=@plugin_prefix@hmi-controller.so
ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface ivi-shell-user-interface=@abs_top_builddir@/weston-ivi-shell-user-interface
#developermode=true #developermode=true

Loading…
Cancel
Save