X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finclude%2Fgroup-interface.hh;h=2a94f0783adc9f7f1825f1eece178f8ed2f80ab3;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=289ba913ba4ff236f8f6d2917549e19d1ecb3fea;hpb=01d84d552854fb399bd0e819502c6c2db2a1b214;p=lilypond.git diff --git a/lily/include/group-interface.hh b/lily/include/group-interface.hh index 289ba913ba..2a94f0783a 100644 --- a/lily/include/group-interface.hh +++ b/lily/include/group-interface.hh @@ -1,57 +1,30 @@ -/* +/* group-interface.hh -- declare Group_interface - + source file of the GNU LilyPond music typesetter - - (c) 1999 Han-Wen Nienhuys - - */ + + (c) 1999--2008 Han-Wen Nienhuys +*/ #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 Grobs, but + sometimes it can be different things. + + todo: reename as list_interface? +*/ struct Group_interface { - Score_element * elt_l_; - String name_; public: - Group_interface (Score_element const*); - Group_interface (Score_element const*, String); - int count (); - bool supports_interface_b (); - void set_interface (); - void add_element (Score_element*); + static int count (Grob *, SCM); + static void add_thing (Grob *, SCM, SCM); }; -/* - template - Link_array Group_interface__extract_elements (T *, String name); -*/ -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 */