summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_load.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/edje/edje_load.c')
-rw-r--r--src/lib/edje/edje_load.c167
1 files changed, 103 insertions, 64 deletions
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index a323f93a9f..fa2f4f7d58 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -779,6 +779,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
779 int group_path_started = 0; 779 int group_path_started = 0;
780 Evas_Object *nested_smart = NULL; 780 Evas_Object *nested_smart = NULL;
781 char lang[PATH_MAX]; 781 char lang[PATH_MAX];
782 Eina_Hash *part_match = NULL;
782 783
783 /* Get data pointer of top-of-stack */ 784 /* Get data pointer of top-of-stack */
784 int idx = eina_array_count(nested) - 1; 785 int idx = eina_array_count(nested) - 1;
@@ -797,6 +798,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
797 evas_event_freeze(tev); 798 evas_event_freeze(tev);
798 799
799 collect = _edje_object_collect(ed); 800 collect = _edje_object_collect(ed);
801 if (collect)
802 part_match = eina_hash_string_superfast_new(NULL);
800 803
801 if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed); 804 if (_edje_lua_script_only(ed)) _edje_lua_script_only_shutdown(ed);
802 805
@@ -938,6 +941,8 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
938 Eina_Bool memerr = EINA_FALSE; 941 Eina_Bool memerr = EINA_FALSE;
939 942
940 ep = ed->collection->parts[n]; 943 ep = ed->collection->parts[n];
944 if (part_match)
945 eina_hash_add(part_match, ep->name, (void*)1);
941 946
942 if (ep->nested_children_count) /* Add object to nested parts list */ 947 if (ep->nested_children_count) /* Add object to nested parts list */
943 { 948 {
@@ -1592,83 +1597,116 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
1592 { 1597 {
1593 Evas_Object *child = NULL; 1598 Evas_Object *child = NULL;
1594 1599
1595 switch (eud->type) 1600 if (!eina_hash_find(part_match, eud->part))
1596 { 1601 {
1597 case EDJE_USER_SWALLOW: 1602 /* part no longer exists */
1598 edje_object_part_swallow(obj, eud->part, eud->u.swallow.child); 1603 switch (eud->type)
1599 child = eud->u.swallow.child; 1604 {
1600 break; 1605 case EDJE_USER_SWALLOW:
1601 1606 child = eud->u.swallow.child;
1602 case EDJE_USER_BOX_PACK: 1607 break;
1603 boxes = eina_list_append(boxes, eud); 1608 case EDJE_USER_BOX_PACK:
1604 eud = NULL; 1609 child = eud->u.box.child;
1605 break; 1610 break;
1606 1611 case EDJE_USER_TABLE_PACK:
1607 case EDJE_USER_TABLE_PACK: 1612 child = eud->u.table.child;
1608 edje_object_part_table_pack(obj, eud->part, eud->u.table.child, 1613 break;
1609 eud->u.table.col, eud->u.table.row, 1614 case EDJE_USER_STRING:
1610 eud->u.table.colspan, eud->u.table.rowspan); 1615 case EDJE_USER_DRAG_STEP:
1611 child = eud->u.table.child; 1616 case EDJE_USER_DRAG_PAGE:
1612 break; 1617 case EDJE_USER_DRAG_VALUE:
1618 case EDJE_USER_DRAG_SIZE:
1619 case EDJE_USER_TEXT_STYLE:
1620 case EDJE_USER_TEXT_EXPAND:
1621 default:
1622 break;
1623 }
1624 if (child)
1625 {
1626 WRN("Container part '%s' no longer exists, hiding previously-contained child object", eud->part);
1627 evas_object_hide(child);
1628 }
1629 }
1630 else
1631 {
1632 switch (eud->type)
1633 {
1634 case EDJE_USER_SWALLOW:
1635 edje_object_part_swallow(obj, eud->part, eud->u.swallow.child);
1636 child = eud->u.swallow.child;
1637 break;
1613 1638
1614 case EDJE_USER_DRAG_STEP: 1639 case EDJE_USER_BOX_PACK:
1615 edje_object_part_drag_step_set(obj, eud->part, 1640 boxes = eina_list_append(boxes, eud);
1616 eud->u.drag_position.x, 1641 eud = NULL;
1617 eud->u.drag_position.y); 1642 break;
1618 break;
1619 1643
1620 case EDJE_USER_DRAG_PAGE: 1644 case EDJE_USER_TABLE_PACK:
1621 edje_object_part_drag_page_set(obj, eud->part, 1645 edje_object_part_table_pack(obj, eud->part, eud->u.table.child,
1622 eud->u.drag_position.x, 1646 eud->u.table.col, eud->u.table.row,
1623 eud->u.drag_position.y); 1647 eud->u.table.colspan, eud->u.table.rowspan);
1624 break; 1648 child = eud->u.table.child;
1649 break;
1625 1650
1626 case EDJE_USER_DRAG_VALUE: 1651 case EDJE_USER_DRAG_STEP:
1627 edje_object_part_drag_value_set(obj, eud->part, 1652 edje_object_part_drag_step_set(obj, eud->part,
1628 eud->u.drag_position.x, 1653 eud->u.drag_position.x,
1629 eud->u.drag_position.y); 1654 eud->u.drag_position.y);
1630 break; 1655 break;
1631 1656
1632 case EDJE_USER_DRAG_SIZE: 1657 case EDJE_USER_DRAG_PAGE:
1633 edje_object_part_drag_size_set(obj, eud->part, 1658 edje_object_part_drag_page_set(obj, eud->part,
1634 eud->u.drag_size.w, 1659 eud->u.drag_position.x,
1635 eud->u.drag_size.h); 1660 eud->u.drag_position.y);
1636 break; 1661 break;
1637 1662
1638 case EDJE_USER_STRING: 1663 case EDJE_USER_DRAG_VALUE:
1639 switch (eud->u.string.type) 1664 edje_object_part_drag_value_set(obj, eud->part,
1640 { 1665 eud->u.drag_position.x,
1641 case EDJE_TEXT_TYPE_NORMAL: 1666 eud->u.drag_position.y);
1642 edje_object_part_text_set(obj, eud->part, eud->u.string.text);
1643 break; 1667 break;
1644 case EDJE_TEXT_TYPE_ESCAPED: 1668
1645 edje_object_part_text_escaped_set(obj, eud->part, eud->u.string.text); 1669 case EDJE_USER_DRAG_SIZE:
1670 edje_object_part_drag_size_set(obj, eud->part,
1671 eud->u.drag_size.w,
1672 eud->u.drag_size.h);
1646 break; 1673 break;
1647 case EDJE_TEXT_TYPE_UNESCAPED: 1674
1648 edje_object_part_text_unescaped_set(obj, eud->part, eud->u.string.text); 1675 case EDJE_USER_STRING:
1676 switch (eud->u.string.type)
1677 {
1678 case EDJE_TEXT_TYPE_NORMAL:
1679 edje_object_part_text_set(obj, eud->part, eud->u.string.text);
1680 break;
1681 case EDJE_TEXT_TYPE_ESCAPED:
1682 edje_object_part_text_escaped_set(obj, eud->part, eud->u.string.text);
1683 break;
1684 case EDJE_TEXT_TYPE_UNESCAPED:
1685 edje_object_part_text_unescaped_set(obj, eud->part, eud->u.string.text);
1686 break;
1687 }
1688 eina_stringshare_del(eud->u.string.text);
1649 break; 1689 break;
1650 }
1651 eina_stringshare_del(eud->u.string.text);
1652 break;
1653 1690
1654 case EDJE_USER_TEXT_STYLE: 1691 case EDJE_USER_TEXT_STYLE:
1655 {
1656 Edje_Part_Text_Prop *prop;
1657 EINA_LIST_FREE(eud->u.text_style.props, prop)
1658 { 1692 {
1659 _canvas_layout_user_text_apply(eud, obj, 1693 Edje_Part_Text_Prop *prop;
1660 prop); 1694 EINA_LIST_FREE(eud->u.text_style.props, prop)
1661 free(prop); 1695 {
1696 _canvas_layout_user_text_apply(eud, obj,
1697 prop);
1698 free(prop);
1699 }
1662 } 1700 }
1701 break;
1702 case EDJE_USER_TEXT_EXPAND:
1703 {
1704 efl_canvas_layout_part_text_expand_set(
1705 efl_part(obj, eud->part),
1706 eud->u.text_expand.expand);
1707 }
1708 break;
1663 } 1709 }
1664 break;
1665 case EDJE_USER_TEXT_EXPAND:
1666 {
1667 efl_canvas_layout_part_text_expand_set(
1668 efl_part(obj, eud->part),
1669 eud->u.text_expand.expand);
1670 }
1671 break;
1672 } 1710 }
1673 if (eud) _edje_user_definition_remove(eud, child); 1711 if (eud) _edje_user_definition_remove(eud, child);
1674 } 1712 }
@@ -1679,6 +1717,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
1679 edje_object_part_box_append(obj, eud->part, eud->u.box.child); 1717 edje_object_part_box_append(obj, eud->part, eud->u.box.child);
1680 _edje_user_definition_remove(eud, eud->u.box.child); 1718 _edje_user_definition_remove(eud, eud->u.box.child);
1681 } 1719 }
1720 eina_hash_free(part_match);
1682 } 1721 }
1683 if (_edje_language) 1722 if (_edje_language)
1684 snprintf(lang, sizeof(lang), "edje,language,%s", _edje_language); 1723 snprintf(lang, sizeof(lang), "edje,language,%s", _edje_language);