Install ardour as a binary, a script and a set of shared
[ardour.git] / libs / gtkmm2 / gtk / gtkmm / image.h
1 // -*- c++ -*-
2 // Generated by gtkmmproc -- DO NOT MODIFY!
3 #ifndef _GTKMM_IMAGE_H
4 #define _GTKMM_IMAGE_H
5
6 #include <glibmm.h>
7
8 /* $Id$ */
9
10 /* image.h
11  * 
12  * Copyright (C) 1998-2002 The gtkmm Development Team
13  *
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.
18  *
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.
23  *
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.
27  */
28
29 #include <gtkmm/misc.h>
30 #include <gtkmm/iconset.h>
31 #include <gdkmm/pixbufanimation.h>
32
33
34 #ifndef DOXYGEN_SHOULD_SKIP_THIS
35 typedef struct _GtkImage GtkImage;
36 typedef struct _GtkImageClass GtkImageClass;
37 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
38
39
40 namespace Gtk
41 { class Image_Class; } // namespace Gtk
42 namespace Gtk
43 {
44
45
46 /** @addtogroup gtkmmEnums Enums and Flags */
47
48 /**
49  * @ingroup gtkmmEnums
50  */
51 enum ImageType
52 {
53   IMAGE_EMPTY,
54   IMAGE_PIXMAP,
55   IMAGE_IMAGE,
56   IMAGE_PIXBUF,
57   IMAGE_STOCK,
58   IMAGE_ICON_SET,
59   IMAGE_ANIMATION,
60   IMAGE_ICON_NAME
61 };
62
63 } // namespace Gtk
64
65
66 #ifndef DOXYGEN_SHOULD_SKIP_THIS
67 namespace Glib
68 {
69
70 template <>
71 class Value<Gtk::ImageType> : public Glib::Value_Enum<Gtk::ImageType>
72 {
73 public:
74   static GType value_type() G_GNUC_CONST;
75 };
76
77 } // namespace Glib
78 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
79
80
81 namespace Gtk
82 {
83
84
85 /** A widget displaying an image.
86  *
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. 
90  *
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.
93  *
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. 
98  *
99  * @ingroup Widgets
100  */
101
102 class Image : public Misc
103 {
104   public:
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 */
111
112   virtual ~Image();
113
114 #ifndef DOXYGEN_SHOULD_SKIP_THIS
115
116 private:
117   friend class Image_Class;
118   static CppClassType image_class_;
119
120   // noncopyable
121   Image(const Image&);
122   Image& operator=(const Image&);
123
124 protected:
125   explicit Image(const Glib::ConstructParams& construct_params);
126   explicit Image(GtkImage* castitem);
127
128 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
129
130 public:
131 #ifndef DOXYGEN_SHOULD_SKIP_THIS
132   static GType get_type()      G_GNUC_CONST;
133   static GType get_base_type() G_GNUC_CONST;
134 #endif
135
136   ///Provides access to the underlying C GtkObject.
137   GtkImage*       gobj()       { return reinterpret_cast<GtkImage*>(gobject_); }
138
139   ///Provides access to the underlying C GtkObject.
140   const GtkImage* gobj() const { return reinterpret_cast<GtkImage*>(gobject_); }
141
142
143 public:
144   //C++ methods used to invoke GTK+ virtual functions:
145
146 protected:
147   //GTK+ Virtual Functions (override these to change behaviour):
148
149   //Default Signal Handlers::
150
151
152 private:
153
154   
155 public:
156
157   Image();
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);
165   
166
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>.
170    */
171   void set(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask);
172   
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>.
176    */
177   void set(const Glib::RefPtr<Gdk::Image>& gdk_image, const Glib::RefPtr<Gdk::Bitmap>& mask);
178   
179   /** See new_from_file() for details.
180    * @param filename A filename or <tt>0</tt>.
181    */
182   void set(const std::string& filename);
183   
184   /** See new_from_pixbuf() for details.
185    * @param pixbuf A Gdk::Pixbuf or <tt>0</tt>.
186    */
187   void set(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
188   
189   /** See new_from_stock() for details.
190    * @param stock_id A stock icon name.
191    * @param size A stock icon size.
192    */
193   void set(const Gtk::StockID& stock_id, IconSize size);
194   
195   /** See new_from_icon_set() for details.
196    * @param icon_set A Gtk::IconSet.
197    * @param size A stock icon size.
198    */
199   void set(IconSet& icon_set, IconSize size);
200   
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.
204    */
205   void set(const Glib::RefPtr<Gdk::PixbufAnimation>& animation);
206   
207   /** See new_from_icon_name() for details.
208    * 
209    * Since: 2.6
210    * @param icon_name An icon name.
211    * @param size An icon size.
212    */
213   void set_from_icon_name(const Glib::ustring& icon_name, IconSize size);
214
215   void clear();
216
217   
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.
222    */
223   ImageType get_storage_type() const;
224
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;
227   
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
232    * returned pixbuf.
233    * @return The displayed pixbuf, or <tt>0</tt> if the image is empty.
234    */
235   Glib::RefPtr<Gdk::Pixbuf> get_pixbuf();
236   
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
241    * returned pixbuf.
242    * @return The displayed pixbuf, or <tt>0</tt> if the image is empty.
243    */
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;
247   
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.
254    */
255   Glib::RefPtr<Gdk::PixbufAnimation> get_animation();
256   
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.
263    */
264   Glib::RefPtr<const Gdk::PixbufAnimation> get_animation() const;
265   
266   Glib::ustring get_icon_name() const;
267   Glib::ustring get_icon_name(IconSize& size);
268   
269
270   /** Gets the pixel size used for named icons.
271    * @return The pixel size used for named icons.
272    * 
273    * Since: 2.6.
274    */
275   int get_pixel_size() const;
276  
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().
280    * 
281    * Since: 2.6
282    * @param pixel_size The new pixel size.
283    */
284   void set_pixel_size(int pixel_size);
285  
286   /** A GdkPixbuf to display.
287    *
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.
291    */
292   Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf() ;
293
294 /** A GdkPixbuf to display.
295    *
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.
299    */
300   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf() const;
301
302   /** A GdkPixmap to display.
303    *
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.
307    */
308   Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > property_pixmap() ;
309
310 /** A GdkPixmap to display.
311    *
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.
315    */
316   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > property_pixmap() const;
317
318   /** A GdkImage to display.
319    *
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.
323    */
324   Glib::PropertyProxy< Glib::RefPtr<Gdk::Image> > property_image() ;
325
326 /** A GdkImage to display.
327    *
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.
331    */
332   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Image> > property_image() const;
333
334   /** Mask bitmap to use with GdkImage or GdkPixmap.
335    *
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.
339    */
340   Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > property_mask() ;
341
342 /** Mask bitmap to use with GdkImage or GdkPixmap.
343    *
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.
347    */
348   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > property_mask() const;
349
350   /** Filename to load and display.
351    *
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.
355    */
356   Glib::PropertyProxy_WriteOnly<Glib::ustring> property_file() ;
357
358 /** Filename to load and display.
359    *
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.
363    */
364   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_file() const;
365
366   /** Stock ID for a stock image to display.
367    *
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.
371    */
372   Glib::PropertyProxy<Glib::ustring> property_stock() ;
373
374 /** Stock ID for a stock image to display.
375    *
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.
379    */
380   Glib::PropertyProxy_ReadOnly<Glib::ustring> property_stock() const;
381
382   /** Icon set to display.
383    *
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.
387    */
388   Glib::PropertyProxy<Gtk::IconSet> property_icon_set() ;
389
390 /** Icon set to display.
391    *
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.
395    */
396   Glib::PropertyProxy_ReadOnly<Gtk::IconSet> property_icon_set() const;
397
398   /** Symbolic size to use for stock icon
399    *
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.
403    */
404   Glib::PropertyProxy<int> property_icon_size() ;
405
406 /** Symbolic size to use for stock icon
407    *
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.
411    */
412   Glib::PropertyProxy_ReadOnly<int> property_icon_size() const;
413
414   /** GdkPixbufAnimation to display.
415    *
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.
419    */
420   Glib::PropertyProxy< Glib::RefPtr<Gdk::PixbufAnimation> > property_pixbuf_animation() ;
421
422 /** GdkPixbufAnimation to display.
423    *
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.
427    */
428   Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::PixbufAnimation> > property_pixbuf_animation() const;
429
430   /** The representation being used for image data.
431    *
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.
435    */
436   Glib::PropertyProxy_ReadOnly<ImageType> property_storage_type() const;
437
438
439 };
440
441 } /* namespace Gtk */
442
443
444 namespace Glib
445 {
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.
450    */
451   Gtk::Image* wrap(GtkImage* object, bool take_copy = false);
452 }
453 #endif /* _GTKMM_IMAGE_H */
454