forked from enlightenment/efl
* edje: move structure from Eina_List to array now that Eet support
them. SVN revision: 49936
This commit is contained in:
parent
11f53993b0
commit
4e30cb2411
|
@ -846,7 +846,7 @@ st_externals_external(void)
|
||||||
check_arg_count(1);
|
check_arg_count(1);
|
||||||
|
|
||||||
if (!edje_file->external_dir)
|
if (!edje_file->external_dir)
|
||||||
edje_file->external_dir = mem_alloc(SZ(Edje_External_Directory));
|
edje_file->external_dir = mem_alloc(SZ(Old_Edje_External_Directory));
|
||||||
|
|
||||||
ex = mem_alloc(SZ(External));
|
ex = mem_alloc(SZ(External));
|
||||||
ex->name = parse_str(0);
|
ex->name = parse_str(0);
|
||||||
|
@ -934,7 +934,7 @@ st_images_image(void)
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
if (!edje_file->image_dir)
|
if (!edje_file->image_dir)
|
||||||
edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
|
edje_file->image_dir = mem_alloc(SZ(Old_Edje_Image_Directory));
|
||||||
img = mem_alloc(SZ(Edje_Image_Directory_Entry));
|
img = mem_alloc(SZ(Edje_Image_Directory_Entry));
|
||||||
img->entry = parse_str(0);
|
img->entry = parse_str(0);
|
||||||
{
|
{
|
||||||
|
@ -945,7 +945,7 @@ st_images_image(void)
|
||||||
{
|
{
|
||||||
if (!strcmp(limg->entry, img->entry))
|
if (!strcmp(limg->entry, img->entry))
|
||||||
{
|
{
|
||||||
free(img->entry);
|
free((char*) img->entry);
|
||||||
free(img);
|
free(img);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1027,7 +1027,7 @@ ob_images_set(void)
|
||||||
Edje_Image_Directory_Set *set;
|
Edje_Image_Directory_Set *set;
|
||||||
|
|
||||||
if (!edje_file->image_dir)
|
if (!edje_file->image_dir)
|
||||||
edje_file->image_dir = mem_alloc(SZ(Edje_Image_Directory));
|
edje_file->image_dir = mem_alloc(SZ(Old_Edje_Image_Directory));
|
||||||
set = mem_alloc(SZ(Edje_Image_Directory_Set));
|
set = mem_alloc(SZ(Edje_Image_Directory_Set));
|
||||||
set->id = eina_list_count(edje_file->image_dir->sets);
|
set->id = eina_list_count(edje_file->image_dir->sets);
|
||||||
edje_file->image_dir->sets = eina_list_append(edje_file->image_dir->sets, set);
|
edje_file->image_dir->sets = eina_list_append(edje_file->image_dir->sets, set);
|
||||||
|
@ -1163,7 +1163,7 @@ st_fonts_font(void)
|
||||||
check_arg_count(2);
|
check_arg_count(2);
|
||||||
|
|
||||||
if (!edje_file->font_dir)
|
if (!edje_file->font_dir)
|
||||||
edje_file->font_dir = mem_alloc(SZ(Edje_Font_Directory));
|
edje_file->font_dir = mem_alloc(SZ(Old_Edje_Font_Directory));
|
||||||
|
|
||||||
fn = mem_alloc(SZ(Font));
|
fn = mem_alloc(SZ(Font));
|
||||||
fn->file = parse_str(0);
|
fn->file = parse_str(0);
|
||||||
|
|
|
@ -27,7 +27,7 @@ char *progname = NULL;
|
||||||
char *file_in = NULL;
|
char *file_in = NULL;
|
||||||
char *file_out = NULL;
|
char *file_out = NULL;
|
||||||
|
|
||||||
Edje_File *edje_file = NULL;
|
Old_Edje_File *edje_file = NULL;
|
||||||
SrcFile_List *srcfiles = NULL;
|
SrcFile_List *srcfiles = NULL;
|
||||||
Font_List *fontlist = NULL;
|
Font_List *fontlist = NULL;
|
||||||
|
|
||||||
|
|
|
@ -1549,7 +1549,7 @@ _edje_image_find(Evas_Object *obj, Edje *ed, Edje_Real_Part_Set **eps, Edje_Part
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!set)
|
if (!set)
|
||||||
set = eina_list_nth(ed->file->image_dir->sets, id);
|
set = ed->file->image_dir->sets + id;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(set->entries, l, entry)
|
EINA_LIST_FOREACH(set->entries, l, entry)
|
||||||
{
|
{
|
||||||
|
@ -1607,7 +1607,7 @@ _edje_image_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3, Edj
|
||||||
Edje_Image_Directory_Entry *ie;
|
Edje_Image_Directory_Entry *ie;
|
||||||
|
|
||||||
if (!ed->file->image_dir) ie = NULL;
|
if (!ed->file->image_dir) ie = NULL;
|
||||||
else ie = eina_list_nth(ed->file->image_dir->entries, (-image_id) - 1);
|
else ie = ed->file->image_dir->entries + (-image_id) - 1;
|
||||||
if ((ie) &&
|
if ((ie) &&
|
||||||
(ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) &&
|
(ie->source_type == EDJE_IMAGE_SOURCE_TYPE_EXTERNAL) &&
|
||||||
(ie->entry))
|
(ie->entry))
|
||||||
|
|
|
@ -59,6 +59,93 @@ _edje_collection_string_free(void *data)
|
||||||
free(ce);
|
free(ce);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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 = malloc(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 *
|
||||||
_edje_file_convert(Eet_File *file, Old_Edje_File *oedf)
|
_edje_file_convert(Eet_File *file, Old_Edje_File *oedf)
|
||||||
{
|
{
|
||||||
|
@ -68,7 +155,7 @@ _edje_file_convert(Eet_File *file, Old_Edje_File *oedf)
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
Edje_Data *ed;
|
Edje_Data *ed;
|
||||||
|
|
||||||
edf = malloc(sizeof (Edje_File));
|
edf = calloc(1, sizeof (Edje_File));
|
||||||
if (!edf) return NULL;
|
if (!edf) return NULL;
|
||||||
|
|
||||||
edf->free_strings = eet_dictionary_get(file) ? 0 : 1;
|
edf->free_strings = eet_dictionary_get(file) ? 0 : 1;
|
||||||
|
@ -86,6 +173,9 @@ _edje_file_convert(Eet_File *file, Old_Edje_File *oedf)
|
||||||
edf->data = eina_hash_string_small_new(NULL);
|
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_LIST_FREE(oedf->data, ed)
|
||||||
{
|
{
|
||||||
eina_hash_direct_add(edf->data, ed->key, ed->value);
|
eina_hash_direct_add(edf->data, ed->key, ed->value);
|
||||||
|
@ -114,9 +204,13 @@ _edje_file_convert(Eet_File *file, Old_Edje_File *oedf)
|
||||||
eina_hash_direct_add(edf->fonts, fnt->entry, fnt);
|
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->oef = oedf;
|
edf->oef = oedf;
|
||||||
edf->external_dir = oedf->external_dir;
|
|
||||||
edf->image_dir = oedf->image_dir;
|
|
||||||
edf->spectrum_dir = oedf->spectrum_dir;
|
edf->spectrum_dir = oedf->spectrum_dir;
|
||||||
edf->styles = oedf->styles;
|
edf->styles = oedf->styles;
|
||||||
edf->color_classes = oedf->color_classes;
|
edf->color_classes = oedf->color_classes;
|
||||||
|
@ -133,6 +227,15 @@ _edje_file_convert(Eet_File *file, Old_Edje_File *oedf)
|
||||||
edf->collection_patterns = NULL;
|
edf->collection_patterns = NULL;
|
||||||
|
|
||||||
return edf;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
Edje_Part_Collection *
|
Edje_Part_Collection *
|
||||||
|
|
|
@ -2,15 +2,34 @@
|
||||||
# define EDJE_CONVERT_H__
|
# define EDJE_CONVERT_H__
|
||||||
|
|
||||||
typedef struct _Edje_Part_Collection Old_Edje_Part_Collection;
|
typedef struct _Edje_Part_Collection Old_Edje_Part_Collection;
|
||||||
|
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;
|
||||||
|
|
||||||
|
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
|
struct _Old_Edje_File
|
||||||
{
|
{
|
||||||
const char *path;
|
const char *path;
|
||||||
time_t mtime;
|
time_t mtime;
|
||||||
|
|
||||||
Edje_External_Directory *external_dir;
|
Old_Edje_External_Directory *external_dir;
|
||||||
Edje_Font_Directory *font_dir;
|
Old_Edje_Font_Directory *font_dir;
|
||||||
Edje_Image_Directory *image_dir;
|
Old_Edje_Image_Directory *image_dir;
|
||||||
Edje_Spectrum_Directory *spectrum_dir;
|
Edje_Spectrum_Directory *spectrum_dir;
|
||||||
Edje_Part_Collection_Directory *collection_dir;
|
Edje_Part_Collection_Directory *collection_dir;
|
||||||
Eina_List *data;
|
Eina_List *data;
|
||||||
|
|
|
@ -82,7 +82,8 @@ _edje_edd_init(void)
|
||||||
eet_data_descriptor_file_new(&eddc);
|
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_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);
|
eet_eina_file_data_descriptor_class_set(&eddc, "Edje_External_Directory",
|
||||||
|
sizeof (Old_Edje_External_Directory));
|
||||||
_edje_edd_edje_external_directory =
|
_edje_edd_edje_external_directory =
|
||||||
eet_data_descriptor_file_new(&eddc);
|
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_LIST(_edje_edd_edje_external_directory, Edje_External_Directory, "entries", entries, _edje_edd_edje_external_directory_entry);
|
||||||
|
@ -94,10 +95,11 @@ _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, "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_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);
|
eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Font_Directory",
|
||||||
|
sizeof (Old_Edje_Font_Directory));
|
||||||
_edje_edd_edje_font_directory =
|
_edje_edd_edje_font_directory =
|
||||||
eet_data_descriptor_file_new(&eddc);
|
eet_data_descriptor_file_new(&eddc);
|
||||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_font_directory, Edje_Font_Directory, "entries", entries, _edje_edd_edje_font_directory_entry);
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_font_directory, Old_Edje_Font_Directory, "entries", entries, _edje_edd_edje_font_directory_entry);
|
||||||
|
|
||||||
/* image directory */
|
/* image directory */
|
||||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Entry);
|
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Image_Directory_Entry);
|
||||||
|
@ -125,11 +127,12 @@ _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_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_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);
|
eet_eina_file_data_descriptor_class_set(&eddc, "Edje_Image_Directory",
|
||||||
|
sizeof (Old_Edje_Image_Directory));
|
||||||
_edje_edd_edje_image_directory =
|
_edje_edd_edje_image_directory =
|
||||||
eet_data_descriptor_file_new(&eddc);
|
eet_data_descriptor_file_new(&eddc);
|
||||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, 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, "entries", entries, _edje_edd_edje_image_directory_entry);
|
||||||
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Edje_Image_Directory, "sets", sets, _edje_edd_edje_image_directory_set);
|
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_image_directory, Old_Edje_Image_Directory, "sets", sets, _edje_edd_edje_image_directory_set);
|
||||||
|
|
||||||
/* spectrum directory */
|
/* spectrum directory */
|
||||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Spectrum_Color);
|
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Spectrum_Color);
|
||||||
|
@ -203,7 +206,7 @@ _edje_edd_init(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "a3", a3, EET_T_UCHAR);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_color_class, Edje_Color_Class, "a3", a3, EET_T_UCHAR);
|
||||||
|
|
||||||
/* the main file directory */
|
/* the main file directory */
|
||||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_File);
|
eet_eina_file_data_descriptor_class_set(&eddc, "Edje_File", sizeof (Old_Edje_File));
|
||||||
_edje_edd_edje_file =
|
_edje_edd_edje_file =
|
||||||
eet_data_descriptor_file_new(&eddc);
|
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, "compiler", compiler, EET_T_STRING);
|
||||||
|
|
|
@ -207,8 +207,7 @@ _edje_part_description_find_byname(Edje_Edit *eed, const char *part, const char
|
||||||
static int
|
static int
|
||||||
_edje_image_id_find(Evas_Object *obj, const char *image_name)
|
_edje_image_id_find(Evas_Object *obj, const char *image_name)
|
||||||
{
|
{
|
||||||
Edje_Image_Directory_Entry *i;
|
unsigned int i;
|
||||||
Eina_List *l;
|
|
||||||
|
|
||||||
GET_ED_OR_RETURN(-1);
|
GET_ED_OR_RETURN(-1);
|
||||||
|
|
||||||
|
@ -217,14 +216,10 @@ _edje_image_id_find(Evas_Object *obj, const char *image_name)
|
||||||
|
|
||||||
//printf("SEARCH IMAGE %s\n", image_name);
|
//printf("SEARCH IMAGE %s\n", image_name);
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, i)
|
for (i = 0; i < ed->file->image_dir->entries_count; ++i)
|
||||||
{
|
if (ed->file->image_dir->entries[i].entry
|
||||||
if (strcmp(image_name, i->entry) == 0)
|
&& !strcmp(image_name, ed->file->image_dir->entries[i].entry))
|
||||||
{
|
return i;
|
||||||
//printf(" Found id: %d \n", i->id);
|
|
||||||
return i->id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -232,21 +227,17 @@ _edje_image_id_find(Evas_Object *obj, const char *image_name)
|
||||||
static const char *
|
static const char *
|
||||||
_edje_image_name_find(Evas_Object *obj, int image_id)
|
_edje_image_name_find(Evas_Object *obj, int image_id)
|
||||||
{
|
{
|
||||||
Edje_Image_Directory_Entry *i;
|
|
||||||
Eina_List *l;
|
|
||||||
|
|
||||||
GET_ED_OR_RETURN(NULL);
|
GET_ED_OR_RETURN(NULL);
|
||||||
|
|
||||||
if (!ed->file) return NULL;
|
if (!ed->file) return NULL;
|
||||||
if (!ed->file->image_dir) return NULL;
|
if (!ed->file->image_dir) return NULL;
|
||||||
|
|
||||||
|
/* Special case for external image */
|
||||||
|
if (image_id < 0) image_id = -image_id - 1;
|
||||||
|
|
||||||
//printf("SEARCH IMAGE ID %d\n", image_id);
|
//printf("SEARCH IMAGE ID %d\n", image_id);
|
||||||
|
if ((unsigned int) image_id >= ed->file->image_dir->entries_count) return NULL;
|
||||||
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, i)
|
return ed->file->image_dir->entries[image_id].entry;
|
||||||
if (image_id == i->id)
|
|
||||||
return i->entry;
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -757,15 +748,15 @@ _edje_edit_style_tag_get(Edje *ed, const char *style, const char *name)
|
||||||
static Edje_External_Directory_Entry *
|
static Edje_External_Directory_Entry *
|
||||||
_edje_edit_external_get(Edje *ed, const char *name)
|
_edje_edit_external_get(Edje *ed, const char *name)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
unsigned int i;
|
||||||
Edje_External_Directory_Entry *e;
|
|
||||||
|
|
||||||
if (!ed || !ed->file || !ed->file->external_dir || !name)
|
if (!ed || !ed->file || !ed->file->external_dir || !name)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ed->file->external_dir->entries, l, e)
|
for (i = 0; i < ed->file->external_dir->entries_count; ++i)
|
||||||
if (e->entry && !strcmp(e->entry, name))
|
if (ed->file->external_dir->entries[i].entry
|
||||||
return e;
|
&& !strcmp(ed->file->external_dir->entries[i].entry, name))
|
||||||
|
return ed->file->external_dir->entries + i;
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -1752,16 +1743,16 @@ EAPI Eina_List *
|
||||||
edje_edit_externals_list_get(Evas_Object *obj)
|
edje_edit_externals_list_get(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Eina_List *externals = NULL;
|
Eina_List *externals = NULL;
|
||||||
Eina_List *l;
|
unsigned int i;
|
||||||
Edje_External_Directory_Entry *e;
|
|
||||||
|
|
||||||
GET_ED_OR_RETURN(NULL);
|
GET_ED_OR_RETURN(NULL);
|
||||||
|
|
||||||
if (!ed->file || !ed->file->external_dir)
|
if (!ed->file || !ed->file->external_dir)
|
||||||
return NULL;
|
return NULL;
|
||||||
//printf("GET STYLES LIST %d\n", eina_list_count(ed->file->styles));
|
//printf("GET STYLES LIST %d\n", eina_list_count(ed->file->styles));
|
||||||
EINA_LIST_FOREACH(ed->file->external_dir->entries, l, e)
|
for (i = 0; i < ed->file->external_dir->entries_count; ++i)
|
||||||
externals = eina_list_append(externals, eina_stringshare_add(e->entry));
|
externals = eina_list_append(externals,
|
||||||
|
eina_stringshare_add(ed->file->external_dir->entries[i].entry));
|
||||||
|
|
||||||
return externals;
|
return externals;
|
||||||
}
|
}
|
||||||
|
@ -1770,19 +1761,41 @@ EAPI Eina_Bool
|
||||||
edje_edit_external_add(Evas_Object *obj, const char *external)
|
edje_edit_external_add(Evas_Object *obj, const char *external)
|
||||||
{
|
{
|
||||||
Edje_External_Directory_Entry *e;
|
Edje_External_Directory_Entry *e;
|
||||||
|
unsigned int freeid;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
GET_ED_OR_RETURN(EINA_FALSE);
|
GET_ED_OR_RETURN(EINA_FALSE);
|
||||||
|
|
||||||
e = _edje_edit_external_get(ed, external);
|
e = _edje_edit_external_get(ed, external);
|
||||||
if (e) return EINA_FALSE;
|
if (e) return EINA_FALSE;
|
||||||
|
|
||||||
e = _alloc(sizeof(Edje_External_Directory_Entry));
|
|
||||||
if (!e) return EINA_FALSE;
|
|
||||||
e->entry = (char*)eina_stringshare_add(external);
|
|
||||||
|
|
||||||
if (!ed->file->external_dir)
|
if (!ed->file->external_dir)
|
||||||
ed->file->external_dir = _alloc(sizeof(Edje_External_Directory));
|
ed->file->external_dir = _alloc(sizeof(Edje_External_Directory));
|
||||||
ed->file->external_dir->entries = \
|
|
||||||
eina_list_append(ed->file->external_dir->entries, e);
|
for (i = 0; i < ed->file->external_dir->entries_count; ++i)
|
||||||
|
if (!ed->file->external_dir->entries[i].entry)
|
||||||
|
break ;
|
||||||
|
|
||||||
|
if (i == ed->file->external_dir->entries_count)
|
||||||
|
{
|
||||||
|
Edje_External_Directory_Entry *tmp;
|
||||||
|
unsigned int max;
|
||||||
|
|
||||||
|
max = ed->file->external_dir->entries_count + 1;
|
||||||
|
tmp = realloc(ed->file->external_dir->entries,
|
||||||
|
sizeof (Edje_External_Directory_Entry) * max);
|
||||||
|
|
||||||
|
if (!tmp) return EINA_FALSE;
|
||||||
|
|
||||||
|
ed->file->external_dir->entries = tmp;
|
||||||
|
freeid = ed->file->external_dir->entries_count;
|
||||||
|
ed->file->external_dir->entries_count = max;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
freeid = i;
|
||||||
|
|
||||||
|
ed->file->external_dir->entries[freeid].entry = (char*)eina_stringshare_add(external);
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1796,16 +1809,8 @@ edje_edit_external_del(Evas_Object *obj, const char *external)
|
||||||
e = _edje_edit_external_get(ed, external);
|
e = _edje_edit_external_get(ed, external);
|
||||||
if (!e) return EINA_FALSE;
|
if (!e) return EINA_FALSE;
|
||||||
|
|
||||||
ed->file->external_dir->entries = \
|
|
||||||
eina_list_remove(ed->file->external_dir->entries, e);
|
|
||||||
if (!ed->file->external_dir->entries)
|
|
||||||
{
|
|
||||||
free(ed->file->external_dir);
|
|
||||||
ed->file->external_dir = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
_edje_if_string_free(ed, e->entry);
|
_edje_if_string_free(ed, e->entry);
|
||||||
free(e);
|
e->entry = NULL;
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4416,9 +4421,8 @@ edje_edit_part_effect_set(Evas_Object *obj, const char *part, Edje_Text_Effect e
|
||||||
EAPI Eina_List *
|
EAPI Eina_List *
|
||||||
edje_edit_images_list_get(Evas_Object *obj)
|
edje_edit_images_list_get(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
Edje_Image_Directory_Entry *i;
|
|
||||||
Eina_List *images = NULL;
|
Eina_List *images = NULL;
|
||||||
Eina_List *l;
|
unsigned int i;
|
||||||
|
|
||||||
GET_ED_OR_RETURN(NULL);
|
GET_ED_OR_RETURN(NULL);
|
||||||
|
|
||||||
|
@ -4426,13 +4430,9 @@ edje_edit_images_list_get(Evas_Object *obj)
|
||||||
if (!ed->file->image_dir) return NULL;
|
if (!ed->file->image_dir) return NULL;
|
||||||
|
|
||||||
//printf("GET IMAGES LIST for %s\n", ed->file->path);
|
//printf("GET IMAGES LIST for %s\n", ed->file->path);
|
||||||
|
for (i = 0; i < ed->file->image_dir->entries_count; ++i)
|
||||||
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, i)
|
images = eina_list_append(images,
|
||||||
{
|
eina_stringshare_add(ed->file->image_dir->entries[i].entry));
|
||||||
images = eina_list_append(images, eina_stringshare_add(i->entry));
|
|
||||||
//printf(" Image: %s (type: %d param: %d id: %d) \n",
|
|
||||||
// i->entry, i->source_type, i->source_param, i->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return images;
|
return images;
|
||||||
}
|
}
|
||||||
|
@ -4440,9 +4440,9 @@ edje_edit_images_list_get(Evas_Object *obj)
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
edje_edit_image_add(Evas_Object *obj, const char* path)
|
edje_edit_image_add(Evas_Object *obj, const char* path)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
Edje_Image_Directory_Entry *de;
|
Edje_Image_Directory_Entry *de;
|
||||||
int free_id = 0;
|
unsigned int i;
|
||||||
|
int free_id = -1;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
GET_ED_OR_RETURN(EINA_FALSE);
|
GET_ED_OR_RETURN(EINA_FALSE);
|
||||||
|
@ -4463,33 +4463,44 @@ edje_edit_image_add(Evas_Object *obj, const char* path)
|
||||||
else name = (char *)path;
|
else name = (char *)path;
|
||||||
|
|
||||||
/* Loop trough image directory to find if image exist */
|
/* Loop trough image directory to find if image exist */
|
||||||
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, de)
|
for (i = 0; i < ed->file->image_dir->entries_count; ++i)
|
||||||
{
|
{
|
||||||
if (!strcmp(name, de->entry))
|
de = ed->file->image_dir->entries + i;
|
||||||
|
|
||||||
|
if (!de->entry)
|
||||||
|
free_id = i;
|
||||||
|
else if (!strcmp(name, de->entry))
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
if (de->id >= free_id)
|
|
||||||
free_id = de->id + 1; /*TODO search for free (hole) id*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create Image Entry */
|
if (free_id == -1)
|
||||||
de = _alloc(sizeof(Edje_Image_Directory_Entry));
|
{
|
||||||
if (!de) return EINA_FALSE;
|
Edje_Image_Directory_Entry *tmp;
|
||||||
de->entry = strdup(name);
|
unsigned int count;
|
||||||
|
|
||||||
|
count = ed->file->image_dir->entries_count + 1;
|
||||||
|
|
||||||
|
tmp = realloc(ed->file->image_dir->entries,
|
||||||
|
sizeof (Edje_Image_Directory_Entry) * count);
|
||||||
|
if (!tmp) return EINA_FALSE;
|
||||||
|
|
||||||
|
ed->file->image_dir->entries = tmp;
|
||||||
|
free_id = ed->file->image_dir->entries_count;
|
||||||
|
ed->file->image_dir->entries_count = count;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set Image Entry */
|
||||||
|
de = ed->file->image_dir->entries + free_id;
|
||||||
|
de->entry = eina_stringshare_add(name);
|
||||||
de->id = free_id;
|
de->id = free_id;
|
||||||
de->source_type = 1;
|
de->source_type = 1;
|
||||||
de->source_param = 1;
|
de->source_param = 1;
|
||||||
|
|
||||||
/* Add image to Image Directory */
|
|
||||||
ed->file->image_dir->entries =
|
|
||||||
eina_list_append(ed->file->image_dir->entries, de);
|
|
||||||
|
|
||||||
/* Import image */
|
/* Import image */
|
||||||
if (!_edje_import_image_file(ed, path, free_id))
|
if (!_edje_import_image_file(ed, path, free_id))
|
||||||
{
|
{
|
||||||
ed->file->image_dir->entries =
|
eina_stringshare_del(de->entry);
|
||||||
eina_list_remove(ed->file->image_dir->entries, de);
|
de->entry = NULL;
|
||||||
free(de->entry);
|
|
||||||
free(de);
|
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4499,8 +4510,8 @@ edje_edit_image_add(Evas_Object *obj, const char* path)
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
edje_edit_image_del(Evas_Object *obj, const char* name)
|
edje_edit_image_del(Evas_Object *obj, const char* name)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
Edje_Image_Directory_Entry *de;
|
Edje_Image_Directory_Entry *de;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
GET_ED_OR_RETURN(EINA_FALSE);
|
GET_ED_OR_RETURN(EINA_FALSE);
|
||||||
|
|
||||||
|
@ -4512,18 +4523,16 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
||||||
if (!ed->file->image_dir)
|
if (!ed->file->image_dir)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, de)
|
for (i = 0; i < ed->file->image_dir->entries_count; ++i)
|
||||||
{
|
{
|
||||||
if (!strcmp(name, de->entry))
|
de = ed->file->image_dir->entries + i;
|
||||||
{
|
|
||||||
ed->file->image_dir->entries = eina_list_remove_list(
|
if (de->entry
|
||||||
ed->file->image_dir->entries, l);
|
&& !strcmp(name, de->entry))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
de = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!de)
|
if (i == ed->file->image_dir->entries_count)
|
||||||
{
|
{
|
||||||
WRN("Unable to find image entry part \"%s\"", name);
|
WRN("Unable to find image entry part \"%s\"", name);
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -4538,8 +4547,6 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
||||||
if (!eetf)
|
if (!eetf)
|
||||||
{
|
{
|
||||||
ERR("Unable to open \"%s\" for writing output", ed->path);
|
ERR("Unable to open \"%s\" for writing output", ed->path);
|
||||||
ed->file->image_dir->entries =
|
|
||||||
eina_list_append(ed->file->image_dir->entries, de);
|
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4549,8 +4556,6 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
||||||
{
|
{
|
||||||
ERR("Unable to delete \"%s\" font entry", entry);
|
ERR("Unable to delete \"%s\" font entry", entry);
|
||||||
eet_close(eetf);
|
eet_close(eetf);
|
||||||
ed->file->image_dir->entries =
|
|
||||||
eina_list_append(ed->file->image_dir->entries, de);
|
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4558,16 +4563,14 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
||||||
if (!_edje_edit_edje_file_save(eetf, ed->file))
|
if (!_edje_edit_edje_file_save(eetf, ed->file))
|
||||||
{
|
{
|
||||||
eet_close(eetf);
|
eet_close(eetf);
|
||||||
ed->file->image_dir->entries =
|
|
||||||
eina_list_append(ed->file->image_dir->entries, de);
|
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
eet_close(eetf);
|
eet_close(eetf);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(de->entry);
|
_edje_if_string_free(ed, de->entry);
|
||||||
free(de);
|
de->entry = NULL;
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4575,9 +4578,7 @@ edje_edit_image_del(Evas_Object *obj, const char* name)
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
edje_edit_image_data_add(Evas_Object *obj, const char *name, int id)
|
edje_edit_image_data_add(Evas_Object *obj, const char *name, int id)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
|
||||||
Edje_Image_Directory_Entry *de;
|
Edje_Image_Directory_Entry *de;
|
||||||
Edje_Image_Directory_Entry *i, *t;
|
|
||||||
|
|
||||||
GET_ED_OR_RETURN(EINA_FALSE);
|
GET_ED_OR_RETURN(EINA_FALSE);
|
||||||
|
|
||||||
|
@ -4593,34 +4594,14 @@ edje_edit_image_data_add(Evas_Object *obj, const char *name, int id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop trough image directory to find if image exist */
|
/* Loop trough image directory to find if image exist */
|
||||||
t = NULL;
|
if (id < 0) id = - id - 1;
|
||||||
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, i)
|
if ((unsigned int) id >= ed->file->image_dir->entries_count) return EINA_FALSE;
|
||||||
{
|
|
||||||
if (!i) return EINA_FALSE;
|
|
||||||
if (i->id == id) t = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create Image Entry */
|
de = ed->file->image_dir->entries + id;
|
||||||
if (!t)
|
eina_stringshare_replace(&de->entry, name);
|
||||||
{
|
|
||||||
de = _alloc(sizeof(Edje_Image_Directory_Entry));
|
|
||||||
if (!de) return EINA_FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
de = t;
|
|
||||||
free(de->entry);
|
|
||||||
}
|
|
||||||
de->entry = strdup(name);
|
|
||||||
de->id = id;
|
|
||||||
de->source_type = 1;
|
de->source_type = 1;
|
||||||
de->source_param = 1;
|
de->source_param = 1;
|
||||||
|
|
||||||
/* Add image to Image Directory */
|
|
||||||
if (!t)
|
|
||||||
ed->file->image_dir->entries =
|
|
||||||
eina_list_append(ed->file->image_dir->entries, de);
|
|
||||||
|
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4633,27 +4614,29 @@ edje_edit_image_id_get(Evas_Object *obj, const char *image_name)
|
||||||
EAPI Edje_Edit_Image_Comp
|
EAPI Edje_Edit_Image_Comp
|
||||||
edje_edit_image_compression_type_get(Evas_Object *obj, const char *image)
|
edje_edit_image_compression_type_get(Evas_Object *obj, const char *image)
|
||||||
{
|
{
|
||||||
Edje_Image_Directory_Entry *i = NULL;
|
Edje_Image_Directory_Entry *de = NULL;
|
||||||
Eina_List *l;
|
unsigned int i;
|
||||||
|
|
||||||
GET_ED_OR_RETURN(-1);
|
GET_ED_OR_RETURN(-1);
|
||||||
|
|
||||||
if (!ed->file) return -1;
|
if (!ed->file) return -1;
|
||||||
if (!ed->file->image_dir) return -1;
|
if (!ed->file->image_dir) return -1;
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, i)
|
for (i = 0; i < ed->file->image_dir->entries_count; ++i)
|
||||||
{
|
{
|
||||||
if (strcmp(i->entry, image) == 0)
|
de = ed->file->image_dir->entries + i;
|
||||||
|
|
||||||
|
if (de->entry
|
||||||
|
&& !strcmp(image, de->entry))
|
||||||
break;
|
break;
|
||||||
i = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!i) return -1;
|
if (i == ed->file->image_dir->entries_count) return -1;
|
||||||
|
|
||||||
switch(i->source_type)
|
switch(de->source_type)
|
||||||
{
|
{
|
||||||
case EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT:
|
case EDJE_IMAGE_SOURCE_TYPE_INLINE_PERFECT:
|
||||||
if (i->source_param == 0) // RAW
|
if (de->source_param == 0) // RAW
|
||||||
return EDJE_EDIT_IMAGE_COMP_RAW;
|
return EDJE_EDIT_IMAGE_COMP_RAW;
|
||||||
else // COMP
|
else // COMP
|
||||||
return EDJE_EDIT_IMAGE_COMP_COMP;
|
return EDJE_EDIT_IMAGE_COMP_COMP;
|
||||||
|
@ -4672,22 +4655,24 @@ edje_edit_image_compression_type_get(Evas_Object *obj, const char *image)
|
||||||
EAPI int
|
EAPI int
|
||||||
edje_edit_image_compression_rate_get(Evas_Object *obj, const char *image)
|
edje_edit_image_compression_rate_get(Evas_Object *obj, const char *image)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
Edje_Image_Directory_Entry *de;
|
||||||
Edje_Image_Directory_Entry *i;
|
unsigned int i;
|
||||||
|
|
||||||
GET_ED_OR_RETURN(-1);
|
GET_ED_OR_RETURN(-1);
|
||||||
|
|
||||||
// Gets the Image Entry
|
// Gets the Image Entry
|
||||||
EINA_LIST_FOREACH(ed->file->image_dir->entries, l, i)
|
for (i = 0; i < ed->file->image_dir->entries_count; ++i)
|
||||||
{
|
{
|
||||||
if (strcmp(i->entry, image) == 0) break;
|
de = ed->file->image_dir->entries + i;
|
||||||
i = NULL;
|
if (de->entry
|
||||||
|
&& !strcmp(de->entry, image))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!i) return -1;
|
if (i == ed->file->image_dir->entries_count) return -1;
|
||||||
if (i->source_type != EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY) return -2;
|
if (de->source_type != EDJE_IMAGE_SOURCE_TYPE_INLINE_LOSSY) return -2;
|
||||||
|
|
||||||
return i->source_param;
|
return de->source_param;
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
|
|
|
@ -323,13 +323,10 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
||||||
|
|
||||||
if (ed->file && ed->file->external_dir)
|
if (ed->file && ed->file->external_dir)
|
||||||
{
|
{
|
||||||
const Edje_External_Directory_Entry *ext;
|
unsigned int i;
|
||||||
const Eina_List *n;
|
|
||||||
|
|
||||||
EINA_LIST_FOREACH(ed->file->external_dir->entries, n, ext)
|
for (i = 0; i < ed->file->external_dir->entries_count; ++i)
|
||||||
{
|
edje_module_load(ed->file->external_dir->entries[i].entry);
|
||||||
edje_module_load(ext->entry);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_edje_textblock_styles_add(ed);
|
_edje_textblock_styles_add(ed);
|
||||||
|
@ -1036,13 +1033,26 @@ _edje_file_free(Edje_File *edf)
|
||||||
|
|
||||||
if (edf->image_dir)
|
if (edf->image_dir)
|
||||||
{
|
{
|
||||||
Edje_Image_Directory_Entry *ie;
|
unsigned int i;
|
||||||
|
|
||||||
EINA_LIST_FREE(edf->image_dir->entries, ie)
|
if (edf->free_strings)
|
||||||
{
|
{
|
||||||
if (edf->free_strings && ie->entry) eina_stringshare_del(ie->entry);
|
for (i = 0; i < edf->image_dir->entries_count; ++i)
|
||||||
free(ie);
|
eina_stringshare_del(edf->image_dir->entries[i].entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Sets have been added after edje received eet dictionnary support */
|
||||||
|
for (i = 0; i < edf->image_dir->sets_count; ++i)
|
||||||
|
{
|
||||||
|
Edje_Image_Directory_Set_Entry *se;
|
||||||
|
|
||||||
|
EINA_LIST_FREE(edf->image_dir->sets[i].entries, se)
|
||||||
|
free(se);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
free(edf->image_dir->entries);
|
||||||
|
free(edf->image_dir->sets);
|
||||||
free(edf->image_dir);
|
free(edf->image_dir);
|
||||||
}
|
}
|
||||||
if (edf->spectrum_dir)
|
if (edf->spectrum_dir)
|
||||||
|
|
|
@ -215,7 +215,6 @@ typedef struct _Edje_Style_Tag Edje_Style_Tag;
|
||||||
typedef struct _Edje_Data Edje_Data;
|
typedef struct _Edje_Data Edje_Data;
|
||||||
typedef struct _Edje_External_Directory Edje_External_Directory;
|
typedef struct _Edje_External_Directory Edje_External_Directory;
|
||||||
typedef struct _Edje_External_Directory_Entry Edje_External_Directory_Entry;
|
typedef struct _Edje_External_Directory_Entry Edje_External_Directory_Entry;
|
||||||
typedef struct _Edje_Font_Directory Edje_Font_Directory;
|
|
||||||
typedef struct _Edje_Font_Directory_Entry Edje_Font_Directory_Entry;
|
typedef struct _Edje_Font_Directory_Entry Edje_Font_Directory_Entry;
|
||||||
typedef struct _Edje_Image_Directory Edje_Image_Directory;
|
typedef struct _Edje_Image_Directory Edje_Image_Directory;
|
||||||
typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
|
typedef struct _Edje_Image_Directory_Entry Edje_Image_Directory_Entry;
|
||||||
|
@ -374,11 +373,6 @@ struct _Edje_Data
|
||||||
|
|
||||||
/*----------*/
|
/*----------*/
|
||||||
|
|
||||||
struct _Edje_Font_Directory
|
|
||||||
{
|
|
||||||
Eina_List *entries; /* a list of Edje_Font_Directory_Entry */
|
|
||||||
};
|
|
||||||
|
|
||||||
struct _Edje_Font_Directory_Entry
|
struct _Edje_Font_Directory_Entry
|
||||||
{
|
{
|
||||||
const char *entry; /* the name of the font */
|
const char *entry; /* the name of the font */
|
||||||
|
@ -390,7 +384,8 @@ struct _Edje_Font_Directory_Entry
|
||||||
|
|
||||||
struct _Edje_External_Directory
|
struct _Edje_External_Directory
|
||||||
{
|
{
|
||||||
Eina_List *entries; /* a list of Edje_External_Directory_Entry */
|
Edje_External_Directory_Entry *entries; /* a list of Edje_External_Directory_Entry */
|
||||||
|
unsigned int entries_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Edje_External_Directory_Entry
|
struct _Edje_External_Directory_Entry
|
||||||
|
@ -407,13 +402,16 @@ struct _Edje_External_Directory_Entry
|
||||||
|
|
||||||
struct _Edje_Image_Directory
|
struct _Edje_Image_Directory
|
||||||
{
|
{
|
||||||
Eina_List *entries; /* a list of Edje_Image_Directory_Entry */
|
Edje_Image_Directory_Entry *entries; /* an array of Edje_Image_Directory_Entry */
|
||||||
Eina_List *sets; /* a list of Edje_Image_Directory_Set */
|
unsigned int entries_count;
|
||||||
|
|
||||||
|
Edje_Image_Directory_Set *sets;
|
||||||
|
unsigned int sets_count; /* an array of Edje_Image_Directory_Set */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Edje_Image_Directory_Entry
|
struct _Edje_Image_Directory_Entry
|
||||||
{
|
{
|
||||||
char *entry; /* the nominal name of the image - if any */
|
const char *entry; /* the nominal name of the image - if any */
|
||||||
int source_type; /* alternate source mode. 0 = none */
|
int source_type; /* alternate source mode. 0 = none */
|
||||||
int source_param; /* extra params on encoding */
|
int source_param; /* extra params on encoding */
|
||||||
int id; /* the id no. of the image */
|
int id; /* the id no. of the image */
|
||||||
|
@ -429,7 +427,7 @@ struct _Edje_Image_Directory_Set
|
||||||
|
|
||||||
struct _Edje_Image_Directory_Set_Entry
|
struct _Edje_Image_Directory_Set_Entry
|
||||||
{
|
{
|
||||||
char *name;
|
const char *name;
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
Loading…
Reference in New Issue