2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ICONSOURCE_H
4 #define _GTKMM_ICONSOURCE_H
13 * Copyright(C) 1998-2002 The gtkmm Development Team
15 * This library is free software, ) you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation, ) either
18 * version 2 of the License, or(at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY, ) without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library, ) if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <gdkmm/pixbuf.h>
31 #include <gtkmm/enums.h>
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 extern "C" { typedef struct _GtkIconSource GtkIconSource; }
44 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45 typedef IconSource CppObjectType;
46 typedef GtkIconSource BaseObjectType;
48 static GType get_type() G_GNUC_CONST;
49 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
53 explicit IconSource(GtkIconSource* gobject, bool make_a_copy = true);
55 IconSource(const IconSource& other);
56 IconSource& operator=(const IconSource& other);
60 void swap(IconSource& other);
62 ///Provides access to the underlying C instance.
63 GtkIconSource* gobj() { return gobject_; }
65 ///Provides access to the underlying C instance.
66 const GtkIconSource* gobj() const { return gobject_; }
68 ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
69 GtkIconSource* gobj_copy() const;
72 GtkIconSource* gobject_;
80 /** Sets the name of an image file to use as a base image when creating
81 * icon variants for Gtk::IconSet. The filename must be absolute.
82 * @param filename Image file to use.
84 void set_filename(const Glib::ustring& filename);
86 /** Sets a pixbuf to use as a base image when creating icon variants
88 * @param pixbuf Pixbuf to use as a source.
90 void set_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>&pixbuf);
93 /** Retrieves the source filename, or <tt>0</tt> if none is set. The
94 * filename is not a copy, and should not be modified or expected to
95 * persist beyond the lifetime of the icon source.
96 * @return Image filename. This string must not be modified
99 Glib::ustring get_filename() const;
101 /** Retrieves the source pixbuf, or <tt>0</tt> if none is set.
102 * In addition, if a filename source is in use, this
103 * function in some cases will return the pixbuf from
104 * loaded from the filename. This is, for example, true
105 * for the GtkIconSource passed to the GtkStyle::render_icon()
106 * virtual function. The reference count on the pixbuf is
108 * @return Source pixbuf.
110 Glib::RefPtr<Gdk::Pixbuf> get_pixbuf();
112 /** Retrieves the source pixbuf, or <tt>0</tt> if none is set.
113 * In addition, if a filename source is in use, this
114 * function in some cases will return the pixbuf from
115 * loaded from the filename. This is, for example, true
116 * for the GtkIconSource passed to the GtkStyle::render_icon()
117 * virtual function. The reference count on the pixbuf is
119 * @return Source pixbuf.
121 Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const;
124 /** If the text direction is wildcarded, this source can be used
125 * as the base image for an icon in any Gtk::TextDirection.
126 * If the text direction is not wildcarded, then the
127 * text direction the icon source applies to should be set
128 * with gtk_icon_source_set_direction(), and the icon source
129 * will only be used with that text direction.
131 * Gtk::IconSet prefers non-wildcarded sources (exact matches) over
132 * wildcarded sources, and will use an exact match when possible.
133 * @param setting <tt>true</tt> to wildcard the text direction.
135 void set_direction_wildcarded(bool setting = true);
137 /** If the widget state is wildcarded, this source can be used as the
138 * base image for an icon in any Gtk::StateType. If the widget state
139 * is not wildcarded, then the state the source applies to should be
140 * set with gtk_icon_source_set_state() and the icon source will
141 * only be used with that specific state.
143 * Gtk::IconSet prefers non-wildcarded sources (exact matches) over
144 * wildcarded sources, and will use an exact match when possible.
146 * Gtk::IconSet will normally transform wildcarded source images to
147 * produce an appropriate icon for a given state, for example
148 * lightening an image on prelight, but will not modify source images
149 * that match exactly.
150 * @param setting <tt>true</tt> to wildcard the widget state.
152 void set_state_wildcarded(bool setting = true);
154 /** If the icon size is wildcarded, this source can be used as the base
155 * image for an icon of any size. If the size is not wildcarded, then
156 * the size the source applies to should be set with
157 * gtk_icon_source_set_size() and the icon source will only be used
158 * with that specific size.
160 * Gtk::IconSet prefers non-wildcarded sources (exact matches) over
161 * wildcarded sources, and will use an exact match when possible.
163 * Gtk::IconSet will normally scale wildcarded source images to produce
164 * an appropriate icon at a given size, but will not change the size
165 * of source images that match exactly.
166 * @param setting <tt>true</tt> to wildcard the widget state.
168 void set_size_wildcarded (bool setting = true);
170 /** Gets the value set by gtk_icon_source_set_size_wildcarded().
171 * @return <tt>true</tt> if this icon source is a base for any icon size variant.
173 bool get_size_wildcarded() const;
175 /** Gets the value set by gtk_icon_source_set_state_wildcarded().
176 * @return <tt>true</tt> if this icon source is a base for any widget state variant.
178 bool get_state_wildcarded() const;
180 /** Gets the value set by gtk_icon_source_set_direction_wildcarded().
181 * @return <tt>true</tt> if this icon source is a base for any text direction variant.
183 bool get_direction_wildcarded() const;
185 /** Sets the text direction this icon source is intended to be used
188 * Setting the text direction on an icon source makes no difference
189 * if the text direction is wildcarded. Therefore, you should usually
190 * call gtk_icon_source_set_direction_wildcarded() to un-wildcard it
191 * in addition to calling this function.
192 * @param direction Text direction this source applies to.
194 void set_direction(TextDirection direction);
196 /** Sets the widget state this icon source is intended to be used
199 * Setting the widget state on an icon source makes no difference
200 * if the state is wildcarded. Therefore, you should usually
201 * call gtk_icon_source_set_state_wildcarded() to un-wildcard it
202 * in addition to calling this function.
203 * @param state Widget state this source applies to.
205 void set_state(Gtk::StateType state);
207 /** Sets the icon size this icon source is intended to be used
210 * Setting the icon size on an icon source makes no difference
211 * if the size is wildcarded. Therefore, you should usually
212 * call gtk_icon_source_set_size_wildcarded() to un-wildcard it
213 * in addition to calling this function.
214 * @param size Icon size this source applies to.
216 void set_size(IconSize size);
218 /** Obtains the text direction this icon source applies to. The return
219 * value is only useful/meaningful if the text direction is <em>not</em>
221 * @return Text direction this source matches.
223 TextDirection get_direction() const;
225 /** Obtains the widget state this icon source applies to. The return
226 * value is only useful/meaningful if the widget state is <em>not</em>
228 * @return Widget state this source matches.
230 Gtk::StateType get_state() const;
232 /** Obtains the icon size this source applies to. The return value
233 * is only useful/meaningful if the icon size is <em>not</em> wildcarded.
234 * @return Icon size this source matches.
236 IconSize get_size() const;
239 /** Sets the name of an icon to look up in the current icon theme
240 * to use as a base image when creating icon variants for Gtk::IconSet.
241 * @param icon_name Name of icon to use.
243 void set_icon_name(const Glib::ustring& icon_name);
245 /** Retrieves the source icon name, or <tt>0</tt> if none is set. The
246 * icon_name is not a copy, and should not be modified or expected to
247 * persist beyond the lifetime of the icon source.
248 * @return Icon name. This string must not be modified or freed.
250 Glib::ustring get_icon_name() const;
255 } /* namespace Gtk */
261 /** @relates Gtk::IconSource
262 * @param lhs The left-hand side
263 * @param rhs The right-hand side
265 inline void swap(IconSource& lhs, IconSource& rhs)
273 /** A Glib::wrap() method for this object.
275 * @param object The C instance.
276 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
277 * @result A C++ instance that wraps this C instance.
279 * @relates Gtk::IconSource
281 Gtk::IconSource wrap(GtkIconSource* object, bool take_copy = false);
283 #ifndef DOXYGEN_SHOULD_SKIP_THIS
285 class Value<Gtk::IconSource> : public Glib::Value_Boxed<Gtk::IconSource>
287 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
292 #endif /* _GTKMM_ICONSOURCE_H */