Filewatcher File Search
FTP Search
  
Directory (beta)
  
Content Search (beta)
   
pkg://Omni-0.7.2-4.src.rpm:3655708/Omni-0.7.2.tar.gz  info  downloads

Omni/0040755000076400007640000000000007576141202011042 5ustar  hamzyhamzyOmni/Brother/0040755000076400007640000000000007571237157012461 5ustar  hamzyhamzyOmni/Brother/Brother HJ-100i Commands.xml0100644000076400007640000000330207254217210017240 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deviceCommands SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<deviceCommands>
  <command name="cmdSetColor">_ESC_ &quot;r%c&quot;</command>
  <command name="cmdSetLineSpacing180inch">_ESC_ &quot;3%c&quot;</command>
  <command name="cmdInit">_ESC_ &quot;@&quot; _NUL_ _NUL_</command>
  <command name="cmdReset">_ESC_ &quot;@&quot;</command>
  <command name="cmdAbort">_FF_ _ESC_ &quot;@&quot;</command>
  <command name="cmdPageEject">_FF_</command>
  <command name="cmdSetXPos">_ESC_ &quot;$%w&quot;</command>
  <command name="cmdBidi">_ESC_ &quot;U%c&quot;</command>
  <command name="cmdEndRasterGraphicsLine">_CR_</command>
  <command name="cmdMoveToNextRasterGraphicsLine">_LF_</command>
  <command name="cmdSetSixthLineSpacing">_ESC_ &quot;2&quot;</command>
  <command name="cmdSetPageLengthInLines">_ESC_ &quot;C%c&quot;</command>
</deviceCommands>
Omni/Brother/Brother ESC Blitter.cpp0100644000076400007640000010562307531013564016545 0ustar  hamzyhamzy/*
 *   IBM Omni driver
 *   Copyright (c) International Business Machines Corp., 2000
 *
 *   This library is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 *   This library is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 *   the GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with this library; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
#include "Brother_ESC_Blitter.hpp"
#include "Brother_ESC_Instance.hpp"
#include "DeviceOrientation.hpp"
#include <CMYKbitmap.hpp>

#define BUMP_TO_NEXT_MODULUS(n,m) ((((n)+(m)-1)/(m))*(m))

int GrabPrintHeadBand (PBYTE pbBits,
                       PBYTE pbBuffer,
                       int   iMaxX,
                       int   iCurrentY,
                       int   iBytesPerColumn,
                       int   iBytesInScanLine,
                       bool  fInterleaved,
                       bool  fBlackWhiteReversed,
                       int  *piMaxRight);

DeviceBlitter *
createBlitter (PrintDevice *pDevice)
{
   return new Brother_ESC_Blitter (pDevice);
}

void
deleteBlitter (DeviceBlitter *pBlitter)
{
   delete pBlitter;
}

Brother_ESC_Blitter::
Brother_ESC_Blitter (PrintDevice *pDevice)
   : DeviceBlitter (pDevice)
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::" << __FUNCTION__ << " ()" << endl;
#endif

   fHaveInitialized_d      = false;
   fGraphicsHaveBeenSent_d = false;
   pbBuffer_d              = 0;
}

Brother_ESC_Blitter::
~Brother_ESC_Blitter ()
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::~" << __FUNCTION__ << " () enter" << endl;
#endif

   fGraphicsHaveBeenSent_d = false;

   if (pbBuffer_d)
   {
      free (pbBuffer_d);
      pbBuffer_d = 0;
   }

#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::~" << __FUNCTION__ << " () exit" << endl;
#endif
}

void Brother_ESC_Blitter::
initializeInstance ()
{
   HardCopyCap      *pHCC = getCurrentForm ()->getHardCopyCap ();
   DeviceResolution *pDR  = getCurrentResolution ();
   DevicePrintMode  *pDPM = getCurrentPrintMode ();

   char *pszDitherID = getCurrentDitherID ();

   if (  pDPM->isID (DevicePrintMode::PRINT_MODE_24_CMY)
      || pDPM->isID (DevicePrintMode::PRINT_MODE_24_CMYK)
      || pDPM->isID (DevicePrintMode::PRINT_MODE_8_CMY)
      || pDPM->isID (DevicePrintMode::PRINT_MODE_8_CMYK)
      )
   {
      int  iNumDstRowBytes8      = (pHCC->getXPels () + 7) >> 3;
      char achDitherOptions[512]; // @TBD

      sprintf (achDitherOptions,
               "fDataInRGB=true "
               "iBlackReduction=%d "
               "iColorTech=%d "
               "iNumDitherRows=%d "
               "iSrcRowPels=%d "
               "iNumDestRowBytes=%d "
               "iDestBitsPerPel=%d",
               /* @TBD iBlackReduction*/0,
               pDPM->getColorTech (),
               pDR->getScanlineMultiple (),
               pHCC->getXPels (),
               iNumDstRowBytes8,
               pDR->getDstBitsPerPel ());

      setDitherInstance (DeviceDither::createDitherInstance (pszDitherID,                 // iDitherType
                                                             pDevice_d,                   // pDevice
                                                             achDitherOptions));          // pszOptions
   }
}

bool Brother_ESC_Blitter::
rasterize (PBYTE        pbBits,
           PBITMAPINFO2 pbmi2,
           PRECTL       prectlPageLocation,
           BITBLT_TYPE  eType)
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ())
      DebugOutput::getErrorStream () << hex
           << "Brother_ESC_Blitter::rasterize (0x"
           << (int)pbBits << ", {"
           << dec << pbmi2->cx << ", "
           << pbmi2->cy << ", "
           << pbmi2->cPlanes << ", "
           << pbmi2->cBitCount << "}, "
           << "{" << prectlPageLocation->xLeft << ", " << prectlPageLocation->yBottom << ", " << prectlPageLocation->xRight << ", " << prectlPageLocation->yTop << "})"
           << endl;
#endif

   Brother_ESC_Instance *pInstance = dynamic_cast <Brother_ESC_Instance *>(getInstance ());
   if (!pInstance)
      return false;

   pInstance->setupPrinter ();

   switch (pDevice_d->getCurrentPrintMode ()->getColorTech ())
   {
   case DevicePrintMode::COLOR_TECH_K:
   {
      return brotherMonoRasterize (pbBits,
                                 pbmi2,
                                 prectlPageLocation,
                                 eType);
      break;
   }

   case DevicePrintMode::COLOR_TECH_CMYK:
   case DevicePrintMode::COLOR_TECH_CMY:
   {
      return brotherColorRasterize (pbBits,
                                  pbmi2,
                                  prectlPageLocation,
                                  eType);
      break;
   }

   default:
#ifndef RETAIL
      if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::rasterize Error: unknown color tech " << pDevice_d->getCurrentPrintMode ()->getColorTech () << endl;
#endif
      break;
   }

   return true;
}

bool Brother_ESC_Blitter::
brotherMonoRasterize (PBYTE        pbBits,
                    PBITMAPINFO2 pbmi2,
                    PRECTL       prectlPageLocation,
                    BITBLT_TYPE  eType)
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::" << __FUNCTION__ << " ()" << endl;
#endif

   Brother_ESC_Instance *pInstance = dynamic_cast <Brother_ESC_Instance *>(getInstance ());
   if (!pInstance)
      return false;

   char      *pszDumpEnvironmentVar = getenv ("DUMP_OUTGOING_BITMAPS");
   bool       fDumpOutgoingBitmaps  = false;
   static int iNum = 0;
   char       achName[4 + 1 + 3 + 1];

   sprintf (achName, "%04dOUT.bmp", iNum++);

   CMYKBitmap outgoingBitmap (achName, pbmi2->cx, pbmi2->cy);

   if (pszDumpEnvironmentVar)
   {
#ifndef RETAIL
      if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << hex << "Brother_ESC_Blitter::brotherMonoRasterize (out)pszDumpEnvironmentVar = " << (int)pszDumpEnvironmentVar << dec << endl;
#endif

      if (*pszDumpEnvironmentVar)
         fDumpOutgoingBitmaps = true;
   }

   DeviceResolution *pDR                   = pDevice_d->getCurrentResolution ();
   int               cy                    = pbmi2->cy,
                     cx                    = pbmi2->cx,
                     ulPageSize;
   int               iScanLineY,
                     iWorldY,
                     iColumnSize,
                     iLinesPerBuffer,
                     iNumBlocks,
                     iBytesPerColumn,
                     iMaxDataX,
                     cbSourceBytesInBitmap,
                     cbDestBytesInPrinter;
   bool              fAllZero              = true,
                     bBlankLines           = false,
                     bStartofBand          = true;
   DeviceCommand    *pCommands             = pDevice_d->getCommands ();
   BinaryData       *pCmd                  = 0;

   if (pDevice_d->getCurrentOrientation ()->isID (DeviceOrientation::ORIENTATION_PORTRAIT))
   {
      int cyPage = pDevice_d->getCurrentForm ()->getHardCopyCap ()->getYPels ();
      ulPageSize = cyPage;
      iWorldY    = cyPage - prectlPageLocation->yTop - 1;
   }
   else
   {
      // @TBD
      int cxPage = pDevice_d->getCurrentForm ()->getHardCopyCap ()->getXPels ();
      ulPageSize = cxPage;
      iWorldY    = cxPage - prectlPageLocation->xRight - 1;
   }

