]> git.donarmstrong.com Git - lilypond.git/blob - lily/breathing-sign.cc
release: 1.3.38
[lilypond.git] / lily / breathing-sign.cc
1 /*
2   breathing_sign.cc -- implement Breathing_sign
3
4   Copyright (C) 1999 Michael Krause
5
6   written for the GNU LilyPond music typesetter
7
8   TODO: --> see breathing-sign-engraver.cc
9
10 */
11 #include "staff-symbol-referencer.hh"
12 #include "directional-element-interface.hh"
13
14 #include "breathing-sign.hh"
15 #include "string.hh"
16 #include "molecule.hh"
17 #include "paper-def.hh"
18 #include "lookup.hh"
19 #include "debug.hh"
20 #include "dimensions.hh"
21 #include "direction.hh"
22
23
24 Breathing_sign::Breathing_sign ()
25 {
26   set_elt_property ("breakable", SCM_BOOL_T);
27 }
28
29 Molecule 
30 Breathing_sign::do_brew_molecule () const
31 {
32   Staff_symbol_referencer_interface si (this);
33   
34   Real space = si.staff_space();
35   Interval i1(0, space / 6), i2(-space / 2, space / 2);
36   Box b(i1, i2);
37
38   return lookup_l()->filledbox(b);
39 }
40
41 void
42 Breathing_sign::after_line_breaking ()
43 {
44   Real space = staff_symbol_referencer (this).staff_space();
45   Direction d = directional_element (this). get ();
46   if (!d)
47     {
48       d = UP;
49       directional_element(this).set (d);
50     }
51
52   translate_axis(2.0 * space * d, Y_AXIS);
53 }
54