]> git.donarmstrong.com Git - lilypond.git/blob - lily/grob-info.cc
* input/regression/alignment-order.ly: new file.
[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--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "grob-info.hh"
10 #include "grob.hh"
11 #include "music.hh"
12 #include "translator-group.hh"
13 #include "context.hh"
14
15
16 Grob_info::Grob_info (Translator *t, Grob *g)
17 {
18   origin_trans_ = t;
19   grob_ = g;
20 }
21
22 Grob_info::Grob_info ()
23 {
24   grob_ = 0;
25   origin_trans_ = 0;
26 }
27
28 Music *
29 Grob_info::music_cause ()
30 {
31   SCM cause = grob_->get_property ("cause");
32   return unsmob_music (cause);
33 }
34
35 Link_array<Context>
36 Grob_info::origin_contexts (Translator *end) const
37 {
38   Context *t = origin_trans_->context ();
39   Link_array<Context> r;
40   do
41     {
42       r.push (t);
43       t = t->get_parent_context ();
44     }
45   while (t && t != end->context ());
46
47   return r;
48 }
49
50
51 Context*
52 Grob_info::context () const
53 {
54   return origin_trans_->context ();
55 }
56