]> err.no Git - mapper/blob - src/path.h
Clear (desktop) progress when download is done.
[mapper] / src / path.h
1 #ifndef _PATH_H
2 #define _PATH_H
3
4 #include <glib.h>
5
6 /** A lat/lon/alt position */
7 typedef struct _Position Position;
8 struct _Position {
9         gdouble lat;
10         gdouble lon;
11         gfloat altitude;
12         gboolean valid;
13 };
14
15 /** A general definition of a point in the Mapper unit system. */
16 typedef struct _Point Point;
17 struct _Point {
18         guint unitx;
19         guint unity;
20         time_t time;
21         gfloat altitude;
22 };
23
24 /** A WayPoint, which is a Point with a description. */
25 typedef struct _WayPoint WayPoint;
26 struct _WayPoint {
27         Point *point;
28         gchar *desc;
29 };
30
31 /** A Path is a set of PathPoints and WayPoints. */
32 typedef struct _Path Path;
33 struct _Path {
34         Point *head;            /* points to first element in array; NULL if empty. */
35         Point *tail;            /* points to last element in array. */
36         Point *cap;             /* points after last slot in array. */
37         WayPoint *whead;        /* points to first element in array; NULL if empty. */
38         WayPoint *wtail;        /* points to last element in array. */
39         WayPoint *wcap;         /* points after last slot in array. */
40 };
41
42 Point _point_null;
43 Position _home;
44 Position _dest;
45
46 void path_resize(Path *path, guint size);
47 void path_wresize(Path *path, guint wsize);
48
49 #endif