X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpaper-outputter.cc;h=5f02a7654923572f7e05aafc808a70495a0ceda5;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=778c15880ef980bab22f5a38088c399fa1b0e1d0;hpb=e1d1549f83ea4fd510f1a59faec38ebabc73de54;p=lilypond.git diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 778c15880e..5f02a76549 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -3,19 +3,21 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2005 Han-Wen Nienhuys + (c) 1997--2008 Han-Wen Nienhuys Jan Nieuwenhuizen */ #include "paper-outputter.hh" -#include +#include #include +using namespace std; + #include "dimensions.hh" #include "file-name.hh" #include "font-metric.hh" -#include "input-smob.hh" +#include "input.hh" #include "lily-version.hh" #include "main.hh" #include "output-def.hh" @@ -27,15 +29,14 @@ #include "ly-smobs.icc" -Paper_outputter::Paper_outputter (String file_name, String format) +Paper_outputter::Paper_outputter (SCM port, string format) { - file_ = SCM_EOL; + file_ = port; output_module_ = SCM_EOL; smobify_self (); - file_name_ = file_name; - String module_name = "scm output-" + format; - output_module_ = scm_c_resolve_module (module_name.to_str0 ()); + string module_name = "scm output-" + format; + output_module_ = scm_c_resolve_module (module_name.c_str ()); } Paper_outputter::~Paper_outputter () @@ -62,18 +63,8 @@ Paper_outputter::print_smob (SCM x, SCM p, scm_print_state*) } SCM -Paper_outputter::file () +Paper_outputter::file () const { - if (file_ == SCM_EOL) - if (file_name_ == "-") - file_ = scm_current_output_port (); - else - /* - Opening binary sucks a little for DOS, since PS doesn't look like - ASCII anymore, but binary CFFs will get embedded correctly. - */ - file_ = scm_open_file (scm_makfrom0str (file_name_.to_str0 ()), - scm_makfrom0str ("wb")); return file_; }