Main Page | Modules | Data Structures | Directories | File List | Data Fields | Related Pages

GLib bindings

API for using D-BUS with GLib. More...

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.
DBusConnectiondbus_g_connection_get_connection (DBusGConnection *gconnection)
 Get the DBusConnection corresponding to this DBusGConnection.
DBusMessagedbus_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.
DBusGProxydbus_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.
DBusGProxydbus_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.
DBusGProxydbus_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.
DBusGProxydbus_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.

Detailed Description

API for using D-BUS with GLib.

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.


Function Documentation

GType dbus_connection_get_g_type void   ) 
 

Get the GLib type ID for a DBusConnection boxed type.

Returns:
GLib type

Definition at line 183 of file dbus-glib.c.

References dbus_connection_ref(), and dbus_connection_unref().

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.

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.

Parameters:
connection the connection
context the GMainContext or NULL for default context

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

DBusGConnection* dbus_g_bus_get DBusBusType  type,
GError **  error
 

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

Parameters:
type bus type
error address where an error can be returned.
Returns:
a DBusConnection

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.

void dbus_g_connection_flush DBusGConnection *  connection  ) 
 

Blocks until outgoing calls and signal emissions have been sent.

Parameters:
connection the connection to flush

Definition at line 47 of file dbus-glib.c.

References dbus_connection_flush().

DBusConnection* dbus_g_connection_get_connection DBusGConnection *  gconnection  ) 
 

Get the DBusConnection corresponding to this DBusGConnection.

The return value does not have its refcount incremented.

Returns:
DBusConnection

Definition at line 256 of file dbus-glib.c.

Referenced by dbus_g_method_return(), and dbus_g_method_return_error().

GType dbus_g_connection_get_g_type void   ) 
 

Get the GLib type ID for a DBusGConnection boxed type.

Returns:
GLib type

Definition at line 219 of file dbus-glib.c.

References dbus_g_connection_ref(), and dbus_g_connection_unref().

DBusGConnection* dbus_g_connection_ref DBusGConnection *  gconnection  ) 
 

Increment refcount on a DBusGConnection.

Parameters:
gconnection the connection to ref
Returns:
the connection that was ref'd

Definition at line 59 of file dbus-glib.c.

References dbus_connection_ref().

Referenced by dbus_g_connection_get_g_type().

void dbus_g_connection_register_g_object DBusGConnection *  connection,
const char *  at_path,
GObject *  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.

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

Definition at line 1617 of file dbus-gobject.c.

References dbus_connection_register_object_path().

void dbus_g_connection_unref DBusGConnection *  gconnection  ) 
 

Decrement refcount on a DBusGConnection.

Parameters:
gconnection the connection to unref

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

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.

You must have created a GEnum for the error codes. This function will not be needed with an introspection-capable GLib.

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

Definition at line 1557 of file dbus-gobject.c.

References DBusGErrorInfo::code_enum, and DBusGErrorInfo::default_iface.

const char* dbus_g_error_get_name GError *  error  ) 
 

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.

Parameters:
error the GError given from the remote method
name the D-BUS error name
msg the D-BUS error detailed message
Returns:
the D-BUS error name

Definition at line 168 of file dbus-glib.c.

References NULL.

Referenced by dbus_g_error_has_name().

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.

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

Parameters:
error the GError given from the remote method
name the D-BUS error name
msg the D-BUS error detailed message
Returns:
TRUE iff the remote error has the given name

Definition at line 144 of file dbus-glib.c.

References dbus_g_error_get_name(), FALSE, and NULL.

GQuark dbus_g_error_quark void   ) 
 

The implementation of DBUS_GERROR error domain.

See documentation for GError in GLib reference manual.

Returns:
the error domain quark for use with GError

Definition at line 121 of file dbus-glib.c.

GType dbus_g_message_get_g_type void   ) 
 

Get the GLib type ID for a DBusGMessage boxed type.

Returns:
GLib type

Definition at line 237 of file dbus-glib.c.

References dbus_g_message_ref(), and dbus_g_message_unref().

DBusMessage* dbus_g_message_get_message DBusGMessage *  gmessage  ) 
 

Get the DBusMessage corresponding to this DBusGMessage.

The return value does not have its refcount incremented.

Returns:
DBusMessage

Definition at line 268 of file dbus-glib.c.

Referenced by dbus_g_method_return(), and dbus_g_method_return_error().

DBusGMessage* dbus_g_message_ref DBusGMessage *  gmessage  ) 
 

Increment refcount on a DBusGMessage.

Parameters:
gmessage the message to ref
Returns:
the message that was ref'd

Definition at line 91 of file dbus-glib.c.

References dbus_message_ref().

Referenced by dbus_g_message_get_g_type().

void dbus_g_message_unref DBusGMessage *  gmessage  ) 
 

Decrement refcount on a DBusGMessage.

Parameters:
gmessage the message to unref

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

void dbus_g_method_return DBusGMethodInvocation context,
  ...
 

Send a return message for a given method invocation, with arguments.

This function also frees the sending context.

Parameters:
context the method 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.

void dbus_g_method_return_error DBusGMethodInvocation context,
GError *  error
 

Send a error message for a given method invocation.

This function also frees the sending context.

Parameters:
context the method context
error the error to send.

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.

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.

This function will not be needed once GLib includes libffi.

Parameters:
marshaller a GClosureMarshal to be used for invocation
rettype a GType for the return type of the function
... The parameter GTypes, followed by G_TYPE_INVALID

Definition at line 1801 of file dbus-gobject.c.

References dbus_g_object_register_marshaller_array(), and TRUE.

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.

See also dbus_g_object_register_marshaller

Parameters:
marshaller a GClosureMarshal to be used for invocation
rettype a GType for the return type of the function
n_types number of function parameters
types a C array of GTypes values

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

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.

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.

Parameters:
object_type GType for the object
info introspection data generated by dbus-glib-tool

Definition at line 1535 of file dbus-gobject.c.

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.

The arguments specified are the GLib types expected.

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

Definition at line 2503 of file dbus-gproxy.c.

References _dbus_gobject_lookup_marshaller(), DBUS_G_PROXY_DESTROYED, FALSE, NULL, and TRUE.

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.

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.

Parameters:
proxy a proxy for a remote interface
method the name of the method to invoke
notify callback to be invoked when method returns
user_data user data passed to callback
destroy function called to destroy user_data
first_arg_type type of the first argument
Returns:
call identifier

Definition at line 2253 of file dbus-gproxy.c.

References DBUS_G_PROXY_DESTROYED, DBUS_G_VALUE_ARRAY_COLLECT_ALL, and FALSE.

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.

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.

Parameters:
proxy a proxy for a remote interface
method method to invoke
error return location for an error
first_arg_type type of first "in" argument
Returns:
FALSE if an error is set, TRUE otherwise

Definition at line 2334 of file dbus-gproxy.c.

References DBUS_G_PROXY_DESTROYED, DBUS_G_VALUE_ARRAY_COLLECT_ALL, FALSE, and NULL.

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.

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

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

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.

void dbus_g_proxy_cancel_call DBusGProxy proxy,
DBusGProxyCall *  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.

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

Definition at line 2422 of file dbus-gproxy.c.

References DBUS_G_PROXY_DESTROYED, dbus_pending_call_cancel(), and NULL.

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.

When the remote interface emits the specified signal, the proxy will emit a corresponding GLib signal.

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

Definition at line 2560 of file dbus-gproxy.c.

References DBUS_G_PROXY_DESTROYED, FALSE, and NULL.

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.

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

Definition at line 2608 of file dbus-gproxy.c.

References DBUS_G_PROXY_DESTROYED, and NULL.

gboolean dbus_g_proxy_end_call DBusGProxy proxy,
DBusGProxyCall *  call,
GError **  error,
GType  first_arg_type,
  ...
 

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.

Parameters:
proxy a proxy for a remote interface
call the pending call ID from dbus_g_proxy_begin_call()
error return location for an error
first_arg_type type of first "out" argument
Returns:
FALSE if an error is set

Definition at line 2302 of file dbus-gproxy.c.

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

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.

Parameters:
proxy the proxy
Returns:
the bus name the proxy sends messages to

Definition at line 1943 of file dbus-gproxy.c.

References DBUS_G_PROXY_DESTROYED, and NULL.

const char* dbus_g_proxy_get_interface DBusGProxy proxy  ) 
 

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

Parameters:
proxy the proxy
Returns:
an object interface

Definition at line 1958 of file dbus-gproxy.c.

References DBUS_G_PROXY_DESTROYED, and NULL.

const char* dbus_g_proxy_get_path DBusGProxy proxy  ) 
 

Gets the path this proxy is bound to.

Parameters:
proxy the proxy
Returns:
an object path

Definition at line 1992 of file dbus-gproxy.c.

References DBUS_G_PROXY_DESTROYED, and NULL.

GType dbus_g_proxy_get_type void   ) 
 

Standard GObject get_type() function for DBusGProxy.

Returns:
type ID for DBusGProxy class

Definition at line 1735 of file dbus-gproxy.c.

References NULL.

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.

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.

Parameters:
connection the connection to the remote bus
name any name on the message bus
path_name name of the object instance to call methods on
interface_name name of the interface to call methods on
Returns:
new proxy object

Definition at line 1812 of file dbus-gproxy.c.

References NULL.

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.

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.

Parameters:
connection the connection to the remote bus
name any name on the message bus
path_name name of the object inside the service to call methods on
interface_name name of the interface to call methods on
error return location for an error
Returns:
new proxy object, or NULL on error

Definition at line 1850 of file dbus-gproxy.c.

References NULL.

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

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.

Parameters:
connection the connection to the peer
path_name name of the object inside the peer to call methods on
interface_name name of the interface to call methods on
Returns:
new proxy object

Definition at line 1915 of file dbus-gproxy.c.

References NULL.

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.

Either or both may be NULL.

Parameters:
proxy the proxy to use as a template
path of the object inside the peer to call methods on
interface name of the interface to call methods on
Returns:
new proxy object

Definition at line 1884 of file dbus-gproxy.c.

References _DBusGProxyManager::connection, _DBusGProxy::interface, _DBusGProxy::manager, _DBusGProxy::name, NULL, and _DBusGProxy::path.

void dbus_g_proxy_send DBusGProxy proxy,
DBusMessage message,
dbus_uint32_t client_serial
 

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.

Parameters:
proxy a proxy for a remote interface
message the message to address and send
client_serial return location for message's serial, or NULL

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

void dbus_g_proxy_set_interface DBusGProxy proxy,
const char *  interface_name
 

Sets the object interface proxy is bound to.

Parameters:
proxy the proxy
interface_name an object interface

Definition at line 1973 of file dbus-gproxy.c.

References _DBusGProxy::interface, and _DBusGProxy::manager.

void dbus_g_thread_init void   ) 
 

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

GType dbus_message_get_g_type void   ) 
 

Get the GLib type ID for a DBusMessage boxed type.

Returns:
GLib type

Definition at line 201 of file dbus-glib.c.

References dbus_message_ref(), and dbus_message_unref().

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.

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.

Parameters:
server the server
context the GMainContext or NULL for default

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.


Generated on Wed Jan 3 04:49:06 2007 for D-BUS by  doxygen 1.4.4