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"
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 /// delete after linebreak calculation.
30 bool break_helper_only_b_;
31 Paper_score *pscore_l_;
34 Score_element (Score_element const&);
35 virtual void print () const;
37 Paper_def *paper () const;
38 Lookup const *lookup_l () const;
40 virtual ~Score_element ();
43 void add_processing ();
46 Remove all links (dependencies, dependents, Axis_group_elements.
49 void substitute_dependency (Score_element*,Score_element*);
50 void remove_dependency (Score_element*);
52 add a dependency. It may be the 0 pointer, in which case, it is ignored.
54 void add_dependency (Score_element*);
56 virtual Line_of_score * line_l () const;
57 virtual bool linked_b () const;
58 VIRTUAL_COPY_CONS(Score_element);
60 /// do not print anything black
65 // ugh: no protection. Denk na, Vrij Veilig
66 void calculate_dependencies (int final, int busy, Score_element_method_pointer funcptr);
70 Administration: Where are we?. This is mainly used by Super_element and
71 Score_element::calcalute_dependencies ()
80 Score_element* dependency (int) const;
81 Score_element* dependent (int) const;
82 int dependent_size () const;
83 int dependency_size () const;
85 virtual void output_processing ();
87 virtual Interval do_height () const;
88 virtual Interval do_width () const;
90 /// do printing of derived info.
91 virtual void do_print () const {}
92 /// generate the molecule
93 virtual Molecule* do_brew_molecule_p () const;
94 ///executed directly after the item is added to the Paper_score
95 virtual void do_add_processing ();
96 /// do calculations before determining horizontal spacing
97 virtual void do_pre_processing ();
99 /// generate rods & springs
100 virtual void do_space_processing ();
102 virtual void do_breakable_col_processing ();
103 /// do calculations after determining horizontal spacing
104 virtual void do_post_processing ();
106 virtual void do_substitute_element_pointer (Score_element * , Score_element *);
107 virtual void do_break_processing ();
108 virtual void handle_broken_dependencies ();
109 virtual void handle_prebroken_dependencies ();
110 virtual void handle_prebroken_dependents ();
111 virtual Link_array<Score_element> get_extra_dependencies () const;
112 virtual void do_unlink ();
113 virtual void do_junk_links ();
117 #endif // STAFFELEM_HH