+
+LY_DEFINE (ly_grob_common_refpoint, "ly:grob-common-refpoint",
+ 3, 0, 0, (SCM grob, SCM other, SCM axis),
+ "Find the common refpoint of @var{grob} and @var{other} for @var{axis}."
+ )
+{
+
+ Grob *gr = unsmob_grob (grob);
+ SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
+
+ Grob *o = unsmob_grob (other);
+ SCM_ASSERT_TYPE (o, other, SCM_ARG2, __FUNCTION__, "grob");
+
+ SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+
+ Grob *refp = gr->common_refpoint (o, Axis (scm_to_int (axis)));
+ return refp ? refp->self_scm () : SCM_BOOL_F;
+}
+
+LY_DEFINE (ly_grob_common_refpoint_of_array, "ly:grob-common-refpoint-of-array",
+ 3, 0, 0, (SCM grob, SCM others, SCM axis),
+ "Find the common refpoint of @var{grob} and @var{others} "
+ "(a grob-array) for @var{axis}."
+ )
+{
+ Grob *gr = unsmob_grob (grob);
+ SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
+
+ Grob_array *ga = unsmob_grob_array (others);
+ SCM_ASSERT_TYPE (ga, others, SCM_ARG2, __FUNCTION__, "grob array");
+ SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
+
+ Grob *refp = common_refpoint_of_array (ga->array (), gr, Axis (scm_to_int (axis)));
+ return refp ? refp->self_scm () : SCM_BOOL_F;
+}