CVSROOT: /cvsroot/lilypond Module name: lilypond Branch: Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/10/21 13:59:25
Modified files: lily : grob-property.cc grob.cc lily/include : grob.hh Log message: * lily/grob.cc: remove is_empty() * lily/grob-property.cc: remove add_to_list_property(). * lily/grob.cc: remove X-extent-callback / Y-extent-callback. * lily/include/grob.hh (class Grob): remove property_callbacks_ member. Properties of procedure type are assumed to be callbacks. * lily/grob.cc: remove set_extent_callback(), set_extent() and has_extent_callback() * lily/grob.cc (flush_extent_cache): rewrite. * lily/grob.cc (Grob): don't set extent from ctor. (extent): use property callbacks. * lily/grob-property.cc (del_property): new function. CVSWeb URLs: http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/grob-property.cc.diff?tr1=1.40&tr2=1.41&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/grob.cc.diff?tr1=1.152&tr2=1.153&r1=text&r2=text http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/include/grob.hh.diff?tr1=1.70&tr2=1.71&r1=text&r2=text Patches: Index: lilypond/lily/grob-property.cc diff -u lilypond/lily/grob-property.cc:1.40 lilypond/lily/grob-property.cc:1.41 --- lilypond/lily/grob-property.cc:1.40 Fri Oct 21 13:54:32 2005 +++ lilypond/lily/grob-property.cc Fri Oct 21 13:59:25 2005 @@ -32,36 +32,6 @@ return interfaces_; } -/* - This special add_thing routine is slightly more efficient than - - set_prop (name, cons (thing, get_prop (name))) - - since it can reuse the handle returned by scm_assq (). -*/ -// JUNKME. -void -Grob::add_to_list_property (SCM sym, SCM thing) -{ - SCM handle - = scm_sloppy_assq (sym, mutable_property_alist_); - - if (handle != SCM_BOOL_F) - scm_set_cdr_x (handle, scm_cons (thing, scm_cdr (handle))); - else - { - /* - There is no mutable prop yet, so create an entry, and put it in front of the - mutable prop list. - */ - handle = scm_sloppy_assq (sym, immutable_property_alist_); - SCM tail = (handle != SCM_BOOL_F) ? scm_cdr (handle) : SCM_EOL; - SCM val = scm_cons (thing, tail); - - mutable_property_alist_ = scm_cons (scm_cons (sym, val), - mutable_property_alist_); - } -} extern void check_interfaces_for_property (Grob const *me, SCM sym); Index: lilypond/lily/grob.cc diff -u lilypond/lily/grob.cc:1.152 lilypond/lily/grob.cc:1.153 --- lilypond/lily/grob.cc:1.152 Fri Oct 21 13:29:41 2005 +++ lilypond/lily/grob.cc Fri Oct 21 13:59:25 2005 @@ -359,10 +359,13 @@ /* We catch PARENT_L_ == nil case with this, but we crash if we did not ask for the absolute coordinate (ie. REFP == nil.) */ + Real off = get_offset (a); if (refp == dim_cache_[a].parent_) - return get_offset (a); + return off; + + off += dim_cache_[a].parent_->relative_coordinate (refp, a); - return get_offset (a) + dim_cache_[a].parent_->relative_coordinate (refp, a); + return off; } /* Invoke callbacks to get offset relative to parent. */ @@ -387,14 +390,6 @@ return dim_cache_[a].offset_; } -#if 0 -bool -Grob::is_empty (Axis a) const -{ - return !(scm_is_pair (dim_cache_[a].dimension_) - || ly_is_procedure (dim_cache_[a].dimension_callback_)); -} -#endif void Grob::flush_extent_cache (Axis axis) Index: lilypond/lily/include/grob.hh diff -u lilypond/lily/include/grob.hh:1.70 lilypond/lily/include/grob.hh:1.71 --- lilypond/lily/include/grob.hh:1.70 Fri Oct 21 13:29:42 2005 +++ lilypond/lily/include/grob.hh Fri Oct 21 13:59:25 2005 @@ -42,6 +42,7 @@ void substitute_object_links (SCM, SCM); DECLARE_CLASSNAME(Grob); + Real get_offset (Axis a) const; public: DECLARE_SCHEME_CALLBACK(same_axis_parent_positioning, (SCM, SCM)); DECLARE_SCHEME_CALLBACK(other_axis_parent_positioning, (SCM, SCM)); @@ -77,11 +78,6 @@ void internal_set_object (SCM sym, SCM val); SCM try_callback (SCM, SCM); - /* - JUNKME. - */ - void add_to_list_property (SCM, SCM); - void add_to_object_list (SCM sym, SCM thing); SCM get_property_alist_chain (SCM) const; static SCM ly_grob_set_property (SCM, SCM, SCM); @@ -91,11 +87,7 @@ void programming_error (String) const; Output_def *get_layout () const; - void add_dependency (Grob *); virtual System *get_system () const; - - void calculate_dependencies (int final, int busy, SCM funcname); - virtual void do_break_processing (); virtual Grob *find_broken_piece (System *) const; virtual void discretionary_processing (); @@ -124,7 +116,6 @@ bool has_offset_callback (SCM callback, Axis) const; void add_offset_callback (SCM callback, Axis); void flush_extent_cache (Axis); - Real get_offset (Axis a) const; void set_parent (Grob *e, Axis); _______________________________________________ Lilypond-cvs mailing list Lilypond-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-cvs