if( !m_visible )
return;
+ // update the transparency global mask
+ m_pImage->clear( x, y, width, height );
+
// Draw all the controls of the layout
list<LayeredControl>::const_iterator iter;
list<LayeredControl>::const_iterator iterVideo = m_controlList.end();
virtual ~OSGraphics() { }
/// Clear the graphics
- virtual void clear() = 0;
+ virtual void clear( int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1) = 0;
/// Draw another graphics on this one
virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,
}
-void Win32Graphics::clear()
+void Win32Graphics::clear( int xDest, int yDest, int width, int height )
{
- // Clear the transparency mask
- DeleteObject( m_mask );
- m_mask = CreateRectRgn( 0, 0, 0, 0 );
+ if( width <= 0 || height <= 0 )
+ {
+ // Clear the transparency mask
+ DeleteObject( m_mask );
+ m_mask = CreateRectRgn( 0, 0, 0, 0 );
+ }
+ else
+ {
+ HRGN mask = CreateRectRgn( xDest, yDest,
+ xDest + width, yDest + height );
+ CombineRgn( m_mask, m_mask, mask, RGN_DIFF );
+ }
}
virtual ~Win32Graphics();
/// Clear the graphics
- virtual void clear();
+ virtual void clear( int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1 );
/// Render a bitmap on this graphics
virtual void drawBitmap( const GenericBitmap &rBitmap, int xSrc = 0,
}
-void X11Graphics::clear()
+void X11Graphics::clear( int xDest, int yDest, int width, int height )
{
- // Clear the transparency mask
- XDestroyRegion( m_mask );
- m_mask = XCreateRegion();
+ if( width <= 0 || height <= 0 )
+ {
+ // Clear the transparency mask completely
+ XDestroyRegion( m_mask );
+ m_mask = XCreateRegion();
+ }
+ else
+ {
+ // remove this area from the mask
+ XRectangle rect;
+ rect.x = xDest;
+ rect.y = yDest;
+ rect.width = width;
+ rect.height = height;
+ Region regMask = XCreateRegion();
+ XUnionRectWithRegion( &rect, regMask, regMask );
+ XSubtractRegion( m_mask, regMask, m_mask );
+ XDestroyRegion( regMask );
+ }
}
virtual ~X11Graphics();
/// Clear the graphics
- virtual void clear();
+ virtual void clear( int xDest = 0, int yDest = 0,
+ int width = -1, int height = -1 );
/// Draw another graphics on this one
virtual void drawGraphics( const OSGraphics &rGraphics, int xSrc = 0,