forked from enlightenment/efl
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>
This commit is contained in:
parent
2127547cb9
commit
c963a0f9cb
|
@ -1910,6 +1910,12 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File)
|
|||
@in color_class: const(char)*;
|
||||
}
|
||||
}
|
||||
color_class_clear @const {
|
||||
[[Clear object color classes.
|
||||
|
||||
@since 1.17.0]]
|
||||
return: bool; [[$true, on success or $false, on error]]
|
||||
}
|
||||
size_class_set {
|
||||
[[Sets the object size class.
|
||||
|
||||
|
|
|
@ -1023,6 +1023,52 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class)
|
|||
_edje_emit(ed, "color_class,del", color_class);
|
||||
}
|
||||
|
||||
EOLIAN Eina_Bool
|
||||
_edje_object_color_class_clear(const Eo *obj EINA_UNUSED, Edje *ed)
|
||||
{
|
||||
Edje_List_Foreach_Data fdata;
|
||||
Edje_Color_Class *cc = NULL;
|
||||
Eina_List *l;
|
||||
char *color_class;
|
||||
unsigned int i;
|
||||
Eina_Bool int_ret = EINA_TRUE;
|
||||
|
||||
if (!ed) return EINA_FALSE;
|
||||
|
||||
memset(&fdata, 0, sizeof(Edje_List_Foreach_Data));
|
||||
eina_hash_foreach(ed->color_classes, _edje_color_class_list_foreach, &fdata);
|
||||
|
||||
EINA_LIST_FOREACH(fdata.list, l, color_class)
|
||||
eina_hash_del(ed->color_classes, color_class, cc);
|
||||
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
||||
rp = ed->table_parts[i];
|
||||
if ((rp->part->type == EDJE_PART_TYPE_GROUP) &&
|
||||
((rp->type == EDJE_RP_TYPE_SWALLOW) &&
|
||||
(rp->typedata.swallow)) &&
|
||||
(rp->typedata.swallow->swallowed_object))
|
||||
int_ret &= edje_object_color_class_clear(rp->typedata.swallow->swallowed_object);
|
||||
}
|
||||
|
||||
ed->dirty = EINA_TRUE;
|
||||
ed->recalc_call = EINA_TRUE;
|
||||
#ifdef EDJE_CALC_CACHE
|
||||
ed->all_part_change = EINA_TRUE;
|
||||
#endif
|
||||
_edje_recalc(ed);
|
||||
|
||||
EINA_LIST_FREE(fdata.list, color_class)
|
||||
{
|
||||
_edje_emit(ed, "color_class,del", color_class);
|
||||
free(color_class);
|
||||
}
|
||||
|
||||
return int_ret;
|
||||
}
|
||||
|
||||
typedef struct _Edje_File_Color_Class_Iterator Edje_File_Color_Class_Iterator;
|
||||
struct _Edje_File_Color_Class_Iterator
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue