2 translator.cc -- implement Translator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "translator.hh"
12 #include "translator-group.hh"
15 #include "ly-smobs.icc"
18 Translator::name() const
20 return classname(this);
23 Translator::~Translator ()
30 simple_trans_list_
= SCM_EOL
;
31 trans_group_list_
= SCM_EOL
;
32 properties_scm_
= SCM_EOL
;
33 definition_
= SCM_EOL
;
37 Translator::Translator ()
45 Translator::Translator (Translator
const &s
)
49 output_def_l_
= s
.output_def_l_
;
50 type_str_
= s
.type_str_
;
56 Translator::is_alias_b (String s
) const
58 return s
== type_str_
;
62 Translator::try_music (Music
*)
69 Translator::now_mom () const
71 return daddy_trans_l_
->now_mom ();
79 Translator::post_move_processing ()
81 start_translation_timestep ();
85 Translator::removal_processing ()
92 Translator::announces ()
99 Translator::pre_move_processing ()
101 stop_translation_timestep ();
107 Translator::output_def_l () const
109 return output_def_l_
;
113 Translator::get_property (char const * id
) const
115 return daddy_trans_l_
->get_property (ly_symbol2scm (id
));
119 Translator::get_property (SCM sym
) const
121 return daddy_trans_l_
->get_property (sym
);
125 Translator:: stop_translation_timestep ()
130 Translator::start_translation_timestep ()
135 Translator::do_announces ()
140 Translator::initialize ()
145 Translator::finalize ()
156 Translator::mark_smob (SCM sm
)
158 Translator
* me
= (Translator
*) SCM_CELL_WORD_1(sm
);
159 scm_gc_mark (me
->simple_trans_list_
);
160 scm_gc_mark (me
->trans_group_list_
);
161 scm_gc_mark (me
->definition_
);
162 scm_gc_mark (me
->properties_scm_
);
164 return me
->properties_scm_
;
169 Translator::print_smob (SCM s
, SCM port
, scm_print_state
*)
171 Translator
*sc
= (Translator
*) gh_cdr (s
);
173 scm_puts ("#<Translator ", port
);
174 scm_puts ((char *)sc
->name (), port
);
175 scm_display (sc
->simple_trans_list_
, port
);
177 don't try to print properties, that is too much hassle.
179 scm_puts (" >", port
);
188 IMPLEMENT_UNSMOB(Translator
, translator
);
189 IMPLEMENT_SMOBS(Translator
);
190 IMPLEMENT_DEFAULT_EQUAL_P(Translator
);