2 super-elem.cc -- implement Super_elem
4 source file of the LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "super-element.hh"
10 #include "line-of-score.hh"
13 #include "tex-outputter.hh"
16 Super_elem::handle_broken_dependencies()
18 lines_arr_
= line_of_score_l_
->get_lines();
19 for (int i
=0; i
< lines_arr_
.size(); i
++)
20 add_dependency (lines_arr_
[i
]);
25 Super_elem::do_substitute_dependency (Score_element
*o
,Score_element
* n
)
27 if (line_of_score_l_
== o
->access_Spanner ())
28 line_of_score_l_
= n
? (Line_of_score
*) n
->access_Spanner () : 0;
31 Super_elem::Super_elem()
33 line_of_score_l_
= new Line_of_score
;
37 Super_elem::do_add_processing()
39 pscore_l_
->typeset_unbroken_spanner (line_of_score_l_
);
40 add_dependency (line_of_score_l_
);
43 IMPLEMENT_IS_TYPE_B1(Super_elem
,Score_element
);
47 for administration of what was done already
49 enum Score_element_status
{
50 ORPHAN
=0, // not yet added to pstaff
51 VIRGIN
, // added to pstaff
54 PRECALCED
, // calcs before spacing done
58 POSTCALCING
, // busy calculating. This is used to trap cyclic deps.
59 POSTCALCED
, // after spacing calcs done
67 Super_elem::pre_processing ()
69 calcalute_dependencies (PRECALCING
, PRECALCED
, &Score_element::do_pre_processing
);
73 Super_elem::space_processing ()
75 calcalute_dependencies (SPACING
, SPACED
, &Score_element::do_space_processing
);
78 /* for break processing, use only one status, because copies have to
79 have correct status. (Previously,
80 Score_element::handle_[pre]broken_dependencies assigned to status_i_
83 Super_elem::breakable_col_processing ()
85 calcalute_dependencies (PREBROKEN
, PREBROKEN
, &Score_element::do_breakable_col_processing
);
89 Super_elem::break_processing ()
91 calcalute_dependencies (BROKEN
, BROKEN
, &Score_element::do_break_processing
);
94 Super_elem::post_processing ()
96 calcalute_dependencies (POSTCALCING
, POSTCALCED
, &Score_element::do_post_processing
);
100 Super_elem::output_all ()
102 for (int i
=0; i
< lines_arr_
.size(); i
++)
104 pscore_l_
->outputter_l_
->start_line ();
105 lines_arr_
[i
]->calcalute_dependencies (BREWING
, BREWED
, &Score_element::do_brew_molecule
);
106 pscore_l_
->outputter_l_
->stop_line ();
113 Super_elem::unlink_all ()
115 calcalute_dependencies (UNLINKING
, UNLINKED
, &Score_element::junk_links
);