]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/output-def.cc
Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / output-def.cc
index e08816a7b80e6ab435b39fb481fba4949c7cd6b1..739b4b9e7be729adeec2efea548258dbaf201f94 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "output-def.hh"
 Output_def::Output_def ()
 {
   scope_ = SCM_EOL;
+  parser_ = 0;
   parent_ = 0;
-  smobify_self ();
 
+  smobify_self ();
+  
   scope_ = ly_make_anonymous_module (false);
 }
 
@@ -36,11 +38,12 @@ Output_def::Output_def (Output_def const &s)
 {
   scope_ = SCM_EOL;
   parent_ = 0;
+  parser_ = s.parser_;
   smobify_self ();
 
   input_origin_ = s.input_origin_;
   scope_ = ly_make_anonymous_module (false);
-  if (ly_c_module_p (s.scope_))
+  if (ly_is_module (s.scope_))
     ly_module_copy (scope_, s.scope_);
 }
 
@@ -51,6 +54,12 @@ Output_def::~Output_def ()
 IMPLEMENT_SMOBS (Output_def);
 IMPLEMENT_DEFAULT_EQUAL_P (Output_def);
 
+Lily_parser *
+Output_def::get_parser () const
+{
+  return parent_ ? parent_->get_parser () : parser_;
+}
+
 SCM
 Output_def::mark_smob (SCM m)
 {
@@ -90,7 +99,7 @@ Output_def::print_smob (SCM s, SCM p, scm_print_state *)
 {
   Output_def * def = unsmob_output_def (s);
   scm_puts ("#< ", p);
-  scm_puts (classname (def), p);
+  scm_puts (def->class_name (), p);
   
   (void)def;
   scm_puts (">", p);
@@ -114,13 +123,13 @@ Output_def::lookup_variable (SCM sym) const
   if (parent_)
     return parent_->lookup_variable (sym);
   
-  return SCM_EOL;
+  return SCM_UNDEFINED;
 }
 
 SCM
-Output_def::c_variable (String s) const
+Output_def::c_variable (string s) const
 {
-  return lookup_variable (ly_symbol2scm (s.to_str0 ()));
+  return lookup_variable (ly_symbol2scm (s.c_str ()));
 }
 
 void
@@ -135,7 +144,7 @@ Output_def::set_variable (SCM sym, SCM val)
 Interval
 line_dimensions_int (Output_def *def, int n)
 {
-  Real lw = def->get_dimension (ly_symbol2scm ("linewidth"));
+  Real lw = def->get_dimension (ly_symbol2scm ("line-width"));
   Real ind = n ? 0.0 : def->get_dimension (ly_symbol2scm ("indent"));
   return Interval (ind, lw);
 }