GFC Logo GFC Title Logo
Reference Manual
Main Page  |  Namespace List  |  Alphabetical List  |  Class List  |  File List

image.hh

Go to the documentation of this file.
00001 /* GFC-UI: GTK+ Foundation Classes (User Interface Library) 00002 * Copyright (C) 2002-2004 The GFC Development Team. 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 */ 00018 00024 00025 #ifndef GFC_GTK_IMAGE_HH 00026 #define GFC_GTK_IMAGE_HH 00027 00028 #ifndef GFC_GTK_MISC_HH 00029 #include <gfc/gtk/misc.hh> 00030 #endif 00031 00032 #ifndef __GTK_IMAGE_H__ 00033 #include <gtk/gtkimage.h> 00034 #endif 00035 00036 #ifndef __GTK_STOCK_H__ 00037 #include <gtk/gtkstock.h> 00038 #endif 00039 00040 namespace GFC { 00041 00042 namespace Gdk { 00043 class Image; 00044 class Pixbuf; 00045 class PixbufAnimation; 00046 class Pixmap; 00047 } 00048 00049 namespace Gtk { 00050 00051 class IconSet; 00052 00053 // @enum Gtk::ImageType 00059 00060 enum ImageType 00061 { 00062 IMAGE_EMPTY = GTK_IMAGE_EMPTY, 00063 IMAGE_PIXMAP = GTK_IMAGE_PIXMAP, 00064 IMAGE_IMAGE = GTK_IMAGE_IMAGE, 00065 IMAGE_PIXBUF = GTK_IMAGE_PIXBUF, 00066 IMAGE_STOCK = GTK_IMAGE_STOCK, 00067 IMAGE_ICON_SET = GTK_IMAGE_ICON_SET, 00068 IMAGE_ANIMATION = GTK_IMAGE_ANIMATION 00069 }; 00070 00181 00182 class Image : public Misc 00183 { 00184 friend class G::Object; 00185 00186 Image(const Image&); 00187 Image& operator=(const Image&); 00188 00189 protected: 00192 00193 explicit Image(GtkImage *image, bool owns_reference = false); 00200 00202 00203 public: 00206 00207 Image(); 00209 00210 Image(Gdk::Pixmap *pixmap, Gdk::Bitmap *mask); 00218 00219 Image(Gdk::Image *image, Gdk::Bitmap *mask); 00227 00228 explicit Image(const char *filename); 00229 explicit Image(const String& filename); 00240 00241 explicit Image(Gdk::Pixbuf *pixbuf); 00249 00250 explicit Image(const char **xpm_data); 00257 00258 Image(const StockId& stock_id, IconSize size); 00267 00268 Image(IconSet *icon_set, IconSize size) ; 00281 00282 explicit Image(Gdk::PixbufAnimation& animation); 00288 00289 virtual ~Image(); 00291 00295 00296 GtkImage* gtk_image() const; 00298 00299 operator GtkImage* () const; 00301 00302 ImageType get_storage_type() const; 00307 00308 void get_pixmap(Gdk::Pixmap **pixmap, Gdk::Bitmap **mask) const; 00316 00317 void get_image(Gdk::Image **gdk_image, Gdk::Bitmap **mask) const; 00325 00326 Gdk::Pixbuf* get_pixbuf() const; 00333 00334 void get_stock(StockId *stock_id, IconSize *size) const; 00342 00343 void get_icon_set(Pointer<IconSet> *icon_set, IconSize *size) const; 00349 00350 Gdk::PixbufAnimation* get_animation() const; 00357 00361 00362 void set(Gdk::Pixmap *pixmap, Gdk::Bitmap *mask); 00370 00371 void set(Gdk::Image *image, Gdk::Bitmap *mask); 00379 00380 void set(const char* filename); 00381 void set(const String& filename); 00392 00393 void set(Gdk::Pixbuf *pixbuf); 00401 00402 void set(const StockId& stock_id, IconSize size); 00409 00410 void set(Gtk::IconSet *icon_set, IconSize size); 00423 00424 void set(Gdk::PixbufAnimation& animation); 00430 00431 void reset(); 00435 00437 }; 00438 00439 } // namespace Gtk 00440 00441 } // namespace GFC 00442 00443 #include <gfc/gtk/inline/image.inl> 00444 00445 #endif // GFC_GTK_IMAGE_HH 00446

Generated on Tue Aug 24 00:34:31 2004 for GFC-UI by doxygen 1.3.8