}
-Line_of_score::Line_of_score(SCM s)
+Line_of_score::Line_of_score (SCM s)
: Spanner (s)
{
rank_i_ = 0;
int
Line_of_score::element_count () const
{
- return scm_ilength ( get_grob_property ("all-elements"));
+ return scm_ilength (get_grob_property ("all-elements"));
}
void
{
elem_p->pscore_l_ = pscore_l_;
Pointer_group_interface::add_element (this, "all-elements",elem_p);
- scm_unprotect_object (elem_p->self_scm ());
+ scm_gc_unprotect_object (elem_p->self_scm ());
}
void
handle_broken_dependencies ();
if (verbose_global_b)
- progress_indication ( _f("Element count %d.", count + element_count()));
+ progress_indication (_f ("Element count %d.", count + element_count ()));
for (int i=0; i < broken_into_l_arr_.size (); i++)
{
for (int i=0; i < breaking.size (); i++)
{
- Line_of_score *line_l = dynamic_cast <Line_of_score*> (clone());
+ Line_of_score *line_l = dynamic_cast <Line_of_score*> (clone ());
line_l->rank_i_ = i;
- // line_l->set_immutable_grob_property ("rank", gh_int2scm( i));
+ // line_l->set_immutable_grob_property ("rank", gh_int2scm (i));
Link_array<Grob> c (breaking[i].cols_);
pscore_l_->typeset_line (line_l);
- line_l->set_bound(LEFT,c[0]);
- line_l->set_bound(RIGHT,c.top ());
- for (int j=0; j < c.size(); j++)
+ line_l->set_bound (LEFT,c[0]);
+ line_l->set_bound (RIGHT,c.top ());
+ for (int j=0; j < c.size (); j++)
{
c[j]->translate_axis (breaking[i].config_[j],X_AXIS);
dynamic_cast<Paper_column*> (c[j])->line_l_ = line_l;
cname = ly_symbol2scm (name); \
scm_permanent_object (cname); \
} \
-ADD_SCM_INIT_FUNC(cname,cname ## _init_func);\
+ADD_SCM_INIT_FUNC (cname,cname ## _init_func);\
-GLOBAL_SYMBOL( offset_sym , "translate-molecule");
-GLOBAL_SYMBOL( placebox_sym , "placebox");
-GLOBAL_SYMBOL( combine_sym , "combine-molecule");
-GLOBAL_SYMBOL( no_origin_sym , "no-origin");
-GLOBAL_SYMBOL( define_origin_sym , "define-origin");
+GLOBAL_SYMBOL (offset_sym , "translate-molecule");
+GLOBAL_SYMBOL (placebox_sym , "placebox");
+GLOBAL_SYMBOL (combine_sym , "combine-molecule");
+GLOBAL_SYMBOL (no_origin_sym , "no-origin");
+GLOBAL_SYMBOL (define_origin_sym , "define-origin");
pscore_l_->outputter_l_->output_scheme (gh_list (define_origin_sym,
- ly_str02scm (ip->file_str ().ch_C()),
+ ly_str02scm (ip->file_str ().ch_C ()),
gh_int2scm (ip->line_number ()),
gh_int2scm (ip->column_number ()),
SCM_UNDEFINED));
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
unsmob_grob (gh_car (s))->discretionary_processing ();
- if(verbose_global_b)
- progress_indication ( _f("Element count %d ", element_count ()));
+ if (verbose_global_b)
+ progress_indication (_f ("Element count %d ", element_count ()));
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
}
- progress_indication ("\n" + _ ("Calculating column positions...") + " " );
+ progress_indication ("\n" + _ ("Calculating column positions...") + " ");
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
Grob * e = unsmob_grob (gh_car (s));
ly_symbol2scm ("after-line-breaking-callback"));
}
- Interval i(extent(this, Y_AXIS));
- if (i.empty_b())
+ Interval i (extent (this, Y_AXIS));
+ if (i.empty_b ())
programming_error ("Huh? Empty Line_of_score?");
else
translate_axis (- i[MAX], Y_AXIS);
/*
generate all molecules to trigger all font loads.
- (ugh. This is not very memory efficient.) */
+ (ugh. This is not very memory efficient.) */
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
{
unsmob_grob (gh_car (s))->get_molecule ();
/*
font defs;
*/
- SCM font_names = ly_quote_scm (paper_l()->font_descriptions ());
+ SCM font_names = ly_quote_scm (paper_l ()->font_descriptions ());
output_scheme (gh_list (ly_symbol2scm ("define-fonts"),
font_names,
SCM_UNDEFINED));
gh_double2scm (height),
SCM_UNDEFINED));
- /*
- all elements.
- */
- for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = gh_cdr (s))
- {
- Grob *sc = unsmob_grob (gh_car (s));
- Molecule *m = sc->get_molecule ();
- if (!m)
- continue;
-
- Offset o (sc->relative_coordinate (this, X_AXIS),
- sc->relative_coordinate (this, Y_AXIS));
-
- SCM e = sc->get_grob_property ("extra-offset");
- if (gh_pair_p (e))
- {
- o[X_AXIS] += gh_scm2double (gh_car (e));
- o[Y_AXIS] += gh_scm2double (gh_cdr (e));
- }
-
- output_molecule (m->get_expr (), o);
- }
+ /* Output elements in three layers, 0, 1, 2.
+ The default layer is 1. */
+ for (int i = 0; i < 3; i++)
+ for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s);
+ s = gh_cdr (s))
+ {
+ Grob *sc = unsmob_grob (gh_car (s));
+ Molecule *m = sc->get_molecule ();
+ if (!m)
+ continue;
+
+ SCM s = sc->get_grob_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");
+ if (gh_pair_p (e))
+ {
+ o[X_AXIS] += gh_scm2double (gh_car (e));
+ o[Y_AXIS] += gh_scm2double (gh_cdr (e));
+ }
+
+ output_molecule (m->get_expr (), o);
+ }
+
if (last_line)
{
output_scheme (gh_list (ly_symbol2scm ("stop-last-line"), SCM_UNDEFINED));
SCM s = get_grob_property ("columns");
while (gh_pair_p (s) && gh_car (s) != r->self_scm ())
- s = gh_cdr (s);
+ s = gh_cdr (s);
if (gh_pair_p (s))
s = gh_cdr (s);
while (gh_pair_p (s) && gh_car (s) != l->self_scm ())
{
- Paper_column*c = dynamic_cast<Paper_column*> ( unsmob_grob (gh_car (s)));
+ Paper_column*c = dynamic_cast<Paper_column*> (unsmob_grob (gh_car (s)));
if (Item::breakable_b (c) && !c->line_l_)
ret.push (c);
- s = gh_cdr (s);
+ s = gh_cdr (s);
}
ret.reverse ();
Link_array<Grob> acs
= Pointer_group_interface__extract_elements (this, (Grob*) 0, "columns");
bool bfound = false;
- for (int i= acs.size (); i -- ; )
+ for (int i= acs.size (); i -- ;)
{
bool brb = Item::breakable_b (acs[i]);
bfound = bfound || brb;