src/lib/edje_smart.c File Reference

Functions

const Edje_Smart_Api_edje_object_smart_class_get (void)
void _edje_object_smart_set (Edje_Smart_Api *sc)
EAPI Evas_Object * edje_object_add (Evas *evas)
 Instantiate a new Edje object.

Variables

Eina_List * _edje_edjes = NULL

Function Documentation

const Edje_Smart_Api* _edje_object_smart_class_get ( void  )
void _edje_object_smart_set ( Edje_Smart_Api sc)
EAPI Evas_Object* edje_object_add ( Evas *  evas)

Instantiate a new Edje object.

Parameters:
evasA valid Evas handle, the canvas to place the new object in
Returns:
A handle to the new object created or NULL, on errors.

This function creates a new Edje smart object, returning its Evas_Object handle. An Edje object is useless without a (source) file set to it, so you'd most probably call edje_object_file_set() afterwards, like in:

 Evas_Object *edje;

 edje = edje_object_add(canvas);
 if (!edje)
   {
      fprintf(stderr, "could not create edje object!\n");
      return NULL;
   }

 if (!edje_object_file_set(edje, "theme.edj", "group_name"))
   {
      int err = edje_object_load_error_get(edje);
      const char *errmsg = edje_load_error_str(err);
      fprintf(stderr, "could not load 'group_name' from theme.edj: %s",
        errmsg);

      evas_object_del(edje);
      return NULL;
   }
Note:
You can get a callback every time edje re-calculates the object (either due to animation or some kind of signal or input). This is called in-line just after the recalculation has occurred. It is a good idea not to go and delete or alter the object inside this callbacks, simply make a note that the recalculation has taken place and then do something about it outside the callback. to register a callback use code like:
    evas_object_smart_callback_add(edje_obj, "recalc", my_cb, my_cb_data);
See also:
evas_object_smart_callback_add()
Note:
Before creating the first Edje object in your code, remember to initialize the library, with edje_init(), or unexpected behavior might occur.

References _edje_lib_ref(), and _edje_object_smart_set().

Referenced by _edje_entry_real_part_init(), _edje_object_file_set_internal(), and edje_edit_part_source_set().


Variable Documentation