]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stencil-interpret.cc
Run grand replace for 2015.
[lilypond.git] / lily / stencil-interpret.cc
index e85ad90f43a2904374d7d9c402890036c24b4611..26e891dfb77698c0533054b231a9f4635b044da9 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
   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