Paul Davis
449aab3c46
git-svn-id: svn://localhost/ardour2/branches/3.0@3435 d708f5d6-7413-0410-9779-e7cbd77b26cf
519 lines
18 KiB
C++
519 lines
18 KiB
C++
// -*- c++ -*-
|
|
// Generated by gtkmmproc -- DO NOT MODIFY!
|
|
#ifndef _GTKMM_IMAGE_H
|
|
#define _GTKMM_IMAGE_H
|
|
|
|
|
|
#include <glibmm.h>
|
|
|
|
/* $Id$ */
|
|
|
|
/* image.h
|
|
*
|
|
* Copyright (C) 1998-2002 The gtkmm Development Team
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the Free
|
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
*/
|
|
|
|
#include <gtkmm/misc.h>
|
|
#include <gtkmm/iconset.h>
|
|
#include <gdkmm/pixbufanimation.h>
|
|
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
typedef struct _GtkImage GtkImage;
|
|
typedef struct _GtkImageClass GtkImageClass;
|
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
|
|
|
|
|
namespace Gtk
|
|
{ class Image_Class; } // namespace Gtk
|
|
namespace Gtk
|
|
{
|
|
|
|
|
|
/** @addtogroup gtkmmEnums Enums and Flags */
|
|
|
|
/**
|
|
* @ingroup gtkmmEnums
|
|
*/
|
|
enum ImageType
|
|
{
|
|
IMAGE_EMPTY,
|
|
IMAGE_PIXMAP,
|
|
IMAGE_IMAGE,
|
|
IMAGE_PIXBUF,
|
|
IMAGE_STOCK,
|
|
IMAGE_ICON_SET,
|
|
IMAGE_ANIMATION,
|
|
IMAGE_ICON_NAME
|
|
};
|
|
|
|
} // namespace Gtk
|
|
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
namespace Glib
|
|
{
|
|
|
|
template <>
|
|
class Value<Gtk::ImageType> : public Glib::Value_Enum<Gtk::ImageType>
|
|
{
|
|
public:
|
|
static GType value_type() G_GNUC_CONST;
|
|
};
|
|
|
|
} // namespace Glib
|
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
|
|
|
|
|
namespace Gtk
|
|
{
|
|
|
|
|
|
/** A widget displaying an image.
|
|
*
|
|
* The Gtk::Image widget displays an image. Various kinds of object can be
|
|
* displayed as an image; most typically, you would load a Gdk::Pixbuf ("pixel
|
|
* buffer") from a file, and then display that.
|
|
*
|
|
* Gtk::Image is a subclass of Gtk::Misc, which implies that you can align it
|
|
* (center, left, right) and add padding to it, using Gtk::Misc methods.
|
|
*
|
|
* Gtk::Image is a "no window" widget (has no Gdk::Window of its own), so by
|
|
* default does not receive events. If you want to receive events on the
|
|
* image, such as button clicks, place the image inside a Gtk::EventBox, then
|
|
* connect to the event signals on the event box.
|
|
*
|
|
* @ingroup Widgets
|
|
*/
|
|
|
|
class Image : public Misc
|
|
{
|
|
public:
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
typedef Image CppObjectType;
|
|
typedef Image_Class CppClassType;
|
|
typedef GtkImage BaseObjectType;
|
|
typedef GtkImageClass BaseClassType;
|
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
|
|
|
virtual ~Image();
|
|
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
|
|
private:
|
|
friend class Image_Class;
|
|
static CppClassType image_class_;
|
|
|
|
// noncopyable
|
|
Image(const Image&);
|
|
Image& operator=(const Image&);
|
|
|
|
protected:
|
|
explicit Image(const Glib::ConstructParams& construct_params);
|
|
explicit Image(GtkImage* castitem);
|
|
|
|
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
|
|
|
|
public:
|
|
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
|
static GType get_type() G_GNUC_CONST;
|
|
static GType get_base_type() G_GNUC_CONST;
|
|
#endif
|
|
|
|
///Provides access to the underlying C GtkObject.
|
|
GtkImage* gobj() { return reinterpret_cast<GtkImage*>(gobject_); }
|
|
|
|
///Provides access to the underlying C GtkObject.
|
|
const GtkImage* gobj() const { return reinterpret_cast<GtkImage*>(gobject_); }
|
|
|
|
|
|
public:
|
|
//C++ methods used to invoke GTK+ virtual functions:
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
|
|
|
protected:
|
|
//GTK+ Virtual Functions (override these to change behaviour):
|
|
#ifdef GLIBMM_VFUNCS_ENABLED
|
|
#endif //GLIBMM_VFUNCS_ENABLED
|
|
|
|
//Default Signal Handlers::
|
|
#ifdef GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
|
#endif //GLIBMM_DEFAULT_SIGNAL_HANDLERS_ENABLED
|
|
|
|
|
|
private:
|
|
|
|
|
|
public:
|
|
|
|
Image();
|
|
explicit Image(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask);
|
|
explicit Image(const Glib::RefPtr<Gdk::Image>& image, const Glib::RefPtr<Gdk::Bitmap>& mask);
|
|
explicit Image(const std::string& file);
|
|
explicit Image(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
|
|
|
|
/** Creates am Image displaying a stock icon.
|
|
* Sample stock icon identifiers are Gtk::Stock::OPEN, Gtk::Stock::EXIT. Sample stock sizes are Gtk::ICON_SIZE_MENU, Gtk::ICON_SIZE_SMALL_TOOLBAR.
|
|
* If the stock icon name isn't known, a "broken image" icon will be displayed instead.
|
|
* You can register your own stock icon names - see Gtk::IconFactory::add().
|
|
* @param stock_id A stock icon.
|
|
* @param size A stock icon size.
|
|
*/
|
|
Image(const Gtk::StockID& stock_id, IconSize size);
|
|
|
|
Image(IconSet& icon_set, IconSize size);
|
|
Image(const Glib::RefPtr<Gdk::PixbufAnimation>& animation);
|
|
|
|
|
|
/** See new_from_pixmap() for details.
|
|
* @param pixmap A Gdk::Pixmap or <tt>0</tt>.
|
|
* @param mask A Gdk::Bitmap or <tt>0</tt>.
|
|
*/
|
|
void set(const Glib::RefPtr<Gdk::Pixmap>& pixmap, const Glib::RefPtr<Gdk::Bitmap>& mask);
|
|
|
|
/** See new_from_image() for details.
|
|
* @param gdk_image A Gdk::Image or <tt>0</tt>.
|
|
* @param mask A Gdk::Bitmap or <tt>0</tt>.
|
|
*/
|
|
void set(const Glib::RefPtr<Gdk::Image>& gdk_image, const Glib::RefPtr<Gdk::Bitmap>& mask);
|
|
|
|
/** See new_from_file() for details.
|
|
* @param filename A filename or <tt>0</tt>.
|
|
*/
|
|
void set(const std::string& filename);
|
|
|
|
/** See new_from_pixbuf() for details.
|
|
* @param pixbuf A Gdk::Pixbuf or <tt>0</tt>.
|
|
*/
|
|
void set(const Glib::RefPtr<Gdk::Pixbuf>& pixbuf);
|
|
|
|
/** See the Image::Image(const Gtk::StockID& stock_id, IconSize size) constructor for details.
|
|
* @param stock_id A stock icon name.
|
|
* @param size A stock icon size.
|
|
*/
|
|
void set(const Gtk::StockID& stock_id, IconSize size);
|
|
|
|
/** See new_from_icon_set() for details.
|
|
* @param icon_set A Gtk::IconSet.
|
|
* @param size A stock icon size.
|
|
*/
|
|
void set(IconSet& icon_set, IconSize size);
|
|
|
|
/** Causes the Gtk::Image to display the given animation (or display
|
|
* nothing, if you set the animation to <tt>0</tt>).
|
|
* @param animation The Gdk::PixbufAnimation.
|
|
*/
|
|
void set(const Glib::RefPtr<Gdk::PixbufAnimation>& animation);
|
|
|
|
/** See new_from_icon_name() for details.
|
|
*
|
|
* @newin2p6
|
|
* @param icon_name An icon name.
|
|
* @param size An icon size.
|
|
*/
|
|
void set_from_icon_name(const Glib::ustring& icon_name, IconSize size);
|
|
|
|
|
|
/** Resets the image to be empty.
|
|
*
|
|
* @newin2p8
|
|
*/
|
|
void clear();
|
|
|
|
|
|
/** Gets the type of representation being used by the Gtk::Image
|
|
* to store image data. If the Gtk::Image has no image data,
|
|
* the return value will be Gtk::IMAGE_EMPTY.
|
|
* @return Image representation being used.
|
|
*/
|
|
ImageType get_storage_type() const;
|
|
|
|
void get_pixmap(Glib::RefPtr<Gdk::Pixmap>& pixmap, Glib::RefPtr<Gdk::Bitmap>& mask) const;
|
|
void get_image(Glib::RefPtr<Gdk::Image>& gdk_image, Glib::RefPtr<Gdk::Bitmap>& mask) const;
|
|
|
|
/** Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
|
|
* The storage type of the image must be Gtk::IMAGE_EMPTY or
|
|
* Gtk::IMAGE_PIXBUF (see get_storage_type()).
|
|
* The caller of this function does not own a reference to the
|
|
* returned pixbuf.
|
|
* @return The displayed pixbuf, or <tt>0</tt> if the image is empty.
|
|
*/
|
|
Glib::RefPtr<Gdk::Pixbuf> get_pixbuf();
|
|
|
|
/** Gets the Gdk::Pixbuf being displayed by the Gtk::Image.
|
|
* The storage type of the image must be Gtk::IMAGE_EMPTY or
|
|
* Gtk::IMAGE_PIXBUF (see get_storage_type()).
|
|
* The caller of this function does not own a reference to the
|
|
* returned pixbuf.
|
|
* @return The displayed pixbuf, or <tt>0</tt> if the image is empty.
|
|
*/
|
|
Glib::RefPtr<const Gdk::Pixbuf> get_pixbuf() const;
|
|
void get_stock(Gtk::StockID& stock_id, IconSize& size) const;
|
|
void get_icon_set(IconSet& icon_set, IconSize& size) const;
|
|
|
|
/** Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
|
|
* The storage type of the image must be Gtk::IMAGE_EMPTY or
|
|
* Gtk::IMAGE_ANIMATION (see get_storage_type()).
|
|
* The caller of this function does not own a reference to the
|
|
* returned animation.
|
|
* @return The displayed animation, or <tt>0</tt> if the image is empty.
|
|
*/
|
|
Glib::RefPtr<Gdk::PixbufAnimation> get_animation();
|
|
|
|
/** Gets the Gdk::PixbufAnimation being displayed by the Gtk::Image.
|
|
* The storage type of the image must be Gtk::IMAGE_EMPTY or
|
|
* Gtk::IMAGE_ANIMATION (see get_storage_type()).
|
|
* The caller of this function does not own a reference to the
|
|
* returned animation.
|
|
* @return The displayed animation, or <tt>0</tt> if the image is empty.
|
|
*/
|
|
Glib::RefPtr<const Gdk::PixbufAnimation> get_animation() const;
|
|
|
|
Glib::ustring get_icon_name() const;
|
|
Glib::ustring get_icon_name(IconSize& size);
|
|
|
|
|
|
/** Gets the pixel size used for named icons.
|
|
* @return The pixel size used for named icons.
|
|
*
|
|
* @newin2p6.
|
|
*/
|
|
int get_pixel_size() const;
|
|
|
|
/** Sets the pixel size to use for named icons. If the pixel size is set
|
|
* to a value != -1, it is used instead of the icon size set by
|
|
* set_from_icon_name().
|
|
*
|
|
* @newin2p6
|
|
* @param pixel_size The new pixel size.
|
|
*/
|
|
void set_pixel_size(int pixel_size);
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** A GdkPixbuf to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** A GdkPixbuf to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixbuf> > property_pixbuf() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** A GdkPixmap to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > property_pixmap() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** A GdkPixmap to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > property_pixmap() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** A GdkImage to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy< Glib::RefPtr<Gdk::Image> > property_image() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** A GdkImage to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Image> > property_image() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Mask bitmap to use with GdkImage or GdkPixmap.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy< Glib::RefPtr<Gdk::Pixmap> > property_mask() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Mask bitmap to use with GdkImage or GdkPixmap.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixmap> > property_mask() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Filename to load and display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<Glib::ustring> property_file() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Filename to load and display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<Glib::ustring> property_file() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Stock ID for a stock image to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<Glib::ustring> property_stock() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Stock ID for a stock image to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<Glib::ustring> property_stock() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Icon set to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<Gtk::IconSet> property_icon_set() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Icon set to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<Gtk::IconSet> property_icon_set() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Symbolic size to use for stock icon
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy<int> property_icon_size() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** Symbolic size to use for stock icon
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<int> property_icon_size() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** GdkPixbufAnimation to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy< Glib::RefPtr<Gdk::PixbufAnimation> > property_pixbuf_animation() ;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** GdkPixbufAnimation to display.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::PixbufAnimation> > property_pixbuf_animation() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
#ifdef GLIBMM_PROPERTIES_ENABLED
|
|
/** The representation being used for image data.
|
|
*
|
|
* You rarely need to use properties because there are get_ and set_ methods for almost all of them.
|
|
* @return A PropertyProxy that allows you to get or set the property of the value, or receive notification when
|
|
* the value of the property changes.
|
|
*/
|
|
Glib::PropertyProxy_ReadOnly<ImageType> property_storage_type() const;
|
|
#endif //#GLIBMM_PROPERTIES_ENABLED
|
|
|
|
|
|
};
|
|
|
|
} /* namespace Gtk */
|
|
|
|
|
|
namespace Glib
|
|
{
|
|
/** A Glib::wrap() method for this object.
|
|
*
|
|
* @param object The C instance.
|
|
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
|
|
* @result A C++ instance that wraps this C instance.
|
|
*
|
|
* @relates Gtk::Image
|
|
*/
|
|
Gtk::Image* wrap(GtkImage* object, bool take_copy = false);
|
|
} //namespace Glib
|
|
|
|
|
|
#endif /* _GTKMM_IMAGE_H */
|
|
|