From 8998a1ed10427c3f7dd0bfacf0e1afde0a71ea1b Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Mon, 25 Feb 2008 13:09:58 +0200 Subject: [PATCH] Move some variables and enums around --- src/cb.c | 1 + src/config-gconf.c | 1 + src/config-gconf.h | 1 + src/map-download.c | 1 + src/map-download.h | 1 + src/map-poi.c | 1 + src/map-repo.c | 1 + src/map-repo.h | 44 +++++++++++++++++++++++++++++++ src/mapper-types.h | 64 ---------------------------------------------- src/osm-db.h | 16 ++++++++++++ src/poi-gui.c | 1 + src/poi.h | 11 ++++++++ src/settings.h | 3 --- src/ui-common.c | 1 + 14 files changed, 80 insertions(+), 67 deletions(-) create mode 100644 src/map-repo.h diff --git a/src/cb.c b/src/cb.c index e01851a..41cd62e 100644 --- a/src/cb.c +++ b/src/cb.c @@ -62,6 +62,7 @@ #include "dialogs.h" #include "filter-gui.h" #include "help.h" +#include "map-repo.h" static void track_tree_view_update_store(GtkWidget *tree_view, Path *track) diff --git a/src/config-gconf.c b/src/config-gconf.c index ad5bb59..8c02c6f 100644 --- a/src/config-gconf.c +++ b/src/config-gconf.c @@ -54,6 +54,7 @@ #include "settings.h" #include "gpx.h" #include "filter.h" +#include "dialogs.h" #define PROXY_PORT (8080) diff --git a/src/config-gconf.h b/src/config-gconf.h index f48d9a4..0175c0a 100644 --- a/src/config-gconf.h +++ b/src/config-gconf.h @@ -4,6 +4,7 @@ #include #include "filter.h" #include "mapper-types.h" +#include "map-repo.h" GConfClient *gconf_client; diff --git a/src/map-download.c b/src/map-download.c index bc84afb..77264c5 100644 --- a/src/map-download.c +++ b/src/map-download.c @@ -57,6 +57,7 @@ #include "gpx.h" #include "map-download.h" #include "iap.h" +#include "map-repo.h" static guint _num_downloads=0; static guint _curr_download=0; diff --git a/src/map-download.h b/src/map-download.h index 075217b..f5634e1 100644 --- a/src/map-download.h +++ b/src/map-download.h @@ -6,6 +6,7 @@ #include #include #include "mapper-types.h" +#include "map-repo.h" #define INITIAL_DOWNLOAD_RETRIES (3) diff --git a/src/map-poi.c b/src/map-poi.c index b9a18da..318f2ee 100644 --- a/src/map-poi.c +++ b/src/map-poi.c @@ -36,6 +36,7 @@ #include "ui-common.h" #include "map-poi.h" #include "latlon.h" +#include "osm-db.h" #define POI_FONT_SIZE_BIG (10) #define POI_FONT_SIZE_SMALL (8) diff --git a/src/map-repo.c b/src/map-repo.c index 083d34a..db80404 100644 --- a/src/map-repo.c +++ b/src/map-repo.c @@ -49,6 +49,7 @@ #include "ui-common.h" #include "dialogs.h" #include "help.h" +#include "map-repo.h" #define MAP_REPO_LIST_URL "http://www.gnuite.com/nokia770/maemo-mapper/repos.txt" diff --git a/src/map-repo.h b/src/map-repo.h new file mode 100644 index 0000000..b4b843c --- /dev/null +++ b/src/map-repo.h @@ -0,0 +1,44 @@ +#ifndef _MAP_REPO_H +#define _MAP_REPO_H + +/** This enumerated type defines the supported types of repositories. */ +typedef enum { + REPOTYPE_NONE, /* No URL set. */ + REPOTYPE_XYZ, /* x=%d, y=%d, and zoom=%d */ + REPOTYPE_XYZ_INV, /* zoom=%0d, x=%d, y=%d */ + REPOTYPE_QUAD_QRST, /* t=%s (%s = {qrst}*) */ + REPOTYPE_QUAD_ZERO, /* t=%0s (%0s = {0123}*) */ + REPOTYPE_WMS /* "service=wms" */ +} RepoType; + +/** Data regarding a map repository. */ +typedef struct _RepoData RepoData; +struct _RepoData { + gchar *name; + gchar *url; + gchar *cache_dir; + guint dl_zoom_steps; + guint view_zoom_steps; + gboolean double_size; + gboolean nextable; + RepoType type; + GtkWidget *menu_item; +}; + +/** Data used during the asynchronous progress update phase of automatic map + * downloading. */ +typedef struct _ProgressUpdateInfo ProgressUpdateInfo; +struct _ProgressUpdateInfo { + gchar *src_str; + gchar *dest_str; + RepoData *repo; + guint tilex, tiley, zoom; /* for refresh. */ + gint retries; /* if equal to zero, it means we're DELETING maps. */ + guint priority; + FILE *file; +}; + +GList *_repo_list; +RepoData *_curr_repo; + +#endif diff --git a/src/mapper-types.h b/src/mapper-types.h index 914290b..1be33ac 100644 --- a/src/mapper-types.h +++ b/src/mapper-types.h @@ -7,32 +7,6 @@ #include #include -/** Generic search item list indexes */ -typedef enum { - ITEM_ID, - ITEM_CATID, - ITEM_LAT, - ITEM_LON, - ITEM_DIST, - ITEM_LATLON, - ITEM_LABEL, - ITEM_DESC, - ITEM_CATLAB, - ITEM_ICON, - ITEM_COLOR, - ITEM_NUM_COLUMNS -} item_list_id; - -/** This enumerated type defines the supported types of repositories. */ -typedef enum { - REPOTYPE_NONE, /* No URL set. */ - REPOTYPE_XYZ, /* x=%d, y=%d, and zoom=%d */ - REPOTYPE_XYZ_INV, /* zoom=%0d, x=%d, y=%d */ - REPOTYPE_QUAD_QRST, /* t=%s (%s = {qrst}*) */ - REPOTYPE_QUAD_ZERO, /* t=%0s (%0s = {0123}*) */ - REPOTYPE_WMS /* "service=wms" */ -} RepoType; - /* Route list */ typedef enum { ROUTE_LATLON, @@ -43,17 +17,6 @@ typedef enum { ROUTE_NUM_COLUMNS } RouteList; -/** Category list **/ -typedef enum { - CAT_ID, - CAT_ENABLED, - CAT_LABEL, - CAT_DESC, - CAT_POI_CNT, - CAT_ICON, - CAT_NUM_COLUMNS -} CategoryList; - /** This enum defines the possible font sizes. */ typedef enum { INFO_FONT_XXSMALL, @@ -136,33 +99,6 @@ typedef enum { } SpeedLocation; gchar *SPEED_LOCATION_TEXT[SPEED_LOCATION_ENUM_COUNT]; -/** Data regarding a map repository. */ -typedef struct _RepoData RepoData; -struct _RepoData { - gchar *name; - gchar *url; - gchar *cache_dir; - guint dl_zoom_steps; - guint view_zoom_steps; - gboolean double_size; - gboolean nextable; - RepoType type; - GtkWidget *menu_item; -}; - -/** Data used during the asynchronous progress update phase of automatic map - * downloading. */ -typedef struct _ProgressUpdateInfo ProgressUpdateInfo; -struct _ProgressUpdateInfo { - gchar *src_str; - gchar *dest_str; - RepoData *repo; - guint tilex, tiley, zoom; /* for refresh. */ - gint retries; /* if equal to zero, it means we're DELETING maps. */ - guint priority; - FILE *file; -}; - typedef struct _RouteDownloadData RouteDownloadData; struct _RouteDownloadData { gchar *bytes; diff --git a/src/osm-db.h b/src/osm-db.h index 6da5f70..2ef777d 100644 --- a/src/osm-db.h +++ b/src/osm-db.h @@ -26,6 +26,22 @@ #define OSM_RANGE_WAY (20000) +/** Generic search item list indexes */ +typedef enum { + ITEM_ID, + ITEM_CATID, + ITEM_LAT, + ITEM_LON, + ITEM_DIST, + ITEM_LATLON, + ITEM_LABEL, + ITEM_DESC, + ITEM_CATLAB, + ITEM_ICON, + ITEM_COLOR, + ITEM_NUM_COLUMNS +} item_list_id; + typedef enum { OSM_NODE_NEXT, OSM_NODE_PREV, diff --git a/src/poi-gui.c b/src/poi-gui.c index 8a38518..a8e6c08 100644 --- a/src/poi-gui.c +++ b/src/poi-gui.c @@ -27,6 +27,7 @@ #include "settings.h" #include "poi-gui.h" #include "osm.h" +#include "osm-db.h" #include "help.h" diff --git a/src/poi.h b/src/poi.h index 1dca4c1..e488e78 100644 --- a/src/poi.h +++ b/src/poi.h @@ -12,6 +12,17 @@ #include "osm.h" +/** Category list **/ +typedef enum { + CAT_ID, + CAT_ENABLED, + CAT_LABEL, + CAT_DESC, + CAT_POI_CNT, + CAT_ICON, + CAT_NUM_COLUMNS +} CategoryList; + typedef enum { POI_TYPE_POINT=0, POI_TYPE_LANDMARK=1, diff --git a/src/settings.h b/src/settings.h index 3b01d13..8058c03 100644 --- a/src/settings.h +++ b/src/settings.h @@ -45,7 +45,4 @@ guint _degformat; SpeedLocation _speed_location; InfoFontSize _info_font_size; -GList *_repo_list; -RepoData *_curr_repo; - #endif diff --git a/src/ui-common.c b/src/ui-common.c index 7d8039d..e1affdd 100644 --- a/src/ui-common.c +++ b/src/ui-common.c @@ -35,6 +35,7 @@ #include "filter.h" #include "dialogs.h" #include "settings-gui.h" +#include "map-repo.h" /* Callbacks */ #include "cb.h" -- 2.39.5