X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fstencil-interpret.cc;h=26e891dfb77698c0533054b231a9f4635b044da9;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=e85ad90f43a2904374d7d9c402890036c24b4611;hpb=f93e4199873c91ae32f0e84a610d14853dc379df;p=lilypond.git diff --git a/lily/stencil-interpret.cc b/lily/stencil-interpret.cc index e85ad90f43..26e891dfb7 100644 --- a/lily/stencil-interpret.cc +++ b/lily/stencil-interpret.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2005--2011 Han-Wen Nienhuys + Copyright (C) 2005--2015 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 @@ -21,7 +21,7 @@ void interpret_stencil_expression (SCM expr, - void (*func) (void *, SCM), + SCM (*func) (void *, SCM), void *func_arg, Offset o) { @@ -37,6 +37,8 @@ interpret_stencil_expression (SCM expr, interpret_stencil_expression (scm_force (scm_cadr (expr)), func, func_arg, o); return; } + if (head == ly_symbol2scm ("transparent-stencil")) + return; if (head == ly_symbol2scm ("footnote")) return; if (head == ly_symbol2scm ("translate-stencil")) @@ -55,10 +57,12 @@ interpret_stencil_expression (SCM expr, { SCM grob = scm_cadr (expr); - (*func) (func_arg, scm_list_3 (head, - ly_quote_scm (ly_offset2scm (o)), grob)); + SCM link = + (*func) (func_arg, + scm_list_3 (head, ly_quote_scm (ly_offset2scm (o)), grob)); interpret_stencil_expression (scm_caddr (expr), func, func_arg, o); - (*func) (func_arg, scm_list_1 (ly_symbol2scm ("no-origin"))); + if (scm_is_true (link)) + (*func) (func_arg, scm_list_1 (ly_symbol2scm ("no-origin"))); return; } else if (head == ly_symbol2scm ("color")) @@ -72,6 +76,16 @@ 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 ("id")) + { + SCM id = scm_cadr (expr); + + (*func) (func_arg, scm_list_2 (ly_symbol2scm ("start-enclosing-id-node"), id)); + interpret_stencil_expression (scm_caddr (expr), func, func_arg, o); + (*func) (func_arg, scm_list_1 (ly_symbol2scm ("end-enclosing-id-node"))); + return; } else if (head == ly_symbol2scm ("rotate-stencil")) @@ -123,7 +137,7 @@ struct Font_list SCM fonts_; }; -static void +static SCM find_font_function (void *fs, SCM x) { Font_list *me = (Font_list *) fs; @@ -142,6 +156,7 @@ find_font_function (void *fs, SCM x) me->fonts_ = scm_cons (scm_cadr (what), me->fonts_); } } + return SCM_BOOL_T; } SCM