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>
14 #include "global-ctor.hh"
16 #include "lily-proto.hh"
17 #include "virtual-methods.hh"
18 #include "lily-guile.hh"
19 #include "dictionary.hh"
24 /** Make some kind of #Element#s from Requests. Elements are made by
25 hierarchically grouped #Translator#s
27 class Translator : public Input {
29 Music_output_def * output_def_l_;
32 virtual const char *name() const;
33 bool is_alias_b (String) const;
35 VIRTUAL_COPY_CONS(Translator);
36 Translator (Translator const &);
38 virtual ~Translator ();
40 Translator_group * daddy_trans_l_ ;
45 try to fit the request in this engraver
48 false: not noted, not taken.
50 true: request swallowed. Don't try to put the request elsewhere.
53 bool try_music (Music*);
54 void pre_move_processing();
55 void add_processing ();
56 void creation_processing ();
57 void process_requests();
58 void post_move_processing();
59 void removal_processing();
61 ask daddy for a feature
63 Music_output_def *output_def_l () const;
65 SCM get_property (String, Translator_group **) const;
66 SCM get_property (SCM symbol, Translator_group **) const;
68 virtual Moment now_mom () const;
87 Default: always return false
89 virtual void do_add_processing ();
90 virtual bool do_try_music (Music *req_l);
91 virtual void do_print () const;
92 virtual void do_pre_move_processing();
93 virtual void do_post_move_processing();
94 virtual void do_process_requests () ;
95 virtual void do_creation_processing() ;
96 virtual void do_removal_processing();
101 A macro to automate administration of translators.
103 #define ADD_THIS_TRANSLATOR(T) \
104 static void _ ## T ## _adder () {\
106 t->type_str_ = classname (t);\
109 ADD_GLOBAL_CTOR(_ ## T ## _adder);
113 extern Dictionary<Translator*> *global_translator_dict_p;
114 void add_translator (Translator*trans_p);
116 Translator*get_translator_l (String s);
118 #endif // TRANSLATOR_HH