]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/dcps.h
Changed clipboard text format id from "STRING" to "TEXT"
[wxWidgets.git] / include / wx / gtk1 / dcps.h
CommitLineData
ed880dd4
RR
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
f04371f0
RR
11#ifndef __GTKDCPSH__
12#define __GTKDCPSNH__
ed880dd4
RR
13
14#ifdef __GNUG__
15#pragma interface
16#endif
17
18#include "wx/dc.h"
06cfab17
RR
19
20#if wxUSE_POSTSCRIPT
21
ed880dd4
RR
22#include "wx/dialog.h"
23#include "wx/module.h"
24#include <fstream.h>
25
ed880dd4
RR
26
27//-----------------------------------------------------------------------------
28// classes
29//-----------------------------------------------------------------------------
30
ed880dd4 31class wxPostScriptDC;
ed880dd4
RR
32
33//-----------------------------------------------------------------------------
34// wxPostScriptDC
35//-----------------------------------------------------------------------------
36
37class WXDLLEXPORT wxPostScriptDC: public wxDC
38{
39 DECLARE_DYNAMIC_CLASS(wxPostScriptDC)
40
41public:
42
43 wxPostScriptDC();
44 wxPostScriptDC(const wxString& output, bool interactive = TRUE, wxWindow *parent = (wxWindow *) NULL);
45
46 ~wxPostScriptDC();
47
48 bool Create(const wxString& output, bool interactive = TRUE, wxWindow *parent = (wxWindow *) NULL);
49
4bc67cc5
RR
50 virtual bool Ok() const;
51
ed880dd4
RR
52 virtual bool PrinterDialog(wxWindow *parent = (wxWindow *) NULL);
53
4bc67cc5
RR
54 virtual void BeginDrawing() {}
55 virtual void EndDrawing() {}
ed880dd4
RR
56
57 void FloodFill(long x1, long y1, const wxColour &col, int style=wxFLOOD_SURFACE) ;
58 bool GetPixel(long x1, long y1, wxColour *col) const;
59
60 void DrawLine(long x1, long y1, long x2, long y2);
61 void CrossHair(long x, long y) ;
62 void DrawArc(long x1,long y1,long x2,long y2,long xc,long yc);
63 void DrawEllipticArc(long x,long y,long w,long h,double sa,double ea);
64 void DrawPoint(long x, long y);
65 // Avoid compiler warning
66 void DrawPoint(wxPoint& point) { wxDC::DrawPoint(point); }
67 void DrawLines(int n, wxPoint points[], long xoffset = 0, long yoffset = 0);
68 // Avoid compiler warning
69 void DrawLines(wxList *lines, long xoffset = 0, long yoffset = 0)
70 { wxDC::DrawLines(lines, xoffset, yoffset); }
71 void DrawPolygon(int n, wxPoint points[], long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE);
72 // Avoid compiler warning
73 void DrawPolygon(wxList *lines, long xoffset = 0, long yoffset = 0, int fillStyle=wxODDEVEN_RULE)
74 { wxDC::DrawPolygon(lines, xoffset, yoffset, fillStyle); }
75 void DrawRectangle(long x, long y, long width, long height);
76 void DrawRoundedRectangle(long x, long y, long width, long height, double radius = 20);
77 void DrawEllipse(long x, long y, long width, long height);
78
79 void DrawSpline(wxList *points);
80
81 bool Blit(long xdest, long ydest, long width, long height,
82 wxDC *source, long xsrc, long ysrc, int rop = wxCOPY, bool useMask = FALSE);
83 inline bool CanDrawBitmap(void) const { return TRUE; }
84
85 void DrawIcon( const wxIcon& icon, long x, long y );
86 void DrawBitmap( const wxBitmap& bitmap, long x, long y, bool useMask=FALSE );
8bbe427f 87
ed880dd4
RR
88 void DrawText(const wxString& text, long x, long y, bool use16 = FALSE);
89
90 void Clear();
91 void SetFont( const wxFont& font );
92 void SetPen( const wxPen& pen );
93 void SetBrush( const wxBrush& brush );
94 void SetLogicalFunction( int function );
95 void SetBackground( const wxBrush& brush );
8bbe427f 96
ed880dd4
RR
97 void SetClippingRegion(long x, long y, long width, long height);
98 void SetClippingRegion( const wxRegion &region );
99 void DestroyClippingRegion();
100
101 bool StartDoc(const wxString& message);
102 void EndDoc();
103 void StartPage();
104 void EndPage();
105
106 long GetCharHeight();
107 long GetCharWidth();
108 inline bool CanGetTextExtent(void) const { return FALSE; }
109 void GetTextExtent(const wxString& string, long *x, long *y,
110 long *descent = (long *) NULL,
111 long *externalLeading = (long *) NULL,
112 wxFont *theFont = (wxFont *) NULL, bool use16 = FALSE);
8bbe427f 113
ed880dd4
RR
114 void GetSize(int* width, int* height) const;
115 void GetSizeMM(long *width, long *height) const;
116
117 void SetAxisOrientation( bool xLeftRight, bool yBottomUp );
118 void SetDeviceOrigin( long x, long y );
8bbe427f 119
4bc67cc5 120 inline void SetBackgroundMode(int WXUNUSED(mode)) {}
ed880dd4 121 inline void SetPalette(const wxPalette& WXUNUSED(palette)) {}
8bbe427f 122
ed880dd4
RR
123 inline ofstream *GetStream(void) const { return m_pstream; }
124
125protected:
126
127 ofstream * m_pstream; // PostScript output stream
128 wxString m_title;
129 unsigned char m_currentRed;
130 unsigned char m_currentGreen;
131 unsigned char m_currentBlue;
132 int m_pageNumber;
133 bool m_clipping;
134 double m_underlinePosition;
135 double m_underlineThickness;
136};
137
8bbe427f 138#endif
ed880dd4
RR
139 // wxUSE_POSTSCRIPT
140
141#endif
f04371f0 142 // __GTKDCPSH__