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"
18 #include "dictionary.hh"
23 /** Make some kind of #Element#s from Requests. Elements are made by
24 hierarchically grouped #Translator#s
26 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 &);
37 virtual ~Translator ();
39 Translator_group * daddy_trans_l_ ;
44 try to fit the request in this engraver
47 false: not noted, not taken.
49 true: request swallowed. Don't try to put the request elsewhere.
52 bool try_music (Music*);
53 void pre_move_processing();
54 void add_processing ();
55 void creation_processing ();
56 void process_requests();
57 void post_move_processing();
58 void removal_processing();
60 ask daddy for a feature
62 Music_output_def *output_def_l () const;
64 SCM get_property (String, Translator_group **) const;
65 SCM get_property (SCM symbol, Translator_group **) const;
67 virtual Moment now_mom () const;
86 Default: always return false
88 virtual void do_add_processing ();
89 virtual bool do_try_music (Music *req_l);
90 virtual void do_print () const;
91 virtual void do_pre_move_processing();
92 virtual void do_post_move_processing();
93 virtual void do_process_requests () ;
94 virtual void do_creation_processing() ;
95 virtual void do_removal_processing();
100 A macro to automate administration of translators.
102 #define ADD_THIS_TRANSLATOR(T) \
103 static void _ ## T ## _adder () {\
105 t->type_str_ = classname (t);\
108 ADD_GLOBAL_CTOR(_ ## T ## _adder);
112 extern Dictionary<Translator*> *global_translator_dict_p;
113 void add_translator (Translator*trans_p);
115 Translator*get_translator_l (String s);
117 #endif // TRANSLATOR_HH