From 702c78bb8205352a8d066513f04f70276921e8c5 Mon Sep 17 00:00:00 2001 From: rephorm Date: Wed, 11 Jan 2006 03:19:46 +0000 Subject: [PATCH] color class blocks in edje. this allows you to specify the default color for any parts using color_classes in a given file. this color will be overridden by edje_color_class_set() which will in turn be overridden by edje_object_color_class_set() note. if you specify a color (color: ...) in a part description that also has a color_class, the cc will be multiplied against the color -- generally not what you want. also, as a tip, the gimp's 'multiply' blend mode is almost exactly the same as evas/edje's coloring. example: ... part { name: "colored"; type: RECT; description { state: "default" 0.0; color_class: "bg_color"; /* note: no color: set here */ } } ... color_classes { color_class { name: "bg_color"; color: 229 239 255 255; } } SVN revision: 19708 --- legacy/edje/src/lib/edje_load.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/legacy/edje/src/lib/edje_load.c b/legacy/edje/src/lib/edje_load.c index 66b8c1380e..5589ed2605 100644 --- a/legacy/edje/src/lib/edje_load.c +++ b/legacy/edje/src/lib/edje_load.c @@ -312,6 +312,7 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part) if ((evas_object_clipees_get(ed->clipper)) && (evas_object_visible_get(obj))) evas_object_show(ed->clipper); + _edje_recalc(ed); _edje_thaw(ed); _edje_unblock(ed); @@ -467,6 +468,7 @@ _edje_file_add(Edje *ed) ed->file = _edje_cache_file_coll_open(ed->path, ed->part, &(ed->load_error), &(ed->collection)); + if (!ed->collection) { if (ed->file) @@ -638,19 +640,27 @@ _edje_file_free(Edje_File *edf) } free(edf->collection_dir); } - if (edf->data) + while (edf->data) { - while (edf->data) - { - Edje_Data *edt; - - edt = edf->data->data; - edf->data = evas_list_remove(edf->data, edt); - if (edt->key) evas_stringshare_del(edt->key); - if (edt->value) evas_stringshare_del(edt->value); - free(edt); - } + Edje_Data *edt; + + edt = edf->data->data; + edf->data = evas_list_remove(edf->data, edt); + if (edt->key) evas_stringshare_del(edt->key); + if (edt->value) evas_stringshare_del(edt->value); + free(edt); } + + while(edf->color_classes) + { + Edje_Color_Class *ecc; + + ecc = edf->color_classes->data; + edf->color_classes = evas_list_remove(edf->color_classes, ecc); + if (ecc->name) evas_stringshare_del(ecc->name); + free(ecc); + } + /* FIXME: free collection_hash and collection_cache */ if (edf->collection_hash) {