dbus-glib.h File Reference

DBUS_INSIDE_DBUS_GLIB_H

Typedef DBusGConnection

typedef struct _DBusGConnectionDBusGConnection

Convert to DBusConnection with dbus_g_connection_get_connection() in dbus-glib-lowlevel.h

Typedef DBusGMessage

typedef struct _DBusGMessageDBusGMessage

Convert to DBusMessage with dbus_g_message_get_message() in dbus-glib-lowlevel.h

DBUS_TYPE_G_CONNECTION

DBUS_TYPE_G_MESSAGE

dbus_g_connection_get_g_type ( void )

IMPORT_C GTypedbus_g_connection_get_g_type(void)

dbus_g_connection_get_g_type: Get the GLib type ID for a DBusGConnection boxed type.

Returns: the GLib type

dbus_g_message_get_g_type ( void )

IMPORT_C GTypedbus_g_message_get_g_type(void)

dbus_g_message_get_g_type: Get the GLib type ID for a DBusGMessage boxed type.

Returns: the GLib type

dbus_g_connection_ref ( DBusGConnection * )

IMPORT_C DBusGConnection *dbus_g_connection_ref(DBusGConnection *connection)

dbus_g_connection_ref: the DBusGConnection to ref

Increment refcount on a DBusGConnection

Returns: the connection that was ref'd

dbus_g_connection_unref ( DBusGConnection * )

IMPORT_C voiddbus_g_connection_unref(DBusGConnection *connection)

dbus_g_connection_unref: : the connection to unref

Decrement refcount on a DBusGConnection

dbus_g_message_ref ( DBusGMessage * )

IMPORT_C DBusGMessage *dbus_g_message_ref(DBusGMessage *message)

SECTION:dbus-gmessage : DBus Message : DBusMessage : Stable

A DBusGConnection is a boxed type abstracting a DBusMessage. dbus_g_message_ref: : the message to ref

Increment refcount on a DBusGMessage

Returns: the message that was ref'd

dbus_g_message_unref ( DBusGMessage * )

IMPORT_C voiddbus_g_message_unref(DBusGMessage *message)

dbus_g_message_unref: : the message to unref

Decrement refcount on a DBusGMessage

dbus_g_connection_flush ( DBusGConnection * )

IMPORT_C voiddbus_g_connection_flush(DBusGConnection *connection)

SECTION:dbus-gconnection : DBus Connection : DBusConnection : Stable

A DBusGConnection is a boxed type abstracting a DBusConnection. dbus_g_connection_flush: : the DBusGConnection to flush

Blocks until outgoing calls and signal emissions have been sent.

dbus_g_error_quark ( void )

IMPORT_C GQuarkdbus_g_error_quark(void)

SECTION:dbus-gerror : DBus GError : GError : Stable

DBusGError is the GError used by DBus. dbus_g_error_quark:

The implementation of DBUS_GERROR error domain. See documentation for GError in GLib reference manual.

Returns: the error domain quark for use with GError

DBUS_GERROR

dbus_g_error_has_name ( GError *, const char * )

IMPORT_C gbooleandbus_g_error_has_name(GError *error,
const char *name
)

dbus_g_error_get_name ( GError * )

IMPORT_C const char *dbus_g_error_get_name(GError *error)

dbus_g_thread_init ( void )

IMPORT_C voiddbus_g_thread_init(void)

dbus_g_thread_init:

Initializes the D-BUS thread system. This function may only be called once and must be called prior to calling any other function in the D-BUS API.

dbus_g_connection_open ( const gchar *, GError ** )

IMPORT_C DBusGConnection *dbus_g_connection_open(const gchar *address,
GError **error
)

dbus_g_connection_open: : address of the connection to open : address where an error can be returned.

Returns a connection to the given address.

(Internally, calls dbus_connection_open() then calls dbus_connection_setup_with_g_main() on the result.)

Returns: a DBusConnection

dbus_g_bus_get ( DBusBusType, GError ** )

IMPORT_C DBusGConnection *dbus_g_bus_get(DBusBusTypetype,
GError **error
)

dbus_g_bus_get: : bus type : address where an error can be returned.

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.)

Returns: a DBusConnection

Typedef DBusGObjectInfo

