/*
- axis-group-interface.cc -- implement Axis_group_interface
+ This file is part of LilyPond, the GNU music typesetter.
- source file of the GNU LilyPond music typesetter
+ Copyright (C) 2000--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
- (c) 2000--2009 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/>.
*/
#include "axis-group-interface.hh"
Interval
Axis_group_interface::cached_pure_height (Grob *me, int start, int end)
+{
+ Interval iv = begin_of_line_pure_height (me, start);
+ iv.unite (rest_of_line_pure_height (me, start, end));
+
+ return iv;
+}
+
+Interval
+Axis_group_interface::rest_of_line_pure_height (Grob *me, int start, int end)
{
SCM adjacent_pure_heights = me->get_property ("adjacent-pure-heights");
return me->get_property ("default-next-staff-spacing");
}
+Real
+Axis_group_interface::minimum_distance (Grob *g1, Grob *g2, Axis a)
+{
+ SCM sym = ly_symbol2scm ((a == Y_AXIS) ? "vertical-skylines" : "horizontal-skylines");
+
+ Skyline_pair *s1 = Skyline_pair::unsmob (g1->get_property (sym));
+ Skyline_pair *s2 = Skyline_pair::unsmob (g2->get_property (sym));
+ if (s1 && s2)
+ return (*s1)[DOWN].distance ((*s2)[UP]);
+ return 0;
+}
+
ADD_INTERFACE (Axis_group_interface,
"An object that groups other layout objects.",
"inter-staff-spacing "
"keep-fixed-while-stretching "
"max-stretch "
+ "non-affinity-spacing "
"next-staff-spacing "
"no-alignment "
"pure-Y-common "
"pure-relevant-spanners "
"staff-affinity "
"staff-grouper "
+ "system-Y-offset "
"vertical-skylines "
);