gimpwidgets.h 10.7 KB
Newer Older
1
2
/* LIBGIMP - The GIMP Library
 * Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
3
4
5
6
7
8
9
 *
 * gimpwidgets.h
 * Copyright (C) 2000 Michael Natterer <mitch@gimp.org>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
10
11
12
13
14
 * version 2 of the License, or (at your option) any later version.
 *
 * This library 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
15
16
17
18
19
20
21
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */
22

23
24
25
#ifndef __GIMP_WIDGETS_H__
#define __GIMP_WIDGETS_H__

26
27
28

#include <libgimpwidgets/gimpwidgetstypes.h>

29
#include <libgimpwidgets/gimpbrowser.h>
30
#include <libgimpwidgets/gimpbutton.h>
31
#include <libgimpwidgets/gimpcellrenderercolor.h>
32
#include <libgimpwidgets/gimpcellrenderertoggle.h>
33
34
35
#include <libgimpwidgets/gimpchainbutton.h>
#include <libgimpwidgets/gimpcolorarea.h>
#include <libgimpwidgets/gimpcolorbutton.h>
36
#include <libgimpwidgets/gimpcolordisplay.h>
37
#include <libgimpwidgets/gimpcolordisplaystack.h>
38
#include <libgimpwidgets/gimpcolorhexentry.h>
39
#include <libgimpwidgets/gimpcolornotebook.h>
40
#include <libgimpwidgets/gimpcolorscale.h>
41
#include <libgimpwidgets/gimpcolorscales.h>
42
43
#include <libgimpwidgets/gimpcolorselector.h>
#include <libgimpwidgets/gimpcolorselect.h>
44
#include <libgimpwidgets/gimpcolorselection.h>
45
#include <libgimpwidgets/gimpdialog.h>
46
47
#include <libgimpwidgets/gimpenumcombobox.h>
#include <libgimpwidgets/gimpenumstore.h>
48
#include <libgimpwidgets/gimpenumwidgets.h>
Michael Natterer's avatar
Michael Natterer committed
49
#include <libgimpwidgets/gimpfileentry.h>
50
#include <libgimpwidgets/gimpframe.h>
51
#include <libgimpwidgets/gimphelpui.h>
52
#include <libgimpwidgets/gimpintcombobox.h>
53
#include <libgimpwidgets/gimpintstore.h>
54
#include <libgimpwidgets/gimpmemsizeentry.h>
55
#include <libgimpwidgets/gimpoffsetarea.h>
56
#include <libgimpwidgets/gimppatheditor.h>
57
#include <libgimpwidgets/gimppickbutton.h>
58
#include <libgimpwidgets/gimppixmap.h>
59
#include <libgimpwidgets/gimppreview.h>
60
#include <libgimpwidgets/gimppreviewarea.h>
61
#include <libgimpwidgets/gimppropwidgets.h>
62
63
#include <libgimpwidgets/gimpquerybox.h>
#include <libgimpwidgets/gimpsizeentry.h>
64
#include <libgimpwidgets/gimpstock.h>
65
66
#include <libgimpwidgets/gimpunitmenu.h>

67
68
#include <libgimpwidgets/gimpoldwidgets.h>

69

70
G_BEGIN_DECLS
71

72
73
/* For information look into the C source or the html documentation */

74

75
76
77
78
/*
 *  Widget Constructors
 */

79
80
81
82
83
GtkWidget * gimp_int_radio_group_new (gboolean          in_frame,
				      const gchar      *frame_title,
				      GCallback         radio_button_callback,
				      gpointer          radio_button_callback_data,
				      gint              initial, /* item_data */
84

85
86
87
88
				      /* specify radio buttons as va_list:
				       *  const gchar  *label,
				       *  gint          item_data,
				       *  GtkWidget   **widget_ptr,
89
90
91
92
				       */

				      ...);

93
94
95
void        gimp_int_radio_group_set_active (GtkRadioButton *radio_button,
                                             gint            item_data);

96

