X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fgroup-interface.hh;h=9c93ebfc566dc59cc5850dd58fba1e09e5a7ab97;hb=a6bd229f7fe1dc4a03478e14ccc0c0c66b225061;hp=72bc892258ac1aa104e9ee398352dcb0a94727cf;hpb=ee513a2f7d18fc8d43e1c291350ed81856b0192d;p=lilypond.git diff --git a/lily/include/group-interface.hh b/lily/include/group-interface.hh index 72bc892258..9c93ebfc56 100644 --- a/lily/include/group-interface.hh +++ b/lily/include/group-interface.hh @@ -1,23 +1,30 @@ -/* - group-interface.hh -- declare Group_interface - - source file of the GNU LilyPond music typesetter - - (c) 1999--2000 Han-Wen Nienhuys - - */ +/* + This file is part of LilyPond, the GNU music typesetter. + + Copyright (C) 1999--2010 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 GROUP_INTERFACE_HH #define GROUP_INTERFACE_HH -#include "lily-proto.hh" -#include "string.hh" -#include "lily-guile.hh" -#include "smobs.hh" - +#include "grob.hh" +#include "std-string.hh" /** Look at Score element ELT as thing which has a list property called - NAME_. Normally the list would contain Score_elements, but + NAME_. Normally the list would contain Grobs, but sometimes it can be different things. todo: reename as list_interface? @@ -25,44 +32,10 @@ struct Group_interface { - Score_element * elt_l_; - String name_; public: - Group_interface (Score_element const*); - Group_interface (Score_element const*, String); - int count (); - void add_thing (SCM); - bool has_interface_b (); - void set_interface (); - void add_element (Score_element*); + static int count (Grob *, SCM); + static void add_thing (Grob *, SCM, SCM); }; -Group_interface group (Score_element*); -Group_interface group (Score_element*, String); - -/** - Put all score elements of ELT's property called NAME into an array, - and return it. */ -template -Link_array -Group_interface__extract_elements (Score_element const *elt, T *, String name) -{ - Link_array arr; - - for (SCM s = elt->get_elt_property (name); gh_pair_p (s); s = gh_cdr (s)) - { - SCM e = gh_car (s); - assert (SMOB_IS_TYPE_B(Score_element,e)); - Score_element* se = SMOB_TO_TYPE(Score_element, e); - arr.push (dynamic_cast (se)); - } - - arr.reverse (); - return arr; -} - - - - #endif /* GROUP_INTERFACE_HH */