source file of the GNU LilyPond music typesetter
- (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
TODO: This is way too hairy
#include "group-interface.hh"
#include "cross-staff.hh"
#include "staff-symbol-referencer.hh"
-#include "lily-guile.icc"
+
void
Drul_array<Note_head*> e (extremal_heads ());
- return Interval (staff_symbol_referencer_interface (e[DOWN]).position_f (),
- staff_symbol_referencer_interface( e[UP]).position_f ());
+ return Interval (staff_symbol_referencer (e[DOWN]).position_f (),
+ staff_symbol_referencer( e[UP]).position_f ());
}
{
Stem * me = (Stem*) this;
d = get_default_dir ();
+ // urg, AAARGH!
directional_element (me).set (d);
}
return d ;
set_elt_property ("heads", SCM_EOL);
set_elt_property ("rests", SCM_EOL);
- dim_cache_[X_AXIS]->off_callbacks_.push ( &Stem::off_callback);
+ add_offset_callback ( &Stem::off_callback, X_AXIS);
}
bool
return Direction (int(paper_l ()->get_var ("stem_default_neutral_direction")));
}
+/*
+ ugh. A is used for different purposes. This functionality should be
+ moved into scheme at some point to get rid of the silly
+ conversions. (but lets wait till we have namespaces in SCM)
+ */
Real
Stem::get_default_stem_end_position () const
{
}
else
{
- s = ly_eval_str (type_str + "stem-length");
- scm_to_array (s, &a);
+ s = scm_eval (ly_symbol2scm ((type_str + "stem-length").ch_C()));
+ for (SCM q = s; q != SCM_EOL; q = gh_cdr (q))
+ a.push (gh_scm2double (gh_car (q)));
+
// stem uses half-spaces
length_f = a[((flag_i () - 2) >? 0) <? (a.size () - 1)] * 2;
}
- s = ly_eval_str (type_str + "stem-shorten");
- scm_to_array (s, &a);
+ a.clear ();
+ s = scm_eval (ly_symbol2scm ((type_str + "stem-shorten").ch_C()));
+ for (SCM q = s; q != SCM_EOL; q = gh_cdr (q))
+ a.push (gh_scm2double (gh_car (q)));
+
// stem uses half-spaces
}
void
-Stem::do_pre_processing ()
+Stem::before_line_breaking ()
{
stem_end_position (); // ugh. Trigger direction calc.
position_noteheads ();
if (invisible_b ())
{
set_elt_property ("transparent", SCM_BOOL_T);
- set_empty (Y_AXIS);
- set_empty (X_AXIS);
+ set_extent_callback (0, Y_AXIS);
+ set_extent_callback (0, X_AXIS);
}
set_spacing_hints ();
const Real ANGLE = 20* (2.0*M_PI/360.0); // ugh!
-Molecule*
-Stem::do_brew_molecule_p () const
+Molecule
+Stem::do_brew_molecule () const
{
- Molecule *mol_p =new Molecule;
+ Molecule mol;
Staff_symbol_referencer_interface si (first_head ());
Interval stem_y(y1,y2);
stem_y.unite (Interval (y2,y1));
- Real dy = staff_symbol_referencer_interface (this)
- .staff_space ()/2.0;
-
+ Real dy = staff_symbol_referencer (this).staff_space ()/2.0;
Real head_wid = 0;
if (support_head ())
head_wid = support_head ()->extent (X_AXIS).length ();
Real stem_width = paper_l ()->get_var ("stemthickness");
Molecule ss =lookup_l ()->filledbox (Box (Interval (-stem_width/2, stem_width/2),
Interval (stem_y[DOWN]*dy, stem_y[UP]*dy)));
- mol_p->add_molecule (ss);
+ mol.add_molecule (ss);
}
if (!beam_l () && abs (flag_i ()) > 2)
{
Molecule fl = flag ();
fl.translate_axis(stem_y[get_direction ()]*dy, Y_AXIS);
- mol_p->add_molecule (fl);
+ mol.add_molecule (fl);
}
- return mol_p;
+ return mol;
}
Real
SCM s;
String type_str = grace_b ? "grace-" : "";
- s = ly_eval_str (type_str + "beamed-stem-minimum-length");
- scm_to_array (s, &a);
+ s = scm_eval (ly_symbol2scm ((type_str + "beamed-stem-minimum-length").ch_C()));
+ a.clear ();
+ for (SCM q = s; q != SCM_EOL; q = gh_cdr (q))
+ a.push (gh_scm2double (gh_car (q)));
+
+
Real minimum_length = a[multiplicity <? (a.size () - 1)] * staff_space;
+ s = scm_eval (ly_symbol2scm ((type_str + "beamed-stem-length").ch_C()));
+
+ a.clear();
+ for (SCM q = s; q != SCM_EOL; q = gh_cdr (q))
+ a.push (gh_scm2double (gh_car (q)));
- s = ly_eval_str (type_str + "beamed-stem-length");
- scm_to_array (s, &a);
Real stem_length = a[multiplicity <? (a.size () - 1)] * staff_space;
if (!beam_dir || (beam_dir == directional_element (this).get ()))