+LY_DEFINE (ly_grob_suicide_x, "ly:grob-suicide!",
+ 1, 0, 0, (SCM g),
+ "Kill @var{g}.")
+{
+ Grob *me = unsmob_grob (g);
+ SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
+
+ me->suicide ();
+ return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_grob_translate_axis_x, "ly:grob-translate-axis!",
+ 3, 0, 0, (SCM g, SCM d, SCM a),
+ "Translate @var{g} on axis @var{a} over distance @var{d}.")
+{
+ Grob *me = unsmob_grob (g);
+ SCM_ASSERT_TYPE (me, g, SCM_ARG1, __FUNCTION__, "grob");
+ SCM_ASSERT_TYPE (scm_is_number (d), d, SCM_ARG2, __FUNCTION__, "dimension");
+ SCM_ASSERT_TYPE (is_axis (a), a, SCM_ARG3, __FUNCTION__, "axis");
+
+ me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
+ return SCM_UNSPECIFIED;
+}
+
+LY_DEFINE (ly_spanner_p, "ly:spanner?",
+ 1, 0, 0, (SCM g),
+ "Is @var{g} a spanner object?")
+{
+ Grob *me = unsmob_grob (g);
+ bool b = dynamic_cast<Spanner *> (me);
+
+ return ly_bool2scm (b);
+}
+
+LY_DEFINE (ly_grob_key, "ly:grob-key",
+ 1, 0, 0,
+ (SCM grob),
+ "Return the object-key for @var{grob}.")
+{
+ Grob *me = unsmob_grob (grob);
+ SCM_ASSERT_TYPE (me, grob, SCM_ARG1, __FUNCTION__, "Grob");
+
+ return me->key () ? me->key ()->self_scm () : SCM_EOL;
+}
+
+LY_DEFINE (ly_grob_default_font, "ly:grob-default-font",
+ 1, 0, 0, (SCM grob),
+ "Return the default font for grob @var{gr}.")
+{
+ Grob *gr = unsmob_grob (grob);
+ SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "grob");
+
+ return Font_interface::get_default_font (gr)->self_scm ();
+}
+
+
+/*
+ TODO: consider swapping order, so we can do
+
+ (grob-common-refpoint a b c d e)
+ */
+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;
+}