INCPATH = `pkg-config --cflags gtk+-2.0 liblocation`
LIBS = `pkg-config --libs gtk+-2.0 liblocation`
-SOURCES = main.c
-OBJECTS = main.o
+SOURCES = main.c callbacks.c
+OBJECTS = main.o callbacks.o
TARGET = speedometer
clean:
rm -f $(OBJECTS) $(TARGET)
-install:
+install: all
install -D -m 755 speedometer $(DESTDIR)/usr/bin/speedometer
+ install -D data/speedometer.desktop $(DESTDIR)/usr/share/applications/hildon/speedometer.desktop
+ install -D data/speedometer.service $(DESTDIR)/usr/share/dbus-1/services/speedometer.service
+
--- /dev/null
+/****
+ Speedometer, shows your current speed using GPS
+ Copyright (C) 2008 Wellu Mäkinen <wellu@wellu.org>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+****/
+
+#include "callbacks.h"
+
+void location_changed(LocationGPSDevice *device, gpointer userdata) {
+ g_print ("Latitude: %.2f\nLongitude: %.2f\nAltitude: %.2f\n",
+ device->fix->latitude, device->fix->longitude, device->fix->altitude);
+}
+
+
--- /dev/null
+/****
+ Speedometer, shows your current speed using GPS
+ Copyright (C) 2008 Wellu Mäkinen <wellu@wellu.org>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 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 General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+****/
+
+#ifndef CALLBACKS_H_
+#define CALLBACKS_H_
+
+#include <location/location-gps-device.h>
+
+// called by GPSD whenever location changes
+void location_changed(LocationGPSDevice *device, gpointer userdata);
+
+#endif /* CALLBACKS_H_ */
--- /dev/null
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Name=Speedometer
+Exec=/usr/bin/speedometer
+Icon=speedometer
+X-Window-Icon=speedometer
+X-Window-Icon-Dimmed=speedometer
+X-Osso-Service=org.wellu.speedometer
+
+
+
--- /dev/null
+[D-BUS Service]
+Name=org.wellu.speedometer
+Exec=/usr/bin/speedometer
+
+
+speedometer (0.2) unstable; urgency=low
+
+ * Added .desktop and .service files.
+ * Code cleanups.
+
+ -- Wellu Mäkinen <wellu@wellu.org> Thu, 28 Aug 2008 21:16:05 +0300
+
speedometer (0.1) unstable; urgency=low
* Initial Release.
Source: speedometer
-Section: user/utils
+Section: user/other
Priority: extra
Maintainer: Wellu Mäkinen <wellu@wellu.org>
Build-Depends: debhelper (>= 5), liblocation-dev
Description: Speedometer shows current speed on the screen.
Speedometer shows your current speed in various units
on the device screen. Speed is taken from GPS connection.
+XB-Maemo-Icon-26:
+ iVBORw0KGgoAAAANSUhEUgAAABoAAAAZCAAAAAAKtWG8AAAACXBIWXMAAAAnAAAAJwEqCZFP
+ AAAAB3RJTUUH1QkMEgEBuF+MPAAAACF0RVh0Q29tbWVudABKUEVHOmdudS1oZWFkLmpwZyAy
+ NzZ4MjYxjzmxCgAAAi9JREFUKM9dkd9LU2Ecxp/37HU/nFub02Zty9K0lc5FYWJBUCBeRD+o
+ y6j/IoIuoj8hgi6DgqAroSAk+gWSIuZVTU1nuDM3tzl1O3PNc3a29/12cSyoy+/zfD+fm4cR
+ QJWdPXgiCgMAECNVF72t4ICZmEmxmn9ooN8FAEV1gnmr/VeCHDKd9USHlIAecAIAfPJmM5l5
+ br/NkdS16KAHtFdccndTLuAcBaKmVslxMkoIeUAFdT4hr00IfvUGR8fxjU2dw1VK3AG0z4/V
+ qjI59j05R7cUHHLYHVyW01GC+fFhPayFR/p6JlefHLyI5fnrLVzhzfxi+MW7B+N29Wx2mr9f
+ y73O19+E3G1MzmZeenxLr7rW3sYHybbz6XLft6ep0PDwOdujtt3Dxer9ASbj+pTdF04mzwRT
+ sfOdo5zDf5L7XBcA+BfVES/8P0zn+NbRkA0govzSHBElhDR0SXJ6VYpsk4gYAagXurH9q8sJ
+ kXKFChm30XTEAQ4AxUhjVcQkseV68Eu8UzutAAAjwFgo1S+VI6i0VtX0GHnyXre1AVFj29gS
+ X4nkuiYqZTH1QRIRkQKABxyK0l4mFt5gXl+hEbOG4wAAGDi2IjpYx2xEW8mdsjIQERGtCVrf
+ kCTMjCnTlo8U6yFUQLi+1RA/n92dYZYPjCy2xPy1vcIJRdUHbPu+fYq110w3p6JN7hL+rcC6
+ WhiOqMmFXuP/Ci0KuMuZLd2b/5OwvzwAamrlWs+B/es340gXFARK7DMAAAAASUVORK5CYII=
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
****/
-
-
#include <stdlib.h>
#include <gtk/gtk.h>
#include <location/location-gps-device.h>
#include <location/location-gpsd-control.h>
-static void location_changed (LocationGPSDevice *device, gpointer userdata) {
- g_print ("Latitude: %.2f\nLongitude: %.2f\nAltitude: %.2f\n",
- device->fix->latitude, device->fix->longitude, device->fix->altitude);
-}
-
-
-
-
-
-
+#include "callbacks.h"
int main(int argc, char** argv) {
/* Create a window with window border width of 12 pixels and a
title text. */
- window = g_object_new(GTK_TYPE_WINDOW,
- "border-width", 12,
- "title", "Hello GTK+",
- NULL);
-
- /* Create the label widget. */
- label = g_object_new(GTK_TYPE_LABEL,
- "label", "Hello World!",
- NULL);
-
- /* Pack the label into the window layout. */
- gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(label));
+ window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
/* Show all widgets that are contained by the window. */
gtk_widget_show_all(GTK_WIDGET(window));
LocationGPSDControl *control;
- control = location_gpsd_control_get_default ();
+ control = location_gpsd_control_get_default();
location_gpsd_control_start(control);
/* Start the main event loop. */
gtk_main();
+
+
return EXIT_SUCCESS;
}