]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/dcclient.h
Cured last focus bug (I hope); some wxMotif mods
[wxWidgets.git] / include / wx / gtk1 / dcclient.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcclient.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __GTKDCCLIENTH__
12 #define __GTKDCCLIENTH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/dc.h"
19 #include "wx/window.h"
20
21 //-----------------------------------------------------------------------------
22 // classes
23 //-----------------------------------------------------------------------------
24
25 class wxWindowDC;
26 class wxPaintDC;
27 class wxClientDC;
28
29 //-----------------------------------------------------------------------------
30 // wxWindowDC
31 //-----------------------------------------------------------------------------
32
33 class wxWindowDC: public wxDC
34 {
35 DECLARE_DYNAMIC_CLASS(wxWindowDC)
36
37 public:
38 wxWindowDC();
39 wxWindowDC( wxWindow *win );
40
41 ~wxWindowDC();
42
43 virtual void FloodFill( long x, long y, const wxColour& col, int style=wxFLOOD_SURFACE );
44 virtual bool GetPixel( long x1, long y1, wxColour *col ) const;
45
46 virtual void DrawLine( long x1, long y1, long x2, long y2 );
47 virtual void CrossHair( long x, long y );
48 virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc );
49 virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea );
50 virtual void DrawPoint( long x, long y );
51
52 virtual void DrawLines( int n, wxPoint points[], long xoffset = 0, long yoffset = 0 );
53 virtual void DrawLines( wxList *points, long xoffset = 0, long yoffset = 0 );
54 virtual void DrawPolygon( int n, wxPoint points[], long xoffset = 0, long yoffset = 0,
55 int fillStyle=wxODDEVEN_RULE );
56 virtual void DrawPolygon( wxList *lines, long xoffset = 0, long yoffset = 0,
57 int fillStyle=wxODDEVEN_RULE );
58
59 virtual void DrawRectangle( long x, long y, long width, long height );
60 virtual void DrawRoundedRectangle( long x, long y, long width, long height, double radius = 20.0 );
61 virtual void DrawEllipse( long x, long y, long width, long height );
62
63 virtual bool CanDrawBitmap() const;
64 virtual void DrawIcon( const wxIcon &icon, long x, long y );
65 virtual void DrawBitmap( const wxBitmap &bitmap, long x, long y, bool useMask=FALSE );
66 virtual bool Blit( long xdest, long ydest, long width, long height,
67 wxDC *source, long xsrc, long ysrc, int logical_func = wxCOPY, bool useMask=FALSE );
68
69 virtual void DrawText( const wxString &text, long x, long y, bool use16 = FALSE );
70 virtual bool CanGetTextExtent() const;
71 virtual void GetTextExtent( const wxString &string, long *width, long *height,
72 long *descent = (long *) NULL, long *externalLeading = (long *) NULL,
73 wxFont *theFont = (wxFont *) NULL, bool use16 = FALSE );
74 virtual long GetCharWidth();
75 virtual long GetCharHeight();
76
77 virtual void Clear();
78
79 virtual void SetFont( const wxFont &font );
80 virtual void SetPen( const wxPen &pen );
81 virtual void SetBrush( const wxBrush &brush );
82 virtual void SetBackground( const wxBrush &brush );
83 virtual void SetLogicalFunction( int function );
84 virtual void SetTextForeground( const wxColour &col );
85 virtual void SetTextBackground( const wxColour &col );
86 virtual void SetBackgroundMode( int mode );
87 virtual void SetPalette( const wxPalette& palette );
88
89 virtual void SetClippingRegion( long x, long y, long width, long height );
90 virtual void DestroyClippingRegion();
91 virtual void SetClippingRegion( const wxRegion &region );
92
93 virtual void DrawSpline( wxList *points );
94
95 // implementation
96
97 GdkWindow *m_window;
98 GdkGC *m_penGC;
99 GdkGC *m_brushGC;
100 GdkGC *m_textGC;
101 GdkGC *m_bgGC;
102 GdkColormap *m_cmap;
103 bool m_isMemDC;
104 wxWindow *m_owner;
105
106 void SetUpDC();
107 void Destroy();
108 GdkWindow *GetWindow();
109 };
110
111 //-----------------------------------------------------------------------------
112 // wxPaintDC
113 //-----------------------------------------------------------------------------
114
115 class wxPaintDC : public wxWindowDC
116 {
117 DECLARE_DYNAMIC_CLASS(wxPaintDC)
118
119 public:
120 wxPaintDC();
121 wxPaintDC( wxWindow *win );
122 };
123
124 //-----------------------------------------------------------------------------
125 // wxClientDC
126 //-----------------------------------------------------------------------------
127
128 class wxClientDC : public wxWindowDC
129 {
130 DECLARE_DYNAMIC_CLASS(wxClientDC)
131
132 public:
133 wxClientDC();
134 wxClientDC( wxWindow *win );
135 };
136
137
138 #endif // __GTKDCCLIENTH__