1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-01-22 06:06:20 -05:00
|
|
|
// Name: dcps.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose: wxPostScriptDC class
|
|
|
|
// Author: Julian Smart and others
|
|
|
|
// Modified by:
|
|
|
|
// RCS-ID: $Id$
|
1999-01-22 06:06:20 -05:00
|
|
|
// Copyright: (c) Julian Smart, Robert Roebling and Markus Holzem
|
1998-11-29 17:21:32 -05: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
|
|
|
|
|
|
|
#ifdef __GNUG__
|
2002-05-05 14:27:03 -04:00
|
|
|
#pragma interface "dcpsg.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#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:
|
1998-11-29 17:21:32 -05:00
|
|
|
wxPostScriptDC();
|
1999-03-25 18:06:01 -05:00
|
|
|
|
|
|
|
// Recommended constructor
|
|
|
|
wxPostScriptDC(const wxPrintData& printData);
|
|
|
|
|
1998-11-29 17:21:32 -05:00
|
|
|
~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);
|
|
|
|
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
|
|
|
|
|
|
|
void DoDrawSpline(wxList *points);
|
|
|
|
|
1999-10-18 11:14:52 -04:00
|
|
|
bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
|
2001-07-12 06:37:27 -04:00
|
|
|
wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = FALSE,
|
|
|
|
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
|
1999-10-18 11:14:52 -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 );
|
|
|
|
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;
|
1999-11-03 10:32:10 -05: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; }
|
2000-08-03 17:43:30 -04:00
|
|
|
|
|
|
|
static void SetResolution(int ppi);
|
|
|
|
static int GetResolution();
|
|
|
|
|
|
|
|
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:
|
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;
|
|
|
|
|
|
|
|
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_
|