]> git.street.me.uk Git - andy/viking.git/blame - src/globals.h
Add missing G_END_DECLS to header files.
[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
50a14534 27#define PROJECT "Viking"
901ca9d5 28#define VIKING_VERSION PACKAGE_VERSION
1fe49af0 29#define VIKING_VERSION_NAME "This Name For Rent"
50a14534
EB
30#define VIKING_URL "http://viking.sf.net/"
31
50a14534
EB
32#define ALTI_TO_MPP 1.4017295
33#define MPP_TO_ALTI 0.7134044
34
6c20e59a 35#define VIK_FEET_IN_METER 3.2808399
9ac936f2 36#define VIK_METERS_TO_FEET(X) ((X)*VIK_FEET_IN_METER)
6b2be5d9 37#define VIK_FEET_TO_METERS(X) ((X)/VIK_FEET_IN_METER)
ab1e0693 38
433b3f7f
RN
39#define VIK_MILES_IN_METER 0.000621371192
40#define VIK_METERS_TO_MILES(X) ((X)*VIK_MILES_IN_METER)
41#define VIK_MILES_TO_METERS(X) ((X)/VIK_MILES_IN_METER)
42
ab1e0693
RN
43/* MPS - Metres Per Second */
44/* MPH - Metres Per Hour */
45#define VIK_MPH_IN_MPS 2.23693629
6b2be5d9
GB
46#define VIK_MPS_TO_MPH(X) ((X)*VIK_MPH_IN_MPS)
47#define VIK_MPH_TO_MPS(X) ((X)/VIK_MPH_IN_MPS)
ab1e0693
RN
48
49/* KPH - Kilometres Per Hour */
50#define VIK_KPH_IN_MPS 3.6
6b2be5d9
GB
51#define VIK_MPS_TO_KPH(X) ((X)*VIK_KPH_IN_MPS)
52#define VIK_KPH_TO_MPS(X) ((X)/VIK_KPH_IN_MPS)
ab1e0693
RN
53
54#define VIK_KNOTS_IN_MPS 1.94384449
6b2be5d9
GB
55#define VIK_MPS_TO_KNOTS(X) ((X)*VIK_KNOTS_IN_MPS)
56#define VIK_KNOTS_TO_MPS(X) ((X)/VIK_KNOTS_IN_MPS)
62e4939d 57
50a14534 58#define VIK_DEFAULT_ALTITUDE 0.0
4a42b254 59#define VIK_DEFAULT_DOP 0.0
50a14534
EB
60
61#define VIK_GTK_WINDOW_FROM_WIDGET(x) GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(x)))
62#define VIK_GTK_WINDOW_FROM_LAYER(x) VIK_GTK_WINDOW_FROM_WIDGET(VIK_LAYER(x)->vt)
63
64#define DEG2RAD 0.017453293
65#define RAD2DEG 57.2957795
66
67/* mercator projection, latitude conversion (degrees) */
68#define MERCLAT(x) (RAD2DEG * log(tan((0.25 * M_PI) + (0.5 * DEG2RAD * (x)))))
69#define DEMERCLAT(x) (RAD2DEG * atan(sinh(DEG2RAD * (x))))
70
2936913d
GB
71/* Some command line options */
72extern gboolean vik_debug;
73extern gboolean vik_verbose;
74extern gboolean vik_version;
75
3bfdae59 76/* Global preferences */
a58aaed4
GB
77void a_vik_preferences_init ();
78
79/* Coord display preferences */
80typedef enum {
81 VIK_DEGREE_FORMAT_DDD,
82 VIK_DEGREE_FORMAT_DMM,
83 VIK_DEGREE_FORMAT_DMS,
84} vik_degree_format_t;
85
86vik_degree_format_t a_vik_get_degree_format ( );
87
6f9336aa
RN
88/* Distance preferences */
89typedef enum {
90 VIK_UNITS_DISTANCE_KILOMETRES,
91 VIK_UNITS_DISTANCE_MILES,
92} vik_units_distance_t;
93
94vik_units_distance_t a_vik_get_units_distance ( );
95
13bdea80
RN
96/* Speed preferences */
97typedef enum {
98 VIK_UNITS_SPEED_KILOMETRES_PER_HOUR,
99 VIK_UNITS_SPEED_MILES_PER_HOUR,
100 VIK_UNITS_SPEED_METRES_PER_SECOND,
a4c92313 101 VIK_UNITS_SPEED_KNOTS,
13bdea80
RN
102} vik_units_speed_t;
103
104vik_units_speed_t a_vik_get_units_speed ( );
105
6027a9c5
RN
106/* Height (Depth) preferences */
107typedef enum {
108 VIK_UNITS_HEIGHT_METRES,
109 VIK_UNITS_HEIGHT_FEET,
110} vik_units_height_t;
111
112vik_units_height_t a_vik_get_units_height ( );
113
9be0449f
RN
114gboolean a_vik_get_use_large_waypoint_icons ( );
115
5210c3d3
GB
116/* Location preferences */
117typedef enum {
118 VIK_LOCATION_LAT,
119 VIK_LOCATION_LONG,
120} vik_location_t;
121
122gdouble a_vik_get_default_lat ( );
123gdouble a_vik_get_default_long ( );
124
60dbd0ad
RN
125/* KML export preferences */
126typedef enum {
127 VIK_KML_EXPORT_UNITS_METRIC,
128 VIK_KML_EXPORT_UNITS_STATUTE,
129 VIK_KML_EXPORT_UNITS_NAUTICAL,
130} vik_kml_export_units_t;
131
132vik_kml_export_units_t a_vik_get_kml_export_units ( );
133
3317dc4e
RN
134#ifndef WINDOWS
135/* Windows automatically uses the system defined viewer
136 ATM for other systems need to specify the program to use */
137const gchar* a_vik_get_image_viewer ( );
138#endif
139
ccccf356
RN
140const gchar* a_vik_get_external_gpx_program_1 ( );
141
ff02058b
RN
142const gchar* a_vik_get_external_gpx_program_2 ( );
143
d8fa3de5
JJ
144/* Group for global preferences */
145#define VIKING_PREFERENCES_GROUP_KEY "viking.globals"
146#define VIKING_PREFERENCES_NAMESPACE "viking.globals."
147
2702f416
RN
148/* Another group of global preferences,
149 but in a separate section to try to keep things organized */
150/* AKA Export/External Prefs */
151#define VIKING_PREFERENCES_IO_GROUP_KEY "viking.io"
152#define VIKING_PREFERENCES_IO_NAMESPACE "viking.io."
153
50a14534 154#endif