Initial revision
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / iconsource.cc
1 // Generated by gtkmmproc -- DO NOT MODIFY!
2
3 #include <gtkmm/iconsource.h>
4 #include <gtkmm/private/iconsource_p.h>
5
6 // -*- c++ -*-
7 /* $Id$ */
8
9 /*
10  *
11  * Copyright 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 Library General Public
15  * License as published by the Free Software Foundation; either
16  * version 2 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  * Library General Public License for more details.
22  *
23  * You should have received a copy of the GNU Library 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 #include <gtk/gtkiconfactory.h>
29
30 namespace
31 {
32 } // anonymous namespace
33
34
35 namespace Glib
36 {
37
38 Gtk::IconSource wrap(GtkIconSource* object, bool take_copy)
39 {
40   return Gtk::IconSource(object, take_copy);
41 }
42
43 } // namespace Glib
44
45
46 namespace Gtk
47 {
48
49
50 // static
51 GType IconSource::get_type()
52 {
53   return gtk_icon_source_get_type();
54 }
55
56 IconSource::IconSource()
57 :
58   gobject_ (gtk_icon_source_new())
59 {}
60
61 IconSource::IconSource(const IconSource& other)
62 :
63   gobject_ ((other.gobject_) ? gtk_icon_source_copy(other.gobject_) : 0)
64 {}
65
66 IconSource::IconSource(GtkIconSource* gobject, bool make_a_copy)
67 :
68   // For BoxedType wrappers, make_a_copy is true by default.  The static
69   // BoxedType wrappers must always take a copy, thus make_a_copy = true
70   // ensures identical behaviour if the default argument is used.
71   gobject_ ((make_a_copy && gobject) ? gtk_icon_source_copy(gobject) : gobject)
72 {}
73
74 IconSource& IconSource::operator=(const IconSource& other)
75 {
76   IconSource temp (other);
77   swap(temp);
78   return *this;
79 }
80
81 IconSource::~IconSource()
82 {
83   if(gobject_)
84     gtk_icon_source_free(gobject_);
85 }
86
87 void IconSource::swap(IconSource& other)
88 {
89   GtkIconSource *const temp = gobject_;
90   gobject_ = other.gobject_;
91   other.gobject_ = temp;
92 }
93
94 GtkIconSource* IconSource::gobj_copy() const
95 {
96   return gtk_icon_source_copy(gobject_);
97 }
98
99
100 void IconSource::set_filename(const Glib::ustring& filename)
101 {
102   gtk_icon_source_set_filename(gobj(), filename.c_str());
103 }
104
105 void IconSource::set_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
106 {
107   gtk_icon_source_set_pixbuf(gobj(), Glib::unwrap(pixbuf));
108 }
109
110 Glib::ustring IconSource::get_filename() const
111 {
112   return Glib::convert_const_gchar_ptr_to_ustring(gtk_icon_source_get_filename(const_cast<GtkIconSource*>(gobj())));
113 }
114
115 Glib::RefPtr<Gdk::Pixbuf> IconSource::get_pixbuf()
116 {
117
118   Glib::RefPtr<Gdk::Pixbuf> retvalue = Glib::wrap(gtk_icon_source_get_pixbuf(gobj()));
119
120   if(retvalue)
121     retvalue->reference(); //The function does not do a ref for us.
122   return retvalue;
123 }
124
125 Glib::RefPtr<const Gdk::Pixbuf> IconSource::get_pixbuf() const
126 {
127
128   Glib::RefPtr<const Gdk::Pixbuf> retvalue = Glib::wrap(gtk_icon_source_get_pixbuf(const_cast<GtkIconSource*>(gobj())));
129
130   if(retvalue)
131     retvalue->reference(); //The function does not do a ref for us.
132   return retvalue;
133 }
134
135 void IconSource::set_direction_wildcarded(bool setting)
136 {
137   gtk_icon_source_set_direction_wildcarded(gobj(), static_cast<int>(setting));
138 }
139
140 void IconSource::set_state_wildcarded(bool setting)
141 {
142   gtk_icon_source_set_state_wildcarded(gobj(), static_cast<int>(setting));
143 }
144
145 void IconSource::set_size_wildcarded(bool setting)
146 {
147   gtk_icon_source_set_size_wildcarded(gobj(), static_cast<int>(setting));
148 }
149
150 bool IconSource::get_size_wildcarded() const
151 {
152   return gtk_icon_source_get_size_wildcarded(const_cast<GtkIconSource*>(gobj()));
153 }
154
155 bool IconSource::get_state_wildcarded() const
156 {
157   return gtk_icon_source_get_state_wildcarded(const_cast<GtkIconSource*>(gobj()));
158 }
159
160 bool IconSource::get_direction_wildcarded() const
161 {
162   return gtk_icon_source_get_direction_wildcarded(const_cast<GtkIconSource*>(gobj()));
163 }
164
165 void IconSource::set_direction(TextDirection direction)
166 {
167   gtk_icon_source_set_direction(gobj(), ((GtkTextDirection)(direction)));
168 }
169
170 void IconSource::set_state(Gtk::StateType state)
171 {
172   gtk_icon_source_set_state(gobj(), ((GtkStateType)(state)));
173 }
174
175 void IconSource::set_size(IconSize size)
176 {
177   gtk_icon_source_set_size(gobj(), static_cast<GtkIconSize>(int(size)));
178 }
179
180 TextDirection IconSource::get_direction() const
181 {
182   return ((TextDirection)(gtk_icon_source_get_direction(const_cast<GtkIconSource*>(gobj()))));
183 }
184
185 Gtk::StateType IconSource::get_state() const
186 {
187   return ((Gtk::StateType)(gtk_icon_source_get_state(const_cast<GtkIconSource*>(gobj()))));
188 }
189
190 IconSize IconSource::get_size() const
191 {
192   return IconSize(static_cast<int>(gtk_icon_source_get_size(const_cast<GtkIconSource*>(gobj()))));
193 }
194
195 void IconSource::set_icon_name(const Glib::ustring& icon_name)
196 {
197   gtk_icon_source_set_icon_name(gobj(), icon_name.c_str());
198 }
199
200 Glib::ustring IconSource::get_icon_name() const
201 {
202   return Glib::convert_const_gchar_ptr_to_ustring(gtk_icon_source_get_icon_name(const_cast<GtkIconSource*>(gobj())));
203 }
204
205
206 } // namespace Gtk
207
208