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>
This commit is contained in:
Dirk Hohndel 2013-02-01 17:25:41 +11:00
parent 393c88f087
commit cf3c0266c2
5 changed files with 93 additions and 4 deletions

7
gps.c
View file

@ -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 {