]>
Commit | Line | Data |
---|---|---|
c801d85f | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/gtk/dcclient.h |
c801d85f KB |
3 | // Purpose: |
4 | // Author: Robert Roebling | |
dbf858b5 | 5 | // Copyright: (c) 1998 Robert Roebling |
65571936 | 6 | // Licence: wxWindows licence |
c801d85f KB |
7 | ///////////////////////////////////////////////////////////////////////////// |
8 | ||
512cfcc3 PC |
9 | #ifndef _WX_GTKDCCLIENT_H_ |
10 | #define _WX_GTKDCCLIENT_H_ | |
c801d85f | 11 | |
888dde65 | 12 | #include "wx/gtk/dc.h" |
c801d85f KB |
13 | |
14 | //----------------------------------------------------------------------------- | |
888dde65 | 15 | // wxWindowDCImpl |
c801d85f KB |
16 | //----------------------------------------------------------------------------- |
17 | ||
888dde65 | 18 | class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxGTKDCImpl |
c801d85f | 19 | { |
ec758a20 | 20 | public: |
888dde65 RR |
21 | wxWindowDCImpl( wxDC *owner ); |
22 | wxWindowDCImpl( wxDC *owner, wxWindow *win ); | |
ab171e95 | 23 | |
888dde65 | 24 | virtual ~wxWindowDCImpl(); |
b0e0d661 | 25 | |
b1263dcf WS |
26 | virtual bool CanDrawBitmap() const { return true; } |
27 | virtual bool CanGetTextExtent() const { return true; } | |
b0e0d661 | 28 | |
376aa62a | 29 | virtual void DoGetSize(int *width, int *height) const; |
03647350 | 30 | virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col, |
89efaf2b | 31 | wxFloodFillStyle style=wxFLOOD_SURFACE ); |
72cdf4c9 VZ |
32 | virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const; |
33 | ||
34 | virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ); | |
35 | virtual void DoCrossHair( wxCoord x, wxCoord y ); | |
36 | virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, | |
37 | wxCoord xc, wxCoord yc ); | |
38 | virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, | |
b0e0d661 | 39 | double sa, double ea ); |
72cdf4c9 | 40 | virtual void DoDrawPoint( wxCoord x, wxCoord y ); |
b0e0d661 | 41 | |
4787c92d | 42 | virtual void DoDrawLines(int n, const wxPoint points[], |
72cdf4c9 | 43 | wxCoord xoffset, wxCoord yoffset); |
4787c92d | 44 | virtual void DoDrawPolygon(int n, const wxPoint points[], |
72cdf4c9 | 45 | wxCoord xoffset, wxCoord yoffset, |
89efaf2b | 46 | wxPolygonFillMode fillStyle = wxODDEVEN_RULE); |
b0e0d661 | 47 | |
72cdf4c9 VZ |
48 | virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); |
49 | virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 ); | |
50 | virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); | |
b0e0d661 | 51 | |
72cdf4c9 VZ |
52 | virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ); |
53 | virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y, | |
b1263dcf | 54 | bool useMask = false ); |
b0e0d661 | 55 | |
03647350 | 56 | virtual bool DoBlit( wxCoord xdest, wxCoord ydest, |
89efaf2b | 57 | wxCoord width, wxCoord height, |
72cdf4c9 | 58 | wxDC *source, wxCoord xsrc, wxCoord ysrc, |
03647350 VZ |
59 | wxRasterOperationMode logical_func = wxCOPY, |
60 | bool useMask = false, | |
89efaf2b | 61 | wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 ); |
b0e0d661 | 62 | |
72cdf4c9 | 63 | virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y ); |
95724b1a VZ |
64 | virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, |
65 | double angle); | |
72cdf4c9 VZ |
66 | virtual void DoGetTextExtent( const wxString &string, |
67 | wxCoord *width, wxCoord *height, | |
d3b9f782 VZ |
68 | wxCoord *descent = NULL, |
69 | wxCoord *externalLeading = NULL, | |
70 | const wxFont *theFont = NULL) const; | |
1f91072f | 71 | virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const; |
6f02a879 | 72 | virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ); |
fdaad94e | 73 | virtual void DoSetDeviceClippingRegion( const wxRegion ®ion ); |
376aa62a | 74 | |
72cdf4c9 VZ |
75 | virtual wxCoord GetCharWidth() const; |
76 | virtual wxCoord GetCharHeight() const; | |
b0e0d661 VZ |
77 | |
78 | virtual void Clear(); | |
79 | ||
80 | virtual void SetFont( const wxFont &font ); | |
81 | virtual void SetPen( const wxPen &pen ); | |
82 | virtual void SetBrush( const wxBrush &brush ); | |
83 | virtual void SetBackground( const wxBrush &brush ); | |
89efaf2b | 84 | virtual void SetLogicalFunction( wxRasterOperationMode function ); |
b0e0d661 VZ |
85 | virtual void SetTextForeground( const wxColour &col ); |
86 | virtual void SetTextBackground( const wxColour &col ); | |
87 | virtual void SetBackgroundMode( int mode ); | |
88 | virtual void SetPalette( const wxPalette& palette ); | |
89 | ||
b0e0d661 | 90 | virtual void DestroyClippingRegion(); |
b0e0d661 | 91 | |
b0e0d661 VZ |
92 | // Resolution in pixels per logical inch |
93 | virtual wxSize GetPPI() const; | |
94 | virtual int GetDepth() const; | |
95 | ||
847dfdb4 RR |
96 | // overrriden here for RTL |
97 | virtual void SetDeviceOrigin( wxCoord x, wxCoord y ); | |
98 | virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp ); | |
99 | ||
f6f1f4ad | 100 | // protected: |
b0e0d661 VZ |
101 | // implementation |
102 | // -------------- | |
103 | ||
888dde65 | 104 | GdkWindow *m_gdkwindow; |
b0e0d661 VZ |
105 | GdkGC *m_penGC; |
106 | GdkGC *m_brushGC; | |
107 | GdkGC *m_textGC; | |
108 | GdkGC *m_bgGC; | |
109 | GdkColormap *m_cmap; | |
e1208c31 | 110 | bool m_isScreenDC; |
3d2d8da1 RR |
111 | wxRegion m_currentClippingRegion; |
112 | wxRegion m_paintClippingRegion; | |
b1263dcf | 113 | |
2b5f62a0 | 114 | // PangoContext stuff for GTK 2.0 |
8943b403 | 115 | PangoContext *m_context; |
138618ac | 116 | PangoLayout *m_layout; |
8943b403 | 117 | PangoFontDescription *m_fontdesc; |
b0e0d661 | 118 | |
ab171e95 | 119 | void SetUpDC( bool ismem = false ); |
b0e0d661 | 120 | void Destroy(); |
98d8a7ec | 121 | |
b1263dcf | 122 | virtual void ComputeScaleAndOrigin(); |
238d735d | 123 | |
888dde65 | 124 | virtual GdkWindow *GetGDKWindow() const { return m_gdkwindow; } |
cd9da200 | 125 | |
ea3a345f PC |
126 | private: |
127 | void DrawingSetup(GdkGC*& gc, bool& originChanged); | |
02cecc4d | 128 | GdkPixmap* MonoToColor(GdkPixmap* monoPixmap, int x, int y, int w, int h) const; |
98d8a7ec | 129 | |
888dde65 | 130 | DECLARE_ABSTRACT_CLASS(wxWindowDCImpl) |
ec758a20 RR |
131 | }; |
132 | ||
133 | //----------------------------------------------------------------------------- | |
888dde65 | 134 | // wxClientDCImpl |
ec758a20 RR |
135 | //----------------------------------------------------------------------------- |
136 | ||
888dde65 | 137 | class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl |
ec758a20 | 138 | { |
ec758a20 | 139 | public: |
888dde65 RR |
140 | wxClientDCImpl( wxDC *owner ); |
141 | wxClientDCImpl( wxDC *owner, wxWindow *win ); | |
cd9da200 | 142 | |
7b30ac82 VZ |
143 | virtual void DoGetSize(int *width, int *height) const; |
144 | ||
888dde65 | 145 | DECLARE_ABSTRACT_CLASS(wxClientDCImpl) |
c801d85f KB |
146 | }; |
147 | ||
ec758a20 | 148 | //----------------------------------------------------------------------------- |
888dde65 | 149 | // wxPaintDCImpl |
ec758a20 RR |
150 | //----------------------------------------------------------------------------- |
151 | ||
888dde65 | 152 | class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl |
ec758a20 | 153 | { |
ec758a20 | 154 | public: |
888dde65 RR |
155 | wxPaintDCImpl( wxDC *owner ); |
156 | wxPaintDCImpl( wxDC *owner, wxWindow *win ); | |
cd9da200 | 157 | |
888dde65 | 158 | DECLARE_ABSTRACT_CLASS(wxPaintDCImpl) |
ec758a20 RR |
159 | }; |
160 | ||
512cfcc3 | 161 | #endif // _WX_GTKDCCLIENT_H_ |