Ardour  9.0-pre0-384-ga76afae0e9
color.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 // Generated by gmmproc 2.45.3 -- DO NOT MODIFY!
3 #ifndef _GDKMM_COLOR_H
4 #define _GDKMM_COLOR_H
5 
6 #include <gdkmmconfig.h>
7 
8 
9 #include <glibmm/ustring.h>
10 #include <sigc++/sigc++.h>
11 
12 /* $Id: color.hg,v 1.5 2005/11/29 16:38:10 murrayc Exp $ */
13 
14 /* Copyright (C) 1998-2002 The gtkmm Development Team
15  *
16  * This library is free software; you can redistribute it and/or
17  * modify it under the terms of the GNU Lesser General Public
18  * License as published by the Free Software Foundation; either
19  * version 2.1 of the License, or (at your option) any later version.
20  *
21  * This library is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24  * Lesser General Public License for more details.
25  *
26  * You should have received a copy of the GNU Lesser General Public
27  * License along with this library; if not, write to the Free
28  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29  */
30 
31 // This is for including the config header before any code (such as
32 // the #ifndef GDKMM_DISABLE_DEPRECATED in deprecated classes) is generated:
33 
34 
35 #include <glibmm/arrayhandle.h>
36 
37 
38 #ifndef DOXYGEN_SHOULD_SKIP_THIS
39 extern "C" { typedef struct _GdkColor GdkColor; }
40 #endif
41 
42 namespace Gdk
43 {
44 
45 class Colormap;
46 
54 class Color
55 {
56  public:
57 #ifndef DOXYGEN_SHOULD_SKIP_THIS
58  typedef Color CppObjectType;
59  typedef GdkColor BaseObjectType;
60 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
61 
64  static GType get_type() G_GNUC_CONST;
65 
66 
67  explicit Color(GdkColor* gobject, bool make_a_copy = true);
68 
69  Color(const Color& other);
70  Color& operator=(const Color& other);
71 
72  ~Color();
73 
74  void swap(Color& other);
75 
77  GdkColor* gobj() { return gobject_; }
78 
80  const GdkColor* gobj() const { return gobject_; }
81 
83  GdkColor* gobj_copy() const;
84 
85 protected:
87 
88 private:
89 
90 public:
91 
92 
96  Color();
97 
104  explicit Color(const Glib::ustring& value);
105 
109  void set_grey(gushort value);
110  void set_grey_p(double g);
111 
117  void set_rgb(gushort red_, gushort green_, gushort blue_);
118 
124  void set_rgb_p(double red_, double green_, double blue_);
125 
126  void set_hsv(double h, double s, double v);
127  void set_hsl(double h, double s, double l);
128 
137  bool set(const Glib::ustring& value);
138 
139  #ifndef GDKMM_DISABLE_DEPRECATED
140 
144  bool parse(const Glib::ustring& spec);
145  #endif // GDKMM_DISABLE_DEPRECATED
146 
147 
151  gushort get_red() const;
152 
156  gushort get_green() const;
157 
161  gushort get_blue() const;
162 
166  void set_red(gushort value);
167 
171  void set_green(gushort value);
172 
176  void set_blue(gushort value);
177 
178 #ifndef GDKMM_DISABLE_DEPRECATED
179 
191  void rgb_find_color(const Glib::RefPtr<Gdk::Colormap>& map);
192 #endif // GDKMM_DISABLE_DEPRECATED
193 
194 
198  guint get_pixel() const;
199 
203  double get_red_p() const;
204 
208  double get_green_p() const;
209 
213  double get_blue_p() const;
214 
220  Glib::ustring to_string() const;
221 
222 
223 };
224 
225 
226 #ifndef DOXYGEN_SHOULD_SKIP_THIS
227 /* These traits are for arrays of GdkColor structs -- not pointer arrays.
228  */
229 struct ColorTraits
230 {
231  typedef Gdk::Color CppType;
232  typedef GdkColor CType;
233  typedef GdkColor CTypeNonConst;
234 
235  static CType to_c_type (const CppType& obj);
236  static CType to_c_type (const CType& obj);
237  static CppType to_cpp_type (const CType& obj);
238  static void release_c_type (const CType&);
239 };
240 #endif //DOXYGEN_SHOULD_SKIP_THIS
241 
242 typedef Glib::ArrayHandle<Color,ColorTraits> ArrayHandle_Color;
243 
244 } // namespace Gdk
245 
246 
247 namespace Gdk
248 {
249 
255 bool operator==(const Color& lhs, const Color& rhs);
256 
262 bool operator!=(const Color& lhs, const Color& rhs);
263 
264 
265 } // namespace Gdk
266 
267 
268 namespace Gdk
269 {
270 
275 inline void swap(Color& lhs, Color& rhs)
276  { lhs.swap(rhs); }
277 
278 } // namespace Gdk
279 
280 namespace Glib
281 {
282 
291 Gdk::Color wrap(GdkColor* object, bool take_copy = false);
292 
293 #ifndef DOXYGEN_SHOULD_SKIP_THIS
294 template <>
295 class Value<Gdk::Color> : public Glib::Value_Boxed<Gdk::Color>
296 {};
297 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
298 
299 } // namespace Glib
300 
301 
302 #endif /* _GDKMM_COLOR_H */
303 
double get_blue_p() const
void set_rgb_p(double red_, double green_, double blue_)
GdkColor * gobject_
Definition: color.h:86
Glib::ustring to_string() const
void swap(Color &other)
gushort get_blue() const
bool parse(const Glib::ustring &spec)
void set_rgb(gushort red_, gushort green_, gushort blue_)
bool operator!=(const Color &lhs, const Color &rhs)
Gdk::Color wrap(GdkColor *object, bool take_copy=false)
static GType get_type() G_GNUC_CONST
bool set(const Glib::ustring &value)
double get_green_p() const
double get_red_p() const
bool operator==(const Color &lhs, const Color &rhs)
Color(const Glib::ustring &value)
void set_red(gushort value)
void set_grey_p(double g)
void rgb_find_color(const Glib::RefPtr< Gdk::Colormap > &map)
void set_hsv(double h, double s, double v)
void set_hsl(double h, double s, double l)
const GdkColor * gobj() const
Provides access to the underlying C instance.
Definition: color.h:80
void set_blue(gushort value)
gushort get_green() const
void set_grey(gushort value)
gushort get_red() const
GdkColor * gobj_copy() const
Provides access to the underlying C instance. The caller is responsible for freeing it....
guint get_pixel() const
GdkColor * gobj()
Provides access to the underlying C instance.
Definition: color.h:77
void swap(Color &lhs, Color &rhs)
Definition: color.h:275
void set_green(gushort value)
Glib::ArrayHandle< Color, ColorTraits > ArrayHandle_Color
Definition: color.h:242
Definition: lobject.h:100