]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/align-element.hh
release: 1.3.5
[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--1999 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 "axis-group-element.hh"
14 #include "interval.hh"
15 #include "direction.hh"
16 #include "axes.hh"
17 #include "hash-table.hh"
18
19 /**
20   Order elements top to bottom/left to right/right to left etc..
21
22   TODO: implement padding.
23
24   document usage of this.
25  */
26 class Align_element : public virtual Axis_group_element {
27
28   /*
29    ugh. JUNKME
30
31   */
32   Hash_table<Score_element*,int> priority_i_hash_;
33 public:
34   Interval threshold_interval_ ;
35
36   /**
37      Should high priorities be first or last?
38    */
39     
40   Direction stacking_dir_;
41
42   /**
43      Which side to align?  -1: left side, 0: centered (around
44      center_l_ if not nil, or around center of width), 1: right side
45
46      URG. Unintuitive if stacking_dir_ == -1 
47   */
48
49   Direction align_dir_;
50   
51   Axis axis () const;
52   Score_element * center_l_;
53   
54   Align_element ();
55   void set_axis (Axis);
56   void add_element (Score_element*);
57   void add_element_priority (Score_element*, int);
58   bool contains_b (Score_element const*) const;
59
60   Score_element *get_elt_by_priority (int) const;
61   int get_priority (Score_element const*) const;
62 protected:
63   void sort_elements ();
64   virtual void do_print() const;
65   virtual void do_substitute_element_pointer (Score_element*,Score_element*);
66   virtual void do_post_processing() ;
67   virtual void do_pre_processing ();
68   virtual void do_side_processing ();
69 };
70 #endif // VERTICAL_ALIGN_ITEM_HH