*%%
*%% Macro definition for standard PCLXL commands
*%%

*%% Attribute tags

*Macros: AttributeTag
{
    PaletteDepth:         "<02>"
    ColorSpace:           "<03>"
    NullBrush:            "<04>"
    NullPen:              "<05>"
    PaletteData:          "<06>"
    PatternSelectID:      "<08>"
    GrayLevel:            "<09>"
    RGBColor:             "<0b>"
    PatternOrigin:        "<0c>"
    NewDestinationSize:   "<0d>"
    DeviceMatrix:         "<21>"
    DitherMatrixDataType: "<22>"
    DitherOrigin:         "<23>"
    MediaDestination:     "<24>"
    MediaSize:            "<2525>"
    MediaSource:          "<26>"
    MediaType:            "<27>"
    Orientation:          "<28>"
    PageAngle:            "<29>"
    PageOrigin:           "<2a>"
    PageScale:            "<2b>"
    ROP3:                 "<2c>"
    TxMode:               "<2d>"
    CustomMediaSize:      "<2f>"
    CustomMediaSizeUnits: "<30>"
    PageCopies:           "<31>"
    DitherMatrixSize:     "<32>"
    DitherMatrixDepth:    "<33>"
    SimplexPageMode:      "<34>"
    DuplexPageMode:       "<35>"
    DuplexPageSize:       "<36>"
    ArgDirection:         "<41>"
    BoundingBox:          "<42>"
    DashOffset:           "<43>"
    EllipseDimension:     "<44>"
    EndPoint:             "<45>"
    FillMode:             "<46>"
    LineCapStyle:         "<47>"
    LineJointStyle:       "<48>"
    MiterLength:          "<49>"
    PenDashStyle:         "<4a>"
    PenWidth:             "<4b>"
    Point:                "<4c>"
    NumberOfPoints:       "<4d>"
    SolidLine:            "<4e>"
    StartPoint:           "<4f>"
    PointType:            "<50>"
    ControlPoint1:        "<51>"
    ControlPoint2:        "<52>"
    ClipRegion:           "<53>"
    ClipMode:             "<54>"
    ColorDepth:           "<62>"
    BlockHeight:          "<63>"
    ColorMapping:         "<64>"
    CompressMode:         "<65>"
    DestinationBox:       "<66>"
    DestinationSize:      "<67>"
    PatternPersistence:   "<68>"
    PatternDefineID:      "<69>"
    SourceHeight:         "<6b>"
    SourceWidth:          "<6c>"
    StartLine:            "<6d>"
    XPairType:            "<6e>"
    NumberOfXPairs:       "<6f>"
    XStart:               "<70>"
    XEnd:                 "<71>"
    NumberOfScanLines:    "<72>"
    CommentData:          "<81>"
    DataOrg:              "<82>"
    Measure:              "<86>"
    SourceType:           "<88>"
    UnitsPerMeasure:      "<89>"
    StreamName:           "<8b>"
    StreamDataLength:     "<8c>"
    ErrorReport:          "<8f>"
    CharAngle:            "<a1>"
    CharCode:             "<a2>"
    CharDataSize:         "<a3>"
    CharScale:            "<a4>"
    CharShear:            "<a5>"
    CharSize:             "<a6>"
    FontHeaderLength:     "<a7>"
    FontName:             "<a8>"
    FontFormat:           "<a9>"
    SymbolSet:            "<aa>"
    TextData:             "<ab>"
    CharSubModeArray:     "<ac>"
    XSpacingData:         "<af>"
    YSpacingData:         "<b0>"
    CharBoldValue:        "<b1>"
    AllObjectTypes:       "<1d>"
    TextObjects:          "<1e>"
    VectorObjects:        "<1f>"
    RasterObjects:        "<20>"
    ColorTreatment:       "<78>"
    TumbleMode:           "<75>"
}

*%% Attribute Enumeration

