remove all XML related API from canvas. it may have been useful during development...
[ardour.git] / libs / canvas / canvas / group.h
1 #ifndef __CANVAS_GROUP_H__
2 #define __CANVAS_GROUP_H__
3
4 #include <list>
5 #include <vector>
6 #include "canvas/item.h"
7 #include "canvas/types.h"
8 #include "canvas/lookup_table.h"
9
10 namespace ArdourCanvas {
11
12 class Group : public Item
13 {
14 public:
15         explicit Group (Group *);
16         explicit Group (Group *, Duple);
17         ~Group ();
18
19         void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
20         virtual void compute_bounding_box () const;
21
22         void add (Item *);
23         void remove (Item *);
24         std::list<Item*> const & items () const {
25                 return _items;
26         }
27     
28         void raise_child_to_top (Item *);
29         void raise_child (Item *, int);
30         void lower_child_to_bottom (Item *);
31         void child_changed ();
32
33         void add_items_at_point (Duple, std::vector<Item const *> &) const;
34
35         void dump (std::ostream&) const;
36
37         static int default_items_per_cell;
38
39 protected:
40         
41         explicit Group (Canvas *);
42         
43 private:
44         friend class ::OptimizingLookupTableTest;
45         
46         Group (Group const &);
47         void ensure_lut () const;
48         void invalidate_lut () const;
49
50         /* our items, from lowest to highest in the stack */
51         std::list<Item*> _items;
52
53         mutable LookupTable* _lut;
54 };
55
56 }
57
58 #endif