aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-05-18 22:07:22 -0500
committerTed Gould <ted@gould.cx>2010-05-18 22:07:22 -0500
commitfe6148723172d93d97fa941184ecc9a256201379 (patch)
treefb62a75f5c08b15346daee53c493174c3b9a0515
parent12731f4f2554e923c92cc04aafb5c5c126be983a (diff)
downloadayatana-indicator-datetime-fe6148723172d93d97fa941184ecc9a256201379.tar.gz
ayatana-indicator-datetime-fe6148723172d93d97fa941184ecc9a256201379.tar.bz2
ayatana-indicator-datetime-fe6148723172d93d97fa941184ecc9a256201379.zip
Building the basic service structure
-rw-r--r--src/datetime-service.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/datetime-service.c b/src/datetime-service.c
index 63590c7..da4cd87 100644
--- a/src/datetime-service.c
+++ b/src/datetime-service.c
@@ -1,7 +1,40 @@
+#include <config.h>
+#include <libindicator/indicator-service.h>
+
+#include <glib/gi18n.h>
+
+#include "dbus-shared.h"
+
+static IndicatorService * service = NULL;
+static GMainLoop * mainloop = NULL;
+
+static void
+service_shutdown (IndicatorService * service, gpointer user_data)
+{
+ g_warning("Shutting down service!");
+ g_main_loop_quit(mainloop);
+ return;
+}
+
int
main (int argc, char ** argv)
{
+ g_type_init();
+
+ service = indicator_service_new_version(SERVICE_NAME, SERVICE_VERSION);
+ g_signal_connect(service, INDICATOR_SERVICE_SIGNAL_SHUTDOWN, G_CALLBACK(service_shutdown), NULL);
+
+ /* Setting up i18n and gettext. Apparently, we need
+ all of these. */
+ setlocale (LC_ALL, "");
+ bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
+ textdomain (GETTEXT_PACKAGE);
+
+ mainloop = g_main_loop_new(NULL, FALSE);
+ g_main_loop_run(mainloop);
+
+ g_object_unref(G_OBJECT(service));
return 0;
}