src/lib/edje_load.c File Reference
Defines | |
#define | EDJE_LOAD_BUILD_TABLE(Array, Ed, It, Tmp) |
#define | EDJE_LOAD_PROGRAM_FREE(Array, Ec, It, FreeStrings) |
#define | EDJE_LOAD_PROGRAMS_ADD(Array, Ed, It, Git, All) |
#define | FREE_POOL(Type, Ce, Desc) |
#define | HASH_FREE(Hash) |
Functions | |
void | _edje_collection_free (Edje_File *edf, Edje_Part_Collection *ec, Edje_Part_Collection_Directory_Entry *ce) |
void | _edje_collection_free_part_description_clean (int type, Edje_Part_Description_Common *desc, Eina_Bool free_strings) |
void | _edje_collection_free_part_description_free (int type, Edje_Part_Description_Common *desc, Edje_Part_Collection_Directory_Entry *ce, Eina_Bool free_strings) |
void | _edje_file_add (Edje *ed) |
void | _edje_file_del (Edje *ed) |
void | _edje_file_free (Edje_File *edf) |
int | _edje_object_file_set_internal (Evas_Object *obj, const char *file, const char *group, Eina_List *group_path) |
void | _edje_programs_patterns_clean (Edje *ed) |
void | _edje_programs_patterns_init (Edje *ed) |
EAPI Eina_List * | edje_file_collection_list (const char *file) |
Get a list of groups in an edje file. | |
EAPI void | edje_file_collection_list_free (Eina_List *lst) |
Free file collection list. | |
EAPI char * | edje_file_data_get (const char *file, const char *key) |
Get data from the file level data block of an edje file. | |
EAPI Eina_Bool | edje_file_group_exists (const char *file, const char *glob) |
Determine whether a group matching glob exists in an edje file. | |
EAPI const char * | edje_load_error_str (Edje_Load_Error error) |
EAPI void | edje_object_file_get (const Evas_Object *obj, const char **file, const char **group) |
Get the file and group name that obj was loaded from. | |
EAPI Eina_Bool | edje_object_file_set (Evas_Object *obj, const char *file, const char *group) |
Sets the EET file and group to load obj from. | |
EAPI Edje_Load_Error | edje_object_load_error_get (const Evas_Object *obj) |
Gets the Edje load error. |
Define Documentation
#define EDJE_LOAD_BUILD_TABLE | ( | Array, | |||
Ed, | |||||
It, | |||||
Tmp | ) |
for (It = 0; It < Ed->collection->programs.Array##_count; ++It) \
{ \
Tmp = Ed->collection->programs.Array[It]; \
Ed->table_programs[Tmp->id] = Tmp; \
}
Referenced by _edje_object_file_set_internal().
#define EDJE_LOAD_PROGRAM_FREE | ( | Array, | |||
Ec, | |||||
It, | |||||
FreeStrings | ) |
for (It = 0; It < Ec->programs.Array##_count; ++It) \
_edje_program_free(Ec->programs.Array[It], FreeStrings); \
free(Ec->programs.Array);
Referenced by _edje_collection_free().
#define EDJE_LOAD_PROGRAMS_ADD | ( | Array, | |||
Ed, | |||||
It, | |||||
Git, | |||||
All | ) |
for (It = 0; It < Ed->collection->programs.Array##_count; ++It, ++Git) \
All[Git] = Ed->collection->programs.Array[It];
Referenced by _edje_programs_patterns_init().
#define FREE_POOL | ( | Type, | |||
Ce, | |||||
Desc | ) |
case EDJE_PART_TYPE_##Type: eina_mempool_free(Ce->mp.Type, Desc); \ ce->count.Type--; \ break;
Referenced by _edje_collection_free_part_description_free().
#define HASH_FREE | ( | Hash | ) |
if (Hash) eina_hash_free(Hash); \
Hash = NULL;
Referenced by _edje_file_free().
Function Documentation
void _edje_collection_free | ( | Edje_File * | edf, | |
Edje_Part_Collection * | ec, | |||
Edje_Part_Collection_Directory_Entry * | ce | |||
) |
References _edje_collection_free_part_description_clean(), _edje_embryo_script_shutdown(), _edje_lua2_script_unload(), _Edje_Part::default_desc, _Edje_Part_Description_List::desc, _Edje_Part_Description_List::desc_count, EDJE_LOAD_PROGRAM_FREE, _Edje_Part::items, _Edje_Part::name, _Edje_Part::other, and _Edje_Part::type.
Referenced by edje_edit_group_del().
void _edje_collection_free_part_description_clean | ( | int | type, | |
Edje_Part_Description_Common * | desc, | |||
Eina_Bool | free_strings | |||
) |
References _edje_external_params_free(), _Edje_Part_Description_Common::color_class, EDJE_PART_TYPE_EXTERNAL, EDJE_PART_TYPE_IMAGE, EDJE_PART_TYPE_TEXT, EDJE_PART_TYPE_TEXTBLOCK, _Edje_Part_Description_External::external_params, _Edje_Part_Description_Spec_Text::font, _Edje_Part_Description_Image::image, _Edje_String::str, _Edje_Part_Description_Spec_Text::style, _Edje_Part_Description_Spec_Text::text, _Edje_Part_Description_Text::text, _Edje_Part_Description_Spec_Text::text_class, _Edje_Part_Description_Spec_Image::tweens, and _Edje_Part_Description_Spec_Image::tweens_count.
Referenced by _edje_collection_free(), _edje_collection_free_part_description_free(), and _edje_file_del().
void _edje_collection_free_part_description_free | ( | int | type, | |
Edje_Part_Description_Common * | desc, | |||
Edje_Part_Collection_Directory_Entry * | ce, | |||
Eina_Bool | free_strings | |||
) |
References _edje_collection_free_part_description_clean(), and FREE_POOL.
Referenced by edje_edit_part_del(), and edje_edit_state_del().
void _edje_file_add | ( | Edje * | ed | ) |
References _edje_cache_file_coll_open(), _edje_cache_file_unref(), _edje_edd_edje_file, _Edje::collection, _Edje::file, _Edje::group, _Edje::load_error, and _Edje::path.
Referenced by _edje_object_file_set_internal().
void _edje_file_del | ( | Edje * | ed | ) |
References _edje_anim_count, _edje_animators, _edje_block_violate(), _edje_box_layout_free_data(), _edje_cache_coll_unref(), _edje_cache_file_unref(), _edje_callbacks_del(), _edje_callbacks_focus_del(), _edje_collection_free_part_description_clean(), _edje_color_class_on_del(), _edje_entry_real_part_shutdown(), _edje_entry_shutdown(), _edje_external_parsed_params_free(), _edje_freeze_calc_count, _edje_freeze_calc_list, _edje_lua2_script_shutdown(), _edje_message_del(), _edje_programs_patterns_clean(), _edje_real_part_mp, _edje_real_part_state_mp, _edje_real_part_swallow_clear(), _edje_text_part_on_del(), _edje_textblock_styles_del(), _edje_unref(), _edje_var_shutdown(), _Edje::actions, _Edje_Real_Part::anim, _Edje::collection, _Edje_Real_Part::custom, _Edje_Real_Part_State::description, _Edje_Real_Part::drag, _Edje_Real_Part::edje, EDJE_ENTRY_EDIT_MODE_NONE, EDJE_PART_TYPE_EXTERNAL, EDJE_PART_TYPE_GROUP, _Edje_Part::entry_mode, _Edje_Real_Part_State::external_params, _Edje::file, _Edje::focused_part, _Edje_File::free_strings, _Edje::freeze_calc, _Edje_Real_Part::items, _Edje::L, _Edje_Real_Part::object, _Edje_Real_Part::param1, _Edje_Real_Part::param2, _Edje_Real_Part::part, _Edje_Part_Collection::parts, _Edje_Part_Collection::parts_count, _Edje::pending_actions, _Edje_Real_Part_State::set, _Edje_Real_Part::swallowed_object, _Edje::table_parts, _Edje::table_parts_size, _Edje::table_programs, _Edje::table_programs_size, _Edje_Real_Part::text, _Edje_Pending_Program::timer, and _Edje_Part::type.
Referenced by _edje_del(), and _edje_object_file_set_internal().
void _edje_file_free | ( | Edje_File * | edf | ) |
References _edje_cache_coll_flush(), _edje_textblock_style_cleanup(), _Edje_File::collection, _Edje_File::collection_cache, _Edje_File::collection_patterns, _Edje_File::color_classes, _Edje_File::compiler, _Edje_File::data, edje_match_patterns_free(), _Edje_File::ef, _Edje_External_Directory::entries, _Edje_Image_Directory_Set::entries, _Edje_Image_Directory::entries, _Edje_Image_Directory::entries_count, _Edje_Image_Directory_Entry::entry, _Edje_File::external_dir, _Edje_File::fonts, _Edje_File::free_strings, HASH_FREE, _Edje_File::image_dir, _Edje_Color_Class::name, _Edje_File::path, _Edje_Image_Directory::sets, and _Edje_Image_Directory::sets_count.
int _edje_object_file_set_internal | ( | Evas_Object * | obj, | |
const char * | file, | |||
const char * | group, | |||
Eina_List * | group_path | |||
) |
References _edje_block(), _edje_block_break(), _edje_box_layout_anim_new(), _edje_callbacks_add(), _edje_callbacks_focus_add(), _edje_color_class_member_add(), _edje_dragable_pos_set(), _edje_emit(), _edje_entry_init(), _edje_entry_real_part_init(), _edje_external_params_parse(), _edje_external_recalc_apply(), _edje_external_type_add(), _edje_fetch(), _edje_file_add(), _edje_file_del(), _edje_freeze(), _edje_lua_script_only(), _edje_lua_script_only_init(), _edje_lua_script_only_shutdown(), _edje_object_file_set_internal(), _edje_programs_patterns_init(), _edje_real_part_box_append(), _edje_real_part_mp, _edje_real_part_swallow(), _edje_real_part_table_pack(), _edje_recalc(), _edje_ref(), _edje_script_only(), _edje_script_only_init(), _edje_script_only_shutdown(), _edje_text_part_on_add(), _edje_textblock_style_all_update(), _edje_textblock_styles_add(), _edje_thaw(), _edje_unblock(), _edje_unref(), _edje_var_init(), _Edje_Real_Part::anim, _Edje_Real_Part::chosen_description, _Edje_Real_Part::clip_to, _Edje_Part::clip_to_id, _Edje::clipper, _Edje_Pack_Element::col, _Edje::collection, _Edje_Part_Description_Common::color_class, _Edje_Pack_Element::colspan, _Edje_Part_Dragable::confine_id, _Edje_Real_Part_Drag::confine_to, _Edje_Part::default_desc, _Edje_Part_Description_List::desc, _Edje_Part_Description_List::desc_count, _Edje_Real_Part_State::description, _Edje::dirty, _Edje_Real_Part::drag, _Edje_Part::dragable, _Edje_Real_Part::edje, EDJE_ENTRY_EDIT_MODE_NONE, EDJE_LOAD_BUILD_TABLE, EDJE_LOAD_ERROR_NONE, EDJE_LOAD_ERROR_RECURSIVE_REFERENCE, EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED, edje_module_load(), edje_object_add(), edje_object_load_error_get(), edje_object_part_swallow(), edje_object_signal_callback_add(), EDJE_PART_TYPE_BOX, EDJE_PART_TYPE_EXTERNAL, EDJE_PART_TYPE_GRADIENT, EDJE_PART_TYPE_GROUP, EDJE_PART_TYPE_IMAGE, EDJE_PART_TYPE_RECTANGLE, EDJE_PART_TYPE_SWALLOW, EDJE_PART_TYPE_TABLE, EDJE_PART_TYPE_TEXT, EDJE_PART_TYPE_TEXTBLOCK, edje_string_get(), _Edje_External_Directory::entries, _Edje_External_Directory::entries_count, _Edje_External_Directory_Entry::entry, _Edje_Part::entry_mode, ERR, _Edje::evas, _Edje_Part_Dragable::event_id, _Edje_Real_Part::events_to, _Edje_File::external_dir, _Edje_Real_Part_State::external_params, _Edje_Part_Description_External::external_params, _Edje_File::feature_ver, _Edje::file, _Edje_Part_Collection::fnmatch_count, FROM_DOUBLE, FROM_INT, _Edje::group, _Edje_Size::h, _Edje::has_entries, _Edje_Part_Description_Spec_Text::id_source, _Edje_Part_Description_Spec_Text::id_text_source, _Edje_Part_Description_Common::id_x, _Edje_Part_Description_Common::id_y, _Edje_Real_Part::items, _Edje_Part::items, _Edje_Part::items_count, _Edje::load_error, _Edje_Part_Collection::lua_script_only, _Edje_Real_Part::max, _Edje_Real_Part::min, _Edje_Part::mouse_events, _Edje_Style::name, name, _Edje_Pack_Element::name, _Edje_Part::name, _Edje_Part_Collection::nocmp_count, _Edje::obj, _Edje_Real_Part::object, _Edje_Part::other, _Edje_Real_Part::param1, _Edje::parent, _Edje_Real_Part::part, _Edje_Part_Collection::parts, _Edje_Part_Collection::parts_count, _Edje::path, _Edje_Part::pointer_mode, _Edje_Part::precise_is_inside, _Edje_Part_Collection::programs, _Edje_Part_Description_Common::rel1, _Edje_Real_Part_State::rel1_to_x, _Edje_Real_Part_State::rel1_to_y, _Edje_Part_Description_Common::rel2, _Edje_Real_Part_State::rel2_to_x, _Edje_Real_Part_State::rel2_to_y, _Edje_Part::repeat_events, _Edje_Pack_Element::row, _Edje_Pack_Element::rowspan, _Edje_Part_Collection::script_only, _Edje_Pack_Element::source, _Edje_Part::source, _Edje_Real_Part_Drag::step, _Edje_Part_Dragable::step_x, _Edje_Part_Dragable::step_y, _Edje_Part_Collection::strcmp_count, _Edje_Part_Collection::strncmp_count, _Edje_Part_Collection::strrncmp_count, _Edje_Style::style, _Edje_Part_Description_Spec_Text::style, _Edje_File::styles, _Edje_Real_Part::swallow_params, _Edje::table_parts, _Edje::table_parts_size, _Edje::table_programs, _Edje::table_programs_size, _Edje_Real_Part::text, _Edje_Part_Description_Text::text, _Edje_Part::type, _Edje_Real_Part_Drag::val, _Edje_Size::w, _Edje_Position_Scale::x, _Edje_Part_Dragable::x, _Edje_Position_Scale::y, and _Edje_Part_Dragable::y.
Referenced by _edje_object_file_set_internal().
void _edje_programs_patterns_clean | ( | Edje * | ed | ) |
References _edje_signals_sources_patterns_clean(), edje_match_signal_source_free(), _Edje_Signals_Sources_Patterns::exact_match, _Edje::patterns, _Edje_Signals_Sources_Patterns::programs, _Edje::programs, and _Edje_Signals_Sources_Patterns::u.
Referenced by _edje_file_del(), edje_edit_program_add(), edje_edit_program_signal_set(), and edje_edit_program_source_set().
void _edje_programs_patterns_init | ( | Edje * | ed | ) |
References _Edje::collection, EDJE_LOAD_PROGRAMS_ADD, edje_match_program_hash_build(), edje_match_programs_signal_init(), edje_match_programs_source_init(), _Edje_Signals_Sources_Patterns::exact_match, _Edje_Part_Collection::fnmatch_count, _Edje_Part_Collection::nocmp_count, _Edje::patterns, _Edje_Signals_Sources_Patterns::programs, _Edje_Part_Collection::programs, _Edje::programs, _Edje_Signals_Sources_Patterns::signals_patterns, _Edje_Signals_Sources_Patterns::sources_patterns, _Edje_Part_Collection::strcmp, _Edje_Part_Collection::strcmp_count, _Edje_Part_Collection::strncmp_count, _Edje_Part_Collection::strrncmp_count, and _Edje_Signals_Sources_Patterns::u.
Referenced by _edje_object_file_set_internal(), edje_edit_program_add(), edje_edit_program_signal_set(), and edje_edit_program_source_set().
EAPI Eina_List* edje_file_collection_list | ( | const char * | file | ) |
Get a list of groups in an edje file.
- Parameters:
-
file The path to the edje file
- Returns:
- The Eina_List of group names (char *)
Note: the list must be freed using edje_file_collection_list_free() when you are done with it.
References _edje_cache_file_coll_open(), _edje_cache_file_unref(), and _Edje_File::collection.
EAPI void edje_file_collection_list_free | ( | Eina_List * | lst | ) |
Free file collection list.
- Parameters:
-
lst The Eina_List of groups
Frees the list returned by edje_file_collection_list().
EAPI char* edje_file_data_get | ( | const char * | file, | |
const char * | key | |||
) |
Get data from the file level data block of an edje file.
- Parameters:
-
file The path to the .edj file key The data key
- Returns:
- The string value of the data
If an edje file is built from the following edc:
data { item: "key1" "value1"; item: "key2" "value2"; } collections { ... }
Then, edje_file_data_get("key1") will return "value1"
References _edje_cache_file_coll_open(), _edje_cache_file_unref(), _Edje_File::data, and edje_string_get().
EAPI Eina_Bool edje_file_group_exists | ( | const char * | file, | |
const char * | glob | |||
) |
Determine whether a group matching glob exists in an edje file.
- Parameters:
-
file The file path glob A glob to match on
- Returns:
- 1 if a match is found, 0 otherwise
References _edje_cache_file_coll_open(), _edje_cache_file_unref(), _Edje_File::collection, _Edje_File::collection_patterns, edje_match_collection_dir_exec(), edje_match_collection_dir_init(), and edje_match_patterns_free().
EAPI const char* edje_load_error_str | ( | Edje_Load_Error | error | ) |
References EDJE_LOAD_ERROR_CORRUPT_FILE, EDJE_LOAD_ERROR_DOES_NOT_EXIST, EDJE_LOAD_ERROR_GENERIC, EDJE_LOAD_ERROR_INCOMPATIBLE_FILE, EDJE_LOAD_ERROR_NONE, EDJE_LOAD_ERROR_PERMISSION_DENIED, EDJE_LOAD_ERROR_RECURSIVE_REFERENCE, EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED, EDJE_LOAD_ERROR_UNKNOWN_COLLECTION, and EDJE_LOAD_ERROR_UNKNOWN_FORMAT.
EAPI void edje_object_file_get | ( | const Evas_Object * | obj, | |
const char ** | file, | |||
const char ** | group | |||
) |
Get the file and group name that obj was loaded from.
- Parameters:
-
obj A valid Evas_Object handle file A pointer to store a pointer to the filename in group A pointer to store a pointer to the group name in
This gets the EET file location and group for the given Evas_Object. If obj is either not an edje file, or has not had its file/group set using edje_object_file_set(), then both file and group will be set to NULL.
It is valid to pass in NULL for either file or group if you are not interested in one of the values.
References _edje_fetch(), _Edje::group, and _Edje::path.
EAPI Eina_Bool edje_object_file_set | ( | Evas_Object * | obj, | |
const char * | file, | |||
const char * | group | |||
) |
Sets the EET file and group to load obj from.
- Parameters:
-
obj A valid Evas_Object handle file The path to the EET file group The group name in the Edje
- Returns:
- 0 on Error
1 on Success and sets EDJE_LOAD_ERROR_NONE
Edje uses EET files, conventionally ending in .edj, to store object descriptions. A single file contains multiple named groups. This function specifies the file and group name to load obj from.
References _edje_fetch(), _Edje::api, and _Edje_Smart_Api::file_set.
Referenced by _edje_entry_real_part_init(), and edje_edit_part_source_set().
EAPI Edje_Load_Error edje_object_load_error_get | ( | const Evas_Object * | obj | ) |
Gets the Edje load error.
- Parameters:
-
obj A valid Evas_Object handle
- Returns:
- The Edje load error:
EDJE_LOAD_ERROR_NONE: No Error
EDJE_LOAD_ERROR_GENERIC: Generic Error
EDJE_LOAD_ERROR_DOES_NOT_EXIST: Does not Exist
EDJE_LOAD_ERROR_PERMISSION_DENIED: Permission Denied
EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED: Resource Allocation Failed
EDJE_LOAD_ERROR_CORRUPT_FILE: Corrupt File
EDJE_LOAD_ERROR_UNKNOWN_FORMAT: Unknown Format
EDJE_LOAD_ERROR_INCOMPATIBLE_FILE: Incompatible File
EDJE_LOAD_ERROR_UNKNOWN_COLLECTION: Unknown Collection
EDJE_LOAD_ERROR_RECURSIVE_REFERENCE: Recursive Reference
References _edje_fetch(), EDJE_LOAD_ERROR_NONE, and _Edje::load_error.
Referenced by _edje_object_file_set_internal().