From: cedric Date: Mon, 9 Aug 2010 17:34:03 +0000 (+0000) Subject: * edje: new file format. X-Git-Tag: submit/2.0alpha-wayland/20121127.221958~1158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=015be4d59fbc3fcb4085a74cdcffe5a75ef96b42;p=profile%2Fivi%2Fedje.git * edje: new file format. WARNING ! WARNING ! WARNING ! WARNING ! Old file format is not readable by edje directly. If you have old edje file that you want to convert, use edje_convert. Their is no way back. Recompile your file as soon as possible. Please report any issue you spot as this is a huge and needed change. git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@50936 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/configure.ac b/configure.ac index e5469eb..aab3363 100644 --- a/configure.ac +++ b/configure.ac @@ -91,6 +91,7 @@ EFL_ENABLE_BIN([edje-cc]) EFL_ENABLE_BIN([edje-decc]) EFL_ENABLE_BIN([edje-recc]) EFL_ENABLE_BIN([edje-player]) +EFL_ENABLE_BIN([edje-convert]) # Optional EDJE_PROGRAM_CACHE (use much more ram, but increase speed in some cases) want_edje_program_cache="no" diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 4a9d6b5..c7cfb41 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -15,9 +15,9 @@ AM_CPPFLAGS = \ bin_SCRIPTS = @EDJE_RECC_PRG@ -bin_PROGRAMS = @EDJE_CC_PRG@ @EDJE_DECC_PRG@ @EDJE_PLAYER_PRG@ +bin_PROGRAMS = @EDJE_CC_PRG@ @EDJE_DECC_PRG@ @EDJE_PLAYER_PRG@ @EDJE_CONVERT_PRG@ -EXTRA_PROGRAMS = edje_cc edje_decc edje_player +EXTRA_PROGRAMS = edje_cc edje_decc edje_player edje_convert edje_cc_SOURCES = \ edje_cc.c \ @@ -26,7 +26,8 @@ edje_cc_parse.c \ edje_cc_mem.c \ edje_cc_handlers.c \ edje_cc_sources.c \ -edje_prefix.c +edje_prefix.c \ +edje_convert.c edje_cc_LDADD = $(top_builddir)/src/lib/libedje.la $(ECORE_EVAS_LIBS) $(EVIL_LIBS) edje_cc_LDFLAGS = @lt_enable_auto_import@ @@ -45,5 +46,9 @@ edje_player_SOURCES = edje_player.c edje_player_LDADD = $(top_builddir)/src/lib/libedje.la $(ECORE_EVAS_LIBS) $(EVIL_LIBS) edje_player_LDFLAGS = @lt_enable_auto_import@ -EXTRA_DIST = @EDJE_RECC_PRG@ edje_prefix.h edje_cc.h +edje_convert_SOURCES = edje_convert.c edje_convert_main.c edje_data_convert.c +edje_convert_LDADD = $(top_builddir)/src/lib/libedje.la $(EVIL_LIBS) +edje_convert_LDFLAGS = @lt_enable_auto_import@ + +EXTRA_DIST = @EDJE_RECC_PRG@ edje_prefix.h edje_cc.h edje_convert.h EXTRA_SCRIPTS = edje_recc diff --git a/src/bin/edje_cc.h b/src/bin/edje_cc.h index 81b79de..795386f 100644 --- a/src/bin/edje_cc.h +++ b/src/bin/edje_cc.h @@ -3,6 +3,8 @@ #include +#include "edje_convert.h" + /* * On Windows, if the file is not opened in binary mode, * read does not return the correct size, because of @@ -149,6 +151,8 @@ void *mem_alloc(size_t size); char *mem_strdup(const char *s); #define SZ sizeof +void error_and_abort(Eet_File *ef, const char *fmt, ...); + /* global vars */ extern Eina_List *ext_dirs; extern Eina_List *img_dirs; diff --git a/src/bin/edje_cc_handlers.c b/src/bin/edje_cc_handlers.c index 8f3dfa4..2041584 100644 --- a/src/bin/edje_cc_handlers.c +++ b/src/bin/edje_cc_handlers.c @@ -1557,7 +1557,7 @@ static void ob_collections(void) { if (!edje_file->collection_dir) - edje_file->collection_dir = mem_alloc(SZ(Edje_Part_Collection_Directory)); + edje_file->collection_dir = mem_alloc(SZ(Old_Edje_Part_Collection_Directory)); } /** diff --git a/src/bin/edje_cc_out.c b/src/bin/edje_cc_out.c index 858f5cb..ccd322f 100644 --- a/src/bin/edje_cc_out.c +++ b/src/bin/edje_cc_out.c @@ -28,6 +28,7 @@ void *alloca (size_t); #include "edje_cc.h" #include "edje_prefix.h" +#include "edje_convert.h" #include #include @@ -95,6 +96,7 @@ struct _Code_Lookup static void data_process_string(Old_Edje_Part_Collection *pc, const char *prefix, char *s, void (*func)(Old_Edje_Part_Collection *pc, char *name, char *ptr, int len)); Old_Edje_File *edje_file = NULL; +Edje_File *new_edje_file = NULL; Eina_List *edje_collections = NULL; Eina_List *externals = NULL; Eina_List *fonts = NULL; @@ -103,16 +105,7 @@ Eina_List *code_lookups = NULL; Eina_List *aliases = NULL; static Eet_Data_Descriptor *edd_edje_file = NULL; -static Eet_Data_Descriptor *edd_edje_image_directory = NULL; -static Eet_Data_Descriptor *edd_edje_image_directory_entry = NULL; -static Eet_Data_Descriptor *edd_edje_program = NULL; -static Eet_Data_Descriptor *edd_edje_program_target = NULL; -static Eet_Data_Descriptor *edd_edje_part_collection_directory = NULL; -static Eet_Data_Descriptor *edd_edje_part_collection_directory_entry = NULL; static Eet_Data_Descriptor *edd_edje_part_collection = NULL; -static Eet_Data_Descriptor *edd_edje_part = NULL; -static Eet_Data_Descriptor *edd_edje_part_description = NULL; -static Eet_Data_Descriptor *edd_edje_part_image_id = NULL; static Eina_List *part_lookups = NULL; static Eina_List *program_lookups = NULL; @@ -126,7 +119,7 @@ static Eina_List *image_slave_lookups= NULL; unlink(file); \ exit(-1); -static void +void error_and_abort(Eet_File *ef, const char *fmt, ...) { va_list ap; @@ -143,16 +136,7 @@ void data_setup(void) { edd_edje_file = _edje_edd_edje_file; - edd_edje_image_directory = _edje_edd_edje_image_directory; - edd_edje_image_directory_entry = _edje_edd_edje_image_directory_entry; - edd_edje_program = _edje_edd_edje_program; - edd_edje_program_target = _edje_edd_edje_program_target; - edd_edje_part_collection_directory = _edje_edd_edje_part_collection_directory; - edd_edje_part_collection_directory_entry = _edje_edd_edje_part_collection_directory_entry; edd_edje_part_collection = _edje_edd_edje_part_collection; - edd_edje_part = _edje_edd_edje_part; - edd_edje_part_description = _edje_edd_edje_part_description; - edd_edje_part_image_id = _edje_edd_edje_part_image_id; } static void @@ -244,19 +228,21 @@ data_write_header(Eet_File *ef) { int bytes = 0; - if (edje_file) + if (new_edje_file) { - - if (edje_file->collection_dir) + if (new_edje_file->collection) { + Edje_Part_Collection_Directory_Entry *ce; + /* copy aliases into collection directory */ - while (aliases) + EINA_LIST_FREE(aliases, ce) { - edje_file->collection_dir->entries = eina_list_append(edje_file->collection_dir->entries, eina_list_data_get(aliases)); - aliases = eina_list_remove_list(aliases, aliases); + if (!ce->entry) + error_and_abort(ef, "Collection %i: name missing.\n", ce->id); + eina_hash_direct_add(new_edje_file->collection, ce->entry, ce); } } - bytes = eet_data_write(ef, edd_edje_file, "edje_file", edje_file, 1); + bytes = eet_data_write(ef, edd_edje_file, "edje/file", new_edje_file, 1); if (bytes <= 0) error_and_abort(ef, "Unable to write \"edje_file\" entry to \"%s\" \n", file_out); @@ -343,7 +329,7 @@ data_write_fonts(Eet_File *ef, int *font_num, int *input_bytes, int *input_raw_b { char buf[4096]; - snprintf(buf, sizeof(buf), "fonts/%s", fn->name); + snprintf(buf, sizeof(buf), "edje/fonts/%s", fn->name); bytes = eet_write(ef, buf, fdata, fsize, 1); if (bytes <= 0) error_and_abort(ef, "Unable to write font part \"%s\" as \"%s\" " @@ -453,11 +439,11 @@ error_and_abort_image_load_error(Eet_File *ef, const char *file, int error) static int data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw_bytes) { - Eina_List *l; + unsigned int i; int bytes = 0; int total_bytes = 0; - if ((edje_file) && (edje_file->image_dir)) + if ((new_edje_file) && (new_edje_file->image_dir)) { Ecore_Evas *ee; Evas *evas; @@ -472,8 +458,10 @@ data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw "load.\n"); evas = ecore_evas_get(ee); - EINA_LIST_FOREACH(edje_file->image_dir->entries, l, img) + for (i = 0; i < new_edje_file->image_dir->entries_count; i++) { + img = &new_edje_file->image_dir->entries[i]; + if (img->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) { } @@ -532,7 +520,7 @@ data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw { int mode, qual; - snprintf(buf, sizeof(buf), "images/%i", img->id); + snprintf(buf, sizeof(buf), "edje/images/%i", img->id); qual = 80; if ((img->source_type == EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT) && (img->source_param == 0)) @@ -627,21 +615,6 @@ data_write_images(Eet_File *ef, int *image_num, int *input_bytes, int *input_raw } static void -check_groups_names(Eet_File *ef) -{ - Eina_List *l; - Edje_Part_Collection_Directory_Entry *de; - - if (!edje_file->collection_dir) - return; - - /* check that all groups have names */ - EINA_LIST_FOREACH(edje_file->collection_dir->entries, l, de) - if (!de->entry) - error_and_abort(ef, "Collection %i: name missing.\n", de->id); -} - -static void check_groups(Eet_File *ef) { Eina_List *l; @@ -665,7 +638,7 @@ static int data_write_groups(Eet_File *ef, int *collection_num) { Eina_List *l; - Old_Edje_Part_Collection *pc; + Edje_Part_Collection *pc; int bytes = 0; int total_bytes = 0; @@ -673,7 +646,7 @@ data_write_groups(Eet_File *ef, int *collection_num) { char buf[4096]; - snprintf(buf, sizeof(buf), "collections/%i", pc->id); + snprintf(buf, sizeof(buf), "edje/collections/%i", pc->id); bytes = eet_data_write(ef, edd_edje_part_collection, buf, pc, 1); if (bytes <= 0) error_and_abort(ef, "Error. Unable to write \"%s\" part entry " @@ -806,7 +779,7 @@ compile_script_file(Eet_File *ef, const char *source, const char *output, error_and_abort(ef, "Unable to read all of script object " "\"%s\"\n", output); - snprintf(buf, sizeof(buf), "scripts/%i", script_num); + snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i", script_num); eet_write(ef, buf, data, size, 1); free(data); } @@ -1005,7 +978,7 @@ data_write_lua_scripts(Eet_File *ef) printf("lua call error: %s\n", lua_tostring (L, -1)); */ - snprintf(buf, sizeof(buf), "lua_scripts/%i", i); + snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", i); eet_write(ef, buf, data.buf, data.size, 1); #ifdef LUA_BINARY free(data.buf); @@ -1018,6 +991,10 @@ void data_write(void) { Eet_File *ef; + Edje_Part_Collection_Directory_Entry *ce; + Old_Edje_Part_Collection *pc; + Eina_Iterator *it; + Eina_List *tmp = NULL; int input_bytes = 0; int total_bytes = 0; int src_bytes = 0; @@ -1035,15 +1012,32 @@ data_write(void) exit(-1); } + check_groups(ef); + + new_edje_file = _edje_file_convert(ef, edje_file); + _edje_file_set(new_edje_file); + + /* convert old structure to new one */ + it = eina_hash_iterator_data_new(new_edje_file->collection); + + EINA_ITERATOR_FOREACH(it, ce) + { + pc = eina_list_nth(edje_collections, ce->id); + tmp = eina_list_append(tmp, + _edje_collection_convert(ef, + ce, pc)); + } + + eina_iterator_free(it); + edje_collections = eina_list_free(edje_collections); + edje_collections = tmp; + total_bytes += data_write_header(ef); total_bytes += data_write_fonts(ef, &font_num, &input_bytes, &input_raw_bytes); total_bytes += data_write_images(ef, &image_num, &input_bytes, &input_raw_bytes); - check_groups_names(ef); - check_groups(ef); - total_bytes += data_write_groups(ef, &collection_num); data_write_scripts(ef); data_write_lua_scripts(ef); diff --git a/src/bin/edje_convert.c b/src/bin/edje_convert.c new file mode 100644 index 0000000..e222f41 --- /dev/null +++ b/src/bin/edje_convert.c @@ -0,0 +1,455 @@ +#include "edje_private.h" + +#include "edje_cc.h" +#include "edje_prefix.h" + +static const Edje_File *_current_edje_file = NULL; + +const Edje_File * +_edje_file_get(void) +{ + return _current_edje_file; +} + +void +_edje_file_set(const Edje_File *edf) +{ + _current_edje_file = edf; +} + +static Eina_Bool +_edje_file_convert_external(Edje_File *edf, Old_Edje_File *oedf) +{ + Edje_External_Directory_Entry *ede; + unsigned int max; + unsigned int i = 0; + + edf->external_dir = calloc(1, sizeof (Edje_External_Directory)); + if (!edf->external_dir) return EINA_FALSE; + if (!oedf->external_dir) return EINA_TRUE; + + max = eina_list_count(oedf->external_dir->entries); + edf->external_dir->entries = calloc(1, sizeof (Edje_External_Directory_Entry) * max); + edf->external_dir->entries_count = max; + + if (!edf->external_dir->entries && max) + return EINA_FALSE; + + EINA_LIST_FREE(oedf->external_dir->entries, ede) + { + edf->external_dir->entries[i++].entry = ede->entry; + free(ede); + } + + free(oedf->external_dir); + oedf->external_dir = NULL; + + return EINA_TRUE; +} + +static Eina_Bool +_edje_file_convert_images(Edje_File *edf, Old_Edje_File *oedf) +{ + Edje_Image_Directory_Entry *de; + Edje_Image_Directory_Set *ds; + Eina_List *l; + int max; + + edf->image_dir = calloc(1, sizeof (Edje_Image_Directory)); + if (!edf->image_dir) return EINA_FALSE; + if (!oedf->image_dir) return EINA_TRUE; + + max = -1; + EINA_LIST_FOREACH(oedf->image_dir->entries, l, de) + if (max < de->id) + max = de->id; + + edf->image_dir->entries = calloc(1, sizeof (Edje_Image_Directory_Entry) * (max + 1)); + edf->image_dir->entries_count = max + 1; + + if (!edf->image_dir->entries && edf->image_dir->entries_count) + return EINA_FALSE; + + EINA_LIST_FREE(oedf->image_dir->entries, de) + { + memcpy(edf->image_dir->entries + de->id, + de, + sizeof (Edje_Image_Directory_Entry)); + free(de); + } + + max = -1; + EINA_LIST_FOREACH(oedf->image_dir->sets, l, ds) + if (max < ds->id) + max = ds->id; + + edf->image_dir->sets = calloc(1, sizeof (Edje_Image_Directory_Set) * (max + 1)); + edf->image_dir->sets_count = max + 1; + + if (!edf->image_dir->sets && edf->image_dir->sets_count) + { + free(edf->image_dir->entries); + edf->image_dir->entries = NULL; + return EINA_FALSE; + } + + EINA_LIST_FREE(oedf->image_dir->sets, ds) + { + memcpy(edf->image_dir->sets + ds->id, + ds, + sizeof (Edje_Image_Directory_Set)); + free(ds); + } + + return EINA_TRUE; +} + +Edje_File * +_edje_file_convert(Eet_File *ef, Old_Edje_File *oedf) +{ + Edje_Part_Collection_Directory_Entry *ce; + Edje_Font_Directory_Entry *fnt; + Edje_File *edf; + Eina_List *l; + Edje_Data *ed; + + if (oedf->version != 2) return NULL; + + edf = calloc(1, sizeof (Edje_File)); + if (!edf) return NULL; + + edf->free_strings = 0; + + edf->fonts = eina_hash_string_small_new(free); + edf->collection = eina_hash_string_small_new(free); + edf->data = eina_hash_string_small_new(NULL); + + if (!edf->fonts || !edf->collection || !edf->data) + goto on_error; + + EINA_LIST_FREE(oedf->data, ed) + { + eina_hash_direct_add(edf->data, ed->key, ed->value); + free(ed); + } + + EINA_LIST_FOREACH(oedf->collection_dir->entries, l, ce) + if (ce->entry) + eina_hash_direct_add(edf->collection, ce->entry, ce); + else + error_and_abort(ef, "Collection %i: name missing.\n", ce->id); + + if (oedf->font_dir) + EINA_LIST_FOREACH(oedf->font_dir->entries, l, fnt) + { + char *tmp; + int length; + + length = strlen(fnt->entry) + 7; + tmp = alloca(length); + + snprintf(tmp, length, "fonts/%s", fnt->entry); + fnt->path = eina_stringshare_add(tmp); + if (edf->free_strings) + eina_stringshare_del(fnt->entry); + fnt->entry = fnt->path + 6; + + eina_hash_direct_add(edf->fonts, fnt->entry, fnt); + } + + if (!_edje_file_convert_images(edf, oedf)) + goto on_error; + + if (!_edje_file_convert_external(edf, oedf)) + goto on_error; + + edf->styles = oedf->styles; + edf->color_classes = oedf->color_classes; + edf->version = EDJE_FILE_VERSION; + edf->feature_ver = oedf->feature_ver; + edf->compiler = oedf->compiler; + + edf->dangling = EINA_FALSE; + edf->warning = EINA_FALSE; + + /* Below you will find all memory structure that could be cleaned when under + memory pressure */ + edf->collection_cache = NULL; + edf->collection_patterns = NULL; + + return edf; + + on_error: + eina_hash_free(edf->fonts); + eina_hash_free(edf->collection); + eina_hash_free(edf->data); + free(edf->image_dir); + free(edf->external_dir); + free(edf); + return NULL; +} + +static void +_edje_collection_program_add(Edje_Program ***array, + unsigned int *count, + Edje_Program *add) +{ + Edje_Program **tmp; + + tmp = realloc(*array, sizeof (Edje_Program*) * (*count + 1)); + if (!tmp) return ; + + tmp[(*count)++] = add; + *array = tmp; +} + +Edje_Part_Collection * +_edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce, Old_Edje_Part_Collection *oedc) +{ + Edje_Part_Collection *edc; + Old_Edje_Part *part; + Edje_Program *pg; + Edje_Data *di; + Eina_List *l; + unsigned int k; + + oedc->part = ce->entry; + + /* Count each type part and their respective state */ + EINA_LIST_FOREACH(oedc->parts, l, part) + { + int *count; + int dummy = 0; + + + switch (part->type) + { +#define CSP(Tp, Ce) \ + case EDJE_PART_TYPE_##Tp : \ + count = &Ce->count.Tp; \ + break; + + CSP(RECTANGLE, ce); + CSP(TEXT, ce); + CSP(IMAGE, ce); + CSP(SWALLOW, ce); + CSP(TEXTBLOCK, ce); + CSP(GROUP, ce); + CSP(BOX, ce); + CSP(TABLE, ce); + CSP(EXTERNAL, ce); + default: + count = &dummy; + break; + } + + *count += eina_list_count(part->other_desc) + 1; + } + ce->count.part = eina_list_count(oedc->parts); + +#define CONVERT_EMN(Tp, Sz, Ce) \ + Ce->mp.Tp = eina_mempool_add("one_big", #Tp, NULL, sizeof (Sz), Ce->count.Tp); + + CONVERT_EMN(RECTANGLE, Edje_Part_Description_Common, ce); + CONVERT_EMN(TEXT, Edje_Part_Description_Text, ce); + CONVERT_EMN(IMAGE, Edje_Part_Description_Image, ce); + CONVERT_EMN(SWALLOW, Edje_Part_Description_Common, ce); + CONVERT_EMN(TEXTBLOCK, Edje_Part_Description_Text, ce); + CONVERT_EMN(GROUP, Edje_Part_Description_Common, ce); + CONVERT_EMN(BOX, Edje_Part_Description_Box, ce); + CONVERT_EMN(TABLE, Edje_Part_Description_Table, ce); + CONVERT_EMN(EXTERNAL, Edje_Part_Description_External, ce); + CONVERT_EMN(part, Edje_Part, ce); + + /* Change structure layout */ + edc = calloc(1, sizeof (Edje_Part_Collection)); + if (!edc) error_and_abort(ef, "Not enough memory\n"); + ce->ref = edc; + + EINA_LIST_FREE(oedc->programs, pg) + { + if (!pg->signal && !pg->source) + _edje_collection_program_add(&edc->programs.nocmp, + &edc->programs.nocmp_count, + pg); + else if (pg->signal && strpbrk(pg->signal, "*?[\\") == NULL + && pg->source && strpbrk(pg->source, "*?[\\") == NULL) + _edje_collection_program_add(&edc->programs.strcmp, + &edc->programs.strcmp_count, + pg); + else if (pg->signal && edje_program_is_strncmp(pg->signal) + && pg->source && edje_program_is_strncmp(pg->source)) + _edje_collection_program_add(&edc->programs.strncmp, + &edc->programs.strncmp_count, + pg); + else if (pg->signal && edje_program_is_strrncmp(pg->signal) + && pg->source && edje_program_is_strrncmp(pg->source)) + _edje_collection_program_add(&edc->programs.strrncmp, + &edc->programs.strrncmp_count, + pg); + else + _edje_collection_program_add(&edc->programs.fnmatch, + &edc->programs.fnmatch_count, + pg); + } + + edc->data = eina_hash_string_small_new(NULL); + EINA_LIST_FREE(oedc->data, di) + { + eina_hash_direct_add(edc->data, di->key, di->value); + free(di); + } + + edc->parts_count = eina_list_count(oedc->parts); + edc->parts = calloc(edc->parts_count, sizeof (Edje_Part *)); + if (edc->parts_count && !edc->parts) + error_and_abort(ef, "Not enough memory\n"); + k = 0; + + EINA_LIST_FREE(oedc->parts, part) + { + Old_Edje_Part_Description *oepd; + Edje_Pack_Element *elm; + Edje_Part *replacement; + unsigned int i; + + replacement = eina_mempool_malloc(ce->mp.part, sizeof (Edje_Part)); + if (!replacement) + error_and_abort(ef, "Not enough memory\n"); + + replacement->name = part->name; + replacement->default_desc = _edje_description_convert(part->type, ce, part->default_desc); + + replacement->other.desc_count = eina_list_count(part->other_desc); + replacement->other.desc = calloc(replacement->other.desc_count, sizeof (Edje_Part_Description_Common*)); + + i = 0; + EINA_LIST_FREE(part->other_desc, oepd) + replacement->other.desc[i++] = _edje_description_convert(part->type, ce, oepd); + + replacement->source = part->source; + replacement->source2 = part->source2; + replacement->source3 = part->source3; + replacement->source4 = part->source4; + replacement->source5 = part->source5; + replacement->source6 = part->source6; + replacement->id = part->id; + replacement->clip_to_id = part->clip_to_id; + replacement->dragable = part->dragable; + replacement->items_count = eina_list_count(part->items); + replacement->items = calloc(replacement->items_count, sizeof (Edje_Pack_Element*)); + + i = 0; + EINA_LIST_FREE(part->items, elm) + replacement->items[i++] = elm; + + replacement->type = part->type; + replacement->effect = part->effect; + replacement->mouse_events = part->mouse_events; + replacement->repeat_events = part->repeat_events; + replacement->ignore_flags = part->ignore_flags; + replacement->scale = part->scale; + replacement->precise_is_inside = part->precise_is_inside; + replacement->use_alternate_font_metrics = part->use_alternate_font_metrics; + replacement->pointer_mode = part->pointer_mode; + replacement->entry_mode = part->entry_mode; + replacement->select_mode = part->select_mode; + replacement->multiline = part->multiline; + replacement->api = part->api; + + edc->parts[k++] = replacement; + + free(part); + } + + edc->id = oedc->id; + edc->alias = oedc->alias; + edc->prop.min = oedc->prop.min; + edc->prop.max = oedc->prop.max; + edc->script = oedc->script; + edc->part = oedc->part; + edc->script_only = oedc->script_only; + edc->lua_script_only = oedc->lua_script_only; + edc->checked = oedc->checked; + + free(oedc); + + return edc; +} + +Edje_Part_Description_Common* +_edje_description_convert(int type, + Edje_Part_Collection_Directory_Entry *ce, + Old_Edje_Part_Description *oed) +{ + Edje_Part_Description_Common *result = NULL; + + switch (type) + { + case EDJE_PART_TYPE_RECTANGLE: + result = eina_mempool_malloc(ce->mp.RECTANGLE, + sizeof (Edje_Part_Description_Common)); + break; + case EDJE_PART_TYPE_SWALLOW: + result = eina_mempool_malloc(ce->mp.SWALLOW, + sizeof (Edje_Part_Description_Common)); + break; + case EDJE_PART_TYPE_GROUP: + result = eina_mempool_malloc(ce->mp.GROUP, + sizeof (Edje_Part_Description_Common)); + break; + + case EDJE_PART_TYPE_IMAGE: + { + Edje_Part_Description_Image *img; + Edje_Part_Image_Id *id; + unsigned int i = 0; + + img = eina_mempool_malloc(ce->mp.IMAGE, sizeof (Edje_Part_Description_Image)); + + img->image.tweens_count = eina_list_count(oed->image.tween_list); + img->image.tweens = calloc(img->image.tweens_count, + sizeof (Edje_Part_Image_Id*)); + if (img->image.tweens_count > 0 && !img->image.tweens) + { + eina_mempool_free(ce->mp.IMAGE, img); + return NULL; + } + + EINA_LIST_FREE(oed->image.tween_list, id) + img->image.tweens[i++] = id; + + img->image.id = oed->image.id; + img->image.scale_hint = oed->image.scale_hint; + img->image.set = oed->image.set; + + img->image.border = oed->image.border; + img->image.fill = oed->image.fill; + + result = &img->common; + break; + } + +#define CONVERT_ALLOC_POOL(Short, Type, Name) \ + case EDJE_PART_TYPE_##Short: \ + { \ + Edje_Part_Description_##Type *Name; \ + \ + Name = eina_mempool_malloc(ce->mp.Short, sizeof (Edje_Part_Description_##Type)); \ + Name->Name = oed->Name; \ + result = &Name->common; \ + break; \ + } + + CONVERT_ALLOC_POOL(TEXT, Text, text); + CONVERT_ALLOC_POOL(TEXTBLOCK, Text, text); + CONVERT_ALLOC_POOL(BOX, Box, box); + CONVERT_ALLOC_POOL(TABLE, Table, table); + CONVERT_ALLOC_POOL(EXTERNAL, External, external_params); + } + + *result = oed->common; + + free(oed); + return result; +} diff --git a/src/bin/edje_convert.h b/src/bin/edje_convert.h new file mode 100644 index 0000000..be43a10 --- /dev/null +++ b/src/bin/edje_convert.h @@ -0,0 +1,152 @@ +#ifndef EDJE_CONVERT_H__ +# define EDJE_CONVERT_H__ + +typedef struct _Old_Edje_Image_Directory Old_Edje_Image_Directory; +typedef struct _Old_Edje_Font_Directory Old_Edje_Font_Directory; +typedef struct _Old_Edje_External_Directory Old_Edje_External_Directory; +typedef struct _Old_Edje_Part Old_Edje_Part; +typedef struct _Old_Edje_Part_Collection Old_Edje_Part_Collection; +typedef struct _Old_Edje_Part_Collection_Directory Old_Edje_Part_Collection_Directory; +typedef struct _Old_Edje_Part_Description Old_Edje_Part_Description; +typedef struct _Old_Edje_Part_Description_Spec_Image Old_Edje_Part_Description_Spec_Image; +typedef struct _Edje_Data Edje_Data; + +struct _Edje_Data +{ + const char *key; + char *value; +}; + +/*----------*/ + +struct _Old_Edje_Font_Directory +{ + Eina_List *entries; /* a list of Edje_Font_Directory_Entry */ +}; + +struct _Old_Edje_Image_Directory +{ + Eina_List *entries; /* a list of Edje_Image_Directory_Entry */ + Eina_List *sets; /* a list of Edje_Image_Directory_Set */ +}; + +struct _Old_Edje_External_Directory +{ + Eina_List *entries; /* a list of Edje_External_Directory_Entry */ +}; + +struct _Old_Edje_File +{ + const char *path; + time_t mtime; + + Old_Edje_External_Directory *external_dir; + Old_Edje_Font_Directory *font_dir; + Old_Edje_Image_Directory *image_dir; + Old_Edje_Part_Collection_Directory *collection_dir; + Eina_List *data; + Eina_List *styles; + Eina_List *color_classes; + + const char *compiler; + int version; + int feature_ver; +}; + +struct _Old_Edje_Part_Collection +{ + Eina_List *programs; /* a list of Edje_Program */ + Eina_List *parts; /* a list of Edje_Part */ + Eina_List *data; + + int id; /* the collection id */ + + Eina_Hash *alias; /* aliasing part*/ + + struct { + Edje_Size min, max; + } prop; + + int references; +#ifdef EDJE_PROGRAM_CACHE + struct { + Eina_Hash *no_matches; + Eina_Hash *matches; + } prog_cache; +#endif + + Embryo_Program *script; /* all the embryo script code for this group */ + const char *part; + + unsigned char script_only; + + unsigned char lua_script_only; + + unsigned char checked : 1; +}; + +struct _Old_Edje_Part +{ + const char *name; /* the name if any of the part */ + Old_Edje_Part_Description *default_desc; /* the part descriptor for default */ + Eina_List *other_desc; /* other possible descriptors */ + const char *source, *source2, *source3, *source4, *source5, *source6; + int id; /* its id number */ + int clip_to_id; /* the part id to clip this one to */ + Edje_Part_Dragable dragable; + Eina_List *items; /* packed items for box and table */ + unsigned char type; /* what type (image, rect, text) */ + unsigned char effect; /* 0 = plain... */ + unsigned char mouse_events; /* it will affect/respond to mouse events */ + unsigned char repeat_events; /* it will repeat events to objects below */ + Evas_Event_Flags ignore_flags; + unsigned char scale; /* should certain properties scale with edje scale factor? */ + unsigned char precise_is_inside; + unsigned char use_alternate_font_metrics; + unsigned char pointer_mode; + unsigned char entry_mode; + unsigned char select_mode; + unsigned char multiline; + Edje_Part_Api api; +}; + +struct _Old_Edje_Part_Description_Spec_Image +{ + Eina_List *tween_list; /* list of Edje_Part_Image_Id */ + int id; /* the image id to use */ + int scale_hint; /* evas scale hint */ + Eina_Bool set; /* if image condition it's content */ + + Edje_Part_Description_Spec_Border border; + Edje_Part_Description_Spec_Fill fill; +}; + +struct _Old_Edje_Part_Description +{ + Edje_Part_Description_Common common; + Old_Edje_Part_Description_Spec_Image image; + Edje_Part_Description_Spec_Text text; + Edje_Part_Description_Spec_Box box; + Edje_Part_Description_Spec_Table table; + + Eina_List *external_params; /* parameters for external objects */ +}; + +struct _Old_Edje_Part_Collection_Directory +{ + Eina_List *entries; /* a list of Edje_Part_Collection_Directory_Entry */ + + int references; +}; + +Edje_File *_edje_file_convert(Eet_File *ef, Old_Edje_File *oedf); +Edje_Part_Collection *_edje_collection_convert(Eet_File *ef, + Edje_Part_Collection_Directory_Entry *ce, + Old_Edje_Part_Collection *oedc); +Edje_Part_Description_Common *_edje_description_convert(int type, + Edje_Part_Collection_Directory_Entry *ce, + Old_Edje_Part_Description *oed); +const Edje_File *_edje_file_get(void); +void _edje_file_set(const Edje_File *edf); + +#endif diff --git a/src/bin/edje_data_convert.c b/src/bin/edje_data_convert.c new file mode 100644 index 0000000..687153b --- /dev/null +++ b/src/bin/edje_data_convert.c @@ -0,0 +1,445 @@ +#include "edje_private.h" +#include "edje_convert.h" + +Eet_Data_Descriptor *_edje_edd_old_edje_file = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_style = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_style_tag = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_color_class = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_data = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_external_directory = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_external_directory_entry = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_font_directory = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_font_directory_entry = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_image_directory = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_image_directory_entry = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_image_directory_set = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_image_directory_set_entry = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_program = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_program_target = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_program_after = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_part_collection_directory = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_part_collection_directory_entry = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_pack_element = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_part_collection = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_part = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_part_description = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_part_image_id = NULL; +Eet_Data_Descriptor *_edje_edd_old_edje_external_param = NULL; + +#define FREED(eed) \ + if (eed) \ + { \ + eet_data_descriptor_free((eed)); \ + (eed) = NULL; \ + } + +void +_edje_edd_old_shutdown(void) +{ + FREED(_edje_edd_old_edje_file); + FREED(_edje_edd_old_edje_style); + FREED(_edje_edd_old_edje_style_tag); + FREED(_edje_edd_old_edje_color_class); + FREED(_edje_edd_old_edje_data); + FREED(_edje_edd_old_edje_external_directory); + FREED(_edje_edd_old_edje_external_directory_entry); + FREED(_edje_edd_old_edje_font_directory); + FREED(_edje_edd_old_edje_font_directory_entry); + FREED(_edje_edd_old_edje_image_directory); + FREED(_edje_edd_old_edje_image_directory_entry); + FREED(_edje_edd_old_edje_program); + FREED(_edje_edd_old_edje_program_target); + FREED(_edje_edd_old_edje_program_after); + FREED(_edje_edd_old_edje_part_collection_directory); + FREED(_edje_edd_old_edje_part_collection_directory_entry); + FREED(_edje_edd_old_edje_pack_element); + FREED(_edje_edd_old_edje_part_collection); + FREED(_edje_edd_old_edje_part); + FREED(_edje_edd_old_edje_part_description); + FREED(_edje_edd_old_edje_part_image_id); + FREED(_edje_edd_old_edje_external_param); + FREED(_edje_edd_old_edje_image_directory_set); + FREED(_edje_edd_old_edje_image_directory_set_entry); +} + +void +_edje_edd_old_init(void) +{ + Eet_Data_Descriptor_Class eddc; + + /* external directory */ + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_External_Directory_Entry); + _edje_edd_old_edje_external_directory_entry = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_external_directory_entry, Edje_External_Directory_Entry, "entry", entry, EET_T_STRING); + + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_External_Directory", + sizeof (Old_Edje_External_Directory)); + _edje_edd_old_edje_external_directory = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_external_directory, Edje_External_Directory, "entries", entries, _edje_edd_old_edje_external_directory_entry); + + /* font directory */ + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Font_Directory_Entry); + _edje_edd_old_edje_font_directory_entry = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_font_directory_entry, Edje_Font_Directory_Entry, "entry", entry, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_font_directory_entry, Edje_Font_Directory_Entry, "file", file, EET_T_STRING); + + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Font_Directory", + sizeof (Old_Edje_Font_Directory)); + _edje_edd_old_edje_font_directory = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_font_directory, Old_Edje_Font_Directory, "entries", entries, _edje_edd_old_edje_font_directory_entry); + + /* image directory */ + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Entry); + _edje_edd_old_edje_image_directory_entry = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_entry, Edje_Image_Directory_Entry, "entry", entry, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_entry, Edje_Image_Directory_Entry, "source_type", source_type, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_entry, Edje_Image_Directory_Entry, "source_param", source_param, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_entry, Edje_Image_Directory_Entry, "id", id, EET_T_INT); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Set_Entry); + _edje_edd_old_edje_image_directory_set_entry = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "id", id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "min.w", size.min.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "min.h", size.min.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "max.w", size.max.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set_entry, Edje_Image_Directory_Set_Entry, "max.h", size.max.h, EET_T_INT); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Set); + _edje_edd_old_edje_image_directory_set = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set, Edje_Image_Directory_Set, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_image_directory_set, Edje_Image_Directory_Set, "id", id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_image_directory_set, Edje_Image_Directory_Set, "entries", entries, _edje_edd_old_edje_image_directory_set_entry); + + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Image_Directory", + sizeof (Old_Edje_Image_Directory)); + _edje_edd_old_edje_image_directory = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_image_directory, Old_Edje_Image_Directory, "entries", entries, _edje_edd_old_edje_image_directory_entry); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_image_directory, Old_Edje_Image_Directory, "sets", sets, _edje_edd_old_edje_image_directory_set); + + /* collection directory */ + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Collection_Directory_Entry); + _edje_edd_old_edje_part_collection_directory_entry = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "entry", entry, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "id", id, EET_T_INT); + + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part_Collection_Directory", + sizeof (Old_Edje_Part_Collection_Directory)); + _edje_edd_old_edje_part_collection_directory = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_collection_directory, Old_Edje_Part_Collection_Directory, "entries", entries, _edje_edd_old_edje_part_collection_directory_entry); + + /* generic data attachment */ + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Data); + _edje_edd_old_edje_data = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_data, Edje_Data, "key", key, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_data, Edje_Data, "value", value, EET_T_STRING); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Style_Tag); + _edje_edd_old_edje_style_tag = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_style_tag, Edje_Style_Tag, "key", key, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_style_tag, Edje_Style_Tag, "value", value, EET_T_STRING); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Style); + _edje_edd_old_edje_style = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_style, Edje_Style, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_style, Edje_Style, "tags", tags, _edje_edd_old_edje_style_tag); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Color_Class); + _edje_edd_old_edje_color_class = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "r", r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "g", g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "b", b, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "a", a, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "r2", r2, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "g2", g2, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "b2", b2, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "a2", a2, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "r3", r3, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "g3", g3, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "b3", b3, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_color_class, Edje_Color_Class, "a3", a3, EET_T_UCHAR); + + /* the main file directory */ + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_File", sizeof (Old_Edje_File)); + _edje_edd_old_edje_file = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_file, Old_Edje_File, "compiler", compiler, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_file, Old_Edje_File, "version", version, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_file, Old_Edje_File, "feature_ver", feature_ver, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_old_edje_file, Old_Edje_File, "external_dir", external_dir, _edje_edd_old_edje_external_directory); + EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_old_edje_file, Old_Edje_File, "font_dir", font_dir, _edje_edd_old_edje_font_directory); + EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_old_edje_file, Old_Edje_File, "image_dir", image_dir, _edje_edd_old_edje_image_directory); + EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_old_edje_file, Old_Edje_File, "collection_dir", collection_dir, _edje_edd_old_edje_part_collection_directory); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_file, Old_Edje_File, "data", data, _edje_edd_old_edje_data); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_file, Old_Edje_File, "styles", styles, _edje_edd_old_edje_style); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_file, Old_Edje_File, "color_classes", color_classes, _edje_edd_old_edje_color_class); + + /* parts & programs - loaded induvidually */ + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Program_Target); + _edje_edd_old_edje_program_target = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program_target, Edje_Program_Target, "id", id, EET_T_INT); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Program_After); + _edje_edd_old_edje_program_after = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program_after, + Edje_Program_After, "id", id, EET_T_INT); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Program); + _edje_edd_old_edje_program = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "id", id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "signal", signal, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "source", source, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "filter_part", filter.part, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "filter_state", filter.state, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "in.from", in.from, EET_T_DOUBLE); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "in.range", in.range, EET_T_DOUBLE); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "action", action, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "state", state, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "state2", state2, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "value", value, EET_T_DOUBLE); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "value2", value2, EET_T_DOUBLE); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "tween.mode", tween.mode, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "tween.time", tween.time, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_program, Edje_Program, "targets", targets, _edje_edd_old_edje_program_target); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_program, Edje_Program, "after", after, _edje_edd_old_edje_program_after); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "api.name", api.name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "api.description", api.description, EET_T_STRING); + + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "param.src", param.src, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_program, Edje_Program, "param.dst", param.dst, EET_T_INT); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Image_Id); + _edje_edd_old_edje_part_image_id = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_image_id, Edje_Part_Image_Id, "id", id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_image_id, Edje_Part_Image_Id, "set", set, EET_T_UCHAR); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_External_Param); + _edje_edd_old_edje_external_param = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_external_param, Edje_External_Param, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_external_param, Edje_External_Param, "type", type, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_external_param, Edje_External_Param, "i", i, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_external_param, Edje_External_Param, "d", d, EET_T_DOUBLE); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_external_param, Edje_External_Param, "s", s, EET_T_STRING); + + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part_Description", sizeof (Old_Edje_Part_Description)); + _edje_edd_old_edje_part_description = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "state.name", common.state.name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "state.value", common.state.value, EET_T_DOUBLE); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "visible", common.visible, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "align.x", common.align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "align.y", common.align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fixed.w", common.fixed.w, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fixed.h", common.fixed.h, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "min.w", common.min.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "min.h", common.min.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "max.w", common.max.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "max.h", common.max.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "step.x", common.step.x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "step.y", common.step.y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "aspect.min", common.aspect.min, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "aspect.max", common.aspect.max, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "aspect.prefer", common.aspect.prefer, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel1.relative_x", common.rel1.relative_x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel1.relative_y", common.rel1.relative_y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel1.offset_x", common.rel1.offset_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel1.offset_y", common.rel1.offset_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel1.id_x", common.rel1.id_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel1.id_y", common.rel1.id_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel2.relative_x", common.rel2.relative_x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel2.relative_y", common.rel2.relative_y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel2.offset_x", common.rel2.offset_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel2.offset_y", common.rel2.offset_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel2.id_x", common.rel2.id_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "rel2.id_y", common.rel2.id_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "image.id", image.id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "image.set", image.set, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "image.tween_list", image.tween_list, _edje_edd_old_edje_part_image_id); + + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "border.l", image.border.l, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "border.r", image.border.r, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "border.t", image.border.t, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "border.b", image.border.b, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "border.no_fill", image.border.no_fill, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "border.scale", image.border.scale, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.smooth", image.fill.smooth, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.pos_rel_x", image.fill.pos_rel_x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.pos_abs_x", image.fill.pos_abs_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.rel_x", image.fill.rel_x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.abs_x", image.fill.abs_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.pos_rel_y", image.fill.pos_rel_y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.pos_abs_y", image.fill.pos_abs_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.rel_y", image.fill.rel_y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.abs_y", image.fill.abs_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.angle", image.fill.angle, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.spread", image.fill.spread, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "fill.type", image.fill.type, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color_class", common.color_class, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color.r", common.color.r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color.g", common.color.g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color.b", common.color.b, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color.a", common.color.a, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color2.r", common.color2.r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color2.g", common.color2.g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color2.b", common.color2.b, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color2.a", common.color2.a, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color3.r", text.color3.r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color3.g", text.color3.g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color3.b", text.color3.b, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "color3.a", text.color3.a, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.text", text.text, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.text_class", text.text_class, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.style", text.style, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.font", text.font, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.repch", text.repch, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.size", text.size, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.fit_x", text.fit_x, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.fit_y", text.fit_y, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.min_x", text.min_x, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.min_y", text.min_y, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.max_x", text.max_x, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.max_y", text.max_y, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.align.x", text.align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.align.y", text.align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.id_source", text.id_source, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.id_text_source", text.id_text_source, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.elipsis", text.elipsis, EET_T_DOUBLE); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "box.layout", box.layout, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "box.alt_layout", box.alt_layout, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "box.align.x", box.align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "box.align.y", box.align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "box.padding.x", box.padding.x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "box.padding.y", box.padding.y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "box.min.h", box.min.h, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "box.min.v", box.min.v, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "table.homogeneous", table.homogeneous, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "table.align.x", table.align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "table.align.y", table.align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "table.padding.x", table.padding.x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "table.padding.y", table.padding.y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.id_persp", common.map.id_persp, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.id_light", common.map.id_light, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.rot.id_center", common.map.rot.id_center, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.rot.x", common.map.rot.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.rot.y", common.map.rot.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.rot.z", common.map.rot.z, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.on", common.map.on, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.smooth", common.map.smooth, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.alpha", common.map.alpha, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.persp_on", common.map.persp_on, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "map.backcull", common.map.backcull, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "persp.zplane", common.persp.zplane, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "persp.focal", common.persp.focal, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "external_params", external_params, _edje_edd_old_edje_external_param); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Pack_Element); + _edje_edd_old_edje_pack_element = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "type", type, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "source", source, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "min.w", min.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "min.h", min.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "prefer.w", prefer.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "prefer.h", prefer.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "max.w", max.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "max.h", max.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "padding.l", padding.l, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "padding.r", padding.r, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "padding.t", padding.t, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "padding.b", padding.b, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "align.x", align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "align.y", align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "weight.x", weight.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "weight.y", weight.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "aspect.w", aspect.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "aspect.h", aspect.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "aspect.mode", aspect.mode, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "options", options, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "col", col, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "row", row, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "colspan", colspan, EET_T_USHORT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_pack_element, Edje_Pack_Element, "rowspan", rowspan, EET_T_USHORT); + + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part", sizeof (Old_Edje_Part)); + _edje_edd_old_edje_part = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "id", id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "type", type, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "effect", effect, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "mouse_events", mouse_events, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "repeat_events", repeat_events, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "ignore_flags", ignore_flags, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "scale", scale, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "pointer_mode", pointer_mode, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "precise_is_inside", precise_is_inside, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "clip_to_id", clip_to_id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "use_alternate_font_metrics", use_alternate_font_metrics, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_old_edje_part, Old_Edje_Part, "default_desc", default_desc, _edje_edd_old_edje_part_description); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part, Old_Edje_Part, "other_desc", other_desc, _edje_edd_old_edje_part_description); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "dragable.x", dragable.x, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "dragable.step_x", dragable.step_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "dragable.count_x", dragable.count_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "dragable.y", dragable.y, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "dragable.step_y", dragable.step_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "dragable.count_y", dragable.count_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "dragable.counfine_id", dragable.confine_id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "dragable.events_id", dragable.event_id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "entry_mode", entry_mode, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "select_mode", select_mode, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "multiline", multiline, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source", source, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source2", source2, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source3", source3, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source4", source4, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source5", source5, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "source6", source6, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part, Old_Edje_Part, "items", items, _edje_edd_old_edje_pack_element); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "api.name", api.name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part, Old_Edje_Part, "api.description", api.description, EET_T_STRING); + + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part_Collection", sizeof (Old_Edje_Part_Collection)); + _edje_edd_old_edje_part_collection = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "programs", programs, _edje_edd_old_edje_program); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "parts", parts, _edje_edd_old_edje_part); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "data", data, _edje_edd_old_edje_data); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "prop.min.w", prop.min.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "prop.min.h", prop.min.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "id", id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_collection, Old_Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); + + { + Old_Edje_Part_Collection epc; + + eet_data_descriptor_element_add(_edje_edd_old_edje_part_collection, + "alias", EET_T_STRING, EET_G_HASH, + (char *)(&(epc.alias)) - (char *)(&(epc)), + 0, /* 0, */NULL, NULL); + } +} diff --git a/src/bin/edje_decc.c b/src/bin/edje_decc.c index b0acf34..072461c 100644 --- a/src/bin/edje_decc.c +++ b/src/bin/edje_decc.c @@ -23,7 +23,7 @@ char *progname = NULL; char *file_in = NULL; char *file_out = NULL; -Old_Edje_File *edje_file = NULL; +Edje_File *edje_file = NULL; SrcFile_List *srcfiles = NULL; Font_List *fontlist = NULL; @@ -134,7 +134,7 @@ decomp(void) eet_close(ef); return 0; } - edje_file = eet_data_read(ef, _edje_edd_edje_file, "edje_file"); + edje_file = eet_data_read(ef, _edje_edd_edje_file, "edje/file"); if (!edje_file) { ERR("ERROR: %s does not appear to be an edje file", file_in); @@ -183,9 +183,12 @@ output(void) if (edje_file->image_dir) { Edje_Image_Directory_Entry *ei; + unsigned int i; - EINA_LIST_FOREACH(edje_file->image_dir->entries, l, ei) + for (i = 0; i < edje_file->image_dir->entries_count; ++i) { + ei = &edje_file->image_dir->entries[i]; + if ((ei->source_type > EDJE_IMAGE_SOURCE_TYPE_NONE) && (ei->source_type < EDJE_IMAGE_SOURCE_TYPE_LAST) && (ei->source_type != EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) && diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 480349a..15fa3a9 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -44,8 +44,7 @@ edje_script_only.c \ edje_lua_script_only.c \ edje_entry.c \ edje_external.c \ -edje_module.c \ -edje_convert.c +edje_module.c if EDJE_AMALGAMATION nodist_libedje_la_SOURCES = edje_amalgamation.c diff --git a/src/lib/edje_cache.c b/src/lib/edje_cache.c index 715bcb2..8ad3375 100644 --- a/src/lib/edje_cache.c +++ b/src/lib/edje_cache.c @@ -58,7 +58,6 @@ static int _edje_collection_cache_size = 16; static Edje_Part_Collection * _edje_file_coll_open(Edje_File *edf, const char *coll) { - Old_Edje_Part_Collection *oedc = NULL; Edje_Part_Collection *edc = NULL; Edje_Part_Collection_Directory_Entry *ce; int id = -1, size = 0; @@ -90,18 +89,13 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) id = ce->id; if (id < 0) return NULL; - snprintf(buf, sizeof(buf), "collections/%i", id); - oedc = eet_data_read(edf->ef, _edje_edd_edje_part_collection, buf); - if (!oedc) return NULL; - - oedc->part = ce->entry; - - edc = _edje_collection_convert(edf, oedc); - oedc = NULL; + snprintf(buf, sizeof(buf), "edje/collections/%i", id); + edc = eet_data_read(edf->ef, _edje_edd_edje_part_collection, buf); + if (!edc) return NULL; edc->references = 1; - snprintf(buf, sizeof(buf), "scripts/%i", id); + snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i", id); data = eet_read(edf->ef, buf, &size); if (data) @@ -111,7 +105,7 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) free(data); } - snprintf(buf, sizeof(buf), "lua_scripts/%i", id); + snprintf(buf, sizeof(buf), "edje/scripts/lua/%i", id); data = eet_read(edf->ef, buf, &size); if (data) @@ -143,7 +137,6 @@ _edje_file_coll_open(Edje_File *edf, const char *coll) static Edje_File * _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Collection **edc_ret) { - Old_Edje_File *oedf; Edje_File *edf; Edje_Part_Collection *edc; Eet_File *ef; @@ -161,16 +154,14 @@ _edje_file_open(const char *file, const char *coll, int *error_ret, Edje_Part_Co *error_ret = EDJE_LOAD_ERROR_UNKNOWN_FORMAT; return NULL; } - oedf = eet_data_read(ef, _edje_edd_edje_file, "edje_file"); - if (!oedf) + edf = eet_data_read(ef, _edje_edd_edje_file, "edje/file"); + if (!edf) { *error_ret = EDJE_LOAD_ERROR_CORRUPT_FILE; eet_close(ef); return NULL; } - edf = _edje_file_convert(ef, oedf); - edf->ef = ef; edf->mtime = st.st_mtime; diff --git a/src/lib/edje_calc.c b/src/lib/edje_calc.c index e0c134c..c559787 100644 --- a/src/lib/edje_calc.c +++ b/src/lib/edje_calc.c @@ -84,9 +84,9 @@ _edje_part_description_find(Edje *ed __UNUSED__, Edje_Real_Part *rp, const char ret = ep->default_desc; min_dst = ABS(ep->default_desc->state.value - val); } - for (i = 0; i < ep->other_count; ++i) + for (i = 0; i < ep->other.desc_count; ++i) { - d = ep->other_desc[i]; + d = ep->other.desc[i]; if (!strcmp(d->state.name, name)) { @@ -1601,8 +1601,8 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj { char buf[1024]; - /* Replace snprint("images/%i") == memcpy + itoa */ -#define IMAGES "images/" + /* Replace snprint("edje/images/%i") == memcpy + itoa */ +#define IMAGES "edje/images/" memcpy(buf, IMAGES, strlen(IMAGES)); eina_convert_itoa(image_id, buf + strlen(IMAGES)); /* No need to check length as 2³² need only 10 characteres. */ diff --git a/src/lib/edje_data.c b/src/lib/edje_data.c index 3bb7979..4aca234 100644 --- a/src/lib/edje_data.c +++ b/src/lib/edje_data.c @@ -4,25 +4,38 @@ 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_external_directory = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_external_directory_entry = NULL; -EAPI Eet_Data_Descriptor *_edje_edd_edje_font_directory = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_font_directory_entry = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_set = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_image_directory_set_entry = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_program = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_program_pointer = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_program_target = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_program_after = NULL; -EAPI Eet_Data_Descriptor *_edje_edd_edje_part_collection_directory = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_part_collection_directory_entry = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_pack_element = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_part_collection = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_part = NULL; -EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_pointer = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_variant = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_common = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_image = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_text = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_box = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_table = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_external = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_variant_list = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_common_pointer = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_image_pointer = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_text_pointer = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_box_pointer = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_table_pointer = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_description_external_pointer = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_part_image_id = NULL; +EAPI Eet_Data_Descriptor *_edje_edd_edje_part_image_id_pointer = NULL; EAPI Eet_Data_Descriptor *_edje_edd_edje_external_param = NULL; #define FREED(eed) \ @@ -32,6 +45,54 @@ EAPI Eet_Data_Descriptor *_edje_edd_edje_external_param = NULL; (eed) = NULL; \ } +struct { + Edje_Part_Type type; + const char *name; +} variant_convertion[] = { + { EDJE_PART_TYPE_RECTANGLE, "rectangle" }, + { EDJE_PART_TYPE_SWALLOW, "swallow" }, + { EDJE_PART_TYPE_GROUP, "group" }, + { EDJE_PART_TYPE_IMAGE, "image" }, + { EDJE_PART_TYPE_TEXT, "text" }, + { EDJE_PART_TYPE_TEXTBLOCK, "textblock" }, + { EDJE_PART_TYPE_BOX, "box" }, + { EDJE_PART_TYPE_TABLE, "table" }, + { EDJE_PART_TYPE_EXTERNAL, "external" }, +}; + +static const char * +_edje_description_variant_type_get(const void *data, Eina_Bool *unknow __UNUSED__) +{ + const unsigned char *type; + unsigned int i; + + type = data; + + for (i = 0; i < (sizeof (variant_convertion) / sizeof (variant_convertion[0])); ++i) + if (*type == variant_convertion[i].type) + return variant_convertion[i].name; + + return NULL; +} + +static Eina_Bool +_edje_description_variant_type_set(const char *type, void *data, Eina_Bool unknow __UNUSED__) +{ + unsigned char *dt; + unsigned int i; + + dt = data; + + for (i = 0; i < (sizeof (variant_convertion) / sizeof (variant_convertion[0])); ++i) + if (!strcmp(variant_convertion[i].name, type)) + { + *dt = variant_convertion[i].type; + return EINA_TRUE; + } + + return EINA_FALSE; +} + void _edje_edd_shutdown(void) { @@ -39,28 +100,55 @@ _edje_edd_shutdown(void) FREED(_edje_edd_edje_style); FREED(_edje_edd_edje_style_tag); FREED(_edje_edd_edje_color_class); - FREED(_edje_edd_edje_data); FREED(_edje_edd_edje_external_directory); FREED(_edje_edd_edje_external_directory_entry); - FREED(_edje_edd_edje_font_directory); FREED(_edje_edd_edje_font_directory_entry); FREED(_edje_edd_edje_image_directory); FREED(_edje_edd_edje_image_directory_entry); FREED(_edje_edd_edje_program); + FREED(_edje_edd_edje_program_pointer); FREED(_edje_edd_edje_program_target); FREED(_edje_edd_edje_program_after); - FREED(_edje_edd_edje_part_collection_directory); FREED(_edje_edd_edje_part_collection_directory_entry); FREED(_edje_edd_edje_pack_element); FREED(_edje_edd_edje_part_collection); FREED(_edje_edd_edje_part); - FREED(_edje_edd_edje_part_description); + FREED(_edje_edd_edje_part_pointer); + FREED(_edje_edd_edje_part_description_variant); + FREED(_edje_edd_edje_part_description_common); + FREED(_edje_edd_edje_part_description_image); + FREED(_edje_edd_edje_part_description_text); + FREED(_edje_edd_edje_part_description_box); + FREED(_edje_edd_edje_part_description_table); + FREED(_edje_edd_edje_part_description_external); + FREED(_edje_edd_edje_part_description_variant_list); + FREED(_edje_edd_edje_part_description_common_pointer); + FREED(_edje_edd_edje_part_description_image_pointer); + FREED(_edje_edd_edje_part_description_text_pointer); + FREED(_edje_edd_edje_part_description_box_pointer); + FREED(_edje_edd_edje_part_description_table_pointer); + FREED(_edje_edd_edje_part_description_external_pointer); FREED(_edje_edd_edje_part_image_id); + FREED(_edje_edd_edje_part_image_id_pointer); FREED(_edje_edd_edje_external_param); FREED(_edje_edd_edje_image_directory_set); FREED(_edje_edd_edje_image_directory_set_entry); } +#define EDJE_DEFINE_POINTER_TYPE(Type, Name) \ + { \ + typedef struct _Edje_##Type##_Pointer Edje_##Type##_Pointer; \ + struct _Edje_##Type##_Pointer \ + { \ + Edje_##Type *pointer; \ + }; \ + \ + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_##Type##_Pointer); \ + _edje_edd_edje_##Name##_pointer = \ + eet_data_descriptor_file_new(&eddc); \ + EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_##Name##_pointer, Edje_##Type##_Pointer, "pointer", pointer, _edje_edd_edje_##Name); \ + } + void _edje_edd_init(void) { @@ -72,11 +160,10 @@ _edje_edd_init(void) eet_data_descriptor_file_new(&eddc); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_external_directory_entry, Edje_External_Directory_Entry, "entry", entry, EET_T_STRING); - eet_eina_file_data_descriptor_class_set(&eddc, "Edje_External_Directory", - sizeof (Old_Edje_External_Directory)); + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_External_Directory); _edje_edd_edje_external_directory = eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_external_directory, Edje_External_Directory, "entries", entries, _edje_edd_edje_external_directory_entry); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_external_directory, Edje_External_Directory, "entries", entries, _edje_edd_edje_external_directory_entry); /* font directory */ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Font_Directory_Entry); @@ -85,12 +172,6 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_font_directory_entry, Edje_Font_Directory_Entry, "entry", entry, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_font_directory_entry, Edje_Font_Directory_Entry, "file", file, EET_T_STRING); - eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Font_Directory", - sizeof (Old_Edje_Font_Directory)); - _edje_edd_edje_font_directory = - eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_font_directory, Old_Edje_Font_Directory, "entries", entries, _edje_edd_edje_font_directory_entry); - /* image directory */ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Entry); _edje_edd_edje_image_directory_entry = @@ -117,12 +198,11 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_image_directory_set, Edje_Image_Directory_Set, "id", id, EET_T_INT); EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory_set, Edje_Image_Directory_Set, "entries", entries, _edje_edd_edje_image_directory_set_entry); - eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Image_Directory", - sizeof (Old_Edje_Image_Directory)); + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory); _edje_edd_edje_image_directory = eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Old_Edje_Image_Directory, "entries", entries, _edje_edd_edje_image_directory_entry); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Old_Edje_Image_Directory, "sets", sets, _edje_edd_edje_image_directory_set); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_image_directory, Edje_Image_Directory, "entries", entries, _edje_edd_edje_image_directory_entry); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_image_directory, Edje_Image_Directory, "sets", sets, _edje_edd_edje_image_directory_set); /* collection directory */ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Collection_Directory_Entry); @@ -130,18 +210,16 @@ _edje_edd_init(void) eet_data_descriptor_file_new(&eddc); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "entry", entry, EET_T_STRING); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "id", id, EET_T_INT); - - EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Collection_Directory); - _edje_edd_edje_part_collection_directory = - eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_collection_directory, Edje_Part_Collection_Directory, "entries", entries, _edje_edd_edje_part_collection_directory_entry); - - /* generic data attachment */ - EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Data); - _edje_edd_edje_data = - eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_data, Edje_Data, "key", key, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_data, Edje_Data, "value", value, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.RECTANGLE", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TEXT", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.IMAGE", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.SWALLOW", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TEXTBLOCK", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.GROUP", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.BOX", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.TABLE", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.EXTERNAL", count.RECTANGLE, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection_directory_entry, Edje_Part_Collection_Directory_Entry, "count.part", count.RECTANGLE, EET_T_INT); EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Style_Tag); _edje_edd_edje_style_tag = @@ -173,19 +251,19 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "a3", a3, EET_T_UCHAR); /* the main file directory */ - eet_eina_file_data_descriptor_class_set(&eddc, "Edje_File", sizeof (Old_Edje_File)); + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_File); _edje_edd_edje_file = eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Old_Edje_File, "compiler", compiler, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Old_Edje_File, "version", version, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Old_Edje_File, "feature_ver", feature_ver, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "external_dir", external_dir, _edje_edd_edje_external_directory); - EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "font_dir", font_dir, _edje_edd_edje_font_directory); - EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory); - EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Old_Edje_File, "collection_dir", collection_dir, _edje_edd_edje_part_collection_directory); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Old_Edje_File, "data", data, _edje_edd_edje_data); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Old_Edje_File, "styles", styles, _edje_edd_edje_style); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Old_Edje_File, "color_classes", color_classes, _edje_edd_edje_color_class); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "compiler", compiler, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "version", version, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_file, Edje_File, "feature_ver", feature_ver, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "external_dir", external_dir, _edje_edd_edje_external_directory); + EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory); + 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); + EET_DATA_DESCRIPTOR_ADD_HASH_STRING(_edje_edd_edje_file, Edje_File, "data", data); + EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_file, Edje_File, "fonts", fonts, _edje_edd_edje_font_directory_entry); + EET_DATA_DESCRIPTOR_ADD_HASH(_edje_edd_edje_file, Edje_File, "collection", collection, _edje_edd_edje_part_collection_directory_entry); /* parts & programs - loaded induvidually */ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Program_Target); @@ -240,116 +318,242 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_external_param, Edje_External_Param, "d", d, EET_T_DOUBLE); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_external_param, Edje_External_Param, "s", s, EET_T_STRING); - eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part_Description", sizeof (Old_Edje_Part_Description)); - _edje_edd_edje_part_description = +#define EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(Edd, Type, Dec) \ + { \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "state.name", Dec.state.name, EET_T_STRING); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "state.value", Dec.state.value, EET_T_DOUBLE); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "visible", Dec.visible, EET_T_CHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "align.x", Dec.align.x, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "align.y", Dec.align.y, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.w", Dec.fixed.w, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "fixed.h", Dec.fixed.h, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.w", Dec.min.w, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "min.h", Dec.min.h, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.w", Dec.max.w, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "max.h", Dec.max.h, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.x", Dec.step.x, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "step.y", Dec.step.y, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "aspect.min", Dec.aspect.min, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "aspect.max", Dec.aspect.max, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "aspect.prefer", Dec.aspect.prefer, EET_T_CHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel1.relative_x", Dec.rel1.relative_x, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel1.relative_y", Dec.rel1.relative_y, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel1.offset_x", Dec.rel1.offset_x, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel1.offset_y", Dec.rel1.offset_y, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel1.id_x", Dec.rel1.id_x, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel1.id_y", Dec.rel1.id_y, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel2.relative_x", Dec.rel2.relative_x, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel2.relative_y", Dec.rel2.relative_y, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel2.offset_x", Dec.rel2.offset_x, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel2.offset_y", Dec.rel2.offset_y, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel2.id_x", Dec.rel2.id_x, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "rel2.id_y", Dec.rel2.id_y, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color_class", Dec.color_class, EET_T_STRING); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color.r", Dec.color.r, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color.g", Dec.color.g, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color.b", Dec.color.b, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color.a", Dec.color.a, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color2.r", Dec.color2.r, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color2.g", Dec.color2.g, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color2.b", Dec.color2.b, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "color2.a", Dec.color2.a, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.id_persp", Dec.map.id_persp, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.id_light", Dec.map.id_light, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.id_center", Dec.map.rot.id_center, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.x", Dec.map.rot.x, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.y", Dec.map.rot.y, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.rot.z", Dec.map.rot.z, EDJE_T_FLOAT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.on", Dec.map.on, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.smooth", Dec.map.smooth, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.alpha", Dec.map.alpha, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.persp_on", Dec.map.persp_on, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "map.backcull", Dec.map.backcull, EET_T_UCHAR); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "persp.zplane", Dec.persp.zplane, EET_T_INT); \ + EET_DATA_DESCRIPTOR_ADD_BASIC(Edd, Type, "persp.focal", Dec.persp.focal, EET_T_INT); \ + } + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Common); + _edje_edd_edje_part_description_common = + eet_data_descriptor_file_new(&eddc); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "state.name", state.name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "state.value", state.value, EET_T_DOUBLE); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "visible", visible, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "align.x", align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "align.y", align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "fixed.w", fixed.w, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "fixed.h", fixed.h, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "min.w", min.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "min.h", min.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "max.w", max.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "max.h", max.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "step.x", step.x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "step.y", step.y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "aspect.min", aspect.min, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "aspect.max", aspect.max, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "aspect.prefer", aspect.prefer, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel1.relative_x", rel1.relative_x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel1.relative_y", rel1.relative_y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel1.offset_x", rel1.offset_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel1.offset_y", rel1.offset_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel1.id_x", rel1.id_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel1.id_y", rel1.id_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel2.relative_x", rel2.relative_x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel2.relative_y", rel2.relative_y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel2.offset_x", rel2.offset_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel2.offset_y", rel2.offset_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel2.id_x", rel2.id_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "rel2.id_y", rel2.id_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color_class", color_class, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color.r", color.r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color.g", color.g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color.b", color.b, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color.a", color.a, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color2.r", color2.r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color2.g", color2.g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color2.b", color2.b, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "color2.a", color2.a, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.id_persp", map.id_persp, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.id_light", map.id_light, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.rot.id_center", map.rot.id_center, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.rot.x", map.rot.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.rot.y", map.rot.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.rot.z", map.rot.z, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.on", map.on, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.smooth", map.smooth, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.alpha", map.alpha, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.persp_on", map.persp_on, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "map.backcull", map.backcull, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "persp.zplane", persp.zplane, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_common, Edje_Part_Description_Common, "persp.focal", persp.focal, EET_T_INT); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Image); + _edje_edd_edje_part_description_image = + eet_data_descriptor_file_new(&eddc); + EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, common); + + EDJE_DEFINE_POINTER_TYPE(Part_Image_Id, part_image_id); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.tweens", image.tweens, _edje_edd_edje_part_image_id_pointer); + + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.id", image.id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.set", image.set, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.border.l", image.border.l, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.border.r", image.border.r, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.border.t", image.border.t, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.border.b", image.border.b, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.border.no_fill", image.border.no_fill, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.border.scale", image.border.scale, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.smooth", image.fill.smooth, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.pos_rel_x", image.fill.pos_rel_x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.pos_abs_x", image.fill.pos_abs_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.rel_x", image.fill.rel_x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.abs_x", image.fill.abs_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.pos_rel_y", image.fill.pos_rel_y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.pos_abs_y", image.fill.pos_abs_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.rel_y", image.fill.rel_y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.abs_y", image.fill.abs_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.angle", image.fill.angle, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.spread", image.fill.spread, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_image, Edje_Part_Description_Image, "image.fill.type", image.fill.type, EET_T_CHAR); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Text); + _edje_edd_edje_part_description_text = eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "state.name", common.state.name, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "state.value", common.state.value, EET_T_DOUBLE); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "visible", common.visible, EET_T_CHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "align.x", common.align.x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "align.y", common.align.y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fixed.w", common.fixed.w, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fixed.h", common.fixed.h, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "min.w", common.min.w, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "min.h", common.min.h, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "max.w", common.max.w, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "max.h", common.max.h, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "step.x", common.step.x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "step.y", common.step.y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "aspect.min", common.aspect.min, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "aspect.max", common.aspect.max, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "aspect.prefer", common.aspect.prefer, EET_T_CHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel1.relative_x", common.rel1.relative_x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel1.relative_y", common.rel1.relative_y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel1.offset_x", common.rel1.offset_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel1.offset_y", common.rel1.offset_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel1.id_x", common.rel1.id_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel1.id_y", common.rel1.id_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel2.relative_x", common.rel2.relative_x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel2.relative_y", common.rel2.relative_y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel2.offset_x", common.rel2.offset_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel2.offset_y", common.rel2.offset_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel2.id_x", common.rel2.id_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "rel2.id_y", common.rel2.id_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "image.id", image.id, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "image.set", image.set, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description, Old_Edje_Part_Description, "image.tween_list", image.tween_list, _edje_edd_edje_part_image_id); - - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "border.l", image.border.l, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "border.r", image.border.r, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "border.t", image.border.t, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "border.b", image.border.b, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "border.no_fill", image.border.no_fill, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "border.scale", image.border.scale, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.smooth", image.fill.smooth, EET_T_CHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.pos_rel_x", image.fill.pos_rel_x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.pos_abs_x", image.fill.pos_abs_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.rel_x", image.fill.rel_x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.abs_x", image.fill.abs_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.pos_rel_y", image.fill.pos_rel_y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.pos_abs_y", image.fill.pos_abs_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.rel_y", image.fill.rel_y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.abs_y", image.fill.abs_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.angle", image.fill.angle, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.spread", image.fill.spread, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "fill.type", image.fill.type, EET_T_CHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color_class", common.color_class, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color.r", common.color.r, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color.g", common.color.g, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color.b", common.color.b, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color.a", common.color.a, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color2.r", common.color2.r, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color2.g", common.color2.g, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color2.b", common.color2.b, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color2.a", common.color2.a, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color3.r", text.color3.r, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color3.g", text.color3.g, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color3.b", text.color3.b, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "color3.a", text.color3.a, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.text", text.text, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.text_class", text.text_class, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.style", text.style, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.font", text.font, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.repch", text.repch, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.size", text.size, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.fit_x", text.fit_x, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.fit_y", text.fit_y, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.min_x", text.min_x, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.min_y", text.min_y, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.max_x", text.max_x, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.max_y", text.max_y, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.align.x", text.align.x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.align.y", text.align.y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.id_source", text.id_source, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.id_text_source", text.id_text_source, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "text.elipsis", text.elipsis, EET_T_DOUBLE); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "box.layout", box.layout, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "box.alt_layout", box.alt_layout, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "box.align.x", box.align.x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "box.align.y", box.align.y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "box.padding.x", box.padding.x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "box.padding.y", box.padding.y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "box.min.h", box.min.h, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "box.min.v", box.min.v, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "table.homogeneous", table.homogeneous, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "table.align.x", table.align.x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "table.align.y", table.align.y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "table.padding.x", table.padding.x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "table.padding.y", table.padding.y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.id_persp", common.map.id_persp, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.id_light", common.map.id_light, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.rot.id_center", common.map.rot.id_center, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.rot.x", common.map.rot.x, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.rot.y", common.map.rot.y, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.rot.z", common.map.rot.z, EDJE_T_FLOAT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.on", common.map.on, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.smooth", common.map.smooth, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.alpha", common.map.alpha, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.persp_on", common.map.persp_on, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "map.backcull", common.map.backcull, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "persp.zplane", common.persp.zplane, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, Old_Edje_Part_Description, "persp.focal", common.persp.focal, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description, Old_Edje_Part_Description, "external_params", external_params, _edje_edd_edje_external_param); + EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, common); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.color3.r", text.color3.r, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.color3.g", text.color3.g, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.color3.b", text.color3.b, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.color3.a", text.color3.a, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.text", text.text, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.text_class", text.text_class, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.style", text.style, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.font", text.font, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.repch", text.repch, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.size", text.size, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.fit_x", text.fit_x, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.fit_y", text.fit_y, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.min_x", text.min_x, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.min_y", text.min_y, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.max_x", text.max_x, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.max_y", text.max_y, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.align.x", text.align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.align.y", text.align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.id_source", text.id_source, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.id_text_source", text.id_text_source, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_text, Edje_Part_Description_Text, "text.elipsis", text.elipsis, EET_T_DOUBLE); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Box); + _edje_edd_edje_part_description_box = + eet_data_descriptor_file_new(&eddc); + EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, common); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, "box.layout", box.layout, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, "box.alt_layout", box.alt_layout, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, "box.align.x", box.align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, "box.align.y", box.align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, "box.padding.x", box.padding.x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, "box.padding.y", box.padding.y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, "box.min.h", box.min.h, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_box, Edje_Part_Description_Box, "box.min.v", box.min.v, EET_T_UCHAR); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_Table); + _edje_edd_edje_part_description_table = + eet_data_descriptor_file_new(&eddc); + EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, common); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.homogeneous", table.homogeneous, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.align.x", table.align.x, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.align.y", table.align.y, EDJE_T_FLOAT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.padding.x", table.padding.x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description_table, Edje_Part_Description_Table, "table.padding.y", table.padding.y, EET_T_INT); + + EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part_Description_External); + _edje_edd_edje_part_description_external = + eet_data_descriptor_file_new(&eddc); + EDJE_DATA_DESCRIPTOR_DESCRIPTION_COMMON(_edje_edd_edje_part_description_external, Edje_Part_Description_External, common); + EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description_external, Edje_Part_Description_External, "external_params", external_params, _edje_edd_edje_external_param); + + EDJE_DEFINE_POINTER_TYPE(Part_Description_Common, part_description_common); + EDJE_DEFINE_POINTER_TYPE(Part_Description_Image, part_description_image); + EDJE_DEFINE_POINTER_TYPE(Part_Description_Text, part_description_text); + EDJE_DEFINE_POINTER_TYPE(Part_Description_Box, part_description_box); + EDJE_DEFINE_POINTER_TYPE(Part_Description_Table, part_description_table); + EDJE_DEFINE_POINTER_TYPE(Part_Description_External, part_description_external); + + eddc.version = EET_DATA_DESCRIPTOR_CLASS_VERSION; + eddc.func.type_get = _edje_description_variant_type_get; + eddc.func.type_set = _edje_description_variant_type_set; + _edje_edd_edje_part_description_variant = eet_data_descriptor_file_new(&eddc); + + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "rectangle", _edje_edd_edje_part_description_common); + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "swallow", _edje_edd_edje_part_description_common); + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "group", _edje_edd_edje_part_description_common); + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "image", _edje_edd_edje_part_description_image); + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "text", _edje_edd_edje_part_description_text); + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "textblock", _edje_edd_edje_part_description_text); + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "box", _edje_edd_edje_part_description_box); + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "table", _edje_edd_edje_part_description_table); + EET_DATA_DESCRIPTOR_ADD_MAPPING(_edje_edd_edje_part_description_variant, "external", _edje_edd_edje_part_description_external); + +#define EDJE_ADD_ARRAY_MAPPING(Variant, Type, Minus) \ + { \ + Edje_Part_Description_List tmp; \ + \ + eet_data_descriptor_element_add(Variant, Type, \ + EET_T_UNKNOW, EET_G_VAR_ARRAY, \ + 0, (char*)(&tmp.desc_count) - (char*)(&tmp), \ + NULL, \ + _edje_edd_edje_part_description_##Minus##_pointer); \ + } + + _edje_edd_edje_part_description_variant_list = eet_data_descriptor_file_new(&eddc); + + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "rectangle", common); + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "swallow", common); + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "group", common); + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "image", image); + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "text", text); + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "textblock", text); + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "box", box); + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "table", table); + EDJE_ADD_ARRAY_MAPPING(_edje_edd_edje_part_description_variant_list, "external", external); EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Pack_Element); _edje_edd_edje_pack_element = @@ -380,64 +584,66 @@ _edje_edd_init(void) EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "colspan", colspan, EET_T_USHORT); EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_pack_element, Edje_Pack_Element, "rowspan", rowspan, EET_T_USHORT); - eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part", sizeof (Old_Edje_Part)); + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part", sizeof (Edje_Part)); _edje_edd_edje_part = eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "name", name, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "id", id, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "type", type, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "effect", effect, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "mouse_events", mouse_events, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "repeat_events", repeat_events, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "ignore_flags", ignore_flags, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "scale", scale, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "pointer_mode", pointer_mode, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "precise_is_inside", precise_is_inside, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "clip_to_id", clip_to_id, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "use_alternate_font_metrics", use_alternate_font_metrics, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_part, Old_Edje_Part, "default_desc", default_desc, _edje_edd_edje_part_description); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part, Old_Edje_Part, "other_desc", other_desc, _edje_edd_edje_part_description); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "dragable.x", dragable.x, EET_T_CHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "dragable.step_x", dragable.step_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "dragable.count_x", dragable.count_x, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "dragable.y", dragable.y, EET_T_CHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "dragable.step_y", dragable.step_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "dragable.count_y", dragable.count_y, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "dragable.counfine_id", dragable.confine_id, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "dragable.events_id", dragable.event_id, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "entry_mode", entry_mode, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "select_mode", select_mode, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "multiline", multiline, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "source", source, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "source2", source2, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "source3", source3, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "source4", source4, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "source5", source5, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "source6", source6, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part, Old_Edje_Part, "items", items, _edje_edd_edje_pack_element); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "api.name", api.name, EET_T_STRING); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Old_Edje_Part, "api.description", api.description, EET_T_STRING); - - eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part_Collection", sizeof (Old_Edje_Part_Collection)); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "name", name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_VARIANT(_edje_edd_edje_part, Edje_Part, "default_desc", default_desc, type, _edje_edd_edje_part_description_variant); + EET_DATA_DESCRIPTOR_ADD_VARIANT(_edje_edd_edje_part, Edje_Part, "other", other, type, _edje_edd_edje_part_description_variant_list); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source", source, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source2", source2, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source3", source3, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source4", source4, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source5", source5, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "source6", source6, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "id", id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "clip_to_id", clip_to_id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.x", dragable.x, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.step_x", dragable.step_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.count_x", dragable.count_x, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.y", dragable.y, EET_T_CHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.step_y", dragable.step_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.count_y", dragable.count_y, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.counfine_id", dragable.confine_id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "dragable.events_id", dragable.event_id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part, Edje_Part, "items", items, _edje_edd_edje_pack_element); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "type", type, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "effect", effect, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "mouse_events", mouse_events, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "repeat_events", repeat_events, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "ignore_flags", ignore_flags, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "scale", scale, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "precise_is_inside", precise_is_inside, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "use_alternate_font_metrics", use_alternate_font_metrics, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "pointer_mode", pointer_mode, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "entry_mode", entry_mode, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "select_mode", select_mode, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "multiline", multiline, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.name", api.name, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part, Edje_Part, "api.description", api.description, EET_T_STRING); + + eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Part_Collection", sizeof (Edje_Part_Collection)); _edje_edd_edje_part_collection = eet_data_descriptor_file_new(&eddc); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "programs", programs, _edje_edd_edje_program); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "parts", parts, _edje_edd_edje_part); - EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "data", data, _edje_edd_edje_data); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "prop.min.w", prop.min.w, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "prop.min.h", prop.min.h, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "id", id, EET_T_INT); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR); - EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Old_Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); - - { - Old_Edje_Part_Collection epc; - - eet_data_descriptor_element_add(_edje_edd_edje_part_collection, - "alias", EET_T_STRING, EET_G_HASH, - (char *)(&(epc.alias)) - (char *)(&(epc)), - 0, /* 0, */NULL, NULL); - } + + EDJE_DEFINE_POINTER_TYPE(Program, program); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "programs.fnmatch", programs.fnmatch, _edje_edd_edje_program_pointer); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "programs.strcmp", programs.strcmp, _edje_edd_edje_program_pointer); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "programs.strncmp", programs.strncmp, _edje_edd_edje_program_pointer); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "programs.strrncmp", programs.strrncmp, _edje_edd_edje_program_pointer); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "programs.nocmp", programs.nocmp, _edje_edd_edje_program_pointer); + + EDJE_DEFINE_POINTER_TYPE(Part, part); + EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(_edje_edd_edje_part_collection, Edje_Part_Collection, "parts", parts, _edje_edd_edje_part_pointer); + + EET_DATA_DESCRIPTOR_ADD_HASH_STRING(_edje_edd_edje_part_collection, Edje_Part_Collection, "data", data); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "id", id, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_HASH_STRING(_edje_edd_edje_part_collection, Edje_Part_Collection, "alias", alias); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.min.w", prop.min.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.min.h", prop.min.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.w", prop.max.w, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "prop.max.h", prop.max.h, EET_T_INT); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "part", part, EET_T_STRING); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "script_only", script_only, EET_T_UCHAR); + EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_collection, Edje_Part_Collection, "lua_script_only", lua_script_only, EET_T_UCHAR); } diff --git a/src/lib/edje_edit.c b/src/lib/edje_edit.c index 5aad713..2a10f41 100644 --- a/src/lib/edje_edit.c +++ b/src/lib/edje_edit.c @@ -532,8 +532,8 @@ _edje_part_id_set(Edje *ed, Edje_Real_Part *rp, int new_id) _edje_part_description_id_set(p->type, p->default_desc, old_id, new_id); /* ...and in all other descriptions */ - for (k = 0; k < p->other_count; ++k) - _edje_part_description_id_set(p->type, p->other_desc[k], old_id, new_id); + for (k = 0; k < p->other.desc_count; ++k) + _edje_part_description_id_set(p->type, p->other.desc[k], old_id, new_id); } /*...and also in programs targets */ @@ -640,8 +640,8 @@ _edje_parts_id_switch(Edje *ed, Edje_Real_Part *rp1, Edje_Real_Part *rp2) _edje_part_description_id_switch(p->type, p->default_desc, id1, id2); // ...and in all other descriptions - for (j = 0; j < p->other_count; ++j) - _edje_part_description_id_switch(p->type, p->other_desc[j], id1, id2); + for (j = 0; j < p->other.desc_count; ++j) + _edje_part_description_id_switch(p->type, p->other.desc[j], id1, id2); } //...and also in programs targets @@ -1871,7 +1871,8 @@ _edje_edit_real_part_add(Evas_Object *obj, const char *name, Edje_Part_Type type ep->source = eina_stringshare_add(source); ep->default_desc = NULL; - ep->other_desc = NULL; + ep->other.desc = NULL; + ep->other.desc_count = 0; /* Init Edje_Real_Part */ rp->edje = ed; @@ -2052,10 +2053,10 @@ edje_edit_part_del(Evas_Object *obj, const char* part) ep->default_desc = NULL; } - for (k = 0; k < ep->other_count; ++k) - _edje_collection_free_part_description_free(ep->type, ep->other_desc[k], ce, 0); + for (k = 0; k < ep->other.desc_count; ++k) + _edje_collection_free_part_description_free(ep->type, ep->other.desc[k], ce, 0); - free(ep->other_desc); + free(ep->other.desc); eina_mempool_free(ce->mp.part, ep); /* Free Edje_Real_Part */ @@ -2562,12 +2563,12 @@ edje_edit_part_states_list_get(Evas_Object *obj, const char *part) //printf("NEW STATE def: %s\n", state->state.name); //append other states - for (i = 0; i < rp->part->other_count; ++i) + for (i = 0; i < rp->part->other.desc_count; ++i) { snprintf(state_name, sizeof(state_name), "%s %.2f", - rp->part->other_desc[i]->state.name, - rp->part->other_desc[i]->state.value); + rp->part->other.desc[i]->state.name, + rp->part->other.desc[i]->state.value); states = eina_list_append(states, eina_stringshare_add(state_name)); //printf("NEW STATE: %s\n", state_name); } @@ -2640,13 +2641,13 @@ edje_edit_state_del(Evas_Object *obj, const char *part, const char *state, doubl ce = eina_hash_find(ed->file->collection, ed->group); - for (i = 0; i < rp->part->other_count; ++i) - if (pd == rp->part->other_desc[i]) + for (i = 0; i < rp->part->other.desc_count; ++i) + if (pd == rp->part->other.desc[i]) { - memmove(rp->part->other_desc + i, - rp->part->other_desc + i + 1, - sizeof (Edje_Part_Description_Common*) * (rp->part->other_count - i - 1)); - rp->part->other_count--; + memmove(rp->part->other.desc + i, + rp->part->other.desc + i + 1, + sizeof (Edje_Part_Description_Common*) * (rp->part->other.desc_count - i - 1)); + rp->part->other.desc_count--; break; } @@ -2719,15 +2720,15 @@ edje_edit_state_add(Evas_Object *obj, const char *part, const char *name, double { Edje_Part_Description_Common **tmp; - tmp = realloc(rp->part->other_desc, - sizeof (Edje_Part_Description_Common *) * (rp->part->other_count + 1)); + tmp = realloc(rp->part->other.desc, + sizeof (Edje_Part_Description_Common *) * (rp->part->other.desc_count + 1)); if (!tmp) { free(pd); return; } - rp->part->other_desc = tmp; - rp->part->other_desc[rp->part->other_count++] = pd; + rp->part->other.desc = tmp; + rp->part->other.desc[rp->part->other.desc_count++] = pd; } memset(pd, 0, sizeof (pd)); @@ -2910,15 +2911,15 @@ edje_edit_state_copy(Evas_Object *obj, const char *part, const char *from, doubl if (!pdto) return EINA_FALSE; /* No need to check for default desc, at this point it must exist */ - tmp = realloc(rp->part->other_desc, - sizeof (Edje_Part_Description_Common *) * (rp->part->other_count + 1)); + tmp = realloc(rp->part->other.desc, + sizeof (Edje_Part_Description_Common *) * (rp->part->other.desc_count + 1)); if (!tmp) { free(pdto); return EINA_FALSE; } - rp->part->other_desc = tmp; - rp->part->other_desc[rp->part->other_count++] = pdto; + rp->part->other.desc = tmp; + rp->part->other.desc[rp->part->other.desc_count++] = pdto; } #define PD_STRING_COPY(To, From, _x) \ @@ -6028,274 +6029,31 @@ source_edd(void) } ///////////////////////////////////////// -/* FIXME: error checks... not that they will help much at all though */ -static void -_edje_edit_convert_to_old(Edje_File *ef) -{ - Eina_Iterator *itr; - Eina_Hash_Tuple *tpl; - unsigned int i; - - itr = eina_hash_iterator_tuple_new(ef->data); - EINA_ITERATOR_FOREACH(itr, tpl) - { - Edje_Data *ed; - ed = malloc(sizeof(*ed)); - ed->key = tpl->key; - ed->value = tpl->data; - ef->oef->data = eina_list_append(ef->oef->data, ed); - } - eina_iterator_free(itr); - - itr = eina_hash_iterator_tuple_new(ef->fonts); - EINA_ITERATOR_FOREACH(itr, tpl) - { - if (!ef->oef->font_dir) - ef->oef->font_dir = calloc(1, sizeof(Old_Edje_Font_Directory)); - ef->oef->font_dir->entries = - eina_list_append(ef->oef->font_dir->entries, - tpl->data); - } - eina_iterator_free(itr); - - if (ef->image_dir->entries || ef->image_dir->sets) - { - if (!ef->oef->image_dir) - ef->oef->image_dir = calloc(1, sizeof(Old_Edje_Image_Directory)); - for (i = 0; i < ef->image_dir->entries_count; i++) - ef->oef->image_dir->entries = eina_list_append( - ef->oef->image_dir->entries, - &ef->image_dir->entries[i]); - for (i = 0; i < ef->image_dir->sets_count; i++) - ef->oef->image_dir->sets = eina_list_append( - ef->oef->image_dir->sets, - &ef->image_dir->sets[i]); - } - - if (ef->external_dir) - { - ef->oef->external_dir = calloc(1, sizeof(Old_Edje_External_Directory)); - for (i = 0; i < ef->external_dir->entries_count; i++) - ef->oef->external_dir->entries = eina_list_append( - ef->oef->external_dir->entries, - &ef->external_dir->entries[i]); - } - - eina_list_free(ef->oef->collection_dir->entries); - ef->oef->collection_dir->entries = NULL; - itr = eina_hash_iterator_tuple_new(ef->collection); - EINA_ITERATOR_FOREACH(itr, tpl) - ef->oef->collection_dir->entries = eina_list_append( - ef->oef->collection_dir->entries, - tpl->data); - eina_iterator_free(itr); - - ef->oef->compiler = ef->compiler; -} - -static void -_edje_edit_clean_old(Edje_File *ef) -{ - Edje_Data *ed; - - EINA_LIST_FREE(ef->oef->data, ed) - free(ed); - if (ef->oef->font_dir) - { - eina_list_free(ef->oef->font_dir->entries); - ef->oef->font_dir = NULL; - } - if (ef->oef->image_dir) - { - eina_list_free(ef->oef->image_dir->entries); - eina_list_free(ef->oef->image_dir->sets); - ef->oef->image_dir->entries = ef->oef->image_dir->sets = NULL; - } - if (ef->oef->external_dir) - { - eina_list_free(ef->oef->external_dir->entries); - free(ef->oef->external_dir); - ef->oef->external_dir = NULL; - } -} - static Eina_Bool _edje_edit_edje_file_save(Eet_File *eetf, Edje_File *ef) { /* Write Edje_File structure */ INF("** Writing Edje_File* ed->file"); - _edje_edit_convert_to_old(ef); - if (eet_data_write(eetf, _edje_edd_edje_file, "edje_file", ef->oef, 1) <= 0) + if (eet_data_write(eetf, _edje_edd_edje_file, "edje/file", ef, 1) <= 0) { ERR("Error. unable to write \"edje_file\" entry to \"%s\"", ef->path); return EINA_FALSE; } - _edje_edit_clean_old(ef); return EINA_TRUE; } -static Old_Edje_Part_Description * -_edje_edit_description_save(int type, Edje_Part_Description_Common *desc) -{ - Old_Edje_Part_Description *result; - - result = calloc(1, sizeof (Old_Edje_Part_Description)); - if (!result) return NULL; - - result->common = *desc; - - switch (type) - { - case EDJE_PART_TYPE_IMAGE: - { - Edje_Part_Description_Image *img = (Edje_Part_Description_Image*) desc; - unsigned int i; - - for (i = 0; i < img->image.tweens_count; ++i) - result->image.tween_list = eina_list_append(result->image.tween_list, - img->image.tweens[i]); - - result->image.id = img->image.id; - result->image.scale_hint = img->image.scale_hint; - result->image.set = img->image.set; - result->image.border = img->image.border; - result->image.fill = img->image.fill; - - break; - } - -#define COPY_OLD(Short, Type, Name) \ - case EDJE_PART_TYPE_##Short: \ - { \ - Edje_Part_Description_##Type *Name = (Edje_Part_Description_##Type *) desc; \ - \ - result->Name = Name->Name; \ - break; \ - } - - COPY_OLD(TEXT, Text, text); - COPY_OLD(TEXTBLOCK, Text, text); - COPY_OLD(BOX, Box, box); - COPY_OLD(TABLE, Table, table); - COPY_OLD(EXTERNAL, External, external_params); - } - - return result; -} - -static Old_Edje_Part * -_edje_edit_part_save(Edje_Part *ep) -{ - Old_Edje_Part *oep; - unsigned int i; - - oep = calloc(1, sizeof(*oep)); - if (!oep) return NULL; - - oep->name = ep->name; - oep->default_desc = _edje_edit_description_save(ep->type, ep->default_desc); - - for (i = 0; i < ep->other_count; ++i) - oep->other_desc = eina_list_append(oep->other_desc, _edje_edit_description_save(ep->type, ep->other_desc[i])); - - oep->source = ep->source; - oep->source2 = ep->source2; - oep->source3 = ep->source3; - oep->source4 = ep->source4; - oep->source5 = ep->source5; - oep->source6 = ep->source6; - oep->id = ep->id; - oep->clip_to_id = ep->clip_to_id; - oep->dragable = ep->dragable; - - for (i = 0; i < ep->items_count; ++i) - oep->items = eina_list_append(oep->items, ep->items[i]); - - oep->type = ep->type; - oep->effect = ep->effect; - oep->mouse_events = ep->mouse_events; - oep->repeat_events = ep->repeat_events; - oep->ignore_flags = ep->ignore_flags; - oep->scale = ep->scale; - oep->precise_is_inside = ep->precise_is_inside; - oep->use_alternate_font_metrics = ep->use_alternate_font_metrics; - oep->pointer_mode = ep->pointer_mode; - oep->entry_mode = ep->entry_mode; - oep->select_mode = ep->select_mode; - oep->multiline = ep->multiline; - oep->api = ep->api; - - return oep; -} - static Eina_Bool -_edje_edit_collection_save(Edje *ed, Eet_File *eetf, Edje_Part_Collection *epc) +_edje_edit_collection_save(Eet_File *eetf, Edje_Part_Collection *epc) { - Old_Edje_Part_Description *oepd; - Old_Edje_Part_Collection oepc; - Old_Edje_Part *oep; - Eina_Iterator *it; - Eina_Hash_Tuple *tu; - Edje_Data *di; char buf[256]; - unsigned int i; - int j; - Eina_Bool err = EINA_TRUE; - memset(&oepc, 0, sizeof(oepc)); + snprintf(buf, sizeof(buf), "edje/collections/%i", epc->id); - snprintf(buf, sizeof(buf), "collections/%i", epc->id); - - for (j = 0; j < ed->table_programs_size; ++j) - oepc.programs = eina_list_append(oepc.programs, ed->table_programs[j]); - - it = eina_hash_iterator_tuple_new(epc->data); - EINA_ITERATOR_FOREACH(it, tu) - { - di = malloc(sizeof(*di)); - if (!di) return EINA_FALSE; - - di->key = tu->key; - di->value = tu->data; - - oepc.data = eina_list_append(oepc.data, di); - } - eina_iterator_free(it); - - for (i = 0; i < epc->parts_count; ++i) - oepc.parts = eina_list_append(oepc.parts, _edje_edit_part_save(epc->parts[i])); - - oepc.id = epc->id; - oepc.alias = epc->alias; - oepc.prop.min = epc->prop.min; - oepc.prop.max = epc->prop.max; - oepc.script = epc->script; - oepc.script_only = epc->script_only; - oepc.lua_script_only = epc->lua_script_only; - oepc.checked = epc->checked; - - if (eet_data_write(eetf, _edje_edd_edje_part_collection, buf, &oepc, 1) <= 0) - { - ERR("Error. unable to write \"%s\" part entry", buf); - err = EINA_FALSE; - } - - // FIXME - oepc.programs = eina_list_free(oepc.programs); - EINA_LIST_FREE(oepc.data, di) - free(di); - EINA_LIST_FREE(oepc.parts, oep) - { - EINA_LIST_FREE(oep->other_desc, oepd) - { - eina_list_free(oepd->image.tween_list); - free(oepd); - } - eina_list_free(oep->items); - free(oep); - } + if (eet_data_write(eetf, _edje_edd_edje_part_collection, buf, epc, 1) > 0) + return EINA_TRUE; - return err; + ERR("Error. unable to write \"%s\" part entry", buf); + return EINA_FALSE; } static Eina_Bool @@ -6411,7 +6169,7 @@ _edje_edit_internal_save(Evas_Object *obj, int current_only) { INF("** Writing Edje_Part_Collection* ed->collection " "[id: %d]", ed->collection->id); - if (!_edje_edit_collection_save(ed, eetf, ed->collection)) + if (!_edje_edit_collection_save(eetf, ed->collection)) { eet_close(eetf); return EINA_FALSE; @@ -6434,7 +6192,7 @@ _edje_edit_internal_save(Evas_Object *obj, int current_only) { INF("** Writing hash Edje_Part_Collection* ed->collection " "[id: %d]", ce->id); - if(!_edje_edit_collection_save(ed, eetf, ce->ref)) + if(!_edje_edit_collection_save(eetf, ce->ref)) { eet_close(eetf); return EINA_FALSE; @@ -6447,7 +6205,7 @@ _edje_edit_internal_save(Evas_Object *obj, int current_only) { INF("** Writing cache Edje_Part_Collection* ed->collection " "[id: %d]", edc->id); - if(!_edje_edit_collection_save(ed, eetf, edc)) + if(!_edje_edit_collection_save(eetf, edc)) { eet_close(eetf); return EINA_FALSE; diff --git a/src/lib/edje_load.c b/src/lib/edje_load.c index 41908cb..59ec24e 100644 --- a/src/lib/edje_load.c +++ b/src/lib/edje_load.c @@ -389,11 +389,11 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g if ((ep->default_desc) && (ep->default_desc->color_class)) _edje_color_class_member_add(ed, ep->default_desc->color_class); - for (k = 0; k < ep->other_count; k++) + for (k = 0; k < ep->other.desc_count; k++) { Edje_Part_Description_Common *desc; - desc = ep->other_desc[k]; + desc = ep->other.desc[k]; if (desc->color_class) _edje_color_class_member_add(ed, desc->color_class); @@ -1084,13 +1084,9 @@ void _edje_file_free(Edje_File *edf) { Edje_Color_Class *ecc; - const Edje_File *prev; - - prev = _edje_file_get(); - _edje_file_set(edf); #define HASH_FREE(Hash) \ - eina_hash_free(Hash); \ + if (Hash) eina_hash_free(Hash); \ Hash = NULL; /* Clean cache before cleaning memory pool */ @@ -1100,23 +1096,6 @@ _edje_file_free(Edje_File *edf) HASH_FREE(edf->collection); HASH_FREE(edf->data); - if (edf->oef) - { - if (edf->oef->font_dir) - { - eina_list_free(edf->oef->font_dir->entries); - - free(edf->oef->font_dir); - } - - if (edf->oef->collection_dir) - { - eina_list_free(edf->oef->collection_dir->entries); - - free(edf->oef->collection_dir); - } - } - if (edf->image_dir) { unsigned int i; @@ -1154,8 +1133,6 @@ _edje_file_free(Edje_File *edf) _edje_textblock_style_cleanup(edf); if (edf->ef) eet_close(edf->ef); free(edf); - - _edje_file_set(prev); } static void @@ -1212,10 +1189,10 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec _edje_collection_free_part_description_clean(ep->type, ep->default_desc, edf->free_strings); ep->default_desc = NULL; } - for (j = 0; j < ep->other_count; ++j) - _edje_collection_free_part_description_clean(ep->type, ep->other_desc[j], edf->free_strings); + for (j = 0; j < ep->other.desc_count; ++j) + _edje_collection_free_part_description_clean(ep->type, ep->other.desc[j], edf->free_strings); - free(ep->other_desc); + free(ep->other.desc); free(ep->items); } if (ec->data) eina_hash_free(ec->data); @@ -1235,6 +1212,7 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec #endif /* Destroy all part and description. */ +#if 0 /* FIXME: USE mempool when possible. */ eina_mempool_del(ce->mp.RECTANGLE); eina_mempool_del(ce->mp.TEXT); eina_mempool_del(ce->mp.IMAGE); @@ -1246,6 +1224,7 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec eina_mempool_del(ce->mp.EXTERNAL); eina_mempool_del(ce->mp.part); memset(&ce->mp, 0, sizeof (ce->mp)); +#endif free(ec); ce->ref = NULL; diff --git a/src/lib/edje_private.h b/src/lib/edje_private.h index b95326b..bee43f1 100644 --- a/src/lib/edje_private.h +++ b/src/lib/edje_private.h @@ -135,7 +135,7 @@ struct _Edje_Smart_Api /* increment this when the EET data descriptors have changed and old * EETs cannot be loaded/used correctly anymore. */ -#define EDJE_FILE_VERSION 2 +#define EDJE_FILE_VERSION 3 /* FIXME: * @@ -144,7 +144,6 @@ struct _Edje_Smart_Api * ? programs can do multiple actions from one signal * ? add containering (hbox, vbox, table, wrapping multi-line hbox & vbox) * ? text entry widget (single line only) - * ? reduce linked list walking and list_nth calls * * ? recursions, unsafe callbacks outside Edje etc. with freeze, ref/unref and block/unblock and break_programs needs to be redesigned & fixed * ? all unsafe calls that may result in callbacks must be marked and dealt with @@ -223,7 +222,6 @@ typedef struct _Edje_Image_Directory_Set_Entry Edje_Image_Directory_Set_En typedef struct _Edje_Program Edje_Program; typedef struct _Edje_Program_Target Edje_Program_Target; typedef struct _Edje_Program_After Edje_Program_After; -typedef struct _Edje_Part_Collection_Directory Edje_Part_Collection_Directory; typedef struct _Edje_Part_Collection_Directory_Entry Edje_Part_Collection_Directory_Entry; typedef struct _Edje_Pack_Element Edje_Pack_Element; typedef struct _Edje_Part_Collection Edje_Part_Collection; @@ -349,8 +347,6 @@ struct _Edje_File Eet_File *ef; - Old_Edje_File *oef; - unsigned char free_strings : 1; unsigned char dangling : 1; unsigned char warning : 1; @@ -499,13 +495,6 @@ struct _Edje_Program_After /* the action to run after another action */ /*----------*/ -struct _Edje_Part_Collection_Directory -{ - Eina_List *entries; /* a list of Edje_Part_Collection_Directory_Entry */ - - int references; -}; - struct _Edje_Part_Collection_Directory_Entry { const char *entry; /* the nominal name of the part collection */ @@ -640,12 +629,20 @@ struct _Edje_Part_Api const char *description; }; +typedef struct _Edje_Part_Description_List Edje_Part_Description_List; +struct _Edje_Part_Description_List +{ + Edje_Part_Description_Common **desc; + unsigned int desc_count; +}; + struct _Edje_Part { const char *name; /* the name if any of the part */ Edje_Part_Description_Common *default_desc; /* the part descriptor for default */ - Edje_Part_Description_Common **other_desc; /* other possible descriptors */ - unsigned int other_count; + + Edje_Part_Description_List other; /* other possible descriptors */ + const char *source, *source2, *source3, *source4, *source5, *source6; int id; /* its id number */ int clip_to_id; /* the part id to clip this one to */ @@ -1757,5 +1754,4 @@ void _edje_lua2_script_func_signal(Edje *ed, const char *sig, const char *src); #endif -#include "edje_convert.h" #endif diff --git a/src/lib/edje_text.c b/src/lib/edje_text.c index 3ef0312..f45436c 100644 --- a/src/lib/edje_text.c +++ b/src/lib/edje_text.c @@ -48,9 +48,9 @@ _edje_text_part_on_add(Edje *ed, Edje_Real_Part *ep) _edje_text_class_member_add(ed, desc->text.text_class); /* If any other classes exist add them */ - for (i = 0; i < pt->other_count; ++i) + for (i = 0; i < pt->other.desc_count; ++i) { - desc = (Edje_Part_Description_Text *) pt->other_desc[i]; + desc = (Edje_Part_Description_Text *) pt->other.desc[i]; if ((desc) && (desc->text.text_class)) _edje_text_class_member_add(ed, desc->text.text_class); } @@ -70,9 +70,9 @@ _edje_text_part_on_del(Edje *ed, Edje_Part *pt) if ((pt->default_desc) && (desc->text.text_class)) _edje_text_class_member_del(ed, desc->text.text_class); - for (i = 0; i < pt->other_count; ++i) + for (i = 0; i < pt->other.desc_count; ++i) { - desc = (Edje_Part_Description_Text *) pt->other_desc[i]; + desc = (Edje_Part_Description_Text *) pt->other.desc[i]; if (desc->text.text_class) _edje_text_class_member_del(ed, desc->text.text_class); } diff --git a/src/lib/edje_textblock_styles.c b/src/lib/edje_textblock_styles.c index 44b5767..d2013af 100644 --- a/src/lib/edje_textblock_styles.c +++ b/src/lib/edje_textblock_styles.c @@ -115,7 +115,7 @@ _edje_format_reparse(Edje_File *edf, const char *str, Edje_Style_Tag **tag_ret) { if (!tmp) tmp = eina_strbuf_new(); - eina_strbuf_append(tmp, "fonts/"); + eina_strbuf_append(tmp, "edje/fonts/"); eina_strbuf_append(tmp, val); (*tag_ret)->font = eina_stringshare_add(eina_strbuf_string_get(tmp)); eina_strbuf_reset(tmp); diff --git a/src/lib/edje_util.c b/src/lib/edje_util.c index 2876c78..058286d 100644 --- a/src/lib/edje_util.c +++ b/src/lib/edje_util.c @@ -4465,9 +4465,9 @@ _edje_color_class_on_del(Edje *ed, Edje_Part *ep) if ((ep->default_desc) && (ep->default_desc->color_class)) _edje_color_class_member_del(ed, ep->default_desc->color_class); - for (i = 0; i < ep->other_count; ++i) - if (ep->other_desc[i]->color_class) - _edje_color_class_member_del(ed, ep->other_desc[i]->color_class); + for (i = 0; i < ep->other.desc_count; ++i) + if (ep->other.desc[i]->color_class) + _edje_color_class_member_del(ed, ep->other.desc[i]->color_class); } Edje_Text_Class *