]>
Commit | Line | Data |
---|---|---|
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 | ||
35 | #define VIK_DEFAULT_ALTITUDE 0.0 | |
4a42b254 | 36 | #define VIK_DEFAULT_DOP 0.0 |
50a14534 EB |
37 | |
38 | #define VIK_GTK_WINDOW_FROM_WIDGET(x) GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(x))) | |
39 | #define VIK_GTK_WINDOW_FROM_LAYER(x) VIK_GTK_WINDOW_FROM_WIDGET(VIK_LAYER(x)->vt) | |
40 | ||
41 | #define DEG2RAD 0.017453293 | |
42 | #define RAD2DEG 57.2957795 | |
43 | ||
44 | /* mercator projection, latitude conversion (degrees) */ | |
45 | #define MERCLAT(x) (RAD2DEG * log(tan((0.25 * M_PI) + (0.5 * DEG2RAD * (x))))) | |
46 | #define DEMERCLAT(x) (RAD2DEG * atan(sinh(DEG2RAD * (x)))) | |
47 | ||
2936913d GB |
48 | /* Some command line options */ |
49 | extern gboolean vik_debug; | |
50 | extern gboolean vik_verbose; | |
51 | extern gboolean vik_version; | |
52 | ||
3bfdae59 | 53 | /* Global preferences */ |
a58aaed4 GB |
54 | void a_vik_preferences_init (); |
55 | ||
56 | /* Coord display preferences */ | |
57 | typedef enum { | |
58 | VIK_DEGREE_FORMAT_DDD, | |
59 | VIK_DEGREE_FORMAT_DMM, | |
60 | VIK_DEGREE_FORMAT_DMS, | |
61 | } vik_degree_format_t; | |
62 | ||
63 | vik_degree_format_t a_vik_get_degree_format ( ); | |
64 | ||
6f9336aa RN |
65 | /* Distance preferences */ |
66 | typedef enum { | |
67 | VIK_UNITS_DISTANCE_KILOMETRES, | |
68 | VIK_UNITS_DISTANCE_MILES, | |
69 | } vik_units_distance_t; | |
70 | ||
71 | vik_units_distance_t a_vik_get_units_distance ( ); | |
72 | ||
13bdea80 RN |
73 | /* Speed preferences */ |
74 | typedef enum { | |
75 | VIK_UNITS_SPEED_KILOMETRES_PER_HOUR, | |
76 | VIK_UNITS_SPEED_MILES_PER_HOUR, | |
77 | VIK_UNITS_SPEED_METRES_PER_SECOND, | |
78 | } vik_units_speed_t; | |
79 | ||
80 | vik_units_speed_t a_vik_get_units_speed ( ); | |
81 | ||
6027a9c5 RN |
82 | /* Height (Depth) preferences */ |
83 | typedef enum { | |
84 | VIK_UNITS_HEIGHT_METRES, | |
85 | VIK_UNITS_HEIGHT_FEET, | |
86 | } vik_units_height_t; | |
87 | ||
88 | vik_units_height_t a_vik_get_units_height ( ); | |
89 | ||
9be0449f RN |
90 | gboolean a_vik_get_use_large_waypoint_icons ( ); |
91 | ||
5210c3d3 GB |
92 | /* Location preferences */ |
93 | typedef enum { | |
94 | VIK_LOCATION_LAT, | |
95 | VIK_LOCATION_LONG, | |
96 | } vik_location_t; | |
97 | ||
98 | gdouble a_vik_get_default_lat ( ); | |
99 | gdouble a_vik_get_default_long ( ); | |
100 | ||
d8fa3de5 JJ |
101 | /* Group for global preferences */ |
102 | #define VIKING_PREFERENCES_GROUP_KEY "viking.globals" | |
103 | #define VIKING_PREFERENCES_NAMESPACE "viking.globals." | |
104 | ||
50a14534 | 105 | #endif |