2 score-elem.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_ELEM_CLONE(T) VIRTUAL_COPY_CONS(T, Score_elem)
18 typedef void (Score_elem::*Score_elem_method_pointer)(void);
20 /** Both Spanner and Item are Score_elem's. Most Score_elem's depend
21 on other Score_elem'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_elem,
24 which are implemented in the Directed_graph_node class: all elements
25 form an acyclic graph.
28 class Score_elem : private Directed_graph_node, public Graphical_element {
30 Paper_score *pscore_l_;
33 Score_elem (Score_elem const&);
34 virtual void print() const;
36 Paper_def *paper() const;
38 virtual ~Score_elem();
39 DECLARE_MY_RUNTIME_TYPEINFO;
41 void add_processing();
44 Remove all links (dependencies, dependents, Axis_group_elements.
47 void substitute_dependency (Score_elem*,Score_elem*);
48 void remove_dependency (Score_elem*);
50 add a dependency. It may be the 0 pointer, in which case, it is ignored.
52 void add_dependency (Score_elem*);
58 virtual Spanner* spanner() { return 0; }
59 virtual Item * item() { return 0; }
60 virtual Line_of_score * line_l() const;
61 virtual bool linked_b() const;
62 SCORE_ELEM_CLONE(Score_elem);
64 /// do not print anything black
67 // ugh: no protection. Denk na, Vrij Veilig
68 void calcalute_dependencies (int final, int busy, Score_elem_method_pointer funcptr);
72 Administration: Where are we?. This is mainly used by Super_elem and
73 Score_elem::calcalute_dependencies ()
81 Score_elem* dependency (int) const;
82 Score_elem* dependent (int) const;
83 int dependent_size() const;
84 int dependency_size() const;
86 virtual void do_brew_molecule ();
88 virtual Interval do_height() const;
89 virtual Interval do_width() const;
91 /// do printing of derived info.
92 virtual void do_print() const {}
93 /// generate the molecule
94 virtual Molecule* brew_molecule_p() const;
95 ///executed directly after the item is added to the Paper_score
96 virtual void do_add_processing();
97 /// do calculations before determining horizontal spacing
98 virtual void do_pre_processing();
100 /// generate rods & springs
101 virtual void do_space_processing ();
103 virtual void do_breakable_col_processing();
104 /// do calculations after determining horizontal spacing
105 virtual void do_post_processing();
107 virtual void do_substitute_dependency (Score_elem * , Score_elem *);
108 virtual void do_substitute_dependent (Score_elem *, Score_elem *);
109 virtual void do_break_processing();
110 virtual void handle_broken_dependencies();
111 virtual void handle_prebroken_dependencies();
112 virtual Link_array<Score_elem> get_extra_dependencies() const;
113 virtual void do_unlink();
114 virtual void do_junk_links();
118 #endif // STAFFELEM_HH