ivi-shell: rework remove_layer notification
The add_notification_remove_layer API accepts a simple
wl_listener instead of a ivi-shell specific notification
function. Therefore, the API is renamed to add_listener_remove_layer.
This change has several advantages:
1. Code cleanup
2. No dynamic memory allocation. Listeners are allocated
by controller plugins
3. Remove API is not needed. Controller plugins can easily
remove the listener link.
The remove API is removed too:
- ivi_layout_remove_notification_remove_layer
Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h
index c2a8c10..2ed1e76 100644
--- a/ivi-shell/ivi-layout-export.h
+++ b/ivi-shell/ivi-layout-export.h
@@ -138,10 +138,6 @@
IVI_LAYOUT_TRANSITION_MAX,
};
-typedef void (*layer_remove_notification_func)(
- struct ivi_layout_layer *ivilayer,
- void *userdata);
-
typedef void (*surface_remove_notification_func)(
struct ivi_layout_surface *ivisurf,
void *userdata);
@@ -345,15 +341,14 @@
int32_t (*add_listener_create_layer)(struct wl_listener *listener);
/**
- * \brief register/unregister for notification when ivi_layer is removed
+ * \brief add a listener for notification when ivi_layer is removed
+ *
+ * When an ivi_layer is removed, a signal is emitted
+ * to the listening controller plugins.
+ * The pointer of the removed ivi_layer is sent as the void *data argument
+ * to the wl_listener::notify callback function of the listener.
*/
- int32_t (*add_notification_remove_layer)(
- layer_remove_notification_func callback,
- void *userdata);
-
- void (*remove_notification_remove_layer)(
- layer_remove_notification_func callback,
- void *userdata);
+ int32_t (*add_listener_remove_layer)(struct wl_listener *listener);
/**
* \brief Create a ivi_layer which should be managed by the service