]> git.donarmstrong.com Git - lilypond.git/blob - lily/ps-stream.cc
4bdbc9e2bfb4f20b67098bce6f9b9679fe5aa10f
[lilypond.git] / lily / ps-stream.cc
1 /*
2   tex-stream.cc -- implement Ps_stream
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   Jan Nieuwenhuizen <janneke@gnu.org>
8 */
9
10 #include <fstream.h>
11 #include <time.h>
12
13 #include "main.hh"
14 #include "ps-stream.hh"
15 #include "debug.hh"
16
17 Ps_stream::Ps_stream (String filename)
18   : Paper_stream (filename)
19 {
20   header ();
21 }
22
23 Ps_stream::~Ps_stream ()
24 {
25   *os << "\nshowpage\n";
26 }
27
28 void
29 Ps_stream::header ()
30 {
31   *os << _ ("%!PS-Adobe-3.0\n");
32   // urg, merge with Tex
33   *os << _ ("%%Creator: ");
34   if (no_timestamps_global_b)
35     *os << "GNU LilyPond\n";
36   else
37     *os << get_version_str () << '\n';
38   *os << _ ("%%Automatically generated");
39   if (no_timestamps_global_b)
40     *os << ".\n";
41   else
42     {
43       *os << _ (", at ");
44       time_t t (time (0));
45       *os << ctime (&t) << "%\n";
46     }
47 }
48
49 // print string. don't forget indent.
50 Paper_stream&
51 Ps_stream::operator << (Scalar s)
52 {
53   return Paper_stream::operator << (s);
54 }
55