summaryrefslogtreecommitdiff
path: root/ivi-shell/ivi-shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'ivi-shell/ivi-shell.c')
-rw-r--r--ivi-shell/ivi-shell.c48
1 files changed, 33 insertions, 15 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index 31d39ccf..ae8d06eb 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -39,12 +39,10 @@
#include <string.h>
#include <linux/input.h>
-#include "compositor.h"
+#include "ivi-shell.h"
#include "ivi-application-server-protocol.h"
#include "weston-layout.h"
-struct ivi_shell;
-
struct ivi_shell_surface
{
struct ivi_shell *shell;
@@ -59,16 +57,6 @@ struct ivi_shell_surface
struct wl_list link;
};
-struct ivi_shell
-{
- struct wl_resource *resource;
- struct wl_listener destroy_listener;
-
- struct weston_compositor *compositor;
-
- struct wl_list ivi_surface_list; /* struct ivi_shell_surface::link */
-};
-
/* ------------------------------------------------------------------------- */
/* common functions */
/* ------------------------------------------------------------------------- */
@@ -255,6 +243,29 @@ bind_ivi_application(struct wl_client *client,
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 = weston_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);
+}
+
/**
* Initialization/destruction method of ivi-shell
*/
@@ -265,6 +276,8 @@ shell_destroy(struct wl_listener *listener, void *data)
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);
@@ -277,9 +290,10 @@ static void
init_ivi_shell(struct weston_compositor *ec, struct ivi_shell *shell)
{
shell->compositor = ec;
-
- wl_list_init(&ec->layer_list);
wl_list_init(&shell->ivi_surface_list);
+
+ weston_layer_init(&shell->panel_layer, &ec->cursor_layer.link);
+ weston_layer_init(&shell->input_panel_layer, NULL);
}
/**
@@ -300,11 +314,15 @@ module_init(struct weston_compositor *ec,
}
init_ivi_shell(ec, shell);
+
weston_layout_initWithCompositor(ec);
shell->destroy_listener.notify = shell_destroy;
wl_signal_add(&ec->destroy_signal, &shell->destroy_listener);
+ if (input_panel_setup(shell) < 0)
+ return -1;
+
if (wl_global_create(ec->wl_display, &ivi_application_interface, 1,
shell, bind_ivi_application) == NULL) {
return -1;