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 PrinterDialog(wxWindow
*parent
= (wxWindow
*) NULL
);
50 inline virtual void BeginDrawing(void) {} ;
51 inline virtual void EndDrawing(void) {} ;
53 void FloodFill(long x1
, long y1
, const wxColour
&col
, int style
=wxFLOOD_SURFACE
) ;
54 bool GetPixel(long x1
, long y1
, wxColour
*col
) const;
56 void DrawLine(long x1
, long y1
, long x2
, long y2
);
57 void CrossHair(long x
, long y
) ;
58 void DrawArc(long x1
,long y1
,long x2
,long y2
,long xc
,long yc
);
59 void DrawEllipticArc(long x
,long y
,long w
,long h
,double sa
,double ea
);
60 void DrawPoint(long x
, long y
);
61 // Avoid compiler warning
62 void DrawPoint(wxPoint
& point
) { wxDC::DrawPoint(point
); }
63 void DrawLines(int n
, wxPoint points
[], long xoffset
= 0, long yoffset
= 0);
64 // Avoid compiler warning
65 void DrawLines(wxList
*lines
, long xoffset
= 0, long yoffset
= 0)
66 { wxDC::DrawLines(lines
, xoffset
, yoffset
); }
67 void DrawPolygon(int n
, wxPoint points
[], long xoffset
= 0, long yoffset
= 0, int fillStyle
=wxODDEVEN_RULE
);
68 // Avoid compiler warning
69 void DrawPolygon(wxList
*lines
, long xoffset
= 0, long yoffset
= 0, int fillStyle
=wxODDEVEN_RULE
)
70 { wxDC::DrawPolygon(lines
, xoffset
, yoffset
, fillStyle
); }
71 void DrawRectangle(long x
, long y
, long width
, long height
);
72 void DrawRoundedRectangle(long x
, long y
, long width
, long height
, double radius
= 20);
73 void DrawEllipse(long x
, long y
, long width
, long height
);
75 void DrawSpline(wxList
*points
);
77 bool Blit(long xdest
, long ydest
, long width
, long height
,
78 wxDC
*source
, long xsrc
, long ysrc
, int rop
= wxCOPY
, bool useMask
= FALSE
);
79 inline bool CanDrawBitmap(void) const { return TRUE
; }
81 void DrawIcon( const wxIcon
& icon
, long x
, long y
);
82 void DrawBitmap( const wxBitmap
& bitmap
, long x
, long y
, bool useMask
=FALSE
);
85 void DrawText(const wxString
& text
, long x
, long y
, bool use16
= FALSE
);
88 void SetFont( const wxFont
& font
);
89 void SetPen( const wxPen
& pen
);
90 void SetBrush( const wxBrush
& brush
);
91 void SetLogicalFunction( int function
);
92 void SetBackground( const wxBrush
& brush
);
94 void SetClippingRegion(long x
, long y
, long width
, long height
);
95 void SetClippingRegion( const wxRegion
®ion
);
96 void DestroyClippingRegion();
98 bool StartDoc(const wxString
& message
);
103 long GetCharHeight();
105 inline bool CanGetTextExtent(void) const { return FALSE
; }
106 void GetTextExtent(const wxString
& string
, long *x
, long *y
,
107 long *descent
= (long *) NULL
,
108 long *externalLeading
= (long *) NULL
,
109 wxFont
*theFont
= (wxFont
*) NULL
, bool use16
= FALSE
);
111 void GetSize(int* width
, int* height
) const;
112 void GetSizeMM(long *width
, long *height
) const;
114 void SetAxisOrientation( bool xLeftRight
, bool yBottomUp
);
115 void SetDeviceOrigin( long x
, long y
);
117 inline void SetBackgroundMode(int WXUNUSED(mode
)) {};
118 inline void SetPalette(const wxPalette
& WXUNUSED(palette
)) {}
120 inline ofstream
*GetStream(void) const { return m_pstream
; }
124 ofstream
* m_pstream
; // PostScript output stream
126 unsigned char m_currentRed
;
127 unsigned char m_currentGreen
;
128 unsigned char m_currentBlue
;
131 double m_underlinePosition
;
132 double m_underlineThickness
;