2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ICONSOURCE_H
4 #define _GTKMM_ICONSOURCE_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 <gdkmm/pixbuf.h>
30 #include <gtkmm/enums.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 extern "C" { typedef struct _GtkIconSource GtkIconSource; }
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
44 typedef IconSource CppObjectType;
45 typedef GtkIconSource BaseObjectType;
47 static GType get_type() G_GNUC_CONST;
48 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
52 explicit IconSource(GtkIconSource* gobject, bool make_a_copy = true);
54 IconSource(const IconSource& other);
55 IconSource& operator=(const IconSource& other);
59 void swap(IconSource& other);
61 ///Provides access to the underlying C instance.
62 GtkIconSource* gobj() { return gobject_; }
64 ///Provides access to the underlying C instance.
65 const GtkIconSource* gobj() const { return gobject_; }
67 ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
68 GtkIconSource* gobj_copy() const;
71 GtkIconSource* gobject_;
79 /** Sets the name of an image file to use as a base image when creating
80 * icon variants for Gtk::IconSet. The filename must be absolute.
81 * @param filename Image file to use.
83 void set_filename(const Glib::ustring& filename);
85 /** Sets a pixbuf to use as a base image when creating icon variants
87 * @param pixbuf Pixbuf to use as a source.
89 void set_pixbuf(const Glib::RefPtr<Gdk::Pixbuf>&pixbuf);
92 /** Retrieves the source filename, or <tt>0</tt> if none is set. The
93 * filename is not a copy, and should not be modified or expected to
94 * persist beyond the lifetime of the icon source.
95 * @return Image filename. This string must not be modified
98 Glib::ustring get_filename() const;
100 /** Retrieves the source pixbuf, or <tt>0</tt> if none is set.
101 * In addition, if a filename source is in use, this
102 * function in some cases will return the pixbuf from
103 * loaded from the filename. This is, for example, true
104 * for the GtkIconSource passed to the GtkStyle::render_icon()
105 * virtual function. The reference count on the pixbuf is
107 * @return Source pixbuf.
109 Glib::RefPtr<Gdk::Pixbuf> get_pixbuf();
111 /** Retrieves the source pixbuf, or <tt>0</tt> if none is set.
112 * In addition, if a filename source is in use, this
113 * function in some cases will return the pixbuf from
114 * loaded from the filename. This is, for example, true
115 * for the GtkIconSource passed to the GtkStyle::render_icon()
116 * virtual function. The reference count on the pixbuf is
118 * @return Source pixbuf.
120 Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const;
123 /** If the text direction is wildcarded, this source can be used
124 * as the base image for an icon in any Gtk::TextDirection.
125 * If the text direction is not wildcarded, then the
126 * text direction the icon source applies to should be set
127 * with gtk_icon_source_set_direction(), and the icon source
128 * will only be used with that text direction.
130 * Gtk::IconSet prefers non-wildcarded sources (exact matches) over
131 * wildcarded sources, and will use an exact match when possible.
132 * @param setting <tt>true</tt> to wildcard the text direction.
134 void set_direction_wildcarded(bool setting = true);
136 /** If the widget state is wildcarded, this source can be used as the
137 * base image for an icon in any Gtk::StateType. If the widget state
138 * is not wildcarded, then the state the source applies to should be
139 * set with gtk_icon_source_set_state() and the icon source will
140 * only be used with that specific state.
142 * Gtk::IconSet prefers non-wildcarded sources (exact matches) over
143 * wildcarded sources, and will use an exact match when possible.
145 * Gtk::IconSet will normally transform wildcarded source images to
146 * produce an appropriate icon for a given state, for example
147 * lightening an image on prelight, but will not modify source images
148 * that match exactly.
149 * @param setting <tt>true</tt> to wildcard the widget state.
151 void set_state_wildcarded(bool setting = true);
153 /** If the icon size is wildcarded, this source can be used as the base
154 * image for an icon of any size. If the size is not wildcarded, then
155 * the size the source applies to should be set with
156 * gtk_icon_source_set_size() and the icon source will only be used
157 * with that specific size.
159 * Gtk::IconSet prefers non-wildcarded sources (exact matches) over
160 * wildcarded sources, and will use an exact match when possible.
162 * Gtk::IconSet will normally scale wildcarded source images to produce
163 * an appropriate icon at a given size, but will not change the size
164 * of source images that match exactly.
165 * @param setting <tt>true</tt> to wildcard the widget state.
167 void set_size_wildcarded (bool setting = true);
169 /** Gets the value set by gtk_icon_source_set_size_wildcarded().
170 * @return <tt>true</tt> if this icon source is a base for any icon size variant.
172 bool get_size_wildcarded() const;
174 /** Gets the value set by gtk_icon_source_set_state_wildcarded().
175 * @return <tt>true</tt> if this icon source is a base for any widget state variant.
177 bool get_state_wildcarded() const;
179 /** Gets the value set by gtk_icon_source_set_direction_wildcarded().
180 * @return <tt>true</tt> if this icon source is a base for any text direction variant.
182 bool get_direction_wildcarded() const;
184 /** Sets the text direction this icon source is intended to be used
187 * Setting the text direction on an icon source makes no difference
188 * if the text direction is wildcarded. Therefore, you should usually
189 * call gtk_icon_source_set_direction_wildcarded() to un-wildcard it
190 * in addition to calling this function.
191 * @param direction Text direction this source applies to.
193 void set_direction(TextDirection direction);
195 /** Sets the widget state this icon source is intended to be used
198 * Setting the widget state on an icon source makes no difference
199 * if the state is wildcarded. Therefore, you should usually
200 * call gtk_icon_source_set_state_wildcarded() to un-wildcard it
201 * in addition to calling this function.
202 * @param state Widget state this source applies to.
204 void set_state(Gtk::StateType state);
206 /** Sets the icon size this icon source is intended to be used
209 * Setting the icon size on an icon source makes no difference
210 * if the size is wildcarded. Therefore, you should usually
211 * call gtk_icon_source_set_size_wildcarded() to un-wildcard it
212 * in addition to calling this function.
213 * @param size Icon size this source applies to.
215 void set_size(IconSize size);
217 /** Obtains the text direction this icon source applies to. The return
218 * value is only useful/meaningful if the text direction is <em>not</em>
220 * @return Text direction this source matches.
222 TextDirection get_direction() const;
224 /** Obtains the widget state this icon source applies to. The return
225 * value is only useful/meaningful if the widget state is <em>not</em>
227 * @return Widget state this source matches.
229 Gtk::StateType get_state() const;
231 /** Obtains the icon size this source applies to. The return value
232 * is only useful/meaningful if the icon size is <em>not</em> wildcarded.
233 * @return Icon size this source matches.
235 IconSize get_size() const;
238 /** Sets the name of an icon to look up in the current icon theme
239 * to use as a base image when creating icon variants for Gtk::IconSet.
240 * @param icon_name Name of icon to use.
242 void set_icon_name(const Glib::ustring& icon_name);
244 /** Retrieves the source icon name, or <tt>0</tt> if none is set. The
245 * icon_name is not a copy, and should not be modified or expected to
246 * persist beyond the lifetime of the icon source.
247 * @return Icon name. This string must not be modified or freed.
249 Glib::ustring get_icon_name() const;
254 } /* namespace Gtk */
260 /** @relates Gtk::IconSource
261 * @param lhs The left-hand side
262 * @param rhs The right-hand side
264 inline void swap(IconSource& lhs, IconSource& rhs)
272 /** @relates Gtk::IconSource
273 * @param object The C instance
274 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
275 * @result A C++ instance that wraps this C instance.
277 Gtk::IconSource wrap(GtkIconSource* object, bool take_copy = false);
279 #ifndef DOXYGEN_SHOULD_SKIP_THIS
281 class Value<Gtk::IconSource> : public Glib::Value_Boxed<Gtk::IconSource>
283 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
287 #endif /* _GTKMM_ICONSOURCE_H */