Tizen Native API
4.0
|
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.
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. | |
Eina_Bool | edje_external_type_unregister (const char *type_name) |
Unregisters a previously registered EXTERNAL type. | |
void | edje_external_type_array_register (const Edje_External_Type_Info *array) |
Registers a batch of types and their information. | |
void | edje_external_type_array_unregister (const Edje_External_Type_Info *array) |
Unregisters a batch of given external type previously registered. | |
unsigned int | edje_external_type_abi_version_get (void) |
Returns the current ABI version for Edje_External_Type structure. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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 . |
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
.
const Eina_Hash_Tuple *tuple; Eina_Iterator *itr; const Eina_List *l, *modules; const char *s; modules = edje_available_modules_get(); EINA_LIST_FOREACH(modules, l, s) { if (!edje_module_load(s)) printf("Error loading edje module: %s\n", s); } itr = edje_external_iterator_get(); EINA_ITERATOR_FOREACH(itr, tuple) { const char *name = tuple->key; const Edje_External_Type *type = tuple->data; if ((!type) || (type->abi_version != edje_external_type_abi_version_get())) { printf("Error: invalid type %p (abi: %d, expected: %d)\n", type, type ? type->abi_version : 0, edje_external_type_abi_version_get()); continue; } printf("%s: %s (%s) label='%s' desc='%s'\n", name, type->module, type->module_name, type->label_get ? type->label_get(type->data) : "", type->description_get ? type->description_get(type->data) : ""); }
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.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. |
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.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 |
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.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.
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.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.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:
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).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() |
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
.
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).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).