#include <saveeps.h>
Inheritance diagram for EPSExportDC:
Public Member Functions | |
EPSExportDC (Filter *) | |
Initialise a DC for exporting EPS. | |
BOOL | Init (CCLexFile *) |
Calls the base class Init function and then sets up the DC to throw exceptions when it gets errors as that is how the EPS stuff expects errors to be reported. | |
virtual BOOL | OutputNewLine () |
Causes a new line to be started in the EPS output file. This is used to give a pleasant appearance to the EPS file - most EPS commands (as opposed to operands) are followed by a new line. | |
virtual BOOL | OutputToken (TCHAR *) |
Outputs a string token to the EPS file. This is the central routine through which the other high-level routines eventually come. The other routines convert their output to a string, which theythen pass on to this routine. A record is kept of the current line width - if it is over 70 characters wide before the token is output, then a new line is output to keep the lines in the EPS file reasonably short. For this reason, it is important not to output strings that contain newline characters, because this routine will not notice, and hence the LineWidth count will be wrong. This routine also ensures that tokens are separated by either a space or a newline, so it is not necessary to output spaces directly to keep the tokens separate - it happens automatically. | |
virtual BOOL | OutputDirect (BYTE *, INT32) |
Send bytes directly to the PostScript stream with no alteration or padding. Used for sending binary/hex data to stream. |
Definition at line 280 of file saveeps.h.
|
Initialise a DC for exporting EPS.
Definition at line 2611 of file saveeps.cpp. 02611 : ExportDC(Parent) 02612 { 02613 }
|
|
Calls the base class Init function and then sets up the DC to throw exceptions when it gets errors as that is how the EPS stuff expects errors to be reported.
Reimplemented from ExportDC. Definition at line 2631 of file saveeps.cpp. 02632 { 02633 // First get the base class to do its thing 02634 if (!ExportDC::Init(pFile)) return FALSE; 02635 02636 // now do what I want done. 02637 // We want export files to throw exceptions, and not report errors. 02638 ExportFile->SetThrowExceptions(TRUE); 02639 ExportFile->SetReportErrors(FALSE); 02640 return TRUE; 02641 }
|
|
Send bytes directly to the PostScript stream with no alteration or padding. Used for sending binary/hex data to stream.
Reimplemented from KernelDC. Definition at line 2755 of file saveeps.cpp. 02756 { 02757 if (ExportFile->write(Buf, nBytes).fail()) 02758 { 02759 // Error 02760 return FALSE; 02761 } 02762 02763 // All ok 02764 return TRUE; 02765 }
|
|
Causes a new line to be started in the EPS output file. This is used to give a pleasant appearance to the EPS file - most EPS commands (as opposed to operands) are followed by a new line.
Reimplemented from KernelDC. Definition at line 2661 of file saveeps.cpp. 02662 { 02663 // Graeme (22-2-00) - Windows uses \r\n as the newline code in its files. 02664 static TCHAR NewLine[] = _T("\r\n"); 02665 if (!OutputTCHARAsChar(NewLine, 2)) 02666 // Error occured 02667 return FALSE; 02668 02669 LineWidth = 0; 02670 02671 // Success 02672 return TRUE; 02673 }
|
|
Outputs a string token to the EPS file. This is the central routine through which the other high-level routines eventually come. The other routines convert their output to a string, which theythen pass on to this routine. A record is kept of the current line width - if it is over 70 characters wide before the token is output, then a new line is output to keep the lines in the EPS file reasonably short. For this reason, it is important not to output strings that contain newline characters, because this routine will not notice, and hence the LineWidth count will be wrong. This routine also ensures that tokens are separated by either a space or a newline, so it is not necessary to output spaces directly to keep the tokens separate - it happens automatically.
Reimplemented from KernelDC. Definition at line 2702 of file saveeps.cpp. 02703 { 02704 // Special tokens 02705 static TCHAR Space = _T(' '); 02706 02707 if (LineWidth > 100) 02708 { 02709 // (ChrisG 8/12/00) We now have only one way of writing a newline out. The old method 02710 // used "/n/r" to write a newline, which doesn't work, while OutputNewLine used "/r/n", 02711 // which does, Also the max line width has been expanded to 100 characters. 02712 if (OutputNewLine () == FALSE) 02713 // Error 02714 return FALSE; 02715 } 02716 02717 // Pad with a space (unless at the beginning of the line) 02718 if (LineWidth > 0) 02719 { 02720 if (!OutputTCHARAsChar(&Space, 1)) 02721 // Error 02722 return FALSE; 02723 LineWidth++; 02724 } 02725 02726 // Write the token out to the file 02727 INT32 Len = camStrlen(Str); 02728 if (!OutputTCHARAsChar(Str, Len)) 02729 // Error 02730 return FALSE; 02731 02732 LineWidth += Len; 02733 02734 // Success 02735 return TRUE; 02736 }
|