Contents of /trunk/src/misc.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 195 - (show annotations)
Wed Jul 8 08:51:02 2009 UTC (14 years, 10 months ago) by harbaum
File MIME type: text/plain
File size: 2465 byte(s)
Speaking names in status bar
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 MISC_H
21 #define MISC_H
22
23 #define MISC_AGAIN_ID_DELETE (1<<0)
24 #define MISC_AGAIN_ID_JOIN_NODES (1<<1)
25 #define MISC_AGAIN_ID_JOIN_WAYS (1<<2)
26 #define MISC_AGAIN_ID_OVERWRITE_TAGS (1<<3)
27 #define MISC_AGAIN_ID_EXTEND_WAY (1<<4)
28 #define MISC_AGAIN_ID_EXTEND_WAY_END (1<<5)
29 #define MISC_AGAIN_ID_EXPORT_OVERWRITE (1<<6)
30
31 typedef struct file_chain_s {
32 char *name;
33 struct file_chain_s *next;
34 } file_chain_t;
35
36 /* these flags prevent you from leaving the dialog with no (or yes) */
37 /* if the "dont show me this dialog again" checkbox is selected. This */
38 /* makes sure, that you can't permanently switch certain things in, but */
39 /* only on. e.g. it doesn't make sense to answer a "do you really want to */
40 /* delete this" dialog with "no and don't ask me again". You'd never be */
41 /* able to delete anything again */
42 #define MISC_AGAIN_FLAG_DONT_SAVE_NO (1<<0)
43 #define MISC_AGAIN_FLAG_DONT_SAVE_YES (1<<1)
44
45 void errorf(GtkWidget *parent, const char *fmt, ...);
46 void messagef(GtkWidget *parent, char *title, const char *fmt, ...);
47 gboolean yes_no_f(GtkWidget *parent,
48 appdata_t *appdata, gulong again_bit, gint flags,
49 char *title, const char *fmt, ...);
50
51 char *find_file(char *name);
52 file_chain_t *file_scan(char *pattern);
53
54 /* dialog size are specified rather fuzzy */
55 #define MISC_DIALOG_NOSIZE -1
56 #define MISC_DIALOG_SMALL 0
57 #define MISC_DIALOG_MEDIUM 1
58 #define MISC_DIALOG_LARGE 2
59 #define MISC_DIALOG_WIDE 3
60 #define MISC_DIALOG_HIGH 4
61
62 GtkWidget *misc_dialog_new(guint hint, const char *title, GtkWindow *parent, ...);
63 GtkWidget *misc_scrolled_window_new(gboolean etched_in);
64 void misc_scrolled_window_add_with_viewport(GtkWidget *win, GtkWidget *child);
65 #endif // MISC_H