source file of the GNU LilyPond music typesetter
- (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2000 Jan Nieuwenhuizen <janneke@gnu.org>
+ Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include "axis-group-interface.hh"
#include "hara-kiri-vertical-group-spanner.hh"
#include "debug.hh"
-#include "note-head.hh"
-#include "bar.hh"
+#include "item.hh"
-IMPLEMENT_IS_TYPE_B1 (Hara_kiri_vertical_group_spanner, Vertical_group_spanner);
-
-Hara_kiri_vertical_group_spanner::Hara_kiri_vertical_group_spanner()
+Hara_kiri_group_spanner::Hara_kiri_group_spanner(SCM s)
+ : Spanner (s)
{
+ set_elt_pointer ("items-worth-living", SCM_EOL);
}
void
-Hara_kiri_vertical_group_spanner::add_note (Note_head* n)
+Hara_kiri_group_spanner::add_interesting_item (Item* n)
{
add_dependency (n);
- head_l_arr_.push (n);
+ Pointer_group_interface (this, "items-worth-living").add_element (n);
}
void
-Hara_kiri_vertical_group_spanner::do_post_processing ()
+Hara_kiri_group_spanner::after_line_breaking ()
{
- if (!head_l_arr_.empty ())
+ SCM worth = get_elt_pointer ("items-worth-living");
+ if (gh_pair_p (worth))
return;
- Link_array<Score_element> childs = get_children ();
+ Link_array<Score_element> childs = Axis_group_interface (this).get_children ();
for (int i = 0; i < childs.size (); i++)
{
- childs[i]->transparent_b_ = true;
- childs[i]->set_empty (true);
+ Score_element* s = childs[i];
+
+ if ( line_l () != s->line_l ())
+ programming_error ("Killing other children too");
+ s->suicide ();
}
- set_empty (true);
+ set_extent_callback (0, X_AXIS);
+ set_extent_callback (0, Y_AXIS);
}
-void
-Hara_kiri_vertical_group_spanner::do_substitute_dependency (Score_element*o, Score_element*n)
-{
- if (o->is_type_b (Note_head::static_name ()))
- head_l_arr_.substitute ((Note_head*)dynamic_cast <Item *> (o),
- (n)? (Note_head*)dynamic_cast <Item *> (n) : 0);
-}
-void
-Hara_kiri_vertical_group_spanner::do_print () const
-{
- Axis_group_spanner::do_print ();
-}