/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2008--2009 Han-Wen Nienhuys <hanwen@lilypond.org>
-
+ Copyright (C) 2008--2012 Han-Wen Nienhuys <hanwen@lilypond.org>
+
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "skyline-pair.hh"
+#include "international.hh"
#include "ly-smobs.icc"
Skyline_pair::Skyline_pair ()
skylines_[DOWN].print ();
}
-
bool
Skyline_pair::is_empty () const
{
return skylines_[UP].is_empty ()
- && skylines_[DOWN].is_empty ();
+ && skylines_[DOWN].is_empty ();
}
-Skyline&
+Skyline &
Skyline_pair::operator [] (Direction d)
{
return skylines_[d];
}
-Skyline const&
+Skyline const &
Skyline_pair::operator [] (Direction d) const
{
return skylines_[d];
scm_puts ("#<Skyline-pair>", port);
return 1;
}
+
+MAKE_SCHEME_CALLBACK (Skyline_pair, skyline, 2);
+SCM
+Skyline_pair::skyline (SCM smob, SCM dir_scm)
+{
+ Skyline_pair *sp = Skyline_pair::unsmob (smob);
+ Direction dir = robust_scm2dir (dir_scm, UP);
+
+ if (dir == CENTER)
+ {
+ warning (_f ("direction must not be CENTER in ly:skyline-pair::skyline"));
+ dir = UP;
+ }
+
+ return (*sp)[dir].smobbed_copy ();
+}