2 system-start-delimiter-engraver.cc -- implement System_start_delimiter_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "system-start-delimiter.hh"
10 #include "engraver.hh"
11 #include "staff-symbol.hh"
12 #include "pointer-group-interface.hh"
13 #include "paper-column.hh"
14 #include "output-def.hh"
17 class System_start_delimiter_engraver : public Engraver
20 TRANSLATOR_DECLARATIONS (System_start_delimiter_engraver);
24 DECLARE_ACKNOWLEDGER (system_start_delimiter);
25 DECLARE_ACKNOWLEDGER (staff_symbol);
27 void process_music ();
28 virtual void finalize ();
32 System_start_delimiter_engraver::acknowledge_staff_symbol (Grob_info inf)
35 don't add as Axis_group_interface::add_element (delim_, ),
36 because that would set the parent as well */
38 Pointer_group_interface::add_grob (delim_, ly_symbol2scm ("elements"), inf.grob ());
41 System_start_delimiter_engraver::acknowledge_system_start_delimiter (Grob_info inf)
43 SCM gl = inf.grob ()->get_property ("glyph");
44 SCM my_gl = delim_->get_property ("glyph");
49 if (scm_is_string (gl) && ly_is_equal (gl, scm_makfrom0str ("brace"))
50 && scm_is_string (my_gl) && ly_is_equal (my_gl, scm_makfrom0str ("bracket")))
51 inf.grob ()->translate_axis (-0.8, X_AXIS); // ugh
52 else if (scm_is_string (gl) && ly_is_equal (gl, scm_makfrom0str ("bracket"))
53 && scm_is_string (my_gl) && ly_is_equal (my_gl, scm_makfrom0str ("bracket")))
55 inf.grob ()->translate_axis (-0.8, X_AXIS); // ugh
59 System_start_delimiter_engraver::System_start_delimiter_engraver ()
65 System_start_delimiter_engraver::process_music ()
69 SCM delim_name = get_property ("systemStartDelimiter");
70 delim_ = make_spanner_from_properties (this, delim_name, SCM_EOL,
71 ly_symbol2string (delim_name).to_str0 ());
73 delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
77 System_start_delimiter_engraver::finalize ()
80 delim_->set_bound (RIGHT, unsmob_grob (get_property ("currentCommandColumn")));
83 #include "translator.icc"
85 ADD_ACKNOWLEDGER (System_start_delimiter_engraver, system_start_delimiter);
86 ADD_ACKNOWLEDGER (System_start_delimiter_engraver, staff_symbol);
88 ADD_TRANSLATOR (System_start_delimiter_engraver,
89 /* doc */ "Creates a system start delimiter (ie. SystemStart@{Bar, Brace, Bracket@} spanner",
90 /* create */ "SystemStartBar SystemStartBrace SystemStartBracket",
92 /* read */ "systemStartDelimiter",