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

vcl: Move constructor and graphics functions to top of window.cxx

Change-Id: I9a2337eb5fb4a54cebe810e1bc2de2678a4b18b0
üst bb6f5654
...@@ -280,6 +280,32 @@ WindowImpl::~WindowImpl() ...@@ -280,6 +280,32 @@ WindowImpl::~WindowImpl()
delete mpControlFont; 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 #ifdef DBG_UTIL
const char* ImplDbgCheckWindow( const void* pObj ) const char* ImplDbgCheckWindow( const void* pObj )
{ {
...@@ -370,6 +396,38 @@ bool Window::AcquireGraphics() const ...@@ -370,6 +396,38 @@ bool Window::AcquireGraphics() const
return mpGraphics ? true : false; 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() void Window::InitClipRegion()
{ {
DBG_TESTSOLARMUTEX(); DBG_TESTSOLARMUTEX();
...@@ -459,38 +517,6 @@ void Window::ClipToPaintRegion(Rectangle& rDstRect) ...@@ -459,38 +517,6 @@ void Window::ClipToPaintRegion(Rectangle& rDstRect)
rDstRect.Intersection(LogicToPixel(aPaintRgn.GetBoundRect())); 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 bool Window::HasMirroredGraphics() const
{ {
const OutputDevice* pOutDev = GetOutDev(); const OutputDevice* pOutDev = GetOutDev();
...@@ -4255,31 +4281,6 @@ void Window::ImplNewInputContext() ...@@ -4255,31 +4281,6 @@ void Window::ImplNewInputContext()
pFocusWin->mpFontCache->Release( pFontEntry ); 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 #if OSL_DEBUG_LEVEL > 0
namespace namespace
{ {
......
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