Kaydet (Commit) 3af4e1a0 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

Implement MacOSX VCL backend as plugin

Change-Id: Ie90af62eff146064c3b066a8f7ca1c3a69f44c39
Reviewed-on: https://gerrit.libreoffice.org/61102
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst 1698debe
......@@ -481,6 +481,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \
AppleRemote \
) \
fps_aqua \
vclplug_osx \
MacOSXSpell \
) \
))
......
......@@ -70,7 +70,7 @@ public:
/** a crude form of life cycle control (called from DeInitVCL; otherwise,
* if the ImplImageTree singleton were destroyed during exit that would
* be too late for the destructors of the bitmaps in maIconCache)*/
void shutdown();
VCL_DLLPUBLIC void shutdown();
};
#endif
......
......@@ -25,7 +25,7 @@
// #i47888# allow for alternative initialization as required for e.g. MacOSX
bool ImplSVMainHook( int* );
int ImplSVMain();
VCL_DLLPUBLIC int ImplSVMain();
VCL_DLLPUBLIC int SVMain();
......
......@@ -555,7 +555,7 @@ public:
SalFrame* ImplGetFrame() const;
SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData();
SAL_DLLPRIVATE vcl::Window* ImplGetWindow();
vcl::Window* ImplGetWindow();
SAL_DLLPRIVATE ImplWinData* ImplGetWinData() const;
SAL_DLLPRIVATE vcl::Window* ImplGetClientWindow() const;
SAL_DLLPRIVATE vcl::Window* ImplGetDlgWindow( sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = nullptr );
......
......@@ -17915,6 +17915,7 @@ vcl/osx/salinst.cxx
vcl/osx/salmenu.cxx
vcl/osx/salnativewidgets.cxx
vcl/osx/salobj.cxx
vcl/osx/salplug.cxx
vcl/osx/salprn.cxx
vcl/osx/salsys.cxx
vcl/osx/saltimer.cxx
......
......@@ -89,22 +89,6 @@ $(eval $(call gb_Library_use_libraries,vcl,\
xmlreader \
))
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_libs,vcl,\
-framework IOKit \
-F/System/Library/PrivateFrameworks \
-framework CoreUI \
-lobjc \
))
endif
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_cxxflags,vcl,\
$(gb_OBJCXXFLAGS) \
))
endif
ifeq ($(ENABLE_JAVA),TRUE)
$(eval $(call gb_Library_use_libraries,vcl,\
jvmaccess \
......@@ -443,8 +427,6 @@ $(eval $(call gb_Library_add_cobjects,vcl,\
vcl/source/filter/jpeg/transupp \
))
# optional parts
vcl_quartz_code= \
vcl/quartz/salbmp \
vcl/quartz/utils \
......@@ -455,100 +437,6 @@ vcl_coretext_code= \
vcl/quartz/ctfonts \
vcl/quartz/salgdi \
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_cxxflags,vcl,\
$(gb_OBJCXXFLAGS) \
))
$(eval $(call gb_Library_add_defs,vcl,\
-DMACOSX_BUNDLE_IDENTIFIER=\"$(MACOSX_BUNDLE_IDENTIFIER)\" \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
$(vcl_coretext_code) \
))
$(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\
ApplicationServices \
))
$(eval $(call gb_Library_add_objcxxobjects,vcl,\
vcl/osx/a11yactionwrapper \
vcl/osx/a11ycomponentwrapper \
vcl/osx/a11yfactory \
vcl/osx/a11yrolehelper \
vcl/osx/a11yselectionwrapper \
vcl/osx/a11ytablewrapper \
vcl/osx/a11ytextattributeswrapper \
vcl/osx/a11ytextwrapper \
vcl/osx/a11yutil \
vcl/osx/a11yvaluewrapper \
vcl/osx/a11ywrapper \
vcl/osx/a11ywrapperbutton \
vcl/osx/a11ywrappercheckbox \
vcl/osx/a11ywrappercombobox \
vcl/osx/a11ywrappergroup \
vcl/osx/a11ywrapperlist \
vcl/osx/a11ywrapperradiobutton \
vcl/osx/a11ywrapperradiogroup \
vcl/osx/a11ywrapperrow \
vcl/osx/a11ywrapperscrollarea \
vcl/osx/a11ywrapperscrollbar \
vcl/osx/a11ywrappersplitter \
vcl/osx/a11ywrapperstatictext \
vcl/osx/a11ywrappertabgroup \
vcl/osx/a11ywrappertextarea \
vcl/osx/a11ywrappertoolbar \
vcl/osx/salnstimer \
vcl/osx/vclnsapp \
vcl/osx/printaccessoryview \
vcl/osx/printview \
vcl/osx/salframeview \
vcl/osx/salnsmenu \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/osx/a11yfocuslistener \
vcl/osx/a11yfocustracker \
vcl/osx/a11ylistener \
vcl/osx/documentfocuslistener \
vcl/osx/saldata \
vcl/osx/salinst \
vcl/osx/salsys \
vcl/osx/saltimer \
vcl/osx/DataFlavorMapping \
vcl/osx/DragActionConversion \
vcl/osx/DragSource \
vcl/osx/DragSourceContext \
vcl/osx/DropTarget \
vcl/osx/HtmlFmtFlt \
vcl/osx/OSXTransferable \
vcl/osx/PictToBmpFlt \
vcl/osx/clipboard \
vcl/osx/service_entry \
$(vcl_quartz_code) \
vcl/quartz/salgdiutils \
vcl/osx/salnativewidgets \
vcl/osx/salprn \
vcl/osx/salframe \
vcl/osx/salmenu \
vcl/osx/salobj \
))
$(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\
$(if $(filter X86_64,$(CPUNAME)),,QuickTime) \
Cocoa \
Carbon \
CoreFoundation \
))
ifneq ($(ENABLE_MACOSX_SANDBOX),TRUE)
$(eval $(call gb_Library_use_libraries,vcl,\
AppleRemote \
))
endif
endif
vcl_headless_code= \
vcl/headless/svpframe \
$(if $(filter-out IOS,$(OS)), \
......@@ -709,6 +597,7 @@ $(eval $(call gb_Library_use_externals,vcl,\
))
endif
ifeq ($(OS),IOS)
$(eval $(call gb_Library_add_cxxflags,vcl,\
$(gb_OBJCXXFLAGS) \
......@@ -727,7 +616,18 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\
))
endif
# OS-specific stuff
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\
Cocoa \
CoreFoundation \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/osx/salplug \
))
endif
ifeq ($(OS),WNT)
$(eval $(call gb_Library_add_exception_objects,vcl,\
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# 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/.
#
# This file incorporates work covered by the following license notice:
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed
# with this work for additional information regarding copyright
# ownership. The ASF licenses this file to you under the Apache
# License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
$(eval $(call gb_Library_Library,vclplug_osx))
$(eval $(call gb_Library_set_include,vclplug_osx,\
$$(INCLUDE) \
-I$(SRCDIR)/vcl/inc \
))
$(eval $(call gb_Library_use_sdk_api,vclplug_osx))
$(eval $(call gb_Library_use_custom_headers,vclplug_osx,\
officecfg/registry \
))
$(eval $(call gb_Library_add_libs,vclplug_osx,\
-framework IOKit \
-F/System/Library/PrivateFrameworks \
-framework CoreUI \
-lobjc \
))
$(eval $(call gb_Library_add_cxxflags,vclplug_osx,\
$(gb_OBJCXXFLAGS) \
))
$(eval $(call gb_Library_use_libraries,vclplug_osx,\
basegfx \
comphelper \
cppu \
cppuhelper \
i18nlangtag \
i18nutil \
sal \
salhelper \
tl \
vcl \
))
$(eval $(call gb_Library_use_externals,vclplug_osx,\
boost_headers \
harfbuzz \
))
ifeq ($(DISABLE_GUI),)
$(eval $(call gb_Library_use_externals,vclplug_osx,\
epoxy \
))
endif
$(eval $(call gb_Library_add_cxxflags,vclplug_osx,\
$(gb_OBJCXXFLAGS) \
))
$(eval $(call gb_Library_add_defs,vclplug_osx,\
-DMACOSX_BUNDLE_IDENTIFIER=\"$(MACOSX_BUNDLE_IDENTIFIER)\" \
))
$(eval $(call gb_Library_add_objcxxobjects,vclplug_osx,\
vcl/osx/a11yactionwrapper \
vcl/osx/a11ycomponentwrapper \
vcl/osx/a11yfactory \
vcl/osx/a11yrolehelper \
vcl/osx/a11yselectionwrapper \
vcl/osx/a11ytablewrapper \
vcl/osx/a11ytextattributeswrapper \
vcl/osx/a11ytextwrapper \
vcl/osx/a11yutil \
vcl/osx/a11yvaluewrapper \
vcl/osx/a11ywrapper \
vcl/osx/a11ywrapperbutton \
vcl/osx/a11ywrappercheckbox \
vcl/osx/a11ywrappercombobox \
vcl/osx/a11ywrappergroup \
vcl/osx/a11ywrapperlist \
vcl/osx/a11ywrapperradiobutton \
vcl/osx/a11ywrapperradiogroup \
vcl/osx/a11ywrapperrow \
vcl/osx/a11ywrapperscrollarea \
vcl/osx/a11ywrapperscrollbar \
vcl/osx/a11ywrappersplitter \
vcl/osx/a11ywrapperstatictext \
vcl/osx/a11ywrappertabgroup \
vcl/osx/a11ywrappertextarea \
vcl/osx/a11ywrappertoolbar \
vcl/osx/printaccessoryview \
vcl/osx/printview \
vcl/osx/salframeview \
vcl/osx/salnsmenu \
vcl/osx/salnstimer \
vcl/osx/vclnsapp \
))
$(eval $(call gb_Library_add_exception_objects,vclplug_osx,\
vcl/osx/DataFlavorMapping \
vcl/osx/DragActionConversion \
vcl/osx/DragSource \
vcl/osx/DragSourceContext \
vcl/osx/DropTarget \
vcl/osx/HtmlFmtFlt \
vcl/osx/OSXTransferable \
vcl/osx/PictToBmpFlt \
vcl/osx/a11yfocuslistener \
vcl/osx/a11yfocustracker \
vcl/osx/a11ylistener \
vcl/osx/clipboard \
vcl/osx/documentfocuslistener \
vcl/osx/saldata \
vcl/osx/salframe \
vcl/osx/salinst \
vcl/osx/salmenu \
vcl/osx/salnativewidgets \
vcl/osx/salobj \
vcl/osx/salprn \
vcl/osx/salsys \
vcl/osx/saltimer \
vcl/osx/service_entry \
vcl/quartz/ctfonts \
vcl/quartz/salbmp \
vcl/quartz/salgdi \
vcl/quartz/salgdicommon \
vcl/quartz/salgdiutils \
vcl/quartz/salvd \
vcl/quartz/utils \
))
$(eval $(call gb_Library_use_system_darwin_frameworks,vclplug_osx,\
ApplicationServices \
Cocoa \
Carbon \
CoreFoundation \
$(if $(filter X86_64,$(CPUNAME)),,QuickTime) \
))
ifneq ($(ENABLE_MACOSX_SANDBOX),TRUE)
$(eval $(call gb_Library_use_libraries,vclplug_osx,\
AppleRemote \
))
endif
# vim: set noet sw=4 ts=4:
......@@ -106,6 +106,7 @@ endif
ifeq ($(OS),MACOSX)
$(eval $(call gb_Module_add_targets,vcl,\
Package_osxres \
Library_vclplug_osx \
))
endif
......
......@@ -20,6 +20,8 @@
#ifndef INCLUDED_VCL_INC_BMPFAST_HXX
#define INCLUDED_VCL_INC_BMPFAST_HXX
#include <vcl/dllapi.h>
class BitmapWriteAccess;
class BitmapReadAccess;
struct BitmapBuffer;
......@@ -29,7 +31,7 @@ struct SalTwoRect;
// the bmpfast functions have signatures with good compatibility to
// their canonic counterparts, which employ the GetPixel/SetPixel methods
bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
VCL_DLLPUBLIC bool ImplFastBitmapConversion( BitmapBuffer& rDst, const BitmapBuffer& rSrc,
const SalTwoRect& rTwoRect );
bool ImplFastBitmapBlending( BitmapWriteAccess const & rDst,
......
......@@ -216,10 +216,6 @@ void DeInitSalData(); // called from Application-Dtor
void InitSalMain();
#ifdef MACOSX
void postInitVCLinitNSApp();
#endif
#endif // INCLUDED_VCL_INC_SALINST_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -47,6 +47,12 @@
#define VCLPLUG_KDE5_PUBLIC SAL_DLLPUBLIC_IMPORT
#endif
#if defined VCLPLUG_OSX_IMPLEMENTATION
#define VCLPLUG_OSX_PUBLIC SAL_DLLPUBLIC_EXPORT
#else
#define VCLPLUG_OSX_PUBLIC SAL_DLLPUBLIC_IMPORT
#endif
#if defined VCLPLUG_QT5_IMPLEMENTATION
#define VCLPLUG_QT5_PUBLIC SAL_DLLPUBLIC_EXPORT
#else
......
......@@ -35,7 +35,7 @@
#include <osl/process.h>
#include <rtl/ustrbuf.hxx>
#include <vclpluginapi.h>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <vcl/idle.hxx>
......@@ -57,6 +57,7 @@
#include <print.h>
#include <salimestatus.hxx>
#include <o3tl/make_unique.hxx>
#include <comphelper/processfactory.hxx>
......@@ -191,24 +192,12 @@ void SalAbort( const OUString& rErrorText, bool bDumpCore )
_exit(1);
}
void InitSalData()
{
}
const OUString& SalGetDesktopEnvironment()
{
static OUString aDesktopEnvironment( "MacOSX" );
return aDesktopEnvironment;
}
void DeInitSalData()
{
}
void InitSalMain()
{
}
SalYieldMutex::SalYieldMutex()
: m_aCodeBlock( nullptr )
{
......@@ -307,7 +296,8 @@ void ImplSalYieldMutexRelease()
pInst->GetYieldMutex()->release();
}
SalInstance* CreateSalInstance()
extern "C" {
VCLPLUG_OSX_PUBLIC SalInstance* create_SalInstance()
{
SalData* pSalData = new SalData;
......@@ -345,10 +335,6 @@ SalInstance* CreateSalInstance()
return pInst;
}
void DestroySalInstance( SalInstance* pInst )
{
delete pInst;
}
AquaSalInstance::AquaSalInstance()
......@@ -358,8 +344,10 @@ AquaSalInstance::AquaSalInstance()
, mbNoYieldLock( false )
, mbTimerProcessed( false )
{
GetYieldMutex()->acquire();
maMainThread = osl::Thread::getCurrentIdentifier();
ImplSVData* pSVData = ImplGetSVData();
pSVData->maAppData.mxToolkitName = OUString("osx");
}
AquaSalInstance::~AquaSalInstance()
......@@ -371,7 +359,6 @@ AquaSalInstance::~AquaSalInstance()
[pDockMenu release];
pDockMenu = nil;
}
GetYieldMutex()->release();
}
void AquaSalInstance::TriggerUserEventProcessing()
......
/* -*- 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <osl/module.hxx>
#include <osl/process.h>
#include <rtl/bootstrap.hxx>
#include <rtl/process.h>
#include <sal/log.hxx>
#include <salinst.hxx>
#include <saldatabasic.hxx>
#include <config_vclplug.h>
#include <desktop/crashreport.hxx>
#include <cstdio>
extern "C" {
typedef SalInstance*(*salFactoryProc)();
}
static oslModule pCloseModule = nullptr;
static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = false )
{
SalInstance* pInst = nullptr;
OUString aModule(
#ifdef SAL_DLLPREFIX
SAL_DLLPREFIX
#endif
"vclplug_" + rModuleBase + "lo" SAL_DLLEXTENSION );
osl::Module aMod;
if (aMod.loadRelative(reinterpret_cast<oslGenericFunction>(&tryInstance), aModule, SAL_LOADMODULE_GLOBAL))
{
salFactoryProc aProc = reinterpret_cast<salFactoryProc>(aMod.getFunctionSymbol("create_SalInstance"));
if (aProc)
{
pInst = aProc();
SAL_INFO(
"vcl.plugadapt",
"sal plugin " << aModule << " produced instance " << pInst);
if (pInst)
{
pCloseModule = static_cast<oslModule>(aMod);
aMod.release();
}
}
else
{
SAL_WARN(
"vcl.plugadapt",
"could not load symbol create_SalInstance from shared object "
<< aModule);
}
}
else if (bForce)
{
SAL_WARN("vcl.plugadapt", "could not load shared object " << aModule);
}
else
{
SAL_INFO("vcl.plugadapt", "could not load shared object " << aModule);
}
// coverity[leaked_storage] - this is on purpose
return pInst;
}
SalInstance *CreateSalInstance()
{
SalInstance *pInst = nullptr;
OUString aUsePlugin;
rtl::Bootstrap::get( "SAL_USE_VCLPLUGIN", aUsePlugin );
if( !aUsePlugin.isEmpty() )
pInst = tryInstance( aUsePlugin, true );
// fallback, try everything
static const char* const pPlugin[] = { "osx" };
for ( int i = 0; !pInst && i != SAL_N_ELEMENTS(pPlugin); ++i )
pInst = tryInstance( OUString::createFromAscii( pPlugin[ i ] ) );
if( ! pInst )
{
std::fprintf( stderr, "no suitable windowing system found, exiting.\n" );
_exit( 1 );
}
// acquire SolarMutex
pInst->AcquireYieldMutex();
return pInst;
}
void DestroySalInstance( SalInstance *pInst )
{
// release SolarMutex
pInst->ReleaseYieldMutexAll();
delete pInst;
if( pCloseModule )
osl_unloadModule( pCloseModule );
}
void InitSalData()
{
}
void DeInitSalData()
{
}
void InitSalMain()
{
}
void SalAbort( const OUString& rErrorText, bool bDumpCore )
{
if( rErrorText.isEmpty() )
std::fprintf( stderr, "Application Error\n" );
else
{
CrashReporter::AddKeyValue("AbortMessage", rErrorText);
std::fprintf( stderr, "%s\n", OUStringToOString(rErrorText, osl_getThreadTextEncoding()).getStr() );
}
if( bDumpCore )
abort();
else
_exit(1);
}
const OUString& SalGetDesktopEnvironment()
{
static OUString aDesktopEnvironment( "Windows" );
return aDesktopEnvironment;
}
SalData::SalData() :
m_pInstance(nullptr),
m_pPIManager(nullptr)
{
}
SalData::~SalData() COVERITY_NOEXCEPT_FALSE
{
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -35,7 +35,6 @@
#include <dbggui.hxx>
#include <salinst.hxx>
#include <svsys.h>
#include <algorithm>
#include <memory>
......
......@@ -1138,7 +1138,7 @@ OUString Application::GetHWOSConfInfo()
aDetails.append( VclResId(SV_APP_DEFAULT) );
aDetails.append( "; " );
#if (defined LINUX || defined _WIN32)
#if (defined LINUX || defined _WIN32 || defined MACOSX)
aDetails.append( SV_APP_VCLBACKEND );
aDetails.append( GetToolkitName() );
aDetails.append( "; " );
......
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