2 grob-info.cc -- implement Grob_info
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "grob-info.hh"
12 #include "translator-group.hh"
17 Grob_info::Grob_info (Translator *t, Grob *g)
23 Grob_info::Grob_info ()
30 Grob_info::music_cause () const
32 SCM cause = grob_->get_property ("cause");
33 return unsmob_music (cause);
37 Grob_info::origin_contexts (Translator *end) const
39 Context *t = origin_trans_->context ();
44 t = t->get_parent_context ();
46 while (t && t != end->context ());
52 Grob_info::context () const
54 return origin_trans_->context ();
58 Grob_info::spanner () const
60 return dynamic_cast<Spanner *> (grob_);
64 Grob_info::item () const
66 return dynamic_cast<Item *> (grob_);
70 Grob_info::ultimate_music_cause () const
72 SCM cause = grob_->self_scm ();
73 while (unsmob_grob (cause))
75 cause = unsmob_grob (cause)->get_property ("cause");
78 return unsmob_music (cause);