projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix for longlongHash for architectures where sizeof(long long) == sizeof(long)
[wxWidgets.git]
/
src
/
generic
/
dragimgg.cpp
diff --git
a/src/generic/dragimgg.cpp
b/src/generic/dragimgg.cpp
index f171e1476748f189b8aea1ab62bdafca3f780d4d..7ea5a4fabcb1a2bf923539bffb3f0734f3e5f4f8 100644
(file)
--- a/
src/generic/dragimgg.cpp
+++ b/
src/generic/dragimgg.cpp
@@
-35,16
+35,12
@@
#include "wx/dcmemory.h"
#include "wx/settings.h"
#include "wx/intl.h"
#include "wx/dcmemory.h"
#include "wx/settings.h"
#include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/image.h"
#endif
#endif
-#include "wx/log.h"
-
#define wxUSE_IMAGE_IN_DRAGIMAGE 1
#define wxUSE_IMAGE_IN_DRAGIMAGE 1
-#if wxUSE_IMAGE_IN_DRAGIMAGE
-#include "wx/image.h"
-#endif
-
#include "wx/generic/dragimgg.h"
// ----------------------------------------------------------------------------
#include "wx/generic/dragimgg.h"
// ----------------------------------------------------------------------------
@@
-76,7
+72,11
@@
void wxGenericDragImage::Init()
m_windowDC = (wxDC*) NULL;
m_window = (wxWindow*) NULL;
m_fullScreen = false;
m_windowDC = (wxDC*) NULL;
m_window = (wxWindow*) NULL;
m_fullScreen = false;
+#ifdef wxHAS_NATIVE_OVERLAY
+ m_dcOverlay = NULL;
+#else
m_pBackingBitmap = (wxBitmap*) NULL;
m_pBackingBitmap = (wxBitmap*) NULL;
+#endif
}
#if WXWIN_COMPATIBILITY_2_6
}
#if WXWIN_COMPATIBILITY_2_6
@@
-288,10
+288,12
@@
bool wxGenericDragImage::BeginDrag(const wxPoint& hotspot,
}
}
}
}
+#ifndef wxHAS_NATIVE_OVERLAY
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
if (!backing->Ok() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y))
(*backing) = wxBitmap(clientSize.x, clientSize.y);
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
if (!backing->Ok() || (backing->GetWidth() < clientSize.x || backing->GetHeight() < clientSize.y))
(*backing) = wxBitmap(clientSize.x, clientSize.y);
+#endif // !wxHAS_NATIVE_OVERLAY
if (!m_fullScreen)
{
if (!m_fullScreen)
{
@@
-354,12
+356,18
@@
bool wxGenericDragImage::EndDrag()
if (m_windowDC)
{
if (m_windowDC)
{
+#ifdef wxHAS_NATIVE_OVERLAY
+ m_overlay.Reset();
+#else
m_windowDC->DestroyClippingRegion();
m_windowDC->DestroyClippingRegion();
+#endif
delete m_windowDC;
m_windowDC = (wxDC*) NULL;
}
delete m_windowDC;
m_windowDC = (wxDC*) NULL;
}
+#ifndef wxHAS_NATIVE_OVERLAY
m_repairBitmap = wxNullBitmap;
m_repairBitmap = wxNullBitmap;
+#endif
return true;
}
return true;
}
@@
-401,6
+409,7
@@
bool wxGenericDragImage::Show()
// This is where we restore the backing bitmap, in case
// something has changed on the window.
// This is where we restore the backing bitmap, in case
// something has changed on the window.
+#ifndef wxHAS_NATIVE_OVERLAY
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
wxMemoryDC memDC;
memDC.SelectObject(* backing);
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
wxMemoryDC memDC;
memDC.SelectObject(* backing);
@@
-409,6
+418,7
@@
bool wxGenericDragImage::Show()
//memDC.Blit(0, 0, m_boundingRect.width, m_boundingRect.height, m_windowDC, m_boundingRect.x, m_boundingRect.y);
memDC.SelectObject(wxNullBitmap);
//memDC.Blit(0, 0, m_boundingRect.width, m_boundingRect.height, m_windowDC, m_boundingRect.x, m_boundingRect.y);
memDC.SelectObject(wxNullBitmap);
+#endif // !wxHAS_NATIVE_OVERLAY
RedrawImage(m_position - m_offset, m_position - m_offset, false, true);
}
RedrawImage(m_position - m_offset, m_position - m_offset, false, true);
}
@@
-450,6
+460,13
@@
bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, const wxPoint& newPo
if (!m_windowDC)
return false;
if (!m_windowDC)
return false;
+#ifdef wxHAS_NATIVE_OVERLAY
+ wxDCOverlay dcoverlay( m_overlay, (wxWindowDC*) m_windowDC ) ;
+ if ( eraseOld )
+ dcoverlay.Clear() ;
+ if (drawNew)
+ DoDrawImage(*m_windowDC, newPos);
+#else // !wxHAS_NATIVE_OVERLAY
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
if (!backing->Ok())
return false;
wxBitmap* backing = (m_pBackingBitmap ? m_pBackingBitmap : (wxBitmap*) & m_backingBitmap);
if (!backing->Ok())
return false;
@@
-515,6
+532,7
@@
bool wxGenericDragImage::RedrawImage(const wxPoint& oldPos, const wxPoint& newPo
memDCTemp.SelectObject(wxNullBitmap);
memDC.SelectObject(wxNullBitmap);
memDCTemp.SelectObject(wxNullBitmap);
memDC.SelectObject(wxNullBitmap);
+#endif // wxHAS_NATIVE_OVERLAY/!wxHAS_NATIVE_OVERLAY
return true;
}
return true;
}