]> git.donarmstrong.com Git - lilypond.git/blob - lily/property-iterator.cc
release: 1.3.85
[lilypond.git] / lily / property-iterator.cc
1 /*
2   property-iterator.cc -- implement Property_iterator
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9 #include "property-iterator.hh"
10 #include "translation-property.hh"
11 #include "translator-def.hh"
12 #include "translator-group.hh"
13
14 /**
15   There is no real processing to a property: just lookup the
16   translation unit, and set the property.
17   */
18 void
19 Property_iterator::do_process_and_next (Moment m)
20 {
21   SCM sym = music_l_->get_mus_property ("symbol");
22   if (gh_symbol_p(sym))
23     report_to_l ()->set_property (sym, music_l_->get_mus_property ("value"));
24   Music_iterator::do_process_and_next (m);
25 }
26
27
28 void
29 Push_property_iterator::do_process_and_next (Moment m)
30 {
31   SCM syms = music_l_->get_mus_property ("symbols");
32   SCM eprop = music_l_->get_mus_property ("element-property");
33   SCM val = music_l_->get_mus_property ("element-value");
34
35   Translator_def::apply_pushpop_property (report_to_l (), syms, eprop, val);
36   
37   Music_iterator::do_process_and_next (m);
38 }
39
40 void
41 Pop_property_iterator::do_process_and_next (Moment m)
42 {
43   SCM syms = music_l_->get_mus_property ("symbols");
44   SCM eprop = music_l_->get_mus_property ("element-property");
45   Translator_def::apply_pushpop_property (report_to_l (), syms, eprop, SCM_UNDEFINED);
46   
47   Music_iterator::do_process_and_next (m);
48 }