<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Glib on John Stowers</title><link>https://johnstowers.co.nz/tags/glib/</link><description>Recent content in Glib on John Stowers</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sat, 19 Jan 2008 19:23:53 +0000</lastBuildDate><atom:link href="https://johnstowers.co.nz/tags/glib/index.xml" rel="self" type="application/rss+xml"/><item><title>Shape of things to come</title><link>https://johnstowers.co.nz/2008/01/19/shape-of-things-to-come/</link><pubDate>Sat, 19 Jan 2008 19:23:53 +0000</pubDate><guid>https://johnstowers.co.nz/2008/01/19/shape-of-things-to-come/</guid><description>&lt;p&gt;I just &lt;a href="http://svn.gnome.org/viewvc/conduit?view=revision&amp;amp;revision=1249" rel="noopener"&gt;committed&lt;/a&gt;
 the first version of a working GObject binding to the &lt;a href="http://www.conduit-project.org" rel="noopener"&gt;Conduit&lt;/a&gt;
 DBus API. You can check out an example test program &lt;a href="http://svn.gnome.org/viewvc/conduit/trunk/conduit-glib/test/test-application.c?view=markup" rel="noopener"&gt;here&lt;/a&gt;
.&lt;/p&gt;
&lt;h3 id="contrived-example-like-code"&gt;Contrived Example-like Code&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt; /* The running conduit app/daemon */
 ConduitGApplication *application = conduit_g_application_new ();

 /* Get two dataproviders, a datasource and datasink */
 ConduitGDataprovider *source = conduit_g_application_get_dataprovider(application, &amp;quot;TestSource&amp;quot;);
 ConduitGDataprovider *sink = conduit_g_application_get_dataprovider(application, &amp;quot;TestSink&amp;quot;);

 /* Put them in a conduit so we can sync them */
 ConduitGConduit *conduit = conduit_g_application_build_conduit(application,source,sink);
 g_signal_connect (conduit, &amp;quot;sync-progress&amp;quot;, (GCallback) _sync_progress_cb, NULL);
 g_signal_connect (conduit, &amp;quot;sync-completed&amp;quot;, (GCallback) _sync_completed_cb, NULL);
 g_signal_connect (conduit, &amp;quot;sync-conflict&amp;quot;, (GCallback) _sync_conflict_cb, NULL);

 /* Add it to the GUI so the user can see it (optional) */
 ConduitGSyncset *gui_syncset = conduit_g_syncset_new(application, &amp;quot;/syncset/gui&amp;quot;);
 conduit_g_syncset_add_conduit(gui_syncset, conduit);

 /* Perform the sync (boom!) */
 conduit_g_conduit_sync(conduit);
 g_main_loop_run (mainloop);
&lt;/code&gt;&lt;/pre&gt;
&lt;h3 id="conclusion"&gt;Conclusion&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;A GObject binding to the Conduit DBus API means you can synchronize your application data, from within your application, in very few lines of code;&lt;/p&gt;</description></item></channel></rss>