2 score-element.hh -- declare Score_element
4 (c) 1996-1999 Han-Wen Nienhuys
11 #include "virtual-methods.hh"
12 #include "directed-graph.hh"
13 #include "graphical-element.hh"
14 #include "protected-scm.hh"
15 #include "lily-guile.hh"
18 typedef void (Score_element::*Score_element_method_pointer) (void);
20 /** Both Spanner and Item are Score_element's. Most Score_element's depend
21 on other Score_element's, eg, Beam needs to know and set direction of
22 Stem. So the Beam has to be calculated *before* Stem. This is
23 accomplished with the dependencies fields of struct Score_element,
24 which are implemented in the Directed_graph_node class: all elements
25 form an acyclic graph.
32 Boolean (true iff defined)
34 break_helper_only -- if defined try to junk this after calcing breakpoints.
36 transparent -- do not calc. output
39 class Score_element : public virtual Graphical_element {
40 Protected_scm element_property_alist_;
41 Link_array<Score_element> dependency_arr_;
43 The lookup, determined by the font size. Cache this value.
47 Score_element *original_l_;
50 Administration: Where are we?. This is mainly used by Super_element and
51 Score_element::calcalute_dependencies ()
59 Paper_score *pscore_l_;
62 Score_element (Score_element const&);
63 virtual void print () const;
68 SCM get_elt_property (SCM sym) const;
69 void set_elt_property (SCM sym, SCM val);
70 SCM remove_elt_property (SCM key);
75 Paper_def *paper_l () const;
76 Lookup const *lookup_l () const;
78 virtual ~Score_element ();
79 void add_processing ();
81 void substitute_dependency (Score_element*,Score_element*);
82 void remove_dependency (Score_element*);
84 add a dependency. It may be the 0 pointer, in which case, it is ignored.
86 void add_dependency (Score_element*);
87 virtual Line_of_score * line_l () const;
88 bool linked_b () const;
89 VIRTUAL_COPY_CONS(Score_element);
92 Recursively track all dependencies of this Score_element. The
93 status_i_ field is used as a mark-field. It is marked with
94 #busy# during execution of this function, and marked with #final#
97 #funcptr# is the function to call to update this element.
99 void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
102 Score_element* dependency (int) const;
103 int dependency_size () const;
105 virtual void output_processing ();
106 virtual Interval do_height () const;
107 virtual Interval do_width () const;
109 /// do printing of derived info.
110 virtual void do_print () const;
111 /// generate the molecule
112 virtual Molecule* do_brew_molecule_p () const;
113 ///executed directly after the item is added to the Paper_score
114 virtual void do_add_processing ();
115 /// do calculations before determining horizontal spacing
116 virtual void do_pre_processing ();
118 /// generate rods & springs
119 virtual void do_space_processing ();
121 virtual void do_breakable_col_processing ();
122 /// do calculations after determining horizontal spacing
123 virtual void do_post_processing ();
125 virtual void do_substitute_element_pointer (Score_element * , Score_element *);
126 virtual void do_break_processing ();
127 virtual void handle_broken_dependencies ();
128 virtual void handle_prebroken_dependencies ();
129 virtual void handle_prebroken_dependents ();
130 virtual Link_array<Score_element> get_extra_dependencies () const;
132 static Interval dim_cache_callback (Dimension_cache*);
136 #endif // STAFFELEM_HH