Print support for OpenVMS. r=dcone

This commit is contained in:
colin%theblakes.com 1999-12-01 11:58:21 +00:00
Родитель f41b8402a5
Коммит cd9671e988
4 изменённых файлов: 35 добавлений и 0 удалений

Просмотреть файл

@ -106,7 +106,13 @@ NS_IMETHODIMP nsDeviceContextSpecGTK :: Init(PRBool aQuiet)
mPrData.fpf = PR_TRUE;
mPrData.grayscale = PR_FALSE;
mPrData.size = NS_LETTER_SIZE;
#ifndef VMS
sprintf( mPrData.command, "lpr" );
#else
// Note to whoever puts the "lpr" into the prefs file. Please contact me
// as I need to make the default be "print" instead of "lpr" for OpenVMS.
sprintf( mPrData.command, "print" );
#endif
// PWD, HOME, or fail

Просмотреть файл

@ -28,6 +28,9 @@
#include "nsFont.h"
#include "nsIImage.h"
#include "nsAFMObject.h"
#ifdef VMS
#include <stdlib.h>
#endif
extern "C" PS_FontInfo *PSFE_MaskToFI[N_FONTS]; // need fontmetrics.c
@ -69,6 +72,15 @@ nsPostScriptObj::~nsPostScriptObj()
fclose( mPrintSetup->out );
else
pclose( mPrintSetup->out );
#ifdef VMS
if ( mPrintSetup->print_cmd != (char *) NULL ) {
char VMSPrintCommand[1024];
sprintf (VMSPrintCommand, "%s /delete %s.",
mPrintSetup->print_cmd, mPrintSetup->filename);
system(VMSPrintCommand);
free(mPrintSetup->filename);
}
#endif
// Cleanup things allocated along the way
if (nsnull != mPrintContext){
if (nsnull != mPrintContext->prInfo){
@ -126,9 +138,17 @@ printf( "top %f bottom %f left %f right %f\n", top, bottom, left, right );
mPrintSetup->paper_size = printSize;
aSpec->GetToPrinter( isAPrinter );
if ( isAPrinter == PR_TRUE ) {
#ifndef VMS
aSpec->GetCommand( &buf );
mPrintSetup->out = popen( buf, "w" );
mPrintSetup->filename = (char *) NULL;
#else
// We can not open a pipe and print the contents of it. Instead
// we have to print to a file and then print that.
aSpec->GetCommand( &mPrintSetup->print_cmd );
mPrintSetup->filename = tempnam("SYS$SCRATCH:","MOZ_P");
mPrintSetup->out = fopen(mPrintSetup->filename, "w");
#endif
} else {
aSpec->GetPath( &buf );
mPrintSetup->filename = buf;

Просмотреть файл

@ -160,6 +160,9 @@ struct PrintSetup_ {
XL_CompletionRoutine completion; // Called when translation finished
void* carg; // Data saved for completion routine
int status; // Status of URL on completion
#ifdef VMS
char *print_cmd; // print command issued in dtor
#endif
// "other" font is for encodings other than iso-8859-1
char *otherFontName[N_FONTS];

Просмотреть файл

@ -106,7 +106,13 @@ NS_IMETHODIMP nsDeviceContextSpecGTK :: Init(PRBool aQuiet)
mPrData.fpf = PR_TRUE;
mPrData.grayscale = PR_FALSE;
mPrData.size = NS_LETTER_SIZE;
#ifndef VMS
sprintf( mPrData.command, "lpr" );
#else
// Note to whoever puts the "lpr" into the prefs file. Please contact me
// as I need to make the default be "print" instead of "lpr" for OpenVMS.
sprintf( mPrData.command, "print" );
#endif
// PWD, HOME, or fail