Contents of /trunk/src/appdata.h

Parent Directory Parent Directory | Revision Log Revision Log


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