1 /*****************************************************************************\
2 internal.h : Interface for internal classes
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_INTERNAL_H
33 #define APDK_INTERNAL_H
37 /////////////////////////////////////////////////////////////////////////
38 // contains all class declarations
39 // for Slimhost++ driver
41 // merged in from file "Objects.h" 5/18/98
42 /////////////////////////////////////////////////////////////////////////
43 // these correspond to PCL codes
46 #define LETTERGOTHIC 6
50 // character set names for PCL
51 #define LATIN1 "0N" // aka ECMA94
56 // used to encourage consistent ordering of color planes
67 #define DEFAULT_SLOW_POLL_COUNT 30
68 #define DEFAULT_SLOW_POLL_BIDI 3
70 //////////////////////////////////////////
72 enum STYLE_TYPE { UPRIGHT, ITALIC };
74 enum WEIGHT_TYPE { NORMAL, BOLD };
76 enum DATA_FORMAT { RASTER_LINE, RASTER_STRIP };
79 ///////////////////////////////////////////////////////////////////
81 #define MAX_ESC_SEQ 40
82 #define MAX_RASTERSIZE 10000 // REVISIT
84 #define MAX_Y_OFFSET 32767
85 // very frequently used fragments made into macros for readability
86 #define CERRCHECK if (constructor_error != NO_ERROR) {DBG1("CERRCHECK fired\n"); return;}
87 #define ERRCHECK if (err != NO_ERROR) {DBG1("ERRCHECK fired\n"); return err;}
88 #define NEWCHECK(x) if (x==NULL) return ALLOCMEM_ERROR;
89 #define CNEWCHECK(x) if (x==NULL) { constructor_error=ALLOCMEM_ERROR; return; }
93 //////// STATIC DATA ////////////////////////////////////////////////////////////////
94 // escape sequences -- see PCL Implementor's Guide or Software Developer's PCL Guides
98 const char UEL[] = {ESC, '%', '-','1','2','3','4','5','X' };
99 const char EnterLanguage[] = {'@','P','J','L',' ','E','N','T','E','R',' ',
100 'L','A','N','G','U','A','G','E','=' };
101 const char PCL3[] = {'P','C','L','3' };
102 const char PCLGUI[] = {'P','C','L','3','G','U','I' };
103 const char JobName[] = {'@','P','J','L',' ','J','O','B',' ','N','A','M','E',' ','=',' '};
104 const char Reset[] = {ESC,'E'};
105 const char crdStart[] = {ESC, '*', 'g'}; // configure raster data command
106 const char cidStart[] = {ESC, '*', 'v'}; // configure image data command
107 const char crdFormat = 2; // only format for 600
108 const char grafStart[] = {ESC, '*', 'r', '1', 'A'}; // raster graphics mode
109 const char grafMode0[] = {ESC, '*', 'b', '0', 'M'}; // compression methods
110 const char grafMode9[] = {ESC, '*', 'b', '9', 'M'};
111 const char grafMode2[] = {ESC, '*', 'b', '2', 'M'};
112 const char SeedSame[] = {ESC, '*', 'b', '0', 'S'};
113 //const char EjectPage[] = {ESC, '&', 'l', '0', 'H'}; // not needed by us; will pick if no page already picked
114 const char BlackExtractOff[] = {ESC, '*', 'o', '5', 'W', 0x04, 0xC, 0, 0, 0 };
115 const char LF = '\012';
116 const char Quote = '\042';
117 const BYTE DJ895_Power_On[] = {ESC, '%','P','u','i','f','p','.',
118 'p','o','w','e','r',' ','1',';',
119 'u','d','w','.','q','u','i','t',';',ESC,'%','-','1','2','3','4','5','X' };
120 /*const BYTE DJ895_Pre_Pick[] = {ESC, '&', 'l', -2, 'H'};
121 {ESC, '%','P','m','e','c','h','.',
122 'l','o','a','d','_','p','a','p','e','r',';',
123 'u','d','w','.','q','u','i','t',';' };//,ESC,'%','-','1','2','3','4','5','X' };
125 const char EnableDuplex[] = { ESC,'&','l', '2', 'S'};
126 const char NoDepletion[] = {ESC, '*', 'o', '1', 'D'};
127 const char NoGrayBalance[] = {ESC, '*', 'b', '2', 'B'};
128 const char EnableBufferFlushing[] = { ESC,'&','b','1','5','W','P','M','L',32,4,0,5,1,2,1,1,5,4,1,1 };
129 const char DisableBufferFlushing[] = { ESC,'&','b','1','5','W','P','M','L',32,4,0,5,1,2,1,1,5,4,1,2 };
130 const char DriverwareJobName[] = { ESC,'*','o','5','W',0x0d,0x06,0x00,0x00,0x01 };
131 const BYTE PEN_CLEAN_PML[]={0x1B,0x45,0x1B,0x26,0x62,0x31,0x36,0x57,
132 0x50,0x4D,0x4C,0x20, // EscE Esc&b16WPML{space}
133 0x04,0x00,0x06,0x01,0x04,0x01,0x05,0x01,
134 0x01,0x04,0x01,0x64}; // PML Marking-Agent-Maintenance=100
137 // ** move these to intenal.h
152 struct fOptSubSig *OptSubSig;
159 struct fOptClassSig *OptClassSig;
166 int ScaleFactorMultiplier;
167 int ScaleFactorDivisor;
168 // int CallerAlloc; // Who does the memory alloc.
169 int Remainder; // For use in non integer scaling cases
170 int Repeat; // When to send an extra output raster
171 int RastersinBuffer; // # of currently buffered rasters
172 unsigned char* Bufferpt[NUMBER_RASTERS];
174 unsigned char* Buffer;
175 struct fOptSigSet OS;
176 struct fOptSubSig rsOptSubSigPtr1[45];
177 struct fOptClassSig OCS;
180 float filterPtr1[45];
181 float filterPtr2[45][9];
182 float joint_meansPtr1[45];
188 COLORTYPE_COLOR, // 0
189 COLORTYPE_BLACK, // 1
193 #define MAX_COLORTYPE 2
197 int rastersize[MAX_COLORTYPE];
198 BYTE* rasterdata[MAX_COLORTYPE];
201 // Bitmap structure definition
209 struct HPBITMAPINFOHEADER{
217 long biXPelsPerMeter;
218 long biYPelsPerMeter;
220 DWORD biClrImportant;
223 struct HPBITMAPINFO {
224 HPBITMAPINFOHEADER bmiHeader;
225 HPRGBQUAD bmiColors[1];
231 HPBITMAPINFO bitmapInfo;
232 unsigned long cjBits;
238 //////////////////////////////////////////
240 //Scaler, Halftoner, ColorMatcher, ErnieFilter, PixelReplicator,
241 //(FRE object, ...) are subclasses of Processor.
246 //! Executes the "Process" method in it's containee.
248 Enter a full description of the class here. This will be the API doc.
250 \sa Scaler Halftoner ColorMatcher ErnieFilter PixelReplicator
251 ******************************************************************************/
256 virtual ~Processor();
258 //virtual BOOL Process(BYTE* InputRaster=NULL, unsigned int size=0)=0; // returns TRUE iff output ready
259 virtual BOOL Process(RASTERDATA *InputRaster=NULL)=0; // returns TRUE iff output ready
260 virtual void Flush()=0; // take any concluding actions based on internal state
261 virtual BYTE* NextOutputRaster(COLORTYPE rastercolor)=0;
262 virtual unsigned int GetOutputWidth(COLORTYPE rastercolor)=0; // in bytes, not pixels
263 virtual unsigned int GetMaxOutputWidth(COLORTYPE rastercolor) { return GetOutputWidth(rastercolor); }
265 unsigned int iRastersReady, iRastersDelivered;
273 //! Manages the processes used in a pipeline
276 Enter a full description of the class here. This will be the API doc.
278 ******************************************************************************/
282 Pipeline(Processor* E);
285 void AddPhase(Pipeline* p); // add p at end
287 //DRIVER_ERROR Execute(BYTE* InputRaster=NULL, unsigned int size=0); // run pipeline
288 DRIVER_ERROR Execute(RASTERDATA* InputRaster=NULL); // run pipeline
290 DRIVER_ERROR Flush();
292 //BOOL Process(BYTE* InputRaster=NULL, unsigned int size=0); // call processor for this phase
293 BOOL Process(RASTERDATA* InputRaster=NULL); // call processor for this phase
295 BYTE* NextOutputRaster(COLORTYPE rastercolor) { return Exec->NextOutputRaster(rastercolor); }
296 unsigned int GetOutputWidth(COLORTYPE rastercolor) { return Exec->GetOutputWidth(rastercolor); }
297 unsigned int GetMaxOutputWidth(COLORTYPE rastercolor) { return Exec->GetMaxOutputWidth(rastercolor); }
308 struct PipeConfigTable
312 #if defined(APDK_VIP_COLORFILTERING)
316 BOOL bPixelReplicate;
319 HALFTONING_ALGORITHM eHT;
324 //! Scales input by a factor
327 Enter a full description of the class here. This will be the API doc.
329 ******************************************************************************/
330 class Scaler : public Processor
333 // constructor protected -- use Create_Scaler()
335 //virtual BOOL Process(BYTE* InputRaster=NULL, unsigned int size=0)=0;
336 BOOL Process(RASTERDATA* InputRaster=NULL)=0;
337 virtual void Flush() { Process(); }
339 DRIVER_ERROR constructor_error;
342 unsigned int remainder;
344 virtual unsigned int GetOutputWidth(COLORTYPE rastercolor);
345 virtual unsigned int GetMaxOutputWidth(COLORTYPE rastercolor);
346 virtual BYTE* NextOutputRaster(COLORTYPE rastercolor)=0;
349 Scaler(SystemServices* pSys,unsigned int inputwidth,
350 unsigned int numerator,unsigned int denominator, BOOL vip, unsigned int BytesPerPixel);
353 BOOL scaling; // false iff ScaleFactor==1.0
354 BOOL ReplicateOnly; // true iff 1<ScaleFactor<2
357 unsigned int iOutputWidth;
358 unsigned int iInputWidth;
359 BYTE* pOutputBuffer[MAX_COLORTYPE];
375 #ifdef APDK_LJJETREADY
376 class LJJetReadyProxy;
379 #ifdef APDK_LJFASTRASTER
380 class LJFastRasterProxy;
383 #ifdef APDK_LJZJS_MONO
384 class LJZjsMonoProxy;
387 #ifdef APDK_LJZJS_COLOR
388 class LJZjsColorProxy;
392 class LJM1005Proxy;
\r
396 #if defined(APDK_PSP100) && defined (APDK_DJ9xxVIP)
401 #if defined(APDK_DJGENERICVIP) && defined (APDK_DJ9xxVIP)
402 class DJGenericVIPProxy;
408 class OJProKx50Proxy;
415 #if defined(APDK_DJ8xx)|| defined(APDK_DJ9xx)
419 #if defined(APDK_DJ8xx)|| defined(APDK_DJ9xx)
425 #if defined(APDK_DJ890)
429 #if defined(APDK_DJ850)
433 #ifdef APDK_DJ6xxPhoto
434 class DJ6xxPhotoProxy;
461 #if defined(APDK_DJ3600) && defined (APDK_DJ3320)
467 #if defined (APDK_DJ3320)
471 #ifdef APDK_APOLLO2560
472 class Apollo2560Proxy;
475 #ifdef APDK_APOLLO21XX
476 class Apollo21xxProxy;
479 #ifdef APDK_APOLLO2XXX
480 class Apollo2xxxProxy;
483 #ifdef APDK_QUICKCONNECT
\r
484 class QuickConnectProxy;
\r
488 //! Isolates device dependencies
491 DeviceRegistry, for isolating all device dependencies
492 The data is contained in Registry.cpp
494 This object encapsulates all model-specific data for a build.
495 Its features are presented to client through the PrintContext.
497 ******************************************************************************/
502 virtual ~DeviceRegistry();
505 // get model string from DevID string
506 DRIVER_ERROR ParseDevIDString(const char* sDevID, char* strModel, int *pVIPVersion, char* strPens);
507 // set "device" to index of entry
508 virtual DRIVER_ERROR SelectDevice(char* model, int* pVIPVersion, char* pens, SystemServices* pSS);
510 virtual DRIVER_ERROR SelectDevice(const char* sDevID, SystemServices* pSS);
512 virtual DRIVER_ERROR SelectDevice(const PRINTER_TYPE Model);
514 virtual DRIVER_ERROR GetPrinterModel(char* strModel, int* pVIPVersion, char* strPens, SystemServices* pSS);
517 // create a Printer object as pointee of p, using the given SystemServices
518 // and the current value of device; still needs to be configured
519 virtual DRIVER_ERROR InstantiatePrinter(Printer*& p,SystemServices* pSS);
522 int device; // ordinal of device from list (or UNSUPPORTED=-1)
525 static PScriptProxy s_PScriptProxy;
529 static LJMonoProxy s_LJMonoProxy;
533 static LJColorProxy s_LJColorProxy;
536 #ifdef APDK_LJJETREADY
537 static LJJetReadyProxy s_LJJetReadyProxy;
540 #ifdef APDK_LJFASTRASTER
541 static LJFastRasterProxy s_LJFastRasterProxy;
544 #ifdef APDK_LJZJS_MONO
545 static LJZjsMonoProxy s_LJZjsMonoProxy;
548 #ifdef APDK_LJZJS_COLOR
549 static LJZjsColorProxy s_LJZjsColorProxy;
553 static LJM1005Proxy s_LJM1005Proxy;
\r
554 static LJP1XXXProxy s_LJP1XXXProxy;
557 #if defined(APDK_PSP100) && defined (APDK_DJ9xxVIP)
558 static PSP100Proxy s_PSP100Proxy;
559 static PSP470Proxy s_PSP470Proxy;
562 #if defined(APDK_DJGENERICVIP) && defined (APDK_DJ9xxVIP)
563 static DJGenericVIPProxy s_DJGenericVIPProxy;
564 static DJ55xxProxy s_DJ55xxProxy;
568 static DJ9xxVIPProxy s_DJ9xxVIPProxy;
569 static OJProKx50Proxy s_OJProKx50Proxy;
573 static DJ9xxProxy s_DJ9xxProxy;
576 #if defined(APDK_DJ8xx)|| defined(APDK_DJ9xx)
577 static DJ8xxProxy s_DJ8xxProxy;
580 #if defined(APDK_DJ8xx)|| defined(APDK_DJ9xx)
582 static DJ8x5Proxy s_DJ8x5Proxy;
586 #if defined(APDK_DJ890)
587 static DJ890Proxy s_DJ890Proxy;
590 #if defined(APDK_DJ850)
591 static DJ850Proxy s_DJ850Proxy;
594 #ifdef APDK_DJ6xxPhoto
595 static DJ6xxPhotoProxy s_DJ6xxPhotoProxy;
599 static DJ660Proxy s_DJ660Proxy;
603 static DJ630Proxy s_DJ630Proxy;
607 static DJ600Proxy s_DJ600Proxy;
611 static DJ540Proxy s_DJ540Proxy;
615 static DJ400Proxy s_DJ400Proxy;
619 static DJ350Proxy s_DJ350Proxy;
622 #if defined(APDK_DJ3600) && defined (APDK_DJ3320)
623 static DJ3600Proxy s_DJ3600Proxy;
624 static DJ4100Proxy s_DJ4100Proxy;
\r
625 static DJD2600Proxy s_DJD2600Proxy;
628 #if defined (APDK_DJ3320)
629 static DJ3320Proxy s_DJ3320Proxy;
632 #ifdef APDK_APOLLO2560
633 static Apollo2560Proxy s_Apollo2560Proxy;
636 #ifdef APDK_APOLLO21XX
637 static Apollo21xxProxy s_Apollo21xxProxy;
640 #ifdef APDK_APOLLO2XXX
641 static Apollo2xxxProxy s_Apollo2xxxProxy;
644 #ifdef APDK_QUICKCONNECT
\r
645 static QuickConnectProxy s_QuickConnectProxy;
\r
651 ////////////////////////////////////////////////
654 const uint32_t *ulMap1;
655 const uint32_t *ulMap2;
656 const unsigned char *ulMap3;
662 //! Base for data compression methods
664 Impliment compression
666 ******************************************************************************/
667 class Compressor : public Processor
670 Compressor(SystemServices* pSys, unsigned int RasterSize, BOOL useseed);
671 virtual ~Compressor();
673 virtual BOOL Process(RASTERDATA* InputRaster=NULL)=0;
675 virtual void Flush() { } // no pending output
677 unsigned int GetOutputWidth(COLORTYPE color);
678 virtual BYTE* NextOutputRaster(COLORTYPE color);
680 void SetSeedRow(BYTE* seed) { SeedRow=seed; }
682 DRIVER_ERROR constructor_error;
685 // buffer is public for use by GraphicsTranslator
686 BYTE* compressBuf; // output buffer
691 unsigned int compressedsize;
692 unsigned int inputsize;
702 class Mode9 : public Compressor
705 Mode9(SystemServices* pSys,unsigned int RasterSize, BOOL bVIPPrinter = FALSE);
707 BOOL Process(RASTERDATA* input);
718 class Mode2 : public Compressor
721 Mode2(SystemServices* pSys,unsigned int RasterSize);
723 BOOL Process(RASTERDATA* input);
731 class Mode3 : public Compressor
734 Mode3 (SystemServices* pSys, Printer *pPrinter, unsigned int RasterSize);
736 BOOL Process (RASTERDATA* input);
742 ////////////////////////////////////////////////////////////////////////////
743 #if defined(APDK_FONTS_NEEDED)
747 //! ASCII data support
750 Does encapsulation work specific to ascii data, including handling of fonts
753 ******************************************************************************/
757 TextTranslator(Printer* p,int quality,unsigned int colorplanes);
758 virtual ~TextTranslator();
760 DRIVER_ERROR TextOut(const char* pTextString, unsigned int LenString,
761 const Font& font, BOOL sendfont=FALSE,
762 int iAbsX=-1, int iAbsY=-1);
764 DRIVER_ERROR SendCAP(unsigned int iAbsX,unsigned int iAbsY);
765 const BYTE* ColorSequence(TEXTCOLOR eColor);
766 BYTE ColorCode(TEXTCOLOR eColor);
767 int TypefaceCode(const char* FontName);
768 const BYTE* PointsizeSequence(unsigned int iPointsize);
769 const BYTE* PitchSequence(unsigned int iPitch);
770 const BYTE* StyleSequence(BOOL bItalic);
771 const BYTE* WeightSequence(BOOL bBold);
772 const BYTE* CompleteSequence(const Font& font);
773 const BYTE* UnderlineSequence();
774 const BYTE* DisableUnderlineSequence();
776 // "transparent mode" escape to treat control code (BYTE b) as normal char
777 int TransparentChar(unsigned int iMaxLen, BYTE b, BYTE* outbuff);
779 DRIVER_ERROR constructor_error;
781 DRIVER_ERROR SendFont(const Font& font);
782 DRIVER_ERROR SendColorSequence(const TEXTCOLOR eColor);
783 DRIVER_ERROR SendPointsize(const unsigned int iPointsize);
784 DRIVER_ERROR SendPitch(const unsigned int iPitch);
785 DRIVER_ERROR SendStyle(const BOOL bItalic);
786 DRIVER_ERROR SendWeight(const BOOL bBold);
787 DRIVER_ERROR SendUnderline();
788 DRIVER_ERROR SendCompleteSequence(const Font& font);
789 DRIVER_ERROR DisableUnderline();
794 int qualcode; // pcl code for text quality
795 BYTE EscSeq[MAX_ESC_SEQ]; // storage for the command
796 unsigned int iNumPlanes; // color planes, based on pen
797 BYTE ColorCode1(TEXTCOLOR eColor); // if iNumPlanes==1 (black)
798 BYTE ColorCode3(TEXTCOLOR eColor); // if iNumPlanes==3 (CMY)
799 BYTE ColorCode4(TEXTCOLOR eColor); // if iNumPlanes==4 (KCMY)
801 // items for avoiding redundant font resets
802 // (cheaper than copying whole font)
805 char lastcharset[MAX_CHAR_SET];
809 void SetLast(const Font& font);
813 #endif //fonts needed
817 //! Composes a header stream
820 Composes a header stream, embodying specific requirements of the Printer.
822 ******************************************************************************/
826 friend class ModeJPEG;
829 Header(Printer* p,PrintContext* pc);
832 virtual DRIVER_ERROR Send()=0;
834 virtual DRIVER_ERROR EndJob();
836 virtual DRIVER_ERROR SendCAPy(unsigned int iAbsY); // made virtual for crossbow
837 virtual DRIVER_ERROR FormFeed(); // made virtual for crossbow
839 BOOL IsLastBand() { return bLastBand; }
840 void SetLastBand(BOOL lastband) { bLastBand = lastband; }
842 unsigned int CAPy; // may be moved during header; retrieved by Job
846 PrintContext* thePrintContext;
847 PrintMode* thePrintMode;
848 /// routines to set values of internal variables
849 void SetMediaType(MediaType mtype);
850 void SetMediaSize(PAPER_SIZE papersize);
851 void SetMediaSource(MediaSource msource);
852 void SetQuality(Quality qual);
853 void SetSimpleColor();
855 // components of a header
856 DRIVER_ERROR Margins();
857 virtual DRIVER_ERROR Graphics();
858 DRIVER_ERROR Simple();
859 DRIVER_ERROR Modes();
860 DRIVER_ERROR ConfigureRasterData();
862 // common escapes, plus mode and margin setting
863 virtual DRIVER_ERROR StartSend();
865 ////// data members /////////////////////////////////
866 unsigned int ResolutionX[MAXCOLORPLANES];
867 unsigned int ResolutionY[MAXCOLORPLANES];
868 unsigned int dyeCount;
872 unsigned int ColorLevels(unsigned int ColorPlane);
874 // escape sequence constants
875 char SimpleColor[6]; BYTE sccount; // color command string, and its size
876 char mediatype[6]; BYTE mtcount; // mediatype string, and its size
877 char mediasize[8]; BYTE mscount; // mediasize string, and its size
878 char mediasource[6]; BYTE msrccount; // mediasource string, and its size
879 char quality[6]; BYTE qualcount; // quality string, and its size
880 BYTE QualityCode(); // returns just the variable byte of quality
887 ******************************************************************************/
888 class Header350 : public Header
891 Header350(Printer* p,PrintContext* pc);
898 ******************************************************************************/
899 class Header400 : public Header
902 Header400(Printer* p,PrintContext* pc);
910 ******************************************************************************/
911 class Header6XX : public Header
914 Header6XX(Printer* p,PrintContext* pc);
915 virtual DRIVER_ERROR Send();
923 ******************************************************************************/
924 class Header600 : public Header6XX
927 Header600(Printer* p,PrintContext* pc);
935 ******************************************************************************/
936 class Header690 : public Header
939 Header690(Printer* p,PrintContext* pc);
946 ******************************************************************************/
947 class Header540 : public Header
950 Header540(Printer* p,PrintContext* pc);
958 ******************************************************************************/
959 class Header895 : public Header
962 Header895(Printer* p,PrintContext* pc);
963 virtual DRIVER_ERROR Send();
966 DRIVER_ERROR Graphics();
967 DRIVER_ERROR StartSend();
973 ******************************************************************************/
974 class Header850 : public Header895
977 Header850(Printer* p,PrintContext* pc);
980 DRIVER_ERROR StartSend();
987 ******************************************************************************/
988 class Header900 : public Header895
991 Header900(Printer* p,PrintContext* pc);
992 virtual DRIVER_ERROR Send();
995 BOOL DuplexEnabled(BYTE* bDevIDBuff);
1001 ******************************************************************************/
1002 class HeaderDJ990 : public Header
1005 HeaderDJ990(Printer* p,PrintContext* pc);
1006 DRIVER_ERROR ConfigureRasterData();
1007 DRIVER_ERROR ConfigureImageData();
1008 DRIVER_ERROR Send();
1009 DRIVER_ERROR StartSend();
1010 void SetMediaSource(MediaSource msource);
1015 ******************************************************************************/
1016 class HeaderDJGenericVIP : public HeaderDJ990
1019 HeaderDJGenericVIP (Printer *p, PrintContext *pc);
1021 unsigned int m_uiCAPy;
1022 DRIVER_ERROR SendCAPy (unsigned int iAbsY);
1023 DRIVER_ERROR FormFeed ();
1024 }; // HeaderDJGenericVIP
1028 ******************************************************************************/
1029 class Header630 : public Header
1032 Header630(Printer* p,PrintContext* pc);
1033 DRIVER_ERROR Send();
1039 ******************************************************************************/
1040 class Header2xxx : public Header
1043 Header2xxx(Printer* p,PrintContext* pc);
1044 DRIVER_ERROR Send();
1050 ******************************************************************************/
1051 class Header3320 : public Header
1054 Header3320 (Printer *p, PrintContext *pc);
1055 DRIVER_ERROR Send ();
1057 DRIVER_ERROR EndJob ();
1058 DRIVER_ERROR FormFeed ();
1059 DRIVER_ERROR SendCAPy (unsigned int iAbsY);
1063 ******************************************************************************/
1064 class Header21xx : public Header
1067 Header21xx(Printer* p,PrintContext* pc);
1068 DRIVER_ERROR Send();
1073 ******************************************************************************/
1074 class HeaderLJMono : public Header
1077 HeaderLJMono (Printer* p,PrintContext* pc);
1078 virtual DRIVER_ERROR Send();
1081 DRIVER_ERROR EndJob ();
1082 DRIVER_ERROR Graphics ();
1083 DRIVER_ERROR StartSend ();
1088 ******************************************************************************/
1089 class HeaderLJColor : public Header
1092 HeaderLJColor (Printer* p,PrintContext* pc);
1093 virtual DRIVER_ERROR Send();
1094 virtual DRIVER_ERROR FormFeed ();
1097 DRIVER_ERROR EndJob ();
1098 DRIVER_ERROR Graphics ();
1099 DRIVER_ERROR StartSend ();
1100 DRIVER_ERROR SendCAPy (unsigned int iAbsY);
1105 ******************************************************************************/
1106 class HeaderPScript : public Header
1109 HeaderPScript (Printer *p, PrintContext *pc);
1110 DRIVER_ERROR Send ();
1112 DRIVER_ERROR EndJob ();
1113 DRIVER_ERROR FormFeed ();
1114 DRIVER_ERROR SendCAPy (unsigned int iAbsY);
1115 DRIVER_ERROR StartSend ();
1120 ******************************************************************************/
1121 class HeaderLJJetReady : public Header
1123 friend class LJJetReady;
1125 HeaderLJJetReady (Printer* p,PrintContext* pc);
1126 virtual DRIVER_ERROR Send();
1127 virtual DRIVER_ERROR FormFeed ();
1128 virtual DRIVER_ERROR StartPage();
1129 virtual DRIVER_ERROR EndPage();
1131 DRIVER_ERROR EndJob ();
1132 DRIVER_ERROR StartSend ();
1133 DRIVER_ERROR SendCAPy (unsigned int iAbsY);
1134 DRIVER_ERROR MapPCLMediaTypeToString (MEDIATYPE eM);
1135 int JRPaperToMediaSize(PAPER_SIZE ps);
1136 }; //HeaderLJJetReady
1140 ******************************************************************************/
1141 class HeaderLJFastRaster : public Header
1143 friend class LJFastRaster;
1145 HeaderLJFastRaster (Printer* p,PrintContext* pc);
1146 virtual DRIVER_ERROR Send();
1147 virtual DRIVER_ERROR FormFeed ();
1148 virtual DRIVER_ERROR StartPage();
1149 virtual DRIVER_ERROR EndPage();
1151 DRIVER_ERROR EndJob ();
1152 DRIVER_ERROR StartSend ();
1153 DRIVER_ERROR SendCAPy (unsigned int iAbsY);
1154 DRIVER_ERROR MapPCLMediaTypeToString (MEDIATYPE eM);
1155 int FrPaperToMediaSize(PAPER_SIZE ps);
1156 }; //HeaderLJFastRaster
1160 ******************************************************************************/
1161 class HeaderLJZjs : public Header
1165 HeaderLJZjs (Printer *p, PrintContext *pc);
1166 virtual DRIVER_ERROR Send ();
1167 virtual DRIVER_ERROR FormFeed ();
1169 DRIVER_ERROR EndJob ();
1170 DRIVER_ERROR SendCAPy (unsigned int iAbsY);
1175 ******************************************************************************/
\r
1176 class HeaderQuickConnect : public Header
\r
1179 HeaderQuickConnect (Printer *p, PrintContext *pc);
\r
1180 virtual DRIVER_ERROR Send ();
\r
1181 virtual DRIVER_ERROR FormFeed ();
\r
1183 DRIVER_ERROR EndJob ();
\r
1184 DRIVER_ERROR SendCAPy (unsigned int iAbsY);
\r
1185 }; // HeaderQuickConnect
\r
1189 ******************************************************************************/
\r
1191 class RasterSender : public Processor
1193 friend class Header;
1194 friend class Header895;
1195 friend class Header900;
1197 // installs Header and Connection
1198 RasterSender(Printer* pP, PrintContext* pPC,
1199 Job* pJob,Halftoner* pHalftoner);
1201 virtual ~RasterSender();
1203 // processor interface ////////////////////////////////////
1204 //BOOL Process(BYTE* InputRaster=NULL, unsigned int size=0);
1205 BOOL Process(RASTERDATA* InputRaster=NULL);
1207 BYTE* NextOutputRaster(COLORTYPE rastercolor) { return NULL; } // end of pipeline
1208 unsigned int GetOutputWidth(COLORTYPE rastercolor) { return 0; } // never called
1211 DRIVER_ERROR constructor_error;
1213 DRIVER_ERROR SendRaster(RASTERDATA* InputRaster=NULL);
1216 Printer* thePrinter;
1218 PrintContext* thePrintContext;
1220 Halftoner* theHalftoner;
1221 long m_lNBlankRasters; /* XXX unused? */
1224 // end of RasterSender section ///////////////////////////////////////////////
1225 ////////////////////////////////////////////////////////////////////////////
1227 #if defined(APDK_FONTS_NEEDED)
1230 //! Encapsulate mappings
1233 Component of TextManager
1234 This class encapsulates mappings that may be peculiar to different partners
1235 or data sources. The use is as follows:
1237 2. now access SubstLen and charset
1239 Currently sets charset to LATIN1 at construction.
1241 ******************************************************************************/
1245 TextMapper(TextTranslator* t);
1247 // main function -- puts alternate string in buffer
1248 virtual void Map(BYTE b,BYTE* bSubst);
1250 // public members for access after call to Map()
1251 unsigned int SubstLen;
1252 char charset[MAX_CHAR_SET];
1255 TextTranslator* theTranslator;
1261 ******************************************************************************/
1262 class GenericMapper : public TextMapper
1265 GenericMapper(TextTranslator* t);
1266 void Map(BYTE b,BYTE* bSubst);
1274 ******************************************************************************/
1276 // Component of TextJob
1279 TextManager(TextTranslator* t,unsigned int PrintableX, unsigned int PrintableY);
1280 virtual ~TextManager();
1282 virtual DRIVER_ERROR TextOut(const char* pTextString, unsigned int iLenString,
1283 const Font& font, int iAbsX=-1, int iAbsY=-1);
1284 TextTranslator* theTranslator;
1286 DRIVER_ERROR constructor_error;
1290 unsigned int PrintableRegionX;
1291 unsigned int PrintableRegionY;
1293 DRIVER_ERROR CheckCoords(unsigned int iAbsX, unsigned int iAbsY );
1295 TextMapper* theMapper;
1303 #endif //APDK_INTERNAL_H