*** empty log message ***
[lilypond.git] / lily / grob-info.cc
blob6b69bfeab63949037d0428a36601748927d02a28
1 /*
2 grob-info.cc -- implement Grob_info
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "grob-info.hh"
10 #include "grob.hh"
11 #include "music.hh"
12 #include "translator-group.hh"
13 #include "context.hh"
16 Grob_info::Grob_info (Translator *t, Grob *g)
18 origin_trans_ = t;
19 grob_ = g;
22 Grob_info::Grob_info ()
24 grob_ = 0;
25 origin_trans_ = 0;
28 Music *
29 Grob_info::music_cause ()
31 SCM cause = grob_->get_property ("cause");
32 return unsmob_music (cause);
35 Link_array<Context>
36 Grob_info::origin_contexts (Translator *end) const
38 Context *t = origin_trans_->context ();
39 Link_array<Context> r;
42 r.push (t);
43 t = t->get_parent_context ();
45 while (t && t != end->context ());
47 return r;
51 Context*
52 Grob_info::context () const
54 return origin_trans_->context ();