$(OBJECTS): $(SOURCES)
$(CC) -c $(SOURCES) $(INCPATH)
-
clean:
rm -f $(OBJECTS) $(TARGET)
-This is Speedometer, a simple GPS application that
-shows current speed on the device screen.
+This application and all its files are released under
+GPL license. See COPYING for the whole license text.
+There is one catch though.. If you really like this
+program I would like to get a postcard from you. Include
+word Speedometer in the card so I know that the card is
+related to this software (like I'm getting tons of
+anynomous postcards all around the world ;)
+
+This is *not* to say you have to but it would be very nice.
+
+See http://en.wikipedia.org/wiki/Cardware if you don't know
+what this means.
+
+
+Anyway, here goes the address:
+
+Wellu Mäkinen
+PO Box
+33580 Tampere
+
+FINLAND
--- /dev/null
+This is a list of things that are on the pipeline:
+
+ - Make AppData part of ui.h --> lots of AppData pointer passing
+ fades away :)
+
+ - Themes: Splitting the package into two graphics and the program.
+
+ -
#include "callbacks.h"
#include "appdata.h"
+#include "util.h"
// this is just here for debugging and tracing purposes
static void print_location(LocationGPSDevice* device) {
device->fix->speed);
}
-void location_changed(LocationGPSDevice* device, gpointer userdata) {
+void location_changed(LocationGPSDevice* device, gpointer data) {
+ print_location(device);
+ AppData* appdata = (AppData*) data;
+
+ if(device->fix && LOCATION_GPS_DEVICE_SPEED_SET) {
+ g_print("Speed is %f km/h", device->fix->speed);
+ interpret_speed_from_gps(appdata, device->fix->speed);
+ }
}
gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, HildonWindow* window) {
#include <gtk/gtk.h>
// called by GPSD whenever location changes
-void location_changed(LocationGPSDevice* device, gpointer userdata);
+void location_changed(LocationGPSDevice* device, gpointer data);
// for hardware keys
gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, HildonWindow* window);
+speedometer (0.3-alpha1) unstable; urgency=low
+
+ * First alpha release.
+
+ -- Wellu Mäkinen <wellu@wellu.org> Sat, 6 Sep 2008 20:19:17 +0300
+
speedometer (0.3) unstable; urgency=low
* Experimental UI layout implemented.
appdata->speed_array[2] = (GtkImage*) gtk_image_new_from_pixbuf(zero);
}
+void set_nth_digit(AppData* appdata, guint n, guint value) {
+ //assert(nth >= 0 && nth < 3);
+
+ GtkImage* image = appdata->speed_array[n];
+ GdkPixbuf* buf = gtk_image_get_pixbuf(appdata->image_array[value]);
+ gtk_image_set_from_pixbuf(image, buf);
+ gtk_widget_queue_draw(GTK_WIDGET(appdata->speed_array[n]));
+}
+
guint randomize(AppData* appdata) {
gint32 n = g_random_int_range(0, 3);
void reset_speed(AppData* appdata);
+void set_nth_digit(AppData* appdata, guint n, guint value);
+
guint randomize(AppData* appdata);
void create_ui(AppData* appdata);
#include "util.h"
#include "appdata.h"
#include "callbacks.h"
+#include "ui.h"
static LocationGPSDevice *device = NULL;
static LocationGPSDControl *control = NULL;
#endif // __arm__
}
+void interpret_speed_from_gps(AppData* appdata, gdouble speed) {
+
+ // first let's convert the number to characters
+ gchar* c_digits = calloc(30, 1);
+
+ g_sprintf(c_digits, "%f", speed);
+
+ g_print("interpret_speed_from_gps: %s", c_digits);
+
+ int i = 0;
+ while(i < 3) {
+ guint value = g_ascii_digit_value(c_digits[i]);
+ set_nth_digit(appdata, i, value);
+ i++;
+ }
+ g_free(c_digits);
+}
+
#include "appdata.h"
+// starts the gps
void start_gps(AppData* appdata);
+
+// stops the gps
void stop_gps(AppData* appdata);
+// converts the speed from the gps
+void interpret_speed_from_gps(AppData* appdata, gdouble speed);
+
#endif /* UTIL_H_ */