*Macros: AttributeEnum
{
*%% TumbleMode
    eAdd180Degree: "<01>" "<00>"
    
*%% ArcDirection
    eClockWise: "<00>" 
    eCounterClockWise: "<01>" 

*%% CharSubModeArray
    eNoSubstitution: "<00>" 
    eVerticalSubstitution: "<01>" 

*%% ClipMode
*%%    see FillMode Enumeration

*%% ClipRegion
    eInterior: "<00>" 
    eExterior: "<01>" 

*%% ColorDepth
    e1Bit: "<00>" 
    e4Bit: "<01>" 
    e8Bit: "<02>" 

*%% ColorimetricColorSpace
    eCRGB: 5 

*%% ColorMapping
    eDirectPixel: "<00>" 
    eIndexedPixel: "<01>" 

*%% ColorSpace
    eGray: "<01>" 
    eRGB: "<02>" 
    eSRGB: "<06>" 
    eGraySub: "<07>" 

*%% CompressMode
    eNoCompression: "<00>" 
    eRLECompression: "<01>" 
    eJPEGCompression: "<02>" 

*%% DataOrg
    eBinaryHighByteFirst: "<00>" 
    eBinaryLowByteFirst: "<01>" 

*%% DataSource
    eDefault: "<00>" 

*%% DataType
    eUByte: "<00>" 
    eSByte: "<01>" 
    eUint16: "<02>" 
    eSint16: "<03>" 

*%% DitherMatrix
    eDeviceBest: "<00>" 

*%% DuplexPageMode
    eDuplexHorizontalBinding: "<00>" 
    eDuplexVerticalBinding: "<01>" 

*%% DuplexPageSide
    eFrontMediaSide: "<00>" 
    eBackMediaSide: "<01>" 

*%% ErrorReport
    eNoReporting: "<00>"
    eBackChannel: "<01>" 
    eErrorPage: "<02>" 
    eBackChAndErrPage: "<03>" 
    eNWBackChannel: "<04>" 
    eNWErrorPage: "<05>"
    eNWBackChAndErrPage: "<06>" 

*%% FillMode
    eNonZeroWinding: "<00>" 
    eEvenOdd: "<01>" 

*%% LineCap
    eButtCap: "<00>" 
    eRoundCap: "<01>" 
    eSquareCap: "<02>" 
    eTriangleCap: "<03>" 

*%% LineJoin
    eMiterJoin: "<00>" 
    eRoundJoin: "<01>" 
    eBevelJoin: "<02>" 
    eNoJoin: "<03>" 

*%% Measure
    eInch: "<00>" 
    eMillimeter: "<01>" 
    eTenthsOfAMillimeter: "<02>" 

*%% MediaSize Enumerations
    eDefaultPaperSize: "<60>"
    eLetterPaper: "<00>"
    eLegalPaper: "<01>"
    eA4Paper: "<02>"
    eExecPaper: "<03>"
    eLedgerPaper: "<04>"
    eA3Paper: "<05>"
    eCOM10Envelope: "<06>"
    eMonarchEnvelope: "<07>"
    eC5Envelope: "<08>"
    eDLEnvelope: "<09>"
    eJB4Paper: "<0a>"
    eJB5Paper: "<0b>"
    eB5Paper: "<0c>"
    eB5Envelope: "<0d>"
    eJPostcard: "<0e>"
    eJDoublePostcard: "<0f>"
    eA5Paper: "<10>"
    eA6Paper: "<11>"
    eJB6Paper: "<12>"
    JIS8K: "<13>"
    JIS16K: "<14>"
    JISExec: "<15>"

*%% MediaSource
    eDefaultSource: "<00>" 
    eAutoSelect: "<01>" 
    eManualFeed: "<02>" 
    eMultiPurposeTray: "<03>" 
    eUpperCassette: "<04>" 
    eLowerCassette: "<05>"
    eEnvelopeTray: "<06>"
    eThirdCassette: "<07>"
*%% External Trays 1-248 8-255

*%% MediaType
    ePlain: "Plain"
    ePreprinted: "Preprinted"
    eLetterhead: "Letterhead"
    eTransparency: "Transparency"
    ePrepunched: "Prepunched"
    eLabels: "Labels"
    eBond: "Bond"
    eRecycled: "Recycled"
    eColor: "Color"
    eCardstock: "Card Stock"
    eRough: "Rough"
    eVellum: "Vellum"
    eEnvelope: "Envelope"
    eMediaLight:    "Light"
    eHeavy:         "Heavy"
    eGloss:         "Gloss"
    eHeavyGloss:    "Heavy Gloss"
    eEnvelope:      "Envelope"
    eGlossFilm:     "Gloss Film"
    ePremIJ:        "PremIJPaper"
    ePremIJH:       "PremIJHeavy"
    ePhotoQualitySemiGloss: "PhotoSemiGloss"
    ePhotoQualityMatte: "PhotoMatte"
    eEverydayPSG: "EDPhotoSemiGloss"
    eEverydayPM: "EDPhotoMatte"
    ePremTransparency: "PremIJTrans"
    ePremPlusTransparency: "PremPLTrans"
    ePhotoGloss: "PhotoGloss"
    ePremPhotoGloss: "PremPhotoGloss"
    ePremPlusPhotoGloss: "PPLPhotGlos"
    ePremPlusPhotoMatte: "PPLPhotMatte"
    eColorFastPhotoGlossy: "ClrFastPhotoGloss"
    eBrochureFlyGloss: "BrochGloss"
    eBrochureFlyGloss: "BrochMatte"

*%% MediaDestination
    eDefaultDestination: "<00>" 
    eFaceDownBin: "<01>" 
    eFaceUpBin: "<02>" 
    eJobOffsetBin: "<03>"
*%% External Bins 1-251 5-255

*%% Orientation
    ePortraitOrientation: "<00>" 
    eLandscapeOrientation: "<01>" 
    eReversePortrait: "<02>" 
    eReverseLandscape: "<03>"
    eDefaultOrientation: "<04>"

*%% PatternPersistence
    eTempPattern: "<00>" 
    ePagePattern: "<01>" 
    eSessionPattern: "<02>" 

*%% SymbolSet
*%%  

*%% SimplexPageMode
    eSimplexFrontSide: "<00>" 

*%% TxMode
    eOpaque: "<00>" 
    eTransparent: "<01>" 

*%% WritingMode
    eHorizontal: "<00>" 
    eVertical: "<01>"

*%% AllObjectTypes
    eDisable:       "<00>" 
    eEnable:        "<01>" 

*%% NeutralAxis Enums
    eTonerBlack:    "<00>" 
    eProcessBlack:  "<01>" 

*%% ColorTrapping Enums

    eMax:           "<01>"
    eNormal:        "<02>" 
    eLight:         "<03>" 

    eHighLPI:       "<00>"
    eMediumLPI:     "<01>"
    eLowLPI:        "<02>"

*%% ColorTreatment
    eNoTreatment:    "<00>"
    eScreenMatch:    "<01>"
    eVivid:          "<02>"
}

