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