X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fstencil-interpret.cc;h=4f8c6bbc8be85712cf2bdea34b6fc25f78bd51a8;hb=d959f8d548dc073c162c4599cfef2a596f9b66db;hp=52e9242d0b76ec157e10a6ea825c43ce12745c1d;hpb=75eebcb49e52d296b1da3e1074e0825d2c780db4;p=lilypond.git diff --git a/lily/stencil-interpret.cc b/lily/stencil-interpret.cc index 52e9242d0b..4f8c6bbc8b 100644 --- a/lily/stencil-interpret.cc +++ b/lily/stencil-interpret.cc @@ -1,9 +1,20 @@ /* - stencil-interpret.cc -- implement Stencil expression interpreting + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2011 Han-Wen Nienhuys - (c) 2005--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 "stencil.hh" @@ -21,6 +32,13 @@ interpret_stencil_expression (SCM expr, SCM head = scm_car (expr); + if (head == ly_symbol2scm ("delay-stencil-evaluation")) + { + interpret_stencil_expression (scm_force (scm_cadr (expr)), func, func_arg, o); + return; + } + if (head == ly_symbol2scm ("footnote")) + return; if (head == ly_symbol2scm ("translate-stencil")) { o += ly_scm2offset (scm_cadr (expr)); @@ -54,6 +72,38 @@ interpret_stencil_expression (SCM expr, interpret_stencil_expression (scm_caddr (expr), func, func_arg, o); (*func) (func_arg, scm_list_1 (ly_symbol2scm ("resetcolor"))); + return; + } + else if (head == ly_symbol2scm ("rotate-stencil")) + { + SCM args = scm_cadr (expr); + SCM angle = scm_car (args); + Offset tmp = o + robust_scm2offset (scm_cadr (args), Offset (0.0, 0.0)); + + SCM offset = ly_offset2scm (tmp); + SCM x = scm_car (offset); + SCM y = scm_cdr (offset); + + (*func) (func_arg, scm_list_4 (ly_symbol2scm ("setrotation"), angle, x, y)); + interpret_stencil_expression (scm_caddr (expr), func, func_arg, o); + (*func) (func_arg, scm_list_4 (ly_symbol2scm ("resetrotation"), angle, x, y)); + + return; + } + else if (head == ly_symbol2scm ("scale-stencil")) + { + SCM args = scm_cadr (expr); + SCM x_scale = scm_car (args); + SCM y_scale = scm_cadr (args); + Offset unscaled = o.scale (Offset (1 / scm_to_double (x_scale), + 1 / scm_to_double (y_scale))); + + (*func) (func_arg, scm_list_3 (ly_symbol2scm ("setscale"), x_scale, + y_scale)); + interpret_stencil_expression (scm_caddr (expr), func, func_arg, + unscaled); + (*func) (func_arg, scm_list_1 (ly_symbol2scm ("resetscale"))); + return; } else