Parent Directory | Revision Log
OSD working
1 | /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; tab-width: 4 -*- */ |
2 | /* vim:set et sw=4 ts=4 cino=t0,(0: */ |
3 | /* |
4 | * osm-gps-map.h |
5 | * Copyright (C) Marcus Bauer 2008 <marcus.bauer@gmail.com> |
6 | * Copyright (C) John Stowers 2009 <john.stowers@gmail.com> |
7 | * |
8 | * Contributions by |
9 | * Everaldo Canuto 2009 <everaldo.canuto@gmail.com> |
10 | * |
11 | * osm-gps-map.c is free software: you can redistribute it and/or modify it |
12 | * under the terms of the GNU General Public License as published by the |
13 | * Free Software Foundation, either version 3 of the License, or |
14 | * (at your option) any later version. |
15 | * |
16 | * osm-gps-map.c is distributed in the hope that it will be useful, but |
17 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
19 | * See the GNU General Public License for more details. |
20 | * |
21 | * You should have received a copy of the GNU General Public License along |
22 | * with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | */ |
24 | |
25 | #ifndef _OSM_GPS_MAP_H_ |
26 | #define _OSM_GPS_MAP_H_ |
27 | |
28 | #include <glib.h> |
29 | #include <glib-object.h> |
30 | #include <gtk/gtk.h> |
31 | #include <gdk-pixbuf/gdk-pixbuf.h> |
32 | |
33 | G_BEGIN_DECLS |
34 | |
35 | #define OSM_TYPE_GPS_MAP (osm_gps_map_get_type ()) |
36 | #define OSM_GPS_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), OSM_TYPE_GPS_MAP, OsmGpsMap)) |
37 | #define OSM_GPS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), OSM_TYPE_GPS_MAP, OsmGpsMapClass)) |
38 | #define OSM_IS_GPS_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), OSM_TYPE_GPS_MAP)) |
39 | #define OSM_IS_GPS_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), OSM_TYPE_GPS_MAP)) |
40 | #define OSM_GPS_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), OSM_TYPE_GPS_MAP, OsmGpsMapClass)) |
41 | |
42 | typedef struct _OsmGpsMapClass OsmGpsMapClass; |
43 | typedef struct _OsmGpsMap OsmGpsMap; |
44 | typedef struct _OsmGpsMapPrivate OsmGpsMapPrivate; |
45 | |
46 | struct _OsmGpsMapClass |
47 | { |
48 | GtkDrawingAreaClass parent_class; |
49 | }; |
50 | |
51 | struct _OsmGpsMap |
52 | { |
53 | GtkDrawingArea parent_instance; |
54 | OsmGpsMapPrivate *priv; |
55 | }; |
56 | |
57 | typedef struct { |
58 | float rlat; |
59 | float rlon; |
60 | } coord_t; |
61 | |
62 | typedef enum { |
63 | OSM_GPS_MAP_SOURCE_NULL, |
64 | OSM_GPS_MAP_SOURCE_OPENSTREETMAP, |
65 | OSM_GPS_MAP_SOURCE_OPENSTREETMAP_RENDERER, |
66 | OSM_GPS_MAP_SOURCE_OPENAERIALMAP, |
67 | OSM_GPS_MAP_SOURCE_MAPS_FOR_FREE, |
68 | OSM_GPS_MAP_SOURCE_GOOGLE_STREET, |
69 | OSM_GPS_MAP_SOURCE_GOOGLE_SATELLITE, |
70 | OSM_GPS_MAP_SOURCE_GOOGLE_HYBRID, |
71 | OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_STREET, |
72 | OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_SATELLITE, |
73 | OSM_GPS_MAP_SOURCE_VIRTUAL_EARTH_HYBRID, |
74 | OSM_GPS_MAP_SOURCE_YAHOO_STREET, |
75 | OSM_GPS_MAP_SOURCE_YAHOO_SATELLITE, |
76 | OSM_GPS_MAP_SOURCE_YAHOO_HYBRID |
77 | } OsmGpsMapSource_t; |
78 | |
79 | typedef struct { |
80 | gint x, y, w, h; |
81 | } OsmGpsMapRect_t; |
82 | |
83 | typedef void (*OsmGpsMapBalloonCallback)(cairo_t *, OsmGpsMapRect_t *rect, |
84 | gpointer data); |
85 | #define OSM_GPS_MAP_BALLOON_CALLBACK(f) ((OsmGpsMapBalloonCallback) (f)) |
86 | |
87 | typedef void (*OsmGpsMapOsdGpsCallback)(gpointer data); |
88 | #define OSM_GPS_MAP_OSD_GPS_CALLBACK(f) ((OsmGpsMapOsdGpsCallback) (f)) |
89 | |
90 | GType osm_gps_map_get_type (void) G_GNUC_CONST; |
91 | |
92 | const char* osm_gps_map_source_get_friendly_name(OsmGpsMapSource_t source); |
93 | const char* osm_gps_map_source_get_repo_uri(OsmGpsMapSource_t source); |
94 | const char *osm_gps_map_source_get_image_format(OsmGpsMapSource_t source); |
95 | int osm_gps_map_source_get_min_zoom(OsmGpsMapSource_t source); |
96 | int osm_gps_map_source_get_max_zoom(OsmGpsMapSource_t source); |
97 | |
98 | void osm_gps_map_download_maps (OsmGpsMap *map, coord_t *pt1, coord_t *pt2, int zoom_start, int zoom_end); |
99 | void osm_gps_map_get_bbox (OsmGpsMap *map, coord_t *pt1, coord_t *pt2); |
100 | void osm_gps_map_set_mapcenter (OsmGpsMap *map, float latitude, float longitude, int zoom); |
101 | void osm_gps_map_set_center (OsmGpsMap *map, float latitude, float longitude); |
102 | int osm_gps_map_set_zoom (OsmGpsMap *map, int zoom); |
103 | void osm_gps_map_add_track (OsmGpsMap *map, GSList *track); |
104 | void osm_gps_map_clear_tracks (OsmGpsMap *map); |
105 | void osm_gps_map_add_image (OsmGpsMap *map, float latitude, float longitude, GdkPixbuf *image); |
106 | gboolean osm_gps_map_remove_image (OsmGpsMap *map, GdkPixbuf *image); |
107 | void osm_gps_map_clear_images (OsmGpsMap *map); |
108 | void osm_gps_map_osd_speed (OsmGpsMap *map, float speed); |
109 | void osm_gps_map_draw_gps (OsmGpsMap *map, float latitude, float longitude, float heading); |
110 | void osm_gps_map_clear_gps (OsmGpsMap *map); |
111 | coord_t osm_gps_map_get_co_ordinates (OsmGpsMap *map, int pixel_x, int pixel_y); |
112 | GtkWidget * osm_gps_map_new(void); |
113 | void osm_gps_map_screen_to_geographic (OsmGpsMap *map, |
114 | gint pixel_x, gint pixel_y, |
115 | gfloat *latitude, gfloat *longitude); |
116 | void osm_gps_map_geographic_to_screen (OsmGpsMap *map, |
117 | gfloat latitude, gfloat longitude, |
118 | gint *pixel_x, gint *pixel_y); |
119 | void osm_gps_map_scroll (OsmGpsMap *map, gint dx, gint dy); |
120 | float osm_gps_map_get_scale(OsmGpsMap *map); |
121 | #ifdef ENABLE_BALLOON |
122 | void osm_gps_map_draw_balloon (OsmGpsMap *map, float latitude, float longitude, OsmGpsMapBalloonCallback cb, gpointer data); |
123 | void osm_gps_map_clear_balloon (OsmGpsMap *map); |
124 | #endif |
125 | #ifdef ENABLE_OSD |
126 | void osm_gps_map_osd_enable_gps (OsmGpsMap *map, OsmGpsMapOsdGpsCallback cb, gpointer data); |
127 | #endif |
128 | |
129 | |
130 | G_END_DECLS |
131 | |
132 | #endif /* _OSM_GPS_MAP_H_ */ |