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>
10 #include "clef-item.hh"
12 #include "molecule.hh"
13 #include "paper-def.hh"
15 #include "text-item.hh"
16 #include "paper-score.hh"
17 #include "dimension-cache.hh"
18 #include "side-position-interface.hh"
20 #include "line-of-score.hh"
23 Clef_item::before_line_breaking ()
25 SCM style_sym =get_elt_property ("style");
27 if (gh_string_p (style_sym))
28 style = ly_scm2string (style_sym);
30 SCM glyph = get_elt_property ("glyph");
31 if (gh_string_p (glyph))
33 String s = ly_scm2string (glyph);
35 if (break_status_dir() != RIGHT && style != "fullSizeChanges")
40 set_elt_property ("glyph", ly_str02scm (s.ch_C()));
44 set_elt_property ("transparent", SCM_BOOL_T);
47 if (style == "transparent") // UGH. JUNKME
49 set_elt_property ("transparent", SCM_BOOL_T);
50 set_extent_callback (0, X_AXIS);
56 Clef_item::do_add_processing ()
58 if (!break_status_dir ()) // broken stuff takes care of their own texts
62 SCM octave_dir = remove_elt_property ("octave-dir");
63 if (isdir_b (octave_dir))
66 Side_position_interface spi (g);
67 spi.set_axis (Y_AXIS);
69 pscore_l_->line_l_->typeset_element (g);
71 spi.add_support (this);
72 g->set_elt_property ("text", ly_str02scm ( "8"));
73 g->set_elt_property ("style", gh_str02scm ("italic"));
74 g->set_parent (this, Y_AXIS);
75 g->set_parent (this, X_AXIS);
77 g->set_elt_property ("self-alignment-X", gh_int2scm (0));
78 g->add_offset_callback (Side_position_interface::aligned_on_self, X_AXIS);
79 g->add_offset_callback (Side_position_interface::centered_on_parent, X_AXIS);
81 g->set_elt_property ("direction", octave_dir);
83 add_dependency (g); // just to be sure.
84 SCM my_vis = get_elt_property ("visibility-lambda");
85 if (gh_procedure_p (my_vis))
86 g->set_elt_property ("visibility-lambda", my_vis);