src/lib/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 iterator that emits Eina_Hash_Tuple pointers with key being the name and data being the Edje_External_Type pointer.
EAPI Eina_Bool edje_external_param_bool_get (const Eina_List *params, const char *key, Eina_Bool *ret)
EAPI Eina_Bool edje_external_param_choice_get (const Eina_List *params, const char *key, const char **ret)
EAPI Eina_Bool edje_external_param_double_get (const Eina_List *params, const char *key, double *ret)
EAPI Edje_External_Paramedje_external_param_find (const Eina_List *params, const char *key)
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)
EAPI Eina_Bool edje_external_param_string_get (const Eina_List *params, const char *key, const char **ret)
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)
EAPI Eina_Bool edje_external_type_register (const char *type_name, const Edje_External_Type *type_info)
 Register given type name to return the given information.
EAPI Eina_Bool edje_external_type_unregister (const char *type_name)
 Unregister given type name previously registered.
EAPI Evas_Object * edje_object_part_external_content_get (const Evas_Object *obj, const char *part, const char *content)
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(), and edje_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 iterator that emits Eina_Hash_Tuple pointers with key being the name and data being the Edje_External_Type pointer.

 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) : "");
   }
EAPI Eina_Bool edje_external_param_bool_get ( const Eina_List *  params,
const char *  key,
Eina_Bool *  ret 
)
EAPI Eina_Bool edje_external_param_choice_get ( const Eina_List *  params,
const char *  key,
const char **  ret 
)
EAPI Eina_Bool edje_external_param_double_get ( const Eina_List *  params,
const char *  key,
double *  ret 
)
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 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 
)
EAPI Eina_Bool edje_external_param_string_get ( const Eina_List *  params,
const char *  key,
const char **  ret 
)
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:
type the 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:
version this edje library was compiled.

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.

This is the recommended function to add information as it's faster than the single version edje_external_type_register().

Note:
the given array is not modified, but the type name strings are not duplicated! That is, all type names must be live until they are unregistered! This was chosen to save some memory and most people will just define the array as a global static const type anyway.
Parameters:
array NULL terminated array with type name and information. Note that type name or information are not modified by are referenced, so they must keep 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:
array NULL 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  ) 
EAPI Eina_Bool edje_external_type_register ( const char *  type_name,
const Edje_External_Type type_info 
)

Register given type name to return the given information.

Parameters:
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.
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 given type name previously registered.

Parameters:
type_name name to unregister. It should be 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 
)
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:
obj A valid Evas_Object handle
part The 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 modifed 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:
obj A valid Evas_Object handle
part The part name
param the 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:
obj A valid Evas_Object handle
part The part name
param the 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:
obj A valid Evas_Object handle
part The part name
param the 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, _Edje_External_Param_Info::type, and type.