]> git.donarmstrong.com Git - lilypond.git/blob - lily/clef-item.cc
release: 1.3.55
[lilypond.git] / lily / clef-item.cc
1 /*
2   clef-item.cc -- implement Clef_item
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #include "clef-item.hh"
11 #include "string.hh"
12 #include "molecule.hh"
13 #include "text-item.hh"
14
15 Clef_item::Clef_item (SCM s)
16   : Item (s)
17 {}
18
19 void
20 Clef_item::before_line_breaking ()
21 {
22   SCM style_sym =get_elt_property ("style");
23   String style;
24   if (gh_string_p (style_sym))
25     style = ly_scm2string (style_sym);
26
27   SCM glyph = get_elt_property ("glyph");
28   
29   /*
30     FIXME: should use symbol.
31    */
32   if (gh_string_p (glyph))
33     {
34       String s = ly_scm2string (glyph);
35
36       /*
37         FIXME: should use fontsize property to set clef changes.
38        */
39       if (break_status_dir() != RIGHT && style != "fullSizeChanges")
40         {
41           s += "_change";
42         }
43       s = "clefs-" +  s;
44       set_elt_property ("glyph", ly_str02scm (s.ch_C()));
45     }
46   else
47     {
48       set_elt_property ("transparent", SCM_BOOL_T);
49     }
50   
51   if (style == "transparent")   // UGH. JUNKME
52     {
53       set_elt_property ("transparent", SCM_BOOL_T);
54       set_extent_callback (0, X_AXIS);
55     }
56 }
57
58
59