Edje Object

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

Modules

 Edje Communication Interface: Signal
 Functions that deal with signals.
 
 Edje Scale
 Functions that deal with scaling objects.
 
 Edje Class: Color
 Functions that deal with Color Classes.
 
 Edje Part
 Functions that deal with layout components.
 
 Edje Object Geometry
 Functions that deal with object's geometry.
 
 Edje Class: Text
 Functions that deal with Text Classes.
 
 Edje Object File
 Functions to deals with EDJ files.
 
 Edje Object Animation
 Functions that deal with animations.
 
 Edje Communication Interface: Message
 Functions that deal with messages.
 
 Edje Perspective
 Functions that deal with 3D projection of an 2D object.
 
#define edje_obj_preload(cancel, ret)   EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PRELOAD), EO_TYPECHECK(Eina_Bool, cancel), EO_TYPECHECK(Eina_Bool *, ret)
 Preload the images on the Edje Object in the background. More...
 
Evas_Objectedje_object_add (Evas *evas)
 Instantiate a new Edje object. More...
 
Eina_Bool edje_object_preload (Evas_Object *obj, Eina_Bool cancel)
 Preload the images on the Edje Object in the background. More...
 

Detailed Description

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.

Macro Definition Documentation

#define edje_obj_preload (   cancel,
  ret 
)    EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PRELOAD), EO_TYPECHECK(Eina_Bool, cancel), EO_TYPECHECK(Eina_Bool *, ret)

Preload the images on the Edje Object in the background.

Since
1.8
Parameters
[in]cancel
[out]ret
See also
edje_object_preload

Referenced by edje_object_preload().

Function Documentation

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:

1 Evas_Object *edje;
2 
3 edje = edje_object_add(canvas);
4 if (!edje)
5  {
6  fprintf(stderr, "could not create edje object!\n");
7  return NULL;
8  }
9 
10 if (!edje_object_file_set(edje, "theme.edj", "group_name"))
11  {
12  int err = edje_object_load_error_get(edje);
13  const char *errmsg = edje_load_error_str(err);
14  fprintf(stderr, "could not load 'group_name' from theme.edj: %s",
15  errmsg);
16 
17  evas_object_del(edje);
18  return NULL;
19  }
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:
1 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.
Examples:
edje-basic.c, edje-box.c, edje-box2.c, edje-color-class.c, edje-drag.c, edje-perspective.c, edje-signals-messages.c, edje-swallow.c, edje-table.c, edje-text.c, and evas-aspect-hints.c.

References EDJE_LOAD_ERROR_DOES_NOT_EXIST, EDJE_LOAD_ERROR_NONE, edje_load_error_str(), edje_obj_file_get, edje_obj_load_error_get, edje_object_perspective_set(), eina_array_free(), eina_array_new(), EINA_FALSE, eina_file_close(), eina_file_open(), eina_hash_string_small_new(), eina_list_append(), eina_list_remove(), eina_stringshare_del(), EINA_TRUE, EINA_UNUSED, EINA_VALUE_TYPE_STRING, ephysics_shutdown(), ephysics_world_del(), ephysics_world_render_geometry_set(), evas_event_freeze(), evas_event_thaw(), evas_event_thaw_eval(), evas_obj_smart_hide, evas_obj_smart_show, evas_obj_type_set, evas_object_color_set(), evas_object_evas_get(), evas_object_geometry_get(), evas_object_move(), evas_object_pass_events_set(), evas_object_rectangle_add(), evas_object_resize(), evas_object_smart_data_set(), evas_object_smart_member_add(), evas_object_static_clip_set(), evas_object_visible_get(), and evas_smart_legacy_type_register().

Referenced by edje_edit_part_source_set(), and edje_file_data_get().

Eina_Bool edje_object_preload ( Evas_Object obj,
Eina_Bool  cancel 
)

Preload the images on the Edje Object in the background.

Parameters
objA handle to an Edje object
cancelEINA_FALSE will add it the preloading work queue, EINA_TRUE will remove it (if it was issued before).
Returns
EINA_FASLE if obj was not a valid Edje object otherwise EINA_TRUE

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.

Note
Use EINA_TRUE on scenarios where you don't need the image data preloaded anymore.

References EAPI, edje_obj_preload, edje_object_signal_callback_add(), edje_object_signal_callback_del(), EINA_FALSE, EINA_TRUE, EVAS_CALLBACK_IMAGE_PRELOADED, evas_object_event_callback_add(), evas_object_event_callback_del_full(), evas_object_image_file_get(), and evas_object_image_preload().