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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
index 68ca68ba..c86cbb11 100644
--- a/ivi-shell/ivi-layout-shell.h
+++ b/ivi-shell/ivi-layout-shell.h
@@ -39,6 +39,14 @@ struct weston_view;
struct weston_surface;
struct ivi_layout_surface;
+void
+ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
+ int32_t width, int32_t height);
+
+struct ivi_layout_surface*
+ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
+ uint32_t id_surface);
+
void
ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
int32_t width, int32_t height);
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 690af742..086d0fd2 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -1995,20 +1995,8 @@ ivi_layout_surface_dump(struct weston_surface *surface,
* methods of interaction between ivi-shell with ivi-layout
*/
-void
-ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
- int32_t width, int32_t height)
-{
- struct ivi_layout *layout = get_instance();
-
- /* emit callback which is set by ivi-layout api user */
- wl_signal_emit(&layout->surface_notification.configure_changed,
- ivisurf);
-}
-
-struct ivi_layout_surface*
-ivi_layout_surface_create(struct weston_surface *wl_surface,
- uint32_t id_surface)
+static struct ivi_layout_surface*
+surface_create(struct weston_surface *wl_surface, uint32_t id_surface)
{
struct ivi_layout *layout = get_instance();
struct ivi_layout_surface *ivisurf = NULL;
@@ -2018,14 +2006,6 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
return NULL;
}
- ivisurf = get_surface(&layout->surface_list, id_surface);
- if (ivisurf != NULL) {
- if (ivisurf->surface != NULL) {
- weston_log("id_surface(%d) is already created\n", id_surface);
- return NULL;
- }
- }
-
ivisurf = calloc(1, sizeof *ivisurf);
if (ivisurf == NULL) {
weston_log("fails to allocate memory\n");
@@ -2049,7 +2029,55 @@ ivi_layout_surface_create(struct weston_surface *wl_surface,
wl_list_insert(&layout->surface_list, &ivisurf->link);
- wl_signal_emit(&layout->surface_notification.created, ivisurf);
+ return ivisurf;
+}
+
+void
+ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
+ int32_t width, int32_t height)
+{
+ struct ivi_layout *layout = get_instance();
+
+ /* emit callback which is set by ivi-layout api user */
+ wl_signal_emit(&layout->surface_notification.configure_desktop_changed,
+ ivisurf);
+}
+
+struct ivi_layout_surface*
+ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
+ uint32_t id_surface)
+{
+ return surface_create(wl_surface, id_surface);
+}
+
+void
+ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
+ int32_t width, int32_t height)
+{
+ struct ivi_layout *layout = get_instance();
+
+ /* emit callback which is set by ivi-layout api user */
+ wl_signal_emit(&layout->surface_notification.configure_changed,
+ ivisurf);
+}
+
+struct ivi_layout_surface*
+ivi_layout_surface_create(struct weston_surface *wl_surface,
+ uint32_t id_surface)
+{
+ struct ivi_layout *layout = get_instance();
+ struct ivi_layout_surface *ivisurf = NULL;
+
+ ivisurf = get_surface(&layout->surface_list, id_surface);
+ if (ivisurf) {
+ weston_log("id_surface(%d) is already created\n", id_surface);
+ return NULL;
+ }
+
+ ivisurf = surface_create(wl_surface, id_surface);
+
+ if (ivisurf)
+ wl_signal_emit(&layout->surface_notification.created, ivisurf);
return ivisurf;
}
|