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_ ;
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 ();
56 void post_move_processing();
57 void removal_processing();
59 ask daddy for a feature
61 Music_output_def *output_def_l () const;
63 SCM get_property (const char *) const;
64 SCM get_property (SCM symbol) const;
66 virtual Moment now_mom () const;
69 ugh: bubbled up from Translator_group.
71 SCM simple_trans_list_;
72 SCM trans_group_list_;
76 DECLARE_SMOBS(Translator, dummy);
95 Default: always return false
97 virtual void do_add_processing ();
98 virtual bool do_try_music (Music *req_l);
99 virtual void do_print () const;
100 virtual void do_pre_move_processing();
101 virtual void do_post_move_processing();
102 virtual void do_process_music () ;
103 virtual void do_creation_processing() ;
104 virtual void do_removal_processing();
109 A macro to automate administration of translators.
111 #define ADD_THIS_TRANSLATOR(T) \
112 static void _ ## T ## _adder () {\
114 t->type_str_ = classname (t);\
117 ADD_GLOBAL_CTOR(_ ## T ## _adder);
121 extern Dictionary<Translator*> *global_translator_dict_p;
122 void add_translator (Translator*trans_p);
124 Translator*get_translator_l (String s);
125 Translator *unsmob_translator (SCM);
126 #endif // TRANSLATOR_HH