Enlightenment CVS committal Author : rephorm Project : e17 Module : libs/edje
Dir : e17/libs/edje/src/lib Modified Files: edje_data.c edje_load.c edje_private.h edje_util.c Log Message: 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; } } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_data.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -3 -r1.28 -r1.29 --- edje_data.c 7 Jan 2006 08:54:30 -0000 1.28 +++ edje_data.c 11 Jan 2006 03:19:45 -0000 1.29 @@ -4,6 +4,7 @@ EAPI Eet_Data_Descriptor *_edje_edd_edje_file = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_style = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_style_tag = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_color_class = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_data = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_font_directory = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_font_directory_entry = NULL; @@ -133,7 +134,25 @@ eet_data_descriptor2_new(&eddc); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_style, Edje_Style, "name", name, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_style, Edje_Style, "tags", tags, _edje_edd_edje_style_tag); - + + NEWD("Edje_Color_Class", + Edje_Color_Class); + _edje_edd_edje_color_class = + eet_data_descriptor2_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "r", r, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "g", g, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "b", b, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "a", a, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "r2", r2, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "g2", g2, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "b2", b2, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "a2", a2, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "r3", r3, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "g3", g3, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "b3", b3, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "a3", a3, EET_T_INT); + /* the main file directory */ NEWD("Edje_File", Edje_File); @@ -147,6 +166,7 @@ EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "collection_dir", collection_dir, _edje_edd_edje_part_collection_directory); EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Edje_File, "data", data, _edje_edd_edje_data); EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Edje_File, "styles", styles, _edje_edd_edje_style); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Edje_File, "color_classes", color_classes, _edje_edd_edje_color_class); /* parts & programs - loaded induvidually */ NEWD("Edje_Program_Target", =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_load.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -3 -r1.81 -r1.82 --- edje_load.c 7 Jan 2006 08:54:30 -0000 1.81 +++ edje_load.c 11 Jan 2006 03:19:45 -0000 1.82 @@ -312,6 +312,7 @@ 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 @@ 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 @@ } 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) { =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_private.h,v retrieving revision 1.103 retrieving revision 1.104 diff -u -3 -r1.103 -r1.104 --- edje_private.h 10 Jan 2006 07:34:48 -0000 1.103 +++ edje_private.h 11 Jan 2006 03:19:45 -0000 1.104 @@ -193,6 +193,7 @@ Edje_Part_Collection_Directory *collection_dir; Evas_List *data; Evas_List *styles; + Evas_List *color_classes; int references; char *compiler; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_util.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -3 -r1.71 -r1.72 --- edje_util.c 7 Jan 2006 08:54:30 -0000 1.71 +++ edje_util.c 11 Jan 2006 03:19:45 -0000 1.72 @@ -1389,16 +1389,29 @@ _edje_color_class_find(Edje *ed, char *color_class) { Evas_List *l; + Edje_Color_Class *cc = NULL; if ((!ed) || (!color_class)) return NULL; + + /* first look through the object scope */ for (l = ed->color_classes; l; l = l->next) { - Edje_Color_Class *cc; - cc = l->data; if ((cc->name) && (!strcmp(color_class, cc->name))) return cc; } - return evas_hash_find(_edje_color_class_hash, color_class); + + /* next look through the global scope */ + cc = evas_hash_find(_edje_color_class_hash, color_class); + if (cc) return cc; + + /* finally, look through the file scope */ + for (l = ed->file->color_classes; l; l = l->next) + { + cc = l->data; + if ((cc->name) && (!strcmp(color_class, cc->name))) return cc; + } + + return NULL; } void ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs