![]() |
![]() |
![]() |
D-Bus GLib bindings - Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <dbus/dbus-glib.h> DBusGConnection; #define DBUS_TYPE_G_CONNECTION DBusGConnection * dbus_g_bus_get (DBusBusType type
,GError **error
); DBusGConnection * dbus_g_bus_get_private (DBusBusType type
,GMainContext *context
,GError **error
); void dbus_g_thread_init (void
); DBusGConnection * dbus_g_connection_open (const gchar *address
,GError **error
); DBusGConnection * dbus_g_connection_ref (DBusGConnection *connection
); void dbus_g_connection_unref (DBusGConnection *connection
); void dbus_g_connection_flush (DBusGConnection *connection
); DBusConnection * dbus_g_connection_get_connection (DBusGConnection *gconnection
); void dbus_g_connection_register_g_object (DBusGConnection *connection
,const char *at_path
,GObject *object
); void dbus_g_connection_unregister_g_object (DBusGConnection *connection
,GObject *object
); GObject * dbus_g_connection_lookup_g_object (DBusGConnection *connection
,const char *at_path
);
typedef struct _DBusGConnection DBusGConnection;
A DBusGConnection is a boxed type abstracting a DBusConnection from libdbus.
#define DBUS_TYPE_G_CONNECTION (dbus_g_connection_get_g_type ())
Expands to a function call returning the boxed GType of a DBusGConnection.
Returns : |
the GLib type |
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.)
|
bus type |
|
address where an error can be returned. |
Returns : |
a DBusConnection |
DBusGConnection * dbus_g_bus_get_private (DBusBusType type
,GMainContext *context
,GError **error
);
Returns a connection to the given bus. The connection will be a private non-shared connection and should be closed when usage is complete.
Internally this function calls dbus_bus_get_private()
then calls
dbus_connection_setup_with_g_main()
on the result; see the documentation
of the former function for more information on private connections.
|
bus type |
|
Mainloop context to attach to |
|
address where an error can be returned. |
Returns : |
a DBusConnection |
void dbus_g_thread_init (void
);
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.
DBusGConnection * dbus_g_connection_open (const gchar *address
,GError **error
);
Returns a connection to the given address.
(Internally, calls dbus_connection_open()
then calls
dbus_connection_setup_with_g_main()
on the result.)
|
address of the connection to open |
|
address where an error can be returned. |
Returns : |
a DBusConnection |
DBusGConnection * dbus_g_connection_ref (DBusGConnection *connection
);
Increment refcount on a DBusGConnection
|
the DBusGConnection to ref |
Returns : |
the connection that was ref'd |
void dbus_g_connection_unref (DBusGConnection *connection
);
Decrement refcount on a DBusGConnection
|
the connection to unref |
void dbus_g_connection_flush (DBusGConnection *connection
);
Blocks until outgoing calls and signal emissions have been sent.
|
the DBusGConnection to 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.
|
a DBusGConnection |
Returns : |
DBusConnection |
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 dbus_g_object_type_install_info()
.
The registration will be cancelled if either the DBusConnection or
the GObject gets finalized, or if dbus_g_connection_unregister_g_object()
is used.
Note: If an object is registered multiple times, the first registration takes priority for cases such as turning an object into an object path.
|
the D-BUS connection |
|
the path where the object will live (the object's name) |
|
the object |
void dbus_g_connection_unregister_g_object (DBusGConnection *connection
,GObject *object
);
Removes object
from any object paths at which it is exported on
connection
. Properties, methods, and signals
of the object can no longer be accessed remotely.
|
the D-BUS connection |
|
the object |
GObject * dbus_g_connection_lookup_g_object (DBusGConnection *connection
,const char *at_path
);
FIXME
|
a DBusGConnection |
|
path |
Returns : |
the object at path at_path
|