Tizen Native API
Edje Communication Interface: Signal

This group discusses functions that deal with signals.

Remarks:
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 theme or create handles for the ones emitted from theme. Signals are identified by strings.

Functions

void edje_object_signal_callback_add (Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data)
 Adds a callback for an arriving edje signal, emitted by a given Ejde object.
void * edje_object_signal_callback_del (Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func)
 Deletes 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)
 Unregisters/deletes a callback set for an arriving edje signal, emitted by a given Ejde object.
void edje_object_signal_emit (Evas_Object *obj, const char *emission, const char *source)
 Sends/emits an edje signal to a given edje object.
void * edje_object_signal_callback_extra_data_get (void)
 Gets the extra data passed to callbacks.

Typedefs

typedef void(* Edje_Signal_Cb )(void *data, Evas_Object *obj, const char *emission, const char *source)
 Edje signal callback functions's prototype definition.

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 ( Evas_Object obj,
const char *  emission,
const char *  source,
Edje_Signal_Cb  func,
void *  data 
)

Adds a callback for an arriving edje signal, emitted by a given Ejde object.

Since :
2.3.1
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 common uses for the two strings, one is free to use them however they like.

Remarks:
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 because 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 that it emits, 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);

"button.*" being the pattern for the names of parts implementing buttons on an interface that you would be registering for notifications on events of mouse buttons being pressed down on either of those parts (all those events 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 are passed as the emission and source parameters of the callback function (e.g. "mouse,down,2" and "button.close"), for each of those events.

Remarks:
See the syntax for EDC files.
Parameters:
[in]objA handle to an 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 the data to pass to func
See also:
edje_object_signal_emit() on how to emit edje signals from the code to an object
edje_object_signal_callback_del_full()
void* edje_object_signal_callback_del ( Evas_Object obj,
const char *  emission,
const char *  source,
Edje_Signal_Cb  func 
)

Deletes a signal-triggered callback from an object.

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

Since :
2.3.1
Parameters:
[in]objA valid Evas_Object handle
[in]emissionThe emission string
[in]sourceThe source string
[in]funcThe callback function
Returns:
The data pointer
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 
)

Unregisters/deletes a callback set for an arriving edje signal, emitted by a given Ejde object.

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

Since :
2.3.1
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 registration
[in]dataA pointer to be passed as data to func
Returns:
data on success, otherwise NULL on errors (or if data has this value)
See also:
edje_object_signal_callback_add().
edje_object_signal_callback_del().

Gets the extra data passed to callbacks.

Since (EFL) :
1.1.0
Since :
2.3.1
Remarks:
Some callbacks pass extra information. This function gives access to that extra information. It's somehow like event_info when it comes to smart callbacks.
Returns:
The extra data for that callback.
See also:
edje_object_signal_callback_add() for more on edje signals.
void edje_object_signal_emit ( Evas_Object obj,
const char *  emission,
const char *  source 
)

Sends/emits an edje signal to a given edje object.

This function sends a signal to the object obj. An edje program, at obj's EDC specification level, can respond to a signal by declaring matching 'signal' and 'source' fields on its block (see the syntax for EDC files).

Since :
2.3.1

As an example,

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

would trigger a program which has an EDC declaration block like

 program {
  name: "a_program";
  signal: "a_signal";
  source: "";
  action: ...
 }
Parameters:
[in]objA handle to an edje object
[in]emissionThe signal's "emission" string
[in]sourceThe signal's "source" string
See also:
edje_object_signal_callback_add() for more on edje signals.