Contents of /trunk/src/misc.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 77 - (hide annotations)
Tue Aug 25 12:49:03 2009 UTC (14 years, 8 months ago) by harbaum
File MIME type: text/plain
File size: 2567 byte(s)
osm-map path, gps etc. adjustements
1 harbaum 1 /*
2     * Copyright (C) 2008 Till Harbaum <till@harbaum.org>.
3     *
4     * This file is part of GPXView.
5     *
6     * GPXView 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 3 of the License, or
9     * (at your option) any later version.
10     *
11     * GPXView 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 GPXView. If not, see <http://www.gnu.org/licenses/>.
18     */
19    
20     #ifndef MISC_H
21     #define MISC_H
22    
23     #define SIZE_NORMAL 0
24     #define SIZE_BIG 1 /* effect only on non-maemo */
25     #define SIZE_SMALL 2 /* effect only on maemo */
26    
27     #define STRIKETHROUGH_NONE 0
28     #define STRIKETHROUGH 1
29     #define STRIKETHROUGH_RED 2
30    
31     #ifdef USE_MAEMO
32     #define GTK_LABEL_BIG(a) gtk_label_new(a)
33     #define GTK_LABEL_SMALL(a) gtk_label_small(a)
34     GtkWidget *gtk_label_small(char *str);
35     #else
36     #define GTK_LABEL_SMALL(a) gtk_label_new(a)
37     #define GTK_LABEL_BIG(a) gtk_label_big(a)
38     GtkWidget *gtk_label_big(char *str);
39     #endif
40    
41     GtkWidget *gtk_label_attrib(char *str, int size, int strikethrough);
42     GtkWidget *gtk_button_attrib(char *str, int size, int strikethrough);
43     void gtk_label_attrib_set(GtkWidget *label,
44     char *str, int size, int strikethrough);
45    
46     void pos_lat_str(char *str, int len, float latitude);
47     void pos_lon_str(char *str, int len, float longitude);
48     GtkWidget *pos_lat(float latitude, int size, int strikethrough);
49     GtkWidget *pos_lon(float longitude, int size, int strikethrough);
50     float pos_parse_lat(char *str);
51     float pos_parse_lon(char *str);
52     const char *pos_get_bearing_str(pos_t from, pos_t to);
53    
54     void textbox_enable(GtkWidget *widget);
55     void textbox_disable(GtkWidget *widget);
56    
57     int checkdir(char *dir);
58     char strlastchr(char *str);
59    
60     pos_t *get_pos(appdata_t *appdata);
61    
62     void distance_str(char *str, int len, float dist, gboolean mil);
63     float distance_parse(char *str, gboolean imperial);
64    
65     GtkWidget *lat_entry_new(float lat);
66     GtkWidget *lon_entry_new(float lon);
67     GtkWidget *dist_entry_new(float dist, gboolean mil);
68     float lat_get(GtkWidget *widget);
69     float lon_get(GtkWidget *widget);
70     float dist_get(GtkWidget *widget, gboolean mil);
71    
72     #ifndef USE_MAEMO
73     #ifdef ENABLE_BROWSER_INTERFACE
74     extern int browser_url(appdata_t *appdata, char *url);
75     #endif
76     #endif
77    
78 harbaum 77 void rmdir_recursive(char *path);
79    
80 harbaum 1 #endif // MISC_H