From 153b2ceb058ce15e5fe3999cbd4b427726d3a430 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:57:59 +0000 Subject: [PATCH] lilypond-0.1.15 --- lily/abbreviation-beam.cc | 2 +- lily/bar.cc | 2 +- lily/beam.cc | 5 ++-- lily/bow.cc | 6 ++--- lily/clef-item.cc | 2 +- lily/dots.cc | 2 +- lily/general-script-def.cc | 4 +-- lily/include/crescendo.hh | 2 +- lily/include/lily-proto.hh | 2 +- lily/include/span-bar.hh | 2 +- lily/include/span-score-bar.hh | 2 +- lily/include/symbol.hh | 47 +--------------------------------- lily/include/symtable.hh | 15 ++++++++--- lily/key-item.cc | 31 +++++++++++----------- lily/meter.cc | 2 +- lily/molecule.cc | 2 +- lily/rest.cc | 2 +- lily/scoreline.cc | 2 +- lily/script-def.cc | 2 +- lily/span-score-bar.cc | 4 +-- lily/stem-info.cc | 2 +- lily/symtable.cc | 8 +++--- lily/template3.cc | 2 +- lily/tex.cc | 2 +- lily/text-spanner.cc | 2 +- 25 files changed, 56 insertions(+), 98 deletions(-) diff --git a/lily/abbreviation-beam.cc b/lily/abbreviation-beam.cc index e47407cdc7..309337dffb 100644 --- a/lily/abbreviation-beam.cc +++ b/lily/abbreviation-beam.cc @@ -14,7 +14,7 @@ #include "abbreviation-beam.hh" #include "misc.hh" #include "debug.hh" -#include "symbol.hh" +#include "atom.hh" #include "molecule.hh" #include "leastsquares.hh" #include "stem.hh" diff --git a/lily/bar.cc b/lily/bar.cc index 43811f88c6..05a8557148 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -34,7 +34,7 @@ Molecule* Bar::brew_molecule_p() const { Paper_def *p = paper(); - Symbol s = p->lookup_l()->bar (type_str_, + Atom s = p->lookup_l()->bar (type_str_, p->get_var ("bar_size")); Molecule*output = new Molecule (Atom (s)); return output; diff --git a/lily/beam.cc b/lily/beam.cc index 27825954b6..d2b5e1e3c6 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -21,7 +21,7 @@ #include "abbreviation-beam.hh" #include "misc.hh" #include "debug.hh" -#include "symbol.hh" +#include "atom.hh" #include "molecule.hh" #include "leastsquares.hh" #include "stem.hh" @@ -304,8 +304,7 @@ Beam::stem_beams (Stem *here, Stem *next, Stem *prev) const int lhalfs= lhalfs = here->beams_left_i_ - prev->beams_right_i_ ; int lwholebeams= here->beams_left_i_ beams_right_i_ ; Real w = (here->hpos_f () - prev->hpos_f ())/4; - Symbol dummy; - Atom a (dummy); + Atom a; if (lhalfs) // generates warnings if not a = paper()->lookup_l ()->beam (sl, w); a.translate (Offset (-w, -w * sl)); diff --git a/lily/bow.cc b/lily/bow.cc index 1bd0a00762..34b7eb7794 100644 --- a/lily/bow.cc +++ b/lily/bow.cc @@ -44,12 +44,10 @@ Bow::brew_molecule_p() const w+= (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]) * nw_f ; Real round_w = w; // slur lookup rounds the slurwidth . - Symbol sl = paper()->lookup_l ()->slur (dy , round_w, dir_); + Atom a = paper()->lookup_l ()->slur (dy , round_w, dir_); Real error = w-round_w; - - Atom a (sl); - a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2, + a.translate (Offset ((dx_f_drul_[LEFT] + 0.5)*nw_f + error/2, pos_i_drul_[LEFT] * nh_f)); output->add (a); return output; diff --git a/lily/clef-item.cc b/lily/clef-item.cc index 920d2c5512..a0ca99bcc5 100644 --- a/lily/clef-item.cc +++ b/lily/clef-item.cc @@ -59,7 +59,7 @@ Clef_item::brew_molecule_p() const String t = type_; if (change_b_) t += "_change"; - Symbol s = paper()->lookup_l ()->clef (t); + Atom s = paper()->lookup_l ()->clef (t); Molecule*output = new Molecule (Atom (s)); output->translate (paper()->internote_f () * y_off, Y_AXIS); return output; diff --git a/lily/dots.cc b/lily/dots.cc index 0525aa1dda..946b74b195 100644 --- a/lily/dots.cc +++ b/lily/dots.cc @@ -27,7 +27,7 @@ Dots::do_post_processing () Molecule* Dots::brew_molecule_p () const { - Symbol d = paper ()->lookup_l ()->dots (no_dots_i_); + Atom d = paper ()->lookup_l ()->dots (no_dots_i_); Molecule *out = new Molecule (Atom (d)); Real inter_f = paper ()->internote_f (); out->translate (inter_f * position_i_, Y_AXIS); diff --git a/lily/general-script-def.cc b/lily/general-script-def.cc index 70c2b740af..2a014cc542 100644 --- a/lily/general-script-def.cc +++ b/lily/general-script-def.cc @@ -9,7 +9,7 @@ #include "general-script-def.hh" #include "debug.hh" -#include "symbol.hh" +#include "atom.hh" Direction General_script_def::staff_dir() const { @@ -65,7 +65,7 @@ General_script_def::do_print() const Atom General_script_def::get_atom (Paper_def*, Direction) const { - Symbol s; + Atom s; return Atom (s); } diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh index 99e0e287cc..6c8a9df805 100644 --- a/lily/include/crescendo.hh +++ b/lily/include/crescendo.hh @@ -30,7 +30,7 @@ protected: DECLARE_MY_RUNTIME_TYPEINFO; private: - Symbol get_symbol() const; + Atom get_symbol() const; }; #endif // CRESCENDO_HH diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 7c735faa27..d8b5b3bddc 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -199,7 +199,7 @@ struct Stem_beam_engraver; struct Stem_req; struct String; struct Subtle_req; -struct Symbol; +struct Atom; struct Symtable; struct Symtables; struct Super_elem; diff --git a/lily/include/span-bar.hh b/lily/include/span-bar.hh index d49974c902..136564678f 100644 --- a/lily/include/span-bar.hh +++ b/lily/include/span-bar.hh @@ -29,7 +29,7 @@ protected: virtual void do_substitute_dependency (Score_elem*,Score_elem*); virtual Molecule * brew_molecule_p() const; - virtual Symbol get_bar_sym (Real dy) const; + virtual Atom get_bar_sym (Real dy) const; }; #endif // SPAN_BAR_HH diff --git a/lily/include/span-score-bar.hh b/lily/include/span-score-bar.hh index 5b25faa3ca..0639825180 100644 --- a/lily/include/span-score-bar.hh +++ b/lily/include/span-score-bar.hh @@ -32,7 +32,7 @@ public: SCORE_ELEM_CLONE(Piano_brace); protected: virtual Interval do_width() const; - virtual Symbol get_bar_sym (Real) const; + virtual Atom get_bar_sym (Real) const; }; #endif // SPAN_SCORE_BAR_HH diff --git a/lily/include/symbol.hh b/lily/include/symbol.hh index 09f7e14e4a..65296f8106 100644 --- a/lily/include/symbol.hh +++ b/lily/include/symbol.hh @@ -1,47 +1,2 @@ -/* - symbol.hh -- declare Symbol, Atom - source file of the GNU LilyPond music typesetter - - (c) 1997 Han-Wen Nienhuys -*/ - -#ifndef SYMBOL_HH -#define SYMBOL_HH - -#include "string.hh" -#include "boxes.hh" -#include "lily-proto.hh" - -struct Symbol { - String tex; - Box dim; - - Symbol (String, Box); - Symbol(); - String str() const; // for printing. -}; - - -/// a symbol which can be translated, and freely copied -struct Atom { - Offset off_; - Symbol sym_; - - /* *************** */ - - void translate (Offset o) { - off_ += o; - } - void translate (Real r,Axis a){ - off_[a] += r; - } - /// how big is #this#? - Box extent() const; - Atom (Symbol s); - - void print() const; - - String TeX_string() const; -}; -#endif +#error diff --git a/lily/include/symtable.hh b/lily/include/symtable.hh index 1c37f7c565..8c36ee6cbf 100644 --- a/lily/include/symtable.hh +++ b/lily/include/symtable.hh @@ -1,16 +1,23 @@ /* - lilypond, (c) 1996,97 Han-Wen Nienhuys + symtable.hh -- declare + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys */ + + #ifndef SYMTABLE_HH #define SYMTABLE_HH + #include "dictionary.hh" #include "string.hh" -#include "symbol.hh" +#include "atom.hh" -struct Symtable : public Dictionary { +struct Symtable : public Dictionary { String id_str; - Symbol lookup (String) const; + Atom lookup (String) const; void print() const; }; diff --git a/lily/key-item.cc b/lily/key-item.cc index f3b57d20a1..4dd094b667 100644 --- a/lily/key-item.cc +++ b/lily/key-item.cc @@ -34,10 +34,10 @@ Key_item::read (Key_engraver const & key_grav_r) const Array &idx_arr =key_grav_r.accidental_idx_arr_; for (int i = 0 ; i< idx_arr.size(); i++) { - int note = idx_arr[i]; - int acc = ((Key &) key_grav_r.key_).oct (0).acc (note); + int note = idx_arr[i]; + int acc = ((Key &) key_grav_r.key_).oct (0).acc (note); - add (note, acc); + add (note, acc); } } @@ -54,8 +54,8 @@ Key_item::add (int p, int a) { if ((a<0 && p>FLAT_TOP_PITCH) || (a>0 && p>SHARP_TOP_PITCH)) - { - p -= 7; /* Typeset below c_position */ + { + p -= 7; /* Typeset below c_position */ } pitch.push (p); acc.push (a); @@ -70,19 +70,18 @@ Key_item::brew_molecule_p() const for (int i =0; i < pitch.size(); i++) { - Symbol s= paper()->lookup_l ()->accidental (acc[i]); - Atom a (s); - a.translate ((c_position + pitch[i]) * inter, Y_AXIS); - Molecule m (a); - output->add_at_edge (X_AXIS, RIGHT, m); + Atom a =paper()->lookup_l ()->accidental (acc[i]); + a.translate ((c_position + pitch[i]) * inter, Y_AXIS); + Molecule m (a); + output->add_at_edge (X_AXIS, RIGHT, m); } if (pitch.size()) { - Molecule m (paper()->lookup_l ()->fill (Box ( - Interval (0, paper()->note_width ()), - Interval (0,0)))); + Molecule m (paper()->lookup_l ()->fill (Box ( + Interval (0, paper()->note_width ()), + Interval (0,0)))); - output->add_at_edge (X_AXIS, RIGHT, m); + output->add_at_edge (X_AXIS, RIGHT, m); } return output; } @@ -94,7 +93,7 @@ Key_item::do_pre_processing() { if (default_b_) { - transparent_b_ = (break_status_i() != 1); - set_empty (transparent_b_); + transparent_b_ = (break_status_i() != 1); + set_empty (transparent_b_); } } diff --git a/lily/meter.cc b/lily/meter.cc index aa41b7922b..0c4d4e0ad1 100644 --- a/lily/meter.cc +++ b/lily/meter.cc @@ -13,7 +13,7 @@ Meter::Meter (Arraya) Molecule* Meter::brew_molecule_p() const { - Symbol s = paper()->lookup_l ()->meter (args); + Atom s = paper()->lookup_l ()->meter (args); return new Molecule (Atom (s)); } diff --git a/lily/molecule.cc b/lily/molecule.cc index e37f9e7c33..4dfe7d6c13 100644 --- a/lily/molecule.cc +++ b/lily/molecule.cc @@ -10,7 +10,7 @@ #include "dimen.hh" #include "string.hh" #include "molecule.hh" -#include "symbol.hh" +#include "atom.hh" #include "debug.hh" #include "tex.hh" diff --git a/lily/rest.cc b/lily/rest.cc index d2ccd2a01b..0a7dc7419a 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -37,7 +37,7 @@ Rest::brew_molecule_p () const int staff_size_i_ =8; bool streepjes_b = (position_i_<-1) || (position_i_ > staff_size_i_+1); - Symbol s(paper ()->lookup_l()->rest (balltype_i_, streepjes_b)); + Atom s(paper ()->lookup_l()->rest (balltype_i_, streepjes_b)); Molecule * m = new Molecule ( Atom (s)); m->translate (position_i_ * paper ()->internote_f (), Y_AXIS); return m; diff --git a/lily/scoreline.cc b/lily/scoreline.cc index 2bd4f870b4..f65690cafb 100644 --- a/lily/scoreline.cc +++ b/lily/scoreline.cc @@ -9,7 +9,7 @@ #include "scoreline.hh" #include "dimen.hh" #include "spanner.hh" -#include "symbol.hh" +#include "atom.hh" #include "paper-def.hh" #include "p-col.hh" #include "p-score.hh" diff --git a/lily/script-def.cc b/lily/script-def.cc index 6ece2874f5..fa067cd3cc 100644 --- a/lily/script-def.cc +++ b/lily/script-def.cc @@ -8,7 +8,7 @@ #include "debug.hh" #include "script-def.hh" -#include "symbol.hh" +#include "atom.hh" #include "paper-def.hh" #include "lookup.hh" diff --git a/lily/span-score-bar.cc b/lily/span-score-bar.cc index 97b195ef1e..5ad94b760d 100644 --- a/lily/span-score-bar.cc +++ b/lily/span-score-bar.cc @@ -7,7 +7,7 @@ */ #include "span-score-bar.hh" -#include "symbol.hh" +#include "atom.hh" #include "paper-def.hh" #include "lookup.hh" @@ -29,7 +29,7 @@ Span_score_bar::do_pre_processing() } -Symbol +Atom Piano_brace::get_bar_sym (Real dy) const { return paper()->lookup_l ()->vbrace (dy); diff --git a/lily/stem-info.cc b/lily/stem-info.cc index a3287ce55c..89cd395c0b 100644 --- a/lily/stem-info.cc +++ b/lily/stem-info.cc @@ -11,7 +11,7 @@ #include "dimen.hh" #include "misc.hh" #include "debug.hh" -#include "symbol.hh" +#include "atom.hh" #include "stem.hh" #include "paper-def.hh" #include "lookup.hh" diff --git a/lily/symtable.cc b/lily/symtable.cc index 2bb6f53fa9..9098e18ad4 100644 --- a/lily/symtable.cc +++ b/lily/symtable.cc @@ -10,7 +10,7 @@ #include "dimen.hh" #include "debug.hh" #include "real.hh" -#include "symbol.hh" +#include "atom.hh" #include "assoc.hh" #include "assoc-iter.hh" #include "symtable.hh" @@ -35,7 +35,7 @@ Symtables::~Symtables() } } -Symbol +Atom Symtable::lookup (String s) const { if (elt_b (s)) @@ -43,7 +43,7 @@ Symtable::lookup (String s) const else { warning ("Symtable `" + id_str+ "\': unknown symbol `" +s+"'\n"); - Symbol sy; + Atom sy; return sy; } } @@ -66,7 +66,7 @@ Symtables::print() const void Symtable::print() const { - for (Assoc_iter i (*this); i.ok(); i++) + for (Assoc_iter i (*this); i.ok(); i++) { DOUT << "\'" << i.key() << "\'->" << i.val ().str () << "\n"; } diff --git a/lily/template3.cc b/lily/template3.cc index d9ea0deba2..e1e1b4d5f2 100644 --- a/lily/template3.cc +++ b/lily/template3.cc @@ -6,7 +6,7 @@ (c) 1997 Han-Wen Nienhuys */ -#include "symbol.hh" +#include "atom.hh" #include "molecule.hh" #include "plist.tcc" #include "pcursor.tcc" diff --git a/lily/tex.cc b/lily/tex.cc index 6e7bb4732b..19285561c1 100644 --- a/lily/tex.cc +++ b/lily/tex.cc @@ -8,7 +8,7 @@ #include "dimen.hh" #include "tex.hh" -#include "symbol.hh" +#include "atom.hh" #include "varray.hh" String diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index edf430aa13..c23bb7e645 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -12,7 +12,7 @@ #include "text-def.hh" #include "debug.hh" #include "paper-def.hh" -#include "symbol.hh" +#include "atom.hh" void -- 2.39.5