/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1996--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1996--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
LilyPond is free software: you can redistribute it and/or modify
DECLARE_SCHEME_CALLBACK (calc_y_offset, (SCM));
DECLARE_SCHEME_CALLBACK (pure_calc_y_offset, (SCM, SCM, SCM));
DECLARE_SCHEME_CALLBACK (calc_x_offset, (SCM));
- DECLARE_GROB_INTERFACE ();
static SCM internal_calc_y_offset (SCM smob, bool pure);
};
SCM
Flag::width (SCM smob)
{
- Grob *me = unsmob_grob (smob);
- Stencil *sten = unsmob_stencil (me->get_property ("stencil"));
+ Grob *me = unsmob<Grob> (smob);
+ Stencil *sten = unsmob<Stencil> (me->get_property ("stencil"));
if (!sten)
return ly_interval2scm (Interval (0.0, 0.0));
SCM
Flag::glyph_name (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = unsmob<Grob> (smob);
Grob *stem = me->get_parent (X_AXIS);
Direction d = get_grob_direction (stem);
char dir = (d == UP) ? 'u' : 'd';
string font_char = flag_style
- + to_string (dir) + staffline_offs + to_string (log);
+ + ::to_string (dir) + staffline_offs + ::to_string (log);
return ly_string2scm ("flags." + font_char);
}
SCM
Flag::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = unsmob<Grob> (smob);
Grob *stem = me->get_parent (X_AXIS);
Direction d = get_grob_direction (stem);
string stroke_style = ly_scm2string (stroke_style_scm);
if (!stroke_style.empty ())
{
- string font_char = flag_style + to_string (dir) + stroke_style;
+ string font_char = flag_style + ::to_string (dir) + stroke_style;
Stencil stroke = fm->find_by_name ("flags." + font_char);
if (stroke.is_empty ())
{
- font_char = to_string (dir) + stroke_style;
+ font_char = ::to_string (dir) + stroke_style;
stroke = fm->find_by_name ("flags." + font_char);
}
if (stroke.is_empty ())
SCM
Flag::internal_calc_y_offset (SCM smob, bool pure)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = unsmob<Grob> (smob);
Grob *stem = me->get_parent (X_AXIS);
Direction d = get_grob_direction (stem);
= me->layout ()->get_dimension (ly_symbol2scm ("blot-diameter"));
Interval stem_extent = pure
- ? stem->pure_height (stem, 0, INT_MAX)
+ ? stem->pure_y_extent (stem, 0, INT_MAX)
: stem->extent (stem, Y_AXIS);
return scm_from_double (stem_extent.is_empty ()
SCM
Flag::calc_x_offset (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = unsmob<Grob> (smob);
Grob *stem = me->get_parent (X_AXIS);
return scm_from_double (stem->extent (stem, X_AXIS)[RIGHT]);
}