1 /*****************************************************************************\
2 pscript.h : Interface for the PScript class
4 Copyright (c) 1996 - 2001, Hewlett-Packard Co.
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. Neither the name of Hewlett-Packard nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
20 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
22 NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24 TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
25 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 \*****************************************************************************/
32 #ifndef APDK_PSCRIPT_H
33 #define APDK_PSCRIPT_H
45 #ifdef APDK_HIGH_RES_MODES
46 #define PS_BASE_RES 300
48 #define PS_BASE_RES 150
52 typedef struct _StrList
55 struct _StrList *next;
61 class PScript : public Printer
64 PScript (SystemServices* pSS,int numfonts=0, BOOL proto=FALSE);
67 PrintMode* GetMode (int index);
69 virtual Header* SelectHeader (PrintContext* pc);
70 virtual DRIVER_ERROR VerifyPenInfo ();
71 virtual DRIVER_ERROR ParsePenInfo (PEN_TYPE& ePen, BOOL QueryPrinter=TRUE);
72 virtual DISPLAY_STATUS ParseError (BYTE status_reg);
73 virtual DRIVER_ERROR Encapsulate (const RASTERDATA* InputRaster, BOOL bLastPlane);
74 inline virtual BOOL SupportSeparateBlack (PrintMode *pCurrentMode) {return FALSE;}
75 virtual DRIVER_ERROR Flush (int FlushSize);
76 DRIVER_ERROR SkipRasters (int nBlankRasters);
78 virtual int PrinterLanguage ()
80 return 10; // PostScript
83 virtual DRIVER_ERROR SaveText (const char *psStr, int iPointSize, int iX, int iY,
84 const char *pTextString, int iTextStringLen,
87 virtual BOOL UseCMYK(unsigned int iPrintMode) { return FALSE;}
89 DRIVER_ERROR SendText (int iCurYPos);
91 void JpegData (BYTE *buffer, int iSize);
96 virtual PScript & operator = (Printer& rhs)
103 DRIVER_ERROR SendImage ();
104 void AddRaster (BYTE *pbyRow, int iLength);
107 DRIVER_ERROR StartJpegCompression ();
108 void FinishJpegCompression ();
112 struct jpeg_compress_struct m_cinfo;
113 struct jpeg_error_mgr m_jerr;
114 jmp_buf m_setjmp_buffer;
116 unsigned int m_iRowNumber;
118 int m_iJpegBufferPos;
119 int m_iJpegBufferSize;
120 BYTE *m_pbyInputRaster;
121 BYTE *m_pbyJpegBuffer;
122 BYTE *m_pbyEncodedBuffer;
124 COLORMODE m_eColorMode;
127 class PScriptDraftMode : public PrintMode
131 }; // PScriptDraftMode
133 class PScriptNormalMode : public PrintMode
136 PScriptNormalMode ();
137 }; // PScriptNormalMode
139 class PScriptGrayMode : public PrintMode
143 }; // PScriptGrayMode
148 ******************************************************************************/
149 class PScriptProxy : public PrinterProxy
152 PScriptProxy() : PrinterProxy(
153 "PostScript", // family name
154 "postscript\0" // models
155 "HP Color LaserJet 2605\0"
156 "HP Color LaserJet 2605dn\0"
157 #ifdef APDK_MLC_PRINTER
159 ) {m_iPrinterType = ePScript;}
160 inline Printer* CreatePrinter(SystemServices* pSS) const { return new PScript(pSS); }
161 inline PRINTER_TYPE GetPrinterType() const { return ePScript;}
162 inline unsigned int GetModelBit() const { return 0x10;}
168 #endif // APDK_PSCRIPT
169 #endif //APDK_PSCRIPT_H