]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/dimension-cache.hh
* flower
[lilypond.git] / lily / include / dimension-cache.hh
index 806ec2704eddf9f3e3d659e075a272621821e807..86c3a663d0f1af096ac1836818917f6d9aaeeb58 100644 (file)
@@ -1,66 +1,52 @@
-/*   
+/*
   dimension-cache.hh -- declare Dimension_cache
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+
+  (c) 1998--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #ifndef DIMENSION_CACHE_HH
 #define DIMENSION_CACHE_HH
 
-#include "interval.hh"
-#include "real.hh"
 #include "lily-proto.hh"
 #include "parray.hh"
-
+#include "dimension-cache-callback.hh"
+#include "lily-guile.hh"
 
 /**
-  Adminstration of offset  dimension info. 
- */
-class Dimension_cache
+   Adminstration of offset dimension info.
+*/
+struct Dimension_cache
 {
-  bool valid_b_;
-  /** Is this element dimensionless?.
-    This is private to guarantee correctness of the cache
-   */
-  bool empty_b_;
-  Interval dim_;
+  /*
+    Multi typed:
+
+    - cons: interval
+    - procedure: callback
+    - else: empty
+  */
+  SCM dimension_;
+  SCM dimension_callback_;
+
   /**
-    The offset wrt. to the center of #parent_l_#
-   */
+     The offset wrt. to the center of #parent_#
+  */
+
   Real offset_;
-  Graphical_element *elt_l_;
-  friend class Graphical_element;
+  SCM offset_callbacks_;
 
-  void init ();
-public:
-  /** The #offset_# is defined with regard to this graphical_element/
-    dimension_cache.  */
-  
-  Dimension_cache * parent_l_;
-  Link_array<Dimension_cache> dependencies_l_arr_;
-  Graphical_element *element_l () { return elt_l_; }
-  Real absolute_coordinate () const;
-  void invalidate ();
-  void invalidate_dependencies ();
-  
-  Dimension_cache(Dimension_cache const&);
-  Dimension_cache ();
+  char offsets_left_;
 
-  Real relative_coordinate (Dimension_cache *d) const;
-  Dimension_cache*common_group (Dimension_cache const* s) const;
-  Dimension_cache*common_group (Link_array<Dimension_cache> caches) const;
-  void set_empty (bool);
-  void translate (Real);
-  void set_offset (Real);
-  bool valid_b () const { return valid_b_; }
-  bool empty_b() const { return empty_b_; }
-  void set_dim (Interval);
-  Interval get_dim () const;
-};
+  /**
+     What to call to find extent.  Nil means empty.
+  */
+  Grob *parent_;
 
+  Dimension_cache (Dimension_cache const &);
+  Dimension_cache ();
+  void init ();
+};
 
 #endif /* DIMENSION_CACHE_HH */