X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fdimension-cache.hh;h=8897dc6fd418b59f18559ccc53e5b188f4c8aa7c;hb=86ae245eef3d991483f27f135ded2c9bc29043f3;hp=0a61bc2d74a79ddbbcd0eb2ff40356a492ce7723;hpb=9bc467a994787949def91708bf3bd50d088db982;p=lilypond.git diff --git a/lily/include/dimension-cache.hh b/lily/include/dimension-cache.hh index 0a61bc2d74..8897dc6fd4 100644 --- a/lily/include/dimension-cache.hh +++ b/lily/include/dimension-cache.hh @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1998--1999 Han-Wen Nienhuys + (c) 1998--2002 Han-Wen Nienhuys */ @@ -14,72 +14,41 @@ #include "real.hh" #include "lily-proto.hh" #include "parray.hh" +#include "dimension-cache-callback.hh" +#include "lily-guile.hh" -class Dimension_cache; -typedef Interval (*Dim_cache_callback)(Dimension_cache const *); -typedef Real (*Offset_cache_callback)(Dimension_cache const *); /** - Adminstration of offset dimension info. - */ -class Dimension_cache + Adminstration of offset dimension info. +*/ +struct Dimension_cache { - bool valid_b_; - Interval dim_; - /** - The offset wrt. to the center of #parent_l_# - */ - - Real extra_offset_; - Real basic_offset_; - bool off_valid_b_; + /* + Multi typed: - Score_element *elt_l_; - friend class Score_element; + - cons: interval + - procedure: callback + - else: empty + */ + SCM dimension_; - void init (); -public: - Array off_callbacks_; /** - What to call to find extent. Nil means empty. + The offset wrt. to the center of #parent_l_# */ - Dim_cache_callback callback_l_; - static Interval point_dimension_callback (Dimension_cache const* ); - Axis axis () const; - Real get_offset () const; - void set_callback (Dim_cache_callback); - /** The #offset_# is defined with regard to this graphical_element/ - dimension_cache. */ - void set_offset_callback (Offset_cache_callback); - Dimension_cache * parent_l_; - Score_element *element_l () const { return elt_l_; } - - void invalidate (); - void invalidate_dependencies (); + Real offset_; + SCM offset_callbacks_; - Dimension_cache(Dimension_cache const&); - Dimension_cache (); - + char offsets_left_; /** - Find the offset relative to D. If D equals THIS, then it is 0. - Otherwise, it recursively defd as - - OFFSET_ + PARENT_L_->relative_coordinate (D) + What to call to find extent. Nil means empty. */ - Real relative_coordinate (Dimension_cache *d) const; - Dimension_cache*common_refpoint (Dimension_cache const* s) const; - Dimension_cache*common_refpoint (Link_array caches) const; - void set_empty (bool); - void translate (Real); - - // junkme. - void set_offset (Real); + Grob * parent_l_; - bool valid_b () const { return valid_b_; } - bool empty_b() const; - Interval get_dim () const; + Dimension_cache (Dimension_cache const&); + Dimension_cache (); + void init (); };