2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ICONINFO_H
4 #define _GTKMM_ICONINFO_H
9 /* Copyright (C) 2003 The gtkmm Development Team
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include <gdkmm/rectangle.h>
27 #include <gdkmm/pixbuf.h>
28 #include <gdkmm/types.h>
30 //#include <gtk/gtkicontheme.h>
33 #ifndef DOXYGEN_SHOULD_SKIP_THIS
34 extern "C" { typedef struct _GtkIconInfo GtkIconInfo; }
43 #ifndef DOXYGEN_SHOULD_SKIP_THIS
44 typedef IconInfo CppObjectType;
45 typedef GtkIconInfo BaseObjectType;
47 static GType get_type() G_GNUC_CONST;
48 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
52 explicit IconInfo(GtkIconInfo* gobject, bool make_a_copy = true);
54 IconInfo(const IconInfo& other);
55 IconInfo& operator=(const IconInfo& other);
59 void swap(IconInfo& other);
61 ///Provides access to the underlying C instance.
62 GtkIconInfo* gobj() { return gobject_; }
64 ///Provides access to the underlying C instance.
65 const GtkIconInfo* 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 GtkIconInfo* gobj_copy() const;
71 GtkIconInfo* gobject_;
78 ///Tests whether the IconInfo is valid.
82 /** Gets the base size for the icon. The base size
83 * is a size for the icon that was specified by
84 * the icon theme creator. This may be different
85 * than the actual size of image; an example of
86 * this is small emblem icons that can be attached
87 * to a larger icon. These icons will be given
88 * the same base size as the larger icons to which
90 * @return The base size, or 0, if no base
91 * size is known for the icon.
95 int get_base_size() const;
97 /** Gets the filename for the icon. If the
98 * Gtk::ICON_LOOKUP_USE_BUILTIN flag was passed
99 * to Gtk::IconTheme::lookup_icon(), there may be
100 * no filename if a builtin icon is returned; in this
101 * case, you should use gtk_icon_info_get_builtin_pixbuf().
102 * @return The filename for the icon, or <tt>0</tt>
103 * if gtk_icon_info_get_builtin_pixbuf() should
106 Glib::ustring get_filename() const;
108 /** Gets the built-in image for this icon, if any. To allow
109 * GTK+ to use built in icon images, you must pass the
110 * Gtk::ICON_LOOKUP_USE_BUILTIN to
111 * Gtk::IconTheme::lookup_icon().
112 * @return The built-in image pixbuf, or <tt>0</tt>.
113 * The returned image must not be modified.
115 Glib::RefPtr<Gdk::Pixbuf> get_builtin_pixbuf();
117 /** Gets the built-in image for this icon, if any. To allow
118 * GTK+ to use built in icon images, you must pass the
119 * Gtk::ICON_LOOKUP_USE_BUILTIN to
120 * Gtk::IconTheme::lookup_icon().
121 * @return The built-in image pixbuf, or <tt>0</tt>.
122 * The returned image must not be modified.
124 Glib::RefPtr<const Gdk::Pixbuf> get_builtin_pixbuf() const;
126 /** Renders an icon previously looked up in an icon theme using
127 * Gtk::IconTheme::lookup_icon(); the size will be based on the size
128 * passed to Gtk::IconTheme::lookup_icon(). Note that the resulting
129 * pixbuf may not be exactly this size; an icon theme may have icons
130 * that differ slightly from their nominal sizes, and in addition GTK+
131 * will avoid scaling icons that it considers sufficiently close to the
132 * requested size or for which the source image would have to be scaled
133 * up too far. (This maintains sharpness.)
134 * @param error Location to store error information on failure, or <tt>0</tt>.
135 * @return The rendered icon; this may be a newly created icon
136 * or a new reference to an internal icon, so you must not modify
137 * the icon. Use Glib::object_unref() to release your reference to the
142 #ifdef GLIBMM_EXCEPTIONS_ENABLED
143 Glib::RefPtr<Gdk::Pixbuf> load_icon() const;
145 Glib::RefPtr<Gdk::Pixbuf> load_icon(std::auto_ptr<Glib::Error>& error) const;
146 #endif //GLIBMM_EXCEPTIONS_ENABLED
149 /** Sets whether the coordinates returned by gtk_icon_info_get_embedded_rect()
150 * and gtk_icon_info_get_attach_points() should be returned in their
151 * original form as specified in the icon theme, instead of scaled
152 * appropriately for the pixbuf returned by gtk_icon_info_load_icon().
154 * Raw coordinates are somewhat strange; they are specified to be with
155 * respect to the unscaled pixmap for PNG and XPM icons, but for SVG
156 * icons, they are in a 1000x1000 coordinate space that is scaled
157 * to the final size of the icon. You can determine if the icon is an SVG
158 * icon by using gtk_icon_info_get_filename(), and seeing if it is non-<tt>0</tt>
159 * and ends in '.svg'.
161 * This function is provided primarily to allow compatibility wrappers
162 * for older API's, and is not expected to be useful for applications.
165 * @param raw_coordinates Whether the coordinates of embedded rectangles
166 * and attached points should be returned in their original
169 void set_raw_coordinates(bool raw_coordinates = true);
171 /** Gets the coordinates of a rectangle within the icon
172 * that can be used for display of information such
173 * as a preview of the contents of a text file.
174 * See gtk_icon_info_set_raw_coordinates() for further
175 * information about the coordinate system.
176 * @param rectangle Gdk::Rectangle in which to store embedded
177 * rectangle coordinates; coordinates are only stored
178 * when this function returns <tt>true</tt>.
179 * @return <tt>true</tt> if the icon has an embedded rectangle
183 bool get_embedded_rect(Gdk::Rectangle& rectangle) const;
184 bool get_attach_points(Glib::ArrayHandle<Gdk::Point>& points) const;
186 /** Gets the display name for an icon. A display name is a
187 * string to be used in place of the icon name in a user
188 * visible context like a list of icons.
189 * @return The display name for the icon or <tt>0</tt>, if
190 * the icon doesn't have a specified display name. This value
191 * is owned @a icon_info and must not be modified or free.
195 Glib::ustring get_display_name() const;
206 /** @relates Gtk::IconInfo
207 * @param lhs The left-hand side
208 * @param rhs The right-hand side
210 inline void swap(IconInfo& lhs, IconInfo& rhs)
218 /** A Glib::wrap() method for this object.
220 * @param object The C instance.
221 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
222 * @result A C++ instance that wraps this C instance.
224 * @relates Gtk::IconInfo
226 Gtk::IconInfo wrap(GtkIconInfo* object, bool take_copy = false);
228 #ifndef DOXYGEN_SHOULD_SKIP_THIS
230 class Value<Gtk::IconInfo> : public Glib::Value_Boxed<Gtk::IconInfo>
232 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
237 #endif /* _GTKMM_ICONINFO_H */