]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/axis-group.hh
release: 0.1.7
[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   Do the dirty work for Axis_group_element.
20  */
21 struct Axis_group_administration {
22     Link_array<Score_elem> elem_l_arr_;
23     
24     Interval extent(Axis)const;
25     void print() const ;
26     Axis_group_administration(Axis_group_administration const&);
27     Axis_group_administration(){}
28     void remove_all(Axis a1,Axis a2);
29     
30     bool contains_b(Score_elem const *)const;
31     void add_element(Score_elem*, Axis_group_element*, Axis a1, Axis a2);
32     void remove_element(Score_elem*, Axis a1, Axis a2);
33 };
34
35 /** 
36   Treat a group of elements a unity in either or both axis sense .
37   This is a wrapper around Axis_group_administration
38   */
39 class Axis_group_element : public virtual Score_elem {
40 protected:
41     Axis_group_administration axis_admin_;
42     virtual void do_print()const;
43     virtual Link_array<Score_elem> get_extra_dependencies()const;
44     virtual void do_unlink();
45
46 public:
47     virtual void remove_all()=0;
48     virtual void add_element(Score_elem*)=0;
49     virtual void remove_element(Score_elem*)=0;
50     virtual bool contains_b(Score_elem const *)const;
51     DECLARE_MY_RUNTIME_TYPEINFO;
52 };
53 #endif // Axis_group_administration_HH