1 From deee858b0b199d8cfa8033a46d7078f30b23725e Mon Sep 17 00:00:00 2001
2 From: "Ucan, Emre (ADITG/SW1)" <eucan@de.adit-jv.com>
3 Date: Thu, 2 Mar 2017 08:47:33 +0000
4 Subject: ivi-shell: add_screen_remove_layer API
6 It is analagous to layer_remove_surface API.
7 The API removes a layer from the render order
11 add the new vfunc at the end of
12 the ivi_layout_interface struct.
14 Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
15 Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
16 Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
18 diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
19 index 2317d6e..39ffde1 100644
20 --- a/ivi-shell/ivi-layout-export.h
21 +++ b/ivi-shell/ivi-layout-export.h
22 @@ -578,6 +578,16 @@ struct ivi_layout_interface {
24 struct ivi_layout_surface *
25 (*get_surface)(struct weston_surface *surface);
28 + * \brief Remove a ivi_layer to a weston_output which is currently managed
31 + * \return IVI_SUCCEEDED if the method call was successful
32 + * \return IVI_FAILED if the method call was failed
34 + int32_t (*screen_remove_layer)(struct weston_output *output,
35 + struct ivi_layout_layer *removelayer);
39 diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
40 index 298e18e..8e4280b 100644
41 --- a/ivi-shell/ivi-layout.c
42 +++ b/ivi-shell/ivi-layout.c
43 @@ -1664,6 +1664,27 @@ ivi_layout_screen_add_layer(struct weston_output *output,
47 +ivi_layout_screen_remove_layer(struct weston_output *output,
48 + struct ivi_layout_layer *removelayer)
50 + struct ivi_layout_screen *iviscrn;
52 + if (output == NULL || removelayer == NULL) {
53 + weston_log("ivi_layout_screen_remove_layer: invalid argument\n");
57 + iviscrn = get_screen_from_output(output);
59 + wl_list_remove(&removelayer->pending.link);
60 + wl_list_init(&removelayer->pending.link);
62 + iviscrn->order.dirty = 1;
64 + return IVI_SUCCEEDED;
68 ivi_layout_screen_set_render_order(struct weston_output *output,
69 struct ivi_layout_layer **pLayer,
71 @@ -2088,6 +2109,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
73 .get_screens_under_layer = ivi_layout_get_screens_under_layer,
74 .screen_add_layer = ivi_layout_screen_add_layer,
75 + .screen_remove_layer = ivi_layout_screen_remove_layer,
76 .screen_set_render_order = ivi_layout_screen_set_render_order,