]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/dimension-cache.hh
patch::: 1.3.59.uu2.jcn1
[lilypond.git] / lily / include / dimension-cache.hh
index 9962cc2a7a19ee5ca946044ffe285a39c91870d7..ca4fad3c16c370485ce2a3c6b5b51d0e6f819a39 100644 (file)
@@ -3,53 +3,46 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2000 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"
 
 
-
-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_;
+  /**
+    The offset wrt. to the center of #parent_l_#
+   */
+
   Real offset_;
-  Graphical_element *elt_l_;
-  friend class Graphical_element;
 
-  void init ();
-public:
-  Dimension_cache * parent_l_;
-  Link_array<Dimension_cache> dependencies_l_arr_;
-  
-  Real absolute_coordinate () const;
-  void invalidate ();
-  void invalidate_dependencies ();
+
   
+  Array<Offset_callback> off_callbacks_;
+
+  /**
+     What to call to find extent.  Nil means empty. 
+   */
+  Dim_cache_callback extent_callback_l_;
+  Score_element * parent_l_;
+
   Dimension_cache(Dimension_cache const&);
   Dimension_cache ();
-  void set_group_l (Graphical_axis_group*);
-  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;
+  void init ();
 };