+Direction
+Script_interface::get_direction (Grob *me)
+{
+ Direction relative_dir = Direction (1);
+ SCM reldir = me->get_property ("side-relative-direction");
+ if (is_direction (reldir))
+ relative_dir = to_dir (reldir);
+
+ SCM other_elt = me->get_object ("direction-source");
+ Grob *e = Grob::unsmob (other_elt);
+ if (e)
+ return (Direction) (relative_dir * get_grob_direction (e));
+
+ return CENTER;
+}
+
+MAKE_SCHEME_CALLBACK (Script_interface, calc_direction, 1);
+SCM
+Script_interface::calc_direction (SCM smob)
+{
+ Grob *me = Grob::unsmob (smob);
+ Direction d = Script_interface::get_direction (me);