1 /*
2  * Tilem II
3  * Copyright (c) 2011 Benjamin Moody
4  *
5  * This program is free software: you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation, either version 3 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 /* Message box macros */
20 
21 #define messagebox00(prnt, mtyp, tprm, tsec) \
22   do {									\
23     GtkWidget* mbx;							\
24     mbx = gtk_message_dialog_new(GTK_WINDOW(prnt), GTK_DIALOG_MODAL,	\
25 				 mtyp, GTK_BUTTONS_OK, tprm);		\
26     gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(mbx),	\
27 					       tsec);			\
28     gtk_dialog_set_default_response(GTK_DIALOG(mbx), GTK_RESPONSE_OK);	\
29     gtk_dialog_run(GTK_DIALOG(mbx));					\
30     gtk_widget_destroy(mbx);						\
31   } while(0)
32 
33 #define messagebox01(prnt, mtyp, tprm, tsec, aaaa) \
34   do {									\
35     GtkWidget* mbx;							\
36     mbx = gtk_message_dialog_new(GTK_WINDOW(prnt), GTK_DIALOG_MODAL,	\
37 				 mtyp, GTK_BUTTONS_OK, tprm);		\
38     gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(mbx),	\
39 					       tsec, (aaaa));		\
40     gtk_dialog_set_default_response(GTK_DIALOG(mbx), GTK_RESPONSE_OK);	\
41     gtk_dialog_run(GTK_DIALOG(mbx));					\
42     gtk_widget_destroy(mbx);						\
43   } while(0)
44 
45 #define messagebox02(prnt, mtyp, tprm, tsec, aaaa, bbbb) \
46   do {									\
47     GtkWidget* mbx;							\
48     mbx = gtk_message_dialog_new(GTK_WINDOW(prnt), GTK_DIALOG_MODAL,	\
49 				 mtyp, GTK_BUTTONS_OK, tprm);		\
50     gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(mbx),	\
51 					       tsec, (aaaa), (bbbb));	\
52     gtk_dialog_set_default_response(GTK_DIALOG(mbx), GTK_RESPONSE_OK);	\
53     gtk_dialog_run(GTK_DIALOG(mbx));					\
54     gtk_widget_destroy(mbx);						\
55   } while(0)
56 
57 #define messagebox11(prnt, mtyp, tprm, aaaa, tsec, bbbb) \
58   do {									\
59     GtkWidget* mbx;							\
60     mbx = gtk_message_dialog_new(GTK_WINDOW(prnt), GTK_DIALOG_MODAL,	\
61 				 mtyp, GTK_BUTTONS_OK, tprm, (aaaa));	\
62     gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(mbx),	\
63 					       tsec, (bbbb));		\
64     gtk_dialog_set_default_response(GTK_DIALOG(mbx), GTK_RESPONSE_OK);	\
65     gtk_dialog_run(GTK_DIALOG(mbx));					\
66     gtk_widget_destroy(mbx);						\
67   } while(0)
68