]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/grob.cc: remove is_empty()
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 21 Oct 2005 13:59:25 +0000 (13:59 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 21 Oct 2005 13:59:25 +0000 (13:59 +0000)
* lily/grob-property.cc: remove add_to_list_property().

* lily/grob.cc: remove X-extent-callback / Y-extent-callback.

* lily/include/grob.hh (class Grob): remove property_callbacks_
member. Properties of procedure type are assumed to be callbacks.

* lily/grob.cc: remove set_extent_callback(), set_extent() and
has_extent_callback()

* lily/grob.cc (flush_extent_cache): rewrite.

* lily/grob.cc (Grob): don't set extent from ctor.
(extent): use property callbacks.

* lily/grob-property.cc (del_property): new function.

lily/grob-property.cc
lily/grob.cc
lily/include/grob.hh

index 789b1e45b456636810c33cbadae84791b12b3e4a..ac452e36b220615be9f48500a294d6c341db0716 100644 (file)
@@ -32,36 +32,6 @@ Grob::get_interfaces () const
   return interfaces_;
 }
 
-/*
-  This special add_thing routine is slightly more efficient than
-
-  set_prop (name, cons (thing, get_prop (name)))
-
-  since it can reuse the handle returned by scm_assq ().
-*/
-// JUNKME.
-void
-Grob::add_to_list_property (SCM sym, SCM thing)
-{
-  SCM handle
-    = scm_sloppy_assq (sym, mutable_property_alist_);
-
-  if (handle != SCM_BOOL_F)
-    scm_set_cdr_x (handle, scm_cons (thing, scm_cdr (handle)));
-  else
-    {
-      /*
-       There is no mutable prop yet, so create an entry, and put it in front of the
-       mutable prop list.
-      */
-      handle = scm_sloppy_assq (sym, immutable_property_alist_);
-      SCM tail = (handle != SCM_BOOL_F) ? scm_cdr (handle) : SCM_EOL;
-      SCM val = scm_cons (thing, tail);
-
-      mutable_property_alist_ = scm_cons (scm_cons (sym, val),
-                                         mutable_property_alist_);
-    }
-}
 
 extern void check_interfaces_for_property (Grob const *me, SCM sym);
 
index 380ba92ded9d6fb8bfa639643cb6155cfd931352..9c2b19ca54017f1a048676297a9727c1e8a1d69b 100644 (file)
@@ -359,10 +359,13 @@ Grob::relative_coordinate (Grob const *refp, Axis a) const
 
   /* We catch PARENT_L_ == nil case with this, but we crash if we did
      not ask for the absolute coordinate (ie. REFP == nil.)  */
+  Real off = get_offset (a);
   if (refp == dim_cache_[a].parent_)
-    return get_offset (a);
+    return off;
+  
+  off += dim_cache_[a].parent_->relative_coordinate (refp, a);
 
-  return get_offset (a) + dim_cache_[a].parent_->relative_coordinate (refp, a);
+  return off;
 }
 
 /* Invoke callbacks to get offset relative to parent.  */
@@ -387,14 +390,6 @@ Grob::get_offset (Axis a) const
   return dim_cache_[a].offset_;
 }
 
-#if 0
-bool
-Grob::is_empty (Axis a) const
-{
-  return !(scm_is_pair (dim_cache_[a].dimension_)
-          || ly_is_procedure (dim_cache_[a].dimension_callback_));
-}
-#endif
 
 void
 Grob::flush_extent_cache (Axis axis)
index 11f5ad0fc93ae4411de0b348f7b2e8dc4552ede0..6c08afeeec96e0399a337732f68798fd4570e651 100644 (file)
@@ -42,6 +42,7 @@ protected:
   void substitute_object_links (SCM, SCM);
 
   DECLARE_CLASSNAME(Grob);
+  Real get_offset (Axis a) const;
 public:
   DECLARE_SCHEME_CALLBACK(same_axis_parent_positioning, (SCM, SCM));
   DECLARE_SCHEME_CALLBACK(other_axis_parent_positioning, (SCM, SCM));
@@ -77,11 +78,6 @@ public:
   void internal_set_object (SCM sym, SCM val);
 
   SCM try_callback (SCM, SCM);
-  /*
-    JUNKME.
-  */
-  void add_to_list_property (SCM, SCM);
-  void add_to_object_list (SCM sym, SCM thing);
 
   SCM get_property_alist_chain (SCM) const;
   static SCM ly_grob_set_property (SCM, SCM, SCM);
@@ -91,11 +87,7 @@ public:
   void programming_error (String) const;
 
   Output_def *get_layout () const;
-  void add_dependency (Grob *);
   virtual System *get_system () const;
-
-  void calculate_dependencies (int final, int busy, SCM funcname);
-
   virtual void do_break_processing ();
   virtual Grob *find_broken_piece (System *) const;
   virtual void discretionary_processing ();
@@ -124,7 +116,6 @@ public:
   bool has_offset_callback (SCM callback, Axis) const;
   void add_offset_callback (SCM callback, Axis);
   void flush_extent_cache (Axis);
-  Real get_offset (Axis a) const;
 
   void set_parent (Grob *e, Axis);