]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob-closure.cc
Grand fixcc.py run on all .hh .cc files.
[lilypond.git] / lily / grob-closure.cc
index b2d0160adaf175942ff0e1e5a057cf7d57ff1dff..4f6c0adc81f5219836e20c2bb92754f347a20eab 100644 (file)
@@ -5,20 +5,18 @@ SCM
 axis_offset_symbol (Axis a)
 {
   return a == X_AXIS
-    ? ly_symbol2scm ("X-offset")
-    : ly_symbol2scm ("Y-offset");
+         ? ly_symbol2scm ("X-offset")
+         : ly_symbol2scm ("Y-offset");
 }
 
 SCM
 axis_parent_positioning (Axis a)
 {
   return (a == X_AXIS)
-    ? Grob::x_parent_positioning_proc
-    : Grob::y_parent_positioning_proc;
+         ? Grob::x_parent_positioning_proc
+         : Grob::y_parent_positioning_proc;
 }
 
-
-
 /*
   Replace
 
@@ -27,7 +25,6 @@ axis_parent_positioning (Axis a)
   by
 
   (+ (PROC GROB) (orig-proc GROB))
-  
 */
 void
 add_offset_callback (Grob *g, SCM proc, Axis a)
@@ -38,11 +35,11 @@ add_offset_callback (Grob *g, SCM proc, Axis a)
       && !is_simple_closure (data))
     {
       g->set_property (axis_offset_symbol (a), proc);
-      return ;
+      return;
     }
 
   if (ly_is_procedure (data))
-    data = ly_make_simple_closure (scm_list_1  (data));
+    data = ly_make_simple_closure (scm_list_1 (data));
   else if (is_simple_closure (data))
     data = simple_closure_expression (data);
 
@@ -50,12 +47,11 @@ add_offset_callback (Grob *g, SCM proc, Axis a)
 
   if (ly_is_procedure (proc))
     proc = ly_make_simple_closure (scm_list_1 (proc));
-  
+
   SCM expr = scm_list_3 (plus, proc, data);
   g->set_property (axis_offset_symbol (a), ly_make_simple_closure (expr));
 }
 
-
 /*
   replace
 
@@ -63,16 +59,15 @@ add_offset_callback (Grob *g, SCM proc, Axis a)
 
   by
 
-  (PROC GROB (orig-proc GROB)) 
-
+  (PROC GROB (orig-proc GROB))
 */
 void
-chain_offset_callback (Grob *g, SCM proc, Axis a)
+chain_callback (Grob *g, SCM proc, SCM sym)
 {
-  SCM data = g->get_property_data (axis_offset_symbol (a));
+  SCM data = g->get_property_data (sym);
 
   if (ly_is_procedure (data))
-    data = ly_make_simple_closure (scm_list_1  (data));
+    data = ly_make_simple_closure (scm_list_1 (data));
   else if (is_simple_closure (data))
     data = simple_closure_expression (data);
   else
@@ -84,9 +79,15 @@ chain_offset_callback (Grob *g, SCM proc, Axis a)
     data = SCM_UNDEFINED;
 
   SCM expr = scm_list_2 (proc, data);
-  g->set_property (axis_offset_symbol (a),
-                  
-                  // twice: one as a wrapper for grob property routines,
-                  // once for the actual delayed binding. 
-                  ly_make_simple_closure (ly_make_simple_closure (expr)));
+  g->set_property (sym,
+
+                   // twice: one as a wrapper for grob property routines,
+                   // once for the actual delayed binding.
+                   ly_make_simple_closure (ly_make_simple_closure (expr)));
+}
+
+void
+chain_offset_callback (Grob *g, SCM proc, Axis a)
+{
+  chain_callback (g, proc, axis_offset_symbol (a));
 }