typedef struct _DBusGObjectInfoDBusGObjectInfo

Typedef DBusGMethodInfo

typedef struct _DBusGMethodInfoDBusGMethodInfo

dbus_g_object_type_install_info ( GType, const DBusGObjectInfo * )

IMPORT_C voiddbus_g_object_type_install_info(GTypeobject_type,
const DBusGObjectInfo *info
)

SECTION:dbus-gobject : Exporting a GObject remotely : GObject : Stable

FIXME dbus_g_object_type_install_info: : GType for the object : introspection data generated by #dbus-glib-tool

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.

dbus_g_error_domain_register ( GQuark, const char *, GType )

IMPORT_C voiddbus_g_error_domain_register(GQuarkdomain,
const char *default_iface,
GTypecode_enum
)

dbus_g_error_domain_register: : the GError domain : the D-BUS interface used for error values by default, or NULL : a GType for a #GEnum of the error codes

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.

dbus_g_connection_register_g_object ( DBusGConnection *, const char *, GObject * )

IMPORT_C voiddbus_g_connection_register_g_object(DBusGConnection *connection,
const char *at_path,
GObject *object
)

dbus_g_connection_register_g_object: : the D-BUS connection : the path where the object will live (the object's name) : the object

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.

dbus_g_connection_lookup_g_object ( DBusGConnection *, const char * )

IMPORT_C GObject *dbus_g_connection_lookup_g_object(DBusGConnection *connection,
const char *at_path
)

dbus_g_connection_lookup_g_object: : a DBusGConnection : path

FIXME

Returns: the object at path

DBUS_TYPE_G_BOOLEAN_ARRAY

DBUS_TYPE_G_UCHAR_ARRAY

DBUS_TYPE_G_UINT_ARRAY

DBUS_TYPE_G_INT_ARRAY

DBUS_TYPE_G_UINT64_ARRAY

DBUS_TYPE_G_INT64_ARRAY

DBUS_TYPE_G_OBJECT_ARRAY

DBUS_TYPE_G_STRING_STRING_HASHTABLE

dbus_g_object_path_get_g_type ( void )

IMPORT_C GTypedbus_g_object_path_get_g_type(void)

Get the GLib type ID for a DBusGObjectPath boxed type.

Returns: GLib type

DBUS_TYPE_G_OBJECT_PATH

dbus_g_object_register_marshaller ( GClosureMarshal, GType, ... )

IMPORT_C voiddbus_g_object_register_marshaller(GClosureMarshalmarshaller,
GTyperettype,
...
)

dbus_g_object_register_marshaller: : a GClosureMarshal to be used for invocation : a GType for the return type of the function @:... The parameter #GTypes, followed by G_TYPE_INVALID

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.

dbus_g_object_register_marshaller_array ( GClosureMarshal, GType, guint, const GType * )

voiddbus_g_object_register_marshaller_array(GClosureMarshalmarshaller,
GTyperettype,
guintn_types,
const GType *types
)

dbus_g_object_register_marshaller_array: : a GClosureMarshal to be used for invocation : a GType for the return type of the function : number of function parameters : a C array of GTypes values

Register a GClosureMarshal to be used for signal invocations. dbus_g_object_register_marshaller

Typedef DBusGProxy

typedef struct _DBusGProxyDBusGProxy

Typedef DBusGProxyClass

typedef struct _DBusGProxyClassDBusGProxyClass

DBUS_TYPE_G_PROXY

DBUS_G_PROXY

DBUS_G_PROXY_CLASS

DBUS_IS_G_PROXY

DBUS_IS_G_PROXY_CLASS

DBUS_G_PROXY_GET_CLASS

Typedef DBusGProxyCall

typedef struct _DBusGProxyCallDBusGProxyCall

Typedef DBusGProxyCallNotify

typedef void(*DBusGProxyCallNotify

dbus_g_proxy_get_type ( void )

IMPORT_C GTypedbus_g_proxy_get_type(void)

SECTION:dbus-gproxy : DBus Proxy : #DBusProxy : Stable

A DBusGProxy is a boxed type abstracting a #DBusProxy. dbus_g_proxy_get_type: Standard GObject get_type() function for DBusGProxy.

Returns: type ID for DBusGProxy class

dbus_g_proxy_new_for_name ( DBusGConnection *, const char *, const char *, const char * )

IMPORT_C DBusGProxy *dbus_g_proxy_new_for_name(DBusGConnection *connection,
const char *name,
const char *path,
const char *interface
)

dbus_g_proxy_new_for_name_owner ( DBusGConnection *, const char *, const char *, const char *, GError ** )

IMPORT_C DBusGProxy *dbus_g_proxy_new_for_name_owner(DBusGConnection *connection,
const char *name,
const char *path,
const char *interface,
GError **error
)

dbus_g_proxy_new_from_proxy ( DBusGProxy *, const char *, const char * )

IMPORT_C DBusGProxy *dbus_g_proxy_new_from_proxy(DBusGProxy *proxy,
const char *interface,
const char *path_name
)

dbus_g_proxy_new_for_peer ( DBusGConnection *, const char *, const char * )

IMPORT_C DBusGProxy *dbus_g_proxy_new_for_peer(DBusGConnection *connection,
const char *path_name,
const char *interface_name
)

dbus_g_proxy_new_for_peer: : the connection to the peer : name of the object inside the peer to call methods on : name of the interface to call methods on

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.

Returns: new proxy object

dbus_g_proxy_set_interface ( DBusGProxy *, const char * )

IMPORT_C voiddbus_g_proxy_set_interface(DBusGProxy *proxy,
const char *interface_name
)

dbus_g_proxy_set_interface: : the proxy : an object interface

Sets the object interface proxy is bound to

dbus_g_proxy_add_signal ( DBusGProxy *, const char *, GType, ... )

IMPORT_C voiddbus_g_proxy_add_signal(DBusGProxy *proxy,
const char *signal_name,
GTypefirst_type,
...
)

dbus_g_proxy_add_signal: : the proxy for a remote interface : the name of the signal : the first argument type, or G_TYPE_INVALID if none

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.

dbus_g_proxy_connect_signal ( DBusGProxy *, const char *, GCallback, void *, GClosureNotify )

IMPORT_C voiddbus_g_proxy_connect_signal(DBusGProxy *proxy,
const char *signal_name,
GCallbackhandler,
void *data,
GClosureNotifyfree_data_func
)

dbus_g_proxy_connect_signal: : a proxy for a remote interface : the DBus signal name to listen for : the handler to connect : data to pass to handler : callback function to destroy data

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.

dbus_g_proxy_disconnect_signal ( DBusGProxy *, const char *, GCallback, void * )

IMPORT_C voiddbus_g_proxy_disconnect_signal(DBusGProxy *proxy,
const char *signal_name,
GCallbackhandler,
void *data
)

dbus_g_proxy_disconnect_signal: : a proxy for a remote interface : the DBus signal name to disconnect : the handler to disconnect : the data that was registered with handler

Disconnect all signal handlers from a proxy that match the given criteria.

dbus_g_proxy_call ( DBusGProxy *, const char *, GError **, GType, ... )

IMPORT_C gbooleandbus_g_proxy_call(DBusGProxy *proxy,
const char *method,
GError **error,
GTypefirst_arg_type,
...
)

dbus_g_proxy_call: : a proxy for a remote interface : method to invoke : return location for an error : type of first "in" argument

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 a second G_TYPE_INVALID. Note that this means you must always specify G_TYPE_INVALID twice.

Returns: FALSE if an error is set, TRUE otherwise.

dbus_g_proxy_call_with_timeout ( DBusGProxy *, const char *, int, GError **, GType, ... )

IMPORT_C gbooleandbus_g_proxy_call_with_timeout(DBusGProxy *proxy,
const char *method,
inttimeout,
GError **error,
GTypefirst_arg_type,
...
)

dbus_g_proxy_call_with_timeout: : a proxy for a remote interface : method to invoke : specify the timeout in milliseconds : return location for an error : type of first "in" argument

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 a second G_TYPE_INVALID. Note that this means you must always specify G_TYPE_INVALID twice.

Returns: FALSE if an error is set, TRUE otherwise.

dbus_g_proxy_call_no_reply ( DBusGProxy *, const char *, GType, ... )

IMPORT_C voiddbus_g_proxy_call_no_reply(DBusGProxy *proxy,
const char *method,
GTypefirst_arg_type,
...
)

dbus_g_proxy_call_no_reply: : a proxy for a remote interface : the name of the method to invoke : type of the first argument

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.

TODO: this particular function shouldn't die on out of memory, since you should be able to do a call with large arguments.

dbus_g_proxy_begin_call ( DBusGProxy *, const char *, DBusGProxyCallNotify, gpointer, GDestroyNotify, GType, ... )

IMPORT_C DBusGProxyCall *dbus_g_proxy_begin_call(DBusGProxy *proxy,
const char *method,
DBusGProxyCallNotifynotify,
gpointerdata,
GDestroyNotifydestroy,
GTypefirst_arg_type,
...
)

dbus_g_proxy_begin_call: : a proxy for a remote interface : the name of the method to invoke : callback to be invoked when method returns : user data passed to callback : function called to destroy user_data : type of the first argument

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().

TODO this particular function shouldn't die on out of memory, since you should be able to do a call with large arguments.

Returns: call identifier.

dbus_g_proxy_begin_call_with_timeout ( DBusGProxy *, const char *, DBusGProxyCallNotify, gpointer, GDestroyNotify, int, GType, ... )

IMPORT_C DBusGProxyCall *dbus_g_proxy_begin_call_with_timeout(DBusGProxy *proxy,
const char *method,
DBusGProxyCallNotifynotify,
gpointeruser_data,
GDestroyNotifydestroy,
inttimeout,
GTypefirst_arg_type,
...
)

dbus_g_proxy_begin_call_with_timeout: : a proxy for a remote interface : the name of the method to invoke : callback to be invoked when method returns : user data passed to callback : function called to destroy user_data : specify the timeout in milliseconds : type of the first argument

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().

TODO this particular function shouldn't die on out of memory, since you should be able to do a call with large arguments.

Returns: call identifier.

dbus_g_proxy_end_call ( DBusGProxy *, DBusGProxyCall *, GError **, GType, ... )

IMPORT_C gbooleandbus_g_proxy_end_call(DBusGProxy *proxy,
DBusGProxyCall *call,
GError **error,
GTypefirst_arg_type,
...
)

dbus_g_proxy_end_call: : a proxy for a remote interface : the pending call ID from dbus_g_proxy_begin_call() : return location for an error : type of first "out" argument

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.

Returns: FALSE if an error is set.

dbus_g_proxy_cancel_call ( DBusGProxy *, DBusGProxyCall * )

IMPORT_C voiddbus_g_proxy_cancel_call(DBusGProxy *proxy,
DBusGProxyCall *call
)

dbus_g_proxy_cancel_call : a proxy for a remote interface : the pending call ID from dbus_g_proxy_begin_call()

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.

dbus_g_proxy_get_path ( DBusGProxy * )

IMPORT_C const char *dbus_g_proxy_get_path(DBusGProxy *proxy)

dbus_g_proxy_get_path: Gets the path this proxy is bound to : the proxy

Returns: an object path

dbus_g_proxy_get_bus_name ( DBusGProxy * )

IMPORT_C const char *dbus_g_proxy_get_bus_name(DBusGProxy *proxy)

dbus_g_proxy_get_bus_name: : the proxy

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.

Returns: the bus name the proxy sends messages to

dbus_g_proxy_get_interface ( DBusGProxy * )

IMPORT_C const char *dbus_g_proxy_get_interface(DBusGProxy *proxy)

dbus_g_proxy_get_interface: : the proxy

Gets the object interface proxy is bound to (may be NULL in some cases).

Returns: an object interface

Typedef DBusGMethodInvocation

typedef struct _DBusGMethodInvocationDBusGMethodInvocation

dbus_g_method_return ( DBusGMethodInvocation *, ... )

IMPORT_C voiddbus_g_method_return(DBusGMethodInvocation *context,
...
)

dbus_g_method_return: : the method context

Send a return message for a given method invocation, with arguments. This function also frees the sending context.

dbus_g_method_return_error ( DBusGMethodInvocation *, GError * )

IMPORT_C voiddbus_g_method_return_error(DBusGMethodInvocation *context,
GError *error
)

dbus_g_method_return_error: : the method context : the error to send

Send a error message for a given method invocation. This function also frees the sending context.