]> git.donarmstrong.com Git - lilypond.git/blob - lily/group-interface.cc
release: 1.3.83
[lilypond.git] / lily / group-interface.cc
1 /*   
2   group-interface.cc --  implement Group_interface
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9 #include "group-interface.hh"
10 #include "score-element.hh"
11
12 /*
13   ugh: clean me, junk elt_l_ field
14  */
15 Group_interface::Group_interface (Score_element * e)
16 {
17   elt_l_ = (Score_element*)e;
18   name_ = "elements";
19 }
20
21
22 Group_interface::Group_interface (Score_element  *e, String s)
23 {
24   elt_l_ =(Score_element*)e;
25   name_ = s;
26
27 bool
28 Group_interface::has_interface () 
29 {
30   SCM el = elt_l_->get_elt_property (name_.ch_C());
31
32   return el == SCM_EOL || gh_pair_p (el);
33 }
34
35
36
37 void
38 Group_interface::add_thing (SCM s)
39 {
40   elt_l_->set_elt_property (name_.ch_C (),
41                             gh_cons (s, elt_l_->get_elt_property (name_.ch_C())));
42 }
43
44
45 int
46 Group_interface::count ()
47 {
48   return scm_ilength (elt_l_->get_elt_property (name_.ch_C()));
49 }
50
51 void
52 Group_interface::set_interface ()
53 {
54   if (!has_interface ())
55     {
56       elt_l_->set_elt_property (name_.ch_C (), SCM_EOL);
57     }
58 }
59