]> err.no Git - mapper/blobdiff - src/mapper-types.h
Include settings.h so the banner macro hildon version works.
[mapper] / src / mapper-types.h
index d80aa6860ff15e34c8f414757565d2ca53901f51..1be33ac53de0ed5114e1d48f9078a559dcc48af4 100644 (file)
@@ -1,89 +1,21 @@
 #include "config.h"
 
-#define _GNU_SOURCE
-
-#include <math.h>
-
 #ifndef _MAPPER_TYPES_H
 #define _MAPPER_TYPES_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;
-
-/** 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;
-
-/** This enum defines the states of the SAX parsing state machine. */
-typedef enum {
-       START,
-       INSIDE_GPX,
-       INSIDE_PATH,
-       INSIDE_PATH_SEGMENT,
-       INSIDE_PATH_POINT,
-       INSIDE_PATH_POINT_ELE,
-       INSIDE_PATH_POINT_TIME,
-       INSIDE_PATH_POINT_DESC,
-       FINISH,
-       UNKNOWN,
-       ERROR,
-} SaxState;
-
-/** POI dialog action **/
-typedef enum {
-       ACTION_ADD_POI,
-       ACTION_EDIT_POI,
-} POIAction;
-
-/** Category list **/
-typedef enum {
-       CAT_ID,
-       CAT_ENABLED,
-       CAT_LABEL,
-       CAT_DESC,
-       CAT_POI_CNT,
-       CAT_NUM_COLUMNS
-} CategoryList;
-
-/** POI list **/
-typedef enum {
-       POI_POIID,
-       POI_CATID,
-       POI_LAT,
-       POI_LON,
-       POI_LATLON,
-       POI_LABEL,
-       POI_DESC,
-       POI_CATLAB,
-       POI_NUM_COLUMNS
-} POIList;
+#include <math.h>
+#include <gtk/gtk.h>
+#include <curl/multi.h>
 
-/** This enum defines the possible units we can use. */
+/* Route list */
 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];
+       ROUTE_LATLON,
+       ROUTE_DISTANCE,
+       ROUTE_WAYPOINT,
+       ROUTE_LAT,
+       ROUTE_LON,
+       ROUTE_NUM_COLUMNS
+} RouteList;
 
 /** This enum defines the possible font sizes. */
 typedef enum {
@@ -158,17 +90,6 @@ typedef enum {
 gchar *COLORABLE_GCONF[COLORABLE_ENUM_COUNT];
 GdkColor COLORABLE_DEFAULT[COLORABLE_ENUM_COUNT];
 
-typedef enum {
-       DDPDDDDD,
-       DD_MMPMMM,
-       DD_MM_SSPS,
-       DDPDDDDD_NSEW,
-       DD_MMPMMM_NSEW,
-       DD_MM_SSPS_NSEW,
-       DEG_FORMAT_ENUM_COUNT
-} DegFormat;
-gchar *DEG_FORMAT_TEXT[DEG_FORMAT_ENUM_COUNT];
-
 typedef enum {
        SPEED_LOCATION_TOP_LEFT,
        SPEED_LOCATION_TOP_RIGHT,
@@ -178,80 +99,6 @@ typedef enum {
 } SpeedLocation;
 gchar *SPEED_LOCATION_TEXT[SPEED_LOCATION_ENUM_COUNT];
 
-/** A lat/lon/alt position */
-typedef struct _Position Position;
-struct _Position {
-       gdouble lat;
-       gdouble lon;
-       gfloat altitude;
-       gboolean valid;
-};
-
-/** A general definition of a point in the Mapper unit system. */
-typedef struct _Point Point;
-struct _Point {
-       guint unitx;
-       guint unity;
-       time_t time;
-       gfloat altitude;
-};
-
-/** A WayPoint, which is a Point with a description. */
-typedef struct _WayPoint WayPoint;
-struct _WayPoint {
-       Point *point;
-       gchar *desc;
-};
-
-/** A Path is a set of PathPoints and WayPoints. */
-typedef struct _Path Path;
-struct _Path {
-       Point *head;            /* points to first element in array; NULL if empty. */
-       Point *tail;            /* points to last element in array. */
-       Point *cap;             /* points after last slot in array. */
-       WayPoint *whead;        /* points to first element in array; NULL if empty. */
-       WayPoint *wtail;        /* points to last element in array. */
-       WayPoint *wcap;         /* points after last slot in array. */
-};
-
-/** Data used during the SAX parsing operation. */
-typedef struct _SaxData SaxData;
-struct _SaxData {
-       Path path;
-       SaxState state;
-       SaxState prev_state;
-       guint unknown_depth;
-       gboolean at_least_one_trkpt;
-       GString *chars;
-};
-
-/** 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;
@@ -275,9 +122,4 @@ struct _BrowseInfo {
        GtkWidget *txt;
 };
 
-Point _point_null;
-
-Position _home;
-Position _dest;
-
 #endif