]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/axis-group.hh
release: 0.1.11
[lilypond.git] / lily / include / axis-group.hh
1 /*
2 axis-group.hh -- declare Axis_group_administration, Axis_group_element
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef Axis_group_administration_HH
11 #define Axis_group_administration_HH
12
13 #include "parray.hh"
14 #include "axes.hh"
15 #include "real.hh"
16 #include "lily-proto.hh"
17 #include "score-elem.hh"
18
19 /**
20   Do the dirty work for Axis_group_element.
21  */
22 struct Axis_group_administration {
23   Link_array<Score_elem> elem_l_arr_;
24     
25   Interval extent (Axis) const;
26   void print() const ;
27   Axis_group_administration (Axis_group_administration const&);
28   Axis_group_administration(){}
29   void remove_all (Axis a1,   Axis a2);
30
31   bool contains_b (Score_elem const *) const;
32   void add_element (Score_elem*, Axis_group_element*, Axis a1, Axis a2);
33   void remove_element (Score_elem*, Axis a1, Axis a2);
34 };
35
36 /** 
37   Treat a group of elements a unity in either or both axis sense .
38   This is a wrapper around Axis_group_administration
39   */
40 class Axis_group_element : public virtual Score_elem {
41 protected:
42   Axis_group_administration axis_admin_;
43   virtual void do_print() const;
44   virtual Link_array<Score_elem> get_extra_dependencies() const;
45   virtual void do_unlink();
46   virtual void do_junk_links();
47
48 public:
49   Axis_group_element();
50   virtual void remove_all()=0;
51   virtual void add_element (Score_elem*)=0;
52   virtual void remove_element (Score_elem*)=0;
53   virtual bool contains_b (Score_elem const *) const;
54   DECLARE_MY_RUNTIME_TYPEINFO;
55 };
56 #endif // Axis_group_administration_HH