From 486edf1680ab8837bdf4af9fcc07ec383c7354a0 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 6 Apr 2013 03:50:42 +0200 Subject: [PATCH] add API to directly request access to pixbuf --- libs/canvas/canvas/pixbuf.h | 9 +++++++++ libs/canvas/pixbuf.cc | 5 +++++ 2 files changed, 14 insertions(+) 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 #include "canvas/item.h" @@ -20,8 +23,14 @@ public: void set (Glib::RefPtr); + /* 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 pixbuf(); + private: Glib::RefPtr _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 pixbuf) end_change (); } +Glib::RefPtr +Pixbuf::pixbuf() { + return _pixbuf; +} + XMLNode * Pixbuf::get_state () const {