]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.46.jcn1
authorfred <fred>
Sat, 8 Mar 1997 19:01:09 +0000 (19:01 +0000)
committerfred <fred>
Sat, 8 Mar 1997 19:01:09 +0000 (19:01 +0000)
flower/include/link.icc [new file with mode: 0644]
flower/include/list.icc [new file with mode: 0644]
lily/include/staff-sym.hh [new file with mode: 0644]

diff --git a/flower/include/link.icc b/flower/include/link.icc
new file mode 100644 (file)
index 0000000..3926d6b
--- /dev/null
@@ -0,0 +1,102 @@
+// link.inl -*-c++-*-
+#ifndef LINK_INL
+#define LINK_INL
+#include <assert.h>
+template<class T>
+inline
+void
+Link<T>::OK() const
+{
+#ifndef NDEBUG
+    if (previous_) {
+       assert(previous_->next_ == this);
+    }
+    if (next_) {
+       assert(next_->previous_ == this);
+    }
+#endif    
+}
+
+template<class T>
+inline
+Link<T>::Link( const T& thing ) : 
+    thing_( thing )
+{
+    previous_ = next_ = 0;
+}
+
+template<class T>
+inline
+Link<T>::Link( Link<T>* previous, Link<T>* next, const T& thing ) : 
+    thing_( thing )
+{
+    previous_ = previous;
+    next_ = next;
+}
+
+template<class T>
+inline
+Link<T>*
+Link<T>::next()
+{
+    return next_;
+}
+
+template<class T>
+inline
+Link<T>*
+Link<T>::previous()
+{
+    return previous_;
+}
+
+template<class T>
+inline
+void
+Link<T>::add( const T& thing )
+{
+    
+    Link<T>* l = new Link<T>( this, next_, thing );
+    if ( next_ )
+        next_->previous_ = l;
+    next_ = l;
+}
+
+template<class T>
+inline void
+Link<T>::insert( const T& thing )
+{
+    //    Link<T>* l = new Link<T>( next_, this, thing );
+                               // bugfix hwn 16/9/96
+    Link<T>* l = new Link<T>( previous_, this, thing );
+    if ( previous_ )
+        previous_->next_ = l;
+    previous_ = l;
+}
+
+/*
+    don't forget to adjust #l#'s top_ and bottom_.
+    */
+template<class T>
+inline void
+Link<T>::remove(List<T> &l)
+{
+    if ( previous_ ) 
+        previous_->next_ = next_;
+    else 
+       l.top_ = next_;
+
+    if ( next_ )
+        next_->previous_ = previous_;
+    else
+       l.bottom_ = previous_;
+}
+
+template<class T>
+inline
+T&
+Link<T>::thing()
+{
+    return thing_;
+}
+#endif
diff --git a/flower/include/list.icc b/flower/include/list.icc
new file mode 100644 (file)
index 0000000..df0687b
--- /dev/null
@@ -0,0 +1,56 @@
+// -*-c++-*-
+
+#ifndef LIST_INL
+#define LIST_INL
+
+template<class T>
+inline
+List<T>::List()
+{
+    set_empty();
+}
+
+template<class T>
+inline void
+List<T>::set_empty()
+{
+    top_ = bottom_ = 0;
+    size_ = 0;
+}
+
+template<class T>
+inline void
+List<T>::remove( Cursor<T> me )
+{
+    if ( me.ok() ){
+       Link<T> *lp = me.pointer();     
+       lp->remove(*this);
+       delete lp;
+        size_--;
+    }
+}
+
+template<class T>
+inline int
+List<T>::size() const
+{ 
+    return size_;
+}
+
+template<class T>
+inline Cursor<T>
+List<T>::top()const
+{
+    return Cursor<T>( *this, top_ );
+}
+
+
+template<class T>
+inline Cursor<T>
+List<T>::bottom()const
+{
+    return Cursor<T>( *this, bottom_ );
+}
+
+
+#endif
diff --git a/lily/include/staff-sym.hh b/lily/include/staff-sym.hh
new file mode 100644 (file)
index 0000000..bcec2bf
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+  staffsym.hh -- declare Staff_symbol
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#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