]> git.donarmstrong.com Git - lilypond.git/blob - lily/clef-item.cc
release: 1.3.62
[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 "item.hh"
14
15 Clef_item::Clef_item (SCM s)
16   : Item (s)
17 {}
18
19
20 /*
21 FIXME: should use symbol.
22
23 FIXME: this should be schemified.
24 */
25 GLUE_SCORE_ELEMENT(Clef_item,before_line_breaking);
26 SCM
27 Clef_item::member_before_line_breaking ()
28 {
29   SCM style_sym =get_elt_property ("style");
30   String style;
31   if (gh_string_p (style_sym))
32     style = ly_scm2string (style_sym);
33
34   SCM glyph = get_elt_property ("glyph");
35   
36   if (gh_string_p (glyph))
37     {
38       String s = ly_scm2string (glyph);
39
40       /*
41         FIXME: should use fontsize property to set clef changes.
42        */
43       if (get_elt_property ("non-default") &&
44           break_status_dir() != RIGHT && style != "fullSizeChanges")
45         {
46           s += "_change";
47           set_elt_property ("glyph", ly_str02scm (s.ch_C()));     
48         }
49     }
50   else
51     {
52       suicide ();
53       return SCM_UNDEFINED;
54     }
55
56   // ugh.
57   /* why not suicide? */
58   if (style == "transparent")   // UGH. JUNKME
59     {
60       set_elt_property ("molecule-callback", SCM_BOOL_T);
61       set_extent_callback (0, X_AXIS);
62     }
63
64   return SCM_UNDEFINED;
65 }
66
67
68