[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Create ly:grob-chain-callback from chain_callback (issue1890044)
From: |
mtsolo |
Subject: |
Re: Create ly:grob-chain-callback from chain_callback (issue1890044) |
Date: |
Wed, 04 Aug 2010 20:17:40 +0000 |
Reviewers: Neil Puttock,
http://codereview.appspot.com/1890044/diff/1/2
File lily/grob-scheme.cc (right):
http://codereview.appspot.com/1890044/diff/1/2#newcode407
lily/grob-scheme.cc:407: 3, 0, 0, (SCM grob, SCM proc, SCM sym),
On 2010/08/04 18:50:59, Neil Puttock wrote:
0, (SCM grob
Done.
http://codereview.appspot.com/1890044/diff/1/2#newcode415
lily/grob-scheme.cc:415: LY_ASSERT_SMOB (Grob, grob, 1);
On 2010/08/04 18:50:59, Neil Puttock wrote:
+ LY_ASSERT_TYPE (ly_is_procedure, proc, 2);
Done.
Description:
Create ly:grob-chain-callback from chain_callback
Create ly:grob-chain-callback from chain_callback
Whitespace fix
Please review this at http://codereview.appspot.com/1890044/show
Affected files:
M lily/grob-scheme.cc
Index: lily/grob-scheme.cc
diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc
index
199e6fb9b3410da8d6355aaea07782577f170223..c27a9ee8bdab5ff3dbe941a0e9bc6533857ca264
100644
--- a/lily/grob-scheme.cc
+++ b/lily/grob-scheme.cc
@@ -402,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;
+}