]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.11
authorfred <fred>
Sun, 24 Nov 1996 23:58:52 +0000 (23:58 +0000)
committerfred <fred>
Sun, 24 Nov 1996 23:58:52 +0000 (23:58 +0000)
src/pcol.cc

index 6e3092a0e334f145e20726dd97e4e4bf215b05d0..41cf4fdb67d43f4fb760f2a3d202b26575b496b2 100644 (file)
@@ -1,4 +1,5 @@
 #include "pcol.hh"
+#include "pscore.hh"
 #include "pstaff.hh"
 #include "debug.hh"
 
@@ -44,24 +45,32 @@ PCol::width() const
 void
 PCol::print() const
 {
-    #ifndef NPRINT
+#ifndef NPRINT
     mtor << "PCol {";
+    if (pscore_) {             // ugh
+       PCursor<PCol*> me=pscore_->find_col(this);
+       PCursor<PCol*> bot(pscore_->cols.top());
+       if (me.ok()) {
+           mtor << "rank: " << me - bot << '\n';
+       }
+    }
     mtor << "# symbols: " << its.size() ;
     if (breakable()){
-       mtor << "pre,post: ";
+       mtor << "\npre,post: ";
        prebreak->print();
        postbreak->print();
+    } else if (daddy) {
+       mtor<<'\n' << ((this == daddy->prebreak) ? "prebreak" : "postbreak");
     }
     mtor << "extent: " << width().min << ", " << width().max << "\n";
     mtor << "}\n";
-    #endif 
+#endif 
 }
 
 int
-PCol::compare(const PCol &, const PCol &)
+PCol::compare(const PCol &c1, const PCol &c2)
 {
-    assert(false);
-    return 0 ;
+    return c1.pscore_->compare_pcols(&c1,&c2);
 }
 
 void
@@ -71,8 +80,7 @@ PCol::OK () const
        assert(prebreak&&postbreak);
        assert(prebreak->daddy == this);
        assert(postbreak->daddy == this);
-    }
-    
+    }    
 }
 
 void
@@ -83,7 +91,10 @@ PCol::set_breakable()
 
     prebreak = new PCol(this);
     postbreak = new PCol(this);
-    used = true;
+    prebreak->pscore_ = pscore_;
+    postbreak->pscore_ = pscore_;
+    
 }
 
 bool
@@ -98,7 +109,8 @@ PCol::PCol(PCol *parent)
     prebreak=0;
     postbreak=0;
     line=0;
-    used  = false;
+    pscore_ = 0;
 }
 
 PCol::~PCol()
@@ -112,5 +124,11 @@ PCol::add( Item *i)
 {
     its.bottom().add(i);
     i->pcol_ = this;
-    used = true;
+}
+
+bool
+PCol::used()const
+{
+    return breakable() || its.size();
 }