File: //usr/local/ssl/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>DBusGConnection</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.68.1">
<link rel="start" href="index.html" title="D-Bus GLib bindings - Reference Manual">
<link rel="up" href="ch02.html" title="API Reference">
<link rel="prev" href="ch02.html" title="API Reference">
<link rel="next" href="dbus-glib-DBus-GObject-related-functions.html" title="DBus GObject related functions">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="Introduction">
<link rel="chapter" href="ch02.html" title="API Reference">
<link rel="chapter" href="ch03.html" title="Tools Reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch02.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">D-Bus GLib bindings - Reference Manual</th>
<td><a accesskey="n" href="dbus-glib-DBus-GObject-related-functions.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2541581" class="shortcut">Top</a>
 | 
<a href="#id2502157" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="dbus-glib-DBusGConnection"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2541581"></a><span class="refentrytitle">DBusGConnection</span>
</h2>
<p>DBusGConnection — DBus Connection</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1" lang="en">
<a name="id2552209"></a><h2>Stability Level</h2>
Stable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a>;
<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a>* <a href="dbus-glib-DBusGConnection.html#dbus-g-bus-get">dbus_g_bus_get</a> (DBusBusType type,
GError **error);
void <a href="dbus-glib-DBusGConnection.html#dbus-g-thread-init">dbus_g_thread_init</a> (void);
<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a>* <a href="dbus-glib-DBusGConnection.html#dbus-g-connection-open">dbus_g_connection_open</a> (const gchar *address,
GError **error);
<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a>* <a href="dbus-glib-DBusGConnection.html#dbus-g-connection-ref">dbus_g_connection_ref</a> (<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection);
void <a href="dbus-glib-DBusGConnection.html#dbus-g-connection-unref">dbus_g_connection_unref</a> (<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection);
void <a href="dbus-glib-DBusGConnection.html#dbus-g-connection-flush">dbus_g_connection_flush</a> (<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection);
DBusConnection* <a href="dbus-glib-DBusGConnection.html#dbus-g-connection-get-connection">dbus_g_connection_get_connection</a>
(<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *gconnection);
void <a href="dbus-glib-DBusGConnection.html#dbus-g-connection-register-g-object">dbus_g_connection_register_g_object</a>
(<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection,
const char *at_path,
GObject *object);
GObject* <a href="dbus-glib-DBusGConnection.html#dbus-g-connection-lookup-g-object">dbus_g_connection_lookup_g_object</a>
(<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection,
const char *at_path);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2502157"></a><h2>Description</h2>
<p>
A <a href="dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a> is a boxed type abstracting a DBusConnection.</p>
<p>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2502185"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2502196"></a><h3>
<a name="DBusGConnection"></a>DBusGConnection</h3>
<a class="indexterm" name="id2502208"></a><pre class="programlisting">typedef struct _DBusGConnection DBusGConnection;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2502224"></a><h3>
<a name="dbus-g-bus-get"></a>dbus_g_bus_get ()</h3>
<a class="indexterm" name="id2502237"></a><pre class="programlisting"><a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a>* dbus_g_bus_get (DBusBusType type,
GError **error);</pre>
<p>
Returns a connection to the given bus. The connection is a global variable
shared with other callers of this function.
</p>
<p>
(Internally, calls <code class="function">dbus_bus_get()</code> then calls
<a href="dbus-glib-DBus-GLib-low-level.html#dbus-connection-setup-with-g-main"><code class="function">dbus_connection_setup_with_g_main()</code></a> on the result.)</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>type</code></em> :</span></td>
<td> bus type
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
<td> address where an error can be returned.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a DBusConnection
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2544640"></a><h3>
<a name="dbus-g-thread-init"></a>dbus_g_thread_init ()</h3>
<a class="indexterm" name="id2544653"></a><pre class="programlisting">void dbus_g_thread_init (void);</pre>
<p>
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.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2544680"></a><h3>
<a name="dbus-g-connection-open"></a>dbus_g_connection_open ()</h3>
<a class="indexterm" name="id2544691"></a><pre class="programlisting"><a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a>* dbus_g_connection_open (const gchar *address,
GError **error);</pre>
<p>
Returns a connection to the given address.
</p>
<p>
(Internally, calls <code class="function">dbus_connection_open()</code> then calls
<a href="dbus-glib-DBus-GLib-low-level.html#dbus-connection-setup-with-g-main"><code class="function">dbus_connection_setup_with_g_main()</code></a> on the result.)</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>address</code></em> :</span></td>
<td> address of the connection to open
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>error</code></em> :</span></td>
<td> address where an error can be returned.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a DBusConnection
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2544793"></a><h3>
<a name="dbus-g-connection-ref"></a>dbus_g_connection_ref ()</h3>
<a class="indexterm" name="id2544804"></a><pre class="programlisting"><a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a>* dbus_g_connection_ref (<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection);</pre>
<p>
Increment refcount on a <a href="dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a></p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>connection</code></em> :</span></td>
<td>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the connection that was ref'd
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2478380"></a><h3>
<a name="dbus-g-connection-unref"></a>dbus_g_connection_unref ()</h3>
<a class="indexterm" name="id2478391"></a><pre class="programlisting">void dbus_g_connection_unref (<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection);</pre>
<p>
Decrement refcount on a <a href="dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a></p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>connection</code></em> :</span></td>
<td>
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2478445"></a><h3>
<a name="dbus-g-connection-flush"></a>dbus_g_connection_flush ()</h3>
<a class="indexterm" name="id2478457"></a><pre class="programlisting">void dbus_g_connection_flush (<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection);</pre>
<p>
Blocks until outgoing calls and signal emissions have been sent.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td>
<span class="term"><em class="parameter"><code>connection</code></em> :</span></td>
<td> the <a href="dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a> to flush
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2478514"></a><h3>
<a name="dbus-g-connection-get-connection"></a>dbus_g_connection_get_connection ()</h3>
<a class="indexterm" name="id2478527"></a><pre class="programlisting">DBusConnection* dbus_g_connection_get_connection
(<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *gconnection);</pre>
<p>
Get the <span class="type">DBusConnection</span> corresponding to this <a href="dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a>.
The return value does not have its refcount incremented.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>gconnection</code></em> :</span></td>
<td> a <a href="dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> <span class="type">DBusConnection</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2567422"></a><h3>
<a name="dbus-g-connection-register-g-object"></a>dbus_g_connection_register_g_object ()</h3>
<a class="indexterm" name="id2567435"></a><pre class="programlisting">void dbus_g_connection_register_g_object
(<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection,
const char *at_path,
GObject *object);</pre>
<p>
Registers a <span class="type">GObject</span> 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 <code class="function">g_object_class_install_info()</code>.
</p>
<p>
The registration will be cancelled if either the <span class="type">DBusConnection</span> or
the <span class="type">GObject</span> gets finalized.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>connection</code></em> :</span></td>
<td> the D-BUS connection
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>at_path</code></em> :</span></td>
<td> the path where the object will live (the object's name)
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>object</code></em> :</span></td>
<td> the object
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2567554"></a><h3>
<a name="dbus-g-connection-lookup-g-object"></a>dbus_g_connection_lookup_g_object ()</h3>
<a class="indexterm" name="id2567568"></a><pre class="programlisting">GObject* dbus_g_connection_lookup_g_object
(<a href="dbus-glib-DBusGConnection.html#DBusGConnection">DBusGConnection</a> *connection,
const char *at_path);</pre>
<p>
FIXME</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><em class="parameter"><code>connection</code></em> :</span></td>
<td> a <a href="dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>at_path</code></em> :</span></td>
<td> path
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the object at path <em class="parameter"><code>at_path</code></em>
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id2567665"></a><h2>See Also</h2>
<span class="type">DBusConnection</span>
</div>
</div>
</body>
</html>