]> git.street.me.uk Git - andy/viking.git/blame - src/globals.h
Add 'Advanced' preferences tab.
[andy/viking.git] / src / globals.h
CommitLineData
50a14534
EB
1/*
2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
3 *
4 * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */
21
22#ifndef __VIKING_GLOBALS_H
23#define __VIKING_GLOBALS_H
24
2936913d
GB
25#include <glib.h>
26
722b5481
RN
27G_BEGIN_DECLS
28
50a14534 29#define PROJECT "Viking"
901ca9d5 30#define VIKING_VERSION PACKAGE_VERSION
1fe49af0 31#define VIKING_VERSION_NAME "This Name For Rent"
50a14534
EB
32#define VIKING_URL "http://viking.sf.net/"
33
50a14534
EB
34#define ALTI_TO_MPP 1.4017295
35#define MPP_TO_ALTI 0.7134044
36
6c20e59a 37#define VIK_FEET_IN_METER 3.2808399
9ac936f2 38#define VIK_METERS_TO_FEET(X) ((X)*VIK_FEET_IN_METER)
6b2be5d9 39#define VIK_FEET_TO_METERS(X) ((X)/VIK_FEET_IN_METER)
ab1e0693 40
433b3f7f
RN
41#define VIK_MILES_IN_METER 0.000621371192
42#define VIK_METERS_TO_MILES(X) ((X)*VIK_MILES_IN_METER)
43#define VIK_MILES_TO_METERS(X) ((X)/VIK_MILES_IN_METER)
44
ab1e0693
RN
45/* MPS - Metres Per Second */
46/* MPH - Metres Per Hour */
47#define VIK_MPH_IN_MPS 2.23693629
6b2be5d9
GB
48#define VIK_MPS_TO_MPH(X) ((X)*VIK_MPH_IN_MPS)
49#define VIK_MPH_TO_MPS(X) ((X)/VIK_MPH_IN_MPS)
ab1e0693
RN
50
51/* KPH - Kilometres Per Hour */
52#define VIK_KPH_IN_MPS 3.6
6b2be5d9
GB
53#define VIK_MPS_TO_KPH(X) ((X)*VIK_KPH_IN_MPS)
54#define VIK_KPH_TO_MPS(X) ((X)/VIK_KPH_IN_MPS)
ab1e0693
RN
55
56#define VIK_KNOTS_IN_MPS 1.94384449
6b2be5d9
GB
57#define VIK_MPS_TO_KNOTS(X) ((X)*VIK_KNOTS_IN_MPS)
58#define VIK_KNOTS_TO_MPS(X) ((X)/VIK_KNOTS_IN_MPS)
62e4939d 59
50a14534 60#define VIK_DEFAULT_ALTITUDE 0.0
4a42b254 61#define VIK_DEFAULT_DOP 0.0
50a14534
EB
62
63#define VIK_GTK_WINDOW_FROM_WIDGET(x) GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(x)))
64#define VIK_GTK_WINDOW_FROM_LAYER(x) VIK_GTK_WINDOW_FROM_WIDGET(VIK_LAYER(x)->vt)
65
81765f5e
GB
66#define DEG2RAD(x) ((x)*(M_PI/180))
67#define RAD2DEG(x) ((x)*(180/M_PI))
50a14534
EB
68
69/* mercator projection, latitude conversion (degrees) */
81765f5e
GB
70#define MERCLAT(x) (RAD2DEG(log(tan((0.25 * M_PI) + (0.5 * DEG2RAD(x))))))
71#define DEMERCLAT(x) (RAD2DEG(atan(sinh(DEG2RAD(x)))))
50a14534 72
2936913d
GB
73/* Some command line options */
74extern gboolean vik_debug;
75extern gboolean vik_verbose;
76extern gboolean vik_version;
77
3bfdae59 78/* Global preferences */
a58aaed4
GB
79void a_vik_preferences_init ();
80
81/* Coord display preferences */
82typedef enum {
83 VIK_DEGREE_FORMAT_DDD,
84 VIK_DEGREE_FORMAT_DMM,
85 VIK_DEGREE_FORMAT_DMS,
86} vik_degree_format_t;
87
88vik_degree_format_t a_vik_get_degree_format ( );
89
6f9336aa
RN
90/* Distance preferences */
91typedef enum {
92 VIK_UNITS_DISTANCE_KILOMETRES,
93 VIK_UNITS_DISTANCE_MILES,
94} vik_units_distance_t;
95
96vik_units_distance_t a_vik_get_units_distance ( );
97
13bdea80
RN
98/* Speed preferences */
99typedef enum {
100 VIK_UNITS_SPEED_KILOMETRES_PER_HOUR,
101 VIK_UNITS_SPEED_MILES_PER_HOUR,
102 VIK_UNITS_SPEED_METRES_PER_SECOND,
a4c92313 103 VIK_UNITS_SPEED_KNOTS,
13bdea80
RN
104} vik_units_speed_t;
105
106vik_units_speed_t a_vik_get_units_speed ( );
107
6027a9c5
RN
108/* Height (Depth) preferences */
109typedef enum {
110 VIK_UNITS_HEIGHT_METRES,
111 VIK_UNITS_HEIGHT_FEET,
112} vik_units_height_t;
113
114vik_units_height_t a_vik_get_units_height ( );
115
9be0449f
RN
116gboolean a_vik_get_use_large_waypoint_icons ( );
117
5210c3d3
GB
118/* Location preferences */
119typedef enum {
120 VIK_LOCATION_LAT,
121 VIK_LOCATION_LONG,
122} vik_location_t;
123
124gdouble a_vik_get_default_lat ( );
125gdouble a_vik_get_default_long ( );
126
60dbd0ad
RN
127/* KML export preferences */
128typedef enum {
129 VIK_KML_EXPORT_UNITS_METRIC,
130 VIK_KML_EXPORT_UNITS_STATUTE,
131 VIK_KML_EXPORT_UNITS_NAUTICAL,
132} vik_kml_export_units_t;
133
134vik_kml_export_units_t a_vik_get_kml_export_units ( );
135
d13f1a57
RN
136typedef enum {
137 VIK_GPX_EXPORT_TRK_SORT_ALPHA,
138 VIK_GPX_EXPORT_TRK_SORT_TIME,
139} vik_gpx_export_trk_sort_t;
140
141vik_gpx_export_trk_sort_t a_vik_get_gpx_export_trk_sort ( );
142
72f067ad
RN
143typedef enum {
144 VIK_GPX_EXPORT_WPT_SYM_NAME_TITLECASE,
145 VIK_GPX_EXPORT_WPT_SYM_NAME_LOWERCASE,
146} vik_gpx_export_wpt_sym_name_t;
147
148vik_gpx_export_wpt_sym_name_t a_vik_gpx_export_wpt_sym_name ( );
149
3317dc4e
RN
150#ifndef WINDOWS
151/* Windows automatically uses the system defined viewer
152 ATM for other systems need to specify the program to use */
153const gchar* a_vik_get_image_viewer ( );
154#endif
155
ccccf356
RN
156const gchar* a_vik_get_external_gpx_program_1 ( );
157
ff02058b
RN
158const gchar* a_vik_get_external_gpx_program_2 ( );
159
d8fa3de5
JJ
160/* Group for global preferences */
161#define VIKING_PREFERENCES_GROUP_KEY "viking.globals"
162#define VIKING_PREFERENCES_NAMESPACE "viking.globals."
163
2702f416
RN
164/* Another group of global preferences,
165 but in a separate section to try to keep things organized */
166/* AKA Export/External Prefs */
167#define VIKING_PREFERENCES_IO_GROUP_KEY "viking.io"
168#define VIKING_PREFERENCES_IO_NAMESPACE "viking.io."
169
29277258
RN
170/* Group for global preferences - but 'advanced'
171 User changeable but only for those that need it */
172#define VIKING_PREFERENCES_ADVANCED_GROUP_KEY "viking.advanced"
173#define VIKING_PREFERENCES_ADVANCED_NAMESPACE "viking.advanced."
174
722b5481
RN
175G_END_DECLS
176
50a14534 177#endif