1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-20 00:14:35 +00:00
|
|
|
// Name: wx/gtk/dcclient.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-26 10:56:58 +00:00
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2007-12-06 16:22:00 +00:00
|
|
|
#ifndef _WX_GTKDCCLIENT_H_
|
|
|
|
#define _WX_GTKDCCLIENT_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
#include "wx/gtk/dc.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2007-11-30 13:48:22 +00:00
|
|
|
// wxWindowDCImpl
|
1998-05-20 14:01:55 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxGTKDCImpl
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1998-12-01 12:55:09 +00:00
|
|
|
public:
|
2007-11-30 13:48:22 +00:00
|
|
|
wxWindowDCImpl( wxDC *owner );
|
|
|
|
wxWindowDCImpl( wxDC *owner, wxWindow *win );
|
2007-09-23 11:27:41 +00:00
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
virtual ~wxWindowDCImpl();
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool CanDrawBitmap() const wxOVERRIDE { return true; }
|
|
|
|
virtual bool CanGetTextExtent() const wxOVERRIDE { return true; }
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
|
2009-08-21 10:41:26 +00:00
|
|
|
virtual bool DoFloodFill( wxCoord x, wxCoord y, const wxColour& col,
|
2014-03-30 00:02:23 +00:00
|
|
|
wxFloodFillStyle style=wxFLOOD_SURFACE ) wxOVERRIDE;
|
|
|
|
virtual bool DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const wxOVERRIDE;
|
1999-10-18 15:14:52 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 ) wxOVERRIDE;
|
|
|
|
virtual void DoCrossHair( wxCoord x, wxCoord y ) wxOVERRIDE;
|
1999-10-18 15:14:52 +00:00
|
|
|
virtual void DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
|
2014-03-30 00:02:23 +00:00
|
|
|
wxCoord xc, wxCoord yc ) wxOVERRIDE;
|
1999-10-18 15:14:52 +00:00
|
|
|
virtual void DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height,
|
2014-03-30 00:02:23 +00:00
|
|
|
double sa, double ea ) wxOVERRIDE;
|
|
|
|
virtual void DoDrawPoint( wxCoord x, wxCoord y ) wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2013-01-18 17:27:51 +00:00
|
|
|
virtual void DoDrawLines(int n, const wxPoint points[],
|
2014-03-30 00:02:23 +00:00
|
|
|
wxCoord xoffset, wxCoord yoffset) wxOVERRIDE;
|
2013-01-18 17:27:51 +00:00
|
|
|
virtual void DoDrawPolygon(int n, const wxPoint points[],
|
1999-10-18 15:14:52 +00:00
|
|
|
wxCoord xoffset, wxCoord yoffset,
|
2014-03-30 00:02:23 +00:00
|
|
|
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) wxOVERRIDE;
|
|
|
|
virtual void DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius = 20.0 ) wxOVERRIDE;
|
|
|
|
virtual void DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y ) wxOVERRIDE;
|
1999-10-18 15:14:52 +00:00
|
|
|
virtual void DoDrawBitmap( const wxBitmap &bitmap, wxCoord x, wxCoord y,
|
2014-03-30 00:02:23 +00:00
|
|
|
bool useMask = false ) wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2009-08-21 10:41:26 +00:00
|
|
|
virtual bool DoBlit( wxCoord xdest, wxCoord ydest,
|
2009-01-08 14:21:53 +00:00
|
|
|
wxCoord width, wxCoord height,
|
1999-10-18 15:14:52 +00:00
|
|
|
wxDC *source, wxCoord xsrc, wxCoord ysrc,
|
2009-08-21 10:41:26 +00:00
|
|
|
wxRasterOperationMode logical_func = wxCOPY,
|
|
|
|
bool useMask = false,
|
2014-03-30 00:02:23 +00:00
|
|
|
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1 ) wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoDrawText( const wxString &text, wxCoord x, wxCoord y ) wxOVERRIDE;
|
1999-12-06 09:35:27 +00:00
|
|
|
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
|
2014-03-30 00:02:23 +00:00
|
|
|
double angle) wxOVERRIDE;
|
1999-10-18 15:14:52 +00:00
|
|
|
virtual void DoGetTextExtent( const wxString &string,
|
|
|
|
wxCoord *width, wxCoord *height,
|
2009-01-19 13:55:27 +00:00
|
|
|
wxCoord *descent = NULL,
|
|
|
|
wxCoord *externalLeading = NULL,
|
2014-03-30 00:02:23 +00:00
|
|
|
const wxFont *theFont = NULL) const wxOVERRIDE;
|
|
|
|
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const wxOVERRIDE;
|
|
|
|
virtual void DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height ) wxOVERRIDE;
|
|
|
|
virtual void DoSetDeviceClippingRegion( const wxRegion ®ion ) wxOVERRIDE;
|
2016-09-01 18:58:45 +00:00
|
|
|
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const wxOVERRIDE;
|
2000-10-30 16:43:37 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxCoord GetCharWidth() const wxOVERRIDE;
|
|
|
|
virtual wxCoord GetCharHeight() const wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void Clear() wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetFont( const wxFont &font ) wxOVERRIDE;
|
|
|
|
virtual void SetPen( const wxPen &pen ) wxOVERRIDE;
|
|
|
|
virtual void SetBrush( const wxBrush &brush ) wxOVERRIDE;
|
|
|
|
virtual void SetBackground( const wxBrush &brush ) wxOVERRIDE;
|
|
|
|
virtual void SetLogicalFunction( wxRasterOperationMode function ) wxOVERRIDE;
|
|
|
|
virtual void SetTextForeground( const wxColour &col ) wxOVERRIDE;
|
|
|
|
virtual void SetTextBackground( const wxColour &col ) wxOVERRIDE;
|
|
|
|
virtual void SetBackgroundMode( int mode ) wxOVERRIDE;
|
|
|
|
virtual void SetPalette( const wxPalette& palette ) wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DestroyClippingRegion() wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
|
|
|
// Resolution in pixels per logical inch
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxSize GetPPI() const wxOVERRIDE;
|
|
|
|
virtual int GetDepth() const wxOVERRIDE;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2006-09-11 10:32:43 +00:00
|
|
|
// overrriden here for RTL
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void SetDeviceOrigin( wxCoord x, wxCoord y ) wxOVERRIDE;
|
|
|
|
virtual void SetAxisOrientation( bool xLeftRight, bool yBottomUp ) wxOVERRIDE;
|
2006-09-11 10:32:43 +00:00
|
|
|
|
2006-09-08 09:45:10 +00:00
|
|
|
// protected:
|
1999-05-13 23:02:35 +00:00
|
|
|
// implementation
|
|
|
|
// --------------
|
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
GdkWindow *m_gdkwindow;
|
1999-05-13 23:02:35 +00:00
|
|
|
GdkGC *m_penGC;
|
|
|
|
GdkGC *m_brushGC;
|
|
|
|
GdkGC *m_textGC;
|
|
|
|
GdkGC *m_bgGC;
|
|
|
|
GdkColormap *m_cmap;
|
2000-03-04 16:23:26 +00:00
|
|
|
bool m_isScreenDC;
|
2000-02-21 14:16:32 +00:00
|
|
|
wxRegion m_currentClippingRegion;
|
|
|
|
wxRegion m_paintClippingRegion;
|
2016-09-01 18:58:45 +00:00
|
|
|
bool m_isClipBoxValid;
|
2004-12-16 21:24:45 +00:00
|
|
|
|
2002-12-04 14:11:26 +00:00
|
|
|
// PangoContext stuff for GTK 2.0
|
2000-07-19 10:44:14 +00:00
|
|
|
PangoContext *m_context;
|
2003-01-26 12:39:51 +00:00
|
|
|
PangoLayout *m_layout;
|
2000-07-19 10:44:14 +00:00
|
|
|
PangoFontDescription *m_fontdesc;
|
1999-05-13 23:02:35 +00:00
|
|
|
|
2007-09-23 11:27:41 +00:00
|
|
|
void SetUpDC( bool ismem = false );
|
1999-05-13 23:02:35 +00:00
|
|
|
void Destroy();
|
2008-08-27 00:52:13 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void ComputeScaleAndOrigin() wxOVERRIDE;
|
1999-05-26 20:40:04 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual GdkWindow *GetGDKWindow() const wxOVERRIDE { return m_gdkwindow; }
|
2000-02-17 12:53:36 +00:00
|
|
|
|
2016-09-01 18:58:45 +00:00
|
|
|
// Update the internal clip box variables
|
|
|
|
void UpdateClipBox();
|
|
|
|
|
2007-12-17 07:31:35 +00:00
|
|
|
private:
|
|
|
|
void DrawingSetup(GdkGC*& gc, bool& originChanged);
|
2009-01-04 02:40:11 +00:00
|
|
|
GdkPixmap* MonoToColor(GdkPixmap* monoPixmap, int x, int y, int w, int h) const;
|
2008-08-27 00:52:13 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_ABSTRACT_CLASS(wxWindowDCImpl);
|
1998-12-01 12:55:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2007-11-30 13:48:22 +00:00
|
|
|
// wxClientDCImpl
|
1998-12-01 12:55:09 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
|
1998-12-01 12:55:09 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-11-30 13:48:22 +00:00
|
|
|
wxClientDCImpl( wxDC *owner );
|
|
|
|
wxClientDCImpl( wxDC *owner, wxWindow *win );
|
2000-02-17 12:53:36 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE;
|
2000-10-31 15:13:54 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_ABSTRACT_CLASS(wxClientDCImpl);
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
1998-12-01 12:55:09 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2007-11-30 13:48:22 +00:00
|
|
|
// wxPaintDCImpl
|
1998-12-01 12:55:09 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
|
1998-12-01 12:55:09 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-11-30 13:48:22 +00:00
|
|
|
wxPaintDCImpl( wxDC *owner );
|
|
|
|
wxPaintDCImpl( wxDC *owner, wxWindow *win );
|
2000-02-17 12:53:36 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_ABSTRACT_CLASS(wxPaintDCImpl);
|
1998-12-01 12:55:09 +00:00
|
|
|
};
|
|
|
|
|
2007-12-06 16:22:00 +00:00
|
|
|
#endif // _WX_GTKDCCLIENT_H_
|