From 31a6650e2b2a5c1cae3237ee47b80cd43d084d53 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 21 Oct 2005 13:29:42 +0000 Subject: [PATCH] * lily/grob.cc: remove X-extent-callback / Y-extent-callback. * scm/define-grob-properties.scm (all-user-grob-properties): remove callback property. * lily/include/grob.hh (class Grob): remove property_callbacks_ member. Properties of procedure type are assumed to be callbacks. * lily/ligature-engraver.cc (override_stencil_callback): rewrite. Use noteHeadLigaturePrimitive as source. * scm/define-grob-properties.scm (all-internal-grob-properties): remove ligature-primitive-callback * lily/include/dimension-cache.hh (class Dimension_cache): make class, with Grob as friend. * lily/grob.cc: remove set_extent_callback(), set_extent() and has_extent_callback() * scm/translation-functions.scm (format-new-bass-figure): read figuredBassPlusDirection * scm/define-context-properties.scm (all-user-translation-properties): add figuredBassPlusDirection. * lily/staff-spacing.cc (next_notes_correction): oops. Init wishes. * lily/align-interface.cc (set_ordered): new function. * lily/grob.cc (flush_extent_cache): rewrite. * lily/dimension-cache.cc (Dimension_cache): cache extent as Interval pointer directly. * lily/main.cc (setup_paths): insert extra / . (setup_paths): junk cff entry. * lily/font-config.cc (init_fontconfig): only add type1 / otf directories. * lily/axis-group-engraver.cc (finalize): remove extraVerticalExtent, minimumVerticalExtent verticalExtent. * lily/grob.cc (Grob): don't set extent from ctor. (extent): use property callbacks. * lily/axis-group-interface.cc: remove set_axes() function. * lily/grob-property.cc (del_property): new function. --- ChangeLog | 53 ++ GNUmakefile.in | 32 +- lily/accidental-placement.cc | 3 +- lily/align-interface.cc | 3 +- lily/arpeggio.cc | 13 +- lily/axis-group-engraver.cc | 29 +- lily/axis-group-interface.cc | 69 +-- lily/balloon.cc | 15 +- lily/beam.cc | 1 + lily/dimension-cache.cc | 12 +- lily/font-config.cc | 17 +- lily/grid-line-interface.cc | 6 +- lily/grob-property.cc | 109 ++-- lily/grob-scheme.cc | 13 +- lily/grob-smob.cc | 3 - lily/grob.cc | 177 +++---- lily/hara-kiri-group-spanner.cc | 9 +- lily/include/align-interface.hh | 2 +- lily/include/arpeggio.hh | 2 +- lily/include/axis-group-interface.hh | 4 +- lily/include/dimension-cache.hh | 18 +- lily/include/grid-line-interface.hh | 2 +- lily/include/grob.hh | 15 +- lily/include/hara-kiri-group-spanner.hh | 2 +- lily/include/note-head.hh | 1 - lily/include/rest.hh | 5 +- lily/include/slur.hh | 2 +- lily/include/span-bar.hh | 2 +- lily/include/stem-tremolo.hh | 2 +- lily/include/stem.hh | 4 +- lily/ligature-engraver.cc | 26 +- lily/main.cc | 34 +- lily/mensural-ligature.cc | 2 +- lily/new-figured-bass-engraver.cc | 1 + lily/rest.cc | 29 +- lily/script-engraver.cc | 6 +- lily/separating-line-group-engraver.cc | 3 +- lily/slur.cc | 8 +- lily/span-arpeggio-engraver.cc | 2 +- lily/span-bar.cc | 10 +- lily/staff-spacing.cc | 19 +- lily/stem-tremolo.cc | 9 +- lily/stem.cc | 14 +- lily/vaticana-ligature.cc | 15 +- lily/vertical-align-engraver.cc | 5 +- scm/define-context-properties.scm | 4 +- scm/define-grob-properties.scm | 17 +- scm/define-grobs.scm | 661 ++++++++++++++---------- scm/music-functions.scm | 12 +- scm/safe-lily.scm | 5 - scm/translation-functions.scm | 5 +- stepmake/aclocal.m4 | 4 +- 52 files changed, 777 insertions(+), 739 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc6adb06b2..bbf53e7c4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,59 @@ * input/mutopia/W.A.Mozart/mozart-hrn3-defs.ily (cresc): remove space-function tweak. + * lily/grob.cc: remove X-extent-callback / Y-extent-callback. + + * scm/define-grob-properties.scm (all-user-grob-properties): + remove callback property. + + * lily/include/grob.hh (class Grob): remove property_callbacks_ + member. Properties of procedure type are assumed to be callbacks. + + * lily/ligature-engraver.cc (override_stencil_callback): + rewrite. Use noteHeadLigaturePrimitive as source. + + * scm/define-grob-properties.scm (all-internal-grob-properties): + remove ligature-primitive-callback + + * lily/include/dimension-cache.hh (class Dimension_cache): make + class, with Grob as friend. + + * lily/grob.cc: remove set_extent_callback(), set_extent() and + has_extent_callback() + + * scm/translation-functions.scm (format-new-bass-figure): read + figuredBassPlusDirection + + * scm/define-context-properties.scm + (all-user-translation-properties): add figuredBassPlusDirection. + + * lily/staff-spacing.cc (next_notes_correction): oops. Init wishes. + + * lily/align-interface.cc (set_ordered): new function. + + * lily/grob.cc (flush_extent_cache): rewrite. + + * lily/dimension-cache.cc (Dimension_cache): cache extent as + Interval pointer directly. + + * lily/main.cc (setup_paths): insert extra / . + (setup_paths): junk cff entry. + + * lily/font-config.cc (init_fontconfig): only add type1 / otf + directories. + + * lily/axis-group-engraver.cc (finalize): remove + extraVerticalExtent, minimumVerticalExtent verticalExtent. + + * lily/grob.cc (Grob): don't set extent from ctor. + (extent): use property callbacks. + + * lily/axis-group-interface.cc: remove set_axes() function. + + * lily/grob-property.cc (del_property): new function. + +2005-10-21 Han-Wen Nienhuys + * lily/font-config.cc (init_fontconfig): resurrect mf/out/ check. 2005-10-20 Jan Nieuwenhuizen diff --git a/GNUmakefile.in b/GNUmakefile.in index 3d84a8363c..7fef24ff72 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -81,8 +81,10 @@ local-WWW-post: cd $(top-build-dir) && ls *.html >> $(outdir)/weblist cat $(outdir)/weblist | (cd $(top-build-dir); GZIP=-9v tar -czf $(outdir)/web.tar.gz -T -) -share-prefix = $(top-build-dir)/share -tree-prefix = $(top-build-dir)/share/lilypond/$(TOPLEVEL_VERSION) +#share-prefix = $(top-build-dir)/share +#tree-prefix = $(top-build-dir)/share/lilypond/$(TOPLEVEL_VERSION) +share-prefix = $(outdir)/share +tree-prefix = $(share-prefix)/lilypond/$(TOPLEVEL_VERSION) src-ext = c cc yy ll hh icc py scm tex ps texi itexi tely itely sh @@ -100,8 +102,8 @@ CATALOGS = $(HELP_CATALOGS:lilypond=) $(tree-prefix)/lilypond-force link-tree: GNUmakefile # Preparing LilyPond tree for build-dir exec - cd $(top-build-dir) && rm -rf lib share - mkdir -p $(top-build-dir)/lib/$(package) + cd $(top-build-dir)/$(outbase) && rm -rf lib share + mkdir -p $(top-build-dir)/$(outbase)/lib/$(package) mkdir -p $(tree-prefix) mkdir -p $(tree-prefix)/dvips mkdir -p $(tree-prefix)/elisp @@ -113,40 +115,40 @@ $(tree-prefix)/lilypond-force link-tree: GNUmakefile mkdir -p $(tree-prefix)/fonts/map mkdir -p $(tree-prefix)/fonts/enc mkdir -p $(tree-prefix)/tex - cd $(top-build-dir)/lib && \ + cd $(top-build-dir)/$(outbase)/lib && \ ln -s ../../../python/$(outconfbase) python cd $(tree-prefix) && \ ln -s $(top-src-dir)/ly ly && \ - ln -s ../../../mf mf && \ + ln -s ../../../../mf mf && \ ln -s $(top-src-dir)/ps && \ ln -s ../../../python/$(outconfbase) python && \ ln -s $(top-src-dir)/scm && \ ln -s $(top-src-dir)/scripts scripts cd $(tree-prefix)/dvips && \ - ln -s ./../../mf/$(outconfbase) mf-out && \ + ln -s ./../../../mf/$(outconfbase) mf-out && \ ln -s $(top-src-dir)/ps cd $(tree-prefix)/tex && \ ln -s $(top-src-dir)/tex source && \ - ln -s ../../../../tex/$(outconfbase) tex-out && \ - ln -s ../../../../mf/$(outconfbase) mf-out + ln -s ../../../../../tex/$(outconfbase) tex-out && \ + ln -s ../../../../../mf/$(outconfbase) mf-out -cd $(tree-prefix)/fonts/otf && \ - ln -s ../../../../../mf/$(outconfbase)/*.otf . + ln -s ../../../../../../mf/$(outconfbase)/*.otf . -cd $(tree-prefix)/fonts/svg && \ - ln -s ../../../../../mf/$(outconfbase)/*.svg . + ln -s ../../../../../../mf/$(outconfbase)/*.svg . -cd $(tree-prefix)/fonts/tfm && \ - ln -s ../../../../../mf/$(outconfbase)/*.tfm . + ln -s ../../../../../../mf/$(outconfbase)/*.tfm . -cd $(tree-prefix)/fonts/type1 && \ - ln -s ../../../../../mf/$(outconfbase)/*.pfa . + ln -s ../../../../../../mf/$(outconfbase)/*.pfa . cd $(tree-prefix)/fonts && \ ln -s $(top-src-dir)/mf source && \ true -cd $(tree-prefix)/elisp && \ - ln -sf ../../../../../elisp/$(outconfbase)/lilypond-words.el . && \ + ln -sf ../../../../../../elisp/$(outconfbase)/lilypond-words.el . && \ ln -s $(top-src-dir)/elisp/*.el . $(foreach i,$(CATALOGS), \ mkdir -p $(share-prefix)/locale/$i/LC_MESSAGES && \ cd $(share-prefix)/locale/$i/LC_MESSAGES && \ - ln -sf ../../../../po/$(outconfbase)/$i.mo lilypond.mo &&) true + ln -sf ../../../../../po/$(outconfbase)/$i.mo lilypond.mo &&) true # touch $@ touch $(tree-prefix)/lilypond-force diff --git a/lily/accidental-placement.cc b/lily/accidental-placement.cc index 4457289235..52cf9cc5ff 100644 --- a/lily/accidental-placement.cc +++ b/lily/accidental-placement.cc @@ -389,7 +389,8 @@ Accidental_placement::calc_positioning_done (SCM smob) Interval width (left_extent[LEFT], right_extent[RIGHT]); SCM scm_width = ly_interval2scm (width); - me->set_extent (scm_width, X_AXIS); + me->flush_extent_cache (X_AXIS); + me->set_property ("X-extent", scm_width); for (int i = apes.size (); i--;) delete apes[i]; diff --git a/lily/align-interface.cc b/lily/align-interface.cc index ada7e4e3a2..034f6d58d5 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -269,9 +269,8 @@ Align_interface::add_element (Grob *me, Grob *element) } void -Align_interface::set_axis (Grob *me, Axis a) +Align_interface::set_ordered (Grob *me) { - Axis_group_interface::set_axes (me, a, a); SCM ga_scm = me->get_object ("elements"); Grob_array *ga = unsmob_grob_array (ga_scm); if (!ga) diff --git a/lily/arpeggio.cc b/lily/arpeggio.cc index 53f70cdf6b..326ef89a92 100644 --- a/lily/arpeggio.cc +++ b/lily/arpeggio.cc @@ -133,14 +133,11 @@ Arpeggio::brew_chord_bracket (SCM smob) We have to do a callback, because print () triggers a vertical alignment if it is cross-staff. */ -MAKE_SCHEME_CALLBACK (Arpeggio, width_callback, 2); +MAKE_SCHEME_CALLBACK (Arpeggio, width, 1); SCM -Arpeggio::width_callback (SCM smob, SCM axis) +Arpeggio::width (SCM smob) { Grob *me = unsmob_grob (smob); - (void) axis; - - assert (scm_to_int (axis) == X_AXIS); Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts.arpeggio"); return ly_interval2scm (arpeggio.extent (X_AXIS)); @@ -148,5 +145,9 @@ Arpeggio::width_callback (SCM smob, SCM axis) ADD_INTERFACE (Arpeggio, "arpeggio-interface", "Functions and settings for drawing an arpeggio symbol (a wavy line left to noteheads.", - "stems arpeggio-direction"); + + /* properties */ + "arpeggio-direction " + "stems " + ); diff --git a/lily/axis-group-engraver.cc b/lily/axis-group-engraver.cc index bfaf9f151e..2796f05ca4 100644 --- a/lily/axis-group-engraver.cc +++ b/lily/axis-group-engraver.cc @@ -45,28 +45,11 @@ Axis_group_engraver::get_spanner () void Axis_group_engraver::finalize () { - if (!staffline_) - return; - - String type = context ()->context_name (); - SCM dims = get_property ("verticalExtent"); - - if (is_number_pair (dims)) - staffline_->set_extent (dims, Y_AXIS); - - dims = get_property ("minimumVerticalExtent"); - if (is_number_pair (dims)) - staffline_->set_property ("minimum-Y-extent", dims); - - dims = get_property ("extraVerticalExtent"); - if (is_number_pair (dims)) - staffline_->set_property ("extra-Y-extent", dims); - - Grob *it = unsmob_grob (get_property ("currentCommandColumn")); - - staffline_->set_bound (RIGHT, it); - - staffline_ = 0; + if (staffline_) + { + Grob *it = unsmob_grob (get_property ("currentCommandColumn")); + staffline_->set_bound (RIGHT, it); + } } void @@ -99,6 +82,7 @@ Axis_group_engraver::process_acknowledged () staffline_ = 0; break; } +#if 0 else if (elts_[i]->is_empty (Y_AXIS)) { /* @@ -109,6 +93,7 @@ Axis_group_engraver::process_acknowledged () elts_[i]->set_parent (staffline_, Y_AXIS); } else +#endif add_element (elts_[i]); } } diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 2757cc52e7..0809e65b83 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -39,11 +39,9 @@ Axis_group_interface::add_element (Grob *me, Grob *e) bool Axis_group_interface::has_axis (Grob *me, Axis a) { - /* - urg. FIXME, check for Hara_kiri_group_spanner shouldn't be necessary? - */ - return me->has_extent_callback (group_extent_callback_proc, a) - || (me->has_extent_callback (Hara_kiri_group_spanner::y_extent_proc, a)); + SCM axes = me->get_property ("axes"); + + return (SCM_BOOL_F != scm_memq (scm_from_int (a), axes)); } Interval @@ -61,13 +59,25 @@ Axis_group_interface::relative_group_extent (Link_array const &elts, return r; } -MAKE_SCHEME_CALLBACK (Axis_group_interface, group_extent_callback, 2); +MAKE_SCHEME_CALLBACK (Axis_group_interface, width, 1); SCM -Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis) +Axis_group_interface::width (SCM smob) { - Grob *me = unsmob_grob (element_smob); - Axis a = (Axis) scm_to_int (scm_axis); + Grob *me = unsmob_grob (smob); + return generic_group_extent (me, X_AXIS); +} +MAKE_SCHEME_CALLBACK (Axis_group_interface, height, 1); +SCM +Axis_group_interface::height (SCM smob) +{ + Grob *me = unsmob_grob (smob); + return generic_group_extent (me, Y_AXIS); +} + +SCM +Axis_group_interface::generic_group_extent (Grob *me, Axis a) +{ extract_grob_set (me, "elements", elts); Grob *common = common_refpoint_of_array (elts, me, a); @@ -77,41 +87,6 @@ Axis_group_interface::group_extent_callback (SCM element_smob, SCM scm_axis) return ly_interval2scm (r - my_coord); } -/* - FIXME: junk this. - */ -void -Axis_group_interface::set_axes (Grob *me, Axis a1, Axis a2) -{ - SCM sa1 = scm_from_int (a1); - SCM sa2 = scm_from_int (a2); - - SCM axes = me->get_property ("axes"); - - if (!scm_is_pair (axes) - || scm_c_memq (sa1, axes) == SCM_BOOL_F - || scm_c_memq (sa2, axes) == SCM_BOOL_F) - { - SCM ax = scm_cons (sa1, SCM_EOL); - if (a1 != a2) - ax = scm_cons (sa2, ax); - me->set_property ("axes", ax); - } - - if (a1 != X_AXIS && a2 != X_AXIS) - me->set_extent (SCM_EOL, X_AXIS); - if (a1 != Y_AXIS && a2 != Y_AXIS) - me->set_extent (SCM_EOL, Y_AXIS); - - /* - why so convoluted ? (fixme/documentme?) - */ - if (me->has_extent_callback (Grob::stencil_extent_proc, a1)) - me->set_extent_callback (Axis_group_interface::group_extent_callback_proc, a1); - if (me->has_extent_callback (Grob::stencil_extent_proc, a2)) - me->set_extent_callback (Axis_group_interface::group_extent_callback_proc, a2); -} - void Axis_group_interface::get_children (Grob *me, Link_array *found) { @@ -129,5 +104,9 @@ Axis_group_interface::get_children (Grob *me, Link_array *found) } ADD_INTERFACE (Axis_group_interface, "axis-group-interface", + "An object that groups other layout objects.", - "axes elements"); + + /* properties */ + "axes " + "elements"); diff --git a/lily/balloon.cc b/lily/balloon.cc index 20508d8db3..fb7ac913d6 100644 --- a/lily/balloon.cc +++ b/lily/balloon.cc @@ -28,12 +28,7 @@ Balloon_interface::print (SCM smob) { Grob *me = unsmob_grob (smob); - SCM cb = me->get_property ("balloon-original-callback"); - SCM stil = SCM_EOL; - - if (ly_is_procedure (cb)) - stil = scm_call_1 (cb, smob); - + SCM stil = me->get_property ("original-stencil"); if (!unsmob_stencil (stil)) return stil; @@ -85,5 +80,11 @@ Balloon_interface::print (SCM smob) ADD_INTERFACE (Balloon_interface, "text-balloon-interface", "A collection of routines to put text balloons around an object.", - "balloon-padding balloon-text-props balloon-text-offset balloon-text balloon-original-callback"); + + /* properties */ + "balloon-padding " + "balloon-text-props " + "balloon-text-offset " + "balloon-text " + "original-stencil "); diff --git a/lily/beam.cc b/lily/beam.cc index c0e2ff28e9..6285c72a97 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -1390,5 +1390,6 @@ ADD_INTERFACE (Beam, "positions " "quant-score " "shorten " + "stems " "thickness " ); diff --git a/lily/dimension-cache.cc b/lily/dimension-cache.cc index ff47aab7e8..749b8aca13 100644 --- a/lily/dimension-cache.cc +++ b/lily/dimension-cache.cc @@ -14,12 +14,11 @@ Dimension_cache::Dimension_cache (Dimension_cache const &d) { init (); - dimension_ = d.dimension_; - dimension_callback_ = d.dimension_callback_; offset_ = d.offset_; offset_callbacks_ = d.offset_callbacks_; offsets_left_ = d.offsets_left_; parent_ = d.parent_; + extent_ = d.extent_ ? new Interval (*d.extent_) : 0; } Dimension_cache::Dimension_cache () @@ -30,13 +29,14 @@ Dimension_cache::Dimension_cache () void Dimension_cache::init () { - dimension_ = SCM_EOL; - dimension_callback_ = SCM_EOL; - offsets_left_ = 0; offset_callbacks_ = SCM_EOL; offset_ = 0.0; - + extent_ = 0; parent_ = 0; } +Dimension_cache::~Dimension_cache () +{ + delete extent_; +} diff --git a/lily/font-config.cc b/lily/font-config.cc index 2d2a5c2eda..b1f08466f3 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -29,21 +29,10 @@ init_fontconfig () font_config_global = FcConfigGetCurrent (); Array dirs; - String builddir = prefix_directory + "/mf/out/"; - struct stat statbuf; - if (stat (builddir.to_str0 (), &statbuf) == 0) - dirs.push (builddir.to_str0 ()); - else - { - /* - ugh. C&P main.cc - */ - dirs.push (prefix_directory + "/fonts/otf/"); - dirs.push (prefix_directory + "/fonts/type1/"); - dirs.push (prefix_directory + "/fonts/cff/"); - dirs.push (prefix_directory + "/fonts/svg/"); - } + dirs.push (prefix_directory + "/fonts/otf/"); + dirs.push (prefix_directory + "/fonts/type1/"); + for (int i = 0; i < dirs.size (); i++) { String dir = dirs[i]; diff --git a/lily/grid-line-interface.cc b/lily/grid-line-interface.cc index 82178f35e8..a346d425d0 100644 --- a/lily/grid-line-interface.cc +++ b/lily/grid-line-interface.cc @@ -49,13 +49,11 @@ Grid_line_interface::print (SCM smobbed_me) return st.smobbed_copy (); } -MAKE_SCHEME_CALLBACK (Grid_line_interface, width_callback, 2); +MAKE_SCHEME_CALLBACK (Grid_line_interface, width, 1); SCM -Grid_line_interface::width_callback (SCM element_smob, SCM scm_axis) +Grid_line_interface::width (SCM element_smob) { Grob *me = unsmob_grob (element_smob); - (void) scm_axis; - assert (scm_to_int (scm_axis) == X_AXIS); Real staffline = me->get_layout ()->get_dimension (ly_symbol2scm ("linethickness")); Real thick = robust_scm2double (me->get_property ("thickness"), 1.0) diff --git a/lily/grob-property.cc b/lily/grob-property.cc index 529315402a..7a21e66111 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -132,35 +132,13 @@ Grob::get_property_data (SCM sym) const 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); - - handle = scm_sloppy_assq (sym, immutable_property_alist_); - - if (do_internal_type_checking_global && scm_is_pair (handle)) + SCM val = get_property_data (sym); + if (ly_is_procedure (val)) { - if (!type_check_assignment (sym, scm_cdr (handle), - ly_symbol2scm ("backend-type?"))) - abort (); - - check_interfaces_for_property (this, sym); + val = ((Grob*)this)->try_callback (sym, val); } - - 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); + return val; } #ifndef NDEBUG @@ -170,53 +148,41 @@ bool debug_property_callbacks = 1; #endif SCM -Grob::try_callback (SCM sym) +Grob::try_callback (SCM sym, SCM proc) { - 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); + 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); + 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 ()); + SCM value = scm_call_1 (proc, self_scm ()); #ifndef NDEBUG - if (debug_property_callbacks) - grob_property_callback_stack = scm_cdr (grob_property_callback_stack); + 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); - if (value == marker) - mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, marker); - } - else - internal_set_property (sym, value); - - return value; - } - else - programming_error ("Callback should be procedure type"); + /* + 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); + if (value == marker) + mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, marker); } - - return SCM_UNSPECIFIED; + else + internal_set_property (sym, value); + + return value; } void @@ -230,20 +196,11 @@ Grob::internal_set_object (SCM s, SCM v) } void -Grob::set_callback (SCM s, SCM v) +Grob::del_property (SCM sym) { - /* Perhaps we simply do the assq_set, but what the heck. */ - if (!is_live ()) - return; - - /* - property_callbacks_ is r/o in principle, so we tack it in front. - */ - property_callbacks_ = scm_acons (s,v, property_callbacks_); + mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, sym); } - - SCM Grob::internal_get_object (SCM sym) const { diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc index e3f72d999b..e8911d6a6b 100644 --- a/lily/grob-scheme.cc +++ b/lily/grob-scheme.cc @@ -16,17 +16,18 @@ #include "font-interface.hh" -LY_DEFINE (ly_grob_set_callback_x, "ly:grob-set-callback!", - 3, 0, 0, (SCM grob, SCM sym, SCM proc), - "Set @var{sym} in grob @var{grob} to value @var{proc}") + +LY_DEFINE (ly_grob_property_data, "ly:grob-property-data", + 2, 0, 0, (SCM grob, SCM sym), + //, SCM dfault), + "Retrieve @var{sym} for @var{grob} but don't process callbacks.") { Grob *sc = unsmob_grob (grob); SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob"); SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol"); - SCM_ASSERT_TYPE (ly_is_procedure (proc), proc, SCM_ARG3, __FUNCTION__, "procedure"); + // SCM_ASSERT_TYPE (ly_is_procedure (proc), proc, SCM_ARG3, __FUNCTION__, "procedure"); - sc->set_callback (sym, proc); - return SCM_UNSPECIFIED; + return sc->get_property_data (sym); } LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!", diff --git a/lily/grob-smob.cc b/lily/grob-smob.cc index 06e757d1c2..15593b353a 100644 --- a/lily/grob-smob.cc +++ b/lily/grob-smob.cc @@ -21,15 +21,12 @@ Grob::mark_smob (SCM ses) { 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 ()); for (int a = 0; a < 2; a++) { scm_gc_mark (s->dim_cache_[a].offset_callbacks_); - scm_gc_mark (s->dim_cache_[a].dimension_); - scm_gc_mark (s->dim_cache_[a].dimension_callback_); /* Do not mark the parents. The pointers in the mutable property list form two tree like structures (one for X diff --git a/lily/grob.cc b/lily/grob.cc index 6f7b898222..380ba92ded 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -79,13 +79,11 @@ Grob::Grob (SCM basicprops, /* FIXME: default should be no callback. */ self_scm_ = SCM_EOL; pscore_ = 0; - status_ = 0; original_ = 0; interfaces_ = SCM_EOL; 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 @@ -100,7 +98,7 @@ Grob::Grob (SCM basicprops, SCM meta = get_property ("meta"); if (scm_is_pair (meta)) - interfaces_ = scm_cdr (scm_assoc (ly_symbol2scm ("interfaces"), meta)); + interfaces_ = scm_cdr (scm_assq (ly_symbol2scm ("interfaces"), meta)); /* TODO: @@ -109,20 +107,10 @@ Grob::Grob (SCM basicprops, 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") }; - SCM extents[] = { - get_property ("X-extent"), - get_property ("Y-extent") - }; - SCM extent_callbacks[] = { - get_property ("X-extent-callback"), - get_property ("Y-extent-callback") - }; for (int a = X_AXIS; a <= Y_AXIS; a++) { @@ -136,21 +124,13 @@ Grob::Grob (SCM basicprops, else programming_error ("[XY]-offset-callbacks must be a list"); - SCM cb = extent_callbacks[a]; - if (cb == SCM_BOOL_F) - dim_cache_[a].dimension_ = SCM_BOOL_F; - - SCM xt = extents[a]; - if (is_number_pair (xt)) - dim_cache_[a].dimension_ = xt; - else if (ly_is_procedure (cb)) - dim_cache_[a].dimension_callback_ = cb; - else if (cb == SCM_EOL - && ly_is_procedure (ly_assoc_get (ly_symbol2scm ("stencil"), - property_callbacks_, SCM_BOOL_F))) - dim_cache_[a].dimension_callback_ = stencil_extent_proc; } + + if (get_property_data (ly_symbol2scm ("X-extent")) == SCM_EOL) + set_property ("X-extent", Grob::stencil_width_proc); + if (get_property_data (ly_symbol2scm ("Y-extent")) == SCM_EOL) + set_property ("Y-extent", Grob::stencil_height_proc); } Grob::Grob (Grob const &s, int copy_index) @@ -163,7 +143,6 @@ 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; pscore_ = 0; @@ -177,14 +156,27 @@ Grob::~Grob () { } -MAKE_SCHEME_CALLBACK (Grob, stencil_extent, 2); + +MAKE_SCHEME_CALLBACK (Grob, stencil_height, 1); +SCM +Grob::stencil_height (SCM element_smob) +{ + Grob *me = unsmob_grob (element_smob); + return stencil_extent (me, Y_AXIS); +} + +MAKE_SCHEME_CALLBACK (Grob, stencil_width, 1); SCM -Grob::stencil_extent (SCM element_smob, SCM scm_axis) +Grob::stencil_width (SCM element_smob) { - Grob *s = unsmob_grob (element_smob); - Axis a = (Axis) scm_to_int (scm_axis); + Grob *me = unsmob_grob (element_smob); + return stencil_extent (me, X_AXIS); +} - Stencil *m = s->get_stencil (); +SCM +Grob::stencil_extent (Grob *me, Axis a) +{ + Stencil *m = me->get_stencil (); Interval e; if (m) e = m->extent (a); @@ -192,11 +184,11 @@ Grob::stencil_extent (SCM element_smob, SCM scm_axis) } Interval -robust_relative_extent (Grob *me, Grob *refp, Axis a) +robust_relative_extent (Grob *me, Grob *refpoint, Axis a) { - Interval ext = me->extent (refp, a); + Interval ext = me->extent (refpoint, a); if (ext.is_empty ()) - ext.add_point (me->relative_coordinate (refp, a)); + ext.add_point (me->relative_coordinate (refpoint, a)); return ext; } @@ -316,16 +308,9 @@ Grob::suicide () mutable_property_alist_ = SCM_EOL; object_alist_ = SCM_EOL; - property_callbacks_ = SCM_EOL; immutable_property_alist_ = SCM_EOL; interfaces_ = SCM_EOL; - set_extent (SCM_EOL, Y_AXIS); - set_extent (SCM_EOL, X_AXIS); - - set_extent_callback (SCM_EOL, Y_AXIS); - set_extent_callback (SCM_EOL, X_AXIS); - for (int a = X_AXIS; a <= Y_AXIS; a++) { dim_cache_[a].offset_callbacks_ = SCM_EOL; @@ -402,71 +387,69 @@ Grob::get_offset (Axis a) const return dim_cache_[a].offset_; } +#if 0 bool Grob::is_empty (Axis a) const { return !(scm_is_pair (dim_cache_[a].dimension_) || ly_is_procedure (dim_cache_[a].dimension_callback_)); } +#endif void Grob::flush_extent_cache (Axis axis) { - Dimension_cache *d = &dim_cache_[axis]; - if (ly_is_procedure (d->dimension_callback_) - && scm_is_pair (d->dimension_)) + if (dim_cache_[axis].extent_) { - d->dimension_ = SCM_EOL; - + /* + Ugh, this is not accurate; will flush property, causing + callback to be called if. + */ + del_property ((axis == X_AXIS) ? ly_symbol2scm ("X-extent") : ly_symbol2scm ("Y-extent")); + delete dim_cache_[axis].extent_; + dim_cache_[axis].extent_ = 0; if (get_parent (axis)) get_parent (axis)->flush_extent_cache (axis); } } + Interval Grob::extent (Grob *refp, Axis a) const { - Real x = relative_coordinate (refp, a); - - Dimension_cache *d = (Dimension_cache *) & dim_cache_[a]; - Interval ext; - - SCM dimpair = d->dimension_; - if (scm_is_pair (dimpair)) - ; - else if (ly_is_procedure (d->dimension_callback_) - && d->dimension_ == SCM_EOL) - d->dimension_ = scm_call_2 (d->dimension_callback_, self_scm (), scm_from_int (a)); - else - return ext; - - if (!scm_is_pair (d->dimension_)) - return ext; - - ext = ly_scm2interval (d->dimension_); - - SCM extra = (a == X_AXIS) - ? get_property ("extra-X-extent") - : get_property ("extra-Y-extent"); - - /* Signs ? */ - if (scm_is_pair (extra)) + Real offset = relative_coordinate (refp, a); + Interval real_ext; + if (dim_cache_[a].extent_) { - ext[BIGGER] += scm_to_double (scm_cdr (extra)); - ext[SMALLER] += scm_to_double (scm_car (extra)); + real_ext = *dim_cache_[a].extent_; } + else + { + SCM min_ext_sym = + (a == X_AXIS) + ? ly_symbol2scm ("minimum-X-extent") + : ly_symbol2scm ("minimum-Y-extent"); + + SCM ext_sym = + (a == X_AXIS) + ? ly_symbol2scm ("X-extent") + : ly_symbol2scm ("Y-extent"); + + SCM min_ext = internal_get_property (min_ext_sym); + SCM ext = internal_get_property (ext_sym); - extra = (a == X_AXIS) - ? get_property ("minimum-X-extent") - : get_property ("minimum-Y-extent"); - - if (scm_is_pair (extra)) - ext.unite (Interval (scm_to_double (scm_car (extra)), - scm_to_double (scm_cdr (extra)))); - - ext.translate (x); + if (is_number_pair (min_ext)) + real_ext.unite (ly_scm2interval (min_ext)); + if (is_number_pair (ext)) + real_ext.unite (ly_scm2interval (ext)); - return ext; + ((Grob*)this)->del_property (ext_sym); + ((Grob*)this)->dim_cache_[a].extent_ = new Interval (real_ext); + } + + real_ext.translate (offset); + + return real_ext; } /* Find the group-element which has both #this# and #s# */ @@ -518,7 +501,7 @@ String Grob::name () const { SCM meta = get_property ("meta"); - SCM nm = scm_assoc (ly_symbol2scm ("name"), meta); + SCM nm = scm_assq (ly_symbol2scm ("name"), meta); nm = (scm_is_pair (nm)) ? scm_cdr (nm) : SCM_EOL; return scm_is_symbol (nm) ? ly_symbol2string (nm) : this->class_name (); } @@ -534,30 +517,12 @@ Grob::add_offset_callback (SCM cb, Axis a) } } -bool -Grob::has_extent_callback (SCM cb, Axis a) const -{ - return scm_equal_p (cb, dim_cache_[a].dimension_callback_) == SCM_BOOL_T; -} - bool Grob::has_offset_callback (SCM cb, Axis a) const { return scm_c_memq (cb, dim_cache_[a].offset_callbacks_) != SCM_BOOL_F; } -void -Grob::set_extent (SCM dc, Axis a) -{ - dim_cache_[a].dimension_ = dc; -} - -void -Grob::set_extent_callback (SCM dc, Axis a) -{ - dim_cache_[a].dimension_callback_ = dc; -} - void Grob::set_parent (Grob *g, Axis a) { @@ -712,19 +677,15 @@ ADD_INTERFACE (Grob, "grob-interface", /* properties */ "X-extent " - "X-extent-callback " "X-offset-callbacks " "Y-extent " - "Y-extent-callback " "Y-offset-callbacks " "after-line-breaking " "axis-group-parent-X " "axis-group-parent-Y " "before-line-breaking " - "callbacks " "cause " "color " - "context " "extra-X-extent " "extra-Y-extent " "extra-offset " @@ -736,7 +697,7 @@ ADD_INTERFACE (Grob, "grob-interface", "springs-and-rods " "staff-symbol " "stencil " - "transparent" + "transparent " ); diff --git a/lily/hara-kiri-group-spanner.cc b/lily/hara-kiri-group-spanner.cc index 01bfa853df..8d7eb003e5 100644 --- a/lily/hara-kiri-group-spanner.cc +++ b/lily/hara-kiri-group-spanner.cc @@ -16,16 +16,13 @@ #include "warn.hh" #include "item.hh" -MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, y_extent, 2); +MAKE_SCHEME_CALLBACK (Hara_kiri_group_spanner, y_extent, 1); SCM -Hara_kiri_group_spanner::y_extent (SCM element_smob, SCM scm_axis) +Hara_kiri_group_spanner::y_extent (SCM element_smob) { Grob *me = unsmob_grob (element_smob); - (void) scm_axis; - - assert (scm_to_int (scm_axis) == Y_AXIS); consider_suicide (me); - return Axis_group_interface::group_extent_callback (me->self_scm (), scm_axis); + return Axis_group_interface::generic_group_extent (me, Y_AXIS); } void diff --git a/lily/include/align-interface.hh b/lily/include/align-interface.hh index 73f036eb15..f0e20d0064 100644 --- a/lily/include/align-interface.hh +++ b/lily/include/align-interface.hh @@ -20,7 +20,7 @@ struct Align_interface DECLARE_SCHEME_CALLBACK (stretch_after_break, (SCM element)); static void align_to_fixed_distance (Grob *, Axis a); static void align_elements_to_extents (Grob *, Axis a); - static void set_axis (Grob *, Axis); + static void set_ordered (Grob *); static Axis axis (Grob *); static void add_element (Grob *, Grob *); static int get_count (Grob *, Grob *); diff --git a/lily/include/arpeggio.hh b/lily/include/arpeggio.hh index aa2e36260e..c99b8c9f0d 100644 --- a/lily/include/arpeggio.hh +++ b/lily/include/arpeggio.hh @@ -17,7 +17,7 @@ class Arpeggio public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM)); - DECLARE_SCHEME_CALLBACK (width_callback, (SCM, SCM)); + DECLARE_SCHEME_CALLBACK (width, (SCM)); static bool has_interface (Grob *); }; diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh index 75a5a2aa56..bb7fbcd3d8 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -16,7 +16,9 @@ */ struct Axis_group_interface { - DECLARE_SCHEME_CALLBACK (group_extent_callback, (SCM smob, SCM axis)); + static SCM generic_group_extent (Grob *me, Axis a); + DECLARE_SCHEME_CALLBACK (width, (SCM smob)); + DECLARE_SCHEME_CALLBACK (height, (SCM smob)); static Interval relative_group_extent (Link_array const &list, Grob *common, Axis); diff --git a/lily/include/dimension-cache.hh b/lily/include/dimension-cache.hh index 86c3a663d0..00480e9fcb 100644 --- a/lily/include/dimension-cache.hh +++ b/lily/include/dimension-cache.hh @@ -17,22 +17,12 @@ /** Adminstration of offset dimension info. */ -struct Dimension_cache +class Dimension_cache { - /* - Multi typed: - - - cons: interval - - procedure: callback - - else: empty - */ - SCM dimension_; - SCM dimension_callback_; - /** The offset wrt. to the center of #parent_# */ - + Interval *extent_; Real offset_; SCM offset_callbacks_; @@ -42,8 +32,10 @@ struct Dimension_cache What to call to find extent. Nil means empty. */ Grob *parent_; - + friend class Grob; + Dimension_cache (Dimension_cache const &); + ~Dimension_cache (); Dimension_cache (); void init (); }; diff --git a/lily/include/grid-line-interface.hh b/lily/include/grid-line-interface.hh index ea39e14977..9e02ce217b 100644 --- a/lily/include/grid-line-interface.hh +++ b/lily/include/grid-line-interface.hh @@ -17,7 +17,7 @@ class Grid_line_interface public: static void add_grid_point (Grob *me, Grob *b); DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_SCHEME_CALLBACK (width_callback, (SCM, SCM)); + DECLARE_SCHEME_CALLBACK (width, (SCM)); static bool has_interface (Grob *); }; diff --git a/lily/include/grob.hh b/lily/include/grob.hh index 96cfba86c3..11f5ad0fc9 100644 --- a/lily/include/grob.hh +++ b/lily/include/grob.hh @@ -27,7 +27,6 @@ protected: 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 @@ -41,7 +40,6 @@ protected: friend SCM ly_grob_basic_properties (SCM); friend void check_interfaces_for_property (Grob const *, SCM); void substitute_object_links (SCM, SCM); - char status_; DECLARE_CLASSNAME(Grob); public: @@ -61,7 +59,10 @@ public: Grob (Grob const &, int copy_count); virtual Grob *clone (int count) const; - DECLARE_SCHEME_CALLBACK (stencil_extent, (SCM smob, SCM axis)); + static SCM stencil_extent (Grob*, Axis); + DECLARE_SCHEME_CALLBACK (stencil_height, (SCM smob)); + DECLARE_SCHEME_CALLBACK (stencil_width, (SCM smob)); + String name () const; /* @@ -71,10 +72,11 @@ public: SCM get_property_data (SCM symbol) const; SCM internal_get_object (SCM symbol) const; + void del_property (SCM symbol); void internal_set_property (SCM sym, SCM val); void internal_set_object (SCM sym, SCM val); - SCM try_callback (SCM); + SCM try_callback (SCM, SCM); /* JUNKME. */ @@ -104,7 +106,6 @@ public: void suicide (); bool is_live () const; - bool is_empty (Axis a) const; bool internal_has_interface (SCM intf); static bool has_interface (Grob *me); @@ -120,13 +121,9 @@ public: Grob *common_refpoint (Grob const *s, Axis a) const; // duh. slim down interface here. (todo) - void set_callback (SCM sym, SCM proc); bool has_offset_callback (SCM callback, Axis) const; void add_offset_callback (SCM callback, Axis); - bool has_extent_callback (SCM, Axis) const; void flush_extent_cache (Axis); - void set_extent (SCM, Axis); - void set_extent_callback (SCM, Axis); Real get_offset (Axis a) const; void set_parent (Grob *e, Axis); diff --git a/lily/include/hara-kiri-group-spanner.hh b/lily/include/hara-kiri-group-spanner.hh index 5baed0f3b0..a14f8feeac 100644 --- a/lily/include/hara-kiri-group-spanner.hh +++ b/lily/include/hara-kiri-group-spanner.hh @@ -16,7 +16,7 @@ class Hara_kiri_group_spanner { public: DECLARE_SCHEME_CALLBACK (force_hara_kiri_callback, (SCM, SCM)); - DECLARE_SCHEME_CALLBACK (y_extent, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (y_extent, (SCM smob)); DECLARE_SCHEME_CALLBACK (force_hara_kiri_in_parent_callback, (SCM, SCM)); static void add_element (Grob *me, Grob *e); static bool has_interface (Grob *); diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index bb6546de82..478ed07baa 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -21,7 +21,6 @@ class Note_head public: 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)); DECLARE_SCHEME_CALLBACK (calc_stem_attachment, (SCM)); static bool has_interface (Grob *); diff --git a/lily/include/rest.hh b/lily/include/rest.hh index de9f3122f7..fb8dbf3aed 100644 --- a/lily/include/rest.hh +++ b/lily/include/rest.hh @@ -19,9 +19,12 @@ public: DECLARE_SCHEME_CALLBACK (y_offset_callback, (SCM, SCM)); static bool has_interface (Grob *); static String glyph_name (Grob *, int, String, bool); - static SCM brew_internal_stencil (SCM, bool); + static SCM brew_internal_stencil (Grob*, bool); + static SCM generic_extent_callback (Grob*, Axis); DECLARE_SCHEME_CALLBACK (extent_callback, (SCM, SCM)); DECLARE_SCHEME_CALLBACK (polyphonic_offset_callback, (SCM, SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); + DECLARE_SCHEME_CALLBACK (width, (SCM)); + DECLARE_SCHEME_CALLBACK (height, (SCM)); }; #endif // REST_HH diff --git a/lily/include/slur.hh b/lily/include/slur.hh index 9084184120..f244b2f725 100644 --- a/lily/include/slur.hh +++ b/lily/include/slur.hh @@ -20,7 +20,7 @@ public: DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_control_points, (SCM)); DECLARE_SCHEME_CALLBACK (calc_direction, (SCM)); - DECLARE_SCHEME_CALLBACK (height, (SCM, SCM)); + DECLARE_SCHEME_CALLBACK (height, (SCM)); DECLARE_SCHEME_CALLBACK (outside_slur_callback, (SCM, SCM)); static bool has_interface (Grob *); static Bezier get_curve (Grob *me); diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index 6995a2da4d..53b317e07d 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -25,7 +25,7 @@ public: static Interval get_spanned_interval (Grob *); static void add_bar (Grob *, Grob *); static void evaluate_glyph (Grob *); - DECLARE_SCHEME_CALLBACK (width_callback, (SCM smob, SCM axis)); + DECLARE_SCHEME_CALLBACK (width, (SCM smob)); DECLARE_SCHEME_CALLBACK (calc_bar_size, (SCM)); DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (calc_glyph_name, (SCM)); diff --git a/lily/include/stem-tremolo.hh b/lily/include/stem-tremolo.hh index d143bd08cb..86ddf33749 100644 --- a/lily/include/stem-tremolo.hh +++ b/lily/include/stem-tremolo.hh @@ -19,7 +19,7 @@ public: static bool has_interface (Grob *); DECLARE_SCHEME_CALLBACK (dim_callback, (SCM smob, SCM axis)); DECLARE_SCHEME_CALLBACK (print, (SCM)); - DECLARE_SCHEME_CALLBACK (height, (SCM, SCM)); + DECLARE_SCHEME_CALLBACK (height, (SCM)); static Stencil raw_stencil (Grob *); }; diff --git a/lily/include/stem.hh b/lily/include/stem.hh index 5e6260c6b0..75f37b6a43 100644 --- a/lily/include/stem.hh +++ b/lily/include/stem.hh @@ -46,7 +46,7 @@ public: 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)); + DECLARE_SCHEME_CALLBACK (width, (SCM smob)); + DECLARE_SCHEME_CALLBACK (height, (SCM)); }; #endif diff --git a/lily/ligature-engraver.cc b/lily/ligature-engraver.cc index 1678a1e018..ce6e8a8c2b 100644 --- a/lily/ligature-engraver.cc +++ b/lily/ligature-engraver.cc @@ -94,7 +94,7 @@ Ligature_engraver::try_music (Music *m) * .ly snippet: * * \property Voice.NoteHead \override #'print-function = - * < value of #'ligature-primitive-callback of Voice.NoteHead > + * < value of noteHeadLigaturePrimitive * * TODO: What we are doing here on the c++ level, should actually be * performed on the SCM level. However, I do not know how to teach @@ -106,18 +106,9 @@ Ligature_engraver::try_music (Music *m) void Ligature_engraver::override_stencil_callback () { -#if 0 - /* - This has been broken with the introduction of generic callbacks. - */ - SCM target_callback = ly_symbol2scm ("print-function"); - SCM source_callback = ly_symbol2scm ("ligature-primitive-callback"); - SCM noteHeadProperties = updated_grob_properties (context (), ly_symbol2scm ("NoteHead")); - SCM value = scm_cdr (scm_sloppy_assq (source_callback, noteHeadProperties)); execute_pushpop_property (context (), ly_symbol2scm ("NoteHead"), - target_callback, value); - -#endif + ly_symbol2scm ("stencil"), + get_property ("noteHeadLigaturePrimitive")); } /* @@ -136,9 +127,8 @@ Ligature_engraver::override_stencil_callback () void Ligature_engraver::revert_stencil_callback () { - SCM symbol = ly_symbol2scm ("NoteHead"); - SCM key = ly_symbol2scm ("print-function"); - execute_pushpop_property (context (), symbol, key, SCM_UNDEFINED); + execute_pushpop_property (context (), ly_symbol2scm ("NoteHead"), + ly_symbol2scm ("stencil"), SCM_UNDEFINED); } void @@ -182,10 +172,6 @@ Ligature_engraver::process_music () prev_start_event_ = events_drul_[START]; ligature_ = create_ligature_spanner (); - brew_ligature_primitive_proc - = ligature_->get_property ("ligature-primitive-callback"); - if (brew_ligature_primitive_proc == SCM_EOL) - programming_error ("Ligature_engraver: ligature-primitive-callback undefined"); Grob *bound = unsmob_grob (get_property ("currentMusicalColumn")); if (!bound) @@ -253,7 +239,7 @@ Ligature_engraver::acknowledge_note_head (Grob_info info) primitives_.push (info); if (info.grob ()) { - info.grob ()->set_callback (ly_symbol2scm ("stencil"), + info.grob ()->set_property ("stencil", brew_ligature_primitive_proc); } } diff --git a/lily/main.cc b/lily/main.cc index 2245a71396..7627e0bb0d 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -381,37 +381,41 @@ setup_paths (char const *argv0) global_path.append (""); - /* Adding mf/out make lilypond unchanged source directory, when setting - LILYPONDPREFIX to lilypond-x.y.z */ - char *suffixes[] = {"ly", "ps", "scm", 0 }; - - Array dirs; - for (char **s = suffixes; *s; s++) - { - String path = prefix_directory + to_string ('/') + String (*s); - dirs.push (path); - } /* When running from build dir, a full LILYPOND_PREFIX is set-up at - share/lilypond/TOPLEVEL_VERSION + $(OUTBASE)/share/lilypond/TOPLEVEL_VERSION This historical hack will allow the shorthand - LILYPONDPREFIX=. lily/out/lilypond ... + LILYPONDPREFIX=out lily/out/lilypond ... */ + struct stat statbuf; - String build_prefix = prefix_directory + "share/lilypond/" TOPLEVEL_VERSION; + String build_prefix = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION; if (stat (build_prefix.to_str0 (), &statbuf) == 0) prefix_directory = build_prefix; + + /* Adding mf/out make lilypond unchanged source directory, when setting + LILYPONDPREFIX to lilypond-x.y.z */ + char *suffixes[] = {"ly", "ps", "scm", 0 }; + + + Array dirs; + for (char **s = suffixes; *s; s++) + { + String path = prefix_directory + to_string ('/') + String (*s); + dirs.push (path); + } + + dirs.push (prefix_directory + "/fonts/otf/"); dirs.push (prefix_directory + "/fonts/type1/"); - dirs.push (prefix_directory + "/fonts/cff/"); dirs.push (prefix_directory + "/fonts/svg/"); - + for (int i = 0; i < dirs.size (); i++) global_path.prepend (dirs[i]); } diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index 87ca3f5bd1..de4e0dc181 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -221,4 +221,4 @@ Mensural_ligature::print (SCM) ADD_INTERFACE (Mensural_ligature, "mensural-ligature-interface", "A mensural ligature", "delta-pitch flexa-width head-width join-right-amount " // "add-join " - "ligature-primitive-callback primitive thickness"); + "primitive thickness"); diff --git a/lily/new-figured-bass-engraver.cc b/lily/new-figured-bass-engraver.cc index fbf0665f3a..f4beb0acab 100644 --- a/lily/new-figured-bass-engraver.cc +++ b/lily/new-figured-bass-engraver.cc @@ -36,6 +36,7 @@ struct Figure_group Figure_group () { + figure_item_ = 0; force_no_continuation_ = false; continuation_line_ = 0; number_ = SCM_EOL; diff --git a/lily/rest.cc b/lily/rest.cc index 9d9579f6a2..0645fe1bba 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -116,12 +116,9 @@ Rest::glyph_name (Grob *me, int balltype, String style, bool try_ledgers) } MAKE_SCHEME_CALLBACK (Rest, print, 1); - SCM -Rest::brew_internal_stencil (SCM smob, bool ledgered) +Rest::brew_internal_stencil (Grob *me, bool ledgered) { - Grob *me = unsmob_grob (smob); - SCM balltype_scm = me->get_property ("duration-log"); if (!scm_is_number (balltype_scm)) return Stencil ().smobbed_copy (); @@ -145,18 +142,32 @@ Rest::brew_internal_stencil (SCM smob, bool ledgered) SCM Rest::print (SCM smob) { - return brew_internal_stencil (smob, true); + return brew_internal_stencil (unsmob_grob (smob), true); } -MAKE_SCHEME_CALLBACK (Rest, extent_callback, 2); +MAKE_SCHEME_CALLBACK (Rest, width, 1); /* We need the callback. The real stencil has ledgers depending on Y-position. The Y-position is known only after line breaking. */ SCM -Rest::extent_callback (SCM smob, SCM ax) +Rest::width (SCM smob) { - Axis a = (Axis) scm_to_int (ax); + return generic_extent_callback (unsmob_grob (smob), X_AXIS); +} +MAKE_SCHEME_CALLBACK (Rest, height, 1); +SCM +Rest::height (SCM smob) +{ + return generic_extent_callback (unsmob_grob (smob), Y_AXIS); +} + +/* + We need the callback. The real stencil has ledgers depending on + Y-position. The Y-position is known only after line breaking. */ +SCM +Rest::generic_extent_callback (Grob *me, Axis a) +{ /* Don't want ledgers: ledgers depend on Y position, which depends on rest collision, which depends on stem size which depends on beam @@ -165,7 +176,7 @@ Rest::extent_callback (SCM smob, SCM ax) consequence: we get too small extents and potential collisions with ledgered rests. */ - SCM m = brew_internal_stencil (smob, a != X_AXIS); + SCM m = brew_internal_stencil (me, a != X_AXIS); return ly_interval2scm (unsmob_stencil (m)->extent (a)); } diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 63284c67e2..f9ecf93ebd 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -135,7 +135,9 @@ void make_script_from_event (Grob *p, bool *follow, Context *tg, val = scm_from_int (prio); } - if (p->get_property_data (sym) == SCM_EOL) + + SCM preset = p->get_property_data (sym); + if (scm_call_1 (type, preset) == SCM_BOOL_F) p->internal_set_property (sym, val); } @@ -163,7 +165,7 @@ Script_engraver::process_music () scripts_[i].script_ = p; - SCM force_dir = music->get_property("direction"); + SCM force_dir = music->get_property ("direction"); if (is_direction (force_dir) && to_dir (force_dir)) p->set_property ("direction", force_dir); } diff --git a/lily/separating-line-group-engraver.cc b/lily/separating-line-group-engraver.cc index c2b6be3b02..0d7a48703e 100644 --- a/lily/separating-line-group-engraver.cc +++ b/lily/separating-line-group-engraver.cc @@ -111,8 +111,7 @@ Separating_line_group_engraver::acknowledge_item (Grob_info i) if (!it) return; if (it->get_parent (X_AXIS) - && it->get_parent (X_AXIS) - ->has_extent_callback (Axis_group_interface::group_extent_callback_proc, X_AXIS)) + && Axis_group_interface::has_axis (it->get_parent (X_AXIS), X_AXIS)) return; if (to_boolean (it->get_property ("no-spacing-rods"))) diff --git a/lily/slur.cc b/lily/slur.cc index 2f735e9e6f..807b30e782 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -56,17 +56,15 @@ Slur::calc_direction (SCM smob) return scm_from_int (d); } -MAKE_SCHEME_CALLBACK (Slur, height, 2); +MAKE_SCHEME_CALLBACK (Slur, height, 1); SCM -Slur::height (SCM smob, SCM ax) +Slur::height (SCM smob) { - Axis a = (Axis)scm_to_int (ax); Grob *me = unsmob_grob (smob); - assert (a == Y_AXIS); // FIXME uncached Stencil *m = me->get_stencil (); - return m ? ly_interval2scm (m->extent (a)) : ly_interval2scm (Interval ()); + return m ? ly_interval2scm (m->extent (Y_AXIS)) : ly_interval2scm (Interval ()); } /* diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc index 3c036fd47d..a5a8ad51b3 100644 --- a/lily/span-arpeggio-engraver.cc +++ b/lily/span-arpeggio-engraver.cc @@ -85,7 +85,7 @@ Span_arpeggio_engraver::stop_translation_timestep () we can't kill the children, since we don't want to the previous note to bump into the span arpeggio; so we make it transparent. */ - arpeggios_[j]->set_callback (ly_symbol2scm ("stencil"), SCM_EOL); + arpeggios_[j]->set_property ("transparent", SCM_BOOL_T); } span_arpeggio_ = 0; diff --git a/lily/span-bar.cc b/lily/span-bar.cc index e3954f494f..8e36450e29 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -107,14 +107,11 @@ Span_bar::print (SCM smobbed_me) return span_bar.smobbed_copy (); } -MAKE_SCHEME_CALLBACK (Span_bar, width_callback, 2); +MAKE_SCHEME_CALLBACK (Span_bar, width, 1); SCM -Span_bar::width_callback (SCM smob, SCM scm_axis) +Span_bar::width (SCM smob) { Grob *me = unsmob_grob (smob); - (void) scm_axis; - - assert ((Axis) scm_to_int (scm_axis) == X_AXIS); SCM gn = me->get_property ("glyph-name"); if (!me->is_live ()) return ly_interval2scm (Interval ()); @@ -196,8 +193,7 @@ Span_bar::calc_glyph_name (SCM smob) Interval Span_bar::get_spanned_interval (Grob *me) { - return ly_scm2interval (Axis_group_interface::group_extent_callback - (me->self_scm (), scm_from_int (Y_AXIS))); + return ly_scm2interval (Axis_group_interface::generic_group_extent (me, Y_AXIS)); } MAKE_SCHEME_CALLBACK (Span_bar, calc_bar_size, 1); diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index 495458eb77..82aa3d9c1b 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -131,7 +131,7 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob, *compound_fixed = 0.0; *compound_space = 0.0; - int wishes; + int wish_count = 0; for (int i = right_items.size (); i--;) { @@ -144,7 +144,7 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob, *compound_space += space; *compound_fixed += fixed; - wishes ++; + wish_count ++; extract_grob_set (g, "elements", elts); for (int j = elts.size (); j--;) @@ -154,14 +154,14 @@ Staff_spacing::next_notes_correction (Grob *me, Grob *last_grob, next_note_correction (me, elts[j], bar_size, &space, &fixed); *compound_fixed += fixed; *compound_space += space; - wishes ++; + wish_count ++; } } - if (wishes) + if (wish_count) { - *compound_space /= wishes; - *compound_fixed /= wishes; + *compound_space /= wish_count; + *compound_fixed /= wish_count; } } @@ -264,4 +264,9 @@ ADD_INTERFACE (Staff_spacing, "staff-spacing-interface", "This object calculates spacing details from a " " breakable symbol (left) to another object. For example, it takes care " " of optical spacing from a bar lines to a note.", - "stem-spacing-correction left-items right-items"); + + /* properties */ + "stem-spacing-correction " + "left-items " + "right-items " + ); diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 94e0c36683..2f642d2598 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -32,18 +32,15 @@ Stem_tremolo::dim_callback (SCM e, SCM) return ly_interval2scm (Interval (-space, space)); } -MAKE_SCHEME_CALLBACK (Stem_tremolo, height, 2); +MAKE_SCHEME_CALLBACK (Stem_tremolo, height, 1); SCM -Stem_tremolo::height (SCM smob, SCM ax) +Stem_tremolo::height (SCM smob) { - Axis a = (Axis)scm_to_int (ax); Grob *me = unsmob_grob (smob); - assert (a == Y_AXIS); - /* TODO: fixme. uncached? */ return ly_interval2scm (me->get_stencil () - ? me->get_stencil ()->extent (a) + ? me->get_stencil ()->extent (Y_AXIS) : Interval()); } diff --git a/lily/stem.cc b/lily/stem.cc index c9974220a8..b3b2058fc8 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -489,13 +489,11 @@ Stem::get_default_dir (Grob *me) -MAKE_SCHEME_CALLBACK (Stem, height, 2); +MAKE_SCHEME_CALLBACK (Stem, height, 1); SCM -Stem::height (SCM smob, SCM ax) +Stem::height (SCM smob) { - Axis a = (Axis)scm_to_int (ax); Grob *me = unsmob_grob (smob); - assert (a == Y_AXIS); Direction dir = get_grob_direction (me); @@ -510,7 +508,7 @@ Stem::height (SCM smob, SCM ax) } /* FIXME uncached? */ - Interval iv = me->get_stencil () ? me->get_stencil ()->extent (a) : Interval(); + Interval iv = me->get_stencil () ? me->get_stencil ()->extent (Y_AXIS) : Interval(); if (beam) { if (dir == CENTER) @@ -601,12 +599,10 @@ Stem::flag (Grob *me) return flag; } -MAKE_SCHEME_CALLBACK (Stem, width_callback, 2); +MAKE_SCHEME_CALLBACK (Stem, width, 1); SCM -Stem::width_callback (SCM e, SCM ax) +Stem::width (SCM e) { - (void) ax; - assert (scm_to_int (ax) == X_AXIS); Grob *me = unsmob_grob (e); Interval r; diff --git a/lily/vaticana-ligature.cc b/lily/vaticana-ligature.cc index d07a1ba370..e65e89518e 100644 --- a/lily/vaticana-ligature.cc +++ b/lily/vaticana-ligature.cc @@ -294,6 +294,15 @@ Vaticana_ligature::print (SCM) ADD_INTERFACE (Vaticana_ligature, "vaticana-ligature-interface", "A vaticana style gregorian ligature", - "glyph-name flexa-height flexa-width thickness add-cauda " - "add-stem add-join delta-pitch x-offset " - "ligature-primitive-callback"); + + /* properties */ + "glyph-name " + "flexa-height " + "flexa-width " + "thickness " + "add-cauda " + "add-stem " + "add-join " + "delta-pitch " + "x-offset " + ); diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index 7e05369f8b..907e850770 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -69,7 +69,7 @@ Vertical_align_engraver::process_music () { valign_ = make_spanner ("VerticalAlignment", SCM_EOL); valign_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn"))); - Align_interface::set_axis (valign_, Y_AXIS); + Align_interface::set_ordered (valign_); } } @@ -89,7 +89,8 @@ Vertical_align_engraver::qualifies (Grob_info i) const int sz = i.origin_contexts ((Translator *)this).size (); return sz > 0 && Axis_group_interface::has_interface (i.grob ()) - && !i.grob ()->get_parent (Y_AXIS) && Axis_group_interface::has_axis (i.grob (), Y_AXIS); + && !i.grob ()->get_parent (Y_AXIS) + && Axis_group_interface::has_axis (i.grob (), Y_AXIS); } void diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index 641376fde6..3b098740fe 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -210,6 +210,8 @@ another non-natural.") (figuredBassCenterContinuations ,boolean? "Whether to vertically center pairs of extender lines.") + (figuredBassPlusDirection ,ly:dir? "Where to put plus signs relative to the the main figure.") + (figuredBassAlterationDirection ,ly:dir? "Where to put alterations relative to the main figure.") (followVoice ,boolean? "If set, note heads are tracked across staff @@ -269,7 +271,6 @@ containing (@var{name} . @var{alter}) or ((@var{octave} . @var{name}) . @var{alt where @var{name} is from 0.. 6 and @var{alter} from -4 (double flat) to 4 (double sharp). ") - (majorSevenSymbol ,markup? "How should the major 7th be formatted in a chord name?") (markFormatter ,procedure? "Procedure @@ -301,6 +302,7 @@ markup. Called with 2 arguments, event and context.") selects the highest string with a fret at least @code{minimumFret}") (minimumVerticalExtent ,number-pair? "minimum vertical extent, same format as @var{verticalExtent}") + (noteHeadLigaturePrimitive ,procedure? "Callback for generating stencil of ligature.") (ottavation ,string? "If set, the text for an ottava spanner. Changing this creates a new text spanner. ") (pedalSustainStrings ,list? "List of string to print for diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index c87cf389d6..7e9519b275 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -22,17 +22,9 @@ (apply define-grob-property x)) `( - (X-extent-callback ,procedure? "Procedure that calculates the -extent of this object. If this value is set to @code{#f}, the object -is empty in the X direction. The procedure takes a grob and axis -argument, and returns a number-pair. -") - (X-offset-callbacks ,list? "A list of functions determining this objects' position relative to its parent. The last one in the list is called first. The functions take a grob and axis argument. ") - - (Y-extent-callback ,procedure? "see @code{X-extent-callback}.") (Y-offset-callbacks ,list? "see @code{X-offset-callbacks}.") (accidentals ,list? "List of alteration numbers") @@ -56,7 +48,7 @@ for balloon text.") (balloon-text-offset ,number-pair? "Where to put text relative to balloon.") (balloon-padding ,ly:dimension? "Text to add to help balloon") - (balloon-original-callback ,procedure? "The + (original-stencil ,ly:stencil? "The original stencil drawer to draw the balloon around.") @@ -121,10 +113,6 @@ middle C.") (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{#} 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 @@ -134,8 +122,6 @@ the slope of the beam.") (color ,color? "The color of this grob.") - (context ,ly:context? "Originating context of the grob") - ;;DOCME (control-points ,list? "List of 4 offsets (number-pairs) that form control points for the tie/slur shape.") @@ -557,7 +543,6 @@ debugging") (least-squares-dy ,number? "ideal beam slope, without damping.") - (ligature-primitive-callback ,procedure? "callback that brews ligature head.") (stem-info ,pair? "caching of stem parameters") (note-columns ,pair? "list of NoteColumn grobs.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 14a2015655..4dedcc156e 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -21,16 +21,20 @@ . ( (avoid-slur . inside) (cautionary-style . parentheses) - (callbacks . ((stencil . ,Accidental_interface::print) - (after-line-breaking - . ,Accidental_interface::after_line_breaking) - )) + + (stencil . ,Accidental_interface::print) + (after-line-breaking + . ,Accidental_interface::after_line_breaking) + (meta . ((class . Item) (interfaces . (accidental-interface font-interface)))))) - + (AccidentalSuggestion - . ((callbacks . ((stencil . ,Accidental_interface::print))) + . ( + + (stencil . ,Accidental_interface::print) + (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent ,Self_alignment_interface::aligned_on_self)) (self-alignment-X . ,CENTER) @@ -49,10 +53,12 @@ self-alignment-interface font-interface)))))) (AccidentalPlacement - . ((X-extent-callback . ,Axis_group_interface::group_extent_callback) + . ( (left-padding . 0.2) - (callbacks . ((positioning-done . ,Accidental_placement::calc_positioning_done) - )) + + (positioning-done . ,Accidental_placement::calc_positioning_done) + (X-extent . ,Axis_group_interface::width) + ;; 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) @@ -61,8 +67,10 @@ (Ambitus . ( (axes . (0 1)) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + + (X-extent . ,Axis_group_interface::width) + (X-extent . ,Axis_group_interface::height) + (space-alist . ( (clef . (extra-space . 0.5)) (key-signature . (extra-space . 0.0)) @@ -79,7 +87,9 @@ (AmbitusLine . ( - (callbacks . ( (stencil . ,Ambitus::print))) + + (stencil . ,Ambitus::print) + (join-heads . #t) (thickness . 2) (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent)) @@ -95,9 +105,10 @@ (X-offset-callbacks . (,Side_position_interface::aligned_side)) (direction . -1) (cautionary-style . parentheses) - (callbacks . ((stencil . ,Accidental_interface::print) - (after-line-breaking . ,Accidental_interface::after_line_breaking) - )) + + (stencil . ,Accidental_interface::print) + (after-line-breaking . ,Accidental_interface::after_line_breaking) + (meta . ((class . Item) (interfaces . (item-interface accidental-interface @@ -108,9 +119,10 @@ (AmbitusNoteHead . ( (duration-log . 2) - (callbacks . ((stencil . ,Note_head::print) - (glyph-name . ,note-head::calc-glyph-name) - )) + + (stencil . ,Note_head::print) + (glyph-name . ,note-head::calc-glyph-name) + (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (meta . ((class . Item) (interfaces . (font-interface @@ -122,8 +134,10 @@ (Arpeggio . ( - (X-extent-callback . ,Arpeggio::width_callback) - (callbacks . ( (stencil . ,Arpeggio::print))) + + (X-extent . ,Arpeggio::width) + (stencil . ,Arpeggio::print) + (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (X-offset-callbacks . (,Side_position_interface::aligned_side)) (direction . -1) @@ -142,10 +156,11 @@ (layer . 0) (break-visibility . ,all-visible) (breakable . #t) - (callbacks . ((stencil . ,Bar_line::print) - (glyph-name . ,bar-line::calc-glyph-name) - (bar-size . ,Bar_line::calc_bar_size) - )) + + (stencil . ,Bar_line::print) + (glyph-name . ,bar-line::calc-glyph-name) + (bar-size . ,Bar_line::calc_bar_size) + (space-alist . ( (time-signature . (extra-space . 0.75)) (custos . (minimum-space . 2.0)) @@ -172,7 +187,9 @@ (BarNumber . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + ; (breakable . #t) (break-visibility . ,begin-of-line-visible) (padding . 1.0) @@ -194,7 +211,9 @@ (BassFigure . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (Y-offset-callbacks . (,Self_alignment_interface::aligned_on_self)) (direction . 1) (font-family . number) @@ -212,21 +231,28 @@ (NewBassFigure . ( - (callbacks . ( (stencil . ,Text_interface::print))) + ; + (stencil . ,Text_interface::print) + (meta . ((class . Item) (interfaces . (text-interface rhythmic-grob-interface bass-figure-interface font-interface)))))) (BassFigureBracket - . ((callbacks . ((stencil . ,Enclosing_bracket::print))) + . ( + ; + (stencil . ,Enclosing_bracket::print) + (edge-height . (0.2 . 0.2)) (meta . ((class . Item) (interfaces . (enclosing-bracket-interface)) )) )) (BassFigureContinuation . ( - (callbacks . ( (stencil . ,Figured_bass_continuation::print))) + + (stencil . ,Figured_bass_continuation::print) + (Y-offset-callbacks . (,Figured_bass_continuation::center_on_figures)) (meta . ((class . Spanner) (interfaces . (figured-bass-continuation-interface)) @@ -234,7 +260,9 @@ (BassFigureLine . ( (axes . (,Y)) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + + (Y-extent . ,Axis_group_interface::height) + (meta . ((class . Spanner) (interfaces . (axis-group-interface )))))) @@ -243,14 +271,15 @@ . ( (axes . (,Y)) (threshold . (2 . 1000)) - (callbacks . ((positioning-done . ,Align_interface::calc_positioning_done) - )) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + + (positioning-done . ,Align_interface::calc_positioning_done) + (Y-extent . ,Axis_group_interface::height) + (stacking-dir . -1) (meta . ((class . Spanner) (interfaces . (align-interface axis-group-interface)))))) - + (Beam . ( ;; todo: clean this up a bit: the list is getting @@ -261,10 +290,11 @@ ,Beam::slope_damping ,Beam::shift_region_to_valid ,Beam::quanting)) - (callbacks . ((positions . ,Beam::calc_positions) - (direction . ,Beam::calc_direction) - (stencil . ,Beam::print) - )) + + (positions . ,Beam::calc_positions) + (direction . ,Beam::calc_direction) + (stencil . ,Beam::print) + ;; TODO: should be in SLT. (thickness . 0.48) ; in staff-space @@ -298,8 +328,10 @@ . ( (breakable . #t) (stacking-dir . 1) - (callbacks . ((positioning-done . ,Break_align_interface::calc_positioning_done) - )) + + (positioning-done . ,Break_align_interface::calc_positioning_done) + (X-extent . ,Axis_group_interface::width) + (break-align-orders . ;; end of line #((instrument-name left-edge @@ -323,7 +355,7 @@ key-signature staff time-signature custos) - + ;; begin of line (instrument-name left-edge @@ -336,7 +368,6 @@ time-signature custos))) (axes . (0)) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) (meta . ((class . Item) (interfaces . (break-alignment-interface axis-group-interface)))))) @@ -344,7 +375,9 @@ (BreakAlignGroup . ( (axes . (0)) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) + + (X-extent . ,Axis_group_interface::width) + (meta . ((class . Item) (interfaces . (break-aligned-interface axis-group-interface)))))) @@ -361,7 +394,9 @@ (clef . (minimum-space . 2.0)) (first-note . (fixed-space . 1.0)) ;huh? (right-edge . (extra-space . 0.1)))) - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (text . ,(make-musicglyph-markup "scripts.rcomma")) (Y-offset-callbacks . (,Breathing_sign::offset_callback)) (break-visibility . ,begin-of-line-invisible) @@ -373,9 +408,10 @@ (Clef . ( - (callbacks . ((stencil . ,Clef::print) - (glyph-name . ,Clef::calc_glyph_name) - )) + + (stencil . ,Clef::print) + (glyph-name . ,Clef::calc_glyph_name) + (breakable . #t) (font-family . music) (break-align-symbol . clef) @@ -397,15 +433,19 @@ (ClusterSpannerBeacon . ( - (Y-extent-callback . ,Cluster_beacon::height) + + (Y-extent . ,Cluster_beacon::height) + (meta . ((class . Item) (interfaces . (cluster-beacon-interface)))))) (ClusterSpanner . ( - (callbacks . ((springs-and-rods . ,Spanner::set_spacing_rods) - (stencil . ,Cluster::print))) - + + (springs-and-rods . ,Spanner::set_spacing_rods) + (stencil . ,Cluster::print) + + (minimum-length . 0.0) (padding . 0.25) (style . ramp) @@ -414,9 +454,10 @@ (ChordName . ( - (callbacks . ((stencil . ,Text_interface::print) - (after-line-breaking . ,Chord_name::after_line_breaking) - )) + + (stencil . ,Text_interface::print) + (after-line-breaking . ,Chord_name::after_line_breaking) + (word-space . 0.0) (font-family . sans) (font-size . 1.5) @@ -429,7 +470,9 @@ (CombineTextScript . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (no-spacing-rods . #t) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self)) @@ -450,7 +493,9 @@ . ( (break-align-symbol . custos) (breakable . #t) - (callbacks . ((stencil . ,Custos::print))) + + (stencil . ,Custos::print) + (break-visibility . ,end-of-line-visible) (style . vaticana) (neutral-direction . -1) @@ -469,9 +514,10 @@ . ( (axes . (0)) (direction . ,RIGHT) - (callbacks . ((positioning-done . ,Dot_column::calc_positioning_done) - )) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) + + (positioning-done . ,Dot_column::calc_positioning_done) + (X-extent . ,Axis_group_interface::width) + (X-offset-callbacks . (,Dot_column::side_position)) (meta . ((class . Item) (interfaces . (dot-column-interface @@ -479,7 +525,9 @@ (Dots . ( - (callbacks . ((stencil . ,Dots::print))) + + (stencil . ,Dots::print) + (dot-count . 1) (meta . ((class . Item) (interfaces . (font-interface @@ -488,7 +536,9 @@ (DoublePercentRepeat . ( - (callbacks . ((stencil . ,Percent_repeat_item_interface::double_percent))) + + (stencil . ,Percent_repeat_item_interface::double_percent) + (breakable . #t) (slope . 1.0) (font-encoding . fetaMusic) @@ -503,7 +553,9 @@ (DoublePercentRepeatCounter . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self ,Self_alignment_interface::centered_on_other_axis_parent)) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) @@ -522,8 +574,6 @@ (DynamicLineSpanner . ( (axes . (1)) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (staff-padding . 0.1) (padding . 0.6) @@ -532,6 +582,10 @@ (minimum-space . 1.2) (direction . -1) + (Y-extent . ,Axis_group_interface::height) + (X-extent . ,Axis_group_interface::width) + + (meta . ((class . Spanner) (interfaces . (axis-group-interface dynamic-interface @@ -540,10 +594,12 @@ (DynamicText . ( - + ;; todo. - (callbacks . ((stencil . ,Text_interface::print) - (direction . ,Script_interface::calc_direction))) + + (stencil . ,Text_interface::print) + (direction . ,Script_interface::calc_direction) + (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self)) (self-alignment-X . 0) (Y-offset-callbacks . (,Self_alignment_interface::aligned_on_self)) @@ -562,7 +618,9 @@ (DynamicTextSpanner . ( - (callbacks . ((stencil . ,Dynamic_text_spanner::print))) + + (stencil . ,Dynamic_text_spanner::print) + ;; rather ugh with NCSB ;; (font-series . bold) (font-shape . italic) @@ -592,8 +650,10 @@ (self-alignment-X . 0) (self-alignment-Y . 0) (script-priority . 100) - (callbacks . ((stencil . ,Text_interface::print) - (direction . ,Script_interface::calc_direction))) + + (stencil . ,Text_interface::print) + (direction . ,Script_interface::calc_direction) + (font-encoding . fetaNumber) (font-size . -5) ; don't overlap when next to heads. (meta . ((class . Item) @@ -610,12 +670,13 @@ (gap . 0.5) (zigzag-width . 0.75) (breakable . #t) - (X-extent-callback . #f) - (Y-extent-callback . #f) - (callbacks . ((stencil . ,Line_spanner::print) - (after-line-breaking . ,Line_spanner::after_line_breaking) - )) + (X-extent . #f) + (Y-extent . #f) + + (stencil . ,Line_spanner::print) + (after-line-breaking . ,Line_spanner::after_line_breaking) + (meta . ((class . Spanner) (interfaces . (line-interface line-spanner-interface)))))) @@ -629,8 +690,10 @@ (GridLine . ( - (callbacks . ((stencil . ,Grid_line_interface::print))) - (X-extent-callback . ,Grid_line_interface::width_callback) + + (X-extent . ,Grid_line_interface::width) + (stencil . ,Grid_line_interface::print) + (self-alignment-X . ,CENTER) (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self ,Self_alignment_interface::centered_on_parent)) @@ -641,10 +704,12 @@ (Hairpin . ( - - (callbacks . ((stencil . ,Hairpin::print) - (springs-and-rods . ,Spanner::set_spacing_rods) - (after-line-breaking . ,Hairpin::after_line_breaking))) + + + (stencil . ,Hairpin::print) + (springs-and-rods . ,Spanner::set_spacing_rods) + (after-line-breaking . ,Hairpin::after_line_breaking) + (thickness . 1.0) (height . 0.6666) (minimum-length . 2.0) @@ -661,7 +726,9 @@ (HorizontalBracket . ( (thickness . 1.0) - (callbacks . ((stencil . ,Horizontal_bracket::print))) + + (stencil . ,Horizontal_bracket::print) + (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (padding . 0.2) (staff-padding . 0.2) @@ -684,7 +751,9 @@ (left-edge . (extra-space . 1.0)))) (self-alignment-Y . 0) - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (break-align-symbol . instrument-name) (break-visibility . ,begin-of-line-visible) (baseline-skip . 2) @@ -697,7 +766,9 @@ (KeyCancellation . ( - (callbacks . ((stencil . ,Key_signature_interface::print))) + + (stencil . ,Key_signature_interface::print) + (space-alist . ( (time-signature . (extra-space . 1.25)) (staff-bar . (extra-space . 0.6)) @@ -715,7 +786,9 @@ break-aligned-interface)))))) (KeySignature . ( - (callbacks . ((stencil . ,Key_signature_interface::print))) + + (stencil . ,Key_signature_interface::print) + (space-alist . ( (time-signature . (extra-space . 1.25)) (staff-bar . (extra-space . 1.1)) @@ -732,10 +805,11 @@ break-aligned-interface)))))) (LaissezVibrerTie . ( - (callbacks . ((stencil . ,Tie::print) - (control-points . ,Laissez_vibrer_tie::calc_control_points) - (direction . ,Laissez_vibrer_tie::calc_direction) - )) + + (stencil . ,Tie::print) + (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) @@ -743,25 +817,28 @@ (interfaces . (laissez-vibrer-tie-interface)) )) )) - + (LaissezVibrerTieColumn . ( - (X-extent-callback . #f) - (Y-extent-callback . #f) - (callbacks . ((positioning-done . ,Laissez_vibrer_tie_column::calc_positioning_done) - )) + (X-extent . #f) + (Y-extent . #f) + + (positioning-done . ,Laissez_vibrer_tie_column::calc_positioning_done) + (meta . ((class . Item) (interfaces . (laissez-vibrer-tie-column-interface)) )) )) - + (LedgerLineSpanner . ( - (callbacks . ((springs-and-rods . ,Ledger_line_spanner::set_spacing_rods) - - (stencil . ,Ledger_line_spanner::print))) - (X-extent-callback . #f) - (Y-extent-callback . #f) + + (springs-and-rods . ,Ledger_line_spanner::set_spacing_rods) + + (stencil . ,Ledger_line_spanner::print) + + (X-extent . #f) + (Y-extent . #f) (minimum-length-fraction . 0.25) (length-fraction . 0.25) (layer . 0) @@ -791,14 +868,13 @@ (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) - (stencil . ,Tuplet_bracket::print) - )) + + (direction . ,Tuplet_bracket::calc_direction) + (positions . ,Tuplet_bracket::calc_positions) + (stencil . ,Tuplet_bracket::print) + (direction . 1) (gap . 0.0) (padding . 2.0) @@ -818,7 +894,9 @@ (minimum-length . 0.3) (padding . 0.07) ; (springs-and-rods . ,Hyphen_spanner::set_spacing_rods) - (callbacks . ((stencil . ,Hyphen_spanner::print))) + + (stencil . ,Hyphen_spanner::print) + (Y-extent . (0 . 0)) (meta . ((class . Spanner) (interfaces . (lyric-interface @@ -827,7 +905,9 @@ (LyricExtender . ( - (callbacks . ((stencil . ,Lyric_extender::print))) + + (stencil . ,Lyric_extender::print) + (thickness . 0.8) ; linethickness (minimum-length . 1.5) (Y-extent . (0 . 0)) @@ -836,7 +916,10 @@ lyric-extender-interface)))))) (LyricText - . ((callbacks . ((stencil . ,Text_interface::print))) + . ( + + (stencil . ,Text_interface::print) + (X-offset-callbacks . (,Self_alignment_interface::aligned_on_parent)) (self-alignment-X . 0) (word-space . 0.6) @@ -853,15 +936,17 @@ . ( (thickness . 1.4) (flexa-width . 2.0) - (ligature-primitive-callback . ,Mensural_ligature::brew_ligature_primitive) - (callbacks . ((stencil . ,Mensural_ligature::print))) + (stencil . ,Mensural_ligature::print) + (meta . ((class . Spanner) (interfaces . (mensural-ligature-interface font-interface)))))) (MetronomeMark . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (direction . 1) (padding . 0.8) @@ -870,10 +955,13 @@ side-position-interface font-interface metronome-mark-interface)))))) + (MeasureGrouping . ( (Y-offset-callbacks . (,Side_position_interface::aligned_side)) - (callbacks . ((stencil . ,Measure_grouping::print))) + + (stencil . ,Measure_grouping::print) + (padding . 2) (direction . 1) (thickness . 1) @@ -882,9 +970,12 @@ (meta . ((class . Spanner) (interfaces . (side-position-interface measure-grouping-interface)))))) + (MultiMeasureRest . ( - (callbacks . ((stencil . ,Multi_measure_rest::print))) + + (stencil . ,Multi_measure_rest::print) + (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (staff-position . 0) (expand-limit . 10) @@ -898,10 +989,11 @@ font-interface staff-symbol-referencer-interface)))))) + (MultiMeasureRestNumber . ( - (callbacks . ((springs-and-rods . ,Multi_measure_rest::set_spacing_rods) - (stencil . ,Text_interface::print))) + (springs-and-rods . ,Multi_measure_rest::set_spacing_rods) + (stencil . ,Text_interface::print) (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self ,Self_alignment_interface::centered_on_other_axis_parent)) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) @@ -915,11 +1007,15 @@ multi-measure-interface self-alignment-interface font-interface - text-interface)))))) - + text-interface)))) + )) + + (MultiMeasureRestText . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self ,Self_alignment_interface::centered_on_other_axis_parent)) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) @@ -937,10 +1033,11 @@ (NoteCollision . ( (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) - )) + + (X-extent . ,Axis_group_interface::width) + (Y-extent . ,Axis_group_interface::height) + (positioning-done . ,Note_collision_interface::calc_positioning_done) + (meta . ((class . Item) (interfaces . (note-collision-interface axis-group-interface)))))) @@ -948,21 +1045,19 @@ (NoteColumn . ( (axes . (0 1)) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + (X-extent . ,Axis_group_interface::width) + (Y-extent . ,Axis_group_interface::height) + (meta . ((class . Item) (interfaces . (axis-group-interface note-column-interface)))))) (NoteHead . ( - (callbacks . ((stencil . ,Note_head::print) - (stem-attachment . ,Note_head::calc_stem_attachment) - (glyph-name . ,note-head::calc-glyph-name) - )) - ;; WTF is this? - (ligature-primitive-callback . ,Note_head::print) + (stencil . ,Note_head::print) + (stem-attachment . ,Note_head::calc_stem_attachment) + (glyph-name . ,note-head::calc-glyph-name) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (X-offset-callbacks . (,Note_head::stem_x_shift)) (meta . ((class . Item) @@ -987,7 +1082,9 @@ (NoteName . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (meta . ((class . Item) (interfaces . (note-name-interface text-interface @@ -1000,7 +1097,9 @@ (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent ,Self_alignment_interface::aligned_on_self)) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + ;; no Y dimensions, because of lyrics under tenor clef. (Y-extent . (0 . 0)) @@ -1017,7 +1116,9 @@ (OttavaBracket . ( (Y-offset-callbacks . (,Side_position_interface::aligned_side)) - (callbacks . ((stencil . ,Ottava_bracket::print))) + + (stencil . ,Ottava_bracket::print) + (font-shape . italic) (shorten-pair . (0.0 . -0.6)) (staff-padding . 1.0) @@ -1037,13 +1138,14 @@ (PaperColumn . ( (axes . (0)) - (callbacks . ((before-line-breaking . ,Paper_column::before_line_breaking) - ;; (stencil . ,Paper_column::print) - )) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) + + (before-line-breaking . ,Paper_column::before_line_breaking) + ;; (stencil . ,Paper_column::print) + (X-extent . ,Axis_group_interface::width) + ;; debugging - ;; (font-size . -6) (font-name . "sans") (Y-extent-callback . #f) + ;; (font-size . -6) (font-name . "sans") (Y-extent . #f) (meta . ((class . Paper_column) (interfaces . (paper-column-interface axis-group-interface @@ -1051,15 +1153,16 @@ (PhrasingSlur . ((slur-details . ,default-slur-details) - (callbacks . ((control-points . ,Slur::calc_control_points) - (direction . ,Slur::calc_direction) - (springs-and-rods . ,Spanner::set_spacing_rods) - (stencil . ,Slur::print) - )) + + (control-points . ,Slur::calc_control_points) + (direction . ,Slur::calc_direction) + (springs-and-rods . ,Spanner::set_spacing_rods) + (Y-extent . ,Slur::height) + (stencil . ,Slur::print) + (thickness . 1.1) (minimum-length . 1.5) - (Y-extent-callback . ,Slur::height) (height-limit . 2.0) (ratio . 0.333) (meta . ((class . Spanner) @@ -1068,14 +1171,15 @@ (NonMusicalPaperColumn . ( (axes . (0)) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) - (callbacks . ((before-line-breaking . ,Paper_column::before_line_breaking) - ;; (stencil . ,Paper_column::print) - )) + + (before-line-breaking . ,Paper_column::before_line_breaking) + (X-extent . ,Axis_group_interface::width) + ;; (stencil . ,Paper_column::print) + (breakable . #t) ;; debugging stuff: print column number. - ;; (font-size . -6) (font-name . "sans") (Y-extent-callback . #f) + ;; (font-size . -6) (font-name . "sans") (Y-extent . #f) (meta . ((class . Paper_column) (interfaces . (paper-column-interface @@ -1084,8 +1188,10 @@ (PercentRepeat . ( - (callbacks . ((springs-and-rods . ,Multi_measure_rest::set_spacing_rods) - (stencil . ,Multi_measure_rest::percent))) + + (springs-and-rods . ,Multi_measure_rest::set_spacing_rods) + (stencil . ,Multi_measure_rest::percent) + (slope . 1.0) (thickness . 0.48) (font-encoding . fetaMusic) @@ -1094,7 +1200,10 @@ font-interface percent-repeat-interface)))))) (PercentRepeatCounter - . ((callbacks . ((stencil . ,Text_interface::print))) + . ( + + (stencil . ,Text_interface::print) + (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self ,Self_alignment_interface::centered_on_other_axis_parent)) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) @@ -1114,7 +1223,9 @@ ;; an example of a text spanner (PianoPedalBracket . ( - (callbacks . ((stencil . ,Piano_pedal_bracket::print))) + + (stencil . ,Piano_pedal_bracket::print) + (style . line) (bound-padding . 1.0) (direction . -1) @@ -1129,10 +1240,14 @@ (RehearsalMark . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self)) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) - (callbacks . ((after-line-breaking . ,shift-right-at-line-begin))) + + (after-line-breaking . ,shift-right-at-line-begin) + (self-alignment-X . 0) (direction . 1) (breakable . #t) @@ -1150,7 +1265,9 @@ (RemoveEmptyVerticalGroup . ( (Y-offset-callbacks . (,Hara_kiri_group_spanner::force_hara_kiri_callback)) - (Y-extent-callback . ,Hara_kiri_group_spanner::y_extent) + + (Y-extent . ,Hara_kiri_group_spanner::y_extent) + (axes . (1)) (meta . ((class . Spanner) (interfaces . (axis-group-interface @@ -1160,16 +1277,20 @@ (RepeatSlash . ( - (callbacks . ((stencil . ,Percent_repeat_item_interface::beat_slash))) + + (stencil . ,Percent_repeat_item_interface::beat_slash) + (thickness . 0.48) (slope . 1.7) (meta . ((class . Item) (interfaces . (percent-repeat-interface)))))) (Rest . ( - (X-extent-callback . ,Rest::extent_callback) - (Y-extent-callback . ,Rest::extent_callback) - (callbacks . ((stencil . ,Rest::print))) + + (stencil . ,Rest::print) + (X-extent . ,Rest::width) + (Y-extent . ,Rest::height) + (Y-offset-callbacks . ( ,Staff_symbol_referencer::callback ,Rest::polyphonic_offset_callback @@ -1186,8 +1307,8 @@ (RestCollision . ( (minimum-distance . 0.75) - (callbacks . ((positioning-done . ,Rest_collision::calc_positioning_done) - )) + (positioning-done . ,Rest_collision::calc_positioning_done) + (meta . ((class . Item) (interfaces . (rest-collision-interface)))))) @@ -1201,8 +1322,10 @@ (staff-padding . 0.25) ;; (script-priority . 0) priorities for scripts, see script.scm (X-offset-callbacks . (,Self_alignment_interface::centered_on_parent)) - (callbacks . ((stencil . ,Script_interface::print) - (direction . ,Script_interface::calc_direction))) + + (stencil . ,Script_interface::print) + (direction . ,Script_interface::calc_direction) + (font-encoding . fetaMusic) (meta . ((class . Item) (interfaces . (script-interface @@ -1211,22 +1334,25 @@ (ScriptColumn . ( - (callbacks . ((before-line-breaking . ,Script_column::before_line_breaking))) + + (before-line-breaking . ,Script_column::before_line_breaking) + (meta . ((class . Item) (interfaces . (script-column-interface)))))) (SeparationItem . ( - (X-extent-callback . #f) - (Y-extent-callback . #f) + (X-extent . #f) + (Y-extent . #f) (meta . ((class . Item) (interfaces . (spacing-interface separation-item-interface)))))) (SeparatingGroupSpanner . ( - (callbacks . ((springs-and-rods . ,Separating_group_spanner::set_spacing_rods) - )) + + (springs-and-rods . ,Separating_group_spanner::set_spacing_rods) + (meta . ((class . Spanner) (interfaces . (only-prebreak-interface spacing-interface @@ -1234,14 +1360,15 @@ (Slur . ((slur-details . ,default-slur-details) - (callbacks . ((control-points . ,Slur::calc_control_points) - (direction . ,Slur::calc_direction) - (springs-and-rods . ,Spanner::set_spacing_rods) - (stencil . ,Slur::print) - )) + + (control-points . ,Slur::calc_control_points) + (direction . ,Slur::calc_direction) + (springs-and-rods . ,Spanner::set_spacing_rods) + (Y-extent . ,Slur::height) + (stencil . ,Slur::print) + (thickness . 1.0) (minimum-length . 1.5) - (Y-extent-callback . ,Slur::height) ; Slur::height) (height-limit . 2.0) (ratio . 0.25) @@ -1250,7 +1377,9 @@ (SpacingSpanner . ( - (callbacks . ((springs-and-rods . ,Spacing_spanner::set_springs))) + + (springs-and-rods . ,Spacing_spanner::set_springs) + (grace-space-factor . 0.6) (shortest-duration-space . 2.0) (spacing-increment . 1.2) @@ -1262,14 +1391,16 @@ (SpanBar . ( (break-align-symbol . staff-bar) - (X-extent-callback . ,Span_bar::width_callback) - (Y-extent-callback . ()) + (Y-extent . ()) (layer . 0) (breakable . #t) - (callbacks . ((stencil . ,Span_bar::print) - (bar-size . ,Span_bar::calc_bar_size) - (glyph-name . ,Span_bar::calc_glyph_name) - (before-line-breaking . ,Span_bar::before_line_breaking))) + + (stencil . ,Span_bar::print) + (bar-size . ,Span_bar::calc_bar_size) + (X-extent . ,Span_bar::width) + (glyph-name . ,Span_bar::calc_glyph_name) + (before-line-breaking . ,Span_bar::before_line_breaking) + ;; ugh duplication! ;; @@ -1285,7 +1416,9 @@ bar-line-interface)))))) (StanzaNumber - . ((callbacks . ((stencil . ,Text_interface::print))) + . ( + (stencil . ,Text_interface::print) + (font-series . bold) (padding . 1.0) (X-offset-callbacks . (,Side_position_interface::aligned_side)) @@ -1298,7 +1431,9 @@ (StringNumber . ( - (callbacks . ((stencil . ,print-circled-text-callback))) + + (stencil . ,print-circled-text-callback) + (padding . 0.5) (staff-padding . 0.5) (self-alignment-X . 0) @@ -1325,7 +1460,9 @@ (SostenutoPedal . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) + (direction . 1) (X-offset-callbacks . (,Self_alignment_interface::aligned_on_self)) (no-spacing-rods . #t) @@ -1340,7 +1477,9 @@ (SostenutoPedalLineSpanner . ( (axes . (1)) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + + (X-extent . ,Axis_group_interface::height) + (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (padding . 1.2) @@ -1353,7 +1492,9 @@ (StaffSymbol . ( - (callbacks . ((stencil . ,Staff_symbol::print))) + + (stencil . ,Staff_symbol::print) + (line-count . 5) (ledger-line-thickness . (1.0 . 0.1)) (layer . 0) @@ -1362,14 +1503,15 @@ (Stem . ( - ;; this list is rather long. Trim --hwn - (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) - (stencil . ,Stem::print) - (length . ,Stem::calc_length) - )) + (direction . ,Stem::calc_direction) + (stem-end-position . ,Stem::calc_stem_end_position) + (stem-info . ,Stem::calc_stem_info) + (positioning-done . ,Stem::calc_positioning_done) + (stencil . ,Stem::print) + (X-extent . ,Stem::width) + (Y-extent . ,Stem::height) + (length . ,Stem::calc_length) + (thickness . 1.3) (details @@ -1399,7 +1541,7 @@ (stem-shorten . (1.0 0.5)) )) - + ;; default stem direction for note on middle line (neutral-direction . -1) @@ -1408,8 +1550,6 @@ ;; and the extreme minima as abolute minimum length. (X-offset-callbacks . (,Stem::offset_callback)) - (X-extent-callback . ,Stem::width_callback) - (Y-extent-callback . ,Stem::height) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (meta . ((class . Item) (interfaces . (stem-interface @@ -1417,10 +1557,9 @@ (StemTremolo . ( - (callbacks . ((stencil . ,Stem_tremolo::print))) - (Y-extent-callback . ,Stem_tremolo::height) - (X-extent-callback . #f) - + (Y-extent . ,Stem_tremolo::height) + (stencil . ,Stem_tremolo::print) + (X-extent . #f) (beam-width . 1.6) ; staff-space (beam-thickness . 0.48) ; staff-space (meta . ((class . Item) @@ -1429,7 +1568,7 @@ (SustainPedal . ( (no-spacing-rods . #t) - (callbacks . ((stencil . ,Sustain_pedal::print))) + (stencil . ,Sustain_pedal::print) (self-alignment-X . 0) (direction . 1) (padding . 0.0) ;; padding relative to SustainPedalLineSpanner @@ -1444,9 +1583,8 @@ (SustainPedalLineSpanner . ( (axes . (1)) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + (X-extent . ,Axis_group_interface::height) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) - (padding . 1.2) (staff-padding . 1.2) (minimum-space . 1.0) @@ -1459,8 +1597,8 @@ (System . ( (axes . (0 1)) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + (X-extent . ,Axis_group_interface::width) + (Y-extent . ,Axis_group_interface::height) (meta . ((class . System) (interfaces . (system-interface axis-group-interface)))))) @@ -1468,19 +1606,19 @@ (SystemStartBrace . ( (glyph . "brace") - (callbacks . ((stencil . ,System_start_delimiter::print))) + (stencil . ,System_start_delimiter::print) (collapse-height . 5.0) (font-encoding . fetaBraces) - (Y-extent-callback . #f) + (Y-extent . #f) (meta . ((class . Spanner) (interfaces . (system-start-delimiter-interface font-interface)))))) (SystemStartBracket . ( - (Y-extent-callback . #f) + (Y-extent . #f) (X-offset-callbacks . (,(lambda (g a) -0.8))) - (callbacks . ((stencil . ,System_start_delimiter::print))) + (stencil . ,System_start_delimiter::print) (glyph . "bracket") (collapse-height . 5.0) (thickness . 0.45) @@ -1490,17 +1628,17 @@ (SystemStartBar . ( - (Y-extent-callback . #f) + (Y-extent . #f) (glyph . "bar-line") (thickness . 1.6) - (callbacks . ((stencil . ,System_start_delimiter::print) - )) + (stencil . ,System_start_delimiter::print) (meta . ((class . Spanner) (interfaces . (system-start-delimiter-interface)))))) (TabNoteHead . ( - (callbacks . ((stencil . ,Text_interface::print))) + + (stencil . ,Text_interface::print) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (font-size . -2) (stem-attachment . (1.0 . 1.35)) @@ -1522,8 +1660,10 @@ ;; sync with Fingering ? (padding . 0.5) (staff-padding . 0.5) - (callbacks . ((stencil . ,Text_interface::print) - (direction . ,Script_interface::calc_direction))) + + (stencil . ,Text_interface::print) + (direction . ,Script_interface::calc_direction) + (avoid-slur . around) (slur-padding . 0.5) (script-priority . 200) @@ -1536,7 +1676,7 @@ (TextSpanner . ( - (callbacks .((stencil . ,Text_spanner::print))) + (stencil . ,Text_spanner::print) (font-shape . italic) (style . dashed-line) (staff-padding . 0.8) @@ -1550,10 +1690,9 @@ (Tie . ( - (callbacks . ((control-points . ,Tie::calc_control_points) - (direction . ,Tie::calc_direction) - (stencil . ,Tie::print) - )) + (control-points . ,Tie::calc_control_points) + (direction . ,Tie::calc_direction) + (stencil . ,Tie::print) (details . ((ratio . 0.333) (height-limit . 1.0) (between-length-limit . 1.0))) @@ -1564,18 +1703,16 @@ (TieColumn . ( - (callbacks . ((positioning-done . ,Tie_column::calc_positioning_done) - (before-line-breaking . ,Tie_column::before_line_breaking) - )) - (X-extent-callback . #f) - (Y-extent-callback . #f) - + (positioning-done . ,Tie_column::calc_positioning_done) + (before-line-breaking . ,Tie_column::before_line_breaking) + (X-extent . #f) + (Y-extent . #f) (meta . ((class . Spanner) (interfaces . (tie-column-interface)))))) (TimeSignature . ( - (callbacks . ((stencil . ,Time_signature::print))) + (stencil . ,Time_signature::print) (break-align-symbol . time-signature) (break-visibility . ,all-visible) (space-alist . ( @@ -1591,7 +1728,7 @@ (TrillSpanner . ( - (callbacks . ((stencil . ,Dynamic_text_spanner::print))) + (stencil . ,Dynamic_text_spanner::print) (edge-text . ,(cons (make-musicglyph-markup "scripts.trill") "")) (style . trill) @@ -1609,7 +1746,7 @@ (padding . 0.2) (direction . ,LEFT) (font-size . -4) - (callbacks . ((stencil . ,Accidental_interface::print))) + (stencil . ,Accidental_interface::print) (meta . ((class . Item) (interfaces . (item-interface accidental-interface @@ -1620,7 +1757,7 @@ . ((X-offset-callbacks . (,Side_position_interface::aligned_side)) (axes . (,X)) (font-size . -4) - (callbacks . ((stencil . ,parenthesize-elements))) + (stencil . ,parenthesize-elements) (direction . ,RIGHT) (padding . 0.3) (meta . ((class . Item) @@ -1632,7 +1769,8 @@ axis-group-interface)))))) (TrillPitchHead - . ((callbacks . ((stencil . ,Note_head::print))) + . ( + (stencil . ,Note_head::print) (duration-log . 2) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (font-size . -4) @@ -1650,12 +1788,10 @@ (thickness . 1.6) (edge-height . (0.7 . 0.7)) (shorten-pair . (-0.2 . -0.2)) - (callbacks . ((direction . ,Tuplet_bracket::calc_direction) - (positions . ,Tuplet_bracket::calc_positions) - (stencil . ,Tuplet_bracket::print) - )) + (direction . ,Tuplet_bracket::calc_direction) + (positions . ,Tuplet_bracket::calc_positions) + (stencil . ,Tuplet_bracket::print) (font-shape . italic) - (font-size . -2) (meta . ((class . Spanner) (interfaces . (text-interface @@ -1665,7 +1801,7 @@ (UnaCordaPedal . ( - (callbacks . ((stencil . ,Text_interface::print))) + (stencil . ,Text_interface::print) (font-shape . italic) (no-spacing-rods . #t) (self-alignment-X . 0) @@ -1680,7 +1816,7 @@ (UnaCordaPedalLineSpanner . ( (axes . (1)) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) + (X-extent . ,Axis_group_interface::height) (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (padding . 1.2) (staff-padding . 1.2) @@ -1695,8 +1831,7 @@ . ( (thickness . 0.6) (flexa-width . 2.0) - (ligature-primitive-callback . ,Vaticana_ligature::brew_ligature_primitive) - (callbacks . ((stencil . ,Vaticana_ligature::print))) + (stencil . ,Vaticana_ligature::print) (meta . ((class . Spanner) (interfaces . (vaticana-ligature-interface font-interface)))))) @@ -1704,22 +1839,19 @@ (VerticalAlignment . ( (axes . (1)) - (callbacks . ((positioning-done . ,Align_interface::calc_positioning_done) - (after-line-breaking . ,Align_interface::stretch_after_break) - )) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) + (positioning-done . ,Align_interface::calc_positioning_done) + (after-line-breaking . ,Align_interface::stretch_after_break) + (Y-extent . ,Axis_group_interface::height) + (X-extent . ,Axis_group_interface::width) (stacking-dir . -1) (meta . ((class . Spanner) (interfaces . (align-interface axis-group-interface)))))) - (VerticalAxisGroup . ( (axes . (1)) - (Y-extent-callback . ,Axis_group_interface::group_extent_callback) - (X-extent-callback . ,Axis_group_interface::group_extent_callback) - + (Y-extent . ,Axis_group_interface::height) + (X-extent . ,Axis_group_interface::width) (meta . ((class . Spanner) (interfaces . (axis-group-interface vertically-spaceable-interface)))))) @@ -1731,7 +1863,7 @@ (direction . 0) (space-alist . ((left-edge . (extra-space . 1.0)))) (break-align-symbol . instrument-name) - (callbacks . ((stencil . ,Text_interface::print))) + (stencil . ,Text_interface::print) (break-align-symbol . clef) (break-visibility . ,begin-of-line-visible) (baseline-skip . 2) @@ -1744,8 +1876,8 @@ (VoltaBracket . ( - (callbacks . ((stencil . ,Volta_bracket_interface::print) - (after-line-breaking . ,Volta_bracket_interface::after_line_breaking))) + (stencil . ,Volta_bracket_interface::print) + (after-line-breaking . ,Volta_bracket_interface::after_line_breaking) (direction . ,UP) (padding . 1) (font-encoding . fetaNumber) @@ -1760,22 +1892,25 @@ line-interface text-interface side-position-interface - font-interface)))))) + font-interface))) + ))) + - (VoiceFollower . ( (style . line) (gap . 0.5) (breakable . #t) - (X-extent-callback . #f) - (Y-extent-callback . #f) - - (callbacks . ((stencil . ,Line_spanner::print) - (after-line-breaking . ,Line_spanner::after_line_breaking))) + (X-extent . #f) + (Y-extent . #f) + (stencil . ,Line_spanner::print) + (after-line-breaking . ,Line_spanner::after_line_breaking) (meta . ((class . Spanner) (interfaces . (line-spanner-interface - line-interface)))))))) + line-interface)))) + )) + +)) (define (completize-grob-entry x) "Transplant assoc key into 'name entry of 'meta of X. Set interfaces for Item, Spanner etc. diff --git a/scm/music-functions.scm b/scm/music-functions.scm index f5f3eb7988..88c02025e2 100644 --- a/scm/music-functions.scm +++ b/scm/music-functions.scm @@ -808,15 +808,13 @@ if appropriate. (define-public ((add-balloon-text object-name text off) grob orig-context cur-context) "Usage: see input/regression/balloon.ly " (let* ((meta (ly:grob-property grob 'meta)) - (callbacks (ly:grob-property grob 'callbacks)) - (nm (if (pair? meta) (cdr (assoc 'name meta)) "nonexistant")) - (cb-handle (assoc 'stencil callbacks)) - (cb (if cb-handle (cdr cb-handle) #f))) + (cb (ly:grob-property-data grob 'stencil)) + (nm (if (pair? meta) (cdr (assoc 'name meta)) "nonexistant"))) (if (and (equal? nm object-name) - cb) + (procedure? cb)) (begin - (ly:grob-set-callback! grob 'stencil Balloon_interface::print) - (set! (ly:grob-property grob 'balloon-original-callback) cb) + (ly:grob-set-property! grob 'stencil Balloon_interface::print) + (set! (ly:grob-property grob 'original-stencil) cb) (set! (ly:grob-property grob 'balloon-text) text) (set! (ly:grob-property grob 'balloon-text-offset) off) (set! (ly:grob-property grob 'balloon-text-props) '((font-family . roman))))))) diff --git a/scm/safe-lily.scm b/scm/safe-lily.scm index cfa6cb4031..26a326ef06 100644 --- a/scm/safe-lily.scm +++ b/scm/safe-lily.scm @@ -148,8 +148,6 @@ Ambitus::print Arpeggio::print Arpeggio::brew_chord_bracket - Arpeggio::width_callback - Axis_group_interface::group_extent_callback Bar_line::print Breathing_sign::offset_callback Clef::print @@ -180,7 +178,6 @@ Percent_repeat_item_interface::beat_slash Percent_repeat_item_interface::double_percent Piano_pedal_bracket::print - Rest::extent_callback Rest::polyphonic_offset_callback Rest::print Script_interface::print @@ -195,11 +192,9 @@ Slur::print Spacing_spanner::set_springs Span_bar::print - Span_bar::width_callback Spanner::set_spacing_rods Staff_symbol::print Staff_symbol_referencer::callback - Stem::width_callback Stem::height Stem::offset_callback Stem::print diff --git a/scm/translation-functions.scm b/scm/translation-functions.scm index 3f72803b28..ad79b7bc2d 100644 --- a/scm/translation-functions.scm +++ b/scm/translation-functions.scm @@ -79,6 +79,7 @@ #f)) (alt-dir (ly:context-property context 'figuredBassAlterationDirection)) + (plus-dir (ly:context-property context 'figuredBassPlusDirection)) ) (if (and (not fig-markup) alt-markup) @@ -111,7 +112,9 @@ (if fig-markup (markup #:put-adjacent fig-markup - X LEFT + X (if (number? plus-dir) + plus-dir + LEFT) #:pad-x 0.2 plus-markup) plus-markup))) diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index 8df5168b8c..ff4295584f 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -283,7 +283,7 @@ AC_DEFUN(STEPMAKE_DATADIR, [ presome=${ac_default_prefix} fi - build_package_datadir=$ugh_ugh_autoconf250_builddir/share/$package + build_package_datadir=$ugh_ugh_autoconf250_builddir/out$CONFIGSUFFIX/share/$package DATADIR=`echo ${datadir} | sed "s!\\\${prefix}!$presome!"` BUILD_PACKAGE_DATADIR=`echo ${build_package_datadir} | sed "s!\\\${prefix}!$presome!"` @@ -301,7 +301,7 @@ AC_DEFUN(STEPMAKE_LIBDIR, [ libdir='${exec_prefix}/lib' fi presome=$exec_prefix - build_package_libdir=$ugh_ugh_autoconf250_builddir/lib/$package + build_package_libdir=$ugh_ugh_autoconf250_builddir/out$CONFIGSUFFIX/lib/$package LIBDIR=`echo ${libdir} | sed "s!\\\${exec_prefix}!$presome!"` BUILD_PACKAGE_LIBDIR=`echo ${build_package_libdir} | sed "s!\\\${exec_prefix}!$presome!"` -- 2.39.2