2 type-swallow-translator.hh -- declare Type_swallow_translator
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #ifndef TYPESWALLOW_TRANSLATOR_HH
10 #define TYPESWALLOW_TRANSLATOR_HH
12 #include "translator.hh"
14 /** eat a certain type of event
15 (Duh, it's good for your skin)
17 class Type_swallow_translator : public Translator
20 string swallow_string_;
21 bool try_music (Music *);
23 VIRTUAL_COPY_CONS (Translator);
26 #define DECLARE_EVENT_SWALLOWER(TYPE) \
27 struct TYPE ## _swallow_translator : public Type_swallow_translator \
29 TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator); \
31 TYPE ## _swallow_translator ::TYPE ## _swallow_translator () \
33 swallow_string_ = #TYPE; \
35 ADD_TRANSLATOR (TYPE ## _swallow_translator, \
36 "Swallow events of " #TYPE " type.", \
43 #endif // TYPESWALLOW_TRANSLATOR_HH