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*);
59 virtual Spanner* access_Spanner () { return 0; }
60 virtual Span_bar* access_Span_bar () { return 0; }
61 virtual Axis_group_element * access_Axis_group_element () { return 0; }
62 virtual Score_element* access_Score_element () { return this; }
64 virtual Item * access_Item () { return 0; }
65 virtual Line_of_score * line_l () const;
66 virtual bool linked_b () const;
67 SCORE_ELEMENT_CLONE (Score_element);
69 /// do not print anything black
74 // ugh: no protection. Denk na, Vrij Veilig
75 void calcalute_dependencies (int final, int busy, Score_element_method_pointer funcptr);
79 Administration: Where are we?. This is mainly used by Super_element and
80 Score_element::calcalute_dependencies ()
89 Score_element* dependency (int) const;
90 Score_element* dependent (int) const;
91 int dependent_size () const;
92 int dependency_size () const;
94 virtual void do_brew_molecule ();
96 virtual Interval do_height () const;
97 virtual Interval do_width () const;
99 /// do printing of derived info.
100 virtual void do_print () const {}
101 /// generate the molecule
102 virtual Molecule* brew_molecule_p () const;
103 ///executed directly after the item is added to the Paper_score
104 virtual void do_add_processing ();
105 /// do calculations before determining horizontal spacing
106 virtual void do_pre_processing ();
108 /// generate rods & springs
109 virtual void do_space_processing ();
111 virtual void do_breakable_col_processing ();
112 /// do calculations after determining horizontal spacing
113 virtual void do_post_processing ();
115 virtual void do_substitute_dependency (Score_element * , Score_element *);
116 virtual void do_substitute_dependent (Score_element *, Score_element *);
117 virtual void do_break_processing ();
118 virtual void handle_broken_dependencies ();
119 virtual void handle_prebroken_dependencies ();
120 virtual Link_array<Score_element> get_extra_dependencies () const;
121 virtual void do_unlink ();
122 virtual void do_junk_links ();
127 #endif // STAFFELEM_HH