2 grob-info.cc -- implement Grob_info
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
10 #include "grob-info.hh"
14 #include "stream-event.hh"
15 #include "translator-group.hh"
17 Grob_info::Grob_info (Translator
*t
, Grob
*g
)
24 assert here, because this is easier to debug.
29 Grob_info::Grob_info ()
37 Grob_info::event_cause () const
39 SCM cause
= grob_
->get_property ("cause");
40 return unsmob_stream_event (cause
);
44 Grob_info::origin_contexts (Translator
*end
) const
46 Context
*t
= origin_trans_
->context ();
51 t
= t
->get_parent_context ();
53 while (t
&& t
!= end
->context ());
59 Grob_info::context () const
61 return origin_trans_
->context ();
65 Grob_info::spanner () const
67 return dynamic_cast<Spanner
*> (grob_
);
71 Grob_info::item () const
73 return dynamic_cast<Item
*> (grob_
);
77 Grob_info::ultimate_event_cause () const
79 SCM cause
= grob_
->self_scm ();
80 while (unsmob_grob (cause
))
82 cause
= unsmob_grob (cause
)->get_property ("cause");
84 return unsmob_stream_event (cause
);