[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 3 commits - vcl/unx
Katarina Behrens
Katarina.Behrens at cib.de
Fri Apr 13 13:23:27 UTC 2018
Rebased ref, commits from common ancestor:
commit fcfea920058b32c455a7624bc5c6ccfec67159b6
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Apr 13 15:18:42 2018 +0200
Use Acquire/ReleaseGraphics from base class
also use SalFrame as argument and retval of CreateFrame
Change-Id: Ie5d15ee672aaa60279db5d7ad0743d3ac0037ec1
diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx
index a6ac52350da5..ffee47165a37 100644
--- a/vcl/unx/kde5/KDE5SalFrame.cxx
+++ b/vcl/unx/kde5/KDE5SalFrame.cxx
@@ -310,20 +310,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();
@@ -334,33 +320,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++ )
diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx
index 3be72142ab95..c939141ec4e0 100644
--- a/vcl/unx/kde5/KDE5SalFrame.hxx
+++ b/vcl/unx/kde5/KDE5SalFrame.hxx
@@ -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;
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index dcf167312a75..7170dfca5da9 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -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(
diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kde5/KDE5SalInstance.hxx
index 74d36e94b297..b0d940204cc0 100644
--- a/vcl/unx/kde5/KDE5SalInstance.hxx
+++ b/vcl/unx/kde5/KDE5SalInstance.hxx
@@ -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; }
commit 1de1cbfd045db3f3a927b043372bdd6d3cc1032f
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Apr 11 15:50:35 2018 +0200
Remove some virtual funcs implemented in the base class
diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx
index 2938a7b69fe0..a6ac52350da5 100644
--- a/vcl/unx/kde5/KDE5SalFrame.cxx
+++ b/vcl/unx/kde5/KDE5SalFrame.cxx
@@ -52,17 +52,6 @@ KDE5SalFrame::KDE5SalFrame( KDE5SalFrame* pParent, SalFrameStyleFlags nState, bo
{
}
-void KDE5SalFrame::Show( bool bVisible, bool bNoActivate )
-{
- if ( !GetParent() /*&& ! (GetStyle() & SalFrameStyleFlags::INTRO)*/ )
- {
- KDE5XLib* pXLib = new KDE5XLib();//static_cast<KDE5XLib*>(GetDisplay()->GetXLib());
- pXLib->doStartup();
- }
-
- //X11SalFrame::Show( bVisible, bNoActivate );
-}
-
/** Helper function to convert colors.
*/
static Color toColor( const QColor &rColor )
diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx
index 485c909653f3..3be72142ab95 100644
--- a/vcl/unx/kde5/KDE5SalFrame.hxx
+++ b/vcl/unx/kde5/KDE5SalFrame.hxx
@@ -58,60 +58,16 @@ class KDE5SalFrame : public Qt5Frame
virtual void ReleaseGraphics( SalGraphics *pGraphics ) override;
void updateGraphics( bool bClear );
virtual void UpdateSettings( AllSettings& rSettings ) override;
- virtual void Show( bool bVisible, bool bNoActivate = false ) override;
- virtual bool PostEvent(ImplSVEvent* pData) override { return false; }
-
- virtual void SetTitle( const OUString& rTitle ) override { return; }
- virtual void SetIcon( sal_uInt16 nIcon ) override { return; }
-
- virtual void SetMenu( SalMenu *pSalMenu ) override { return; }
virtual void DrawMenuBar() override { return; }
- virtual void SetExtendedFrameStyle( SalExtStyle nExtStyle ) override { return; }
- virtual void SetMinClientSize( long nWidth, long nHeight ) override { return; }
- virtual void SetMaxClientSize( long nWidth, long nHeight ) override { return; }
-
- virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) override { return; }
- virtual void GetClientSize( long& rWidth, long& rHeight ) override { return; }
- virtual void GetWorkArea( tools::Rectangle& rRect ) override { return; }
- virtual SalFrame* GetParent() const override { return nullptr; }
- virtual void SetWindowState( const SalFrameState* pState ) override { return; }
- virtual bool GetWindowState( SalFrameState* pState ) override { return false; }
- virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) override { return; }
- virtual void StartPresentation( bool bStart ) override { return; }
- virtual void SetAlwaysOnTop( bool bOnTop ) override { return; }
-
- virtual void ToTop( SalFrameToTop nFlags ) override { return; }
- virtual void SetPointer( PointerStyle ePointerStyle ) override { return; }
- virtual void CaptureMouse( bool bMouse ) override { return; }
- virtual void SetPointerPos( long nX, long nY ) override { return; }
-
- virtual void SetInputContext( SalInputContext* pContext ) override { return; }
- virtual void EndExtTextInput( EndExtTextInputFlags nFlags ) override { return; }
- virtual OUString GetKeyName( sal_uInt16 nKeyCode ) override { return OUString(); }
- virtual bool MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) override { return false; }
-
virtual LanguageType GetInputLanguage() override { return LANGUAGE_SYSTEM; }
virtual void Beep() override { return; }
virtual const SystemEnvData* GetSystemData() const override { return nullptr; }
virtual SalPointerState GetPointerState() override { return SalPointerState(); }
virtual KeyIndicatorState GetIndicatorState() override { return KeyIndicatorState(); }
- virtual void SimulateKeyPress( sal_uInt16 nKeyCode ) override { return; }
-
- // set new parent window
- virtual void SetParent( SalFrame* pNewParent ) override { return; }
- virtual bool SetPluginParent( SystemParentData* pNewParent ) override { return false; }
virtual void SetScreenNumber( unsigned int ) override { return; }
- virtual void SetApplicationID( const OUString &rWMClass ) override { return; }
-
- virtual void ResetClipRegion() override { return; }
- virtual void BeginSetClipRegion( sal_uLong nRects ) override { return; }
- virtual void UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) override { return; }
- virtual void EndSetClipRegion() override { return; }
-
- virtual void Flush() override { return; }
cairo_t* getCairoContext() const;
};
commit 624556b83a46be9cb0a0cc865bf4ca05697c9e27
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Apr 13 11:32:44 2018 +0200
Remove unused headers and commented-out code
Change-Id: I8dee846d9499f1549f5e61deaad885b93d2f5438
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index b5ce3f812c72..dcf167312a75 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -23,7 +23,6 @@
#include <QtWidgets/QApplication>
#include <QtGui/QClipboard>
#include <QtWidgets/QFrame>
-#include <QtX11Extras/QX11Info>
#include <osl/process.h>
#include <qt5/Qt5Data.hxx>
@@ -59,11 +58,6 @@ uno::Reference< ui::dialogs::XFilePicker2 > KDE5SalInstance::createFilePicker(
return SalInstance::createFilePicker( xMSF );
}
-/*SalX11Display* KDE5SalInstance::CreateDisplay() const
-{
- return new SalKDE5Display( QX11Info::display() );
-}*/
-
bool KDE5SalInstance::IsMainThread() const
{
return qApp->thread() == QThread::currentThread();
diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kde5/KDE5SalInstance.hxx
index 7b549a18c08d..74d36e94b297 100644
--- a/vcl/unx/kde5/KDE5SalInstance.hxx
+++ b/vcl/unx/kde5/KDE5SalInstance.hxx
@@ -19,7 +19,6 @@
#pragma once
-#include <headless/svpinst.hxx>
#include <qt5/Qt5Instance.hxx>
#include "KDE5SalFrame.hxx"
@@ -29,10 +28,6 @@ class KDE5XLib;
class KDE5SalInstance : public Qt5Instance
{
-
-protected:
- //SalX11Display* CreateDisplay() const;
-
public:
explicit KDE5SalInstance(SalYieldMutex* pMutex);
virtual KDE5SalFrame* CreateFrame( KDE5SalFrame* pParent, SalFrameStyleFlags nStyle );
More information about the Libreoffice-commits
mailing list