1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-11-30 07:58:37 +00:00
|
|
|
// Name: wx/gtk/dc.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-01 18:37:08 +00:00
|
|
|
#ifndef _WX_GTKDC_H_
|
|
|
|
#define _WX_GTKDC_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2012-06-30 20:39:06 +00:00
|
|
|
#ifdef __WXGTK3__
|
|
|
|
|
|
|
|
#include "wx/dcgraph.h"
|
|
|
|
|
|
|
|
class wxGTKCairoDCImpl: public wxGCDCImpl
|
|
|
|
{
|
|
|
|
typedef wxGCDCImpl base_type;
|
|
|
|
public:
|
|
|
|
wxGTKCairoDCImpl(wxDC* owner);
|
2012-07-13 16:58:37 +00:00
|
|
|
wxGTKCairoDCImpl(wxDC* owner, int);
|
2016-02-22 17:52:26 +00:00
|
|
|
wxGTKCairoDCImpl(wxDC* owner, double scaleFactor);
|
2012-06-30 20:39:06 +00:00
|
|
|
wxGTKCairoDCImpl(wxDC* owner, wxWindow* window);
|
2012-07-13 16:58:37 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoDrawBitmap(const wxBitmap& bitmap, int x, int y, bool useMask) wxOVERRIDE;
|
|
|
|
virtual void DoDrawIcon(const wxIcon& icon, int x, int y) wxOVERRIDE;
|
2012-06-30 20:39:06 +00:00
|
|
|
#if wxUSE_IMAGE
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool DoFloodFill(int x, int y, const wxColour& col, wxFloodFillStyle style) wxOVERRIDE;
|
2012-06-30 20:39:06 +00:00
|
|
|
#endif
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const wxOVERRIDE;
|
|
|
|
virtual bool DoGetPixel(int x, int y, wxColour* col) const wxOVERRIDE;
|
|
|
|
virtual void DoGetSize(int* width, int* height) const wxOVERRIDE;
|
|
|
|
virtual bool DoStretchBlit(int xdest, int ydest, int dstWidth, int dstHeight, wxDC* source, int xsrc, int ysrc, int srcWidth, int srcHeight, wxRasterOperationMode rop, bool useMask, int xsrcMask, int ysrcMask) wxOVERRIDE;
|
|
|
|
virtual void* GetCairoContext() const wxOVERRIDE;
|
2012-06-30 20:39:06 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
int m_width, m_height;
|
|
|
|
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxGTKCairoDCImpl);
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxWindowDCImpl: public wxGTKCairoDCImpl
|
|
|
|
{
|
|
|
|
typedef wxGTKCairoDCImpl base_type;
|
|
|
|
public:
|
|
|
|
wxWindowDCImpl(wxWindowDC* owner, wxWindow* window);
|
|
|
|
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxWindowDCImpl);
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxClientDCImpl: public wxGTKCairoDCImpl
|
|
|
|
{
|
|
|
|
typedef wxGTKCairoDCImpl base_type;
|
|
|
|
public:
|
|
|
|
wxClientDCImpl(wxClientDC* owner, wxWindow* window);
|
|
|
|
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxClientDCImpl);
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxPaintDCImpl: public wxGTKCairoDCImpl
|
|
|
|
{
|
|
|
|
typedef wxGTKCairoDCImpl base_type;
|
|
|
|
public:
|
|
|
|
wxPaintDCImpl(wxPaintDC* owner, wxWindow* window);
|
|
|
|
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxScreenDCImpl: public wxGTKCairoDCImpl
|
|
|
|
{
|
|
|
|
typedef wxGTKCairoDCImpl base_type;
|
|
|
|
public:
|
|
|
|
wxScreenDCImpl(wxScreenDC* owner);
|
|
|
|
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxScreenDCImpl);
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMemoryDCImpl: public wxGTKCairoDCImpl
|
|
|
|
{
|
|
|
|
typedef wxGTKCairoDCImpl base_type;
|
|
|
|
public:
|
|
|
|
wxMemoryDCImpl(wxMemoryDC* owner);
|
|
|
|
wxMemoryDCImpl(wxMemoryDC* owner, wxBitmap& bitmap);
|
|
|
|
wxMemoryDCImpl(wxMemoryDC* owner, wxDC* dc);
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxBitmap DoGetAsBitmap(const wxRect* subrect) const wxOVERRIDE;
|
|
|
|
virtual void DoSelect(const wxBitmap& bitmap) wxOVERRIDE;
|
|
|
|
virtual const wxBitmap& GetSelectedBitmap() const wxOVERRIDE;
|
|
|
|
virtual wxBitmap& GetSelectedBitmap() wxOVERRIDE;
|
2012-06-30 20:39:06 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void Setup();
|
|
|
|
wxBitmap m_bitmap;
|
|
|
|
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxMemoryDCImpl);
|
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLIMPEXP_CORE wxGTKCairoDC: public wxDC
|
|
|
|
{
|
|
|
|
typedef wxDC base_type;
|
|
|
|
public:
|
2016-02-22 17:52:26 +00:00
|
|
|
wxGTKCairoDC(cairo_t* cr, wxWindow* window);
|
2012-06-30 20:39:06 +00:00
|
|
|
|
|
|
|
wxDECLARE_NO_COPY_CLASS(wxGTKCairoDC);
|
|
|
|
};
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2007-12-01 18:37:08 +00:00
|
|
|
#include "wx/dc.h"
|
2007-05-06 20:14:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
2007-05-08 23:47:43 +00:00
|
|
|
// wxDC
|
2007-05-03 22:29:01 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxGTKDCImpl : public wxDCImpl
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1998-12-03 15:14:45 +00:00
|
|
|
public:
|
2007-11-30 13:48:22 +00:00
|
|
|
wxGTKDCImpl( wxDC *owner );
|
|
|
|
virtual ~wxGTKDCImpl();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2005-11-30 07:58:37 +00:00
|
|
|
#if wxUSE_PALETTE
|
2011-12-29 14:42:13 +00:00
|
|
|
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); }
|
2005-11-30 07:58:37 +00:00
|
|
|
#endif // wxUSE_PALETTE
|
1998-12-09 17:30:17 +00:00
|
|
|
|
1999-05-13 21:21:04 +00:00
|
|
|
// Resolution in pixels per logical inch
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual wxSize GetPPI() const wxOVERRIDE;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual bool StartDoc( const wxString& WXUNUSED(message) ) wxOVERRIDE { return true; }
|
|
|
|
virtual void EndDoc() wxOVERRIDE { }
|
|
|
|
virtual void StartPage() wxOVERRIDE { }
|
|
|
|
virtual void EndPage() wxOVERRIDE { }
|
1998-12-09 17:30:17 +00:00
|
|
|
|
2006-10-09 16:39:34 +00:00
|
|
|
virtual GdkWindow* GetGDKWindow() const { return NULL; }
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void* GetHandle() const wxOVERRIDE { return GetGDKWindow(); }
|
2012-07-28 19:31:18 +00:00
|
|
|
|
1999-05-13 21:21:04 +00:00
|
|
|
// base class pure virtuals implemented here
|
2014-03-30 00:02:23 +00:00
|
|
|
virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
|
|
|
|
virtual void DoGetSizeMM(int* width, int* height) const wxOVERRIDE;
|
1998-12-09 17:30:17 +00:00
|
|
|
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_ABSTRACT_CLASS(wxGTKDCImpl);
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
2007-11-30 13:48:22 +00:00
|
|
|
// this must be defined when wxDC::Blit() honours the DC origin and needed to
|
2002-02-10 16:09:49 +00:00
|
|
|
// allow wxUniv code in univ/winuniv.cpp to work with versions of wxGTK
|
|
|
|
// 2.3.[23]
|
|
|
|
#ifndef wxHAS_WORKING_GTK_DC_BLIT
|
|
|
|
#define wxHAS_WORKING_GTK_DC_BLIT
|
|
|
|
#endif
|
|
|
|
|
2012-06-30 20:39:06 +00:00
|
|
|
#endif
|
2007-12-01 18:37:08 +00:00
|
|
|
#endif // _WX_GTKDC_H_
|