]> git.donarmstrong.com Git - lilypond.git/blob - lily/grob-info.cc
* flower
[lilypond.git] / lily / grob-info.cc
1 /*
2   grob-info.cc -- implement Grob_info
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "grob-info.hh"
10
11 #include "grob.hh"
12 #include "music.hh"
13 #include "translator-group.hh"
14 #include "context.hh"
15
16 Grob_info::Grob_info ()
17 {
18   grob_ = 0;
19   origin_trans_ = 0;
20 }
21
22 Music *
23 Grob_info::music_cause ()
24 {
25   SCM cause = grob_->get_property ("cause");
26   return unsmob_music (cause);
27 }
28
29 Link_array<Context>
30 Grob_info::origin_contexts (Translator *end) const
31 {
32   Context *t = origin_trans_->context ();
33   Link_array<Context> r;
34   do
35     {
36       r.push (t);
37       t = t->get_parent_context ();
38     }
39   while (t && t != end->context ());
40
41   return r;
42 }
43