diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-02-01 17:25:41 +1100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-01 17:25:41 +1100 |
commit | cf3c0266c2bf0f6fbbd532ef4e0c9bdd0a7b37a7 (patch) | |
tree | e1200262f40aead51403aab1e665392892d0298f /gps.c | |
parent | 393c88f087d40578558b104dd42ff2076e198188 (diff) | |
download | subsurface-cf3c0266c2bf0f6fbbd532ef4e0c9bdd0a7b37a7.tar.gz |
Move flag icon to include file
Just like with the satellite icon we are creating a pixdata structure for
the flag.
The Makefile cleanup in commit df6a9ddd8a21 ("Auto-generate C file
dependencies, and make the build more quiet") removed the rules for
generating the .h file by mistake (I hope).
This adds a more generic rule back in and also makes sure that the data
structures get more useful names.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gps.c')
-rw-r--r-- | gps.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -2,7 +2,6 @@ /* Creates the UI displaying the dives locations on a map. */ #include <glib/gi18n.h> -#include <gdk-pixbuf/gdk-pixbuf.h> #include "osm-gps-map.h" @@ -11,6 +10,10 @@ #include "display-gtk.h" #include "divelist.h" +#include <gdk-pixbuf/gdk-pixbuf.h> +#include <gdk-pixbuf/gdk-pixdata.h> +#include "flag.h" + /* Several map providers are available, such as OSM_GPS_MAP_SOURCE_OPENSTREETMAP and OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_SATELLITE. We should make more of them available from e.g. a pull-down menu */ @@ -219,7 +222,7 @@ void show_gps_location(struct dive *dive, void (*callback)(float, float)) if (lat != 0 || lng != 0) { add_gps_point(map, lat, lng); osm_gps_map_set_center_and_zoom(map, lat, lng, 9); - picture = gdk_pixbuf_new_from_file("./flag.png", &gerror); + picture = gdk_pixbuf_from_pixdata(&flag_pixbuf, TRUE, NULL); if (picture) { osm_gps_map_image_add_with_alignment(map, lat, lng, picture, 0, 1); } else { |