X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fspacing-spanner.hh;h=61ed8dc4ac0c3ee8ac5df1b8262e5997f992f1e1;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=a8d9888397116c1eef3b23a055beef1acc0fa8db;hpb=e012a172277f78d4954d269fd4973ad3fd6e5d60;p=lilypond.git diff --git a/lily/include/spacing-spanner.hh b/lily/include/spacing-spanner.hh index a8d9888397..61ed8dc4ac 100644 --- a/lily/include/spacing-spanner.hh +++ b/lily/include/spacing-spanner.hh @@ -1,60 +1,56 @@ /* - spacing-spanner.hh -- declare Spacing spanner + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2015 Han-Wen Nienhuys - (c) 2005--2006 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #ifndef SPACING_SPANNER_HH #define SPACING_SPANNER_HH #include "lily-proto.hh" -#include "lily-guile.hh" #include "rational.hh" #include "std-vector.hh" +#include "grob-interface.hh" +#include "spring.hh" -struct Spacing_options -{ - bool packed_; - bool stretch_uniformly_; - bool float_nonmusical_columns_; - bool float_grace_columns_; - Rational global_shortest_; - Real increment_; - Real shortest_duration_space_; - - Spacing_options(); - void init_from_grob (Grob *me); - Real get_duration_space (Moment d, bool *) const; -}; - -/* - TODO: prune to public interface. -*/ class Spacing_spanner { -public: +private: + static void set_distances_for_loose_col (Grob *me, Grob *c, Drul_array next_door, Spacing_options const *); static void generate_pair_spacing (Grob *me, - Paper_column *l, Paper_column *r, - Paper_column *nextr, - Spacing_options const *options); - static void standard_breakable_column_spacing (Grob *me, Item *l, Item *r, - Real *fixed, Real *space, - Spacing_options const *); + Paper_column *l, Paper_column *r, + Paper_column *nextr, + Spacing_options const *options); static Real default_bar_spacing (Grob *, Grob *, Grob *, Moment); - static Real note_spacing (Grob *, Grob *, Grob *, Spacing_options const *, bool *); - static Real get_duration_space (Moment dur, Spacing_options const *, bool *); - static Rational find_shortest (Grob *, vector const &); - static Rational effective_shortest_duration (Grob *me, vector const &all); + static Rational effective_shortest_duration (Grob *me, vector const &all); static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *); - static void prune_loose_columns (Grob *, vector *cols, Spacing_options const *); - static void set_explicit_neighbor_columns (vector const &cols); - static void set_implicit_neighbor_columns (vector const &cols); - static void generate_springs (Grob *me, vector const &cols, Spacing_options const *); + static void prune_loose_columns (Grob *, vector *cols, Spacing_options *); + static void set_explicit_neighbor_columns (vector const &cols); + static void set_implicit_neighbor_columns (vector const &cols); + static void generate_springs (Grob *me, vector const &cols, Spacing_options const *); static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *); + static bool fills_measure (Grob *, Item *, Item *); +public: + static vector get_columns (Grob *me); + static Spring note_spacing (Grob *, Grob *, Grob *, Spacing_options const *); + static Spring standard_breakable_column_spacing (Grob *me, Item *l, Item *r, Spacing_options const *); + DECLARE_SCHEME_CALLBACK (set_springs, (SCM)); - static bool has_interface (Grob *); + DECLARE_SCHEME_CALLBACK (calc_common_shortest_duration, (SCM)); + DECLARE_GROB_INTERFACE (); }; #endif /* SPACING_SPANNER_HH */