*%% Data Tags

*Macros: DataTag
{
    ubyte:          "<c0>"
    uint16:         "<c1>"
    uint32:         "<c2>"
    sint16:         "<c3>"
    sint32:         "<c4>"
    real32:         "<c5>"
    ubyte_array:    "<c8>"
    uint16_array:   "<c9>"
    uint32_array:   "<ca>"
    sint16_array:   "<cb>"
    sint32_array:   "<cc>"
    real32_array:   "<cd>"
    ubyte_xy:       "<d0>"
    uint16_xy:      "<d1>"
    uint32_xy:      "<d2>"
    sint16_xy:      "<d3>"
    sint32_xy:      "<d4>"
    real32_xy:      "<d5>"
    ubyte_box:      "<e0>"
    uint16_box:     "<e1>"
    uint32_box:     "<e2>"
    sint16_box:     "<e3>"
    sint32_box:     "<e4>"
    real32_box:     "<e5>"
    attr_ubyte:     "<f8>"
    attr_uint16:    "<f9>"
    dataLength:     "<fa>"
    dataLengthByte: "<fb>"
}

*%% Operator Tag

*Macros: OperatorTag
{
    HT: "<09>"
    LF: "<0a>"
    VT: "<0b>"
    FF: "<0c>"
    CR: "<0d>"
    BeginSession: "<41>"
    EndSession: "<42>"
    BeginPage: "<43>"
    EndPage: "<44>"
    Comment: "<47>"
    OpenDataSource: "<48>"
    CloseDataSource: "<49>"
    BeginFontHeader: "<4f>"
    ReadFontHeader: "<50>"
    EndFontHeader: "<51>"
    BeginChar: "<52>"
    ReadChar: "<53>"
    EndChar: "<54>"
    RemoveFont: "<55>"
    BeginStream: "<5b>"
    ReadStream: "<5c>"
    EndStream: "<5d>"
    ExecStream: "<5e>"
    PopGS: "<60>"
    PushGS: "<61>"
    SetClipReplace: "<62>"
    SetBrushSource: "<63>"
    SetCharAngle: "<64>"
    SetCharScale: "<65>"
    SetCharShear: "<66>"
    SetClipIntersect: "<67>"
    SetClipRectangle: "<68>"
    SetClipToPage: "<69>"
    SetColorSpace: "<6a>"
    SetCursor: "<6b>"
    SetCursorRel: "<6c>"
    SetFillMode: "<6e>"
    SetFont: "<6f>"
    SetLineDash: "<70>"
    SetLineCap: "<71>"
    SetLineJoin: "<72>"
    SetMiterLimit: "<73>"
    SetPageDefaultCTM: "<74>"
    PrintableArea: "<74>"
    SetPageOrigin: "<75>"
    SetPageRotation: "<76>"
    SetPageScale: "<77>"
    SetPatternTxMode: "<78>"
    SetPenSource: "<79>"
    SetPenWidth: "<7a>"
    SetROP: "<7b>"
    SetSourceTxMode: "<7c>"
    SetCharBoldValue: "<7d>"
    SetClipMode: "<7f>"
    SetPathToClip: "<80>"
    SetCharSubMode: "<81>"
    CloseSubPath: "<84>"
    NewPath: "<85>"
    PaintPath: "<86>"
    ArcPath: "<91>"
    BezierPath: "<93>"
    BezierRelPath: "<95>"
    Chord: "<96>"
    ChordPath: "<97>"
    Ellipse: "<98>"
    EllipsePath: "<99>"
    LinePath: "<9b>"
    LineRelPath: "<9d>"
    Pie: "<9e>"
    PiePath: "<9f>"
    Rectangle: "<a0>"
    RectanglePath: "<a1>"
    RoundRectangle: "<a2>"
    RoundRectanglePath: "<a3>"
    Text: "<a8>"
    TextPath: "<a9>"
    BeginImage: "<b0>"
    ReadImage: "<b1>"
    EndImage: "<b2>"
    BeginRestPattern: "<b3>"
    ReadRastPattern: "<b4>"
    EndRastPattern: "<b5>"
    BeginScan: "<b6>"
    EndScan: "<b8>"
    ScanLineRel: "<b9>"
    SetNeutralAxis:         "<7e>"
    SetHalftoneMethod:      "<6d>"
    SetAdaptiveHalftoning:  "<94>"
    SetColorTrapping:       "<92>"
    SetColorTreatment:      "<58>"
    SetPaintTxMode:          "<78>"
    SetSourceTxMode:         "<7c>"
}

