X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fspanner-scheme.cc;h=f2a9f0f939afd41b66b0218eb53fe348f35536ee;hb=e90f0536f9be39ada0bef0aeb0d275dec3b2fb5b;hp=d47e4f028509419217d888a2777f156204aa0c79;hpb=a8c9e8a7ca320ab0df5fd32e717fd62cd7635ce6;p=lilypond.git diff --git a/lily/spanner-scheme.cc b/lily/spanner-scheme.cc index d47e4f0285..f2a9f0f939 100644 --- a/lily/spanner-scheme.cc +++ b/lily/spanner-scheme.cc @@ -1,10 +1,21 @@ -/* - spanner-scheme.cc -- implement Spanner bindings. - - source file of the GNU LilyPond music typesetter - - (c) 2007--2009 Han-Wen Nienhuys +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 2007--2011 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 . */ #include "spanner.hh" @@ -17,8 +28,21 @@ LY_DEFINE (ly_spanner_bound, "ly:spanner-bound", { LY_ASSERT_TYPE (unsmob_spanner, spanner, 1); LY_ASSERT_TYPE (is_direction, dir, 2); - - return unsmob_spanner (spanner)->get_bound (to_dir (dir))->self_scm (); + Item *bound = unsmob_spanner (spanner)->get_bound (to_dir (dir)); + return bound ? bound->self_scm () : SCM_EOL; +} + +LY_DEFINE (ly_spanner_set_bound_x, "ly:spanner-set-bound!", + 3, 0, 0, (SCM spanner, SCM dir, SCM item), + "Set grob @var{item} as bound in direction @var{dir} for" + " @var{spanner}.") +{ + LY_ASSERT_TYPE (unsmob_spanner, spanner, 1); + LY_ASSERT_TYPE (is_direction, dir, 2); + LY_ASSERT_TYPE (unsmob_item, item, 3); + + unsmob_spanner (spanner)->set_bound (to_dir (dir), unsmob_item (item)); + return SCM_UNSPECIFIED; } /* TODO: maybe we should return a vector -- random access is more