X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fengraver-group.cc;h=07a0ef50914b4f235093ae222e3c8637e604964d;hb=9bf6174bc111c5d90fa00af0f0c59f17cd4d9b9f;hp=71533cd116cd8e353d853285578ed287fc3344c6;hpb=d4f38c4239f67dd08d616794a9cdc47a30a86b6a;p=lilypond.git diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc index 71533cd116..07a0ef5091 100644 --- a/lily/engraver-group.cc +++ b/lily/engraver-group.cc @@ -1,18 +1,69 @@ /* - engraver-group.cc -- implement Engraver_group + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 1997--2011 Han-Wen Nienhuys - (c) 1997--2006 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 . */ +#include "context.hh" +#include "dispatcher.hh" #include "engraver-group.hh" - -#include "warn.hh" -#include "paper-score.hh" #include "grob.hh" -#include "context.hh" +#include "paper-score.hh" #include "translator-dispatch-list.hh" +#include "warn.hh" + +IMPLEMENT_LISTENER (Engraver_group, override); +void +Engraver_group::override (SCM sev) +{ + Stream_event *ev = unsmob_stream_event (sev); + + sloppy_general_pushpop_property (context (), + ev->get_property ("symbol"), + ev->get_property ("property-path"), + ev->get_property ("value")); +} + +IMPLEMENT_LISTENER (Engraver_group, revert); +void +Engraver_group::revert (SCM sev) +{ + Stream_event *ev = unsmob_stream_event (sev); + + sloppy_general_pushpop_property (context (), + ev->get_property ("symbol"), + ev->get_property ("property-path"), + SCM_UNDEFINED); +} + +void +Engraver_group::connect_to_context (Context *c) +{ + Translator_group::connect_to_context (c); + c->event_source ()->add_listener (GET_LISTENER (override), ly_symbol2scm ("Override")); + c->event_source ()->add_listener (GET_LISTENER (revert), ly_symbol2scm ("Revert")); +} + +void +Engraver_group::disconnect_from_context () +{ + context ()->event_source ()->remove_listener (GET_LISTENER (override), ly_symbol2scm ("Override")); + context ()->event_source ()->remove_listener (GET_LISTENER (revert), ly_symbol2scm ("Revert")); + Translator_group::disconnect_from_context (); +} void Engraver_group::announce_grob (Grob_info info) @@ -48,7 +99,7 @@ Engraver_group::acknowledge_grobs () else continue; - SCM acklist = scm_hashq_ref (acknowledge_hash_table_drul_[info.start_end()], + SCM acklist = scm_hashq_ref (acknowledge_hash_table_drul_[info.start_end ()], nm, SCM_BOOL_F); Engraver_dispatch_list *dispatch @@ -138,11 +189,18 @@ Engraver_group::Engraver_group () #include "translator.icc" ADD_TRANSLATOR_GROUP (Engraver_group, - /* doc */ "A group of engravers taken together", - /* create */ "", - /* accept */ "", - /* read */ "", - /* write */ ""); + /* doc */ + "A group of engravers taken together.", + + /* create */ + "", + + /* read */ + "", + + /* write */ + "" + ); void Engraver_group::derived_mark () const