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