/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1998--2012 Jan Nieuwenhuizen <janneke@gnu.org>
+ Copyright (C) 1998--2014 Jan Nieuwenhuizen <janneke@gnu.org>
Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
#include "paper-score.hh"
#include "simple-closure.hh"
#include "system.hh"
+#include "unpure-pure-container.hh"
#include "warn.hh" // error ()
LY_DEFINE (ly_grob_property_data, "ly:grob-property-data",
LY_ASSERT_SMOB (Grob, grob, 1);
- bool type_ok = ly_cheap_is_list (symlist);
+ bool type_ok = scm_is_pair (symlist);
if (type_ok)
for (SCM s = symlist; scm_is_pair (s) && type_ok; s = scm_cdr (s))
SCM_ASSERT_TYPE (type_ok, symlist, SCM_ARG2, __FUNCTION__, "list of symbols");
- set_nested_property (sc, symlist, val);
+ if (scm_is_pair (scm_cdr (symlist)))
+ set_nested_property (sc, symlist, val);
+ else
+ ly_grob_set_property_x (grob, scm_car (symlist), val);
return SCM_UNSPECIFIED;
}
Grob *gr = unsmob_grob (grob);
LY_ASSERT_SMOB (Grob, grob, 1);
- LY_ASSERT_TYPE (ly_is_procedure, proc, 2);
+ SCM_ASSERT_TYPE (ly_is_procedure (proc) || is_unpure_pure_container (proc), proc, SCM_ARG2, __FUNCTION__, "procedure or unpure pure container");
LY_ASSERT_TYPE (ly_is_symbol, sym, 3);
chain_callback (gr, proc, sym);
return ly_bool2scm (Grob::vertical_less (ga, gb));
}
+
+LY_DEFINE (ly_grob_get_vertical_axis_group_index, "ly:grob-get-vertical-axis-group-index",
+ 1, 0, 0, (SCM grob),
+ "Get the index of the vertical axis group the grob @var{grob} belongs to;"
+ " return @code{-1} if none is found.")
+{
+ Grob *gr = unsmob_grob (grob);
+
+ LY_ASSERT_SMOB (Grob, grob, 1);
+
+ return scm_from_int (Grob::get_vertical_axis_group_index (gr));
+}