2 score-element.hh -- part of GNU LilyPond
4 (c) 1996,97 Han-Wen Nienhuys
11 #include "virtual-methods.hh"
12 #include "directed-graph.hh"
13 #include "graphical-element.hh"
15 #define SCORE_ELEMENT_CLONE(T) VIRTUAL_COPY_CONS (T, Score_element)
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.
28 class Score_element : private Directed_graph_node, public virtual Graphical_element {
30 Paper_score *pscore_l_;
33 Score_element (Score_element const&);
34 virtual void print () const;
36 Paper_def *paper () const;
37 Lookup const *lookup_l () const;
39 virtual ~Score_element ();
40 DECLARE_MY_RUNTIME_TYPEINFO;
42 void add_processing ();
45 Remove all links (dependencies, dependents, Axis_group_elements.
48 void substitute_dependency (Score_element*,Score_element*);
49 void remove_dependency (Score_element*);
51 add a dependency. It may be the 0 pointer, in which case, it is ignored.
53 void add_dependency (Score_element*);
55 virtual Line_of_score * line_l () const;
56 virtual bool linked_b () const;
57 SCORE_ELEMENT_CLONE (Score_element);
59 /// do not print anything black
64 // ugh: no protection. Denk na, Vrij Veilig
65 void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
69 Administration: Where are we?. This is mainly used by Super_element and
70 Score_element::calcalute_dependencies ()
79 Score_element* dependency (int) const;
80 Score_element* dependent (int) const;
81 int dependent_size () const;
82 int dependency_size () const;
84 virtual void do_brew_molecule ();
86 virtual Interval do_height () const;
87 virtual Interval do_width () const;
89 /// do printing of derived info.
90 virtual void do_print () const {}
91 /// generate the molecule
92 virtual Molecule* brew_molecule_p () const;
93 ///executed directly after the item is added to the Paper_score
94 virtual void do_add_processing ();
95 /// do calculations before determining horizontal spacing
96 virtual void do_pre_processing ();
98 /// generate rods & springs
99 virtual void do_space_processing ();
101 virtual void do_breakable_col_processing ();
102 /// do calculations after determining horizontal spacing
103 virtual void do_post_processing ();
105 virtual void do_substitute_dependency (Score_element * , Score_element *);
106 virtual void do_substitute_dependent (Score_element *, Score_element *);
107 virtual void do_break_processing ();
108 virtual void handle_broken_dependencies ();
109 virtual void handle_prebroken_dependencies ();
110 virtual Link_array<Score_element> get_extra_dependencies () const;
111 virtual void do_unlink ();
112 virtual void do_junk_links ();
117 #endif // STAFFELEM_HH