File: gsdlg.h

package info (click to toggle)
geany-plugins 2.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,832 kB
  • sloc: ansic: 107,883; sh: 5,567; makefile: 1,531; sed: 16
file content (85 lines) | stat: -rw-r--r-- 3,132 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * gsdlg.h - Simple GTK dialog wrapper
 *
 * Copyright 2007-2008 Jeff Pohlmeyer <yetanothergeek(at)gmail(dot)com>
 *
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */


/*

Defining GSDLG_ALL_IN_ONE will cause this header to also include the
complete "gsdlg.c" sources. This is done by "gsdlg_lua.c" to keep
the implemention details static.

But since the "gsdlg.c" API might also be useful outside of Lua,
it is also possible to build it as a standalone object file, in
which case the GSDLG_API functions will be available externally.

*/

#ifdef GSDLG_ALL_IN_ONE
#define GSDLG_API static
#else
#define GSDLG_API
#endif

#include <gtk/gtk.h>

typedef const gchar* GsDlgStr;

GSDLG_API void gsdlg_text(     GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
GSDLG_API void gsdlg_password( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
GSDLG_API void gsdlg_textarea( GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
GSDLG_API void gsdlg_file(     GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
GSDLG_API void gsdlg_color(    GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
GSDLG_API void gsdlg_font(     GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);

GSDLG_API void gsdlg_group(    GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
GSDLG_API void gsdlg_radio(    GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
GSDLG_API void gsdlg_select(   GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);
GSDLG_API void gsdlg_option(   GtkDialog *dlg, GsDlgStr key, GsDlgStr value, GsDlgStr label);

GSDLG_API void gsdlg_checkbox( GtkDialog *dlg, GsDlgStr key, gboolean value, GsDlgStr label);

GSDLG_API void gsdlg_label(    GtkDialog *dlg, GsDlgStr text);
GSDLG_API void gsdlg_heading(  GtkDialog *dlg, GsDlgStr text);
GSDLG_API void gsdlg_hr(       GtkDialog *dlg);


GSDLG_API GtkDialog *gsdlg_new(GsDlgStr title, GsDlgStr* btns);
GSDLG_API GHashTable* gsdlg_run(GtkDialog *dlg, gint *btn, gpointer user_data);

GSDLG_API GtkWindow* gsdlg_toplevel;


typedef void (*GsDlgRunHook) (gboolean running, gpointer user_data);

/*
	If assigned, the cb callback will be called twice by gsdlg_run(),
	first with running=TRUE when the dialog is displayed, and
	then with running=FALSE when it is dismissed.
*/
#ifndef DIALOG_LIB
GSDLG_API void gsdlg_set_run_hook(GsDlgRunHook cb);
#endif


#ifdef GSDLG_ALL_IN_ONE
#include "gsdlg.c"
#endif