forked from enlightenment/efl
parent
3ec81c0b3e
commit
2623367732
|
@ -3442,9 +3442,9 @@ st_collections_group_parts_part_description_inherit(void)
|
|||
#define STRDUP(x) x ? strdup(x) : NULL
|
||||
|
||||
ed->common.color_class = STRDUP(ed->common.color_class);
|
||||
ed->text.text = STRDUP(ed->text.text);
|
||||
ed->text.text.str = STRDUP(ed->text.text.str);
|
||||
ed->text.text_class = STRDUP(ed->text.text_class);
|
||||
ed->text.font = STRDUP(ed->text.font);
|
||||
ed->text.font.str = STRDUP(ed->text.font.str);
|
||||
#undef STRDUP
|
||||
|
||||
data_queue_part_slave_lookup(&(parent->text.id_source), &(ed->text.id_source));
|
||||
|
@ -4812,7 +4812,7 @@ st_collections_group_parts_part_description_text_text(void)
|
|||
free(s);
|
||||
}
|
||||
}
|
||||
ed->text.text = str;
|
||||
ed->text.text.str = str;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4887,7 +4887,7 @@ st_collections_group_parts_part_description_text_font(void)
|
|||
|
||||
ed = ep->default_desc;
|
||||
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
||||
ed->text.font = parse_str(0);
|
||||
ed->text.font.str = parse_str(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4924,7 +4924,7 @@ st_collections_group_parts_part_description_text_style(void)
|
|||
|
||||
ed = ep->default_desc;
|
||||
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
||||
ed->text.style = parse_str(0);
|
||||
ed->text.style.str = parse_str(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4962,7 +4962,7 @@ st_collections_group_parts_part_description_text_repch(void)
|
|||
|
||||
ed = ep->default_desc;
|
||||
if (ep->other_desc) ed = eina_list_data_get(eina_list_last(ep->other_desc));
|
||||
ed->text.repch = parse_str(0);
|
||||
ed->text.repch.str = parse_str(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -122,14 +122,21 @@ _edje_file_convert(Eet_File *ef, Old_Edje_File *oedf)
|
|||
|
||||
edf->fonts = eina_hash_string_small_new(free);
|
||||
edf->collection = eina_hash_string_small_new(free);
|
||||
edf->data = eina_hash_string_small_new(NULL);
|
||||
edf->data = eina_hash_string_small_new(free);
|
||||
|
||||
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);
|
||||
Edje_String *es;
|
||||
|
||||
es = calloc(1, sizeof (Edje_String));
|
||||
if (!es) continue;
|
||||
|
||||
es->str = ed->value;
|
||||
|
||||
eina_hash_direct_add(edf->data, ed->key, es);
|
||||
free(ed);
|
||||
}
|
||||
|
||||
|
@ -282,7 +289,14 @@ _edje_collection_convert(Eet_File *ef, Edje_Part_Collection_Directory_Entry *ce,
|
|||
edc->data = eina_hash_string_small_new(NULL);
|
||||
EINA_LIST_FREE(oedc->data, di)
|
||||
{
|
||||
eina_hash_direct_add(edc->data, di->key, di->value);
|
||||
Edje_String *es;
|
||||
|
||||
es = calloc(1, sizeof (Edje_String));
|
||||
if (!es) continue ;
|
||||
|
||||
es->str = di->value;
|
||||
|
||||
eina_hash_direct_add(edc->data, di->key, es);
|
||||
free(di);
|
||||
}
|
||||
|
||||
|
|
|
@ -308,11 +308,11 @@ _edje_edd_old_init(void)
|
|||
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", text.text.str, 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.style", text.style.str, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.font", text.font.str, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_old_edje_part_description, Old_Edje_Part_Description, "text.repch", text.repch.str, 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);
|
||||
|
|
|
@ -246,7 +246,7 @@ _edje_recalc(Edje *ed)
|
|||
void
|
||||
_edje_recalc_do(Edje *ed)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed->postponed = 0;
|
||||
evas_object_smart_need_recalculate_set(ed->obj, 0);
|
||||
|
@ -673,31 +673,35 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
|
|||
const char *text = "";
|
||||
const char *style = "";
|
||||
Edje_Style *stl = NULL;
|
||||
const char *tmp;
|
||||
Eina_List *l;
|
||||
|
||||
if (chosen_desc->text.id_source >= 0)
|
||||
{
|
||||
ep->text.source = ed->table_parts[chosen_desc->text.id_source % ed->table_parts_size];
|
||||
if (((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.style)
|
||||
style = ((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.style;
|
||||
|
||||
tmp = edje_string_get(&((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.style);
|
||||
if (tmp) style = tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
ep->text.source = NULL;
|
||||
if (chosen_desc->text.style)
|
||||
style = chosen_desc->text.style;
|
||||
|
||||
tmp = edje_string_get(&chosen_desc->text.style);
|
||||
if (tmp) style = tmp;
|
||||
}
|
||||
|
||||
if (chosen_desc->text.id_text_source >= 0)
|
||||
{
|
||||
ep->text.text_source = ed->table_parts[chosen_desc->text.id_text_source % ed->table_parts_size];
|
||||
text = ((Edje_Part_Description_Text*)ep->text.text_source->chosen_description)->text.text;
|
||||
text = edje_string_get(&((Edje_Part_Description_Text*)ep->text.text_source->chosen_description)->text.text);
|
||||
|
||||
if (ep->text.text_source->text.text) text = ep->text.text_source->text.text;
|
||||
}
|
||||
else
|
||||
{
|
||||
ep->text.text_source = NULL;
|
||||
text = chosen_desc->text.text;
|
||||
text = edje_string_get(&chosen_desc->text.text);
|
||||
if (ep->text.text) text = ep->text.text;
|
||||
}
|
||||
|
||||
|
@ -815,9 +819,9 @@ _edje_part_recalc_single_text(FLOAT_T sc,
|
|||
ep->text.text_source = NULL;
|
||||
|
||||
if (ep->text.text_source)
|
||||
text = ((Edje_Part_Description_Text*)ep->text.text_source->chosen_description)->text.text;
|
||||
text = edje_string_get(&(((Edje_Part_Description_Text*)ep->text.text_source->chosen_description)->text.text));
|
||||
else
|
||||
text = chosen_desc->text.text;
|
||||
text = edje_string_get(&chosen_desc->text.text);
|
||||
|
||||
if (ep->text.source)
|
||||
font = _edje_text_class_font_get(ed, ((Edje_Part_Description_Text*)ep->text.source->chosen_description), &size, &sfont);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "edje_private.h"
|
||||
|
||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_file = NULL;
|
||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_string = 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;
|
||||
|
@ -17,6 +18,7 @@ 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_entry = NULL;
|
||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_pack_element = NULL;
|
||||
EAPI Eet_Data_Descriptor *_edje_edd_edje_pack_element_pointer = 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_pointer = NULL;
|
||||
|
@ -130,10 +132,26 @@ _edje_description_variant_type_set(const char *type, void *data, Eina_Bool unkno
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Hash *
|
||||
_edje_eina_hash_add_alloc(Eina_Hash *hash,
|
||||
const char *key,
|
||||
void *data)
|
||||
{
|
||||
if (!hash)
|
||||
hash = eina_hash_string_small_new(free);
|
||||
|
||||
if (!hash)
|
||||
return NULL;
|
||||
|
||||
eina_hash_add(hash, key, data);
|
||||
return hash;
|
||||
}
|
||||
|
||||
EAPI void
|
||||
_edje_edd_shutdown(void)
|
||||
{
|
||||
FREED(_edje_edd_edje_file);
|
||||
FREED(_edje_edd_edje_string);
|
||||
FREED(_edje_edd_edje_style);
|
||||
FREED(_edje_edd_edje_style_tag);
|
||||
FREED(_edje_edd_edje_color_class);
|
||||
|
@ -148,6 +166,7 @@ _edje_edd_shutdown(void)
|
|||
FREED(_edje_edd_edje_program_after);
|
||||
FREED(_edje_edd_edje_part_collection_directory_entry);
|
||||
FREED(_edje_edd_edje_pack_element);
|
||||
FREED(_edje_edd_edje_pack_element_pointer);
|
||||
FREED(_edje_edd_edje_part_collection);
|
||||
FREED(_edje_edd_edje_part);
|
||||
FREED(_edje_edd_edje_part_pointer);
|
||||
|
@ -197,6 +216,12 @@ _edje_edd_init(void)
|
|||
{
|
||||
Eet_Data_Descriptor_Class eddc;
|
||||
|
||||
/* localisable string */
|
||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_String);
|
||||
_edje_edd_edje_string = eet_data_descriptor_file_new(&eddc);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_string, Edje_String, "str", str, EET_T_STRING);
|
||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_string, Edje_String, "id", id, EET_T_UINT);
|
||||
|
||||
/* external directory */
|
||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_External_Directory_Entry);
|
||||
_edje_edd_edje_external_directory_entry =
|
||||
|
@ -295,8 +320,8 @@ _edje_edd_init(void)
|
|||
|
||||
/* the main file directory */
|
||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_File);
|
||||
_edje_edd_edje_file =
|
||||
eet_data_descriptor_file_new(&eddc);
|
||||
eddc.func.hash_add = (void * (*)(void *, const char *, void *)) _edje_eina_hash_add_alloc;
|
||||
_edje_edd_edje_file = eet_data_descriptor_file_new(&eddc);
|
||||
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);
|
||||
|
@ -304,7 +329,7 @@ _edje_edd_init(void)
|
|||
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, "data", data, _edje_edd_edje_string);
|
||||
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);
|
||||
|
||||
|
@ -689,6 +714,8 @@ _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);
|
||||
|
||||
EDJE_DEFINE_POINTER_TYPE(Pack_Element, pack_element);
|
||||
|
||||
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Part);
|
||||
eddc.func.mem_free = mem_free_part;
|
||||
eddc.func.mem_alloc = mem_alloc_part;
|
||||
|
@ -713,7 +740,7 @@ _edje_edd_init(void)
|
|||
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_VAR_ARRAY(_edje_edd_edje_part, Edje_Part, "items", items, _edje_edd_edje_pack_element_pointer);
|
||||
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);
|
||||
|
@ -743,7 +770,7 @@ _edje_edd_init(void)
|
|||
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_HASH(_edje_edd_edje_part_collection, Edje_Part_Collection, "data", data, _edje_edd_edje_string);
|
||||
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);
|
||||
|
|
|
@ -441,7 +441,7 @@ _edje_import_image_file(Edje *ed, const char *path, int id)
|
|||
static int
|
||||
_edje_part_id_find(Edje *ed, const char *part)
|
||||
{
|
||||
int id;
|
||||
unsigned int id;
|
||||
|
||||
for (id = 0; id < ed->table_parts_size; id++)
|
||||
{
|
||||
|
@ -669,7 +669,7 @@ _edje_fix_parts_id(Edje *ed)
|
|||
*/
|
||||
unsigned int i;
|
||||
int correct_id;
|
||||
int count;
|
||||
unsigned int count;
|
||||
|
||||
//printf("FIXING PARTS ID \n");
|
||||
|
||||
|
@ -1764,7 +1764,7 @@ EAPI Eina_List *
|
|||
edje_edit_parts_list_get(Evas_Object *obj)
|
||||
{
|
||||
Eina_List *parts = NULL;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
GET_ED_OR_RETURN(NULL);
|
||||
|
||||
|
@ -2119,7 +2119,7 @@ edje_edit_part_above_get(Evas_Object *obj, const char* part)
|
|||
|
||||
GET_RP_OR_RETURN(0);
|
||||
|
||||
if (rp->part->id >= ed->table_parts_size - 1) return 0;
|
||||
if ((unsigned int) rp->part->id >= ed->table_parts_size - 1) return 0;
|
||||
|
||||
next = ed->table_parts[(rp->part->id + 1) % ed->table_parts_size];
|
||||
|
||||
|
@ -2167,7 +2167,7 @@ edje_edit_part_restack_above(Evas_Object *obj, const char* part)
|
|||
|
||||
//printf("RESTACK PART: %s ABOVE\n", part);
|
||||
|
||||
if (rp->part->id >= ed->table_parts_size - 1) return EINA_FALSE;
|
||||
if ((unsigned int) rp->part->id >= ed->table_parts_size - 1) return EINA_FALSE;
|
||||
|
||||
group = ed->collection;
|
||||
|
||||
|
@ -3004,11 +3004,11 @@ edje_edit_state_copy(Evas_Object *obj, const char *part, const char *from, doubl
|
|||
text_to->text = text_from->text;
|
||||
|
||||
/* Update pointers. */
|
||||
PD_STRING_COPY(text_to, text_from, text.text);
|
||||
PD_STRING_COPY(text_to, text_from, text.text.str);
|
||||
PD_STRING_COPY(text_to, text_from, text.text_class);
|
||||
PD_STRING_COPY(text_to, text_from, text.style);
|
||||
PD_STRING_COPY(text_to, text_from, text.font);
|
||||
PD_STRING_COPY(text_to, text_from, text.repch);
|
||||
PD_STRING_COPY(text_to, text_from, text.style.str);
|
||||
PD_STRING_COPY(text_to, text_from, text.font.str);
|
||||
PD_STRING_COPY(text_to, text_from, text.repch.str);
|
||||
break;
|
||||
}
|
||||
case EDJE_PART_TYPE_BOX:
|
||||
|
@ -3760,10 +3760,7 @@ edje_edit_state_text_get(Evas_Object *obj, const char *part, const char *state,
|
|||
txt = (Edje_Part_Description_Text *) pd;
|
||||
//printf("GET TEXT of state: %s\n", state);
|
||||
|
||||
if (txt->text.text)
|
||||
return eina_stringshare_add(txt->text.text);
|
||||
|
||||
return NULL;
|
||||
return eina_stringshare_add(edje_string_get(&txt->text.text));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -3783,8 +3780,9 @@ edje_edit_state_text_set(Evas_Object *obj, const char *part, const char *state,
|
|||
|
||||
txt = (Edje_Part_Description_Text *) pd;
|
||||
|
||||
_edje_if_string_free(ed, txt->text.text);
|
||||
txt->text.text = (char *)eina_stringshare_add(text);
|
||||
_edje_if_string_free(ed, txt->text.text.str);
|
||||
txt->text.text.str = (char *)eina_stringshare_add(text);
|
||||
txt->text.text.id = 0;
|
||||
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
@ -4037,8 +4035,7 @@ edje_edit_state_font_get(Evas_Object *obj, const char *part, const char *state,
|
|||
|
||||
txt = (Edje_Part_Description_Text*) pd;
|
||||
|
||||
if (!txt->text.font) return NULL;
|
||||
return eina_stringshare_add(txt->text.font);
|
||||
return eina_stringshare_add(edje_string_get(&txt->text.font));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -4054,8 +4051,9 @@ edje_edit_state_font_set(Evas_Object *obj, const char *part, const char *state,
|
|||
|
||||
txt = (Edje_Part_Description_Text*) pd;
|
||||
|
||||
_edje_if_string_free(ed, txt->text.font);
|
||||
txt->text.font = (char *)eina_stringshare_add(font);
|
||||
_edje_if_string_free(ed, txt->text.font.str);
|
||||
txt->text.font.str = (char *)eina_stringshare_add(font);
|
||||
txt->text.font.id = 0;
|
||||
|
||||
edje_object_calc_force(obj);
|
||||
}
|
||||
|
@ -5735,10 +5733,20 @@ _edje_generate_source_of_state(Evas_Object *obj, const char *part, const char *s
|
|||
txt = (Edje_Part_Description_Text *) pd;
|
||||
|
||||
BUF_APPEND(I5"text {\n");
|
||||
if (txt->text.text)
|
||||
BUF_APPENDF(I6"text: \"%s\";\n", txt->text.text);
|
||||
if (txt->text.font)
|
||||
BUF_APPENDF(I6"font: \"%s\";\n", txt->text.font);
|
||||
if (edje_string_get(&txt->text.text))
|
||||
{
|
||||
if (txt->text.text.id)
|
||||
BUF_APPENDF(I6"text: _(\"%s\");\n", edje_string_id_get(&txt->text.text));
|
||||
else
|
||||
BUF_APPENDF(I6"text: \"%s\";\n", edje_string_get(&txt->text.text));
|
||||
}
|
||||
if (edje_string_get(&txt->text.font))
|
||||
{
|
||||
if (txt->text.font.id)
|
||||
BUF_APPENDF(I6"font: _(\"%s\");\n", edje_string_id_get(&txt->text.font));
|
||||
else
|
||||
BUF_APPENDF(I6"font: \"%s\";\n", edje_string_get(&txt->text.font));
|
||||
}
|
||||
if (txt->text.size)
|
||||
BUF_APPENDF(I6"size: %d;\n", txt->text.size);
|
||||
if (txt->text.text_class)
|
||||
|
@ -5908,7 +5916,8 @@ _edje_generate_source_of_group(Edje *ed, Edje_Part_Collection_Directory_Entry *p
|
|||
{
|
||||
Evas_Object *obj;
|
||||
Eina_List *l, *ll;
|
||||
int w, h, i;
|
||||
unsigned int i;
|
||||
int w, h;
|
||||
char *data;
|
||||
const char *group = pce->entry;
|
||||
Eina_Bool ret = EINA_TRUE;
|
||||
|
|
|
@ -1668,10 +1668,13 @@ _edje_embryo_fn_custom_state(Embryo_Program *ep, Embryo_Cell *params)
|
|||
|
||||
text_desc = (Edje_Part_Description_Text*) d;
|
||||
|
||||
text_desc->text.text = DUP(text_desc->text.text);
|
||||
text_desc->text.text_class = DUP(text_desc->text.text_class);
|
||||
text_desc->text.font = DUP(text_desc->text.font);
|
||||
text_desc->text.style = DUP(text_desc->text.style);
|
||||
text_desc->text.text.str = DUP(edje_string_get(&text_desc->text.text));
|
||||
text_desc->text.text.id = 0;
|
||||
text_desc->text.font.str = DUP(edje_string_get(&text_desc->text.font));
|
||||
text_desc->text.font.id = 0;
|
||||
text_desc->text.style.str = DUP(edje_string_get(&text_desc->text.style));
|
||||
text_desc->text.style.id = 0;
|
||||
}
|
||||
#undef DUP
|
||||
|
||||
|
@ -1925,7 +1928,7 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params)
|
|||
GETSTR(s, params[3]);
|
||||
|
||||
text = (Edje_Part_Description_Text*) rp->custom->description;
|
||||
GETSTREVAS(s, text->text.text);
|
||||
GETSTREVAS(s, text->text.text.str);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1955,7 +1958,7 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params)
|
|||
GETSTR(s, params[3]);
|
||||
|
||||
text = (Edje_Part_Description_Text*) rp->custom->description;
|
||||
GETSTREVAS(s, text->text.font);
|
||||
GETSTREVAS(s, text->text.font.str);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1969,7 +1972,7 @@ _edje_embryo_fn_set_state_val(Embryo_Program *ep, Embryo_Cell *params)
|
|||
GETSTR(s, params[3]);
|
||||
|
||||
text = (Edje_Part_Description_Text*) rp->custom->description;
|
||||
GETSTREVAS(s, text->text.style);
|
||||
GETSTREVAS(s, text->text.style.str);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -2365,7 +2368,7 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params)
|
|||
|
||||
text = (Edje_Part_Description_Text*) rp->custom->description;
|
||||
|
||||
s = text->text.text;
|
||||
s = text->text.text.str;
|
||||
SETSTRALLOCATE(s);
|
||||
|
||||
break;
|
||||
|
@ -2397,7 +2400,7 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params)
|
|||
|
||||
text = (Edje_Part_Description_Text*) rp->custom->description;
|
||||
|
||||
s = text->text.font;
|
||||
s = text->text.font.str;
|
||||
SETSTRALLOCATE(s);
|
||||
|
||||
break;
|
||||
|
@ -2412,7 +2415,7 @@ _edje_embryo_fn_get_state_val(Embryo_Program *ep, Embryo_Cell *params)
|
|||
|
||||
text = (Edje_Part_Description_Text*) rp->custom->description;
|
||||
|
||||
s = text->text.style;
|
||||
s = text->text.style.str;
|
||||
SETSTRALLOCATE(s);
|
||||
|
||||
break;
|
||||
|
|
|
@ -1696,8 +1696,8 @@ _edje_entry_real_part_init(Edje_Real_Part *rp)
|
|||
txt = (Edje_Part_Description_Text *) rp->chosen_description;
|
||||
|
||||
en->select_allow = 0;
|
||||
if (txt && txt->text.repch)
|
||||
evas_object_textblock_replace_char_set(rp->object, txt->text.repch);
|
||||
if (txt && edje_string_get(&txt->text.repch))
|
||||
evas_object_textblock_replace_char_set(rp->object, edje_string_get(&txt->text.repch));
|
||||
else
|
||||
evas_object_textblock_replace_char_set(rp->object, "*");
|
||||
}
|
||||
|
|
|
@ -248,7 +248,7 @@ edje_file_data_get(const char *file, const char *key)
|
|||
edf = _edje_cache_file_coll_open(file, NULL, &error_ret, NULL);
|
||||
if (edf != NULL)
|
||||
{
|
||||
str = eina_hash_find(edf->data, key);
|
||||
str = (char*) edje_string_get(eina_hash_find(edf->data, key));
|
||||
|
||||
if (str) str = strdup(str);
|
||||
|
||||
|
@ -371,17 +371,16 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
|||
}
|
||||
else
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
int errors = 0;
|
||||
unsigned int j;
|
||||
|
||||
/* colorclass stuff */
|
||||
for (j = 0; j < ed->collection->parts_count; ++j)
|
||||
for (i = 0; i < ed->collection->parts_count; ++i)
|
||||
{
|
||||
Edje_Part *ep;
|
||||
unsigned int k;
|
||||
|
||||
ep = ed->collection->parts[j];
|
||||
ep = ed->collection->parts[i];
|
||||
|
||||
if (errors)
|
||||
break;
|
||||
|
@ -852,7 +851,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const char *file, const char *g
|
|||
const char *style;
|
||||
|
||||
text = (Edje_Part_Description_Text *) rp->part->default_desc;
|
||||
style = text->text.style;
|
||||
style = edje_string_get(&text->text.style);
|
||||
if (style)
|
||||
{
|
||||
Eina_List *l;
|
||||
|
@ -903,7 +902,7 @@ static Eina_List *
|
|||
_edje_swallows_collect(Edje *ed)
|
||||
{
|
||||
Eina_List *swallows = NULL;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
if (!ed->file || !ed->table_parts) return NULL;
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
|
@ -940,7 +939,7 @@ _edje_file_del(Edje *ed)
|
|||
if (!((ed->file) && (ed->collection))) return;
|
||||
if (ed->table_parts)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *rp;
|
||||
|
@ -1195,6 +1194,9 @@ _edje_collection_free(Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collec
|
|||
free(ep->other.desc);
|
||||
free(ep->items);
|
||||
}
|
||||
free(ec->parts);
|
||||
ec->parts = NULL;
|
||||
|
||||
if (ec->data) eina_hash_free(ec->data);
|
||||
#ifdef EDJE_PROGRAM_CACHE
|
||||
if (ec->prog_cache.no_matches) eina_hash_free(ec->prog_cache.no_matches);
|
||||
|
@ -1265,10 +1267,10 @@ _edje_collection_free_part_description_clean(int type, Edje_Part_Description_Com
|
|||
|
||||
text = (Edje_Part_Description_Text *) desc;
|
||||
|
||||
if (text->text.text) eina_stringshare_del(text->text.text);
|
||||
if (text->text.text.str) eina_stringshare_del(text->text.text.str);
|
||||
if (text->text.text_class) eina_stringshare_del(text->text.text_class);
|
||||
if (text->text.style) eina_stringshare_del(text->text.style);
|
||||
if (text->text.font) eina_stringshare_del(text->text.font);
|
||||
if (text->text.style.str) eina_stringshare_del(text->text.style.str);
|
||||
if (text->text.font.str) eina_stringshare_del(text->text.font.str);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ EAPI void
|
|||
edje_object_message_send(Evas_Object *obj, Edje_Message_Type type, int id, void *msg)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
|
@ -207,7 +207,7 @@ _edje_message_shutdown(void)
|
|||
void
|
||||
_edje_message_cb_set(Edje *ed, void (*func) (void *data, Evas_Object *obj, Edje_Message_Type type, int id, void *msg), void *data)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed->message.func = func;
|
||||
ed->message.data = data;
|
||||
|
|
|
@ -200,6 +200,12 @@ struct _Edje_Aspect
|
|||
Edje_Aspect_Control mode;
|
||||
};
|
||||
|
||||
struct _Edje_String
|
||||
{
|
||||
char *str;
|
||||
unsigned int id;
|
||||
};
|
||||
|
||||
typedef struct _Edje_Position_Scale Edje_Alignment;
|
||||
typedef struct _Edje_Position_Scale Edje_Position_Scale;
|
||||
typedef struct _Edje_Position Edje_Position;
|
||||
|
@ -208,6 +214,7 @@ typedef struct _Edje_Rectangle Edje_Rectangle;
|
|||
typedef struct _Edje_Color Edje_Color;
|
||||
typedef struct _Edje_Aspect_Prefer Edje_Aspect_Prefer;
|
||||
typedef struct _Edje_Aspect Edje_Aspect;
|
||||
typedef struct _Edje_String Edje_String;
|
||||
|
||||
typedef struct _Edje_File Edje_File;
|
||||
typedef struct _Edje_Style Edje_Style;
|
||||
|
@ -757,11 +764,11 @@ struct _Edje_Part_Description_Spec_Image
|
|||
|
||||
struct _Edje_Part_Description_Spec_Text
|
||||
{
|
||||
char *text; /* if "" or NULL, then leave text unchanged */
|
||||
Edje_String text; /* if "" or NULL, then leave text unchanged */
|
||||
char *text_class; /* how to apply/modify the font */
|
||||
char *style; /* the text style if a textblock */
|
||||
char *font; /* if a specific font is asked for */
|
||||
char *repch; /* replacement char for password mode entry */
|
||||
Edje_String style; /* the text style if a textblock */
|
||||
Edje_String font; /* if a specific font is asked for */
|
||||
Edje_String repch; /* replacement char for password mode entry */
|
||||
|
||||
Edje_Alignment align; /* text alignment within bounds */
|
||||
Edje_Color color3;
|
||||
|
@ -918,8 +925,8 @@ struct _Edje
|
|||
Eina_List *text_insert_filter_callbacks;
|
||||
void *script_only_data;
|
||||
int table_programs_size;
|
||||
int table_parts_size;
|
||||
|
||||
unsigned int table_parts_size;
|
||||
|
||||
Edje_Perspective *persp;
|
||||
|
||||
struct {
|
||||
|
@ -1759,7 +1766,9 @@ void _edje_lua2_script_func_move(Edje *ed);
|
|||
void _edje_lua2_script_func_resize(Edje *ed);
|
||||
void _edje_lua2_script_func_message(Edje *ed, Edje_Message *em);
|
||||
void _edje_lua2_script_func_signal(Edje *ed, const char *sig, const char *src);
|
||||
|
||||
#endif
|
||||
|
||||
const char *edje_string_get(const Edje_String *es);
|
||||
const char *edje_string_id_get(const Edje_String *es);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -282,7 +282,7 @@ edje_object_play_set(Evas_Object *obj, Eina_Bool play)
|
|||
double t;
|
||||
Eina_List *l;
|
||||
Edje_Running_Program *runp;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
|
@ -356,7 +356,7 @@ edje_object_animation_set(Evas_Object *obj, Eina_Bool on)
|
|||
{
|
||||
Edje *ed;
|
||||
Eina_List *l;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
|
@ -912,7 +912,7 @@ _edje_program_run(Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig,
|
|||
focused = evas_focus_get(evas_object_evas_get(ed->obj));
|
||||
if (focused)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
/* Check if the current swallowed object is one of my child. */
|
||||
for (i = 0; i < ed->table_parts_size; ++i)
|
||||
|
@ -1026,7 +1026,7 @@ _edje_emit(Edje *ed, const char *sig, const char *src)
|
|||
if (part)
|
||||
{
|
||||
char *newsig;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
memcpy(part, sig, length);
|
||||
|
||||
|
|
|
@ -147,7 +147,6 @@ static void
|
|||
_edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
|
||||
ed = evas_object_smart_data_get(obj);
|
||||
if (!ed) return;
|
||||
|
@ -174,6 +173,8 @@ _edje_smart_move(Evas_Object * obj, Evas_Coord x, Evas_Coord y)
|
|||
}
|
||||
else
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
Edje_Real_Part *ep;
|
||||
|
|
|
@ -280,7 +280,7 @@ _edje_text_class_font_get(Edje *ed, Edje_Part_Description_Text *chosen_desc, int
|
|||
Edje_Text_Class *tc;
|
||||
const char *text_class_name, *font;
|
||||
|
||||
font = chosen_desc->text.font;
|
||||
font = edje_string_get(&chosen_desc->text.font);
|
||||
*size = chosen_desc->text.size;
|
||||
|
||||
text_class_name = chosen_desc->text.text_class;
|
||||
|
@ -291,7 +291,7 @@ _edje_text_class_font_get(Edje *ed, Edje_Part_Description_Text *chosen_desc, int
|
|||
if (!tc)
|
||||
return font;
|
||||
|
||||
font = _edje_text_font_get(chosen_desc->text.font, tc->font, free_later);
|
||||
font = _edje_text_font_get(edje_string_get(&chosen_desc->text.font), tc->font, free_later);
|
||||
*size = _edje_text_size_calc(*size, tc);
|
||||
|
||||
return font;
|
||||
|
@ -314,7 +314,7 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
|
||||
sc = ed->scale;
|
||||
if (sc == 0.0) sc = _edje_scale;
|
||||
text = chosen_desc->text.text;
|
||||
text = edje_string_get(&chosen_desc->text.text);
|
||||
font = _edje_text_class_font_get(ed, chosen_desc, &size, &sfont);
|
||||
|
||||
if (ep->text.text) text = (char *) ep->text.text;
|
||||
|
@ -323,12 +323,12 @@ _edje_text_recalc_apply(Edje *ed, Edje_Real_Part *ep,
|
|||
|
||||
if (ep->text.text_source)
|
||||
{
|
||||
text = ((Edje_Part_Description_Text *)ep->text.text_source->chosen_description)->text.text;
|
||||
text = edje_string_get(&(((Edje_Part_Description_Text *)ep->text.text_source->chosen_description)->text.text));
|
||||
if (ep->text.text_source->text.text) text = ep->text.text_source->text.text;
|
||||
}
|
||||
if (ep->text.source)
|
||||
{
|
||||
font = ((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.font;
|
||||
font = edje_string_get(&(((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.font));
|
||||
size = ((Edje_Part_Description_Text *)ep->text.source->chosen_description)->text.size;
|
||||
if (ep->text.source->text.font) font = ep->text.source->text.font;
|
||||
if (ep->text.source->text.size > 0) size = ep->text.source->text.size;
|
||||
|
|
|
@ -75,7 +75,7 @@ edje_freeze(void)
|
|||
static void
|
||||
_edje_thaw_edje(Edje *ed)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < ed->table_parts_size; i++)
|
||||
{
|
||||
|
@ -297,7 +297,7 @@ edje_object_data_get(const Evas_Object *obj, const char *key)
|
|||
return NULL;
|
||||
if (!ed->collection) return NULL;
|
||||
if (!ed->collection->data) return NULL;
|
||||
return eina_hash_find(ed->collection->data, key);
|
||||
return edje_string_get(eina_hash_find(ed->collection->data, key));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -314,7 +314,7 @@ EAPI int
|
|||
edje_object_freeze(Evas_Object *obj)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return 0;
|
||||
|
@ -341,7 +341,7 @@ EAPI int
|
|||
edje_object_thaw(Evas_Object *obj)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return 0;
|
||||
|
@ -642,7 +642,7 @@ edje_object_color_class_set(Evas_Object *obj, const char *color_class, int r, in
|
|||
Edje *ed;
|
||||
Eina_List *l;
|
||||
Edje_Color_Class *cc;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!color_class)) return EINA_FALSE;
|
||||
|
@ -810,7 +810,7 @@ edje_object_color_class_del(Evas_Object *obj, const char *color_class)
|
|||
Edje *ed;
|
||||
Eina_List *l;
|
||||
Edje_Color_Class *cc = NULL;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
if (!color_class) return;
|
||||
|
||||
|
@ -1007,7 +1007,7 @@ edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char
|
|||
Edje *ed;
|
||||
Eina_List *l;
|
||||
Edje_Text_Class *tc;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if ((!ed) || (!text_class)) return EINA_FALSE;
|
||||
|
@ -1221,7 +1221,7 @@ EAPI void
|
|||
edje_object_text_change_cb_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, const char *part), void *data)
|
||||
{
|
||||
Edje *ed;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return;
|
||||
|
@ -2733,7 +2733,7 @@ edje_object_parts_extends_calc(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, E
|
|||
Edje *ed;
|
||||
Evas_Coord x1 = INT_MAX, y1 = INT_MAX;
|
||||
Evas_Coord x2 = 0, y2 = 0;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed)
|
||||
|
@ -2821,7 +2821,7 @@ edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Co
|
|||
ok = 1;
|
||||
while (ok)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ok = 0;
|
||||
ed->dirty = 1;
|
||||
|
@ -4101,7 +4101,7 @@ edje_object_preload(Evas_Object *obj, Eina_Bool cancel)
|
|||
{
|
||||
Edje *ed;
|
||||
int count;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
ed = _edje_fetch(obj);
|
||||
if (!ed) return EINA_FALSE;
|
||||
|
@ -4352,7 +4352,7 @@ _edje_real_part_recursive_get_helper(Edje *ed, char **path)
|
|||
Edje_Real_Part *
|
||||
_edje_real_part_get(Edje *ed, const char *part)
|
||||
{
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
if (!part) return NULL;
|
||||
|
||||
|
@ -4935,3 +4935,19 @@ edje_program_is_strrncmp(const char *str)
|
|||
return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
const char *
|
||||
edje_string_get(const Edje_String *es)
|
||||
{
|
||||
/* FIXME: Handle localization here */
|
||||
if (!es) return NULL;
|
||||
return es->str;
|
||||
}
|
||||
|
||||
const char *
|
||||
edje_string_id_get(const Edje_String *es)
|
||||
{
|
||||
/* FIXME: Handle localization here */
|
||||
if (!es) return NULL;
|
||||
return es->str;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue