Tizen 2.1 base
[platform/upstream/hplip.git] / prnt / hpijs / dj350.cpp
1 /*****************************************************************************\
2   dj350.cpp : Implimentation for the DJ350 class
3
4   Copyright (c) 1996 - 2001, Hewlett-Packard Co.
5   All rights reserved.
6
7   Redistribution and use in source and binary forms, with or without
8   modification, are permitted provided that the following conditions
9   are met:
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.
18
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 \*****************************************************************************/
30
31
32 #ifdef APDK_DJ350
33
34 #include "header.h"
35 #include "dj6xx.h"
36 #include "dj600.h"
37 #include "dj350.h"
38 #include "printerproxy.h"
39
40 APDK_BEGIN_NAMESPACE
41
42 extern uint32_t ulMapDJ600_CCM_CMY[ 9 * 9 * 9 ];
43 extern uint32_t ulMapDJ600_CCM_K[ 9 * 9 * 9 ];
44
45 DJ350::DJ350(SystemServices* pSS, int numfonts, BOOL proto)
46            : DJ600 (pSS, proto)
47 {
48     CMYMap = ulMapDJ600_CCM_CMY;
49 //    pMode[SPECIALMODE_INDEX]   = new Mode350KPhoto (ulMapDJ600_CCM_K);
50 //    pMode[SPECIALMODE_INDEX] = new Mode350CPhoto (CMYMap);
51
52 #ifdef APDK_EXTENDED_MEDIASIZE
53     ModeCount = 5;
54 #else
55     ModeCount = 2;
56 #endif
57
58     DBG1("DJ350 created\n");
59 }
60
61 #if 0
62 Mode350KPhoto::Mode350KPhoto (uint32_t *map)
63     : PrintMode (map)
64 {
65     theQuality = qualityPresentation;
66     dyeCount = 1;
67     BaseResX = 600;
68     BaseResY = 600;
69     ResolutionX[0] = 600;
70     ResolutionY[0] = 600;
71     CompatiblePens[0] = BLACK_PEN;
72 //    medium = mediaGlossy;
73     MixedRes = FALSE;
74 //    strcpy (ModeName, "BlackBest");
75 }
76
77 Mode350CPhoto::Mode350CPhoto (uint32_t *map)
78     : PrintMode (map)
79 {
80     theQuality = qualityPresentation;
81     dyeCount = 3;
82
83     CompatiblePens[0] = COLOR_PEN;  // only thing allowed
84 //    MixedRes = TRUE;
85     medium =  mediaSpecial;
86
87 //    strcpy(ModeName, "ColorPhoto");
88 }
89 #endif
90
91 Header350::Header350 (Printer *p, PrintContext* pc) : Header (p, pc)
92 { }
93
94 DRIVER_ERROR Header350::Send ()
95 {
96     DRIVER_ERROR err;
97
98     StartSend ();
99
100     if (dyeCount == 3 || ResolutionY[0] == 600) // color pen
101     {
102         err = ConfigureRasterData ();
103         ERRCHECK;
104     }
105     else                     // black pen
106     {
107         err = Simple ();    // set color mode and resolution
108         ERRCHECK;
109     }
110
111
112     if (ResolutionY[0] == 600)
113     {
114         char uom[10];
115         sprintf(uom,"%c%c%c%d%c",ESC,'&','u',thePrintMode->ResolutionY[K],'D');
116         err=thePrinter->Send((const BYTE*)uom, 7 );
117         ERRCHECK;
118     }
119
120
121     err = Graphics();       // start raster graphics and set compression mode
122
123     return err;
124 }
125
126 Header* DJ350::SelectHeader (PrintContext *pc)
127 {
128     return new Header350 (this, pc);
129 }
130
131 APDK_END_NAMESPACE
132
133 #endif  //APDK_DJ350