+2002-07-24 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * lily, lily/include: Rename line to system. Junk _l suffix.
+
2002-07-24 Han-Wen Nienhuys <hanwen@cs.uu.nl>
* po/fr.po: update from TP.
#(define (assert-system-count smob n)
(let ((systems (length (get-broken-into
(get-original
- (get-line smob))))))
+ (get-system smob))))))
(if (not (equal? n systems))
;; Can't use error yet, as we know that we're not using 6...
;;(error
}
#(define (display-systemno smob)
- (let* ((this-line (get-line smob))
+ (let* ((this-system (get-line smob))
(systems (get-broken-into
- (get-original this-line))))
+ (get-original this-system))))
(display smob)
- (display (list-index systems this-line))
+ (display (list-index systems this-system))
(newline)))
(display (length
(get-broken-into
(get-original
- (get-line smob))))))
+ (get-system smob))))))
Array<int>
Break_algorithm::find_break_indices () const
{
- Link_array<Grob> all = pscore_l_->line_l_->column_l_arr ();
+ Link_array<Grob> all = pscore_l_->system_->column_l_arr ();
Array<int> retval;
for (int i=0; i < all.size (); i++)
Link_array<Grob>
Break_algorithm::find_breaks () const
{
- Link_array<Grob> all = pscore_l_->line_l_->column_l_arr ();
+ Link_array<Grob> all = pscore_l_->system_->column_l_arr ();
Link_array<Grob> retval;
for (int i=0; i < all.size (); i++)
{
System * line
= dynamic_cast<System*> (unsmob_grob (break_criterion));
- if (sc->line_l () != line)
+ if (sc->get_system () != line)
{
sc = sc->find_broken_piece (line);
}
- /* now: !sc || (sc && sc->line_l () == line) */
+ /* now: !sc || (sc && sc->get_system () == line) */
if (!sc)
return SCM_UNDEFINED;
- /* now: sc && sc->line_l () == line */
+ /* now: sc && sc->get_system () == line */
if (!line)
return sc->self_scm();
if (to_boolean (s))
{
if (Paper_column::rank_i (me->column_l ()) -
- me->line_l ()->spanned_rank_iv ()[LEFT] > 1)
+ me->get_system ()->spanned_rank_iv ()[LEFT] > 1)
me->suicide ();
}
return SCM_UNSPECIFIED;
{
Array<Break_node> optimal_paths;
Link_array<Grob> all =
- pscore_l_->line_l_->column_l_arr ();
+ pscore_l_->system_->column_l_arr ();
Array<int> breaks = find_break_indices ();
System *
-Grob::line_l () const
+Grob::get_system () const
{
return 0;
}
-LY_DEFINE (get_line,
- "get-line",
+LY_DEFINE (get_system,
+ "get-system",
1, 0, 0, (SCM grob),
"
-Return the Line Grob of @var{grob}.
+Return the System Grob of @var{grob}.
")
{
Grob *me = unsmob_grob (grob);
SCM_ASSERT_TYPE (me, grob, SCM_ARG1, __FUNCTION__, "grob");
- if (Grob *g = me->line_l ())
+ if (Grob *g = me->get_system ())
return g->self_scm ();
return SCM_EOL;
for (int i = 0; i< s->broken_into_l_arr_ .size (); i++)
{
Grob * sc = s->broken_into_l_arr_[i];
- System * l = sc->line_l ();
+ System * l = sc->get_system ();
sc->substitute_mutable_properties (l ? l->self_scm () : SCM_UNDEFINED,
mutable_property_alist_);
}
- System *line = line_l ();
+ System *system = get_system ();
if (live ()
- && line && common_refpoint (line, X_AXIS) && common_refpoint (line, Y_AXIS))
+ && system && common_refpoint (system, X_AXIS) && common_refpoint (system, Y_AXIS))
{
- substitute_mutable_properties (line ? line->self_scm () : SCM_UNDEFINED,
+ substitute_mutable_properties (system ? system->self_scm () : SCM_UNDEFINED,
mutable_property_alist_);
}
else if (dynamic_cast <System*> (this))
if (!parent)
continue;
- if (parent->line_l () != me->line_l () && me->line_l ())
+ if (parent->get_system () != me->get_system () && me->get_system ())
{
- Grob * newparent = parent->find_broken_piece (me->line_l ());
+ Grob * newparent = parent->find_broken_piece (me->get_system ());
me->set_parent (newparent, ax);
}
add a dependency. It may be the 0 pointer, in which case, it is ignored.
*/
void add_dependency (Grob*);
- virtual System * line_l () const;
+ virtual System * get_system () const;
bool linked_b () const;
Item (SCM);
Item (Item const &);
- static bool breakable_b (Grob*me);
+ static bool breakable_b (Grob *);
bool broken_b () const;
Direction break_status_dir () const;
- Item * find_prebroken_piece (Direction) const;
- Grob * find_broken_piece (System*) const;
+ Item *find_prebroken_piece (Direction) const;
+ Grob *find_broken_piece (System *) const;
- virtual System * line_l () const;
- virtual Paper_column * column_l () const;
+ virtual System *get_system () const;
+ virtual Paper_column *column_l () const;
virtual void handle_prebroken_dependencies ();
- static bool has_interface (Grob*);
+ static bool has_interface (Grob *);
protected:
virtual void discretionary_processing ();
void copy_breakable_items ();
int rank_i_;
virtual void do_break_processing ();
virtual Paper_column *column_l () const;
- virtual System *line_l () const;
+ virtual System *get_system () const;
/// if lines are broken then this column is in #line#
- System *line_l_;
+ System *system_;
static int rank_i (Grob*);
Paper_def *paper_l_;
Paper_outputter *outputter_l_;
- System * line_l_;
+ System *system_;
Paper_score ();
*/
-#ifndef SCORE_GRAV_HH
-#define SCORE_GRAV_HH
+#ifndef SCORE_ENGRAVER_HH
+#define SCORE_ENGRAVER_HH
#include "engraver-group-engraver.hh"
#include "global-translator.hh"
class Score_engraver :
public Engraver_group_engraver, public Global_translator
{
- System * scoreline_l_;
+ System *system_;
int breaks_i_;
virtual void stop_translation_timestep ();
};
-#endif // SCORE_GRAV_HH
+#endif /* SCORE_ENGRAVER_HH */
VIRTUAL_COPY_CONS (Grob);
virtual void do_break_processing ();
- virtual System*line_l () const;
+ virtual System *get_system () const;
};
(c) 1996--2002 Han-Wen Nienhuys
*/
-#ifndef SCORELINE_HH
-#define SCORELINE_HH
+#ifndef SYSTEM_HH
+#define SYSTEM_HH
#include "column-x-positions.hh"
VIRTUAL_COPY_CONS (Grob);
};
-#endif
+#endif /* SYSTEM_HH */
}
System *
-Item::line_l () const
+Item::get_system () const
{
Grob *g = get_parent (X_AXIS);
- return g ? g->line_l () : 0;
+ return g ? g->get_system () : 0;
}
{
Grob * dolly = clone ();
Item * item_p = dynamic_cast<Item*> (dolly);
- pscore_l_->line_l_->typeset_grob (item_p);
+ pscore_l_->system_->typeset_grob (item_p);
new_copies[i] =item_p;
}
while (flip (&i) != LEFT);
Grob*
Item::find_broken_piece (System*l) const
{
- if (line_l () == l)
+ if (get_system () == l)
return (Item*) (this);
Direction d = LEFT;
do {
Grob *s = broken_to_drul_[d];
- if (s && s->line_l () == l)
+ if (s && s->get_system () == l)
return s;
}
while (flip (&d) != LEFT);
}
System*
-Paper_column::line_l () const
+Paper_column::get_system () const
{
- return line_l_;
+ return system_;
}
Paper_column*
Paper_column::Paper_column (SCM l)
: Item (l) // guh.?
{
- line_l_=0;
+ system_=0;
rank_i_ = -1;
}
{
paper_l_ =0;
outputter_l_ =0;
- line_l_ = 0;
+ system_ = 0;
main_smob_ = SCM_EOL;
}
void
Paper_score::typeset_line (System *l)
{
- if (!line_l_)
+ if (!system_)
{
- line_l_ = l; // ugh.
+ system_ = l; // ugh.
}
main_smob_ = gh_cons (l->self_scm (), main_smob_);
l->pscore_l_ = this;
Paper_score::process ()
{
if (verbose_global_b)
- progress_indication (_f ("Element count %d ", line_l_->element_count ()));
+ progress_indication (_f ("Element count %d ", system_->element_count ()));
progress_indication (_ ("Preprocessing elements...") + " ");
/*
Be sure to set breakability on first & last column.
*/
- Link_array<Grob> pc (line_l_->column_l_arr ());
+ Link_array<Grob> pc (system_->column_l_arr ());
pc[0]->set_grob_property ("breakable", SCM_BOOL_T);
pc.top ()->set_grob_property ("breakable", SCM_BOOL_T);
- line_l_->pre_processing ();
+ system_->pre_processing ();
Array<Column_x_positions> breaking = calc_breaking ();
- line_l_->break_into_pieces (breaking);
+ system_->break_into_pieces (breaking);
outputter_l_ = paper_l_->paper_outputter_p ();
;
SCM scm = scm_list_n (ly_symbol2scm ("header-end"), SCM_UNDEFINED);
outputter_l_->output_scheme (scm);
- line_l_->output_lines ();
+ system_->output_lines ();
scm = scm_list_n (ly_symbol2scm ("end-output"), SCM_UNDEFINED);
outputter_l_->output_scheme (scm);
*/
Score_engraver::Score_engraver ()
{
- scoreline_l_ =0;
+ system_ =0;
command_column_l_ =0;
musical_column_l_ =0;
breaks_i_ =0;
pscore_p_->typeset_line (new System (props));
make_columns ();
- scoreline_l_ = pscore_p_->line_l_;
- scoreline_l_->set_bound (LEFT, command_column_l_);
+ system_ = pscore_p_->system_;
+ system_->set_bound (LEFT, command_column_l_);
command_column_l_->set_grob_property ("breakable", SCM_BOOL_T);
Engraver_group_engraver::initialize ();
Grob * cc
= unsmob_grob (get_property ("currentCommandColumn"));
- scoreline_l_->set_bound (RIGHT, cc);
+ system_->set_bound (RIGHT, cc);
cc->set_grob_property ("breakable", SCM_BOOL_T);
typeset_all ();
Score_engraver::announce_grob (Grob_info info)
{
announce_info_arr_.push (info);
- pscore_p_->line_l_->typeset_grob (info.grob_l_);
+ pscore_p_->system_->typeset_grob (info.grob_l_);
}
void
}
}
if (!elem_p->get_parent (Y_AXIS))
- Axis_group_interface::add_element (scoreline_l_, elem_p);
+ Axis_group_interface::add_element (system_, elem_p);
}
elem_p_arr_.clear ();
}
}
- scoreline_l_->add_column (command_column_l_);
- scoreline_l_->add_column (musical_column_l_);
+ system_->add_column (command_column_l_);
+ system_->add_column (musical_column_l_);
command_column_l_ = 0;
musical_column_l_ = 0;
{
Grob *me = unsmob_grob (smob);
- Link_array<Grob> all (me->pscore_l_->line_l_->column_l_arr ()) ;
+ Link_array<Grob> all (me->pscore_l_->system_->column_l_arr ()) ;
set_explicit_neighbor_columns (all);
}
}
- if (line_l () || broken_b ())
+ if (get_system () || broken_b ())
return;
if (left == right)
Item* bound = left->find_prebroken_piece (d);
if (!bound)
programming_error ("no broken bound");
- else if (bound->line_l ())
+ else if (bound->get_system ())
{
Spanner * span_p = dynamic_cast<Spanner*> (clone ());
span_p->set_bound (LEFT, bound);
span_p->set_bound (RIGHT, bound);
- assert (span_p->line_l ());
- span_p->line_l ()->typeset_grob (span_p);
+ assert (span_p->get_system ());
+ span_p->get_system ()->typeset_grob (span_p);
broken_into_l_arr_.push (span_p);
}
}
}
else
{
- Link_array<Item> break_points = pscore_l_->line_l_->broken_col_range (left,right);
+ Link_array<Item> break_points = pscore_l_->system_->broken_col_range (left,right);
break_points.insert (left,0);
break_points.push (right);
Direction d = LEFT;
do
{
- if (!bounds[d]->line_l ())
+ if (!bounds[d]->get_system ())
bounds[d] = bounds[d]->find_prebroken_piece (- d);
}
while ((flip (&d))!= LEFT);
span_p->set_bound (LEFT,bounds[LEFT]);
span_p->set_bound (RIGHT,bounds[RIGHT]);
- if (!bounds[LEFT]->line_l ()
+ if (!bounds[LEFT]->get_system ()
- || !bounds[RIGHT]->line_l ()
- || bounds[LEFT]->line_l () != bounds[RIGHT]->line_l ())
+ || !bounds[RIGHT]->get_system ()
+ || bounds[LEFT]->get_system () != bounds[RIGHT]->get_system ())
{
programming_error ("bounds of spanner are invalid");
span_p->suicide ();
}
else
{
- bounds[LEFT]->line_l ()->typeset_grob (span_p);
+ bounds[LEFT]->get_system ()->typeset_grob (span_p);
broken_into_l_arr_.push (span_p);
}
}
Direction i = (Direction) LEFT;
do
{
- if (!spanned_drul_[i]->line_l ())
+ if (!spanned_drul_[i]->get_system ())
set_bound (i,spanned_drul_[i]->find_prebroken_piece ((Direction) -i));
}
while (flip (&i) != LEFT);
}
System *
-Spanner::line_l () const
+Spanner::get_system () const
{
if (!spanned_drul_[LEFT] || !spanned_drul_[RIGHT])
return 0;
- if (spanned_drul_[LEFT]->line_l () != spanned_drul_[RIGHT]->line_l ())
+ if (spanned_drul_[LEFT]->get_system () != spanned_drul_[RIGHT]->get_system ())
return 0;
- return spanned_drul_[LEFT]->line_l ();
+ return spanned_drul_[LEFT]->get_system ();
}
int
Spanner::compare (Spanner * const &p1, Spanner * const &p2)
{
- return p1->line_l ()->rank_i_ - p2->line_l ()->rank_i_;
+ return p1->get_system ()->rank_i_ - p2->get_system ()->rank_i_;
}
bool
for (int i=0; i < broken_into_l_arr_.size (); i++)
{
- System *line_l = dynamic_cast<System*> (broken_into_l_arr_[i]);
+ System *system = dynamic_cast<System*> (broken_into_l_arr_[i]);
if (verbose_global_b)
progress_indication ("[");
- line_l->post_processing (i+1 == broken_into_l_arr_.size ());
+ system->post_processing (i+1 == broken_into_l_arr_.size ());
if (verbose_global_b)
{
if (i < broken_into_l_arr_.size () - 1)
{
- SCM lastcol = ly_car (line_l->get_grob_property ("columns"));
+ SCM lastcol = ly_car (system->get_grob_property ("columns"));
Grob* e = unsmob_grob (lastcol);
SCM between = ly_symbol2scm ("between-system-string");
Item *loose = dynamic_cast<Item*> (posns->loose_cols_[i]);
Paper_column* col = dynamic_cast<Paper_column*> (loose);
- if (col->line_l_)
+ if (col->system_)
continue;
Paper_column *thiscol = dynamic_cast<Paper_column*> (loose);
- thiscol->line_l_ = which;
+ thiscol->system_ = which;
thiscol->translate_axis (lx + j*(rx - lx)/divide_over, X_AXIS);
j ++;
else
dx *= 0.5;
- col->line_l_ = which;
+ col->system_ = which;
col->translate_axis (lx + dx - cval[LEFT], X_AXIS);
#endif
}
{
for (int i=0; i < breaking.size (); i++)
{
- System *line_l = dynamic_cast <System*> (clone ());
- line_l->rank_i_ = i;
- // line_l->set_immutable_grob_property ("rank", gh_int2scm (i));
+ System *system = dynamic_cast <System*> (clone ());
+ system->rank_i_ = i;
+ // system->set_immutable_grob_property ("rank", gh_int2scm (i));
Link_array<Grob> c (breaking[i].cols_);
- pscore_l_->typeset_line (line_l);
+ pscore_l_->typeset_line (system);
- line_l->set_bound (LEFT,c[0]);
- line_l->set_bound (RIGHT,c.top ());
+ system->set_bound (LEFT,c[0]);
+ system->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;
+ dynamic_cast<Paper_column*> (c[j])->system_ = system;
}
- set_loose_columns (line_l, &breaking[i]);
- broken_into_l_arr_.push (line_l);
+ set_loose_columns (system, &breaking[i]);
+ broken_into_l_arr_.push (system);
}
}
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->line_l_)
+ if (Item::breakable_b (c) && !c->system_)
ret.push (c);
s = ly_cdr (s);