2 translator.hh -- declare Translator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "global-ctor.hh"
14 #include "lily-proto.hh"
15 #include "virtual-methods.hh"
16 #include "property-inspect.hh"
17 #include "dictionary.hh"
22 /** Make some kind of #Element#s from Requests. Elements are made by
23 hierarchically grouped #Translator#s
25 class Translator : public Input {
27 Music_output_def * output_def_l_;
30 virtual const char *name() const;
31 bool is_alias_b (String) const;
33 VIRTUAL_COPY_CONS(Translator);
34 Translator (Translator const &);
36 virtual ~Translator ();
38 Translator_group * daddy_trans_l_ ;
43 try to fit the request in this engraver
46 false: not noted, not taken.
48 true: request swallowed. Don't try to put the request elsewhere.
51 bool try_music (Music*);
52 void pre_move_processing();
53 void add_processing ();
54 void creation_processing ();
55 void process_requests();
56 void post_move_processing();
57 void removal_processing();
59 ask daddy for a feature
61 Music_output_def *output_def_l () const;
62 SCM get_property (String, Translator_group **) const;
63 virtual Moment now_mom () const;
79 Default: always return false
81 virtual void do_add_processing ();
82 virtual bool do_try_music (Music *req_l);
83 virtual void do_print () const;
84 virtual void do_pre_move_processing();
85 virtual void do_post_move_processing();
86 virtual void do_process_requests () ;
87 virtual void do_creation_processing() ;
88 virtual void do_removal_processing();
93 A macro to automate administration of translators.
95 #define ADD_THIS_TRANSLATOR(T) \
96 static void _ ## T ## _adder () {\
98 t->type_str_ = classname (t);\
101 ADD_GLOBAL_CTOR(_ ## T ## _adder);
105 extern Dictionary<Translator*> *global_translator_dict_p;
106 void add_translator (Translator*trans_p);
108 Translator*get_translator_l (String s);
110 #endif // TRANSLATOR_HH