]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spacing-spanner.hh
60ad275958953414b83d9a1f07c179b9fde1a693
[lilypond.git] / lily / include / spacing-spanner.hh
1 /*
2   spacing-spanner.hh -- declare Spacing spanner
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef SPACING_SPANNER_HH
10 #define SPACING_SPANNER_HH
11
12 #include "lily-proto.hh"
13 #include "lily-guile.hh"
14 #include "rational.hh"
15
16 struct Spacing_options
17 {
18   bool packed_;
19   bool stretch_uniformly_;
20   bool float_nonmusical_columns_;
21   Rational global_shortest_;
22   Real increment_;
23   Real shortest_duration_space_;
24
25   void init ();
26   void init_from_grob (Grob *me);
27   Real get_duration_space (Moment d, bool *) const;
28 };
29
30 /*
31   TODO: prune to public interface.
32 */
33 class Spacing_spanner
34 {
35 public:
36   static void generate_pair_spacing (Grob *me,
37                                      Paper_column *l, Paper_column *r,
38                                      Paper_column *nextr,
39                                      Spacing_options const *options);
40   static void standard_breakable_column_spacing (Grob *me, Item *l, Item *r,
41                                                  Real *fixed, Real *space,
42                                                  Spacing_options const *);
43   static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment);
44   static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *);
45   static Real get_duration_space (Moment dur, Spacing_options const *, bool *);
46   static Rational find_shortest (Grob *, Link_array<Grob> const &);
47   static Rational effective_shortest_duration (Grob *me, Link_array<Grob> const &all);
48   static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *);
49   static void prune_loose_columns (Grob *, Link_array<Grob> *cols, Spacing_options const *);
50   static void set_explicit_neighbor_columns (Link_array<Grob> const &cols);
51   static void set_implicit_neighbor_columns (Link_array<Grob> const &cols);
52   static void generate_springs (Grob *me, Link_array<Grob> const &cols, Spacing_options const *);
53   static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *);
54   DECLARE_SCHEME_CALLBACK (set_springs, (SCM));
55   static bool has_interface (Grob *);
56 };
57
58 #endif /* SPACING_SPANNER_HH */