Functions to deals with EDJ files. More...
Typedefs | |
typedef enum _Edje_Load_Error | Edje_Load_Error |
Edje file loading error codes one can get - see edje_load_error_str() too. More... | |
Enumerations | |
enum | _Edje_Load_Error { EDJE_LOAD_ERROR_NONE = 0, EDJE_LOAD_ERROR_GENERIC = 1, EDJE_LOAD_ERROR_DOES_NOT_EXIST = 2, EDJE_LOAD_ERROR_PERMISSION_DENIED = 3, EDJE_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED = 4, EDJE_LOAD_ERROR_CORRUPT_FILE = 5, EDJE_LOAD_ERROR_UNKNOWN_FORMAT = 6, EDJE_LOAD_ERROR_INCOMPATIBLE_FILE = 7, EDJE_LOAD_ERROR_UNKNOWN_COLLECTION = 8, EDJE_LOAD_ERROR_RECURSIVE_REFERENCE = 9 } |
Functions | |
Eina_List * | edje_mmap_collection_list (Eina_File *f) |
Get a list of groups in an edje mapped file. More... | |
void | edje_mmap_collection_list_free (Eina_List *lst) |
Free file collection list. More... | |
Eina_Bool | edje_mmap_group_exists (Eina_File *f, const char *glob) |
Determine whether a group matching glob exists in an edje mapped file. More... | |
Eina_List * | edje_file_collection_list (const char *file) |
Get a list of groups in an edje file. More... | |
void | edje_file_collection_list_free (Eina_List *lst) |
Free file collection list. More... | |
Eina_Bool | edje_file_group_exists (const char *file, const char *glob) |
Determine whether a group matching glob exists in an edje file. More... | |
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... | |
#define | edje_obj_data_get(key, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_DATA_GET), EO_TYPECHECK(const char *, key), EO_TYPECHECK(const char **, ret) |
Retrieve an EDC data field's value from a given Edje. More... | |
#define | edje_obj_file_set(file, group, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_SET), EO_TYPECHECK(const char*, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret) |
#define | edje_obj_mmap_set(file, group, ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_MMAP_SET), EO_TYPECHECK(const Eina_File*, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret) |
#define | edje_obj_file_get(file, group) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(const char **, group) |
Get the file and group name that a given Edje object is bound to. More... | |
#define | edje_obj_load_error_get(ret) EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_LOAD_ERROR_GET), EO_TYPECHECK(Edje_Load_Error *, ret) |
Gets the (last) file loading error for a given Edje object. More... | |
const char * | edje_object_data_get (const Evas_Object *obj, const char *key) |
Retrive an EDC data field's value from a given Edje object's group. More... | |
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... | |
Eina_Bool | edje_object_mmap_set (Evas_Object *obj, const Eina_File *file, const char *group) |
Sets the EDJ file (and group within it) to load an Edje object's contents from. More... | |
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... | |
Edje_Load_Error | edje_object_load_error_get (const Evas_Object *obj) |
Gets the (last) file loading error for a given Edje object. More... | |
Functions to deals with EDJ files.
Layouts in Edje are usually called themes and they are created using the EDC language. The EDC language is declarative and must be compiled before being used. The output of this compilation is an EDJ file, this file can be loaded by Edje, and the result is a edje object.
This groups of functions interact with these EDJ files, either by loading them or retrieving information of the EDC file about objects.
#define edje_obj_data_get | ( | key, | |
ret | |||
) | EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_DATA_GET), EO_TYPECHECK(const char *, key), EO_TYPECHECK(const char **, ret) |
Retrieve an EDC data field's value from a given Edje.
[in] | key | |
[out] | ret |
Referenced by edje_object_data_get().
#define edje_obj_file_set | ( | file, | |
group, | |||
ret | |||
) | EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_SET), EO_TYPECHECK(const char*, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret) |
[in] | file | in |
[in] | group | in |
[out] | ret | out |
Referenced by edje_object_file_set().
#define edje_obj_mmap_set | ( | file, | |
group, | |||
ret | |||
) | EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_MMAP_SET), EO_TYPECHECK(const Eina_File*, file), EO_TYPECHECK(const char *, group), EO_TYPECHECK(Eina_Bool *, ret) |
[in] | file | in |
[in] | group | in |
[out] | ret | out |
Referenced by edje_object_mmap_set().
#define edje_obj_file_get | ( | file, | |
group | |||
) | EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_FILE_GET), EO_TYPECHECK(const char **, file), EO_TYPECHECK(const char **, group) |
Get the file and group name that a given Edje object is bound to.
[out] | file | |
[out] | group |
Referenced by edje_object_file_get().
#define edje_obj_load_error_get | ( | ret | ) | EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_LOAD_ERROR_GET), EO_TYPECHECK(Edje_Load_Error *, ret) |
Gets the (last) file loading error for a given Edje object.
[out] | ret |
Referenced by edje_object_load_error_get().
typedef enum _Edje_Load_Error Edje_Load_Error |
Edje file loading error codes one can get - see edje_load_error_str() too.
enum _Edje_Load_Error |
Get a list of groups in an edje mapped file.
f | The mapped file |
Note: the list must be freed using edje_mmap_collection_list_free() when you are done with it.
References EAPI, eina_hash_iterator_key_new(), EINA_ITERATOR_FOREACH, eina_iterator_free(), eina_list_append(), and eina_stringshare_add().
Referenced by edje_file_collection_list().
void edje_mmap_collection_list_free | ( | Eina_List * | lst | ) |
Free file collection list.
lst | The Eina_List of groups |
Frees the list returned by edje_mmap_collection_list().
References EAPI, and edje_file_collection_list_free().
Determine whether a group matching glob exists in an edje mapped file.
f | The mapped file |
glob | A glob to match on |
References EINA_FALSE, eina_hash_find(), eina_hash_iterator_data_new(), EINA_ITERATOR_FOREACH, eina_iterator_free(), eina_list_append(), eina_list_free(), and EINA_TRUE.
Referenced by edje_file_group_exists().
Eina_List* edje_file_collection_list | ( | const char * | file | ) |
Get a list of groups in an edje file.
file | The path to the edje file |
Note: the list must be freed using edje_file_collection_list_free() when you are done with it.
References EAPI, edje_mmap_collection_list(), EINA_FALSE, eina_file_close(), and eina_file_open().
void edje_file_collection_list_free | ( | Eina_List * | lst | ) |
Free file collection list.
lst | The Eina_List of groups |
Frees the list returned by edje_file_collection_list().
References EAPI, eina_list_data_get(), eina_list_remove(), and eina_stringshare_del().
Referenced by edje_mmap_collection_list_free().
Eina_Bool edje_file_group_exists | ( | const char * | file, |
const char * | glob | ||
) |
Determine whether a group matching glob exists in an edje file.
file | The file path |
glob | A glob to match on |
References EAPI, edje_mmap_group_exists(), EINA_FALSE, eina_file_close(), and eina_file_open().
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.
error | the error code, a value in Edje_Load_Error. |
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 EAPI, 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.
const char* edje_object_data_get | ( | const Evas_Object * | obj, |
const char * | key | ||
) |
Retrive an EDC data field's value from a given Edje object's group.
obj | A handle to an Edje object |
key | The data field's key string |
This function fetches an EDC data field's value, which is declared on the objects building EDC file, under its group. EDC data blocks are most commonly used to pass arbitrary parameters from an application's theme to its code.
They look like the following:
EDC data fields always hold strings as values, hence the return type of this function. Check the complete syntax reference for EDC files.
References EAPI, edje_obj_data_get, and eina_hash_find().
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.
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 |
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.
References EAPI, edje_obj_file_set, and EINA_FALSE.
Eina_Bool edje_object_mmap_set | ( | Evas_Object * | obj, |
const Eina_File * | file, | ||
const char * | group | ||
) |
Sets the EDJ file (and group within it) to load an Edje object's contents from.
obj | A handle to an Edje object |
file | The Eina_File pointing to the EDJ file to load from |
group | The name of the group, in file , which implements an Edje object |
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.
References EAPI, edje_obj_mmap_set, and EINA_FALSE.
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.
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 |
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.
NULL
pointers on the file/group components you're not interested in: they'll be ignored by the function. References EAPI, edje_obj_file_get, and EINA_UNUSED.
Edje_Load_Error edje_object_load_error_get | ( | const Evas_Object * | obj | ) |
Gets the (last) file loading error for a given Edje object.
obj | A handlet to an Edje object |
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.
References EAPI, EDJE_LOAD_ERROR_NONE, and edje_obj_load_error_get.