Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions
nsDeviceContextSpecOS2.h File Reference
#include "nsCOMPtr.h"
#include "nsIDeviceContextSpec.h"
#include "nsIPrintOptions.h"
#include "nsIPrintSettings.h"
#include "nsVoidArray.h"
#include "nsGFXDefs.h"
#include "nsPrintdOS2.h"
#include <os2.h>
#include <pmddim.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PRINTDLG
class  nsDeviceContextSpecOS2
class  nsPrinterEnumeratorOS2

Defines

#define INCL_PM
#define INCL_DOS
#define INCL_DOSERRORS
#define INCL_SPLDOSPRINT
#define INCL_DEV
#define INCL_DEVDJP
#define INCL_GRE_DEVICE
#define MAX_PRINT_QUEUES   (128)

Functions

BOOL PrnInitialize (HMODULE hmodResources)
BOOL PrnTerminate (void)
BOOL PrnClosePrinter (PRTQUEUE *pPrintQueue)
HDC PrnOpenDC (PRTQUEUE *pPrintQueue, PSZ pszApplicationName, int copies, int destination, char *file)
BOOL PrnQueryHardcopyCaps (HDC hdc, PHCINFO pHCInfo)
BOOL PrnAbortJob (HDC hdc)

Define Documentation

Definition at line 46 of file nsDeviceContextSpecOS2.h.

Definition at line 47 of file nsDeviceContextSpecOS2.h.

Definition at line 43 of file nsDeviceContextSpecOS2.h.

Definition at line 44 of file nsDeviceContextSpecOS2.h.

Definition at line 48 of file nsDeviceContextSpecOS2.h.

Definition at line 42 of file nsDeviceContextSpecOS2.h.

Definition at line 45 of file nsDeviceContextSpecOS2.h.

#define MAX_PRINT_QUEUES   (128)

Definition at line 73 of file nsDeviceContextSpecOS2.h.


Function Documentation

BOOL PrnAbortJob ( HDC  hdc)
BOOL PrnClosePrinter ( PRTQUEUE pPrintQueue)

Definition at line 998 of file nsDeviceContextSpecOS2.cpp.

{
   BOOL rc = FALSE;

   if (pPrintQueue)
   {
      delete pPrintQueue;
      rc = TRUE;
   }

   return rc;
}

Here is the caller graph for this function:

BOOL PrnInitialize ( HMODULE  hmodResources)

Definition at line 986 of file nsDeviceContextSpecOS2.cpp.

{
   hmodRes = hmodResources;
   return TRUE;
}
HDC PrnOpenDC ( PRTQUEUE pPrintQueue,
PSZ  pszApplicationName,
int  copies,
int  destination,
char *  file 
)

Definition at line 900 of file nsDeviceContextSpecOS2.cpp.

{
   HDC hdc = 0;
   PSZ pszLogAddress;
   PSZ pszDataType;
   LONG dcType;
   DEVOPENSTRUC dop;

   if (!pInfo || !pszApplicationName)
      return hdc;

   if ( destination ) {
      pszLogAddress = pInfo->PQI3 ().pszName;
      pszDataType = "PM_Q_STD";
      if ( destination == 2 )
         dcType = OD_METAFILE;
      else
         dcType = OD_QUEUED;
   } else {
      if (file && *file)
         pszLogAddress = (PSZ) file;
      else    
         pszLogAddress = "FILE";
      pszDataType = "PM_Q_RAW";
      dcType = OD_DIRECT;
   } 

   dop.pszLogAddress      = pszLogAddress; 
   dop.pszDriverName      = (char*)pInfo->DriverName ();
   dop.pdriv              = pInfo->PQI3 ().pDriverData;
   dop.pszDataType        = pszDataType; 
   dop.pszComment         = pszApplicationName;
   dop.pszQueueProcName   = pInfo->PQI3 ().pszPrProc;     
   dop.pszQueueProcParams = 0;
   dop.pszSpoolerParams   = 0;     
   dop.pszNetworkParams   = 0;     

   hdc = ::DevOpenDC( 0, dcType, "*", 9, (PDEVOPENDATA) &dop, NULLHANDLE);

#ifdef DEBUG
   if (hdc == 0)
   {
      ULONG ErrorCode = ERRORIDERROR (::WinGetLastError (0));
      printf ("!ERROR! - Can't open DC for printer %04lX\a\n", ErrorCode);
   }   
#endif

   return hdc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL PrnQueryHardcopyCaps ( HDC  hdc,
PHCINFO  pHCInfo 
)

Definition at line 951 of file nsDeviceContextSpecOS2.cpp.

{
   BOOL rc = FALSE;

   if( hdc && pHCInfo)
   {
      PHCINFO pBuffer;
      long    lAvail, i;

      /* query how many forms are available */
      lAvail = ::DevQueryHardcopyCaps( hdc, 0, 0, NULL);

      pBuffer = (PHCINFO) malloc( lAvail * sizeof(HCINFO));

      ::DevQueryHardcopyCaps( hdc, 0, lAvail, pBuffer);

      for( i = 0; i < lAvail; i++)
         if( pBuffer[ i].flAttributes & HCAPS_CURRENT)
         {
            memcpy( pHCInfo, pBuffer + i, sizeof(HCINFO));
            rc = TRUE;
            break;
         }

      free( pBuffer);
   }

   return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 992 of file nsDeviceContextSpecOS2.cpp.

{
   /* nop for now, may do something eventually */
   return TRUE;
}