2 clef-item.cc -- implement Clef_item
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "clef-item.hh"
12 #include "molecule.hh"
13 #include "paper-def.hh"
15 #include "g-text-item.hh"
19 Clef_item::do_pre_processing()
21 dim_cache_[Y_AXIS]->translate (y_position_i_ * staff_line_leading_f () / 2.0);
22 SCM style_sym =get_elt_property (style_scm_sym);
24 if (style_sym != SCM_BOOL_F)
25 style = ly_scm2string (SCM_CDR(style_sym));
27 if (break_status_dir() != RIGHT && style != "fullSizeChanges")
29 if (style == "transparent")
31 set_elt_property (transparent_scm_sym, SCM_BOOL_T);
32 dim_cache_[X_AXIS]->set_empty (true);
39 Clef_item::Clef_item()
41 set_elt_property (breakable_scm_sym, SCM_BOOL_T);
48 Clef_item::do_add_processing ()
50 if (!break_status_dir ()) // broken stuff takes care of their own texts
54 SCM octave_dir = remove_elt_property (octave_dir_scm_sym);
55 if (octave_dir != SCM_BOOL_F)
57 Direction d = Direction (gh_scm2int (SCM_CDR(octave_dir)));
59 pscore_l_->typeset_element (g);
62 g->style_str_ = "italic";
63 g->dim_cache_[Y_AXIS]->parent_l_ = dim_cache_[Y_AXIS];
64 g->dim_cache_[X_AXIS]->parent_l_ = dim_cache_[X_AXIS];
65 add_dependency (g); // just to be sure.
67 Real r = do_height ()[d] - g->extent (Y_AXIS)[-d];
68 g->dim_cache_[Y_AXIS]->set_offset (r);
70 SCM my_vis = get_elt_property (visibility_lambda_scm_sym);
71 if (my_vis != SCM_BOOL_F)
72 g->set_elt_property (visibility_lambda_scm_sym, SCM_CDR (my_vis));
80 Clef_item::do_brew_molecule_p() const
82 Molecule*output = new Molecule (lookup_l ()->clef (symbol_));