]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/item-scheme.cc
Doc-es: various updates.
[lilypond.git] / lily / item-scheme.cc
index d2188194324919fc86152be284bf2dde657c397a..48f3218f22951f11f218f8feffefcb42e22ef95d 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2005--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
 
   LilyPond is free software: you can redistribute it and/or modify
 */
 
 #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 = unsmob_grob (g);
+  Grob *me = unsmob<Grob> (g);
   bool b = dynamic_cast<Item *> (me);
   return ly_bool2scm (b);
 }
@@ -35,7 +36,21 @@ LY_DEFINE (ly_item_break_dir, "ly:item-break-dir",
            " end of line, @code{0}@tie{}unbroken, and"
            " @code{1}@tie{}beginning of line.")
 {
-  LY_ASSERT_TYPE (unsmob_item, it, 1);
-  Item *me = unsmob_item (it);
+  LY_ASSERT_SMOB (Item, it, 1);
+  Item *me = unsmob<Item> (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<Item> (it);
+
+  if (Paper_column *col = me->get_column ())
+    return col->self_scm ();
+
+  return SCM_EOL;
+}