X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fscore-element.hh;h=af9b484faa5f19e137d0223565779be05721d9ef;hb=0cf97b5cdceecbba937f43ac827f4065aad5001e;hp=719cc16d8ed2938e517f3d08e47c1e834809d273;hpb=d36e8ced83cfeabcf4ec3840ffe93a717a17ac4d;p=lilypond.git diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index 719cc16d8e..af9b484faa 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -9,9 +9,7 @@ #include "parray.hh" #include "virtual-methods.hh" -#include "directed-graph.hh" #include "graphical-element.hh" -#include "protected-scm.hh" #include "lily-guile.hh" @@ -37,7 +35,16 @@ Boolean (true iff defined) */ class Score_element : public virtual Graphical_element { - Protected_scm element_property_alist_; + + friend class Paper_score; + /** + properties specific for this element. Destructor will not call + scm_unprotect, so as to allow more flexible GC arrangements. The + real alist is in (cdr element_property_alist_), to reduce the + need for more scm_protect calls. + + */ + SCM element_property_alist_; Link_array dependency_arr_; /** The lookup, determined by the font size. Cache this value. @@ -98,6 +105,8 @@ public: */ void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr); + + virtual Score_element *find_broken_piece (Line_of_score*) const; protected: Score_element* dependency (int) const; int dependency_size () const; @@ -105,7 +114,8 @@ protected: virtual void output_processing (); virtual Interval do_height () const; virtual Interval do_width () const; - + + /// do printing of derived info. virtual void do_print () const; /// generate the molecule @@ -118,6 +128,9 @@ protected: /// generate rods & springs virtual void do_space_processing (); + /// do postbreak substs on array of pointers. + virtual void do_substitute_arrays (); + virtual void do_breakable_col_processing (); /// do calculations after determining horizontal spacing virtual void do_post_processing (); @@ -127,11 +140,33 @@ protected: virtual void handle_broken_dependencies (); virtual void handle_prebroken_dependencies (); virtual void handle_prebroken_dependents (); + virtual void handle_broken_dependents (); virtual Link_array get_extra_dependencies () const; static Interval dim_cache_callback (Dimension_cache*); }; +template +void +substitute_element_array (Link_array &arr, Line_of_score * to) +{ + Link_array newarr; + for (int i =0; i < arr.size (); i++) + { + T * t = arr[i]; + if (t->line_l () != to) + { + t = dynamic_cast (t->find_broken_piece (to)); + } + + if (t) + newarr.push (t); + } + arr = newarr; +} + + + #endif // STAFFELEM_HH