]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/side-position-interface.hh
release: 1.3.68
[lilypond.git] / lily / include / side-position-interface.hh
1 /*   
2   side-position-interface.hh -- declare Side_position_interface
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef SIDE_POSITION_INTERFACE_HH
11 #define SIDE_POSITION_INTERFACE_HH
12
13 #include "spanner.hh"
14 #include "item.hh"
15
16
17 /**
18    Position victim object (ELT_L_) next to other objects (the support).
19
20    side-support -- list of score elements
21
22    direction -- where to put the victim object (left or right?)
23
24    side-relative-direction -- if set: get the direction from a different object, and multiply by this.
25    
26    direction-source -- in case side-relative-direction is set, where
27    to get the direction
28
29    minimum-space -- minimum distance that the victim should move
30    (after padding)
31
32    padding -- add this much extra space between victim and support
33
34    TODO: move  out unrelated callbacks.
35    
36  */
37 struct Side_position_interface
38 {
39   Score_element * elt_l_;
40 public:
41   Side_position_interface (Score_element const*);
42   static Real side_position (Score_element *, Axis);
43   static Real aligned_on_self (Score_element *, Axis);
44   static Real aligned_side (Score_element *, Axis);  
45   static Real quantised_position (Score_element *, Axis);
46   static Real centered_on_parent (Score_element *, Axis);
47   void set_axis (Axis);
48   void set_minimum_space (Real);
49   void set_padding (Real);
50   void set_quantised (Axis);
51   Axis get_axis () const;
52   
53   bool supported_b () const;
54   bool has_interface_b () const;
55   void add_support (Score_element*);
56
57   void add_staff_support ();
58   Direction get_direction () const;
59   void set_direction (Direction);
60 };
61
62
63 #endif /* SIDE_POSITION_INTERFACE_HH */
64