1 /*****************************************************************************\
2 global_types.h : global types, enums, and #defines for APDK
4 Copyright (c) 1996 - 2008, 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 /*! \addtogroup globals
33 Definitions for global variables, types, and #defines
38 // Definitions and structures needed by applications
40 // This file does not include C++ class definitions etc. so it can
41 // be included by calling C or C++ source files
43 #ifndef APDK_GLOBAL_TYPES_H
44 #define APDK_GLOBAL_TYPES_H
49 #define APDK_INVALID_VALUE -9999
52 #include "auto-include.h"
54 typedef unsigned long uint32_t;
61 //#define NOTHROW (std::nothrow)
62 #define new new(std::nothrow)
65 // Camera compiler warns about NULL at different locations each time.
66 // So, force a definition here.
94 typedef unsigned char BYTE;
96 typedef unsigned short WORD;
98 typedef uint32_t DWORD;
101 #define LOWORD(l) ((WORD) (l))
105 #define HIWORD(l) ((WORD) (((DWORD) (l) >> 16) & 0xFFFF))
109 #define ABS(x) ( ((x)<0) ? -(x) : (x) )
123 //! \internal For use in connection with PCL media-type command. Values are PCL codes.
131 mediaTransparency = 4,
132 mediaHighresPhoto = 3, // used by vip printers for 2400 mode
138 //! \internal For use in connection with PCL media-size command. Values are PCL codes.
150 sizePhoto = 74, // 4x6 Index Card / Photo paper
151 sizeA6 = 73, // used to be 24, full-bleed support is for 73 only. Is same size though
168 //! \internal For use in connection with PCL media-source command. Values are PCL codes.
177 sourceDuplexerNHagakiFeed = 5,
178 sourceOptionalEnv = 6,
\r
181 sourceTrayCDDVD = 14,
186 //! \internal For use in connection with PCL quality-mode command. Values are PCL codes.
190 qualityFastDraft = -2,
193 qualityPresentation = 1,
194 qualityMarvellous = 2,
\r
195 qualityFastNormal = 3
198 //! \internal For use in connection with fullbleed support. Values are type of fullbleed.
201 fullbleedNotSupported = 0,
202 fullbleed3EdgeAllMedia = 1,
203 fullbleed3EdgePhotoMedia = 2,
204 fullbleed3EdgeNonPhotoMedia = 3,
205 fullbleed4EdgeAllMedia = 4,
206 fullbleed4EdgePhotoMedia = 5,
207 fullbleed4EdgeNonPhotoMedia = 6
214 LETTERGOTHIC_INDEX = 3,
218 const int MAX_CHAR_SET = 5;
220 const int MAX_POINTSIZES = 5;
222 const int MAXCOLORDEPTH = 3;
224 const int MAXCOLORPLANES = 6; // current max anticipated, 6 for 690 photopen
226 const int MAXCOLORROWS = 2; // multiple of high-to-low for mixed-resolution cases
228 // ** JOB related structures/enums
230 //! Possible pen combinations
233 BLACK_PEN, //!< Only BLACK pen in the printer
234 COLOR_PEN, //!< Only COLOR pen in the printer
235 BOTH_PENS, //!< BLACK & COLOR pens in printer
236 MDL_PEN, //!< Photo pen in the printer
237 MDL_BOTH, //!< COLOR and Photo pen in printer
238 MDL_AND_BLACK_PENS, //!< BLACK and Photo pen in printer
239 MDL_BLACK_AND_COLOR_PENS, //!< BLACK, COLOR and Photo pen in printer
240 GREY_PEN, //!< Only GREY pen in the printer
241 GREY_BOTH, //!< COLOR and GREY pen in the printer
242 MDL_AND_GREY_PENS, //!< GREY and Photo pen in printer
243 MDL_GREY_AND_COLOR_PENS, //!< GREY, COLOR, and Photo pen in the printer
244 UNKNOWN_PEN, //!< New Pen type that we have no knowledge yet
245 // if more pen or pen combos are added then add them here and point MAX_PEN_TYPE to the last one
246 NO_PEN, //!< No pens in the printer
247 DUMMY_PEN, //!< Not a possible value - used for initialization
248 MAX_PEN_TYPE = UNKNOWN_PEN //!< base 0, ending with MDL_BOTH (NOT NO_PEN)
250 //const int MAX_PEN_TYPE = 4;
253 //! Supported Paper sizes
255 The PAPER_SIZE enum is directly supported by PSM in PrintContext
256 do not change the order of the PAPER_SIZE enum. The static array in
257 PrintContext depends on this order. Any changes to this enum may require
258 changes to the PSM array.
260 typedef enum // typedef'ed for C interface
262 UNSUPPORTED_SIZE =-1, //!< Not supported paper size (also used as mandatory flag)
263 LETTER = 0, //!< 8.5 x 11 in.
264 A4 = 1, //!< 210 x 297 mm.
265 LEGAL = 2, //!< 8.25 x 14 in.
266 PHOTO_SIZE = 3, //!< 4x6 Photo with tear-off tab
267 A6 = 4, //!< 105 x 148 mm.
268 CARD_4x6 = 5, //!< 4x6 photo/card without tear-off tab
269 B4 = 6, //!< 250 x 353 mm.
270 B5 = 7, //!< 176 x 250 mm.
271 OUFUKU = 8, //!< 148 x 200 mm.
272 OFUKU = 8, //!< Misspelled - here for backwards compatibility
273 HAGAKI = 9, //!< 100 x 148 mm.
274 A6_WITH_TEAR_OFF_TAB = 10, //!< A6 with tear-off tab
275 #ifdef APDK_EXTENDED_MEDIASIZE
276 A3 = 11, //!< 294 x 419.8 mm.
277 A5 = 12, //!< 148 x 210 mm.
278 LEDGER = 13, //!< 11 x 17 in.
279 SUPERB_SIZE = 14, //!< 13 x 19 in.
280 EXECUTIVE = 15, //!< 7.25 x 10.5 in.
281 FLSA = 16, //!< 8.5 x 13 in.
282 CUSTOM_SIZE = 17, //!< Custom
283 ENVELOPE_NO_10 = 18, //!< No. 10 Envelope (4.12 x 9.5 in.)
284 ENVELOPE_A2 = 19, //!< A2 Envelope (4.37 x 5.75 in.)
285 ENVELOPE_C6 = 20, //!< C6 Envelope (114 x 162 mm)
286 ENVELOPE_DL = 21, //!< DL Envelope (110 x 220 mm)
287 ENVELOPE_JPN3 = 22, //!< Japanese Envelope #3 (120 x 235 mm)
288 ENVELOPE_JPN4 = 23, //!< Japanese Envelope #4 (90 x 205 mm)
\r
290 PHOTO_5x7, //!< 5x7 Photo
291 CDDVD_80, //!< 3 in. CD or DVD
292 CDDVD_120, //!< 5 in. CD or DVD
\r
293 #ifdef APDK_EXTENDED_MEDIASIZE
\r
294 PHOTO_4x8, //!< Panorama 4 in. x 8 in.
\r
295 PHOTO_4x12, //!< Panorama 4 in. x 12 in.
\r
296 L, //!< Japanese card (3.5 in. x 5 in.)
\r
298 MAX_PAPER_SIZE //!< Only for array size and loops
302 typedef enum // typedef'ed for C interface
308 // ** TEXT related structures/enums
310 //! Supported Text colors for device text
311 typedef enum // typedef'ed for C interface
313 WHITE_TEXT, //!< White
315 MAGENTA_TEXT, //!< Magenta
317 YELLOW_TEXT, //!< Yellow
318 GREEN_TEXT, //!< Green
320 BLACK_TEXT //!< Black
324 // currently only portrait fonts are supported
332 const int MAX_FONT_SIZES = 10; // max # of fonts to be realized at one time
335 // ** I/O related stuff
337 const int TIMEOUTVAL = 500; // in msec, ie 0.5 sec
340 typedef void * PORTHANDLE;
350 enum HALFTONING_ALGORITHM
357 //! Color modes for SelectPrintMode
358 typedef enum // typedef'ed for C interface
360 GREY_K, //!< Use the BLACK pen to print B&W only
361 GREY_CMY, //!< Use the COLOR pen to print grey scale
362 COLOR, //!< Use the COLOR pen to print color
367 //! Quality modes for SelectPrintMode
368 typedef enum // typedef'ed for C interface
370 QUALITY_NORMAL, //!< Normal quality print mode (probably 300x300)
371 QUALITY_DRAFT, //!< Draft print mode - the same or faster than normal
372 QUALITY_BEST, //!< Probably slower and possible higher resolution
373 QUALITY_HIGHRES_PHOTO, //!< 1200 dpi - currently 9xxvip, linux only
374 QUALITY_FASTDRAFT, //!< True draft, 300 dpi - newer VIP printers only
375 QUALITY_AUTO, //!< Printer selects optimum resolution - 05 and later VIP printers only
\r
376 QUALITY_FASTNORMAL, //!< Normal quality print mode - faster than Normal
381 //! Media types for SelectPrintMode
382 typedef enum // typedef'ed for C interface
384 MEDIA_PLAIN, //!< Plain paper
385 MEDIA_PREMIUM, //!< Premium paper - for use with 6xx series
386 MEDIA_PHOTO, //!< Photo paper - for use with photo quality printers
387 MEDIA_TRANSPARENCY, //!< Transparency film
388 MEDIA_HIGHRES_PHOTO, //!< Premium photo paper
\r
389 MEDIA_AUTO, //!< Printer uses media sense to determine media type
\r
390 MEDIA_ADVANCED_PHOTO, //!< Advanced photo paper
\r
391 MEDIA_CDDVD = 7, //!< CD or DVD media
\r
392 MEDIA_BROCHURE = 8, //!< Glossy brochure paper
\r
397 typedef enum // typedef'ed for C interface
399 UNKNOWN = -1, //!< Unknown State
400 DISENGAGED = 0, //!< Photo Tray is nor engaged
401 ENGAGED = 1 //!< Photo Tray is engaged
404 //////////////////////////////////////////////////////////////////////////////////////
405 // values of DRIVER_ERROR
406 // first of 2 hex digits indicates category
408 typedef enum // typedef'ed for C interface
411 // general or system errors
412 NO_ERROR = 0x00, //!< everything okay
413 JOB_CANCELED = 0x01, //!< CANCEL chosen by user
414 SYSTEM_ERROR = 0x02, //!< something bad that should not have happened
415 ALLOCMEM_ERROR = 0x03, //!< failed to allocate memory
416 NO_PRINTER_SELECTED = 0x04, //!< indicates improper calling sequence or unidi
417 INDEX_OUT_OF_RANGE = 0x05, //!< what it says
418 ILLEGAL_RESOLUTION = 0x06, //!< tried to set resolution at unacceptable value
419 NULL_POINTER = 0x07, //!< supplied ptr was null
420 MISSING_PENS = 0x08, //!< one or more printhead/pen missing
423 // (items either absent from current build, or just bad index from client code)
424 UNSUPPORTED_PRINTER = 0x10, //!< selected printer-type unsupported in build
425 UNSUPPORTED_PEN = 0x11, //!< selected pen-type unsupported
426 TEXT_UNSUPPORTED = 0x12, //!< no text allowed in current build, UsePageWidth is false
427 GRAPHICS_UNSUPPORTED = 0x13, //!< no graphics allowed in current build
428 UNSUPPORTED_FONT = 0x14, //!< font selection failed
429 ILLEGAL_COORDS = 0x15, //!< bad (x,y) passed to TextOut
430 UNSUPPORTED_FUNCTION = 0x16, //!< bad selection for PerformPrinterFunction
431 BAD_INPUT_WIDTH = 0x18, //!< inputwidth is 0 and
432 OUTPUTWIDTH_EXCEEDS_PAGEWIDTH = 0x19, //!< inputwidth exceeds printable width
433 UNSUPPORTED_SCALING = 0x1a, //!< inputwidth exceeds outputwidth, can't shrink output
436 IO_ERROR = 0x20, //!< I/O error communicating with printer
437 BAD_DEVICE_ID = 0x21, //!< bad or garbled device id from printer
438 CONTINUE_FROM_BLOCK = 0x22, //!< continue from blocked state for printers with no buttons
440 // Run time related
\r
441 PLUGIN_LIBRARY_MISSING = 0x30, //!< a required plugin (dynamic) library is missing
\r
444 // convention is that values < 0 can be ignored (at user's peril)
445 WARN_MODE_MISMATCH = -1, //!< printmode selection incompatible with pen, tray, etc.
446 WARN_DUPLEX = -2, //!< duplexer installed; our driver can't use it
447 WARN_LOW_INK_BOTH_PENS= -3, //!< sensor says pens below threshold
448 WARN_LOW_INK_BLACK = -4, //!< sensor says black pen below threshold
449 WARN_LOW_INK_COLOR = -5, //!< sensor says color pen below threshold
451 WARN_LOW_INK_PHOTO = -10, //!< sensor says photo pen below threshold
452 WARN_LOW_INK_GREY = -11, //!< sensor says grey pen below threshold
453 WARN_LOW_INK_BLACK_PHOTO = -12, //!< sensor says black and photo pens below threshold
454 WARN_LOW_INK_COLOR_PHOTO = -13, //!< sensor says color and photo pens below threshold
455 WARN_LOW_INK_GREY_PHOTO = -14, //!< sensor says grey and photo pens below threshold
456 WARN_LOW_INK_COLOR_GREY = -15, //!< sensor says color and grey pens below threshold
457 WARN_LOW_INK_COLOR_GREY_PHOTO = -16, //!< sensor says color, photo, and grey pens below threshold
458 WARN_LOW_INK_COLOR_BLACK_PHOTO = -17, //!< sensor says color, photo, and black pens below threshold
459 WARN_LOW_INK_CYAN = -18, //!< sensor says cyan ink below threshold
460 WARN_LOW_INK_MAGENTA = -19, //!< sensor says magenta ink below threshold
461 WARN_LOW_INK_YELLOW = -20, //!< sensor says yellow ink below threshold
462 WARN_LOW_INK_MULTIPLE_PENS = - 21, //!< sensor says more than one pen below threshold
463 WARN_FULL_BLEED_UNSUPPORTED = -6,//!< device does not support full-bleed printing
464 WARN_FULL_BLEED_3SIDES = -7, //!< full bleed on only 3 sides
465 WARN_FULL_BLEED_PHOTOPAPER_ONLY = -30, //!< device only support full-bleed on photo paper
466 WARN_FULL_BLEED_3SIDES_PHOTOPAPER_ONLY = -31, //!< device only support 3 sided full-bleed on photo paper
467 WARN_ILLEGAL_PAPERSIZE = -8, //!< papersize illegal for given hardware
468 ILLEGAL_PAPERSIZE = -8,
469 WARN_INVALID_MEDIA_SOURCE = -9 //!< media source tray is invalid
470 } DRIVER_ERROR; //DRIVER_ERROR
473 ///////////////////////////////////////////////////////////////////////////////////////
475 // ** Printer Status return values
479 { // used for DisplayPrinterStatus
480 NODISPLAYSTATUS = -1,
482 DISPLAY_PRINTING_COMPLETE,
483 DISPLAY_PRINTING_CANCELED,
486 DISPLAY_OUT_OF_PAPER,
487 DISPLAY_TOP_COVER_OPEN,
489 DISPLAY_NO_PRINTER_FOUND,
490 DISPLAY_NO_PEN_DJ400,
491 DISPLAY_NO_PEN_DJ600,
492 DISPLAY_NO_COLOR_PEN,
493 DISPLAY_NO_BLACK_PEN,
495 DISPLAY_PHOTO_PEN_WARN,
496 DISPLAY_PRINTER_NOT_SUPPORTED,
497 DISPLAY_COMM_PROBLEM,
498 DISPLAY_CANT_ID_PRINTER,
499 DISPLAY_OUT_OF_PAPER_NEED_CONTINUE,
500 DISPLAY_PAPER_JAMMED,
501 DISPLAY_PHOTOTRAY_MISMATCH,
503 // internal driver use only
506 DISPLAY_PRINTCONTEXT_WARN,
507 DISPLAY_PRINTMODE_WARN,
512 // ** move these to internal.h
513 // items from wtv_interp.h
515 const int NUMBER_PLANES = 3;
517 // must be #define instead of const int for C interface
518 #define NUMBER_RASTERS 3 // The number of Rasters to Buffer
520 #ifdef APDK_AUTODUPLEX
533 EXTRA_DRYTIME_HINT,
\r
534 MAX_FILE_SIZE_HINT,
\r
535 RED_EYE_REMOVAL_HINT,
\r
537 LEFT_OVERSPRAY_HINT,
\r
538 RIGHT_OVERSPRAY_HINT,
\r
539 TOP_OVERSPRAY_HINT,
\r
540 BOTTOM_OVERSPRAY_HINT
\r
545 /*! @} */ // end globals group (documentation)
547 #endif //APDK_GLOBAL_TYPES_H