meta-agl-profile-telematics: recipes-core: systemd: change canbus systemd match regex
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston / 0017-ivi-shell-register-ivi_layout_interface.patch
1 From 5b1d282c7a7d2badf74bb19f9ddc0d49d3d4562b Mon Sep 17 00:00:00 2001
2 From: Emre Ucan <eucan@de.adit-jv.com>
3 Date: Thu, 25 Jan 2018 14:36:10 +0100
4 Subject: [PATCH] ivi-shell: register ivi_layout_interface
5
6 Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
7 Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
8 ---
9  ivi-shell/ivi-layout-export.h | 13 +++++++++++++
10  ivi-shell/ivi-layout.c        |  6 ++++++
11  ivi-shell/ivi-shell.c         |  2 --
12  3 files changed, 19 insertions(+), 2 deletions(-)
13
14 diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
15 index 2317d6e..9452691 100644
16 --- a/ivi-shell/ivi-layout-export.h
17 +++ b/ivi-shell/ivi-layout-export.h
18 @@ -59,6 +59,7 @@ extern "C" {
19  
20  #include "stdbool.h"
21  #include "compositor.h"
22 +#include "plugin-registry.h"
23  
24  #define IVI_SUCCEEDED (0)
25  #define IVI_FAILED (-1)
26 @@ -140,6 +141,8 @@ enum ivi_layout_transition_type{
27         IVI_LAYOUT_TRANSITION_MAX,
28  };
29  
30 +#define IVI_LAYOUT_API_NAME "ivi_layout_api_v1"
31 +
32  struct ivi_layout_interface {
33  
34         /**
35 @@ -580,6 +583,16 @@ struct ivi_layout_interface {
36                 (*get_surface)(struct weston_surface *surface);
37  };
38  
39 +static inline const struct ivi_layout_interface *
40 +ivi_layout_get_api(struct weston_compositor *compositor)
41 +{
42 +       const void *api;
43 +       api = weston_plugin_api_get(compositor, IVI_LAYOUT_API_NAME,
44 +                                   sizeof(struct ivi_layout_interface));
45 +
46 +       return (const struct ivi_layout_interface *)api;
47 +}
48 +
49  #ifdef __cplusplus
50  }
51  #endif /* __cplusplus */
52 diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
53 index 64e4ead..c2c1a35 100644
54 --- a/ivi-shell/ivi-layout.c
55 +++ b/ivi-shell/ivi-layout.c
56 @@ -2000,6 +2000,8 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
57         return ivisurf;
58  }
59  
60 +static struct ivi_layout_interface ivi_layout_interface;
61 +
62  void
63  ivi_layout_init_with_compositor(struct weston_compositor *ec)
64  {
65 @@ -2028,6 +2030,10 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec)
66  
67         layout->transitions = ivi_layout_transition_set_create(ec);
68         wl_list_init(&layout->pending_transition_list);
69 +
70 +       weston_plugin_api_register(ec, IVI_LAYOUT_API_NAME,
71 +                                  &ivi_layout_interface,
72 +                                  sizeof(struct ivi_layout_interface));
73  }
74  
75  static struct ivi_layout_interface ivi_layout_interface = {
76 diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
77 index 67619b8..2dabdf9 100644
78 --- a/ivi-shell/ivi-shell.c
79 +++ b/ivi-shell/ivi-shell.c
80 @@ -425,8 +425,6 @@ ivi_shell_setting_create(struct ivi_shell_setting *dest,
81         if (!dest->ivi_module &&
82             weston_config_section_get_string(section, "ivi-module",
83                                              &dest->ivi_module, NULL) < 0) {
84 -               weston_log("Error: ivi-shell: No ivi-module set\n");
85 -               result = -1;
86         }
87  
88         weston_config_section_get_bool(section, "developermode",
89 -- 
90 2.7.4
91