edje: update hints after loading GROUP.
authorcedric <cedric>
Tue, 7 Jun 2011 07:43:32 +0000 (07:43 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Tue, 7 Jun 2011 07:43:32 +0000 (07:43 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@60026 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/edje_edit.c
src/lib/edje_load.c
src/lib/edje_private.h
src/lib/edje_util.c

index 9204f53..ef0ffa4 100644 (file)
@@ -2159,7 +2159,7 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type
             Evas_Object *child;
             child = _edje_external_type_add(source, evas_object_evas_get(ed->obj), ed->obj, NULL, name);
             if (child)
-              _edje_real_part_swallow(rp, child);
+              _edje_real_part_swallow(rp, child, EINA_TRUE);
          }
        evas_object_clip_set(rp->object, ed->base.clipper);
        evas_object_show(ed->base.clipper);
@@ -2700,7 +2700,7 @@ edje_edit_part_source_set(Evas_Object *obj, const char *part, const char *source
        rp->part->source = eina_stringshare_add(source);
        child_obj = edje_object_add(ed->base.evas);
        edje_object_file_set(child_obj, ed->file->path, source);
-       _edje_real_part_swallow(rp, child_obj);
+       _edje_real_part_swallow(rp, child_obj, EINA_TRUE);
      }
    else
      rp->part->source = NULL;
index 9aeee1c..82d7c06 100644 (file)
@@ -652,7 +652,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
                                                                 external->external_params, rp->part->name);
                             if (child_obj)
                               {
-                                 _edje_real_part_swallow(rp, child_obj);
+                                 _edje_real_part_swallow(rp, child_obj, EINA_TRUE);
                                  rp->param1.external_params = _edje_external_params_parse(child_obj,
                                                                                           external->external_params);
                                  _edje_external_recalc_apply(ed, rp, NULL, rp->chosen_description);
@@ -701,7 +701,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
                       group_path = eina_list_append(group_path, group_path_entry);
                       if (rp->part->type == EDJE_PART_TYPE_GROUP)
                         {
-                            _edje_real_part_swallow(rp, child_obj);
+                            _edje_real_part_swallow(rp, child_obj, EINA_FALSE);
                         }
 
                       if (!_edje_object_file_set_internal(child_obj, file, source, rp->part->name, group_path))
@@ -731,6 +731,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
                       edje_object_signal_callback_add(child_obj, "*", "*", _cb_signal_repeat, obj);
                       if (rp->part->type == EDJE_PART_TYPE_GROUP)
                         {
+                            _edje_real_part_swallow(rp, child_obj, EINA_TRUE);
                            source = NULL;
                         }
                       else
index 47a5f71..3267dd6 100644 (file)
@@ -1557,7 +1557,7 @@ int               _edje_block_break(Edje *ed);
 void              _edje_block_violate(Edje *ed);
 void              _edje_object_part_swallow_free_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
 void              _edje_object_part_swallow_changed_hints_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
-void              _edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow);
+void              _edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow, Eina_Bool hints_update);
 void              _edje_real_part_swallow_clear(Edje_Real_Part *rp);
 void              _edje_box_init(void);
 void              _edje_box_shutdown(void);
index 3ee0de8..212a1e0 100644 (file)
@@ -1675,7 +1675,7 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
        ERR("cannot unswallow part %s: not swallow type!", rp->part->name);
        return EINA_FALSE;
      }
-   _edje_real_part_swallow(rp, obj_swallow);
+   _edje_real_part_swallow(rp, obj_swallow, EINA_TRUE);
    return EINA_TRUE;
 }
 
@@ -3821,9 +3821,9 @@ _edje_object_part_swallow_free_cb(void *data, Evas *e __UNUSED__, Evas_Object *o
 static void
 _edje_real_part_swallow_hints_update(Edje_Real_Part *rp)
 {
-   char *type;
+   const char *type;
 
-   type = (char *)evas_object_type_get(rp->swallowed_object);
+   type = evas_object_type_get(rp->swallowed_object);
 
    rp->swallow_params.min.w = 0;
    rp->swallow_params.min.h = 0;
@@ -3905,7 +3905,9 @@ _edje_object_part_swallow_changed_hints_cb(void *data, __UNUSED__ Evas *e, __UNU
 }
 
 void
-_edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow)
+_edje_real_part_swallow(Edje_Real_Part *rp,
+                       Evas_Object *obj_swallow,
+                       Eina_Bool hints_update)
 {
    if (rp->swallowed_object)
      {
@@ -3916,7 +3918,8 @@ _edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow)
           }
         else
           {
-             _edje_real_part_swallow_hints_update(rp);
+             if (hints_update)
+               _edje_real_part_swallow_hints_update(rp);
              rp->edje->dirty = 1;
              _edje_recalc(rp->edje);
              return;
@@ -3941,7 +3944,8 @@ _edje_real_part_swallow(Edje_Real_Part *rp, Evas_Object *obj_swallow)
                                  _edje_object_part_swallow_changed_hints_cb,
                                  rp);
 
-   _edje_real_part_swallow_hints_update(rp);
+   if (hints_update)
+     _edje_real_part_swallow_hints_update(rp);
 
    if (rp->part->mouse_events)
      {