]> git.donarmstrong.com Git - lilypond.git/blob - lily/super-element.cc
release: 1.1.24
[lilypond.git] / lily / super-element.cc
1 /*
2   super-elem.cc -- implement Super_elem
3
4   source file of the LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "super-element.hh"
10 #include "line-of-score.hh"
11 #include "p-score.hh"
12 #include "string.hh"
13 #include "paper-outputter.hh"
14
15
16 Super_element::Super_element()
17 {
18 }
19
20
21
22
23 /**
24     for administration of what was done already
25     */
26 enum Score_element_status {
27   ORPHAN=0,                     // not yet added to pstaff
28   VIRGIN,                       // added to pstaff
29   PREBROKEN,
30   PREBROKEN_SECOND,
31   PRECALCING,
32   PRECALCED,            // calcs before spacing done
33   SPACING,
34   SPACED,
35   BROKEN,
36   POSTCALCING,          // busy calculating. This is used to trap cyclic deps.
37   POSTCALCED,           // after spacing calcs done
38   BREWING,
39   BREWED,
40   UNLINKING,
41   UNLINKED,
42 };
43
44 void
45 Super_element::pre_processing ()
46 {
47   calculate_dependencies (PRECALCING, PRECALCED, &Score_element::do_pre_processing);
48 }
49
50 void
51 Super_element::space_processing ()
52 {
53   calculate_dependencies (SPACING, SPACED, &Score_element::do_space_processing);
54 }
55
56 /* for break processing, use only one status, because copies have to
57   have correct status. (Previously,
58   Score_element::handle_[pre]broken_dependencies assigned to status_i_
59   */
60 void
61 Super_element::breakable_col_processing ()
62 {
63   calculate_dependencies (PREBROKEN, PREBROKEN, &Score_element::do_breakable_col_processing);
64   calculate_dependencies (PREBROKEN_SECOND, PREBROKEN_SECOND, &Score_element::handle_prebroken_dependents);
65 }
66
67 void
68 Super_element::break_processing ()
69 {
70   calculate_dependencies (BROKEN, BROKEN, &Score_element::do_break_processing);
71 }
72 void
73 Super_element::post_processing ()
74 {
75   calculate_dependencies (POSTCALCING, POSTCALCED, &Score_element::do_post_processing);
76 }
77
78 void
79 Super_element::output_all () 
80 {
81   pscore_l_->outputter_l_->start_line ();
82   calculate_dependencies (BREWING, BREWED, &Score_element::output_processing);
83   pscore_l_->outputter_l_->stop_line ();
84 }
85
86
87
88 void
89 Super_element::unlink_all ()
90 {
91   calculate_dependencies (UNLINKING, UNLINKED, &Score_element::junk_links);
92 }
93