Program

These functions provide an abstraction layer between the application code and the interface, while allowing extremely flexible dynamic layouts and animations. More...

Data Structures

struct  _Edje_Program_Data

Functions

void _edje_callbacks_patterns_clean (Edje *ed)
void _edje_emit (Edje *ed, const char *sig, const char *src)
void _edje_emit_handle (Edje *ed, const char *sig, const char *src)
void _edje_program_end (Edje *ed, Edje_Running_Program *runp)
void _edje_program_run (Edje *ed, Edje_Program *pr, Eina_Bool force, const char *ssig, const char *ssrc)
Eina_Bool _edje_program_run_iterate (Edje_Running_Program *runp, double tim)
EAPI double edje_frametime_get (void)
 Get edje trasitions' frame time.
EAPI void edje_frametime_set (double t)
 Set edje trasitions' frame time.
EAPI Eina_Bool edje_object_animation_get (const Evas_Object *obj)
 Get the edje object's animation state.
EAPI void edje_object_animation_set (Evas_Object *obj, Eina_Bool on)
 Set the object's animation state.
EAPI Eina_Bool edje_object_play_get (const Evas_Object *obj)
 Get the edje object's play/pause state.
EAPI void edje_object_play_set (Evas_Object *obj, Eina_Bool play)
 Set the edje object to playing or paused states.
EAPI void edje_object_signal_callback_add (Evas_Object *obj, const char *emission, const char *source, void(*func)(void *data, Evas_Object *o, const char *emission, const char *source), void *data)
 Add a callback for a signal emitted by obj.
EAPI void * edje_object_signal_callback_del (Evas_Object *obj, const char *emission, const char *source, void(*func)(void *data, Evas_Object *o, const char *emission, const char *source))
 Remove a signal-triggered callback from an object.
