From fe6148723172d93d97fa941184ecc9a256201379 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 18 May 2010 22:07:22 -0500 Subject: Building the basic service structure --- src/datetime-service.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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 +#include + +#include + +#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; } -- cgit v1.2.3