~inkscape.dev/inkscape-devlibs/devlibs-gtk3

« back to all changes in this revision

Viewing changes to include/gtkmm-2.4/gtkmm/colorselection.h

  • Committer: JazzyNico
  • Date: 2013-01-21 10:11:05 UTC
  • Revision ID: nicoduf@yahoo.fr-20130121101105-i8d8slkq9ng4olx8
Adding gtk2 libraries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- c++ -*-
 
2
// Generated by gtkmmproc -- DO NOT MODIFY!
 
3
#ifndef _GTKMM_COLORSELECTION_H
 
4
#define _GTKMM_COLORSELECTION_H
 
5
 
 
6
 
 
7
#include <glibmm.h>
 
8
 
 
9
/* $Id: colorselection.hg,v 1.2 2004/02/10 14:50:11 murrayc Exp $ */
 
10
 
 
11
/* Copyright (C) 1998-2002 The gtkmm Development Team
 
12
 *
 
13
 * This library is free software; you can redistribute it and/or
 
14
 * modify it under the terms of the GNU Lesser General Public
 
15
 * License as published by the Free Software Foundation; either
 
16
 * version 2.1 of the License, or (at your option) any later version.
 
17
 *
 
18
 * This library is distributed in the hope that it will be useful,
 
19
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
20
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
21
 * Lesser General Public License for more details.
 
22
 *
 
23
 * You should have received a copy of the GNU Lesser General Public
 
24
 * License along with this library; if not, write to the Free
 
25
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
26
 */
 
27
 
 
28
 
 
29
#include <gtkmm/box.h>
 
30
#include <gtkmm/dialog.h>
 
31
#include <gtkmm/button.h>
 
32
 
 
33
 
 
34
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
35
typedef struct _GtkColorSelection GtkColorSelection;
 
36
typedef struct _GtkColorSelectionClass GtkColorSelectionClass;
 
37
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
38
 
 
39
 
 
40
namespace Gtk
 
41
{ class ColorSelection_Class; } // namespace Gtk
 
42
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
43
typedef struct _GtkColorSelectionDialog GtkColorSelectionDialog;
 
44
typedef struct _GtkColorSelectionDialogClass GtkColorSelectionDialogClass;
 
45
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
46
 
 
47
 
 
48
namespace Gtk
 
49
{ class ColorSelectionDialog_Class; } // namespace Gtk
 
50
namespace Gtk
 
