include/vcl/outdev.hxx | 279 ++++++++++++++++++++++++++++--------------------- 1 file changed, 164 insertions(+), 115 deletions(-)
New commits: commit cd21e1ea69d1cf66e7b6c6488609c0b57c64e379 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Thu Feb 6 17:57:22 2014 +1100 Group like Impl* functions in outdev.hxx Change-Id: Iede8395d9287a857601080e7a65dc3a3eea93c9e Reviewed-on: https://gerrit.libreoffice.org/7890 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 38bf254..3a9bf86 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -355,36 +355,53 @@ private: mutable bool mbEnableRTL : 1; public: - SAL_DLLPRIVATE sal_Int32 ImplGetDPIX() const { return mnDPIX; } - SAL_DLLPRIVATE sal_Int32 ImplGetDPIY() const { return mnDPIY; } + /** @name Initialization and accessor functions + */ + ///@{ SAL_DLLPRIVATE SalGraphics* ImplGetGraphics() const; SAL_DLLPRIVATE void ImplReleaseGraphics( sal_Bool bRelease = sal_True ); - SAL_DLLPRIVATE bool ImplHasMirroredGraphics() const; - SAL_DLLPRIVATE void ImplReMirror( Point &rPoint ) const; - SAL_DLLPRIVATE void ImplReMirror( Rectangle &rRect ) const; - SAL_DLLPRIVATE void ImplReMirror( Region &rRegion ) const; SAL_DLLPRIVATE void ImplInitOutDevData(); SAL_DLLPRIVATE void ImplDeInitOutDevData(); - SAL_DLLPRIVATE void ImplInitLineColor(); - SAL_DLLPRIVATE void ImplInitFillColor(); - SAL_DLLPRIVATE bool ImplNewFont() const; - SAL_DLLPRIVATE void ImplInitFont() const; - SAL_DLLPRIVATE void ImplInitTextColor(); + ///@} + + /** @name Helper functions + */ + ///@{ + SAL_DLLPRIVATE sal_Int32 ImplGetDPIX() const { return mnDPIX; } + SAL_DLLPRIVATE sal_Int32 ImplGetDPIY() const { return mnDPIY; } + SAL_DLLPRIVATE long ImplLogicXToDevicePixel( long nX ) const; + SAL_DLLPRIVATE long ImplLogicYToDevicePixel( long nY ) const; + SAL_DLLPRIVATE long ImplLogicWidthToDevicePixel( long nWidth ) const; + SAL_DLLPRIVATE long ImplLogicHeightToDevicePixel( long nHeight ) const; + SAL_DLLPRIVATE long ImplDevicePixelToLogicWidth( long nWidth ) const; + SAL_DLLPRIVATE long ImplDevicePixelToLogicHeight( long nHeight ) const; + SAL_DLLPRIVATE float ImplFloatLogicHeightToDevicePixel( float ) const; + SAL_DLLPRIVATE Point ImplLogicToDevicePixel( const Point& rLogicPt ) const; + SAL_DLLPRIVATE Size ImplLogicToDevicePixel( const Size& rLogicSize ) const; + SAL_DLLPRIVATE Rectangle ImplLogicToDevicePixel( const Rectangle& rLogicRect ) const; + SAL_DLLPRIVATE ::basegfx::B2DPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolygon& ) const; + SAL_DLLPRIVATE ::basegfx::B2DPolyPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolyPolygon& ) const; + SAL_DLLPRIVATE Polygon ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const; + SAL_DLLPRIVATE PolyPolygon ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyPoly ) const; + SAL_DLLPRIVATE LineInfo ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const; + SAL_DLLPRIVATE Rectangle ImplDevicePixelToLogic( const Rectangle& rLogicRect ) const; + SAL_DLLPRIVATE Region ImplPixelToDevicePixel( const Region& rRegion ) const; + SAL_DLLPRIVATE void ImplInvalidateViewTransform(); + SAL_DLLPRIVATE basegfx::B2DHomMatrix ImplGetDeviceTransformation() const; + ///@} + SAL_DLLPRIVATE void ImplInitClipRegion(); SAL_DLLPRIVATE bool ImplSelectClipRegion( const Region&, SalGraphics* pGraphics = NULL ); SAL_DLLPRIVATE void ImplSetClipRegion( const Region* pRegion ); - SAL_DLLPRIVATE SalLayout* ImplLayout( const OUString&, sal_Int32 nIndex, sal_Int32 nLen, - const Point& rLogicPos = Point(0,0), long nLogicWidth=0, - const sal_Int32* pLogicDXArray=NULL, bool bFilter = false ) const; - SAL_DLLPRIVATE ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen, - long nPixelWidth, const sal_Int32* pPixelDXArray ) const; - SAL_DLLPRIVATE SalLayout* ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const; + /** @name Text and font functions + */ + ///@{ + SAL_DLLPRIVATE bool ImplNewFont() const; + SAL_DLLPRIVATE void ImplInitFont() const; + SAL_DLLPRIVATE void ImplInitTextColor(); static - SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const OUString& rStr, - long nMaxWidth, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout ); - static SAL_DLLPRIVATE void ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect, const OUString& rOrigStr, sal_uInt16 nStyle, MetricVector* pVector, OUString* pDisplayText, ::vcl::ITextLayout& _rLayout ); @@ -396,6 +413,9 @@ public: SAL_DLLPRIVATE void ImplDrawText( SalLayout& ); SAL_DLLPRIVATE Rectangle ImplGetTextBoundRect( const SalLayout& ); SAL_DLLPRIVATE void ImplDrawEmphasisMarks( SalLayout& ); + static + SAL_DLLPRIVATE OUString ImplGetEllipsisString( const OutputDevice& rTargetDevice, const OUString& rStr, + long nMaxWidth, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout ); SAL_DLLPRIVATE void ImplDrawTextRect( long nBaseX, long nBaseY, long nX, long nY, long nWidth, long nHeight ); @@ -408,6 +428,9 @@ public: SAL_DLLPRIVATE void ImplDrawStrikeoutChar( long nBaseX, long nBaseY, long nX, long nY, long nWidth, FontStrikeout eStrikeout, Color aColor ); SAL_DLLPRIVATE void ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bUnderlineAbove ); SAL_DLLPRIVATE void ImplDrawMnemonicLine( long nX, long nY, long nWidth ); + SAL_DLLPRIVATE static sal_Bool ImplIsUnderlineAbove( const Font& ); + + SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont ); SAL_DLLPRIVATE void ImplGetEmphasisMark( PolyPolygon& rPolyPoly, sal_Bool& rPolyLine, Rectangle& rRect1, Rectangle& rRect2, long& rYOff, long& rWidth, FontEmphasisMark eEmphasis, long nHeight, short nOrient ); SAL_DLLPRIVATE void ImplDrawEmphasisMark( long nBaseX, long nX, long nY, const PolyPolygon& rPolyPoly, sal_Bool bPolyLine, const Rectangle& rRect1, const Rectangle& rRect2 ); static @@ -415,124 +438,150 @@ public: SAL_DLLPRIVATE void ImplInitFontList() const; SAL_DLLPRIVATE void ImplUpdateFontData( bool bNewFontLists ); SAL_DLLPRIVATE static void ImplUpdateAllFontData( bool bNewFontLists ); + ///@} - SAL_DLLPRIVATE long ImplLogicXToDevicePixel( long nX ) const; - SAL_DLLPRIVATE long ImplLogicYToDevicePixel( long nY ) const; - SAL_DLLPRIVATE long ImplLogicWidthToDevicePixel( long nWidth ) const; - SAL_DLLPRIVATE long ImplLogicHeightToDevicePixel( long nHeight ) const; - SAL_DLLPRIVATE long ImplDevicePixelToLogicWidth( long nWidth ) const; - SAL_DLLPRIVATE long ImplDevicePixelToLogicHeight( long nHeight ) const; - SAL_DLLPRIVATE float ImplFloatLogicHeightToDevicePixel( float ) const; - SAL_DLLPRIVATE Point ImplLogicToDevicePixel( const Point& rLogicPt ) const; - SAL_DLLPRIVATE Size ImplLogicToDevicePixel( const Size& rLogicSize ) const; - SAL_DLLPRIVATE Rectangle ImplLogicToDevicePixel( const Rectangle& rLogicRect ) const; - SAL_DLLPRIVATE ::basegfx::B2DPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolygon& ) const; - SAL_DLLPRIVATE ::basegfx::B2DPolyPolygon ImplLogicToDevicePixel( const ::basegfx::B2DPolyPolygon& ) const; - SAL_DLLPRIVATE Polygon ImplLogicToDevicePixel( const Polygon& rLogicPoly ) const; - SAL_DLLPRIVATE PolyPolygon ImplLogicToDevicePixel( const PolyPolygon& rLogicPolyPoly ) const; - SAL_DLLPRIVATE LineInfo ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const; - SAL_DLLPRIVATE Rectangle ImplDevicePixelToLogic( const Rectangle& rLogicRect ) const; - SAL_DLLPRIVATE Region ImplPixelToDevicePixel( const Region& rRegion ) const; - SAL_DLLPRIVATE void ImplInvalidateViewTransform(); - SAL_DLLPRIVATE basegfx::B2DHomMatrix ImplGetDeviceTransformation() const; + /** @name Line functions + */ + ///@{ + SAL_DLLPRIVATE void ImplInitLineColor(); + SAL_DLLPRIVATE void ImplInitFillColor(); + + // #i101491# + // Helper which holds the old line geometry creation and is extended to use AA when + // switched on. Advantage is that line geometry is only temporarily used for paint + SAL_DLLPRIVATE void ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo); + + // #i101491# + // Helper who tries to use SalGDI's DrawPolyLine direct and returns it's bool. Contains no AA check. + SAL_DLLPRIVATE bool ImpTryDrawPolyLineDirect( + const basegfx::B2DPolygon& rB2DPolygon, + double fLineWidth = 0.0, + double fTransparency = 0.0, + basegfx::B2DLineJoin eLineJoin = basegfx::B2DLINEJOIN_NONE, + css::drawing::LineCap eLineCap = css::drawing::LineCap_BUTT); + + // Helper for line geometry paint with support for graphic expansion (pattern and fat_to_area) + void impPaintLineGeometryWithEvtlExpand(const LineInfo& rInfo, basegfx::B2DPolyPolygon aLinePolyPolygon); + ///@} + /** @name Polygon functions + */ + ///@{ SAL_DLLPRIVATE void ImplDrawPolygon( const Polygon& rPoly, const PolyPolygon* pClipPolyPoly = NULL ); SAL_DLLPRIVATE void ImplDrawPolyPolygon( const PolyPolygon& rPolyPoly, const PolyPolygon* pClipPolyPoly = NULL ); SAL_DLLPRIVATE void ImplDrawPolyPolygon( sal_uInt16 nPoly, const PolyPolygon& rPolyPoly ); + // #i101491# + // Helper who implements the DrawPolyPolygon functionality for basegfx::B2DPolyPolygon + // without MetaFile processing + SAL_DLLPRIVATE void ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly); + + + ///@} + + /** @name Gradient functions + */ + ///@{ SAL_DLLPRIVATE void ImplDrawLinearGradient( const Rectangle& rRect, const Gradient& rGradient, sal_Bool bMtf, const PolyPolygon* pClipPolyPoly ); SAL_DLLPRIVATE void ImplDrawComplexGradient( const Rectangle& rRect, const Gradient& rGradient, sal_Bool bMtf, const PolyPolygon* pClipPolyPoly ); + ///@} + /** @name Hatch functions + */ + ///@{ SAL_DLLPRIVATE void ImplDrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch, sal_Bool bMtf ); SAL_DLLPRIVATE void ImplCalcHatchValues( const Rectangle& rRect, long nDist, sal_uInt16 nAngle10, Point& rPt1, Point& rPt2, Size& rInc, Point& rEndPt1 ); SAL_DLLPRIVATE void ImplDrawHatchLine( const Line& rLine, const PolyPolygon& rPolyPoly, Point* pPtBuffer, sal_Bool bMtf ); + ///@} + /** @name Wallpaper functions + */ + ///@{ SAL_DLLPRIVATE void ImplDrawWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ); SAL_DLLPRIVATE void ImplDrawColorWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ); SAL_DLLPRIVATE void ImplDrawBitmapWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ); SAL_DLLPRIVATE void ImplDrawGradientWallpaper( long nX, long nY, long nWidth, long nHeight, const Wallpaper& rWallpaper ); + ///@} - SAL_DLLPRIVATE void ImplDrawOutDevDirect( const OutputDevice* pSrcDev, SalTwoRect& rPosAry ); - SAL_DLLPRIVATE void ImplDrawBitmap( const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel, - const Bitmap& rBitmap, const sal_uLong nAction ); - SAL_DLLPRIVATE void ImplDrawBitmapEx( const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel, - const BitmapEx& rBitmapEx, const sal_uLong nAction ); - SAL_DLLPRIVATE void ImplDrawMask( const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel, - const Bitmap& rBitmap, const Color& rMaskColor, - const sal_uLong nAction ); - SAL_DLLPRIVATE void ImplDrawAlpha( const Bitmap& rBmp, const AlphaMask& rAlpha, - const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel ); - SAL_DLLPRIVATE Bitmap ImplBlend( Bitmap aBmp, - BitmapReadAccess* pP, - BitmapReadAccess* pA, - const sal_Int32 nOffY, - const sal_Int32 nDstHeight, - const sal_Int32 nOffX, - const sal_Int32 nDstWidth, - const Rectangle& aBmpRect, - const Size& aOutSz, - const bool bHMirr, - const bool bVMirr, - const long* pMapX, - const long* pMapY ); - SAL_DLLPRIVATE Bitmap ImplBlendWithAlpha( Bitmap aBmp, - BitmapReadAccess* pP, - BitmapReadAccess* pA, - const Rectangle& aDstRect, - const sal_Int32 nOffY, - const sal_Int32 nDstHeight, - const sal_Int32 nOffX, - const sal_Int32 nDstWidth, - const long* pMapX, - const long* pMapY ); - SAL_DLLPRIVATE void ImplPrintTransparent( const Bitmap& rBmp, const Bitmap& rMask, - const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel ); - SAL_DLLPRIVATE void ImplPrintMask( const Bitmap& rMask, const Color& rMaskColor, - const Point& rDestPt, const Size& rDestSize, - const Point& rSrcPtPixel, const Size& rSrcSizePixel ); - SAL_DLLPRIVATE void ImplDrawFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize, - const OutputDevice& rOutDev, const Region& rRegion ); - SAL_DLLPRIVATE void ImplGetFrameDev( const Point& rPt, const Point& rDevPt, const Size& rDevSize, - OutputDevice& rOutDev ); - + /** @name Bitmap functions + */ + ///@{ + SAL_DLLPRIVATE void ImplDrawOutDevDirect ( const OutputDevice* pSrcDev, SalTwoRect& rPosAry ); + SAL_DLLPRIVATE void ImplDrawBitmap ( const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel, + const Bitmap& rBitmap, const sal_uLong nAction ); + SAL_DLLPRIVATE void ImplDrawBitmapEx ( const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel, + const BitmapEx& rBitmapEx, const sal_uLong nAction ); + SAL_DLLPRIVATE void ImplDrawMask ( const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel, + const Bitmap& rBitmap, const Color& rMaskColor, + const sal_uLong nAction ); + SAL_DLLPRIVATE void ImplDrawAlpha ( const Bitmap& rBmp, const AlphaMask& rAlpha, + const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel ); + SAL_DLLPRIVATE Bitmap ImplBlend ( Bitmap aBmp, + BitmapReadAccess* pP, + BitmapReadAccess* pA, + const sal_Int32 nOffY, + const sal_Int32 nDstHeight, + const sal_Int32 nOffX, + const sal_Int32 nDstWidth, + const Rectangle& aBmpRect, + const Size& aOutSz, + const bool bHMirr, + const bool bVMirr, + const long* pMapX, + const long* pMapY ); + SAL_DLLPRIVATE Bitmap ImplBlendWithAlpha ( Bitmap aBmp, + BitmapReadAccess* pP, + BitmapReadAccess* pA, + const Rectangle& aDstRect, + const sal_Int32 nOffY, + const sal_Int32 nDstHeight, + const sal_Int32 nOffX, + const sal_Int32 nDstWidth, + const long* pMapX, + const long* pMapY ); + SAL_DLLPRIVATE void ImplPrintTransparent ( const Bitmap& rBmp, const Bitmap& rMask, + const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel ); + SAL_DLLPRIVATE void ImplPrintMask ( const Bitmap& rMask, const Color& rMaskColor, + const Point& rDestPt, const Size& rDestSize, + const Point& rSrcPtPixel, const Size& rSrcSizePixel ); + SAL_DLLPRIVATE Color ImplDrawModeToColor ( const Color& rColor ) const; + ///@} + + /** @name Frame functions + */ + ///@{ + SAL_DLLPRIVATE void ImplGetFrameDev ( const Point& rPt, const Point& rDevPt, const Size& rDevSize, + OutputDevice& rOutDev ); + SAL_DLLPRIVATE void ImplDrawFrameDev ( const Point& rPt, const Point& rDevPt, const Size& rDevSize, + const OutputDevice& rOutDev, const Region& rRegion ); + ///@} + + /** @name Layout functions + */ + ///@{ SAL_DLLPRIVATE sal_Bool ImplIsRecordLayout() const; - - SAL_DLLPRIVATE static FontEmphasisMark ImplGetEmphasisMarkStyle( const Font& rFont ); - SAL_DLLPRIVATE static sal_Bool ImplIsUnderlineAbove( const Font& ); - + SAL_DLLPRIVATE bool ImplHasMirroredGraphics() const; + SAL_DLLPRIVATE void ImplReMirror( Point &rPoint ) const; + SAL_DLLPRIVATE void ImplReMirror( Rectangle &rRect ) const; + SAL_DLLPRIVATE void ImplReMirror( Region &rRegion ) const; + SAL_DLLPRIVATE SalLayout* ImplLayout( const OUString&, sal_Int32 nIndex, sal_Int32 nLen, + const Point& rLogicPos = Point(0,0), long nLogicWidth=0, + const sal_Int32* pLogicDXArray=NULL, bool bFilter = false ) const; + SAL_DLLPRIVATE ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen, + long nPixelWidth, const sal_Int32* pPixelDXArray ) const; + SAL_DLLPRIVATE SalLayout* ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const; // tells whether this output device is RTL in an LTR UI or LTR in a RTL UI SAL_DLLPRIVATE bool ImplIsAntiparallel() const ; - SAL_DLLPRIVATE Color ImplDrawModeToColor( const Color& rColor ) const; - - // #i101491# - // Helper which holds the old line geometry creation and is extended to use AA when - // switched on. Advantage is that line geometry is only temporarily used for paint - SAL_DLLPRIVATE void ImpDrawPolyLineWithLineInfo(const Polygon& rPoly, const LineInfo& rLineInfo); - - // #i101491# - // Helper who implements the DrawPolyPolygon functionality for basegfx::B2DPolyPolygon - // without MetaFile processing - SAL_DLLPRIVATE void ImpDrawPolyPolygonWithB2DPolyPolygon(const basegfx::B2DPolyPolygon& rB2DPolyPoly); - - // #i101491# - // Helper who tries to use SalGDI's DrawPolyLine direct and returns it's bool. Contains no AA check. - SAL_DLLPRIVATE bool ImpTryDrawPolyLineDirect( - const basegfx::B2DPolygon& rB2DPolygon, - double fLineWidth = 0.0, - double fTransparency = 0.0, - basegfx::B2DLineJoin eLineJoin = basegfx::B2DLINEJOIN_NONE, - css::drawing::LineCap eLineCap = css::drawing::LineCap_BUTT); - - // Helper for line geometry paint with support for graphic expansion (pattern and fat_to_area) - void impPaintLineGeometryWithEvtlExpand(const LineInfo& rInfo, basegfx::B2DPolyPolygon aLinePolyPolygon); - SAL_DLLPRIVATE SalLayout* getFallbackFont(ImplFontEntry &rFallbackFont, FontSelectPattern &rFontSelData, int nFallbackLevel, ImplLayoutArgs& rLayoutArgs) const; + + ///@} + protected: OutputDevice();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits