2 ' separating-line-group-engraver.cc -- implement Separating_line_group_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "separating-group-spanner.hh"
11 #include "separation-item.hh"
12 #include "paper-column.hh"
13 #include "paper-def.hh"
14 #include "engraver.hh"
15 #include "axis-group-interface.hh"
17 class Separating_line_group_engraver
: public Engraver
21 Item
* nobreak_malt_p_
;
22 Spanner
* sep_span_p_
;
24 virtual void acknowledge_grob (Grob_info
);
25 virtual void initialize ();
26 virtual void finalize ();
27 virtual void stop_translation_timestep ();
29 Separating_line_group_engraver ();
30 VIRTUAL_COPY_CONS (Translator
);
33 Separating_line_group_engraver::Separating_line_group_engraver ()
41 Separating_line_group_engraver::initialize ()
43 sep_span_p_
= new Spanner (get_property ("SeparatingGroupSpanner"));
45 announce_grob (sep_span_p_
, 0);
46 sep_span_p_
->set_bound (LEFT
, unsmob_grob (get_property ("currentCommandColumn")));
50 Separating_line_group_engraver::finalize ()
52 sep_span_p_
->set_bound (RIGHT
, unsmob_grob (get_property ("currentCommandColumn")));
53 typeset_grob (sep_span_p_
);
58 Separating_line_group_engraver::acknowledge_grob (Grob_info i
)
60 Item
* it
= dynamic_cast <Item
*> (i
.elem_l_
);
63 if (it
->parent_l (X_AXIS
)
64 && it
->parent_l (X_AXIS
)->has_extent_callback_b
65 (Axis_group_interface::group_extent_callback_proc
, X_AXIS
))
69 bool ib
=Item::breakable_b (it
);
70 Item
*&p_ref_ (ib
? break_malt_p_
76 (get_property ("SeparationItem"));
79 p_ref_
->set_grob_property ("breakable", SCM_BOOL_T
);
80 announce_grob (p_ref_
, 0);
82 Separation_item::add_item (p_ref_
,it
);
86 Separating_line_group_engraver::stop_translation_timestep ()
90 Separating_group_spanner::add_spacing_unit (sep_span_p_
, break_malt_p_
);
92 typeset_grob (break_malt_p_
);
97 Separating_group_spanner::add_spacing_unit (sep_span_p_
, nobreak_malt_p_
);
98 typeset_grob (nobreak_malt_p_
);
105 ADD_THIS_TRANSLATOR (Separating_line_group_engraver
);