Tizen Native API
Edje Object

Functions

Evas_Objectedje_object_add (Evas *evas)
 Instantiate a new Edje object.
Eina_Bool edje_object_preload (Edje_Object *obj, Eina_Bool cancel)
 Preload the images on the Edje Object in the background.

This group discusses functions that deal with Edje layouts and its components.

An important thing to know about this group is that there is no Edje_Object in code. What we refer here as object are layouts (or themes) defined by groups, and parts, both declared in EDC files. They are of type Evas_Object as the other native objects of Evas, but they only exist in Edje, so that is why we are calling them "edje objects".

With the Edje Object Group functions we can deal with layouts by managing its aspect, content, message and signal exchange and animation, among others.


Function Documentation

Instantiate a new Edje object.

Since :
2.3
Parameters:
[in]evasA valid Evas handle, the canvas to place the new object in
Returns:
A handle to the new object created or NULL, on errors.
Remarks:
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;
   }
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()
Remarks:
Before creating the first Edje object in your code, remember to initialize the library, or unexpected behavior might occur.
Eina_Bool edje_object_preload ( Edje_Object *  obj,
Eina_Bool  cancel 
)

Preload the images on the Edje Object in the background.

Since :
2.3
Returns:
EINA_FASLE if obj was not a valid Edje object otherwise EINA_TRUE
Remarks:
This function requests the preload of all data images (on the given object) in the background. The work is queued before being processed (because there might be other pending requests of this type). It emits a signal "preload,done" when finished.
Use EINA_TRUE on scenarios where you don't need the image data preloaded anymore.
Parameters:
[in]objThe edje object
[in]cancelEINA_FALSE will add it the preloading work queue, EINA_TRUE will remove it (if it was issued before).