+void wxWindowDFB::PaintOverlays(const wxRect& rect)
+{
+ if ( !m_overlays )
+ return;
+
+ for ( wxDfbOverlaysList::const_iterator i = m_overlays->begin();
+ i != m_overlays->end(); ++i )
+ {
+ // FIXME: the cast is necessary for STL build where the iterator
+ // (incorrectly) returns void* and not wxOverlayImpl*
+ wxOverlayImpl *overlay = (wxOverlayImpl*) *i;
+
+ wxRect orectOrig(overlay->GetRect());
+ wxRect orect(orectOrig);
+ orect.Intersect(rect);
+ if ( orect.IsEmpty() )
+ continue;
+
+ if ( overlay->IsEmpty() )
+ continue; // nothing to paint
+
+ DFBRectangle dfbRect = { orect.x - orectOrig.x, orect.y - orectOrig.y,
+ orect.width, orect.height };
+ GetDfbSurface()->Blit
+ (
+ overlay->GetDirectFBSurface(),
+ &dfbRect,
+ orect.x, orect.y
+ );
+ }
+}
+
+void wxWindowDFB::AddOverlay(wxOverlayImpl *overlay)
+{
+ if ( !m_overlays )
+ m_overlays = new wxDfbOverlaysList;
+
+ m_overlays->Add(overlay);
+}
+
+void wxWindowDFB::RemoveOverlay(wxOverlayImpl *overlay)
+{
+ wxCHECK_RET( m_overlays, "no overlays to remove" );
+
+ m_overlays->Remove(overlay);
+
+ if ( m_overlays->empty() )
+ {
+ wxDELETE(m_overlays);
+ }
+
+ if ( !m_isBeingDeleted )
+ RefreshWindowRect(overlay->GetRect());
+}
+