]> err.no Git - mapper/blob - src/position.h
More map widget integration changes
[mapper] / src / position.h
1 #ifndef _POSITION_H
2 #define _POSITION_H
3
4 #include <glib.h>
5 #include <glib-object.h>
6
7 typedef enum {
8         POSITION_TYPE_GPS,
9         POSITION_TYPE_HOME,
10         POSITION_TYPE_DESTINATION,
11         POSITION_TYPE_WAYPOINT,
12         POSITION_TYPE_FRIEND,
13 } PositionType;
14
15 /** A lat/lon/alt position */
16
17 typedef struct _Position Position;
18 struct _Position {
19         gchar *name;            /* Name of position */
20         guint id;                       /* Unique ID of position */
21         PositionType type;      /* Type of position (Home, Destination, Waypoint, etc) */
22         gboolean valid;         /* Is lat/lon valid ? */
23         gdouble lat;
24         gdouble lon;
25         gfloat altitude;
26         gfloat heading;         /* Where is it heading ? */
27         gfloat angle;           /* Course from current position to this one */
28         time_t time;            /* Time last changed */
29 };
30
31 /* Special positions */
32 Position *_home;
33 Position *_dest;
34
35 Position *position_new(PositionType type, guint id);
36 void position_free(Position *p);
37 void position_set(Position *pos, gboolean valid, gdouble lat, gdouble lon, gfloat alt);
38
39 #endif