2 translator.hh -- declare Translator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 #include "global-ctor.hh"
15 #include "lily-proto.hh"
16 #include "virtual-methods.hh"
17 #include "lily-guile.hh"
22 /** Make some kind of #Element#s from Requests. Elements are made by
23 hierarchically grouped #Translator#s
25 class Translator : public Input {
28 Music_output_def * output_def_l_;
31 virtual const char *name() const;
32 bool is_alias_b (String) const;
34 VIRTUAL_COPY_CONS(Translator);
35 Translator (Translator const &);
38 Translator_group * daddy_trans_l_ ;
41 void pre_move_processing();
42 void add_processing ();
44 void post_move_processing();
45 void removal_processing();
47 ask daddy for a feature
49 Music_output_def *output_def_l () const;
51 SCM get_property (const char *) const;
52 SCM get_property (SCM symbol) const;
54 virtual Moment now_mom () const;
57 ugh: bubbled up from Translator_group.
59 SCM simple_trans_list_;
60 SCM trans_group_list_;
64 DECLARE_SMOBS(Translator, dummy);
67 virtual void do_add_processing ();
69 try to fit the request in this engraver
72 false: not noted, not taken.
74 true: request swallowed. Don't try to put the request elsewhere.
77 virtual bool try_music (Music *req_l);
78 virtual void stop_translation_timestep();
79 virtual void start_translation_timestep();
80 virtual void do_announces () ;
81 virtual void do_creation_processing() ;
82 virtual void do_removal_processing();
87 A macro to automate administration of translators.
89 #define ADD_THIS_TRANSLATOR(T) \
90 static void _ ## T ## _adder () {\
92 t->type_str_ = classname (t);\
95 ADD_GLOBAL_CTOR(_ ## T ## _adder);
99 extern Dictionary<Translator*> *global_translator_dict_p;
100 void add_translator (Translator*trans_p);
102 Translator*get_translator_l (String s);
103 Translator *unsmob_translator (SCM);
104 #endif // TRANSLATOR_HH