diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-05-11 19:48:54 +1000 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-05-13 08:13:56 +1000 |
commit | 668c6dd0c3e9fa87affe2fa4c6772fb95f19e2ae (patch) | |
tree | ea8295888683ed475ef96abdefaed6655e423733 /vcl | |
parent | bb6f5654521c4d9ce429c831203bada66e4a4807 (diff) |
vcl: Move constructor and graphics functions to top of window.cxx
Change-Id: I9a2337eb5fb4a54cebe810e1bc2de2678a4b18b0
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/window.cxx | 115 |
1 files changed, 58 insertions, 57 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index a8023000b3ea..cdf9ed4a3e9d 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -280,6 +280,32 @@ WindowImpl::~WindowImpl() delete mpControlFont; } +Window::Window( WindowType nType ) +{ + ImplInitWindowData( nType ); +} + +Window::Window( Window* pParent, WinBits nStyle ) +{ + + ImplInitWindowData( WINDOW_WINDOW ); + ImplInit( pParent, nStyle, NULL ); +} + +Window::Window( Window* pParent, const ResId& rResId ) + : mpWindowImpl(NULL) +{ + rResId.SetRT( RSC_WINDOW ); + WinBits nStyle = ImplInitRes( rResId ); + ImplInitWindowData( WINDOW_WINDOW ); + ImplInit( pParent, nStyle, NULL ); + ImplLoadRes( rResId ); + + if ( !(nStyle & WB_HIDE) ) + Show(); +} + + #ifdef DBG_UTIL const char* ImplDbgCheckWindow( const void* pObj ) { @@ -370,6 +396,38 @@ bool Window::AcquireGraphics() const return mpGraphics ? true : false; } +void Window::ReleaseGraphics( bool bRelease ) +{ + DBG_TESTSOLARMUTEX(); + + if ( !mpGraphics ) + return; + + // release the fonts of the physically released graphics device + if( bRelease ) + ImplReleaseFonts(); + + ImplSVData* pSVData = ImplGetSVData(); + + Window* pWindow = (Window*)this; + + if ( bRelease ) + pWindow->mpWindowImpl->mpFrame->ReleaseGraphics( mpGraphics ); + // remove from global LRU list of window graphics + if ( mpPrevGraphics ) + mpPrevGraphics->mpNextGraphics = mpNextGraphics; + else + pSVData->maGDIData.mpFirstWinGraphics = mpNextGraphics; + if ( mpNextGraphics ) + mpNextGraphics->mpPrevGraphics = mpPrevGraphics; + else + pSVData->maGDIData.mpLastWinGraphics = mpPrevGraphics; + + mpGraphics = NULL; + mpPrevGraphics = NULL; + mpNextGraphics = NULL; +} + void Window::InitClipRegion() { DBG_TESTSOLARMUTEX(); @@ -459,38 +517,6 @@ void Window::ClipToPaintRegion(Rectangle& rDstRect) rDstRect.Intersection(LogicToPixel(aPaintRgn.GetBoundRect())); } -void Window::ReleaseGraphics( bool bRelease ) -{ - DBG_TESTSOLARMUTEX(); - - if ( !mpGraphics ) - return; - - // release the fonts of the physically released graphics device - if( bRelease ) - ImplReleaseFonts(); - - ImplSVData* pSVData = ImplGetSVData(); - - Window* pWindow = (Window*)this; - - if ( bRelease ) - pWindow->mpWindowImpl->mpFrame->ReleaseGraphics( mpGraphics ); - // remove from global LRU list of window graphics - if ( mpPrevGraphics ) - mpPrevGraphics->mpNextGraphics = mpNextGraphics; - else - pSVData->maGDIData.mpFirstWinGraphics = mpNextGraphics; - if ( mpNextGraphics ) - mpNextGraphics->mpPrevGraphics = mpPrevGraphics; - else - pSVData->maGDIData.mpLastWinGraphics = mpPrevGraphics; - - mpGraphics = NULL; - mpPrevGraphics = NULL; - mpNextGraphics = NULL; -} - bool Window::HasMirroredGraphics() const { const OutputDevice* pOutDev = GetOutDev(); @@ -4255,31 +4281,6 @@ void Window::ImplNewInputContext() pFocusWin->mpFontCache->Release( pFontEntry ); } -Window::Window( WindowType nType ) -{ - ImplInitWindowData( nType ); -} - -Window::Window( Window* pParent, WinBits nStyle ) -{ - - ImplInitWindowData( WINDOW_WINDOW ); - ImplInit( pParent, nStyle, NULL ); -} - -Window::Window( Window* pParent, const ResId& rResId ) - : mpWindowImpl(NULL) -{ - rResId.SetRT( RSC_WINDOW ); - WinBits nStyle = ImplInitRes( rResId ); - ImplInitWindowData( WINDOW_WINDOW ); - ImplInit( pParent, nStyle, NULL ); - ImplLoadRes( rResId ); - - if ( !(nStyle & WB_HIDE) ) - Show(); -} - #if OSL_DEBUG_LEVEL > 0 namespace { |