2 clef-item.cc -- implement Clef_item
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "clef-item.hh"
12 #include "molecule.hh"
13 #include "paper-def.hh"
15 #include "clef-engraver.hh"
16 #include "text-item.hh"
19 Clef_item::do_pre_processing()
21 bool b
= (break_status_dir() != RIGHT
);
34 Clef_item::Clef_item()
43 // Ugh: This should be const, I guess.
44 octave_marker_td_p_
.set_p (new Text_def());// UGH!
45 octave_marker_td_p_
->text_str_
= "8";
46 octave_marker_td_p_
->style_str_
= "italic";
53 Clef_item::brew_molecule_p() const
58 Atom s
= lookup_l ()->clef (t
);
59 Molecule
*output
= new Molecule (Atom (s
));
60 output
->translate_axis (paper()->internote_f () * y_position_i_
, Y_AXIS
);
62 Molecule octave_marker
= Molecule(octave_marker_td_p_
->get_atom(paper(),
64 Real offset
= output
->extent()[Y_AXIS
][octave_dir_
]
65 - octave_marker
.extent()[Y_AXIS
][- octave_dir_
];
66 if (octave_dir_
== DOWN
)
67 offset
+= octave_marker
.extent()[Y_AXIS
][UP
] * 0.35 ;
68 octave_marker
.translate_axis (offset
, Y_AXIS
);
69 output
->add_molecule (octave_marker
);
77 #include "pointer.tcc"
78 template class P
<Text_def
>; // ugh