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