edje_external.c File Reference

Functions

Evas_Object * _edje_external_content_get (const Evas_Object *obj, const char *content)
void _edje_external_init ()
Eina_Bool _edje_external_param_get (const Evas_Object *obj, Edje_Real_Part *rp, Edje_External_Param *param)
Eina_Bool _edje_external_param_set (Evas_Object *obj, Edje_Real_Part *rp, const Edje_External_Param *param)
void _edje_external_params_free (Eina_List *external_params, Eina_Bool free_strings)
void * _edje_external_params_parse (Evas_Object *obj, const Eina_List *params)
void _edje_external_parsed_params_free (Evas_Object *obj, void *params)
void _edje_external_recalc_apply (Edje *ed __UNUSED__, Edje_Real_Part *ep, Edje_Calc_Params *params __UNUSED__, Edje_Part_Description_Common *chosen_desc __UNUSED__)
void _edje_external_shutdown ()
void _edje_external_signal_emit (Evas_Object *obj, const char *emission, const char *source)
Evas_Object * _edje_external_type_add (const char *type_name, Evas *evas, Evas_Object *parent, const Eina_List *params, const char *part_name)
EAPI Eina_Iterator * edje_external_iterator_get (void)
 Returns an interator of all the registered EXTERNAL types.
EAPI Eina_Bool edje_external_param_bool_get (const Eina_List *params, const char *key, Eina_Bool *ret)
 Get the value of the given parameter of boolean type.
EAPI Eina_Bool edje_external_param_choice_get (const Eina_List *params, const char *key, const char **ret)
 Get the value of the given parameter of choice type.
EAPI Eina_Bool edje_external_param_double_get (const Eina_List *params, const char *key, double *ret)
 Get the value of the given parameter of double type.
EAPI Edje_External_Paramedje_external_param_find (const Eina_List *params, const char *key)
 Conevenience function to find a specific parameter in a list of them.
EAPI const
Edje_External_Param_Info
edje_external_param_info_get (const char *type_name)
 Get the array of parameters information about a type given its name.
EAPI Eina_Bool edje_external_param_int_get (const Eina_List *params, const char *key, int *ret)
 Get the value of the given parameter of integer type.
EAPI Eina_Bool edje_external_param_string_get (const Eina_List *params, const char *key, const char **ret)
 Get the value of the given parameter of string type.
EAPI const char * edje_external_param_type_str (Edje_External_Param_Type type)
 Converts type identifier to string nicer representation.
EAPI unsigned int edje_external_type_abi_version_get (void)
 Return the current ABI version for Edje_External_Type structure.
EAPI void edje_external_type_array_register (const Edje_External_Type_Info *array)
 Register a batch of types and their information.
EAPI void edje_external_type_array_unregister (const Edje_External_Type_Info *array)
 Unregister a batch of given external type previously registered.
EAPI const Edje_External_Typeedje_external_type_get (const char *type_name)
 Get the Edje_External_Type that defines an EXTERNAL type registered with the name type_name.
EAPI Eina_Bool edje_external_type_register (const char *type_name, const Edje_External_Type *type_info)
 Register a type to be used by EXTERNAL parts.
EAPI Eina_Bool edje_external_type_unregister (const char *type_name)
 Unregister a previously registered EXTERNAL type.
EAPI Evas_Object * edje_object_part_external_content_get (const Evas_Object *obj, const char *part, const char *content)
 Get an object contained in an part of type EXTERNAL.
EAPI Evas_Object * edje_object_part_external_object_get (const Evas_Object *obj, const char *part)
 Get the object created by this external part.
EAPI Eina_Bool edje_object_part_external_param_get (const Evas_Object *obj, const char *part, Edje_External_Param *param)
 Get the parameter for the external part.
EAPI Eina_Bool edje_object_part_external_param_set (Evas_Object *obj, const char *part, const Edje_External_Param *param)
 Set the parameter for the external part.
