2 #include "simple-closure.hh"
5 UGH : todo -> to different file.
9 axis_offset_symbol (Axis a)
12 ? ly_symbol2scm ("X-offset")
13 : ly_symbol2scm ("Y-offset");
17 axis_parent_positioning (Axis a)
20 ? Grob::x_parent_positioning_proc
21 : Grob::y_parent_positioning_proc;
33 (+ (PROC GROB) (orig-proc GROB))
37 add_offset_callback (Grob *g, SCM proc, Axis a)
39 SCM data = g->get_property_data (axis_offset_symbol (a));
40 if (ly_is_procedure (data))
41 data = ly_make_simple_closure (scm_list_1 (data));
42 else if (is_simple_closure (data))
43 data = simple_closure_expression (data);
44 else if (!scm_is_number (data))
45 g->internal_set_property (axis_offset_symbol (a),
49 SCM plus = ly_lily_module_constant ("+");
50 SCM expr = scm_list_3 (plus,
51 ly_make_simple_closure (scm_list_1 (proc)),
53 g->internal_set_property (axis_offset_symbol (a),
54 ly_make_simple_closure (expr));
66 (PROC GROB (orig-proc GROB))
70 chain_offset_callback (Grob *g, SCM proc, Axis a)
72 SCM data = g->get_property_data (axis_offset_symbol (a));
74 if (ly_is_procedure (data))
75 data = ly_make_simple_closure (scm_list_1 (data));
76 else if (is_simple_closure (data))
77 data = simple_closure_expression (data);
78 else if (!scm_is_number (data))
79 data = scm_from_int (0);
81 SCM expr = scm_list_2 (proc, data);
82 g->internal_set_property (axis_offset_symbol (a),
84 // twice: one as a wrapper for grob property routines,
85 // once for the actual delayed binding.
86 ly_make_simple_closure (ly_make_simple_closure (expr)));