struct Break_position
{
- vsize sys_; /* our index in the all_ list */
- vsize score_break_; /* if sys_ is a score, then we start at the score_brk_'th
- possible page-break in the score */
- Grob *col_; /* if sys_ is a score, this points to the broken column */
+ /* our index in the all_ list */
+ vsize sys_;
+
+ /* if sys_ is a score, then we start at the score_brk_'th possible
+ page-break in the score */
+ vsize score_break_;
+
+ /* if sys_ is a score, this points to the broken column */
+ Grob *col_;
bool score_ender_;
Break_position (vsize s=VPOS, vsize brk=VPOS, Grob *g=NULL, bool end=false)
score_ender_ = end;
}
+ /*
+ lexicographic in (sys_, score_break_)
+ */
bool operator< (const Break_position &other)
{
return (sys_ == VPOS && other.sys_ != VPOS)
Real blank_page_penalty () const;
SCM breakpoint_property (vsize breakpoint, char const *str);
+
+
+protected:
vector<Break_position> breaks_;
private:
vector<Break_position> chunks_;
- vector<System_spec> all_;
+ vector<System_spec> system_specs_;
vector<Constrained_breaking> line_breaking_;
bool ragged_;
bool ragged_last_;
if (sys == VPOS) /* beginning of the book */
return 0;
- if (all_[sys].pscore_ && !break_pos.score_ender_)
+ if (system_specs_[sys].pscore_ && !break_pos.score_ender_)
return sys; /* the score overflows the previous page */
return sys + 1; /* this page starts with a new sys */
}
vsize *line_breaker_start,
vsize *line_breaker_end)
{
- assert (all_[sys].pscore_);
+ assert (system_specs_[sys].pscore_);
assert (next_system (start) <= sys && sys <= end.sys_);
if (start.sys_ == sys)
for (vsize i = 0; i + 1 < chunks.size (); i++)
{
vsize sys = next_system (chunks[i]);
- if (all_[sys].pscore_)
+ if (system_specs_[sys].pscore_)
{
vsize start;
vsize end;
vector<Column_x_positions> pos = ignore_div
? line_breaking_[sys].best_solution (start, end)
: line_breaking_[sys].solve (start, end, div[i]);
- all_[sys].pscore_->root_system ()->break_into_pieces (pos);
+ system_specs_[sys].pscore_->root_system ()->break_into_pieces (pos);
}
}
}
Page_breaking::systems ()
{
SCM ret = SCM_EOL;
- for (vsize sys = 0; sys < all_.size (); sys++)
+ for (vsize sys = 0; sys < system_specs_.size (); sys++)
{
- if (all_[sys].pscore_)
+ if (system_specs_[sys].pscore_)
{
- all_[sys].pscore_->root_system ()
+ system_specs_[sys].pscore_->root_system ()
->do_break_substitution_and_fixup_refpoints ();
- SCM lines = all_[sys].pscore_->root_system ()
+ SCM lines = system_specs_[sys].pscore_->root_system ()
->get_broken_system_grobs ();
ret = scm_cons (lines, ret);
}
else
{
- Prob *pb = all_[sys].prob_;
+ Prob *pb = system_specs_[sys].prob_;
ret = scm_cons (scm_list_1 (pb->self_scm ()), ret);
pb->unprotect ();
}
if (pos.sys_ == VPOS)
return SCM_EOL;
- if (all_[pos.sys_].pscore_)
+ if (system_specs_[pos.sys_].pscore_)
return pos.col_->get_property (str);
- return all_[pos.sys_].prob_->get_property (str);
+ return system_specs_[pos.sys_].prob_->get_property (str);
}
SCM
scm_vector_to_list (ps->get_paper_systems ()),
scm_cdr (s)));
else
- all_.push_back (System_spec (ps));
+ system_specs_.push_back (System_spec (ps));
}
else
{
assert (pb);
pb->protect ();
- all_.push_back (System_spec (pb));
+ system_specs_.push_back (System_spec (pb));
}
}
}
chunks_.push_back (Break_position ());
breaks_.push_back (Break_position ());
- for (vsize i = 0; i < all_.size (); i++)
+ for (vsize i = 0; i < system_specs_.size (); i++)
{
- if (all_[i].pscore_)
+ if (system_specs_[i].pscore_)
{
- vector<Grob*> cols = all_[i].pscore_->root_system ()->used_columns ();
+ vector<Grob*> cols = system_specs_[i].pscore_->root_system ()->used_columns ();
vector<vsize> line_breaker_columns;
line_breaker_columns.push_back (0);
cols[j],
last);
- if (break_point || (i == all_.size () - 1 && last))
+ if (break_point || (i == system_specs_.size () - 1 && last))
breaks_.push_back (cur_pos);
if (chunk_end || last)
chunks_.push_back (cur_pos);
if ((break_point || chunk_end) && !last)
line_breaker_columns.push_back (j);
}
- line_breaking_.push_back (Constrained_breaking (all_[i].pscore_, line_breaker_columns));
+ line_breaking_.push_back (Constrained_breaking (system_specs_[i].pscore_, line_breaker_columns));
}
else
{
/* TODO: we want some way of applying Break_p to a prob? */
- if (i == all_.size () - 1)
+ if (i == system_specs_.size () - 1)
breaks_.push_back (Break_position (i));
chunks_.push_back (Break_position (i));
for (vsize i = 0; i + 1 < chunks.size (); i++)
{
vsize sys = next_system (chunks[i]);
- if (all_[sys].pscore_)
+ if (system_specs_[sys].pscore_)
{
vsize start;
vsize end;
for (vsize i = 0; i+1 < current_chunks_.size (); i++)
{
vsize sys = next_system (current_chunks_[i]);
- if (all_[sys].pscore_)
+ if (system_specs_[sys].pscore_)
{
line_breaker_args (sys, current_chunks_[i], current_chunks_[i+1], &start, &end);
div.push_back (line_breaking_[sys].best_solution (start, end).size ());
for (vsize i = 0; i + 1 < current_chunks_.size (); i++)
{
vsize sys = next_system (current_chunks_[i]);
- if (all_[sys].pscore_)
+ if (system_specs_[sys].pscore_)
{
vsize start;
vsize end;
else
{
assert (div[i] == 1);
- uncompressed_line_details_.push_back (Line_details (all_[sys].prob_));
+ uncompressed_line_details_.push_back (Line_details (system_specs_[sys].prob_));
uncompressed_line_details_.back ().padding_ = padding;
}
}