EAPI Edje_External_Param_Type edje_object_part_external_param_type_get (const Evas_Object *obj, const char *part, const char *param)
 Facility to query the type of the given parameter of the given part.

Function Documentation

Evas_Object* _edje_external_content_get ( const Evas_Object *  obj,
const char *  content 
)
void _edje_external_init ( )

Referenced by edje_init().

void _edje_external_params_free ( Eina_List *  external_params,
Eina_Bool  free_strings 
)
void* _edje_external_params_parse ( Evas_Object *  obj,
const Eina_List *  params 
)
void _edje_external_parsed_params_free ( Evas_Object *  obj,
void *  params 
)
void _edje_external_shutdown ( )

Referenced by edje_init().

void _edje_external_signal_emit ( Evas_Object *  obj,
const char *  emission,
const char *  source 
)
Evas_Object* _edje_external_type_add ( const char *  type_name,
Evas *  evas,
Evas_Object *  parent,
const Eina_List *  params,
const char *  part_name 
)
EAPI Eina_Iterator* edje_external_iterator_get ( void  )

Returns an interator of all the registered EXTERNAL types.

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;
EINA_LIST_FOREACH(modules, l, s)
{
printf("Error loading edje module: %s\n", s);
}
EINA_ITERATOR_FOREACH(itr, tuple)
{
const char *name = tuple->key;
const Edje_External_Type *type = tuple->data;
if ((!type) ||
{
printf("Error: invalid type %p (abi: %d, expected: %d)\n",
type, type ? type->abi_version : 0,
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) : "");
}
EAPI Eina_Bool edje_external_param_bool_get ( const Eina_List *  params,
const char *  key,
Eina_Bool *  ret 
)

Get 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.

Parameters
paramsList of parameters where to look
keyName of the parameter to fetch
retEina_Bool pointer where to store the value, must not be NULL.
Returns
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, _Edje_External_Param::i, and _Edje_External_Param::type.

EAPI Eina_Bool edje_external_param_choice_get ( const Eina_List *  params,
const char *  key,
const char **  ret 
)

Get 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.

Parameters
paramsList of parameters where to look
keyName of the parameter to fetch
retString pointer where to store the value, must not be NULL.
Returns
EINA_TRUE if the parameter was found and is of integer type, EINA_FALSE otherwise.

References edje_external_param_find(), EDJE_EXTERNAL_PARAM_TYPE_CHOICE, _Edje_External_Param::s, and _Edje_External_Param::type.

EAPI Eina_Bool edje_external_param_double_get ( const Eina_List *  params,
const char *  key,
double *  ret 
)

Get 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.

Parameters
paramsList of parameters where to look
keyName of the parameter to fetch
retDouble pointer where to store the value, must not be NULL.
Returns
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, and _Edje_External_Param::type.

EAPI Edje_External_Param* edje_external_param_find ( const Eina_List *  params,
const char *  key 
)

Conevenience function to find a specific parameter in a list of them.

Parameters
paramsThe list of parameters for the external
keyThe parameter to look for
Returns
The matching Edje_External_Param or NULL if it's not found.

References _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().

EAPI const Edje_External_Param_Info* edje_external_param_info_get ( const char *  type_name)

Get the array of parameters information about a type given its name.

Note
the type names and other strings are static, that means they are NOT translated. One must use Edje_External_Type::translate() to translate those.
Returns
the NULL terminated array, or NULL if type is unknown or it does not have any parameter information.
See Also
edje_external_type_get()

References _Edje_External_Type::parameters_info, and type.

Referenced by edje_edit_state_add().

EAPI Eina_Bool edje_external_param_int_get ( const Eina_List *  params,
const char *  key,
int *  ret 
)

Get 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.

Parameters
paramsList of parameters where to look
keyName of the parameter to fetch
retInt pointer where to store the value, must not be NULL.
Returns
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, _Edje_External_Param::i, and _Edje_External_Param::type.

EAPI Eina_Bool edje_external_param_string_get ( const Eina_List *  params,
const char *  key,
const char **  ret 
)

Get 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.

Parameters
paramsList of parameters where to look
keyName of the parameter to fetch
retString pointer where to store the value, must not be NULL.
Returns
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, _Edje_External_Param::s, and _Edje_External_Param::type.

EAPI const char* edje_external_param_type_str ( Edje_External_Param_Type  type)

Converts type identifier to string nicer representation.

This may be used to debug or other informational purposes.

Parameters
typethe identifier to convert.
Returns
the string with the string representation, or "(unknown)".

References EDJE_EXTERNAL_PARAM_TYPE_BOOL, EDJE_EXTERNAL_PARAM_TYPE_CHOICE, EDJE_EXTERNAL_PARAM_TYPE_DOUBLE, EDJE_EXTERNAL_PARAM_TYPE_INT, and EDJE_EXTERNAL_PARAM_TYPE_STRING.

EAPI unsigned int edje_external_type_abi_version_get ( void  )

Return 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.

Warning
NEVER, EVER define your own Edje_External_Type using the return of this function as it will change as Edje library (libedje.so) changes, but your type definition will not. Instead, use EDJE_EXTERNAL_TYPE_ABI_VERSION.

Summary:

Returns
The external ABI version the Edje library was compiled with. That is, the value EDJE_EXTERNAL_TYPE_ABI_VERSION had at that moment.

References EDJE_EXTERNAL_TYPE_ABI_VERSION.

EAPI void edje_external_type_array_register ( const Edje_External_Type_Info array)

Register 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.

Note
The contents of the array will be referenced directly for as long as the type remains registered, so both the 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.
Parameters
arrayNULL 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!
Returns
EINA_TRUE on success, EINA_FALSE on failure (like type already registered).
See Also
edje_external_type_register()

References _Edje_External_Type::abi_version, EDJE_EXTERNAL_TYPE_ABI_VERSION, ERR, _Edje_External_Type_Info::info, and _Edje_External_Type_Info::name.

EAPI void edje_external_type_array_unregister ( const Edje_External_Type_Info array)

Unregister a batch of given external type previously registered.

Parameters
arrayNULL terminated array, should be the same as the one used to register with edje_external_type_array_register()
See Also
edje_external_type_unregister()

References _Edje_External_Type_Info::info, and _Edje_External_Type_Info::name.

EAPI const Edje_External_Type* edje_external_type_get ( const char *  type_name)

Get the Edje_External_Type that defines an EXTERNAL type registered with the name type_name.

EAPI Eina_Bool edje_external_type_register ( const char *  type_name,
const Edje_External_Type type_info 
)

Register a type to be used by EXTERNAL parts.

Edje supports parts of type EXTERNAL, which 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.

Parameters
type_namename to register and be known by edje's "source:" parameter of "type: EXTERNAL" parts.
type_infometa-information describing how to interact with it.
Returns
EINA_TRUE on success, EINA_FALSE on failure (like type already registered).
See Also
edje_external_type_array_register()

References _Edje_External_Type::abi_version, EDJE_EXTERNAL_TYPE_ABI_VERSION, and ERR.

EAPI Eina_Bool edje_external_type_unregister ( const char *  type_name)

Unregister a previously registered EXTERNAL type.

Parameters
type_namename to unregister. It should have been registered with edje_external_type_register() before.
Returns
EINA_TRUE on success, EINA_FALSE on failure (like type_name did not exist).
See Also
edje_external_type_array_unregister()
EAPI Evas_Object* edje_object_part_external_content_get ( const Evas_Object *  obj,
const char *  part,
const char *  content 
)

Get an object contained in an part of type EXTERNAL.

The content string must not be NULL. Its actual value depends on the code providing the EXTERNAL.

Parameters
objThe Edje object
partThe name of the part holding the EXTERNAL
contentA string identifying which content from the EXTERNAL to get

References _edje_external_content_get(), _edje_fetch(), _edje_real_part_recursive_get(), ERR, and _Edje_Real_Part::swallowed_object.

EAPI Evas_Object* edje_object_part_external_object_get ( const Evas_Object *  obj,
const char *  part 
)

Get the object created by this external part.

Parts of type external creates the part object using information provided by external plugins. It's somehow like "swallow" (edje_object_part_swallow()), but it's all set automatically.

This function returns the part created by such external plugins and being currently managed by this Edje.

Note
Almost all swallow rules apply: you should not move, resize, hide, show, set the color or clipper of such part. It's a bit more restrictive as one must never delete this object!
Parameters
objA valid Evas_Object handle
partThe part name
Returns
The externally created object, or NULL if there is none or part is not an external.

References _edje_fetch(), _edje_real_part_recursive_get(), _edje_recalc_do(), EDJE_PART_TYPE_EXTERNAL, ERR, _Edje_Part::name, _Edje_Real_Part::part, _Edje_Real_Part::swallowed_object, and _Edje_Part::type.

EAPI Eina_Bool edje_object_part_external_param_get ( const Evas_Object *  obj,
const char *  part,
Edje_External_Param param 
)

Get the parameter for the external part.

Parts of type external may carry extra properties that have meanings defined by the external plugin. For instance, it may be a string that defines a button label. This property can be modified by state parameters, by explicit calls to edje_object_part_external_param_set() or getting the actual object with edje_object_part_external_object_get() and calling native functions.

This function asks the external plugin what is the current value, independent on how it was set.

Parameters
objA valid Evas_Object handle
partThe part name
paramthe parameter details. It is used as both input and output variable. This pointer should be valid, and the parameter must exist in Edje_External_Type::parameters_info, with the exact type, otherwise the operation will fail and EINA_FALSE will be returned.
Returns
EINA_TRUE if everything went fine and param members are filled with information, EINA_FALSE on errors and param member values are not set or valid.

References _edje_external_param_get(), _edje_fetch(), _edje_real_part_recursive_get(), ERR, and _Edje_External_Param::name.

EAPI Eina_Bool edje_object_part_external_param_set ( Evas_Object *  obj,
const char *  part,
const Edje_External_Param param 
)

Set the parameter for the external part.

Parts of type external may carry extra properties that have meanings defined by the external plugin. For instance, it may be a string that defines a button label and setting this property will change that label on the fly.

Note
external parts have parameters set when they change states. Those parameters will never be changed by this function. The interpretation of how state_set parameters and param_set will interact is up to the external plugin.
this function will not check if parameter value is valid using Edje_External_Param_Info minimum, maximum, valid choices and others. However these should be checked by the underlying implementation provided by the external plugin. This is done for performance reasons.
Parameters
objA valid Evas_Object handle
partThe part name
paramthe parameter details, including its name, type and actual value. This pointer should be valid, and the parameter must exist in Edje_External_Type::parameters_info, with the exact type, otherwise the operation will fail and EINA_FALSE will be returned.
Returns
EINA_TRUE if everything went fine, EINA_FALSE on errors.

References _edje_external_param_set(), _edje_fetch(), _edje_real_part_recursive_get(), ERR, and _Edje_External_Param::name.

Referenced by edje_edit_state_external_param_set().

EAPI Edje_External_Param_Type edje_object_part_external_param_type_get ( const Evas_Object *  obj,
const char *  part,
const char *  param 
)

Facility to query the type of the given parameter of the given part.

Parameters
objA valid Evas_Object handle
partThe part name
paramthe parameter name to use.
Returns
EDJE_EXTERNAL_PARAM_TYPE_MAX on errors, or another value from Edje_External_Param_Type on success.

References _edje_fetch(), _edje_real_part_recursive_get(), EDJE_EXTERNAL_PARAM_TYPE_MAX, ERR, _Edje_External_Type::module_name, _Edje_External_Param_Info::name, _Edje_External_Type::parameters_info, _Edje_Real_Part::swallowed_object, type, and _Edje_External_Param_Info::type.