remove all XML related API from canvas. it may have been useful during development...
[ardour.git] / libs / canvas / canvas / rectangle.h
1 #ifndef __CANVAS_RECTANGLE_H__
2 #define __CANVAS_RECTANGLE_H__
3
4 #include "canvas/item.h"
5 #include "canvas/types.h"
6 #include "canvas/outline.h"
7 #include "canvas/fill.h"
8
9 namespace ArdourCanvas
10 {
11
12 class Rectangle : virtual public Item, public Outline, public Fill
13 {
14 public:
15         Rectangle (Group *);
16         Rectangle (Group *, Rect const &);
17         
18         void render (Rect const &, Cairo::RefPtr<Cairo::Context>) const;
19         void compute_bounding_box () const;
20
21         Rect const & get () const {
22                 return _rect;
23         }
24
25         Coord x0 () const {
26                 return _rect.x0;
27         }
28
29         Coord y0 () const {
30                 return _rect.y0;
31         }
32
33         Coord x1 () const {
34                 return _rect.x1;
35         }
36
37         Coord y1 () const {
38                 return _rect.y1;
39         }
40
41         void set (Rect const &);
42         void set_x0 (Coord);
43         void set_y0 (Coord);
44         void set_x1 (Coord);
45         void set_y1 (Coord);
46
47         enum What {
48                 LEFT = 0x1,
49                 RIGHT = 0x2,
50                 TOP = 0x4,
51                 BOTTOM = 0x8
52         };
53
54         void set_outline_what (What);
55         void set_outline_what (int);
56
57 private:
58         /** Our rectangle; note that x0 may not always be less than x1
59          *  and likewise with y0 and y1.
60          */
61         Rect _rect;
62         What _outline_what;
63 };
64
65 }
66
67 #endif