diff options
author | Emre Ucan <eucan@de.adit-jv.com> | 2015-08-25 15:38:28 +0200 |
---|---|---|
committer | Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp> | 2015-08-27 15:31:05 +0900 |
commit | f1efde1b15af229093ca501bac3dae3a9f2ab1f1 (patch) | |
tree | 035682284ebb085daaddf7f19bf715f2b837c6a6 /weston-ivi-shell | |
parent | f13b9912f6eb4fec0698325996e9b264f9dc7fe7 (diff) | |
download | wayland-ivi-extension-f1efde1b15af229093ca501bac3dae3a9f2ab1f1.tar.gz |
ivi-controller: remove struct link_screen
A layer can be on only one screen. Therefore, the struct link_screen is
not required. Instead, struct ivilayer has a pointer to the screen. In
the future, a feature to support that a layer belongs to several screens
would be supported again if somebody requires.
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Diffstat (limited to 'weston-ivi-shell')
-rw-r--r-- | weston-ivi-shell/src/ivi-controller-impl.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/weston-ivi-shell/src/ivi-controller-impl.c b/weston-ivi-shell/src/ivi-controller-impl.c index 1fb4de0..f01913a 100644 --- a/weston-ivi-shell/src/ivi-controller-impl.c +++ b/weston-ivi-shell/src/ivi-controller-impl.c @@ -43,11 +43,6 @@ struct link_layer { struct wl_list link; }; -struct link_screen { - struct iviscreen *screen; - struct wl_list link; -}; - struct ivisurface { struct wl_list link; struct wl_client *client; @@ -64,7 +59,7 @@ struct ivilayer { struct wl_list link; struct ivishell *shell; struct ivi_layout_layer *layout_layer; - struct wl_list list_screen; + struct iviscreen *on_screen; uint32_t controller_layer_count; int layer_canbe_removed; }; @@ -513,8 +508,6 @@ send_layer_add_event(struct ivilayer *ivilayer, int32_t length = 0; int32_t ans = 0; int i = 0; - struct link_screen *link_scrn = NULL; - struct link_screen *next = NULL; struct iviscreen *iviscrn = NULL; struct ivishell *shell = ivilayer->shell; struct wl_client *client = wl_resource_get_client(resource); @@ -529,9 +522,7 @@ send_layer_add_event(struct ivilayer *ivilayer, /* Send Null to cancel added layer */ if (mask & IVI_NOTIFICATION_REMOVE) { - wl_list_for_each_safe(link_scrn, next, &ivilayer->list_screen, link) { ivi_controller_layer_send_screen(resource, NULL); - } } else if (mask & IVI_NOTIFICATION_ADD) { for (i = 0; i < (int)length; i++) { @@ -607,8 +598,6 @@ update_layer_prop(struct ivilayer *ivilayer, struct ivi_layout_screen **pArray = NULL; int32_t length = 0; int32_t ans = 0; - struct link_screen *link_scrn = NULL; - struct link_screen *next = NULL; struct ivishell *shell = ivilayer->shell; ans = ivi_extension_get_screens_under_layer(shell, ivilayer->layout_layer, @@ -620,36 +609,20 @@ update_layer_prop(struct ivilayer *ivilayer, /* Send Null to cancel added layer */ if (mask & IVI_NOTIFICATION_REMOVE) { - wl_list_for_each_safe(link_scrn, next, &ivilayer->list_screen, link) { - wl_list_remove(&link_scrn->link); - free(link_scrn); - link_scrn = NULL; - } + ivilayer->on_screen = NULL; } if (mask & IVI_NOTIFICATION_ADD) { int i = 0; for (i = 0; i < (int)length; i++) { struct ivishell *shell = ivilayer->shell; struct iviscreen *iviscrn = NULL; - /* Create list_screen */ - link_scrn = calloc(1, sizeof(*link_scrn)); - if (NULL == link_scrn) { - continue; - } - link_scrn->screen = NULL; + wl_list_for_each(iviscrn, &shell->list_screen, link) { if (iviscrn->layout_screen == pArray[i]) { - link_scrn->screen = iviscrn; + ivilayer->on_screen = iviscrn; break; } } - - if (link_scrn->screen == NULL) { - free(link_scrn); - link_scrn = NULL; - continue; - } - wl_list_insert(&ivilayer->list_screen, &link_scrn->link); } } @@ -1451,7 +1424,6 @@ create_layer(struct ivishell *shell, } ivilayer->shell = shell; - wl_list_init(&ivilayer->list_screen); wl_list_insert(&shell->list_layer, &ivilayer->link); ivilayer->layout_layer = layout_layer; |