Kaydet (Commit) 3d0cc7d6 authored tarafından Katarina Behrens's avatar Katarina Behrens

Use Acquire/ReleaseGraphics from base class

also use SalFrame as argument and retval of CreateFrame

Change-Id: Ie5d15ee672aaa60279db5d7ad0743d3ac0037ec1
üst 20f8079c
......@@ -311,20 +311,6 @@ void KDE5SalFrame::UpdateSettings( AllSettings& rSettings )
rSettings.SetStyleSettings( style );
}
void KDE5SalFrame::ReleaseGraphics( SalGraphics *pGraphics )
{
for( int i = 0; i < nMaxGraphics; i++ )
{
if( m_aGraphics[i].pGraphics.get() == pGraphics )
{
m_aGraphics[i].bInUse = false;
if ( m_aGraphics[i].pSurface != nullptr )
cairo_surface_destroy( m_aGraphics[i].pSurface );
break;
}
}
}
void KDE5SalFrame::updateGraphics( bool bClear )
{
vcl::Window* pWindow = GetWindow();
......@@ -335,33 +321,6 @@ void KDE5SalFrame::updateGraphics( bool bClear )
}
}
SalGraphics* KDE5SalFrame::AcquireGraphics()
{
if( GetWindow() )
{
basegfx::B2IVector aSize( 142, 142 );
for( int i = 0; i < nMaxGraphics; i++ )
{
if( ! m_aGraphics[i].bInUse )
{
m_aGraphics[i].bInUse = true;
if( ! m_aGraphics[i].pGraphics )
{
m_aGraphics[i].pGraphics.reset( new KDE5SalGraphics( this, m_pWindow ) );
//FIXME: those parameters are completely arbitrary, IDK what the right ones should be yet
m_aGraphics[i].pSurface = cairo_image_surface_create( CAIRO_FORMAT_ARGB32, aSize.getX(), aSize.getY() );
m_aGraphics[i].pGraphics->setSurface( m_aGraphics[i].pSurface, aSize );
//m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() );
}
return m_aGraphics[i].pGraphics.get();
}
}
}
return nullptr;
}
cairo_t* KDE5SalFrame::getCairoContext() const
{
for( int i = 0; i < nMaxGraphics; i++ )
......
......@@ -54,8 +54,6 @@ class KDE5SalFrame : public Qt5Frame
public:
KDE5SalFrame( KDE5SalFrame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo );
virtual SalGraphics* AcquireGraphics() override;
virtual void ReleaseGraphics( SalGraphics *pGraphics ) override;
void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings ) override;
......
......@@ -42,9 +42,9 @@ KDE5SalInstance::KDE5SalInstance(SalYieldMutex* pMutex)
pSVData->maAppData.mpToolkitName = new OUString("kde5");
}
KDE5SalFrame* KDE5SalInstance::CreateFrame( KDE5SalFrame *pParent, SalFrameStyleFlags nState )
SalFrame* KDE5SalInstance::CreateFrame( SalFrame *pParent, SalFrameStyleFlags nState )
{
return new KDE5SalFrame( pParent, nState, true );
return new KDE5SalFrame( static_cast<KDE5SalFrame*>(pParent), nState, true );
}
uno::Reference< ui::dialogs::XFilePicker2 > KDE5SalInstance::createFilePicker(
......
......@@ -30,7 +30,7 @@ class KDE5SalInstance : public Qt5Instance
{
public:
explicit KDE5SalInstance(SalYieldMutex* pMutex);
virtual KDE5SalFrame* CreateFrame( KDE5SalFrame* pParent, SalFrameStyleFlags nStyle );
virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle );
virtual bool hasNativeFileSelection() const override { return true; }
......
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