lilypond-1.3.80
[lilypond.git] / lily / clef-item.cc
blob1b3adc4d4cd03aa9e2f2b39c850b7a686eb9ef77
1 /*
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>
7 */
10 #include "clef.hh"
11 #include "string.hh"
12 #include "molecule.hh"
13 #include "item.hh"
16 FIXME: should use symbol.
19 MAKE_SCHEME_CALLBACK(Clef,before_line_breaking);
20 SCM
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");
26 String 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);
37 FIXME: should use fontsize property to set clef changes.
39 if (s->get_elt_property ("non-default") &&
40 s->break_status_dir() != RIGHT && style != "fullSizeChanges")
42 str += "_change";
43 s->set_elt_property ("glyph", ly_str02scm (str.ch_C()));
46 else
48 s->suicide ();
49 return SCM_UNSPECIFIED;
52 return SCM_UNSPECIFIED;
55 bool
56 Clef::has_interface (Score_element* me)
58 return me->has_interface (ly_symbol2scm ("clef-interface"));
62 void
63 Clef::set_interface (Score_element* me)
65 me->set_interface (ly_symbol2scm ("clef-interface"));