#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize ulPageSize = " << ulPageSize << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize iWorldY = " << iWorldY << endl;
#endif

   cbSourceBytesInBitmap = ((pbmi2->cBitCount * pbmi2->cx + 31) >> 5) << 2;
   cbDestBytesInPrinter  = (pbmi2->cx + 7) >> 3;
   iScanLineY            = cy - 1;
   iColumnSize           = pDR->getScanlineMultiple ();
   iLinesPerBuffer       = BUMP_TO_NEXT_MODULUS (cy, iColumnSize);
   iNumBlocks            = iLinesPerBuffer / iColumnSize;
   iBytesPerColumn       = iColumnSize / 8;

#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize cbSourceBytesInBitmap = " << cbSourceBytesInBitmap << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize cbDestBytesInPrinter  = " << cbDestBytesInPrinter << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize iScanLineY            = " << iScanLineY << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize iColumnSize           = " << iColumnSize << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize iLinesPerBuffer       = " << iLinesPerBuffer << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize iNumBlocks            = " << iNumBlocks << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize iBytesPerColumn       = " << iBytesPerColumn << endl;
#endif

   if (0 == pbBuffer_d)
   {
      pbBuffer_d = (PBYTE)malloc (cx * iBytesPerColumn);
      if (pbBuffer_d)
      {
         memset (pbBuffer_d, 0, cx * iBytesPerColumn);
      }
   }

   bool fBlackWhiteReversed = false;

   if (  0x00 == pbmi2->argbColor[0].bRed
      && 0x00 == pbmi2->argbColor[0].bGreen
      && 0x00 == pbmi2->argbColor[0].bBlue
      )
      fBlackWhiteReversed = true;

#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize fBlackWhiteReversed = " << fBlackWhiteReversed << endl;
#endif

   for (; iNumBlocks && iWorldY >= 0; iNumBlocks--)
   {
      /* Move bits for the print so they are in the correct format for the
      ** printer.
      */
      fAllZero = GrabPrintHeadBand (pbBits,
                                    pbBuffer_d,
                                    cx,
                                    iScanLineY,
                                    iBytesPerColumn,
                                    cbSourceBytesInBitmap,
                                    false,
                                    fBlackWhiteReversed,
                                    &iMaxDataX);

      if (fAllZero)
      {
         bBlankLines = true;
      }
      else
      {
         if (  bBlankLines    // output leading blank lines
            || bStartofBand   // check for motion for start of band
            )
         {
            // Set Absolute Vertical Print Position
#ifndef RETAIL
            if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize setting position to " << iWorldY << endl;
#endif

            moveToYPosition (iWorldY, false);

            bBlankLines  = false;
            bStartofBand = false;
         }

         // Send raster transfer header
         pCmd = pDR->getData ();
         pDevice_d->sendPrintfToDevice (pCmd, iMaxDataX);

         BinaryData data (pbBuffer_d, iMaxDataX * iBytesPerColumn);
         pDevice_d->sendBinaryDataToDevice (&data);

         // End the raster line
         pCmd = pCommands->getCommandData ("cmdEndRasterGraphicsLine");
         pDevice_d->sendBinaryDataToDevice (pCmd);
         pCmd = pCommands->getCommandData ("cmdMoveToNextRasterGraphicsLine");
         pDevice_d->sendBinaryDataToDevice (pCmd);

         if (fDumpOutgoingBitmaps)
         {
            for (int y = 0; y < iColumnSize; y++)
            {
#ifndef RETAIL
               if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherMonoRasterize bitmap y pos = " << iScanLineY - y << endl;
#endif

               outgoingBitmap.addScanLine (pbBits + (iScanLineY - y) * cbSourceBytesInBitmap,
                                           1,
                                           cy - 1 - iScanLineY + y,
                                           CMYKBitmap::BLACK);
            }
         }

         pInstance->ptlPrintHead_d.y = iWorldY + iColumnSize;
      }

      iScanLineY -= iColumnSize;
      iWorldY    += iColumnSize;
   }

   return true;
}

bool Brother_ESC_Blitter::
brotherColorRasterize (PBYTE        pbBits,
                     PBITMAPINFO2 pbmi2,
                     PRECTL       prectlPageLocation,
                     BITBLT_TYPE  eType)
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::" << __FUNCTION__ << " ()" << endl;
#endif

   Brother_ESC_Instance *pInstance = dynamic_cast <Brother_ESC_Instance *>(getInstance ());
   if (!pInstance)
      return false;

   char      *pszDumpEnvironmentVar = getenv ("DUMP_OUTGOING_BITMAPS");
   bool       fDumpOutgoingBitmaps  = false;
   static int iNum = 0;
   char       achName[4 + 1 + 3 + 1];

   sprintf (achName, "%04dOUT.bmp", iNum++);

   CMYKBitmap outgoingBitmap (achName, pbmi2->cx, pbmi2->cy);

   if (pszDumpEnvironmentVar)
   {
#ifndef RETAIL
      if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << hex << "Brother_ESC_Blitter::brotherColorRasterize (out)pszDumpEnvironmentVar = " << (int)pszDumpEnvironmentVar << dec << endl;
#endif

      if (*pszDumpEnvironmentVar)
         fDumpOutgoingBitmaps = true;
   }

   DeviceResolution *pDR                   = pDevice_d->getCurrentResolution ();
   int               cy                    = pbmi2->cy,
                     cx                    = pbmi2->cx,
                     ulPageSize;
   int               iScanLineY,
                     iWorldY,
                     iColumnSize,
                     iLinesPerBuffer,
                     iNumBlocks,
                     iBytesPerColumn,
                     iMaxDataX,
                     cbSourceBytesInBitmap,
                     cbDestBytesInPrinter;
   int               saveCy;
   int               iMaxPass              = 4,
                     iLastColor            = -1;   /* Not a valid color to start with */
   bool              fAllZero              = true,
                     bBlankLines           = false,
                     bStartofBand          = true;
   PBYTE             pbBuffer;
   BinaryData       *pbdColorBits          = 0;
   DeviceCommand    *pCommands             = pDevice_d->getCommands ();
   BinaryData       *pCmd                  = 0;

   if (pDevice_d->getCurrentOrientation ()->isID (DeviceOrientation::ORIENTATION_PORTRAIT))
   {
      int cyPage = pDevice_d->getCurrentForm ()->getHardCopyCap ()->getYPels ();
      ulPageSize = cyPage;
      iWorldY    = cyPage - prectlPageLocation->yTop - 1;
   }
   else
   {
      // @TBD
      int cxPage = pDevice_d->getCurrentForm ()->getHardCopyCap ()->getXPels ();
      ulPageSize = cxPage;
      iWorldY    = cxPage - prectlPageLocation->xRight - 1;
   }

#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize ulPageSize = " << ulPageSize << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize iWorldY = " << iWorldY << endl;
#endif

   cbSourceBytesInBitmap = ((pbmi2->cBitCount * pbmi2->cx + 31) >> 5) << 2;
   cbDestBytesInPrinter  = (pbmi2->cx + 7) >> 3;
   iScanLineY            = cy - 1;
   iColumnSize           = pDR->getScanlineMultiple ();
   iLinesPerBuffer       = BUMP_TO_NEXT_MODULUS (cy, iColumnSize);
   iNumBlocks            = iLinesPerBuffer / iColumnSize;
   iBytesPerColumn       = iColumnSize / 8;

#ifndef RETAIL
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize cbSourceBytesInBitmap = " << cbSourceBytesInBitmap << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize cbDestBytesInPrinter  = " << cbDestBytesInPrinter << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize iScanLineY            = " << iScanLineY << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize iColumnSize           = " << iColumnSize << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize iLinesPerBuffer       = " << iLinesPerBuffer << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize iNumBlocks            = " << iNumBlocks << endl;
   if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize iBytesPerColumn       = " << iBytesPerColumn << endl;
#endif

   if (0 == pbBuffer_d)
   {
      pbBuffer_d = (PBYTE)malloc (cx * iBytesPerColumn);
      if (pbBuffer_d)
      {
         memset (pbBuffer_d, 0, cx * iBytesPerColumn);
      }
   }

   saveCy = pbmi2->cy;

   for (; iNumBlocks && iWorldY >= 0; iNumBlocks--)
   {
      pbBuffer = pbBits + ( iScanLineY
                          - iColumnSize
                          + 1
                          ) * cbSourceBytesInBitmap;

      pbmi2->cy = iColumnSize;
      ditherRGBtoCMYK (pbmi2, pbBuffer);

      if (ditherAllPlanesBlank ())
      {
         incrementBlankLineCount (iColumnSize);
      }
      else
      {
         /* Loop through the four color passes/planes:
         **     YELLOW .. MAGENTA .. CYAN .. BLACK
         */
         for (int iPass = 0; iPass < iMaxPass; iPass++)
         {
            pCmd = pCommands->getCommandData ("cmdSetColor");

            switch (iPass)
            {
            case 0: /* YELLOW */
            {
               if (ditherYPlaneBlank ())
                  continue;

               pbdColorBits = getYPlane ();

               // Need to change color modes?
               if (iLastColor != iPass)
                  pDevice_d->sendPrintfToDevice (pCmd, 4);
               break;
            }

            case 1: /* MAGENTA */
            {
               if (ditherMPlaneBlank ())
                  continue;

               pbdColorBits = getMPlane ();

               // Need to change color modes?
               if (iLastColor != iPass)
                  pDevice_d->sendPrintfToDevice (pCmd, 1);
               break;
            }

            case 2: /* CYAN */
            {
               if (ditherCPlaneBlank ())
                  continue;

               pbdColorBits = getCPlane ();

               // Need to change color modes?
               if (iLastColor != iPass)
                  pDevice_d->sendPrintfToDevice (pCmd, 2);
               break;
            }

            case 3: /* BLACK */
            {
               if (ditherKPlaneBlank ())
                  continue;

               pbdColorBits = getKPlane ();

               // Need to change color modes?
               if (iLastColor != iPass)
                  pDevice_d->sendPrintfToDevice (pCmd, 0);
               break;
            }
            }

            iLastColor = iPass;

            /* Move bits for the print so they are in the correct format for the
            ** printer.
            */
            fAllZero = GrabPrintHeadBand (pbdColorBits->getData (),
                                          pbBuffer_d,
                                          cx,
                                          iColumnSize - 1,
                                          iBytesPerColumn,
                                          cbDestBytesInPrinter,
                                          false,
                                          false,
                                          &iMaxDataX);

            if (fAllZero)
            {
               bBlankLines = true;
            }
            else
            {
               if (fDumpOutgoingBitmaps)
               {
                  CMYKBitmap::PLANE eWhichPlane = CMYKBitmap::BLACK;

                  switch (iPass)
                  {
                  case 0: /* YELLOW */  eWhichPlane = CMYKBitmap::YELLOW;  break;
                  case 1: /* MAGENTA */ eWhichPlane = CMYKBitmap::MAGENTA; break;
                  case 2: /* CYAN */    eWhichPlane = CMYKBitmap::CYAN;    break;
                  case 3: /* BLACK */   eWhichPlane = CMYKBitmap::BLACK;   break;
                  }

                  outgoingBitmap.addScanLine (pbdColorBits->getData (),
                                              iColumnSize,
                                              ( cy
                                              - iScanLineY
                                              + iColumnSize
                                              - 2
                                              ),
                                              eWhichPlane);
               }

               if (  bBlankLines    // output leading blank lines
                  || bStartofBand   // check for motion for start of band
                  )
               {
                  // Set Absolute Vertical Print Position
#ifndef RETAIL
                  if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::brotherColorRasterize setting position to " << iWorldY << endl;
#endif

                  moveToYPosition (iWorldY, false);

                  bBlankLines  = false;
                  bStartofBand = false;
               }

               // Send raster transfer header
               pCmd = pDR->getData ();
               pDevice_d->sendPrintfToDevice (pCmd, iMaxDataX);

               BinaryData data (pbBuffer_d, iMaxDataX * iBytesPerColumn);
               pDevice_d->sendBinaryDataToDevice (&data);

               // End the raster line
               pCmd = pCommands->getCommandData ("cmdEndRasterGraphicsLine");
               pDevice_d->sendBinaryDataToDevice (pCmd);

               pInstance->ptlPrintHead_d.y = iWorldY + iColumnSize;
            }
         }

         pCmd = pCommands->getCommandData ("cmdMoveToNextRasterGraphicsLine");
         pDevice_d->sendBinaryDataToDevice (pCmd);
      }

      iScanLineY -= iColumnSize;
      iWorldY    += iColumnSize;
   }

   pbmi2->cy = saveCy;

   return true;
}

/****************************************************************************/
/* NOTE: assumes iWorldY increases                                          */
/****************************************************************************/
bool Brother_ESC_Blitter::
moveToYPosition (int  iWorldY,
                 bool fAbsolute)
{
   Brother_ESC_Instance *pInstance = dynamic_cast <Brother_ESC_Instance *>(getInstance ());
   if (!pInstance)
      return false;

   DeviceCommand    *pCommands   = pDevice_d->getCommands ();
   BinaryData       *pCmd        = 0;
   int               iAmount,
                     iResult,
                     iRemainder;
   DeviceResolution *pRes        = getCurrentResolution ();
   int               iColumnSize = pRes->getScanlineMultiple ();

   if (fAbsolute)
   {
      iAmount = iWorldY;
   }
   else
   {
      if (pInstance->ptlPrintHead_d.y == iWorldY)
      {
         // No movement required
         return true;
      }

      if (pInstance->ptlPrintHead_d.y > iWorldY)
      {
         // Wants to move backwards!
         return false;
      }

      iAmount = iWorldY - pInstance->ptlPrintHead_d.y;
   }

   pCmd = pCommands->getCommandData ("cmdSetYPos");

   if (pCmd)
   {
      pDevice_d->sendPrintfToDevice (pCmd, iAmount);
   }
   else
   {
      int iSpacing = 0;
      int iDefault = 0;

      /* We have to do it the hard way...
      */
      pCmd = pCommands->getCommandData ("cmdSetLineSpacing216inch");
      if (pCmd)
      {
         iSpacing = 216;
      }
      else
      {
         pCmd = pCommands->getCommandData ("cmdSetLineSpacing180inch");
         if (pCmd)
         {
            iSpacing = 180;
         }
         else
         {
#ifndef RETAIL
            if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::moveToYPosition Cannot find a set line spacing command!" << endl;
#endif
            return false;
         }
      }

      iDefault = iSpacing * iColumnSize / pRes->getYRes ();

      iResult    = iAmount / iSpacing;
      iRemainder = iAmount - iSpacing * iResult;

#ifndef RETAIL
      if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::moveToYPosition iAmount    = " << iAmount << endl;
      if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::moveToYPosition iResult    = " << iResult << endl;
      if (DebugOutput::shouldOutputBlitter ()) DebugOutput::getErrorStream () << "Brother_ESC_Blitter::moveToYPosition iRemainder = " << iRemainder << endl;
#endif

      if (  0 < iResult
         || 0 < iRemainder
         )
      {
         register int i;

         BinaryData *pCmdMoveToNextRasterGraphicsLine;
         BinaryData *pCmdEndRasterGraphicsLine;

         pCmdMoveToNextRasterGraphicsLine = pCommands->getCommandData ("cmdMoveToNextRasterGraphicsLine");
         pCmdEndRasterGraphicsLine        = pCommands->getCommandData ("cmdEndRasterGraphicsLine");

         if (0 < iResult)
         {
            pDevice_d->sendPrintfToDevice (pCmd, iSpacing);
         }

         for (i = iResult; i; i--)
         {
            // Move down
            if (pCmdMoveToNextRasterGraphicsLine)
               pDevice_d->sendBinaryDataToDevice (pCmdMoveToNextRasterGraphicsLine);
            if (pCmdEndRasterGraphicsLine)
               pDevice_d->sendBinaryDataToDevice (pCmdEndRasterGraphicsLine);
         }

         if (0 < iRemainder)
         {
            pDevice_d->sendPrintfToDevice (pCmd, iRemainder);

            if (pCmdMoveToNextRasterGraphicsLine)
               pDevice_d->sendBinaryDataToDevice (pCmdMoveToNextRasterGraphicsLine);
            if (pCmdEndRasterGraphicsLine)
               pDevice_d->sendBinaryDataToDevice (pCmdEndRasterGraphicsLine);
         }

         pDevice_d->sendPrintfToDevice (pCmd, iDefault);
      }
   }

   return true;
}

