]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Jul 2002 13:34:13 +0000 (13:34 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 10 Jul 2002 13:34:13 +0000 (13:34 +0000)
lily/include/paper-column.hh
lily/paper-column.cc
lily/system.cc
scm/grob-description.scm

index fbf69636ec490eed11aa919e480e9ef00ad9d5a3..f2c94744edbb22a5807bb8a348e10f02d9a479cd 100644 (file)
@@ -24,13 +24,14 @@ public:
   virtual void do_break_processing ();
   virtual Paper_column *column_l () const;
   virtual System *line_l () const;
-
+  
   /// if lines are broken then this column is in #line#
   System *line_l_;
 
   static int rank_i (Grob*);
 
   DECLARE_SCHEME_CALLBACK(brew_molecule, (SCM));
+  DECLARE_SCHEME_CALLBACK(before_line_breaking, (SCM));
   
   Paper_column (SCM);
   static bool musical_b (Grob *);
index e68395807dff33e84c7d4e496ef4bb5cbdce0aa6..2abeff483e683329ddb28305cf91a94375c30869 100644 (file)
@@ -48,6 +48,7 @@ Paper_column::do_break_processing ()
   Item::do_break_processing ();
 }
 
+
 int
 Paper_column::rank_i (Grob*me) 
 {
@@ -132,3 +133,37 @@ Paper_column::brew_molecule (SCM p)
   return t.smobbed_copy ();                                            
 }
 
+/*
+  This is all too hairy. We use bounded-by-me to make sure that some
+  columns are kept "alive". Unfortunately, when spanners are suicided,
+  this falls apart again. (sigh.)
+
+  THIS IS BROKEN KLUDGE. WE SHOULD INVENT SOMETHING BETTER. 
+ */
+MAKE_SCHEME_CALLBACK(Paper_column,before_line_breaking,1);
+SCM
+Paper_column::before_line_breaking (SCM grob)
+{
+  Grob *me = unsmob_grob (grob);
+
+  SCM c = me->get_grob_property ("bounded-by-me");
+  SCM *ptrptr = &c;
+
+  while (gh_pair_p (c))
+    {
+      Grob * g = unsmob_grob (gh_car (c));
+
+      if (!g || !g->live ())
+       {
+         *ptrptr = gh_cdr (c);
+       }
+      else
+       {
+         ptrptr = SCM_CDRLOC (c);
+       }
+      
+      c = gh_cdr (c);
+    }
+
+  me->set_grob_property ("bounded-by-me", c);
+}
index f9fe1f4edd8e316e1433b528e0f8d3f268c6652f..af5fecc44e3c091070dc6d81b0a1766f4766ff00 100644 (file)
@@ -73,7 +73,7 @@ System::output_lines ()
            }
          g->suicide ();
        }
-      else
+      else if (g->live ())
        g->do_break_processing ();
     }
 
index 7c5cb8dfdfc71e38adb5c8d366e680bff1b084ad..13276d505fa9545324d003922203774374cee816 100644 (file)
     (PaperColumn
      . (
        (axes . (0))
+       (before-line-breaking-callback . ,Paper_column::before_line_breaking)
        (X-extent-callback . ,Axis_group_interface::group_extent_callback)
 
 ;              (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") (Y-extent-callback . #f)
      . (
        (axes . (0))
        (X-extent-callback . ,Axis_group_interface::group_extent_callback)
-
+       (before-line-breaking-callback . ,Paper_column::before_line_breaking)
        ;; debugging stuff: print column number.
 ;      (molecule-callback . ,Paper_column::brew_molecule) (font-name . "cmr8") (Y-extent-callback . #f)