*Macros: MediaSizeStrings
{
    sLetterPaper: =ubyte "<06>" "LETTER"
    sLegalPaper: =ubyte "<05>" "LEGAL"
    sA4Paper: =ubyte "<02>" "A4"
    sExecPaper: =ubyte "<04>" "EXEC"
    sLedgerPaper: =ubyte "<06>" "LEDGER"
    sA3Paper: =ubyte "<02>" "A3"
    sCOM10Envelope: =ubyte "<05>" "COM10"
    sMonarchEnvelope: =ubyte "<07>" "MONARCH"
    sC5Envelope: =ubyte "<02>" "C5"
    sDLEnvelope: =ubyte "<02>" "DL"
    sJB4Paper: =ubyte "<06>" "JIS B4"
    sJB5Paper: =ubyte "<06>" "JIS B5"
    sB5Envelope: =ubyte "<06>" "B5 ENV"
    sJPostcard: =ubyte "<05>" "JPOST"
    sJDoublePostcard: =ubyte "<06>" "JPOSTD"
    sA5Paper: =ubyte "<02>" "A5"
    sA6Paper: =ubyte "<02>" "A6"
    sJB6Paper: =ubyte "<02>" "JIS B6"
    s8KPaper: =ubyte "<05>" "ROC8K"
    s16kPaper: =ubyte "<06>" "ROC16K"
    sJisExecPaper: =ubyte "<07>" "JISEXEC"
    sB5ISOPaper: =ubyte "<05>" "ISOB5"
    s8_5x13Paper: =ubyte "<08>" "FOOLSCAP"
    sB5ISOPaperRuby: =ubyte "<06>" "ISO B5"
    sExecPaperRuby: =ubyte "<09>" "EXECUTIVE"
    sB5EnvelopRuby: =ubyte "<02>" "B5"
}

