int
System::element_count () const
{
- return scm_ilength (get_grob_property ("all-elements"));
+ return scm_ilength (get_property ("all-elements"));
}
int
System::spanner_count () const
{
int k =0;
- for (SCM s = get_grob_property ("all-elements");
+ for (SCM s = get_property ("all-elements");
gh_pair_p (s); s = ly_cdr (s))
{
- if (dynamic_cast<Spanner*> (unsmob_grob (gh_car(s))))
+ if (dynamic_cast<Spanner*> (unsmob_grob (gh_car (s))))
k++;
}
int len = scm_ilength (l);
SCM * arr = new SCM[len];
int k = 0;
- for (SCM s =l ; SCM_NNULLP (s); s = SCM_CDR(s))
- arr[k++] = SCM_CAR(s);
+ for (SCM s =l ; SCM_NNULLP (s); s = SCM_CDR (s))
+ arr[k++] = SCM_CAR (s);
assert (k == len);
qsort (arr, len, sizeof (SCM), &scm_default_compare);
if (i && arr[i] == arr[i-1])
continue;
- SCM_SETCAR(s, arr[i]);
+ SCM_SETCAR (s, arr[i]);
if (i < len - 1)
- s = SCM_CDR(s);
+ s = SCM_CDR (s);
}
- SCM_SETCDR(s, SCM_EOL);
- delete arr;
+ SCM_SETCDR (s, SCM_EOL);
+ delete[] arr;
return l;
}
void
System::output_lines ()
{
- for (SCM s = get_grob_property ("all-elements");
+ for (SCM s = get_property ("all-elements");
gh_pair_p (s); s = ly_cdr (s))
{
Grob * g = unsmob_grob (ly_car (s));
Kill no longer needed grobs.
*/
Item * it = dynamic_cast<Item*> (g);
- if (it && Item::breakable_b(it))
+ if (it && Item::is_breakable (it))
{
- it->find_prebroken_piece (LEFT)->suicide();
- it->find_prebroken_piece (RIGHT)->suicide();
+ it->find_prebroken_piece (LEFT)->suicide ();
+ it->find_prebroken_piece (RIGHT)->suicide ();
}
g->suicide ();
}
for (int i=0; i < broken_intos_.size (); i++)
{
Grob *se = broken_intos_[i];
- SCM all = se->get_grob_property ("all-elements");
+ SCM all = se->get_property ("all-elements");
for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
{
fixup_refpoint (ly_car (s));
/*
needed for doing items.
*/
- fixup_refpoints (get_grob_property ("all-elements"));
+ fixup_refpoints (get_property ("all-elements"));
- for (SCM s = get_grob_property ("all-elements");
+ for (SCM s = get_property ("all-elements");
gh_pair_p (s); s = ly_cdr (s))
{
unsmob_grob (ly_car (s))->handle_broken_dependencies ();
handle_broken_dependencies ();
/*
- Because the this->get_grob_property (all-elements) contains items
+ Because the this->get_property (all-elements) contains items
in 3 versions, handle_broken_dependencies () will leave duplicated
items in all-elements. Strictly speaking this is harmless, but it
- leads to duplicated symbols in the output. uniquify_list() makes
+ leads to duplicated symbols in the output. uniquify_list () makes
sure that no duplicates are in the list.
*/
for (int i=0; i < broken_intos_.size (); i++)
/*
don't do this: strange side effects.
*/
- // SCM al = broken_intos_[i]->get_grob_property ("all-elements");
+ // SCM al = broken_intos_[i]->get_property ("all-elements");
// al = uniquify_list (al);
}
if (i < broken_intos_.size () - 1)
{
- SCM lastcol = ly_car (system->get_grob_property ("columns"));
+ SCM lastcol = ly_car (system->get_property ("columns"));
Grob* e = unsmob_grob (lastcol);
SCM between = ly_symbol2scm ("between-system-string");
- SCM inter = e->internal_get_grob_property (between);
+ SCM inter = e->internal_get_property (between);
if (gh_string_p (inter))
{
pscore_->outputter_
Item * right = 0;
do
{
- SCM between = loose->get_grob_property ("between-cols");
+ SCM between = loose->get_property ("between-cols");
if (!gh_pair_p (between))
break;
*/
Grob * common = right->common_refpoint (left, X_AXIS);
- Real rx = right->extent(common, X_AXIS)[LEFT];
- Real lx = left->extent(common, X_AXIS)[RIGHT];
+ Real rx = right->extent (common, X_AXIS)[LEFT];
+ Real lx = left->extent (common, X_AXIS)[RIGHT];
Real total_dx = rx - lx;
Interval cval =col->extent (col, X_AXIS);
System::add_column (Paper_column*p)
{
Grob *me = this;
- SCM cs = me->get_grob_property ("columns");
+ SCM cs = me->get_property ("columns");
Grob * prev = gh_pair_p (cs) ? unsmob_grob (ly_car (cs)) : 0;
p->rank_ = prev ? Paper_column::get_rank (prev) + 1 : 0;
- me->set_grob_property ("columns", gh_cons (p->self_scm (), cs));
+ me->set_property ("columns", gh_cons (p->self_scm (), cs));
Axis_group_interface::add_element (me, p);
}
void
System::pre_processing ()
{
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->discretionary_processing ();
if (verbose_global_b)
progress_indication (_f ("Grob count %d ", element_count ()));
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
unsmob_grob (ly_car (s))->handle_prebroken_dependencies ();
- fixup_refpoints (get_grob_property ("all-elements"));
+ fixup_refpoints (get_property ("all-elements"));
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
{
Grob* sc = unsmob_grob (ly_car (s));
sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
}
progress_indication ("\n" + _ ("Calculating line breaks...") + " ");
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * e = unsmob_grob (ly_car (s));
- SCM proc = e->get_grob_property ("spacing-procedure");
+ SCM proc = e->get_property ("spacing-procedure");
if (gh_procedure_p (proc))
gh_call1 (proc, e->self_scm ());
}
void
System::post_processing (bool last_line)
{
- for (SCM s = get_grob_property ("all-elements");
+ for (SCM s = get_property ("all-elements");
gh_pair_p (s); s = ly_cdr (s))
{
Grob* sc = unsmob_grob (ly_car (s));
/*
generate all stencils to trigger all font loads.
-
- (ugh. This is not very memory efficient.) */
-
- SCM all = get_grob_property ("all-elements") ;
+ */
+ SCM all = get_property ("all-elements") ;
all = uniquify_list (all);
/*
- triger font loads first.
+ trigger font loads first.
This might seem inefficient, but Stencils are cached per grob
anyway.
*/
- this->get_stencil();
+ this->get_stencil ();
for (SCM s = all; gh_pair_p (s); s = ly_cdr (s))
{
Grob * g = unsmob_grob (ly_car (s));
/* Output elements in three layers, 0, 1, 2.
The default layer is 1. */
{
- Stencil *m = this->get_stencil();
+ Stencil *m = this->get_stencil ();
if (m)
- output_stencil (m->get_expr (), Offset(0,0));
+ output_stencil (m->get_expr (), Offset (0,0));
}
for (int i = 0; i < 3; i++)
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s);
+ for (SCM s = get_property ("all-elements"); gh_pair_p (s);
s = ly_cdr (s))
{
Grob *sc = unsmob_grob (ly_car (s));
if (!m)
continue;
- SCM s = sc->get_grob_property ("layer");
+ SCM s = sc->get_property ("layer");
int layer = gh_number_p (s) ? gh_scm2int (s) : 1;
if (layer != i)
continue;
Offset o (sc->relative_coordinate (this, X_AXIS),
sc->relative_coordinate (this, Y_AXIS));
- SCM e = sc->get_grob_property ("extra-offset");
+ SCM e = sc->get_property ("extra-offset");
if (gh_pair_p (e))
{
Offset z = ly_scm2offset (e);
l = l->get_column ();
r = r->get_column ();
- SCM s = get_grob_property ("columns");
+ SCM s = get_property ("columns");
while (gh_pair_p (s) && ly_car (s) != r->self_scm ())
s = ly_cdr (s);
while (gh_pair_p (s) && ly_car (s) != l->self_scm ())
{
Paper_column*c = dynamic_cast<Paper_column*> (unsmob_grob (ly_car (s)));
- if (Item::breakable_b (c) && !c->system_)
+ if (Item::is_breakable (c) && !c->system_)
ret.push (c);
s = ly_cdr (s);
bool bfound = false;
for (int i= acs.size (); i -- ;)
{
- bool brb = Item::breakable_b (acs[i]);
+ bool brb = Item::is_breakable (acs[i]);
bfound = bfound || brb;
/*
ADD_INTERFACE (System,"system-interface",
- "Super grob, parent of all: "
-"\n\n"
-"The columns of a score that form one line. The toplevel grob. Any "
-"grob has a Line_of_score as both X and Y reference point. The "
-"Paper_score contains one grob of this type. Control enters the "
-"Grob dependency calculation from this single Line_of_score "
-"object.",
- "between-system-string all-elements columns");
+ "This is the toplevel object: each object in a score "
+ "ultimately has a System object as its X and Y parent. "
+ ,
+ "between-system-string all-elements columns");