rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=26e2d73b23db911ad394eb5d57813752959db333

commit 26e2d73b23db911ad394eb5d57813752959db333
Author: Andrii Kroitor <an.kroi...@samsung.com>
Date:   Thu Dec 24 11:53:16 2015 +0200

    container: removed unused confine methods and logic
---
 src/bin/ui/container/container.c | 85 ----------------------------------------
 src/bin/ui/container/container.h | 30 --------------
 src/bin/ui/live_view/live_view.c |  1 -
 src/bin/ui/workspace/workspace.c |  1 -
 4 files changed, 117 deletions(-)

diff --git a/src/bin/ui/container/container.c b/src/bin/ui/container/container.c
index 50527bb..80028c6 100644
--- a/src/bin/ui/container/container.c
+++ b/src/bin/ui/container/container.c
@@ -80,10 +80,6 @@ struct _Container_Smart_Data
    Eina_Stringshare *style;
    Evas_Coord downx;
    Evas_Coord downy;
-   struct {
-      Evas_Object *obj;
-      Evas_Coord x, y, w, h;
-   } confine;
    Evas_Coord dx, dy;
 };
 
@@ -221,14 +217,6 @@ _mouse_move_hTL_cb(void *data,
                   nx = x + (w - nw);
                }
              else nx = x + dx;
-             if ((sd->confine.obj) && (nx < sd->confine.x))
-               {
-                  if (nx != sd->confine.x)
-                    {
-                       nw = w + (x - sd->confine.x);
-                       nx = sd->confine.x;
-                    }
-               }
           }
      }
 
@@ -250,14 +238,6 @@ _mouse_move_hTL_cb(void *data,
                   ny = y + (h - nh);
                }
              else ny = y + dy;
-             if ((sd->confine.obj) && (ny < sd->confine.y))
-               {
-                  if (ny != sd->confine.y)
-                    {
-                       nh = h + (y - sd->confine.y);
-                       ny = sd->confine.y;
-                    }
-               }
           }
      }
 
@@ -318,13 +298,6 @@ _mouse_move_hBR_cb(void *data,
           nh = sd->con_size_max.h + H_HEIGHT + sd->dy + sd->pad_left_top.h + 
sd->pad_right_bottom.h;
         else nh = h + dy;
      }
-   if (sd->confine.obj)
-     {
-        if ((sd->confine.x + sd->confine.w) < (x + nw))
-          nw = sd->confine.w - (x - sd->confine.x);
-        if ((sd->confine.y + sd->confine.h) < (y + nh))
-          nh = sd->confine.h - (y - sd->confine.y);
-     }
    evas_object_resize(o, nw, nh);
 
    sd->size->dx = dx;
@@ -432,7 +405,6 @@ _container_smart_add(Evas_Object *o)
    priv->size->h = 0;
    priv->handler_TL_pressed = false;
    priv->handler_BR_pressed = false;
-   priv->confine.obj = NULL;
 
    evas_object_smart_member_add(priv->bg, o);
    evas_object_smart_member_add(priv->container, o);
@@ -489,8 +461,6 @@ _container_smart_resize(Evas_Object *o,
    if ((ow == w) && (oh == h)) return;
 
    CONTAINER_DATA_GET(o, sd)
-   if (!sd->confine.obj)
-     evas_object_size_hint_min_set(o, w, h);
 
    nw = w + H_WIGTH + sd->pad_left_top.w + sd->pad_right_bottom.w + sd->dx;
    nh = h + H_HEIGHT + sd->pad_left_top.h + sd->pad_right_bottom.h + sd->dy;
@@ -731,61 +701,6 @@ container_content_unset(Evas_Object *obj)
    return ret;
 }
 
