ivi-shell: reference implementation of input panel for ivi-shell
- introduces ivi-shell/input-panel-ivi.c which is basically copied
from desktop shell. It shall be improvaded to remove duplicate
implementation.
Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index 50894fb..a14010e 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -314,6 +314,31 @@
shell, NULL);
}
+struct weston_view *
+get_default_view(struct weston_surface *surface)
+{
+ struct ivi_shell_surface *shsurf;
+ struct weston_view *view;
+
+ if (!surface || wl_list_empty(&surface->views))
+ return NULL;
+
+ shsurf = get_ivi_shell_surface(surface);
+ if (shsurf && shsurf->layout_surface) {
+ view = shsurf->shell->ivi_layout->get_weston_view(shsurf->layout_surface);
+ if (view)
+ return view;
+ }
+
+ wl_list_for_each(view, &surface->views, surface_link) {
+ if (weston_view_is_mapped(view))
+ return view;
+ }
+
+ return container_of(surface->views.next,
+ struct weston_view, surface_link);
+}
+
/*
* Called through the compositor's destroy signal.
*/
@@ -324,6 +349,8 @@
container_of(listener, struct ivi_shell, destroy_listener);
struct ivi_shell_surface *ivisurf, *next;
+ input_panel_destroy(shell);
+
wl_list_for_each_safe(ivisurf, next, &shell->ivi_surface_list, link) {
wl_list_remove(&ivisurf->link);
free(ivisurf);
@@ -339,6 +366,7 @@
wl_list_init(&shell->ivi_surface_list);
+ weston_layer_init(&shell->input_panel_layer, NULL);
}
static int
@@ -413,6 +441,8 @@
shell->destroy_listener.notify = shell_destroy;
wl_signal_add(&compositor->destroy_signal, &shell->destroy_listener);
+ if (input_panel_setup(shell) < 0)
+ return -1;
if (wl_global_create(compositor->wl_display,
&ivi_application_interface, 1,