#include "config.h"
-#define _GNU_SOURCE
-
-#include <math.h>
-#include <gtk/gtk.h>
-
#ifndef _MAPPER_TYPES_H
#define _MAPPER_TYPES_H
-/** 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;
-
-/** 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;
+#include <math.h>
+#include <gtk/gtk.h>
+#include <curl/multi.h>
/* Route list */
typedef enum {
ROUTE_LATLON,
ROUTE_DISTANCE,
ROUTE_WAYPOINT,
+ ROUTE_LAT,
+ ROUTE_LON,
ROUTE_NUM_COLUMNS
} RouteList;
-/** Category list **/
-typedef enum {
- CAT_ID,
- CAT_ENABLED,
- CAT_LABEL,
- CAT_DESC,
- CAT_POI_CNT,
- 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,
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,
} 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;
GtkWidget *txt;
};
-Point _point_null;
-
-Position _home;
-Position _dest;
-
#endif