]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/music-constructor.hh
b646b2b6bb10375b0440d10ed3f4616f2535ea14
[lilypond.git] / lily / include / music-constructor.hh
1 /*   
2   music-constructor.hh -- declare Music_constructor
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #ifndef MUSIC_CONSTRUCTOR_HH
11 #define MUSIC_CONSTRUCTOR_HH
12
13 #include "lily-guile.hh"
14 #include "lily-proto.hh"
15 #include "string.hh"
16 #include "global-ctor.hh"
17
18 #define ADD_MUSIC(type) \
19 Music * _ ## type ## _ctor (SCM init)\
20 {\
21   return new type (init);\
22 }\
23 static void  _ ## type ## _adder () {\
24       add_music_ctor (#type, & _ ## type ## _ctor);\
25 }\
26 ADD_SCM_INIT_FUNC( _ ## type ## _adder_prefix,  _ ## type ## _adder);
27
28 typedef Music *(*Music_ctor) (SCM);
29 void add_music_ctor (String, Music_ctor);
30 Music*make_music (String, SCM);
31
32
33
34
35
36 #endif /* MUSIC_CONSTRUCTOR_HH */
37