vcl/source/gdi/animate.cxx | 26 +++++++++++++------------- vcl/source/gdi/impanmvw.cxx | 27 +++++++++++---------------- vcl/source/gdi/impanmvw.hxx | 34 +++++++++++++++++----------------- 3 files changed, 41 insertions(+), 46 deletions(-)
New commits: commit cc02d84421182c70f1efbb24d1bda749b1f5e422 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue Nov 18 12:02:10 2014 +1100 vcl: rename ImplAnimView functions to more readable names Change-Id: I47e888bcd08cadcbbd3788b264a478c56af4d063 diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx index 7288847..c6f2438 100644 --- a/vcl/source/gdi/animate.cxx +++ b/vcl/source/gdi/animate.cxx @@ -250,12 +250,12 @@ bool Animation::Start( OutputDevice* pOut, const Point& rDestPt, const Size& rDe for( size_t i = 0; i < maViewList.size(); ++i ) { pView = maViewList[ i ]; - if( pView->ImplMatches( pOut, nExtraData ) ) + if( pView->matches( pOut, nExtraData ) ) { - if( pView->ImplGetOutPos() == rDestPt && - pView->ImplGetOutSizePix() == pOut->LogicToPixel( rDestSz ) ) + if( pView->getOutPos() == rDestPt && + pView->getOutSizePix() == pOut->LogicToPixel( rDestSz ) ) { - pView->ImplRepaint(); + pView->repaint(); pMatch = pView; } else @@ -300,7 +300,7 @@ void Animation::Stop( OutputDevice* pOut, long nExtraData ) { ImplAnimView* pView = maViewList[ i ]; - if( pView->ImplMatches( pOut, nExtraData ) ) + if( pView->matches( pOut, nExtraData ) ) { delete pView; maViewList.erase( maViewList.begin() + i ); @@ -369,7 +369,7 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl) // create AInfo-List for( size_t i = 0, n = maViewList.size(); i < n; ++i ) - aAInfoList.push_back( maViewList[ i ]->ImplCreateAInfo() ); + aAInfoList.push_back( maViewList[ i ]->createAInfo() ); maNotifyLink.Call( this ); @@ -387,8 +387,8 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl) else pView = (ImplAnimView*) pAInfo->pViewData; - pView->ImplPause( pAInfo->bPause ); - pView->ImplSetMarked( true ); + pView->pause( pAInfo->bPause ); + pView->setMarked( true ); } // delete AInfo structures @@ -400,17 +400,17 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl) for( size_t i = 0; i < maViewList.size(); ) { pView = maViewList[ i ]; - if( !pView->ImplIsMarked() ) + if( !pView->isMarked() ) { delete pView; maViewList.erase( maViewList.begin() + i ); } else { - if( !pView->ImplIsPause() ) + if( !pView->isPause() ) bGlobalPause = false; - pView->ImplSetMarked( false ); + pView->setMarked( false ); i++; } } @@ -453,9 +453,9 @@ IMPL_LINK_NOARG(Animation, ImplTimeoutHdl) for( size_t i = 0; i < maViewList.size(); ) { pView = maViewList[ i ]; - pView->ImplDraw( mnPos ); + pView->draw( mnPos ); - if( pView->ImplIsMarked() ) + if( pView->isMarked() ) { delete pView; maViewList.erase( maViewList.begin() + i ); diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index 293b148..6fac2e8 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -85,7 +85,7 @@ ImplAnimView::ImplAnimView( Animation* pParent, OutputDevice* pOut, mpBackground->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut ); // Initialize drawing to actual position - ImplDrawToPos( mpParent->ImplGetCurPos() ); + drawToPos( mpParent->ImplGetCurPos() ); // If first frame OutputDevice is set, update variables now for real OutputDevice if( pFirstFrameOutDev ) @@ -100,7 +100,7 @@ ImplAnimView::~ImplAnimView() Animation::ImplDecAnimCount(); } -bool ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const +bool ImplAnimView::matches( OutputDevice* pOut, long nExtraData ) const { bool bRet = false; @@ -115,7 +115,7 @@ bool ImplAnimView::ImplMatches( OutputDevice* pOut, long nExtraData ) const return bRet; } -void ImplAnimView::ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix ) +void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix ) { const Size& rAnmSize = mpParent->GetDisplaySizePixel(); Point aPt2( rAnm.aPosPix.X() + rAnm.aSizePix.Width() - 1L, @@ -152,7 +152,7 @@ void ImplAnimView::ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix, rPosPix.Y() = maSzPix.Height() - 1L - aPt2.Y(); } -void ImplAnimView::ImplDrawToPos( sal_uLong nPos ) +void ImplAnimView::drawToPos( sal_uLong nPos ) { VirtualDevice aVDev; boost::scoped_ptr<vcl::Region> pOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL); @@ -161,7 +161,7 @@ void ImplAnimView::ImplDrawToPos( sal_uLong nPos ) nPos = std::min( nPos, (sal_uLong) mpParent->Count() - 1UL ); for( sal_uLong i = 0UL; i <= nPos; i++ ) - ImplDraw( i, &aVDev ); + draw( i, &aVDev ); if( pOldClip ) mpOut->SetClipRegion( maClip ); @@ -172,18 +172,13 @@ void ImplAnimView::ImplDrawToPos( sal_uLong nPos ) mpOut->SetClipRegion( *pOldClip ); } -void ImplAnimView::ImplDraw( sal_uLong nPos ) -{ - ImplDraw( nPos, NULL ); -} - -void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev ) +void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev ) { Rectangle aOutRect( mpOut->PixelToLogic( Point() ), mpOut->GetOutputSize() ); // check, if output lies out of display if( aOutRect.Intersection( Rectangle( maDispPt, maDispSz ) ).IsEmpty() ) - ImplSetMarked( true ); + setMarked( true ); else if( !mbPause ) { VirtualDevice* pDev; @@ -194,7 +189,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev ) const sal_uLong nLastPos = mpParent->Count() - 1; const AnimationBitmap& rAnm = mpParent->Get( (sal_uInt16) ( mnActPos = std::min( nPos, nLastPos ) ) ); - ImplGetPosSize( rAnm, aPosPix, aSizePix ); + getPosSize( rAnm, aPosPix, aSizePix ); // Mirrored horizontally? if( mbHMirr ) @@ -287,7 +282,7 @@ void ImplAnimView::ImplDraw( sal_uLong nPos, VirtualDevice* pVDev ) } } -void ImplAnimView::ImplRepaint() +void ImplAnimView::repaint() { const bool bOldPause = mbPause; @@ -303,11 +298,11 @@ void ImplAnimView::ImplRepaint() mpBackground->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut ); mbPause = false; - ImplDrawToPos( mnActPos ); + drawToPos( mnActPos ); mbPause = bOldPause; } -AInfo* ImplAnimView::ImplCreateAInfo() const +AInfo* ImplAnimView::createAInfo() const { AInfo* pAInfo = new AInfo; diff --git a/vcl/source/gdi/impanmvw.hxx b/vcl/source/gdi/impanmvw.hxx index 2ee3591..ce49476 100644 --- a/vcl/source/gdi/impanmvw.hxx +++ b/vcl/source/gdi/impanmvw.hxx @@ -54,32 +54,30 @@ private: bool mbHMirr; bool mbVMirr; - void ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix ); - void ImplDraw( sal_uLong nPos, VirtualDevice* pVDev ); - - private: ImplAnimView( Animation* pParent, OutputDevice* pOut, const Point& rPt, const Size& rSz, sal_uLong nExtraData, OutputDevice* pFirstFrameOutDev = NULL ); ~ImplAnimView(); - bool ImplMatches( OutputDevice* pOut, long nExtraData ) const; - void ImplDrawToPos( sal_uLong nPos ); - void ImplDraw( sal_uLong nPos ); - void ImplRepaint(); - AInfo* ImplCreateAInfo() const; + bool matches( OutputDevice* pOut, long nExtraData ) const; + void drawToPos( sal_uLong nPos ); + void draw( sal_uLong nPos, VirtualDevice* pVDev=NULL ); + void repaint(); + AInfo* createAInfo() const; + + void getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix ); - const Point& ImplGetOutPos() const { return maPt; } + const Point& getOutPos() const { return maPt; } - const Size& ImplGetOutSize() const { return maSz; } - const Size& ImplGetOutSizePix() const { return maSzPix; } + const Size& getOutSize() const { return maSz; } + const Size& getOutSizePix() const { return maSzPix; } - void ImplPause( bool bPause ) { mbPause = bPause; } - bool ImplIsPause() const { return mbPause; } + void pause( bool bPause ) { mbPause = bPause; } + bool isPause() const { return mbPause; } - void ImplSetMarked( bool bMarked ) { mbMarked = bMarked; } - bool ImplIsMarked() const { return mbMarked; } + void setMarked( bool bMarked ) { mbMarked = bMarked; } + bool isMarked() const { return mbMarked; } }; #endif commit abce63857daf59fcd9d8287bcf59e784e3b33b98 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue Nov 18 11:46:12 2014 +1100 vcl: make all members of ImplAnimView private I'm making Animation a friend class of ImplAnimView. Nothing should be using ImplAnimView other than Animation - so to enforce this I'm making all member functions private. This is part of general cleanup of vcl's Animation. Change-Id: Ib4746d31c14b1b2caeed61cae99c61fca0e02abc diff --git a/vcl/source/gdi/impanmvw.hxx b/vcl/source/gdi/impanmvw.hxx index bf3545b..2ee3591 100644 --- a/vcl/source/gdi/impanmvw.hxx +++ b/vcl/source/gdi/impanmvw.hxx @@ -31,6 +31,8 @@ class ImplAnimView { private: + friend class Animation; + Animation* mpParent; OutputDevice* mpOut; long mnExtraData; @@ -55,8 +57,8 @@ private: void ImplGetPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size& rSizePix ); void ImplDraw( sal_uLong nPos, VirtualDevice* pVDev ); -public: +private: ImplAnimView( Animation* pParent, OutputDevice* pOut, const Point& rPt, const Size& rSz, sal_uLong nExtraData, OutputDevice* pFirstFrameOutDev = NULL ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits