]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/paper-system.cc
Show how to properly support the Gonville font.
[lilypond.git] / lily / paper-system.cc
index d5e8b914bac08c0ec240bca7b34646fd24adac54..c96e412d8a36b2ae8576bf3ee8b0d682bc9f4485 100644 (file)
@@ -1,41 +1,44 @@
 /*
-  paper-system.cc -- implement Paper_system
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2004--2010 Jan Nieuwenhuizen <janneke@gnu.org>
 
-  (c) 2004--2006 Jan Nieuwenhuizen <janneke@gnu.org>
+  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 "paper-system.hh"
 #include "item.hh"
 
-Paper_system::Paper_system (Stencil s, SCM immutable_init)
-  : Prob (immutable_init)
+Prob *
+make_paper_system (SCM immutable_init)
+{
+  Prob *prob = new Prob (ly_symbol2scm ("paper-system"), immutable_init);
+  return prob;
+}
+
+void
+paper_system_set_stencil (Prob *prob, Stencil s)
 {
-  SCM yext = get_property ("Y-extent");
+  SCM yext = prob->get_property ("Y-extent");
 
   if (is_number_pair (yext))
     {
-      
-      Box b = s.extent_box();
+      Box b = s.extent_box ();
       b[Y_AXIS] = ly_scm2interval (yext);
 
       s = Stencil (b, s.expr ());
     }
 
-  set_property ("stencil", s.smobbed_copy ());
-}
-
-Paper_system *
-unsmob_paper_system (SCM x)
-{
-  Prob *prob = unsmob_prob (x);
-  return dynamic_cast<Paper_system*> (prob);
-}
-
-LY_DEFINE(ly_paper_system_p, "ly:paper-system?",
-         1,0,0, (SCM obj),
-         "Type predicate.")
-{
-  return scm_from_bool (unsmob_paper_system (obj));
+  prob->set_property ("stencil", s.smobbed_copy ());
 }