/*
- align-interface.hh -- declare Align_interface
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+ This file is part of LilyPond, the GNU music typesetter.
+
+ Copyright (C) 2000--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ 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 <http://www.gnu.org/licenses/>.
+*/
#ifndef ALIGN_INTERFACE_HH
#define ALIGN_INTERFACE_HH
-#include "axes.hh"
#include "lily-proto.hh"
-
-/*
- TODO: rewrite this comment.
-
-
- Order elements top to bottom/left to right/right to left etc..
-
- TODO: implement padding.
-
- document usage of this.
-
-
-
- *******
-
- element properties
-
- stacking-dir
-
- Which side to align? -1: left side, 0: centered (around
- center_l_ if not nil, or around center of width), 1: right side
- */
-struct Align_interface {
- Score_element * elt_l_;
-
- Align_interface (Score_element const*);
- static Real alignment_callback (Score_element *,Axis);
- void do_side_processing (Axis a);
- void set_axis (Axis);
- Axis axis () const;
- void add_element (Score_element*);
- int get_count (Score_element*)const;
- void set_interface ();
- bool has_interface_b ();
- static Real center_on_element (Score_element *c, Axis);
+#include "std-vector.hh"
+#include "grob-interface.hh"
+
+class Align_interface
+{
+public:
+ DECLARE_SCHEME_CALLBACK (align_to_minimum_distances, (SCM));
+ DECLARE_SCHEME_CALLBACK (align_to_ideal_distances, (SCM));
+ static void align_elements_to_minimum_distances(Grob *, Axis a);
+ static void align_elements_to_ideal_distances(Grob *);
+ static vector<Real> get_minimum_translations (Grob *, vector<Grob*> const&, Axis a);
+ static vector<Real> get_minimum_translations_without_min_dist (Grob *, vector<Grob*> const&, Axis a);
+ static vector<Real> get_pure_minimum_translations (Grob *, vector<Grob*> const&,
+ Axis a, int start, int end);
+ static void set_ordered (Grob *);
+ static Axis axis (Grob *);
+ static void add_element (Grob *, Grob *);
+ static int get_count (Grob *, Grob *);
+
+ DECLARE_GROB_INTERFACE();
+
+ static Real get_pure_child_y_translation (Grob *, Grob *child, int start, int end);
+
+protected:
+ static vector<Real> internal_get_minimum_translations (Grob *, vector<Grob*> const&,
+ Axis a,
+ bool include_fixed_spacing,
+ bool pure, int start, int end);
};
#endif /* ALIGN_INTERFACE_HH */