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, const char *parent, 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) |
Converts the given Edje file load error code into a string describing it in English. | |
EAPI void | edje_object_file_get (const Evas_Object *obj, const char **file, const char **group) |
Get the file and group name that a given Edje object is bound to. | |
EAPI Eina_Bool | edje_object_file_set (Evas_Object *obj, const char *file, const char *group) |
Sets the EDJ file (and group within it) to load an Edje object's contents from. | |
EAPI Edje_Load_Error | edje_object_load_error_get (const Evas_Object *obj) |
Gets the (last) file loading error for a given Edje object. |
Define Documentation
#define EDJE_LOAD_BUILD_TABLE | ( | Array, | |||
Ed, | |||||
It, | |||||
Tmp | ) |
Value:
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 | ) |
Value:
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 | ) |
Value:
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 | ) |
Value:
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 | ) |
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_Part_Description_List::desc_rtl, 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::obj, _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::subobjs, _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_Sound_Tone::name, _Edje_Sound_Sample::name, _Edje_File::path, _Edje_Sound_Directory::samples, _Edje_Sound_Directory::samples_count, _Edje_Image_Directory::sets, _Edje_Image_Directory::sets_count, _Edje_Sound_Sample::snd_src, _Edje_File::sound_dir, _Edje_Sound_Directory::tones, and _Edje_Sound_Directory::tones_count.
int _edje_object_file_set_internal | ( | Evas_Object * | obj, | |
const char * | file, | |||
const char * | group, | |||
const char * | parent, | |||
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_part_description_find(), _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_subobj_register(), _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::base, _Edje_Real_Part::chosen_description, _Edje_Real_Part::clip_to, _Edje_Part::clip_to_id, _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_propagate_callback_add(), EDJE_ORIENTATION_AUTO, EDJE_ORIENTATION_RTL, EDJE_PART_TYPE_BOX, EDJE_PART_TYPE_EXTERNAL, EDJE_PART_TYPE_GRADIENT, EDJE_PART_TYPE_GROUP, EDJE_PART_TYPE_IMAGE, EDJE_PART_TYPE_PROXY, 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_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::is_rtl, _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_Collection::orientation, _Edje_Part::other, _Edje_Real_Part::param1, _Edje_Pack_Element::parent, _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_Collection::prop, _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 *)
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
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. Must be freed by the user when no longer needed.
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(), edje_match_patterns_free(), and INF.
EAPI const char* edje_load_error_str | ( | Edje_Load_Error | error | ) |
Converts the given Edje file load error code into a string describing it in English.
- Parameters:
-
error the error code, a value in Edje_Load_Error.
- Returns:
- Always returns a valid string. If the given
error
is not supported,"Unknown error"
is returned.
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 a given Edje object is bound to.
- Parameters:
-
obj A handle to an Edje object file A pointer to a variable whero to store the file's path group A pointer to a variable where to store the group name in
file
and group
will be set to NULL
, indicating an error.
- See also:
- edje_object_file_set()
- Note:
- Use
NULL
pointers on the file/group components you're not interested in: they'll be ignored by the function.
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 EDJ file (and group within it) to load an Edje object's contents from.
- Parameters:
-
obj A handle to an Edje object file The path to the EDJ file to load from
group The name of the group, in file
, which implements an Edje object
- Returns:
EINA_TRUE
, on success orEINA_FALSE
, on errors (check edje_object_load_error_get() after this call to get errors causes)
.edj extension. EDJ files, in turn, are assembled from textual object description files, where one describes Edje objects declaratively -- the EDC files (see the syntax for those files).
Those description files were designed so that many Edje object definitions -- also called groups (or collections) -- could be packed together in the same EDJ file, so that a whole application's theme could be packed in one file only. This is the reason for the group
argument.
Use this function after you instantiate a new Edje object, so that you can "give him life", telling where to get its contents from.
- See also:
- edje_object_add()
References _edje_fetch(), _edje_object_orientation_inform(), _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 (last) file loading error for a given Edje object.
- Parameters:
-
obj A handlet to an Edje object
- Returns:
- The Edje loading error, one of:
- EDJE_LOAD_ERROR_NONE
- EDJE_LOAD_ERROR_GENERIC
- EDJE_LOAD_ERROR_DOES_NOT_EXIST
- EDJE_LOAD_ERROR_PERMISSION_DENIED
- EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED
- EDJE_LOAD_ERROR_CORRUPT_FILE
- EDJE_LOAD_ERROR_UNKNOWN_FORMAT
- EDJE_LOAD_ERROR_INCOMPATIBLE_FILE
- EDJE_LOAD_ERROR_UNKNOWN_COLLECTION
- EDJE_LOAD_ERROR_RECURSIVE_REFERENCE
EINA_TRUE
, one should check for the reason of failure with this one.
- See also:
- edje_load_error_str()
References _edje_fetch(), EDJE_LOAD_ERROR_NONE, and _Edje::load_error.
Referenced by _edje_object_file_set_internal().