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