]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/group-interface.cc
2003 -> 2004
[lilypond.git] / lily / group-interface.cc
index a24e883da67cf83019269d52e87ad63e01c01e71..a62dde9a9c9f09fdea31a55f6e61761513629cb4 100644 (file)
@@ -3,76 +3,34 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 #include "group-interface.hh"
-#include "score-element.hh"
-
-Group_interface::Group_interface (Score_element const* e)
-{
-  elt_l_ = (Score_element*)e;
-  name_ = "elements";
-}
-
-
-Group_interface::Group_interface (Score_element const *e, String s)
-{
-  elt_l_ =(Score_element*)e;
-  name_ = s;
-} 
-bool
-Group_interface::has_interface_b () 
-{
-  SCM el = elt_l_->get_elt_property (name_);
-
-  return el == SCM_EOL || gh_pair_p (el);
-}
-
+#include "grob.hh"
 
 void
-Group_interface::add_element (Score_element*p) 
+Group_interface::add_thing (Grob*me, SCM sym, SCM thing)
 {
-  p->used_b_ =  true;
-  elt_l_->used_b_ = true;
-
-  add_thing (p->self_scm_);
+  me->add_to_list_property (sym, thing);
 }
 
+
 void
-Group_interface::add_thing (SCM s)
+Group_interface::add_thing (Grob*me, String name, SCM thing)
 {
-  elt_l_->set_elt_property (name_,
-                           gh_cons (s, elt_l_->get_elt_property (name_)));
-
+  add_thing (me, ly_symbol2scm (name.to_str0 ()), thing);
 }
 
-
 int
-Group_interface::count ()
-{
-  return scm_ilength (elt_l_->get_elt_property (name_));
-}
-
-void
-Group_interface::set_interface ()
+Group_interface::count (Grob *me, String name)
 {
-  if (!has_interface_b ())
-    {
-      elt_l_->set_elt_property (name_, SCM_EOL);
-    }
+  return scm_ilength (me->get_grob_property (name.to_str0 ()));
 }
 
-Group_interface
-group (Score_element*s,String n)
-{
-  Group_interface gi (s,n);
-  return gi;
-}
 
-Group_interface
-group (Score_element*s)
+void
+Pointer_group_interface::add_grob (Grob*me, SCM name, Grob*p) 
 {
-  Group_interface gi (s);
-  return gi;
+  Group_interface::add_thing (me, name, p->self_scm ());
 }