X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Foutput-def.cc;h=f9fbda9fb6d3335dd90ad623ce917f5d06510f74;hb=8b649b5ed48e87329185796af4aa10352a08ca4b;hp=0010d69b4f41286751856619721c82b5dd288103;hpb=6ddd5b9373861e63801b29b336580621ca4b9ef1;p=lilypond.git diff --git a/lily/output-def.cc b/lily/output-def.cc index 0010d69b4f..f9fbda9fb6 100644 --- a/lily/output-def.cc +++ b/lily/output-def.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2005 Han-Wen Nienhuys + (c) 1997--2009 Han-Wen Nienhuys */ #include "output-def.hh" @@ -27,8 +27,9 @@ Output_def::Output_def () { scope_ = SCM_EOL; parent_ = 0; - smobify_self (); + smobify_self (); + scope_ = ly_make_anonymous_module (false); } @@ -80,7 +81,7 @@ assign_context_def (Output_def * m, SCM transdef) /* find the translator for NAME. NAME must be a symbol. */ SCM find_context_def (Output_def const *m, SCM name) -{ +{ Context_def *cd = unsmob_context_def (m->lookup_variable (name)); return cd ? cd->self_scm () : SCM_EOL; } @@ -90,9 +91,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); - - (void)def; + scm_puts (def->class_name (), p); scm_puts (">", p); return 1; } @@ -108,19 +107,19 @@ SCM Output_def::lookup_variable (SCM sym) const { SCM var = ly_module_lookup (scope_, sym); - if (SCM_VARIABLEP (var) && SCM_VARIABLE_REF(var) != SCM_UNDEFINED) + if (SCM_VARIABLEP (var) && SCM_VARIABLE_REF (var) != SCM_UNDEFINED) return SCM_VARIABLE_REF (var); 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,8 +134,10 @@ 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 ind = n ? 0.0 : def->get_dimension (ly_symbol2scm ("indent")); + Real lw = def->get_dimension (ly_symbol2scm ("line-width")); + Real ind = n + ? def->get_dimension (ly_symbol2scm ("short-indent")) + : def->get_dimension (ly_symbol2scm ("indent")); return Interval (ind, lw); }