Merge branch 'cairocanvas' of git.ardour.org:ardour/ardour into cairocanvas
[ardour.git] / libs / canvas / canvas / pixbuf.h
1 #ifndef __CANVAS_PIXBUF__
2 #define __CANVAS_PIXBUF__
3
4 #include <glibmm/refptr.h>
5
6 #include "canvas/item.h"
7
8 namespace Gdk {
9         class Pixbuf;
10 }
11
12 namespace ArdourCanvas {
13
14 class Pixbuf : public Item
15 {
16 public:
17         Pixbuf (Group *);
18
19         void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
20         void compute_bounding_box () const;
21         XMLNode* get_state () const;
22         void set_state (XMLNode const *);
23
24         void set (Glib::RefPtr<Gdk::Pixbuf>);
25
26         /* returns the reference to the internal private pixbuf
27          * after changing data in the pixbuf a call to set()
28          * is mandatory to update the data on screen */
29         Glib::RefPtr<Gdk::Pixbuf> pixbuf();
30
31 private:
32         Glib::RefPtr<Gdk::Pixbuf> _pixbuf;
33 };
34
35 }
36 #endif