]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/side-position-interface.hh
patch::: 1.3.93.jcn2
[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 extern SCM Side_position_aligned_on_self_proc;
17 extern SCM Side_position_centered_on_parent_proc;
18 extern SCM Side_position_quantised_position_proc;
19
20 /**
21    Position victim object (ELT_L_) next to other objects (the support).
22
23    side-support -- list of score elements
24
25    direction -- where to put the victim object (left or right?)
26
27    side-relative-direction -- if set: get the direction from a different object, and multiply by this.
28    
29    direction-source -- in case side-relative-direction is set, where
30    to get the direction
31
32    minimum-space -- minimum distance that the victim should move
33    (after padding)
34
35    padding -- add this much extra space between victim and support
36
37    self-alignment-X -- real number: -1 = left aligned, 0 = center, 1
38      right-aligned in X direction.
39
40      Set to an element pointer, if you want that element to be the center. 
41      
42    self-alignment-Y -- like self-alignment-X but for Y axis
43    
44    TODO: move  out unrelated callbacks.
45
46    TODO: reduce number of methods.
47
48 */
49 struct Side_position
50 {
51 public:
52   static SCM side_position (SCM element, SCM axis);
53   static SCM aligned_on_self (SCM element, SCM axis);
54   static SCM aligned_side (SCM element, SCM axis);  
55   static SCM quantised_position (SCM element, SCM axis);
56   static SCM centered_on_parent (SCM element, SCM axis);
57   static void set_axis (Score_element*,Axis);
58   static void set_minimum_space (Score_element*,Real);
59   static void set_padding (Score_element*,Real);
60   static Axis get_axis (Score_element*) ;
61   static bool supported_b (Score_element*) ;
62   static bool has_interface (Score_element*) ;
63   static void add_support (Score_element*,Score_element*);
64   static void add_staff_support (Score_element*);
65   static Direction get_direction (Score_element*);
66   static void set_direction (Score_element*,Direction);
67 };
68
69
70 #endif /* SIDE_POSITION_INTERFACE_HH */
71