source file of the GNU LilyPond music typesetter
- (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "separation-item.hh"
+
#include "paper-column.hh"
#include "warn.hh"
#include "group-interface.hh"
Paper_column * pc = item->get_column ();
- for (SCM s = me->get_grob_property ("conditional-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("conditional-elements"); scm_is_pair (s); s = scm_cdr (s))
{
- SCM elt = ly_car (s);
+ SCM elt = scm_car (s);
if (!unsmob_grob (elt))
continue;
continue; /*UGH UGH*/
}
- if (to_boolean (il->get_grob_property ("no-spacing-rods")))
+ if (to_boolean (il->get_property ("no-spacing-rods")))
{
continue;
}
}
}
- SCM pad = me->get_grob_property ("padding");
+ SCM pad = me->get_property ("padding");
- if (gh_number_p (pad))
- {
- w[RIGHT] += gh_scm2double (pad)/2;
- w[LEFT] -= gh_scm2double (pad)/2;
- }
+ w.widen (robust_scm2double (pad, 0.0));
return w;
}
Interval
Separation_item::width (Grob *me)
{
- SCM sw = me->get_grob_property ("X-extent");
+ SCM sw = me->get_property ("X-extent");
if (is_number_pair (sw))
{
return ly_scm2interval (sw);
Paper_column * pc = item->get_column ();
Interval w;
- for (SCM s = me->get_grob_property ("elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = me->get_property ("elements"); scm_is_pair (s); s = scm_cdr (s))
{
- SCM elt = ly_car (s);
+ SCM elt = scm_car (s);
if (!unsmob_grob (elt))
continue;
continue; /*UGH UGH*/
}
- if (to_boolean (il->get_grob_property ("no-spacing-rods")))
+ if (to_boolean (il->get_property ("no-spacing-rods")))
{
continue;
}
}
}
- SCM pad = me->get_grob_property ("padding");
+ SCM pad = me->get_property ("padding");
- if (gh_number_p (pad))
- {
- w[RIGHT] += gh_scm2double (pad)/2;
- w[LEFT] -= gh_scm2double (pad)/2;
- }
+ w.widen (robust_scm2double (pad, 0.0));
- me->set_grob_property ("X-extent", ly_interval2scm (w));
+ me->set_property ("X-extent", ly_interval2scm (w));
return w;
}
Grob *col = dynamic_cast<Item*> (separation_item)->get_column ();
last_ext->set_empty ();
Grob *last_grob = 0;
- for (SCM s = separation_item->get_grob_property ("elements");
- gh_pair_p (s); s = gh_cdr (s))
+ for (SCM s = separation_item->get_property ("elements");
+ scm_is_pair (s); s = scm_cdr (s))
{
- Grob * break_item = unsmob_grob (gh_car (s));
+ Grob * break_item = unsmob_grob (scm_car (s));
- if (!gh_symbol_p (break_item->get_grob_property ("break-align-symbol")))
+ if (!scm_is_symbol (break_item->get_property ("break-align-symbol")))
continue;
Interval ext = break_item->extent (col, X_AXIS);
ADD_INTERFACE (Separation_item,"separation-item-interface",
- "Item that computes widths to generate spacing rods.\n"
-"\n"
-"Calculate dimensions for the Separating_group_spanner; this has to be "
-"an item to get dependencies correct. "
-, "padding X-extent conditional-elements elements");
+ "Item that computes widths to generate spacing rods. "
+ "This is done in concert with @ref{separation-spanner-interface}."
+
+ ,
+
+ "padding X-extent conditional-elements elements");