git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72073
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#endif // __WXMSW__
protected:
#endif // __WXMSW__
protected:
+ // unused int parameter distinguishes this version, which does not create a
+ // wxGraphicsContext, in the expectation that the derived class will do it
+ wxGCDCImpl(wxDC* owner, int);
+
// scaling variables
bool m_logicalFunctionSupported;
wxGraphicsMatrix m_matrixOriginal;
// scaling variables
bool m_logicalFunctionSupported;
wxGraphicsMatrix m_matrixOriginal;
typedef wxGCDCImpl base_type;
public:
wxGTKCairoDCImpl(wxDC* owner);
typedef wxGCDCImpl base_type;
public:
wxGTKCairoDCImpl(wxDC* owner);
+ wxGTKCairoDCImpl(wxDC* owner, int);
wxGTKCairoDCImpl(wxDC* owner, wxWindow* window);
wxGTKCairoDCImpl(wxDC* owner, wxWindow* window);
virtual void DoDrawBitmap(const wxBitmap& bitmap, int x, int y, bool useMask);
virtual void DoDrawIcon(const wxIcon& icon, int x, int y);
#if wxUSE_IMAGE
virtual void DoDrawBitmap(const wxBitmap& bitmap, int x, int y, bool useMask);
virtual void DoDrawIcon(const wxIcon& icon, int x, int y);
#if wxUSE_IMAGE
+wxGCDCImpl::wxGCDCImpl(wxDC* owner, int)
+ : wxDCImpl(owner)
+{
+ // derived class will set a context
+ Init(NULL);
+}
+
void wxGCDCImpl::Init(wxGraphicsContext* ctx)
{
m_ok = false;
void wxGCDCImpl::Init(wxGraphicsContext* ctx)
{
m_ok = false;
+wxGTKCairoDCImpl::wxGTKCairoDCImpl(wxDC* owner, int)
+ : base_type(owner, 0)
+{
+ m_width = 0;
+ m_height = 0;
+}
+
wxGTKCairoDCImpl::wxGTKCairoDCImpl(wxDC* owner, wxWindow* window)
wxGTKCairoDCImpl::wxGTKCairoDCImpl(wxDC* owner, wxWindow* window)
{
m_window = window;
m_font = window->GetFont();
{
m_window = window;
m_font = window->GetFont();
if (x || y)
SetDeviceLocalOrigin(x, y);
}
if (x || y)
SetDeviceLocalOrigin(x, y);
}
+ else
+ SetGraphicsContext(wxGraphicsContext::Create());
}
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
- {
- // create something that can be used for measuring, but not drawing
- cairo_t* cr = gdk_cairo_create(gdk_get_default_root_window());
- cairo_rectangle(cr, 0, 0, 0, 0);
- cairo_clip(cr);
- SetGraphicsContext(wxGraphicsContext::CreateFromNative(cr));
- }
+ SetGraphicsContext(wxGraphicsContext::Create());
}
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
wxScreenDCImpl::wxScreenDCImpl(wxScreenDC* owner)
//-----------------------------------------------------------------------------
wxScreenDCImpl::wxScreenDCImpl(wxScreenDC* owner)
{
GdkWindow* window = gdk_get_default_root_window();
m_width = gdk_window_get_width(window);
{
GdkWindow* window = gdk_get_default_root_window();
m_width = gdk_window_get_width(window);
}
wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC* owner, wxBitmap& bitmap)
}
wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC* owner, wxBitmap& bitmap)
, m_bitmap(bitmap)
{
Setup();
, m_bitmap(bitmap)
{
Setup();
//-----------------------------------------------------------------------------
wxGTKCairoDC::wxGTKCairoDC(cairo_t* cr)
//-----------------------------------------------------------------------------
wxGTKCairoDC::wxGTKCairoDC(cairo_t* cr)
- : base_type(new wxGTKCairoDCImpl(this))
+ : base_type(new wxGTKCairoDCImpl(this, 0))
{
cairo_reference(cr);
SetGraphicsContext(wxGraphicsContext::CreateFromNative(cr));
{
cairo_reference(cr);
SetGraphicsContext(wxGraphicsContext::CreateFromNative(cr));