2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ICONINFO_H
4 #define _GTKMM_ICONINFO_H
8 /* Copyright (C) 2003 The gtkmm Development Team
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Library General Public
12 * License as published by the Free Software Foundation; either
13 * version 2 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Library General Public License for more details.
20 * You should have received a copy of the GNU Library General Public
21 * License along with this library; if not, write to the Free
22 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include <gdkmm/rectangle.h>
26 #include <gdkmm/pixbuf.h>
27 #include <gdkmm/types.h>
29 //#include <gtk/gtkicontheme.h>
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 extern "C" { typedef struct _GtkIconInfo GtkIconInfo; }
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43 typedef IconInfo CppObjectType;
44 typedef GtkIconInfo BaseObjectType;
46 static GType get_type() G_GNUC_CONST;
47 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
51 explicit IconInfo(GtkIconInfo* gobject, bool make_a_copy = true);
53 IconInfo(const IconInfo& other);
54 IconInfo& operator=(const IconInfo& other);
58 void swap(IconInfo& other);
60 ///Provides access to the underlying C instance.
61 GtkIconInfo* gobj() { return gobject_; }
63 ///Provides access to the underlying C instance.
64 const GtkIconInfo* gobj() const { return gobject_; }
66 ///Provides access to the underlying C instance. The caller is responsible for freeing it. Use when directly setting fields in structs.
67 GtkIconInfo* gobj_copy() const;
70 GtkIconInfo* gobject_;
77 ///Tests whether the IconInfo is valid.
81 /** Gets the base size for the icon. The base size
82 * is a size for the icon that was specified by
83 * the icon theme creator. This may be different
84 * than the actual size of image; an example of
85 * this is small emblem icons that can be attached
86 * to a larger icon. These icons will be given
87 * the same base size as the larger icons to which
89 * @return The base size, or 0, if no base
90 * size is known for the icon.
94 int get_base_size() const;
96 /** Gets the filename for the icon. If the
97 * Gtk::ICON_LOOKUP_USE_BUILTIN flag was passed
98 * to Gtk::IconTheme::lookup_icon(), there may be
99 * no filename if a builtin icon is returned; in this
100 * case, you should use gtk_icon_info_get_builtin_pixbuf().
101 * @return The filename for the icon, or <tt>0</tt>
102 * if gtk_icon_info_get_builtin_pixbuf() should
105 Glib::ustring get_filename() const;
107 /** Gets the built-in image for this icon, if any. To allow
108 * GTK+ to use built in icon images, you must pass the
109 * Gtk::ICON_LOOKUP_USE_BUILTIN to
110 * Gtk::IconTheme::lookup_icon().
111 * @return The built-in image pixbuf, or <tt>0</tt>.
112 * The returned image must not be modified.
114 Glib::RefPtr<Gdk::Pixbuf> get_builtin_pixbuf();
116 /** Gets the built-in image for this icon, if any. To allow
117 * GTK+ to use built in icon images, you must pass the
118 * Gtk::ICON_LOOKUP_USE_BUILTIN to
119 * Gtk::IconTheme::lookup_icon().
120 * @return The built-in image pixbuf, or <tt>0</tt>.
121 * The returned image must not be modified.
123 Glib::RefPtr<const Gdk::Pixbuf> get_builtin_pixbuf() const;
125 /** Renders an icon previously looked up in an icon theme using
126 * Gtk::IconTheme::lookup_icon(); the size will be based on the size
127 * passed to Gtk::IconTheme::lookup_icon(). Note that the resulting
128 * pixbuf may not be exactly this size; an icon theme may have icons
129 * that differ slightly from their nominal sizes, and in addition GTK+
130 * will avoid scaling icons that it considers sufficiently close to the
131 * requested size or for which the source image would have to be scaled
132 * up too far. (This maintains sharpness.)
133 * @return The rendered icon; this may be a newly created icon
134 * or a new reference to an internal icon, so you must not modify
135 * the icon. Use Glib::object_unref() to release your reference to the
140 Glib::RefPtr<Gdk::Pixbuf> load_icon() const;
142 /** Sets whether the coordinates returned by gtk_icon_info_get_embedded_rect()
143 * and gtk_icon_info_get_attach_points() should be returned in their
144 * original form as specified in the icon theme, instead of scaled
145 * appropriately for the pixbuf returned by gtk_icon_info_load_icon().
147 * Raw coordinates are somewhat strange; they are specified to be with
148 * respect to the unscaled pixmap for PNG and XPM icons, but for SVG
149 * icons, they are in a 1000x1000 coordinate space that is scaled
150 * to the final size of the icon. You can determine if the icon is an SVG
151 * icon by using gtk_icon_info_get_filename(), and seeing if it is non-<tt>0</tt>
152 * and ends in '.svg'.
154 * This function is provided primarily to allow compatibility wrappers
155 * for older API's, and is not expected to be useful for applications.
158 * @param raw_coordinates Whether the coordinates of embedded rectangles
159 * and attached points should be returned in their original
162 void set_raw_coordinates(bool raw_coordinates = true);
164 /** Gets the coordinates of a rectangle within the icon
165 * that can be used for display of information such
166 * as a preview of the contents of a text file.
167 * See gtk_icon_info_set_raw_coordinates() for further
168 * information about the coordinate system.
169 * @param rectangle Gdk::Rectangle in which to store embedded
170 * rectangle coordinates; coordinates are only stored
171 * when this function returns <tt>true</tt>.
172 * @return <tt>true</tt> if the icon has an embedded rectangle
176 bool get_embedded_rect(Gdk::Rectangle& rectangle) const;
177 bool get_attach_points(Glib::ArrayHandle<Gdk::Point>& points) const;
179 /** Gets the display name for an icon. A display name is a
180 * string to be used in place of the icon name in a user
181 * visible context like a list of icons.
182 * @return The display name for the icon or <tt>0</tt>, if
183 * the icon doesn't have a specified display name. This value
184 * is owned @a icon_info and must not be modified or free.
188 Glib::ustring get_display_name() const;
199 /** @relates Gtk::IconInfo
200 * @param lhs The left-hand side
201 * @param rhs The right-hand side
203 inline void swap(IconInfo& lhs, IconInfo& rhs)
211 /** @relates Gtk::IconInfo
212 * @param object The C instance
213 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
214 * @result A C++ instance that wraps this C instance.
216 Gtk::IconInfo wrap(GtkIconInfo* object, bool take_copy = false);
218 #ifndef DOXYGEN_SHOULD_SKIP_THIS
220 class Value<Gtk::IconInfo> : public Glib::Value_Boxed<Gtk::IconInfo>
222 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
226 #endif /* _GTKMM_ICONINFO_H */