--- /dev/null
+/*
+ * azimuth.c - Source for Azimith
+ * Copyright (C) 2010 Guillaume Desmottes
+ * @author Guillaume Desmottes <gdesmott@gnome.org>
+ *
+ * This library 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 library 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 this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "azimuth.h"
+#include "position-publisher.h"
+
+G_DEFINE_TYPE(Azimuth, azimuth, G_TYPE_OBJECT)
+
+/* private structure */
+typedef struct _AzimuthPrivate AzimuthPrivate;
+
+struct _AzimuthPrivate
+{
+ GMainLoop *loop;
+ PositionPublisher *publisher;
+};
+
+#define AZIMUTH_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), AZIMUTH_TYPE, AzimuthPrivate))
+
+static void
+azimuth_init (Azimuth *obj)
+{
+ AzimuthPrivate *priv = AZIMUTH_GET_PRIVATE (obj);
+
+ priv->loop = g_main_loop_new (NULL, FALSE);
+ priv->publisher = NULL;
+}
+
+static void
+azimuth_dispose (GObject *object)
+{
+ Azimuth *self = AZIMUTH (object);
+ AzimuthPrivate *priv = AZIMUTH_GET_PRIVATE (self);
+
+ if (priv->publisher != NULL)
+ {
+ g_object_unref (priv->publisher);
+ priv->publisher = NULL;
+ }
+
+ if (priv->loop != NULL)
+ {
+ g_main_loop_unref (priv->loop);
+ priv->loop = NULL;
+ }
+
+ if (G_OBJECT_CLASS (azimuth_parent_class)->dispose)
+ G_OBJECT_CLASS (azimuth_parent_class)->dispose (object);
+}
+
+static void
+azimuth_class_init (AzimuthClass *azimuth_class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (azimuth_class);
+
+ g_type_class_add_private (azimuth_class, sizeof (AzimuthPrivate));
+
+ object_class->dispose = azimuth_dispose;
+}
+
+Azimuth *
+azimuth_new (void)
+{
+ return g_object_new (AZIMUTH_TYPE,
+ NULL);
+}
+
+void
+azimuth_run (Azimuth *self)
+{
+ AzimuthPrivate *priv = AZIMUTH_GET_PRIVATE (self);
+
+ g_assert (priv->publisher == NULL);
+ priv->publisher = position_publisher_new ();
+
+ g_print ("azimuth running\n");
+ g_main_loop_run (priv->loop);
+}
--- /dev/null
+/*
+ * azimuth.h - Header for Azimith
+ * Copyright (C) 2010 Guillaume Desmottes
+ * @author Guillaume Desmottes <gdesmott@gnome.org>
+ *
+ * This library 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 library 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 this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __AZIMUTH_H__
+#define __AZIMUTH_H__
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+typedef struct _Azimuth Azimuth;
+typedef struct _AzimuthClass AzimuthClass;
+
+struct _AzimuthClass {
+ GObjectClass parent_class;
+};
+
+struct _Azimuth {
+ GObject parent;
+};
+
+GType azimuth_get_type (void);
+
+/* TYPE MACROS */
+#define AZIMUTH_TYPE \
+ (azimuth_get_type())
+#define AZIMUTH(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), AZIMUTH_TYPE, Azimuth))
+#define AZIMUTH_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), AZIMUTH_TYPE, AzimuthClass))
+#define IS_AZIMUTH(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), AZIMUTH_TYPE))
+#define IS_AZIMUTH_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), AZIMUTH_TYPE))
+#define AZIMUTH_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), AZIMUTH_TYPE, AzimuthClass))
+
+Azimuth * azimuth_new (void);
+
+void azimuth_run (Azimuth *self);
+
+G_END_DECLS
+
+#endif /* #ifndef __AZIMUTH_H__*/