Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / iconinfo.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_ICONINFO_H
4 #define _GTKMM_ICONINFO_H
5
6 #include <glibmm.h>
7
8 /* Copyright (C) 2003 The gtkmm Development Team
9  *
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.
14  *
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.
19  *
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.
23  */
24
25 #include <gdkmm/rectangle.h>
26 #include <gdkmm/pixbuf.h>
27 #include <gdkmm/types.h>
28
29 //#include <gtk/gtkicontheme.h>
30  
31
32 #ifndef DOXYGEN_SHOULD_SKIP_THIS
33 extern "C" { typedef struct _GtkIconInfo GtkIconInfo; }
34 #endif
35
36 namespace Gtk
37 {
38
39 class IconInfo
40 {
41   public:
42 #ifndef DOXYGEN_SHOULD_SKIP_THIS
43   typedef IconInfo CppObjectType;
44   typedef GtkIconInfo BaseObjectType;
45
46   static GType get_type() G_GNUC_CONST;
47 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
48
49   IconInfo();
50
51   explicit IconInfo(GtkIconInfo* gobject, bool make_a_copy = true);
52
53   IconInfo(const IconInfo& other);
54   IconInfo& operator=(const IconInfo& other);
55
56   ~IconInfo();
57
58   void swap(IconInfo& other);
59
60   ///Provides access to the underlying C instance.
61   GtkIconInfo*       gobj()       { return gobject_; }
62
63   ///Provides access to the underlying C instance.
64   const GtkIconInfo* gobj() const { return gobject_; }
65
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;
68
69 protected:
70   GtkIconInfo* gobject_;
71
72 private:
73
74   
75 public:
76
77   ///Tests whether the IconInfo is valid.
78   operator bool();
79
80   
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
88    * they are attached.
89    * @return The base size, or 0, if no base
90    * size is known for the icon.
91    * 
92    * Since: 2.4.
93    */
94   int get_base_size() const;
95   
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
103    * be used instead.
104    */
105   Glib::ustring get_filename() const;
106   
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.
113    */
114   Glib::RefPtr<Gdk::Pixbuf> get_builtin_pixbuf();
115   
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.
122    */
123   Glib::RefPtr<const Gdk::Pixbuf> get_builtin_pixbuf() const;
124   
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
136    * icon.
137    * 
138    * Since: 2.4.
139    */
140   Glib::RefPtr<Gdk::Pixbuf> load_icon() const;
141   
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().
146    * 
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'.
153    * 
154    * This function is provided primarily to allow compatibility wrappers
155    * for older API's, and is not expected to be useful for applications.
156    * 
157    * Since: 2.4
158    * @param raw_coordinates Whether the coordinates of embedded rectangles
159    * and attached points should be returned in their original
160    * (unscaled) form.
161    */
162   void set_raw_coordinates(bool raw_coordinates = true);
163   
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
173    * 
174    * Since: 2.4.
175    */
176   bool get_embedded_rect(Gdk::Rectangle& rectangle) const;
177   bool get_attach_points(Glib::ArrayHandle<Gdk::Point>& points) const;
178   
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.
185    * 
186    * Since: 2.4.
187    */
188   Glib::ustring get_display_name() const;
189
190
191 };
192
193 } // namespace Gtk
194
195
196 namespace Gtk
197 {
198
199 /** @relates Gtk::IconInfo
200  * @param lhs The left-hand side
201  * @param rhs The right-hand side
202  */
203 inline void swap(IconInfo& lhs, IconInfo& rhs)
204   { lhs.swap(rhs); }
205
206 } // namespace Gtk
207
208 namespace Glib
209 {
210
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.
215  */
216 Gtk::IconInfo wrap(GtkIconInfo* object, bool take_copy = false);
217
218 #ifndef DOXYGEN_SHOULD_SKIP_THIS
219 template <>
220 class Value<Gtk::IconInfo> : public Glib::Value_Boxed<Gtk::IconInfo>
221 {};
222 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
223
224 } // namespace Glib
225
226 #endif /* _GTKMM_ICONINFO_H */
227