]> git.donarmstrong.com Git - lilypond.git/blob - lily/translator-scheme.cc
* lily/include/grob-info.hh: origin_contexts() now does not
[lilypond.git] / lily / translator-scheme.cc
1 /*   
2   translator-scheme.cc --  implement Scheme context functions
3  
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7
8  */
9
10 #include "translator.hh"
11 #include "context-def.hh"
12
13 #include "translator-group.hh"
14 #include "lily-guile.hh"
15
16
17
18
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.")
22 {
23   Translator * tr =  unsmob_translator (trans);
24   SCM_ASSERT_TYPE(tr, trans, SCM_ARG1, __FUNCTION__, "Translator");
25
26   char const* nm = classname (tr);
27   return ly_symbol2scm (nm);
28 }
29
30
31 LY_DEFINE(ly_translator_description,
32           "ly:translator-description",
33           1,0,0, (SCM me),
34           "Return an alist of properties of  translator @var{me}.")
35 {
36   Translator *tr =unsmob_translator (me);
37   SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Context");
38
39   return tr->translator_description ();
40 }
41
42
43 int
44 Translator::print_smob (SCM s, SCM port, scm_print_state *)
45 {
46   Translator *sc = (Translator *) ly_cdr (s);
47      
48   scm_puts ("#<Translator ", port);
49   scm_puts (classname (sc), port);
50
51   /*
52     don't try to print properties, that is too much hassle.
53    */
54   scm_puts (" >", port);
55   
56   return 1;
57 }
58