/*
- bar.cc -- implement Bar
+ bar-line.cc -- implement Bar_line
source file of the GNU LilyPond music typesetter
(c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "bar-line.hh"
+
#include <math.h>
-#include "bar-line.hh"
+#include "all-font-metrics.hh"
+#include "font-interface.hh"
#include "lookup.hh"
-#include "paper-column.hh"
#include "output-def.hh"
-#include "font-interface.hh"
-#include "all-font-metrics.hh"
+#include "paper-column.hh"
#include "staff-symbol-referencer.hh"
MAKE_SCHEME_CALLBACK (Bar_line, print, 1);
SCM s = me->get_property ("glyph");
SCM barsiz_proc = me->get_property ("bar-size-procedure");
- if (scm_is_string (s) && ly_c_procedure_p (barsiz_proc))
+ if (scm_is_string (s) && ly_is_procedure (barsiz_proc))
{
String str = ly_scm2string (s);
SCM siz = scm_call_1 (barsiz_proc, me->self_scm ());
if (sz <= 0)
return SCM_EOL;
- return compound_barline (me, str, sz).smobbed_copy ();
+ return compound_barline (me, str, sz, false).smobbed_copy ();
}
return SCM_EOL;
}
Stencil
-Bar_line::compound_barline (Grob *me, String str, Real h)
+Bar_line::compound_barline (Grob *me, String str, Real h,
+ bool rounded)
{
Real kern = robust_scm2double (me->get_property ("kern"), 1);
Real thinkern = robust_scm2double (me->get_property ("thin-kern"), 1);
hair *= staffline;
fatline *= staffline;
- Stencil thin = simple_barline (me, hair, h);
- Stencil thick = simple_barline (me, fatline, h);
+ Stencil thin = simple_barline (me, hair, h, rounded);
+ Stencil thick = simple_barline (me, fatline, h, rounded);
Stencil dot = Font_interface::get_default_font (me)->find_by_name ("dots.dot");
int lines = Staff_symbol_referencer::line_count (me);
Real y = (- (c - 1.0) / 2 + 0.5 + i * staff_space);
Stencil d (dot);
- d. translate_axis (y, Y_AXIS);
+ d.translate_axis (y, Y_AXIS);
m.add_stencil (d);
}
}
Stencil
Bar_line::simple_barline (Grob *me,
Real w,
- Real h)
+ Real h,
+ bool rounded)
{
- Real blot = me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"));
+ Real blot
+ = rounded
+ ? me->get_layout ()->get_dimension (ly_symbol2scm ("blotdiameter"))
+ : 0.0;
- return Lookup::round_filled_box (Box (Interval (0, w), Interval (-h / 2, h / 2)), blot);
+ return Lookup::round_filled_box (Box (Interval (0, w),
+ Interval (-h / 2, h / 2)), blot);
}
MAKE_SCHEME_CALLBACK (Bar_line, before_line_breaking, 1);
// leave y_extent for spanbar?
}
- if (! ly_c_equal_p (g, orig))
+ if (! ly_is_equal (g, orig))
me->set_property ("glyph", g);
return SCM_UNSPECIFIED;
}
-
MAKE_SCHEME_CALLBACK (Bar_line, get_staff_bar_size, 1);
SCM
Bar_line::get_staff_bar_size (SCM smob)
Real ss = Staff_symbol_referencer::staff_space (me);
SCM size = me->get_property ("bar-size");
if (scm_is_number (size))
- return scm_make_real (scm_to_double (size)*ss);
+ return scm_make_real (scm_to_double (size) * ss);
else if (Staff_symbol_referencer::get_staff_symbol (me))
{
/*
ysize = ysize * ss + Staff_symbol_referencer::line_thickness (me);
return scm_make_real (ysize);
}
- else
- return scm_int2num (0);
+ return scm_int2num (0);
}
ADD_INTERFACE (Bar_line, "bar-line-interface",