]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/type-swallow-translator.hh
release: 1.5.29
[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--2002 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 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   TRANSLATOR_DECLARATIONS (TYPE ## _swallow_translator);  \
30 };                                                                      \
31   TYPE ## _swallow_translator :: TYPE ## _swallow_translator() {\
32       swallow_str_ =  #TYPE;                                            \
33   }                                                                     \
34 ENTER_DESCRIPTION(TYPE ## _swallow_translator,                          \
35                   "Swallow requests of " #TYPE " type.",                \
36                   "",                                                   \
37                   "",                                                   \
38                   "",                                                   \
39                   "");
40
41 #endif // TYPESWALLOW_GRAV_HH
42