]> git.donarmstrong.com Git - lilypond.git/blob - lily/dot-column-engraver.cc
* configure.in: Test for and accept lmodern if EC fonts not found.
[lilypond.git] / lily / dot-column-engraver.cc
1 /*   
2   dot-column-engraver.cc -- implement Dot_column_engraver
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include "rhythmic-head.hh"
11 #include "dot-column.hh"
12 #include "side-position-interface.hh"
13 #include "engraver.hh"
14 #include "stem.hh"
15
16 class Dot_column_engraver : public Engraver
17 {
18   Grob *dotcol_ ;
19   Grob * stem_;
20   Link_array<Item> heads_;
21 public:
22   TRANSLATOR_DECLARATIONS (Dot_column_engraver );
23   
24 protected:
25   virtual void acknowledge_grob (Grob_info);
26   virtual void stop_translation_timestep ();  
27 };
28
29
30 Dot_column_engraver::Dot_column_engraver ()
31 {
32   dotcol_ = 0;
33   stem_ = 0;
34 }
35
36 void
37 Dot_column_engraver::stop_translation_timestep ()
38 {
39   /*
40     Add the stem to the support so dots stay clear of flags.
41
42     See [Ross, p 171]
43   */
44   if (stem_ && dotcol_)
45     dotcol_->set_property ("stem", stem_->self_scm ());
46       
47   dotcol_ =0;
48   heads_.clear ();
49   stem_ =0;
50 }
51
52 void
53 Dot_column_engraver::acknowledge_grob (Grob_info info)
54 {
55   Grob *d = unsmob_grob (info.grob_->get_property ("dot"));
56   if (d)
57     {
58       if (!dotcol_)
59         {
60           dotcol_ = make_item ("DotColumn", SCM_EOL);
61           
62         }
63
64       Dot_column::add_head (dotcol_, info.grob_);
65     }
66   else if (Stem::has_interface (info.grob_))
67     {
68       stem_ = info.grob_;
69     }
70 }
71
72
73
74
75 ENTER_DESCRIPTION (Dot_column_engraver,
76 /* descr */       "Engraves dots on dotted notes shifted to the right of the note.\n"
77 "If omitted, then dots appear on top of the notes.",
78 /* creats*/       "DotColumn",
79 /* accepts */     "",
80 /* acks  */      "rhythmic-head-interface dot-column-interface stem-interface",
81 /* reads */       "",
82 /* write */       "");