]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/spacing-spanner.hh
3f0590c4ee1bde98b03d250af9a7ef870d92b269
[lilypond.git] / lily / include / spacing-spanner.hh
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2005--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6   LilyPond is free software: you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation, either version 3 of the License, or
9   (at your option) any later version.
10
11   LilyPond is distributed in the hope that it will be useful,
12   but WITHOUT ANY WARRANTY; without even the implied warranty of
13   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   GNU General Public License for more details.
15
16   You should have received a copy of the GNU General Public License
17   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef SPACING_SPANNER_HH
21 #define SPACING_SPANNER_HH
22
23 #include "lily-proto.hh"
24 #include "rational.hh"
25 #include "std-vector.hh"
26 #include "grob-interface.hh"
27 #include "spring.hh"
28
29 class Spacing_spanner
30 {
31 private:
32   static void set_distances_for_loose_col (Grob *me, Grob *c, Drul_array<Item *> next_door, Spacing_options const *);
33   static void generate_pair_spacing (Grob *me,
34                                      Paper_column *l, Paper_column *r,
35                                      Paper_column *nextr,
36                                      Spacing_options const *options);
37   static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment);
38   static Rational effective_shortest_duration (Grob *me, vector<Grob *> const &all);
39   static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *);
40   static void prune_loose_columns (Grob *, vector<Grob *> *cols, Spacing_options *);
41   static void set_explicit_neighbor_columns (vector<Grob *> const &cols);
42   static void set_implicit_neighbor_columns (vector<Grob *> const &cols);
43   static void generate_springs (Grob *me, vector<Grob *> const &cols, Spacing_options const *);
44   static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *);
45   static bool fills_measure (Grob *, Item *, Item *);
46 public:
47   static vector<Grob *> get_columns (Grob *me);
48   static Spring note_spacing (Grob *, Grob *, Grob *, Spacing_options const *);
49   static Spring standard_breakable_column_spacing (Grob *me, Item *l, Item *r, Spacing_options const *);
50
51   DECLARE_SCHEME_CALLBACK (set_springs, (SCM));
52   DECLARE_SCHEME_CALLBACK (calc_common_shortest_duration, (SCM));
53   DECLARE_GROB_INTERFACE ();
54 };
55
56 #endif /* SPACING_SPANNER_HH */