2 clef-item.cc -- implement Clef_item
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "molecule.hh"
14 #include "font-interface.hh"
17 FIXME: should use symbol for #'style.
19 MAKE_SCHEME_CALLBACK(Clef,before_line_breaking,1);
21 Clef::before_line_breaking (SCM smob)
23 Item * s = dynamic_cast<Item*> (unsmob_element (smob));
25 SCM style_sym =s->get_elt_property ("style");
27 if (gh_string_p (style_sym))
28 style = ly_scm2string (style_sym);
30 SCM glyph = s->get_elt_property ("glyph");
32 if (gh_string_p (glyph))
34 String str = ly_scm2string (glyph);
36 if (to_boolean (s->get_elt_property ("non-default")) &&
37 s->break_status_dir() != RIGHT &&
38 to_boolean (s->get_elt_property ("full-size-change")))
41 s->set_elt_property ("glyph", ly_str02scm (str.ch_C()));
47 return SCM_UNSPECIFIED;
50 return SCM_UNSPECIFIED;
54 Clef::has_interface (Score_element* me)
56 return me->has_interface (ly_symbol2scm ("clef-interface"));
61 Clef::set_interface (Score_element* me)
63 me->set_interface (ly_symbol2scm ("clef-interface"));
66 MAKE_SCHEME_CALLBACK(Clef,brew_molecule,1)
68 Clef::brew_molecule (SCM smob)
70 Score_element * sc = unsmob_element (smob);
71 SCM glyph = sc->get_elt_property ("glyph");
72 if (gh_string_p (glyph))
74 return Font_interface::get_default_font (sc)->find_by_name (String (ly_scm2string (glyph))).smobbed_copy ();