* lily/spacing-spanner.cc (Module): idem.
* lily/script-column.cc (before_line_breaking): use extract_grob_set()
* lily/include/paper-column.hh (class Paper_column): add
non-static get_rank() member.
+
+2005-07-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * lily/note-column.cc (dir): idem.
+
+ * lily/spacing-spanner.cc (Module): idem.
+
+ * lily/script-column.cc (before_line_breaking): use extract_grob_set()
+
+ * lily/include/paper-column.hh (class Paper_column): add
+ non-static get_rank() member.
+
+ * scm/framework-null.scm: new file, used for benchmarking.
+
2005-07-20 Heikki Junes <hjunes@cc.hut.fi>
* Documentation/topdocs/INSTALL.texi, configure.in: fix
* stepmake/bin/add-html-footer.py: add missing </p>.
-2005-07-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
- * scm/framework-null.scm: new file, used for benchmarking.
-
2005-07-19 Han-Wen Nienhuys <hanwen@xs4all.nl>
* scm/define-markup-commands.scm (beam): use polygon in beam
link to libstdc++
* lily/GNUmakefile (static-gxx-libs): new target
- static-gxx-libs. Create link to libstdc++.a
+ static-gxx-libs. Create symlink to libstdc++.a
* lily/new-lyric-combine-music-iterator.cc: rename to
Lyric_combine_music_iterator
SCM s = me->get_property ("begin-of-line-visible");
if (to_boolean (s))
{
- if (Paper_column::get_rank (me->get_column ())
+ if (me->get_column ()->get_rank ()
- me->get_system ()->spanned_rank_iv ()[LEFT] > 1)
me->suicide ();
}
mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, sym, v);
}
+#ifdef DEBUG_PROFILE_ACCESSES
Protected_scm property_lookup_table;
LY_DEFINE(ly_property_lookup_stats, "ly:property-lookup-stats",
0,0,0, (),
{
return (SCM) property_lookup_table;
}
-
+#endif
SCM
Grob::internal_get_property (SCM sym) const
}
#endif
-#if 0
+#ifdef DEBUG_PROFILE_ACCESSES
/*
Statistics: which properties are looked up?
*/
scm_set_cdr_x (hashhandle, scm_from_int (scm_to_int (scm_cdr (hashhandle)) + 1));
#endif
-
SCM s = scm_sloppy_assq (sym, mutable_property_alist_);
if (s != SCM_BOOL_F)
return scm_cdr (s);
class Paper_column : public Item
{
-public:
int rank_;
/// if lines are broken then this column is in #line#
System *system_;
+
+ // ugh: friend declarations.
+ friend void set_loose_columns (System *which, Column_x_positions const *posns);
+ friend class System;
+public:
Paper_column (SCM, Object_key const *);
Paper_column (Paper_column const &, int count);
virtual System *get_system () const;
static int get_rank (Grob *);
-
+ int get_rank () const { return rank_; }
+
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
ledger_extent.widen (length_fraction * head_extent.length ());
Direction vdir = Direction (sign (pos));
- int rank = Paper_column::get_rank (h->get_column ());
+ int rank = h->get_column ()->get_rank ();
reqs[rank][vdir].ledger_extent_.unite (ledger_extent);
reqs[rank][vdir].head_extent_.unite (head_extent);
Interval ledger_size = head_size;
ledger_size.widen (ledger_size.length () * length_fraction);
- Interval max_size = reqs[Paper_column::get_rank (h->get_column ())][Direction (sign (pos))].ledger_extent_;
+ Interval max_size = reqs[h->get_column ()->get_rank ()][Direction (sign (pos))].ledger_extent_;
ledger_size.intersect (max_size);
Real left_shorten = 0.0;
Grob *stem = unsmob_grob (me->get_object ("stem"));
if (stem && Stem::has_interface (stem))
return Stem::get_direction (stem);
- else if (scm_is_pair (me->get_object ("note-heads")))
- return (Direction)sign (head_positions_interval (me).center ());
-
+ else
+ {
+ extract_grob_set (me, "note-heads", heads);
+ if (heads.size ())
+ return (Direction)sign (head_positions_interval (me).center ());
+ }
+
programming_error ("note column without heads and stem");
return CENTER;
}
Script_column::before_line_breaking (SCM smob)
{
Grob *me = unsmob_grob (smob);
- Drul_array<SCM> scripts (SCM_EOL, SCM_EOL);
+ Drul_array<SCM> scripts_drul (SCM_EOL, SCM_EOL);
Link_array<Grob> staff_sided;
- for (SCM s = me->get_property ("scripts"); scm_is_pair (s); s = scm_cdr (s))
+ extract_grob_set (me, "scripts", scripts);
+ for (int i = 0; i < scripts.size (); i++)
{
- Grob *sc = unsmob_grob (scm_car (s));
+ Grob *sc = scripts[i];
/*
Don't want to consider scripts horizontally next to notes.
g->set_property ("direction", scm_int2num (d));
}
- scripts[d] = scm_cons (g->self_scm (), scripts[d]);
+ scripts_drul[d] = scm_cons (g->self_scm (), scripts_drul[d]);
}
Direction d = DOWN;
do
{
- SCM ss = scm_reverse_x (scripts[d], SCM_EOL);
+ SCM ss = scm_reverse_x (scripts_drul[d], SCM_EOL);
ss = scm_stable_sort_x (ss, ly_grob_script_priority_less_proc);
Grob *last = 0;
Direction d = LEFT;
do
{
- b1[d] = s1->get_bound (d)->get_column ()->rank_;
- b2[d] = s2->get_bound (d)->get_column ()->rank_;
+ b1[d] = s1->get_bound (d)->get_column ()->get_rank ();
+ b2[d] = s2->get_bound (d)->get_column ()->get_rank ();
}
while (flip (&d) != LEFT);
Item *loose = dynamic_cast<Item *> (posns->loose_cols_[i]);
Paper_column *col = dynamic_cast<Paper_column *> (loose);
- if (col->system_)
+ if (col->get_system ())
continue;
Item *left = 0;
distance_to_next = my_extent[RIGHT] + 1.0;
right_point = right->extent (common, X_AXIS)[LEFT];
}
-#if 0
- Real left_point = left->extent (common, X_AXIS)[RIGHT];
- Real space_left = ((right_point - left_point) >? 0.0)
- - (my_extent.is_empty () ? 0.0 : my_extent.length ());
-
- Real padding = (space_left / 2) <? 1.0;
- /*
- Put it just left of the right column, with a bit of extra space
- */
-#endif
Real my_offset = right_point - distance_to_next;
col->system_ = which;
Spacing_spanner::do_measure (Rational global_shortest, Grob *me,
Link_array<Grob> *cols)
{
-
Real headwid = robust_scm2double (me->get_property ("spacing-increment"), 1);
for (int i = 0; i < cols->size () - 1; i++)
{
Paper_column *lc = dynamic_cast<Paper_column *> (l);
Paper_column *rc = dynamic_cast<Paper_column *> (r);
- if (!Paper_column::is_musical (l))
+ if (Paper_column::is_musical (l))
+ {
+ musical_column_spacing (me, lc, rc, headwid, global_shortest);
+ if (Item *rb = r->find_prebroken_piece (LEFT))
+ musical_column_spacing (me, lc, rb, headwid, global_shortest);
+ }
+ else
{
- breakable_column_spacing (me, l, r, global_shortest);
-
/*
The case that the right part is broken as well is rather
rare, but it is possible, eg. with a single empty measure,
or if one staff finishes a tad earlier than the rest.
-
*/
Item *lb = l->find_prebroken_piece (RIGHT);
Item *rb = r->find_prebroken_piece (LEFT);
- if (lb)
+ if (i == 0 && Paper_column::get_rank (l) == 0)
+ l = 0;
+
+ if (l && r)
+ breakable_column_spacing (me, l, r, global_shortest);
+
+ if (lb && r)
breakable_column_spacing (me, lb, r, global_shortest);
- if (rb)
+ if (l && rb)
breakable_column_spacing (me, l, rb, global_shortest);
+
if (lb && rb)
breakable_column_spacing (me, lb, rb, global_shortest);
}
- else
- {
- musical_column_spacing (me, lc, rc, headwid, global_shortest);
- if (Item *rb = r->find_prebroken_piece (LEFT))
- musical_column_spacing (me, lc, rb, headwid, global_shortest);
- }
}
}
Real compound_fixed_note_space = 0.0;
int wish_count = 0;
- SCM seq = lc->get_object ("right-neighbors");
+ extract_grob_set (lc, "right-neighbors", neighbors);
/*
We adjust the space following a note only if the next note
happens after the current note (this is set in the grob
property SPACING-SEQUENCE.
*/
- for (SCM s = seq; scm_is_pair (s); s = scm_cdr (s))
+ for (int i = 0; i < neighbors.size (); i++)
{
- Grob *wish = unsmob_grob (scm_car (s));
+ Grob *wish = neighbors[i];
Item *wish_rcol = Note_spacing::right_column (wish);
if (Note_spacing::left_column (wish) != lc
if (dt == Moment (0, 0))
{
- for (SCM s = l->get_object ("spacing-wishes");
- scm_is_pair (s); s = scm_cdr (s))
+ extract_grob_set (l, "spacing-wishes", wishes);
+
+ for (int i = 0; i < wishes.size (); i++)
{
- Item *spacing_grob = dynamic_cast<Item *> (unsmob_grob (scm_car (s)));
+ Item *spacing_grob = dynamic_cast<Item *> (wishes[i]);
if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob))
continue;
Interval_t<int> iv (0, 0);
if (spanned_drul_[LEFT] && spanned_drul_[LEFT]->get_column ())
- iv[LEFT] = Paper_column::get_rank (spanned_drul_[LEFT]->get_column ());
+ iv[LEFT] = spanned_drul_[LEFT]->get_column ()->get_rank ();
if (spanned_drul_[RIGHT] && spanned_drul_[RIGHT]->get_column ())
- iv[RIGHT] = Paper_column::get_rank (spanned_drul_[RIGHT]->get_column ());
+ iv[RIGHT] = spanned_drul_[RIGHT]->get_column ()->get_rank ();
return iv;
}
Direction dir = LEFT;
do
{
- if (dir * Paper_column::get_rank (tie->get_bound (dir)->get_column ())
- > dir * Paper_column::get_rank (me->get_bound (dir)->get_column ()))
+ if (dir * tie->get_bound (dir)->get_column ()->get_rank ()
+ > dir * me->get_bound (dir)->get_column ()->get_rank ())
{
me->set_bound (dir, Tie::head (tie, dir));
}
(cond
((ly:music? cause) cause)
- ((ly:grob? cause) (music-cause cause))
+; ((ly:grob? cause) (music-cause cause))
(else
#f))))