Functions
Signal Handler

Functions

Eldbus_Signal_Handlereldbus_signal_handler_add (Eldbus_Connection *conn, const char *sender, const char *path, const char *interface, const char *member, Eldbus_Signal_Cb cb, const void *cb_data)
 Add a signal handler. More...
 
Eldbus_Signal_Handlereldbus_signal_handler_ref (Eldbus_Signal_Handler *handler)
 Increase signal handler reference. More...
 
void eldbus_signal_handler_unref (Eldbus_Signal_Handler *handler)
 Decrease signal handler reference. More...
 
void eldbus_signal_handler_del (Eldbus_Signal_Handler *handler)
 Decrease signal handler reference like eldbus_signal_handler_unref() but if reference > 0 this signal handler will stop listening to signals. More...
 
Eina_Bool eldbus_signal_handler_match_extra_set (Eldbus_Signal_Handler *sh,...) EINA_SENTINEL
 Add extra argument in match of signal handler to obtain specifics signals. More...
 
Eina_Bool eldbus_signal_handler_match_extra_vset (Eldbus_Signal_Handler *sh, va_list ap)
 Add extra argument in match of signal handler to obtain specifics signals. More...
 
void eldbus_signal_handler_free_cb_add (Eldbus_Signal_Handler *handler, Eldbus_Free_Cb cb, const void *data)
 Add a callback function to be called when signal handler will be freed. More...
 
void eldbus_signal_handler_free_cb_del (Eldbus_Signal_Handler *handler, Eldbus_Free_Cb cb, const void *data)
 Remove callback registered in eldbus_signal_handler_free_cb_add(). More...
 
const char * eldbus_signal_handler_sender_get (const Eldbus_Signal_Handler *handler)
 
const char * eldbus_signal_handler_path_get (const Eldbus_Signal_Handler *handler)
 
const char * eldbus_signal_handler_interface_get (const Eldbus_Signal_Handler *handler)
 
const char * eldbus_signal_handler_member_get (const Eldbus_Signal_Handler *handler)
 
const char * eldbus_signal_handler_match_get (const Eldbus_Signal_Handler *handler)
 
Eldbus_Connectioneldbus_signal_handler_connection_get (const Eldbus_Signal_Handler *handler)
 

Detailed Description

Function Documentation

◆ eldbus_signal_handler_add()

Eldbus_Signal_Handler * eldbus_signal_handler_add ( Eldbus_Connection conn,
const char *  sender,
const char *  path,
const char *  interface,
const char *  member,
Eldbus_Signal_Cb  cb,
const void *  cb_data 
)

Add a signal handler.

Parameters
connconnection where the signal is emitted
senderbus name or unique id of where the signal is emitted
pathpath of remote object
interfacethat signal belongs
membername of the signal
cbcallback that will be called when this signal is received
cb_datadata that will be passed to callback
Returns
signal handler

References EINA_SAFETY_ON_NULL_RETURN_VAL, eldbus_connection_free_cb_add(), and eldbus_signal_handler_free_cb_add().

◆ eldbus_signal_handler_ref()

Eldbus_Signal_Handler * eldbus_signal_handler_ref ( Eldbus_Signal_Handler handler)

Increase signal handler reference.

Parameters
handlersignal handler
Returns
the same signal handler, handler

References DBG, and eina_strbuf_string_get().

◆ eldbus_signal_handler_unref()

void eldbus_signal_handler_unref ( Eldbus_Signal_Handler handler)

Decrease signal handler reference.

If reference == 0 signal handler will be freed.

Parameters
handlersignal handler

References DBG, and eina_strbuf_string_get().

Referenced by eldbus_proxy_event_callback_del(), and eldbus_signal_handler_del().

◆ eldbus_signal_handler_del()

void eldbus_signal_handler_del ( Eldbus_Signal_Handler handler)

Decrease signal handler reference like eldbus_signal_handler_unref() but if reference > 0 this signal handler will stop listening to signals.

In other words it will be canceled but memory will not be freed.

Parameters
handlersignal handler to delete

References eldbus_signal_handler_unref().

Referenced by eldbus_object_event_callback_del().

◆ eldbus_signal_handler_match_extra_set()

Eina_Bool eldbus_signal_handler_match_extra_set ( Eldbus_Signal_Handler sh,
  ... 
)

Add extra argument in match of signal handler to obtain specifics signals.

Example: eldbus_signal_handler_match_extra_set(sh, "arg0", "org.bansheeproject.Banshee", "arg1", "", NULL); With this extra arguments this signal handler callback only will be called when Banshee is started.

Note
For now only argX is supported.
Parameters
shsignal handler
...variadic of key and value and must be ended with a NULL
Returns
EINA_TRUE if success
Note
For more information: http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules

References eldbus_signal_handler_match_extra_vset().

Referenced by eldbus_object_event_callback_add(), and eldbus_proxy_properties_changed_callback_add().

◆ eldbus_signal_handler_match_extra_vset()

Eina_Bool eldbus_signal_handler_match_extra_vset ( Eldbus_Signal_Handler sh,
va_list  ap 
)

Add extra argument in match of signal handler to obtain specifics signals.

Example: eldbus_signal_handler_match_extra_set(sh, "arg0", "org.bansheeproject.Banshee", "arg1", "", NULL); With this extra arguments this signal handler callback only will be called when Banshee is started.

Note
For now is only supported argX.
Parameters
shsignal handler
apva_list with the keys and values, must be ended with a NULL
Returns
EINA_TRUE if success
Note
To information: http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules

References EINA_FALSE, EINA_INLIST_GET, eina_inlist_sorted_state_insert(), EINA_SAFETY_ON_NULL_GOTO, eina_strbuf_string_get(), eina_stringshare_add(), EINA_TRUE, and ERR.

Referenced by eldbus_signal_handler_match_extra_set().

◆ eldbus_signal_handler_free_cb_add()

void eldbus_signal_handler_free_cb_add ( Eldbus_Signal_Handler handler,
Eldbus_Free_Cb  cb,
const void *  data 
)

Add a callback function to be called when signal handler will be freed.

Parameters
handlersignal handler
cbcallback that will be called when this signal handler is freed
datadata that will be passed to callback

References EINA_SAFETY_ON_NULL_RETURN.

Referenced by eldbus_object_signal_handler_add(), eldbus_proxy_signal_handler_add(), and eldbus_signal_handler_add().

◆ eldbus_signal_handler_free_cb_del()

void eldbus_signal_handler_free_cb_del ( Eldbus_Signal_Handler handler,
Eldbus_Free_Cb  cb,
const void *  data 
)

Remove callback registered in eldbus_signal_handler_free_cb_add().

Parameters
handlersignal handler
cbregistered callback to remove
datadata that will be passed to callback

References EINA_SAFETY_ON_NULL_RETURN.