1 /* LIBGIMP - The GIMP Library 2 * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball 3 * 4 * gimpquerybox.h 5 * Copyright (C) 1999-2000 Michael Natterer <mitch@gimp.org> 6 * 7 * This library is free software: you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * 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 * Lesser General Public License for more details. 16 * 17 * 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 #if !defined (__GIMP_WIDGETS_H_INSIDE__) && !defined (GIMP_WIDGETS_COMPILATION) 23 #error "Only <libgimpwidgets/gimpwidgets.h> can be included directly." 24 #endif 25 26 #ifndef __GIMP_QUERY_BOX_H__ 27 #define __GIMP_QUERY_BOX_H__ 28 29 G_BEGIN_DECLS 30 31 /* For information look into the C source or the html documentation */ 32 33 34 /** 35 * GimpQueryStringCallback: 36 * @query_box: The query box. 37 * @string: The entered string. 38 * @data: The user data. 39 * 40 * Note that you must not g_free() the passed string. 41 **/ 42 typedef void (* GimpQueryStringCallback) (GtkWidget *query_box, 43 const gchar *string, 44 gpointer data); 45 46 /** 47 * GimpQueryIntCallback: 48 * @query_box: The query box. 49 * @value: The entered integer value. 50 * @data: The user data. 51 * 52 * The callback for an int query box. 53 **/ 54 typedef void (* GimpQueryIntCallback) (GtkWidget *query_box, 55 gint value, 56 gpointer data); 57 58 /** 59 * GimpQueryDoubleCallback: 60 * @query_box: The query box. 61 * @value: The entered double value. 62 * @data: The user data. 63 * 64 * The callback for a double query box. 65 **/ 66 typedef void (* GimpQueryDoubleCallback) (GtkWidget *query_box, 67 gdouble value, 68 gpointer data); 69 70 /** 71 * GimpQuerySizeCallback: 72 * @query_box: The query box. 73 * @size: The entered size in pixels. 74 * @unit: The selected unit from the #GimpUnitMenu. 75 * @data: The user data. 76 * 77 * The callback for a size query box. 78 **/ 79 typedef void (* GimpQuerySizeCallback) (GtkWidget *query_box, 80 gdouble size, 81 GimpUnit unit, 82 gpointer data); 83 84 /** 85 * GimpQueryBooleanCallback: 86 * @query_box: The query box. 87 * @value: The entered boolean value. 88 * @data: The user data. 89 * 90 * The callback for a boolean query box. 91 **/ 92 typedef void (* GimpQueryBooleanCallback) (GtkWidget *query_box, 93 gboolean value, 94 gpointer data); 95 96 97 /** 98 * GIMP_QUERY_BOX_VBOX: 99 * @qbox: The query box. 100 * 101 * A macro to access the #GtkVBox in a #libgimpwidgets-gimpquerybox. 102 * Useful if you want to add more widgets. 103 **/ 104 #define GIMP_QUERY_BOX_VBOX(qbox) g_object_get_data (G_OBJECT (qbox), \ 105 "gimp-query-box-vbox") 106 107 108 /* some simple query dialogs */ 109 GtkWidget * gimp_query_string_box (const gchar *title, 110 GtkWidget *parent, 111 GimpHelpFunc help_func, 112 const gchar *help_id, 113 const gchar *message, 114 const gchar *initial, 115 GObject *object, 116 const gchar *signal, 117 GimpQueryStringCallback callback, 118 gpointer data); 119 120 GtkWidget * gimp_query_int_box (const gchar *title, 121 GtkWidget *parent, 122 GimpHelpFunc help_func, 123 const gchar *help_id, 124 const gchar *message, 125 gint initial, 126 gint lower, 127 gint upper, 128 GObject *object, 129 const gchar *signal, 130 GimpQueryIntCallback callback, 131 gpointer data); 132 133 GtkWidget * gimp_query_double_box (const gchar *title, 134 GtkWidget *parent, 135 GimpHelpFunc help_func, 136 const gchar *help_id, 137 const gchar *message, 138 gdouble initial, 139 gdouble lower, 140 gdouble upper, 141 gint digits, 142 GObject *object, 143 const gchar *signal, 144 GimpQueryDoubleCallback callback, 145 gpointer data); 146 147 GtkWidget * gimp_query_size_box (const gchar *title, 148 GtkWidget *parent, 149 GimpHelpFunc help_func, 150 const gchar *help_id, 151 const gchar *message, 152 gdouble initial, 153 gdouble lower, 154 gdouble upper, 155 gint digits, 156 GimpUnit unit, 157 gdouble resolution, 158 gboolean dot_for_dot, 159 GObject *object, 160 const gchar *signal, 161 GimpQuerySizeCallback callback, 162 gpointer data); 163 164 GtkWidget * gimp_query_boolean_box (const gchar *title, 165 GtkWidget *parent, 166 GimpHelpFunc help_func, 167 const gchar *help_id, 168 const gchar *icon_name, 169 const gchar *message, 170 const gchar *true_button, 171 const gchar *false_button, 172 GObject *object, 173 const gchar *signal, 174 GimpQueryBooleanCallback callback, 175 gpointer data); 176 177 178 G_END_DECLS 179 180 #endif /* __GIMP_QUERY_BOX_H__ */ 181