X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fparenthesis-engraver.cc;h=d021be9be45529bf262b87970abaa0c5aa54f465;hb=0b544cfb7332615ef809b71b57ab656741311ae1;hp=d3382070e0af877b9e41cb565668b26bdc4aa657;hpb=8cab78caa0db1ba14f2e52e4c1ddbb541ea0e5cb;p=lilypond.git diff --git a/lily/parenthesis-engraver.cc b/lily/parenthesis-engraver.cc index d3382070e0..d021be9be4 100644 --- a/lily/parenthesis-engraver.cc +++ b/lily/parenthesis-engraver.cc @@ -1,10 +1,21 @@ /* - parenthesis-engraver.cc -- implement Parenthesis_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2014 Han-Wen Nienhuys - (c) 2005--2009 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 "engraver.hh" @@ -35,45 +46,45 @@ Parenthesis_engraver::acknowledge_grob (Grob_info info) if (Stream_event *ev = info.event_cause ()) { if (to_boolean (ev->get_property ("parenthesize"))) - { - if (Item *victim = dynamic_cast (info.grob ())) - { - Engraver *eng = dynamic_cast (info.origin_translator ()); - Item *paren = eng->make_item ("ParenthesesItem", victim->self_scm ()); - Pointer_group_interface::add_grob (paren, ly_symbol2scm ("elements"), victim); - - paren->set_parent (victim, Y_AXIS); - - Real size = robust_scm2double (paren->get_property ("font-size"), 0.0) - + robust_scm2double (victim->get_property ("font-size"), 0.0); - paren->set_property ("font-size", scm_from_double (size)); - - /* - TODO? - - enlarge victim to allow for parentheses space? - */ - } - else - { - programming_error ("Don't know how to parenthesize spanners."); - } - } + { + if (Item *victim = dynamic_cast (info.grob ())) + { + Engraver *eng = dynamic_cast (info.origin_translator ()); + Item *paren = eng->make_item ("ParenthesesItem", victim->self_scm ()); + Pointer_group_interface::add_grob (paren, ly_symbol2scm ("elements"), victim); + + paren->set_parent (victim, Y_AXIS); + + Real size = robust_scm2double (paren->get_property ("font-size"), 0.0) + + robust_scm2double (victim->get_property ("font-size"), 0.0); + paren->set_property ("font-size", scm_from_double (size)); + + /* + TODO? + + enlarge victim to allow for parentheses space? + */ + } + else + { + programming_error ("Don't know how to parenthesize spanners."); + } + } } } ADD_ACKNOWLEDGER (Parenthesis_engraver, grob); ADD_TRANSLATOR (Parenthesis_engraver, - /* doc */ - "Parenthesize objects whose music cause has the" - " @code{parenthesize} property.", - - /* create */ - "ParenthesesItem ", - - /* read */ - "", - - /* write */ - "" - ); + /* doc */ + "Parenthesize objects whose music cause has the" + " @code{parenthesize} property.", + + /* create */ + "ParenthesesItem ", + + /* read */ + "", + + /* write */ + "" + );