]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/spacing-spanner.hh
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / lily / include / spacing-spanner.hh
index a5c5420bd5a5c7d928ab6bf26ac5fc16d1e012ab..7f560e288029383199d41c30c91db8465a4844a0 100644 (file)
@@ -1,32 +1,59 @@
-/*   
-  spacing-spanner.hh -- declare Spacing_spanner
-  
+/*
+  spacing-spanner.hh -- declare Spacing spanner
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+
+  (c) 2005--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
+*/
 
 #ifndef SPACING_SPANNER_HH
 #define SPACING_SPANNER_HH
 
-#include "spanner.hh"
+#include "lily-proto.hh"
+#include "lily-guile.hh"
+#include "rational.hh"
+#include "std-vector.hh"
 
-class Spacing_spanner : public Spanner
+struct Spacing_options
 {
-public:
-  Spacing_spanner ();
-
-  VIRTUAL_COPY_CONS(Score_element);
-  Array<Spring> do_measure (Link_array<Paper_column>) const;
-
-protected:
-  virtual  Array<Spring> get_springs () const;
+  bool packed_;
+  bool stretch_uniformly_;
+  bool float_nonmusical_columns_;
+  Rational global_shortest_;
+  Real increment_;
+  Real shortest_duration_space_;
+
+  void init ();
+  void init_from_grob (Grob *me);
+  Real get_duration_space (Moment d, bool *) const;
+};
 
-  Real stem_dir_correction (Paper_column*,Paper_column*)  const;
-  Real default_bar_spacing (Paper_column*,Paper_column*,Moment)  const;
-  Real note_spacing (Paper_column*,Paper_column*,Moment)  const;  
+/*
+  TODO: prune to public interface.
+*/
+class Spacing_spanner
+{
+public:
+  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 *);
+  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<Grob*> const &);
+  static Rational effective_shortest_duration (Grob *me, vector<Grob*> const &all);
+  static void breakable_column_spacing (Grob *, Item *l, Item *r, Spacing_options const *);
+  static void prune_loose_columns (Grob *, vector<Grob*> *cols, Spacing_options const *);
+  static void set_explicit_neighbor_columns (vector<Grob*> const &cols);
+  static void set_implicit_neighbor_columns (vector<Grob*> const &cols);
+  static void generate_springs (Grob *me, vector<Grob*> const &cols, Spacing_options const *);
+  static void musical_column_spacing (Grob *, Item *, Item *, Spacing_options const *);
+  DECLARE_SCHEME_CALLBACK (set_springs, (SCM));
+  static bool has_interface (Grob *);
 };
 
 #endif /* SPACING_SPANNER_HH */
-