diff options
-rw-r--r-- | libs/canvas/canvas/pixbuf.h | 9 | ||||
-rw-r--r-- | libs/canvas/pixbuf.cc | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libs/canvas/canvas/pixbuf.h b/libs/canvas/canvas/pixbuf.h index 31efb1c1ef..0da7e4e7ea 100644 --- a/libs/canvas/canvas/pixbuf.h +++ b/libs/canvas/canvas/pixbuf.h @@ -1,3 +1,6 @@ +#ifndef __CANVAS_PIXBUF__ +#define __CANVAS_PIXBUF__ + #include <glibmm/refptr.h> #include "canvas/item.h" @@ -20,8 +23,14 @@ public: void set (Glib::RefPtr<Gdk::Pixbuf>); + /* returns the reference to the internal private pixbuf + * after changing data in the pixbuf a call to set() + * is mandatory to update the data on screen */ + Glib::RefPtr<Gdk::Pixbuf> pixbuf(); + private: Glib::RefPtr<Gdk::Pixbuf> _pixbuf; }; } +#endif diff --git a/libs/canvas/pixbuf.cc b/libs/canvas/pixbuf.cc index e576003b57..ccb42fdf74 100644 --- a/libs/canvas/pixbuf.cc +++ b/libs/canvas/pixbuf.cc @@ -44,6 +44,11 @@ Pixbuf::set (Glib::RefPtr<Gdk::Pixbuf> pixbuf) end_change (); } +Glib::RefPtr<Gdk::Pixbuf> +Pixbuf::pixbuf() { + return _pixbuf; +} + XMLNode * Pixbuf::get_state () const { |