From 9d95aa3a368c678aec4854b0360362760a54997f Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 8 Mar 1997 19:00:50 +0000 Subject: [PATCH] lilypond-0.0.46.jcn1 --- flower/include/link.icc | 102 ++++++++++++++++++++++++++++++++++++++++++++++ flower/include/list.icc | 56 +++++++++++++++++++++++++ lily/include/staff-sym.hh | 30 ++++++++++++++ 3 files changed, 188 insertions(+) create mode 100644 flower/include/link.icc create mode 100644 flower/include/list.icc create mode 100644 lily/include/staff-sym.hh diff --git a/flower/include/link.icc b/flower/include/link.icc new file mode 100644 index 0000000000..3926d6bc2a --- /dev/null +++ b/flower/include/link.icc @@ -0,0 +1,102 @@ +// link.inl -*-c++-*- +#ifndef LINK_INL +#define LINK_INL +#include +template +inline +void +Link::OK() const +{ +#ifndef NDEBUG + if (previous_) { + assert(previous_->next_ == this); + } + if (next_) { + assert(next_->previous_ == this); + } +#endif +} + +template +inline +Link::Link( const T& thing ) : + thing_( thing ) +{ + previous_ = next_ = 0; +} + +template +inline +Link::Link( Link* previous, Link* next, const T& thing ) : + thing_( thing ) +{ + previous_ = previous; + next_ = next; +} + +template +inline +Link* +Link::next() +{ + return next_; +} + +template +inline +Link* +Link::previous() +{ + return previous_; +} + +template +inline +void +Link::add( const T& thing ) +{ + + Link* l = new Link( this, next_, thing ); + if ( next_ ) + next_->previous_ = l; + next_ = l; +} + +template +inline void +Link::insert( const T& thing ) +{ + // Link* l = new Link( next_, this, thing ); + // bugfix hwn 16/9/96 + Link* l = new Link( previous_, this, thing ); + if ( previous_ ) + previous_->next_ = l; + previous_ = l; +} + +/* + don't forget to adjust #l#'s top_ and bottom_. + */ +template +inline void +Link::remove(List &l) +{ + if ( previous_ ) + previous_->next_ = next_; + else + l.top_ = next_; + + if ( next_ ) + next_->previous_ = previous_; + else + l.bottom_ = previous_; +} + +template +inline +T& +Link::thing() +{ + return thing_; +} +#endif diff --git a/flower/include/list.icc b/flower/include/list.icc new file mode 100644 index 0000000000..df0687b7c8 --- /dev/null +++ b/flower/include/list.icc @@ -0,0 +1,56 @@ +// -*-c++-*- + +#ifndef LIST_INL +#define LIST_INL + +template +inline +List::List() +{ + set_empty(); +} + +template +inline void +List::set_empty() +{ + top_ = bottom_ = 0; + size_ = 0; +} + +template +inline void +List::remove( Cursor me ) +{ + if ( me.ok() ){ + Link *lp = me.pointer(); + lp->remove(*this); + delete lp; + size_--; + } +} + +template +inline int +List::size() const +{ + return size_; +} + +template +inline Cursor +List::top()const +{ + return Cursor( *this, top_ ); +} + + +template +inline Cursor +List::bottom()const +{ + return Cursor( *this, bottom_ ); +} + + +#endif diff --git a/lily/include/staff-sym.hh b/lily/include/staff-sym.hh new file mode 100644 index 0000000000..bcec2bfaff --- /dev/null +++ b/lily/include/staff-sym.hh @@ -0,0 +1,30 @@ +/* + staffsym.hh -- declare Staff_symbol + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef STAFFSYM_HH +#define STAFFSYM_HH +#include "spanner.hh" +/** + This spanner draws the lines of a pstaff. + The bottom line is position 0. + */ +class Staff_symbol : public Spanner +{ +public: + /// this many lines. + int no_lines_i_; + + NAME_MEMBERS(Staff_symbol); + Staff_symbol(int lines); + virtual Molecule* brew_molecule_p() const; + void set_extent(PCol* p1, PCol* p2); + virtual void do_print()const; + virtual Spanner *do_break_at( PCol *c1, PCol *c2) const; +}; +#endif // STAFFSYM_HH -- 2.11.4.GIT