Kaydet (Commit) a8445614 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Don't include vcl's private include files in desktop

Introduce a handful of small public wrapper functions.

Change-Id: I80e1e35d09675112d67b831f3efda483e709b540
üst 1dc47816
...@@ -14,7 +14,6 @@ $(eval $(call gb_Library_set_include,sofficeapp,\ ...@@ -14,7 +14,6 @@ $(eval $(call gb_Library_set_include,sofficeapp,\
-I$(SRCDIR)/desktop/inc \ -I$(SRCDIR)/desktop/inc \
-I$(SRCDIR)/desktop/source/inc \ -I$(SRCDIR)/desktop/source/inc \
-I$(SRCDIR)/desktop/source/deployment/inc \ -I$(SRCDIR)/desktop/source/deployment/inc \
-I$(SRCDIR)/vcl/inc \
)) ))
$(eval $(call gb_Library_add_libs,sofficeapp,\ $(eval $(call gb_Library_add_libs,sofficeapp,\
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <com/sun/star/ucb/XUniversalContentBroker.hpp> #include <com/sun/star/ucb/XUniversalContentBroker.hpp>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/svpforlokit.hxx>
#include <tools/resmgr.hxx> #include <tools/resmgr.hxx>
#include <tools/fract.hxx> #include <tools/fract.hxx>
#include <vcl/graphicfilter.hxx> #include <vcl/graphicfilter.hxx>
...@@ -52,15 +53,6 @@ ...@@ -52,15 +53,6 @@
#include <app.hxx> #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" #include "../app/cmdlineargs.hxx"
// We also need to hackily be able to start the main libreoffice thread: // We also need to hackily be able to start the main libreoffice thread:
#include "../app/sofficemain.h" #include "../app/sofficemain.h"
...@@ -613,9 +605,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis, ...@@ -613,9 +605,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
#if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS) #if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
#ifndef IOS #ifndef IOS
ImplSVData* pSVData = ImplGetSVData(); InitSvpForLibreOfficeKit();
SvpSalInstance* pSalInstance = static_cast< SvpSalInstance* >(pSVData->mpDefInst);
pSalInstance->setBitCountFormatMapping( 32, ::basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA );
VirtualDevice aDevice(0, Size(1, 1), (sal_uInt16)32); VirtualDevice aDevice(0, Size(1, 1), (sal_uInt16)32);
boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() ); boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
...@@ -626,10 +616,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis, ...@@ -626,10 +616,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight, pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
nTilePosX, nTilePosY, nTileWidth, nTileHeight); nTilePosX, nTilePosY, nTileWidth, nTileHeight);
SvpSalVirtualDevice* pSalDev = static_cast< SvpSalVirtualDevice* >(aDevice.getSalVirtualDevice()); *pRowStride = GetRowStrideForLibreOfficeKit(aDevice.getSalVirtualDevice());
basebmp::BitmapDeviceSharedPtr pBmpDev = pSalDev->getBitmapDevice();
*pRowStride = pBmpDev->getScanlineStride();
#else #else
SystemGraphicsData aData; SystemGraphicsData aData;
aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer); aData.rCGContext = reinterpret_cast<CGContextRef>(pBuffer);
...@@ -710,16 +697,16 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis, ...@@ -710,16 +697,16 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
static void doc_postKeyEvent(LibreOfficeKitDocument* /*pThis*/, int nType, int nCharCode, int nKeyCode) static void doc_postKeyEvent(LibreOfficeKitDocument* /*pThis*/, int nType, int nCharCode, int nKeyCode)
{ {
#if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS) #if defined(UNX) && !defined(MACOSX) && !defined(ENABLE_HEADLESS)
if (SalFrame *pFocus = SvpSalFrame::GetFocusFrame()) if (SalFrame *pFocus = GetSvpFocusFrameForLibreOfficeKit())
{ {
KeyEvent aEvent(nCharCode, nKeyCode, 0); KeyEvent aEvent(nCharCode, nKeyCode, 0);
switch (nType) switch (nType)
{ {
case LOK_KEYEVENT_KEYINPUT: case LOK_KEYEVENT_KEYINPUT:
Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, pFocus->GetWindow(), &aEvent); Application::PostKeyEvent(VCLEVENT_WINDOW_KEYINPUT, GetSalFrameWindowForLibreOfficeKit(pFocus), &aEvent);
break; break;
case LOK_KEYEVENT_KEYUP: case LOK_KEYEVENT_KEYUP:
Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, pFocus->GetWindow(), &aEvent); Application::PostKeyEvent(VCLEVENT_WINDOW_KEYUP, GetSalFrameWindowForLibreOfficeKit(pFocus), &aEvent);
break; break;
} }
} }
......
/* -*- 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: */
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
*/ */
#include <string.h> #include <string.h>
#include "vcl/syswin.hxx" #include <vcl/svpforlokit.hxx>
#include <vcl/syswin.hxx>
#include "headless/svpframe.hxx" #include "headless/svpframe.hxx"
#include "headless/svpinst.hxx" #include "headless/svpinst.hxx"
#include "headless/svpgdi.hxx" #include "headless/svpgdi.hxx"
...@@ -493,4 +495,14 @@ void SvpSalFrame::EndSetClipRegion() ...@@ -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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#ifndef IOS #ifndef IOS
#include <vcl/svpforlokit.hxx>
#include "headless/svpbmp.hxx" #include "headless/svpbmp.hxx"
#include "headless/svpinst.hxx" #include "headless/svpinst.hxx"
#include "headless/svpvd.hxx" #include "headless/svpvd.hxx"
...@@ -95,6 +97,21 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, ...@@ -95,6 +97,21 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
return true; 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 #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -58,7 +58,7 @@ class VCL_DLLPUBLIC SvpSalFrame : public SalFrame ...@@ -58,7 +58,7 @@ class VCL_DLLPUBLIC SvpSalFrame : public SalFrame
std::list< SvpSalGraphics* > m_aGraphics; std::list< SvpSalGraphics* > m_aGraphics;
SAL_DLLPUBLIC_EXPORT static SvpSalFrame* s_pFocusFrame; static SvpSalFrame* s_pFocusFrame;
public: public:
SvpSalFrame( SvpSalInstance* pInstance, SvpSalFrame( SvpSalInstance* pInstance,
SalFrame* pParent, SalFrame* pParent,
...@@ -136,7 +136,7 @@ public: ...@@ -136,7 +136,7 @@ public:
virtual void SetApplicationID(const OUString &rApplicationID) SAL_OVERRIDE { (void) rApplicationID; } virtual void SetApplicationID(const OUString &rApplicationID) SAL_OVERRIDE { (void) rApplicationID; }
bool IsVisible() { return m_bVisible; } bool IsVisible() { return m_bVisible; }
SAL_DLLPUBLIC_EXPORT static SvpSalFrame* GetFocusFrame() { return s_pFocusFrame; } static SvpSalFrame* GetFocusFrame() { return s_pFocusFrame; }
}; };
......
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