gimpquerybox.h 7.83 KB
Newer Older
1
/* LIBGIMP - The GIMP Library
2
 * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
3
 *
4
 * gimpquerybox.h
5 6
 * Copyright (C) 1999-2000 Michael Natterer <mitch@gimp.org>
 *
7
 * This library is free software: you can redistribute it and/or
8 9
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
10
 * version 3 of the License, or (at your option) any later version.
11
 *
12
 * This library is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 16 17
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with this library.  If not, see
19
 * <https://www.gnu.org/licenses/>.
20
 */
21

22 23 24 25
#if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION)
#error "Only <libgimpwidgets/gimpwidgets.h> can be included directly."
#endif

26 27 28
#ifndef __GIMP_QUERY_BOX_H__
#define __GIMP_QUERY_BOX_H__

29
G_BEGIN_DECLS
30

31
/* For information look into the C source or the html documentation */
32 33


34 35 36 37 38 39 40 41
/**
 * GimpQueryStringCallback:
 * @query_box: The query box.
 * @string:    The entered string.
 * @data:      The user data.
 *
 * Note that you must not g_free() the passed string.
 **/
42
typedef void (* GimpQueryStringCallback)  (GtkWidget   *query_box,
Sven Neumann's avatar
Sven Neumann committed
43 44
                                           const gchar *string,
                                           gpointer     data);
45

46 47 48 49 50 51 52 53
/**
 * GimpQueryIntCallback:
 * @query_box: The query box.
 * @value:     The entered integer value.
 * @data:      The user data.
 *
 * The callback for an int query box.
 **/
54
typedef void (* GimpQueryIntCallback)     (GtkWidget   *query_box,
Sven Neumann's avatar
Sven Neumann committed
55 56
                                           gint         value,
                                           gpointer     data);
57

58 59 60 61 62 63 64 65
/**
 * GimpQueryDoubleCallback:
 * @query_box: The query box.
 * @value:     The entered double value.
 * @data:      The user data.
 *
 * The callback for a double query box.
 **/
66
typedef void (* GimpQueryDoubleCallback)  (GtkWidget   *query_box,
Sven Neumann's avatar
Sven Neumann committed
67 68
                                           gdouble      value,
                                           gpointer     data);
69

70 71 72 73 74 75 76 77 78
/**
 * GimpQuerySizeCallback:
 * @query_box: The query box.
 * @size:      The entered size in pixels.
 * @unit:      The selected unit from the #GimpUnitMenu.
 * @data:      The user data.
 *
 * The callback for a size query box.
 **/
79
typedef void (* GimpQuerySizeCallback)    (GtkWidget   *query_box,
Sven Neumann's avatar
Sven Neumann committed
80 81 82
                                           gdouble      size,
                                           GimpUnit     unit,
                                           gpointer     data);
83

84 85 86 87 88 89 90 91
/**
 * GimpQueryBooleanCallback:
 * @query_box: The query box.
 * @value:     The entered boolean value.
 * @data:      The user data.
 *
 * The callback for a boolean query box.
 **/
92
typedef void (* GimpQueryBooleanCallback) (GtkWidget   *query_box,
Sven Neumann's avatar
Sven Neumann committed
93 94
                                           gboolean     value,
                                           gpointer     data);
95

96

97 98 99 100
/**
 * GIMP_QUERY_BOX_VBOX:
 * @qbox: The query box.
 *
101 102
 * A macro to access the #GtkVBox in a #libgimpwidgets-gimpquerybox.
 * Useful if you want to add more widgets.
103
 **/
104 105 106 107
#define GIMP_QUERY_BOX_VBOX(qbox) g_object_get_data (G_OBJECT (qbox), \
                                                     "gimp-query-box-vbox")


108
/*  some simple query dialogs  */
109
GtkWidget * gimp_query_string_box  (const gchar              *title,
110
                                    GtkWidget                *parent,
Sven Neumann's avatar
Sven Neumann committed
111 112 113 114 115 116 117 118
                                    GimpHelpFunc              help_func,
                                    const gchar              *help_id,
                                    const gchar              *message,
                                    const gchar              *initial,
                                    GObject                  *object,
                                    const gchar              *signal,
                                    GimpQueryStringCallback   callback,
                                    gpointer                  data);
119

120
GtkWidget * gimp_query_int_box     (const gchar              *title,
121
                                    GtkWidget                *parent,
Sven Neumann's avatar
Sven Neumann committed
122 123 124 125 126 127 128 129 130 131
                                    GimpHelpFunc              help_func,
                                    const gchar              *help_id,
                                    const gchar              *message,
                                    gint                      initial,
                                    gint                      lower,
                                    gint                      upper,
                                    GObject                  *object,
                                    const gchar              *signal,
                                    GimpQueryIntCallback      callback,
                                    gpointer                  data);
132

133
GtkWidget * gimp_query_double_box  (const gchar              *title,
134
                                    GtkWidget                *parent,
Sven Neumann's avatar
Sven Neumann committed
135 136 137 138 139 140 141 142 143 144 145
                                    GimpHelpFunc              help_func,
                                    const gchar              *help_id,
                                    const gchar              *message,
                                    gdouble                   initial,
                                    gdouble                   lower,
                                    gdouble                   upper,
                                    gint                      digits,
                                    GObject                  *object,
                                    const gchar              *signal,
                                    GimpQueryDoubleCallback   callback,
                                    gpointer                  data);
146

147
GtkWidget * gimp_query_size_box    (const gchar              *title,
148
                                    GtkWidget                *parent,
Sven Neumann's avatar
Sven Neumann committed
149 150 151 152 153 154 155 156 157 158 159 160 161 162
                                    GimpHelpFunc              help_func,
                                    const gchar              *help_id,
                                    const gchar              *message,
                                    gdouble                   initial,
                                    gdouble                   lower,
                                    gdouble                   upper,
                                    gint                      digits,
                                    GimpUnit                  unit,
                                    gdouble                   resolution,
                                    gboolean                  dot_for_dot,
                                    GObject                  *object,
                                    const gchar              *signal,
                                    GimpQuerySizeCallback     callback,
                                    gpointer                  data);
163

164
GtkWidget * gimp_query_boolean_box (const gchar              *title,
165
                                    GtkWidget                *parent,
Sven Neumann's avatar
Sven Neumann committed
166 167
                                    GimpHelpFunc              help_func,
                                    const gchar              *help_id,
168
                                    const gchar              *icon_name,
Sven Neumann's avatar
Sven Neumann committed
169 170 171 172 173 174 175
                                    const gchar              *message,
                                    const gchar              *true_button,
                                    const gchar              *false_button,
                                    GObject                  *object,
                                    const gchar              *signal,
                                    GimpQueryBooleanCallback  callback,
                                    gpointer                  data);
176

177

178
G_END_DECLS
179

180
#endif /* __GIMP_QUERY_BOX_H__ */