2 score-element.hh -- declare Score_element
4 (c) 1996-1999 Han-Wen Nienhuys
11 #include "virtual-methods.hh"
12 #include "graphical-element.hh"
13 #include "lily-guile.hh"
16 typedef void (Score_element::*Score_element_method_pointer) (void);
18 /** Both Spanner and Item are Score_element's. Most Score_element's depend
19 on other Score_element's, eg, Beam needs to know and set direction of
20 Stem. So the Beam has to be calculated *before* Stem. This is
21 accomplished with the dependencies fields of struct Score_element,
22 which are implemented in the Directed_graph_node class: all elements
23 form an acyclic graph.
30 Boolean (true iff defined)
32 break_helper_only -- if defined try to junk this after calcing breakpoints.
34 transparent -- do not calc. output
37 class Score_element : public virtual Graphical_element {
39 friend class Paper_score;
41 properties specific for this element. Destructor will not call
42 scm_unprotect, so as to allow more flexible GC arrangements. The
43 real alist is in (cdr element_property_alist_), to reduce the
44 need for more scm_protect calls.
47 SCM element_property_alist_;
48 Link_array<Score_element> dependency_arr_;
50 The lookup, determined by the font size. Cache this value.
54 Score_element *original_l_;
57 Administration: Where are we?. This is mainly used by Super_element and
58 Score_element::calcalute_dependencies ()
66 Paper_score *pscore_l_;
69 Score_element (Score_element const&);
70 virtual void print () const;
75 SCM get_elt_property (SCM sym) const;
76 void set_elt_property (SCM sym, SCM val);
77 SCM remove_elt_property (SCM key);
82 Paper_def *paper_l () const;
83 Lookup const *lookup_l () const;
85 virtual ~Score_element ();
86 void add_processing ();
88 void substitute_dependency (Score_element*,Score_element*);
89 void remove_dependency (Score_element*);
91 add a dependency. It may be the 0 pointer, in which case, it is ignored.
93 void add_dependency (Score_element*);
94 virtual Line_of_score * line_l () const;
95 bool linked_b () const;
96 VIRTUAL_COPY_CONS(Score_element);
99 Recursively track all dependencies of this Score_element. The
100 status_i_ field is used as a mark-field. It is marked with
101 #busy# during execution of this function, and marked with #final#
104 #funcptr# is the function to call to update this element.
106 void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
109 Score_element* dependency (int) const;
110 int dependency_size () const;
112 virtual void output_processing ();
113 virtual Interval do_height () const;
114 virtual Interval do_width () const;
116 /// do printing of derived info.
117 virtual void do_print () const;
118 /// generate the molecule
119 virtual Molecule* do_brew_molecule_p () const;
120 ///executed directly after the item is added to the Paper_score
121 virtual void do_add_processing ();
122 /// do calculations before determining horizontal spacing
123 virtual void do_pre_processing ();
125 /// generate rods & springs
126 virtual void do_space_processing ();
128 virtual void do_breakable_col_processing ();
129 /// do calculations after determining horizontal spacing
130 virtual void do_post_processing ();
132 virtual void do_substitute_element_pointer (Score_element * , Score_element *);
133 virtual void do_break_processing ();
134 virtual void handle_broken_dependencies ();
135 virtual void handle_prebroken_dependencies ();
136 virtual void handle_prebroken_dependents ();
137 virtual void handle_broken_dependents ();
138 virtual Link_array<Score_element> get_extra_dependencies () const;
140 static Interval dim_cache_callback (Dimension_cache*);
144 #endif // STAFFELEM_HH