]> git.donarmstrong.com Git - lilypond.git/blob - lily/chord-name.cc
50c5c43a76c2a48931ea7d5081f9d3815679f25f
[lilypond.git] / lily / chord-name.cc
1 /*
2   chord-name.cc -- implement Chord_name
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1999--2004 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "chord-name.hh"
10 #include "molecule.hh"
11 #include "paper-def.hh"
12 #include "font-interface.hh"
13 #include "grob.hh"
14 #include "paper-column.hh"
15 #include "system.hh"
16 #include "staff-symbol-referencer.hh"
17 #include "text-item.hh"
18
19 MAKE_SCHEME_CALLBACK (Chord_name,after_line_breaking,1);
20 SCM
21 Chord_name::after_line_breaking (SCM smob)
22 {
23   Item* me = unsmob_item (smob);
24   assert (me);
25     
26   SCM s = me->get_grob_property ("begin-of-line-visible");
27   if (to_boolean (s))
28     {
29       if (Paper_column::get_rank (me->get_column ()) -
30           me->get_system ()->spanned_rank_iv ()[LEFT] > 1)
31         me->suicide ();
32     }
33   return SCM_UNSPECIFIED;
34 }
35
36
37 ADD_INTERFACE (Chord_name, "chord-name-interface",
38   "generate a chord name",
39   "begin-of-line-visible");
40