1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxPostScriptDC class
4 // Author: Julian Smart and others
7 // Copyright: (c) Julian Smart, Robert Roebling and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
19 #include "wx/dialog.h"
20 #include "wx/module.h"
25 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 //-----------------------------------------------------------------------------
35 class WXDLLEXPORT wxPostScriptDC
: public wxDC
37 DECLARE_DYNAMIC_CLASS(wxPostScriptDC
)
42 wxPostScriptDC(const wxString
& output
, bool interactive
= TRUE
, wxWindow
*parent
= (wxWindow
*) NULL
);
46 bool Create(const wxString
& output
, bool interactive
= TRUE
, wxWindow
*parent
= (wxWindow
*) NULL
);
48 virtual bool Ok() const;
50 virtual bool PrinterDialog(wxWindow
*parent
= (wxWindow
*) NULL
);
52 virtual void BeginDrawing() {}
53 virtual void EndDrawing() {}
55 void FloodFill(long x1
, long y1
, const wxColour
&col
, int style
=wxFLOOD_SURFACE
) ;
56 bool GetPixel(long x1
, long y1
, wxColour
*col
) const;
58 void DrawLine(long x1
, long y1
, long x2
, long y2
);
59 void CrossHair(long x
, long y
) ;
60 void DrawArc(long x1
,long y1
,long x2
,long y2
,long xc
,long yc
);
61 void DrawEllipticArc(long x
,long y
,long w
,long h
,double sa
,double ea
);
62 void DrawPoint(long x
, long y
);
63 // Avoid compiler warning
64 void DrawPoint(wxPoint
& point
) { wxDC::DrawPoint(point
); }
65 void DrawLines(int n
, wxPoint points
[], long xoffset
= 0, long yoffset
= 0);
66 // Avoid compiler warning
67 void DrawLines(wxList
*lines
, long xoffset
= 0, long yoffset
= 0)
68 { wxDC::DrawLines(lines
, xoffset
, yoffset
); }
69 void DrawPolygon(int n
, wxPoint points
[], long xoffset
= 0, long yoffset
= 0, int fillStyle
=wxODDEVEN_RULE
);
70 // Avoid compiler warning
71 void DrawPolygon(wxList
*lines
, long xoffset
= 0, long yoffset
= 0, int fillStyle
=wxODDEVEN_RULE
)
72 { wxDC::DrawPolygon(lines
, xoffset
, yoffset
, fillStyle
); }
73 void DrawRectangle(long x
, long y
, long width
, long height
);
74 void DrawRoundedRectangle(long x
, long y
, long width
, long height
, double radius
= 20);
75 void DrawEllipse(long x
, long y
, long width
, long height
);
77 void DrawSpline(wxList
*points
);
79 bool Blit(long xdest
, long ydest
, long width
, long height
,
80 wxDC
*source
, long xsrc
, long ysrc
, int rop
= wxCOPY
, bool useMask
= FALSE
);
81 inline bool CanDrawBitmap(void) const { return TRUE
; }
83 void DrawIcon( const wxIcon
& icon
, long x
, long y
);
84 void DrawBitmap( const wxBitmap
& bitmap
, long x
, long y
, bool useMask
=FALSE
);
86 void DrawText(const wxString
& text
, long x
, long y
, bool use16
= FALSE
);
89 void SetFont( const wxFont
& font
);
90 void SetPen( const wxPen
& pen
);
91 void SetBrush( const wxBrush
& brush
);
92 void SetLogicalFunction( int function
);
93 void SetBackground( const wxBrush
& brush
);
95 void SetClippingRegion(long x
, long y
, long width
, long height
);
96 void SetClippingRegion( const wxRegion
®ion
);
97 void DestroyClippingRegion();
99 bool StartDoc(const wxString
& message
);
104 long GetCharHeight();
106 inline bool CanGetTextExtent(void) const { return FALSE
; }
107 void GetTextExtent(const wxString
& string
, long *x
, long *y
,
108 long *descent
= (long *) NULL
,
109 long *externalLeading
= (long *) NULL
,
110 wxFont
*theFont
= (wxFont
*) NULL
, bool use16
= FALSE
);
112 void GetSize(int* width
, int* height
) const;
113 void GetSizeMM(long *width
, long *height
) const;
115 void SetAxisOrientation( bool xLeftRight
, bool yBottomUp
);
116 void SetDeviceOrigin( long x
, long y
);
118 inline void SetBackgroundMode(int WXUNUSED(mode
)) {}
119 inline void SetPalette(const wxPalette
& WXUNUSED(palette
)) {}
121 inline ofstream
*GetStream(void) const { return m_pstream
; }
125 ofstream
* m_pstream
; // PostScript output stream
127 unsigned char m_currentRed
;
128 unsigned char m_currentGreen
;
129 unsigned char m_currentBlue
;
132 double m_underlinePosition
;
133 double m_underlineThickness
;