2 span-bar.cc -- implement Span_bar
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 #include "dimension-cache.hh"
11 #include "dimensions.hh"
12 #include "paper-def.hh"
13 #include "molecule.hh"
15 #include "axis-group-interface.hh"
16 #include "group-interface.hh"
19 Span_bar::add_bar (Score_element*b)
21 Pointer_group_interface gi (this);
29 Span_bar::width_callback (Score_element const *se, Axis )
31 Span_bar* s= dynamic_cast<Span_bar*> ((Score_element*)se);
32 String gl = ly_scm2string (s->get_elt_property ("glyph"));
37 Molecule m = s->compound_barline (gl, 40 PT);
39 return m.extent (X_AXIS);
43 Span_bar::before_line_breaking ()
45 Bar::before_line_breaking ();
51 Span_bar::after_line_breaking ()
53 Bar::after_line_breaking ();
54 Interval i (get_spanned_interval ());
55 translate_axis (i.center (), Y_AXIS);
59 Span_bar::evaluate_empty ()
61 if (!gh_pair_p (get_elt_pointer ("elements")))
66 SCM gl = get_elt_property ("glyph");
67 if (!gh_string_p (gl))
73 String type_str = ly_scm2string (gl);
74 String orig = type_str;
79 else if (type_str== ":|")
83 else if (type_str== ":|:")
88 set_elt_property ("glyph", ly_str02scm (type_str.ch_C()));
93 Span_bar::get_spanned_interval () const
95 return Axis_group_interface::group_extent_callback (this, Y_AXIS);
100 Span_bar::get_bar_size () const
102 Interval iv (get_spanned_interval ());
105 programming_error("Huh? My children deflated (FIXME)");
111 Span_bar::Span_bar (SCM s)
114 Pointer_group_interface(this).set_interface ();
115 set_extent_callback (width_callback, X_AXIS);
117 // dim_cache_[Y_AXIS]->set_extent_callback (Axis_group_interface::group_extent_callback);
119 set_extent_callback (0, Y_AXIS);