git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50728
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
12 files changed:
#ifndef __GTKDCH__
#define __GTKDCH__
#ifndef __GTKDCH__
#define __GTKDCH__
-//-----------------------------------------------------------------------------
-// classes
-//-----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_FWD_CORE wxDC;
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// wxDC
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxDC : public wxDCBase
+class WXDLLIMPEXP_CORE wxGTKDCImpl : public wxDCImpl
- wxDC();
- virtual ~wxDC() { }
+ wxGTKDCImpl(wxDC *owner);
+ virtual ~wxGTKDCImpl() { }
#if wxUSE_PALETTE
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
#if wxUSE_PALETTE
void SetColourMap( const wxPalette& palette ) { SetPalette(palette); };
#ifndef __GTKDCCLIENTH__
#define __GTKDCCLIENTH__
#ifndef __GTKDCCLIENTH__
#define __GTKDCCLIENTH__
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
#include "wx/window.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_FWD_CORE wxWindowDC;
-class WXDLLIMPEXP_FWD_CORE wxPaintDC;
-class WXDLLIMPEXP_FWD_CORE wxClientDC;
+class WXDLLIMPEXP_FWD_CORE wxWindowDCImpl;
+class WXDLLIMPEXP_FWD_CORE wxPaintDCImpl;
+class WXDLLIMPEXP_FWD_CORE wxClientDCImpl;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
+class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxGTKDCImpl
- wxWindowDC();
- wxWindowDC( wxWindow *win );
+ wxWindowDCImpl(wxDC *owner);
+ wxWindowDCImpl(wxDC *owner, wxWindow *win);
+ virtual ~wxWindowDCImpl();
virtual bool CanDrawBitmap() const { return true; }
virtual bool CanGetTextExtent() const { return true; }
virtual bool CanDrawBitmap() const { return true; }
virtual bool CanGetTextExtent() const { return true; }
GdkWindow *GetWindow() { return m_window; }
private:
GdkWindow *GetWindow() { return m_window; }
private:
- DECLARE_DYNAMIC_CLASS(wxWindowDC)
+ DECLARE_DYNAMIC_CLASS(wxWindowDCImpl)
};
//-----------------------------------------------------------------------------
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxClientDC : public wxWindowDC
+class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
- wxClientDC() { }
- wxClientDC( wxWindow *win );
+ wxClientDCImpl(wxDC *owner) : wxWindowDCImpl(owner) { }
+ wxClientDCImpl(wxDC *owner, wxWindow *win);
protected:
virtual void DoGetSize(int *width, int *height) const;
private:
protected:
virtual void DoGetSize(int *width, int *height) const;
private:
- DECLARE_DYNAMIC_CLASS(wxClientDC)
+ DECLARE_DYNAMIC_CLASS(wxClientDCImpl)
};
//-----------------------------------------------------------------------------
};
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDC
+class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
- wxPaintDC() { }
- wxPaintDC( wxWindow *win );
+ wxPaintDCImpl(wxDC *owner) : wxClientDCImpl(owner) { }
+ wxPaintDCImpl(wxDC *owner, wxWindow *win);
- DECLARE_DYNAMIC_CLASS(wxPaintDC)
+ DECLARE_DYNAMIC_CLASS(wxPaintDCImpl)
};
#endif // __GTKDCCLIENTH__
};
#endif // __GTKDCCLIENTH__
#ifndef __GTKDCMEMORYH__
#define __GTKDCMEMORYH__
#ifndef __GTKDCMEMORYH__
#define __GTKDCMEMORYH__
-#include "wx/defs.h"
-#include "wx/dcclient.h"
+#include "wx/gtk1/dcclient.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
+class WXDLLIMPEXP_FWD_CORE wxMemoryDCImpl;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_CORE wxMemoryDC : public wxWindowDC, public wxMemoryDCBase
+class WXDLLIMPEXP_CORE wxMemoryDCImpl : public wxWindowDCImpl
- wxMemoryDC() { Init(); }
- wxMemoryDC(wxBitmap& bitmap) { Init(); SelectObject(bitmap); }
- wxMemoryDC( wxDC *dc ); // Create compatible DC
- virtual ~wxMemoryDC();
- void DoGetSize( int *width, int *height ) const;
+ wxMemoryDCImpl(wxMemoryDC *owner)
+ : wxWindowDCImpl(owner)
+ {
+ Init();
+ }
+
+ wxMemoryDCImpl(wxMemoryDC *owner, wxBitmap& bitmap)
+ : wxWindowDCImpl(owner)
+ {
+ Init();
+
+ DoSelect(bitmap);
+ }
+
+ wxMemoryDCImpl(wxMemoryDC *owner, wxDC *dc);
+ virtual ~wxMemoryDCImpl();
+
+ virtual void DoSelect(const wxBitmap& bitmap);
+ virtual void DoGetSize( int *width, int *height ) const;
// these get reimplemented for mono-bitmaps to behave
// more like their Win32 couterparts. They now interpret
// these get reimplemented for mono-bitmaps to behave
// more like their Win32 couterparts. They now interpret
// implementation
wxBitmap m_selected;
// implementation
wxBitmap m_selected;
-protected:
- virtual void DoSelect(const wxBitmap& bitmap);
-
- DECLARE_DYNAMIC_CLASS(wxMemoryDC)
+ DECLARE_DYNAMIC_CLASS(wxMemoryDCImpl)
-#endif
- // __GTKDCMEMORYH__
+#endif // __GTKDCMEMORYH__
#ifndef __GTKDCSCREENH__
#define __GTKDCSCREENH__
#ifndef __GTKDCSCREENH__
#define __GTKDCSCREENH__
-#include "wx/dcclient.h"
+#include "wx/gtk1/dcclient.h"
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-class WXDLLIMPEXP_FWD_CORE wxScreenDC;
-
-//-----------------------------------------------------------------------------
-// wxScreenDC
-//-----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_CORE wxScreenDC : public wxPaintDC
+class WXDLLIMPEXP_CORE wxScreenDCImpl : public wxPaintDCImpl
- wxScreenDC();
- virtual ~wxScreenDC();
-
- static bool StartDrawingOnTop( wxWindow *window );
- static bool StartDrawingOnTop( wxRect *rect = (wxRect *) NULL );
- static bool EndDrawingOnTop();
+ wxScreenDCImpl(wxScreenDC *owner);
+ virtual ~wxScreenDCImpl();
virtual void DoGetSize(int *width, int *height) const;
private:
virtual void DoGetSize(int *width, int *height) const;
private:
- DECLARE_DYNAMIC_CLASS(wxScreenDC)
+ DECLARE_DYNAMIC_CLASS(wxScreenDCImpl)
-#endif
-
- // __GTKDCSCREENH__
+#endif // __GTKDCSCREENH__
#include "wx/msw/dcscreen.h"
#endif
#include "wx/msw/dcscreen.h"
#endif
#include "wx/gtk/dcclient.h"
#include "wx/gtk/dcmemory.h"
#include "wx/gtk/dcscreen.h"
#include "wx/gtk/dcclient.h"
#include "wx/gtk/dcmemory.h"
#include "wx/gtk/dcscreen.h"
+#elif defined(__WXGTK__)
+ #include "wx/gtk1/dcclient.h"
+ #include "wx/gtk1/dcmemory.h"
+ #include "wx/gtk1/dcscreen.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include <gdk/gdk.h>
#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
#include <gdk/gdk.h>
#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
+IMPLEMENT_ABSTRACT_CLASS(wxGTKDCImpl, wxDCImpl)
+wxGTKDCImpl::wxGTKDCImpl(wxDC *owner)
+ : wxDCImpl(owner)
m_brush = *wxWHITE_BRUSH;
}
m_brush = *wxWHITE_BRUSH;
}
-void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
+void wxGTKDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
m_clipping = TRUE;
m_clipX1 = x;
{
m_clipping = TRUE;
m_clipX1 = x;
// get DC capabilities
// ---------------------------------------------------------------------------
// get DC capabilities
// ---------------------------------------------------------------------------
-void wxDC::DoGetSizeMM( int* width, int* height ) const
+void wxGTKDCImpl::DoGetSizeMM( int* width, int* height ) const
}
// Resolution in pixels per logical inch
}
// Resolution in pixels per logical inch
-wxSize wxDC::GetPPI() const
+wxSize wxGTKDCImpl::GetPPI() const
{
// TODO (should probably be pure virtual)
return wxSize(0, 0);
{
// TODO (should probably be pure virtual)
return wxSize(0, 0);
#define XCopyPlane XCOPYPLANE
#endif
#define XCopyPlane XCOPYPLANE
#endif
-#include "wx/dcclient.h"
-
#ifndef WX_PRECOMP
#include "wx/log.h"
#ifndef WX_PRECOMP
#include "wx/log.h"
- #include "wx/dcmemory.h"
#include "wx/math.h" // for floating-point functions
#include "wx/image.h"
#include "wx/module.h"
#include "wx/math.h" // for floating-point functions
#include "wx/image.h"
#include "wx/module.h"
#include "wx/fontutil.h"
#include "wx/gtk1/win_gtk.h"
#include "wx/fontutil.h"
#include "wx/gtk1/win_gtk.h"
+#include "wx/gtk1/dcclient.h"
+#include "wx/gtk1/dcmemory.h"
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
}
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
+IMPLEMENT_ABSTRACT_CLASS(wxWindowDCImpl, wxDC)
-wxWindowDC::wxWindowDC()
+wxWindowDCImpl::wxWindowDCImpl(wxDC *owner)
+ : wxGTKDCImpl(owner)
{
m_penGC = (GdkGC *) NULL;
m_brushGC = (GdkGC *) NULL;
{
m_penGC = (GdkGC *) NULL;
m_brushGC = (GdkGC *) NULL;
m_owner = (wxWindow *)NULL;
}
m_owner = (wxWindow *)NULL;
}
-wxWindowDC::wxWindowDC( wxWindow *window )
+wxWindowDCImpl::wxWindowDCImpl(wxDC *owner, wxWindow *window)
+ : wxGTKDCImpl(owner)
{
wxASSERT_MSG( window, wxT("DC needs a window") );
{
wxASSERT_MSG( window, wxT("DC needs a window") );
-wxWindowDC::~wxWindowDC()
+wxWindowDCImpl::~wxWindowDCImpl()
-void wxWindowDC::SetUpDC()
+void wxWindowDCImpl::SetUpDC()
m_textGC = wxGetPoolGC( m_window, wxTEXT_SCREEN );
m_bgGC = wxGetPoolGC( m_window, wxBG_SCREEN );
}
m_textGC = wxGetPoolGC( m_window, wxTEXT_SCREEN );
m_bgGC = wxGetPoolGC( m_window, wxBG_SCREEN );
}
- else
- if (m_isMemDC && (((wxMemoryDC*)this)->m_selected.GetDepth() == 1))
+ else if (m_isMemDC && (((wxMemoryDCImpl*)this)->m_selected.GetDepth() == 1))
{
m_penGC = wxGetPoolGC( m_window, wxPEN_MONO );
m_brushGC = wxGetPoolGC( m_window, wxBRUSH_MONO );
{
m_penGC = wxGetPoolGC( m_window, wxPEN_MONO );
m_brushGC = wxGetPoolGC( m_window, wxBRUSH_MONO );
-void wxWindowDC::DoGetSize( int* width, int* height ) const
+void wxWindowDCImpl::DoGetSize( int* width, int* height ) const
{
wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
{
wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
const wxColour & col, int style);
extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
const wxColour & col, int style);
-bool wxWindowDC::DoFloodFill(wxCoord x, wxCoord y,
+bool wxWindowDCImpl::DoFloodFill(wxCoord x, wxCoord y,
const wxColour& col, int style)
{
const wxColour& col, int style)
{
- return wxDoFloodFill(this, x, y, col, style);
+ return wxDoFloodFill(GetOwner(), x, y, col, style);
-bool wxWindowDC::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
+bool wxWindowDCImpl::DoGetPixel( wxCoord x1, wxCoord y1, wxColour *col ) const
{
// Generic (and therefore rather inefficient) method.
// Could be improved.
{
// Generic (and therefore rather inefficient) method.
// Could be improved.
-void wxWindowDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
+void wxWindowDCImpl::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
if (m_pen.GetStyle() != wxTRANSPARENT)
{
-void wxWindowDC::DoCrossHair( wxCoord x, wxCoord y )
+void wxWindowDCImpl::DoCrossHair( wxCoord x, wxCoord y )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
if (m_pen.GetStyle() != wxTRANSPARENT)
{
-void wxWindowDC::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
+void wxWindowDCImpl::DoDrawArc( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc )
{
wxCoord xc, wxCoord yc )
{
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
wxCoord xx1 = XLOG2DEV(x1);
wxCoord yy1 = YLOG2DEV(y1);
wxCoord xx1 = XLOG2DEV(x1);
wxCoord yy1 = YLOG2DEV(y1);
CalcBoundingBox (x2, y2);
}
CalcBoundingBox (x2, y2);
}
-void wxWindowDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double sa, double ea )
+void wxWindowDCImpl::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double sa, double ea )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
CalcBoundingBox (x + width, y + height);
}
CalcBoundingBox (x + width, y + height);
}
-void wxWindowDC::DoDrawPoint( wxCoord x, wxCoord y )
+void wxWindowDCImpl::DoDrawPoint( wxCoord x, wxCoord y )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
CalcBoundingBox (x, y);
}
CalcBoundingBox (x, y);
}
-void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
+void wxWindowDCImpl::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) return;
if (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) return;
-void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) )
+void wxWindowDCImpl::DoDrawPolygon( int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset, int WXUNUSED(fillStyle) )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
-void wxWindowDC::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
+void wxWindowDCImpl::DoDrawRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
CalcBoundingBox( x + width, y + height );
}
CalcBoundingBox( x + width, y + height );
}
-void wxWindowDC::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius )
+void wxWindowDCImpl::DoDrawRoundedRectangle( wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
// X drawing errors with small radii
if (rr == 0)
{
// X drawing errors with small radii
if (rr == 0)
{
- DrawRectangle( x, y, width, height );
+ DoDrawRectangle( x, y, width, height );
CalcBoundingBox( x + width, y + height );
}
CalcBoundingBox( x + width, y + height );
}
-void wxWindowDC::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
+void wxWindowDCImpl::DoDrawEllipse( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
wxCoord xx = XLOG2DEV(x);
wxCoord yy = YLOG2DEV(y);
CalcBoundingBox( x + width, y + height );
}
CalcBoundingBox( x + width, y + height );
}
-void wxWindowDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
+void wxWindowDCImpl::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
{
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
DoDrawBitmap( (const wxBitmap&)icon, x, y, true );
}
{
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
DoDrawBitmap( (const wxBitmap&)icon, x, y, true );
}
-void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap,
+void wxWindowDCImpl::DoDrawBitmap( const wxBitmap &bitmap,
wxCoord x, wxCoord y,
bool useMask )
{
wxCoord x, wxCoord y,
bool useMask )
{
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
wxCHECK_RET( bitmap.Ok(), wxT("invalid bitmap") );
wxCHECK_RET( bitmap.Ok(), wxT("invalid bitmap") );
gdk_bitmap_unref( new_mask );
}
gdk_bitmap_unref( new_mask );
}
-bool wxWindowDC::DoBlit( wxCoord xdest, wxCoord ydest,
- wxCoord width, wxCoord height,
- wxDC *source,
- wxCoord xsrc, wxCoord ysrc,
- int logical_func,
- bool useMask,
- wxCoord xsrcMask, wxCoord ysrcMask )
+bool wxWindowDCImpl::DoBlit( wxCoord xdest, wxCoord ydest,
+ wxCoord width, wxCoord height,
+ wxDC *source,
+ wxCoord xsrc, wxCoord ysrc,
+ int logical_func,
+ bool useMask,
+ wxCoord xsrcMask, wxCoord ysrcMask )
- wxCHECK_MSG( Ok(), false, wxT("invalid window dc") );
+ wxCHECK_MSG( IsOk(), false, wxT("invalid window dc") );
wxCHECK_MSG( source, false, wxT("invalid source dc") );
if (!m_window) return false;
// transform the source DC coords to the device ones
wxCHECK_MSG( source, false, wxT("invalid source dc") );
if (!m_window) return false;
// transform the source DC coords to the device ones
- xsrc = source->XLOG2DEV(xsrc);
- ysrc = source->YLOG2DEV(ysrc);
+ xsrc = source->LogicalToDeviceX(xsrc);
+ ysrc = source->LogicalToDeviceY(ysrc);
- wxClientDC *srcDC = (wxClientDC*)source;
- wxMemoryDC *memDC = (wxMemoryDC*)source;
+ wxClientDCImpl *srcDC = (wxClientDCImpl*)source->GetImpl();
+ wxMemoryDCImpl *memDC = (wxMemoryDCImpl*)source;
bool use_bitmap_method = false;
bool is_mono = false;
bool use_bitmap_method = false;
bool is_mono = false;
-void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
+void wxWindowDCImpl::DoDrawText( const wxString &text, wxCoord x, wxCoord y )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
// a better approach here:
// http://www.daa.com.au/pipermail/pygtk/2003-April/005052.html
// a better approach here:
// http://www.daa.com.au/pipermail/pygtk/2003-April/005052.html
-void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, double angle )
+void wxWindowDCImpl::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, double angle )
{
if ( wxIsNullDouble(angle) )
{
{
if ( wxIsNullDouble(angle) )
{
+ DoDrawText(text, x, y);
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
CalcBoundingBox(x + maxX, y + maxY);
}
CalcBoundingBox(x + maxX, y + maxY);
}
-void wxWindowDC::DoGetTextExtent(const wxString &string,
+void wxWindowDCImpl::DoGetTextExtent(const wxString &string,
wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading,
const wxFont *theFont) const
wxCoord *width, wxCoord *height,
wxCoord *descent, wxCoord *externalLeading,
const wxFont *theFont) const
*descent = wxCoord(font->descent / m_scaleY);
}
*descent = wxCoord(font->descent / m_scaleY);
}
-wxCoord wxWindowDC::GetCharWidth() const
+wxCoord wxWindowDCImpl::GetCharWidth() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
wxCHECK_MSG( font, -1, wxT("invalid font") );
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
wxCHECK_MSG( font, -1, wxT("invalid font") );
return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
}
return wxCoord(gdk_string_width( font, "H" ) / m_scaleX);
}
-wxCoord wxWindowDC::GetCharHeight() const
+wxCoord wxWindowDCImpl::GetCharHeight() const
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
wxCHECK_MSG( font, -1, wxT("invalid font") );
{
GdkFont *font = m_font.GetInternalFont( m_scaleY );
wxCHECK_MSG( font, -1, wxT("invalid font") );
return wxCoord((font->ascent + font->descent) / m_scaleY);
}
return wxCoord((font->ascent + font->descent) / m_scaleY);
}
-void wxWindowDC::Clear()
+void wxWindowDCImpl::Clear()
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
-void wxWindowDC::SetFont( const wxFont &font )
+void wxWindowDCImpl::SetFont( const wxFont &font )
-void wxWindowDC::SetPen( const wxPen &pen )
+void wxWindowDCImpl::SetPen( const wxPen &pen )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (m_pen == pen) return;
if (m_pen == pen) return;
gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() );
}
gdk_gc_set_foreground( m_penGC, m_pen.GetColour().GetColor() );
}
-void wxWindowDC::SetBrush( const wxBrush &brush )
+void wxWindowDCImpl::SetBrush( const wxBrush &brush )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (m_brush == brush) return;
if (m_brush == brush) return;
-void wxWindowDC::SetBackground( const wxBrush &brush )
+void wxWindowDCImpl::SetBackground( const wxBrush &brush )
{
/* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch brush */
{
/* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch brush */
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (m_backgroundBrush == brush) return;
if (m_backgroundBrush == brush) return;
-void wxWindowDC::SetLogicalFunction( int function )
+void wxWindowDCImpl::SetLogicalFunction( int function )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
if (m_logicalFunction == function)
return;
if (m_logicalFunction == function)
return;
gdk_gc_set_function( m_textGC, mode );
}
gdk_gc_set_function( m_textGC, mode );
}
-void wxWindowDC::SetTextForeground( const wxColour &col )
+void wxWindowDCImpl::SetTextForeground( const wxColour &col )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
// don't set m_textForegroundColour to an invalid colour as we'd crash
// later then (we use m_textForegroundColour.GetColor() without checking
// don't set m_textForegroundColour to an invalid colour as we'd crash
// later then (we use m_textForegroundColour.GetColor() without checking
-void wxWindowDC::SetTextBackground( const wxColour &col )
+void wxWindowDCImpl::SetTextBackground( const wxColour &col )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
// same as above
if ( !col.Ok() || (m_textBackgroundColour == col) )
// same as above
if ( !col.Ok() || (m_textBackgroundColour == col) )
-void wxWindowDC::SetBackgroundMode( int mode )
+void wxWindowDCImpl::SetBackgroundMode( int mode )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
-void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
+void wxWindowDCImpl::SetPalette( const wxPalette& WXUNUSED(palette) )
- wxFAIL_MSG( wxT("wxWindowDC::SetPalette not implemented") );
+ wxFAIL_MSG( wxT("wxWindowDCImpl::SetPalette not implemented") );
-void wxWindowDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
+void wxWindowDCImpl::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
wxCoord xx, yy, ww, hh;
m_currentClippingRegion.GetBox( xx, yy, ww, hh );
wxCoord xx, yy, ww, hh;
m_currentClippingRegion.GetBox( xx, yy, ww, hh );
- wxDC::DoSetClippingRegion( xx, yy, ww, hh );
+ wxGTKDCImpl::DoSetClippingRegion( xx, yy, ww, hh );
gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_bgGC, m_currentClippingRegion.GetRegion() );
}
gdk_gc_set_clip_region( m_bgGC, m_currentClippingRegion.GetRegion() );
}
-void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
+void wxWindowDCImpl::DoSetClippingRegionAsRegion( const wxRegion ®ion )
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
wxCoord xx, yy, ww, hh;
m_currentClippingRegion.GetBox( xx, yy, ww, hh );
wxCoord xx, yy, ww, hh;
m_currentClippingRegion.GetBox( xx, yy, ww, hh );
- wxDC::DoSetClippingRegion( xx, yy, ww, hh );
+ wxGTKDCImpl::DoSetClippingRegion( xx, yy, ww, hh );
gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_penGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_brushGC, m_currentClippingRegion.GetRegion() );
gdk_gc_set_clip_region( m_bgGC, m_currentClippingRegion.GetRegion() );
}
gdk_gc_set_clip_region( m_bgGC, m_currentClippingRegion.GetRegion() );
}
-void wxWindowDC::DestroyClippingRegion()
+void wxWindowDCImpl::DestroyClippingRegion()
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
+ wxCHECK_RET( IsOk(), wxT("invalid window dc") );
- wxDC::DestroyClippingRegion();
+ wxGTKDCImpl::DestroyClippingRegion();
m_currentClippingRegion.Clear();
m_currentClippingRegion.Clear();
-void wxWindowDC::Destroy()
+void wxWindowDCImpl::Destroy()
{
if (m_penGC) wxFreePoolGC( m_penGC );
m_penGC = (GdkGC*) NULL;
{
if (m_penGC) wxFreePoolGC( m_penGC );
m_penGC = (GdkGC*) NULL;
m_bgGC = (GdkGC*) NULL;
}
m_bgGC = (GdkGC*) NULL;
}
-void wxWindowDC::ComputeScaleAndOrigin()
+void wxWindowDCImpl::ComputeScaleAndOrigin()
{
const wxRealPoint origScale(m_scaleX, m_scaleY);
{
const wxRealPoint origScale(m_scaleX, m_scaleY);
- wxDC::ComputeScaleAndOrigin();
+ wxGTKDCImpl::ComputeScaleAndOrigin();
// if scale has changed call SetPen to recalulate the line width
if ( wxRealPoint(m_scaleX, m_scaleY) != origScale && m_pen.Ok() )
// if scale has changed call SetPen to recalulate the line width
if ( wxRealPoint(m_scaleX, m_scaleY) != origScale && m_pen.Ok() )
}
// Resolution in pixels per logical inch
}
// Resolution in pixels per logical inch
-wxSize wxWindowDC::GetPPI() const
+wxSize wxWindowDCImpl::GetPPI() const
{
return wxSize( (int) (m_mm_to_pix_x * 25.4 + 0.5), (int) (m_mm_to_pix_y * 25.4 + 0.5));
}
{
return wxSize( (int) (m_mm_to_pix_x * 25.4 + 0.5), (int) (m_mm_to_pix_y * 25.4 + 0.5));
}
-int wxWindowDC::GetDepth() const
+int wxWindowDCImpl::GetDepth() const
{
wxFAIL_MSG(wxT("not implemented"));
{
wxFAIL_MSG(wxT("not implemented"));
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxClientDC)
+IMPLEMENT_ABSTRACT_CLASS(wxPaintDCImpl, wxClientDCImpl)
// Limit the paint region to the window size. Sometimes
// the paint region is too big, and this risks X11 errors
// Limit the paint region to the window size. Sometimes
// the paint region is too big, and this risks X11 errors
-wxPaintDC::wxPaintDC( wxWindow *win )
- : wxClientDC( win )
+wxPaintDCImpl::wxPaintDCImpl(wxDC *owner, wxWindow *win)
+ : wxClientDCImpl(owner, win)
{
#if USE_PAINT_REGION
if (!win->m_clipPaintRegion)
{
#if USE_PAINT_REGION
if (!win->m_clipPaintRegion)
}
//-----------------------------------------------------------------------------
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
+IMPLEMENT_ABSTRACT_CLASS(wxClientDCImpl, wxWindowDCImpl)
-wxClientDC::wxClientDC( wxWindow *win )
- : wxWindowDC( win )
+wxClientDCImpl::wxClientDCImpl(wxDC *owner, wxWindow *win)
+ : wxWindowDCImpl(owner, win)
- wxCHECK_RET( win, _T("NULL window in wxClientDC::wxClientDC") );
+ wxCHECK_RET( win, _T("NULL window in wxClientDCImpl::wxClientDCImpl") );
#ifdef __WXUNIVERSAL__
wxPoint ptOrigin = win->GetClientAreaOrigin();
#ifdef __WXUNIVERSAL__
wxPoint ptOrigin = win->GetClientAreaOrigin();
#endif // __WXUNIVERSAL__
}
#endif // __WXUNIVERSAL__
}
-void wxClientDC::DoGetSize(int *width, int *height) const
+void wxClientDCImpl::DoGetSize(int *width, int *height) const
{
wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
{
wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") );
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#include "wx/dcmemory.h"
+#include "wx/gtk1/dcmemory.h"
#include <gdk/gdk.h>
#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
#include <gdk/gdk.h>
#include <gtk/gtk.h>
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
+IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl, wxWindowDCImpl)
+void wxMemoryDCImpl::Init()
{
m_ok = false;
m_cmap = gtk_widget_get_default_colormap();
}
{
m_ok = false;
m_cmap = gtk_widget_get_default_colormap();
}
-wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
- : wxWindowDC()
+wxMemoryDCImpl::wxMemoryDCImpl(wxMemoryDC *owner, wxDC *WXUNUSED(dc))
+ : wxWindowDCImpl(owner)
-wxMemoryDC::~wxMemoryDC()
+wxMemoryDCImpl::~wxMemoryDCImpl()
-void wxMemoryDC::DoSelect( const wxBitmap& bitmap )
+void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
-void wxMemoryDC::SetPen( const wxPen& penOrig )
+void wxMemoryDCImpl::SetPen( const wxPen& penOrig )
{
wxPen pen( penOrig );
if ( m_selected.Ok() &&
{
wxPen pen( penOrig );
if ( m_selected.Ok() &&
pen.SetColour( pen.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
}
pen.SetColour( pen.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
}
- wxWindowDC::SetPen( pen );
+ wxWindowDCImpl::SetPen( pen );
-void wxMemoryDC::SetBrush( const wxBrush& brushOrig )
+void wxMemoryDCImpl::SetBrush( const wxBrush& brushOrig )
{
wxBrush brush( brushOrig );
if ( m_selected.Ok() &&
{
wxBrush brush( brushOrig );
if ( m_selected.Ok() &&
brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE);
}
brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE);
}
- wxWindowDC::SetBrush( brush );
+ wxWindowDCImpl::SetBrush( brush );
-void wxMemoryDC::SetBackground( const wxBrush& brushOrig )
+void wxMemoryDCImpl::SetBackground( const wxBrush& brushOrig )
{
wxBrush brush(brushOrig);
{
wxBrush brush(brushOrig);
brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
}
brush.SetColour( brush.GetColour() == *wxWHITE ? *wxBLACK : *wxWHITE );
}
- wxWindowDC::SetBackground( brush );
+ wxWindowDCImpl::SetBackground( brush );
-void wxMemoryDC::SetTextForeground( const wxColour& col )
+void wxMemoryDCImpl::SetTextForeground( const wxColour& col )
{
if ( m_selected.Ok() && m_selected.GetBitmap() )
{
{
if ( m_selected.Ok() && m_selected.GetBitmap() )
{
- wxWindowDC::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
+ wxWindowDCImpl::SetTextForeground( col == *wxWHITE ? *wxBLACK : *wxWHITE);
- wxWindowDC::SetTextForeground( col );
+ wxWindowDCImpl::SetTextForeground( col );
-void wxMemoryDC::SetTextBackground( const wxColour &col )
+void wxMemoryDCImpl::SetTextBackground( const wxColour &col )
{
if (m_selected.Ok() && m_selected.GetBitmap())
{
{
if (m_selected.Ok() && m_selected.GetBitmap())
{
- wxWindowDC::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE );
+ wxWindowDCImpl::SetTextBackground( col == *wxWHITE ? *wxBLACK : *wxWHITE );
- wxWindowDC::SetTextBackground( col );
+ wxWindowDCImpl::SetTextBackground( col );
-void wxMemoryDC::DoGetSize( int *width, int *height ) const
+void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
-#include "wx/dcscreen.h"
-
#ifndef WX_PRECOMP
#include "wx/window.h"
#endif
#ifndef WX_PRECOMP
#include "wx/window.h"
#endif
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
+#include "wx/gtk1/dcscreen.h"
+
//-----------------------------------------------------------------------------
// global data initialization
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// global data initialization
//-----------------------------------------------------------------------------
-GdkWindow *wxScreenDC::sm_overlayWindow = (GdkWindow*) NULL;
-int wxScreenDC::sm_overlayWindowX = 0;
-int wxScreenDC::sm_overlayWindowY = 0;
+GdkWindow *wxScreenDCImpl::sm_overlayWindow = (GdkWindow*) NULL;
+int wxScreenDCImpl::sm_overlayWindowX = 0;
+int wxScreenDCImpl::sm_overlayWindowY = 0;
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxScreenDC,wxPaintDC)
+IMPLEMENT_ABSTRACT_CLASS(wxScreenDCImpl, wxPaintDCImpl)
-wxScreenDC::wxScreenDC()
+wxScreenDCImpl::wxScreenDCImpl(wxScreenDC *owner)
+ : wxPaintDCImpl(owner)
{
m_ok = false;
m_cmap = gdk_colormap_get_system();
{
m_ok = false;
m_cmap = gdk_colormap_get_system();
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
}
gdk_gc_set_subwindow( m_bgGC, GDK_INCLUDE_INFERIORS );
}
-wxScreenDC::~wxScreenDC()
+wxScreenDCImpl::~wxScreenDCImpl()
{
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN );
gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN );
gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN );
{
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
gdk_gc_set_subwindow( m_brushGC, GDK_CLIP_BY_CHILDREN );
gdk_gc_set_subwindow( m_textGC, GDK_CLIP_BY_CHILDREN );
gdk_gc_set_subwindow( m_bgGC, GDK_CLIP_BY_CHILDREN );
-
- EndDrawingOnTop();
-}
-
-bool wxScreenDC::StartDrawingOnTop( wxWindow * )
-{
- return true;
-}
-
-bool wxScreenDC::StartDrawingOnTop( wxRect * )
-{
- return true;
-}
-
-bool wxScreenDC::EndDrawingOnTop()
-{
- return true;
-void wxScreenDC::DoGetSize(int *width, int *height) const
+void wxScreenDCImpl::DoGetSize(int *width, int *height) const
{
wxDisplaySize(width, height);
}
{
wxDisplaySize(width, height);
}
#include "gtk/gtk.h"
#include "wx/gtk1/win_gtk.h"
#include "wx/gtk1/private.h"
#include "gtk/gtk.h"
#include "wx/gtk1/win_gtk.h"
#include "wx/gtk1/private.h"
+#include "wx/gtk1/dcclient.h"
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
#include <gdk/gdk.h>
#include <gdk/gdkprivate.h>
gdk_gc_unref( gc );
// Hack alert
gdk_gc_unref( gc );
// Hack alert
- dc.m_window = pizza->bin_window;
+ wx_static_cast(wxClientDCImpl *, dc.GetImpl())->m_window = pizza->bin_window;
dc.SetTextForeground( *wxWHITE );
dc.DrawText( win->GetTitle(), 6, 3 );
}
dc.SetTextForeground( *wxWHITE );
dc.DrawText( win->GetTitle(), 6, 3 );
}
gdk_gc_unref( gc );
// Hack alert
gdk_gc_unref( gc );
// Hack alert
- dc.m_window = pizza->bin_window;
+ wx_static_cast(wxClientDCImpl *, dc.GetImpl())->m_window = pizza->bin_window;
dc.SetTextForeground( *wxWHITE );
dc.DrawText( win->GetTitle(), 6, 3 );
}
dc.SetTextForeground( *wxWHITE );
dc.DrawText( win->GetTitle(), 6, 3 );
}
// wxPen
//-----------------------------------------------------------------------------
// wxPen
//-----------------------------------------------------------------------------
-class wxPenRefData: public wxObjectRefData
+class wxPenRefData : public wxGDIRefData
}
wxPenRefData( const wxPenRefData& data )
}
wxPenRefData( const wxPenRefData& data )
{
m_style = data.m_style;
m_width = data.m_width;
{
m_style = data.m_style;
m_width = data.m_width;
#ifndef WX_PRECOMP
#include "wx/window.h"
#include "wx/dc.h"
#ifndef WX_PRECOMP
#include "wx/window.h"
#include "wx/dc.h"
- #include "wx/dcclient.h"
#endif
#include <gtk/gtk.h>
#include "wx/gtk1/win_gtk.h"
#endif
#include <gtk/gtk.h>
#include "wx/gtk1/win_gtk.h"
+#include "wx/gtk1/dcclient.h"
// RR: After a correction to the orientation of the sash
// this doesn't seem to be required anymore and it
// RR: After a correction to the orientation of the sash
// this doesn't seem to be required anymore and it
- dc.XLOG2DEV(rect.x) -1, rect.y -1, rect.width +2, rect.height +2
+ dc.LogicalToDeviceX(rect.x) -1, rect.y -1, rect.width +2, rect.height +2
// work for wxMemoryDC. So that is why we assume wxDC
// is wxWindowDC (wxClientDC, wxMemoryDC and wxPaintDC
// are derived from it) and use its m_window.
// work for wxMemoryDC. So that is why we assume wxDC
// is wxWindowDC (wxClientDC, wxMemoryDC and wxPaintDC
// are derived from it) and use its m_window.
- GdkWindow* gdk_window = dc.GetGDKWindow();
- wxASSERT_MSG( gdk_window,
- wxT("cannot use wxRendererNative on wxDC of this type") );
+ wxWindowDCImpl * const impl = wxDynamicCast(dc.GetImpl(), wxWindowDCImpl);
+ wxCHECK_RET( impl, "must have a window DC" );
+
+ GdkWindow* gdk_window = impl->GetGDKWindow();
// draw arrow so that there is even space horizontally
// on both sides
// draw arrow so that there is even space horizontally
// on both sides
GtkWidget *button = GetButtonWidget();
// for reason why we do this, see DrawDropArrow
GtkWidget *button = GetButtonWidget();
// for reason why we do this, see DrawDropArrow
- GdkWindow* gdk_window = dc.GetGDKWindow();
- wxASSERT_MSG( gdk_window,
- wxT("cannot use wxRendererNative on wxDC of this type") );
+ wxWindowDCImpl * const impl = wxDynamicCast(dc.GetImpl(), wxWindowDCImpl);
+ wxCHECK_RET( impl, "must have a window DC" );
+
+ GdkWindow* gdk_window = impl->GetGDKWindow();
// draw button
GtkStateType state;
// draw button
GtkStateType state;