Kaydet (Commit) aa5b97fa authored tarafından Chris Sherlock's avatar Chris Sherlock

Split outdev5.cxx and outdev6.cxx

outdev5.cxx deals with curved shapes, so renamed to curvedshapes.cxx

Moved polygon functions to polygon.cxx, transparency functions to
transparent.cxx, a few miscellaneous functions to outdev.cxx and as the
rest of the functions are wallpaper functions then renamed outdev6.cxx
to wallpaper.cxx

Change-Id: I62a0b66d4d66740fb5f70ecb558db1ad3bf76eb5
üst d92ee5d8
...@@ -234,6 +234,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ ...@@ -234,6 +234,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/gdi/metric \ vcl/source/gdi/metric \
vcl/source/gdi/octree \ vcl/source/gdi/octree \
vcl/source/gdi/oldprintadaptor \ vcl/source/gdi/oldprintadaptor \
vcl/source/outdev/outdev \
vcl/source/outdev/tworect \ vcl/source/outdev/tworect \
vcl/source/outdev/bezier \ vcl/source/outdev/bezier \
vcl/source/outdev/polygon \ vcl/source/outdev/polygon \
...@@ -250,9 +251,8 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ ...@@ -250,9 +251,8 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/outdev/polyline \ vcl/source/outdev/polyline \
vcl/source/outdev/hatch \ vcl/source/outdev/hatch \
vcl/source/outdev/gradient \ vcl/source/outdev/gradient \
vcl/source/outdev/outdev5 \ vcl/source/outdev/curvedshapes \
vcl/source/outdev/outdev6 \ vcl/source/outdev/wallpaper \
vcl/source/outdev/outdev \
vcl/source/outdev/outdevnative \ vcl/source/outdev/outdevnative \
vcl/source/outdev/outmap \ vcl/source/outdev/outmap \
vcl/source/gdi/pdfextoutdevdata \ vcl/source/gdi/pdfextoutdevdata \
......
...@@ -1576,4 +1576,122 @@ css::uno::Reference< css::rendering::XCanvas > OutputDevice::GetCanvas() const ...@@ -1576,4 +1576,122 @@ css::uno::Reference< css::rendering::XCanvas > OutputDevice::GetCanvas() const
return xCanvas; return xCanvas;
} }
void OutputDevice::Erase()
{
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return;
bool bNativeOK = false;
if( meOutDevType == OUTDEV_WINDOW )
{
Window* pWindow = static_cast<Window*>(this);
ControlPart aCtrlPart = pWindow->ImplGetWindowImpl()->mnNativeBackground;
if( aCtrlPart != 0 && ! pWindow->IsControlBackground() )
{
ImplControlValue aControlValue;
Point aGcc3WorkaroundTemporary;
Rectangle aCtrlRegion( aGcc3WorkaroundTemporary, GetOutputSizePixel() );
ControlState nState = 0;
if( pWindow->IsEnabled() ) nState |= CTRL_STATE_ENABLED;
bNativeOK = pWindow->DrawNativeControl( CTRL_WINDOW_BACKGROUND, aCtrlPart, aCtrlRegion,
nState, aControlValue, OUString() );
}
}
if ( mbBackground && ! bNativeOK )
{
RasterOp eRasterOp = GetRasterOp();
if ( eRasterOp != ROP_OVERPAINT )
SetRasterOp( ROP_OVERPAINT );
ImplDrawWallpaper( 0, 0, mnOutWidth, mnOutHeight, maBackground );
if ( eRasterOp != ROP_OVERPAINT )
SetRasterOp( eRasterOp );
}
if( mpAlphaVDev )
mpAlphaVDev->Erase();
}
bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize,
const GfxLink& rGfxLink, GDIMetaFile* pSubst )
{
bool bDrawn(true);
if ( mpMetaFile )
{
GDIMetaFile aSubst;
if( pSubst )
aSubst = *pSubst;
mpMetaFile->AddAction( new MetaEPSAction( rPoint, rSize, rGfxLink, aSubst ) );
}
if ( !IsDeviceOutputNecessary() || ImplIsRecordLayout() )
return bDrawn;
if( mbOutputClipped )
return bDrawn;
Rectangle aRect( ImplLogicToDevicePixel( Rectangle( rPoint, rSize ) ) );
if( !aRect.IsEmpty() )
{
// draw the real EPS graphics
if( rGfxLink.GetData() && rGfxLink.GetDataSize() )
{
if( !mpGraphics && !ImplGetGraphics() )
return bDrawn;
if( mbInitClipRegion )
ImplInitClipRegion();
aRect.Justify();
bDrawn = mpGraphics->DrawEPS( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(),
(sal_uInt8*) rGfxLink.GetData(), rGfxLink.GetDataSize(), this );
}
// else draw the substitution graphics
if( !bDrawn && pSubst )
{
GDIMetaFile* pOldMetaFile = mpMetaFile;
mpMetaFile = NULL;
Graphic( *pSubst ).Draw( this, rPoint, rSize );
mpMetaFile = pOldMetaFile;
}
}
if( mpAlphaVDev )
mpAlphaVDev->DrawEPS( rPoint, rSize, rGfxLink, pSubst );
return bDrawn;
}
void OutputDevice::DrawCheckered(const Point& rPos, const Size& rSize, sal_uInt32 nLen, Color aStart, Color aEnd)
{
const sal_uInt32 nMaxX(rPos.X() + rSize.Width());
const sal_uInt32 nMaxY(rPos.Y() + rSize.Height());
Push(PUSH_LINECOLOR|PUSH_FILLCOLOR);
SetLineColor();
for(sal_uInt32 x(0), nX(rPos.X()); nX < nMaxX; x++, nX += nLen)
{
const sal_uInt32 nRight(std::min(nMaxX, nX + nLen));
for(sal_uInt32 y(0), nY(rPos.Y()); nY < nMaxY; y++, nY += nLen)
{
const sal_uInt32 nBottom(std::min(nMaxY, nY + nLen));
SetFillColor((x & 0x0001) ^ (y & 0x0001) ? aStart : aEnd);
DrawRect(Rectangle(nX, nY, nRight, nBottom));
}
}
Pop();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
...@@ -476,3 +476,97 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly ...@@ -476,3 +476,97 @@ void OutputDevice::ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const Poly
if( pClipPolyPoly ) if( pClipPolyPoly )
delete pPolyPoly; delete pPolyPoly;
} }
void OutputDevice::DrawGrid( const Rectangle& rRect, const Size& rDist, sal_uLong nFlags )
{
Rectangle aDstRect( PixelToLogic( Point() ), GetOutputSize() );
aDstRect.Intersection( rRect );
if( aDstRect.IsEmpty() || ImplIsRecordLayout() )
return;
if( !mpGraphics && !ImplGetGraphics() )
return;
if( mbInitClipRegion )
ImplInitClipRegion();
if( mbOutputClipped )
return;
const long nDistX = std::max( rDist.Width(), 1L );
const long nDistY = std::max( rDist.Height(), 1L );
long nX = ( rRect.Left() >= aDstRect.Left() ) ? rRect.Left() : ( rRect.Left() + ( ( aDstRect.Left() - rRect.Left() ) / nDistX ) * nDistX );
long nY = ( rRect.Top() >= aDstRect.Top() ) ? rRect.Top() : ( rRect.Top() + ( ( aDstRect.Top() - rRect.Top() ) / nDistY ) * nDistY );
const long nRight = aDstRect.Right();
const long nBottom = aDstRect.Bottom();
const long nStartX = ImplLogicXToDevicePixel( nX );
const long nEndX = ImplLogicXToDevicePixel( nRight );
const long nStartY = ImplLogicYToDevicePixel( nY );
const long nEndY = ImplLogicYToDevicePixel( nBottom );
long nHorzCount = 0L;
long nVertCount = 0L;
::com::sun::star::uno::Sequence< sal_Int32 > aVertBuf;
::com::sun::star::uno::Sequence< sal_Int32 > aHorzBuf;
if( ( nFlags & GRID_DOTS ) || ( nFlags & GRID_HORZLINES ) )
{
aVertBuf.realloc( aDstRect.GetHeight() / nDistY + 2L );
aVertBuf[ nVertCount++ ] = nStartY;
while( ( nY += nDistY ) <= nBottom )
aVertBuf[ nVertCount++ ] = ImplLogicYToDevicePixel( nY );
}
if( ( nFlags & GRID_DOTS ) || ( nFlags & GRID_VERTLINES ) )
{
aHorzBuf.realloc( aDstRect.GetWidth() / nDistX + 2L );
aHorzBuf[ nHorzCount++ ] = nStartX;
while( ( nX += nDistX ) <= nRight )
aHorzBuf[ nHorzCount++ ] = ImplLogicXToDevicePixel( nX );
}
if( mbInitLineColor )
ImplInitLineColor();
if( mbInitFillColor )
ImplInitFillColor();
const bool bOldMap = mbMap;
EnableMapMode( false );
if( nFlags & GRID_DOTS )
{
for( long i = 0L; i < nVertCount; i++ )
for( long j = 0L, Y = aVertBuf[ i ]; j < nHorzCount; j++ )
mpGraphics->DrawPixel( aHorzBuf[ j ], Y, this );
}
else
{
if( nFlags & GRID_HORZLINES )
{
for( long i = 0L; i < nVertCount; i++ )
{
nY = aVertBuf[ i ];
mpGraphics->DrawLine( nStartX, nY, nEndX, nY, this );
}
}
if( nFlags & GRID_VERTLINES )
{
for( long i = 0L; i < nHorzCount; i++ )
{
nX = aHorzBuf[ i ];
mpGraphics->DrawLine( nX, nStartY, nX, nEndY, this );
}
}
}
EnableMapMode( bOldMap );
if( mpAlphaVDev )
mpAlphaVDev->DrawGrid( rRect, rDist, nFlags );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment