X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fenclosing-bracket.cc;h=1a199f43a18c0cca5fd4659013ff19c883ad3725;hb=9e781b7dc83b60a543ce218aa1a5f139f74c760f;hp=ef2dd18b6bd08a14bc8786dd68b7e3533e85ef89;hpb=474c8729dc274a30558102a015a01fa5882673db;p=lilypond.git diff --git a/lily/enclosing-bracket.cc b/lily/enclosing-bracket.cc index ef2dd18b6b..1a199f43a1 100644 --- a/lily/enclosing-bracket.cc +++ b/lily/enclosing-bracket.cc @@ -1,10 +1,21 @@ /* - enclosing-bracket.cc -- implement Enclosing_bracket + 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--2007 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 "stencil.hh" @@ -15,30 +26,27 @@ struct Enclosing_bracket { - DECLARE_GROB_INTERFACE(); - + DECLARE_GROB_INTERFACE (); + public: - DECLARE_SCHEME_CALLBACK(print, (SCM)); - DECLARE_SCHEME_CALLBACK(width, (SCM)); + DECLARE_SCHEME_CALLBACK (print, (SCM)); + DECLARE_SCHEME_CALLBACK (width, (SCM)); }; +ADD_INTERFACE (Enclosing_bracket, + "Brackets alongside bass figures.", -ADD_INTERFACE(Enclosing_bracket, - - "Brackets alongside bass figures.", - - /* props */ - "bracket-flare " - "edge-height " - "elements " - "padding " - "shorten-pair " - "thickness " - ); + /* properties */ + "bracket-flare " + "edge-height " + "elements " + "padding " + "shorten-pair " + "thickness " + ); /* ugh: should make bracket interface. */ - MAKE_SCHEME_CALLBACK (Enclosing_bracket, width, 1); SCM Enclosing_bracket::width (SCM grob) @@ -54,13 +62,12 @@ Enclosing_bracket::width (SCM grob) return SCM_EOL; } - Grob *common_x = common_refpoint_of_array (elements, me, X_AXIS); + Grob *common_x = common_refpoint_of_array (elements, me, X_AXIS); Interval xext = Axis_group_interface::relative_group_extent (elements, common_x, X_AXIS); Stencil left_br = Horizontal_bracket::make_bracket (me, 10.0, Y_AXIS, LEFT); Stencil right_br = Horizontal_bracket::make_bracket (me, 10.0, Y_AXIS, LEFT); - xext.widen (robust_scm2double (me->get_property ("padding"), 0.25)); left_br.translate_axis (xext[LEFT], X_AXIS); right_br.translate_axis (xext[RIGHT], X_AXIS); @@ -83,7 +90,7 @@ Enclosing_bracket::print (SCM grob) return SCM_EOL; } - Grob *common_x = common_refpoint_of_array (elements, me, X_AXIS); + Grob *common_x = common_refpoint_of_array (elements, me, X_AXIS); Interval xext = Axis_group_interface::relative_group_extent (elements, common_x, X_AXIS); if (xext.is_empty ()) { @@ -92,14 +99,14 @@ Enclosing_bracket::print (SCM grob) } Stencil left_br = Horizontal_bracket::make_enclosing_bracket (me, me, elements, - Y_AXIS, LEFT); + Y_AXIS, LEFT); Stencil right_br = Horizontal_bracket::make_enclosing_bracket (me, me, elements, - Y_AXIS, RIGHT); + Y_AXIS, RIGHT); xext.widen (robust_scm2double (me->get_property ("padding"), 0.25)); left_br.translate_axis (xext[LEFT], X_AXIS); right_br.translate_axis (xext[RIGHT], X_AXIS); - + left_br.add_stencil (right_br); left_br.translate_axis (-me->relative_coordinate (common_x, X_AXIS), X_AXIS);