]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/axis-group-interface.cc
Doc-es: update Snippets.
[lilypond.git] / lily / axis-group-interface.cc
index 396a95857c38a56b306bc0a9b26eb3b35fc44220..262f387ada4aa4e671b6c987a464d9a902c65b6e 100644 (file)
@@ -1,9 +1,20 @@
 /*
-  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--2010 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"
@@ -682,22 +693,40 @@ Axis_group_interface::print (SCM smob)
   return ret.smobbed_copy ();
 }
 
+MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_pure_next_staff_spacing, 3)
+SCM
+Axis_group_interface::calc_pure_next_staff_spacing (SCM smob, SCM start, SCM end)
+{
+  return calc_maybe_pure_next_staff_spacing (unsmob_grob (smob),
+                                            true,
+                                            scm_to_int (start),
+                                            scm_to_int (end));
+}
+
 MAKE_SCHEME_CALLBACK (Axis_group_interface, calc_next_staff_spacing, 1)
 SCM
 Axis_group_interface::calc_next_staff_spacing (SCM smob)
 {
-  Grob *me = unsmob_grob (smob);
+  return calc_maybe_pure_next_staff_spacing (unsmob_grob (smob),
+                                            false,
+                                            0,
+                                            INT_MAX);
+}
+
+SCM
+Axis_group_interface::calc_maybe_pure_next_staff_spacing (Grob *me, bool pure, int start, int end)
+{
   Grob *grouper = unsmob_grob (me->get_object ("staff-grouper"));
 
   if (grouper)
     {
-      Grob *last_in_group = Staff_grouper_interface::get_last_grob (grouper);
+      Grob *last_in_group = Staff_grouper_interface::get_maybe_pure_last_grob (grouper, pure, start, end);
       if (me == last_in_group)
-       return grouper->get_property ("after-last-staff-spacing");
+       return grouper->get_maybe_pure_property ("after-last-staff-spacing", pure, start, end);
       else
-       return grouper->get_property ("between-staff-spacing");
+       return grouper->get_maybe_pure_property ("between-staff-spacing", pure, start, end);
     }
-  return me->get_property ("default-next-staff-spacing");
+  return me->get_maybe_pure_property ("default-next-staff-spacing", pure, start, end);
 }
 
 Real
@@ -729,6 +758,7 @@ ADD_INTERFACE (Axis_group_interface,
               "inter-staff-spacing "
               "keep-fixed-while-stretching "
               "max-stretch "
+              "non-affinity-spacing "
               "next-staff-spacing "
               "no-alignment "
               "pure-Y-common "