From 5f7cab79f11e1c1ffc7a905fde0e7801a3d16d9f Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 02:03:49 +0000 Subject: [PATCH] lilypond-1.5.19 --- lily/break-align-item.cc | 4 +-- lily/chord-name.cc | 4 +-- lily/clef-engraver.cc | 6 ++-- lily/directional-element-interface.cc | 16 +++------- lily/dynamic-engraver.cc | 6 ++-- lily/engraver-group-engraver.cc | 6 ++-- lily/global-translator.cc | 2 +- lily/include/directional-element-interface.hh | 2 +- lily/include/group-interface.hh | 2 +- lily/include/lily-guile.hh | 13 +++++--- lily/include/music.hh | 18 ++++++----- lily/include/protected-scm.hh | 3 +- lily/include/translator-group.hh | 7 +++-- lily/include/translator.hh | 6 ++-- lily/lily-guile.cc | 5 ++++ lily/line-group-group-engraver.cc | 4 +-- lily/music.cc | 30 ++++++++----------- lily/note-head.cc | 12 ++++---- lily/output-property-engraver.cc | 2 +- lily/parser.yy | 2 +- lily/part-combine-music-iterator.cc | 4 +-- lily/property-engraver.cc | 6 ++-- lily/property-iterator.cc | 2 +- lily/score-engraver.cc | 10 +++---- lily/span-bar-engraver.cc | 6 ++-- lily/span-bar.cc | 8 ++--- lily/staff-performer.cc | 4 +-- lily/system-start-delimiter-engraver.cc | 2 +- lily/translator-def.cc | 2 +- lily/translator-group.cc | 26 ++++++---------- lily/translator.cc | 7 +++-- lily/unfolded-repeat-iterator.cc | 2 +- 32 files changed, 116 insertions(+), 113 deletions(-) diff --git a/lily/break-align-item.cc b/lily/break-align-item.cc index b47d5b0358..8349ce5e63 100644 --- a/lily/break-align-item.cc +++ b/lily/break-align-item.cc @@ -152,8 +152,8 @@ Break_align_interface::do_alignment (Grob *me) symbol_list = ly_cdr (scm_reverse (symbol_list)); for (int i=0; i set_grob_property (ly_car (symbol_list), - scm_cons (gh_double2scm (0), + elems[i]->internal_set_grob_property (ly_car (symbol_list), + scm_cons (gh_double2scm (0), gh_double2scm (dists[i+1]))); symbol_list = ly_cdr (symbol_list); diff --git a/lily/chord-name.cc b/lily/chord-name.cc index 8c0d543487..5595759236 100644 --- a/lily/chord-name.cc +++ b/lily/chord-name.cc @@ -48,8 +48,8 @@ Chord_name::brew_molecule (SCM smob) if (!gh_symbol_p (style)) style = ly_symbol2scm ("banter"); - SCM chord = me-> get_grob_property ("chord"); - SCM func = me->get_grob_property (ly_symbol2scm ("chord-name-function")); + SCM chord = me->get_grob_property ("chord"); + SCM func = me->get_grob_property ("chord-name-function"); SCM text = gh_call2 (func, style, chord); SCM properties = Font_interface::font_alist_chain (me); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index a04db27dac..6a4646f6cd 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -98,8 +98,10 @@ Clef_engraver::create_clef () clef_p_ = c; } - Staff_symbol_referencer::set_position (clef_p_, - gh_scm2int (get_property ("clefPosition"))); + SCM cpos = get_property ("clefPosition"); + + if (gh_number_p (cpos)) + Staff_symbol_referencer::set_position (clef_p_, gh_scm2int (cpos)); SCM oct = get_property ("clefOctavation"); if (gh_number_p (oct) && gh_scm2int (oct)) diff --git a/lily/directional-element-interface.cc b/lily/directional-element-interface.cc index 7f986d51ee..ac2c40927d 100644 --- a/lily/directional-element-interface.cc +++ b/lily/directional-element-interface.cc @@ -10,27 +10,19 @@ #include "directional-element-interface.hh" -SCM Directional_element_interface::direction_sym; - -static void -init_functions () -{ - Directional_element_interface::direction_sym = scm_permanent_object (ly_symbol2scm ("direction")); -} -ADD_SCM_INIT_FUNC (Directional, init_functions); bool Directional_element_interface::has_interface (Grob*me) { - return isdir_b (me->get_grob_property (direction_sym)); + return isdir_b (me->get_grob_property ("direction")); } Direction Directional_element_interface::get (Grob*me) { // return dir_; - SCM d= me->get_grob_property (direction_sym); + SCM d= me->get_grob_property ("direction"); if (!isdir_b (d)) return CENTER; @@ -42,6 +34,6 @@ Directional_element_interface::set (Grob*me, Direction d) { SCM sd = gh_int2scm (d); - if (me->get_grob_property (direction_sym) != sd) - me->set_grob_property (direction_sym, sd); + if (me->get_grob_property ("direction") != sd) + me->set_grob_property ("direction", sd); } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 32dd5b23a4..3241671974 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -253,8 +253,8 @@ Dynamic_engraver::process_music () cresc_p_->set_interface (ly_symbol2scm ("dynamic-interface")); cresc_p_->set_grob_property ("type", s); - daddy_trans_l_->set_property (start_type - + "Spanner", SCM_UNDEFINED); + daddy_trans_l_->set_property ((start_type + + "Spanner").ch_C(), SCM_UNDEFINED); s = get_property ((start_type + "Text").ch_C ()); /* FIXME: use markup_p () to check type. @@ -263,7 +263,7 @@ Dynamic_engraver::process_music () { cresc_p_->set_grob_property ("edge-text", gh_cons (s, ly_str02scm (""))); - daddy_trans_l_->set_property (start_type + "Text", + daddy_trans_l_->set_property ((start_type + "Text").ch_C(), SCM_UNDEFINED); } } diff --git a/lily/engraver-group-engraver.cc b/lily/engraver-group-engraver.cc index 8dd6e1a4ce..c0cc4eb51d 100644 --- a/lily/engraver-group-engraver.cc +++ b/lily/engraver-group-engraver.cc @@ -41,7 +41,7 @@ Engraver_group_engraver::acknowledge_grobs () if (!announce_info_arr_.size ()) return ; - SCM tab =get_property (ly_symbol2scm ("acknowledgeHashTable")); + SCM tab = get_property ("acknowledgeHashTable"); SCM name_sym = ly_symbol2scm ("name"); SCM meta_sym = ly_symbol2scm ("meta"); @@ -50,7 +50,7 @@ Engraver_group_engraver::acknowledge_grobs () { Grob_info info = announce_info_arr_[j]; - SCM meta = info.grob_l_->get_grob_property (meta_sym); + SCM meta = info.grob_l_->internal_get_grob_property (meta_sym); SCM nm = scm_assoc (name_sym, meta); if (gh_pair_p (nm)) nm = ly_cdr (nm); @@ -135,7 +135,7 @@ void Engraver_group_engraver::initialize () { SCM tab = scm_make_vector (gh_int2scm (61), SCM_BOOL_F); // magic -> - set_property (ly_symbol2scm ("acknowledgeHashTable"), tab); + set_property ("acknowledgeHashTable", tab); Translator_group::initialize (); } diff --git a/lily/global-translator.cc b/lily/global-translator.cc index 4e4208bd82..7ca91a5ad3 100644 --- a/lily/global-translator.cc +++ b/lily/global-translator.cc @@ -104,7 +104,7 @@ Global_translator::run_iterator_on_me (Music_iterator * iter) if (first) { first = false; - set_property (ly_symbol2scm ("measurePosition"), w.smobbed_copy ()); + set_property ("measurePosition", w.smobbed_copy ()); } prepare (w); diff --git a/lily/include/directional-element-interface.hh b/lily/include/directional-element-interface.hh index 81685e377a..233e3d9e44 100644 --- a/lily/include/directional-element-interface.hh +++ b/lily/include/directional-element-interface.hh @@ -15,7 +15,7 @@ struct Directional_element_interface { public: - static SCM direction_sym ; + static void set (Grob*,Direction d); static Direction get (Grob*) ; static bool has_interface (Grob*) ; diff --git a/lily/include/group-interface.hh b/lily/include/group-interface.hh index e2303633dc..7a07bccd6d 100644 --- a/lily/include/group-interface.hh +++ b/lily/include/group-interface.hh @@ -13,8 +13,8 @@ #include "lily-proto.hh" #include "string.hh" #include "lily-guile.hh" -#include "smobs.hh" +#include "grob.hh" /** Look at Score element ELT as thing which has a list property called NAME_. Normally the list would contain Grobs, but diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index 54c9decd29..e67293e06f 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -9,6 +9,8 @@ #ifndef LILY_GUILE_HH #define LILY_GUILE_HH +#define SCM_VOIDP_TEST + #include /* @@ -89,6 +91,8 @@ SCM ly_truncate_list (int k, SCM l ); #define CACHE_SYMBOLS #ifdef CACHE_SYMBOLS +SCM my_gh_symbol2scm (const char* x); + // #warning: CACHE_SYMBOLS /* @@ -102,10 +106,11 @@ SCM ly_truncate_list (int k, SCM l ); */ #define ly_symbol2scm(x) ({ static SCM cached; \ SCM value = cached; /* We store this one locally, since G++ -O2 fucks up else */ \ - if (__builtin_constant_p (x))\ - value = cached = scm_permanent_object (gh_symbol2scm((char*)x));\ - else\ - value = gh_symbol2scm ((char*)x); \ + if ( __builtin_constant_p ((x)))\ + { if (!cached)\ + value = cached = scm_gc_protect_object (my_gh_symbol2scm((char*) (x)));\ + } else\ + value = gh_symbol2scm ((char*) (x)); \ value; }) #else inline SCM ly_symbol2scm(char const* x) { return gh_symbol2scm((char*)x); } diff --git a/lily/include/music.hh b/lily/include/music.hh index 500eb003dc..d89c24f70e 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -19,6 +19,9 @@ #include "music-constructor.hh" +#define get_mus_property(x) internal_get_mus_property(ly_symbol2scm(x)) +#define set_mus_property(x,y) internal_set_mus_property(ly_symbol2scm (x), y) + /** Music is anything that has duration and supports both time compression and transposition. @@ -36,15 +39,16 @@ class Music { public: Input *origin () const; void set_spot (Input); - - SCM get_mus_property (const char*) const; - SCM get_mus_property (SCM) const; - void set_mus_property (const char * , SCM val); + + SCM internal_get_mus_property (SCM) const; + void internal_set_mus_property (SCM , SCM val); +#if 0 void set_immutable_mus_property (const char * , SCM val); - void set_immutable_mus_property (SCM key, SCM val); - void set_mus_property (SCM , SCM val); - void set_mus_pointer (const char*, SCM val); + void set_immutable_mus_property (SCM key, SCM val); + SCM remove_mus_property (const char* nm); +#endif + virtual Pitch to_relative_octave (Pitch); diff --git a/lily/include/protected-scm.hh b/lily/include/protected-scm.hh index 10ba29c8e8..7a13b24b1f 100644 --- a/lily/include/protected-scm.hh +++ b/lily/include/protected-scm.hh @@ -10,7 +10,8 @@ #ifndef PROTECTED_SCM_HH #define PROTECTED_SCM_HH -#include + +#include "lily-guile.hh" /* Mix GUILE GC with C++ ctors and dtors. diff --git a/lily/include/translator-group.hh b/lily/include/translator-group.hh index 1e61749356..50a713be69 100644 --- a/lily/include/translator-group.hh +++ b/lily/include/translator-group.hh @@ -19,6 +19,7 @@ // egcs typedef void (Translator::*Method_pointer) (void); +#define set_property(x,y) internal_set_property(ly_symbol2scm(x),y) class Scheme_hash_table; @@ -37,10 +38,10 @@ protected: public: SCM add_translator (SCM, Translator*); void execute_single_pushpop_property (SCM prop, SCM sym, SCM val); - SCM get_property (SCM name_sym) const; - void set_property (String var_name, SCM value); + SCM internal_get_property (SCM name_sym) const; + void unset_property (SCM var_sym); - void set_property (SCM var_sym, SCM value); + void internal_set_property (SCM var_sym, SCM value); Translator_group *where_defined (SCM name_sym) const; String id_str_; diff --git a/lily/include/translator.hh b/lily/include/translator.hh index 6c1ff11327..1e1109d99c 100644 --- a/lily/include/translator.hh +++ b/lily/include/translator.hh @@ -19,6 +19,9 @@ #include "input.hh" #include "smobs.hh" +#define get_property(x) internal_get_property(ly_symbol2scm(x)) + + #define TRANSLATOR_DECLARATIONS(NAME) \ public: \ NAME();\ @@ -53,8 +56,7 @@ public: */ Music_output_def *output_def_l () const; - SCM get_property (const char *) const; - SCM get_property (SCM symbol) const; + SCM internal_get_property (SCM symbol) const; virtual Moment now_mom () const; diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 77c3ce5506..ccca4cee06 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -542,3 +542,8 @@ ly_truncate_list (int k, SCM l ) } return l; } + +SCM my_gh_symbol2scm (const char* x) +{ + return gh_symbol2scm (x); +} diff --git a/lily/line-group-group-engraver.cc b/lily/line-group-group-engraver.cc index 14f55b6742..a324aef2d8 100644 --- a/lily/line-group-group-engraver.cc +++ b/lily/line-group-group-engraver.cc @@ -35,7 +35,7 @@ Line_group_engraver_group::finalize () { Engraver_group_engraver::finalize (); Grob * it - = unsmob_grob (get_property (ly_symbol2scm ("currentCommandColumn"))); + = unsmob_grob (get_property ("currentCommandColumn")); staffline_p_->set_bound (RIGHT,it); Engraver_group_engraver::typeset_grob (staffline_p_); @@ -47,7 +47,7 @@ Line_group_engraver_group::initialize () { create_line_spanner (); Grob * it - = unsmob_grob (get_property (ly_symbol2scm ("currentCommandColumn"))); + = unsmob_grob (get_property ("currentCommandColumn")); staffline_p_->set_bound (LEFT,it); Engraver::announce_grob (staffline_p_,0); diff --git a/lily/music.cc b/lily/music.cc index d3f5cdb4a8..178a602aa7 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -142,14 +142,7 @@ IMPLEMENT_DEFAULT_EQUAL_P (Music); /****************************/ SCM -Music::get_mus_property (const char *nm) const -{ - SCM sym = ly_symbol2scm (nm); - return get_mus_property (sym); -} - -SCM -Music::get_mus_property (SCM sym) const +Music::internal_get_mus_property (SCM sym) const { SCM s = scm_sloppy_assq (sym, mutable_property_alist_); if (s != SCM_BOOL_F) @@ -159,6 +152,7 @@ Music::get_mus_property (SCM sym) const return (s == SCM_BOOL_F) ? SCM_EOL : ly_cdr (s); } +#if 0 /* Remove the value associated with KEY, and return it. The result is that a next call will yield SCM_EOL (and not the underlying @@ -173,18 +167,18 @@ Music::remove_mus_property (const char* key) return val; } -void -Music::set_mus_property (const char* k, SCM v) +SCM +Music::get_mus_property (const char *nm) const { - SCM s = ly_symbol2scm (k); - set_mus_property (s, v); + SCM sym = ly_symbol2scm (nm); + return get_mus_property (sym); } void -Music::set_immutable_mus_property (const char*k, SCM v) +Music::set_mus_property (const char* k, SCM v) { SCM s = ly_symbol2scm (k); - set_immutable_mus_property (s, v); + set_mus_property (s, v); } void @@ -193,8 +187,10 @@ Music::set_immutable_mus_property (SCM s, SCM v) immutable_property_alist_ = gh_cons (gh_cons (s,v), mutable_property_alist_); mutable_property_alist_ = scm_assq_remove_x (mutable_property_alist_, s); } +#endif + void -Music::set_mus_property (SCM s, SCM v) +Music::internal_set_mus_property (SCM s, SCM v) { mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, s, v); } @@ -232,7 +228,7 @@ ly_get_mus_property (SCM mus, SCM sym) if (sc) { - return sc->get_mus_property (sym); + return sc->internal_get_mus_property (sym); } else { @@ -258,7 +254,7 @@ ly_set_mus_property (SCM mus, SCM sym, SCM val) if (sc) { - sc->set_mus_property (sym, val); + sc->internal_set_mus_property (sym, val); } else { diff --git a/lily/note-head.cc b/lily/note-head.cc index bda7f38c2d..b58c23cf20 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -98,12 +98,14 @@ Note_head::brew_molecule (SCM smob) UGH: use grob-property. */ - Molecule out = Font_interface::get_default_font (me)->find_by_name (String ("noteheads-") + - ly_scm2string (scm_primitive_eval (scm_list_n (ly_symbol2scm ("find-notehead-symbol"), - me->get_grob_property ("duration-log"), - ly_quote_scm (style), - SCM_UNDEFINED)))); + SCM log = me->get_grob_property ("duration-log"); + SCM exp = scm_list_n (ly_symbol2scm ("find-notehead-symbol"), log, + ly_quote_scm (style), + SCM_UNDEFINED); + String name = "noteheads-" + ly_scm2string (scm_primitive_eval (exp)); + Molecule out = Font_interface::get_default_font (me)->find_by_name (name); + if (streepjes_i) { Direction dir = (Direction)sign (p); diff --git a/lily/output-property-engraver.cc b/lily/output-property-engraver.cc index 527b0c103a..e852d666fa 100644 --- a/lily/output-property-engraver.cc +++ b/lily/output-property-engraver.cc @@ -65,7 +65,7 @@ Output_property_engraver::acknowledge_grob (Grob_info inf) { SCM sym = o->get_mus_property ("grob-property"); SCM val = o->get_mus_property ("grob-value"); - inf.grob_l_->set_grob_property (sym, val); + inf.grob_l_->internal_set_grob_property (sym, val); } } } diff --git a/lily/parser.yy b/lily/parser.yy index 27e3e1cdec..f5425dc2ef 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -101,7 +101,7 @@ set_music_properties (Music *p, SCM a) { for (SCM k = a; gh_pair_p (k); k = ly_cdr (k)) { - p->set_mus_property (ly_caar (k), ly_cdar (k)); + p->internal_set_mus_property (ly_caar (k), ly_cdar (k)); } } diff --git a/lily/part-combine-music-iterator.cc b/lily/part-combine-music-iterator.cc index bd18cb347b..16098a4cbe 100644 --- a/lily/part-combine-music-iterator.cc +++ b/lily/part-combine-music-iterator.cc @@ -148,7 +148,7 @@ Part_combine_music_iterator::get_state (Moment) Translator_group *first_translator = first_iter_p_->report_to_l ()->find_create_translator_l (w, "one" + suffix_); - SCM s = first_translator->get_property (ly_symbol2scm ("changeMoment")); + SCM s = first_translator->get_property ("changeMoment"); if (!gh_pair_p (s)) return state; @@ -277,7 +277,7 @@ Part_combine_music_iterator::get_state (Moment) if (gh_number_p (interval)) { - SCM s = first_translator->get_property (ly_symbol2scm ("splitInterval")); + SCM s = first_translator->get_property ("splitInterval"); int i = gh_scm2int (interval); if (gh_pair_p (s) && gh_number_p (ly_car (s)) diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc index 775da363b4..25ca3af774 100644 --- a/lily/property-engraver.cc +++ b/lily/property-engraver.cc @@ -58,7 +58,7 @@ Property_engraver::initialize () { prop_dict_ = new Scheme_hash_table; - SCM plist = get_property (ly_symbol2scm ("Generic_property_list")); + SCM plist = get_property ("Generic_property_list"); for (; gh_pair_p (plist); plist = ly_cdr (plist)) { SCM elt_props = ly_car (plist); @@ -106,14 +106,14 @@ Property_engraver::apply_properties (SCM p, Grob *e, Translator_group*origin) if (preset != SCM_BOOL_F) continue; - SCM val = get_property (prop_sym); + SCM val = internal_get_property (prop_sym); if (val == SCM_EOL) ; // Not defined in context. else if (gh_apply (type_p, scm_list_n (val, SCM_UNDEFINED)) == SCM_BOOL_T) // defined and right type: do it { - e->set_grob_property (elt_prop_sym, val); + e->internal_set_grob_property (elt_prop_sym, val); SCM meta = e->get_grob_property ("meta"); SCM name = scm_assoc (ly_symbol2scm ("name"), meta); diff --git a/lily/property-iterator.cc b/lily/property-iterator.cc index cea57f3dc3..9589804ecf 100644 --- a/lily/property-iterator.cc +++ b/lily/property-iterator.cc @@ -26,7 +26,7 @@ Property_iterator::process (Moment m) if (val != SCM_EOL) ok = type_check_assignment (val, sym, ly_symbol2scm ("translation-type?")); if (ok) - report_to_l ()->set_property (sym, val); + report_to_l ()->internal_set_property (sym, val); } Simple_music_iterator::process (m); } diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 814bd4d448..9189ee71eb 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -40,8 +40,8 @@ Score_engraver::make_columns () if (!command_column_l_) // || *unsmob_moment (command_column_l_->get_grob_property ("when")) != w) { - set_columns (new Paper_column (get_property (ly_symbol2scm ("NonMusicalPaperColumn"))), - new Paper_column (get_property (ly_symbol2scm ("PaperColumn")))); + set_columns (new Paper_column (get_property ("NonMusicalPaperColumn")), + new Paper_column (get_property ("PaperColumn"))); command_column_l_->set_grob_property ("breakable", SCM_BOOL_T); @@ -87,7 +87,7 @@ Score_engraver::initialize () pscore_p_ = new Paper_score; pscore_p_->paper_l_ = dynamic_cast (output_def_l_); - SCM props = get_property (ly_symbol2scm ("LineOfScore")); + SCM props = get_property ("LineOfScore"); pscore_p_->typeset_line (new Line_of_score (props)); @@ -106,7 +106,7 @@ Score_engraver::finalize () Engraver_group_engraver::finalize (); Grob * cc - = unsmob_grob (get_property (ly_symbol2scm ("currentCommandColumn"))); + = unsmob_grob (get_property ("currentCommandColumn")); scoreline_l_->set_bound (RIGHT, cc); cc->set_grob_property ("breakable", SCM_BOOL_T); @@ -116,7 +116,7 @@ Score_engraver::finalize () void Score_engraver::one_time_step () { - if (!to_boolean (get_property (ly_symbol2scm("skipTypesetting")))) + if (!to_boolean (get_property ("skipTypesetting"))) { process_music (); announces (); diff --git a/lily/span-bar-engraver.cc b/lily/span-bar-engraver.cc index 66b317e5b1..43fc872e2f 100644 --- a/lily/span-bar-engraver.cc +++ b/lily/span-bar-engraver.cc @@ -73,9 +73,9 @@ Span_bar_engraver::stop_translation_timestep () Span_bar::add_bar (spanbar_p_,bar_l_arr_[i]); SCM vissym =ly_symbol2scm ("visibility-lambda"); - SCM vis = bar_l_arr_[0]->get_grob_property (vissym); - if (scm_equal_p (spanbar_p_->get_grob_property (vissym), vis) != SCM_BOOL_T) - spanbar_p_->set_grob_property (vissym, vis); + SCM vis = bar_l_arr_[0]->internal_get_grob_property (vissym); + if (scm_equal_p (spanbar_p_->internal_get_grob_property (vissym), vis) != SCM_BOOL_T) + spanbar_p_->internal_set_grob_property (vissym, vis); typeset_grob (spanbar_p_); spanbar_p_ =0; diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 1700d181fc..0e5d6e2f7b 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -63,7 +63,7 @@ Span_bar::brew_molecule (SCM smobbed_me) } Span_bar::evaluate_glyph(me); - SCM glyph = me->get_grob_property (ly_symbol2scm ("glyph")); + SCM glyph = me->get_grob_property ("glyph"); /* glyph may not be a string, when ME is killed by Hara Kiri in @@ -182,7 +182,7 @@ Span_bar::evaluate_glyph (Grob*me) while (gh_pair_p (elts)) { - gl = unsmob_grob (gh_car (elts))->get_grob_property (glyph_symbol); + gl = unsmob_grob (gh_car (elts))->internal_get_grob_property (glyph_symbol); if (gh_string_p (gl)) break; elts =gh_cdr (elts); @@ -209,8 +209,8 @@ Span_bar::evaluate_glyph (Grob*me) } gl = ly_str02scm (type.ch_C ()); - if (scm_equal_p (me->get_grob_property (glyph_symbol), gl) != SCM_BOOL_T) - me->set_grob_property (glyph_symbol, gl); + if (scm_equal_p (me->internal_get_grob_property (glyph_symbol), gl) != SCM_BOOL_T) + me->internal_set_grob_property (glyph_symbol, gl); } Interval diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 24418337d1..a0ff443430 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -126,10 +126,10 @@ String Staff_performer::new_instrument_str () { // mustn't ask Score for instrument: it will return piano! - SCM minstr = get_property (ly_symbol2scm ("midiInstrument")); + SCM minstr = get_property ("midiInstrument"); if (!gh_string_p (minstr)) - minstr = get_property (ly_symbol2scm ("instrument")); + minstr = get_property ("instrument"); if (!gh_string_p (minstr) || ly_scm2string (minstr) == instrument_str_) diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index 969f3a07e2..5f7828b127 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -72,7 +72,7 @@ void System_start_delimiter_engraver::initialize () { SCM delim_name =get_property ("SystemStartDelimiter"); - delim_ = new Spanner (get_property (delim_name)); + delim_ = new Spanner (internal_get_property (delim_name)); delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn"))); diff --git a/lily/translator-def.cc b/lily/translator-def.cc index 200e0513cc..9c8ffb0d3a 100644 --- a/lily/translator-def.cc +++ b/lily/translator-def.cc @@ -277,7 +277,7 @@ Translator_def::apply_property_operations (Translator_group*tg) } else if (type == assign_sym) { - tg->set_property (ly_car (entry), ly_cadr (entry)); + tg->internal_set_property (ly_car (entry), ly_cadr (entry)); } } } diff --git a/lily/translator-group.cc b/lily/translator-group.cc index bb7f8cb187..aac575c38b 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -277,27 +277,21 @@ Translator_group::where_defined (SCM sym) const return SCM_EOL when not found. */ SCM -Translator_group::get_property (SCM sym) const +Translator_group::internal_get_property (SCM sym) const { SCM val =SCM_EOL; if (properties_dict ()->try_retrieve (sym, &val)) return val; if (daddy_trans_l_) - return daddy_trans_l_->get_property (sym); + return daddy_trans_l_->internal_get_property (sym); return val; } -void -Translator_group::set_property (String id, SCM val) -{ - set_property (ly_symbol2scm (id.ch_C ()), val); -} - void -Translator_group::set_property (SCM sym, SCM val) +Translator_group::internal_set_property (SCM sym, SCM val) { properties_dict ()->set (sym, val); } @@ -323,18 +317,16 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va { if (val != SCM_UNDEFINED) { - SCM prev = get_property (prop); + SCM prev = internal_get_property (prop); if (gh_pair_p (prev) || prev == SCM_EOL) { bool ok = type_check_assignment (val, eltprop, ly_symbol2scm ("backend-type?")); - - if (ok) { prev = gh_cons (gh_cons (eltprop, val), prev); - set_property (prop, prev); + internal_set_property (prop, prev); } } else @@ -345,7 +337,7 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va } else { - SCM prev = get_property (prop); + SCM prev = internal_get_property (prop); SCM newprops= SCM_EOL ; while (gh_pair_p (prev) && ly_caar (prev) != eltprop) @@ -357,7 +349,7 @@ Translator_group::execute_single_pushpop_property (SCM prop, SCM eltprop, SCM va if (gh_pair_p (prev)) { newprops = scm_reverse_x (newprops, ly_cdr (prev)); - set_property (prop, newprops); + internal_set_property (prop, newprops); } } } @@ -448,7 +440,7 @@ ly_get_trans_property (SCM context, SCM name) warning (_ ("ly-get-trans-property: expecting a Translator_group argument")); return SCM_EOL; } - return tr->get_property (name); + return tr->internal_get_property (name); } SCM @@ -459,7 +451,7 @@ ly_set_trans_property (SCM context, SCM name, SCM val) Translator_group* tr= dynamic_cast (t); if (tr) { - tr->set_property (name, val); + tr->internal_set_property (name, val); } return SCM_UNSPECIFIED; } diff --git a/lily/translator.cc b/lily/translator.cc index ef5f4b100a..ddac9aae3c 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -97,17 +97,18 @@ Translator::output_def_l () const { return output_def_l_; } - +#if 0 SCM Translator::get_property (char const * id) const { return daddy_trans_l_->get_property (ly_symbol2scm (id)); } +#endif SCM -Translator::get_property (SCM sym) const +Translator::internal_get_property (SCM sym) const { - return daddy_trans_l_->get_property (sym); + return daddy_trans_l_->internal_get_property (sym); } void diff --git a/lily/unfolded-repeat-iterator.cc b/lily/unfolded-repeat-iterator.cc index 315149a478..7dd93bd1dc 100644 --- a/lily/unfolded-repeat-iterator.cc +++ b/lily/unfolded-repeat-iterator.cc @@ -296,7 +296,7 @@ Unfolded_repeat_iterator::add_repeat_command (SCM what) && current_reps == SCM_EOL || gh_pair_p (current_reps)) { current_reps = gh_cons (what, current_reps); - where->set_property (reps, current_reps); + where->internal_set_property (reps, current_reps); } } -- 2.39.5