PSWriterErr.h

/*
    File:       PSWriterErr.h
 
    Contains:   This file contains defines for the internal Errors
                the PostScript printer driver can generate.
 
    Written by: Richard Blanchard and Ingrid Kelly  
 
    Copyright:  Copyright © 1999 by Apple Computer, Inc., All Rights Reserved.
 
                You may incorporate this Apple sample source code into your program(s) without
                restriction. This Apple sample source code has been provided "AS IS" and the
                responsibility for its operation is yours. You are not permitted to redistribute
                this Apple sample source code as "Apple sample source code" after having made
                changes. If you're going to re-distribute the source, we require that you make
                it clear in the source that the code was descended from Apple sample source
                code, but that you've made changes.
 
    Change History (most recent first):
                7/26/1999   Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
                
 
*/
#pragma once
 
#ifndef __PSWRITERERR__      
#define __PSWRITERERR__     
 
/*  The error values returned from components is a signed 32 bit value. The driver
    uses OSErr everywhere which is a signed 16 bit value. The macro mapComponentErr()
    looks at an error value and if it is out of range, then it maps the error to
    'errGenericComponentErr'. For simplicity, this macro assumes errors are all
    negaitive. rb580 bg035.
*/
#define kMinOSErr   -32768
#define mapComponentErr(cmErr)  ((cmErr) < kMinOSErr ? errGenericComponentErr : (OSErr)(cmErr))
 
enum{
    // iPrAbort = 128,
    
    errNotAKey =                -8998,
//  errFaceListBad =            -8997,
//  errSizeListBad =            -8996,
//  errFontNotFound =           -8995,
//  errUnknownPSLevel =         -8994,
    errInLineTimeout =          -8993,
    
//  errNoProcSetRes =           -8991,
    errBadSpoolFileVersion =    -8990,
    errCouldNotMakeNumberedFilename =   -8989,
    
//  errPSFileName =             -8987,
    errBitmapFontNotLoaded =    -8986,              
    errDidNotDownloadFont =     -8985,
    errBadConverterIndex =      -8984,
//  errSpoolFolderIsAFile =     -8983,
//  errPSFileNameNull =         -8982,
//  errNullColorInfo =          -8981,
    errNoPagesSpooled =         -8980,
//  errBadConverterID =         -8979,
//  errNoPattern =              -8978,              
    errPSStateUnderflow =       -8977,              
    errChannelNotBinary =       -8976,              
    errPrinterNotLevel2 =       -8975,              
    errBadFontKeyType =         -8974,              
//  errFunctionNotAvailable =   -8973,              
    errNULLFormatString =       -8972,              
    errNotAFolderAlias =        -8971,              
    errMissingPAPA =            -8970,              
//  errMissingPrinterInfo =     -8969,              
    errUnsupportedDestColorMode = -8968,            
//  errUnknownColorUsage =      -8967,              
 
    errUnsupportedCodec =       -8966,              
    errInvalidPPD =             -8965,              
    errBadColorSync2Comment =   -8964,              
    errBadFlattenRefCon =       -8963,              
    errGlyphsDontFit =          -8962,              
    errGenericComponentErr =    -8961,              
    errUnsupportedStream =      -8960,              
    errProfileNotInList =       -8959,              
    errUninitializedPort =      -8958,          
    errHintWrongSize =          -8957,                      
    errSystemProfileNotFound =  -8956,              
    errCFM_EnablerNotPresent =  -8955,              
    errCouldNotIDArchitecture = -8954,              
    errPSStreamNullOutProc =    -8953,              
    errTriedToWriteNullBuffer = -8952,              
    errWhoTookThatOutBuffer =   -8951,              
    errMoreDataToFlush =        -8950,              
    errWrongStructVersion =     -8949,              
    errPortIsNull =             -8948,              
    errLW8WrongArch =           -8947,              
    errUnknown =                -8946,              
    errPrLibWrongArch =         -8945,              
    errPrLibMissing =           -8944,              
    errInvalidLibraryNumber =   -8943,              
    errMissedTTFont =           -8942,              
    errNoRoomInPapa =           -8941,              
    errInvalidDTPType =         -8940,              
    errBadLibraryVersion =      -8939,              
    errRenderAtDeviceResl =     -8938,              
    errInvalidExtendedPapa =    -8937,              
    errInvalidPluginsCache =    -8936,              
 
