2 // Generated by gtkmmproc -- DO NOT MODIFY!
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 <gtkmm/misc.h>
30 #include <gtkmm/iconset.h>
31 #include <gdkmm/pixbufanimation.h>
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkImage GtkImage;
36 typedef struct _GtkImageClass GtkImageClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41 { class Image_Class; } // namespace Gtk
46 /** @addtogroup gtkmmEnums Enums and Flags */
66 #ifndef DOXYGEN_SHOULD_SKIP_THIS
71 class Value<Gtk::ImageType> : public Glib::Value_Enum<Gtk::ImageType>
74 static GType value_type() G_GNUC_CONST;
78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
85 /** A widget displaying an image.
87 * The Gtk::Image widget displays an image. Various kinds of object can be
88 * displayed as an image; most typically, you would load a Gdk::Pixbuf ("pixel
89 * buffer") from a file, and then display that.
91 * Gtk::Image is a subclass of Gtk::Misc, which implies that you can align it
92 * (center, left, right) and add padding to it, using Gtk::Misc methods.
94 * Gtk::Image is a "no window" widget (has no Gdk::Window of its own), so by
95 * default does not receive events. If you want to receive events on the
96 * image, such as button clicks, place the image inside a Gtk::EventBox, then
97 * connect to the event signals on the event box.
102 class Image : public Misc
105 #ifndef DOXYGEN_SHOULD_SKIP_THIS
106 typedef Image CppObjectType;
107 typedef Image_Class CppClassType;
108 typedef GtkImage BaseObjectType;
109 typedef GtkImageClass BaseClassType;
110 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
114 #ifndef DOXYGEN_SHOULD_SKIP_THIS
117 friend class Image_Class;
118 static CppClassType image_class_;
122 Image& operator=(const Image&);
125 explicit Image(const Glib::ConstructParams& construct_params);
126 explicit Image(GtkImage* castitem);
128 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
131 #ifndef DOXYGEN_SHOULD_SKIP_THIS
132 static GType get_type() G_GNUC_CONST;
133 static GType get_base_type() G_GNUC_CONST;
136 ///Provides access to the underlying C GtkObject.
137 GtkImage* gobj() { return reinterpret_cast<GtkImage*>(gobject_); }
139 ///Provides access to the underlying C GtkObject.
140 const GtkImage* gobj() const { return reinterpret_cast<GtkImage*>(gobject_); }
144 //C++ methods used to invoke GTK+ virtual functions:
147 //GTK+ Virtual Functions (override these to change behaviour):
149 //Default Signal Handlers::
158 explicit Image(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask);
159 explicit Image(const Glib::RefPtr<Gdk::Image>& image, const Glib::RefPtr<Gdk::Bitmap>& mask);
160 explicit Image(const std::string& file);
161 explicit Image(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
162 Image(const Gtk::StockID& stock_id, IconSize size);
163 Image(IconSet& icon_set, IconSize size);
164 Image(const Glib::RefPtr<Gdk::PixbufAnimation>& animation);
167 /** See new_from_pixmap() for details.
168 * @param pixmap A Gdk::Pixmap or <tt>0</tt>.
169 * @param mask A Gdk::Bitmap or <tt>0</tt>.
171 void set(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask);
173 /** See new_from_image() for details.
174 * @param gdk_image A Gdk::Image or <tt>0</tt>.
175 * @param mask A Gdk::Bitmap or <tt>0</tt>.
177 void set(const Glib::RefPtr<Gdk::Image>& gdk_image, const Glib::RefPtr<Gdk::Bitmap>& mask);
179 /** See new_from_file() for details.
180 * @param filename A filename or <tt>0</tt>.
182 void set(const std::string& filename);
184 /** See new_from_pixbuf() for details.
185 * @param pixbuf A Gdk::Pixbuf or <tt>0</tt>.
187 void set(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
189 /** See new_from_stock() for details.
190 * @param stock_id A stock icon name.
191 * @param size A stock icon size.
193 void set(const Gtk::StockID& stock_id, IconSize size);
195 /** See new_from_icon_set() for details.
196 * @param icon_set A Gtk::IconSet.
197 * @param size A stock icon size.
199 void set(IconSet& icon_set, IconSize size);
201 /** Causes the Gtk::Image to display the given animation (or display
202 * nothing, if you set the animation to <tt>0</tt>).
203 * @param animation The Gdk::PixbufAnimation.
205 void set(const Glib::RefPtr<Gdk::PixbufAnimation>& animation);
207 /** See new_from_icon_name() for details.
210 * @param icon_name An icon name.
211 * @param size An icon size.
213 void set_from_icon_name(const Glib::ustring& icon_name, IconSize size);
218 /** Gets the type of representation being used by the Gtk::Image
219 * to store image data. If the Gtk::Image has no image data,
220 * the return value will be Gtk::IMAGE_EMPTY.
221 * @return Image representation being used.
223 ImageType get_storage_type() const;
225 void get_pixmap(Glib::RefPtr<Gdk::Pixmap>& pixmap, Glib::RefPtr<Gdk::Bitmap>& mask) const;
226 void get_image(Glib::RefPtr<Gdk::Image>& gdk_image, Glib::RefPtr<Gdk::Bitmap>& mask) const;
228 /** Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
229 * The storage type of the image must be Gtk::IMAGE_EMPTY or
230 * Gtk::IMAGE_PIXBUF (see get_storage_type()).
231 * The caller of this function does not own a reference to the
233 * @return The displayed pixbuf, or <tt>0</tt> if the image is empty.
235 Glib::RefPtr<Gdk::Pixbuf> get_pixbuf();
237 /** Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
238 * The storage type of the image must be Gtk::IMAGE_EMPTY or
239 * Gtk::IMAGE_PIXBUF (see get_storage_type()).
240 * The caller of this function does not own a reference to the
242 * @return The displayed pixbuf, or <tt>0</tt> if the image is empty.
244 Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const;
245 void get_stock(Gtk::StockID& stock_id, IconSize& size) const;
246 void get_icon_set(IconSet& icon_set, IconSize& size) const;
248 /** Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
249 * The storage type of the image must be Gtk::IMAGE_EMPTY or
250 * Gtk::IMAGE_ANIMATION (see get_storage_type()).
251 * The caller of this function does not own a reference to the
252 * returned animation.
253 * @return The displayed animation, or <tt>0</tt> if the image is empty.
255 Glib::RefPtr<Gdk::PixbufAnimation> get_animation();
257 /** Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
258 * The storage type of the image must be Gtk::IMAGE_EMPTY or
259 * Gtk::IMAGE_ANIMATION (see get_storage_type()).
260 * The caller of this function does not own a reference to the
261 * returned animation.
262 * @return The displayed animation, or <tt>0</tt> if the image is empty.
264 Glib::RefPtr<const Gdk::PixbufAnimation> get_animation() const;
266 Glib::ustring get_icon_name() const;
267 Glib::ustring get_icon_name(IconSize& size);
270 /** Gets the pixel size used for named icons.
271 * @return The pixel size used for named icons.
275 int get_pixel_size() const;
277 /** Sets the pixel size to use for named icons. If the pixel size is set
278 * to a value != -1, it is used instead of the icon size set by
279 * set_from_icon_name().
282 * @param pixel_size The new pixel size.
284 void set_pixel_size(int pixel_size);
286 /** A GdkPixbuf to display.
288 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
289 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
290 * the value of the property changes.
292 Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf() ;
294 /** A GdkPixbuf to display.
296 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
297 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
298 * the value of the property changes.
300 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf() const;
302 /** A GdkPixmap to display.
304 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
305 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
306 * the value of the property changes.
308 Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > property_pixmap() ;
310 /** A GdkPixmap to display.
312 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
313 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
314 * the value of the property changes.
316 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > property_pixmap() const;
318 /** A GdkImage to display.
320 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
321 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
322 * the value of the property changes.
324 Glib::PropertyProxy< Glib::RefPtr<Gdk::Image> > property_image() ;
326 /** A GdkImage to display.
328 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
329 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
330 * the value of the property changes.
332 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Image> > property_image() const;
334 /** Mask bitmap to use with GdkImage or GdkPixmap.
336 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
337 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
338 * the value of the property changes.
340 Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > property_mask() ;
342 /** Mask bitmap to use with GdkImage or GdkPixmap.
344 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
345 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
346 * the value of the property changes.
348 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > property_mask() const;
350 /** Filename to load and display.
352 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
353 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
354 * the value of the property changes.
356 Glib::PropertyProxy_WriteOnly<Glib::ustring> property_file() ;
358 /** Filename to load and display.
360 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
361 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
362 * the value of the property changes.
364 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_file() const;
366 /** Stock ID for a stock image to display.
368 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
369 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
370 * the value of the property changes.
372 Glib::PropertyProxy<Glib::ustring> property_stock() ;
374 /** Stock ID for a stock image to display.
376 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
377 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
378 * the value of the property changes.
380 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_stock() const;
382 /** Icon set to display.
384 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
385 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
386 * the value of the property changes.
388 Glib::PropertyProxy<Gtk::IconSet> property_icon_set() ;
390 /** Icon set to display.
392 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
393 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
394 * the value of the property changes.
396 Glib::PropertyProxy_ReadOnly<Gtk::IconSet> property_icon_set() const;
398 /** Symbolic size to use for stock icon
400 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
401 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
402 * the value of the property changes.
404 Glib::PropertyProxy<int> property_icon_size() ;
406 /** Symbolic size to use for stock icon
408 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
409 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
410 * the value of the property changes.
412 Glib::PropertyProxy_ReadOnly<int> property_icon_size() const;
414 /** GdkPixbufAnimation to display.
416 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
417 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
418 * the value of the property changes.
420 Glib::PropertyProxy< Glib::RefPtr<Gdk::PixbufAnimation> > property_pixbuf_animation() ;
422 /** GdkPixbufAnimation to display.
424 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
425 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
426 * the value of the property changes.
428 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::PixbufAnimation> > property_pixbuf_animation() const;
430 /** The representation being used for image data.
432 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
433 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
434 * the value of the property changes.
436 Glib::PropertyProxy_ReadOnly<ImageType> property_storage_type() const;
441 } /* namespace Gtk */
446 /** @relates Gtk::Image
447 * @param object The C instance
448 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
449 * @result A C++ instance that wraps this C instance.
451 Gtk::Image* wrap(GtkImage* object, bool take_copy = false);
453 #endif /* _GTKMM_IMAGE_H */