2 dimension-cache.hh -- declare Dimension_cache
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #ifndef DIMENSION_CACHE_HH
11 #define DIMENSION_CACHE_HH
13 #include "interval.hh"
15 #include "lily-proto.hh"
18 class Dimension_cache;
19 typedef Interval (*Dim_cache_callback)(Dimension_cache *);
22 Adminstration of offset dimension info.
27 /** Is this element dimensionless?.
28 This is private to guarantee correctness of the cache
33 The offset wrt. to the center of #parent_l_#
36 Graphical_element *elt_l_;
37 Dim_cache_callback callback_l_;
38 friend class Graphical_element;
43 void set_callback (Dim_cache_callback);
44 /** The #offset_# is defined with regard to this graphical_element/
47 Dimension_cache * parent_l_;
48 Link_array<Dimension_cache> dependencies_l_arr_;
49 Graphical_element *element_l () { return elt_l_; }
50 Real absolute_coordinate () const;
52 void invalidate_dependencies ();
54 Dimension_cache(Dimension_cache const&);
57 Real relative_coordinate (Dimension_cache *d) const;
58 Dimension_cache*common_group (Dimension_cache const* s) const;
59 Dimension_cache*common_group (Link_array<Dimension_cache> caches) const;
60 void set_empty (bool);
61 void translate (Real);
62 void set_offset (Real);
63 bool valid_b () const { return valid_b_; }
64 bool empty_b() const { return empty_b_; }
65 void set_dim (Interval);
66 Interval get_dim () const;
70 #endif /* DIMENSION_CACHE_HH */