converted most of X11 DC code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50354 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-11-30 15:26:05 +00:00
parent 7a8dce715f
commit 2b77c3fce7
6 changed files with 376 additions and 329 deletions

View File

@@ -20,10 +20,30 @@
#endif
#include "wx/x11/private.h"
#include "wx/x11/dcmemory.h"
IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC,wxWindowDC)
IMPLEMENT_ABSTRACT_CLASS(wxMemoryDCImpl,wxWindowDCImpl)
void wxMemoryDC::Init()
wxMemoryDCImpl::wxMemoryDCImpl( wxDC *owner )
: wxWindowDCImpl( owner )
{
Init();
}
wxMemoryDCImpl::wxMemoryDCImpl( wxDC *owner, wxBitmap& bitmap )
: wxWindowDCImpl( owner )
{
Init();
DoSelect(bitmap);
}
wxMemoryDCImpl::wxMemoryDCImpl( wxDC* owner, wxDC *WXUNUSED(dc) )
: wxWindowDCImpl( owner )
{
Init();
}
void wxMemoryDCImpl::Init()
{
m_ok = false;
@@ -33,17 +53,11 @@ void wxMemoryDC::Init()
m_cmap = (WXColormap) DefaultColormap( wxGlobalDisplay(), screen );
}
wxMemoryDC::wxMemoryDC( wxDC *WXUNUSED(dc) )
: wxWindowDC()
{
Init();
}
wxMemoryDC::~wxMemoryDC()
wxMemoryDCImpl::~wxMemoryDCImpl()
{
}
void wxMemoryDC::DoSelect( const wxBitmap& bitmap )
void wxMemoryDCImpl::DoSelect( const wxBitmap& bitmap )
{
Destroy();
@@ -52,11 +66,11 @@ void wxMemoryDC::DoSelect( const wxBitmap& bitmap )
{
if (m_selected.GetPixmap())
{
m_window = (WXWindow) m_selected.GetPixmap();
m_x11window = (WXWindow) m_selected.GetPixmap();
}
else
{
m_window = m_selected.GetBitmap();
m_x11window = m_selected.GetBitmap();
}
m_isMemDC = true;
@@ -66,11 +80,11 @@ void wxMemoryDC::DoSelect( const wxBitmap& bitmap )
else
{
m_ok = false;
m_window = NULL;
m_x11window = NULL;
}
}
void wxMemoryDC::DoGetSize( int *width, int *height ) const
void wxMemoryDCImpl::DoGetSize( int *width, int *height ) const
{
if (m_selected.Ok())
{
@@ -83,3 +97,13 @@ void wxMemoryDC::DoGetSize( int *width, int *height ) const
if (height) (*height) = 0;
}
}
const wxBitmap& wxMemoryDCImpl::GetSelectedBitmap() const
{
return m_selected;
}
wxBitmap& wxMemoryDCImpl::GetSelectedBitmap()
{
return m_selected;
}