From b899ba17b83ca46ce198bb6c0d98cb735e6cefd1 Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Mon, 25 Sep 2017 14:00:31 +0200 Subject: [PATCH] kde5: convert KDE5SalGraphics to SvpSalGraphics Change-Id: Id30494fa1b01510e300f39b985b3a49ea58d81bc --- vcl/unx/kde5/KDE5SalFrame.cxx | 8 ++++---- vcl/unx/kde5/KDE5SalFrame.hxx | 9 ++++++++- vcl/unx/kde5/KDE5SalGraphics.cxx | 9 ++++++++- vcl/unx/kde5/KDE5SalGraphics.hxx | 9 ++++++++- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx index 73eb097bacc9..2419da16e4d4 100644 --- a/vcl/unx/kde5/KDE5SalFrame.cxx +++ b/vcl/unx/kde5/KDE5SalFrame.cxx @@ -351,8 +351,8 @@ void KDE5SalFrame::updateGraphics( bool bClear ) Drawable aDrawable = bClear ? None : GetWindow(); for( int i = 0; i < nMaxGraphics; i++ ) { - if( m_aGraphics[i].bInUse ) - m_aGraphics[i].pGraphics->SetDrawable( aDrawable, GetScreenNumber() ); + /*if( m_aGraphics[i].bInUse ) + m_aGraphics[i].pGraphics->SetDrawable( aDrawable, GetScreenNumber() );*/ } } @@ -367,8 +367,8 @@ SalGraphics* KDE5SalFrame::AcquireGraphics() m_aGraphics[i].bInUse = true; if( ! m_aGraphics[i].pGraphics ) { - m_aGraphics[i].pGraphics.reset( new KDE5SalGraphics ); - m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() ); + m_aGraphics[i].pGraphics.reset( new KDE5SalGraphics( this, m_pWindow ) ); + //m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() ); } return m_aGraphics[i].pGraphics.get(); } diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx index dc77ec6daae5..01539a458abe 100644 --- a/vcl/unx/kde5/KDE5SalFrame.hxx +++ b/vcl/unx/kde5/KDE5SalFrame.hxx @@ -25,6 +25,11 @@ #include #include +#include "KDE5SalGraphics.hxx" + +class QWidget; +class KDE5SalGraphics; + class KDE5SalFrame : public X11SalFrame { private: @@ -32,7 +37,7 @@ class KDE5SalFrame : public X11SalFrame struct GraphicsHolder { - std::unique_ptr pGraphics; + std::unique_ptr pGraphics; bool bInUse; GraphicsHolder() : bInUse( false ) {} @@ -40,6 +45,8 @@ class KDE5SalFrame : public X11SalFrame GraphicsHolder m_aGraphics[ nMaxGraphics ]; + QWidget* m_pWindow; + public: KDE5SalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ); diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 9419dff1e018..a22a695955e2 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -26,7 +26,7 @@ #undef Region -#include "KDE5SalGraphics.hxx" +#include "KDE5SalFrame.hxx" #include "KDE5SalInstance.hxx" #include @@ -70,6 +70,13 @@ QRect region2QRect( const tools::Rectangle& rControlRegion ) return QRect(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.GetWidth(), rControlRegion.GetHeight()); } +KDE5SalGraphics::KDE5SalGraphics( KDE5SalFrame *pFrame, QWidget *pWindow ) + : SvpSalGraphics(), + m_pWindow( pWindow ), + m_pFrame( pFrame ) +{ +} + bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart part ) { switch (type) diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx index 811e4953c323..298d2100fe0f 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.hxx +++ b/vcl/unx/kde5/KDE5SalGraphics.hxx @@ -24,15 +24,19 @@ #include #include #include +#include #include +class KDE5SalFrame; + /** * Handles native graphics requests and performs the needed drawing operations. */ -class KDE5SalGraphics : public X11SalGraphics +class KDE5SalGraphics : public SvpSalGraphics { public: + KDE5SalGraphics( KDE5SalFrame *pFrame, QWidget *pWindow); virtual bool IsNativeControlSupported( ControlType, ControlPart ) override; virtual bool hitTestNativeControl( ControlType, ControlPart, @@ -46,6 +50,9 @@ public: const OUString&, tools::Rectangle&, tools::Rectangle& ) override; private: + QWidget *m_pWindow; + KDE5SalFrame *m_pFrame; + std::unique_ptr m_image; QRect lastPopupRect; };