/****************************************************************************/
/*                                                                          */
/****************************************************************************/
int
GrabPrintHeadBand (PBYTE pbBits,
                   PBYTE pbBuffer,
                   int   iMaxX,
                   int   iCurrentY,
                   int   iBytesPerColumn,
                   int   iBytesInScanLine,
                   bool  fInterleaved,
                   bool  fBlackWhiteReversed,
                   int  *piMaxRight)
{
   static BYTE  bMaxBit[256] = {
                              0, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              4, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              3, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              4, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              2, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              4, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              3, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              4, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              1, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              4, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              3, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              4, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              2, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              4, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              3, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8,
                              4, 8, 7, 8, 6, 8, 7, 8, 5, 8, 7, 8, 6, 8, 7, 8
   };
   static BYTE  bBitMask[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01};
   static BYTE  bRemMask[8] = {0x80, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC, 0xFE, 0xFF};
   bool         fAllZero    = true;
   BYTE         currentbyte,
                columnbyte0, columnbyte1, columnbyte2, columnbyte3,
                columnbyte4, columnbyte5, columnbyte6, columnbyte7;
   int          iPosInArray,
                iBytesInCX,
                iRemX,
                iMaxRight;
   int          offset2, offset3, offset4, offset5, offset6, offset7;
   register int i, j, x;

   iMaxRight = 0;

   // How many bytes are there for the iMaxX bits?
   iBytesInCX = BUMP_TO_NEXT_MODULUS (iMaxX, 8) / 8;

   /* The for loop and the other tests expect the number to be one less than
   ** the real number.
   */
   iBytesInCX--;

   // How many bits are there in the last byte?
   iRemX = iMaxX & 7;
   if (0 == iRemX)
      /* Since cx is divisible by 8, the "end of the byte" is in effect and
      ** you want to address every bit in that byte.
      */
      iRemX = 8;

   // Calculate the offsets in advance
   offset2  = iBytesPerColumn << 1;
   offset3  = offset2 + iBytesPerColumn;
   offset4  = offset3 + iBytesPerColumn;
   offset5  = offset4 + iBytesPerColumn;
   offset6  = offset5 + iBytesPerColumn;
   offset7  = offset6 + iBytesPerColumn;

   /* Loop through every pel in the X direction one byte at a time.
   ** 8-bit move along the x axis.
   */
   for (x = 0; x <= iBytesInCX; x++)
   {
      /* Calculate the offset into the bitmap array (OS/2 PM defined).
      ** This is a 1-bpp bitmap format.  Note that x (in pels) runs in
      ** multiples of 8, so to access the bitmap data, you need to divide
      ** by 8.
      */
      iPosInArray = x + iCurrentY * iBytesInScanLine;

      /* Loop through the number of bytes in the printer head.
      ** 8-bit move along the y axis.
      */
      for (j = 0; j < iBytesPerColumn; j++)
      {
         // Clear out the column bits
         columnbyte0 = columnbyte1 = columnbyte2 = columnbyte3 =
         columnbyte4 = columnbyte5 = columnbyte6 = columnbyte7 = 0;

         if (iPosInArray >= 0)
         {
            /* Construct the 90 deg rotated bytes from column of bits.
            ** Loop through each scanline in the 8-bit byte of the printer head.
            ** 1-bit move along the y axis.
            */
            for (i = 0; i <= 7; i++)
            {
               // Grab the byte of bitmap data
               currentbyte = pbBits[iPosInArray];

               if (fBlackWhiteReversed)
                  currentbyte = ~currentbyte;

               if (x == iBytesInCX)
                  /* If this is the last byte then, only look at the remaining
                  ** bits (mask off extraneous bits).
                  */
                  currentbyte &= bRemMask[iRemX - 1];

               // Is there something there?
               if (currentbyte)
               {
                  fAllZero = false;

                  /* Keep track of the maximum bit that was set for this
                  ** byte of bitmap data.
                  */
                  iMaxRight = max (((x << 3) + bMaxBit[currentbyte]),
                                   iMaxRight);

                  /* Set the corresponding rotated bits in the column bytes.
                  */
                  if (currentbyte & 0x80) columnbyte0 |= bBitMask[i];
                  if (currentbyte & 0x40) columnbyte1 |= bBitMask[i];
                  if (currentbyte & 0x20) columnbyte2 |= bBitMask[i];
                  if (currentbyte & 0x10) columnbyte3 |= bBitMask[i];
                  if (currentbyte & 0x08) columnbyte4 |= bBitMask[i];
                  if (currentbyte & 0x04) columnbyte5 |= bBitMask[i];
                  if (currentbyte & 0x02) columnbyte6 |= bBitMask[i];
                  if (currentbyte & 0x01) columnbyte7 |= bBitMask[i];
               }

               /* Decrement the scan line pointer.  This has the effect of
               ** keeping x the same and moving one less for y.
               */
               iPosInArray -= iBytesInScanLine;
               if (fInterleaved)
                  iPosInArray -= iBytesInScanLine;

               if (iPosInArray < 0)
                  // We are outside the bitmap array.  Leave!
                  break;
            }
         }

         // Are we on the last byte?
         if (x == iBytesInCX)
         {
            /* Check the number of bits remaining before writing out the data.
            ** We are guarenteed at least one.
            */
            *(pbBuffer + j) = columnbyte0;
            if (1 < iRemX)
               *(pbBuffer + iBytesPerColumn + j) = columnbyte1;
            if (2 < iRemX)
               *(pbBuffer + offset2         + j) = columnbyte2;
            if (3 < iRemX)
               *(pbBuffer + offset3         + j) = columnbyte3;
            if (4 < iRemX)
               *(pbBuffer + offset4         + j) = columnbyte4;
            if (5 < iRemX)
               *(pbBuffer + offset5         + j) = columnbyte5;
            if (6 < iRemX)
               *(pbBuffer + offset6         + j) = columnbyte6;
            if (7 < iRemX)
               *(pbBuffer + offset7         + j) = columnbyte7;
         }
         else
         {
            /* Write the 8 column block of bitmap data.
            */
            *(pbBuffer +                   j) = columnbyte0;
            *(pbBuffer + iBytesPerColumn + j) = columnbyte1;
            *(pbBuffer + offset2         + j) = columnbyte2;
            *(pbBuffer + offset3         + j) = columnbyte3;
            *(pbBuffer + offset4         + j) = columnbyte4;
            *(pbBuffer + offset5         + j) = columnbyte5;
            *(pbBuffer + offset6         + j) = columnbyte6;
            *(pbBuffer + offset7         + j) = columnbyte7;
         }
      }

      /* We have done an 8 byte block for however many byte columns there
      ** are.  Increment the output buffer pointer...
      */
      pbBuffer += (iBytesPerColumn << 3);
   }

   // Return the maximum bit that was set in the x axis.
   if (piMaxRight)
      *piMaxRight = iMaxRight;

   // Return if this band is empty or not.
   return fAllZero;
}

string Brother_ESC_Blitter::
toString (ostringstream& oss)
{
   oss << "{ "
       << DeviceBlitter::toString (oss) // Add parent's output as well
       << " }";

   return oss.str ();
}

