Fix warnings.
#include "utils.h"
#include "poi.h"
#include "route.h"
+#include "track.h"
+#include "path.h"
#include "settings.h"
#include "gps.h"
#include "map.h"
#include "bt.h"
#include "ui-common.h"
#include "db.h"
-
+#include "latlon.h"
#include "cb.h"
+#include "gps-panels.h"
gboolean map_cb_configure(GtkWidget * widget, GdkEventConfigure * event)
{
/* Initialize with the current center position. */
{
gchar buffer[32];
- gfloat lat, lon;
+ gdouble lat, lon;
unit2latlon(_center.unitx, _center.unity, lat, lon);
snprintf(buffer, sizeof(buffer), "%.06f", lat);
gtk_label_set_text(GTK_LABEL(txt_lat), buffer);
while (GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) {
const gchar *text;
gchar *error_check;
- gfloat lat, lon;
+ gdouble lat, lon;
guint unitx, unity;
text = gtk_entry_get_text(GTK_ENTRY(txt_lat));
if ((_fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_fullscreen_item)))) {
gtk_window_fullscreen(GTK_WINDOW(_window));
- gtk_widget_set_state(_toolbar_fullscreen_item, GTK_STATE_ACTIVE);
+ gtk_widget_set_state(GTK_WIDGET(_toolbar_fullscreen_item), GTK_STATE_ACTIVE);
} else {
gtk_window_unfullscreen(GTK_WINDOW(_window));
- gtk_widget_set_state(_toolbar_fullscreen_item, GTK_STATE_NORMAL);
+ gtk_widget_set_state(GTK_WIDGET(_toolbar_fullscreen_item), GTK_STATE_NORMAL);
}
gtk_idle_add((GSourceFunc) window_present, NULL);
void cmenu_show_latlon(guint unitx, guint unity)
{
- gfloat lat, lon;
+ gdouble lat, lon;
gchar buffer[80], tmp1[16], tmp2[16];
printf("%s()\n", __PRETTY_FUNCTION__);
void cmenu_clip_latlon(guint unitx, guint unity)
{
gchar buffer[80];
- gfloat lat, lon;
+ gdouble lat, lon;
printf("%s()\n", __PRETTY_FUNCTION__);
unit2latlon(unitx, unity, lat, lon);
gchar buffer[80];
gchar strlat[32];
gchar strlon[32];
- gfloat lat, lon;
+ gdouble lat, lon;
printf("%s()\n", __PRETTY_FUNCTION__);
unit2latlon(unitx, unity, lat, lon);
void cmenu_distance_to(guint unitx, guint unity)
{
gchar buffer[80];
- gfloat lat, lon;
+ gdouble lat, lon;
printf("%s()\n", __PRETTY_FUNCTION__);
unit2latlon(unitx, unity, lat, lon);
void cmenu_route_add_way(guint unitx, guint unity)
{
- gfloat lat, lon;
+ gdouble lat, lon;
gchar tmp1[16], tmp2[16], *p_latlon;
GtkWidget *dialog;
GtkWidget *table;
#include "bt.h"
#include "ui-common.h"
#include "settings.h"
+#include "gpx.h"
void config_update_proxy(void)
{
struct _GpsData {
guint fix;
guint fixquality;
- gfloat lat;
- gfloat lon;
+ gdouble lat;
+ gdouble lon;
gfloat speed; /* in knots */
gfloat maxspeed; /* in knots */
gfloat avgspeed; /* -- "" -- */
/* Curr points to first non-zero point. */
for (curr--; curr++ != path->tail;) {
- gfloat lat, lon;
+ gdouble lat, lon;
if (curr->unity) {
gchar buffer[80];
gboolean first_sub = TRUE;
if (!strcmp((gchar *) name, "trkpt")) {
const xmlChar **curr_attr;
gchar *error_check;
- gfloat lat = 0.f, lon = 0.f;
+ gdouble lat = 0.f, lon = 0.f;
gboolean has_lat, has_lon;
has_lat = FALSE;
has_lon = FALSE;
dlat=lat2 - lat1;
dlon=lon2 - lon1;
-slat=sinf(dlat / 2.f);
-slon=sinf(dlon / 2.f);
+slat=sin(dlat / 2.f);
+slon=sin(dlon / 2.f);
-a=(slat * slat) + (cosf(lat1) * cosf(lat2) * slon * slon);
+a=(slat * slat) + (cos(lat1) * cos(lat2) * slon * slon);
-return ((2.f * atan2f(sqrtf(a), sqrtf(1.f - a))) * EARTH_RADIUS);
+return ((2.f * atan2(sqrt(a), sqrt(1.f - a))) * EARTH_RADIUS);
}
* given source location. It would have been nice if gdk_pixbuf provided
* this method, but I guess it's not general-purpose enough.
*/
-void
+static void
map_pixbuf_scale_inplace(GdkPixbuf * pixbuf, guint ratio_p2,
guint src_x, guint src_y)
{
* Trim pixbufs that are bigger than tiles. (Those pixbufs result, when
* captions should be cut off.)
*/
-GdkPixbuf *pixbuf_trim(GdkPixbuf * pixbuf)
+static GdkPixbuf *pixbuf_trim(GdkPixbuf * pixbuf)
{
vprintf("%s()\n", __PRETTY_FUNCTION__);
GdkPixbuf *mpixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, gdk_pixbuf_get_has_alpha(pixbuf),
* trimming.
* 'proj' is used for the conversion
*/
-gchar *map_convert_wms_to_wms(gint tilex, gint tiley, gint zoomlevel,
+static gchar *map_convert_wms_to_wms(gint tilex, gint tiley, gint zoomlevel,
gchar * uri)
{
gint system_retcode;
gchar cmd[BUFFER_SIZE], srs[BUFFER_SIZE];
gchar *ret = NULL;
FILE *in;
- gfloat lon1, lat1, lon2, lat2;
+ gdouble lon1, lat1, lon2, lat2;
gchar *widthstr = strcasestr(uri, "WIDTH=");
gchar *heightstr = strcasestr(uri, "HEIGHT=");
else if (!(in = g_fopen("/tmp/tmpcs2cs", "r")))
g_printerr("Cannot open results of conversion\n");
else if (5 !=
- fscanf(in, "%f %f %s %f %f", &lon1, &lat1, cmd, &lon2,
- &lat2)) {
+ fscanf(in, "%lf %lf %s %lf %lf", &lon1, &lat1, cmd, &lon2, &lat2)) {
g_printerr("Wrong conversion\n");
fclose(in);
} else {
* Given the xyz coordinates of our map coordinate system, write the qrst
* quadtree coordinates to buffer.
*/
-void
+static void
map_convert_coords_to_quadtree_string(gint x, gint y, gint zoomlevel,
gchar * buffer, const gchar initial,
const gchar * const quadrant)
* the URI format, since that would indicate a quadtree-based map coordinate
* system.
*/
-gchar *map_construct_url(guint tilex, guint tiley, guint zoom)
+static gchar *map_construct_url(guint tilex, guint tiley, guint zoom)
{
vprintf("%s()\n", __PRETTY_FUNCTION__);
switch (_curr_repo->type) {
/* Now calculate and draw the distance. */
{
gchar buffer[16];
- gfloat distance;
- gfloat lat1, lon1, lat2, lon2;
+ gdouble distance;
+ gdouble lat1, lon1, lat2, lon2;
gint width;
unit2latlon(_center.unitx - pixel2unit(SCALE_WIDTH / 2 - 4),
gboolean map_key_zoom_timeout();
gboolean curl_download_timeout();
+void map_set_autozoom(gboolean az);
+int map_zoom(gint zdir);
+void map_move_mark();
+void map_render_path(Path * path, GdkGC ** gc);
+void map_center_unit(guint new_center_unitx, guint new_center_unity);
+void map_pan(gint delta_unitx, gint delta_unity);
+void map_set_mark();
+
#endif