97
GtkWidget * gimp_radio_group_new   (gboolean            in_frame,
98
				    const gchar        *frame_title,
99
100

				    /* specify radio buttons as va_list:
101
				     *  const gchar    *label,
102
				     *  GCallback       callback,
103
104
				     *  gpointer        callback_data,
				     *  gpointer        item_data,
105
106
107
108
109
110
				     *  GtkWidget     **widget_ptr,
				     *  gboolean        active,
				     */

				    ...);
GtkWidget * gimp_radio_group_new2  (gboolean            in_frame,
111
				    const gchar        *frame_title,
112
				    GCallback           radio_button_callback,
113
114
				    gpointer            radio_button_callback_data,
				    gpointer            initial, /* item_data */
115
116

				    /* specify radio buttons as va_list:
117
				     *  const gchar    *label,
118
				     *  gpointer        item_data,
119
120
121
122
				     *  GtkWidget     **widget_ptr,
				     */

				    ...);
123

124
125
void   gimp_radio_group_set_active (GtkRadioButton     *radio_button,
                                    gpointer            item_data);
126

127

128
129
130
GtkWidget * gimp_spin_button_new   (/* return value: */
				    GtkObject         **adjustment,

131
132
133
134
135
136
137
				    gdouble             value,
				    gdouble             lower,
				    gdouble             upper,
				    gdouble             step_increment,
				    gdouble             page_increment,
				    gdouble             page_size,
				    gdouble             climb_rate,
138
139
				    guint               digits);

140
#define GIMP_SCALE_ENTRY_LABEL(adj) \
141
        (g_object_get_data (G_OBJECT (adj), "label"))
142
143

#define GIMP_SCALE_ENTRY_SCALE(adj) \
144
        (g_object_get_data (G_OBJECT (adj), "scale"))
145
146
#define GIMP_SCALE_ENTRY_SCALE_ADJ(adj) \
        gtk_range_get_adjustment \
147
        (GTK_RANGE (g_object_get_data (G_OBJECT (adj), "scale")))
148
149

#define GIMP_SCALE_ENTRY_SPINBUTTON(adj) \
150
        (g_object_get_data (G_OBJECT (adj), "spinbutton"))
151
152
#define GIMP_SCALE_ENTRY_SPINBUTTON_ADJ(adj) \
        gtk_spin_button_get_adjustment \
153
        (GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (adj), "spinbutton")))
154

155
156
157
158
159
160
GtkObject * gimp_scale_entry_new       (GtkTable           *table,
                                        gint                column,
                                        gint                row,
                                        const gchar        *text,
                                        gint                scale_width,
                                        gint                spinbutton_width,
161
162
163
164
165
                                        gdouble             value,
                                        gdouble             lower,
                                        gdouble             upper,
                                        gdouble             step_increment,
                                        gdouble             page_increment,
166
167
                                        guint               digits,
                                        gboolean            constrain,
168
169
                                        gdouble             unconstrained_lower,
                                        gdouble             unconstrained_upper,
170
                                        const gchar        *tooltip,
171
                                        const gchar        *help_id);
172

173

174
175
176
177
178
179
GtkObject * gimp_color_scale_entry_new (GtkTable           *table,
                                        gint                column,
                                        gint                row,
                                        const gchar        *text,
                                        gint                scale_width,
                                        gint                spinbutton_width,
180
181
182
183
184
                                        gdouble             value,
                                        gdouble             lower,
                                        gdouble             upper,
                                        gdouble             step_increment,
                                        gdouble             page_increment,
185
186
                                        guint               digits,
                                        const gchar        *tooltip,
187
                                        const gchar        *help_id);
188

189
190
191
192
193
194
void     gimp_scale_entry_set_sensitive   (GtkObject       *adjustment,
                                           gboolean         sensitive);

void     gimp_scale_entry_set_logarithmic (GtkObject       *adjustment,
                                           gboolean         logarithmic);
gboolean gimp_scale_entry_get_logarithmic (GtkObject       *adjustment);
195
196


