]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/type-swallow-translator.hh
Run `make grand-replace'.
[lilypond.git] / lily / include / type-swallow-translator.hh
1 /*
2   type-swallow-translator.hh -- declare Type_swallow_translator
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef TYPESWALLOW_TRANSLATOR_HH
10 #define TYPESWALLOW_TRANSLATOR_HH
11
12 #include "translator.hh"
13
14 /** eat a certain type of event
15     (Duh, it's good for your skin)
16 */
17 class Type_swallow_translator : public Translator
18 {
19 protected:
20   string swallow_string_;
21   bool try_music (Music *);
22 public:
23   VIRTUAL_COPY_CONS (Translator);
24 };
25
26 #define DECLARE_EVENT_SWALLOWER(TYPE)                                   \
27   struct TYPE ## _swallow_translator : public Type_swallow_translator   \
28   {                                                                     \
29     TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator);              \
30   };                                                                    \
31   TYPE ## _swallow_translator ::TYPE ## _swallow_translator ()          \
32   {                                                                     \
33     swallow_string_ = #TYPE;                                            \
34   }                                                                     \
35   ADD_TRANSLATOR (TYPE ## _swallow_translator,                          \
36                   "Swallow events of " #TYPE " type.",                  \
37                   "",                                                   \
38                   "general-music",                                      \
39                   "",                                                   \
40                   "",                                                   \
41                   "");
42
43 #endif // TYPESWALLOW_TRANSLATOR_HH
44