projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix history in wxWebViewIE when using a custom file scheme.
[wxWidgets.git]
/
src
/
x11
/
dcmemory.cpp
diff --git
a/src/x11/dcmemory.cpp
b/src/x11/dcmemory.cpp
index 34cc5f075387fb6c1c479593b569b7dbec16a64a..bdafb7aaf9778bbc39e143f1cfd9a7d27abc239f 100644
(file)
--- a/
src/x11/dcmemory.cpp
+++ b/
src/x11/dcmemory.cpp
@@
-1,81
+1,92
@@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-// Name: dcmemory.cpp
+// Name:
src/x11/
dcmemory.cpp
// Purpose: wxMemoryDC class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Purpose: wxMemoryDC class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence:
wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "dcmemory.h"
-#endif
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
#include "wx/dcmemory.h"
#include "wx/dcmemory.h"
-#include "wx/settings.h"
-#include "wx/utils.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/utils.h"
+ #include "wx/settings.h"
+#endif
#include "wx/x11/private.h"
#include "wx/x11/private.h"
+#include "wx/x11/dcmemory.h"
-IMPLEMENT_
DYNAMIC_CLASS(wxMemoryDC,wxWindowDC
)
+IMPLEMENT_
ABSTRACT_CLASS(wxMemoryDCImpl,wxWindowDCImpl
)
-wxMemoryDC::wxMemoryDC() : wxWindowDC()
+wxMemoryDCImpl::wxMemoryDCImpl( wxDC *owner )
+ : wxWindowDCImpl( owner )
{
{
- m_ok = FALSE;
-
- m_display = (WXDisplay *) wxGlobalDisplay();
+ Init();
+}
- int screen = DefaultScreen( wxGlobalDisplay() );
- m_cmap = (WXColormap) DefaultColormap( wxGlobalDisplay(), screen );
+wxMemoryDCImpl::wxMemoryDCImpl( wxDC *owner, wxBitmap& bitmap )
+ : wxWindowDCImpl( owner )
+{
+ Init();
+ DoSelect(bitmap);
}
}
-wxMemoryDC
::wxMemoryDC(
wxDC *WXUNUSED(dc) )
- : wxWindowDC
(
)
+wxMemoryDC
Impl::wxMemoryDCImpl( wxDC* owner,
wxDC *WXUNUSED(dc) )
+ : wxWindowDC
Impl( owner
)
{
{
- m_ok = FALSE;
+ Init();
+}
+
+void wxMemoryDCImpl::Init()
+{
+ m_ok = false;
m_display = (WXDisplay *) wxGlobalDisplay();
m_display = (WXDisplay *) wxGlobalDisplay();
-
+
int screen = DefaultScreen( wxGlobalDisplay() );
m_cmap = (WXColormap) DefaultColormap( wxGlobalDisplay(), screen );
}
int screen = DefaultScreen( wxGlobalDisplay() );
m_cmap = (WXColormap) DefaultColormap( wxGlobalDisplay(), screen );
}
-wxMemoryDC
::~wxMemoryDC
()
+wxMemoryDC
Impl::~wxMemoryDCImpl
()
{
}
{
}
-void wxMemoryDC
::SelectObj
ect( const wxBitmap& bitmap )
+void wxMemoryDC
Impl::DoSel
ect( const wxBitmap& bitmap )
{
Destroy();
{
Destroy();
-
+
m_selected = bitmap;
m_selected = bitmap;
- if (m_selected.Ok())
+ if (m_selected.
Is
Ok())
{
if (m_selected.GetPixmap())
{
{
if (m_selected.GetPixmap())
{
- m_window = (WXWindow) m_selected.GetPixmap();
+ m_
x11
window = (WXWindow) m_selected.GetPixmap();
}
else
{
}
else
{
-
// m_
window = m_selected.GetBitmap();
+
m_x11
window = m_selected.GetBitmap();
}
}
- m_isMemDC =
TRUE
;
+ m_isMemDC =
true
;
SetUpDC();
}
else
{
SetUpDC();
}
else
{
- m_ok =
FALSE
;
- m_window = NULL;
+ m_ok =
false
;
+ m_
x11
window = NULL;
}
}
}
}
-void wxMemoryDC::DoGetSize( int *width, int *height ) const
+void wxMemoryDC
Impl
::DoGetSize( int *width, int *height ) const
{
{
- if (m_selected.Ok())
+ if (m_selected.
Is
Ok())
{
if (width) (*width) = m_selected.GetWidth();
if (height) (*height) = m_selected.GetHeight();
{
if (width) (*width) = m_selected.GetWidth();
if (height) (*height) = m_selected.GetHeight();
@@
-86,3
+97,13
@@
void wxMemoryDC::DoGetSize( int *width, int *height ) const
if (height) (*height) = 0;
}
}
if (height) (*height) = 0;
}
}
+
+const wxBitmap& wxMemoryDCImpl::GetSelectedBitmap() const
+{
+ return m_selected;
+}
+
+wxBitmap& wxMemoryDCImpl::GetSelectedBitmap()
+{
+ return m_selected;
+}