/* Provide a way to print out class data
*/
ostream&
operator<< (ostream& os, const Brother_ESC_Blitter& const_self)
{
   Brother_ESC_Blitter& self = const_cast<Brother_ESC_Blitter&>(const_self);
   ostringstream      oss;

   os << self.toString (oss);

   return os;
}
Omni/Brother/Brother ESC Blitter.hpp0100644000076400007640000000557007531013564016552 0ustar  hamzyhamzy/*
 *   IBM Omni driver
 *   Copyright (c) International Business Machines Corp., 2000
 *
 *   This library is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 *   This library is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 *   the GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with this library; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
#ifndef _Brother_ESC_Blitter
#define _Brother_ESC_Blitter

#include "Device.hpp"

extern "C" {
   DeviceBlitter *createBlitter (PrintDevice   *pDevice);
   void           deleteBlitter (DeviceBlitter *pBlitter);
};

class Brother_ESC_Blitter : public DeviceBlitter
{
public:
                   Brother_ESC_Blitter              (PrintDevice             *pDevice);
   virtual        ~Brother_ESC_Blitter              ();

   void            initializeInstance             ();

   virtual bool    rasterize                      (PBYTE                    pbBits,
                                                   PBITMAPINFO2             pbmi,
                                                   PRECTL                   prectlPageLocation,
                                                   BITBLT_TYPE              eType);

   virtual string  toString                       (ostringstream&           oss);
   friend ostream& operator<<                     (ostream&                 os,
                                                   const Brother_ESC_Blitter& device);

private:
   bool            brotherMonoRasterize             (PBYTE                    pbBits,
                                                   PBITMAPINFO2             pbmi,
                                                   PRECTL                   prectlPageLocation,
                                                   BITBLT_TYPE              eType);
   bool            brotherColorRasterize            (PBYTE                    pbBits,
                                                   PBITMAPINFO2             pbmi,
                                                   PRECTL                   prectlPageLocation,
                                                   BITBLT_TYPE              eType);
   bool            moveToYPosition                (int                      iWorldY,
                                                   bool                     fAbsolute);

   bool               fHaveInitialized_d;
   bool               fGraphicsHaveBeenSent_d;

   PBYTE              pbBuffer_d;
};

#endif
Omni/Brother/Brother ESC Instance.cpp0100644000076400007640000003606407531514263016710 0ustar  hamzyhamzy/*
 *   IBM Omni driver
 *   Copyright (c) International Business Machines Corp., 2000
 *
 *   This library is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 *   This library is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 *   the GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with this library; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
#include "Brother_ESC_Instance.hpp"
#include "defines.hpp"

#include <iostream>
#include <sstream>

const static bool fTestNoCompression = true;

DeviceInstance *
createInstance (PrintDevice *pDevice)
{
   return new Brother_ESC_Instance (pDevice);
}

void
deleteInstance (DeviceInstance *pInstance)
{
   delete pInstance;
}

Brother_ESC_Instance::
Brother_ESC_Instance (PrintDevice *pDevice)
   : DeviceInstance (pDevice)
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::Brother_ESC_Instance ()" << endl;
#endif

   fHaveInitialized_d  = false;
   fHaveSetupPrinter_d = false;
   fUseBidirectional_d = true;
   ptlPrintHead_d.x    = 0;
   ptlPrintHead_d.y    = 0;
}

Brother_ESC_Instance::
~Brother_ESC_Instance ()
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::~Brother_ESC_Instance ()" << endl;
#endif
}

void Brother_ESC_Instance::
initializeInstance ()
{
   if (fHaveInitialized_d)
      return;

   fHaveInitialized_d = true;

#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::initializeInstance ()" << endl;
#endif
}

static char *apszDeviceJobPropertyKeys[] = {
   "bidirectional"
};
#define JOBPROP_BIDIRECTIONAL apszDeviceJobPropertyKeys[0]

static char *apszDeviceJobPropertyValues[] = {
   "true",
   "false"
};
#define JOBPROP_TRUE    apszDeviceJobPropertyValues[0]
#define JOBPROP_FALSE   apszDeviceJobPropertyValues[1]

class DeviceJobPropertyKeyEnumerator : public Enumeration
{
public:
   DeviceJobPropertyKeyEnumerator (char **apszKeys, int iDimOfKeys)
   {
      iWhichKey_d = iDimOfKeys;
      apszKeys_d  = apszKeys;
   }

   virtual bool hasMoreElements ()
   {
      return iWhichKey_d > 0;
   }

   virtual void * nextElement ()
   {
      if (0 < iWhichKey_d)
      {
         iWhichKey_d--;
         return apszKeys_d[iWhichKey_d];
      }

      return 0;
   }

private:
   int    iWhichKey_d;
   char **apszKeys_d;
};

Enumeration * Brother_ESC_Instance::
listDeviceJobPropertyKeys ()
{
   return new DeviceJobPropertyKeyEnumerator (apszDeviceJobPropertyKeys, dimof (apszDeviceJobPropertyKeys));
}

class KeyEnumerator : public Enumeration
{
public:
   KeyEnumerator (const char *pszKeys)
   {
      pszKeys_d    = 0;
      pszCurrent_d = 0;

      if (  pszKeys
         && *pszKeys
         )
      {
         pszKeys_d = (char *)malloc (strlen (pszKeys) + 1);
         if (pszKeys_d)
         {
            strcpy (pszKeys_d, pszKeys);
            pszCurrent_d = pszKeys_d;
         }
      }
   }

   virtual ~KeyEnumerator ()
   {
      if (pszKeys_d)
      {
         free (pszKeys_d);
         pszKeys_d = 0;
      }
   }

   virtual bool hasMoreElements ()
   {
      return pszCurrent_d ? true : false;
   }

   virtual void *nextElement ()
   {
      void *pvRet = pszCurrent_d;

      if (  pszCurrent_d
         && *pszCurrent_d
         )
      {
         char *pszSpace = strchr (pszCurrent_d, ' ');

         if (pszSpace)
         {
            *pszSpace = '\0';
            pszCurrent_d = pszSpace + 1;
            while (' ' == *pszCurrent_d)
            {
               pszCurrent_d++;
            }
            if (!*pszCurrent_d)
            {
               pszCurrent_d = 0;
            }
         }
         else
         {
            pszCurrent_d = 0;
         }
      }
      else
      {
         pszCurrent_d = 0;
      }

      return pvRet;
   }

private:
   char *pszKeys_d;
   char *pszCurrent_d;
};

Enumeration * Brother_ESC_Instance::
listKeyValues (char *pszKey)
{
   ostringstream oss;

   if (0 == strcasecmp (pszKey, JOBPROP_BIDIRECTIONAL))
   {
      oss << JOBPROP_TRUE
          << " "
          << JOBPROP_FALSE;
   }

   return new KeyEnumerator (oss.str ().c_str ());
}

bool Brother_ESC_Instance::
handleDeviceJobProperty (char *pszKey,
                         char *pszValue)
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::handleDeviceJobProperty ("
                          << pszKey << ", "
                          << pszValue << ")"
                          << endl;
#endif

   if (0 == strcasecmp (pszKey, JOBPROP_BIDIRECTIONAL))
   {
      if (0 == strcmp (pszValue, JOBPROP_TRUE))
      {
         fUseBidirectional_d = true;
         return true;
      }
      else if (0 == strcmp (pszValue, JOBPROP_FALSE))
      {
         fUseBidirectional_d = false;
         return true;
      }
   }

   return false;
}

string * Brother_ESC_Instance::
getJobPropertyType (char *pszKey)
{
   string *pRet = 0;

   if (0 == strcasecmp (pszKey, JOBPROP_BIDIRECTIONAL))
   {
      pRet = new string ("boolean ");
      *pRet += JOBPROP_TRUE;
   }

   return pRet;
}

string * Brother_ESC_Instance::
getJobProperty (char *pszKey)
{
   if (0 == strcasecmp (pszKey, JOBPROP_BIDIRECTIONAL))
   {
      if (fUseBidirectional_d)
      {
         return new string (JOBPROP_TRUE);
      }
      else
      {
         return new string (JOBPROP_FALSE);
      }
   }

   return 0;
}

string * Brother_ESC_Instance::
translateKeyValue (char *pszKey,
                   char *pszValue)
{
   char   *pszRetKey   = 0;
   char   *pszRetValue = 0;
   string *pRet        = 0;
   int     iValueEnum  = StringResource::DEVICE_COMMON_UNKNOWN;

   if (0 == strcasecmp (pszKey, JOBPROP_BIDIRECTIONAL))
   {
      pszRetKey = StringResource::getString (pDevice_d->getLanguageResource (),
                                             StringResource::STRINGGROUP_DEVICE_COMMON,
                                             StringResource::DEVICE_COMMON_BIDIRECTIONAL);
   }

   if (pszValue)
   {
      if (0 == strcasecmp (pszValue, JOBPROP_TRUE))
         iValueEnum = StringResource::DEVICE_COMMON_TRUE;
      else if (0 == strcasecmp (pszValue, JOBPROP_FALSE))
         iValueEnum = StringResource::DEVICE_COMMON_FALSE;
   }

   if (StringResource::DEVICE_COMMON_UNKNOWN != iValueEnum)
   {
      pszRetValue = StringResource::getString (pDevice_d->getLanguageResource (),
                                               StringResource::STRINGGROUP_DEVICE_COMMON,
                                               iValueEnum);
   }

   if (pszRetKey)
   {
      pRet = new string (pszRetKey);
   }

   if (  pszRetValue
      && pRet
      )
   {
      *pRet += "=";
      *pRet += pszRetValue;
   }

   return pRet;
}

void Brother_ESC_Instance::
setupPrinter ()
{
   if (fHaveSetupPrinter_d)
      return;

#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::setupPrinter ()" << endl;
#endif

   fHaveSetupPrinter_d = true;

   DeviceResolution *pRes      = getCurrentResolution ();
   DeviceForm       *pDF       = getCurrentForm ();
   HardCopyCap      *pHCC      = pDF->getHardCopyCap ();
   DeviceCommand    *pCommands = getCommands ();
   BinaryData       *pCmd      = 0;

   pCmd = pCommands->getCommandData ("cmdBidi");
   if (pCmd)
   {
      char chState = '0';

      if (fUseBidirectional_d)
      {
         chState = '1';
      }

      pDevice_d->sendPrintfToDevice (pCmd, chState);
   }
   else
   {
#ifndef RETAIL
      if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Error: There is no cmdBidi defined for this device!" << endl;
#endif
   }

   // @TBD
///pDevice_d->sendBinaryDataToDevice (getCurrentTray ());

   pCmd = pCommands->getCommandData ("cmdSetColor");
   if (pCmd)
   {
      // Start with black ink (default)
      pDevice_d->sendPrintfToDevice (pCmd, '0');
   }

   int iLines = (int)(6.0 * (float)pHCC->getCy () / 25400.0);

#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "iLines = " << iLines << endl;
#endif

   pCmd = pCommands->getCommandData ("cmdSetSixthLineSpacing");
   if (pCmd)
   {
      pDevice_d->sendBinaryDataToDevice (pCmd);
   }

   pCmd = pCommands->getCommandData ("cmdSetPageLengthInLines");
   if (pCmd)
   {
      pDevice_d->sendPrintfToDevice (pCmd, iLines);
   }

   int iColumnSize = pRes->getScanlineMultiple ();
   int iSpacing    = 0;

   pCmd = pCommands->getCommandData ("cmdSetLineSpacing216inch");
   if (pCmd)
   {
      iSpacing = 216;
   }
   else
   {
      pCmd = pCommands->getCommandData ("cmdSetLineSpacing180inch");
      if (pCmd)
      {
         iSpacing = 180;
      }
   }

#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << *pCmd << " iSpacing = " << iSpacing << ", iColumnSize = " << iColumnSize << ", pRes->getYRes () = " << pRes->getYRes () << endl;
#endif

   if (0 < iSpacing)
   {
      pDevice_d->sendPrintfToDevice (pCmd,
                                     iSpacing * iColumnSize / pRes->getYRes ());
   }
}

bool Brother_ESC_Instance::
beginJob ()
{
   DeviceCommand    *pCommands = getCommands ();
   BinaryData       *pCmd      = 0;

#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::beginJob ()" << endl;
#endif

   pCmd = pCommands->getCommandData ("cmdInit");
   if (pCmd)
   {
#ifndef RETAIL
      if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "cmdInit = " << *pCmd << endl;
#endif

      pDevice_d->sendBinaryDataToDevice (pCmd);
   }

   return true;
}

bool Brother_ESC_Instance::
beginJob (bool fJobPropertiesChanged)
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::beginJob (with props)" << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The job properties are as follows:" << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The orientation is = " << getCurrentOrientation() << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "iDitherID = " << getCurrentDitherID () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The form is = " << getCurrentForm () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The tray is = " << getCurrentTray () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The media is = " << getCurrentMedia () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The resolution is = " << getCurrentResolution () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The print mode is = " << getCurrentPrintMode () << endl;
#endif

   // @TBD - reinitialize with new job properties

   // Call common code
   return beginJob ();
}

bool Brother_ESC_Instance::
newFrame ()
{
   DeviceCommand    *pCommands = getCommands ();
   BinaryData       *pCmd      = 0;

#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::newFrame ()" << endl;
#endif

   pCmd = pCommands->getCommandData ("cmdPageEject");
   if (pCmd)
   {
#ifndef RETAIL
      if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "cmdPageEject = " << *pCmd << endl;
#endif

      pDevice_d->sendBinaryDataToDevice (pCmd);
   }

   ditherNewFrame ();

   ptlPrintHead_d.x = 0;
   ptlPrintHead_d.y = 0;

   return true;
}

bool Brother_ESC_Instance::
newFrame (bool fJobPropertiesChanged)
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::newFrame (with props)" << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The job properties are as follows:" << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The orientation is = " << getCurrentOrientation() << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "iDitherID = " << getCurrentDitherID () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The form is = " << getCurrentForm () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The tray is = " << getCurrentTray () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The media is = " << getCurrentMedia () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The resolution is = " << getCurrentResolution () << endl;
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "The print mode is = " << getCurrentPrintMode () << endl;
#endif

   // @TBD - reinitialize with new job properties

   // Call common code
   return newFrame ();
}

bool Brother_ESC_Instance::
endJob ()
{
   DeviceCommand    *pCommands = getCommands ();
   BinaryData       *pCmd      = 0;

#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::endJob ()" << endl;
#endif

   pCmd = pCommands->getCommandData ("cmdPageEject");
   if (pCmd)
   {
#ifndef RETAIL
      if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "cmdPageEject = " << *pCmd << endl;
#endif

      pDevice_d->sendBinaryDataToDevice (pCmd);
   }

   pCmd = pCommands->getCommandData ("cmdTerm");
   if (pCmd)
   {
#ifndef RETAIL
      if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "cmdTerm = " << *pCmd << endl;
#endif

      pDevice_d->sendBinaryDataToDevice (pCmd);
   }

   return true;
}

bool Brother_ESC_Instance::
abortJob ()
{
#ifndef RETAIL
   if (DebugOutput::shouldOutputInstance ()) DebugOutput::getErrorStream () << "Brother_ESC_Instance::endJob ()" << endl;
#endif

   int cx = getCurrentForm ()->getHardCopyCap ()->getXPels ();

   // The largest size is 24 lines
   int iSize = 24 * (cx + 7) / 8;

   PBYTE abData = new BYTE [iSize];

   memset (abData, 0, sizeof (abData));

   BinaryData data (abData, sizeof (abData));

   pDevice_d->sendBinaryDataToDevice (&data);

   delete []abData;

   return true;
}

string Brother_ESC_Instance::
toString (ostringstream& oss)
{
   oss << "{ "
       << DeviceInstance::toString (oss) // Add parent's output as well
       << " }";

   return oss.str ();
}

/* Provide a way to print out class data
*/
ostream&
operator<< (ostream& os, const Brother_ESC_Instance& const_self)
{
   Brother_ESC_Instance& self = const_cast<Brother_ESC_Instance&>(const_self);
   ostringstream       oss;

   os << self.toString (oss);

   return os;
}
Omni/Brother/Brother ESC Instance.hpp0100644000076400007640000000551407531013543016704 0ustar  hamzyhamzy/*
 *   IBM Omni driver
 *   Copyright (c) International Business Machines Corp., 2000
 *
 *   This library is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published
 *   by the Free Software Foundation; either version 2.1 of the License, or
 *   (at your option) any later version.
 *
 *   This library is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
 *   the GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with this library; if not, write to the Free Software
 *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 */
