]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/grob-interface.hh
57ee505717e3cfe6330db9abc00dd1cafb0c11ce
[lilypond.git] / lily / include / grob-interface.hh
1 /*
2   interface.hh -- declare Interface
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2002--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
8
9 #ifndef INTERFACE_HH
10 #define INTERFACE_HH
11
12 #include "lily-guile.hh"
13
14 #define DECLARE_GROB_INTERFACE() \
15   static SCM interface_symbol_;    \
16   static bool has_interface (Grob*)
17
18 #define ADD_INTERFACE(cl, b, c)                         \
19   SCM cl::interface_symbol_; \
20   bool cl::has_interface (Grob *me)                             \
21   {                                                             \
22     return me->internal_has_interface (interface_symbol_);      \
23   }                                                             \
24   void cl ## _init_ifaces ()                                    \
25   {                                                             \
26     cl::interface_symbol_ = add_interface (#cl, b, c);          \
27   }                                                             \
28   ADD_SCM_INIT_FUNC (cl ## ifaces, cl ## _init_ifaces);
29
30 SCM add_interface (char const *cxx_name,
31                     char const *descr,
32                     char const *vars);
33
34 SCM ly_add_interface (SCM, SCM, SCM);
35 void internal_add_interface (SCM, SCM, SCM);
36 SCM ly_all_grob_interfaces ();
37
38 #endif /* INTERFACE_HH */
39