]> git.donarmstrong.com Git - lilypond.git/blob - lily/paper-system.cc
*** empty log message ***
[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--2005 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "paper-system.hh"
10
11 #include "virtual-methods.hh"
12
13 #include "ly-smobs.icc"
14
15 IMPLEMENT_SMOBS (Paper_system);
16 IMPLEMENT_TYPE_P (Paper_system, "ly:paper-system?");
17 IMPLEMENT_DEFAULT_EQUAL_P (Paper_system);
18
19
20
21 Paper_system::Paper_system (Stencil s, bool is_title)
22 {
23   is_title_ = is_title;
24   number_ = 0;
25   break_before_penalty_ = 0;
26   smobify_self ();
27   stencil_ = s;
28   staff_refpoints_ = Interval(0,0);
29 }
30
31 Paper_system::~Paper_system ()
32 {
33 }
34
35 SCM
36 Paper_system::mark_smob (SCM smob)
37 {
38   Paper_system *system = (Paper_system*) SCM_CELL_WORD_1 (smob);
39   return system-> stencil_.expr ();
40 }
41
42 int
43 Paper_system::print_smob (SCM smob, SCM port, scm_print_state*)
44 {
45   Paper_system *p = (Paper_system*) SCM_CELL_WORD_1 (smob);
46   scm_puts ("#<", port);
47   scm_puts (classname (p), port);
48   scm_puts (" ", port);
49   scm_puts (to_string (p->number_).to_str0 (), port);
50   scm_puts ("p ", port);
51   scm_puts (to_string (p->break_before_penalty_).to_str0 (), port);
52   if (p->is_title ())
53     scm_puts (" t", port);
54   scm_puts (" >", port);
55   return 1;
56 }
57
58 bool
59 Paper_system::is_title () const
60 {
61   return is_title_;
62 }
63
64 Real
65 Paper_system::break_before_penalty () const
66 {
67   return break_before_penalty_;
68 }
69
70 Stencil
71 Paper_system::to_stencil () const
72 {
73   return stencil_;
74 }