]> git.donarmstrong.com Git - lilypond.git/blob - lily/tex-def.cc
bd9d61acb260d5a8cf7770a889bdfe4a865e8639
[lilypond.git] / lily / tex-def.cc
1 /*
2   tex-def.cc -- implement Tex_def
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
7 */
8
9 #include "assoc.hh"
10 #include "assoc-iter.hh"
11 #include "identifier.hh"
12 #include "scope.hh"
13 #include "tex-def.hh"
14 #include "tex-lookup.hh"
15 #include "tex-score.hh"
16
17 IMPLEMENT_IS_TYPE_B1 (Tex_def, Paper_def);
18
19 String
20 Tex_def::dimension_str (Real r) const
21 {
22   return Paper_def::dimension_str (r) + "pt";
23 }
24
25 Lookup*
26 Tex_def::lookup_p (Lookup const& l) const
27 {
28   return new Tex_lookup (l);
29 }
30
31 Lookup*
32 Tex_def::lookup_p (Symtables const& s) const
33 {
34   return new Tex_lookup (s);
35 }
36
37 String
38 Tex_def::output_settings_str () const
39 {
40   String s ("\n ");
41   for (Assoc_iter<String,Identifier*> i (*scope_p_); i.ok (); i++)
42     s += String ("\\def\\mudelapaper") + i.key () 
43       + "{" + i.val ()->str () + "}\n";
44   s +=  *scope_p_->elem ("texsetting")->access_String ();
45   return s;
46 }
47
48 Paper_score*
49 Tex_def::paper_score_p () const
50 {
51   return new Tex_score ();
52 }
53  
54 String
55 Tex_def::unknown_str () const
56 {
57   return "\\unknown";
58 }
59