1 /* LIBGIMP - The GIMP Library
2  * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
3  *
4  * gimpwidgets.h
5  * Copyright (C) 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 #ifndef __GIMP_WIDGETS_H__
23 #define __GIMP_WIDGETS_H__
24 
25 #define __GIMP_WIDGETS_H_INSIDE__
26 
27 #include <libgimpwidgets/gimpwidgetstypes.h>
28 
29 #include <libgimpwidgets/gimpbrowser.h>
30 #include <libgimpwidgets/gimpbusybox.h>
31 #include <libgimpwidgets/gimpbutton.h>
32 #include <libgimpwidgets/gimpcairo-utils.h>
33 #include <libgimpwidgets/gimpcellrenderercolor.h>
34 #include <libgimpwidgets/gimpcellrenderertoggle.h>
35 #include <libgimpwidgets/gimpchainbutton.h>
36 #include <libgimpwidgets/gimpcolorarea.h>
37 #include <libgimpwidgets/gimpcolorbutton.h>
38 #include <libgimpwidgets/gimpcolordisplay.h>
39 #include <libgimpwidgets/gimpcolordisplaystack.h>
40 #include <libgimpwidgets/gimpcolorhexentry.h>
41 #include <libgimpwidgets/gimpcolornotebook.h>
42 #include <libgimpwidgets/gimpcolorprofilechooserdialog.h>
43 #include <libgimpwidgets/gimpcolorprofilecombobox.h>
44 #include <libgimpwidgets/gimpcolorprofilestore.h>
45 #include <libgimpwidgets/gimpcolorprofileview.h>
46 #include <libgimpwidgets/gimpcolorscale.h>
47 #include <libgimpwidgets/gimpcolorscales.h>
48 #include <libgimpwidgets/gimpcolorselector.h>
49 #include <libgimpwidgets/gimpcolorselect.h>
50 #include <libgimpwidgets/gimpcolorselection.h>
51 #include <libgimpwidgets/gimpdialog.h>
52 #include <libgimpwidgets/gimpenumcombobox.h>
53 #include <libgimpwidgets/gimpenumlabel.h>
54 #include <libgimpwidgets/gimpenumstore.h>
55 #include <libgimpwidgets/gimpenumwidgets.h>
56 #include <libgimpwidgets/gimpfileentry.h>
57 #include <libgimpwidgets/gimpframe.h>
58 #include <libgimpwidgets/gimphelpui.h>
59 #include <libgimpwidgets/gimphintbox.h>
60 #include <libgimpwidgets/gimpicons.h>
61 #include <libgimpwidgets/gimpintcombobox.h>
62 #include <libgimpwidgets/gimpintstore.h>
63 #include <libgimpwidgets/gimpmemsizeentry.h>
64 #include <libgimpwidgets/gimpnumberpairentry.h>
65 #include <libgimpwidgets/gimpoffsetarea.h>
66 #include <libgimpwidgets/gimppageselector.h>
67 #include <libgimpwidgets/gimppatheditor.h>
68 #include <libgimpwidgets/gimppickbutton.h>
69 #include <libgimpwidgets/gimppixmap.h>
70 #include <libgimpwidgets/gimppreview.h>
71 #include <libgimpwidgets/gimppreviewarea.h>
72 #include <libgimpwidgets/gimppropwidgets.h>
73 #include <libgimpwidgets/gimpquerybox.h>
74 #include <libgimpwidgets/gimpruler.h>
75 #include <libgimpwidgets/gimpscaleentry.h>
76 #include <libgimpwidgets/gimpscrolledpreview.h>
77 #include <libgimpwidgets/gimpsizeentry.h>
78 #include <libgimpwidgets/gimpspinbutton.h>
79 #include <libgimpwidgets/gimpstringcombobox.h>
80 #include <libgimpwidgets/gimpunitcombobox.h>
81 #include <libgimpwidgets/gimpunitmenu.h>
82 #include <libgimpwidgets/gimpunitstore.h>
83 #include <libgimpwidgets/gimpwidgets-error.h>
84 #include <libgimpwidgets/gimpwidgetsutils.h>
85 #include <libgimpwidgets/gimpzoommodel.h>
86 
87 #include <libgimpwidgets/gimp3migration.h>
88 #include <libgimpwidgets/gimpoldwidgets.h>
89 
90 #undef __GIMP_WIDGETS_H_INSIDE__
91 
92 G_BEGIN_DECLS
93 
94 /* For information look into the C source or the html documentation */
95 
96 
97 /*
98  *  Widget Constructors
99  */
100 
101 GtkWidget * gimp_int_radio_group_new (gboolean          in_frame,
102                                       const gchar      *frame_title,
103                                       GCallback         radio_button_callback,
104                                       gpointer          radio_button_callback_data,
105                                       gint              initial, /* item_data */
106 
107                                       /* specify radio buttons as va_list:
108                                        *  const gchar  *label,
109                                        *  gint          item_data,
110                                        *  GtkWidget   **widget_ptr,
111                                        */
112 
113                                       ...) G_GNUC_NULL_TERMINATED;
114 
115 void        gimp_int_radio_group_set_active (GtkRadioButton *radio_button,
116                                              gint            item_data);
117 
118 
119 GtkWidget * gimp_radio_group_new   (gboolean            in_frame,
120                                     const gchar        *frame_title,
121 
122                                     /* specify radio buttons as va_list:
123                                      *  const gchar    *label,
124                                      *  GCallback       callback,
125                                      *  gpointer        callback_data,
126                                      *  gpointer        item_data,
127                                      *  GtkWidget     **widget_ptr,
128                                      *  gboolean        active,
129                                      */
130 
131                                     ...) G_GNUC_NULL_TERMINATED;
132 GtkWidget * gimp_radio_group_new2  (gboolean            in_frame,
133                                     const gchar        *frame_title,
134                                     GCallback           radio_button_callback,
135                                     gpointer            radio_button_callback_data,
136                                     gpointer            initial, /* item_data */
137 
138                                     /* specify radio buttons as va_list:
139                                      *  const gchar    *label,
140                                      *  gpointer        item_data,
141                                      *  GtkWidget     **widget_ptr,
142                                      */
143 
144                                     ...) G_GNUC_NULL_TERMINATED;
145 
146 void   gimp_radio_group_set_active (GtkRadioButton     *radio_button,
147                                     gpointer            item_data);
148 
149 
150 GIMP_DEPRECATED_FOR(gtk_spin_button_new)
151 GtkWidget * gimp_spin_button_new   (/* return value: */
152                                     GtkObject         **adjustment,
153 
154                                     gdouble             value,
155                                     gdouble             lower,
156                                     gdouble             upper,
157                                     gdouble             step_increment,
158                                     gdouble             page_increment,
159                                     gdouble             page_size,
160                                     gdouble             climb_rate,
161                                     guint               digits);
162 
163 /**
164  * GIMP_RANDOM_SEED_SPINBUTTON:
165  * @hbox: The #GtkHBox returned by gimp_random_seed_new().
166  *
167  * Returns: the random_seed's #GtkSpinButton.
168  **/
169 #define GIMP_RANDOM_SEED_SPINBUTTON(hbox) \
170         (g_object_get_data (G_OBJECT (hbox), "spinbutton"))
171 
172 /**
173  * GIMP_RANDOM_SEED_SPINBUTTON_ADJ:
174  * @hbox: The #GtkHBox returned by gimp_random_seed_new().
175  *
176  * Returns: the #GtkAdjustment of the random_seed's #GtkSpinButton.
177  **/
178 #define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox)       \
179         gtk_spin_button_get_adjustment \
180         (GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (hbox), "spinbutton")))
181 
182 /**
183  * GIMP_RANDOM_SEED_TOGGLE:
184  * @hbox: The #GtkHBox returned by gimp_random_seed_new().
185  *
186  * Returns: the random_seed's #GtkToggleButton.
187  **/
188 #define GIMP_RANDOM_SEED_TOGGLE(hbox) \
189         (g_object_get_data (G_OBJECT(hbox), "toggle"))
190 
191 GtkWidget * gimp_random_seed_new   (guint32            *seed,
192                                     gboolean           *random_seed);
193 
194 /**
195  * GIMP_COORDINATES_CHAINBUTTON:
196  * @sizeentry: The #GimpSizeEntry returned by gimp_coordinates_new().
197  *
198  * Returns: the #GimpChainButton which is attached to the
199  *          #GimpSizeEntry.
200  **/
201 #define GIMP_COORDINATES_CHAINBUTTON(sizeentry) \
202         (g_object_get_data (G_OBJECT (sizeentry), "chainbutton"))
203 
204 GtkWidget * gimp_coordinates_new   (GimpUnit            unit,
205                                     const gchar        *unit_format,
206                                     gboolean            menu_show_pixels,
207                                     gboolean            menu_show_percent,
208                                     gint                spinbutton_width,
209                                     GimpSizeEntryUpdatePolicy  update_policy,
210 
211                                     gboolean            chainbutton_active,
212                                     gboolean            chain_constrains_ratio,
213 
214                                     const gchar        *xlabel,
215                                     gdouble             x,
216                                     gdouble             xres,
217                                     gdouble             lower_boundary_x,
218                                     gdouble             upper_boundary_x,
219                                     gdouble             xsize_0,   /* % */
220                                     gdouble             xsize_100, /* % */
221 
222                                     const gchar        *ylabel,
223                                     gdouble             y,
224                                     gdouble             yres,
225                                     gdouble             lower_boundary_y,
226                                     gdouble             upper_boundary_y,
227                                     gdouble             ysize_0,   /* % */
228                                     gdouble             ysize_100  /* % */);
229 
230 
231 /*
232  *  Standard Callbacks
233  */
234 
235 void gimp_toggle_button_update           (GtkWidget       *widget,
236                                           gpointer         data);
237 
238 void gimp_radio_button_update            (GtkWidget       *widget,
239                                           gpointer         data);
240 
241 void gimp_int_adjustment_update          (GtkAdjustment   *adjustment,
242                                           gpointer         data);
243 
244 void gimp_uint_adjustment_update         (GtkAdjustment   *adjustment,
245                                           gpointer         data);
246 
247 void gimp_float_adjustment_update        (GtkAdjustment   *adjustment,
248                                           gpointer         data);
249 
250 void gimp_double_adjustment_update       (GtkAdjustment   *adjustment,
251                                           gpointer         data);
252 
253 
254 G_END_DECLS
255 
256 #endif /* __GIMP_WIDGETS_H__ */
257