#ifndef _Brother_ESC_Instance
#define _Brother_ESC_Instance

#include "defines.hpp"
#include "Device.hpp"

extern "C" {
   DeviceInstance *createInstance (PrintDevice    *pDevice);
   void            deleteInstance (DeviceInstance *pInstance);
};

class Brother_ESC_Instance : public DeviceInstance
{
public:
                      Brother_ESC_Instance        (PrintDevice              *pDevice);
   virtual           ~Brother_ESC_Instance        ();

   void               initializeInstance        ();

   Enumeration       *listDeviceJobPropertyKeys ();
   Enumeration       *listKeyValues             (char                     *pszKey);
   bool               handleDeviceJobProperty   (char                     *pszKey,
                                                 char                     *pszValue);
   string            *getJobPropertyType        (char                     *pszKey);
   string            *getJobProperty            (char                     *pszKey);

   string            *translateKeyValue         (char                     *pszKey,
                                                 char                     *pszValue);

   virtual bool       beginJob                  ();
   virtual bool       beginJob                  (bool                      fJobPropertiesChanged);
   virtual bool       newFrame                  ();
   virtual bool       newFrame                  (bool                      fJobPropertiesChanged);
   virtual bool       endJob                    ();
   virtual bool       abortJob                  ();

   virtual string     toString                  (ostringstream&            oss);
   friend ostream&    operator<<                (ostream&                  os,
                                                 const Brother_ESC_Instance& device);

   void               setupPrinter              ();

   POINTL             ptlPrintHead_d;

private:
   bool               fHaveInitialized_d;
   bool               fHaveSetupPrinter_d;
   bool               fUseBidirectional_d;
};

