[PATCH] ivi-shell: reordering method in ivi_layout.c

Nobuhiko Tanibata NOBUHIKO_TANIBATA at xddp.denso.co.jp
Sun Dec 14 20:20:44 PST 2014


In the future, re-alignmenet of WL_EXPORT per method should be done.
For that work, re-ordering is required to be used by another method.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>
---
 ivi-shell/ivi-layout.c | 171 +++++++++++++++++++++++++------------------------
 1 file changed, 86 insertions(+), 85 deletions(-)

diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 93a4144..ff5d014 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -273,6 +273,81 @@ get_layer(struct wl_list *layer_list, uint32_t id_layer)
 	return NULL;
 }
 
+static void
+remove_configured_listener(struct ivi_layout_surface *ivisurf)
+{
+	struct wl_listener *link = NULL;
+	struct wl_listener *next = NULL;
+
+	wl_list_for_each_safe(link, next, &ivisurf->configured.listener_list, link) {
+		wl_list_remove(&link->link);
+	}
+}
+
+
+static void
+remove_all_notification(struct wl_list *listener_list)
+{
+	struct wl_listener *listener = NULL;
+	struct wl_listener *next = NULL;
+
+	wl_list_for_each_safe(listener, next, listener_list, link) {
+		struct listener_layout_notification *notification = NULL;
+		if (!wl_list_empty(&listener->link)) {
+			wl_list_remove(&listener->link);
+		}
+
+		notification =
+			container_of(listener,
+				     struct listener_layout_notification,
+				     listener);
+
+		free(notification->userdata);
+		free(notification);
+	}
+}
+
+WL_EXPORT void
+ivi_layout_surface_remove_notification(struct ivi_layout_surface *ivisurf)
+{
+	if (ivisurf == NULL) {
+		weston_log("ivi_layout_surface_remove_notification: invalid argument\n");
+		return;
+	}
+
+	remove_all_notification(&ivisurf->property_changed.listener_list);
+}
+
+void
+ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf)
+{
+	struct ivi_layout *layout = get_instance();
+
+	if (ivisurf == NULL) {
+		weston_log("ivi_layout_surface_remove: invalid argument\n");
+		return;
+	}
+
+	if (!wl_list_empty(&ivisurf->pending.link)) {
+		wl_list_remove(&ivisurf->pending.link);
+	}
+	if (!wl_list_empty(&ivisurf->order.link)) {
+		wl_list_remove(&ivisurf->order.link);
+	}
+	if (!wl_list_empty(&ivisurf->link)) {
+		wl_list_remove(&ivisurf->link);
+	}
+	remove_ordersurface_from_layer(ivisurf);
+
+	wl_signal_emit(&layout->surface_notification.removed, ivisurf);
+
+	remove_configured_listener(ivisurf);
+
+	ivi_layout_surface_remove_notification(ivisurf);
+
+	free(ivisurf);
+}
+
 /**
  * Called at destruction of ivi_surface
  */
@@ -1210,28 +1285,6 @@ remove_notification(struct wl_list *listener_list, void *callback, void *userdat
 	}
 }
 
-static void
-remove_all_notification(struct wl_list *listener_list)
-{
-	struct wl_listener *listener = NULL;
-	struct wl_listener *next = NULL;
-
-	wl_list_for_each_safe(listener, next, listener_list, link) {
-		struct listener_layout_notification *notification = NULL;
-		if (!wl_list_empty(&listener->link)) {
-			wl_list_remove(&listener->link);
-		}
-
-		notification =
-			container_of(listener,
-				     struct listener_layout_notification,
-				     listener);
-
-		free(notification->userdata);
-		free(notification);
-	}
-}
-
 /**
  * Exported APIs of ivi-layout library are implemented from here.
  * Brief of APIs is described in ivi-layout-export.h.
@@ -1515,58 +1568,6 @@ ivi_layout_surface_add_notification(struct ivi_layout_surface *ivisurf,
 	return IVI_SUCCEEDED;
 }
 
-WL_EXPORT void
-ivi_layout_surface_remove_notification(struct ivi_layout_surface *ivisurf)
-{
-	if (ivisurf == NULL) {
-		weston_log("ivi_layout_surface_remove_notification: invalid argument\n");
-		return;
-	}
-
-	remove_all_notification(&ivisurf->property_changed.listener_list);
-}
-
-static void
-remove_configured_listener(struct ivi_layout_surface *ivisurf)
-{
-	struct wl_listener *link = NULL;
-	struct wl_listener *next = NULL;
-
-	wl_list_for_each_safe(link, next, &ivisurf->configured.listener_list, link) {
-		wl_list_remove(&link->link);
-	}
-}
-
-void
-ivi_layout_surface_remove(struct ivi_layout_surface *ivisurf)
-{
-	struct ivi_layout *layout = get_instance();
-
-	if (ivisurf == NULL) {
-		weston_log("ivi_layout_surface_remove: invalid argument\n");
-		return;
-	}
-
-	if (!wl_list_empty(&ivisurf->pending.link)) {
-		wl_list_remove(&ivisurf->pending.link);
-	}
-	if (!wl_list_empty(&ivisurf->order.link)) {
-		wl_list_remove(&ivisurf->order.link);
-	}
-	if (!wl_list_empty(&ivisurf->link)) {
-		wl_list_remove(&ivisurf->link);
-	}
-	remove_ordersurface_from_layer(ivisurf);
-
-	wl_signal_emit(&layout->surface_notification.removed, ivisurf);
-
-	remove_configured_listener(ivisurf);
-
-	ivi_layout_surface_remove_notification(ivisurf);
-
-	free(ivisurf);
-}
-
 WL_EXPORT const struct ivi_layout_layer_properties *
 ivi_layout_get_properties_of_layer(struct ivi_layout_layer *ivilayer)
 {
@@ -1857,6 +1858,17 @@ ivi_layout_layer_create_with_dimension(uint32_t id_layer,
 }
 
 WL_EXPORT void
+ivi_layout_layer_remove_notification(struct ivi_layout_layer *ivilayer)
+{
+	if (ivilayer == NULL) {
+		weston_log("ivi_layout_layer_remove_notification: invalid argument\n");
+		return;
+	}
+
+	remove_all_notification(&ivilayer->property_changed.listener_list);
+}
+
+WL_EXPORT void
 ivi_layout_layer_remove(struct ivi_layout_layer *ivilayer)
 {
 	struct ivi_layout *layout = get_instance();
@@ -2470,17 +2482,6 @@ ivi_layout_layer_add_notification(struct ivi_layout_layer *ivilayer,
 				prop_callback);
 }
 
-WL_EXPORT void
-ivi_layout_layer_remove_notification(struct ivi_layout_layer *ivilayer)
-{
-	if (ivilayer == NULL) {
-		weston_log("ivi_layout_layer_remove_notification: invalid argument\n");
-		return;
-	}
-
-	remove_all_notification(&ivilayer->property_changed.listener_list);
-}
-
 WL_EXPORT const struct ivi_layout_surface_properties *
 ivi_layout_get_properties_of_surface(struct ivi_layout_surface *ivisurf)
 {
-- 
1.8.3.1



More information about the wayland-devel mailing list