    errInvalidPluginSubType =   -8934,              
    errSecurityViolation    =   -8931,                  
    errRequiresJava =           -8930,              
    errRequiresThreads =        -8929,              
    errRequiresAppearance =     -8928,              
    
    errHoseCantBeUsed   =       -8927,              
    errHoseInUse        =       -8926,              
    errHoseWrongState   =       -8925,              
 
    errSalamanderNotAvailable = -8924,              
    errJavaFailure =            -8923,              
 
    errFatalPrinterErr =        -8919,          
    errCouldNotMoveSpoolFile =  -8918,          
    errTooLargeFont =           -8917,          
 
    errIrdaToolNotFoundErr = -8916, 
    
    errNoFontObject             = -8915,        
    errNoFontEncoding           = -8914,        
    errApplyEncoding            = -8913,
        
    errIrdaUnknownOpenErr       = -8912,        
    errIrdaDisconnectedErr      = -8911,        
 
    errCantFGorBGPrint          = -8910,            
    LPR_ResultErr               = -8909,            
        
    errATSStreamInternal            = -8908,
    errATSStreamNullFlatParam       = -8907,
    errATSStreamParamErr            = -8906,
    errATSStreamNoFontName          = -8905,
    errATSStreamFontObject          = -8904,
    errATSStreamAGFind              = -8903,
    errATSStreamCorrupt             = -8902,
    errATSStreamNoStrikeTransform   = -8901,
    errATSStreamNoStrikeDesc        = -8900,
    errATSStreamSysVersion          = -8899,
    errATSStreamNoQuickTime         = -8898,
    errATSStreamNoCompressionMgr    = -8897,
    errATSStreamComponentReg        = -8896,
 
    errNoBuffersAvailable           = -8895,
    errOutRangePageNumberErr        = -8894,        
 
    errPSNameTooBig                 = -8893,        
    errSecurityIgnore               = -8892,        
    errSecurityNoAuthErr            = -8891,            
    errBadlyFormedBitmapFont        = -8890,        
    errBadlyFormedFond              = -8889,        
 
    errUSBHoseOldClassDriver        = -8888,        
 
    errNeedPowerPC                  = -8887,        
    errBadLPRDeviceOrAddress        = -8886,            
    errNoLPRConnection              = -8885,            
    errLPRConnectionError           = -8884,            
    errUnableToDoNewIrdaConnection  = -8883,            
    errNoSuchVolumeError            = -8882,            
    errLaunchOutOfMem               = -8881,            
    errClientHighLevelEvent         = -8880,            
    errServerHighLevelEvent         = -8879,            
    errUSBUnknownOpenErr            = -8878,            
    errAppleTalkIsNotAvailableErr   = -8877,            
/*  Old LaserWriter 7 errors.
*/
    manualFeedTOErr =           -8132,
    generalPSErr =              -8133,
    noChoosenPrinterErr =       -8150,
    prepMismatchErr =           -8151,
    noPrepErr =                 -8152,
    zoomRangeErr =              -8160,
 
    
/*  Private error codes we can return to Nessie.
*/
    errNessiePutJobOnHold =     -4200,          // Tell Nessie to put the job on hold. rb2012
    errNessieStopQueue      =   -4201,
    errNessieTryAgain       =   -4202,
 
/*  Here are PAP error codes. 
*/
    PAPNoCCBs =                 -4096,         // No free CCB's available
    PAPBadRefnum =              -4097,         // Bad connection refnum
    PAPActive =                 -4098,         // Request already active
    PAPTooBig =                 -4099,         // Write request too big
    PAPConnClosed =             -4100,         // Connection just closed
    PAPNoPrinter =              -4101,         // Printer not found on open
 