*BlockMacro: DuplexConstraints
{
    *Constraints: Duplex.HORIZONTAL
    *Constraints: Duplex.VERTICAL
}

*Macros: HBRAttributeTag
{
    600ReversedEndin:  "<58>" "<02>"
    300ReversedEndin:  "<2C>" "<01>"
    JR3ExecStream:     "<68704003>"
    VUDownloadDeviceTable:     "<68704003>"
    1200ReversedEndin: "<B0>" "<04>"
}

*Macros: PCLXLCommand
{
*% ---------------------------------------------------------------------------
*% PCL XL Stream Header
*% ---------------------------------------------------------------------------
PCLXL_VUExtension: =uint32 "<11207068>" =attr_ubyte "<91>" "<46>" 
PCLXL_OpenDataSource: =ubyte "<00>" =attr_ubyte =SourceType =ubyte "<01>" =attr_ubyte =DataOrg =OpenDataSource

*% ---------------------------------------------------------------------------
*% BeginSession
*%     Measure(ubyte) & UnitsPerMeasure(uint16_xy) & {ErrorReport(ubyte)}
*% ---------------------------------------------------------------------------
PCLXL_BeginSession1200: =uint16_xy "<b004b004>" =attr_ubyte =UnitsPerMeasure =ubyte
+ =eInch =attr_ubyte =Measure =ubyte =eBackChAndErrPage =attr_ubyte =ErrorReport =BeginSession

PCLXL_BeginSession600: =uint16_xy "<58025802>" =attr_ubyte =UnitsPerMeasure =ubyte
+ =eInch =attr_ubyte =Measure =ubyte =eBackChAndErrPage =attr_ubyte =ErrorReport =BeginSession

PCLXL_BeginSession300: =uint16_xy "<2c012c01>" =attr_ubyte =UnitsPerMeasure =ubyte
+ =eInch =attr_ubyte =Measure =ubyte =eBackChAndErrPage =attr_ubyte =ErrorReport =BeginSession

Width: %m{ RasterDataWidthInBytes }
Height: %m{ RasterDataHeightInPixels }
DataSize: %l{ NumOfDataBytes }
FntHeight: %l{ FontHeight*600/TextYRes }
FntNextGlyph: %l{ NextGlyph }

*% ---------------------------------------------------------------------------
*% BeginRaster
*%     ColorDepth(ubyte) & ColorMapping(ubyte) & SourceWidth(uint16) &
*%     SourceWidth(uint16) & SourceHeight(uint16)
*% ---------------------------------------------------------------------------
PCLXL_CmdBeginRaster: =ubyte =e1Bit =attr_ubyte =ColorDepth
+                     =ubyte =eDirectPixel =attr_ubyte =ColorMapping
+                     =uint16 =Width =attr_ubyte =SourceWidth
+                     =uint16 =Height =attr_ubyte =SourceHeight
+                     =uint16_xy =Width =Height =attr_ubyte =DestinationSize
+                     =BeginImage
+                     =ubyte =eNoCompression =attr_ubyte =CompressMode
+                     =ubyte "<00>" =attr_ubyte =StartLine
+                     =uint16 =Height =attr_ubyte =BlockHeight
+                     =ReadImage

PCLXL_CmdSendBlockData: =dataLength =DataSize "<0000>"

DestinationX: %l{DestX}
DestinationY: %l{DestY}
DestinationXRel: %l{DestYRel}
DestinationYRel: %l{DestXRel}
NumOfCopy: %l{NumOfCopies}
PrintDir: %l{PrintDirInCCDegrees}
FntName: =ubyte_array =uint16 "<1000>" "MS PCLXLFont " %3d{CurrentFontID}
}

*Macros: HPFaxPJLs
{
    PJL_ENTER_HPFAXPDL:     "@PJL ENTER LANGUAGE=HPFAXPDL<0A>"

}
