#include "parray.hh"
#include "virtual-methods.hh"
-#include "directed-graph.hh"
#include "graphical-element.hh"
-#include "protected-scm.hh"
#include "lily-guile.hh"
*/
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<Score_element> dependency_arr_;
/**
The lookup, determined by the font size. Cache this value.
*/
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;
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
/// 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 ();
virtual void handle_broken_dependencies ();
virtual void handle_prebroken_dependencies ();
virtual void handle_prebroken_dependents ();
+ virtual void handle_broken_dependents ();
virtual Link_array<Score_element> get_extra_dependencies () const;
static Interval dim_cache_callback (Dimension_cache*);
};
+template<class T>
+void
+substitute_element_array (Link_array<T> &arr, Line_of_score * to)
+{
+ Link_array<T> newarr;
+ for (int i =0; i < arr.size (); i++)
+ {
+ T * t = arr[i];
+ if (t->line_l () != to)
+ {
+ t = dynamic_cast<T*> (t->find_broken_piece (to));
+ }
+
+ if (t)
+ newarr.push (t);
+ }
+ arr = newarr;
+}
+
+
+
#endif // STAFFELEM_HH