]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/dcpsg.h
Added C/wxString array constructors to wxArrayString
[wxWidgets.git] / include / wx / generic / dcpsg.h
CommitLineData
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$
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
RR
68
69 void DoDrawSpline(wxList *points);
70
72cdf4c9 71 bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
ca65c044 72 wxDC *source, wxCoord xsrc, wxCoord ysrc, int rop = wxCOPY, bool useMask = false,
422d0ff0 73 wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord);
ca65c044 74 bool CanDrawBitmap() const { return true; }
bf38cbff 75
72cdf4c9 76 void DoDrawIcon( const wxIcon& icon, wxCoord x, wxCoord y );
ca65c044 77 void DoDrawBitmap( const wxBitmap& bitmap, wxCoord x, wxCoord y, bool useMask = false );
bf38cbff 78
72cdf4c9 79 void DoDrawText(const wxString& text, wxCoord x, wxCoord y );
95724b1a 80 void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle);
c801d85f 81
a6f6393c 82 void Clear();
bf38cbff
JS
83 void SetFont( const wxFont& font );
84 void SetPen( const wxPen& pen );
85 void SetBrush( const wxBrush& brush );
86 void SetLogicalFunction( int function );
87 void SetBackground( const wxBrush& brush );
88
72cdf4c9 89 void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
a6f6393c 90 void DestroyClippingRegion();
af0bb3b1 91
72cdf4c9 92 void DoSetClippingRegionAsRegion( const wxRegion &WXUNUSED(clip) ) { }
c801d85f
KB
93
94 bool StartDoc(const wxString& message);
a6f6393c
VZ
95 void EndDoc();
96 void StartPage();
97 void EndPage();
c801d85f 98
72cdf4c9
VZ
99 wxCoord GetCharHeight() const;
100 wxCoord GetCharWidth() const;
ca65c044 101 bool CanGetTextExtent() const { return true; }
72cdf4c9
VZ
102 void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
103 wxCoord *descent = (wxCoord *) NULL,
104 wxCoord *externalLeading = (wxCoord *) NULL,
64698f9a 105 wxFont *theFont = (wxFont *) NULL ) const;
c801d85f 106
4e4ea166
RR
107 void DoGetSize(int* width, int* height) const;
108 void DoGetSizeMM(int *width, int *height) const;
7bcb11d3
JS
109
110 // Resolution in pixels per logical inch
72cdf4c9 111 wxSize GetPPI() const;
c801d85f 112
bf38cbff 113 void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
72cdf4c9 114 void SetDeviceOrigin( wxCoord x, wxCoord y );
bf38cbff 115
72cdf4c9
VZ
116 void SetBackgroundMode(int WXUNUSED(mode)) { }
117 void SetPalette(const wxPalette& WXUNUSED(palette)) { }
c801d85f 118
af0bb3b1
VZ
119 wxPrintData& GetPrintData() { return m_printData; }
120 void SetPrintData(const wxPrintData& data) { m_printData = data; }
121
122 virtual int GetDepth() const { return 24; }
ca65c044 123
b64de916
VS
124 static void SetResolution(int ppi);
125 static int GetResolution();
244e5e34
VZ
126
127 void PsPrintf( const wxChar* fmt, ... );
128 void PsPrint( const char* psdata );
129 void PsPrint( int ch );
130
131#if wxUSE_UNICODE
132 void PsPrint( const wxChar* psdata ) { PsPrint( wxConvUTF8.cWX2MB( psdata ) ); }
133#endif
134
ca65c044 135private:
eba33006 136 static float ms_PSScaleFactor;
7bcb11d3 137
c801d85f 138protected:
3a97d2db 139
eba33006
RR
140 FILE* m_pstream; // PostScript output stream
141 wxString m_title;
142 unsigned char m_currentRed;
143 unsigned char m_currentGreen;
144 unsigned char m_currentBlue;
145 int m_pageNumber;
146 bool m_clipping;
147 double m_underlinePosition;
148 double m_underlineThickness;
149 wxPrintData m_printData;
ca65c044 150
eba33006
RR
151private:
152 DECLARE_DYNAMIC_CLASS(wxPostScriptDC)
c801d85f
KB
153};
154
bf38cbff
JS
155#endif
156 // wxUSE_POSTSCRIPT
72cdf4c9 157
ce4169a4
RR
158#endif
159 // wxUSE_PRINTING_ARCHITECTURE
ed880dd4 160
c801d85f 161#endif
bf38cbff 162 // _WX_DCPSG_H_