edje_load.c File Reference

Data Structures

struct  _Edje_Drag_Items
 
struct  _Edje_Table_Items
 

Macros

#define EDJE_DUMP_PROGRAM(Section)
 
#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)
 

Typedefs

typedef struct _Edje_Drag_Items Edje_Drag_Items
 
typedef struct _Edje_Table_Items Edje_Table_Items
 

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. More...
 
EAPI void edje_file_collection_list_free (Eina_List *lst)
 Free file collection list. More...
 
EAPI char * edje_file_data_get (const char *file, const char *key)
 Get data from the file level data block of an edje file. More...
 
EAPI Eina_Bool edje_file_group_exists (const char *file, const char *glob)
 Determine whether a group matching glob exists in an edje file. More...
 
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. More...
 
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. More...
 
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. More...
 
EAPI Edje_Load_Error edje_object_load_error_get (const Evas_Object *obj)
 Gets the (last) file loading error for a given Edje object. More...
 

Macro Definition Documentation

#define EDJE_DUMP_PROGRAM (   Section)
Value:
for (i = 0; i < ed->collection->programs.Section##_count; i++) \
INF(#Section" for ('%s', '%s')", ed->collection->programs.Section[i]->signal, ed->collection->programs.Section[i]->source);

Referenced by _edje_programs_patterns_init().

#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)
Value:
if (Hash) eina_hash_free(Hash); \
Hash = NULL;

Referenced by _edje_file_free().

Typedef Documentation

Function Documentation

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_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_subobj_unregister(), _edje_text_part_on_del(), _edje_textblock_styles_del(), _edje_unref(), _edje_user_definition_free(), _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::groups, _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, _Edje_Part::type, and _Edje::user_defined.

Referenced by _edje_del(), and _edje_object_file_set_internal().

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_user_definition_remove(), _edje_var_init(), _Edje_Real_Part::anim, _Edje::base, _Edje::block_break, _Edje_User_Defined::box, _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_User_Defined::drag_position, _Edje_User_Defined::drag_size, _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_mirrored_get(), edje_object_part_box_append(), edje_object_part_drag_page_set(), edje_object_part_drag_size_set(), edje_object_part_drag_step_set(), edje_object_part_drag_value_set(), edje_object_part_swallow(), edje_object_part_table_pack(), edje_object_part_text_set(), edje_object_propagate_callback_add(), edje_object_signal_emit(), 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_SPACER, EDJE_PART_TYPE_SWALLOW, EDJE_PART_TYPE_TABLE, EDJE_PART_TYPE_TEXT, EDJE_PART_TYPE_TEXTBLOCK, edje_string_get(), EDJE_USER_BOX_PACK, EDJE_USER_DRAG_PAGE, EDJE_USER_DRAG_SIZE, EDJE_USER_DRAG_STEP, EDJE_USER_DRAG_VALUE, EDJE_USER_STRING, EDJE_USER_SWALLOW, EDJE_USER_TABLE_PACK, _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_Part_Description_External::external_params, _Edje_Real_Part_State::external_params, _Edje_File::feature_ver, _Edje::file, _Edje_Part_Collection::fnmatch_count, FROM_DOUBLE, FROM_INT, _Edje::group, _Edje::groups, _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_Part::items, _Edje_Real_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_File::mtime, _Edje_Style::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_User_Defined::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::recalc_call, _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_User_Defined::string, _Edje_Part_Collection::strncmp_count, _Edje_Part_Collection::strrncmp_count, _Edje_Style::style, _Edje_Part_Description_Spec_Text::style, _Edje_File::styles, _Edje_User_Defined::swallow, _Edje_Real_Part::swallow_params, _Edje_User_Defined::table, _Edje::table_parts, _Edje::table_parts_size, _Edje::table_programs, _Edje::table_programs_size, _Edje_Part_Description_Text::text, _Edje_Real_Part::text, _Edje_Part::type, _Edje_User_Defined::type, _Edje_User_Defined::u, _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().

EAPI Eina_List* edje_file_collection_list ( const char *  file)

Get a list of groups in an edje file.

Parameters
fileThe 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
lstThe 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
fileThe path to the .edj file
keyThe data key
Returns
The string value of the data. Must be freed by the user when no longer needed.

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
fileThe file path
globA 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
errorthe 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.

edje_object_file_set() is a function which sets an error value, afterwards, which can be fetched with edje_object_load_error_get(). The function in question is meant to be used in conjunction with the latter, for pretty-printing any possible error cause.

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
objA handle to an Edje object
fileA pointer to a variable whero to store the file's path
groupA pointer to a variable where to store the group name in

This gets the EDJ file's path, with the respective group set for the given Edje object. If obj is either not an Edje file, or has not had its file/group set previously, by edje_object_file_set(), then both 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
objA handle to an Edje object
fileThe path to the EDJ file to load from
groupThe name of the group, in file, which implements an Edje object
Returns
EINA_TRUE, on success or EINA_FALSE, on errors (check edje_object_load_error_get() after this call to get errors causes)

Edje expects EDJ files, which are theming objects' descriptions and resources packed together in an EET file, to read Edje object definitions from. They usually are created with the .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()
edje_object_file_get()

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
objA handlet to an Edje object
Returns
The Edje loading error, one of:

This function is meant to be used after an Edje EDJ file loading, what takes place with the edje_object_file_set() function. If that function does not return 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().