1 /*****************************************************************************\
2 Copyright (c) 2002 - 2006, Hewlett-Packard Co.
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
8 1. Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in the
12 documentation and/or other materials provided with the distribution.
13 3. Neither the name of Hewlett-Packard nor the names of its
14 contributors may be used to endorse or promote products derived
15 from this software without specific prior written permission.
17 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
18 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
20 NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22 TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 \*****************************************************************************/
30 #include "hpprintapi.h"
34 class PlatformServices : public SystemServices
39 void DisplayPrinterStatus (DISPLAY_STATUS ePrinterStatus);
40 DRIVER_ERROR BusyWait (DWORD msec);
41 DRIVER_ERROR ReadDeviceID (BYTE *strID, int iSize);
42 BYTE *AllocMem (int iMemSize);
43 void FreeMem (BYTE* pMem);
44 BOOL GetStatusInfo (BYTE *bStatReg);
45 DRIVER_ERROR ToDevice (const BYTE *pBuffer, DWORD *dwCount);
46 DRIVER_ERROR FromDevice (BYTE *pReadBuff, DWORD *wReadCount);
47 DWORD GetSystemTickCount (void);
48 float power (float x, float y);
53 PAPER_SIZE iPaperSize;
57 PaperSizeInfo PaperSizeInfoData[] =
61 {EXECUTIVE, "Executive"},
66 {PHOTO_SIZE, "Photo"},
70 {OUFUKU, "Oufuku-Hagaki"},
72 {SUPERB_SIZE, "Super B"},
74 {ENVELOPE_NO_10, "Number 10 Envelope"},
75 {ENVELOPE_A2, "A2 Envelope"},
76 {ENVELOPE_C6, "C6 Envelope"},
77 {ENVELOPE_DL, "DL Envelope"},
78 {ENVELOPE_JPN3, "Japanese Envelope #3"},
79 {ENVELOPE_JPN4, "Japanese Envelope #4"}
87 float fPhysicalHeight;
88 float fPrintableWidth;
89 float fPrintableHeight;
94 PlatformServices *pSys = NULL;
95 PrintContext *pPC = NULL;
96 BOOL CreatePrinterProperties ();
97 int iCurrentPrinter = UNSUPPORTED;
98 int iPrinterClasses[MAX_PRINTER_TYPE];
102 char *szPaperSizeNames[] =
107 "4x6 with tear-off tab",
114 "A6 with tear-off tab",
122 "Number 10 Envelope",
126 "Japanese Envelope #3",
127 "Japanese Envelope #4",