2 * viking -- GPS Data and Topo Analyzer, Explorer, and Manager
4 * Copyright (C) 2003-2005, Evan Battaglia <gtoevan@gmx.net>
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.
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.
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
22 #ifndef __VIKING_GLOBALS_H
23 #define __VIKING_GLOBALS_H
27 #define PROJECT "Viking"
28 #define VIKING_VERSION PACKAGE_VERSION
29 #define VIKING_VERSION_NAME "This Name For Rent"
30 #define VIKING_URL "http://viking.sf.net/"
32 #define ALTI_TO_MPP 1.4017295
33 #define MPP_TO_ALTI 0.7134044
35 #define VIK_FEET_IN_METER 3.2808399
36 #define VIK_METERS_TO_FEET(X) ((X)*VIK_FEET_IN_METER)
37 #define VIK_FEET_TO_METERS(X) ((X)/VIK_FEET_IN_METER)
39 /* MPS - Metres Per Second */
40 /* MPH - Metres Per Hour */
41 #define VIK_MPH_IN_MPS 2.23693629
42 #define VIK_MPS_TO_MPH(X) ((X)*VIK_MPH_IN_MPS)
43 #define VIK_MPH_TO_MPS(X) ((X)/VIK_MPH_IN_MPS)
45 /* KPH - Kilometres Per Hour */
46 #define VIK_KPH_IN_MPS 3.6
47 #define VIK_MPS_TO_KPH(X) ((X)*VIK_KPH_IN_MPS)
48 #define VIK_KPH_TO_MPS(X) ((X)/VIK_KPH_IN_MPS)
50 #define VIK_KNOTS_IN_MPS 1.94384449
51 #define VIK_MPS_TO_KNOTS(X) ((X)*VIK_KNOTS_IN_MPS)
52 #define VIK_KNOTS_TO_MPS(X) ((X)/VIK_KNOTS_IN_MPS)
54 #define VIK_DEFAULT_ALTITUDE 0.0
55 #define VIK_DEFAULT_DOP 0.0
57 #define VIK_GTK_WINDOW_FROM_WIDGET(x) GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(x)))
58 #define VIK_GTK_WINDOW_FROM_LAYER(x) VIK_GTK_WINDOW_FROM_WIDGET(VIK_LAYER(x)->vt)
60 #define DEG2RAD 0.017453293
61 #define RAD2DEG 57.2957795
63 /* mercator projection, latitude conversion (degrees) */
64 #define MERCLAT(x) (RAD2DEG * log(tan((0.25 * M_PI) + (0.5 * DEG2RAD * (x)))))
65 #define DEMERCLAT(x) (RAD2DEG * atan(sinh(DEG2RAD * (x))))
67 /* Some command line options */
68 extern gboolean vik_debug;
69 extern gboolean vik_verbose;
70 extern gboolean vik_version;
72 /* Global preferences */
73 void a_vik_preferences_init ();
75 /* Coord display preferences */
77 VIK_DEGREE_FORMAT_DDD,
78 VIK_DEGREE_FORMAT_DMM,
79 VIK_DEGREE_FORMAT_DMS,
80 } vik_degree_format_t;
82 vik_degree_format_t a_vik_get_degree_format ( );
84 /* Distance preferences */
86 VIK_UNITS_DISTANCE_KILOMETRES,
87 VIK_UNITS_DISTANCE_MILES,
88 } vik_units_distance_t;
90 vik_units_distance_t a_vik_get_units_distance ( );
92 /* Speed preferences */
94 VIK_UNITS_SPEED_KILOMETRES_PER_HOUR,
95 VIK_UNITS_SPEED_MILES_PER_HOUR,
96 VIK_UNITS_SPEED_METRES_PER_SECOND,
97 VIK_UNITS_SPEED_KNOTS,
100 vik_units_speed_t a_vik_get_units_speed ( );
102 /* Height (Depth) preferences */
104 VIK_UNITS_HEIGHT_METRES,
105 VIK_UNITS_HEIGHT_FEET,
106 } vik_units_height_t;
108 vik_units_height_t a_vik_get_units_height ( );
110 gboolean a_vik_get_use_large_waypoint_icons ( );
112 /* Location preferences */
118 gdouble a_vik_get_default_lat ( );
119 gdouble a_vik_get_default_long ( );
121 /* Group for global preferences */
122 #define VIKING_PREFERENCES_GROUP_KEY "viking.globals"
123 #define VIKING_PREFERENCES_NAMESPACE "viking.globals."