Contents of /trunk/src/appdata.h

Parent Directory Parent Directory | Revision Log Revision Log


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