Contents of /trunk/src/appdata.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 308 - (show annotations)
Wed Oct 14 07:25:55 2009 UTC (14 years, 7 months ago) by harbaum
File MIME type: text/plain
File size: 4549 byte(s)
/opt-ified
1 /*
2 * Copyright (C) 2008 Till Harbaum <till@harbaum.org>.
3 *
4 * This file is part of OSM2Go.
5 *
6 * OSM2Go 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 * OSM2Go 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 OSM2Go. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef APPDATA_H
21 #define APPDATA_H
22
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
26
27 #include <locale.h>
28 #include <libintl.h>
29
30 #define LOCALEDIR PREFIX "/locale"
31
32 #define _(String) gettext(String)
33 #define N_(String) (String)
34
35 #ifdef USE_HILDON
36 #if (MAEMO_VERSION_MAJOR == 5)
37 #define FREMANTLE
38 #endif
39
40 #include <hildon/hildon-program.h>
41 #include <hildon/hildon-file-chooser-dialog.h>
42 #include <hildon/hildon-file-system-model.h>
43 #include <hildon/hildon-defines.h>
44 #include <libosso.h> /* required for screen saver timeout */
45 #define GTK_FM_OK GTK_RESPONSE_OK
46 #define HILDON_ENTRY_NO_AUTOCAP(a) \
47 hildon_gtk_entry_set_input_mode(GTK_ENTRY(a),HILDON_GTK_INPUT_MODE_FULL)
48 #else
49 #define GTK_FM_OK GTK_RESPONSE_ACCEPT
50 #define HILDON_ENTRY_NO_AUTOCAP(a)
51 #endif
52
53 #define ZOOM_BUTTONS
54 #define DETAIL_POPUP
55
56 #include <gtk/gtk.h>
57 #include <glib/gstdio.h>
58
59 #include <libgnomevfs/gnome-vfs.h>
60 #include <libgnomevfs/gnome-vfs-inet-connection.h>
61
62 #include "pos.h"
63 #include "osm.h"
64
65 #include "canvas.h"
66 #include "undo.h"
67
68 #ifdef USE_HILDON
69 #include "dbus.h"
70 #endif
71
72 typedef struct appdata_s {
73 #ifdef USE_HILDON
74 HildonProgram *program;
75 HildonWindow *window;
76 osso_context_t *osso_context;
77
78 #else
79 GtkWidget *window;
80 #endif
81
82 GtkWidget *vbox;
83 struct map_s *map;
84 osm_t *osm;
85
86 #ifdef ZOOM_BUTTONS
87 GtkWidget *btn_zoom_in, *btn_zoom_out, *btn_detail_popup;
88 #endif
89
90 struct statusbar_s *statusbar;
91 struct settings_s *settings;
92 struct project_s *project;
93 struct iconbar_s *iconbar;
94 struct icon_s *icon;
95 struct presets_item_s *presets;
96
97 /* menu items to be enabled and disabled every now and then */
98 struct gps_state_s *gps_state;
99
100 #ifdef USE_HILDON
101 dbus_mm_pos_t mmpos;
102 GtkWidget *banner;
103 #endif
104 gboolean banner_is_grabby;
105
106 /* flags used to prevent re-appearence of dialogs */
107 struct {
108 gulong not; /* bit is set if dialog is not to be displayed again */
109 gulong reply; /* reply to be assumed if "not" bit is set */
110 } dialog_again;
111
112 struct {
113 GtkWidget *submenu_track;
114 GtkWidget *menu_item_track_import;
115 GtkWidget *menu_item_track_export;
116 GtkWidget *menu_item_track_clear;
117 GtkWidget *menu_item_track_enable_gps;
118 GtkWidget *menu_item_track_follow_gps;
119 struct track_s *track;
120 #ifndef ENABLE_LIBLOCATION
121 /* when using liblocation, events are generated on position change */
122 /* and no seperate timer is required */
123 guint handler_id;
124 #endif
125 canvas_item_t *gps_item; // the purple circle
126 int warn_cnt;;
127 } track;
128
129 #if !defined(USE_HILDON) || (MAEMO_VERSION_MAJOR < 5)
130 GtkWidget *menu_item_view_fullscreen;
131 #endif
132
133 GtkWidget *submenu_view;
134
135 GtkWidget *submenu_map;
136 GtkWidget *menu_item_map_upload;
137 GtkWidget *menu_item_map_undo;
138 GtkWidget *menu_item_map_save_changes;
139 GtkWidget *menu_item_map_undo_changes;
140 GtkWidget *menu_item_map_relations;
141
142 GtkWidget *submenu_wms;
143 GtkWidget *menu_item_wms_clear;
144 GtkWidget *menu_item_wms_adjust;
145
146 GtkWidget *menu_item_map_hide_sel;
147 GtkWidget *menu_item_map_show_all;
148
149 #if defined(USE_HILDON) && (MAEMO_VERSION_MAJOR == 5)
150 /* submenues are seperate menues under fremantle */
151 GtkWidget *app_menu_view, *app_menu_wms, *app_menu_track;
152 GtkWidget *app_menu_map;
153 #endif
154
155 undo_t undo;
156
157 } appdata_t;
158
159 #include "settings.h"
160 #include "map.h"
161 #include "map_hl.h"
162 #include "osm_api.h"
163 #include "statusbar.h"
164 #include "area_edit.h"
165 #include "project.h"
166 #include "diff.h"
167 #include "iconbar.h"
168 #include "icon.h"
169 #include "info.h"
170 #include "track.h"
171 #include "gps.h"
172 #include "wms.h"
173 #include "josm_presets.h"
174 #include "relation_edit.h"
175 #include "misc.h"
176 #include "map_edit.h"
177 #include "josm_elemstyles.h"
178 #include "style.h"
179 #include "net_io.h"
180 #include "banner.h"
181 #include "list.h"
182 #include "scale_popup.h"
183
184 void main_ui_enable(appdata_t *appdata);
185
186 #endif // APPDATA_H