Fix utility function `make-type-checker'.
[lilypond/mpolesky.git] / lily / paper-system.cc
blobc96e412d8a36b2ae8576bf3ee8b0d682bc9f4485
1 /*
2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2004--2010 Jan Nieuwenhuizen <janneke@gnu.org>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "paper-system.hh"
21 #include "item.hh"
23 Prob *
24 make_paper_system (SCM immutable_init)
26 Prob *prob = new Prob (ly_symbol2scm ("paper-system"), immutable_init);
27 return prob;
30 void
31 paper_system_set_stencil (Prob *prob, Stencil s)
33 SCM yext = prob->get_property ("Y-extent");
35 if (is_number_pair (yext))
37 Box b = s.extent_box ();
38 b[Y_AXIS] = ly_scm2interval (yext);
40 s = Stencil (b, s.expr ());
43 prob->set_property ("stencil", s.smobbed_copy ());