]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/dcpsg.h
added ping location for IRIX
[wxWidgets.git] / include / wx / generic / dcpsg.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
389076f1 2// Name: wx/generic/dcps.h
c801d85f
KB
3// Purpose: wxPostScriptDC class
4// Author: Julian Smart and others
5// Modified by:
c801d85f 6// RCS-ID: $Id$
371a5b4e 7// Copyright: (c) Julian Smart and Robert Roebling
65571936 8// Licence: wxWindows licence
c801d85f
KB
9/////////////////////////////////////////////////////////////////////////////
10
bf38cbff
JS
11#ifndef _WX_DCPSG_H_
12#define _WX_DCPSG_H_
c801d85f 13
12028905 14#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
ade6b9c5 15#pragma interface "dcpsg.h"
c801d85f
KB
16#endif
17
18#include "wx/dc.h"
c801d85f 19
ce4169a4
RR
20#if wxUSE_PRINTING_ARCHITECTURE
21
47d67540 22#if wxUSE_POSTSCRIPT
c801d85f 23
bf38cbff
JS
24#include "wx/dialog.h"
25#include "wx/module.h"
7bcb11d3 26#include "wx/cmndata.h"
fbc535ff 27
bf38cbff
JS
28//-----------------------------------------------------------------------------
29// classes
30//-----------------------------------------------------------------------------
f04371f0 31
bf38cbff 32class wxPostScriptDC;
f04371f0 33
bf38cbff
JS
34//-----------------------------------------------------------------------------
35// wxPostScriptDC
36//-----------------------------------------------------------------------------
f04371f0 37
c801d85f
KB
38class WXDLLEXPORT wxPostScriptDC: public wxDC
39{
bf38cbff 40public:
3a97d2db 41 wxPostScriptDC();
7bcb11d3 42
3a97d2db
RR
43 // Recommended constructor
44 wxPostScriptDC(const wxPrintData& printData);
ca65c044 45
3a97d2db
RR
46 // Recommended destructor :-)
47 ~wxPostScriptDC();
c801d85f 48
bf38cbff
JS
49 virtual bool Ok() const;
50
bf38cbff
JS
51 virtual void BeginDrawing() {}
52 virtual void EndDrawing() {}
c801d85f 53
387ebd3e 54 bool DoFloodFill(wxCoord x1, wxCoord y1, const wxColour &col, int style=wxFLOOD_SURFACE );
72cdf4c9
VZ
55 bool DoGetPixel(wxCoord x1, wxCoord y1, wxColour *col) const;
56
57 void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
58 void DoCrossHair(wxCoord x, wxCoord y) ;
59 void DoDrawArc(wxCoord x1,wxCoord y1,wxCoord x2,wxCoord y2,wxCoord xc,wxCoord yc);
60 void DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea);
61 void DoDrawPoint(wxCoord x, wxCoord y);
62 void DoDrawLines(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0);
63 void DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE);
793db755 64 void DoDrawPolyPolygon(int n, int count[], wxPoint points[], wxCoord xoffset = 0, wxCoord yoffset = 0, int fillStyle=wxODDEVEN_RULE);
72cdf4c9
VZ
65 void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
66 void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20);
67 void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
64698f9a 68
389076f1 69#if wxUSE_SPLINES
64698f9a 70 void DoDrawSpline(wxList *points);
389076f1 71#endif // wxUSE_SPLINES
72cdf4c9 72 bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
ca65c044 73 wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false,
422d0ff0 74 wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
ca65c044 75 bool CanDrawBitmap() const { return true; }
bf38cbff 76
72cdf4c9 77 void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y );
ca65c044 78 void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false );
bf38cbff 79
72cdf4c9 80 void DoDrawText(const wxString& text, wxCoord x, wxCoord y );
95724b1a 81 void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
c801d85f 82
a6f6393c 83 void Clear();
bf38cbff
JS
84 void SetFont( const wxFont& font );
85 void SetPen( const wxPen& pen );
86 void SetBrush( const wxBrush& brush );
87 void SetLogicalFunction( int function );
88 void SetBackground( const wxBrush& brush );
89
72cdf4c9 90 void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
a6f6393c 91 void DestroyClippingRegion();
af0bb3b1 92
72cdf4c9 93 void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { }
c801d85f
KB
94
95 bool StartDoc(const wxString& message);
a6f6393c
VZ
96 void EndDoc();
97 void StartPage();
98 void EndPage();
c801d85f 99
72cdf4c9
VZ
100 wxCoord GetCharHeight() const;
101 wxCoord GetCharWidth() const;
ca65c044 102 bool CanGetTextExtent() const { return true; }
72cdf4c9
VZ
103 void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
104 wxCoord *descent = (wxCoord *) NULL,
105 wxCoord *externalLeading = (wxCoord *) NULL,
64698f9a 106 wxFont *theFont = (wxFont *) NULL ) const;
c801d85f 107
4e4ea166
RR
108 void DoGetSize(int* width, int* height) const;
109 void DoGetSizeMM(int *width, int *height) const;
7bcb11d3
JS
110
111 // Resolution in pixels per logical inch
72cdf4c9 112 wxSize GetPPI() const;
c801d85f 113
bf38cbff 114 void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
72cdf4c9 115 void SetDeviceOrigin( wxCoord x, wxCoord y );
bf38cbff 116
72cdf4c9
VZ
117 void SetBackgroundMode(int WXUNUSED(mode)) { }
118 void SetPalette(const wxPalette& WXUNUSED(palette)) { }
c801d85f 119
af0bb3b1
VZ
120 wxPrintData& GetPrintData() { return m_printData; }
121 void SetPrintData(const wxPrintData& data) { m_printData = data; }
122
123 virtual int GetDepth() const { return 24; }
ca65c044 124
b64de916
VS
125 static void SetResolution(int ppi);
126 static int GetResolution();
244e5e34
VZ
127
128 void PsPrintf( const wxChar* fmt, ... );
129 void PsPrint( const char* psdata );
130 void PsPrint( int ch );
131
132#if wxUSE_UNICODE
133 void PsPrint( const wxChar* psdata ) { PsPrint( wxConvUTF8.cWX2MB( psdata ) ); }
134#endif
135
ca65c044 136private:
eba33006 137 static float ms_PSScaleFactor;
7bcb11d3 138
c801d85f 139protected:
3a97d2db 140
eba33006
RR
141 FILE* m_pstream; // PostScript output stream
142 wxString m_title;
143 unsigned char m_currentRed;
144 unsigned char m_currentGreen;
145 unsigned char m_currentBlue;
146 int m_pageNumber;
147 bool m_clipping;
148 double m_underlinePosition;
149 double m_underlineThickness;
150 wxPrintData m_printData;
ca65c044 151
eba33006
RR
152private:
153 DECLARE_DYNAMIC_CLASS(wxPostScriptDC)
c801d85f
KB
154};
155
bf38cbff
JS
156#endif
157 // wxUSE_POSTSCRIPT
72cdf4c9 158
ce4169a4
RR
159#endif
160 // wxUSE_PRINTING_ARCHITECTURE
ed880dd4 161
c801d85f 162#endif
bf38cbff 163 // _WX_DCPSG_H_