#endif
Omni/Brother/Brother HL-630_631 Connections.xml0100664000076400007640000000636707375277646020262 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE deviceConnections SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<deviceConnections>
  <deviceConnection>
    <name>BROTHER_CONN_ID_1</name>
    <connectionForm>FORM_LETTER</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_2</name>
    <connectionForm>FORM_LEGAL</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_3</name>
    <connectionForm>FORM_EXECUTIVE</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_4</name>
    <connectionForm>FORM_A4</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_5</name>
    <connectionForm>FORM_A5</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_6</name>
    <connectionForm>FORM_3_X_5_CARD</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_7</name>
    <connectionForm>FORM_C5_ENVELOPE</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_8</name>
    <connectionForm>FORM_DL_ENVELOPE</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_9</name>
    <connectionForm>FORM_C10_ENVELOPE</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_10</name>
    <connectionForm>FORM_MONARCH_ENVELOPE</connectionForm>
    <connectionTray>TRAY_MULTI_TRAY</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
</deviceConnections>
Omni/Brother/Brother HJ-100i Connections.xml0100644000076400007640000000727507247551465020015 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE deviceConnections SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<deviceConnections>
  <deviceConnection>
    <name>BROTHER_CONN_ID_1</name>
    <connectionForm>FORM_LETTER</connectionForm>
    <connectionTray>TRAY_REAR_CONTINUOUS</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_2</name>
    <connectionForm>FORM_LEGAL</connectionForm>
    <connectionTray>TRAY_REAR_CONTINUOUS</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_3</name>
    <connectionForm>FORM_A4</connectionForm>
    <connectionTray>TRAY_REAR_CONTINUOUS</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_4</name>
    <connectionForm>FORM_A3</connectionForm>
    <connectionTray>TRAY_REAR_CONTINUOUS</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_5</name>
    <connectionForm>FORM_A5</connectionForm>
    <connectionTray>TRAY_REAR_CONTINUOUS</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_6</name>
    <connectionForm>FORM_B5</connectionForm>
    <connectionTray>TRAY_REAR_CONTINUOUS</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_7</name>
    <connectionForm>FORM_LETTER</connectionForm>
    <connectionTray>TRAY_MANUAL_FEEDER</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_8</name>
    <connectionForm>FORM_LEGAL</connectionForm>
    <connectionTray>TRAY_MANUAL_FEEDER</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_9</name>
    <connectionForm>FORM_A4</connectionForm>
    <connectionTray>TRAY_MANUAL_FEEDER</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_10</name>
    <connectionForm>FORM_A3</connectionForm>
    <connectionTray>TRAY_MANUAL_FEEDER</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_11</name>
    <connectionForm>FORM_A5</connectionForm>
    <connectionTray>TRAY_MANUAL_FEEDER</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_12</name>
    <connectionForm>FORM_B5</connectionForm>
    <connectionTray>TRAY_MANUAL_FEEDER</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
</deviceConnections>
Omni/Brother/Brother HJ-100i Forms.xml0100644000076400007640000000611307276337163016606 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deviceForms SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<deviceForms>
  <deviceForm>
    <name>FORM_LETTER</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>0</hardCopyCapLeft>
      <hardCopyCapTop>20000</hardCopyCapTop>
      <hardCopyCapRight>14000</hardCopyCapRight>
      <hardCopyCapBottom>4000</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_LEGAL</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>0</hardCopyCapLeft>
      <hardCopyCapTop>20000</hardCopyCapTop>
      <hardCopyCapRight>14000</hardCopyCapRight>
      <hardCopyCapBottom>4000</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_A3</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>0</hardCopyCapLeft>
      <hardCopyCapTop>20000</hardCopyCapTop>
      <hardCopyCapRight>14000</hardCopyCapRight>
      <hardCopyCapBottom>0</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_A4</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>0</hardCopyCapLeft>
      <hardCopyCapTop>20000</hardCopyCapTop>
      <hardCopyCapRight>10000</hardCopyCapRight>
      <hardCopyCapBottom>0</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_A5</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>0</hardCopyCapLeft>
      <hardCopyCapTop>20000</hardCopyCapTop>
      <hardCopyCapRight>0</hardCopyCapRight>
      <hardCopyCapBottom>0</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_B5</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>0</hardCopyCapLeft>
      <hardCopyCapTop>20000</hardCopyCapTop>
      <hardCopyCapRight>0</hardCopyCapRight>
      <hardCopyCapBottom>0</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
</deviceForms>
Omni/Brother/Brother HJ-100i Gammas.xml0100644000076400007640000001645607247551465016741 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE deviceGammaTables SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<deviceGammaTables>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_60_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_60_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_120_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_120_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_90_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_90_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_180_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_180_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_360_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_360_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
</deviceGammaTables>
Omni/Brother/Brother HJ-100i Medias.xml0100644000076400007640000000223507247551465016724 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE deviceMedias SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<deviceMedias>
  <deviceMedia>
    <name>MEDIA_PLAIN</name>
    <command>_NUL_</command>
    <mediaColorAdjustRequired>0</mediaColorAdjustRequired>
    <mediaAbsorption>MEDIA_HEAVY_ABSORPTION</mediaAbsorption>
  </deviceMedia>
</deviceMedias>
Omni/Brother/Brother HJ-100i PrintModes.xml0100644000076400007640000000226507247551465017611 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE devicePrintModes SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<devicePrintModes>
  <devicePrintMode>
    <name>PRINT_MODE_1_ANY</name>
    <printModePhysicalCount>1</printModePhysicalCount>
    <printModeLogicalCount>1</printModeLogicalCount>
    <printModePlanes>1</printModePlanes>
  </devicePrintMode>
</devicePrintModes>
Omni/Brother/Brother HJ-100i Resolutions.xml0100644000076400007640000000524407247551465020053 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE deviceResolutions SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<deviceResolutions>
  <deviceResolution>
    <name>RESOLUTION_60_X_180</name>
    <xRes>60</xRes>
    <yRes>180</yRes>
    <command>_ESC_ "* %w"</command>
    <resolutionCapability>0</resolutionCapability>
    <resolutionDestinationBitsPerPel>1</resolutionDestinationBitsPerPel>
    <resolutionScanlineMultiple>24</resolutionScanlineMultiple>
  </deviceResolution>
  <deviceResolution>
    <name>RESOLUTION_120_X_180</name>
    <xRes>120</xRes>
    <yRes>180</yRes>
    <command>_ESC_ "*!%w"</command>
    <resolutionCapability>0</resolutionCapability>
    <resolutionDestinationBitsPerPel>1</resolutionDestinationBitsPerPel>
    <resolutionScanlineMultiple>24</resolutionScanlineMultiple>
  </deviceResolution>
  <deviceResolution>
    <name>RESOLUTION_90_X_180</name>
    <xRes>90</xRes>
    <yRes>180</yRes>
    <command>_ESC_ "*&amp;%w"</command>
    <resolutionCapability>0</resolutionCapability>
    <resolutionDestinationBitsPerPel>1</resolutionDestinationBitsPerPel>
    <resolutionScanlineMultiple>24</resolutionScanlineMultiple>
  </deviceResolution>
  <deviceResolution>
    <name>RESOLUTION_180_X_180</name>
    <xRes>180</xRes>
    <yRes>180</yRes>
    <command>_ESC_ "*&apos;%w"</command>
    <resolutionCapability>0</resolutionCapability>
    <resolutionDestinationBitsPerPel>1</resolutionDestinationBitsPerPel>
    <resolutionScanlineMultiple>24</resolutionScanlineMultiple>
  </deviceResolution>
  <deviceResolution>
    <name>RESOLUTION_360_X_180</name>
    <xRes>360</xRes>
    <yRes>180</yRes>
    <command>_ESC_ "*(%w"</command>
    <resolutionCapability>0</resolutionCapability>
    <resolutionDestinationBitsPerPel>1</resolutionDestinationBitsPerPel>
    <resolutionScanlineMultiple>24</resolutionScanlineMultiple>
  </deviceResolution>
</deviceResolutions>
Omni/Brother/Brother HJ-100i Trays.xml0100644000076400007640000000367007247551465016630 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE deviceTrays SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<deviceTrays>
  <deviceTray>
    <name>TRAY_REAR_CONTINUOUS</name>
    <trayType>TRAY_TYPE_AUTO</trayType>
    <command>_ESC_ HEX (19) "B"</command>
  </deviceTray>
  <deviceTray>
    <name>TRAY_FRONT_CONTINUOUS</name>
    <trayType>TRAY_TYPE_AUTO</trayType>
    <command>_ESC_ HEX (19) "F"</command>
  </deviceTray>
  <deviceTray>
    <name>TRAY_SINGLE_SHEET</name>
    <trayType>TRAY_TYPE_AUTO</trayType>
    <command>_NUL_</command>
  </deviceTray>
  <deviceTray>
    <name>TRAY_MANUAL_FEEDER</name>
    <trayType>TRAY_TYPE_MANUAL</trayType>
    <command>_ESC_ HEX (19) "?"</command>
  </deviceTray>
  <deviceTray>
    <name>TRAY_BIN_1</name>
    <trayType>TRAY_TYPE_AUTO</trayType>
    <command>_ESC_ HEX (19) "1"</command>
  </deviceTray>
  <deviceTray>
    <name>TRAY_BIN_2</name>
    <trayType>TRAY_TYPE_AUTO</trayType>
    <command>_ESC_ HEX (19) "2"</command>
  </deviceTray>
  <deviceTray>
    <name>TRAY_CSF</name>
    <trayType>TRAY_TYPE_AUTO</trayType>
    <command>_ESC_ HEX (19) "0"</command>
  </deviceTray>
