X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fdimension-cache.hh;h=24f2615b388a36de4fd2634d633b425a67b1fbfe;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=fc23932284e3b78a5d001024c8eb2ecb3c84231a;hpb=59e4ae99bad964d00dc167919779301c5ec2a535;p=lilypond.git diff --git a/lily/include/dimension-cache.hh b/lily/include/dimension-cache.hh index fc23932284..24f2615b38 100644 --- a/lily/include/dimension-cache.hh +++ b/lily/include/dimension-cache.hh @@ -1,90 +1,45 @@ -/* - dimension-cache.hh -- declare Dimension_cache - - source file of the GNU LilyPond music typesetter - - (c) 1998--1999 Han-Wen Nienhuys - - */ +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 1998--2015 Han-Wen Nienhuys + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . +*/ #ifndef DIMENSION_CACHE_HH #define DIMENSION_CACHE_HH -#include "interval.hh" -#include "real.hh" #include "lily-proto.hh" -#include "parray.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. - */ +/* + XY offset/refpoint/extent structure. +*/ class 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 extra_offset_; - Real basic_offset_; - - bool off_valid_b_; - - - Graphical_element *elt_l_; - Dim_cache_callback callback_l_; - friend class Graphical_element; - + Interval *extent_; + Real *offset_; + Grob *parent_; void init (); -public: - Array off_callbacks_; - - 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_; + void clear (); - Graphical_element *element_l () const { return elt_l_; } + friend class Grob; - void invalidate (); - void invalidate_dependencies (); - - Dimension_cache(Dimension_cache const&); + Dimension_cache (Dimension_cache const &); + Dimension_cache & operator = (Dimension_cache const &d); + ~Dimension_cache (); Dimension_cache (); - - - /** - 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) - */ - 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); - - bool valid_b () const { return valid_b_; } - bool empty_b() const { return empty_b_; } - Interval get_dim () const; }; - #endif /* DIMENSION_CACHE_HH */