summaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0017-ivi-shell-register-ivi_layout_interface.patch
blob: 87d883c02233cb4518012a766ff2737b6160fa09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
From 5b1d282c7a7d2badf74bb19f9ddc0d49d3d4562b Mon Sep 17 00:00:00 2001
From: Emre Ucan <eucan@de.adit-jv.com>
Date: Thu, 25 Jan 2018 14:36:10 +0100
Subject: [PATCH] ivi-shell: register ivi_layout_interface

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
---
 ivi-shell/ivi-layout-export.h | 13 +++++++++++++
 ivi-shell/ivi-layout.c        |  6 ++++++
 ivi-shell/ivi-shell.c         |  2 --
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
index 2317d6e..9452691 100644
--- a/ivi-shell/ivi-layout-export.h
+++ b/ivi-shell/ivi-layout-export.h
@@ -59,6 +59,7 @@ extern "C" {
 
 #include "stdbool.h"
 #include "compositor.h"
+#include "plugin-registry.h"
 
 #define IVI_SUCCEEDED (0)
 #define IVI_FAILED (-1)
@@ -140,6 +141,8 @@ enum ivi_layout_transition_type{
 	IVI_LAYOUT_TRANSITION_MAX,
 };
 
+#define IVI_LAYOUT_API_NAME "ivi_layout_api_v1"
+
 struct ivi_layout_interface {
 
 	/**
@@ -580,6 +583,16 @@ struct ivi_layout_interface {
 		(*get_surface)(struct weston_surface *surface);
 };
 
+static inline const struct ivi_layout_interface *
+ivi_layout_get_api(struct weston_compositor *compositor)
+{
+	const void *api;
+	api = weston_plugin_api_get(compositor, IVI_LAYOUT_API_NAME,
+				    sizeof(struct ivi_layout_interface));
+
+	return (const struct ivi_layout_interface *)api;
+}
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 64e4ead..c2c1a35 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2000,6 +2000,8 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
 	return ivisurf;
 }
 
+static struct ivi_layout_interface ivi_layout_interface;
+
 void
 ivi_layout_init_with_compositor(struct weston_compositor *ec)
 {
@@ -2028,6 +2030,10 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec)
 
 	layout->transitions = ivi_layout_transition_set_create(ec);
 	wl_list_init(&layout->pending_transition_list);
+
+	weston_plugin_api_register(ec, IVI_LAYOUT_API_NAME,
+				   &ivi_layout_interface,
+				   sizeof(struct ivi_layout_interface));
 }
 
 static struct ivi_layout_interface ivi_layout_interface = {
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index 67619b8..2dabdf9 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -425,8 +425,6 @@ ivi_shell_setting_create(struct ivi_shell_setting *dest,
 	if (!dest->ivi_module &&
 	    weston_config_section_get_string(section, "ivi-module",
 					     &dest->ivi_module, NULL) < 0) {
-		weston_log("Error: ivi-shell: No ivi-module set\n");
-		result = -1;
 	}
 
 	weston_config_section_get_bool(section, "developermode",
-- 
2.7.4