Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

etk_signal.h File Reference


Detailed Description


Data Structures

struct  Etk_Signal
 The structure of a signal. More...

Defines

#define ETK_MEMBER_OFFSET(type, member)   ((long)((long *)&((type *)0)->member))

Functions

Etk_Signal * etk_signal_new (const char *signal_name, Etk_Type *object_type, long handler_offset, Etk_Marshaller marshaller, Etk_Accumulator accumulator, void *accum_data)
 Creates a new signal called signal_name, for the object type object_type.
void etk_signal_delete (Etk_Signal *signal)
 Deletes the signal. The signal could not be connected or emitted anymore.
Etk_Signal * etk_signal_lookup (const char *signal_name, Etk_Type *type)
 Gets the the signal corresponding to the name and the object type.
const char * etk_signal_name_get (Etk_Signal *signal)
 Gets the name of the signal.
Etk_Marshaller etk_signal_marshaller_get (Etk_Signal *signal)
 Gets the marshaller used by the signal.
void etk_signal_connect (const char *signal_name, Etk_Object *object, Etk_Callback callback, void *data)
 Connects a callback to a signal of the object object. The callback is added at the start of the list of callbacks to call. It means that when the signal is emitted, this callback will the first to be called. This way, you can prevent the other callbacks from being called using etk_signal_stop() when this callback gets called.
void etk_signal_connect_after (const char *signal_name, Etk_Object *object, Etk_Callback callback, void *data)
 Connects a callback to a signal of the object object. The callback is added at the end of the list of callbacks to call which means that when the signal is emitted, this callback will the last to be called. If you don't need a specific call-order, use etk_signal_connect() rather.
void etk_signal_connect_swapped (const char *signal_name, Etk_Object *object, Etk_Callback callback, void *data)
 Connects a callback to a signal of the object object. The callback is added at the start of the list of callbacks to call. It means that when the signal is emitted, this callback will the first to be called. This way, you can prevent the other callbacks from being called using etk_signal_stop() when this callback gets called.
void etk_signal_connect_full (Etk_Signal *signal, Etk_Object *object, Etk_Callback callback, void *data, Etk_Bool swapped, Etk_Bool after)
 Connects a callback to a signal of the object object. When the signal of the object will be emitted, this callback will be automatically called.
void etk_signal_disconnect (const char *signal_name, Etk_Object *object, Etk_Callback callback)
 Disconnects a callback from a signal, the callback won't be called anymore when the signal is emitted.
void etk_signal_disconnect_all (const char *signal_name, Etk_Object *object)
 Disconnects all callbacks from a signal.
void etk_signal_block (const char *signal_name, Etk_Object *object, Etk_Callback callback)
 Blocks a callback from being called when the corresponding signal is emitted. Unlike etk_signal_disconnect(), the callback is note removed, and can be easily unblock with etk_signal_unblock().
void etk_signal_unblock (const char *signal_name, Etk_Object *object, Etk_Callback callback)
 Unblocks a blocked callback. The callback will no longer be prevented from being called when the corresponding signal is emitted.
Etk_Bool etk_signal_emit (Etk_Signal *signal, Etk_Object *object, void *return_value,...)
 Emits the signal: it will call the callbacks connected to the signal signal.
Etk_Bool etk_signal_emit_by_name (const char *signal_name, Etk_Object *object, void *return_value,...)
 Emits the signal: it will call the callbacks connected to the signal signal.
Etk_Bool etk_signal_emit_valist (Etk_Signal *signal, Etk_Object *object, void *return_value, va_list args)
 Emits the signal: it will call the callbacks connected to the signal signal.
void etk_signal_stop ()
 Stops the propagation of the last emitted signal: the remaining callbacks/handler won't be called.
It's usually called in a callback to avoid the other callbacks to be called.