-wxIDirectFBSurfacePtr wxTopLevelWindowDFB::ObtainDfbSurface() const
-{
- return m_dfbwin->GetSurface();
-}
-
-void wxTopLevelWindowDFB::HandleQueuedPaintRequests()
-{
- if ( m_toPaint->IsEmpty() )
- return; // nothing to do
-
- if ( IsFrozen() || !IsShown() )
- {
- // nothing to do if the window is frozen or hidden; clear the queue
- // and return (note that it's OK to clear the queue even if the window
- // is frozen, because Thaw() calls Refresh()):
- m_toPaint->Clear();
- return;
- }
-
- const wxDfbQueuedPaintRequestsList& requests = m_toPaint->GetRequests();
-
- // process queued paint requests:
- wxRect winRect(wxPoint(0, 0), GetSize());
- wxRect paintedRect;
-
- size_t cnt = requests.size();
- for ( size_t i = 0; i < cnt; ++i )
- {
- const wxDfbPaintRequest& request = *requests[i];
-
- wxRect clipped(request.m_rect);
-
- wxLogTrace(TRACE_PAINT,
- _T("%p ('%s'): processing paint request [x=%i,y=%i,w=%i,h=%i]"),
- this, GetName().c_str(),
- clipped.x, clipped.y, clipped.width, clipped.height);
-
- clipped.Intersect(winRect);
- if ( clipped.IsEmpty() )
- continue; // nothing to refresh
-
- PaintWindow(clipped, request.m_eraseBackground);
-
- // remember rectangle covering all repainted areas:
- if ( paintedRect.IsEmpty() )
- paintedRect = clipped;
- else
- paintedRect.Union(clipped);
- }
-
- m_toPaint->Clear();
-
- if ( paintedRect.IsEmpty() )
- return; // no painting occurred, no need to flip
-
- // flip the surface to make the changes visible:
- DFBRegion r = {paintedRect.GetLeft(), paintedRect.GetTop(),
- paintedRect.GetRight(), paintedRect.GetBottom()};
- DFBRegion *rptr = (winRect == paintedRect) ? NULL : &r;
-
- GetDfbSurface()->Flip(rptr, DSFLIP_NONE);
-}
-
-void wxTopLevelWindowDFB::DoRefreshRect(const wxRect& rect, bool eraseBack)
-{
- // defer painting until idle time or until Update() is called:
- m_toPaint->Add(rect, eraseBack);
-}
-
-void wxTopLevelWindowDFB::Update()
-{
- HandleQueuedPaintRequests();
-}
-
-// ---------------------------------------------------------------------------
-// events handling
-// ---------------------------------------------------------------------------
-
-/* static */
-void wxTopLevelWindowDFB::HandleDFBWindowEvent(const wxDFBWindowEvent& event_)