projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't include pbt.h from wxMSW code unnecessarily.
[wxWidgets.git]
/
src
/
dfb
/
overlay.cpp
diff --git
a/src/dfb/overlay.cpp
b/src/dfb/overlay.cpp
index 64ae7eff539575eb5d5283ac12dd1ee49a047288..cee282298ac87e6b51f65c0ce9a4efece5f809af 100644
(file)
--- a/
src/dfb/overlay.cpp
+++ b/
src/dfb/overlay.cpp
@@
-23,7
+23,13
@@
#pragma hdrstop
#endif
#pragma hdrstop
#endif
+#ifndef WX_PRECOMP
+ #include "wx/window.h"
+ #include "wx/dcclient.h"
+#endif
+
#include "wx/private/overlay.h"
#include "wx/private/overlay.h"
+#include "wx/dfb/dcclient.h"
#include "wx/dfb/private.h"
// ============================================================================
#include "wx/dfb/private.h"
// ============================================================================
@@
-50,50
+56,61
@@
bool wxOverlayImpl::IsOk()
return m_window != NULL;
}
return m_window != NULL;
}
-void wxOverlayImpl::Init(wx
Window
DC *dc, int x, int y, int width, int height)
+void wxOverlayImpl::Init(wxDC *dc, int x, int y, int width, int height)
{
{
+ wxCHECK_RET( dc, "NULL dc pointer" );
wxASSERT_MSG( !IsOk() , _("You cannot Init an overlay twice") );
wxASSERT_MSG( !IsOk() , _("You cannot Init an overlay twice") );
+ wxDFBDCImpl * const dcimpl = wxDynamicCast(dc->GetImpl(), wxDFBDCImpl);
+ wxCHECK_RET( dcimpl, "must have a DFB wxDC" );
+
m_window = dc->GetWindow();
m_rect = wxRect(x, y, width, height);
m_window = dc->GetWindow();
m_rect = wxRect(x, y, width, height);
- m_rect.Offset(m_window->GetClientAreaOrigin());
+ if ( wxDynamicCast(dc, wxClientDC) )
+ m_rect.Offset(m_window->GetClientAreaOrigin());
// FIXME: create surface with transparency or key color (?)
// FIXME: create surface with transparency or key color (?)
- m_surface =
- dc->GetDirectFBSurface()->CreateCompatible
- (
- m_rect.GetSize(),
- wxIDirectFBSurface::CreateCompatible_NoBackBuffer
- );
+ m_surface = dcimpl->GetDirectFBSurface()->CreateCompatible
+ (
+ m_rect.GetSize(),
+ wxIDirectFBSurface::CreateCompatible_NoBackBuffer
+ );
m_window->AddOverlay(this);
}
m_window->AddOverlay(this);
}
-void wxOverlayImpl::BeginDrawing(wx
Window
DC *dc)
+void wxOverlayImpl::BeginDrawing(wxDC *dc)
{
{
- wxPoint origin(m_rect.GetPosition() - m_window->GetClientAreaOrigin());
+ wxCHECK_RET( dc, "NULL dc pointer" );
+
+ wxWindowDCImpl * const
+ dcimpl = static_cast<wxWindowDCImpl *>(dc->GetImpl());
+
+ wxPoint origin(m_rect.GetPosition());
+ if ( wxDynamicCast(dc, wxClientDC) )
+ origin -= m_window->GetClientAreaOrigin();
// drawing on overlay "hijacks" existing wxWindowDC rather then using
// another DC, so we have to change the DC to draw on the overlay's surface.
// Setting m_shouldFlip is done to avoid flipping and drawing of overlays
// in ~wxWindowDC (we do it EndDrawing).
// drawing on overlay "hijacks" existing wxWindowDC rather then using
// another DC, so we have to change the DC to draw on the overlay's surface.
// Setting m_shouldFlip is done to avoid flipping and drawing of overlays
// in ~wxWindowDC (we do it EndDrawing).
- dc->DFBInit(m_surface);
+ dcimpl->DFBInit(m_surface);
+ dcimpl->m_shouldFlip = false;
dc->SetDeviceOrigin(-origin.x, -origin.y);
dc->SetDeviceOrigin(-origin.x, -origin.y);
- dc->m_shouldFlip = false;
m_isEmpty = false;
}
m_isEmpty = false;
}
-void wxOverlayImpl::EndDrawing(wx
WindowDC *dc
)
+void wxOverlayImpl::EndDrawing(wx
DC *WXUNUSED(dc)
)
{
m_window->RefreshWindowRect(m_rect);
}
{
m_window->RefreshWindowRect(m_rect);
}
-void wxOverlayImpl::Clear(wx
WindowDC *dc
)
+void wxOverlayImpl::Clear(wx
DC *WXUNUSED(dc)
)
{
wxASSERT_MSG( IsOk(),
{
wxASSERT_MSG( IsOk(),
-
_T("You cannot Clear an overlay that is not initialized")
);
+
"You cannot Clear an overlay that is not initialized"
);
m_isEmpty = true;
}
m_isEmpty = true;
}