[Libreoffice-commits] core.git: Branch 'feature/kde5' - 2 commits - vcl/unx
Katarina Behrens
Katarina.Behrens at cib.de
Mon Sep 25 12:01:54 UTC 2017
vcl/unx/kde5/KDE5SalFrame.cxx | 8 ++++----
vcl/unx/kde5/KDE5SalFrame.hxx | 9 ++++++++-
vcl/unx/kde5/KDE5SalGraphics.cxx | 17 ++++++++++++-----
vcl/unx/kde5/KDE5SalGraphics.hxx | 9 ++++++++-
4 files changed, 32 insertions(+), 11 deletions(-)
New commits:
commit 5515eadef1415bba3a1ea897bf70dcef4435052d
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Sep 25 14:00:31 2017 +0200
Convert KDE5SalGraphics to SvpSalGraphics
Change-Id: Id30494fa1b01510e300f39b985b3a49ea58d81bc
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 <unx/salframe.h>
#include <unx/salgdi.h>
+#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<X11SalGraphics> pGraphics;
+ std::unique_ptr<KDE5SalGraphics> 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 <vcl/settings.hxx>
@@ -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 <rtl/string.hxx>
#include <unx/saldisp.hxx>
#include <unx/salgdi.h>
+#include <headless/svpgdi.hxx>
#include <QtGui/QImage>
+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<QImage> m_image;
QRect lastPopupRect;
};
commit 626481ed5a96cd5e6033c7539d9769844bcb96ba
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Sep 22 15:24:30 2017 +0200
Rename KDESalGraphics too
Change-Id: I1a1625428cca0be7ece5fb4604aaacef4967a405
diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx
index 28f47f860015..73eb097bacc9 100644
--- a/vcl/unx/kde5/KDE5SalFrame.cxx
+++ b/vcl/unx/kde5/KDE5SalFrame.cxx
@@ -367,7 +367,7 @@ SalGraphics* KDE5SalFrame::AcquireGraphics()
m_aGraphics[i].bInUse = true;
if( ! m_aGraphics[i].pGraphics )
{
- m_aGraphics[i].pGraphics.reset( new KDESalGraphics );
+ m_aGraphics[i].pGraphics.reset( new KDE5SalGraphics );
m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() );
}
return m_aGraphics[i].pGraphics.get();
diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 85642f6f91df..9419dff1e018 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -70,7 +70,7 @@ QRect region2QRect( const tools::Rectangle& rControlRegion )
return QRect(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.GetWidth(), rControlRegion.GetHeight());
}
-bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
+bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
{
switch (type)
{
@@ -197,7 +197,7 @@ static QRegion XRegionToQRegion( Region xr )
}
#endif
-bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
+bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part,
const tools::Rectangle& rControlRegion, ControlState nControlState,
const ImplControlValue& value,
const OUString& )
@@ -661,7 +661,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
return returnVal;
}
-bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
+bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
const tools::Rectangle& controlRegion, ControlState controlState,
const ImplControlValue& val,
const OUString&,
@@ -974,7 +974,7 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
aPos was or was not inside the native widget specified by the
nType/nPart combination.
*/
-bool KDESalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
+bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
const tools::Rectangle& rControlRegion, const Point& rPos,
bool& rIsInside )
{
diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx
index eb513388f369..811e4953c323 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.hxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.hxx
@@ -30,7 +30,7 @@
/**
* Handles native graphics requests and performs the needed drawing operations.
*/
-class KDESalGraphics : public X11SalGraphics
+class KDE5SalGraphics : public X11SalGraphics
{
public:
virtual bool IsNativeControlSupported( ControlType, ControlPart ) override;
More information about the Libreoffice-commits
mailing list