]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/grob-scheme.cc
* Documentation/user/changing-defaults.itely (Creating titles):
[lilypond.git] / lily / grob-scheme.cc
index 75c9c7bc1e7b6182cbfa1ad3a6b1c33379c1222d..d6d32e9ecd1b52d1be8919f495b91fe320f6b587 100644 (file)
@@ -7,14 +7,11 @@
                  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "grob.hh"
 #include "warn.hh"
-#include "spanner.hh"
 #include "item.hh"
 #include "output-def.hh"
 #include "system.hh"
 
-
 LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
           3, 0, 0, (SCM grob, SCM sym, SCM val),
           "Set @var{sym} in grob @var{grob} to value @var{val}")
@@ -58,28 +55,28 @@ LY_DEFINE (ly_spanner_get_bound, "ly:spanner-get-bound",
 
 /* TODO: make difference between scaled and unscalead variable in
    calling (i.e different funcs.) */
-LY_DEFINE (ly_grob_paper, "ly:grob-paper",
+LY_DEFINE (ly_grob_layout, "ly:grob-layout",
           1, 0, 0, (SCM g),
-          "Get @code{\\paper} definition from grob @var{g}.")
+          "Get @code{\\layout} definition from grob @var{g}.")
 {
   Grob * sc = unsmob_grob (g);
   SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
 
-  return sc->get_paper ()->self_scm ();
+  return sc->get_layout ()->self_scm ();
 }
 
 LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain",
           1, 1, 0, (SCM g, SCM global),
           "Get an alist chain for grob @var{g}, with @var{global} as the "
           "global default. If unspecified, @code{font-defaults} "
-          "from the paper block is taken. ")
+          "from the layout block is taken. ")
 {
   Grob *sc = unsmob_grob (g);
   SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
 
   if (global == SCM_UNDEFINED)
     global
-      = sc->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+      = sc->get_layout ()->lookup_variable (ly_symbol2scm ("font-defaults"));
 
   return sc->get_property_alist_chain (global);
 }
@@ -223,3 +220,14 @@ LY_DEFINE (ly_item_break_dir, "ly:item-break-dir",
   return scm_int2num (me->break_status_dir ());
 }
 
+
+LY_DEFINE(ly_grob_key, "ly:grob-key",
+         1,0,0,
+         (SCM grob),
+         "Return the object-key for @var{grob}."
+         )
+{
+  Grob *me = unsmob_grob (grob);
+  SCM_ASSERT_TYPE (me, grob, SCM_ARG1, __FUNCTION__, "Grob");
+  return me->get_key ()->self_scm ();
+}