X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fscore-element.hh;h=a223d5657d9f673b61cbe468655715d7bc7cb167;hb=fd7e615444cf58b38283a59b56d3457c07778397;hp=c9b1a30188666cd0ea3c537f71911e634813272e;hpb=3a0e9efb7f067e5b334ba0596b95e15d96d7cc49;p=lilypond.git diff --git a/lily/include/score-element.hh b/lily/include/score-element.hh index c9b1a30188..a223d5657d 100644 --- a/lily/include/score-element.hh +++ b/lily/include/score-element.hh @@ -9,8 +9,8 @@ #include "parray.hh" #include "virtual-methods.hh" -#include "graphical-element.hh" #include "lily-guile.hh" +#include "lily-proto.hh" #include "smobs.hh" typedef void (Score_element::*Score_element_method_pointer) (void); @@ -34,7 +34,12 @@ Boolean (true iff defined) transparent -- do not calc. output */ -class Score_element : public virtual Graphical_element { +class Score_element { + /** + The lookup, determined by the font size. Cache this value. + */ + Lookup * lookup_l_; +public: /** properties specific for this element. Destructor will not call scm_unprotect, so as to allow more flexible GC arrangements. The @@ -43,12 +48,7 @@ class Score_element : public virtual Graphical_element { */ SCM element_property_alist_; - Link_array dependency_arr_; - /** - The lookup, determined by the font size. Cache this value. - */ - Lookup * lookup_l_; -public: + Score_element *original_l_; /** @@ -70,9 +70,12 @@ public: /* properties */ - SCM get_elt_property (SCM sym) const; - void set_elt_property (SCM sym, SCM val); - SCM remove_elt_property (SCM key); + SCM get_elt_property (String nm) const; + void set_elt_property (String, SCM val); + SCM remove_elt_property (String nm); + + void Score_element::set_real (String, Real); + Real Score_element::get_real (String s) const; /* related classes. @@ -82,8 +85,6 @@ public: void add_processing (); - void substitute_dependency (Score_element*,Score_element*); - void remove_dependency (Score_element*); /** add a dependency. It may be the 0 pointer, in which case, it is ignored. */ @@ -102,7 +103,10 @@ public: */ void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr); + static SCM handle_broken_smobs (SCM, SCM criterion); + void recurse_into_smobs (SCM s, void (Score_element::*meth_ptr)()); + virtual void do_break_processing (); virtual Score_element *find_broken_piece (Line_of_score*) const; protected: @@ -111,13 +115,8 @@ protected: be handled by GUILE gc. */ virtual ~Score_element (); - Score_element* dependency (int) const; - int dependency_size () const; - virtual void output_processing (); - virtual Interval do_height () const; - virtual Interval do_width () const; - + static Interval molecule_extent (Dimension_cache const*); /// do printing of derived info. virtual void do_print () const; @@ -131,46 +130,61 @@ 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 (); - virtual void do_substitute_element_pointer (Score_element * , Score_element *); - virtual void do_break_processing (); - 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*); + static Interval dim_cache_callback (Dimension_cache const*); public: + virtual void handle_broken_dependencies (); + virtual void handle_prebroken_dependencies (); + DECLARE_SMOBS; -}; + void init (); + +public: + Dimension_cache *dim_cache_[NO_AXES]; + + /** + Set this if anyone points to me, or if I point to anyone. + */ + bool used_b_; + + char const * name () const; + /** + Set empty in direction A. + */ + void set_empty (Axis a); + bool empty_b (Axis a) const; + Interval extent (Axis) const; + + /** + translate in one direction + */ + + void translate_axis (Real, Axis); + + Real relative_coordinate (Score_element const* refp, Axis) const; + /** + Find the group-element which has both #this# and #s# + */ + Score_element*common_refpoint (Score_element const* s, Axis a) const; + Score_element*common_refpoint (Link_array elems, Axis a) const; + + /** + Set the parent refpoint of THIS to E + */ + void set_parent (Score_element* e, Axis); + + Score_element *parent_l (Axis a) const; + void fixup_refpoint (); +}; -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; -} +Score_element * unsmob_element (SCM);