allow generating PS on an output stream and not only a FILE (patch 876362)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-02-10 22:46:12 +00:00
parent 0891fcb11f
commit 244e5e34c2
6 changed files with 492 additions and 487 deletions

View File

@@ -197,6 +197,7 @@ Unix:
- added XFree86 resolution changing using xf86vidmode extensions (Ryan Norton) - added XFree86 resolution changing using xf86vidmode extensions (Ryan Norton)
- implemented asynchronous playback in wxSound and added SDL backend in - implemented asynchronous playback in wxSound and added SDL backend in
addition to existing OSS one addition to existing OSS one
- it is now possible to send PostScript to any output stream (Zoltan Kovacs)
2.5.0 2.5.0

View File

@@ -22,6 +22,10 @@
#include "wx/colour.h" #include "wx/colour.h"
#include "wx/gdicmn.h" #include "wx/gdicmn.h"
#if wxUSE_STREAMS
#include "wx/stream.h"
#endif
class WXDLLEXPORT wxColourData: public wxObject class WXDLLEXPORT wxColourData: public wxObject
{ {
public: public:
@@ -203,6 +207,11 @@ public:
void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; } void SetPrinterTranslation(long x, long y) { m_printerTranslateX = x; m_printerTranslateY = y; }
void SetPrintMode(wxPrintMode printMode) { m_printMode = printMode; } void SetPrintMode(wxPrintMode printMode) { m_printMode = printMode; }
#if wxUSE_STREAMS
wxOutputStream* GetOutputStream() { return m_outputstream; }
void SetOutputStream(wxOutputStream* outputstream) { m_outputstream = outputstream; }
#endif
void operator=(const wxPrintData& data); void operator=(const wxPrintData& data);
#if defined(__WXMSW__) #if defined(__WXMSW__)
@@ -225,6 +234,9 @@ public:
#elif defined(__WXMAC__) #elif defined(__WXMAC__)
wxNativePrintData* m_nativePrintData ; wxNativePrintData* m_nativePrintData ;
#endif #endif
#if wxUSE_STREAMS
wxOutputStream* m_outputstream;
#endif
private: private:
@@ -251,7 +263,7 @@ private:
long m_printerTranslateX; long m_printerTranslateX;
long m_printerTranslateY; long m_printerTranslateY;
wxPrintMode m_printMode; wxPrintMode m_printMode;
private: private:
DECLARE_DYNAMIC_CLASS(wxPrintData) DECLARE_DYNAMIC_CLASS(wxPrintData)
}; };

View File

@@ -1994,7 +1994,8 @@ enum wxPrintMode
wxPRINT_MODE_NONE = 0, wxPRINT_MODE_NONE = 0,
wxPRINT_MODE_PREVIEW = 1, /* Preview in external application */ wxPRINT_MODE_PREVIEW = 1, /* Preview in external application */
wxPRINT_MODE_FILE = 2, /* Print to file */ wxPRINT_MODE_FILE = 2, /* Print to file */
wxPRINT_MODE_PRINTER = 3 /* Send to printer */ wxPRINT_MODE_PRINTER = 3, /* Send to printer */
wxPRINT_MODE_STREAM = 4 /* Send postscript data into a stream */
}; };
/* ---------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------- */

View File

@@ -129,7 +129,15 @@ public:
static void SetResolution(int ppi); static void SetResolution(int ppi);
static int GetResolution(); static int GetResolution();
void PsPrintf( const wxChar* fmt, ... );
void PsPrint( const char* psdata );
void PsPrint( int ch );
#if wxUSE_UNICODE
void PsPrint( const wxChar* psdata ) { PsPrint( wxConvUTF8.cWX2MB( psdata ) ); }
#endif
private: private:
static float ms_PSScaleFactor; static float ms_PSScaleFactor;

View File

@@ -213,6 +213,10 @@ wxPrintData::wxPrintData()
m_printerTranslateX = 0; m_printerTranslateX = 0;
m_printerTranslateY = 0; m_printerTranslateY = 0;
m_printMode = wxPRINT_MODE_FILE; m_printMode = wxPRINT_MODE_FILE;
#ifdef wxUSE_STREAMS
m_outputstream = NULL;
#endif
} }
wxPrintData::wxPrintData(const wxPrintData& printData) wxPrintData::wxPrintData(const wxPrintData& printData)
@@ -712,6 +716,9 @@ void wxPrintData::operator=(const wxPrintData& data)
m_printQuality = data.m_printQuality; m_printQuality = data.m_printQuality;
m_paperId = data.m_paperId; m_paperId = data.m_paperId;
m_paperSize = data.m_paperSize; m_paperSize = data.m_paperSize;
#ifdef wxUSE_STREAMS
m_outputstream = data.m_outputstream;
#endif
// PostScript-specific data // PostScript-specific data
m_printerCommand = data.m_printerCommand; m_printerCommand = data.m_printerCommand;

File diff suppressed because it is too large Load Diff