2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ICONSET_H
4 #define _GTKMM_ICONSET_H
12 * Copyright(C) 1998-2002 The gtkmm Development Team
14 * This library is free software, ) you can redistribute it and/or
15 * modify it under the terms of the GNU Library General Public
16 * License as published by the Free Software Foundation, ) either
17 * version 2 of the License, or(at your option) any later version.
19 * This library is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY, ) without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Library General Public License for more details.
24 * You should have received a copy of the GNU Library General Public
25 * License along with this library, ) if not, write to the Free
26 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
29 //#include <gtkmm/style.h>
30 #include <gdkmm/pixbuf.h>
31 #include <gtkmm/iconsource.h>
32 //#include <gtkmm/widget.h>
33 #include <gtkmm/stockid.h>
34 #include <glibmm/arrayhandle.h>
37 #ifndef DOXYGEN_SHOULD_SKIP_THIS
38 extern "C" { typedef struct _GtkIconSet GtkIconSet; }
50 #ifndef DOXYGEN_SHOULD_SKIP_THIS
51 typedef IconSet CppObjectType;
52 typedef GtkIconSet BaseObjectType;
54 static GType get_type() G_GNUC_CONST;
55 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
59 explicit IconSet(GtkIconSet* gobject, bool make_a_copy = true);
61 IconSet(const IconSet& other);
62 IconSet& operator=(const IconSet& other);
66 void swap(IconSet& other);
68 ///Provides access to the underlying C instance.
69 GtkIconSet* gobj() { return gobject_; }
71 ///Provides access to the underlying C instance.
72 const GtkIconSet* gobj() const { return gobject_; }
74 ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
75 GtkIconSet* gobj_copy() const;
84 explicit IconSet(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
87 /** Copies @a icon_set by value.
88 * @return A new Gtk::IconSet identical to the first.
92 //Note that we use Gtk::StateType here instead of StateType, because there is an Atk::StateType too, and doxygen gets confused.
94 /** Renders an icon using Gtk::Style::render_icon(). In most cases,
95 * Gtk::Widget::render_icon() is better, since it automatically provides
96 * most of the arguments from the current widget settings. This
97 * function never returns <tt>0</tt>; if the icon can't be rendered
98 * (perhaps because an image file fails to load), a default "missing
99 * image" icon will be returned instead.
100 * @param style A Gtk::Style associated with @a widget , or <tt>0</tt>.
101 * @param direction Text direction.
102 * @param state Widget state.
103 * @param size Icon size. A size of (GtkIconSize)-1
104 * means render at the size of the source and don't scale.
105 * @param widget Widget that will display the icon, or <tt>0</tt>.
106 * The only use that is typically made of this
107 * is to determine the appropriate Gdk::Screen.
108 * @param detail Detail to pass to the theme engine, or <tt>0</tt>.
109 * Note that passing a detail of anything but <tt>0</tt>
110 * will disable caching.
111 * @return A Gdk::Pixbuf to be displayed.
113 Glib::RefPtr<Gdk::Pixbuf> render_icon(const Glib::RefPtr<Style>& style, TextDirection direction,
114 Gtk::StateType state, IconSize size,
115 Widget& widget, const Glib::ustring& detail);
118 /** Icon sets have a list of Gtk::IconSource, which they use as base
119 * icons for rendering icons in different states and sizes. Icons are
120 * scaled, made to look insensitive, etc. in
121 * gtk_icon_set_render_icon(), but Gtk::IconSet needs base images to
122 * work with. The base images and when to use them are described by
125 * This function copies @a source , so you can reuse the same source immediately
126 * without affecting the icon set.
128 * An example of when you'd use this function: a web browser's "Back
129 * to Previous Page" icon might point in a different direction in
130 * Hebrew and in English; it might look different when insensitive;
131 * and it might change size depending on toolbar mode (small/large
132 * icons). So a single icon set would contain all those variants of
133 * the icon, and you might add a separate source for each one.
135 * You should nearly always add a "default" icon source with all
136 * fields wildcarded, which will be used as a fallback if no more
137 * specific source matches. Gtk::IconSet always prefers more specific
138 * icon sources to more generic icon sources. The order in which you
139 * add the sources to the icon set does not matter.
141 * gtk_icon_set_new_from_pixbuf() creates a new icon set with a
142 * default icon source based on the given pixbuf.
143 * @param source A Gtk::IconSource.
145 void add_source(const IconSource& source);
147 Glib::ArrayHandle<IconSize> get_sizes() const;
149 static IconSet lookup_default(const Gtk::StockID& stock_id);
154 } /* namespace Gtk */
160 /** @relates Gtk::IconSet
161 * @param lhs The left-hand side
162 * @param rhs The right-hand side
164 inline void swap(IconSet& lhs, IconSet& rhs)
172 /** @relates Gtk::IconSet
173 * @param object The C instance
174 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
175 * @result A C++ instance that wraps this C instance.
177 Gtk::IconSet wrap(GtkIconSet* object, bool take_copy = false);
179 #ifndef DOXYGEN_SHOULD_SKIP_THIS
181 class Value<Gtk::IconSet> : public Glib::Value_Boxed<Gtk::IconSet>
183 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
187 #endif /* _GTKMM_ICONSET_H */