2 translator-scheme.cc -- implement Scheme context functions
4 source file of the GNU LilyPond music typesetter
6 (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "translator.hh"
11 #include "context-def.hh"
13 #include "translator-group.hh"
14 #include "lily-guile.hh"
19 LY_DEFINE(ly_translator_name,
20 "ly:translator-name", 1,0,0, (SCM trans),
21 "Return the type name of the translator object @var{trans}. The name is a symbol.")
23 Translator * tr = unsmob_translator (trans);
24 SCM_ASSERT_TYPE(tr, trans, SCM_ARG1, __FUNCTION__, "Translator");
26 char const* nm = classname (tr);
27 return ly_symbol2scm (nm);
31 LY_DEFINE(ly_translator_description,
32 "ly:translator-description",
34 "Return an alist of properties of translator @var{me}.")
36 Translator *tr =unsmob_translator (me);
37 SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Translator");
39 return tr->translator_description ();
44 Translator::print_smob (SCM s, SCM port, scm_print_state *)
46 Translator *sc = (Translator *) ly_cdr (s);
48 scm_puts ("#<Translator ", port);
49 scm_puts (classname (sc), port);
52 don't try to print properties, that is too much hassle.
54 scm_puts (" >", port);