diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-04 00:32:52 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2013-04-04 00:32:52 -0400 |
commit | aaea166135ace01709f7e0be64f40be80f4107ec (patch) | |
tree | 0e794ef7a723e4aaf909b841a6816e405b4ceca1 /libs/canvas/pixbuf.cc | |
parent | 1d8bac08c0c00d44e22c581768a275e1b21a99a7 (diff) |
initial commit of hand merging, plus getting "ancient" waf script to work correctly
Diffstat (limited to 'libs/canvas/pixbuf.cc')
-rw-r--r-- | libs/canvas/pixbuf.cc | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/libs/canvas/pixbuf.cc b/libs/canvas/pixbuf.cc new file mode 100644 index 0000000000..e576003b57 --- /dev/null +++ b/libs/canvas/pixbuf.cc @@ -0,0 +1,58 @@ +#include <cairomm/cairomm.h> +#include <gdkmm/general.h> + +#include "pbd/xml++.h" + +#include "canvas/pixbuf.h" + +using namespace std; +using namespace ArdourCanvas; + +Pixbuf::Pixbuf (Group* g) + : Item (g) +{ + +} + +void +Pixbuf::render (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) const +{ + Gdk::Cairo::set_source_pixbuf (context, _pixbuf, 0, 0); + context->paint (); +} + +void +Pixbuf::compute_bounding_box () const +{ + if (_pixbuf) { + _bounding_box = boost::optional<Rect> (Rect (0, 0, _pixbuf->get_width(), _pixbuf->get_height())); + } else { + _bounding_box = boost::optional<Rect> (); + } + + _bounding_box_dirty = false; +} + +void +Pixbuf::set (Glib::RefPtr<Gdk::Pixbuf> pixbuf) +{ + begin_change (); + + _pixbuf = pixbuf; + _bounding_box_dirty = true; + + end_change (); +} + +XMLNode * +Pixbuf::get_state () const +{ + /* XXX */ + return new XMLNode ("Pixbuf"); +} + +void +Pixbuf::set_state (XMLNode const * /*node*/) +{ + /* XXX */ +} |