</deviceTrays>
Omni/Brother/Brother HJ-100i.xml0100644000076400007640000000377407276337204015545 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Device SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<Device name="Brother HJ-100i">
  <DriverName>Brother</DriverName>
  <Capability type="MONOCHROME"/>
  <Capability type="MIRROR"/>
  <RasterCapabilities type="TOP_TO_BOTTOM"/>
  <PDL level="PDL_Epson" sublevel="LEVEL_ESC" major="1" minor="0"/>
  <Uses>Brother HJ-100i Commands.xml</Uses>
  <Has>Brother Orientations.xml</Has>
  <Has>Brother HJ-100i Resolutions.xml</Has>
  <Has>Brother HJ-100i PrintModes.xml</Has>
  <Has>Brother HJ-100i Trays.xml</Has>
  <Has>Brother HJ-100i Forms.xml</Has>
  <Has>Brother HJ-100i Medias.xml</Has>
  <Has>Brother HJ-100i Connections.xml</Has>
  <Instance>Brother ESC Instance.hpp</Instance>
  <Instance>Brother ESC Instance.cpp</Instance>
  <Blitter>Brother ESC Blitter.hpp</Blitter>
  <Blitter>Brother ESC Blitter.cpp</Blitter>
  <DefaultJobProperties>
    <orientation>ORIENTATION_PORTRAIT</orientation>
    <form>FORM_LETTER</form>
    <tray>TRAY_REAR_CONTINUOUS</tray>
    <media>MEDIA_PLAIN</media>
    <resolution>RESOLUTION_180_X_180</resolution>
    <dither>DITHER_STUCKI_DIFFUSION</dither>
    <printmode>PRINT_MODE_1_ANY</printmode>
  </DefaultJobProperties>
</Device>
Omni/Brother/Brother HJ-400 Forms.xml0100644000076400007640000000536207276337124016442 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE deviceForms SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<deviceForms>
  <deviceForm>
    <name>FORM_LETTER</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>4000</hardCopyCapLeft>
      <hardCopyCapTop>4000</hardCopyCapTop>
      <hardCopyCapRight>8680</hardCopyCapRight>
      <hardCopyCapBottom>12000</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_LEGAL</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>4000</hardCopyCapLeft>
      <hardCopyCapTop>4000</hardCopyCapTop>
      <hardCopyCapRight>8680</hardCopyCapRight>
      <hardCopyCapBottom>12000</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_A4</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>4000</hardCopyCapLeft>
      <hardCopyCapTop>4000</hardCopyCapTop>
      <hardCopyCapRight>0</hardCopyCapRight>
      <hardCopyCapBottom>12000</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_A5</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>4000</hardCopyCapLeft>
      <hardCopyCapTop>4000</hardCopyCapTop>
      <hardCopyCapRight>0</hardCopyCapRight>
      <hardCopyCapBottom>12000</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
  <deviceForm>
    <name>FORM_B5</name>
    <formCapabilities>NO_CAPABILITIES</formCapabilities>
    <command>_NUL_</command>
    <hardCopyCap>
      <hardCopyCapLeft>4000</hardCopyCapLeft>
      <hardCopyCapTop>4000</hardCopyCapTop>
      <hardCopyCapRight>0</hardCopyCapRight>
      <hardCopyCapBottom>12000</hardCopyCapBottom>
    </hardCopyCap>
  </deviceForm>
</deviceForms>
Omni/Brother/Brother HJ-400 Gammas.xml0100644000076400007640000001645607247551465016573 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE deviceGammaTables SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<deviceGammaTables>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_60_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_60_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_120_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_120_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_90_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_90_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_180_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_180_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_360_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_MATRIX</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>10</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
  <deviceGammaTable>
    <gammaTableResolution>RESOLUTION_360_X_180</gammaTableResolution>
    <gammaTableMedia>MEDIA_PLAIN</gammaTableMedia>
    <gammaTablePrintMode>PRINT_MODE_1_ANY</gammaTablePrintMode>
    <gammaTableDitherCatagory>DITHER_CATAGORY_DIFFUSION</gammaTableDitherCatagory>
    <gammaTableCGamma>10</gammaTableCGamma>
    <gammaTableMGamma>10</gammaTableMGamma>
    <gammaTableYGamma>10</gammaTableYGamma>
    <gammaTableKGamma>7</gammaTableKGamma>
    <gammaTableCBias>0</gammaTableCBias>
    <gammaTableMBias>0</gammaTableMBias>
    <gammaTableYBias>0</gammaTableYBias>
    <gammaTableKBias>0</gammaTableKBias>
  </deviceGammaTable>
</deviceGammaTables>
Omni/Brother/Brother HJ-400.xml0100644000076400007640000000377207276337145015401 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Device SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<Device name="Brother HJ-400">
  <DriverName>Brother</DriverName>
  <Capability type="MONOCHROME"/>
  <Capability type="MIRROR"/>
  <RasterCapabilities type="TOP_TO_BOTTOM"/>
  <PDL level="PDL_Epson" sublevel="LEVEL_ESC" major="1" minor="0"/>
  <Uses>Brother HJ-100i Commands.xml</Uses>
  <Has>Brother Orientations.xml</Has>
  <Has>Brother HJ-100i Resolutions.xml</Has>
  <Has>Brother HJ-100i PrintModes.xml</Has>
  <Has>Brother HJ-100i Trays.xml</Has>
  <Has>Brother HJ-400 Forms.xml</Has>
  <Has>Brother HJ-100i Medias.xml</Has>
  <Has>Brother HJ-100i Connections.xml</Has>
  <Instance>Brother ESC Instance.hpp</Instance>
  <Instance>Brother ESC Instance.cpp</Instance>
  <Blitter>Brother ESC Blitter.hpp</Blitter>
  <Blitter>Brother ESC Blitter.cpp</Blitter>
  <DefaultJobProperties>
    <orientation>ORIENTATION_PORTRAIT</orientation>
    <form>FORM_LETTER</form>
    <tray>TRAY_REAR_CONTINUOUS</tray>
    <media>MEDIA_PLAIN</media>
    <resolution>RESOLUTION_180_X_180</resolution>
    <dither>DITHER_STUCKI_DIFFUSION</dither>
    <printmode>PRINT_MODE_1_ANY</printmode>
  </DefaultJobProperties>
</Device>
Omni/Brother/Brother HL-10V Connections.xml0100664000076400007640000000605707375277645017722 0ustar  hamzyhamzy<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE deviceConnections SYSTEM "../OmniDevice.dtd">
<!--
     IBM Omni driver
     Copyright (c) International Business Machines Corp., 2000

     This library is free software; you can redistribute it and/or modify
     it under the terms of the GNU Lesser General Public License as published
     by the Free Software Foundation; either version 2.1 of the License, or
     (at your option) any later version.

     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
     the GNU Lesser General Public License for more details.

     You should have received a copy of the GNU Lesser General Public License
     along with this library; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->

<deviceConnections>
  <deviceConnection>
    <name>BROTHER_CONN_ID_1</name>
    <connectionForm>FORM_LETTER</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_2</name>
    <connectionForm>FORM_LEGAL</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_3</name>
    <connectionForm>FORM_EXECUTIVE</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_4</name>
    <connectionForm>FORM_A4</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_5</name>
    <connectionForm>FORM_B5</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_6</name>
    <connectionForm>FORM_C5_ENVELOPE</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_7</name>
    <connectionForm>FORM_C10_ENVELOPE</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_8</name>
    <connectionForm>FORM_DL_ENVELOPE</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
  <deviceConnection>
    <name>BROTHER_CONN_ID_9</name>
    <connectionForm>FORM_MONARCH_ENVELOPE</connectionForm>
    <connectionTray>TRAY_UPPER_CASSETTE</connectionTray>
    <connectionMedia>MEDIA_PLAIN</connectionMedia>
  </deviceConnection>
</deviceConnections>