]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/global-performers.hh
0ed76e4c54bf6aff98041f586545fd49a3c8f57e
[lilypond.git] / lily / include / global-performers.hh
1
2 /*
3   global-performers.hh -- declare global performer stuff
4
5   source file of the GNU LilyPond music typesetter
6
7   (c) 1996, 1997 Han-Wen Nienhuys <hanwen@stack.nl>
8                  Jan Nieuwenhuizen <jan@digicash.com>
9 */
10
11 #ifndef GLOBAL_PERFORMER_HH
12 #define GLOBAL_PERFORMER_HH
13
14 /**
15   A macro to automate administration of performers
16  */
17 #define ADD_THIS_PERFORMER( c) \
18 struct c ## init { \
19     static Performer* globalctor() \
20     { \
21         return new c;\
22     } \
23     c ## init() \
24     { \
25         add_Performer (c::static_name(), globalctor); \
26     } \
27 } _ ## c ## init;
28
29 // typedef Performer*(*Perf_ctor)(void); c++ ?
30 typedef Performer*(*Perf_ctor)();
31 void add_Performer (String s, Perf_ctor f);
32
33 #endif // GLOBAL_PERFORMER_HH