1 /*****************************************************************************\
2 dj660.cpp : Implimentation for the DJ660 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 \*****************************************************************************/
37 #include "printerproxy.h"
41 extern uint32_t ulMapDJ660_CCM_KCMY[ 9 * 9 * 9 ];
42 extern uint32_t ulMapDJ600_CCM_K[ 9 * 9 * 9 ];
43 extern uint32_t ulMapDJ600_CCM_CMY[ 9 * 9 * 9 ];
45 // ** DJ660:Printer CLASS **
48 DJ660::DJ660(SystemServices* pSS,BOOL proto)
49 : DJ6XX(pSS,NUM_DJ6XX_FONTS,proto)
50 // create two dummy font objects to be queried via EnumFont
52 DBG1("DJ660::VerifyPenInfo(): called\n");
54 if ((!proto) && (IOMode.bDevID))
56 constructor_error = VerifyPenInfo();
59 else ePen=BOTH_PENS; // matches default mode
61 pMode[DEFAULTMODE_INDEX] = new PrintMode( ulMapDJ660_CCM_KCMY );
62 pMode[GRAYMODE_INDEX] = new GrayMode(ulMapDJ600_CCM_K);
63 pMode[SPECIALMODE_INDEX] = new Mode660Draft();
64 #ifdef APDK_EXTENDED_MEDIASIZE
65 pMode[SPECIALMODE_INDEX+1] = new Mode660DraftGrayK();
66 pMode[SPECIALMODE_INDEX+2] = new Mode660BestGrayK();
71 CMYMap = ulMapDJ660_CCM_KCMY;
74 DBG1("DJ 660 created\n");
77 Mode660Draft::Mode660Draft()
78 : PrintMode( ulMapDJ660_CCM_KCMY )
80 theQuality = qualityDraft;
84 pmQuality = QUALITY_DRAFT;
86 // strcpy(ModeName, "Draft");
90 #ifdef APDK_EXTENDED_MEDIASIZE
91 Mode660DraftGrayK::Mode660DraftGrayK()
92 : GrayMode(ulMapDJ600_CCM_K)
94 theQuality = qualityDraft;
95 pmQuality = QUALITY_DRAFT;
98 Mode660BestGrayK::Mode660BestGrayK()
99 : GrayMode(ulMapDJ600_CCM_K)
101 theQuality = qualityPresentation;
102 pmQuality = QUALITY_BEST;
104 ResolutionX[0] = 600;
105 #ifdef APDK_HIGH_RES_MODES
107 ResolutionY[0] = 600;
110 ResolutionY[0] = 300;
113 #endif // APDK_EXTENDED_MEDIASIZE
115 Header* DJ660::SelectHeader(PrintContext* pc)
117 return new Header6XX(this,pc);
120 DRIVER_ERROR DJ660::VerifyPenInfo()
123 DRIVER_ERROR err=NO_ERROR;
125 if(IOMode.bDevID == FALSE)
128 err = ParsePenInfo(ePen);
132 // check for the normal case
133 if (ePen == BOTH_PENS)
137 // the 6XX printers are all two-pen, so trap
138 // on any pen type that is not BOTH_PENS
139 while ( ePen != BOTH_PENS )
146 // user shouldn't be able to get photopen in a non-690...
147 pSS->DisplayPrinterStatus(DISPLAY_PHOTO_PEN_WARN);
150 // black pen installed, need to install color pen
151 pSS->DisplayPrinterStatus(DISPLAY_NO_COLOR_PEN);
154 // color pen installed, need to install black pen
155 pSS->DisplayPrinterStatus(DISPLAY_NO_BLACK_PEN);
158 // neither pen installed
160 pSS->DisplayPrinterStatus(DISPLAY_NO_PENS);
164 if (pSS->BusyWait(500) == JOB_CANCELED)
167 err = ParsePenInfo(ePen);
171 pSS->DisplayPrinterStatus(DISPLAY_PRINTING);
177 DRIVER_ERROR DJ660::ParsePenInfo(PEN_TYPE& ePen, BOOL QueryPrinter)
180 DRIVER_ERROR err = SetPenInfo(str, QueryPrinter);
185 return BAD_DEVICE_ID;
191 // check pen1, assume it is black or MDL, pen2 is color
194 // check for MDL in case someone wedged one in there
195 case 'M': temp_pen1 = MDL_PEN; break; // (M)ulti-Dye load pen
196 case 'C': temp_pen1 = BLACK_PEN; break; // (C)andide black
197 default: temp_pen1 = NO_PEN; break;
203 while((i < DevIDBuffSize) && str[i]!='$') i++; // handles variable length penIDs
204 if (i == DevIDBuffSize)
206 return BAD_DEVICE_ID;
211 if(str[i]=='R') // we have the (R)obinhood color pen,
212 // check what pen1 was
214 if (temp_pen1 == BLACK_PEN)
218 if (temp_pen1 == MDL_PEN)
224 else // no color pen, just set what pen1 was