conduit r1249 - in trunk/conduit-glib: . conduit-glib data docs docs/reference po test
- From: jstowers svn gnome org
- To: svn-commits-list gnome org
- Subject: conduit r1249 - in trunk/conduit-glib: . conduit-glib data docs docs/reference po test
- Date: Sat, 19 Jan 2008 05:56:51 +0000 (GMT)
Author: jstowers
Date: Sat Jan 19 05:56:50 2008
New Revision: 1249
URL: http://svn.gnome.org/viewvc/conduit?rev=1249&view=rev
Log:
2008-01-19 John Stowers <john stowers gmail com>
* Add initial GObject bindings to the Conduit DBus API
Added:
trunk/conduit-glib/
trunk/conduit-glib/AUTHORS
trunk/conduit-glib/COPYING (contents, props changed)
trunk/conduit-glib/ChangeLog
trunk/conduit-glib/INSTALL (contents, props changed)
trunk/conduit-glib/MAINTAINERS
trunk/conduit-glib/Makefile.am
trunk/conduit-glib/Makefile.decl
trunk/conduit-glib/NEWS
trunk/conduit-glib/README
trunk/conduit-glib/ROADMAP
trunk/conduit-glib/TODO.tasks
trunk/conduit-glib/autogen.sh (contents, props changed)
trunk/conduit-glib/conduit-glib/
trunk/conduit-glib/conduit-glib.anjuta
trunk/conduit-glib/conduit-glib.pc.in
trunk/conduit-glib/conduit-glib/.cvsignore
trunk/conduit-glib/conduit-glib/Makefile.am
trunk/conduit-glib/conduit-glib/conduit-g-application.c
trunk/conduit-glib/conduit-glib/conduit-g-application.h
trunk/conduit-glib/conduit-glib/conduit-g-conduit.c
trunk/conduit-glib/conduit-glib/conduit-g-conduit.h
trunk/conduit-glib/conduit-glib/conduit-g-dataprovider.c
trunk/conduit-glib/conduit-glib/conduit-g-dataprovider.h
trunk/conduit-glib/conduit-glib/conduit-g-syncset.c
trunk/conduit-glib/conduit-glib/conduit-g-syncset.h
trunk/conduit-glib/conduit-glib/conduit-glib-globals.h
trunk/conduit-glib/conduit-glib/conduit-glib.h
trunk/conduit-glib/conduit-glib/conduit-marshal.list
trunk/conduit-glib/configure.ac
trunk/conduit-glib/data/
trunk/conduit-glib/data/Makefile.am
trunk/conduit-glib/data/application.xml
trunk/conduit-glib/data/conduit.xml
trunk/conduit-glib/data/dataprovider.xml
trunk/conduit-glib/data/generate-instrospection-xml.py (contents, props changed)
trunk/conduit-glib/data/syncset.xml
trunk/conduit-glib/depcomp (contents, props changed)
trunk/conduit-glib/docs/
trunk/conduit-glib/docs/Makefile.am
trunk/conduit-glib/docs/reference/
trunk/conduit-glib/docs/reference/Makefile.am
trunk/conduit-glib/docs/reference/conduit-glib-docs.sgml
trunk/conduit-glib/docs/reference/conduit-glib-sections.txt
trunk/conduit-glib/docs/reference/conduit-glib.types
trunk/conduit-glib/install-sh (contents, props changed)
trunk/conduit-glib/missing (contents, props changed)
trunk/conduit-glib/po/
trunk/conduit-glib/po/.cvsignore
trunk/conduit-glib/po/ChangeLog
trunk/conduit-glib/po/LINGUAS
trunk/conduit-glib/po/Makefile.in.in
trunk/conduit-glib/po/POTFILES.in
trunk/conduit-glib/test/
trunk/conduit-glib/test/Makefile.am
trunk/conduit-glib/test/test-application.c
Added: trunk/conduit-glib/AUTHORS
==============================================================================
Added: trunk/conduit-glib/COPYING
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/COPYING Sat Jan 19 05:56:50 2008
@@ -0,0 +1 @@
+link /usr/share/automake-1.9/COPYING
\ No newline at end of file
Added: trunk/conduit-glib/INSTALL
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/INSTALL Sat Jan 19 05:56:50 2008
@@ -0,0 +1 @@
+link /usr/share/automake-1.9/INSTALL
\ No newline at end of file
Added: trunk/conduit-glib/MAINTAINERS
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/MAINTAINERS Sat Jan 19 05:56:50 2008
@@ -0,0 +1,3 @@
+John Stowers
+E-mail: john stowers gmail com
+Userid: jstowers
Added: trunk/conduit-glib/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/Makefile.am Sat Jan 19 05:56:50 2008
@@ -0,0 +1,38 @@
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = \
+ conduit-glib \
+ docs \
+ data \
+ po \
+ test
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = conduit-glib.pc
+
+conduit_glibdocdir = ${prefix}/doc/conduit-glib
+
+conduit_glibdoc_DATA = \
+ README \
+ COPYING \
+ AUTHORS \
+ INSTALL \
+ MAINTAINERS
+
+EXTRA_DIST = \
+ intltool-extract.in \
+ intltool-merge.in \
+ intltool-update.in \
+ conduit-glib.pc.in \
+ TODO.tasks \
+ conduit-glib.anjuta \
+ $(conduit_glibdoc_DATA)
+
+DISTCLEANFILES = \
+ intltool-extract \
+ intltool-merge \
+ intltool-update
+
+DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
+
+
Added: trunk/conduit-glib/Makefile.decl
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/Makefile.decl Sat Jan 19 05:56:50 2008
@@ -0,0 +1,60 @@
+# GLIB - Library of useful C routines
+#
+# This file is copied almost verbatim from the GLib-2.0 distribution
+#
+
+GTESTER = gtester # for non-GLIB packages
+GTESTER_REPORT = $(top_builddir)/test/gtester-report # for the GLIB package
+
+# initialize variables for unconditional += appending
+EXTRA_DIST =
+TEST_PROGS =
+
+### testing rules
+
+# test: run all tests in cwd and subdirs
+test: ${TEST_PROGS}
+ @test -z "${TEST_PROGS}" || ${GTESTER} --verbose ${TEST_PROGS}
+ @ for subdir in $(SUBDIRS) ; do \
+ test "$$subdir" = "." -o "$$subdir" = "po" || \
+ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+ done
+# test-report: run tests in subdirs and generate report
+# perf-report: run tests in subdirs with -m perf and generate report
+# full-report: like test-report: with -m perf and -m slow
+test-report perf-report full-report: ${TEST_PROGS}
+ @test -z "${TEST_PROGS}" || { \
+ case $@ in \
+ test-report) test_options="-k";; \
+ perf-report) test_options="-k -m=perf";; \
+ full-report) test_options="-k -m=perf -m=slow";; \
+ esac ; \
+ if test -z "$$GTESTER_LOGDIR" ; then \
+ ${GTESTER} --verbose $$test_options -o test-report.xml ${TEST_PROGS} ; \
+ elif test -n "${TEST_PROGS}" ; then \
+ ${GTESTER} --verbose $$test_options -o `mktemp "$$GTESTER_LOGDIR/log-XXXXXX"` ${TEST_PROGS} ; \
+ fi ; \
+ }
+ @ ignore_logdir=true ; \
+ if test -z "$$GTESTER_LOGDIR" ; then \
+ GTESTER_LOGDIR=`mktemp -d "\`pwd\`/.testlogs-XXXXXX"`; export GTESTER_LOGDIR ; \
+ ignore_logdir=false ; \
+ fi ; \
+ for subdir in $(SUBDIRS) ; do \
+ test "$$subdir" = "." -o "$$subdir" = "po" || \
+ ( cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@ ) || exit $? ; \
+ done ; \
+ $$ignore_logdir || { \
+ echo '<?xml version="1.0"?>' > $ xml ; \
+ echo '<report-collection>' >> $ xml ; \
+ for lf in `ls -L "$$GTESTER_LOGDIR"/.` ; do \
+ sed '1,1s/^<?xml\b[^>?]*?>//' <"$$GTESTER_LOGDIR"/"$$lf" >> $ xml ; \
+ done ; \
+ echo >> $ xml ; \
+ echo '</report-collection>' >> $ xml ; \
+ rm -rf "$$GTESTER_LOGDIR"/ ; \
+ ${GTESTER_REPORT} --version 2>/dev/null 1>&2 ; test "$$?" != 0 || ${GTESTER_REPORT} $ xml >$ html ; \
+ }
+.PHONY: test test-report perf-report full-report
+# run make test as part of make check
+check-local: test
Added: trunk/conduit-glib/NEWS
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/NEWS Sat Jan 19 05:56:50 2008
@@ -0,0 +1 @@
+
Added: trunk/conduit-glib/README
==============================================================================
Added: trunk/conduit-glib/ROADMAP
==============================================================================
Added: trunk/conduit-glib/TODO.tasks
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/TODO.tasks Sat Jan 19 05:56:50 2008
@@ -0,0 +1,3 @@
+<?xml version="1.0"?>
+<gtodo>
+</gtodo>
Added: trunk/conduit-glib/autogen.sh
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/autogen.sh Sat Jan 19 05:56:50 2008
@@ -0,0 +1,172 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+DIE=0
+
+if [ -n "$GNOME2_DIR" ]; then
+ ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
+ LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
+ PATH="$GNOME2_DIR/bin:$PATH"
+ export PATH
+ export LD_LIBRARY_PATH
+fi
+
+(test -f $srcdir/configure.ac) || {
+ echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+ echo " top-level package directory"
+ exit 1
+}
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`autoconf' installed."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+(grep "^IT_PROG_INTLTOOL" $srcdir/configure.ac >/dev/null) && {
+ (intltoolize --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`intltool' installed."
+ echo "You can get it from:"
+ echo " ftp://ftp.gnome.org/pub/GNOME/"
+ DIE=1
+ }
+}
+
+(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.ac >/dev/null) && {
+ (xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`xml-i18n-toolize' installed."
+ echo "You can get it from:"
+ echo " ftp://ftp.gnome.org/pub/GNOME/"
+ DIE=1
+ }
+}
+
+(grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
+ (libtool --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`libtool' installed."
+ echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+ }
+}
+
+(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.ac >/dev/null) && {
+ (grep "sed.*POTFILES" $srcdir/configure.ac) > /dev/null || \
+ (glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`glib' installed."
+ echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
+ DIE=1
+ }
+}
+
+(automake --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`automake' installed."
+ echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+ NO_AUTOMAKE=yes
+}
+
+(gtkdocize --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: You must have \`gtkdocize' installed."
+ echo "Usually found in your distribution's \`gtk-doc-tools' package"
+ DIE=1
+ NO_GTKDOC=true
+}
+
+# if no automake, don't bother testing for aclocal
+test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "**Error**: Missing \`aclocal'. The version of \`automake'"
+ echo "installed doesn't appear recent enough."
+ echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "**Warning**: I am going to run \`configure' with no arguments."
+ echo "If you wish to pass any to it, please specify them on the"
+ echo \`$0\'" command line."
+ echo
+fi
+
+case $CC in
+xlc )
+ am_opt=--include-deps;;
+esac
+
+for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.ac -print`
+do
+ dr=`dirname $coin`
+ if test -f $dr/NO-AUTO-GEN; then
+ echo skipping $dr -- flagged as no auto-gen
+ else
+ echo processing $dr
+ ( cd $dr
+
+ aclocalinclude="$ACLOCAL_FLAGS"
+
+ if grep "^AM_GLIB_GNU_GETTEXT" configure.ac >/dev/null; then
+ echo "Creating $dr/aclocal.m4 ..."
+ test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
+ echo "Running glib-gettextize... Ignore non-fatal messages."
+ echo "no" | glib-gettextize --force --copy
+ echo "Making $dr/aclocal.m4 writable ..."
+ test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
+ fi
+ if grep "^IT_PROG_INTLTOOL" configure.ac >/dev/null; then
+ echo "Running intltoolize..."
+ intltoolize --copy --force --automake
+ fi
+ if grep "^AM_PROG_XML_I18N_TOOLS" configure.ac >/dev/null; then
+ echo "Running xml-i18n-toolize..."
+ xml-i18n-toolize --copy --force --automake
+ fi
+ if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
+ if test -z "$NO_LIBTOOLIZE" ; then
+ echo "Running libtoolize..."
+ libtoolize --force --copy
+ fi
+ fi
+ if "$NO_GTKDOC"; then
+ echo "Not building API documentation, no \`gtkdocize'"
+ else
+ echo "Running gtkdocize ..."
+ gtkdocize || exit 1
+ fi
+ echo "Running aclocal $aclocalinclude ..."
+ aclocal $aclocalinclude
+ if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
+ echo "Running autoheader..."
+ autoheader
+ fi
+ echo "Running automake --gnu $am_opt ..."
+ automake --add-missing --gnu $am_opt
+ echo "Running autoconf ..."
+ autoconf
+ )
+ fi
+done
+
+conf_flags="--enable-maintainer-mode"
+
+if test x$NOCONFIGURE = x; then
+ echo Running $srcdir/configure $conf_flags "$@" ...
+ $srcdir/configure $conf_flags "$@" \
+ && echo Now type \`make\' to compile. || exit 1
+else
+ echo Skipping configure process.
+fi
Added: trunk/conduit-glib/conduit-glib.anjuta
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib.anjuta Sat Jan 19 05:56:50 2008
@@ -0,0 +1,44 @@
+<?xml version="1.0"?>
+<anjuta>
+ <plugin name="GBF Project Manager"
+ url="http://anjuta.org/plugins/"
+ mandatory="yes">
+ <require group="Anjuta Plugin"
+ attribute="Interfaces"
+ value="IAnjutaProjectManager"/>
+ <require group="Project"
+ attribute="Supported-Project-Types"
+ value="automake"/>
+ </plugin>
+ <plugin name="Symbol Browser"
+ url="http://anjuta.org/plugins/"
+ mandatory="yes">
+ <require group="Anjuta Plugin"
+ attribute="Location"
+ value="anjuta-symbol-browser:SymbolBrowserPlugin"/>
+ </plugin>
+ <plugin name="Make Build System"
+ url="http://anjuta.org/plugins/"
+ mandatory="yes">
+ <require group="Anjuta Plugin"
+ attribute="Interfaces"
+ value="IAnjutaBuildable"/>
+ <require group="Build"
+ attribute="Supported-Build-Types"
+ value="make"/>
+ </plugin>
+ <plugin name="Task Manager"
+ url="http://anjuta.org/plugins/"
+ mandatory="no">
+ <require group="Anjuta Plugin"
+ attribute="Interfaces"
+ value="IAnjutaTodo"/>
+ </plugin>
+ <plugin name="Debug Manager"
+ url="http://anjuta.org/plugins/"
+ mandatory="no">
+ <require group="Anjuta Plugin"
+ attribute="Interfaces"
+ value="IAnjutaDebuggerManager"/>
+ </plugin>
+</anjuta>
Added: trunk/conduit-glib/conduit-glib.pc.in
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib.pc.in Sat Jan 19 05:56:50 2008
@@ -0,0 +1,11 @@
+prefix= prefix@
+exec_prefix= exec_prefix@
+libdir= libdir@
+includedir= includedir@
+
+Name: @PACKAGE_NAME@
+Description: GLib bindings for Conduit
+Version: @PACKAGE_VERSION@
+Requires: glib-2.0 gobject-2.0 dbus-glib-1
+Libs: -L${libdir} -lconduit-glib
+Cflags: -I${includedir}/conduit-1.0
Added: trunk/conduit-glib/conduit-glib/.cvsignore
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/.cvsignore Sat Jan 19 05:56:50 2008
@@ -0,0 +1,17 @@
+.libs
+.deps
+.*swp
+.nautilus-metafile.xml
+*.autosave
+*.bak
+*~
+#*#
+*.gladep
+*.la
+*.lo
+*.o
+*.class
+*.pyc
+*.plugin
+Makefile
+Makefile.in
Added: trunk/conduit-glib/conduit-glib/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/Makefile.am Sat Jan 19 05:56:50 2008
@@ -0,0 +1,68 @@
+## Process this file with automake to produce Makefile.in
+
+## Created by Anjuta
+
+INCLUDES = \
+ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+ -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
+ -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
+ -I$(top_srcdir) -I$(srcdir) \
+ $(CONDUIT_GLIB_CFLAGS)
+
+AM_CFLAGS =\
+ -Wall\
+ -g
+
+#
+# Headers to be installed
+#
+devel_headers_HEADERS = \
+ conduit-g-application.h \
+ conduit-glib.h
+
+#
+# Path to install headers in
+#
+devel_headersdir = $(includedir)/conduit-glib
+
+lib_LTLIBRARIES = \
+ libconduit-glib.la
+
+EXTRA_DIST=conduit-marshal.list
+
+BUILT_SOURCES = \
+ conduit-marshal.c \
+ conduit-marshal.h \
+ conduit-application-bindings.h \
+ conduit-dataprovider-bindings.h \
+ conduit-conduit-bindings.h \
+ conduit-syncset-bindings.h
+
+libconduit_glib_la_SOURCES = \
+ conduit-g-application.c \
+ conduit-g-application.h \
+ conduit-g-dataprovider.c \
+ conduit-g-dataprovider.h \
+ conduit-g-conduit.c \
+ conduit-g-conduit.h \
+ conduit-g-syncset.c \
+ conduit-g-syncset.h \
+ conduit-glib-globals.h \
+ conduit-glib.h \
+ $(BUILT_SOURCES)
+
+
+libconduit_glib_la_LIBADD = \
+ $(conduit_GLIB_LIBS)
+
+conduit-marshal.h: conduit-marshal.list
+ glib-genmarshal --header --prefix=conduit_marshal $< > conduit-marshal.h
+
+conduit-marshal.c: conduit-marshal.list
+ glib-genmarshal --body --prefix=conduit_marshal $< > conduit-marshal.c
+
+conduit-%-bindings.h: $(top_srcdir)/data/%.xml
+ dbus-binding-tool --mode=glib-client --output=$@ --prefix=$(subst -,_,$*) $^
+
+CLEANFILES = $(BUILT_SOURCES)
+
Added: trunk/conduit-glib/conduit-glib/conduit-g-application.c
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-g-application.c Sat Jan 19 05:56:50 2008
@@ -0,0 +1,319 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "conduit-g-application.h"
+#include "conduit-application-bindings.h"
+#include "conduit-g-dataprovider.h"
+#include "conduit-g-conduit.h"
+#include "conduit-marshal.h"
+
+#define CONDUIT_APPLICATION_DBUS_NAME "org.conduit.Application"
+#define CONDUIT_APPLICATION_DBUS_INTERFACE "org.conduit.Application"
+#define CONDUIT_APPLICATION_DBUS_PATH "/"
+
+struct _ConduitGApplicationPrivate {
+ DBusGProxy *proxy;
+ DBusGConnection *connection;
+ DBusGProxyCall *session_request_call;
+};
+
+/* Property ids */
+enum
+{
+ PROP_0,
+
+ PROP_VERSION,
+
+ LAST_PROPERTY
+};
+
+/* Signals */
+enum
+{
+ DATAPROVIDER_AVAILABLE,
+ DATAPROVIDER_UNAVAILABLE,
+
+ LAST_SIGNAL
+};
+
+static guint g_application_signals[LAST_SIGNAL] = { 0 };
+
+/* Private methods */
+static void _dispatch_dataprovider_available (DBusGProxy *proxy,
+ const gchar *key,
+ ConduitGApplication *application);
+
+static void _dispatch_dataprovider_unavailable (DBusGProxy *proxy,
+ const gchar *key,
+ ConduitGApplication *application);
+
+G_DEFINE_TYPE (ConduitGApplication, conduit_g_application, G_TYPE_OBJECT);
+
+static void
+conduit_g_application_finalize (GObject *application_obj)
+{
+ ConduitGApplication *application;
+ ConduitGApplicationPrivate *priv;
+
+ application = CONDUIT_G_APPLICATION (application_obj);
+ priv = application->priv;
+
+ /* Free private members */
+ if (priv->proxy) g_object_unref (priv->proxy);
+ if (priv->connection) dbus_g_connection_unref (priv->connection);
+
+ /* Free fundamental structs */
+ g_free (application->priv);
+
+ G_OBJECT_CLASS (conduit_g_application_parent_class)->finalize (application_obj);
+}
+
+static void
+conduit_g_application_set_property (GObject *object, guint prop_id,
+ const GValue *value, GParamSpec *pspec)
+{
+ ConduitGApplication *application;
+
+ g_return_if_fail (CONDUIT_IS_G_APPLICATION (object));
+
+ if (prop_id <= PROP_0 || prop_id >= LAST_PROPERTY) {
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+
+ application = CONDUIT_G_APPLICATION (object);
+}
+
+static void
+conduit_g_application_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
+{
+ ConduitGApplication *application;
+
+ g_return_if_fail (CONDUIT_IS_G_APPLICATION (object));
+
+ application = CONDUIT_G_APPLICATION (object);
+
+ switch (prop_id)
+ {
+ case PROP_VERSION:
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ return;
+ break;
+ }
+}
+
+static void
+conduit_g_application_class_init (ConduitGApplicationClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = conduit_g_application_finalize;
+ object_class->set_property = conduit_g_application_set_property;
+ object_class->get_property = conduit_g_application_get_property;
+
+ /* Register a signal marshaller for the SyncCompleted signal */
+ dbus_g_object_register_marshaller(conduit_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN,
+ G_TYPE_NONE, G_TYPE_BOOLEAN,G_TYPE_BOOLEAN,G_TYPE_BOOLEAN,
+ G_TYPE_INVALID);
+
+ g_object_class_install_property (object_class,
+ PROP_VERSION,
+ g_param_spec_string ("version",
+ "Conduit version",
+ "Conduit version",
+ "",
+ G_PARAM_READABLE));
+
+ /**
+ * ConduitGApplication::dataprovider-available
+ * @application: The object on which this signal is emitted
+ * @key: DP key
+ *
+ * Emitted when new dp is detected
+ */
+ g_application_signals[DATAPROVIDER_AVAILABLE] =
+ g_signal_new ("dataprovider-available",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
+
+ /**
+ * ConduitGApplication::dataprovider-unavailable
+ * @application: The object on which this signal is emitted
+ * @key: DP key
+ *
+ * Emitted when a dp goes away
+ */
+ g_application_signals[DATAPROVIDER_UNAVAILABLE] =
+ g_signal_new ("dataprovider-unavailable",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1,
+ G_TYPE_STRING);
+}
+
+static void
+conduit_g_application_init (ConduitGApplication *application)
+{
+ ConduitGApplicationPrivate *priv;
+
+ priv = g_new0 (ConduitGApplicationPrivate, 1);
+ priv->proxy = NULL;
+
+ application->priv = priv;
+}
+
+/**
+ * conduit_g_application_new
+ * @returns: A newly created #ConduitGApplication or %NULL if there is an error
+ * connecting to DBus session bus.
+ *
+ * Returns %NULL if there is an error connecting to the DBus session bus.
+ */
+ConduitGApplication*
+conduit_g_application_new (void)
+{
+ ConduitGApplication *application;
+ DBusGConnection *connection;
+ DBusGProxy *proxy;
+ GError *error;
+
+ error = NULL;
+ connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+
+ if (connection == NULL)
+ {
+ g_critical ("Failed to open connection to bus: %s\n", error->message);
+ g_error_free (error);
+ return NULL;
+ }
+
+ proxy = dbus_g_proxy_new_for_name (connection,
+ CONDUIT_APPLICATION_DBUS_NAME,
+ CONDUIT_APPLICATION_DBUS_PATH,
+ CONDUIT_APPLICATION_DBUS_INTERFACE);
+
+ application = CONDUIT_G_APPLICATION (g_object_new (CONDUIT_TYPE_G_APPLICATION, NULL));
+ application->priv->connection = connection;
+ application->priv->proxy = proxy;
+
+ dbus_g_proxy_add_signal (proxy, "DataproviderAvailable",
+ G_TYPE_STRING, G_TYPE_INVALID);
+
+ dbus_g_proxy_add_signal (proxy, "DataproviderUnavailable",
+ G_TYPE_STRING, G_TYPE_INVALID);
+
+ dbus_g_proxy_connect_signal (proxy,
+ "DataproviderAvailable",
+ G_CALLBACK(_dispatch_dataprovider_available),
+ application, NULL);
+
+ dbus_g_proxy_connect_signal (proxy,
+ "DataproviderUnavailable",
+ G_CALLBACK(_dispatch_dataprovider_unavailable),
+ application, NULL);
+
+ return application;
+}
+
+gchar **
+conduit_g_application_get_all_dataproviders (ConduitGApplication *application)
+{
+ gchar **array;
+ GError *error;
+
+ array = NULL;
+ error = NULL;
+ if (!org_conduit_Application_get_all_data_providers (application->priv->proxy, &array, &error)) {
+ g_critical ("Error listing dataprovider: %s\n", error->message);
+ g_error_free (error);
+ }
+ return array;
+}
+
+ConduitGDataprovider *
+conduit_g_application_get_dataprovider (ConduitGApplication *application, const gchar *name)
+{
+ GError *error;
+ gchar *path;
+ ConduitGDataprovider *dp;
+
+ error = NULL;
+ path = NULL;
+ if (!org_conduit_Application_get_data_provider(application->priv->proxy, name, &path, &error)) {
+ g_critical ("Error getting dataprovider: %s\n", error->message);
+ g_error_free (error);
+ return NULL;
+ }
+ dp = conduit_g_dataprovider_new(application, path);
+ return dp;
+}
+
+ConduitGConduit *
+conduit_g_application_build_conduit (ConduitGApplication *application, ConduitGDataprovider *source, ConduitGDataprovider *sink)
+{
+ GError *error;
+ const gchar *source_path, *sink_path;
+ gchar *conduit_path;
+ ConduitGConduit *conduit;
+
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (source), NULL);
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (sink), NULL);
+
+ source_path = conduit_g_dataprovider_get_object_path(source);
+ sink_path = conduit_g_dataprovider_get_object_path(sink);
+
+ error = NULL;
+ if (!org_conduit_Application_build_conduit(application->priv->proxy, source_path, sink_path, &conduit_path, &error)) {
+ g_critical ("Error building conduit: %s\n", error->message);
+ g_error_free (error);
+ return NULL;
+ }
+ conduit = conduit_g_conduit_new(application, conduit_path);
+ return conduit;
+}
+
+static void
+_dispatch_dataprovider_available (DBusGProxy *proxy,
+ const gchar *key,
+ ConduitGApplication *application)
+{
+ g_signal_emit (application, g_application_signals[DATAPROVIDER_AVAILABLE], 0, key);
+}
+
+static void
+_dispatch_dataprovider_unavailable (DBusGProxy *proxy,
+ const gchar *key,
+ ConduitGApplication *application)
+{
+ g_signal_emit (application, g_application_signals[DATAPROVIDER_UNAVAILABLE], 0, key);
+}
+
+
Added: trunk/conduit-glib/conduit-glib/conduit-g-application.h
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-g-application.h Sat Jan 19 05:56:50 2008
@@ -0,0 +1,78 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _CONDUIT_G_APPLICATION_H_
+#define _CONDUIT_G_APPLICATION_H_
+
+#include <glib-object.h>
+#include <dbus/dbus-glib.h>
+
+G_BEGIN_DECLS
+
+#define CONDUIT_TYPE_G_APPLICATION (conduit_g_application_get_type ())
+#define CONDUIT_G_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONDUIT_TYPE_G_APPLICATION, ConduitGApplication))
+#define CONDUIT_G_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONDUIT_TYPE_G_APPLICATION, ConduitGApplicationClass))
+#define CONDUIT_IS_G_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONDUIT_TYPE_G_APPLICATION))
+#define CONDUIT_IS_G_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONDUIT_TYPE_G_APPLICATION))
+#define CONDUIT_G_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONDUIT_TYPE_G_APPLICATION, ConduitGApplicationClass))
+
+// Public structs
+typedef struct _ConduitGApplication ConduitGApplication;
+typedef struct _ConduitGApplicationClass ConduitGApplicationClass;
+
+// Private structs
+typedef struct _ConduitGApplicationPrivate ConduitGApplicationPrivate;
+
+// Forward declarations
+typedef struct _ConduitGDataprovider ConduitGDataprovider;
+typedef struct _ConduitGConduit ConduitGConduit;
+ConduitGDataprovider* conduit_g_dataprovider_new (ConduitGApplication *application, gchar *path);
+const gchar* conduit_g_dataprovider_get_object_path (ConduitGDataprovider *dataprovider);
+ConduitGConduit* conduit_g_conduit_new (ConduitGApplication *application, gchar *path);
+const gchar* conduit_g_conduit_get_object_path (ConduitGConduit *conduit);
+
+struct _ConduitGApplicationClass
+{
+ GObjectClass parent_class;
+};
+
+struct _ConduitGApplication
+{
+ GObject parent_instance;
+ ConduitGApplicationPrivate *priv;
+};
+
+
+// Public methods
+GType conduit_g_application_get_type (void) G_GNUC_CONST;
+
+ConduitGApplication* conduit_g_application_new (void);
+
+gchar** conduit_g_application_get_all_dataproviders (ConduitGApplication *application);
+
+ConduitGDataprovider* conduit_g_application_get_dataprovider (ConduitGApplication *application, const gchar *name);
+
+ConduitGConduit * conduit_g_application_build_conduit (ConduitGApplication *application, ConduitGDataprovider *source, ConduitGDataprovider *sink);
+
+G_END_DECLS
+
+#endif /* _CONDUIT_G_APPLICATION_H_ */
Added: trunk/conduit-glib/conduit-glib/conduit-g-conduit.c
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-g-conduit.c Sat Jan 19 05:56:50 2008
@@ -0,0 +1,261 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "conduit-g-conduit.h"
+#include "conduit-conduit-bindings.h"
+#include "conduit-g-application.h"
+#include "conduit-glib-globals.h"
+#include "conduit-marshal.h"
+
+struct _ConduitGConduitPrivate {
+ ConduitGApplication *application;
+ DBusGProxy *proxy;
+ DBusGProxyCall *proxy_request_call;
+};
+
+/* Signals */
+enum
+{
+ SYNC_STARTED,
+ SYNC_PROGRESS,
+ SYNC_COMPLETED,
+ SYNC_CONFLICT,
+
+ LAST_SIGNAL
+};
+
+static guint g_conduit_signals[LAST_SIGNAL] = { 0 };
+
+/* Private methods */
+static void _dispatch_sync_started (DBusGProxy *proxy,
+ ConduitGConduit *conduit);
+
+static void _dispatch_sync_progress (DBusGProxy *proxy,
+ gdouble progress,
+ ConduitGConduit *conduit);
+
+static void _dispatch_sync_completed (DBusGProxy *proxy,
+ gboolean aborted,
+ gboolean errored,
+ gboolean conflicted,
+ ConduitGConduit *conduit);
+
+static void _dispatch_sync_conflict (DBusGProxy *proxy,
+ ConduitGConduit *conduit);
+
+/* Private methods */
+
+G_DEFINE_TYPE (ConduitGConduit, conduit_g_conduit, G_TYPE_OBJECT);
+
+/**
+ * SECTION:conduit-g-conduit
+ * @short_description: Represents a conduit
+ * @see_also: #ConduitGApplication
+ *
+ * #ConduitGConduit is a client side representation of a conduit which links one source
+ * with one or more dataproviders.
+ *
+ */
+
+static void
+conduit_g_conduit_init (ConduitGConduit *conduit)
+{
+ ConduitGConduitPrivate *priv;
+
+ priv = g_new0 (ConduitGConduitPrivate, 1);
+ priv->application = NULL;
+ priv->proxy = NULL;
+ priv->proxy_request_call = NULL;
+
+ conduit->priv = priv;
+}
+
+static void
+conduit_g_conduit_finalize (GObject *object)
+{
+ ConduitGConduit *conduit;
+ ConduitGConduitPrivate *priv;
+
+ conduit = CONDUIT_G_CONDUIT(object);
+ priv = conduit->priv;
+
+ g_object_unref (priv->application);
+
+ g_free (conduit->priv);
+
+ G_OBJECT_CLASS (conduit_g_conduit_parent_class)->finalize (object);
+}
+
+static void
+conduit_g_conduit_class_init (ConduitGConduitClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = conduit_g_conduit_finalize;
+
+ g_conduit_signals[SYNC_STARTED] =
+ g_signal_new ("sync-started",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ g_conduit_signals[SYNC_PROGRESS] =
+ g_signal_new ("sync-progress",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__DOUBLE,
+ G_TYPE_NONE, 1,
+ G_TYPE_DOUBLE);
+
+ g_conduit_signals[SYNC_COMPLETED] =
+ g_signal_new ("sync-completed",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ conduit_marshal_VOID__BOOLEAN_BOOLEAN_BOOLEAN,
+ G_TYPE_NONE, 3,
+ G_TYPE_BOOLEAN,G_TYPE_BOOLEAN,G_TYPE_BOOLEAN);
+
+ g_conduit_signals[SYNC_CONFLICT] =
+ g_signal_new ("sync-conflict",
+ G_OBJECT_CLASS_TYPE (klass),
+ G_SIGNAL_RUN_LAST,
+ 0,
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+}
+
+/**
+ * conduit_g_conduit_new
+ * @application: The session to be parent of the new conduit
+ * @path: The object path
+ * @returns: A newly allocated #ConduitGConduit
+ *
+ * Package private constructor. Use conduit_g_application_get_dataprovider
+ * as the public api.
+ */
+ConduitGConduit*
+conduit_g_conduit_new (ConduitGApplication *application, gchar *path)
+{
+ ConduitGConduit *conduit;
+ DBusGConnection *connection;
+ DBusGProxy *proxy;
+
+ conduit = CONDUIT_G_CONDUIT (g_object_new (CONDUIT_TYPE_G_CONDUIT, NULL));
+ conduit->priv->application = application;
+
+ g_object_ref (application);
+
+ /* We need to react if the application is closed as we
+ * are invalid in that case
+ g_signal_connect (application, "closed",
+ G_CALLBACK(_conduit_application_closed), NULL); */
+
+ connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
+ proxy = dbus_g_proxy_new_for_name (connection,
+ CONDUIT_CONDUIT_DBUS_NAME,
+ path,
+ CONDUIT_CONDUIT_DBUS_INTERFACE);
+ conduit->priv->proxy = proxy;
+
+ dbus_g_proxy_add_signal (proxy, "SyncStarted", G_TYPE_INVALID);
+ dbus_g_proxy_add_signal (proxy, "SyncProgress", G_TYPE_DOUBLE, G_TYPE_INVALID);
+ dbus_g_proxy_add_signal (proxy, "SyncCompleted",
+ G_TYPE_BOOLEAN,G_TYPE_BOOLEAN,G_TYPE_BOOLEAN,G_TYPE_INVALID);
+ dbus_g_proxy_add_signal (proxy, "SyncConflict", G_TYPE_INVALID);
+
+ dbus_g_proxy_connect_signal (proxy,
+ "SyncStarted",
+ G_CALLBACK(_dispatch_sync_started),
+ conduit, NULL);
+
+ dbus_g_proxy_connect_signal (proxy,
+ "SyncProgress",
+ G_CALLBACK(_dispatch_sync_progress),
+ conduit, NULL);
+
+ dbus_g_proxy_connect_signal (proxy,
+ "SyncCompleted",
+ G_CALLBACK(_dispatch_sync_completed),
+ conduit, NULL);
+
+ dbus_g_proxy_connect_signal (proxy,
+ "SyncConflict",
+ G_CALLBACK(_dispatch_sync_conflict),
+ conduit, NULL);
+
+ return conduit;
+}
+
+gboolean
+conduit_g_conduit_sync (ConduitGConduit *conduit)
+{
+ GError *error;
+
+ g_return_val_if_fail (CONDUIT_IS_G_CONDUIT (conduit), FALSE);
+
+ error = NULL;
+ if(!org_conduit_Conduit_sync(conduit->priv->proxy, &error)) {
+ g_critical ("Error calling sync: %s\n", error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+const gchar*
+conduit_g_conduit_get_object_path (ConduitGConduit *conduit)
+{
+ g_return_val_if_fail (CONDUIT_IS_G_CONDUIT (conduit), NULL);
+ return dbus_g_proxy_get_path(conduit->priv->proxy);
+}
+
+static void
+_dispatch_sync_started (DBusGProxy *proxy, ConduitGConduit *conduit)
+{
+ g_signal_emit (conduit, g_conduit_signals[SYNC_STARTED], 0);
+}
+
+static void
+_dispatch_sync_progress (DBusGProxy *proxy, gdouble progress, ConduitGConduit *conduit)
+{
+ g_signal_emit (conduit, g_conduit_signals[SYNC_PROGRESS], 0, progress);
+}
+
+static void
+_dispatch_sync_completed (DBusGProxy *proxy, gboolean aborted, gboolean errored, gboolean conflicted, ConduitGConduit *conduit)
+{
+ g_signal_emit (conduit, g_conduit_signals[SYNC_COMPLETED], 0, aborted, errored, conflicted);
+}
+
+static void
+_dispatch_sync_conflict (DBusGProxy *proxy, ConduitGConduit *conduit)
+{
+ g_signal_emit (conduit, g_conduit_signals[SYNC_CONFLICT], 0);
+}
Added: trunk/conduit-glib/conduit-glib/conduit-g-conduit.h
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-g-conduit.h Sat Jan 19 05:56:50 2008
@@ -0,0 +1,64 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _CONDUIT_G_CONDUIT_H_
+#define _CONDUIT_G_CONDUIT_H_
+
+#include <glib-object.h>
+#include <conduit-glib/conduit-g-application.h>
+
+G_BEGIN_DECLS
+
+#define CONDUIT_TYPE_G_CONDUIT (conduit_g_conduit_get_type ())
+#define CONDUIT_G_CONDUIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONDUIT_TYPE_G_CONDUIT, ConduitGConduit))
+#define CONDUIT_G_CONDUIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONDUIT_TYPE_G_CONDUIT, ConduitGConduitClass))
+#define CONDUIT_IS_G_CONDUIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONDUIT_TYPE_G_CONDUIT))
+#define CONDUIT_IS_G_CONDUIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONDUIT_TYPE_G_CONDUIT))
+#define CONDUIT_G_CONDUIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONDUIT_TYPE_G_CONDUIT, ConduitGConduitClass))
+
+/* Public structs */
+/* Foward declared in application.h
+typedef struct _ConduitGConduit ConduitGConduit; */
+typedef struct _ConduitGConduitClass ConduitGConduitClass;
+
+/* Private structs */
+typedef struct _ConduitGConduitPrivate ConduitGConduitPrivate;
+
+struct _ConduitGConduitClass
+{
+ GObjectClass parent_class;
+};
+
+struct _ConduitGConduit
+{
+ GObject parent_instance;
+ ConduitGConduitPrivate *priv;
+};
+
+/* Public methods */
+GType conduit_g_conduit_get_type (void) G_GNUC_CONST;
+
+gboolean conduit_g_conduit_sync (ConduitGConduit *conduit);
+
+G_END_DECLS
+
+#endif /* _CONDUIT_G_CONDUIT_H_ */
Added: trunk/conduit-glib/conduit-glib/conduit-g-dataprovider.c
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-g-dataprovider.c Sat Jan 19 05:56:50 2008
@@ -0,0 +1,219 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "conduit-g-dataprovider.h"
+#include "conduit-dataprovider-bindings.h"
+#include "conduit-g-application.h"
+#include "conduit-glib-globals.h"
+
+struct _ConduitGDataproviderPrivate {
+ ConduitGApplication *application;
+ DBusGProxy *proxy;
+ DBusGProxyCall *proxy_request_call;
+};
+
+/* Private methods */
+
+
+G_DEFINE_TYPE (ConduitGDataprovider, conduit_g_dataprovider, G_TYPE_OBJECT);
+
+/**
+ * SECTION:conduit-g-dataprovider
+ * @short_description: Represents a dataprovider
+ * @see_also: #ConduitGApplication
+ *
+ * #ConduitGDataprovider is a client side representation of a dataprovider. A dataprovider is
+ * created via a #ConduitGApplication object's #conduit_g_application_get_dataprovider
+ *
+ */
+
+static void
+conduit_g_dataprovider_init (ConduitGDataprovider *dataprovider)
+{
+ ConduitGDataproviderPrivate *priv;
+
+ priv = g_new0 (ConduitGDataproviderPrivate, 1);
+ priv->application = NULL;
+ priv->proxy = NULL;
+ priv->proxy_request_call = NULL;
+
+ dataprovider->priv = priv;
+}
+
+static void
+conduit_g_dataprovider_finalize (GObject *object)
+{
+ ConduitGDataprovider *dataprovider;
+ ConduitGDataproviderPrivate *priv;
+
+ dataprovider = CONDUIT_G_DATAPROVIDER(object);
+ priv = dataprovider->priv;
+
+ g_object_unref (priv->application);
+
+ g_free (dataprovider->priv);
+
+ G_OBJECT_CLASS (conduit_g_dataprovider_parent_class)->finalize (object);
+}
+
+static void
+conduit_g_dataprovider_class_init (ConduitGDataproviderClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = conduit_g_dataprovider_finalize;
+}
+
+/**
+ * conduit_g_dataprovider_new
+ * @application: The session to be parent of the new dataprovider
+ * @query: The query the dataprovider should run
+ * @returns: A newly allocated #ConduitGDataprovider
+ *
+ * Package private constructor. Use conduit_g_application_get_dataprovider
+ * as the public api.
+ */
+ConduitGDataprovider*
+conduit_g_dataprovider_new (ConduitGApplication *application, gchar *path)
+{
+ ConduitGDataprovider *dataprovider;
+ DBusGConnection *connection;
+ DBusGProxy *proxy;
+
+ dataprovider = CONDUIT_G_DATAPROVIDER (g_object_new (CONDUIT_TYPE_G_DATAPROVIDER, NULL));
+ dataprovider->priv->application = application;
+
+ g_object_ref (application);
+
+ /* We need to react if the application is closed as we
+ * are invalid in that case
+ g_signal_connect (application, "closed",
+ G_CALLBACK(_conduit_application_closed), NULL); */
+
+ connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
+ proxy = dbus_g_proxy_new_for_name (connection,
+ CONDUIT_DATAPROVIDER_DBUS_NAME,
+ path,
+ CONDUIT_DATAPROVIDER_DBUS_INTERFACE);
+ dataprovider->priv->proxy = proxy;
+
+ return dataprovider;
+}
+
+GHashTable*
+conduit_g_dataprovider_get_information (ConduitGDataprovider *dataprovider)
+{
+ GHashTable *info;
+ GError *error;
+
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider), NULL);
+
+ error = NULL;
+ if (!org_conduit_DataProvider_get_information(dataprovider->priv->proxy, &info, &error)) {
+ g_critical ("Error getting information: %s\n", error->message);
+ g_error_free (error);
+ return NULL;
+ }
+ return info;
+}
+
+void
+conduit_g_dataprovider_configure (ConduitGDataprovider *dataprovider)
+{
+ GError *error;
+
+ g_return_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider));
+
+ error = NULL;
+ if (!org_conduit_DataProvider_configure(dataprovider->priv->proxy, &error)) {
+ g_critical ("Error configuring dataprovider: %s\n", error->message);
+ g_error_free (error);
+ }
+}
+
+gboolean
+conduit_g_dataprovider_is_pending (ConduitGDataprovider *dataprovider)
+{
+ gboolean pending;
+ GError *error;
+
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider), FALSE);
+
+ error = NULL;
+ if(!org_conduit_DataProvider_is_configured(dataprovider->priv->proxy, &pending, &error)) {
+ g_critical ("Error calling is_pending: %s\n", error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+ return pending;
+}
+
+gboolean
+conduit_g_dataprovider_add_data (ConduitGDataprovider *dataprovider, gchar *uri)
+{
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider), FALSE);
+ return FALSE;
+}
+
+gboolean
+conduit_g_dataprovider_is_configured (ConduitGDataprovider *dataprovider)
+{
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider), FALSE);
+ return FALSE;
+}
+
+gboolean
+conduit_g_dataprovider_set_configuration_xml (ConduitGDataprovider *dataprovider, gchar *xml)
+{
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider), FALSE);
+ return FALSE;
+}
+
+gchar *
+conduit_g_dataprovider_get_configuration_xml (ConduitGDataprovider *dataprovider)
+{
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider), NULL);
+ return NULL;
+}
+
+ConduitGApplication*
+conduit_g_dataprovider_get_application (ConduitGDataprovider *dataprovider)
+{
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider), NULL);
+ return dataprovider->priv->application;
+}
+
+const gchar*
+conduit_g_dataprovider_get_object_path (ConduitGDataprovider *dataprovider)
+{
+ g_return_val_if_fail (CONDUIT_IS_G_DATAPROVIDER (dataprovider), NULL);
+ return dbus_g_proxy_get_path(dataprovider->priv->proxy);
+}
+
+/* Callback for the closed signal on the session
+static void
+_conduit_application_closed (ConduitGDataprovider *dataprovider)
+{
+ if (!dataprovider->priv->closed) {
+ conduit_g_dataprovider_close (dataprovider);
+ }
+} */
Added: trunk/conduit-glib/conduit-glib/conduit-g-dataprovider.h
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-g-dataprovider.h Sat Jan 19 05:56:50 2008
@@ -0,0 +1,81 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _CONDUIT_G_DATAPROVIDER_H_
+#define _CONDUIT_G_DATAPROVIDER_H_
+
+#include <glib-object.h>
+#include <conduit-glib/conduit-g-application.h>
+
+G_BEGIN_DECLS
+
+#define CONDUIT_TYPE_G_DATAPROVIDER (conduit_g_dataprovider_get_type ())
+#define CONDUIT_G_DATAPROVIDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONDUIT_TYPE_G_DATAPROVIDER, ConduitGDataprovider))
+#define CONDUIT_G_DATAPROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONDUIT_TYPE_G_DATAPROVIDER, ConduitGDataproviderClass))
+#define CONDUIT_IS_G_DATAPROVIDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONDUIT_TYPE_G_DATAPROVIDER))
+#define CONDUIT_IS_G_DATAPROVIDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONDUIT_TYPE_G_DATAPROVIDER))
+#define CONDUIT_G_DATAPROVIDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONDUIT_TYPE_G_DATAPROVIDER, ConduitGDataproviderClass))
+
+/* Public structs */
+/* Foward declared in application.h
+typedef struct _ConduitGDataprovider ConduitGDataprovider; */
+typedef struct _ConduitGDataproviderClass ConduitGDataproviderClass;
+
+/* Private structs */
+typedef struct _ConduitGDataproviderPrivate ConduitGDataproviderPrivate;
+
+struct _ConduitGDataproviderClass
+{
+ GObjectClass parent_class;
+};
+
+struct _ConduitGDataprovider
+{
+ GObject parent_instance;
+ ConduitGDataproviderPrivate *priv;
+};
+
+/* Public methods */
+GType conduit_g_dataprovider_get_type (void) G_GNUC_CONST;
+
+GHashTable* conduit_g_dataprovider_get_information (ConduitGDataprovider *dataprovider);
+
+void conduit_g_dataprovider_configure (ConduitGDataprovider *dataprovider);
+
+gboolean conduit_g_dataprovider_is_pending (ConduitGDataprovider *dataprovider);
+
+gboolean conduit_g_dataprovider_add_data (ConduitGDataprovider *dataprovider, gchar *uri);
+
+void conduit_g_dataprovider_configure (ConduitGDataprovider *dataprovider);
+
+gboolean conduit_g_dataprovider_is_configured (ConduitGDataprovider *dataprovider);
+
+gboolean conduit_g_dataprovider_set_configuration_xml(ConduitGDataprovider *dataprovider, gchar *xml);
+
+gchar * conduit_g_dataprovider_get_configuration_xml(ConduitGDataprovider *dataprovider);
+
+ConduitGApplication*
+ conduit_g_dataprovider_get_application (ConduitGDataprovider *dataprovider);
+
+G_END_DECLS
+
+#endif /* _CONDUIT_G_DATAPROVIDER_H_ */
Added: trunk/conduit-glib/conduit-glib/conduit-g-syncset.c
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-g-syncset.c Sat Jan 19 05:56:50 2008
@@ -0,0 +1,130 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "conduit-g-syncset.h"
+#include "conduit-syncset-bindings.h"
+#include "conduit-g-application.h"
+#include "conduit-g-conduit.h"
+#include "conduit-glib-globals.h"
+
+struct _ConduitGSyncsetPrivate {
+ ConduitGApplication *application;
+ DBusGProxy *proxy;
+ DBusGProxyCall *proxy_request_call;
+};
+
+/* Private methods */
+
+G_DEFINE_TYPE (ConduitGSyncset, conduit_g_syncset, G_TYPE_OBJECT);
+
+static void
+conduit_g_syncset_init (ConduitGSyncset *syncset)
+{
+ ConduitGSyncsetPrivate *priv;
+
+ priv = g_new0 (ConduitGSyncsetPrivate, 1);
+ priv->application = NULL;
+ priv->proxy = NULL;
+ priv->proxy_request_call = NULL;
+
+ syncset->priv = priv;
+}
+
+static void
+conduit_g_syncset_finalize (GObject *object)
+{
+ ConduitGSyncset *syncset;
+ ConduitGSyncsetPrivate *priv;
+
+ syncset = CONDUIT_G_SYNCSET(object);
+ priv = syncset->priv;
+
+ g_object_unref (priv->application);
+
+ g_free (syncset->priv);
+
+ G_OBJECT_CLASS (conduit_g_syncset_parent_class)->finalize (object);
+}
+
+static void
+conduit_g_syncset_class_init (ConduitGSyncsetClass *klass)
+{
+ GObjectClass* object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = conduit_g_syncset_finalize;
+}
+
+ConduitGSyncset*
+conduit_g_syncset_new (ConduitGApplication *application, gchar *path)
+{
+ ConduitGSyncset *syncset;
+ DBusGConnection *connection;
+ DBusGProxy *proxy;
+
+ g_return_val_if_fail (CONDUIT_IS_G_APPLICATION (application), NULL);
+
+ syncset = CONDUIT_G_SYNCSET (g_object_new (CONDUIT_TYPE_G_SYNCSET, NULL));
+ syncset->priv->application = application;
+
+ g_object_ref (application);
+
+ /* We need to react if the application is closed as we
+ * are invalid in that case
+ g_signal_connect (application, "closed",
+ G_CALLBACK(_conduit_application_closed), NULL); */
+
+ connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);
+ proxy = dbus_g_proxy_new_for_name (connection,
+ CONDUIT_SYNCSET_DBUS_NAME,
+ path,
+ CONDUIT_SYNCSET_DBUS_INTERFACE);
+ syncset->priv->proxy = proxy;
+
+ return syncset;
+}
+
+gboolean
+conduit_g_syncset_add_conduit (ConduitGSyncset *syncset, ConduitGConduit *conduit)
+{
+ GError *error;
+ const gchar *path;
+
+ g_return_val_if_fail (CONDUIT_IS_G_CONDUIT (conduit), FALSE);
+
+ path = conduit_g_conduit_get_object_path(conduit);
+
+ error = NULL;
+ if(!org_conduit_SyncSet_add_conduit(syncset->priv->proxy, path, &error)) {
+ g_critical ("Error adding conduit to syncset: %s\n", error->message);
+ g_error_free (error);
+ return FALSE;
+ }
+ return TRUE;
+}
+
+const gchar*
+conduit_g_syncset_get_object_path (ConduitGSyncset *syncset)
+{
+ g_return_val_if_fail (CONDUIT_IS_G_SYNCSET (syncset), NULL);
+ return dbus_g_proxy_get_path(syncset->priv->proxy);
+}
+
Added: trunk/conduit-glib/conduit-glib/conduit-g-syncset.h
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-g-syncset.h Sat Jan 19 05:56:50 2008
@@ -0,0 +1,67 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _CONDUIT_G_SYNCSET_H_
+#define _CONDUIT_G_SYNCSET_H_
+
+#include <glib-object.h>
+#include <conduit-glib/conduit-g-application.h>
+
+G_BEGIN_DECLS
+
+#define CONDUIT_TYPE_G_SYNCSET (conduit_g_syncset_get_type ())
+#define CONDUIT_G_SYNCSET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONDUIT_TYPE_G_SYNCSET, ConduitGSyncset))
+#define CONDUIT_G_SYNCSET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONDUIT_TYPE_G_SYNCSET, ConduitGSyncsetClass))
+#define CONDUIT_IS_G_SYNCSET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONDUIT_TYPE_G_SYNCSET))
+#define CONDUIT_IS_G_SYNCSET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONDUIT_TYPE_G_SYNCSET))
+#define CONDUIT_G_SYNCSET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONDUIT_TYPE_G_SYNCSET, ConduitGSyncsetClass))
+
+/* Public structs */
+typedef struct _ConduitGSyncset ConduitGSyncset;
+typedef struct _ConduitGSyncsetClass ConduitGSyncsetClass;
+
+/* Private structs */
+typedef struct _ConduitGSyncsetPrivate ConduitGSyncsetPrivate;
+
+struct _ConduitGSyncsetClass
+{
+ GObjectClass parent_class;
+};
+
+struct _ConduitGSyncset
+{
+ GObject parent_instance;
+ ConduitGSyncsetPrivate *priv;
+};
+
+/* Public methods */
+GType conduit_g_syncset_get_type (void) G_GNUC_CONST;
+
+ConduitGSyncset* conduit_g_syncset_new (ConduitGApplication *application, gchar *path);
+
+const gchar* conduit_g_syncset_get_object_path (ConduitGSyncset *syncset);
+
+gboolean conduit_g_syncset_add_conduit (ConduitGSyncset *syncset, ConduitGConduit *conduit);
+
+G_END_DECLS
+
+#endif /* _CONDUIT_G_SYNCSET_H_ */
Added: trunk/conduit-glib/conduit-glib/conduit-glib-globals.h
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-glib-globals.h Sat Jan 19 05:56:50 2008
@@ -0,0 +1,45 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _CONDUIT_GLIB_GLOBALS_H_
+#define _CONDUIT_GLIB_GLOBALS_H_
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+#define CONDUIT_APPLICATION_DBUS_NAME "org.conduit.Application"
+#define CONDUIT_APPLICATION_DBUS_INTERFACE "org.conduit.Application"
+#define CONDUIT_APPLICATION_DBUS_PATH "/"
+
+#define CONDUIT_DATAPROVIDER_DBUS_NAME "org.conduit.DataProvider"
+#define CONDUIT_DATAPROVIDER_DBUS_INTERFACE "org.conduit.DataProvider"
+
+#define CONDUIT_CONDUIT_DBUS_NAME "org.conduit.Conduit"
+#define CONDUIT_CONDUIT_DBUS_INTERFACE "org.conduit.Conduit"
+
+#define CONDUIT_SYNCSET_DBUS_NAME "org.conduit.SyncSet"
+#define CONDUIT_SYNCSET_DBUS_INTERFACE "org.conduit.SyncSet"
+
+G_END_DECLS
+
+#endif /* _CONDUIT_GLIB_GLOBALS_H_ */
Added: trunk/conduit-glib/conduit-glib/conduit-glib.h
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-glib.h Sat Jan 19 05:56:50 2008
@@ -0,0 +1,32 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
+/*
+ * conduit-glib
+ * Copyright (C) John Stowers 2008 <john stowers gmail com>
+ *
+ * conduit-glib is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * conduit-glib is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with conduit-glib. If not, write to:
+ * The Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _CONDUIT_GLIB_H_
+#define _CONDUIT_GLIB_H_
+
+#include <conduit-glib/conduit-g-application.h>
+#include <conduit-glib/conduit-g-dataprovider.h>
+#include <conduit-glib/conduit-g-conduit.h>
+#include <conduit-glib/conduit-g-syncset.h>
+#include <conduit-glib/conduit-glib-globals.h>
+
+#endif /* _CONDUIT_GLIB_H_ */
Added: trunk/conduit-glib/conduit-glib/conduit-marshal.list
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/conduit-glib/conduit-marshal.list Sat Jan 19 05:56:50 2008
@@ -0,0 +1,2 @@
+# SyncCompleted signal
+VOID:BOOL,BOOL,BOOL
Added: trunk/conduit-glib/configure.ac
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/configure.ac Sat Jan 19 05:56:50 2008
@@ -0,0 +1,92 @@
+# Process this file with autoconf to produce a configure script.
+# Created by Anjuta application wizard.
+
+AC_INIT(conduit-glib, 0.2)
+
+AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+AM_CONFIG_HEADER(config.h)
+AM_MAINTAINER_MODE
+
+CFLAGS="$CFLAGS"
+
+###################################################################
+# Check essential build programs
+###################################################################
+AC_ISC_POSIX
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+AM_PROG_LIBTOOL
+
+
+####################################################################
+# Compiler generate debug code
+####################################################################
+AC_ARG_ENABLE([debug],
+ AC_HELP_STRING([--enable-debug], [build with debug symbols]),,
+ [enable_debug=no])
+
+if test "x$enable_debug" = "xyes"; then
+ CFLAGS="-g $CFLAGS"
+fi
+
+
+####################################################################
+# gettext/intltool support
+####################################################################
+GETTEXT_PACKAGE=AC_PACKAGE_NAME
+AC_SUBST(GETTEXT_PACKAGE)
+AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
+ [The gettext translation domain])
+
+AM_GLIB_GNU_GETTEXT
+IT_PROG_INTLTOOL([0.35.0])
+
+
+####################################################################
+# Check library deps
+####################################################################
+GLIB_REQUIRED=2.12
+DBUS_GLIB_REQUIRED=0.73
+DBUS_REQUIRED=1.0.0
+
+#PKG_CHECK_MODULES(CONDUIT_GLIB, [glib-2.0 >= $GLIB_REQUIRED dbus-glib-1 >= DBUS_GLIB_REQUIRED dbus-1 >= $DBUS_REQUIRED gobject-2.0 >= GLIB_REQUIRED ])
+PKG_CHECK_MODULES(GLIB2, [glib-2.0 >= $GLIB_REQUIRED ])
+PKG_CHECK_MODULES(GOBJECT2, [gobject-2.0 >= $GLIB_REQUIRED ])
+PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= $DBUS_GLIB_REQUIRED ])
+PKG_CHECK_MODULES(DBUS, [dbus-1 >= $DBUS_REQUIRED ])
+
+CONDUIT_GLIB_CFLAGS="$GLIB2_CFLAGS $GOBJECT2_CFLAGS $DBUS_GLIB_CFLAGS $DBUS_CFLAGS"
+CONDUIT_GLIB_LIBS="$GLIB2_LIBS $GOBJECT2_LIBS $DBUS_GLIB_LIBS $DBUS_LIBS"
+AC_SUBST(CONDUIT_GLIB_CFLAGS)
+AC_SUBST(CONDUIT_GLIB_LIBS)
+
+
+GTK_DOC_CHECK(1.0)
+
+
+####################################################################
+# check for newer glib (>= 2.15.0) for unit testing framework
+####################################################################
+RECENT_GLIB=2.15.0
+
+PKG_CHECK_MODULES(glib2, [ glib-2.0 >= $RECENT_GLIB ],
+ [have_recent_glib=yes], [have_recent_glib=no])
+
+if test "$have_recent_glib" = "yes" ; then
+ AC_DEFINE(HAVE_RECENT_GLIB, 1, [Define if we have recent glib])
+fi
+
+AM_CONDITIONAL(HAVE_RECENT_GLIB, test "$have_recent_glib" = "yes")
+
+
+AC_OUTPUT([
+conduit-glib.pc
+Makefile
+po/Makefile.in
+test/Makefile
+data/Makefile
+docs/Makefile
+docs/reference/Makefile
+conduit-glib/Makefile
+])
Added: trunk/conduit-glib/data/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/data/Makefile.am Sat Jan 19 05:56:50 2008
@@ -0,0 +1,6 @@
+EXTRA_DIST = \
+ application.xml \
+ dataprovider.xml \
+ syncset.xml \
+ conduit.xml \
+ generate-instrospection-xml.py
Added: trunk/conduit-glib/data/application.xml
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/data/application.xml Sat Jan 19 05:56:50 2008
@@ -0,0 +1,41 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node name="/">
+ <interface name="org.conduit.Application">
+ <method name="Quit">
+ </method>
+ <method name="NewSyncSet">
+ <arg direction="out" type="o" />
+ </method>
+ <signal name="DataproviderUnavailable">
+ <arg type="s" name="key" />
+ </signal>
+ <method name="BuildExporter">
+ <arg direction="in" type="s" name="key" />
+ <arg direction="out" type="o" />
+ </method>
+ <method name="GetDataProvider">
+ <arg direction="in" type="s" name="key" />
+ <arg direction="out" type="o" />
+ </method>
+ <method name="BuildConduit">
+ <arg direction="in" type="o" name="source" />
+ <arg direction="in" type="o" name="sink" />
+ <arg direction="out" type="o" />
+ </method>
+ <signal name="DataproviderAvailable">
+ <arg type="s" name="key" />
+ </signal>
+ <method name="GetAllDataProviders">
+ <arg direction="out" type="as" />
+ </method>
+ </interface>
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg direction="out" type="s" />
+ </method>
+ </interface>
+ <node name="activate"/>
+ <node name="conduit"/>
+ <node name="dataprovider"/>
+ <node name="syncset"/>
+</node>
Added: trunk/conduit-glib/data/conduit.xml
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/data/conduit.xml Sat Jan 19 05:56:50 2008
@@ -0,0 +1,57 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node name="/conduit/7a551e633dd2455088a258a1e52ec4f2">
+ <interface name="org.conduit.Conduit">
+ <method name="AddDataprovider">
+ <arg direction="in" type="o" name="dp" />
+ <arg direction="in" type="b" name="trySource" />
+ </method>
+ <signal name="SyncStarted">
+ </signal>
+ <method name="DeleteDataprovider">
+ <arg direction="in" type="o" name="dp" />
+ </method>
+ <method name="DisableTwoWaySync">
+ </method>
+ <method name="IsTwoWay">
+ <arg direction="out" type="b" />
+ </method>
+ <method name="Sync">
+ </method>
+ <method name="Refresh">
+ </method>
+ <signal name="SyncProgress">
+ <arg type="d" name="progress" />
+ </signal>
+ <signal name="SyncCompleted">
+ <arg type="b" name="aborted" />
+ <arg type="b" name="error" />
+ <arg type="b" name="conflict" />
+ </signal>
+ <signal name="SyncConflict">
+ </signal>
+ <method name="EnableTwoWaySync">
+ </method>
+ </interface>
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg direction="out" type="s" />
+ </method>
+ </interface>
+ <interface name="org.conduit.Exporter">
+ <method name="SinkGetConfigurationXml">
+ <arg direction="out" type="s" />
+ </method>
+ <method name="SinkConfigure">
+ </method>
+ <method name="SinkSetConfigurationXml">
+ <arg direction="in" type="s" name="xml" />
+ </method>
+ <method name="AddData">
+ <arg direction="in" type="s" name="uri" />
+ <arg direction="out" type="b" />
+ </method>
+ <method name="SinkGetInformation">
+ <arg direction="out" type="a{ss}" />
+ </method>
+ </interface>
+</node>
Added: trunk/conduit-glib/data/dataprovider.xml
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/data/dataprovider.xml Sat Jan 19 05:56:50 2008
@@ -0,0 +1,31 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node name="/dataprovider/23e61c630d824fd984bec8b3aac0b236">
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg direction="out" type="s" />
+ </method>
+ </interface>
+ <interface name="org.conduit.DataProvider">
+ <method name="GetInformation">
+ <arg direction="out" type="a{ss}" />
+ </method>
+ <method name="Configure">
+ </method>
+ <method name="IsPending">
+ <arg direction="out" type="b" />
+ </method>
+ <method name="GetConfigurationXml">
+ <arg direction="out" type="s" />
+ </method>
+ <method name="AddData">
+ <arg direction="in" type="s" name="uri" />
+ <arg direction="out" type="b" />
+ </method>
+ <method name="IsConfigured">
+ <arg direction="out" type="b" />
+ </method>
+ <method name="SetConfigurationXml">
+ <arg direction="in" type="s" name="xml" />
+ </method>
+ </interface>
+</node>
Added: trunk/conduit-glib/data/generate-instrospection-xml.py
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/data/generate-instrospection-xml.py Sat Jan 19 05:56:50 2008
@@ -0,0 +1,68 @@
+#!/usr/bin/python
+import sys
+import dbus
+
+APPLICATION_DBUS_IFACE="org.conduit.Application"
+SYNCSET_DBUS_IFACE="org.conduit.SyncSet"
+CONDUIT_DBUS_IFACE="org.conduit.Conduit"
+EXPORTER_DBUS_IFACE="org.conduit.Exporter"
+DATAPROVIDER_DBUS_IFACE="org.conduit.DataProvider"
+
+bus = dbus.SessionBus()
+
+#check conduit is running
+obj = bus.get_object('org.freedesktop.DBus', '/org/freedesktop/DBus')
+dbus_iface = dbus.Interface(obj, 'org.freedesktop.DBus')
+avail = dbus_iface.ListNames()
+
+if APPLICATION_DBUS_IFACE not in avail:
+ print "Conduit not running"
+ sys.exit()
+
+#get conduit app
+app = bus.get_object(APPLICATION_DBUS_IFACE,"/")
+
+#get a syncset
+syncset = bus.get_object(SYNCSET_DBUS_IFACE,"/syncset/gui")
+
+#get a source and a sink
+source = bus.get_object(
+ DATAPROVIDER_DBUS_IFACE,
+ app.GetDataProvider(
+ "TestSource",
+ dbus_interface=APPLICATION_DBUS_IFACE
+ )
+ )
+sink = bus.get_object(
+ DATAPROVIDER_DBUS_IFACE,
+ app.GetDataProvider(
+ "TestSink",
+ dbus_interface=APPLICATION_DBUS_IFACE
+ )
+ )
+
+#get a conduit
+cond = bus.get_object(
+ CONDUIT_DBUS_IFACE,
+ app.BuildConduit(
+ source,
+ sink,
+ dbus_interface=APPLICATION_DBUS_IFACE
+ )
+ )
+
+FILES = (
+ (app, "application.xml"),
+ (syncset, "syncset.xml"),
+ (source, "dataprovider.xml"),
+ (cond, "conduit.xml"),
+)
+
+for obj,name in FILES:
+ print "Writing %s" % name
+ iface = dbus.Interface(obj, 'org.freedesktop.DBus.Introspectable')
+ rawxml = iface.Introspect()
+ f = open(name, 'w')
+ f.write(rawxml)
+ f.close()
+
Added: trunk/conduit-glib/data/syncset.xml
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/data/syncset.xml Sat Jan 19 05:56:50 2008
@@ -0,0 +1,26 @@
+<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
+<node name="/syncset/gui">
+ <interface name="org.freedesktop.DBus.Introspectable">
+ <method name="Introspect">
+ <arg direction="out" type="s" />
+ </method>
+ </interface>
+ <interface name="org.conduit.SyncSet">
+ <method name="SaveToXml">
+ <arg direction="in" type="s" name="path" />
+ </method>
+ <method name="RestoreFromXml">
+ <arg direction="in" type="s" name="path" />
+ </method>
+ <method name="DeleteConduit">
+ <arg direction="in" type="o" name="cond" />
+ </method>
+ <signal name="ConduitRemoved">
+ </signal>
+ <method name="AddConduit">
+ <arg direction="in" type="o" name="cond" />
+ </method>
+ <signal name="ConduitAdded">
+ </signal>
+ </interface>
+</node>
Added: trunk/conduit-glib/depcomp
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/depcomp Sat Jan 19 05:56:50 2008
@@ -0,0 +1 @@
+link /usr/share/automake-1.9/depcomp
\ No newline at end of file
Added: trunk/conduit-glib/docs/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/docs/Makefile.am Sat Jan 19 05:56:50 2008
@@ -0,0 +1 @@
+SUBDIRS = reference
Added: trunk/conduit-glib/docs/reference/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/docs/reference/Makefile.am Sat Jan 19 05:56:50 2008
@@ -0,0 +1,53 @@
+## Process this file with automake to produce Makefile.in
+
+# automake requirements
+AUTOMAKE_OPTIONS = 1.7
+
+# The name of the module
+DOC_MODULE=conduit-glib
+
+# The top-level SGML file. You can change this if you want to.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+
+# The directory containing the source code. Relative to $(srcdir).
+DOC_SOURCE_DIR=../..
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+# Fx --rebuild-types --rebuild-sections
+SCAN_OPTIONS=
+
+# Extra options to supply to gtkdoc-mkdb.
+MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files=trio
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+HFILE_GLOB=$(top_srcdir)/conduit-glib/*.h
+CFILE_GLOB=$(top_srcdir)/conduit-glib/*.c
+
+# Header files to ignore when scanning.
+IGNORE_HFILES=conduit-marshal.h conduit-glib.h conduit-glib-globals.h
+
+# Images to copy into HTML directory.
+HTML_IMAGES=
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+content_files =
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+INCLUDES=-I$(top_srcdir)/conduit-glib \
+ $(CONDUIT_GLIB_CFLAGS)
+
+GTKDOC_LIBS=$(CONDUIT_GLIB_LIBS) \
+ $(top_builddir)/conduit-glib/libconduit-glib.la
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST +=
Added: trunk/conduit-glib/docs/reference/conduit-glib-docs.sgml
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/docs/reference/conduit-glib-docs.sgml Sat Jan 19 05:56:50 2008
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
+ <bookinfo>
+ <title>Conduit GLib Reference Manual</title>
+ </bookinfo>
+
+ <chapter>
+ <title>API Documentation</title>
+ <xi:include href="xml/conduit-g-application.xml"/>
+ </chapter>
+</book>
Added: trunk/conduit-glib/docs/reference/conduit-glib-sections.txt
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/docs/reference/conduit-glib-sections.txt Sat Jan 19 05:56:50 2008
@@ -0,0 +1,11 @@
+<SECTION>
+<FILE>conduit-g-application</FILE>
+<TITLE>ConduitGApplication</TITLE>
+ConduitGApplication
+conduit_g_application_new
+conduit_g_application_get_dataprovider
+conduit_g_application_build_conduit
+<SUBSECTION Standard>
+conduit_g_application
+</SECTION>
+
Added: trunk/conduit-glib/docs/reference/conduit-glib.types
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/docs/reference/conduit-glib.types Sat Jan 19 05:56:50 2008
@@ -0,0 +1 @@
+conduit_g_application_get_type
Added: trunk/conduit-glib/install-sh
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/install-sh Sat Jan 19 05:56:50 2008
@@ -0,0 +1 @@
+link /usr/share/automake-1.9/install-sh
\ No newline at end of file
Added: trunk/conduit-glib/missing
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/missing Sat Jan 19 05:56:50 2008
@@ -0,0 +1 @@
+link /usr/share/automake-1.9/missing
\ No newline at end of file
Added: trunk/conduit-glib/po/.cvsignore
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/po/.cvsignore Sat Jan 19 05:56:50 2008
@@ -0,0 +1,23 @@
+.libs
+.deps
+.*swp
+.nautilus-metafile.xml
+*.autosave
+*.gmo
+*.mo
+*.pot
+*~
+#*#
+*.bak
+*.o
+*.lo
+*.la
+cat-id-tbl.c
+stamp-cat-id
+messages
+missing
+POTFILES
+Makefile
+Makefile.in
+Makefile.in.in
+translations.xml
Added: trunk/conduit-glib/po/LINGUAS
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/po/LINGUAS Sat Jan 19 05:56:50 2008
@@ -0,0 +1,2 @@
+# please keep this list sorted alphabetically
+#
Added: trunk/conduit-glib/po/Makefile.in.in
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/po/Makefile.in.in Sat Jan 19 05:56:50 2008
@@ -0,0 +1,218 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper gnu ai mit edu>
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+#
+# - Modified by Owen Taylor <otaylor redhat com> to use GETTEXT_PACKAGE
+# instead of PACKAGE and to look for po2tbl in ./ not in intl/
+#
+# - Modified by jacob berkman <jacob ximian com> to install
+# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
+#
+# - Modified by Rodney Dawes <dobey novell com> for use with intltool
+#
+# We have the following line for use by intltoolize:
+# INTLTOOL_MAKEFILE
+
+GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = @datadir@
+datarootdir = @datarootdir@
+libdir = @libdir@
+DATADIRNAME = @DATADIRNAME@
+itlocaledir = $(prefix)/$(DATADIRNAME)/locale
+subdir = po
+install_sh = @install_sh@
+# Automake >= 1.8 provides @mkdir_p
+# Until it can be supposed, use the safe fallback:
+mkdir_p = $(install_sh) -d
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+GMSGFMT = @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = @XGETTEXT@
+INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
+INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
+GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
+
+ALL_LINGUAS = @ALL_LINGUAS@
+
+PO_LINGUAS=$(shell if test -r $(srcdir)/LINGUAS; then grep -v "^\#" $(srcdir)/LINGUAS; fi)
+
+USER_LINGUAS=$(shell if test -n "$(LINGUAS)"; then LLINGUAS="$(LINGUAS)"; ALINGUAS="$(ALL_LINGUAS)"; for lang in $$LLINGUAS; do if test -n "`grep ^$$lang$$ $(srcdir)/LINGUAS`" -o -n "`echo $$ALINGUAS|grep ' ?$$lang ?'`"; then printf "$$lang "; fi; done; fi)
+
+USE_LINGUAS=$(shell if test -n "$(USER_LINGUAS)"; then LLINGUAS="$(USER_LINGUAS)"; else if test -n "$(PO_LINGUAS)"; then LLINGUAS="$(PO_LINGUAS)"; else LLINGUAS="$(ALL_LINGUAS)"; fi; fi; for lang in $$LLINGUAS; do printf "$$lang "; done)
+
+POFILES=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.po "; done)
+
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(POFILES)
+EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
+
+POTFILES = \
+# This comment gets stripped out
+
+CATALOGS=$(shell LINGUAS="$(USE_LINGUAS)"; for lang in $$LINGUAS; do printf "$$lang.gmo "; done)
+
+.SUFFIXES:
+.SUFFIXES: .po .pox .gmo .mo .msg .cat
+
+.po.pox:
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ $(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+ sed -f ../intl/po2msg.sed < $< > $*.msg \
+ && rm -f $@ && gencat $@ $*.msg
+
+
+all: all- USE_NLS@
+
+all-yes: $(CATALOGS)
+all-no:
+
+$(GETTEXT_PACKAGE).pot: $(POTFILES)
+ $(GENPOT)
+
+install: install-data
+install-data: install-data- USE_NLS@
+install-data-no: all
+install-data-yes: all
+ $(mkdir_p) $(DESTDIR)$(itlocaledir)
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ dir=$(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES; \
+ $(mkdir_p) $$dir; \
+ if test -r $$lang.gmo; then \
+ $(INSTALL_DATA) $$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+ echo "installing $$lang.gmo as $$dir/$(GETTEXT_PACKAGE).mo"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$lang.gmo $$dir/$(GETTEXT_PACKAGE).mo; \
+ echo "installing $(srcdir)/$$lang.gmo as" \
+ "$$dir/$(GETTEXT_PACKAGE).mo"; \
+ fi; \
+ if test -r $$lang.gmo.m; then \
+ $(INSTALL_DATA) $$lang.gmo.m $$dir/$(GETTEXT_PACKAGE).mo.m; \
+ echo "installing $$lang.gmo.m as $$dir/$(GETTEXT_PACKAGE).mo.m"; \
+ else \
+ if test -r $(srcdir)/$$lang.gmo.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$lang.gmo.m \
+ $$dir/$(GETTEXT_PACKAGE).mo.m; \
+ echo "installing $(srcdir)/$$lang.gmo.m as" \
+ "$$dir/$(GETTEXT_PACKAGE).mo.m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+
+# Empty stubs to satisfy archaic automake needs
+dvi info tags TAGS ID:
+
+# Define this as empty until I found a useful application.
+install-exec installcheck:
+
+uninstall:
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo; \
+ rm -f $(DESTDIR)$(itlocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE).mo.m; \
+ done
+
+check: all $(GETTEXT_PACKAGE).pot
+ rm -f missing notexist
+ srcdir=$(srcdir) $(INTLTOOL_UPDATE) -m
+ if [ -r missing -o -r notexist ]; then \
+ exit 1; \
+ fi
+
+mostlyclean:
+ rm -f *.pox $(GETTEXT_PACKAGE).pot *.old.po cat-id-tbl.tmp
+ rm -f .intltool-merge-cache
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES stamp-it
+ rm -f *.mo *.msg *.cat *.cat.m *.gmo
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f Makefile.in.in
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ extra_dists="$(EXTRA_DISTFILES)"; \
+ for file in $$extra_dists; do \
+ test -f $(srcdir)/$$file && dists="$$dists $(srcdir)/$$file"; \
+ done; \
+ for file in $$dists; do \
+ test -f $$file || file="$(srcdir)/$$file"; \
+ ln $$file $(distdir) 2> /dev/null \
+ || cp -p $$file $(distdir); \
+ done
+
+update-po: Makefile
+ $(MAKE) $(GETTEXT_PACKAGE).pot
+ tmpdir=`pwd`; \
+ linguas="$(USE_LINGUAS)"; \
+ for lang in $$linguas; do \
+ echo "$$lang:"; \
+ result="`$(MSGMERGE) -o $$tmpdir/$$lang.new.po $$lang`"; \
+ if $$result; then \
+ if cmp $(srcdir)/$$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+ rm -f $$tmpdir/$$lang.new.po; \
+ else \
+ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+ :; \
+ else \
+ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ echo "msgmerge for $$lang.gmo failed!"; \
+ rm -f $$tmpdir/$$lang.new.po; \
+ fi; \
+ done
+
+Makefile POTFILES: stamp-it
+ @if test ! -f $@; then \
+ rm -f stamp-it; \
+ $(MAKE) stamp-it; \
+ fi
+
+stamp-it: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+ cd $(top_builddir) \
+ && CONFIG_FILES=$(subdir)/Makefile.in CONFIG_HEADERS= CONFIG_LINKS= \
+ $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
Added: trunk/conduit-glib/po/POTFILES.in
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/po/POTFILES.in Sat Jan 19 05:56:50 2008
@@ -0,0 +1,7 @@
+# List of source files containing translatable strings.
+
+conduit-glib/conduit-g-application.c
+conduit-glib/conduit-g-dataprovider.c
+conduit-glib/conduit-g-conduit.c
+conduit-glib/conduit-g-syncset.c
+
Added: trunk/conduit-glib/test/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/test/Makefile.am Sat Jan 19 05:56:50 2008
@@ -0,0 +1,18 @@
+noinst_PROGRAMS = \
+ test-application
+
+INCLUDES = \
+ -I$(top_srcdir) -I$(srcdir) \
+ -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
+ -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
+ -DPACKAGE_DATA_DIR=\""$(datadir)"\" $(CONDUIT_GLIB_CFLAGS)
+
+AM_CFLAGS = \
+ -Wall \
+ -g
+
+test_application_SOURCES = test-application.c
+test_application_LDADD = $(CONDUIT_GLIB_LIBS) $(top_builddir)/conduit-glib/libconduit-glib.la
+
+
+
Added: trunk/conduit-glib/test/test-application.c
==============================================================================
--- (empty file)
+++ trunk/conduit-glib/test/test-application.c Sat Jan 19 05:56:50 2008
@@ -0,0 +1,116 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with main.c; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA
+ */
+
+#include <stdio.h>
+#include <glib-2.0/glib.h>
+
+#include "conduit-glib/conduit-glib.h"
+
+static void
+_dataprovider_available_cb (ConduitGApplication *application, char *hits, gpointer data)
+{
+ g_print ("Dataprovider %s Available\n", hits);
+}
+
+static void
+_dataprovider_unavailable_cb (ConduitGApplication *application, char *hits, gpointer data)
+{
+ g_print ("Dataprovider %s Unavailable\n", hits);
+}
+
+static void
+_sync_progress_cb (ConduitGConduit *conduit, gdouble progress, gpointer data)
+{
+ g_print ("Sync (%2.1f%% complete)\n", progress*100.0);
+}
+
+static void
+_sync_completed_cb (ConduitGConduit *conduit, gboolean a, gboolean e, gboolean c, gpointer data)
+{
+ g_print ("Sync finished (abort:%u error:%u conflict:%u)\n",a,e,c);
+}
+
+static void
+_sync_conflict_cb (ConduitGConduit *conduit, gpointer data)
+{
+ g_print ("Conflict!\n");
+}
+
+
+static void
+_print_dataprovider_information(char *key, char *value, gpointer user_data)
+{
+ if (key && value)
+ g_print ("%s : %s\n", key, value);
+}
+
+int
+main (int argc, char** argv)
+{
+ ConduitGApplication *application;
+ ConduitGDataprovider *source, *sink;
+ ConduitGConduit *conduit;
+ ConduitGSyncset *gui_syncset;
+ GMainLoop *mainloop;
+ gchar **dataproviders;
+
+ g_type_init ();
+ application = conduit_g_application_new ();
+ mainloop = g_main_loop_new (NULL, FALSE);
+
+ g_signal_connect (application, "dataprovider-available", (GCallback) _dataprovider_available_cb, NULL);
+ g_signal_connect (application, "dataprovider-unavailable", (GCallback) _dataprovider_unavailable_cb, NULL);
+
+ dataproviders = conduit_g_application_get_all_dataproviders(application);
+ if (dataproviders)
+ {
+ guint i;
+ GHashTable *info;
+
+ for (i = 0; dataproviders[i] != NULL; i++)
+ g_print ("%s\n", dataproviders[i]);
+
+ /* Get a datasource */
+ source = conduit_g_application_get_dataprovider(application, "TestSource");
+ info = conduit_g_dataprovider_get_information(source);
+ g_hash_table_foreach (info, (GHFunc)&_print_dataprovider_information, NULL);
+
+ /* Get a datasink */
+ sink = conduit_g_application_get_dataprovider(application, "TestConflict");
+ info = conduit_g_dataprovider_get_information(source);
+ g_hash_table_foreach (info, (GHFunc)&_print_dataprovider_information, NULL);
+
+ /* Put them in a conduit */
+ conduit = conduit_g_application_build_conduit(application,source,sink);
+ g_signal_connect (conduit, "sync-progress", (GCallback) _sync_progress_cb, NULL);
+ g_signal_connect (conduit, "sync-completed", (GCallback) _sync_completed_cb, NULL);
+ g_signal_connect (conduit, "sync-conflict", (GCallback) _sync_conflict_cb, NULL);
+
+ /* Add it to the GUI (optional) */
+ gui_syncset = conduit_g_syncset_new(application, "/syncset/gui");
+ conduit_g_syncset_add_conduit(gui_syncset, conduit);
+
+ conduit_g_conduit_sync(conduit);
+ }
+ else
+ {
+ g_print ("No dataproviders found");
+ }
+
+ g_main_loop_run (mainloop);
+
+ return 0;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]