51
{
 
52
 
 
53
/** A widget used to select a color.
 
54
 *
 
55
 * This widget is used to select a color. It
 
56
 * consists of a color wheel and number of sliders and entry boxes for color
 
57
 * parameters such as hue, saturation, value, red, green, blue, and opacity.
 
58
 *
 
59
 * It is found on the standard color selection dialog box
 
60
 * Gtk::ColorSelectionDialog.
 
61
 *
 
62
 * @ingroup Widgets
 
63
 */
 
64
 
 
65
class ColorSelection : public VBox
 
66
{
 
67
  public:
 
68
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
69
  typedef ColorSelection CppObjectType;
 
70
  typedef ColorSelection_Class CppClassType;
 
71
  typedef GtkColorSelection BaseObjectType;
 
72
  typedef GtkColorSelectionClass BaseClassType;
 
73
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
74
 
 
75
  virtual ~ColorSelection();
 
76
 
 
77
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
78
 
 
79
private:
 
80
  friend class ColorSelection_Class;
 
81
  static CppClassType colorselection_class_;
 
82
 
 
83
  // noncopyable
 
84
  ColorSelection(const ColorSelection&);
 
85
  ColorSelection& operator=(const ColorSelection&);
 
86
 
 
87
protected:
 
88
  explicit ColorSelection(const Glib::ConstructParams& construct_params);
 
89
  explicit ColorSelection(GtkColorSelection* castitem);
 
90
 
 
91
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
92
 
 
93
public:
 
94
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
95
  static GType get_type()      G_GNUC_CONST;
 
96
 
 
97
 
 
98
  static GType get_base_type() G_GNUC_CONST;
 
99
#endif
 
100
 
 
101
  ///Provides access to the underlying C GtkObject.
 
102
  GtkColorSelection*       gobj()       { return reinterpret_cast<GtkColorSelection*>(gobject_); }
 
103
 
 
104
  ///Provides access to the underlying C GtkObject.
 
105
  const GtkColorSelection* gobj() const { return reinterpret_cast<GtkColorSelection*>(gobject_); }
 
106
 
 
107
 
 
108
public:
 
109
  //C++ methods used to invoke GTK+ virtual functions:
 
110
 
 
111
protected:
 
112
  //GTK+ Virtual Functions (override these to change behaviour):
 
113
 
 
114
  //Default Signal Handlers::
 
115
  virtual void on_color_changed();
 
116
 
 
117
 
 
118
private:
 
119
 
 
120
  
 
121
public:
 
122
  ColorSelection();
 
123
 
 
124
  
 
125
  /** Determines whether the colorsel has an opacity control.
 
126
   * @return <tt>true</tt> if the @a colorsel has an opacity control.  <tt>false</tt> if it does't.
 
127
   */
 
128
  bool get_has_opacity_control() const;
 
129
  
 
130
  /** Sets the @a colorsel to use or not use opacity.
 
131
   * @param has_opacity <tt>true</tt> if @a colorsel can set the opacity, <tt>false</tt> otherwise.
 
132
   */
 
133
  void set_has_opacity_control(bool has_opacity =  true);
 
134
  
 
135
  /** Determines whether the color selector has a color palette.
 
136
   * @return <tt>true</tt> if the selector has a palette.  <tt>false</tt> if it hasn't.
 
137
   */
 
138
  bool get_has_palette() const;
 
139
  
 
140
  /** Shows and hides the palette based upon the value of @a has_palette.
 
141
   * @param has_palette <tt>true</tt> if palette is to be visible, <tt>false</tt> otherwise.
 
142
   */
 
143
  void set_has_palette(bool has_palette =  true);
 
144
  
 
145
  /** Sets the current color to be @a color.  The first time this is called, it will
 
146
   * also set the original color to be @a color too.
 
147
   * @param color A Gdk::Color to set the current color with.
 
148
   */
 
149
  void set_current_color(const Gdk::Color& color);
 
150
  
 
151
  /** Sets the current opacity to be @a alpha.  The first time this is called, it will
 
152
   * also set the original opacity to be @a alpha too.
 
153
   * @param alpha An integer between 0 and 65535.
 
154
   */
 
155
  void set_current_alpha(guint16 alpha);
 
156
  Gdk::Color get_current_color() const;
 
157
  
 
158
  /** Returns the current alpha value.
 
159
   * @return An integer between 0 and 65535.
 
160
   */
 
161
  guint16 get_current_alpha() const;
 
162
  
 
163
  /** Sets the 'previous' color to be @a color.  This function should be called with
 
164
   * some hesitations, as it might seem confusing to have that color change.
 
165
   * Calling set_current_color() will also set this color the first
 
166
   * time it is called.
 
167
   * @param color A Gdk::Color to set the previous color with.
 
168
   */
 
169
  void set_previous_color(const Gdk::Color& color);
 
170
  
 
171
  /** Sets the 'previous' alpha to be @a alpha.  This function should be called with
 
172
   * some hesitations, as it might seem confusing to have that alpha change.
 
173
   * @param alpha An integer between 0 and 65535.
 
174
   */
 
175
  void set_previous_alpha(guint16 alpha);
 
176
  Gdk::Color get_previous_color() const;
 
177
  
 
178
  /** Returns the previous alpha value.
 
179
   * @return An integer between 0 and 65535.
 
180
   */
 
181
  guint16 get_previous_alpha() const;
 
182
 
 
183
  
 
184
  /** Gets the current state of the @a colorsel.
 
185
   * @return <tt>true</tt> if the user is currently dragging a color around, and <tt>false</tt>
 
186
   * if the selection has stopped.
 
187
   */
 
188
  bool is_adjusting() const;
 
189
 
 
190
  static Gdk::ArrayHandle_Color palette_from_string(const Glib::ustring& str);
 
191
  static Glib::ustring palette_to_string(const Gdk::ArrayHandle_Color& colors);
 
192
 
 
193
  typedef sigc::slot<void, const Glib::RefPtr<Gdk::Screen>&,
 
194
                            const Gdk::ArrayHandle_Color&> SlotChangePaletteHook;
 
195
 
 
196
  static SlotChangePaletteHook set_change_palette_hook(const SlotChangePaletteHook& slot);
 
197
 
 
198
  
 
199
  /**
 
200
   * @par Prototype:
 
201
   * <tt>void on_my_%color_changed()</tt>
 
202
   */
 
203
 
 
204
  Glib::SignalProxy0< void > signal_color_changed();
 
205
 
 
206
 
 
207
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
208
/** Whether a palette should be used.
 
209
   *
 
210
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
211
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
212
   * the value of the property changes.
 
213
   */
 
214
  Glib::PropertyProxy<bool> property_has_palette() ;
 
215
#endif //#GLIBMM_PROPERTIES_ENABLED
 
216
 
 
217
#ifdef GLIBMM_PROPERTIES_ENABLED
 
218
/** Whether a palette should be used.
 
219
   *
 
220
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
221
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
222
   * the value of the property changes.
 
223
   */
 
224
  Glib::PropertyProxy_ReadOnly<bool> property_has_palette() const;
 
225
#endif //#GLIBMM_PROPERTIES_ENABLED
 
226
 
 
227
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
228
/** Whether the color selector should allow setting opacity.
 
229
   *
 
230
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
231
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
232
   * the value of the property changes.
 
233
   */
 
234
  Glib::PropertyProxy<bool> property_has_opacity_control() ;
 
235
#endif //#GLIBMM_PROPERTIES_ENABLED
 
236
 
 
237
#ifdef GLIBMM_PROPERTIES_ENABLED
 
238
/** Whether the color selector should allow setting opacity.
 
239
   *
 
240
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
241
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
242
   * the value of the property changes.
 
243
   */
 
244
  Glib::PropertyProxy_ReadOnly<bool> property_has_opacity_control() const;
 
245
#endif //#GLIBMM_PROPERTIES_ENABLED
 
246
 
 
247
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
248
/** The current color.
 
249
   *
 
250
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
251
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
252
   * the value of the property changes.
 
253
   */
 
254
  Glib::PropertyProxy<Gdk::Color> property_current_color() ;
 
255
#endif //#GLIBMM_PROPERTIES_ENABLED
 
256
 
 
257
#ifdef GLIBMM_PROPERTIES_ENABLED
 
258
/** The current color.
 
259
   *
 
260
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
261
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
262
   * the value of the property changes.
 
263
   */
 
264
  Glib::PropertyProxy_ReadOnly<Gdk::Color> property_current_color() const;
 
265
#endif //#GLIBMM_PROPERTIES_ENABLED
 
266
 
 
267
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
268
/** The current opacity value (0 fully transparent, 65535 fully opaque).
 
269
   *
 
270
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
271
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
272
   * the value of the property changes.
 
273
   */
 
274
  Glib::PropertyProxy<guint> property_current_alpha() ;
 
275
#endif //#GLIBMM_PROPERTIES_ENABLED
 
276
 
 
277
#ifdef GLIBMM_PROPERTIES_ENABLED
 
278
/** The current opacity value (0 fully transparent, 65535 fully opaque).
 
279
   *
 
280
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
281
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
282
   * the value of the property changes.
 
283
   */
 
284
  Glib::PropertyProxy_ReadOnly<guint> property_current_alpha() const;
 
285
#endif //#GLIBMM_PROPERTIES_ENABLED
 
286
 
 
287
 
 
288
};
 
289
 
 
290
/** This dialog allows the user to select a color.
 
291
 *
 
292
 * A ColorSelectionDialog looks like this:
 
293
 * @image html colorselectiondialog1.png
 
294
 *
 
295
 * @ingroup Dialogs
 
296
 */
 
297
 
 
298
class ColorSelectionDialog : public Dialog
 
299
{
 
300
  public:
 
301
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
302
  typedef ColorSelectionDialog CppObjectType;
 
303
  typedef ColorSelectionDialog_Class CppClassType;
 
304
  typedef GtkColorSelectionDialog BaseObjectType;
 
305
  typedef GtkColorSelectionDialogClass BaseClassType;
 
306
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
307
 
 
308
  virtual ~ColorSelectionDialog();
 
309
 
 
310
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
311
 
 
312
private:
 
313
  friend class ColorSelectionDialog_Class;
 
314
  static CppClassType colorselectiondialog_class_;
 
315
 
 
316
  // noncopyable
 
317
  ColorSelectionDialog(const ColorSelectionDialog&);
 
318
  ColorSelectionDialog& operator=(const ColorSelectionDialog&);
 
319
 
 
320
protected:
 
321
  explicit ColorSelectionDialog(const Glib::ConstructParams& construct_params);
 
322
  explicit ColorSelectionDialog(GtkColorSelectionDialog* castitem);
 
323
 
 
324
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
 
325
 
 
326
public:
 
327
#ifndef DOXYGEN_SHOULD_SKIP_THIS
 
328
  static GType get_type()      G_GNUC_CONST;
 
329
 
 
330
 
 
331
  static GType get_base_type() G_GNUC_CONST;
 
332
#endif
 
333
 
 
334
  ///Provides access to the underlying C GtkObject.
 
335
  GtkColorSelectionDialog*       gobj()       { return reinterpret_cast<GtkColorSelectionDialog*>(gobject_); }
 
336
 
 
337
  ///Provides access to the underlying C GtkObject.
 
338
  const GtkColorSelectionDialog* gobj() const { return reinterpret_cast<GtkColorSelectionDialog*>(gobject_); }
 
339
 
 
340
 
 
341
public:
 
342
  //C++ methods used to invoke GTK+ virtual functions:
 
343
 
 
344
protected:
 
345
  //GTK+ Virtual Functions (override these to change behaviour):
 
346
 
 
347
  //Default Signal Handlers::
 
348
 
 
349
 
 
350
private:
 
351
 
 
352
  
 
353
public:
 
354
 
 
355
  ColorSelectionDialog();
 
356
    explicit ColorSelectionDialog(const Glib::ustring& title);
 
357
 
 
358
 
 
359
  /** Retrieves the Gtk::ColorSelection widget embedded in the dialog.
 
360
   * 
 
361
   * @newin{2,14}
 
362
   * @return The embedded Gtk::ColorSelection.
 
363
   */
 
364
  ColorSelection* get_color_selection();
 
365
  
 
366
  /** Retrieves the Gtk::ColorSelection widget embedded in the dialog.
 
367
   * 
 
368
   * @newin{2,14}
 
369
   * @return The embedded Gtk::ColorSelection.
 
370
   */
 
371
  const ColorSelection* get_color_selection() const;
 
372
 
 
373
#ifndef GTKMM_DISABLE_DEPRECATED
 
374
 
 
375
  //TODO: Remove these in gtkmm 3. They use G_SEAL()ed struct fields.
 
376
 
 
377
  /** @deprecated Use get_color_selection() instead.
 
378
   */
 
379
  ColorSelection* get_colorsel();
 
380
 
 
381
  /** @deprecated Use get_color_selection() instead.
 
382
   */
 
383
  const ColorSelection* get_colorsel() const;
 
384
 
 
385
  /** @deprecated Use Gtk::Dialog::get_widget_for_response() instead.
 
386
   */
 
387
   Button* get_ok_button();
 
388
  const Button* get_ok_button() const;
 
389
 
 
390
  /** @deprecated Use Gtk::Dialog::get_widget_for_response() instead.
 
391
   */
 
392
   Button* get_cancel_button();
 
393
  const Button* get_cancel_button() const;
 
394
 
 
395
  /** @deprecated Use Gtk::Dialog::get_widget_for_response() instead.
 
396
   */
 
397
   Button* get_help_button();
 
398
  const Button* get_help_button() const;
 
399
 #endif // GTKMM_DISABLE_DEPRECATED
 
400
 
 
401
 
 
402
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
403
/** The color selection embedded in the dialog.
 
404
   *
 
405
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
406
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
407
   * the value of the property changes.
 
408
   */
 
409
  Glib::PropertyProxy_ReadOnly<ColorSelection*> property_color_selection() const;
 
410
#endif //#GLIBMM_PROPERTIES_ENABLED
 
411
 
 
412
 
 
413
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
414
/** The OK button of the dialog.
 
415
   *
 
416
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
417
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
418
   * the value of the property changes.
 
419
   */
 
420
  Glib::PropertyProxy_ReadOnly<Button*> property_ok_button() const;
 
421
#endif //#GLIBMM_PROPERTIES_ENABLED
 
422
 
 
423
 
 
424
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
425
/** The cancel button of the dialog.
 
426
   *
 
427
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
428
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
429
   * the value of the property changes.
 
430
   */
 
431
  Glib::PropertyProxy_ReadOnly<Button*> property_cancel_button() const;
 
432
#endif //#GLIBMM_PROPERTIES_ENABLED
 
433
 
 
434
 
 
435
  #ifdef GLIBMM_PROPERTIES_ENABLED
 
436
/** The help button of the dialog.
 
437
   *
 
438
   * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
 
439
   * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
 
440
   * the value of the property changes.
 
441
   */
 
442
  Glib::PropertyProxy_ReadOnly<Button*> property_help_button() const;
 
443
#endif //#GLIBMM_PROPERTIES_ENABLED
 
444
 
 
445
 
 
446
};
 
447
 
 
448
} // namespace Gtk
 
449
 
 
450
 
 
451
namespace Glib
 
452
{
 
453
  /** A Glib::wrap() method for this object.
 
454
   * 
 
455
   * @param object The C instance.
 
456
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
457
   * @result A C++ instance that wraps this C instance.
 
458
   *
 
459
   * @relates Gtk::ColorSelection
 
460
   */
 
461
  Gtk::ColorSelection* wrap(GtkColorSelection* object, bool take_copy = false);
 
462
} //namespace Glib
 
463
 
 
464
 
 
465
namespace Glib
 
466
{
 
467
  /** A Glib::wrap() method for this object.
 
468
   * 
 
469
   * @param object The C instance.
 
470
   * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
 
471
   * @result A C++ instance that wraps this C instance.
 
472
   *
 
473
   * @relates Gtk::ColorSelectionDialog
 
474
   */
 
475
  Gtk::ColorSelectionDialog* wrap(GtkColorSelectionDialog* object, bool take_copy = false);
 
476
} //namespace Glib
 
477
 
 
478
 
 
479
#endif /* _GTKMM_COLORSELECTION_H */
 
480