]> err.no Git - mapper/blobdiff - src/speed-display.c
Map widget:
[mapper] / src / speed-display.c
index 593a9b051aec32849a0374424b524ede72f30e75..dbb4eb024fac64941d2abfa67232d21c85521ea7 100644 (file)
@@ -1,7 +1,5 @@
 #include "config.h"
 
-#define _GNU_SOURCE
-
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
@@ -17,8 +15,6 @@
 #include "ui-common.h"
 #include "speak.h"
 
-gchar *SPEED_LOCATION_TEXT[SPEED_LOCATION_ENUM_COUNT];
-
 static gboolean 
 speed_excess(void)
 {
@@ -30,53 +26,4 @@ speak_text("Warning, you are over speed limit!");
 return TRUE;
 }
 
-void
-speed_limit(void)
-{
-GdkGC *gc;
-gfloat cur_speed;
-gchar *buffer;
-static guint x = 0, y = 0, width = 0, height = 0;
-
-cur_speed = _gps.speed * UNITS_CONVERT[_units];
-
-if (cur_speed > _speed_limit) {
-       gc = _speed_limit_gc1;
-       if (!_speed_excess) {
-               _speed_excess = TRUE;
-               g_timeout_add(5000, (GSourceFunc) speed_excess, NULL);
-       }
-} else {
-       gc = _speed_limit_gc2;
-       _speed_excess = FALSE;
-}
 
-buffer = g_strdup_printf("%0.0f", cur_speed);
-pango_layout_set_text(_speed_limit_layout, buffer, -1);
-pango_layout_get_pixel_size(_speed_limit_layout, &width, &height);
-
-gtk_widget_queue_draw_area(_map_widget, x - 5, y - 5, width * 3 + 15, height + 5);
-gdk_window_process_all_updates();
-
-switch (_speed_location) {
-       case SPEED_LOCATION_TOP_RIGHT:
-               x = _map_widget->allocation.width - 10 - width;
-               y = 5;
-       break;
-       case SPEED_LOCATION_BOTTOM_RIGHT:
-               x = _map_widget->allocation.width - 10 - width;
-               y = _map_widget->allocation.height - 10 - height;
-       break;
-       case SPEED_LOCATION_BOTTOM_LEFT:
-               x = 10;
-               y = _map_widget->allocation.height - 10 - height;
-       break;
-       default:
-               x = 10;
-               y = 10;
-       break;
-}
-
-gdk_draw_layout(_map_widget->window, gc, x, y, _speed_limit_layout);
-g_free(buffer);
-}