X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=callbacks.c;h=bb6dbdade47680181195c8ec2a56a49a2f156d5a;hb=633158f78b1a600b464275f7eea62fb776652b91;hp=f8e29ff040fd079e0bd6283b48fca79bb40a1a8e;hpb=04eaf74dc982120cdf34cd17eece780dea8d6034;p=speedometer diff --git a/callbacks.c b/callbacks.c index f8e29ff..bb6dbda 100644 --- a/callbacks.c +++ b/callbacks.c @@ -14,26 +14,22 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . -****/ + ****/ -#include #include +#include +#include #include "callbacks.h" #include "appdata.h" -#include "util.h" +#include "ui.h" void location_changed(LocationGPSDevice* device, gpointer data) { - g_assert(data); - g_assert(device); - - AppData* appdata = (AppData*) data; - // check for NaN before passing values if(device->fix->fields & LOCATION_GPS_DEVICE_SPEED_SET) { if(!isnan(device->fix->speed)) { - interpret_speed_from_gps(appdata, device->fix->speed); - } + interpret_and_set_speed(device->fix->speed); + } } } @@ -79,22 +75,12 @@ gboolean key_press_cb(GtkWidget* widget, GdkEventKey* event, HildonWindow* windo return FALSE; } -gboolean top_event_box_button_press(GtkWidget* widget, GdkEventButton* event, gpointer data) { - gdouble x = event->x; - g_print("Top event box pressed at: %f\n", x); - AppData* appdata = (AppData*) data; - - if(x > 750) { - g_print("Exiting..\n"); - g_signal_emit_by_name(appdata->window, "delete_event"); - } +gboolean long_tap(GtkWidget* widget, gpointer data) { + gtk_main_quit(); return TRUE; } - -gboolean bottom_event_box_button_press(GtkWidget* widget, GdkEventButton* event, gpointer data) { - gdouble x = event->x; - g_print("Bottom event box pressed at: %f\n", x); +gboolean short_tap(GtkWidget* widget, GdkEventButton* event, gpointer data) { + change_unit(); return TRUE; } -