    errUserSelectPPD =          127,            
    errUserAbort =              128             
};
 
/********************   Error Descriptions *****************
errCommCodePtr
    The interface to the communications module needed to invoke a communications
    function. The error occurred because the pointer to the communications code
    was .
 
errNotAKey
    While invoking a font we could not find a key for the desired font number
    and style. The error occurred because the font tables got messed up.
 
errFaceListBad
    We went looking for an entry in the face list that should be there but
    we couldn't find it. See peek.c.
 
errSizeListBad
    The size list contained an entry that could not be reconciled with the face
    list. See fontHassle.c
    
errUnknownPICTVersion
    When running our own PICT opcode parser we ran into an PICT version
    we didn't recognize. See opcodeConvert.c
 
errUnknownPSLevel
    When we queried for the PostScript level we received an answer we
    weren't expecting. See query.c
 
errInLineTimeout
    We got tired of waiting for a response from the printer. See formatIn.c
 
errNoSaveFileName
    We tried to get the filename of the PostScript file we will create but
    the driver didn't have the name. See pdef0.c or spoolFile.c
    
errNoProcSetRes
    While generating the PostScript prolog we were unable to get the resource
    describing the needed procedure sets. See header.c
    
errBadSpoolFileVersion
    While foreground Printing we went to read the header of our spool file but
    found that the version number in the header was bad. See pmSupervisor.c
 
errCouldNotMakeNumberedFilename
    See spoolFile.c in numberedFilename(). We were trying to make a unique
    filename by adding numbers to the back of a basename. We tried lots of
    numbers but still couln't make a unique name.
 
errPSFileNameNull
    See spoolFile.c. The flag was set indicating that we should save to disk but
    the filename pointer was NULL.
 
errWhereIsSystemFolder
    See download.c. If machinesSystemFolder() in machinInfo.c can't find the
    system folder then we return this error.
 
errBitmapFontNotLoaded                          
    We called FMSwapFont and the output record contained a fontHandle which was
    a handled to a resource which is not loaded.
 
errDidNotDownloadFont
    See download.c. This should not be a fatal error but should be caught by the
    caller to download(). The error means that a PostScript outline could not
    be found for a PostScript font and that we didn't have an 'sfnt' to work
    with.
    
errBadConverterIndex
    When saving to disk we look at the jobType in the print record. We couldn't
    find a matching entry in ourt 'fSav' resource. See pmSupervisor.c
 
errNullColorInfo
    The function getColor() was called with a NULL GetColorInfo handle. See GetColor.c
 
errNoPagesSpooled
    The applioation made a PrOpenDoc call and a PrCloseDoc call with no PrOpenPage/PrClosePage
    calls in between. 
 
errBadConverterID
    The 'PDEF' we wanted to run as the converter doesn't exist.
    See SavePSInterface.c
 
errNoPattern
    We couldn't find or make a pixpat. See PSPattern.c 
 
errPSStateUnderflow
    We tried to pop our top most gState. See PSClip.c
    
errChannelNotBinary
    Application indicated that it will send binary data with PrGeneral call. After query,
    it turns out that the channel is ascii.
 
errPrinterNotLevel2
    Application indicated that it will use level 2 operators with PrGeneral call. After query,
    it turns out that the printer is a level 1 printer.
 
errBadFontKeyType
    We were trying to set a font and the corresponding font key was not of an expected type. 
 
errFunctionNotAvailable
    We tried to call a callback function that had not been initialized. See
    PSClip.h
 
errNULLFormatString
    The format string passed to OutFormatVar() in FormatOut.c was NULL. This is
    not a good thing.
 
errFontNotFound
    A font query reply didn't match any fonts in list of ps names.
 
errNotAFolderAlias
    We tried to track down a Print Monitor Document Folder alias but couldn't
    because either there wasn't an alias or the alias lead to a file not
    a folder. See SpoolFile.c trackDownPMFolder().
    
errMissingPAPA
    We went looking for the driver's PAPA resource but we couldn't find it. This is very bad.
    DMG589 Returning this error when psCreateDMJobCollection is called with a NULL PapaHandle.
 
errMissingPrinterInfo
    The current printer does not have an entry in the printer database. On entry in the database
    is required since it is there we hold the current print mode. 
    
errGlyphsDontFit
    In FontUtilitiees.c, we were trying to output some TrueType glyph definitions into
    64K PostScript strings but we were unable to get even one glyph to fit. The code
    requires the glyphs to end on long word boundaries so failure to meet that condition
    was most likely the problem. 
 
errProfileNotInList
    In ColorSyncUtil.c, we tried to use/close a temporary profile that was not in
    our list of temporary profiles. 
 
errUnsupportedStream
    The PSStream type passed in to a given library call is not supported.
 
errHintWrongSize
    One of the converter's hints was a different size than expected. 
    
    
errSystemProfileNotFound
    In JobHeader.c when trying to setup the color handling information playback, we
    got a hint to tell us to use ColorSync color matching and the destination profile
    hint was not found. When we went to use the system profile as the default for this case,
    we couldn't get the System profile. At that point we are hosed.     
 
    
errPSStreamNullOutProc
    The converter call psConvOpenDoc was passed a PSPrintStream type PSStream,
    but the function pointer for the output routine was NULL. 
 
errTriedToWriteNullBuffer
    In PrStream.c, one of the routines tried to write a buffer that does not
    exist. This should never happen.
 
errWhoTookThatOutBuffer
    In PrStream, we tried to dequeue a write buffer, but it disappeared. The async
    code should have been stopped and therefore shouldn't have take the buffer.
 
errMoreDataToFlush
    When the converter tells the client to flush its buffers, the client is
    expected to return quickly. The client returns this error if it did not
    finish flushing. The converter will then call the flush routine again. rb852
 
errWrongStructVersion
    A caller to one of the externally visable API's (NessieInfoLib is an example)
    passed in a version of a structure that is not compatable with the current
    version of the code.
    
errInvalidLibraryNumber
    A caller of the function getLibraryVersion supplied an invalid library number.
    
errMissedTTFont
    We were about to make a bitmap font for the printer, but came across an 'sfnt'
    resource. This means that we misclassified a TrueType font. See DumpBMFont.c
    rb1008
 
errNoRoomInPapa
    In Papa.c, we tried to add a tag to an extended papa and there was not enough room
    for it. 
 
errInvalidDTPType
    Returned from psGetDTPType, this error code indicates that the PAPA described an
    invalid/unrecognized desktop printer type. 
    
errBadLibraryVersion    
    The library version available doesn't contain the routines we need so we can't use it.
    Initially this is because we now rely on the streams code availability in PSUtilsLib
    but there will be other reasons in the future.  
    
errCantFGorBGPrint
    Certain jobs require that the printing app can accept high level events or that we are
    printing background to Nessie.  If neither is available we will return this error.  
 
errInvalidPluginSubType
    Returned by the Plug-ins Manager if it the requested subtype is of an invalid subtype.
    The only invalid subtype is that it uses internally to cache the information
    about what libraries support a given type.
 
errInvalidExtendedPapa
    In PAPA.c, we wanted to walk the tags in an extended PAPA, but the extended PAPA
    looked bad.
    
errInvalidPluginsCache
    Even though we validated the plugin's cache before beginning to use it, we got an error
    that indicated the cache was not valid.
    
errInvalidDownloaderInfo
    A Download Manager client passed us a DownloadInfo structure that is no longer valid. The way
    this might occur is if it took one we returned and stored it away for later use. If in the meantime
    the user has moved plugins out of the plugins folder or replaced PrintingLib with a different version
    and the DownloadInfo structure passed references a modified or non-existent file, then this error
    is returned.
 
errCantMakeStreamForDTP
    A Download Manager client passed a PAPA resource to psDownloadFile for a DTP type that we don't know how to 
    support. If the same PAPA is passed to psCanDownloadFile we will say we can't download the file. This
    scenario is unlikely to happen, but it can happen if the DM client calls psCanDownloadFile with one PAPA
    and then calls psDownloadFile with another. This would happen if, for example, Nessie failed to again
    call psCanDownloadFile if a 'spool' file intended for the Download Manager were dragged from one DTP
    to another.
 
errRequiresJava
    The routine called requires JManager, but it was not available.
    This error is returned from ppdWebSearchDlg() and ppdWebSearch(). 
    
errRequiresThread
    The routine called requires the Thread Manager which was not available.
    This error is returned from ppdWebSearchDlg() and ppdWebSearch(). 
    
errRequiresAppearance
    The routine called requires the Appearance Manager which was not available.
    This error is returned from ppdWebSearchDlg().
    
errHoseCantBeUsed
    A hose returns this error on the open call if it cannot be used. The initial use of this error 
    is for the Open Transport PAP hose -- it's returned if OT is not installed or doesn't meet the 
    version requirement.
 
errSalamanderNotAvailable
    A comm channel was chosen that required the Salamander library but it isn't available. This should
    only happen with our own internal builds but to be safe I'm adding an error code.
 
errJavaFailure
    We were unable to use the Java VMN even though it was available. This error will occur
    if we can't get a session or if one of the java.* classes that should be available
    is not. See WebPPD.h
    
errBadParsePPD
    The psAutoSetup routine in the NessieInfoLib was asked to setup the PPD but the PPD that was
    selected had a parsing error. The Generic PPD is substituted.
 
errNeedsManualConfig
    The psAutoSetup routine could not complete the setup because either there are installable options
    for which there are no queries or the installable options query failed. 
    
errDTPNotFound
    This error is returned from the function psNessieFindDTP() if it
    was unable to find a DTP that matched the specified driver and PAPA.    
 
errFatalPrinterErr
    This error is used when there is a fatal printer error reported by the printer but it
    is not a PostScript error. I'm not sure when this occurs other than for serious printer bugs.
    
errCouldNotMoveSpoolFile
    Returned in PrDraft.c this error occurs if we spooled into the temp file of a volume
    that was different than the eventual destination of the spool file. This can only
    happen if a DTP not on the boot volume is deleted between the time a spool job
    is started and it is finished.
 
errNoFontObject
    We did not convert StdText calls to ATSUI format because we either could
    not get a FontObject or a font scaler for the requested font and face.
    This is not a fatal error, it just prevents us from doing partial fonts
    for that font. See StdTextToATS.c 
 
errNoFontEncoding
    We could not find the proper encoding for a font when trying to convert StdText
    to ATSUI. This is not a fatal error. See StdTextATS.c 
 
errApplyEncoding
    We could not convert StdText character codes into glyph codes while converting
    StdText to ATSUI text. This is not a fatal error. See StdTextAts.c rb2178
 
errPSNameTooBig
    The PostScript name returned by OFA was larger than we were capable of using.
    See getFontObjPSName() in FontHassle.c.  
    
errBadlyFormedBitmapFont
    We detected that the bitmap font data had a first character value or last character
    value that was out of range.    
    
errBadlyFormedFond
    We detected a FOND that had a first character value or last character value that
    was out of range.       
 
errUSBHoseOldClassDriver
    The USB hose returns this error when the underlying USB printer class driver is too old.
    This is an issue because of bugs in it with releases 1.0 & 1.1 (hopefully fixed in 1.2).
 
errNeedPowerPC  
    8.6.5 requires power pc architecture. 
 
errBadLPRDeviceOrAddress                
    
errNoLPRConnection                  
Timeout error trying to connect to LPR device.          
 
errLPRConnectionError               
Error when connecting to LPR printer.  Likely cause is a misconfigured or inactive tcp/ip service.
 
errUnableToDoNewIrdaConnection              
Error when connecting to IR device.
 
*********************/
 
#endif      // __PSWRITERERR__