summaryrefslogtreecommitdiff
path: root/ivi-shell
diff options
context:
space:
mode:
authorUcan, Emre (ADITG/SW1) <eucan@de.adit-jv.com>2016-03-17 15:30:39 +0000
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-03-24 11:10:07 +0200
commit3a8521e0056d44602106ac7bbe38dab2c4a8a3ed (patch)
tree01f9b707627fe8b322b1660fcc8c274bb44aac31 /ivi-shell
parentff6a9f8474dbfdef79c87084f435d9b02c7a33b1 (diff)
downloadweston-3a8521e0056d44602106ac7bbe38dab2c4a8a3ed.tar.gz
ivi-shell: remove ivi_layout_get_screens API
The compositor data struct already has a list of weston outputs. Therefore, this API is not required. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Wataru Natsume <wnatsume@jp.adit-jv.com>
Diffstat (limited to 'ivi-shell')
-rw-r--r--ivi-shell/hmi-controller.c27
-rw-r--r--ivi-shell/ivi-layout-export.h8
-rw-r--r--ivi-shell/ivi-layout.c34
3 files changed, 2 insertions, 67 deletions
diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c
index c35f39cd..fced66b9 100644
--- a/ivi-shell/hmi-controller.c
+++ b/ivi-shell/hmi-controller.c
@@ -131,7 +131,6 @@ struct hmi_controller {
struct ui_setting ui_setting;
int32_t screen_num;
- struct ivi_layout_screen **pp_screen;
};
struct launcher_info {
@@ -521,22 +520,6 @@ switch_mode(struct hmi_controller *hmi_ctrl,
free(pp_surface);
}
-/**
- * Internal method to get screens from weston core
- * TODO: shall support hotplug of screens
- */
-static int32_t
-get_screens(struct hmi_controller *hmi_ctrl)
-{
- hmi_ctrl->pp_screen = NULL;
- hmi_ctrl->screen_num = 0;
- ivi_layout_interface->get_screens(&hmi_ctrl->screen_num, &hmi_ctrl->pp_screen);
-
- if (hmi_ctrl->pp_screen == NULL)
- return -1;
- else
- return 0;
-}
/**
* Internal method to get ivi_layout_screen
@@ -549,7 +532,7 @@ get_screen(int32_t screen_idx, struct hmi_controller *hmi_ctrl)
if (screen_idx > hmi_ctrl->screen_num - 1)
weston_log("Invalid index. Return NULL\n");
else
- iviscrn = hmi_ctrl->pp_screen[screen_idx];
+ iviscrn = ivi_layout_interface->get_screen_from_id(screen_idx);
return iviscrn;
}
@@ -767,7 +750,6 @@ hmi_controller_destroy(struct wl_listener *listener, void *data)
wl_array_release(&hmi_ctrl->ui_widgets);
free(hmi_ctrl->hmi_setting);
- free(hmi_ctrl->pp_screen);
free(hmi_ctrl);
}
@@ -803,14 +785,9 @@ hmi_controller_create(struct weston_compositor *ec)
hmi_ctrl->layout_mode = IVI_HMI_CONTROLLER_LAYOUT_MODE_TILING;
hmi_ctrl->hmi_setting = hmi_server_setting_create(ec);
hmi_ctrl->compositor = ec;
+ hmi_ctrl->screen_num = wl_list_length(&ec->output_list);
/* TODO: shall support hotplug of screens */
- if (get_screens(hmi_ctrl) < 0) {
- weston_log("ivi-shell: Failed to get screens\n");
- hmi_ctrl = NULL;
- return hmi_ctrl;
- }
-
iviscrn = get_screen(0, hmi_ctrl);
/* init base ivi_layer*/
diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
index 79cad5ce..dade418a 100644
--- a/ivi-shell/ivi-layout-export.h
+++ b/ivi-shell/ivi-layout-export.h
@@ -568,14 +568,6 @@ struct ivi_layout_interface {
(*get_screen_from_id)(uint32_t id_screen);
/**
- * \brief Get the ivi_screens
- *
- * \return IVI_SUCCEEDED if the method call was successful
- * \return IVI_FAILED if the method call was failed
- */
- int32_t (*get_screens)(int32_t *pLength, struct ivi_layout_screen ***ppArray);
-
- /**
* \brief Get the ivi_screens under the given ivi_layer
*
* \return IVI_SUCCEEDED if the method call was successful
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index aa36f4fb..1bbb7c24 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -1410,39 +1410,6 @@ ivi_layout_get_properties_of_layer(struct ivi_layout_layer *ivilayer)
}
static int32_t
-ivi_layout_get_screens(int32_t *pLength, struct ivi_layout_screen ***ppArray)
-{
- struct ivi_layout *layout = get_instance();
- struct ivi_layout_screen *iviscrn = NULL;
- int32_t length = 0;
- int32_t n = 0;
-
- if (pLength == NULL || ppArray == NULL) {
- weston_log("ivi_layout_get_screens: invalid argument\n");
- return IVI_FAILED;
- }
-
- length = wl_list_length(&layout->screen_list);
-
- if (length != 0) {
- /* the Array must be free by module which called this function */
- *ppArray = calloc(length, sizeof(struct ivi_layout_screen *));
- if (*ppArray == NULL) {
- weston_log("fails to allocate memory\n");
- return IVI_FAILED;
- }
-
- wl_list_for_each(iviscrn, &layout->screen_list, link) {
- (*ppArray)[n++] = iviscrn;
- }
- }
-
- *pLength = length;
-
- return IVI_SUCCEEDED;
-}
-
-static int32_t
ivi_layout_get_screens_under_layer(struct ivi_layout_layer *ivilayer,
int32_t *pLength,
struct ivi_layout_screen ***ppArray)
@@ -2457,7 +2424,6 @@ static struct ivi_layout_interface ivi_layout_interface = {
* screen controller interfaces part1
*/
.get_screen_from_id = ivi_layout_get_screen_from_id,
- .get_screens = ivi_layout_get_screens,
.get_screens_under_layer = ivi_layout_get_screens_under_layer,
.screen_add_layer = ivi_layout_screen_add_layer,
.screen_set_render_order = ivi_layout_screen_set_render_order,