#include "string-convert.hh"
#include "main.hh"
#include "file-results.hh"
-#include "header.hh"
+#include "scope.hh"
#include "paper-stream.hh"
#include "ps-stream.hh"
#include "ps-outputter.hh"
+#include "scope.hh"
+#include "dictionary-iter.hh"
+#include "identifier.hh"
Ps_lookup::Ps_lookup ()
: Lookup ()
return a;
}
+Lookup*
+Ps_lookup::lookup_p (Lookup const& l) const
+{
+ return new Ps_lookup (l);
+}
+
+Lookup*
+Ps_lookup::lookup_p (Symtables const& s) const
+{
+ return new Ps_lookup (s);
+}
+extern char const *lily_version_number_sz ();
+
+String
+header_to_ps_string (Scope *head)
+{
+ String s;
+ String lily_id_str = "Lily was here, " +
+ String (lily_version_number_sz ());
+
+ s+= "/lily_id_string\n{" + lily_id_str + "} bind def\n";
+
+ for (Dictionary_iter<Identifier*> i (*head); i.ok (); i++)
+ {
+ if (!i.val ()->access_String_identifier ())
+ continue;
+
+ String val = *i.val()->access_String_identifier ()->data_p_;
+
+ s += "/mudela" + i.key () + "{" + val + "} bind def\n";
+ }
+
+ return s;
+}
+
+Paper_outputter*
+Ps_lookup::paper_outputter_p (Paper_stream* os_p, Paper_def* paper_l, Header* header_l, String origin_str) const
+{
+ if (header_global_p)
+ *os_p << header_to_ps_string (header_global_p);
+
+ *os_p << _ ("\n% outputting Score, defined at: ") << origin_str << '\n';
+
+ if (header_l)
+ {
+ *os_p << header_to_ps_string (header_l);
+ }
+
+ *os_p << paper_l->ps_output_settings_str ();
+
+ if (experimental_features_global_b)
+ *os_p << "turnOnExperimentalFeatures\n";
+
+ return new Ps_outputter (os_p);
+}
+
+Paper_stream*
+Ps_lookup::paper_stream_p () const
+{
+ String outname = base_output_str ();
+
+ if (outname != "-")
+ outname += ".ps";
+ *mlog << _f ("PostScript output to %s...",
+ outname == "-" ? String ("<stdout>") : outname ) << endl;
+ target_str_global_array.push (outname);
+ return new Ps_stream (outname);
+}
+
Atom
Ps_lookup::plet (Real dy , Real dx, Direction dir) const
{
return Lookup::text (style, "(" + text + ")");
}
+String
+Ps_lookup::unknown_str () const
+{
+ return "unknown ";
+}
+
Atom
Ps_lookup::vbracket (Real &y) const
{