Functions to register, unregister EXTERNAL types and develop the plugins. More...
Functions | |
Eina_Bool | edje_external_type_register (const char *type_name, const Edje_External_Type *type_info) |
Registers a type to be used by EXTERNAL parts. More... | |
Eina_Bool | edje_external_type_unregister (const char *type_name) |
Unregisters a previously registered EXTERNAL type. More... | |
void | edje_external_type_array_register (const Edje_External_Type_Info *array) |
Registers a batch of types and their information. More... | |
void | edje_external_type_array_unregister (const Edje_External_Type_Info *array) |
Unregisters a batch of given external type previously registered. More... | |
unsigned int | edje_external_type_abi_version_get (void) |
Returns the current ABI version for Edje_External_Type structure. More... | |
Eina_Iterator * | edje_external_iterator_get (void) |
Edje_External_Param * | edje_external_param_find (const Eina_List *params, const char *key) |
Convenience function to find a specific parameter in a list of them. More... | |
Eina_Bool | edje_external_param_int_get (const Eina_List *params, const char *key, int *ret) |
Gets the value of the given parameter of integer type. More... | |
Eina_Bool | edje_external_param_double_get (const Eina_List *params, const char *key, double *ret) |
Gets the value of the given parameter of double type. More... | |
Eina_Bool | edje_external_param_string_get (const Eina_List *params, const char *key, const char **ret) |
Gets the value of the given parameter of string type. More... | |
Eina_Bool | edje_external_param_bool_get (const Eina_List *params, const char *key, Eina_Bool *ret) |
Gets the value of the given parameter of boolean type. More... | |
Eina_Bool | edje_external_param_choice_get (const Eina_List *params, const char *key, const char **ret) |
Gets the value of the given parameter of choice type. More... | |
const Edje_External_Param_Info * | edje_external_param_info_get (const char *type_name) |
Gets the array of parameters information about a type given its name. More... | |
const Edje_External_Type * | edje_external_type_get (const char *type_name) |
Gets the Edje_External_Type that defines an EXTERNAL type registered with the name type_name . | |
Functions to register, unregister EXTERNAL types and develop the plugins.
This group discusses functions useful for the development of new plugins. These functions deal with the newly EXTERNAL types by registering, unregistering and manipulating them.
Eina_Bool edje_external_type_register | ( | const char * | type_name, |
const Edje_External_Type * | type_info | ||
) |
Registers a type to be used by EXTERNAL parts.
Parts of type EXTERNAL will call user defined functions to create and manipulate the object that's allocated in that part. This is done by expecifying in the source
property of the part the name of the external to use, which must be one registered with this function.
type_name | Name to register and be known by edje's "source:" parameter of "type: EXTERNAL" parts. |
type_info | Meta-information describing how to interact with it. |
EINA_TRUE
on success, EINA_FALSE
on failure (like type already registered).References _Edje_External_Type::abi_version, EDJE_EXTERNAL_TYPE_ABI_VERSION, EINA_FALSE, eina_hash_add(), eina_hash_find(), and ERR.
Eina_Bool edje_external_type_unregister | ( | const char * | type_name | ) |
Unregisters a previously registered EXTERNAL type.
type_name | name to unregister. It should have been registered with edje_external_type_register() before. |
EINA_TRUE
on success, EINA_FALSE
on failure (like type_name did not exist).References EINA_FALSE, and eina_hash_del_by_key().
void edje_external_type_array_register | ( | const Edje_External_Type_Info * | array | ) |
Registers a batch of types and their information.
When several types will be registered it is recommended to use this function instead of several calls to edje_external_type_register(), as it is faster.
name
and info
in the array
must be kept alive during all this period (usually, the entire program lifetime). The most common case would be to keep the array as a static
const
type anyway.array | NULL terminated array with type name and information. Note that type name or information are referenced directly, so they must be kept alive after this function returns! |
EINA_TRUE
on success, EINA_FALSE
on failure (like type already registered).References _Edje_External_Type::abi_version, EDJE_EXTERNAL_TYPE_ABI_VERSION, eina_hash_direct_add(), ERR, _Edje_External_Type_Info::info, and _Edje_External_Type_Info::name.
void edje_external_type_array_unregister | ( | const Edje_External_Type_Info * | array | ) |
Unregisters a batch of given external type previously registered.
array | NULL terminated array, should be the same as the one used to register with edje_external_type_array_register() |
References eina_hash_del(), _Edje_External_Type_Info::info, and _Edje_External_Type_Info::name.
unsigned int edje_external_type_abi_version_get | ( | void | ) |
Returns the current ABI version for Edje_External_Type structure.
Always check this number before accessing Edje_External_Type in your own software. If the number is not the same, your software may access invalid memory and crash, or just get garbage values.
Summary:
References EDJE_EXTERNAL_TYPE_ABI_VERSION.
Eina_Iterator * edje_external_iterator_get | ( | void | ) |
Each item in the iterator is an Eina_Hash_Tuple
which has the type of the external in the key
and Edje_External_Type as data
.
References eina_hash_iterator_tuple_new().
Edje_External_Param * edje_external_param_find | ( | const Eina_List * | params, |
const char * | key | ||
) |
Convenience function to find a specific parameter in a list of them.
params | The list of parameters for the external |
key | The parameter to look for |
References EINA_LIST_FOREACH, and _Edje_External_Param::name.
Referenced by edje_external_param_bool_get(), edje_external_param_choice_get(), edje_external_param_double_get(), edje_external_param_int_get(), and edje_external_param_string_get().
Gets the value of the given parameter of integer type.
Look for the key
parameter in the params
list and return its value in ret
. If the parameter is found and is of type EDJE_EXTERNAL_PARAM_TYPE_INT, its value will be stored in the int pointed by ret
, returning EINA_TRUE. In any other case, the function returns EINA_FALSE.
params | List of parameters where to look |
key | Name of the parameter to fetch |
ret | Int pointer where to store the value, must not be NULL. |
EINA_TRUE
if the parameter was found and is of integer type, EINA_FALSE
otherwise. References edje_external_param_find(), EDJE_EXTERNAL_PARAM_TYPE_INT, EINA_FALSE, EINA_TRUE, _Edje_External_Param::i, and _Edje_External_Param::type.
Eina_Bool edje_external_param_double_get | ( | const Eina_List * | params, |
const char * | key, | ||
double * | ret | ||
) |
Gets the value of the given parameter of double type.
Look for the key
parameter in the params
list and return its value in ret
. If the parameter is found and is of type EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, its value will be stored in the double pointed by ret
, returning EINA_TRUE. In any other case, the function returns EINA_FALSE.
params | List of parameters where to look |
key | Name of the parameter to fetch |
ret | Double pointer where to store the value, must not be NULL. |
EINA_TRUE
if the parameter was found and is of double type, EINA_FALSE
otherwise. References _Edje_External_Param::d, edje_external_param_find(), EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, EINA_FALSE, EINA_TRUE, and _Edje_External_Param::type.
Eina_Bool edje_external_param_string_get | ( | const Eina_List * | params, |
const char * | key, | ||
const char ** | ret | ||
) |
Gets the value of the given parameter of string type.
Look for the key
parameter in the params
list and return its value in ret
. If the parameter is found and is of type EDJE_EXTERNAL_PARAM_TYPE_STRING, its value will be stored in the pointer pointed by ret
, returning EINA_TRUE. In any other case, the function returns EINA_FALSE.
The string stored in ret
must not be freed or modified.
params | List of parameters where to look |
key | Name of the parameter to fetch |
ret | String pointer where to store the value, must not be NULL. |
EINA_TRUE
if the parameter was found and is of string type, EINA_FALSE
otherwise. References edje_external_param_find(), EDJE_EXTERNAL_PARAM_TYPE_STRING, EINA_FALSE, EINA_TRUE, _Edje_External_Param::s, and _Edje_External_Param::type.
Eina_Bool edje_external_param_bool_get | ( | const Eina_List * | params, |
const char * | key, | ||
Eina_Bool * | ret | ||
) |
Gets the value of the given parameter of boolean type.
Look for the key
parameter in the params
list and return its value in ret
. If the parameter is found and is of type EDJE_EXTERNAL_PARAM_TYPE_BOOL, its value will be stored in the Eina_Bool pointed by ret
, returning EINA_TRUE. In any other case, the function returns EINA_FALSE.
params | List of parameters where to look |
key | Name of the parameter to fetch |
ret | Eina_Bool pointer where to store the value, must not be NULL. |
EINA_TRUE
if the parameter was found and is of boolean type, EINA_FALSE
otherwise. References edje_external_param_find(), EDJE_EXTERNAL_PARAM_TYPE_BOOL, EINA_FALSE, EINA_TRUE, _Edje_External_Param::i, and _Edje_External_Param::type.
Eina_Bool edje_external_param_choice_get | ( | const Eina_List * | params, |
const char * | key, | ||
const char ** | ret | ||
) |
Gets the value of the given parameter of choice type.
Look for the key
parameter in the params
list and return its value in ret
. If the parameter is found and is of type EDJE_EXTERNAL_PARAM_TYPE_CHOICE, its value will be stored in the string pointed by ret
, returning EINA_TRUE. In any other case, the function returns EINA_FALSE.
The string stored in ret
must not be freed or modified.
params | List of parameters where to look |
key | Name of the parameter to fetch |
ret | String pointer where to store the value, must not be NULL. |
References edje_external_param_find(), EDJE_EXTERNAL_PARAM_TYPE_CHOICE, EINA_FALSE, EINA_TRUE, _Edje_External_Param::s, and _Edje_External_Param::type.
const Edje_External_Param_Info * edje_external_param_info_get | ( | const char * | type_name | ) |
Gets the array of parameters information about a type given its name.
type_name | Edje external type name |
NULL
if type is unknown or it does not have any parameter information.References eina_hash_find().
Referenced by edje_edit_state_add().