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