From: Kaj-Michael Lang Date: Thu, 21 Feb 2008 10:03:31 +0000 (+0200) Subject: Move some variables around X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5787d3b8adae3773202429c7718a482ba046b83f;p=mapper Move some variables around --- diff --git a/src/latlon.c b/src/latlon.c index 49d490e..e491166 100644 --- a/src/latlon.c +++ b/src/latlon.c @@ -30,6 +30,7 @@ #include #include +#include #include "latlon.h" #include "osm.h" @@ -49,6 +50,10 @@ DEG_FORMAT_TEXT[DD_MM_SSPS] = "-dd°mm'ss.s\""; DEG_FORMAT_TEXT[DDPDDDDD_NSEW] = "dd.ddddd° S"; DEG_FORMAT_TEXT[DD_MMPMMM_NSEW] = "dd°mm.mmm' S"; DEG_FORMAT_TEXT[DD_MM_SSPS_NSEW] = "dd°mm'ss.s\" S"; + +UNITS_TEXT[UNITS_KM] = _("km"); +UNITS_TEXT[UNITS_MI] = _("mi."); +UNITS_TEXT[UNITS_NM] = _("n.m."); } static inline gdouble diff --git a/src/latlon.h b/src/latlon.h index 47dfe05..b31649b 100644 --- a/src/latlon.h +++ b/src/latlon.h @@ -37,6 +37,21 @@ typedef enum { } DegFormat; gchar *DEG_FORMAT_TEXT[DEG_FORMAT_ENUM_COUNT]; +/** This enum defines the possible units we can use. */ +typedef enum { + UNITS_KM, + UNITS_MI, + UNITS_NM, + UNITS_ENUM_COUNT +} UnitType; +gchar *UNITS_TEXT[UNITS_ENUM_COUNT]; + +/* UNITS_CONVERTS, when multiplied, converts from NM. */ +#define EARTH_RADIUS (3440.06479f) +gfloat UNITS_CONVERT[UNITS_ENUM_COUNT]; + +UnitType _units; + #define lat_format(F, A, B) deg_format((F),(A), (B), 'S', 'N') #define lon_format(F, A, B) deg_format((F),(A), (B), 'W', 'E') diff --git a/src/map.h b/src/map.h index f1c1539..f15df0e 100644 --- a/src/map.h +++ b/src/map.h @@ -137,6 +137,17 @@ typedef enum { MAP_MODES } MapMode; +/** Possible center modes. The "WAS" modes imply no current center mode; + * they only hint at what the last center mode was, so that it can be + * recalled. */ +typedef enum { + CENTER_WAS_LATLON = -2, + CENTER_WAS_LEAD = -1, + CENTER_MANUAL =0, + CENTER_LEAD = 1, + CENTER_LATLON = 2 +} CenterMode; + /** VARIABLES FOR MAINTAINING STATE OF THE CURRENT VIEW. */ /** The "zoom" level defines the resolution of a pixel, from 0 to MAX_ZOOM. @@ -168,11 +179,22 @@ guint _focus_unitwidth; guint _focus_unitheight; guint _world_size_tiles; +gint _show_tracks; +gboolean _show_scale; +gboolean _show_velvec; +gboolean _show_poi; + +guint _lead_ratio; +guint _center_ratio; +guint _draw_width; + guint _key_zoom_new; guint _key_zoom_timeout_sid; osm_location map_loc; +CenterMode _center_mode; + /** The widget that provides the visual display of the map. */ GtkWidget *_map_widget; diff --git a/src/mapper-types.h b/src/mapper-types.h index 9bee657..914290b 100644 --- a/src/mapper-types.h +++ b/src/mapper-types.h @@ -33,17 +33,6 @@ typedef enum { REPOTYPE_WMS /* "service=wms" */ } RepoType; -/** Possible center modes. The "WAS" modes imply no current center mode; - * they only hint at what the last center mode was, so that it can be - * recalled. */ -typedef enum { - CENTER_WAS_LATLON = -2, - CENTER_WAS_LEAD = -1, - CENTER_MANUAL =0, - CENTER_LEAD = 1, - CENTER_LATLON = 2 -} CenterMode; - /* Route list */ typedef enum { ROUTE_LATLON, @@ -65,19 +54,6 @@ typedef enum { CAT_NUM_COLUMNS } CategoryList; -/** This enum defines the possible units we can use. */ -typedef enum { - UNITS_KM, - UNITS_MI, - UNITS_NM, - UNITS_ENUM_COUNT -} UnitType; -gchar *UNITS_TEXT[UNITS_ENUM_COUNT]; - -/* UNITS_CONVERTS, when multiplied, converts from NM. */ -#define EARTH_RADIUS (3440.06479f) -gfloat UNITS_CONVERT[UNITS_ENUM_COUNT]; - /** This enum defines the possible font sizes. */ typedef enum { INFO_FONT_XXSMALL, diff --git a/src/mapper.c b/src/mapper.c index e3ed145..af39b45 100644 --- a/src/mapper.c +++ b/src/mapper.c @@ -120,10 +120,6 @@ static GtkWidget *init_dialog; static void variables_init(void) { -UNITS_TEXT[UNITS_KM] = _("km"); -UNITS_TEXT[UNITS_MI] = _("mi."); -UNITS_TEXT[UNITS_NM] = _("n.m."); - INFO_FONT_TEXT[INFO_FONT_XXSMALL] = "xx-small"; INFO_FONT_TEXT[INFO_FONT_XSMALL] = "x-small"; INFO_FONT_TEXT[INFO_FONT_SMALL] = "small"; diff --git a/src/settings.h b/src/settings.h index 29a03e5..3b01d13 100644 --- a/src/settings.h +++ b/src/settings.h @@ -18,19 +18,13 @@ gboolean _track_store; gboolean _always_keep_on; gboolean _fullscreen; + gboolean _enable_gps; gboolean _gps_info; +gboolean _satdetails_on; -gint _show_tracks; -gboolean _show_scale; -gboolean _show_velvec; -gboolean _show_poi; gboolean _auto_download; -guint _lead_ratio; -guint _center_ratio; -guint _draw_width; - gboolean _enable_voice; guint _announce_notice_ratio; guint _voice_speed; @@ -40,8 +34,6 @@ gboolean _speed_on; gboolean _speed_excess; guint _speed_limit; -gboolean _satdetails_on; - gchar *_http_proxy_host; gint _http_proxy_port; @@ -49,8 +41,6 @@ GSList *_loc_list; GtkListStore *_loc_model; CustomAction _action[CUSTOM_KEY_ENUM_COUNT]; -CenterMode _center_mode; -UnitType _units; guint _degformat; SpeedLocation _speed_location; InfoFontSize _info_font_size;