+2005-10-16 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * scm/define-context-properties.scm
+ (all-user-translation-properties): remove verticalAlignmentChildCallback
+
+ * lily/tuplet-bracket.cc: use positions property iso. left,right-position.
+ (calc_direction): use callback
+ (calc_positions): use callback.
+
+ * lily/tie.cc (calc_direction): use callback. Only call parent
+ positioning for more than one tie.
+
+ * lily/tie-column.cc (calc_positioning_done): use callback
+
+ * lily/slur-scoring.cc (calc_control_points): use callback
+
+ * lily/slur.cc (calc_direction): use callback.
+
+ * lily/note-collision.cc (force_shift_callback): remove.
+
+ * lily/dot-column.cc (force_shift_callback): remove. Use
+ other_axis_parent_positioning.
+
+ * lily/grob.cc (other_axis_parent_positioning): new function.
+ (same_axis_parent_positioning): new function
+
+ * lily/align-interface.cc (alignment_callback): remove function.
+
+ * lily/note-collision.cc (calc_positioning_done): use callback.
+
+ * lily/laissez-vibrer-tie.cc (calc_control_points): use callback.
+ (calc_direction): idem.
+ remove print function.
+
+ * lily/laissez-vibrer-tie-column.cc (calc_positioning_done): use callback.
+
+ * lily/dot-column.cc (calc_positioning_done): use callback.
+
+ * lily/break-align-interface.cc (calc_positioning_done): use callback.
+
+ * lily/beam.cc (calc_direction): use pseudo-property for beam
+ direction callback.
+ (calc_positions): use callback
+
+ * lily/align-interface.cc (calc_positioning_done): use
+ callback. Fold fixed distance and normal alignment in one function.
+
+ * lily/stem.cc (calc_stem_end_position): use callback.
+ (calc_positioning_done): idem.
+ (calc_direction): idem.
+ (calc_stem_end_position): idem
+ (calc_stem_info): idem.
+
+ * lily/grob-property.cc (get_property_data): new function:
+ (try_callback): new function.
+
+ * scm/define-grob-properties.scm (all-user-grob-properties): doc
+ callbacks property.
+
+ * lily/break-align-interface.cc: remove Break_align_interface::alignment_callback.
+
2005-10-15 Han-Wen Nienhuys <hanwen@xs4all.nl>
- * lily/include/*.hh (Module): lots of compile fixes.
+ * lily/tie.cc (get_position): robustness fix. Don't crash if a
+ tie
+ has no heads.
+
+ * lily/include/*.hh (Module): compile fixes.
2005-10-14 Heikki Junes <hjunes@cc.hut.fi>
2005-10-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
* ly/titling-init.ly (evenHeaderMarkup): use space in header on
- even header too.6
+ even header too.
* scm/define-markup-commands.scm (wordwrap-string): bugfix for
MacOS 9 users.
#include "note-collision.hh"
#include "accidental-interface.hh"
-MAKE_SCHEME_CALLBACK (Accidental_placement, alignment_callback, 2);
-SCM
-Accidental_placement::alignment_callback (SCM s, SCM)
-{
- Grob *me = unsmob_grob (s);
-
- Grob *par = me->get_parent (X_AXIS);
- if (!to_boolean (par->get_property ("positioning-done")))
- {
- par->set_property ("positioning-done", SCM_BOOL_T);
- position_accidentals (par);
- }
-
- return scm_from_int (0);
-}
void
Accidental_placement::add_accidental (Grob *me, Grob *a)
{
a->set_parent (me, X_AXIS);
- a->add_offset_callback (alignment_callback_proc, X_AXIS);
+ a->add_offset_callback (Grob::same_axis_parent_positioning_proc, X_AXIS);
SCM cause = a->get_parent (Y_AXIS)->get_property ("cause");
Music *mcause = unsmob_music (cause);
Natural + downstem
- |_
- | | X
- |_| |
- | |
+ *
+ * |_
+ * | | X
+ * |_| |
+ * | |
+ *
+
*/
+
+MAKE_SCHEME_CALLBACK(Accidental_placement, calc_positioning_done, 1);
SCM
-Accidental_placement::position_accidentals (Grob *me)
+Accidental_placement::calc_positioning_done (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
if (!me->is_live ())
- return SCM_UNSPECIFIED;
+ return SCM_BOOL_T;
SCM accs = me->get_object ("accidental-grobs");
if (!scm_is_pair (accs))
- return SCM_UNSPECIFIED;
+ return SCM_BOOL_T;
/*
TODO: there is a bug in this code. If two accs are on the same
for (int i = apes.size (); i--;)
delete apes[i];
- return SCM_UNSPECIFIED;
+ return SCM_BOOL_T;
}
ADD_INTERFACE (Accidental_placement,
"accidental-placement-interface",
"Resolve accidental collisions.",
- "left-padding padding right-padding accidental-grobs positioning-done")
+
+ /* properties */
+ "accidental-grobs "
+ "left-padding "
+ "padding "
+ "positioning-done "
+ "right-padding ")
distance.
*/
-MAKE_SCHEME_CALLBACK (Align_interface, alignment_callback, 2);
+MAKE_SCHEME_CALLBACK (Align_interface, calc_positioning_done, 1);
SCM
-Align_interface::alignment_callback (SCM element_smob, SCM axis)
+Align_interface::calc_positioning_done (SCM smob)
{
- Grob *me = unsmob_grob (element_smob);
+ Grob *me = unsmob_grob (smob);
+ SCM axis = scm_car (me->get_property ("axes"));
Axis ax = (Axis)scm_to_int (axis);
- Grob *par = me->get_parent (ax);
- if (par && !to_boolean (par->get_property ("positioning-done")))
- Align_interface::align_elements_to_extents (par, ax);
- return scm_from_double (0.0);
-}
-MAKE_SCHEME_CALLBACK (Align_interface, fixed_distance_alignment_callback, 2);
-SCM
-Align_interface::fixed_distance_alignment_callback (SCM element_smob, SCM axis)
-{
- Grob *me = unsmob_grob (element_smob);
- Axis ax = (Axis)scm_to_int (axis);
- Grob *par = me->get_parent (ax);
- if (par && !to_boolean (par->get_property ("positioning-done")))
- Align_interface::align_to_fixed_distance (par, ax);
- return scm_from_double (0.0);
+ SCM force = me->get_property ("forced-distance");
+ if (scm_is_number (force))
+ Align_interface::align_to_fixed_distance (me, ax);
+ else
+ Align_interface::align_elements_to_extents (me, ax);
+
+ return SCM_BOOL_T;
}
/*
void
Align_interface::align_to_fixed_distance (Grob *me, Axis a)
{
- me->set_property ("positioning-done", SCM_BOOL_T);
-
Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
DOWN);
The original function has been taken over by
align_to_fixed_distance ().
*/
+
void
Align_interface::align_elements_to_extents (Grob *me, Axis a)
{
extra_space);
}
- me->set_property ("positioning-done", SCM_BOOL_T);
-
Direction stacking_dir = robust_scm2dir (me->get_property ("stacking-dir"),
DOWN);
}
void
-Align_interface::add_element (Grob *me, Grob *element, SCM call_back)
+Align_interface::add_element (Grob *me, Grob *element)
{
- element->add_offset_callback (call_back, Align_interface::axis (me));
+ element->add_offset_callback (Grob::same_axis_parent_positioning_proc,
+ Align_interface::axis (me));
Axis_group_interface::add_element (me, element);
}
#include "staff-symbol-referencer.hh"
MAKE_SCHEME_CALLBACK (Bar_line, print, 1);
-
SCM
Bar_line::print (SCM smob)
{
}
MAKE_SCHEME_CALLBACK (Bar_line, before_line_breaking, 1);
-
SCM
Bar_line::before_line_breaking (SCM smob)
{
// leave y_extent for spanbar?
}
- if (! ly_is_equal (g, orig))
+ if (!ly_is_equal (g, orig))
me->set_property ("glyph", g);
return SCM_UNSPECIFIED;
return scm_from_int (0);
}
-ADD_INTERFACE (Bar_line, "bar-line-interface",
+ADD_INTERFACE (Bar_line,
+ "bar-line-interface",
+
"Bar line.\n"
"\n"
"Print a special bar symbol. It replaces the \n"
"repeat, a double bar, a start bar, an end bar, and a thick double bar.\n"
"If @var{bartype} is set to @code{empty} then nothing is printed,\n"
"but a line break is allowed at that spot.\n",
- "bar-size-procedure kern thin-kern hair-thickness thick-thickness glyph bar-size break-glyph-function");
+
+
+ /* properties */
+ "bar-size-procedure "
+ "kern "
+ "thin-kern "
+ "hair-thickness "
+ "thick-thickness "
+ "glyph "
+ "bar-size "
+ "break-glyph-function");
void
Beam::add_stem (Grob *me, Grob *s)
{
- Pointer_group_interface::add_grob (me, ly_symbol2scm ("stems"), s);
-
- s->add_dependency (me);
+ if (Stem::get_beam (s))
+ {
+ programming_error ("Stem already has beam");
+ return ;
+ }
- assert (!Stem::get_beam (s));
+ Pointer_group_interface::add_grob (me, ly_symbol2scm ("stems"), s);
s->set_object ("beam", me->self_scm ());
-
add_bound_item (dynamic_cast<Spanner *> (me), dynamic_cast<Item *> (s));
}
Currenly, this means that beam has set all stem's directions.
[Alternatively, stems could set its own directions, according to
their beam, during 'final-pre-processing'.] */
-MAKE_SCHEME_CALLBACK (Beam, before_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Beam, calc_direction, 1);
SCM
-Beam::before_line_breaking (SCM smob)
+Beam::calc_direction (SCM smob)
{
Grob *me = unsmob_grob (smob);
return SCM_UNSPECIFIED;
}
}
+
+ Direction d = CENTER;
+
if (count >= 1)
{
- Direction d = get_default_dir (me);
-
+ d = get_default_dir (me);
consider_auto_knees (me);
set_stem_directions (me, d);
set_stem_shorten (me);
}
- return SCM_EOL;
+ return scm_from_int (d);
}
/* We want a maximal number of shared beams, but if there is choice, we
Beam::print (SCM grob)
{
Spanner *me = unsmob_spanner (grob);
- position_beam (me);
extract_grob_set (me, "stems", stems);
Grob *xcommon = common_refpoint_of_array (stems, me, X_AXIS);
total[UP] = total[DOWN] = 0;
Drul_array<int> count;
count[UP] = count[DOWN] = 0;
- Direction d = DOWN;
extract_grob_set (me, "stems", stems);
for (int i = 0; i < stems.size (); i++)
- do
- {
- Grob *s = stems[i];
- Direction sd = get_grob_direction (s);
-
- int center_distance = max (int (- d * Stem::head_positions (s) [-d]), 0);
- int current = sd ? (1 + d * sd) / 2 : center_distance;
-
- if (current)
- {
- total[d] += current;
- count[d]++;
- }
- }
- while (flip (&d) != DOWN);
+ {
+ Grob *s = stems[i];
+ Direction stem_dir = CENTER;
+ SCM stem_dir_scm = s->get_property_data (ly_symbol2scm ("direction"));
+ if (is_direction (stem_dir_scm))
+ stem_dir = to_dir (stem_dir_scm);
+ else
+ stem_dir = Stem::get_default_dir (s);
+
+ if (stem_dir)
+ {
+ count[stem_dir] ++;
+ total[stem_dir] += max (int (- stem_dir * Stem::head_positions (s) [-stem_dir]), 0);
+ }
+ }
SCM func = me->get_property ("dir-function");
SCM s = scm_call_2 (func,
{
Grob *s = stems[i];
- SCM forcedir = s->get_property ("direction");
+ SCM forcedir = s->get_property_data (ly_symbol2scm ("direction"));
if (!to_dir (forcedir))
set_grob_direction (s, d);
}
*/
head_extents += stem->relative_coordinate (common, Y_AXIS);
- if (to_dir (stem->get_property ("direction")))
+ if (to_dir (stem->get_property_data (ly_symbol2scm ("direction"))))
{
Direction stemdir = to_dir (stem->get_property ("direction"));
head_extents[-stemdir] = -stemdir * infinity_f;
me->set_property ("shorten", scm_from_double (shorten_f));
}
-/* Call list of y-dy-callbacks, that handle setting of
- grob-properties
-*/
-MAKE_SCHEME_CALLBACK (Beam, after_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Beam, calc_positions, 1);
SCM
-Beam::after_line_breaking (SCM smob)
+Beam::calc_positions (SCM smob)
{
Grob *me = unsmob_grob (smob);
-
- position_beam (me);
- return SCM_UNSPECIFIED;
-}
-
-void
-Beam::position_beam (Grob *me)
-{
if (!me->is_live ())
- return;
- if (to_boolean (me->get_property ("positioning-done")))
- return;
-
- me->set_property ("positioning-done", SCM_BOOL_T);
+ return SCM_EOL;
- /* Copy to mutable list. */
- SCM s = ly_deep_copy (me->get_property ("positions"));
- me->set_property ("positions", s);
+ (void) me->get_property ("direction");
+
+ SCM posns = scm_cons (SCM_BOOL_F, SCM_BOOL_F);
+ me->set_property ("positions", posns);
- if (scm_car (s) == SCM_BOOL_F)
- {
- // one wonders if such genericity is necessary --hwn.
- SCM callbacks = me->get_property ("position-callbacks");
- for (SCM i = callbacks; scm_is_pair (i); i = scm_cdr (i))
- scm_call_1 (scm_car (i), me->self_scm ());
- }
+ SCM callbacks = me->get_property ("position-callbacks");
+ for (SCM i = callbacks; scm_is_pair (i); i = scm_cdr (i))
+ scm_call_1 (scm_car (i), me->self_scm ());
+ /*
+ TODO: move this in separate calc function.
+ */
set_stem_lengths (me);
+ return SCM_UNSPECIFIED;
}
+
void
set_minimum_dy (Grob *me, Real *dy)
{
if (scm_is_pair (s) && scm_is_number (scm_car (s)))
pos = ly_scm2interval (s);
else
- {
- /*
- UGH. TODO: fix dependency tracking.
- */
- position_beam (beam);
- pos = ly_scm2interval (beam->get_property ("positions"));
- }
+ programming_error ("positions property should always be pair of numbers.");
Real staff_space = Staff_symbol_referencer::staff_space (rest);
return bc;
}
-ADD_INTERFACE (Beam, "beam-interface",
+ADD_INTERFACE (Beam,
+ "beam-interface",
+
"A beam. \n\n"
"The @code{thickness} property is the weight of beams, "
- "measured in staffspace",
+ "measured in staffspace. The @code{direction} property is not user-serviceable. Use "
+ "the @code{direction} property of @code{Stem} instead. "
+
+ ,
+
+ /* properties */
"auto-knee-gap "
"beamed-stem-shorten "
"break-overshoot "
"concaveness "
"damping "
"details "
+ "direction "
"dir-function "
"flag-width-function "
"gap "
"least-squares-dy "
"neutral-direction "
"position-callbacks "
- "positioning-done "
"positions "
"quant-score "
"shorten "
#include "paper-column.hh"
#include "align-interface.hh"
-MAKE_SCHEME_CALLBACK (Break_align_interface, alignment_callback, 2);
-SCM
-Break_align_interface::alignment_callback (SCM element_smob, SCM axis)
-{
- Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) scm_to_int (axis);
-
- assert (a == X_AXIS);
- Grob *par = me->get_parent (a);
- if (par && !to_boolean (par->get_property ("positioning-done")))
- {
- par->set_property ("positioning-done", SCM_BOOL_T);
- Break_align_interface::do_alignment (par);
- }
-
- return scm_from_double (0);
-}
MAKE_SCHEME_CALLBACK (Break_align_interface, self_align_callback, 2);
SCM
void
Break_align_interface::add_element (Grob *me, Grob *toadd)
{
- Axis_group_interface::add_element (me, toadd);
+ Align_interface::add_element (me, toadd);
}
-void
-Break_align_interface::do_alignment (Grob *grob)
+MAKE_SCHEME_CALLBACK(Break_align_interface, calc_positioning_done, 1)
+SCM
+Break_align_interface::calc_positioning_done (SCM smob)
{
+ Grob *grob = unsmob_grob (smob);
Item *me = dynamic_cast<Item *> (grob);
Link_array<Grob> elems = ordered_elements (me);
}
if (total_extent.is_empty ())
- return;
+ return SCM_BOOL_T;
if (me->break_status_dir () == LEFT)
alignment_off = -total_extent[RIGHT] - extra_right_space;
here += offsets[i];
elems[i]->translate_axis (here, X_AXIS);
}
+
+ return SCM_BOOL_T;
}
ADD_INTERFACE (Break_aligned_interface, "break-aligned-interface",
ADD_INTERFACE (Break_align_interface, "break-alignment-interface",
"The object that performs break aligment. See @ref{break-aligned-interface}.",
- "positioning-done break-align-orders");
+
+ /* properties */
+ "positioning-done "
+ "break-align-orders");
*/
#include "directional-element-interface.hh"
+#include "warn.hh"
Direction
get_grob_direction (Grob *me)
{
SCM d = me->get_property ("direction");
+ if (d == ly_symbol2scm ("calculation-in-progress"))
+ {
+ programming_error ("Grob direction requested while calculation in progress. ");
+ return UP;
+ }
if (!is_direction (d))
return CENTER;
TODO: let Dot_column communicate with stem via Note_column.
*/
-MAKE_SCHEME_CALLBACK (Dot_column, force_shift_callback, 2);
-SCM
-Dot_column::force_shift_callback (SCM element_smob, SCM axis)
-{
- Grob *me = unsmob_grob (element_smob);
- (void) axis;
- assert (scm_to_int (axis) == Y_AXIS);
- me = me->get_parent (X_AXIS);
-
- if (!to_boolean (me->get_property ("positioning-done")))
- {
- me->set_property ("positioning-done", SCM_BOOL_T);
-
- do_shifts (me);
- }
- return scm_from_double (0.0);
-}
-
MAKE_SCHEME_CALLBACK (Dot_column, side_position, 2);
SCM
Dot_column::side_position (SCM element_smob, SCM axis)
This will add the stem to the support if a flag collision happens.
*/
- Stem::stem_end_position (stem);
+ stem->get_property ("stem-end-position");
}
+
return Side_position_interface::aligned_side (element_smob, axis);
}
}
}
+MAKE_SCHEME_CALLBACK(Dot_column, calc_positioning_done, 1);
SCM
-Dot_column::do_shifts (Grob *me)
+Dot_column::calc_positioning_done (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
Link_array<Grob> dots
= extract_grob_array (me, "dots");
i != cfg.end (); i++)
Staff_symbol_referencer::set_position (i->second.dot_, i->first);
- return SCM_UNSPECIFIED;
+ return SCM_BOOL_T;
}
void
Side_position_interface::add_support (me, rh);
Pointer_group_interface::add_grob (me, ly_symbol2scm ("dots"), d);
- d->add_offset_callback (Dot_column::force_shift_callback_proc, Y_AXIS);
+ d->add_offset_callback (Grob::other_axis_parent_positioning_proc, Y_AXIS);
Axis_group_interface::add_element (me, d);
}
}
-ADD_INTERFACE (Dot_column, "dot-column-interface",
+ADD_INTERFACE (Dot_column,
+ "dot-column-interface",
+
"Groups dot objects so they form a column, and position dots so they do not "
"clash with staff lines ",
- "positioning-done direction stem");
+
+ /* properties */
+ "positioning-done "
+ "direction "
+ "stem");
"The dots to go with a notehead or rest."
"@code{direction} sets the preferred direction to move in case of staff "
"line collisions.",
- "direction dot-count");
+
+ /* properties */
+ "direction "
+ "dot-count");
if (to_dir (e->get_property ("side-relative-direction")))
e->set_object ("direction-source", inf.grob ()->self_scm ());
- /*
- add dep ?
- */
- e->add_dependency (inf.grob ());
Side_position_interface::add_support (e, inf.grob ());
}
}
//#define PROFILE_PROPERTY_ACCESSES
+/*
+ Ugh C&P Coding.
+ Retrieve property without triggering callback.
+ */
SCM
-Grob::internal_get_property (SCM sym) const
+Grob::get_property_data (SCM sym) const
{
#ifndef NDEBUG
if (profile_property_accesses)
note_property_access (&grob_property_lookup_table, sym);
#endif
+
+ SCM handle = scm_sloppy_assq (sym, mutable_property_alist_);
+ if (handle != SCM_BOOL_F)
+ return scm_cdr (handle);
- SCM s = scm_sloppy_assq (sym, mutable_property_alist_);
- if (s != SCM_BOOL_F)
- return scm_cdr (s);
+ handle = scm_sloppy_assq (sym, immutable_property_alist_);
+
+ if (do_internal_type_checking_global && scm_is_pair (handle))
+ {
+ if (!type_check_assignment (sym, scm_cdr (handle),
+ ly_symbol2scm ("backend-type?")))
+ abort ();
- s = scm_sloppy_assq (sym, immutable_property_alist_);
+ check_interfaces_for_property (this, sym);
+ }
+
+ return (handle == SCM_BOOL_F) ? SCM_EOL : scm_cdr (handle);
+}
+
+SCM
+Grob::internal_get_property (SCM sym) const
+{
+#ifndef NDEBUG
+ if (profile_property_accesses)
+ note_property_access (&grob_property_lookup_table, sym);
+#endif
+
+ SCM handle = scm_sloppy_assq (sym, mutable_property_alist_);
+ if (handle != SCM_BOOL_F)
+ return scm_cdr (handle);
- if (do_internal_type_checking_global && scm_is_pair (s))
+ handle = scm_sloppy_assq (sym, immutable_property_alist_);
+
+ if (do_internal_type_checking_global && scm_is_pair (handle))
{
- if (!type_check_assignment (sym, scm_cdr (s),
+ if (!type_check_assignment (sym, scm_cdr (handle),
ly_symbol2scm ("backend-type?")))
abort ();
check_interfaces_for_property (this, sym);
}
- return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s);
+
+ if (handle == SCM_BOOL_F)
+ {
+ SCM value = ((Grob*) this)->try_callback (sym);
+ if (value != SCM_UNSPECIFIED)
+ return value;
+ }
+
+ return (handle == SCM_BOOL_F) ? SCM_EOL : scm_cdr (handle);
+}
+
+#ifndef NDEBUG
+#include "protected-scm.hh"
+Protected_scm grob_property_callback_stack = SCM_EOL;
+bool debug_property_callbacks;
+#endif
+
+SCM
+Grob::try_callback (SCM sym)
+{
+ SCM handle = scm_sloppy_assq (sym, property_callbacks_);
+ if (scm_is_pair (handle))
+ {
+ SCM proc = scm_cdr (handle);
+ if (ly_is_procedure (proc))
+ {
+ SCM marker = ly_symbol2scm ("calculation-in-progress");
+ /*
+ need to put a value in SYM to ensure that we don't get a
+ cyclic call chain.
+ */
+ mutable_property_alist_
+ = scm_assq_set_x (mutable_property_alist_, sym, marker);
+
+#ifndef NDEBUG
+ if (debug_property_callbacks)
+ grob_property_callback_stack = scm_acons (sym, proc, grob_property_callback_stack);
+#endif
+ SCM value = scm_call_1 (proc, self_scm ());
+#ifndef NDEBUG
+ if (debug_property_callbacks)
+ grob_property_callback_stack = scm_cdr (grob_property_callback_stack);
+#endif
+
+ /*
+ If the function returns SCM_UNSPECIFIED, we assume the
+ property has been set with an explicit set_property()
+ call.
+ */
+ if (value == SCM_UNSPECIFIED)
+ value = internal_get_property (sym);
+ else
+ internal_set_property (sym, value);
+
+ return value;
+ }
+ else
+ programming_error ("Callback should be procedure type");
+ }
+
+ return SCM_UNSPECIFIED;
}
void
{
Grob *s = (Grob *) SCM_CELL_WORD_1 (ses);
scm_gc_mark (s->immutable_property_alist_);
+ scm_gc_mark (s->property_callbacks_);
if (s->key_)
scm_gc_mark (s->key_->self_scm ());
#include "ly-smobs.icc"
#include "output-def.hh"
+MAKE_SCHEME_CALLBACK(Grob, same_axis_parent_positioning, 2);
+SCM
+Grob::same_axis_parent_positioning (SCM element_smob, SCM axis)
+{
+ Grob *me = unsmob_grob (element_smob);
+ Axis ax = other_axis ((Axis)scm_to_int (axis));
+
+ Grob *par = me->get_parent (ax);
+ if (par)
+ par->get_property ("positioning-done");
+
+ return scm_from_double (0.0);
+}
+
+MAKE_SCHEME_CALLBACK(Grob,other_axis_parent_positioning, 2);
+SCM
+Grob::other_axis_parent_positioning (SCM element_smob, SCM axis)
+{
+ Grob *me = unsmob_grob (element_smob);
+ Axis ax = other_axis ((Axis) scm_to_int (axis));
+
+ Grob *par = me->get_parent (ax);
+ if (par)
+ par->get_property ("positioning-done");
+
+ return scm_from_double (0.0);
+}
+
+
+
Grob *
Grob::clone (int count) const
{
immutable_property_alist_ = basicprops;
mutable_property_alist_ = SCM_EOL;
object_alist_ = SCM_EOL;
-
+ property_callbacks_ = SCM_EOL;
+
/* We do smobify_self () as the first step. Since the object lives
on the heap, none of its SCM variables are protected from
GC. After smobify_self (), they are. */
creation. Convenient eg. when using \override with
StaffSymbol. */
+ property_callbacks_ = get_property ("callbacks");
+
SCM off_callbacks[] = {
get_property ("X-offset-callbacks"),
get_property ("Y-offset-callbacks")
&& ly_is_procedure (get_property ("print-function")))
dim_cache_[a].dimension_callback_ = stencil_extent_proc;
}
+
}
Grob::Grob (Grob const &s, int copy_index)
immutable_property_alist_ = s.immutable_property_alist_;
mutable_property_alist_ = ly_deep_copy (s.mutable_property_alist_);
interfaces_ = s.interfaces_;
+ property_callbacks_ = s.property_callbacks_;
object_alist_ = SCM_EOL;
/* No properties are copied. That is the job of
return 0;
}
-void
-Grob::add_dependency (Grob *e)
-{
- if (e)
- Pointer_group_interface::add_grob (this, ly_symbol2scm ("dependencies"), e);
- else
- programming_error ("null dependency added");
-}
void
Grob::handle_broken_dependencies ()
mutable_property_alist_ = SCM_EOL;
object_alist_ = SCM_EOL;
+ property_callbacks_ = SCM_EOL;
immutable_property_alist_ = SCM_EOL;
interfaces_ = SCM_EOL;
"lists of other objects, or results from computations are stored in"
"mutable properties: every call to set-grob-property (or its C++ equivalent) "
"sets a mutable property. ",
- "X-offset-callbacks Y-offset-callbacks X-extent-callback stencil cause "
- "Y-extent-callback print-function extra-offset spacing-procedure "
- "context staff-symbol interfaces dependencies X-extent Y-extent extra-X-extent "
- "meta layer before-line-breaking-callback "
- "color "
+
+ /* properties */
+ "X-extent "
+ "X-extent-callback "
+ "X-offset-callbacks "
+ "Y-extent "
+ "Y-extent-callback "
+ "Y-offset-callbacks "
+ "after-line-breaking-callback "
"axis-group-parent-X "
"axis-group-parent-Y "
- "after-line-breaking-callback extra-Y-extent minimum-X-extent "
- "minimum-Y-extent transparent");
+ "before-line-breaking-callback "
+ "callbacks "
+ "cause "
+ "color "
+ "context "
+ "extra-X-extent "
+ "extra-Y-extent "
+ "extra-offset "
+ "interfaces "
+ "layer "
+ "meta "
+ "minimum-X-extent "
+ "minimum-Y-extent "
+ "print-function "
+ "spacing-procedure "
+ "staff-symbol "
+ "stencil "
+ "transparent"
+ );
+
void
Hara_kiri_group_spanner::add_interesting_item (Grob *me, Grob *n)
{
- me->add_dependency (n);
Pointer_group_interface::add_grob (me, ly_symbol2scm ("items-worth-living"), n);
}
"A group spanner that keeps track of interesting items. If it "
"doesn't contain any after linebreaking, then it "
"will remove itself and all its children.",
- "items-worth-living remove-first");
+
+
+ /* properties */
+ "items-worth-living "
+ "remove-first");
Link_array<Grob> *break_reminder,
Link_array<Grob> *real_acc);
- static SCM position_accidentals (Grob *);
+ DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
static bool has_interface (Grob *);
};
#endif /* ACCIDENTAL_PLACEMENT_HH */
struct Align_interface
{
+ DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK (fixed_distance_alignment_callback, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK (stretch_after_break, (SCM element));
static void align_elements_to_extents (Grob *, Axis a);
static void set_axis (Grob *, Axis);
static Axis axis (Grob *);
- static void add_element (Grob *, Grob *, SCM callback);
+ static void add_element (Grob *, Grob *);
static int get_count (Grob *, Grob *);
static bool has_interface (Grob *);
static void set_beaming (Grob *, Beaming_info_list const *);
static void set_stemlens (Grob *);
static int get_beam_count (Grob *me);
- static void position_beam (Grob *me);
static Real get_beam_translation (Grob *me);
static Real get_thickness (Grob *me);
static void connect_beams (Grob *me);
DECLARE_SCHEME_CALLBACK (rest_collision_callback, (SCM element, SCM axis));
DECLARE_SCHEME_CALLBACK (space_function, (SCM, SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
- DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
- DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
/* position callbacks */
DECLARE_SCHEME_CALLBACK (least_squares, (SCM));
class Break_align_interface
{
public:
- static void do_alignment (Grob *);
static Link_array<Grob> ordered_elements (Grob *me);
static bool has_interface (Grob *);
static void add_element (Grob *me, Grob *add);
- DECLARE_SCHEME_CALLBACK (alignment_callback, (SCM element, SCM axis));
+ DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element));
DECLARE_SCHEME_CALLBACK (self_align_callback, (SCM element, SCM axis));
};
struct Break_aligned_interface
static bool has_interface (Grob *);
DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM, SCM));
DECLARE_SCHEME_CALLBACK (side_position, (SCM, SCM));
- static SCM do_shifts (Grob *);
+ DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
};
#endif // DOT_COLUMN_HH
private:
DECLARE_SMOBS (Grob, foo);
void init ();
+
+
+
protected:
Object_key const *key_;
SCM immutable_property_alist_;
SCM mutable_property_alist_;
SCM object_alist_;
-
+ SCM property_callbacks_;
+
/*
If this is a property, it accounts for 25% of the property
lookups.
DECLARE_CLASSNAME(Grob);
public:
+ DECLARE_SCHEME_CALLBACK(same_axis_parent_positioning, (SCM, SCM));
+ DECLARE_SCHEME_CALLBACK(other_axis_parent_positioning, (SCM, SCM));
+
Object_key const *get_key () const;
Grob *original_;
/*
Properties
*/
- SCM internal_get_property (SCM) const;
- SCM internal_get_object (SCM) const;
+ SCM internal_get_property (SCM symbol) const;
+ SCM get_property_data (SCM symbol) const;
+ SCM internal_get_object (SCM symbol) const;
void internal_set_property (SCM sym, SCM val);
void internal_set_object (SCM sym, SCM val);
+ SCM try_callback (SCM);
/*
JUNKME.
*/
#include "grob-interface.hh"
#include "lily-proto.hh"
+#include "lily-guile.hh"
struct Laissez_vibrer_tie_column
{
static bool has_interface (Grob *);
- static void set_directions (Grob *me);
+
+ DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
};
{
static bool has_interface (Grob *);
- DECLARE_SCHEME_CALLBACK (print, (SCM));
- static void set_direction (Grob *);
+ DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
static int compare (Grob *const &s1,
Grob *const &s2);
static int get_position (Grob *);
static Drul_array<Link_array<Grob> > get_clash_groups (Grob *me);
DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis));
- static void do_shifts (Grob *);
+ DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM smob));
static void add_column (Grob *me, Grob *ncol);
static bool has_interface (Grob *);
};
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (brew_ez_stencil, (SCM));
DECLARE_SCHEME_CALLBACK (extent, (SCM, SCM));
+ DECLARE_SCHEME_CALLBACK (stem_x_shift, (SCM, SCM));
static bool has_interface (Grob *);
static Real stem_attachment_coordinate (Grob *, Axis a);
static int get_balltype (Grob *);
static bool has_interface (Grob *);
DECLARE_SCHEME_CALLBACK (force_shift_callback, (SCM element, SCM axis));
+ DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM element));
DECLARE_SCHEME_CALLBACK (force_shift_callback_rest, (SCM element, SCM axis));
static SCM do_shift (Grob *);
};
static void add_column (Grob *me, Grob *col);
static void add_extra_encompass (Grob *me, Grob *col);
DECLARE_SCHEME_CALLBACK (print, (SCM));
- DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
DECLARE_SCHEME_CALLBACK (height, (SCM, SCM));
DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM));
static bool has_interface (Grob *);
static bool is_invisible (Grob *);
static Interval head_positions (Grob *);
static Real get_default_stem_end_position (Grob *me);
- static void position_noteheads (Grob *);
static Real stem_end_position (Grob *);
static Stencil flag (Grob *);
static Stencil get_translated_flag (Grob*);
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (offset_callback, (SCM element, SCM axis));
- DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_stem_end_position, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_stem_info, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
DECLARE_SCHEME_CALLBACK (width_callback, (SCM smob, SCM axis));
DECLARE_SCHEME_CALLBACK (height, (SCM, SCM));
-
-private:
- static void calc_stem_info (Grob *);
};
#endif
public:
static bool has_interface (Grob *);
static void add_tie (Grob *me, Grob *);
- DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
static void set_directions (Grob *me);
static void new_directions (Grob *me);
public:
static void set_head (Grob *, Direction, Grob *head);
static bool has_interface (Grob *);
- static void set_direction (Grob *);
static Grob *head (Grob *, Direction);
static int get_column_rank (Grob *, Direction);
static int get_position (Grob *);
static void set_default_control_points (Grob *);
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM));
static int compare (Grob *const &s1,
Grob *const &s2);
class Tuplet_bracket
{
public:
- DECLARE_SCHEME_CALLBACK (after_line_breaking, (SCM));
- DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_direction, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
DECLARE_SCHEME_CALLBACK (print, (SCM));
static bool has_interface (Grob *);
/*
Cut & paste from tie-column.cc
*/
-void
-Laissez_vibrer_tie_column::set_directions (Grob *me)
+MAKE_SCHEME_CALLBACK(Laissez_vibrer_tie_column, calc_positioning_done, 1);
+SCM
+Laissez_vibrer_tie_column::calc_positioning_done (SCM smob)
{
- if (!to_boolean (me->get_property ("positioning-done")))
- me->set_property ("positioning-done", SCM_BOOL_T);
- else
- return;
-
-
+ Grob *me = unsmob_grob (smob);
+
extract_grob_set (me, "ties", lv_ro_ties);
Link_array<Grob> lv_ties (lv_ro_ties);
for (int i = 0; i < lv_ties.size (); i++)
{
Tie_configuration conf;
- conf.dir_ = get_grob_direction (lv_ties[i]);
+ conf.dir_ = CENTER;
Item *head = unsmob_item (lv_ties[i]->get_object ("note-head"));
heads.push (head);
details );
set_grob_direction (lv_ties[i], tie_configs[i].dir_);
}
+
+ return SCM_BOOL_T;
}
"x-gap "
);
-MAKE_SCHEME_CALLBACK (Laissez_vibrer_tie, print, 1);
+MAKE_SCHEME_CALLBACK(Laissez_vibrer_tie, calc_control_points, 1)
SCM
-Laissez_vibrer_tie::print (SCM smob)
+Laissez_vibrer_tie::calc_control_points (SCM smob)
{
Grob *me = unsmob_grob (smob);
- if (CENTER == get_grob_direction (me))
- set_direction (me);
-
- if (!get_grob_direction (me))
- me->programming_error ("lv. tie direction not set.");
-
- SCM cp = me->get_property ("control-points");
- if (!scm_is_pair (cp))
- if (Laissez_vibrer_tie_column::has_interface (me->get_parent (Y_AXIS)))
- {
- Laissez_vibrer_tie_column::set_directions (me->get_parent (Y_AXIS));
- }
-
- return Tie::print (smob);
+ if (Laissez_vibrer_tie_column::has_interface (me->get_parent (Y_AXIS)))
+ {
+ me->get_parent (Y_AXIS)->get_property ("positioning-done");
+ }
+ else
+ {
+ programming_error ("lv tie without Laissez_vibrer_tie_column. Killing lv tie.");
+ me->suicide ();
+ }
+
+ return SCM_UNSPECIFIED;
}
-void
-Laissez_vibrer_tie::set_direction (Grob *me)
+MAKE_SCHEME_CALLBACK(Laissez_vibrer_tie, calc_direction, 1)
+SCM
+Laissez_vibrer_tie::calc_direction (SCM smob)
{
- if (!get_grob_direction (me))
+ Grob *me = unsmob_grob (smob);
+ if (Laissez_vibrer_tie_column::has_interface (me->get_parent (Y_AXIS)))
+ me->get_parent (Y_AXIS)->get_property("positioning-done");
+ else
{
- if (Laissez_vibrer_tie_column::has_interface (me->get_parent (Y_AXIS)))
- Laissez_vibrer_tie_column::set_directions (me->get_parent (Y_AXIS));
- else
- {
- programming_error ("lv tie without Laissez_vibrer_tie_column");
- set_grob_direction (me, UP);
- }
+ programming_error ("lv tie without Laissez_vibrer_tie_column");
+ set_grob_direction (me, UP);
}
+
+ return SCM_UNSPECIFIED;
}
int
group.group_ = make_spanner ("BassFigureLine", SCM_EOL);
group.group_->set_bound (LEFT, muscol);
Align_interface::add_element (alignment_,
- group.group_,
- Align_interface::alignment_callback_proc);
+ group.group_);
}
if (scm_memq (fig, get_property ("implicitBassFigures")) != SCM_BOOL_F)
#include "dot-column.hh"
#include "pointer-group-interface.hh"
-MAKE_SCHEME_CALLBACK (Note_collision_interface, force_shift_callback, 2);
-SCM
-Note_collision_interface::force_shift_callback (SCM element_smob, SCM axis)
-{
- Grob *me = unsmob_grob (element_smob);
- Axis a = (Axis) scm_to_int (axis);
- assert (a == X_AXIS);
-
- me = me->get_parent (a);
-
- if (! to_boolean (me->get_property ("positioning-done")))
- {
- me->set_property ("positioning-done", SCM_BOOL_T);
- do_shifts (me);
- }
-
- return scm_from_double (0.0);
-}
void
check_meshing_chords (Grob *me,
while ((flip (&d)) != UP);
}
-void
-Note_collision_interface::do_shifts (Grob *me)
+
+MAKE_SCHEME_CALLBACK(Note_collision_interface, calc_positioning_done, 1)
+SCM
+Note_collision_interface::calc_positioning_done (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
Drul_array<Link_array<Grob> > cg = get_clash_groups (me);
SCM autos (automatic_shift (me, cg));
for (int i = 0; i < amounts.size (); i++)
done[i]->translate_axis (amounts[i] - left_most, X_AXIS);
+
+ return SCM_BOOL_T;
}
-Drul_array < Link_array<Grob>
-> Note_collision_interface::get_clash_groups (Grob *me)
+Drul_array < Link_array<Grob> >
+Note_collision_interface::get_clash_groups (Grob *me)
{
Drul_array<Link_array<Grob> > clash_groups;
void
Note_collision_interface::add_column (Grob *me, Grob *ncol)
{
- ncol->add_offset_callback (Note_collision_interface::force_shift_callback_proc, X_AXIS);
+ ncol->add_offset_callback (Grob::same_axis_parent_positioning_proc, X_AXIS);
Axis_group_interface::add_element (me, ncol);
- me->add_dependency (ncol);
}
ADD_INTERFACE (Note_collision_interface, "note-collision-interface",
"are to be set in @ref{note-column-interface}: these are "
"@code{force-hshift} and @code{horizontal-shift}.",
- "merge-differently-dotted merge-differently-headed positioning-done");
+ /* properties */
+ "merge-differently-dotted "
+ "merge-differently-headed "
+ "positioning-done");
Note_column::set_stem (Grob *me, Grob *stem)
{
me->set_object ("stem", stem->self_scm ());
- me->add_dependency (stem);
Axis_group_interface::add_element (me, stem);
}
return out;
}
+/*
+ TODO: make stem X-parent of notehead.
+ */
+MAKE_SCHEME_CALLBACK (Note_head, stem_x_shift, 2);
+SCM
+Note_head::stem_x_shift (SCM smob, SCM axis)
+{
+ (void) axis;
+
+ Grob *me = unsmob_grob (smob);
+ Grob *stem = unsmob_grob (me->get_object ("stem"));
+ if (stem)
+ (void) stem->get_property ("positioning-done");
+
+ return scm_from_int (0);
+}
+
MAKE_SCHEME_CALLBACK (Note_head, print, 1);
SCM
Note_head::print (SCM smob)
if (Note_column::has_rests (them))
{
- Grob *rc = unsmob_grob (them->get_object ("rest-collision"));
+ Grob *collision = unsmob_grob (them->get_object ("rest-collision"));
- if (rc && !to_boolean (rc->get_property ("positioning-done")))
+ if (collision)
{
- rc->set_property ("positioning-done", SCM_BOOL_T);
- do_shift (rc);
+ (void) collision->get_property ("positioning-done");
}
}
return scm_from_double (0.0);
void
Rest_collision::add_column (Grob *me, Grob *p)
{
- me->add_dependency (p);
Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), p);
/*
TODO: look at horizontal-shift to determine ordering between rests
for more than two voices.
*/
+MAKE_SCHEME_CALLBACK(Rest_collision, calc_positioning_done, 1);
SCM
-Rest_collision::do_shift (Grob *me)
+Rest_collision::calc_positioning_done (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
extract_grob_set (me, "elements", elts);
Link_array<Grob> rests;
ADD_INTERFACE (Rest_collision, "rest-collision-interface",
"Move around ordinary rests (not multi-measure-rests) to avoid "
"conflicts.",
- "minimum-distance positioning-done elements");
+
+ /* properties */
+ "minimum-distance "
+ "positioning-done "
+ "elements");
#include "pointer-group-interface.hh"
void
-Script_column::add_staff_sided (Grob *me, Item *i)
+Script_column::add_staff_sided (Grob *me, Item *item)
{
- SCM p = i->get_property ("script-priority");
+ SCM p = item->get_property ("script-priority");
if (!scm_is_number (p))
return;
- Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), i);
-
- me->add_dependency (i);
+ Pointer_group_interface::add_grob (me, ly_symbol2scm ("scripts"), item);
}
LY_DEFINE (ly_grob_script_priority_less, "ly:grob-script-priority-less",
if (to_dir (e->get_property ("side-relative-direction")))
e->set_object ("direction-source", info.grob ()->self_scm ());
- /* FIXME: add dependency */
- e->add_dependency (info.grob ());
Side_position_interface::add_support (e, info.grob ());
}
}
&& !e->get_parent (Y_AXIS))
{
e->set_parent (info.grob (), Y_AXIS);
- e->add_dependency (info.grob ());
}
Side_position_interface::add_support (e, info.grob ());
}
ADD_INTERFACE (Text_script, "text-script-interface",
"An object that is put above or below a note",
+
+ /* properties */
"add-stem-support "
"avoid-slur "
"script-priority "
Separating_group_spanner::add_spacing_unit (Grob *me, Item *i)
{
Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), i);
- me->add_dependency (i);
}
ADD_INTERFACE (Separating_group_spanner, "separation-spanner-interface",
"A spanner that calculates spacing constraints (\"rods\") "
"using the @code{separation-item-interface} grobs in @code{elements}.",
- "elements padding");
+
+ /* properties */
+ "elements "
+ "padding");
musical_dy_ = 0.0;
}
-void
-set_slur_control_points (Grob *me)
+
+MAKE_SCHEME_CALLBACK(Slur, calc_control_points, 1)
+SCM
+Slur::calc_control_points (SCM smob)
{
+ Spanner *me = unsmob_spanner (smob);
+
Slur_score_state state;
state.fill (me);
if (!state.valid_)
- return;
+ return SCM_EOL;
state.generate_curves ();
me->relative_coordinate (state.common_[Y_AXIS], Y_AXIS));
controls = scm_cons (ly_offset2scm (o), controls);
}
- me->set_property ("control-points", controls);
+
+ return controls;
}
Bezier
#include "warn.hh"
#include "slur-scoring.hh"
-static Direction
-get_default_dir (Grob *me)
+#include "script-interface.hh"
+
+
+
+MAKE_SCHEME_CALLBACK(Slur, calc_direction, 1)
+SCM
+Slur::calc_direction (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
extract_grob_set (me, "note-columns", encompasses);
+ if (encompasses.is_empty ())
+ {
+ me->suicide ();
+ return SCM_BOOL_F;
+ }
+
Direction d = DOWN;
for (int i = 0; i < encompasses.size (); i++)
{
break;
}
}
- return d;
+ return scm_from_int (d);
}
MAKE_SCHEME_CALLBACK (Slur, height, 2);
Slur::add_extra_encompass (Grob *me, Grob *n)
{
Pointer_group_interface::add_grob (me, ly_symbol2scm ("encompass-objects"), n);
- me->add_dependency (n);
}
-#include "script-interface.hh"
+
MAKE_SCHEME_CALLBACK (Slur, outside_slur_callback, 2);
SCM
Slur::outside_slur_callback (SCM grob, SCM axis)
if (dir == CENTER)
return scm_from_int (0);
- /* FIXME: this dependency should be automatic. */
- if (scm_ilength (slur->get_property ("control-points")) < 4)
- Slur::after_line_breaking (slur->self_scm ());
-
Grob *cx = script->common_refpoint (slur, X_AXIS);
Grob *cy = script->common_refpoint (slur, Y_AXIS);
return scm_from_double (offset);
}
-MAKE_SCHEME_CALLBACK (Slur, after_line_breaking, 1);
-SCM
-Slur::after_line_breaking (SCM smob)
-{
- Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
- extract_grob_set (me, "note-columns", encompasses);
- if (encompasses.is_empty ())
- {
- me->suicide ();
- return SCM_UNSPECIFIED;
- }
-
- if (!get_grob_direction (me))
- set_grob_direction (me, get_default_dir (me));
-
- if (scm_ilength (me->get_property ("control-points")) < 4)
- set_slur_control_points (me);
- return SCM_UNSPECIFIED;
-}
ADD_INTERFACE (Slur, "slur-interface",
+
"A slur",
- "positions quant-score eccentricity encompass-objects control-points dash-period dash-fraction slur-details direction height-limit note-columns ratio thickness");
+
+ "control-points "
+ "dash-fraction "
+ "dash-period "
+ "direction "
+ "eccentricity "
+ "encompass-objects "
+ "height-limit "
+ "note-columns "
+ "positions "
+ "quant-score "
+ "ratio "
+ "slur-details "
+ "thickness ");
Span_bar::add_bar (Grob *me, Grob *b)
{
Pointer_group_interface::add_grob (me, ly_symbol2scm ("elements"), b);
-
- me->add_dependency (b);
}
MAKE_SCHEME_CALLBACK (Span_bar, print, 1);
Stem::add_head (Grob *me, Grob *n)
{
n->set_object ("stem", me->self_scm ());
- n->add_dependency (me);
if (Note_head::has_interface (n))
Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-heads"), n);
return to_dir (me->get_property ("neutral-direction"));
}
+
Real
Stem::get_default_stem_end_position (Grob *me)
{
/* URGURGURG
'set-default-stemlen' sets direction too. */
Direction dir = get_direction (me);
- if (!dir)
- {
- dir = get_default_dir (me);
- set_grob_direction (me, dir);
- }
/* Stems in unnatural (forced) direction should be shortened,
according to [Roush & Gourlay] */
return (scm_is_number (s)) ? scm_to_int (s) : 2;
}
-void
-Stem::position_noteheads (Grob *me)
+MAKE_SCHEME_CALLBACK(Stem, calc_positioning_done, 1);
+SCM
+Stem::calc_positioning_done (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
if (!head_count (me))
- return;
+ return SCM_BOOL_T;
extract_grob_set (me, "note-heads", ro_heads);
Link_array<Grob> heads (ro_heads);
lastpos = int (p);
}
+
+ return SCM_BOOL_T;
+}
+
+
+
+MAKE_SCHEME_CALLBACK(Stem, calc_direction, 1);
+SCM
+Stem::calc_direction (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Direction dir = CENTER;
+ if (Grob *beam = unsmob_grob (me->get_object ("beam")))
+ {
+ SCM ignore_me = beam->get_property ("direction");
+ (void) ignore_me;
+ dir = get_grob_direction (me);
+ }
+ else
+ dir = get_default_dir (me);
+
+ return scm_from_int (dir);
}
-MAKE_SCHEME_CALLBACK (Stem, before_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Stem, calc_stem_end_position, 1);
SCM
-Stem::before_line_breaking (SCM smob)
+Stem::calc_stem_end_position (SCM smob)
{
Grob *me = unsmob_grob (smob);
Do the calculations for visible stems, but also for invisible stems
with note heads (i.e. half notes.)
*/
+ Real pos = 0.0;
if (head_count (me))
{
- stem_end_position (me); // ugh. Trigger direction calc.
- position_noteheads (me);
+ pos = stem_end_position (me); // ugh. Trigger direction calc.
}
- return SCM_UNSPECIFIED;
+ return scm_from_double (pos);
}
/*
Grob *me = unsmob_grob (smob);
assert (a == Y_AXIS);
- /*
- ugh. - this dependency should be automatic.
+ Direction dir = get_grob_direction (me);
+
+ /* Trigger callback.
+
+ UGH. Should be automatic
*/
Grob *beam = get_beam (me);
if (beam)
- Beam::after_line_breaking (beam->self_scm ());
-
+ {
+ beam->get_property ("positions");
+ }
+
SCM mol = me->get_uncached_stencil ();
Interval iv;
if (mol != SCM_EOL)
iv = unsmob_stencil (mol)->extent (a);
- if (Grob *b = get_beam (me))
+
+ if (beam)
{
- Direction d = get_direction (me);
- if (d == CENTER)
+ if (dir == CENTER)
{
programming_error ("no stem direction");
- d = UP;
+ dir = UP;
}
- iv[d] += d * Beam::get_thickness (b) * 0.5;
+ iv[dir] += dir * Beam::get_thickness (beam) * 0.5;
}
return ly_interval2scm (iv);
Stem_info
Stem::get_stem_info (Grob *me)
{
- /* Return cached info if available */
- SCM scm_info = me->get_property ("stem-info");
- if (!scm_is_pair (scm_info))
- {
- calc_stem_info (me);
- scm_info = me->get_property ("stem-info");
- }
-
Stem_info si;
si.dir_ = get_grob_direction (me);
+
+ SCM scm_info = me->get_property ("stem-info");
si.ideal_y_ = scm_to_double (scm_car (scm_info));
si.shortest_y_ = scm_to_double (scm_cadr (scm_info));
return si;
}
/* TODO: add extra space for tremolos! */
-void
-Stem::calc_stem_info (Grob *me)
+MAKE_SCHEME_CALLBACK(Stem, calc_stem_info, 1);
+SCM
+Stem::calc_stem_info (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
Direction my_dir = get_grob_direction (me);
if (!my_dir)
Real minimum_y = note_start + minimum_length;
Real shortest_y = minimum_y * my_dir;
- me->set_property ("stem-info",
- scm_list_2 (scm_from_double (ideal_y),
- scm_from_double (shortest_y)));
+ return scm_list_2 (scm_from_double (ideal_y),
+ scm_from_double (shortest_y));
}
Slice
"In addition, it internally connects note heads, beams and"
"tremolos. "
"Rests and whole notes have invisible stems.",
- "tremolo-flag french-beaming "
- "avoid-note-head thickness "
- "stemlet-length rests "
- "stem-info beamed-lengths beamed-minimum-free-lengths "
- "beamed-extreme-minimum-free-lengths lengths beam stem-shorten "
- "duration-log beaming neutral-direction stem-end-position "
- "note-heads direction length flag-style "
- "no-stem-extend stroke-style");
+
+ /* properties */
+
+ "avoid-note-head "
+ "beam "
+ "beamed-extreme-minimum-free-lengths "
+ "beamed-lengths "
+ "beamed-minimum-free-lengths "
+ "beaming "
+ "direction "
+ "duration-log "
+ "flag-style "
+ "french-beaming "
+ "length "
+ "lengths "
+ "neutral-direction "
+ "no-stem-extend "
+ "note-heads "
+ "positioning-done "
+ "rests "
+ "stem-end-position "
+ "stem-info "
+ "stem-shorten "
+ "stemlet-length "
+ "stroke-style "
+ "thickness "
+ "tremolo-flag "
+ );
/****************************************************************/
tie->set_parent (me, Y_AXIS);
Pointer_group_interface::add_grob (me, ly_symbol2scm ("ties"), tie);
- tie->add_dependency (me);
-}
-
-void
-Tie_column::set_directions (Grob *me)
-{
- if (!to_boolean (me->get_property ("positioning-done")))
- {
- me->set_property ("positioning-done", SCM_BOOL_T);
- new_directions (me);
- }
-}
-
-
-
-MAKE_SCHEME_CALLBACK (Tie_column, after_line_breaking, 1);
-SCM
-Tie_column::after_line_breaking (SCM smob)
-{
- set_directions (unsmob_grob (smob));
- return SCM_UNSPECIFIED;
}
/*
}
while (flip (&dir) != LEFT);
}
+
return SCM_UNSPECIFIED;
}
-
-void
-Tie_column::new_directions (Grob *me)
+MAKE_SCHEME_CALLBACK(Tie_column, calc_positioning_done, 1)
+SCM
+Tie_column::calc_positioning_done (SCM smob)
{
+ Grob *me = unsmob_grob (smob);
extract_grob_set (me, "ties", ro_ties);
Link_array<Grob> ties (ro_ties);
if (!ties.size ())
- return;
+ return SCM_BOOL_T;
if (ties.size() == 1)
{
- Tie::set_default_control_points (ties[0]);
- return;
+ /*
+ Already handled by standard mechanisms.
+ */
+ return SCM_BOOL_T;
}
ties.sort (&Tie::compare);
);
set_grob_direction (ties[i], tie_configs[i].dir_);
}
+ return SCM_BOOL_T;
}
*/
#include "tie.hh"
-
-
#include "spanner.hh"
#include "lookup.hh"
#include "output-def.hh"
#include "stem.hh"
#include "note-head.hh"
#include "tie-column.hh"
+#include "grob-array.hh"
int
Tie::compare (Grob *const &s1,
Tie::set_head (Grob *me, Direction d, Grob *h)
{
dynamic_cast<Spanner *> (me)->set_bound (d, h);
- me->add_dependency (h);
}
Grob *
int
Tie::get_position (Grob *me)
{
- Direction d = head (me, LEFT) ? LEFT : RIGHT;
- return (int) Staff_symbol_referencer::get_position (head (me, d));
+ Direction d = LEFT;
+ do
+ {
+ Grob *h = head (me, d);
+ if (h)
+ return (int) Staff_symbol_referencer::get_position (h);
+ }
+ while (flip (&d) != LEFT);
+
+ /*
+
+ TODO: this is theoretically possible for ties across more than 2
+ systems.. We should look at the first broken copy.
+
+ */
+ programming_error ("Tie without heads. Suicide");
+ me->suicide ();
+ return 0;
}
/*
return UP;
}
-void
-Tie::set_direction (Grob *me)
+
+MAKE_SCHEME_CALLBACK(Tie, calc_direction, 1);
+SCM
+Tie::calc_direction (SCM smob)
{
- if (!get_grob_direction (me))
+ Grob *me = unsmob_grob (smob);
+ Grob *yparent = me->get_parent (Y_AXIS);
+ if (Tie_column::has_interface (yparent)
+ && unsmob_grob_array (yparent->get_object ("ties"))
+ && unsmob_grob_array (yparent->get_object ("ties"))->size () > 1)
{
- if (Tie_column::has_interface (me->get_parent (Y_AXIS)))
- Tie_column::set_directions (me->get_parent (Y_AXIS));
- else
- set_grob_direction (me, Tie::get_default_dir (me));
+ /* trigger positioning. */
+ (void) yparent->get_property ("positioning-done");
}
+ else
+ set_grob_direction (me, Tie::get_default_dir (me));
+
+ return SCM_UNSPECIFIED;
}
Interval
common = me->get_bound (RIGHT)->common_refpoint (common, X_AXIS);
Tie_configuration conf;
- if (!get_grob_direction (me))
- set_grob_direction (me, get_default_dir (me));
-
int tie_position = (int) Tie::get_position (me);
conf.position_ = tie_position;
me->set_property ("control-points", controls);
}
-
-
-MAKE_SCHEME_CALLBACK (Tie, print, 1);
+MAKE_SCHEME_CALLBACK(Tie, calc_control_points, 1);
SCM
-Tie::print (SCM smob)
+Tie::calc_control_points (SCM smob)
{
Grob *me = unsmob_grob (smob);
- if (CENTER == get_grob_direction (me))
- set_direction (me);
+ // trigger Tie-column
+ (void) get_grob_direction (me);
- if (!get_grob_direction (me))
- me->programming_error ("Tie direction not set.");
-
- SCM cp = me->get_property ("control-points");
- if (!scm_is_pair (cp))
- {
- /*
- UGH. dependency tracking!
- */
- if (Tie_column::has_interface (me->get_parent (Y_AXIS)))
- {
- Tie_column::set_directions (me->get_parent (Y_AXIS));
- }
-
- cp = me->get_property ("control-points");
- }
-
- if (!scm_is_pair (cp))
+ if (!scm_is_pair (me->get_property ("control-points")))
{
set_default_control_points (me);
- cp = me->get_property ("control-points");
}
- if (!scm_is_pair (cp))
- return Stencil ().smobbed_copy ();
+ return SCM_UNSPECIFIED;
+}
+
+
+MAKE_SCHEME_CALLBACK (Tie, print, 1);
+SCM
+Tie::print (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+
+ SCM cp = me->get_property ("control-points");
Real staff_thick = Staff_symbol_referencer::line_thickness (me);
Real base_thick = robust_scm2double (me->get_property ("thickness"), 1);
Stencil mol;
extract_grob_set (me, "note-columns", columns);
- {
- SCM lp = me->get_property ("left-position");
- SCM rp = me->get_property ("right-position");
-
- if (!scm_is_number (rp) || !scm_is_number (lp))
- {
- /*
- UGH. dependency tracking!
- */
- extract_grob_set (me, "tuplets", tuplets);
- for (int i = 0; i < tuplets.size (); i++)
- Tuplet_bracket::print (tuplets[i]->self_scm ());
-
- after_line_breaking (smob);
- }
- }
-
- Real ly = robust_scm2double (me->get_property ("left-position"), 0);
- Real ry = robust_scm2double (me->get_property ("right-position"), 0);
-
+ Drul_array<Real> positions = ly_scm2realdrul (me->get_property ("positions"));
+ Real dy = positions[RIGHT] - positions[LEFT];
bool equally_long = false;
Grob *par_beam = parallel_beam (me, columns, &equally_long);
Spanner *sp = dynamic_cast<Spanner *> (me);
int neighbor_idx = me->get_break_index () - break_dir;
- /*
- UGH. dependency handling.
- */
if (break_dir
&& d == RIGHT
&& neighbor_idx < orig_spanner->broken_intos_.size ())
{
Grob *neighbor = orig_spanner->broken_intos_[neighbor_idx];
- // ugh, should inspect callback?
- Tuplet_bracket::after_line_breaking (neighbor->self_scm ());
+ /* trigger possible suicide*/
+ (void) neighbor->get_property ("positions");
}
connect_to_other[d]
num.translate_axis (w / 2, X_AXIS);
num.align_to (Y_AXIS, CENTER);
- num.translate_axis ((ry - ly) / 2, Y_AXIS);
+ num.translate_axis (dy / 2, Y_AXIS);
mol.add_stencil (num);
}
while (flip (&d) != LEFT);
Stencil brack = make_bracket (me, Y_AXIS,
- Offset (w, ry - ly),
+ Offset (w, positions[RIGHT]),
height,
/*
0.1 = more space at right due to italics
mol.add_stencil (brack);
}
- mol.translate_axis (ly, Y_AXIS);
+ mol.translate_axis (positions[LEFT], Y_AXIS);
mol.translate_axis (x_span[LEFT]
- sp->get_bound (LEFT)->relative_coordinate (commonx, X_AXIS), X_AXIS);
return mol.smobbed_copy ();
Interval tuplet_y (tuplets[i]->extent (commony, Y_AXIS));
Direction d = LEFT;
- Real lp = scm_to_double (tuplets[i]->get_property ("left-position"));
- Real rp = scm_to_double (tuplets[i]->get_property ("right-position"));
- Real other_dy = rp - lp;
+ Drul_array<Real> positions = ly_scm2realdrul (tuplets[i]->get_property ("positions"));
+
+
+ Real other_dy = positions[RIGHT] - positions[LEFT];
do
{
}
}
-/*
- We depend on the beams if there are any.
-*/
-MAKE_SCHEME_CALLBACK (Tuplet_bracket, before_line_breaking, 1);
+
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_direction, 1);
SCM
-Tuplet_bracket::before_line_breaking (SCM smob)
+Tuplet_bracket::calc_direction (SCM smob)
{
Grob *me = unsmob_grob (smob);
- extract_grob_set (me, "note-columns", columns);
-
- for (int i = columns.size (); i--;)
- {
- Grob *s = Note_column::get_stem (columns[i]);
- Grob *b = s ? Stem::get_beam (s) : 0;
- if (b)
- me->add_dependency (b);
- }
- return SCM_UNSPECIFIED;
+ Direction dir = Tuplet_bracket::get_default_dir (me);
+ return scm_from_int (dir);
}
-MAKE_SCHEME_CALLBACK (Tuplet_bracket, after_line_breaking, 1);
+MAKE_SCHEME_CALLBACK (Tuplet_bracket, calc_positions, 1);
SCM
-Tuplet_bracket::after_line_breaking (SCM smob)
+Tuplet_bracket::calc_positions (SCM smob)
{
Grob *me = unsmob_grob (smob);
extract_grob_set (me, "note-columns", columns);
if (columns.is_empty())
{
me->suicide ();
- return SCM_UNSPECIFIED;
+ return scm_cons (scm_from_double (0),
+ scm_from_double (0));
}
Direction dir = get_grob_direction (me);
- if (!dir)
- {
- dir = Tuplet_bracket::get_default_dir (me);
- set_grob_direction (me, dir);
- }
-
bool equally_long = false;
Grob *par_beam = parallel_beam (me, columns, &equally_long);
dy = rp - lp;
}
- SCM lp = me->get_property ("left-position");
- SCM rp = me->get_property ("right-position");
-
- if (scm_is_number (lp) && !scm_is_number (rp))
- rp = scm_from_double (scm_to_double (lp) + dy);
- else if (scm_is_number (rp) && !scm_is_number (lp))
- lp = scm_from_double (scm_to_double (rp) - dy);
- else if (!scm_is_number (rp) && !scm_is_number (lp))
- {
- lp = scm_from_double (offset);
- rp = scm_from_double (offset + dy);
- }
-
- me->set_property ("left-position", lp);
- me->set_property ("right-position", rp);
-
- return SCM_UNSPECIFIED;
+
+ SCM x = scm_cons (scm_from_double (offset),
+ scm_from_double (offset + dy));
+
+ return x;
}
/*
Tuplet_bracket::add_column (Grob *me, Item *n)
{
Pointer_group_interface::add_grob (me, ly_symbol2scm ("note-columns"), n);
- me->add_dependency (n);
-
add_bound_item (dynamic_cast<Spanner *> (me), n);
}
Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket)
{
Pointer_group_interface::add_grob (me, ly_symbol2scm ("tuplets"), bracket);
- me->add_dependency (bracket);
}
ADD_INTERFACE (Tuplet_bracket,
"At a line break, the markups in the @code{edge-text} are printed "
"at the edges. ",
-
+
+ /* properties */
"bracket-flare "
"bracket-visibility "
"break-overshoot "
"direction "
"edge-height "
"edge-text "
- "left-position "
+ "positions "
"note-columns "
"number-visibility "
"padding "
- "right-position "
"shorten-pair "
"staff-padding "
"thickness "
Grob *before_grob = unsmob_grob (before);
Grob *after_grob = unsmob_grob (after);
- Align_interface::add_element (valign_, i.grob (),
- get_property ("verticalAlignmentChildCallback"));
+ Align_interface::add_element (valign_, i.grob ());
if (before_grob || after_grob)
{
Spanner *orig_span = dynamic_cast<Spanner *> (me->original_);
bool broken_first_bracket = orig_span && (orig_span->broken_intos_[0]
== (Spanner *)me);
-
-
Output_def *layout = me->get_layout ();
Real half_space = 0.5;
"Just like @code{GrandStaff} but with a forced distance between
the staves, so cross staff beaming and slurring can be used."
- verticalAlignmentChildCallback = #Align_interface::fixed_distance_alignment_callback
\override VerticalAlignment #'forced-distance = #12
\override VerticalAlignment #'self-alignment-Y = #0
\override VerticalAlignment #'after-line-breaking-callback
autoBeamCheck = #default-auto-beam-check
scriptDefinitions = #default-script-alist
- verticalAlignmentChildCallback = #Align_interface::alignment_callback
-
pedalSustainStrings = #'("Ped." "*Ped." "*")
pedalSustainStyle = #'text
pedalUnaCordaStrings = #'("una corda" "" "tre corde")
(useBassFigureExtenders ,boolean? "Whether to use extender lines
for repeated bass figures")
- (verticalAlignmentChildCallback ,procedure? "What callback to add
-to children of a vertical alignment. It determines what
-procedure is used on the alignment itself.")
(verticalExtent ,number-pair? "Hard coded vertical extent. The format
is a pair of dimensions, for example, this sets the sizes of a staff
to 10 (5+5) staffspaces high.
(cautionary-style ,symbol? "How to print cautionary
accidentals. Choices are @code{smaller} or
@code{parentheses}.")
+ (callbacks ,list? "An alist of (@var{symbol} . @var{procedure})
+pairs. When the grob property @var{symbol} is requested,
+@var{procedure} is invoked. The return value, if it is unequal to
+@code{#<unspecified>} is recorded as the value of the property.")
(cautionary ,boolean? "Is this a cautionary accidental?")
(concaveness ,number? "A beam is concave when its inner stems are
closer to the beam than the two outside stems. This number is a
"The thickness of ledger lines: it is the
sum of 2 numbers. The first is the factor for line thickness, and the
second for staff space. Both contributions are added.")
- (left-position ,number? "Vertical position of left part of spanner.")
(left-padding ,ly:dimension? "The amount of space that is put
left to a group of accidentals.")
(length ,ly:dimension? "User override for the stem length of
(remove-first ,boolean? "Remove the first staff of a orchestral score?")
(right-padding ,ly:dimension? "Space to insert between note and
accidentals.")
- (right-position ,number? "Vertical position of right part of spanner.")
(script-priority ,number? "A sorting key that determines in what
order a script is within a stack of scripts.")
(columns ,ly:grob-array? "list of grobs, typically containing
paper-columns or note-column objects.")
(conditional-elements ,ly:grob-array? "Internal use only")
- (dependencies ,ly:grob-array? "list of score-grob pointers that indicate
-who to compute first for certain global passes.")
(encompass-objects ,ly:grob-array? "Objects that a slur should avoid
in addition to notes and stems.")
(elements ,ly:grob-array? "list of grobs, type depending on the Grob
(AccidentalPlacement
. ((X-extent-callback . ,Axis_group_interface::group_extent_callback)
(left-padding . 0.2)
-
+ (callbacks . ((positioning-done . ,Accidental_placement::calc_positioning_done)
+ ))
;; this is quite small, but it is very ugly to have
;; accs closer to the previous note than to the next one.
(right-padding . 0.15)
. (
(axes . (,Y))
(threshold . (2 . 1000))
+ (callbacks . ((positioning-done . ,Align_interface::calc_positioning_done)
+ ))
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
(stacking-dir . -1)
(meta . ((class . Spanner)
;; rather long.
(print-function . ,Beam::print)
(gap . 0.8)
- (positions . (#f . #f))
(position-callbacks . (,Beam::least_squares
,Beam::check_concave
,Beam::slope_damping
,Beam::shift_region_to_valid
,Beam::quanting))
+ (callbacks . ((positions . ,Beam::calc_positions)
+ (direction . ,Beam::calc_direction)
+ ))
;; TODO: should be in SLT.
(thickness . 0.48) ; in staff-space
- (before-line-breaking-callback . ,Beam::before_line_breaking)
- (after-line-breaking-callback . ,Beam::after_line_breaking)
+; (before-line-breaking-callback . ,Beam::before_line_breaking)
+; (after-line-breaking-callback . ,Beam::after_line_breaking)
(neutral-direction . -1)
(dir-function . ,beam-dir-majority-median)
. (
(breakable . #t)
(stacking-dir . 1)
+ (callbacks . ((positioning-done . ,Break_align_interface::calc_positioning_done)
+ ))
(break-align-orders . ;; end of line
#((instrument-name
left-edge
(BreakAlignGroup
. (
(axes . (0))
- (X-offset-callbacks . (,Break_align_interface::alignment_callback))
(X-extent-callback . ,Axis_group_interface::group_extent_callback)
(meta . ((class . Item)
(interfaces . (break-aligned-interface
. (
(axes . (0))
(direction . ,RIGHT)
+ (callbacks . ((positioning-done . ,Dot_column::calc_positioning_done)
+ ))
(X-extent-callback . ,Axis_group_interface::group_extent_callback)
(X-offset-callbacks . (,Dot_column::side_position))
(meta . ((class . Item)
break-aligned-interface))))))
(LaissezVibrerTie
. (
- (print-function . ,Laissez_vibrer_tie::print)
+ (print-function . ,Tie::print)
+ (callbacks . ((control-points . ,Laissez_vibrer_tie::calc_control_points)
+ (direction . ,Laissez_vibrer_tie::calc_direction)
+ ))
(details . ((ratio . 0.333)
(height-limit . 1.0)))
(thickness . 1.0)
. (
(X-extent-callback . #f)
(Y-extent-callback . #f)
+ (callbacks . ((positioning-done . ,Laissez_vibrer_tie_column::calc_positioning_done)
+ ))
(meta . ((class . Item)
(interfaces . (laissez-vibrer-tie-column-interface))
))
(LigatureBracket
. (
(ligature-primitive-callback . ,Note_head::print)
+
+ ;; ugh. A ligature bracket is totally different from
+ ;; a tuplet bracket.
+ (callbacks . ((direction . ,Tuplet_bracket::calc_direction)
+ (positions . ,Tuplet_bracket::calc_positions)
+ ))
(direction . 1)
(gap . 0.0)
(padding . 2.0)
(thickness . 1.6)
(edge-height . (0.7 . 0.7))
(shorten-pair . (-0.2 . -0.2))
- (before-line-breaking-callback . ,Tuplet_bracket::before_line_breaking)
- (after-line-breaking-callback . ,Tuplet_bracket::after_line_breaking)
(print-function . ,Tuplet_bracket::print)
(meta . ((class . Spanner)
(interfaces . (tuplet-bracket-interface
(axes . (0 1))
(X-extent-callback . ,Axis_group_interface::group_extent_callback)
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
+ (callbacks . ((positioning-done . ,Note_collision_interface::calc_positioning_done)
+ ))
(meta . ((class . Item)
(interfaces . (note-collision-interface
axis-group-interface))))))
(ligature-primitive-callback . ,Note_head::print)
(glyph-name-procedure . ,find-notehead-symbol)
(Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (X-offset-callbacks . (,Note_head::stem_x_shift))
(stem-attachment-function . ,note-head-style->attachment-coordinates)
(meta . ((class . Item)
(interfaces . (rhythmic-grob-interface
(PhrasingSlur
. ((slur-details . ,default-slur-details)
+ (callbacks . ((control-points . ,Slur::calc_control_points)
+ (direction . ,Slur::calc_direction)
+ ))
(print-function . ,Slur::print)
(thickness . 1.1)
(spacing-procedure . ,Spanner::set_spacing_rods)
(minimum-length . 1.5)
- (after-line-breaking-callback . ,Slur::after_line_breaking)
(Y-extent-callback . ,Slur::height)
(height-limit . 2.0)
(ratio . 0.333)
(RestCollision
. (
(minimum-distance . 0.75)
+ (callbacks . ((positioning-done . ,Rest_collision::calc_positioning_done)
+ ))
(meta . ((class . Item)
(interfaces . (rest-collision-interface))))))
(Slur
. ((slur-details . ,default-slur-details)
+ (callbacks . ((control-points . ,Slur::calc_control_points)
+ (direction . ,Slur::calc_direction)
+ ))
(print-function . ,Slur::print)
(thickness . 1.0)
(spacing-procedure . ,Spanner::set_spacing_rods)
(minimum-length . 1.5)
- (after-line-breaking-callback . ,Slur::after_line_breaking)
(Y-extent-callback . ,Slur::height)
; Slur::height)
(height-limit . 2.0)
(Stem
. (
;; this list is rather long. Trim --hwn
- (before-line-breaking-callback . ,Stem::before_line_breaking)
+ (callbacks . ((direction . ,Stem::calc_direction)
+ (stem-end-position . ,Stem::calc_stem_end_position)
+ (stem-info . ,Stem::calc_stem_info)
+ (positioning-done . ,Stem::calc_positioning_done)
+ ))
(print-function . ,Stem::print)
(thickness . 1.3)
(Tie
. ((print-function . ,Tie::print)
+ (callbacks . ((control-points . ,Tie::calc_control_points)
+ (direction . ,Tie::calc_direction)
+ ))
(details . ((ratio . 0.333)
(height-limit . 1.0)
(between-length-limit . 1.0)))
(TieColumn
. (
- (after-line-breaking-callback . ,Tie_column::after_line_breaking)
+ (callbacks . ((positioning-done . ,Tie_column::calc_positioning_done)
+ ))
(before-line-breaking-callback . ,Tie_column::before_line_breaking)
(X-extent-callback . #f)
(Y-extent-callback . #f)
+
(meta . ((class . Spanner)
(interfaces . (tie-column-interface))))))
(thickness . 1.6)
(edge-height . (0.7 . 0.7))
(shorten-pair . (-0.2 . -0.2))
- (before-line-breaking-callback . ,Tuplet_bracket::before_line_breaking)
- (after-line-breaking-callback . ,Tuplet_bracket::after_line_breaking)
+ (callbacks . ((direction . ,Tuplet_bracket::calc_direction)
+ (positions . ,Tuplet_bracket::calc_positions)
+ ))
(print-function . ,Tuplet_bracket::print)
(font-shape . italic)
(VerticalAlignment
. (
(axes . (1))
+ (callbacks . ((positioning-done . ,Align_interface::calc_positioning_done)
+ ))
(Y-extent-callback . ,Axis_group_interface::group_extent_callback)
(X-extent-callback . ,Axis_group_interface::group_extent_callback)
(stacking-dir . -1)
(debug-enable 'backtrace)
(read-enable 'positions)))
-
(define-public tex-backend?
(member (ly:output-backend) '("texstr" "tex")))
(define-public (make-grob-property-revert grob gprop)
"Revert the grob property GPROP for GROB."
- (make-music 'OverrideProperty
+ (make-music 'RevertProperty
'symbol grob
'grob-property gprop))
;;$defaultmidi
;;$defaultlayout
- Accidental_interface::after_line_breaking
Accidental_interface::print
Ambitus::print
Arpeggio::print
Arpeggio::brew_chord_bracket
Arpeggio::width_callback
Axis_group_interface::group_extent_callback
- Bar_line::before_line_breaking
Bar_line::get_staff_bar_size
Bar_line::print
- Beam::after_line_breaking
- Beam::before_line_breaking
- Beam::check_concave
- Beam::least_squares
- Beam::print
- Beam::quanting
- Beam::shift_region_to_valid
- Beam::slope_damping
- Beam::space_function
- Break_align_interface::alignment_callback
Breathing_sign::offset_callback
- Chord_name::after_line_breaking
- Clef::before_line_breaking
Clef::print
Cluster::print
Cluster_beacon::height
Hyphen_spanner::print
Hyphen_spanner::set_spacing_rods
Key_signature_interface::print
- Line_spanner::after_line_breaking
Line_spanner::print
Lyric_extender::print
Measure_grouping::print
Note_head::print
Note_head::brew_ez_stencil
Ottava_bracket::print
- Paper_column::before_line_breaking
Paper_column::print
Percent_repeat_item_interface::beat_slash
Percent_repeat_item_interface::double_percent
Piano_pedal_bracket::print
- Rest::after_line_breaking
Rest::extent_callback
Rest::polyphonic_offset_callback
Rest::print
- Script_column::before_line_breaking
- Script_interface::before_line_breaking
Script_interface::print
Self_alignment_interface::aligned_on_parent
Self_alignment_interface::aligned_on_self
Separating_group_spanner::set_spacing_rods
Side_position_interface::aligned_on_support_refpoints
Side_position_interface::aligned_side
- Slur::after_line_breaking
Slur::height
Slur::print
Spacing_spanner::set_springs
- Span_bar::before_line_breaking
Span_bar::get_bar_size
Span_bar::print
Span_bar::width_callback
Spanner::set_spacing_rods
Staff_symbol::print
Staff_symbol_referencer::callback
- Stem::before_line_breaking
Stem::width_callback
Stem::height
Stem::offset_callback
Stem_tremolo::height
Stem_tremolo::print
Sustain_pedal::print
- System_start_delimiter::after_line_breaking
System_start_delimiter::print
Text_interface::print
Text_spanner::print
Tie::print
- Tie_column::after_line_breaking
Time_signature::print
- Tuplet_bracket::after_line_breaking
- Tuplet_bracket::before_line_breaking
Tuplet_bracket::print
Vaticana_ligature::brew_ligature_primitive
Vaticana_ligature::print