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>
10 #include "grob-info.hh"
15 #include "stream-event.hh"
16 #include "translator-group.hh"
18 Grob_info::Grob_info (Translator *t, Grob *g)
25 Grob_info::Grob_info ()
33 Grob_info::event_cause () const
35 SCM cause = grob_->get_property ("cause");
36 return unsmob_stream_event (cause);
40 Grob_info::origin_contexts (Translator *end) const
42 Context *t = origin_trans_->context ();
47 t = t->get_parent_context ();
49 while (t && t != end->context ());
55 Grob_info::context () const
57 return origin_trans_->context ();
61 Grob_info::spanner () const
63 return dynamic_cast<Spanner *> (grob_);
67 Grob_info::item () const
69 return dynamic_cast<Item *> (grob_);
73 Grob_info::ultimate_event_cause () const
75 SCM cause = grob_->self_scm ();
76 while (unsmob_grob (cause))
78 cause = unsmob_grob (cause)->get_property ("cause");
80 return unsmob_stream_event (cause);