Contents of /trunk/src/appdata.h

Parent Directory Parent Directory | Revision Log Revision Log


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