add API to directly request access to pixbuf
authorRobin Gareus <robin@gareus.org>
Sat, 6 Apr 2013 01:50:42 +0000 (03:50 +0200)
committerRobin Gareus <robin@gareus.org>
Sat, 6 Apr 2013 02:10:23 +0000 (04:10 +0200)
libs/canvas/canvas/pixbuf.h
libs/canvas/pixbuf.cc

index 31efb1c1ef43f959aaa1170839e6cc214a8727f9..0da7e4e7eae0621f9154668135a99dc3f0864a49 100644 (file)
@@ -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
index e576003b579a7992910b4fb4d6bd0df1cc6db5fc..ccb42fdf745efc317d0374ba66305b916ad1dd94 100644 (file)
@@ -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
 {