2 translator.hh -- declare Translator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 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 ();
43 void post_move_processing ();
44 void removal_processing ();
46 ask daddy for a feature
48 Music_output_def *output_def_l () const;
50 SCM get_property (const char *) const;
51 SCM get_property (SCM symbol) const;
53 virtual Moment now_mom () const;
56 ugh: bubbled up from Translator_group.
58 SCM simple_trans_list_;
59 SCM trans_group_list_;
63 DECLARE_SMOBS (Translator, dummy);
67 try to fit the request in this engraver
70 false: not noted, not taken.
72 true: request swallowed. Don't try to put the request elsewhere.
75 virtual bool try_music (Music *req_l);
76 virtual void stop_translation_timestep ();
77 virtual void start_translation_timestep ();
78 virtual void do_announces () ;
79 virtual void initialize () ;
80 virtual void finalize ();
85 A macro to automate administration of translators.
87 #define ADD_THIS_TRANSLATOR(T) \
88 static void _ ## T ## _adder () {\
90 t->type_str_ = classname (t);\
93 ADD_GLOBAL_CTOR (_ ## T ## _adder);
97 extern Dictionary<Translator*> *global_translator_dict_p;
98 void add_translator (Translator*trans_p);
100 Translator*get_translator_l (String s);
101 Translator *unsmob_translator (SCM);
102 #endif // TRANSLATOR_HH