Parent Directory
|
Revision Log
Various fremantle ui adoptions
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 | #define MISC_AGAIN_ID_AREA_TOO_BIG (1<<7) |
31 | |
32 | typedef struct file_chain_s { |
33 | char *name; |
34 | struct file_chain_s *next; |
35 | } file_chain_t; |
36 | |
37 | /* these flags prevent you from leaving the dialog with no (or yes) */ |
38 | /* if the "dont show me this dialog again" checkbox is selected. This */ |
39 | /* makes sure, that you can't permanently switch certain things in, but */ |
40 | /* only on. e.g. it doesn't make sense to answer a "do you really want to */ |
41 | /* delete this" dialog with "no and don't ask me again". You'd never be */ |
42 | /* able to delete anything again */ |
43 | #define MISC_AGAIN_FLAG_DONT_SAVE_NO (1<<0) |
44 | #define MISC_AGAIN_FLAG_DONT_SAVE_YES (1<<1) |
45 | |
46 | void errorf(GtkWidget *parent, const char *fmt, ...); |
47 | void warningf(GtkWidget *parent, const char *fmt, ...); |
48 | void messagef(GtkWidget *parent, char *title, const char *fmt, ...); |
49 | gboolean yes_no_f(GtkWidget *parent, |
50 | appdata_t *appdata, gulong again_bit, gint flags, |
51 | char *title, const char *fmt, ...); |
52 | |
53 | char *find_file(char *name); |
54 | file_chain_t *file_scan(char *pattern); |
55 | |
56 | /* dialog size are specified rather fuzzy */ |
57 | #define MISC_DIALOG_NOSIZE -1 |
58 | #define MISC_DIALOG_SMALL 0 |
59 | #define MISC_DIALOG_MEDIUM 1 |
60 | #define MISC_DIALOG_LARGE 2 |
61 | #define MISC_DIALOG_WIDE 3 |
62 | #define MISC_DIALOG_HIGH 4 |
63 | |
64 | GtkWidget *misc_dialog_new(guint hint, const char *title, GtkWindow *parent, ...); |
65 | GtkWidget *misc_scrolled_window_new(gboolean etched_in); |
66 | void misc_scrolled_window_add_with_viewport(GtkWidget *win, GtkWidget *child); |
67 | const char *misc_get_proxy_uri(settings_t *settings); |
68 | void misc_table_attach(GtkWidget *table, GtkWidget *widget, int x, int y); |
69 | |
70 | /* unified widgets */ |
71 | GtkWidget *entry_new(void); |
72 | GType entry_type(void); |
73 | |
74 | GtkWidget *button_new(void); |
75 | GtkWidget *button_new_with_label(char *label); |
76 | |
77 | GtkWidget *check_button_new_with_label(char *label); |
78 | void check_button_set_active(GtkWidget *button, gboolean active); |
79 | gboolean check_button_get_active(GtkWidget *button); |
80 | GType check_button_type(void); |
81 | |
82 | GtkWidget *notebook_new(void); |
83 | void notebook_append_page(GtkWidget *notebook, |
84 | GtkWidget *page, char *label); |
85 | GtkWidget *notebook_get_gtk_notebook(GtkWidget *notebook); |
86 | |
87 | GtkWidget *combo_box_new(char *title); |
88 | GtkWidget *combo_box_entry_new(char *title); |
89 | void combo_box_append_text(GtkWidget *cbox, char *text); |
90 | void combo_box_set_active(GtkWidget *cbox, int index); |
91 | int combo_box_get_active(GtkWidget *cbox); |
92 | const char *combo_box_get_active_text(GtkWidget *cbox); |
93 | GType combo_box_type(void); |
94 | |
95 | void misc_init(void); |
96 | |
97 | #endif // MISC_H |