EAPI void * edje_object_signal_callback_del_full (Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
 Remove a signal-triggered callback from an object.
EAPI void edje_object_signal_emit (Evas_Object *obj, const char *emission, const char *source)
 Send a signal to an edje object.

Detailed Description

These functions provide an abstraction layer between the application code and the interface, while allowing extremely flexible dynamic layouts and animations.


Function Documentation

void _edje_program_run ( Edje ed,
Edje_Program pr,
Eina_Bool  force,
const char *  ssig,
const char *  ssrc 
)

References _edje_anim_count, _edje_animators, _edje_block(), _edje_block_break(), _edje_dragable_pos_set(), _edje_embryo_test_run(), _edje_emit(), _edje_freeze(), _edje_part_description_apply(), _edje_part_pos_set(), _edje_pending_timer_cb(), _edje_program_end(), _edje_program_run(), _edje_recalc(), _edje_recalc_do(), _edje_ref(), _edje_thaw(), _edje_timer, _edje_timer_cb(), _edje_unblock(), _edje_unref(), _Edje_Program::action, _Edje::actions, _Edje_Program::after, _Edje_Real_Part_Drag::count, _Edje::delete_me, _Edje_Real_Part_State::description, _Edje_Real_Part_Drag::down, _Edje_Real_Part::drag, _Edje_Part::dragable, _Edje_Program::dst, _Edje_Running_Program::edje, _Edje_Pending_Program::edje, EDJE_ACTION_TYPE_ACTION_STOP, EDJE_ACTION_TYPE_DRAG_VAL_PAGE, EDJE_ACTION_TYPE_DRAG_VAL_SET, EDJE_ACTION_TYPE_DRAG_VAL_STEP, EDJE_ACTION_TYPE_FOCUS_OBJECT, EDJE_ACTION_TYPE_FOCUS_SET, EDJE_ACTION_TYPE_PARAM_COPY, EDJE_ACTION_TYPE_PARAM_SET, EDJE_ACTION_TYPE_SCRIPT, EDJE_ACTION_TYPE_SIGNAL_EMIT, EDJE_ACTION_TYPE_STATE_SET, ERR, _Edje::focused_part, _Edje_Program::from, _Edje_Program::id, _Edje_Program_After::id, _Edje_Program_Target::id, _Edje_Program::in, _Edje_Program::mode, _Edje_Part::name, _Edje_Part_Description_Common::name, _Edje::no_anim, _Edje::obj, _Edje_Real_Part_Drag::page, _Edje_Program::param, _Edje_Real_Part::param1, _Edje_Real_Part::part, _Edje::pending_actions, _Edje_Running_Program::program, _Edje_Real_Part::program, _Edje_Pending_Program::program, _Edje_Program::range, _Edje_Program::src, _Edje_Running_Program::start_time, _Edje_Program::state, _Edje_Part_Description_Common::state, _Edje_Program::state2, _Edje_Real_Part_Drag::step, _Edje_Real_Part::swallowed_object, _Edje::table_parts, _Edje::table_parts_size, _Edje::table_programs, _Edje::table_programs_size, _Edje_Program::targets, _Edje_Program::time, _Edje_Pending_Program::timer, _Edje_Program::tween, _Edje_Real_Part_Drag::val, _Edje_Program::value, _Edje_Part_Description_Common::value, _Edje_Program::value2, _Edje_Part_Dragable::x, _Edje_Position_Scale::x, _Edje_Part_Dragable::y, _Edje_Position_Scale::y, and ZERO.

Referenced by _edje_emit_handle(), _edje_pending_timer_cb(), _edje_program_run(), _edje_program_run_iterate(), and edje_edit_program_run().

EAPI double edje_frametime_get ( void   ) 

Get edje trasitions' frame time.

Returns:
The frame time, in seconds.

This function returns the edje frame time set by edje_frametime_set().

See also:
edje_frametime_set()
EAPI void edje_frametime_set ( double  t  ) 

Set edje trasitions' frame time.

Parameters:
t The frame time, in seconds. Default value is 1/30.

This function sets the edje built-in animations' frame time (thus, affecting their resolution) by calling ecore_animator_frametime_set(). This frame time can be retrieved with edje_frametime_get().

See also:
edje_frametime_get()
EAPI Eina_Bool edje_object_animation_get ( const Evas_Object *  obj  ) 

Get the edje object's animation state.

Parameters:
obj A valid Evas_Object handle.
Returns:
EINA_FALSE on error or if object is not animated; EINA_TRUE if animated.

This function returns if the animation is playing or not. The animation state is set by edje_object_play_set().

See also:
edje_object_animation_set().

References _edje_fetch(), _Edje::delete_me, and _Edje::no_anim.

EAPI void edje_object_animation_set ( Evas_Object *  obj,
Eina_Bool  on 
)
EAPI Eina_Bool edje_object_play_get ( const Evas_Object *  obj  ) 

Get the edje object's play/pause state.

Parameters:
obj A valid Evas_Object handle.
Returns:
EINA_FALSE if the object is not connected, its delete_me flag is set, or it is at paused state; EINA_TRUE if the object is at playing state.

This function tells if an edje object is playing or not. This state is set by edje_object_play_set().

See also:
edje_object_play_set().

References _edje_fetch(), _Edje::delete_me, and _Edje::paused.

EAPI void edje_object_play_set ( Evas_Object *  obj,
Eina_Bool  play 
)

Set the edje object to playing or paused states.

Parameters:
obj A valid Evas_Object handle.
play Object state (1 to playing, 0 to pauseed).

This function sets the edje object obj to playing or paused states, depending on the parameter play. This has no effect if the object was already at that state.

See also:
edje_object_play_get().

References _edje_fetch(), _Edje::actions, _Edje::delete_me, edje_object_play_set(), EDJE_PART_TYPE_GROUP, _Edje_Real_Part::part, _Edje::paused, _Edje::paused_at, _Edje_Running_Program::start_time, _Edje_Real_Part::swallowed_object, _Edje::table_parts, _Edje::table_parts_size, and _Edje_Part::type.

Referenced by edje_object_play_set().

EAPI void edje_object_signal_callback_add ( Evas_Object *  obj,
const char *  emission,
const char *  source,
void(*)(void *data, Evas_Object *o, const char *emission, const char *source)  func,
void *  data 
)

Add a callback for a signal emitted by obj.

Parameters:
obj A valid Evas_Object handle.
emission The signal's name.
source The signal's source.
func The callback function to be executed when the signal is emitted.
data A pointer to data to pass in to the callback function.

Connects a callback function to a signal emitted by obj. In EDC, a program can emit a signal as follows:

 program {
   name: "emit_example";
   action: SIGNAL_EMIT "a_signal" "a_source";
 }

Assuming a function with the following declaration is definded:

 void cb_signal(void *data, Evas_Object *o, const char *emission, const char *source);

a callback is attached using:

 edje_object_signal_callback_add(obj, "a_signal", "a_source", cb_signal, data);

Here, data is an arbitrary pointer to be used as desired. Note that emission and source correspond respectively to the first and the second parameters at the SIGNAL_EMIT action.

Internal edje signals can also be attached to, and globs can occur in either the emission or source name, e.g.

 edje_object_signal_callback_add(obj, "mouse,down,*", "button.*", NULL);

Here, any mouse down events on an edje part whose name begins with "button." will trigger the callback. The actual signal and source names will be passed in to the emission and source parameters of the callback function (e.g. "mouse,down,2" and "button.close").

References _edje_callbacks_patterns_clean(), _edje_fetch(), _Edje::callbacks, _Edje_Signal_Callback::data, _Edje::delete_me, _Edje_Signal_Callback::func, _Edje_Signal_Callback::just_added, _Edje::just_added_callbacks, _Edje_Signal_Callback::signal, _Edje_Signal_Callback::source, and _Edje::walking_callbacks.

EAPI void* edje_object_signal_callback_del ( Evas_Object *  obj,
const char *  emission,
const char *  source,
void(*)(void *data, Evas_Object *o, const char *emission, const char *source)  func 
)

Remove a signal-triggered callback from an object.

Parameters:
obj A valid Evas_Object handle.
emission The emission string.
source The source string.
func The callback function.
Returns:
The data pointer

This function removes a callback, previously attached to the emittion of a signal, from the object obj. The parameters emission, source and func must match exactly those passed to a previous call to edje_object_signal_callback_add(). The data pointer that was passed to this call will be returned.

See also:
edje_object_signal_callback_add().
edje_object_signal_callback_del_full().

References _edje_callbacks_patterns_clean(), _edje_fetch(), _Edje::callbacks, _Edje_Signal_Callback::data, _Edje::delete_callbacks, _Edje_Signal_Callback::delete_me, _Edje::delete_me, _Edje_Signal_Callback::func, _Edje_Signal_Callback::signal, _Edje_Signal_Callback::source, and _Edje::walking_callbacks.

EAPI void* edje_object_signal_callback_del_full ( Evas_Object *  obj,
const char *  emission,
const char *  source,
Edje_Signal_Cb  func,
void *  data 
)

Remove a signal-triggered callback from an object.

Parameters:
obj A valid Evas_Object handle.
emission The emission string.
source The source string.
func The callback function.
data The user data passed to the callback.
Returns:
The data pointer

This function removes a callback, previously attached to the emittion of a signal, from the object obj. The parameters emission, sourcei, func and data must match exactly those passed to a previous call to edje_object_signal_callback_add(). The data pointer that was passed to this call will be returned.

See also:
edje_object_signal_callback_add().
edje_object_signal_callback_del().

References _edje_callbacks_patterns_clean(), _edje_fetch(), _Edje::callbacks, _Edje_Signal_Callback::data, _Edje::delete_callbacks, _Edje_Signal_Callback::delete_me, _Edje::delete_me, _Edje_Signal_Callback::func, _Edje_Signal_Callback::signal, _Edje_Signal_Callback::source, and _Edje::walking_callbacks.

EAPI void edje_object_signal_emit ( Evas_Object *  obj,
const char *  emission,
const char *  source 
)

Send a signal to an edje object.

Parameters:
obj A valid Evas_Object handle.
emission The signal's name.
source The signal's source.

This function sends a signal to the object obj. An edje program can respond to a signal by specifying matching 'signal' and 'source' fields.

 edje_object_signal_emit(obj, "a_signal", "");

will trigger a program whose EDC block is:

 program {
  name: "a_program";
  signal: "a_signal";
  source: "";
  action: ...
 }

FIXME: should this signal be sent to children also?

References _edje_emit(), _edje_fetch(), and _Edje::delete_me.