]> Pileus Git - aweather/blob - src/plugins/gps-plugin.h
5495b26ff71fc383c6e7397bcce49e964f107f94
[aweather] / src / plugins / gps-plugin.h
1 /*
2  * Copyright (C) 2012 Adam Boggs <boggs@aircrafter.org>
3  * 
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  */
17 #ifndef _GPS_PLUGIN_H
18 #define _GPS_PLUGIN_H
19
20 #define GRITS_TYPE_PLUGIN_GPS            (grits_plugin_gps_get_type ())
21 #define GRITS_PLUGIN_GPS(obj)            (G_TYPE_CHECK_INSTANCE_CAST((obj),   GRITS_TYPE_PLUGIN_GPS, GritsPluginGps))
22 #define GRITS_IS_PLUGIN_GPS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE((obj),   GRITS_TYPE_PLUGIN_GPS))
23 #define GRITS_PLUGIN_GPS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST   ((klass), GRITS_TYPE_PLUGIN_GPS, GritsPluginGpsClass))
24 #define GRITS_IS_PLUGIN_GPS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE   ((klass), GRITS_TYPE_PLUGIN_GPS))
25 #define GRITS_PLUGIN_GPS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),   GRITS_TYPE_PLUGIN_GPS, GritsPluginGpsClass))
26
27 typedef struct _GritsPluginGps      GritsPluginGps;
28 typedef struct _GritsPluginGpsClass GritsPluginGpsClass;
29
30 /* All the User Interface objects we need to keep track of. */
31 typedef struct {
32         /* gps info frame */
33         GtkWidget *gps_status_frame;
34         GtkWidget *gps_status_table;
35         GtkWidget *gps_status_label;
36         GtkWidget *gps_latitude_label;
37         GtkWidget *gps_longitude_label;
38         GtkWidget *gps_heading_label;
39         GtkWidget *gps_elevation_label;
40
41         GtkWidget *status_bar;
42
43         /* control frame */
44         GtkWidget *gps_follow_checkbox;
45         GtkWidget *gps_track_checkbox;
46         GtkWidget *gps_clear_button;
47
48         /* log frame */
49         GtkWidget *gps_log_checkbox;
50         GtkWidget *gps_log_filename_entry;
51         GtkWidget *gps_log_interval_slider;
52         guint      gps_log_timeout_id; /* id of timeout so we can delete it */
53         guint      gps_log_number;     /* sequential log number */
54
55         /* range ring frame */
56         GtkWidget *gps_rangering_checkbox;
57 } GpsUi;
58
59 typedef struct {
60         /* track storage */
61         gboolean   active;  /* Display track history */
62         gdouble (**points)[3];
63         GritsLine *line;
64         guint      cur_point;
65         guint      num_points;
66         guint      cur_group;
67 } GpsTrack;
68
69 /* GPS private data */
70 struct _GritsPluginGps {
71         GObject parent_instance;
72
73         /* instance members */
74         GritsViewer *viewer;
75         GritsPrefs  *prefs;
76         GtkWidget   *config;
77         guint        tab_id;
78         GtkWidget   *hbox;
79         GritsMarker *marker;
80
81         struct gps_data_t gps_data;
82
83         gboolean     follow_gps;
84         gboolean     gps_rangering_active;  /* range rings are visible or not */
85         guint        gps_update_timeout_id; /* id of timeout so we can delete it */
86
87         GpsTrack     track;
88         GpsUi        ui;
89 };
90
91 struct _GritsPluginGpsClass {
92         GObjectClass parent_class;
93 };
94
95 GType grits_plugin_gps_get_type();
96
97
98 #endif /* GPS_PLUGIN_H */
99