Reviewers: ,
Message:
Please review. Thanks!
Description:
Make Grob::name accessible to Scheme
Needing to determine the name of a grob is extremely common to users
of Scheme.
Please review this at https://codereview.appspot.com/203090043/
Affected files (+11, -0 lines):
M lily/grob-scheme.cc
Index: lily/grob-scheme.cc
diff --git a/lily/grob-scheme.cc b/lily/grob-scheme.cc
index
238a0af7518189024210bda07cc9ee70aa515c40..c2609a09d3926cfe19f5cdf60626bb2eaa7a5252
100644
--- a/lily/grob-scheme.cc
+++ b/lily/grob-scheme.cc
@@ -482,3 +482,14 @@ LY_DEFINE
(ly_grob_get_vertical_axis_group_index, "ly:grob-get-vertical-axis-gro
return scm_from_int (Grob::get_vertical_axis_group_index (gr));
}
+
+LY_DEFINE (ly_grob_name, "ly:grob-name",
+ 1, 0, 0, (SCM grob),
+ "Return the name of the grob @var{grob}.")
+{
+ Grob *gr = Grob::unsmob (grob);
+
+ LY_ASSERT_SMOB (Grob, grob, 1);
+
+ return ly_string2scm (gr->name ());
+}
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel