2 // Generated by gtkmmproc -- DO NOT MODIFY!
13 * Copyright (C) 1998-2002 The gtkmm Development Team
15 * This library is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU Library General Public
17 * License as published by the Free Software Foundation; either
18 * version 2 of the License, or (at your option) any later version.
20 * This library is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 * Library General Public License for more details.
25 * You should have received a copy of the GNU Library General Public
26 * License along with this library; if not, write to the Free
27 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 #include <gtkmm/misc.h>
31 #include <gtkmm/iconset.h>
32 #include <gdkmm/pixbufanimation.h>
35 #ifndef DOXYGEN_SHOULD_SKIP_THIS
36 typedef struct _GtkImage GtkImage;
37 typedef struct _GtkImageClass GtkImageClass;
38 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
42 { class Image_Class; } // namespace Gtk
47 /** @addtogroup gtkmmEnums Enums and Flags */
67 #ifndef DOXYGEN_SHOULD_SKIP_THIS
72 class Value<Gtk::ImageType> : public Glib::Value_Enum<Gtk::ImageType>
75 static GType value_type() G_GNUC_CONST;
79 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
86 /** A widget displaying an image.
88 * The Gtk::Image widget displays an image. Various kinds of object can be
89 * displayed as an image; most typically, you would load a Gdk::Pixbuf ("pixel
90 * buffer") from a file, and then display that.
92 * Gtk::Image is a subclass of Gtk::Misc, which implies that you can align it
93 * (center, left, right) and add padding to it, using Gtk::Misc methods.
95 * Gtk::Image is a "no window" widget (has no Gdk::Window of its own), so by
96 * default does not receive events. If you want to receive events on the
97 * image, such as button clicks, place the image inside a Gtk::EventBox, then
98 * connect to the event signals on the event box.
103 class Image : public Misc
106 #ifndef DOXYGEN_SHOULD_SKIP_THIS
107 typedef Image CppObjectType;
108 typedef Image_Class CppClassType;
109 typedef GtkImage BaseObjectType;
110 typedef GtkImageClass BaseClassType;
111 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
115 #ifndef DOXYGEN_SHOULD_SKIP_THIS
118 friend class Image_Class;
119 static CppClassType image_class_;
123 Image& operator=(const Image&);
126 explicit Image(const Glib::ConstructParams& construct_params);
127 explicit Image(GtkImage* castitem);
129 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
132 #ifndef DOXYGEN_SHOULD_SKIP_THIS
133 static GType get_type() G_GNUC_CONST;
134 static GType get_base_type() G_GNUC_CONST;
137 ///Provides access to the underlying C GtkObject.
138 GtkImage* gobj() { return reinterpret_cast<GtkImage*>(gobject_); }
140 ///Provides access to the underlying C GtkObject.
141 const GtkImage* gobj() const { return reinterpret_cast<GtkImage*>(gobject_); }
145 //C++ methods used to invoke GTK+ virtual functions:
146 #ifdef GLIBMM_VFUNCS_ENABLED
147 #endif //GLIBMM_VFUNCS_ENABLED
150 //GTK+ Virtual Functions (override these to change behaviour):
151 #ifdef GLIBMM_VFUNCS_ENABLED
152 #endif //GLIBMM_VFUNCS_ENABLED
154 //Default Signal Handlers::
155 #ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
156 #endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
165 explicit Image(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask);
166 explicit Image(const Glib::RefPtr<Gdk::Image>& image, const Glib::RefPtr<Gdk::Bitmap>& mask);
167 explicit Image(const std::string& file);
168 explicit Image(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
170 /** Creates am Image displaying a stock icon.
171 * Sample stock icon identifiers are Gtk::Stock::OPEN, Gtk::Stock::EXIT. Sample stock sizes are Gtk::ICON_SIZE_MENU, Gtk::ICON_SIZE_SMALL_TOOLBAR.
172 * If the stock icon name isn't known, a "broken image" icon will be displayed instead.
173 * You can register your own stock icon names - see Gtk::IconFactory::add().
174 * @param stock_id A stock icon.
175 * @param size A stock icon size.
177 Image(const Gtk::StockID& stock_id, IconSize size);
179 Image(IconSet& icon_set, IconSize size);
180 Image(const Glib::RefPtr<Gdk::PixbufAnimation>& animation);
183 /** See new_from_pixmap() for details.
184 * @param pixmap A Gdk::Pixmap or <tt>0</tt>.
185 * @param mask A Gdk::Bitmap or <tt>0</tt>.
187 void set(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask);
189 /** See new_from_image() for details.
190 * @param gdk_image A Gdk::Image or <tt>0</tt>.
191 * @param mask A Gdk::Bitmap or <tt>0</tt>.
193 void set(const Glib::RefPtr<Gdk::Image>& gdk_image, const Glib::RefPtr<Gdk::Bitmap>& mask);
195 /** See new_from_file() for details.
196 * @param filename A filename or <tt>0</tt>.
198 void set(const std::string& filename);
200 /** See new_from_pixbuf() for details.
201 * @param pixbuf A Gdk::Pixbuf or <tt>0</tt>.
203 void set(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
205 /** See the Image::Image(const Gtk::StockID& stock_id, IconSize size) constructor for details.
206 * @param stock_id A stock icon name.
207 * @param size A stock icon size.
209 void set(const Gtk::StockID& stock_id, IconSize size);
211 /** See new_from_icon_set() for details.
212 * @param icon_set A Gtk::IconSet.
213 * @param size A stock icon size.
215 void set(IconSet& icon_set, IconSize size);
217 /** Causes the Gtk::Image to display the given animation (or display
218 * nothing, if you set the animation to <tt>0</tt>).
219 * @param animation The Gdk::PixbufAnimation.
221 void set(const Glib::RefPtr<Gdk::PixbufAnimation>& animation);
223 /** See new_from_icon_name() for details.
226 * @param icon_name An icon name.
227 * @param size An icon size.
229 void set_from_icon_name(const Glib::ustring& icon_name, IconSize size);
232 /** Resets the image to be empty.
239 /** Gets the type of representation being used by the Gtk::Image
240 * to store image data. If the Gtk::Image has no image data,
241 * the return value will be Gtk::IMAGE_EMPTY.
242 * @return Image representation being used.
244 ImageType get_storage_type() const;
246 void get_pixmap(Glib::RefPtr<Gdk::Pixmap>& pixmap, Glib::RefPtr<Gdk::Bitmap>& mask) const;
247 void get_image(Glib::RefPtr<Gdk::Image>& gdk_image, Glib::RefPtr<Gdk::Bitmap>& mask) const;
249 /** Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
250 * The storage type of the image must be Gtk::IMAGE_EMPTY or
251 * Gtk::IMAGE_PIXBUF (see get_storage_type()).
252 * The caller of this function does not own a reference to the
254 * @return The displayed pixbuf, or <tt>0</tt> if the image is empty.
256 Glib::RefPtr<Gdk::Pixbuf> get_pixbuf();
258 /** Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
259 * The storage type of the image must be Gtk::IMAGE_EMPTY or
260 * Gtk::IMAGE_PIXBUF (see get_storage_type()).
261 * The caller of this function does not own a reference to the
263 * @return The displayed pixbuf, or <tt>0</tt> if the image is empty.
265 Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const;
266 void get_stock(Gtk::StockID& stock_id, IconSize& size) const;
267 void get_icon_set(IconSet& icon_set, IconSize& size) const;
269 /** Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
270 * The storage type of the image must be Gtk::IMAGE_EMPTY or
271 * Gtk::IMAGE_ANIMATION (see get_storage_type()).
272 * The caller of this function does not own a reference to the
273 * returned animation.
274 * @return The displayed animation, or <tt>0</tt> if the image is empty.
276 Glib::RefPtr<Gdk::PixbufAnimation> get_animation();
278 /** Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
279 * The storage type of the image must be Gtk::IMAGE_EMPTY or
280 * Gtk::IMAGE_ANIMATION (see get_storage_type()).
281 * The caller of this function does not own a reference to the
282 * returned animation.
283 * @return The displayed animation, or <tt>0</tt> if the image is empty.
285 Glib::RefPtr<const Gdk::PixbufAnimation> get_animation() const;
287 Glib::ustring get_icon_name() const;
288 Glib::ustring get_icon_name(IconSize& size);
291 /** Gets the pixel size used for named icons.
292 * @return The pixel size used for named icons.
296 int get_pixel_size() const;
298 /** Sets the pixel size to use for named icons. If the pixel size is set
299 * to a value != -1, it is used instead of the icon size set by
300 * set_from_icon_name().
303 * @param pixel_size The new pixel size.
305 void set_pixel_size(int pixel_size);
307 #ifdef GLIBMM_PROPERTIES_ENABLED
308 /** A GdkPixbuf to display.
310 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
311 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
312 * the value of the property changes.
314 Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf() ;
315 #endif //#GLIBMM_PROPERTIES_ENABLED
317 #ifdef GLIBMM_PROPERTIES_ENABLED
318 /** A GdkPixbuf 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_ReadOnly< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf() const;
325 #endif //#GLIBMM_PROPERTIES_ENABLED
327 #ifdef GLIBMM_PROPERTIES_ENABLED
328 /** A GdkPixmap to display.
330 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
331 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
332 * the value of the property changes.
334 Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > property_pixmap() ;
335 #endif //#GLIBMM_PROPERTIES_ENABLED
337 #ifdef GLIBMM_PROPERTIES_ENABLED
338 /** A GdkPixmap to display.
340 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
341 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
342 * the value of the property changes.
344 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > property_pixmap() const;
345 #endif //#GLIBMM_PROPERTIES_ENABLED
347 #ifdef GLIBMM_PROPERTIES_ENABLED
348 /** A GdkImage to display.
350 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
351 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
352 * the value of the property changes.
354 Glib::PropertyProxy< Glib::RefPtr<Gdk::Image> > property_image() ;
355 #endif //#GLIBMM_PROPERTIES_ENABLED
357 #ifdef GLIBMM_PROPERTIES_ENABLED
358 /** A GdkImage to 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::RefPtr<Gdk::Image> > property_image() const;
365 #endif //#GLIBMM_PROPERTIES_ENABLED
367 #ifdef GLIBMM_PROPERTIES_ENABLED
368 /** Mask bitmap to use with GdkImage or GdkPixmap.
370 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
371 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
372 * the value of the property changes.
374 Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > property_mask() ;
375 #endif //#GLIBMM_PROPERTIES_ENABLED
377 #ifdef GLIBMM_PROPERTIES_ENABLED
378 /** Mask bitmap to use with GdkImage or GdkPixmap.
380 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
381 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
382 * the value of the property changes.
384 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > property_mask() const;
385 #endif //#GLIBMM_PROPERTIES_ENABLED
387 #ifdef GLIBMM_PROPERTIES_ENABLED
388 /** Filename to load and display.
390 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
391 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
392 * the value of the property changes.
394 Glib::PropertyProxy<Glib::ustring> property_file() ;
395 #endif //#GLIBMM_PROPERTIES_ENABLED
397 #ifdef GLIBMM_PROPERTIES_ENABLED
398 /** Filename to load and display.
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_ReadOnly<Glib::ustring> property_file() const;
405 #endif //#GLIBMM_PROPERTIES_ENABLED
407 #ifdef GLIBMM_PROPERTIES_ENABLED
408 /** Stock ID for a stock image to display.
410 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
411 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
412 * the value of the property changes.
414 Glib::PropertyProxy<Glib::ustring> property_stock() ;
415 #endif //#GLIBMM_PROPERTIES_ENABLED
417 #ifdef GLIBMM_PROPERTIES_ENABLED
418 /** Stock ID for a stock image to display.
420 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
421 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
422 * the value of the property changes.
424 Glib::PropertyProxy_ReadOnly<Glib::ustring> property_stock() const;
425 #endif //#GLIBMM_PROPERTIES_ENABLED
427 #ifdef GLIBMM_PROPERTIES_ENABLED
428 /** Icon set to display.
430 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
431 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
432 * the value of the property changes.
434 Glib::PropertyProxy<Gtk::IconSet> property_icon_set() ;
435 #endif //#GLIBMM_PROPERTIES_ENABLED
437 #ifdef GLIBMM_PROPERTIES_ENABLED
438 /** Icon set to display.
440 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
441 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
442 * the value of the property changes.
444 Glib::PropertyProxy_ReadOnly<Gtk::IconSet> property_icon_set() const;
445 #endif //#GLIBMM_PROPERTIES_ENABLED
447 #ifdef GLIBMM_PROPERTIES_ENABLED
448 /** Symbolic size to use for stock icon
450 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
451 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
452 * the value of the property changes.
454 Glib::PropertyProxy<int> property_icon_size() ;
455 #endif //#GLIBMM_PROPERTIES_ENABLED
457 #ifdef GLIBMM_PROPERTIES_ENABLED
458 /** Symbolic size to use for stock icon
460 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
461 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
462 * the value of the property changes.
464 Glib::PropertyProxy_ReadOnly<int> property_icon_size() const;
465 #endif //#GLIBMM_PROPERTIES_ENABLED
467 #ifdef GLIBMM_PROPERTIES_ENABLED
468 /** GdkPixbufAnimation to display.
470 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
471 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
472 * the value of the property changes.
474 Glib::PropertyProxy< Glib::RefPtr<Gdk::PixbufAnimation> > property_pixbuf_animation() ;
475 #endif //#GLIBMM_PROPERTIES_ENABLED
477 #ifdef GLIBMM_PROPERTIES_ENABLED
478 /** GdkPixbufAnimation to display.
480 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
481 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
482 * the value of the property changes.
484 Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::PixbufAnimation> > property_pixbuf_animation() const;
485 #endif //#GLIBMM_PROPERTIES_ENABLED
487 #ifdef GLIBMM_PROPERTIES_ENABLED
488 /** The representation being used for image data.
490 * You rarely need to use properties because there are get_ and set_ methods for almost all of them.
491 * @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
492 * the value of the property changes.
494 Glib::PropertyProxy_ReadOnly<ImageType> property_storage_type() const;
495 #endif //#GLIBMM_PROPERTIES_ENABLED
500 } /* namespace Gtk */
505 /** A Glib::wrap() method for this object.
507 * @param object The C instance.
508 * @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
509 * @result A C++ instance that wraps this C instance.
511 * @relates Gtk::Image
513 Gtk::Image* wrap(GtkImage* object, bool take_copy = false);
517 #endif /* _GTKMM_IMAGE_H */