Contents of /trunk/src/misc.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 315 - (hide annotations)
Wed Dec 16 20:07:58 2009 UTC (14 years, 5 months ago) by harbaum
File MIME type: text/plain
File size: 3173 byte(s)
Various fremantleization
1 harbaum 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 harbaum 156 #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 harbaum 249 #define MISC_AGAIN_ID_AREA_TOO_BIG (1<<7)
31 harbaum 1
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 harbaum 209 void warningf(GtkWidget *parent, const char *fmt, ...);
48 harbaum 1 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 harbaum 167 /* 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 harbaum 195 GtkWidget *misc_scrolled_window_new(gboolean etched_in);
66     void misc_scrolled_window_add_with_viewport(GtkWidget *win, GtkWidget *child);
67 harbaum 200 const char *misc_get_proxy_uri(settings_t *settings);
68 harbaum 203 void misc_table_attach(GtkWidget *table, GtkWidget *widget, int x, int y);
69 harbaum 315
70     /* unified widgets */
71     GtkWidget *entry_new(void);
72    
73     GtkWidget *button_new(void);
74     GtkWidget *button_new_with_label(char *label);
75    
76     GtkWidget *check_button_new_with_label(char *label);
77     void check_button_set_active(GtkWidget *button, gboolean active);
78     gboolean check_button_get_active(GtkWidget *button);
79    
80     GtkWidget *notebook_new(void);
81     void notebook_append_page(GtkWidget *notebook,
82     GtkWidget *page, char *label);
83     GtkWidget *notebook_get_gtk_notebook(GtkWidget *notebook);
84    
85 harbaum 1 #endif // MISC_H