From 65e1be1234fcbb7455fc9b41ac9916d258cf39f8 Mon Sep 17 00:00:00 2001 From: Michael Teyfel Date: Tue, 17 Oct 2017 11:03:38 +0200 Subject: [PATCH] ivi-layout: introduced configure_desktop_changed Introduced signal configure_desktop_changed with interface. This signal should be sent, when a desktop-surface is configured. Signed-off-by: Michael Teyfel --- ivi-shell/ivi-layout-export.h | 10 ++++++++++ ivi-shell/ivi-layout-private.h | 1 + ivi-shell/ivi-layout.c | 17 +++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h index a3ec645a..c65eb306 100644 --- a/ivi-shell/ivi-layout-export.h +++ b/ivi-shell/ivi-layout-export.h @@ -190,6 +190,16 @@ struct ivi_layout_interface { */ int32_t (*add_listener_configure_surface)(struct wl_listener *listener); + /** + * \brief add a listener for notification when desktop_surface is configured + * + * When an desktop_surface is configured, a signal is emitted + * to the listening controller plugins. + * The pointer of the configured desktop_surface is sent as the void *data argument + * to the wl_listener::notify callback function of the listener. + */ + int32_t (*add_listener_configure_desktop_surface)(struct wl_listener *listener); + /** * \brief Get all ivi_surfaces which are currently registered and managed * by the services diff --git a/ivi-shell/ivi-layout-private.h b/ivi-shell/ivi-layout-private.h index 2b8bd472..fe5be01a 100644 --- a/ivi-shell/ivi-layout-private.h +++ b/ivi-shell/ivi-layout-private.h @@ -104,6 +104,7 @@ struct ivi_layout { struct wl_signal created; struct wl_signal removed; struct wl_signal configure_changed; + struct wl_signal configure_desktop_changed; } surface_notification; struct weston_layer layout_layer; diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 95a7f628..9e4cd1f1 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -968,6 +968,21 @@ ivi_layout_add_listener_configure_surface(struct wl_listener *listener) return IVI_SUCCEEDED; } +static int32_t +ivi_layout_add_listener_configure_desktop_surface(struct wl_listener *listener) +{ + struct ivi_layout *layout = get_instance(); + + if (!listener) { + weston_log("ivi_layout_add_listener_configure_desktop_surface: invalid argument\n"); + return IVI_FAILED; + } + + wl_signal_add(&layout->surface_notification.configure_desktop_changed, listener); + + return IVI_SUCCEEDED; +} + uint32_t ivi_layout_get_id_of_surface(struct ivi_layout_surface *ivisurf) { @@ -1969,6 +1984,7 @@ ivi_layout_init_with_compositor(struct weston_compositor *ec) wl_signal_init(&layout->surface_notification.created); wl_signal_init(&layout->surface_notification.removed); wl_signal_init(&layout->surface_notification.configure_changed); + wl_signal_init(&layout->surface_notification.configure_desktop_changed); /* Add layout_layer at the last of weston_compositor.layer_list */ weston_layer_init(&layout->layout_layer, ec); @@ -1997,6 +2013,7 @@ static struct ivi_layout_interface ivi_layout_interface = { .add_listener_create_surface = ivi_layout_add_listener_create_surface, .add_listener_remove_surface = ivi_layout_add_listener_remove_surface, .add_listener_configure_surface = ivi_layout_add_listener_configure_surface, + .add_listener_configure_desktop_surface = ivi_layout_add_listener_configure_desktop_surface, .get_surface = shell_get_ivi_layout_surface, .get_surfaces = ivi_layout_get_surfaces, .get_id_of_surface = ivi_layout_get_id_of_surface,