WEB: Found more hardcoded names, yay! Fix linking to essay, images in essay.
[lilypond/patrick.git] / lily / skyline-pair.cc
blob61573ee01d65508baaa592542597b91a491bd024
1 /*
2 skyline-pair.cc -- implement Skyline_pair
4 source file of the GNU LilyPond music typesetter
6 (c) 2008--2009 Han-Wen Nienhuys <hanwen@lilypond.org>
8 */
10 #include "skyline-pair.hh"
12 #include "ly-smobs.icc"
14 Skyline_pair::Skyline_pair ()
15 : skylines_ (Skyline (DOWN), Skyline (UP))
19 Skyline_pair::Skyline_pair (vector<Box> const &boxes, Real padding, Axis a)
20 : skylines_ (Skyline (boxes, padding, a, DOWN), Skyline (boxes, padding, a, UP))
24 Skyline_pair::Skyline_pair (Box const &b, Real padding, Axis a)
25 : skylines_ (Skyline (b, padding, a, DOWN), Skyline (b, padding, a, UP))
29 void
30 Skyline_pair::raise (Real r)
32 skylines_[UP].raise (r);
33 skylines_[DOWN].raise (r);
36 void
37 Skyline_pair::shift (Real r)
39 skylines_[UP].shift (r);
40 skylines_[DOWN].shift (r);
43 void
44 Skyline_pair::insert (Box const &b, Real padding, Axis a)
46 skylines_[UP].insert (b, padding, a);
47 skylines_[DOWN].insert (b, padding, a);
50 void
51 Skyline_pair::merge (Skyline_pair const &other)
53 skylines_[UP].merge (other[UP]);
54 skylines_[DOWN].merge (other[DOWN]);
57 void
58 Skyline_pair::print () const
60 skylines_[UP].print ();
61 skylines_[DOWN].print ();
64 void
65 Skyline_pair::print_points () const
67 skylines_[UP].print ();
68 skylines_[DOWN].print ();
72 bool
73 Skyline_pair::is_empty () const
75 return skylines_[UP].is_empty ()
76 && skylines_[DOWN].is_empty ();
79 Skyline&
80 Skyline_pair::operator [] (Direction d)
82 return skylines_[d];
85 Skyline const&
86 Skyline_pair::operator [] (Direction d) const
88 return skylines_[d];
91 IMPLEMENT_SIMPLE_SMOBS (Skyline_pair);
92 IMPLEMENT_TYPE_P (Skyline_pair, "ly:skyline-pair?");
93 IMPLEMENT_DEFAULT_EQUAL_P (Skyline_pair);
95 SCM
96 Skyline_pair::mark_smob (SCM)
98 return SCM_EOL;
102 Skyline_pair::print_smob (SCM s, SCM port, scm_print_state *)
104 Skyline_pair *r = (Skyline_pair *) SCM_CELL_WORD_1 (s);
105 (void) r;
107 scm_puts ("#<Skyline-pair>", port);
108 return 1;