]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/align-element.hh
release: 1.1.6
[lilypond.git] / lily / include / align-element.hh
1 /*
2   align-item.hh -- declare Align_elem
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef VERTICAL_ALIGN_ITEM_HH
11 #define VERTICAL_ALIGN_ITEM_HH
12
13 #include "score-element.hh"
14 #include "interval.hh"
15 #include "direction.hh"
16 #include "axes.hh"
17
18 /**
19   Order elements top to bottom.
20
21   TODO: merge with Horizontal_align_item
22  */
23 class Align_element : virtual public Score_element {
24   Link_array<Score_element> elem_l_arr_;
25   Array<int> priority_i_arr_;
26   void sort_elements ();
27 public:
28   Interval threshold_interval_ ;
29
30   /**
31      Should high priorities be first or last?
32    */
33     
34   Direction stacking_dir_;
35
36   /**
37      Which side to align? 
38      -1: left side, 0: centered (around center_l_ if not nil), 1: right side
39   */
40
41   Direction align_dir_;
42   
43   Axis axis_;
44   Score_element * center_l_;
45   
46   Align_element ();
47   void add_element (Score_element*);
48   void add_element_priority (Score_element*, int);
49   bool contains_b (Score_element const*) const;
50   
51 protected:
52   virtual void do_print() const;
53   virtual void do_substitute_dependency (Score_element*,Score_element*);
54   virtual void do_post_processing() ;
55   virtual void do_pre_processing ();
56   virtual void do_side_processing ();
57 };
58 #endif // VERTICAL_ALIGN_ITEM_HH