Contents of /trunk/src/misc.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 221 - (hide annotations)
Mon Nov 30 21:28:04 2009 UTC (14 years, 6 months ago) by harbaum
File MIME type: text/plain
File size: 3615 byte(s)
Fremantle coordinate picker
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 harbaum 221 float lat_entry_get(GtkWidget *widget);
68     float lon_entry_get(GtkWidget *widget);
69     void lat_entry_set(GtkWidget *widget, float lat);
70     void lon_entry_set(GtkWidget *widget, float lon);
71    
72     void lat_label_set(GtkWidget *widget, float lat);
73     void lon_label_set(GtkWidget *widget, float lon);
74     void lat_label_attrib_set(GtkWidget *widget, float lat,
75     int size, int strikethrough);
76     void lon_label_attrib_set(GtkWidget *widget, float lon,
77     int size, int strikethrough);
78    
79 harbaum 1 GtkWidget *dist_entry_new(float dist, gboolean mil);
80     float dist_get(GtkWidget *widget, gboolean mil);
81    
82 harbaum 198 GtkWidget *left_label_new(char *str);
83    
84 harbaum 1 #ifndef USE_MAEMO
85     #ifdef ENABLE_BROWSER_INTERFACE
86     extern int browser_url(appdata_t *appdata, char *url);
87     #endif
88     #endif
89    
90 harbaum 77 void rmdir_recursive(char *path);
91 harbaum 137 GtkWidget *link_button_attrib(appdata_t *appdata, char *str, char *url,
92     int size, int strikethrough);
93     GtkWidget *link_button_by_id(appdata_t *appdata, char *str,
94     const char *type, int id);
95 harbaum 138 GtkWidget *link_icon_button_by_id(appdata_t *appdata, GtkWidget *icon,
96     const char *type, int id);
97 harbaum 165 GtkWidget *simple_text_widget(char *text);
98 harbaum 212
99 harbaum 221 GtkWidget *preset_coordinate_picker(appdata_t *appdata, GtkWidget *lat_entry, GtkWidget *lon_entry);
100     void preset_coordinate_picker_update(appdata_t *appdata, GtkWidget *popup);
101    
102 harbaum 212 GtkWidget *entry_new(void);
103    
104 harbaum 214 gboolean pos_differ(pos_t *pos1, pos_t *pos2);
105    
106 harbaum 1 #endif // MISC_H