]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-system.cc
* lily/music.cc (derived_mark): derive Music from Prob.
[lilypond.git] / lily / paper-system.cc
1 /*
2   paper-system.cc -- implement Paper_system
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2004--2006 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "paper-system.hh"
10 #include "item.hh"
11
12 Paper_system::Paper_system (Stencil s, SCM immutable_init)
13   : Prob (immutable_init)
14 {
15   SCM yext = get_property ("Y-extent");
16
17   if (is_number_pair (yext))
18     {
19       
20       Box b = s.extent_box();
21       b[Y_AXIS] = ly_scm2interval (yext);
22
23       s = Stencil (b, s.expr ());
24     }
25
26   set_property ("stencil", s.smobbed_copy ());
27 }
28
29 Paper_system *
30 unsmob_paper_system (SCM x)
31 {
32   Prob *prob = unsmob_prob (x);
33   return dynamic_cast<Paper_system*> (prob);
34 }
35
36 LY_DEFINE(ly_paper_system_p, "ly:paper-system?",
37           1,0,0, (SCM obj),
38           "Type predicate.")
39 {
40   return scm_from_bool (unsmob_paper_system (obj));
41 }