Introduce meta-agl-profile-core and meta-agl-profile-graphics
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston / 0016-ivi-shell_add_screen_remove_layer_api.patch
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
5
6 It is analagous to layer_remove_surface API.
7 The API removes a layer from the render order
8 of the screen.
9
10 v3:
11 add the new vfunc at the end of
12 the ivi_layout_interface struct.
13
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>
17
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 {
23          */
24         struct ivi_layout_surface *
25                 (*get_surface)(struct weston_surface *surface);
26 +
27 +       /**
28 +        * \brief Remove a ivi_layer to a weston_output which is currently managed
29 +        * by the service
30 +        *
31 +        * \return IVI_SUCCEEDED if the method call was successful
32 +        * \return IVI_FAILED if the method call was failed
33 +        */
34 +       int32_t (*screen_remove_layer)(struct weston_output *output,
35 +                                      struct ivi_layout_layer *removelayer);
36  };
37  
38  #ifdef __cplusplus
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,
44  }
45  
46  static int32_t
47 +ivi_layout_screen_remove_layer(struct weston_output *output,
48 +                           struct ivi_layout_layer *removelayer)
49 +{
50 +       struct ivi_layout_screen *iviscrn;
51 +
52 +       if (output == NULL || removelayer == NULL) {
53 +               weston_log("ivi_layout_screen_remove_layer: invalid argument\n");
54 +               return IVI_FAILED;
55 +       }
56 +
57 +       iviscrn = get_screen_from_output(output);
58 +
59 +       wl_list_remove(&removelayer->pending.link);
60 +       wl_list_init(&removelayer->pending.link);
61 +
62 +       iviscrn->order.dirty = 1;
63 +
64 +       return IVI_SUCCEEDED;
65 +}
66 +
67 +static int32_t
68  ivi_layout_screen_set_render_order(struct weston_output *output,
69                                    struct ivi_layout_layer **pLayer,
70                                    const int32_t number)
71 @@ -2088,6 +2109,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
72          */
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,
77  
78         /**
79 -- 
80 cgit v0.10.2
81
82