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"
17 typedef void (Score_element::*Score_element_method_pointer) (void);
19 /** Both Spanner and Item are Score_element's. Most Score_element's depend
20 on other Score_element's, eg, Beam needs to know and set direction of
21 Stem. So the Beam has to be calculated *before* Stem. This is
22 accomplished with the dependencies fields of struct Score_element,
23 which are implemented in the Directed_graph_node class: all elements
24 form an acyclic graph.
27 class Score_element : private Directed_graph_node, public virtual Graphical_element {
29 Paper_score *pscore_l_;
32 Score_element (Score_element const&);
33 virtual void print () const;
35 Paper_def *paper () const;
36 Lookup const *lookup_l () const;
38 virtual ~Score_element ();
41 void add_processing ();
44 Remove all links (dependencies, dependents, Axis_group_elements.
47 void substitute_dependency (Score_element*,Score_element*);
48 void remove_dependency (Score_element*);
50 add a dependency. It may be the 0 pointer, in which case, it is ignored.
52 void add_dependency (Score_element*);
54 virtual Line_of_score * line_l () const;
55 virtual bool linked_b () const;
56 VIRTUAL_COPY_CONS(Score_element);
58 /// do not print anything black
63 // ugh: no protection. Denk na, Vrij Veilig
64 void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
68 Administration: Where are we?. This is mainly used by Super_element and
69 Score_element::calcalute_dependencies ()
78 Score_element* dependency (int) const;
79 Score_element* dependent (int) const;
80 int dependent_size () const;
81 int dependency_size () const;
83 virtual void output_processing ();
85 virtual Interval do_height () const;
86 virtual Interval do_width () const;
88 /// do printing of derived info.
89 virtual void do_print () const {}
90 /// generate the molecule
91 virtual Molecule* do_brew_molecule_p () const;
92 ///executed directly after the item is added to the Paper_score
93 virtual void do_add_processing ();
94 /// do calculations before determining horizontal spacing
95 virtual void do_pre_processing ();
97 /// generate rods & springs
98 virtual void do_space_processing ();
100 virtual void do_breakable_col_processing ();
101 /// do calculations after determining horizontal spacing
102 virtual void do_post_processing ();
104 virtual void do_substitute_dependency (Score_element * , Score_element *);
105 virtual void do_substitute_dependent (Score_element *, Score_element *);
106 virtual void do_break_processing ();
107 virtual void handle_broken_dependencies ();
108 virtual void handle_prebroken_dependencies ();
109 virtual Link_array<Score_element> get_extra_dependencies () const;
110 virtual void do_unlink ();
111 virtual void do_junk_links ();
116 #endif // STAFFELEM_HH