add API to directly request access to pixbuf

This commit is contained in:
Robin Gareus
2013-04-06 03:50:42 +02:00
parent 8eef4b1904
commit 486edf1680
2 changed files with 14 additions and 0 deletions

View 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

View 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
{