X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fgrob-interface.hh;h=210226094503bf70fa2386e73540ff9d56496f61;hb=f93e4199873c91ae32f0e84a610d14853dc379df;hp=d764ae4e6eb71bc32b6f7a92625ebf767c18ceb1;hpb=6c00542bf11cd4759b2e39537aeb3d9a533a3519;p=lilypond.git diff --git a/lily/include/grob-interface.hh b/lily/include/grob-interface.hh index d764ae4e6e..2102260945 100644 --- a/lily/include/grob-interface.hh +++ b/lily/include/grob-interface.hh @@ -1,37 +1,50 @@ -/* - interface.hh -- declare Interface +/* + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2002--2011 Han-Wen Nienhuys - (c) 2002--2004 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - */ + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . +*/ #ifndef INTERFACE_HH #define INTERFACE_HH -#include /* SCM */ - - - -#define ADD_INTERFACE(cl,a,b,c) \ -bool cl::has_interface(Grob*me)\ -{\ - return me->internal_has_interface (ly_symbol2scm (a));\ -}\ -void cl ## _init_ifaces() {\ - add_interface(a,b,c);\ -}\ -ADD_SCM_INIT_FUNC(cl ## ifaces, cl ## _init_ifaces);\ - - - -void add_interface (const char * symbol, - const char * descr, - const char * vars); - -SCM ly_add_interface (SCM, SCM, SCM); -SCM ly_all_grob_interfaces(); +#include "lily-guile.hh" + +#define DECLARE_GROB_INTERFACE() \ + static SCM interface_symbol_; \ + static bool has_interface (Grob*) + +#define ADD_INTERFACE(cl, b, c) \ + SCM cl::interface_symbol_; \ + bool cl::has_interface (Grob *me) \ + { \ + return me->internal_has_interface (interface_symbol_); \ + } \ + void cl ## _init_ifaces () \ + { \ + cl::interface_symbol_ = add_interface (#cl, b, c); \ + } \ + ADD_SCM_INIT_FUNC (cl ## ifaces, cl ## _init_ifaces); + +SCM add_interface (char const *cxx_name, + char const *descr, + char const *vars); + +SCM ly_add_interface (SCM, SCM, SCM); +void internal_add_interface (SCM, SCM, SCM); +SCM ly_all_grob_interfaces (); #endif /* INTERFACE_HH */