2
* gsdlg.h - Simple GTK dialog wrapper
4
* Copyright 2007-2008 Jeff Pohlmeyer <yetanothergeek(at)gmail(dot)com>
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License along
19
* with this program; if not, write to the Free Software Foundation, Inc.,
20
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
Defining GSDLG_ALL_IN_ONE will cause this header to also include the
27
complete "gsdlg.c" sources. This is done by "gsdlg_lua.c" to keep
28
the implemention details static.
30
But since the "gsdlg.c" API might also be useful outside of Lua,
31
it is also possible to build it as a standalone object file, in
32
which case the GSDLG_API functions will be available externally.
36
#ifdef GSDLG_ALL_IN_ONE
37
#define GSDLG_API static
44
typedef const gchar* GsDlgStr;
46
GSDLG_API void gsdlg_text( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
47
GSDLG_API void gsdlg_password( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
48
GSDLG_API void gsdlg_textarea( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
49
GSDLG_API void gsdlg_file( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
50
GSDLG_API void gsdlg_color( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
51
GSDLG_API void gsdlg_font( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
53
GSDLG_API void gsdlg_group( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
54
GSDLG_API void gsdlg_radio( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
55
GSDLG_API void gsdlg_select( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
56
GSDLG_API void gsdlg_option( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
58
GSDLG_API void gsdlg_checkbox( GtkDialog *dlg, GsDlgStr key, gboolean value, GsDlgStr label);
60
GSDLG_API void gsdlg_label( GtkDialog *dlg, GsDlgStr text);
61
GSDLG_API void gsdlg_heading( GtkDialog *dlg, GsDlgStr text);
62
GSDLG_API void gsdlg_hr( GtkDialog *dlg);
65
GSDLG_API GtkDialog *gsdlg_new(GsDlgStr title, GsDlgStr* btns);
66
GSDLG_API GHashTable* gsdlg_run(GtkDialog *dlg, gint *btn, gpointer user_data);
68
GSDLG_API GtkWindow* gsdlg_toplevel;
71
typedef void (*GsDlgRunHook) (gboolean running, gpointer user_data);
74
If assigned, the cb callback will be called twice by gsdlg_run(),
75
first with running=TRUE when the dialog is displayed, and
76
then with running=FALSE when it is dismissed.
79
GSDLG_API void gsdlg_set_run_hook(GsDlgRunHook cb);
83
#ifdef GSDLG_ALL_IN_ONE