197
#define GIMP_RANDOM_SEED_SPINBUTTON(hbox) \
198
        (g_object_get_data (G_OBJECT (hbox), "spinbutton"))
199
200
#define GIMP_RANDOM_SEED_SPINBUTTON_ADJ(hbox) \
        gtk_spin_button_get_adjustment \
201
        (GTK_SPIN_BUTTON (g_object_get_data (G_OBJECT (hbox), "spinbutton")))
202
203
#define GIMP_RANDOM_SEED_TOGGLE(hbox) \
        (g_object_get_data (G_OBJECT(hbox), "toggle"))
204

205
GtkWidget * gimp_random_seed_new   (guint32            *seed,
206
				    gboolean           *random_seed);
207

208
#define GIMP_COORDINATES_CHAINBUTTON(sizeentry) \
209
        (g_object_get_data (G_OBJECT (sizeentry), "chainbutton"))
210

211
GtkWidget * gimp_coordinates_new   (GimpUnit            unit,
212
				    const gchar        *unit_format,
213
214
				    gboolean            menu_show_pixels,
				    gboolean            menu_show_percent,
215
				    gint                spinbutton_width,
216
				    GimpSizeEntryUpdatePolicy  update_policy,
217

218
219
220
				    gboolean            chainbutton_active,
				    gboolean            chain_constrains_ratio,

221
				    const gchar        *xlabel,
222
223
				    gdouble             x,
				    gdouble             xres,
224
225
226
227
				    gdouble             lower_boundary_x,
				    gdouble             upper_boundary_x,
				    gdouble             xsize_0,   /* % */
				    gdouble             xsize_100, /* % */
228

229
				    const gchar        *ylabel,
230
231
				    gdouble             y,
				    gdouble             yres,
232
233
234
235
				    gdouble             lower_boundary_y,
				    gdouble             upper_boundary_y,
				    gdouble             ysize_0,   /* % */
				    gdouble             ysize_100  /* % */);
236

Sven Neumann's avatar
Sven Neumann committed
237

238
239
#ifndef GIMP_DISABLE_DEPRECATED

Sven Neumann's avatar
Sven Neumann committed
240
GtkWidget * gimp_pixmap_button_new  (gchar             **xpm_data,
241
				     const gchar        *text);
242

243
244
245
#endif


246
247
248
249
/*
 *  Standard Callbacks
 */

250
251
252
253
void gimp_toggle_button_sensitive_update (GtkToggleButton *toggle_button);

void gimp_toggle_button_update           (GtkWidget       *widget,
					  gpointer         data);
254

255
256
void gimp_radio_button_update            (GtkWidget       *widget,
					  gpointer         data);
257

258
259
void gimp_int_adjustment_update          (GtkAdjustment   *adjustment,
					  gpointer         data);
260

261
262
263
void gimp_uint_adjustment_update         (GtkAdjustment   *adjustment,
					  gpointer         data);

264
265
void gimp_float_adjustment_update        (GtkAdjustment   *adjustment,
					  gpointer         data);
266

267
268
void gimp_double_adjustment_update       (GtkAdjustment   *adjustment,
					  gpointer         data);
269

270
271
void gimp_unit_menu_update               (GtkWidget       *widget,
					  gpointer         data);
Michael Natterer's avatar
Michael Natterer committed
272

273

274
275
276
277
/*
 *  Helper Functions
 */

278
279
280
281
282
283
284
285
286
GtkWidget * gimp_table_attach_aligned    (GtkTable        *table,
					  gint             column,
					  gint             row,
					  const gchar     *label_text,
					  gfloat           xalign,
					  gfloat           yalign,
					  GtkWidget       *widget,
					  gint             colspan,
					  gboolean         left_align);
287

288

289
290
291
292
void        gimp_label_set_attributes    (GtkLabel        *label,
                                          ...);


293
G_END_DECLS
294
295

#endif /* __GIMP_WIDGETS_H__ */