X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fitem-scheme.cc;h=48f3218f22951f11f218f8feffefcb42e22ef95d;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=0e6b71ef30a8191931495c3ff16bd6d9bb5fcadb;hpb=c054eb280fd9953596eb164f67b0f9d5555c5a32;p=lilypond.git diff --git a/lily/item-scheme.cc b/lily/item-scheme.cc index 0e6b71ef30..48f3218f22 100644 --- a/lily/item-scheme.cc +++ b/lily/item-scheme.cc @@ -19,12 +19,13 @@ */ #include "item.hh" +#include "paper-column.hh" LY_DEFINE (ly_item_p, "ly:item?", 1, 0, 0, (SCM g), "Is @var{g} an @code{Item} object?") { - Grob *me = Grob::unsmob (g); + Grob *me = unsmob (g); bool b = dynamic_cast (me); return ly_bool2scm (b); } @@ -36,6 +37,20 @@ LY_DEFINE (ly_item_break_dir, "ly:item-break-dir", " @code{1}@tie{}beginning of line.") { LY_ASSERT_SMOB (Item, it, 1); - Item *me = Item::unsmob (it); + Item *me = unsmob (it); return scm_from_int (me->break_status_dir ()); } + +LY_DEFINE (ly_item_get_column, "ly:item-get-column", + 1, 0, 0, (SCM it), + "Return the @code{PaperColumn} or @code{NonMusicalPaperColumn}" + " associated with this @code{Item}.") +{ + LY_ASSERT_SMOB (Item, it, 1); + Item *me = unsmob (it); + + if (Paper_column *col = me->get_column ()) + return col->self_scm (); + + return SCM_EOL; +}