source file of the GNU LilyPond music typesetter
- (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1996--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "input-smob.hh"
return scm_ilength (get_grob_property ("all-elements"));
}
+int
+System::spanner_count () const
+{
+ int k =0;
+ for (SCM s = get_grob_property ("all-elements");
+ gh_pair_p (s); s = ly_cdr (s))
+ {
+ if (dynamic_cast<Spanner*> (unsmob_grob (gh_car(s))))
+ k++;
+ }
+
+ return k;
+}
+
+
+
void
System::typeset_grob (Grob * elem)
{
}
while (1);
-
-#if 0
- Real rx = right->relative_coordinate (right->get_parent (X_AXIS), X_AXIS);
- Real lx = left->relative_coordinate (left->get_parent (X_AXIS), X_AXIS);
-
- /*
- divide space equally over loose columns.
- */
- int j = 1;
- loose = col;
- while (1)
- {
- SCM between = loose->get_grob_property ("between-cols");
- if (!gh_pair_p (between))
- break;
-
- Paper_column *thiscol = dynamic_cast<Paper_column*> (loose);
-
- thiscol->system_ = which;
- thiscol->translate_axis (lx + j*(rx - lx)/divide_over, X_AXIS);
-
- j ++;
- loose = dynamic_cast<Item*> (unsmob_grob (ly_cdr (between)));
- }
-#else
/*
We divide the remaining space of the column over the left and
right side. At the moment, we
col->system_ = which;
col->translate_axis (lx + dx - cval[LEFT], X_AXIS);
-#endif
}
}
{
System *system = dynamic_cast <System*> (clone ());
system->rank_ = i;
- // system->set_immutable_grob_property ("rank", gh_int2scm (i));
+
Link_array<Grob> c (breaking[i].cols_);
pscore_->typeset_line (system);
{
Input * ip = unsmob_input (head);
-
pscore_->outputter_->output_scheme (scm_list_n (ly_symbol2scm ("define-origin"),
scm_makfrom0str (ip->file_string ().to_str0 ()),
gh_int2scm (ip->line_number ()),
Axis_group_interface::add_element (me, p);
}
-
-
-/*
- TODO: use scm_map iso. for loops.
- */
void
System::pre_processing ()
{
sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
}
- progress_indication ("\n" + _ ("Calculating column positions...") + " ");
+ progress_indication ("\n" + _ ("Calculating line breaks...") + " ");
for (SCM s = get_grob_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s))
{
Grob * e = unsmob_grob (ly_car (s));
}
Interval i (extent (this, Y_AXIS));
- if (i.empty_b ())
+ if (i.is_empty ())
programming_error ("Huh? Empty System?");
else
translate_axis (- i[MAX], Y_AXIS);
/*
line preamble.
*/
+ Interval j (extent (this, X_AXIS));
+ Real length = j[RIGHT];
+
output_scheme (scm_list_n (ly_symbol2scm ("start-system"),
+ gh_double2scm (length),
gh_double2scm (height),
SCM_UNDEFINED));
/* Output elements in three layers, 0, 1, 2.
The default layer is 1. */
-
{
Molecule *m = this->get_molecule();
if (m)
ADD_INTERFACE (System,"system-interface",
- "Super grob, parent of all:
-
-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.",
+ "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");