Data Structures | |
struct | DBusGFuncSignature |
Functions | |
void | dbus_g_connection_flush (DBusGConnection *connection) |
Blocks until outgoing calls and signal emissions have been sent. | |
DBusGConnection * | dbus_g_connection_ref (DBusGConnection *gconnection) |
Increment refcount on a DBusGConnection. | |
void | dbus_g_connection_unref (DBusGConnection *gconnection) |
Decrement refcount on a DBusGConnection. | |
DBusGMessage * | dbus_g_message_ref (DBusGMessage *gmessage) |
Increment refcount on a DBusGMessage. | |
void | dbus_g_message_unref (DBusGMessage *gmessage) |
Decrement refcount on a DBusGMessage. | |
GQuark | dbus_g_error_quark (void) |
The implementation of DBUS_GERROR error domain. | |
gboolean | dbus_g_error_has_name (GError *error, const char *name) |
Determine whether D-BUS error name for a remote exception matches the given name. | |
const char * | dbus_g_error_get_name (GError *error) |
Return the D-BUS name for a remote exception. | |
GType | dbus_connection_get_g_type (void) |
Get the GLib type ID for a DBusConnection boxed type. | |
GType | dbus_message_get_g_type (void) |
Get the GLib type ID for a DBusMessage boxed type. | |
GType | dbus_g_connection_get_g_type (void) |
Get the GLib type ID for a DBusGConnection boxed type. | |
GType | dbus_g_message_get_g_type (void) |
Get the GLib type ID for a DBusGMessage boxed type. | |
DBusConnection * | dbus_g_connection_get_connection (DBusGConnection *gconnection) |
Get the DBusConnection corresponding to this DBusGConnection. | |
DBusMessage * | dbus_g_message_get_message (DBusGMessage *gmessage) |
Get the DBusMessage corresponding to this DBusGMessage. | |
void | dbus_connection_setup_with_g_main (DBusConnection *connection, GMainContext *context) |
Sets the watch and timeout functions of a DBusConnection to integrate the connection with the GLib main loop. | |
void | dbus_server_setup_with_g_main (DBusServer *server, GMainContext *context) |
Sets the watch and timeout functions of a DBusServer to integrate the server with the GLib main loop. | |
DBusGConnection * | dbus_g_bus_get (DBusBusType type, GError **error) |
Returns a connection to the given bus. | |
void | dbus_g_object_type_install_info (GType object_type, const DBusGObjectInfo *info) |
Install introspection information about the given object GType sufficient to allow methods on the object to be invoked by name. | |
void | dbus_g_error_domain_register (GQuark domain, const char *default_iface, GType code_enum) |
Register a GError domain and set of codes with D-BUS. | |
void | dbus_g_connection_register_g_object (DBusGConnection *connection, const char *at_path, GObject *object) |
Registers a GObject at the given path. | |
GObject * | dbus_g_connection_lookup_g_object (DBusGConnection *connection, const char *at_path) |
GClosureMarshal | _dbus_gobject_lookup_marshaller (GType rettype, guint n_params, const GType *param_types) |
void | dbus_g_object_register_marshaller (GClosureMarshal marshaller, GType rettype,...) |
Register a GClosureMarshal to be used for signal invocations, giving its return type and a list of parameter types, followed by G_TYPE_INVALID. | |
void | dbus_g_object_register_marshaller_array (GClosureMarshal marshaller, GType rettype, guint n_types, const GType *types) |
Register a GClosureMarshal to be used for signal invocations. | |
void | dbus_g_method_return (DBusGMethodInvocation *context,...) |
Send a return message for a given method invocation, with arguments. | |
void | dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error) |
Send a error message for a given method invocation. | |
GType | dbus_g_proxy_get_type (void) |
Standard GObject get_type() function for DBusGProxy. | |
DBusGProxy * | dbus_g_proxy_new_for_name (DBusGConnection *connection, const char *name, const char *path_name, const char *interface_name) |
Creates a new proxy for a remote interface exported by a connection on a message bus. | |
DBusGProxy * | dbus_g_proxy_new_for_name_owner (DBusGConnection *connection, const char *name, const char *path_name, const char *interface_name, GError **error) |
Similar to dbus_g_proxy_new_for_name(), but makes a round-trip request to the message bus to get the current name owner, then binds the proxy to the unique name of the current owner, rather than to the well-known name. | |
DBusGProxy * | dbus_g_proxy_new_from_proxy (DBusGProxy *proxy, const char *interface, const char *path) |
Creates a proxy using an existing proxy as a template, substituting the specified interface and path. | |
DBusGProxy * | dbus_g_proxy_new_for_peer (DBusGConnection *connection, const char *path_name, const char *interface_name) |
Creates a proxy for an object in peer application (one we're directly connected to). | |
const char * | dbus_g_proxy_get_bus_name (DBusGProxy *proxy) |
Gets the bus name a proxy is bound to (may be NULL in some cases). | |
const char * | dbus_g_proxy_get_interface (DBusGProxy *proxy) |
Gets the object interface proxy is bound to (may be NULL in some cases). | |
void | dbus_g_proxy_set_interface (DBusGProxy *proxy, const char *interface_name) |
Sets the object interface proxy is bound to. | |
const char * | dbus_g_proxy_get_path (DBusGProxy *proxy) |
Gets the path this proxy is bound to. | |
DBusGProxyCall * | dbus_g_proxy_begin_call (DBusGProxy *proxy, const char *method, DBusGProxyCallNotify notify, gpointer user_data, GDestroyNotify destroy, GType first_arg_type,...) |
Asynchronously invokes a method on a remote interface. | |
gboolean | dbus_g_proxy_end_call (DBusGProxy *proxy, DBusGProxyCall *call, GError **error, GType first_arg_type,...) |
Collects the results of a method call. | |
gboolean | dbus_g_proxy_call (DBusGProxy *proxy, const char *method, GError **error, GType first_arg_type,...) |
Function for synchronously invoking a method and receiving reply values. | |
void | dbus_g_proxy_call_no_reply (DBusGProxy *proxy, const char *method, GType first_arg_type,...) |
Sends a method call message as with dbus_g_proxy_begin_call(), but does not ask for a reply or allow you to receive one. | |
void | dbus_g_proxy_cancel_call (DBusGProxy *proxy, DBusGProxyCall *call) |
Cancels a pending method call. | |
void | dbus_g_proxy_send (DBusGProxy *proxy, DBusMessage *message, dbus_uint32_t *client_serial) |
Sends a message to the interface we're proxying for. | |
void | dbus_g_proxy_add_signal (DBusGProxy *proxy, const char *signal_name, GType first_type,...) |
Specifies the argument signature of a signal;.only necessary if the remote object does not support introspection. | |
void | dbus_g_proxy_connect_signal (DBusGProxy *proxy, const char *signal_name, GCallback handler, void *data, GClosureNotify free_data_func) |
Connect a signal handler to a proxy for a remote interface. | |
void | dbus_g_proxy_disconnect_signal (DBusGProxy *proxy, const char *signal_name, GCallback handler, void *data) |
Disconnect all signal handlers from a proxy that match the given criteria. | |
void | dbus_g_thread_init (void) |
Initializes the D-BUS thread system to use GLib threads. |
libdbus proper is a low-level API, these GLib bindings wrap libdbus with a much higher-level approach. The higher level approach is possible because GLib defines a main loop, an object/type system, and an out-of-memory handling policy (it exits the program). See http://www.gtk.org for GLib information.
To manipulate remote objects, use DBusGProxy.
|
Get the GLib type ID for a DBusConnection boxed type.
Definition at line 183 of file dbus-glib.c. References dbus_connection_ref(), and dbus_connection_unref(). |
|
Sets the watch and timeout functions of a DBusConnection to integrate the connection with the GLib main loop. Pass in NULL for the GMainContext unless you're doing something specialized. If called twice for the same context, does nothing the second time. If called once with context A and once with context B, context B replaces context A as the context monitoring the connection.
Definition at line 564 of file dbus-gmain.c. References ConnectionSetup::context, dbus_connection_allocate_data_slot(), dbus_connection_get_data(), dbus_connection_set_data(), dbus_connection_set_timeout_functions(), dbus_connection_set_wakeup_main_function(), dbus_connection_set_watch_functions(), and NULL. Referenced by dbus_g_bus_get(). |
|
Returns a connection to the given bus. The connection is a global variable shared with other callers of this function. (Internally, calls dbus_bus_get() then calls dbus_connection_setup_with_g_main() on the result.)
Definition at line 710 of file dbus-gmain.c. References dbus_bus_get(), dbus_connection_setup_with_g_main(), dbus_error_free(), dbus_error_init(), dbus_set_g_error(), and NULL. |
|
Blocks until outgoing calls and signal emissions have been sent.
Definition at line 47 of file dbus-glib.c. References dbus_connection_flush(). |
|
Get the DBusConnection corresponding to this DBusGConnection. The return value does not have its refcount incremented.
Definition at line 256 of file dbus-glib.c. Referenced by dbus_g_method_return(), and dbus_g_method_return_error(). |
|
Get the GLib type ID for a DBusGConnection boxed type.
Definition at line 219 of file dbus-glib.c. References dbus_g_connection_ref(), and dbus_g_connection_unref(). |
|
Increment refcount on a DBusGConnection.
Definition at line 59 of file dbus-glib.c. References dbus_connection_ref(). Referenced by dbus_g_connection_get_g_type(). |
|
Registers a GObject at the given path. Properties, methods, and signals of the object can then be accessed remotely. Methods are only available if method introspection data has been added to the object's class with g_object_class_install_info(). The registration will be cancelled if either the DBusConnection or the GObject gets finalized.
Definition at line 1617 of file dbus-gobject.c. References dbus_connection_register_object_path(). |
|
Decrement refcount on a DBusGConnection.
Definition at line 75 of file dbus-glib.c. References dbus_connection_unref(). Referenced by dbus_g_connection_get_g_type(), and dbus_g_method_return(). |
|
Register a GError domain and set of codes with D-BUS. You must have created a GEnum for the error codes. This function will not be needed with an introspection-capable GLib.
Definition at line 1557 of file dbus-gobject.c. References DBusGErrorInfo::code_enum, and DBusGErrorInfo::default_iface. |
|
Return the D-BUS name for a remote exception. This function may only be invoked on a GError returned from an invocation of a remote method, e.g. via dbus_g_proxy_end_call. Moreover, you must ensure that the error's domain is DBUS_GERROR, and the code is DBUS_GERROR_REMOTE_EXCEPTION.
Definition at line 168 of file dbus-glib.c. References NULL. Referenced by dbus_g_error_has_name(). |
|
Determine whether D-BUS error name for a remote exception matches the given name. This function is intended to be invoked on a GError returned from an invocation of a remote method, e.g. via dbus_g_proxy_end_call. It will silently return FALSE for errors which are not remote D-BUS exceptions (i.e. with a domain other than DBUS_GERROR or a code other than DBUS_GERROR_REMOTE_EXCEPTION).
Definition at line 144 of file dbus-glib.c. References dbus_g_error_get_name(), FALSE, and NULL. |
|
The implementation of DBUS_GERROR error domain. See documentation for GError in GLib reference manual.
Definition at line 121 of file dbus-glib.c. |
|
Get the GLib type ID for a DBusGMessage boxed type.
Definition at line 237 of file dbus-glib.c. References dbus_g_message_ref(), and dbus_g_message_unref(). |
|
Get the DBusMessage corresponding to this DBusGMessage. The return value does not have its refcount incremented.
Definition at line 268 of file dbus-glib.c. Referenced by dbus_g_method_return(), and dbus_g_method_return_error(). |
|
Increment refcount on a DBusGMessage.
Definition at line 91 of file dbus-glib.c. References dbus_message_ref(). Referenced by dbus_g_message_get_g_type(). |
|
Decrement refcount on a DBusGMessage.
Definition at line 106 of file dbus-glib.c. References dbus_message_unref(). Referenced by dbus_g_message_get_g_type(), and dbus_g_method_return(). |
|
Send a return message for a given method invocation, with arguments. This function also frees the sending context.
Definition at line 1867 of file dbus-gobject.c. References _DBusGMethodInvocation::connection, dbus_connection_send(), dbus_g_connection_get_connection(), dbus_g_connection_unref(), dbus_g_message_get_message(), dbus_g_message_unref(), dbus_message_iter_init_append(), dbus_message_new_method_return(), dbus_message_unref(), FALSE, _DBusGMethodInvocation::message, _DBusGMethodInvocation::method, and _DBusGMethodInvocation::object. |
|
Send a error message for a given method invocation. This function also frees the sending context.
Definition at line 1916 of file dbus-gobject.c. References _DBusGMethodInvocation::connection, dbus_connection_send(), dbus_g_connection_get_connection(), dbus_g_message_get_message(), dbus_message_unref(), _DBusGMethodInvocation::message, and _DBusGMethodInvocation::object. |
|
Register a GClosureMarshal to be used for signal invocations, giving its return type and a list of parameter types, followed by G_TYPE_INVALID. This function will not be needed once GLib includes libffi.
Definition at line 1801 of file dbus-gobject.c. References dbus_g_object_register_marshaller_array(), and TRUE. |
|
Register a GClosureMarshal to be used for signal invocations. See also dbus_g_object_register_marshaller
Definition at line 1833 of file dbus-gobject.c. References DBusGFuncSignature::n_params, DBusGFuncSignature::params, and DBusGFuncSignature::rettype. Referenced by dbus_g_object_register_marshaller(). |
|
Install introspection information about the given object GType sufficient to allow methods on the object to be invoked by name. The introspection information is normally generated by dbus-glib-tool, then this function is called in the class_init() for the object class. Once introspection information has been installed, instances of the object registered with dbus_g_connection_register_g_object() can have their methods invoked remotely.
Definition at line 1535 of file dbus-gobject.c. |
|
Specifies the argument signature of a signal;.only necessary if the remote object does not support introspection. The arguments specified are the GLib types expected.
Definition at line 2503 of file dbus-gproxy.c. References _dbus_gobject_lookup_marshaller(), DBUS_G_PROXY_DESTROYED, FALSE, NULL, and TRUE. |
|
Asynchronously invokes a method on a remote interface. The method call will not be sent over the wire until the application returns to the main loop, or blocks in dbus_connection_flush() to write out pending data. The call will be completed after a timeout, or when a reply is received. When the call returns, the callback specified will be invoked; you can then collect the results of the call (which may be an error, or a reply), use dbus_g_proxy_end_call().
Definition at line 2253 of file dbus-gproxy.c. References DBUS_G_PROXY_DESTROYED, DBUS_G_VALUE_ARRAY_COLLECT_ALL, and FALSE. |
|
Function for synchronously invoking a method and receiving reply values. This function is equivalent to dbus_g_proxy_begin_call followed by dbus_g_proxy_end_call. All of the input arguments are specified first, followed by G_TYPE_INVALID, followed by all of the output values, followed by G_TYPE_INVALID.
Definition at line 2334 of file dbus-gproxy.c. References DBUS_G_PROXY_DESTROYED, DBUS_G_VALUE_ARRAY_COLLECT_ALL, FALSE, and NULL. |
|
Sends a method call message as with dbus_g_proxy_begin_call(), but does not ask for a reply or allow you to receive one.
Definition at line 2376 of file dbus-gproxy.c. References dbus_connection_send(), DBUS_G_PROXY_DESTROYED, DBUS_G_VALUE_ARRAY_COLLECT_ALL, dbus_message_set_no_reply(), dbus_message_unref(), NULL, and TRUE. |
|
Cancels a pending method call. The method call was normally initiated with dbus_g_proxy_begin_call(). This function may not be used on pending calls that have already been ended with dbus_g_proxy_end_call.
Definition at line 2422 of file dbus-gproxy.c. References DBUS_G_PROXY_DESTROYED, dbus_pending_call_cancel(), and NULL. |
|
Connect a signal handler to a proxy for a remote interface. When the remote interface emits the specified signal, the proxy will emit a corresponding GLib signal.
Definition at line 2560 of file dbus-gproxy.c. References DBUS_G_PROXY_DESTROYED, FALSE, and NULL. |
|
Disconnect all signal handlers from a proxy that match the given criteria.
Definition at line 2608 of file dbus-gproxy.c. References DBUS_G_PROXY_DESTROYED, and NULL. |
|
Collects the results of a method call. The method call was normally initiated with dbus_g_proxy_end_call(). You may use this function outside of the callback given to dbus_g_proxy_begin_call; in that case this function will block if the results haven't yet been received. If the call results in an error, the error is set as normal for GError and the function returns FALSE. Otherwise, the "out" parameters and return value of the method are stored in the provided varargs list. The list should be terminated with G_TYPE_INVALID.
Definition at line 2302 of file dbus-gproxy.c. |
|
Gets the bus name a proxy is bound to (may be NULL in some cases). If you created the proxy with dbus_g_proxy_new_for_name(), then the name you passed to that will be returned. If you created it with dbus_g_proxy_new_for_name_owner(), then the unique connection name will be returned. If you created it with dbus_g_proxy_new_for_peer() then NULL will be returned.
Definition at line 1943 of file dbus-gproxy.c. References DBUS_G_PROXY_DESTROYED, and NULL. |
|
Gets the object interface proxy is bound to (may be NULL in some cases).
Definition at line 1958 of file dbus-gproxy.c. References DBUS_G_PROXY_DESTROYED, and NULL. |
|
Gets the path this proxy is bound to.
Definition at line 1992 of file dbus-gproxy.c. References DBUS_G_PROXY_DESTROYED, and NULL. |
|
Standard GObject get_type() function for DBusGProxy.
Definition at line 1735 of file dbus-gproxy.c. References NULL. |
|
Creates a new proxy for a remote interface exported by a connection on a message bus. Method calls and signal connections over this proxy will go to the name owner; the name's owner is expected to support the given interface name. THE NAME OWNER MAY CHANGE OVER TIME, for example between two different method calls, unless the name is a unique name. If you need a fixed owner, you need to request the current owner and bind a proxy to its unique name rather than to the generic name; see dbus_g_proxy_new_for_name_owner(). A name-associated proxy only makes sense with a message bus, not for app-to-app direct dbus connections. This proxy will only emit the "destroy" signal if the DBusConnection is disconnected, the proxy has no remaining references, or the name is a unique name and its owner disappears. If a well-known name changes owner, the proxy will still be alive.
Definition at line 1812 of file dbus-gproxy.c. References NULL. |
|
Similar to dbus_g_proxy_new_for_name(), but makes a round-trip request to the message bus to get the current name owner, then binds the proxy to the unique name of the current owner, rather than to the well-known name. As a result, the name owner will not change over time, and the proxy will emit the "destroy" signal when the owner disappears from the message bus. An example of the difference between dbus_g_proxy_new_for_name() and dbus_g_proxy_new_for_name_owner(): if you provide the well-known name "org.freedesktop.Database" dbus_g_proxy_new_for_name() remains bound to that name as it changes owner. dbus_g_proxy_new_for_name_owner() will fail if the name has no owner. If the name has an owner, dbus_g_proxy_new_for_name_owner() will bind to the unique name of that owner rather than the generic name.
Definition at line 1850 of file dbus-gproxy.c. References NULL. |
|
Creates a proxy for an object in peer application (one we're directly connected to). That is, this function is intended for use when there's no message bus involved, we're doing a simple 1-to-1 communication between two applications.
Definition at line 1915 of file dbus-gproxy.c. References NULL. |
|
Creates a proxy using an existing proxy as a template, substituting the specified interface and path. Either or both may be NULL.
Definition at line 1884 of file dbus-gproxy.c. References _DBusGProxyManager::connection, _DBusGProxy::interface, _DBusGProxy::manager, _DBusGProxy::name, NULL, and _DBusGProxy::path. |
|
Sends a message to the interface we're proxying for. Does not block or wait for a reply. The message is only actually written out when you return to the main loop or block in dbus_connection_flush(). The message is modified to be addressed to the target interface. That is, a destination name field or whatever is needed will be added to the message. The basic point of this function is to add the necessary header fields, otherwise it's equivalent to dbus_connection_send(). This function adds a reference to the message, so the caller still owns its original reference.
Definition at line 2460 of file dbus-gproxy.c. References dbus_connection_send(), DBUS_G_PROXY_DESTROYED, dbus_message_set_destination(), dbus_message_set_interface(), and dbus_message_set_path(). |
|
Sets the object interface proxy is bound to.
Definition at line 1973 of file dbus-gproxy.c. References _DBusGProxy::interface, and _DBusGProxy::manager. |
|
Initializes the D-BUS thread system to use GLib threads. This function may only be called once and must be called prior to calling any other function in the D-BUS API. Definition at line 171 of file dbus-gthread.c. References dbus_threads_init(). |
|
Get the GLib type ID for a DBusMessage boxed type.
Definition at line 201 of file dbus-glib.c. References dbus_message_ref(), and dbus_message_unref(). |
|
Sets the watch and timeout functions of a DBusServer to integrate the server with the GLib main loop. In most cases the context argument should be NULL. If called twice for the same context, does nothing the second time. If called once with context A and once with context B, context B replaces context A as the context monitoring the connection.
Definition at line 640 of file dbus-gmain.c. References ConnectionSetup::context, dbus_server_allocate_data_slot(), dbus_server_get_data(), dbus_server_set_data(), dbus_server_set_timeout_functions(), dbus_server_set_watch_functions(), and NULL. |