]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob.cc
2003 -> 2004
[lilypond.git] / lily / grob.cc
index 86c7d499d69c1c5d257307e2ad672465adbf4e47..ff54ff54760f83829c5c41d450e641cf034bacf0 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
@@ -125,7 +125,6 @@ Grob::Grob (Grob const&s)
   self_scm_ = SCM_EOL;
 
   immutable_property_alist_ = s.immutable_property_alist_;
-
   mutable_property_alist_ = SCM_EOL;
   
   /*
@@ -133,7 +132,7 @@ Grob::Grob (Grob const&s)
    */
   
   status_ = s.status_;
-  pscore_ = s.pscore_;
+  pscore_ = 0;
 
   smobify_self ();
 
@@ -150,9 +149,6 @@ Grob::~Grob ()
 }
 
 
-
-
-
 MAKE_SCHEME_CALLBACK (Grob,molecule_extent,2);
 SCM
 Grob::molecule_extent (SCM element_smob, SCM scm_axis)
@@ -177,15 +173,11 @@ Grob::preset_extent (SCM element_smob, SCM scm_axis)
   SCM ext = s->get_grob_property ((a == X_AXIS)
                                 ? "X-extent"
                                 : "Y-extent");
-  
-  if (gh_pair_p (ext))
-    {
-      Real l = gh_scm2double (ly_car (ext));
-      Real r = gh_scm2double (ly_cdr (ext));
-      return ly_interval2scm (Interval (l, r));
-    }
-  
-  return ly_interval2scm (Interval ());
+
+  if (is_number_pair (ext))
+    return ext;
+  else
+    return ly_interval2scm (Interval());
 }
 
 
@@ -231,14 +223,13 @@ Grob::get_molecule ()  const
   if (!live())
     {
       return 0;
-      
     }
   
   SCM mol = get_grob_property ("molecule");
   if (unsmob_molecule (mol))
     return unsmob_molecule (mol);
 
-  mol =  get_uncached_molecule ();
+  mol = get_uncached_molecule ();
   
   if (live ())
     {
@@ -330,12 +321,16 @@ Grob::handle_broken_dependencies ()
 
   if (sp)
     {
+      /*
+       This is the original spanner. We use a special function
+       because some Spanners have enormously long lists in their
+       properties.
+       */
       for (SCM s = mutable_property_alist_; gh_pair_p(s);
           s = gh_cdr(s))
        {
          sp->substitute_one_mutable_property (gh_caar (s),
                                              gh_cdar (s));
-         
        }
     }
 
@@ -501,7 +496,7 @@ Grob::point_dimension_callback (SCM , SCM)
 }
 
 bool
-Grob::empty_b (Axis a)const
+Grob::is_empty (Axis a)const
 {
   return ! (gh_pair_p (dim_cache_[a].dimension_) ||
            gh_procedure_p (dim_cache_[a].dimension_));
@@ -855,7 +850,7 @@ ADD_INTERFACE (Grob, "grob-interface",
   "X-offset-callbacks Y-offset-callbacks X-extent-callback molecule cause "
 "Y-extent-callback molecule-callback extra-offset spacing-procedure "
 "staff-symbol interfaces dependencies X-extent Y-extent extra-X-extent "
-"causes meta layer before-line-breaking-callback "
+"meta layer before-line-breaking-callback "
 "after-line-breaking-callback extra-Y-extent minimum-X-extent "
 "minimum-Y-extent transparent");