Merged revisions 6293,6296-6306,6308 via svnmerge from
[ardour.git] / libs / gtkmm2 / pango / pangomm / color.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3
4 #include <pangomm/color.h>
5 #include <pangomm/private/color_p.h>
6
7 /* Copyright (C) 2002 The gtkmm Development Team
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Library General Public
11  * License as published by the Free Software Foundation; either
12  * version 2 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Library General Public License for more details.
18  *
19  * You should have received a copy of the GNU Library General Public
20  * License along with this library; if not, write to the Free
21  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22  */
23
24 namespace Pango
25 {
26
27 /* For some unknown reason pango doesn't provide pango_color_new(). Let's define an
28  * equivalent function ourself! */
29 PangoColor* _pango_color_new()
30 {
31   return g_new(PangoColor, 1);
32 }
33
34 Color::operator bool()
35 {
36   return gobj() != 0;
37 }
38
39 } /* namespace Pango */
40
41 namespace
42 {
43 } // anonymous namespace
44
45
46 namespace Glib
47 {
48
49 Pango::Color& wrap(PangoColor* object)
50 {
51   return *reinterpret_cast<Pango::Color*>(object);
52 }
53
54 const Pango::Color& wrap(const PangoColor* object)
55 {
56   return *reinterpret_cast<const Pango::Color*>(object);
57 }
58
59 } // namespace Glib
60
61
62 namespace Pango
63 {
64
65
66 // static
67 GType Color::get_type()
68 {
69   return pango_color_get_type();
70 }
71
72 Color::Color()
73 {
74   GLIBMM_INITIALIZE_STRUCT(gobject_, PangoColor);
75 }
76
77 Color::Color(const PangoColor* gobject)
78 {
79   if(gobject)
80     gobject_ = *gobject;
81   else
82     GLIBMM_INITIALIZE_STRUCT(gobject_, PangoColor);
83 }
84
85
86  guint16 Color::get_red() const
87 {
88   return gobj()->red;
89 }
90  
91  guint16 Color::get_green() const
92 {
93   return gobj()->green;
94 }
95  
96  guint16 Color::get_blue() const
97 {
98   return gobj()->blue;
99 }
100  
101  void Color::set_red(const guint16& value)
102 {
103   gobj()->red = value;
104 }
105  
106  void Color::set_green(const guint16& value)
107 {
108   gobj()->green = value;
109 }
110  
111  void Color::set_blue(const guint16& value)
112 {
113   gobj()->blue = value;
114 }
115  
116 bool Color::parse(const Glib::ustring& spec)
117 {
118   return pango_color_parse(gobj(), spec.c_str());
119 }
120
121 Glib::ustring Color::to_string() const
122 {
123   return Glib::convert_return_gchar_ptr_to_ustring(pango_color_to_string(const_cast<PangoColor*>(gobj())));
124 }
125
126
127 } // namespace Pango
128
129