UniWidgets  1.0.0
SimpleImage.h
00001 #ifndef _SIMPLEIMAGE_H
00002 #define _SIMPLEIMAGE_H
00003 // -------------------------------------------------------------------------
00004 #include <gtkmm.h>
00005 #include "uniwidgets/UPixbufCache.h"
00006 #include <global_macros.h>
00007 // -------------------------------------------------------------------------
00008 namespace UniWidgets
00009 {
00016 class SimpleImage : public Gtk::EventBox
00017 {
00018 public:
00019     SimpleImage();
00020     explicit SimpleImage(Gtk::EventBox::BaseObjectType* gobject);
00021     virtual ~SimpleImage();
00022 
00023 protected:
00024     /* Variables */
00025     Glib::RefPtr<Gdk::Pixbuf> missing_image_;               
00027     /* Methods */
00028     void on_path_changed(Glib::RefPtr<Gdk::Pixbuf>& image,
00029             Glib::Property<Glib::ustring>* new_path,
00030             Glib::ustring property_name);               
00032     void draw(Glib::RefPtr<Gdk::Pixbuf>& image);                
00033     UPixbufCache& get_cache(){ return pixbufcache;}                     
00035 private:
00036     /* Variables */
00037     UPixbufCache pixbufcache;
00038     /* Methods */
00039     void constructor();
00040 
00041     void load_pixbuf(Glib::RefPtr<Gdk::Pixbuf>* image_ptr,
00042             const Glib::Property<Glib::ustring>* property_path);
00043     DISALLOW_COPY_AND_ASSIGN(SimpleImage);
00044 };
00045 
00046 }
00047 
00048 #endif