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