]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/type-swallow-translator.hh
release: 1.3.19
[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--2000 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 request.
16     (Duh, it's good for your skin)
17  */
18 class Type_swallow_translator : public virtual Translator
19 {
20 protected:
21   String swallow_str_;
22   bool do_try_music (Music*);
23 public:  
24   VIRTUAL_COPY_CONS(Translator);
25 };
26
27 #define DECLARE_REQUEST_SWALLOWER(TYPE)  \
28 struct TYPE ## _swallow_translator : public Type_swallow_translator {\
29   TYPE ## _swallow_translator() { \
30       swallow_str_ =  #TYPE;\
31   }\
32   \
33   VIRTUAL_COPY_CONS(Translator);\
34 };\
35 ADD_THIS_TRANSLATOR(TYPE ## _swallow_translator);\
36
37 #endif // TYPESWALLOW_GRAV_HH
38