]> git.donarmstrong.com Git - lilypond.git/blob - lily/clef-item.cc
f0a8b8566f9d8175ae8bd1b423f2a4798ca33873
[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 "paper-def.hh"
14 #include "lookup.hh"
15 #include "text-item.hh"
16 #include "paper-score.hh"
17 #include "dimension-cache.hh"
18 #include "side-position-interface.hh"
19 #include "warn.hh"
20 #include "line-of-score.hh"
21
22 void
23 Clef_item::before_line_breaking ()
24 {
25   SCM style_sym =get_elt_property ("style");
26   String style;
27   if (gh_string_p (style_sym))
28     style = ly_scm2string (style_sym);
29
30   SCM glyph = get_elt_property ("glyph");
31   if (gh_string_p (glyph))
32     {
33       String s = ly_scm2string (glyph);
34         
35       if (break_status_dir() != RIGHT && style != "fullSizeChanges")
36         {
37           s += "_change";
38         }
39       s = "clefs-" +  s;
40       set_elt_property ("glyph", ly_str02scm (s.ch_C()));
41     }
42   else
43     {
44       set_elt_property ("transparent", SCM_BOOL_T);
45     }
46   
47   if (style == "transparent")   // UGH. JUNKME
48     {
49       set_elt_property ("transparent", SCM_BOOL_T);
50       set_extent_callback (0, X_AXIS);
51     }
52 }
53
54
55