Tizen Native API
Edje Communication Interface: Signal

Functions

void * edje_object_signal_callback_extra_data_get (void)
 Get extra data passed to callbacks.
void * edje_object_signal_callback_del (Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func)
 Remove a signal-triggered callback from an object.
void * edje_object_signal_callback_del_full (Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
 Unregister/delete a callback set for an arriving Edje signal, emitted by a given Edje object.
void edje_object_signal_emit (Edje_Object *obj, const char *emission, const char *source)
 Send/emit an Edje signal to a given Edje object.
void edje_object_signal_callback_add (Edje_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
 Add a callback for an arriving Edje signal, emitted by a given Edje object.

Typedefs

typedef void(* Edje_Signal_Cb )(void *data, Evas_Object *obj, const char *emission, const char *source)

Functions that deal with signals.

Edje has two communication interfaces between code and theme. Signals and messages.

This group has functions that deal with signals. One can either emit a signal from code to a theme or create handles for the ones emitted from themes. Signals are identified by strings.


Typedef Documentation

typedef void(* Edje_Signal_Cb)(void *data, Evas_Object *obj, const char *emission, const char *source)

Edje signal callback functions's prototype definition. data will have the auxiliary data pointer set at the time the callback registration. obj will be a pointer the Edje object where the signal comes from. emission will identify the exact signal's emission string and source the exact signal's source one.


Function Documentation

void edje_object_signal_callback_add ( Edje_Object *  obj,
const char *  emission,
const char *  source,
Edje_Signal_Cb  func,
void *  data 
)

Add a callback for an arriving Edje signal, emitted by a given Edje object.

Since :
2.3
Remarks:
Edje signals are one of the communication interfaces between code and a given Edje object's theme. With signals, one can communicate two string values at a time, which are:
  • "emission" value: the name of the signal, in general
  • "source" value: a name for the signal's context, in general
Though there are those common uses for the two strings, one is free to use them however they like.
This function adds a callback function to a signal emitted by obj, to be issued every time an EDC program like the following
 program {
 name: "emit_example";
 action: SIGNAL_EMIT "a_signal" "a_source";
 }
is run, if emission and source are given those same values, here.
Signal callback registration is powerful, in the way that blobs may be used to match multiple signals at once. All the *?[\ set of fnmatch() operators can be used, both for emission and source.
Edje has internal signals it will emit, automatically, on various actions taking place on group parts. For example, the mouse cursor being moved, pressed, released, etc., over a given part's area, all generate individual signals.
By using something like
 edje_object_signal_callback_add(obj, "mouse,down,*", "button.*",
 signal_cb, NULL);
being "button.*" the pattern for the names of parts implementing buttons on an interface, you'd be registering for notifications on events of mouse buttons being pressed down on either of those parts (those events all have the "mouse,down," common prefix on their names, with a suffix giving the button number). The actual emission and source strings of an event will be passed in as the emission and source parameters of the callback function (e.g. "mouse,down,2" and "button.close"), for each of those events.
See edcref the syntax for EDC files
See also:
edje_object_signal_emit() on how to emits Edje signals from code to a an object
edje_object_signal_callback_del_full()
Parameters:
[in]objThe edje object
[in]emissionThe signal's "emission" string
[in]sourceThe signal's "source" string
[in]funcThe callback function to be executed when the signal is emitted.
[in]dataA pointer to data to pass in to func.
void* edje_object_signal_callback_del ( Evas_Object obj,
const char *  emission,
const char *  source,
Edje_Signal_Cb  func 
)

Remove a signal-triggered callback from an object.

Since :
2.3
Parameters:
[in]objA valid Evas_Object handle.
[in]emissionThe emission string.
[in]sourceThe source string.
[in]funcThe callback function.
Returns:
The data pointer
Remarks:
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().
void* edje_object_signal_callback_del_full ( Evas_Object obj,
const char *  emission,
const char *  source,
Edje_Signal_Cb  func,
void *  data 
)

Unregister/delete a callback set for an arriving Edje signal, emitted by a given Edje object.

Since :
2.3
Parameters:
[in]objA handle to an Edje object
[in]emissionThe signal's "emission" string
[in]sourceThe signal's "source" string
[in]funcThe callback function passed on the callback's registration
[in]dataThe pointer given to be passed as data to func
Returns:
data, on success or NULL, on errors (or if data had this value)
Remarks:
This function removes a callback, previously attached to the emittion of a signal, from the object obj. The parameters emission, source, 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().

Get extra data passed to callbacks.

Since :
2.3
Returns:
the extra data for that callback.
Remarks:
Some callbacks pass extra information. This function gives access to that extra information. It's somehow like event_info in smart callbacks.
See also:
edje_object_signal_callback_add() for more on Edje signals.
Since (EFL) :
1.1.0
void edje_object_signal_emit ( Edje_Object *  obj,
const char *  emission,
const char *  source 
)

Send/emit an Edje signal to a given Edje object.

Since :
2.3
Remarks:
This function sends a signal to the object obj. An Edje program, at obj's EDC specification level, can respond to a signal by having declared matching 'signal' and 'source' fields on its block (see edcref the syntax for EDC files).
As an example,
 edje_object_signal_emit(obj, "a_signal", "");
would trigger a program which had an EDC declaration block like
 program {
 name: "a_program";
 signal: "a_signal";
 source: "";
 action: ...
 }
See also:
edje_object_signal_callback_add() for more on Edje signals.
Parameters:
[in]objThe edje object
[in]emissionThe signal's "emission" string
[in]sourceThe signal's "source" string