1 /*
2   postscript_print.h
3 
4 
5   For Tux Paint
6   PostScript(r) printing routine.
7   (for non-Windows, non-Mac OS X, non-BeOS platforms, e.g. Linux)
8   (moved from tuxpaint.c in 0.9.17)
9 
10   Copyright (c) 2008 by Bill Kendrick and others
11   bill@newbreedsoftware.com
12   http://www.tuxpaint.org/
13 
14   This program is free software; you can redistribute it and/or modify
15   it under the terms of the GNU General Public License as published by
16   the Free Software Foundation; either version 2 of the License, or
17   (at your option) any later version.
18 
19   This program is distributed in the hope that it will be useful,
20   but WITHOUT ANY WARRANTY; without even the implied warranty of
21   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   GNU General Public License for more details.
23 
24   You should have received a copy of the GNU General Public License
25   along with this program; if not, write to the Free Software
26   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27   (See COPYING.txt)
28 
29   June 24, 2007 - December 7, 2008
30   $Id$
31 */
32 
33 #ifndef POSTSCRIPT_PRINT_H
34 #define POSTSCRIPT_PRINT_H
35 
36 #include <stdio.h>
37 #include <sys/wait.h>
38 #include "SDL.h"
39 #include "compiler.h"
40 
41 
42 /* Method for printing images: */
43 
44 /* FIXME: We should either settle on direct PostScript printing and remove
45    the other options, or move these settings to Makefile -bjk 2007.06.25 */
46 
47 #define PRINTMETHOD_PS          /* Direct to PostScript */
48 //#define PRINTMETHOD_PNM_PS       /* Output PNM, assuming it gets printed */
49 //#define PRINTMETHOD_PNG_PNM_PS   /* Output PNG, assuming it gets printed */
50 
51 
52 
53 /* Default print and alt-print command, depending on the print method: */
54 
55 #define DEFAULT_PRINTCOMMAND "lpr"
56 #define DEFAULT_ALTPRINTCOMMAND "kprinter"
57 
58 #ifdef PRINTMETHOD_PNG_PNM_PS
59 #define PRINTCOMMAND "pngtopnm | pnmtops | " DEFAULT_PRINTCOMMAND
60 #elif defined(PRINTMETHOD_PNM_PS)
61 #define PRINTCOMMAND "pnmtops | " DEFAULT_PRINTCOMMAND
62 #elif defined(PRINTMETHOD_PS)
63 #define PRINTCOMMAND DEFAULT_PRINTCOMMAND
64 #else
65 #error No print method defined!
66 #endif
67 
68 #ifdef PRINTMETHOD_PNG_PNM_PS
69 #define ALTPRINTCOMMAND "pngtopnm | pnmtops | " DEFAULT_ALTPRINTCOMMAND
70 #elif defined(PRINTMETHOD_PNM_PS)
71 #define ALTPRINTCOMMAND "pnmtops | " DEFAULT_ALTPRINTCOMMAND
72 #elif defined(PRINTMETHOD_PS)
73 #define ALTPRINTCOMMAND DEFAULT_ALTPRINTCOMMAND
74 #else
75 #error No alt print method defined!
76 #endif
77 
78 
79 #ifdef PRINTMETHOD_PS
80 
81 int do_ps_save(FILE * fi,
82                const char *restrict const fname, SDL_Surface * surf, const char *restrict pprsize, int is_pipe);
83 
84 #endif
85 
86 #endif /* POSTSCRIPT_PRINT_H */
87