summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/Library_sofficeapp.mk1
-rw-r--r--desktop/source/lib/init.cxx25
-rw-r--r--include/vcl/svpforlokit.hxx27
-rw-r--r--vcl/headless/svpframe.cxx14
-rw-r--r--vcl/headless/svpvd.cxx17
-rw-r--r--vcl/inc/headless/svpframe.hxx4
6 files changed, 65 insertions, 23 deletions
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 985e55eadfc0..91c7a51abf1e 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -14,7 +14,6 @@ $(eval $(call gb_Library_set_include,sofficeapp,\
-I$(SRCDIR)/desktop/inc \
-I$(SRCDIR)/desktop/source/inc \
-I$(SRCDIR)/desktop/source/deployment/inc \
- -I$(SRCDIR)/vcl/inc \
))
$(eval $(call gb_Library_add_libs,sofficeapp,\
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index df4593f98925..c29223b73baf 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/ucb/XUniversalContentBroker.hpp>
#include <vcl/svapp.hxx>
+#include <vcl/svpforlokit.hxx>
#include <tools/resmgr.hxx>
#include <tools/fract.hxx>
#include <vcl/graphicfilter.hxx>
@@ -52,15 +53,6 @@
#include <app.hxx>
-#if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
-// Let's grab the SvpSalInstance and SvpSalVirtualDevice
-#include <headless/svpinst.hxx>
-#include <headless/svpframe.hxx>
-#include <headless/svpvd.hxx>
-
-#include <basebmp/bitmapdevice.hxx>
-#endif
-
#include "../app/cmdlineargs.hxx"
// We also need to hackily be able to start the main libreoffice thread:
#include "../app/sofficemain.h"
@@ -613,9 +605,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
#if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
#ifndef IOS
- ImplSVData* pSVData = ImplGetSVData();
- SvpSalInstance* pSalInstance = static_cast< SvpSalInstance* >(pSVData->mpDefInst);
- pSalInstance->setBitCountFormatMapping( 32, ::basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA );
+ InitSvpForLibreOfficeKit();
VirtualDevice aDevice(0, Size(1, 1), (sal_uInt16)32);
boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
@@ -626,10 +616,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight);
- SvpSalVirtualDevice* pSalDev = static_cast< SvpSalVirtualDevice* >(aDevice.getSalVirtualDevice());
- basebmp::BitmapDeviceSharedPtr pBmpDev = pSalDev->getBitmapDevice();
-
- *pRowStride = pBmpDev->getScanlineStride();
+ *pRowStride = GetRowStrideForLibreOfficeKit(aDevice.getSalVirtualDevice());
#else
SystemGraphicsData aData;
aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
@@ -710,16 +697,16 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
static void doc_postKeyEvent(LibreOfficeKitDocument* /*pThis*/, int nType, int nCharCode, int nKeyCode)
{
#if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
- if (SalFrame *pFocus = SvpSalFrame::GetFocusFrame())
+ if (SalFrame *pFocus = GetSvpFocusFrameForLibreOfficeKit())
{
KeyEvent aEvent(nCharCode, nKeyCode, 0);
switch (nType)
{
case LOK_KEYEVENT_KEYINPUT:
- Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pFocus->GetWindow(), &aEvent);
+ Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, GetSalFrameWindowForLibreOfficeKit(pFocus), &aEvent);
break;
case LOK_KEYEVENT_KEYUP:
- Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pFocus->GetWindow(), &aEvent);
+ Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, GetSalFrameWindowForLibreOfficeKit(pFocus), &aEvent);
break;
}
}
diff --git a/include/vcl/svpforlokit.hxx b/include/vcl/svpforlokit.hxx
new file mode 100644
index 000000000000..51299eea21d6
--- /dev/null
+++ b/include/vcl/svpforlokit.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_VCL_SVPFORLOKIT_HXX
+#define INCLUDED_VCL_SVPFORLOKIT_HXX
+
+#include <vcl/virdev.hxx>
+#include <vcl/dllapi.h>
+
+// These functions are for use by LibreOfficeKit only, I think
+
+class SalFrame;
+
+VCL_DLLPUBLIC void InitSvpForLibreOfficeKit();
+VCL_DLLPUBLIC int GetRowStrideForLibreOfficeKit(SalVirtualDevice* pVD);
+VCL_DLLPUBLIC SalFrame* GetSvpFocusFrameForLibreOfficeKit();
+VCL_DLLPUBLIC vcl::Window* GetSalFrameWindowForLibreOfficeKit(SalFrame *pSF);
+
+#endif // INCLUDED_VCL_SVPFORLOKIT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx
index 8e56c82f97ac..e1218d7ab3e6 100644
--- a/vcl/headless/svpframe.cxx
+++ b/vcl/headless/svpframe.cxx
@@ -18,7 +18,9 @@
*/
#include <string.h>
-#include "vcl/syswin.hxx"
+#include <vcl/svpforlokit.hxx>
+#include <vcl/syswin.hxx>
+
#include "headless/svpframe.hxx"
#include "headless/svpinst.hxx"
#include "headless/svpgdi.hxx"
@@ -493,4 +495,14 @@ void SvpSalFrame::EndSetClipRegion()
{
}
+SalFrame* GetSvpFocusFrameForLibreOfficeKit()
+{
+ return SvpSalFrame::GetFocusFrame();
+}
+
+vcl::Window* GetSalFrameWindowForLibreOfficeKit(SalFrame *pSF)
+{
+ return pSF->GetWindow();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx
index 84701eb6c459..0daf4cdc0cfb 100644
--- a/vcl/headless/svpvd.cxx
+++ b/vcl/headless/svpvd.cxx
@@ -19,6 +19,8 @@
#ifndef IOS
+#include <vcl/svpforlokit.hxx>
+
#include "headless/svpbmp.hxx"
#include "headless/svpinst.hxx"
#include "headless/svpvd.hxx"
@@ -95,6 +97,21 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
return true;
}
+void InitSvpForLibreOfficeKit()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ SvpSalInstance* pSalInstance = static_cast< SvpSalInstance* >(pSVData->mpDefInst);
+ pSalInstance->setBitCountFormatMapping( 32, ::basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA );
+}
+
+int GetRowStrideForLibreOfficeKit(SalVirtualDevice* pVD)
+{
+ SvpSalVirtualDevice* pSalDev = static_cast< SvpSalVirtualDevice* >(pVD);
+ basebmp::BitmapDeviceSharedPtr pBmpDev = pSalDev->getBitmapDevice();
+
+ return pBmpDev->getScanlineStride();
+}
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/headless/svpframe.hxx b/vcl/inc/headless/svpframe.hxx
index 7bbf73ab1cc0..b07c2163794f 100644
--- a/vcl/inc/headless/svpframe.hxx
+++ b/vcl/inc/headless/svpframe.hxx
@@ -58,7 +58,7 @@ class VCL_DLLPUBLIC SvpSalFrame : public SalFrame
std::list< SvpSalGraphics* > m_aGraphics;
- SAL_DLLPUBLIC_EXPORT static SvpSalFrame* s_pFocusFrame;
+ static SvpSalFrame* s_pFocusFrame;
public:
SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent,
@@ -136,7 +136,7 @@ public:
virtual void SetApplicationID(const OUString &rApplicationID) SAL_OVERRIDE { (void) rApplicationID; }
bool IsVisible() { return m_bVisible; }
- SAL_DLLPUBLIC_EXPORT static SvpSalFrame* GetFocusFrame() { return s_pFocusFrame; }
+ static SvpSalFrame* GetFocusFrame() { return s_pFocusFrame; }
};