-static void
-_confine_changed(void *data,
-                 Evas *e __UNUSED__,
-                 Evas_Object *obj,
-                 void *event_info __UNUSED__)
-{
-   Container_Smart_Data *sd = (Container_Smart_Data *)data;
-
-   assert(sd != NULL);
-
-   evas_object_geometry_get(obj,
-                            &sd->confine.x,
-                            &sd->confine.y,
-                            &sd->confine.w,
-                            &sd->confine.h);
-
-}
-
-Eina_Bool
-container_confine_set(Evas_Object *obj, Evas_Object *confine)
-{
-   CONTAINER_DATA_GET(obj, sd);
-
-   assert(confine != NULL);
-
-   sd->confine.obj = confine;
-   evas_object_geometry_get(confine,
-                            &sd->confine.x,
-                            &sd->confine.y,
-                            &sd->confine.w,
-                            &sd->confine.h);
-   evas_object_event_callback_add(confine, EVAS_CALLBACK_MOVE,
-                                  _confine_changed, sd);
-   evas_object_event_callback_add(confine, EVAS_CALLBACK_RESIZE,
-                                  _confine_changed, sd);
-
-   return true;
-}
-
-Eina_Bool
-container_confine_unset(Evas_Object *obj)
-{
-   CONTAINER_DATA_GET(obj, sd);
-
-   if (!sd->confine.obj) return false;
-
-   evas_object_event_callback_del_full(sd->confine.obj, EVAS_CALLBACK_MOVE,
-                                       _confine_changed, sd);
-   evas_object_event_callback_del_full(sd->confine.obj, EVAS_CALLBACK_RESIZE,
-                                       _confine_changed, sd);
-   sd->confine.obj = NULL;
-
-   return true;
-}
-
 Eina_Bool
 container_border_hide(Evas_Object *obj)
 {
diff --git a/src/bin/ui/container/container.h b/src/bin/ui/container/container.h
index e98d638..ad88cfe 100644
--- a/src/bin/ui/container/container.h
+++ b/src/bin/ui/container/container.h
@@ -212,36 +212,6 @@ Evas_Object *
 container_content_unset(Evas_Object *obj);
 
 /**
- * Set the confine object. The confine object make a moveble area for a
- * container.
- *
- * @param obj The Container object.
- * @param confine The confine object.
- *
- * @warning If you are setting container into swallow or layout, please, use
- *          use this function as well, because otherwise container won't work 
at
- *          all.
- *
- * @return EINA_TRUE on success or EINA_FALSE, on errors.
- *
- * @ingroup Container
- */
-Eina_Bool
-container_confine_set(Evas_Object *obj, Evas_Object *confine);
-
-/**
- * Unset the confine object from the Container object.
- *
- * @param obj The Container object.
- *
- * @return EINA_TRUE on success or EINA_FALSE, on errors.
- *
- * @ingroup Container
- */
-Eina_Bool
-container_confine_unset(Evas_Object *obj);
-
-/**
  * Hiding container (handlers and borders) of the Container object but not 
hiding
  * setted content.
  *
diff --git a/src/bin/ui/live_view/live_view.c b/src/bin/ui/live_view/live_view.c
index 4e3f19a..3100d70 100644
--- a/src/bin/ui/live_view/live_view.c
+++ b/src/bin/ui/live_view/live_view.c
@@ -190,7 +190,6 @@ live_view_add(Evas_Object *parent, Eina_Bool in_prog_edit, 
Group *group)
    live->live_view = container_add(parent);
    elm_object_part_content_set(live->layout, SWALLOW_CONTENT, live->live_view);
    elm_object_part_content_set(live->layout, SWALLOW_BG, bg);
-   container_confine_set(live->live_view, bg);
 
    /* save structure inside of an object */
    evas_object_data_set(live->block, "live_view_structure", live);
diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c
index 8e84bb7..dc7b3f5 100644
--- a/src/bin/ui/workspace/workspace.c
+++ b/src/bin/ui/workspace/workspace.c
@@ -977,7 +977,6 @@ _mode_changed(void *data,
    /* delete all object besides groupedit, because all these objects we created
     * on mode chage. It's do for create, alwayes actual and correct object, and
     * eliminates from updates, like live_view update mehanism. So, Profit! */
-   container_confine_unset(sd->container.obj);
    if ((sd->active_mode == MODE_NORMAL) || (sd->active_mode == MODE_SEPARATE))
      evas_object_hide(sd->groupedit);
    else

-- 


Reply via email to