1 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #include <gtkmm/iconsource.h>
4 #include <gtkmm/private/iconsource_p.h>
11 * Copyright 1998-2002 The gtkmm Development Team
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.
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.
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.
28 #include <gtk/gtkiconfactory.h>
32 } // anonymous namespace
38 Gtk::IconSource wrap(GtkIconSource* object, bool take_copy)
40 return Gtk::IconSource(object, take_copy);
51 GType IconSource::get_type()
53 return gtk_icon_source_get_type();
56 IconSource::IconSource()
58 gobject_ (gtk_icon_source_new())
61 IconSource::IconSource(const IconSource& other)
63 gobject_ ((other.gobject_) ? gtk_icon_source_copy(other.gobject_) : 0)
66 IconSource::IconSource(GtkIconSource* gobject, bool make_a_copy)
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)
74 IconSource& IconSource::operator=(const IconSource& other)
76 IconSource temp (other);
81 IconSource::~IconSource()
84 gtk_icon_source_free(gobject_);
87 void IconSource::swap(IconSource& other)
89 GtkIconSource *const temp = gobject_;
90 gobject_ = other.gobject_;
91 other.gobject_ = temp;
94 GtkIconSource* IconSource::gobj_copy() const
96 return gtk_icon_source_copy(gobject_);
100 void IconSource::set_filename(const Glib::ustring& filename)
102 gtk_icon_source_set_filename(gobj(), filename.c_str());
105 void IconSource::set_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
107 gtk_icon_source_set_pixbuf(gobj(), Glib::unwrap(pixbuf));
110 Glib::ustring IconSource::get_filename() const
112 return Glib::convert_const_gchar_ptr_to_ustring(gtk_icon_source_get_filename(const_cast<GtkIconSource*>(gobj())));
115 Glib::RefPtr<Gdk::Pixbuf> IconSource::get_pixbuf()
118 Glib::RefPtr<Gdk::Pixbuf> retvalue = Glib::wrap(gtk_icon_source_get_pixbuf(gobj()));
121 retvalue->reference(); //The function does not do a ref for us.
125 Glib::RefPtr<const Gdk::Pixbuf> IconSource::get_pixbuf() const
128 Glib::RefPtr<const Gdk::Pixbuf> retvalue = Glib::wrap(gtk_icon_source_get_pixbuf(const_cast<GtkIconSource*>(gobj())));
131 retvalue->reference(); //The function does not do a ref for us.
135 void IconSource::set_direction_wildcarded(bool setting)
137 gtk_icon_source_set_direction_wildcarded(gobj(), static_cast<int>(setting));
140 void IconSource::set_state_wildcarded(bool setting)
142 gtk_icon_source_set_state_wildcarded(gobj(), static_cast<int>(setting));
145 void IconSource::set_size_wildcarded(bool setting)
147 gtk_icon_source_set_size_wildcarded(gobj(), static_cast<int>(setting));
150 bool IconSource::get_size_wildcarded() const
152 return gtk_icon_source_get_size_wildcarded(const_cast<GtkIconSource*>(gobj()));
155 bool IconSource::get_state_wildcarded() const
157 return gtk_icon_source_get_state_wildcarded(const_cast<GtkIconSource*>(gobj()));
160 bool IconSource::get_direction_wildcarded() const
162 return gtk_icon_source_get_direction_wildcarded(const_cast<GtkIconSource*>(gobj()));
165 void IconSource::set_direction(TextDirection direction)
167 gtk_icon_source_set_direction(gobj(), ((GtkTextDirection)(direction)));
170 void IconSource::set_state(Gtk::StateType state)
172 gtk_icon_source_set_state(gobj(), ((GtkStateType)(state)));
175 void IconSource::set_size(IconSize size)
177 gtk_icon_source_set_size(gobj(), static_cast<GtkIconSize>(int(size)));
180 TextDirection IconSource::get_direction() const
182 return ((TextDirection)(gtk_icon_source_get_direction(const_cast<GtkIconSource*>(gobj()))));
185 Gtk::StateType IconSource::get_state() const
187 return ((Gtk::StateType)(gtk_icon_source_get_state(const_cast<GtkIconSource*>(gobj()))));
190 IconSize IconSource::get_size() const
192 return IconSize(static_cast<int>(gtk_icon_source_get_size(const_cast<GtkIconSource*>(gobj()))));
195 void IconSource::set_icon_name(const Glib::ustring& icon_name)
197 gtk_icon_source_set_icon_name(gobj(), icon_name.c_str());
200 Glib::ustring IconSource::get_icon_name() const
202 return Glib::convert_const_gchar_ptr_to_ustring(gtk_icon_source_get_icon_name(const_cast<GtkIconSource*>(gobj())));