1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-09-15 11:26:27 -04:00
|
|
|
// Name: wx/generic/dcps.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose: wxPostScriptDC class
|
|
|
|
// Author: Julian Smart and others
|
|
|
|
// Modified by:
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 05:34:04 -05:00
|
|
|
// Copyright: (c) Julian Smart and Robert Roebling
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
#ifndef _WX_DCPSG_H_
|
|
|
|
#define _WX_DCPSG_H_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
#include "wx/dc.h"
|
|
|
|
|
1999-06-15 16:21:59 -04:00
|
|
|
#if wxUSE_PRINTING_ARCHITECTURE
|
|
|
|
|
1998-09-25 09:28:52 -04:00
|
|
|
#if wxUSE_POSTSCRIPT
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
#include "wx/dialog.h"
|
|
|
|
#include "wx/module.h"
|
1999-03-25 18:06:01 -05:00
|
|
|
#include "wx/cmndata.h"
|
1998-10-12 03:46:15 -04:00
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
1998-12-05 16:53:51 -05:00
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
class wxPostScriptDC;
|
1998-12-05 16:53:51 -05:00
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxPostScriptDC
|
|
|
|
//-----------------------------------------------------------------------------
|
1998-12-05 16:53:51 -05:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
class WXDLLEXPORT wxPostScriptDC: public wxDC
|
|
|
|
{
|
1999-01-22 06:06:20 -05:00
|
|
|
public:
|
2003-07-08 07:18:42 -04:00
|
|
|
wxPostScriptDC();
|
1999-03-25 18:06:01 -05:00
|
|
|
|
2003-07-08 07:18:42 -04:00
|
|
|
// Recommended constructor
|
|
|
|
wxPostScriptDC(const wxPrintData& printData);
|
2004-06-17 12:22:36 -04:00
|
|
|
|
2003-07-08 07:18:42 -04:00
|
|
|
// Recommended destructor :-)
|
|
|
|
~wxPostScriptDC();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
virtual bool Ok() const;
|
|
|
|
|
|
|
|
virtual void BeginDrawing() {}
|
|
|
|
virtual void EndDrawing() {}
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2002-04-17 07:48:11 -04:00
|
|
|
bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE );
|
1999-10-18 11:14:52 -04:00
|
|
|
bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const;
|
|
|
|
|
|
|
|
void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
|
|
|
|
void DoCrossHair(wxCoord x, wxCoord y) ;
|
|
|
|
void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
|
|
|
|
void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
|
|
|
|
void DoDrawPoint(wxCoord x, wxCoord y);
|
|
|
|
void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
|
|
|
|
void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE);
|
2004-02-29 18:34:01 -05:00
|
|
|
void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE);
|
1999-10-18 11:14:52 -04:00
|
|
|
void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
|
|
|
void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20);
|
|
|
|
void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
1999-05-14 16:27:41 -04:00
|
|
|
|
2005-09-15 11:26:27 -04:00
|
|
|
#if wxUSE_SPLINES
|
1999-05-14 16:27:41 -04:00
|
|
|
void DoDrawSpline(wxList *points);
|
2005-09-15 11:26:27 -04:00
|
|
|
#endif // wxUSE_SPLINES
|
1999-10-18 11:14:52 -04:00
|
|
|
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
2004-06-17 12:22:36 -04:00
|
|
|
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false,
|
2004-07-20 06:09:47 -04:00
|
|
|
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
|
2004-06-17 12:22:36 -04:00
|
|
|
bool CanDrawBitmap() const { return true; }
|
1999-01-22 06:06:20 -05:00
|
|
|
|
1999-10-18 11:14:52 -04:00
|
|
|
void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y );
|
2004-06-17 12:22:36 -04:00
|
|
|
void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false );
|
1999-01-22 06:06:20 -05:00
|
|
|
|
1999-10-18 11:14:52 -04:00
|
|
|
void DoDrawText(const wxString& text, wxCoord x, wxCoord y );
|
1999-12-06 04:35:27 -05:00
|
|
|
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1998-11-29 17:21:32 -05:00
|
|
|
void Clear();
|
1999-01-22 06:06:20 -05:00
|
|
|
void SetFont( const wxFont& font );
|
|
|
|
void SetPen( const wxPen& pen );
|
|
|
|
void SetBrush( const wxBrush& brush );
|
|
|
|
void SetLogicalFunction( int function );
|
|
|
|
void SetBackground( const wxBrush& brush );
|
|
|
|
|
1999-10-18 11:14:52 -04:00
|
|
|
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
1998-11-29 17:21:32 -05:00
|
|
|
void DestroyClippingRegion();
|
1999-06-08 15:10:37 -04:00
|
|
|
|
1999-10-18 11:14:52 -04:00
|
|
|
void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { }
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
bool StartDoc(const wxString& message);
|
1998-11-29 17:21:32 -05:00
|
|
|
void EndDoc();
|
|
|
|
void StartPage();
|
|
|
|
void EndPage();
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-10-18 11:14:52 -04:00
|
|
|
wxCoord GetCharHeight() const;
|
|
|
|
wxCoord GetCharWidth() const;
|
2004-06-17 12:22:36 -04:00
|
|
|
bool CanGetTextExtent() const { return true; }
|
1999-10-18 11:14:52 -04:00
|
|
|
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
|
|
|
wxCoord *descent = (wxCoord *) NULL,
|
|
|
|
wxCoord *externalLeading = (wxCoord *) NULL,
|
1999-05-14 16:27:41 -04:00
|
|
|
wxFont *theFont = (wxFont *) NULL ) const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-05-15 19:40:42 -04:00
|
|
|
void DoGetSize(int* width, int* height) const;
|
|
|
|
void DoGetSizeMM(int *width, int *height) const;
|
1999-03-25 18:06:01 -05:00
|
|
|
|
|
|
|
// Resolution in pixels per logical inch
|
1999-10-18 11:14:52 -04:00
|
|
|
wxSize GetPPI() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
1999-10-18 11:14:52 -04:00
|
|
|
void SetDeviceOrigin( wxCoord x, wxCoord y );
|
1999-01-22 06:06:20 -05:00
|
|
|
|
1999-10-18 11:14:52 -04:00
|
|
|
void SetBackgroundMode(int WXUNUSED(mode)) { }
|
|
|
|
void SetPalette(const wxPalette& WXUNUSED(palette)) { }
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-06-08 15:10:37 -04:00
|
|
|
wxPrintData& GetPrintData() { return m_printData; }
|
|
|
|
void SetPrintData(const wxPrintData& data) { m_printData = data; }
|
|
|
|
|
|
|
|
virtual int GetDepth() const { return 24; }
|
2004-06-17 12:22:36 -04:00
|
|
|
|
2000-08-03 17:43:30 -04:00
|
|
|
static void SetResolution(int ppi);
|
|
|
|
static int GetResolution();
|
2004-02-10 17:46:12 -05:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2004-06-17 12:22:36 -04:00
|
|
|
private:
|
2002-08-17 12:29:05 -04:00
|
|
|
static float ms_PSScaleFactor;
|
1999-03-25 18:06:01 -05:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
protected:
|
2003-07-08 07:18:42 -04:00
|
|
|
|
2002-08-17 12:29:05 -04:00
|
|
|
FILE* m_pstream; // PostScript output stream
|
|
|
|
wxString m_title;
|
|
|
|
unsigned char m_currentRed;
|
|
|
|
unsigned char m_currentGreen;
|
|
|
|
unsigned char m_currentBlue;
|
|
|
|
int m_pageNumber;
|
|
|
|
bool m_clipping;
|
|
|
|
double m_underlinePosition;
|
|
|
|
double m_underlineThickness;
|
|
|
|
wxPrintData m_printData;
|
2004-06-17 12:22:36 -04:00
|
|
|
|
2002-08-17 12:29:05 -04:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPostScriptDC)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
1999-01-22 06:06:20 -05:00
|
|
|
#endif
|
|
|
|
// wxUSE_POSTSCRIPT
|
1999-10-18 11:14:52 -04:00
|
|
|
|
1999-06-15 16:21:59 -04:00
|
|
|
#endif
|
|
|
|
// wxUSE_PRINTING_ARCHITECTURE
|
1998-12-05 16:02:04 -05:00
|
|
|
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
1999-01-22 06:06:20 -05:00
|
|
|
// _WX_DCPSG_H_
|