]> git.donarmstrong.com Git - lilypond.git/blob - lily/item-scheme.cc
Web-ja: update introduction
[lilypond.git] / lily / item-scheme.cc
1 /*
2   This file is part of LilyPond, the GNU music typesetter.
3
4   Copyright (C) 2005--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
5
6
7   LilyPond is free software: you can redistribute it and/or modify
8   it under the terms of the GNU General Public License as published by
9   the Free Software Foundation, either version 3 of the License, or
10   (at your option) any later version.
11
12   LilyPond is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16
17   You should have received a copy of the GNU General Public License
18   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 #include "item.hh"
22 #include "paper-column.hh"
23
24 LY_DEFINE (ly_item_p, "ly:item?",
25            1, 0, 0, (SCM g),
26            "Is @var{g} an @code{Item} object?")
27 {
28   Grob *me = unsmob<Grob> (g);
29   bool b = dynamic_cast<Item *> (me);
30   return ly_bool2scm (b);
31 }
32
33 LY_DEFINE (ly_item_break_dir, "ly:item-break-dir",
34            1, 0, 0, (SCM it),
35            "The break status direction of item @var{it}.  @w{@code{-1}} means"
36            " end of line, @code{0}@tie{}unbroken, and"
37            " @code{1}@tie{}beginning of line.")
38 {
39   LY_ASSERT_SMOB (Item, it, 1);
40   Item *me = unsmob<Item> (it);
41   return scm_from_int (me->break_status_dir ());
42 }
43
44 LY_DEFINE (ly_item_get_column, "ly:item-get-column",
45            1, 0, 0, (SCM it),
46            "Return the @code{PaperColumn} or @code{NonMusicalPaperColumn}"
47            " associated with this @code{Item}.")
48 {
49   LY_ASSERT_SMOB (Item, it, 1);
50   Item *me = unsmob<Item> (it);
51
52   if (Paper_column *col = me->get_column ())
53     return col->self_scm ();
54
55   return SCM_EOL;
56 }