[gnome-panel] Start adding geoclue support...



commit 7c8d23896de1580ad817dac19fa837fd45599031
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 29 01:03:21 2009 -0400

    Start adding geoclue support...
    
    Add a location abstraction to ClockData (a ClockGeoclue).
    ClockGeoclue uses a couple of geoclue providers to get current
    location on demand and on NetworkManager signals

 applets/clock/Makefile.am            |    3 +++
 applets/clock/clock-marshallers.list |    1 +
 applets/clock/clock.c                |    9 +++++++++
 configure.in                         |    3 ++-
 4 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/applets/clock/Makefile.am b/applets/clock/Makefile.am
index 87be581..2e28351 100644
--- a/applets/clock/Makefile.am
+++ b/applets/clock/Makefile.am
@@ -57,6 +57,9 @@ CLOCK_SOURCES = 		\
 	clock-utils.h		\
 	system-timezone.c	\
 	system-timezone.h	\
+	clock-geoclue.c		\
+	clock-geoclue.h		\
+	geoclue-localnet-bindings.h \
 	$(BUILT_SOURCES)	\
 	$(CALENDAR_SOURCES)	\
 	$(SETTIME_SOURCES)
diff --git a/applets/clock/clock-marshallers.list b/applets/clock/clock-marshallers.list
index 8c4d307..d1785c8 100644
--- a/applets/clock/clock-marshallers.list
+++ b/applets/clock/clock-marshallers.list
@@ -1,3 +1,4 @@
 POINTER:VOID
 VOID:OBJECT,STRING
 INT:VOID
+VOID:STRING,STRING,STRING
diff --git a/applets/clock/clock.c b/applets/clock/clock.c
index 31ad70e..2523c0c 100644
--- a/applets/clock/clock.c
+++ b/applets/clock/clock.c
@@ -70,6 +70,7 @@
 #include "clock-utils.h"
 #include "set-timezone.h"
 #include "system-timezone.h"
+#include "clock-geoclue.h"
 
 #define INTERNETSECOND (864)
 #define INTERNETBEAT   (86400)
@@ -176,6 +177,8 @@ struct _ClockData {
         GList *locations;
         GList *location_tiles;
 
+	ClockGeoclue *clock_geo; /* geoclue abstraction */
+
 	/* runtime data */
         time_t             current_time;
 	char              *timeformat;
@@ -776,6 +779,10 @@ destroy_clock (GtkWidget * widget, ClockData *cd)
         g_list_free (cd->location_tiles);
         cd->location_tiles = NULL;
 
+	if (cd->clock_geo)
+		g_object_unref (cd->clock_geo);
+	cd->clock_geo = NULL;
+
 	if (cd->systz) {
 		g_object_unref (cd->systz);
 		cd->systz = NULL;
@@ -2638,6 +2645,8 @@ fill_clock_applet (PanelApplet *applet)
 					      NULL);
 	}
 
+	cd->clock_geo = clock_geoclue_new ();
+
 	cd->systz = system_timezone_new ();
 	g_signal_connect (cd->systz, "changed",
 			  G_CALLBACK (clock_timezone_changed), cd);
diff --git a/configure.in b/configure.in
index 2942ceb..ee0548c 100644
--- a/configure.in
+++ b/configure.in
@@ -68,6 +68,7 @@ LIBEDATASERVERUI_REQUIRED=1.2.0
 CAIRO_REQUIRED=1.0.0
 DBUS_GLIB_REQUIRED=0.60
 GWEATHER_REQUIRED=2.24.1
+GEOCLUE_REQUIRED=0.11.1
 
 dnl pkg-config dependency checks
 
@@ -121,7 +122,7 @@ fi
 AM_CONDITIONAL(HAVE_LIBECAL, test -n "$LIBECAL_REQUIREMENT")
 AC_SUBST(CLOCK_EDS_ICONDIR)
 
-PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED $LIBECAL_REQUIREMENT libglade-2.0 >= $LIBGLADE_REQUIRED librsvg-2.0 dbus-glib-1 gweather >= $GWEATHER_REQUIRED)
+PKG_CHECK_MODULES(CLOCK, pango >= $PANGO_REQUIRED gtk+-2.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED gio-2.0 >= $GLIB_REQUIRED $LIBECAL_REQUIREMENT libglade-2.0 >= $LIBGLADE_REQUIRED librsvg-2.0 dbus-glib-1 gweather >= $GWEATHER_REQUIRED geoclue >= $GEOCLUE_REQUIRED libnm_glib)
 AC_SUBST(CLOCK_CFLAGS)
 AC_SUBST(CLOCK_LIBS)
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]