]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/side-position-interface.hh
release: 1.3.92
[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    self-alignment-X -- real number: -1 = left aligned, 0 = center, 1
35      right-aligned in X direction.
36
37      Set to an element pointer, if you want that element to be the center. 
38      
39    self-alignment-Y -- like self-alignment-X but for Y axis
40    
41    TODO: move  out unrelated callbacks.
42
43    TODO: reduce number of methods.
44
45 */
46 struct Side_position
47 {
48 public:
49   static Real side_position (Score_element *, Axis);
50   static Real aligned_on_self (Score_element *, Axis);
51   static Real aligned_side (Score_element *, Axis);  
52   static Real quantised_position (Score_element *, Axis);
53   static Real centered_on_parent (Score_element *, Axis);
54   static void set_axis (Score_element*,Axis);
55   static void set_minimum_space (Score_element*,Real);
56   static void set_padding (Score_element*,Real);
57   static Axis get_axis (Score_element*) ;
58   static bool supported_b (Score_element*) ;
59   static bool has_interface (Score_element*) ;
60   static void add_support (Score_element*,Score_element*);
61   static void add_staff_support (Score_element*);
62   static Direction get_direction (Score_element*);
63   static void set_direction (Score_element*,Direction);
64 };
65
66
67 #endif /* SIDE_POSITION_INTERFACE_HH */
68