summaryrefslogtreecommitdiff
path: root/ivi-shell
diff options
context:
space:
mode:
authorNobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>2014-12-15 13:20:44 +0900
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2014-12-15 16:29:40 +0200
commitef6c7864e2779af55f6e709a93d097f2dd0fb859 (patch)
tree308703ebd8c56e36ad0f4961db8e9d55a4a11e0a /ivi-shell
parent3d7eadb1e00922007f0dd7ba30d6e11181467471 (diff)
ivi-shell: reordering method in ivi_layout.c
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@xddp.denso.co.jp> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'ivi-shell')
-rw-r--r--ivi-shell/ivi-layout.c171
1 files changed, 86 insertions, 85 deletions
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index dd2ebe7c..8683e7dd 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -268,6 +268,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
*/
@@ -1205,28 +1280,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.
@@ -1510,58 +1563,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)
{
@@ -1852,6 +1853,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();
@@ -2465,17 +2477,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)
{