]> git.donarmstrong.com Git - lilypond.git/blob - lily/grob-info.cc
* lily/include/context.hh (class Context): make members protected.
[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--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "grob.hh"
10 #include "grob-info.hh"
11 #include "music.hh"
12 #include "translator-group.hh"
13 #include "context.hh"
14
15 Grob_info::Grob_info ()
16 {
17   grob_ = 0;
18   origin_trans_ = 0;
19 }
20
21 Music*
22 Grob_info::music_cause ()
23 {
24   SCM cause = grob_->get_property ("cause"); 
25   return unsmob_music (cause);
26 }
27
28 Link_array<Context>
29 Grob_info::origin_contexts (Translator* end) const
30 {
31   Context * t = origin_trans_->get_parent_context ();
32   Link_array<Context> r;
33   do {
34     r.push (t);
35     t = t->get_parent_context ();
36   } while (t && t != end->get_parent_context ());
37   
38   return r;
39 }
40