1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-09-15 15:26:27 +00:00
|
|
|
// Name: wx/generic/dcps.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose: wxPostScriptDC class
|
|
|
|
// Author: Julian Smart and others
|
|
|
|
// Modified by:
|
|
|
|
// RCS-ID: $Id$
|
2003-03-17 10:34:04 +00:00
|
|
|
// Copyright: (c) Julian Smart and Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
1999-01-22 11:06:20 +00:00
|
|
|
#ifndef _WX_DCPSG_H_
|
|
|
|
#define _WX_DCPSG_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-05-26 16:12:31 +00:00
|
|
|
#include "wx/defs.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-09-24 14:04:09 +00:00
|
|
|
#if wxUSE_PRINTING_ARCHITECTURE && wxUSE_POSTSCRIPT
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-05-26 16:12:31 +00:00
|
|
|
#include "wx/dc.h"
|
1999-01-22 11:06:20 +00:00
|
|
|
#include "wx/dialog.h"
|
|
|
|
#include "wx/module.h"
|
1999-03-25 23:06:01 +00:00
|
|
|
#include "wx/cmndata.h"
|
2007-03-17 10:26:10 +00:00
|
|
|
#include "wx/strvararg.h"
|
1998-10-12 07:46:15 +00:00
|
|
|
|
1999-01-22 11:06:20 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxPostScriptDC
|
|
|
|
//-----------------------------------------------------------------------------
|
1998-12-05 21:53:51 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
class WXDLLEXPORT wxPostScriptDC: public wxDC
|
|
|
|
{
|
1999-01-22 11:06:20 +00:00
|
|
|
public:
|
2003-07-08 11:18:42 +00:00
|
|
|
wxPostScriptDC();
|
1999-03-25 23:06:01 +00:00
|
|
|
|
2003-07-08 11:18:42 +00:00
|
|
|
// Recommended constructor
|
|
|
|
wxPostScriptDC(const wxPrintData& printData);
|
2007-05-02 11:05:45 +00:00
|
|
|
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxPostScriptDC();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
virtual bool Ok() const { return IsOk(); }
|
|
|
|
virtual bool IsOk() const;
|
1999-01-22 11:06:20 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
bool CanDrawBitmap() const { return true; }
|
1999-01-22 11:06:20 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
void Clear();
|
|
|
|
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-01-22 11:06:20 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
void DestroyClippingRegion();
|
1999-06-08 19:10:37 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
bool StartDoc(const wxString& message);
|
|
|
|
void EndDoc();
|
|
|
|
void StartPage();
|
|
|
|
void EndPage();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
wxCoord GetCharHeight() const;
|
|
|
|
wxCoord GetCharWidth() const;
|
|
|
|
bool CanGetTextExtent() const { return true; }
|
1999-03-25 23:06:01 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
// Resolution in pixels per logical inch
|
|
|
|
wxSize GetPPI() const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-09-24 14:04:09 +00:00
|
|
|
#if wxUSE_NEW_DC
|
|
|
|
#else
|
2007-05-02 11:05:45 +00:00
|
|
|
// these need to be overridden as wxPostscriptDC inherits
|
|
|
|
// from the platform dependent wxDC and this we'd call
|
|
|
|
// e.g. wxMSW specific code here.
|
2007-09-24 14:04:09 +00:00
|
|
|
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
|
2007-05-02 11:05:45 +00:00
|
|
|
virtual void SetMapMode(int mode);
|
|
|
|
virtual void SetUserScale(double x, double y);
|
|
|
|
virtual void SetLogicalScale(double x, double y);
|
|
|
|
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
|
|
|
|
virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
|
2007-09-24 14:04:09 +00:00
|
|
|
#endif
|
1999-01-22 11:06:20 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
void SetBackgroundMode(int WXUNUSED(mode)) { }
|
|
|
|
void SetPalette(const wxPalette& WXUNUSED(palette)) { }
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
void SetPrintData(const wxPrintData& data);
|
|
|
|
wxPrintData& GetPrintData() { return m_printData; }
|
1999-06-08 19:10:37 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
virtual int GetDepth() const { return 24; }
|
2004-06-17 16:22:36 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
static void SetResolution(int ppi);
|
|
|
|
static int GetResolution();
|
2004-02-10 22:46:12 +00:00
|
|
|
|
2007-05-02 11:05:45 +00:00
|
|
|
void PsPrint( const wxString& psdata );
|
2004-02-10 22:46:12 +00:00
|
|
|
|
2004-06-17 16:22:36 +00:00
|
|
|
private:
|
1999-03-25 23:06:01 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
protected:
|
2006-02-08 21:47:09 +00:00
|
|
|
bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style = wxFLOOD_SURFACE);
|
|
|
|
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);
|
|
|
|
void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle = wxODDEVEN_RULE);
|
|
|
|
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);
|
|
|
|
#if wxUSE_SPLINES
|
|
|
|
void DoDrawSpline(wxList *points);
|
|
|
|
#endif // wxUSE_SPLINES
|
|
|
|
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
|
|
|
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false,
|
|
|
|
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
|
|
|
|
void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
|
|
|
|
void DoDrawBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false);
|
|
|
|
void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
|
|
|
|
void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
|
|
|
|
void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
|
|
|
|
void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip)) { }
|
|
|
|
void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
|
|
|
|
wxCoord *descent = NULL,
|
|
|
|
wxCoord *externalLeading = NULL,
|
2007-04-25 01:49:47 +00:00
|
|
|
const wxFont *theFont = NULL) const;
|
2006-02-08 21:47:09 +00:00
|
|
|
void DoGetSize(int* width, int* height) const;
|
|
|
|
void DoGetSizeMM(int *width, int *height) const;
|
2003-07-08 11:18:42 +00:00
|
|
|
|
2002-08-17 16:29:05 +00: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;
|
2007-09-24 14:04:09 +00:00
|
|
|
double m_pageHeight;
|
2004-06-17 16:22:36 +00:00
|
|
|
|
2002-08-17 16:29:05 +00:00
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxPostScriptDC)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1999-01-22 11:06:20 +00:00
|
|
|
#endif
|
2007-09-24 14:04:09 +00:00
|
|
|
// wxUSE_POSTSCRIPT && wxUSE_PRINTING_ARCHITECTURE
|
1998-12-05 21:02:04 +00:00
|
|
|
|
1998-05-20 14:01:55 +00:00
|
|
|
#endif
|
1999-01-22 11:06:20 +00:00
|
|
|
// _WX_DCPSG_H_
|