]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob-scheme.cc
Merge branch 'lilypond/translation' of ssh://git.sv.gnu.org/srv/git/lilypond into...
[lilypond.git] / lily / grob-scheme.cc
index bfe79da7c0bdf43c563d8e9b45c9c2f2e05bfe79..c27a9ee8bdab5ff3dbe941a0e9bc6533857ca264 100644 (file)
@@ -124,6 +124,18 @@ LY_DEFINE (ly_grob_object, "ly:grob-object",
 }
 
 
+LY_DEFINE (ly_grob_set_object_x, "ly:grob-set-object!",
+          3, 0, 0, (SCM grob, SCM sym, SCM val),
+          "Set @var{sym} in grob @var{grob} to value @var{val}.")
+{
+  Grob *sc = unsmob_grob (grob);
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
+
+  sc->set_object (sym, val);
+  return SCM_UNSPECIFIED;
+}
 
 /* TODO: make difference between scaled and unscalead variable in
    calling (i.e different funcs.) */
@@ -246,6 +258,22 @@ LY_DEFINE (ly_grob_parent, "ly:grob-parent",
   return par ? par->self_scm () : SCM_EOL;
 }
 
+LY_DEFINE (ly_grob_set_parent_x, "ly:grob-set-parent!",
+          3, 0, 0, (SCM grob, SCM axis, SCM parent_grob),
+          "Set @var{parent-grob} the parent of grob @var{grob} in axis @var{axis}.")
+{
+  Grob *gr = unsmob_grob (grob);
+  Grob *parent = unsmob_grob (parent_grob);
+
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (is_axis, axis, 2);
+  LY_ASSERT_SMOB (Grob, parent_grob, 3);
+
+  Axis a = Axis (scm_to_int (axis));
+  gr->set_parent (parent, a);
+  return SCM_UNSPECIFIED;
+}
+
 LY_DEFINE (ly_grob_properties, "ly:grob-properties",
           1, 0, 0, (SCM grob),
           "Get the mutable properties of @var{grob}.")
@@ -374,3 +402,20 @@ LY_DEFINE (ly_grob_common_refpoint_of_array, "ly:grob-common-refpoint-of-array",
   Grob *refp = common_refpoint_of_array (ga->array (), gr, Axis (scm_to_int (axis)));
   return refp ? refp->self_scm () : SCM_BOOL_F;
 }
+
+LY_DEFINE (ly_grob_chain_callback, "ly:grob-chain-callback",
+          3, 0, 0, (SCM grob, SCM proc, SCM sym),
+          "Find the callback that is stored as property"
+          " @var{sym} of grob @var{grob} and chain @var{proc}"
+          " to the head of this, meaning that it is called"
+          " using @var{grob} and the previous callback's result.")
+{
+  Grob *gr = unsmob_grob (grob);
+
+  LY_ASSERT_SMOB (Grob, grob, 1);
+  LY_ASSERT_TYPE (ly_is_procedure, proc, 2);
+  LY_ASSERT_TYPE (ly_is_symbol, sym, 3);
+
+  chain_callback (gr, proc, sym);
+  return SCM_UNSPECIFIED;
+}