summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJee-Yong Um <conr2d@gmail.com>2016-01-04 15:10:58 -0800
committerCedric BAIL <cedric@osg.samsung.com>2016-01-04 15:11:01 -0800
commitc963a0f9cb3009b7ad1a5cdc623b0d7c9f8d3e4f (patch)
tree939d39cdce16f3d26fa5bb9c9049b740348c4764
parent2127547cb95114bfc8bb7e999f55c98fc91179c7 (diff)
edje: add edje_object_color_class_clear()
Summary: clear all color classes defined in edje object Reviewers: raster, jpeg Subscribers: woohyun, cedric, kimcinoo Differential Revision: https://phab.enlightenment.org/D3514 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/edje/edje_object.eo6
-rw-r--r--src/lib/edje/edje_util.c46
2 files changed, 52 insertions, 0 deletions
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index 37fd8b9b04..e600a15947 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -1910,6 +1910,12 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
1910 @in color_class: const(char)*; 1910 @in color_class: const(char)*;
1911 } 1911 }
1912 } 1912 }
1913 color_class_clear @const {
1914 [[Clear object color classes.
1915
1916 @since 1.17.0]]
1917 return: bool; [[$true, on success or $false, on error]]
1918 }
1913 size_class_set { 1919 size_class_set {
1914 [[Sets the object size class. 1920 [[Sets the object size class.
1915 1921
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index fc0c5b86f7..600b38d4fe 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -1023,6 +1023,52 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class)
1023 _edje_emit(ed, "color_class,del", color_class); 1023 _edje_emit(ed, "color_class,del", color_class);
1024} 1024}
1025 1025
1026EOLIAN Eina_Bool
1027_edje_object_color_class_clear(const Eo *obj EINA_UNUSED, Edje *ed)
1028{
1029 Edje_List_Foreach_Data fdata;
1030 Edje_Color_Class *cc = NULL;
1031 Eina_List *l;
1032 char *color_class;
1033 unsigned int i;
1034 Eina_Bool int_ret = EINA_TRUE;
1035
1036 if (!ed) return EINA_FALSE;
1037
1038 memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
1039 eina_hash_foreach(ed->color_classes, _edje_color_class_list_foreach, &fdata);
1040
1041 EINA_LIST_FOREACH(fdata.list, l, color_class)
1042 eina_hash_del(ed->color_classes, color_class, cc);
1043
1044 for (i = 0; i < ed->table_parts_size; i++)
1045 {
1046 Edje_Real_Part *rp;
1047
1048 rp = ed->table_parts[i];
1049 if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
1050 ((rp->type == EDJE_RP_TYPE_SWALLOW) &&
1051 (rp->typedata.swallow)) &&
1052 (rp->typedata.swallow->swallowed_object))
1053 int_ret &= edje_object_color_class_clear(rp->typedata.swallow->swallowed_object);
1054 }
1055
1056 ed->dirty = EINA_TRUE;
1057 ed->recalc_call = EINA_TRUE;
1058#ifdef EDJE_CALC_CACHE
1059 ed->all_part_change = EINA_TRUE;
1060#endif
1061 _edje_recalc(ed);
1062
1063 EINA_LIST_FREE(fdata.list, color_class)
1064 {
1065 _edje_emit(ed, "color_class,del", color_class);
1066 free(color_class);
1067 }
1068
1069 return int_ret;
1070}
1071
1026typedef struct _Edje_File_Color_Class_Iterator Edje_File_Color_Class_Iterator; 1072typedef struct _Edje_File_Color_Class_Iterator Edje_File_Color_Class_Iterator;
1027struct _Edje_File_Color_Class_Iterator 1073struct _Edje_File_Color_Class_Iterator
1028{ 1074{