1 /*****************************************************************************\
2 ljzjs.h : Interface for the LJZjs class
4 Copyright (c) 1996 - 2007, 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 \*****************************************************************************/
35 #if defined (APDK_LJZJS_MONO) || defined (APDK_LJZJS_COLOR) || defined (APDK_LJM1005)
37 #include "hpjbig_wrapper.h"
45 class LJZjs : public Printer
48 LJZjs (SystemServices* pSS, int numfonts = 0, BOOL proto = FALSE);
51 virtual Header* SelectHeader (PrintContext* pc);
52 virtual DRIVER_ERROR VerifyPenInfo ();
53 virtual DRIVER_ERROR ParsePenInfo (PEN_TYPE& ePen, BOOL QueryPrinter = TRUE);
54 virtual DRIVER_ERROR Encapsulate (const RASTERDATA *pRasterData, BOOL bLastPlane)
58 virtual DRIVER_ERROR Flush (int FlushSize);
59 virtual DRIVER_ERROR SkipRasters (int iBlankRasters);
60 int SendChunkHeader (BYTE *szStr, DWORD dwSize, DWORD dwChunkType, DWORD dwNumItems);
61 int SendItem (BYTE *szStr, BYTE cType, WORD wItem, DWORD dwValue, DWORD dwExtra = 0);
62 int SendIntItem (BYTE *szStr, int iItem, int iItemType, int iItemValue);
63 DRIVER_ERROR SendChunkAndItemHeader (BYTE type, void *obj);
65 virtual BOOL GetMargins (PAPER_SIZE ps, float *fMargins)
67 fMargins[0] = (float) 0.25;
68 fMargins[1] = (float) 0.25;
69 fMargins[2] = (float) 0.2;
70 fMargins[3] = (float) 0.2;
73 PRINTER_TYPE m_iPrinterType;
78 virtual LJZjs & operator = (Printer& rhs)
86 DRIVER_ERROR JbigCompress ();
87 DRIVER_ERROR JbigCompress_LJZjsColor2 ();
88 DRIVER_ERROR SendItemData (BYTE ItemType, WORD Item, DWORD dwValue);
89 DRIVER_ERROR StartPage (DWORD dwWidth, DWORD dwHeight);
90 virtual DRIVER_ERROR EndPage ()
94 virtual DRIVER_ERROR SendPlaneData (int iPlaneNumber, HPLJZjsJbgEncSt *se, HPLJZjcBuff *pcBuff, BOOL bLastStride)
98 virtual int GetOutputResolutionY ()
\r
103 static const unsigned char szByte1[256];
104 static const unsigned char szByte2[256];
105 void *m_hHPLibHandle;
108 DWORD m_dwCurrentRaster;
109 DWORD m_dwLastRaster;
110 BYTE *m_pszInputRasterData;
112 PrintContext *thePrintContext;
113 BOOL m_bStartPageSent;
114 COLORMODE m_cmColorMode;
119 BOOL m_bLJZjsColor2Printer ; /*TRUE when the Printer model follows LJZjsColor-2 encapsulation format, else FALSE*/
141 /* 0x00*/ ZJI_PAGECOUNT,
142 /* 0x01*/ ZJI_DMCOLLATE,
143 /* 0x02*/ ZJI_DMDUPLEX,
145 /* 0x03*/ ZJI_DMPAPER,
146 /* 0x04*/ ZJI_DMCOPIES,
147 /* 0x05*/ ZJI_DMDEFAULTSOURCE,
148 /* 0x06*/ ZJI_DMMEDIATYPE,
150 /* 0x08*/ ZJI_RESOLUTION_X,
151 /* 0x09*/ ZJI_RESOLUTION_Y,
152 /* 0x0A */ ZJI_OFFSET_X,
153 /* 0x0B */ ZJI_OFFSET_Y,
154 /* 0x0C */ ZJI_RASTER_X,
155 /* 0x0D */ ZJI_RASTER_Y,
157 /* 0x0E */ ZJI_COLLATE,
158 /* 0x0F */ ZJI_QUANTITY,
160 /* 0x10 */ ZJI_VIDEO_BPP,
161 /* 0x11 */ ZJI_VIDEO_X,
162 /* 0x12 */ ZJI_VIDEO_Y,
163 /* 0x13 */ ZJI_INTERLACE,
164 /* 0x14 */ ZJI_PLANE,
165 /* 0x15 */ ZJI_PALETTE,
168 /* 0x17 */ ZJI_TONER_SAVE,
170 /* 0x18 */ ZJI_MEDIA_SIZE_X,
171 /* 0x19 */ ZJI_MEDIA_SIZE_Y,
172 /* 0x1A */ ZJI_MEDIA_SIZE_UNITS,
174 /* 0x1B */ ZJI_CHROMATIC,
176 /* 0x63 */ ZJI_PAD = 99,
178 /* 0x64 */ ZJI_PROMPT,
180 /* 0x65 */ ZJI_BITMAP_TYPE,
181 /* 0x66 */ ZJI_ENCODING_DATA,
182 /* 0x67 */ ZJI_END_PLANE,
184 /* 0x68 */ ZJI_BITMAP_PIXELS,
185 /* 0x69 */ ZJI_BITMAP_LINES,
186 /* 0x6A */ ZJI_BITMAP_BPP,
187 /* 0x6B */ ZJI_BITMAP_STRIDE,
211 #endif // defned (APDK_LJZJS_MONO) || defined (APDK_LJZJS_COLOR) || defined (APDK_LJM1005)
212 #endif //APDK_LJZJS_H