summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-05-30 18:19:40 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2021-06-01 15:30:59 +0200
commit3d1f28dd1fbb2fe3f5b933a9d692fb4d033f08b6 (patch)
tree2230fd165d9ded658195791ddc2f4bd5c7394a76 /vcl
parent159666084a28ab3591b96cdd390f8fa0ac62bf3c (diff)
configure: Refactor platform defaults
The main idea was to move complexity from source (and Makefiles) into configure.ac, because otherwise these must replicate the "same" branching, often resulting in diversions. Better to keep the logic in one place (configure.ac) and set additional variables to be used directly by source code and Makefiles. Notably this introduce the "using_*" platform flags, which should be considered constants. There is USING_X11, which actually tells, if the build uses the platform's X11 (and I opted for the removal of HAVE_FEATURE_X11). I also consider variables constant, after they have been exported by AC_SUBST, which should never be conditional, or some AC_DEFINE set them for a config header. A large block of defaults depends on $using_x11, so we set them to the same value, but just if the platform doesn't set it. The other important flag is $using_freetype_fontconfig, if the platform uses freetype and fontconfig. The headless plugin uses cairo for its drawing operations and freetype+fontconfig for text, so $test_cairo = $using_freetype_fontconfig. This is independent from a the cairo canvas! The OpenGL X11 code now depends on USING_X11, but it doesn't yet reflect the filter in Library_vcl.mk protecting glx. I don't know how correct this glx filter is, seeing that the source code just checked for "UNX - some non-X11 targets". Change-Id: Id1ba1a967a5d8d10ee217458be879ed00459f7e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116440 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/Library_vcl.mk2
-rw-r--r--vcl/source/app/salplug.cxx2
-rw-r--r--vcl/source/font/fontcache.cxx4
-rw-r--r--vcl/source/opengl/OpenGLHelper.cxx7
-rw-r--r--vcl/source/treelist/transfer2.cxx4
-rw-r--r--vcl/source/window/mouse.cxx4
6 files changed, 10 insertions, 13 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 45861cf2271c..aed3ce9603da 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -512,7 +512,7 @@ vcl_headless_code= \
$(if $(filter-out iOS,$(OS)), \
vcl/headless/svpbmp \
vcl/headless/svpgdi \
- vcl/headless/svpdata \
+ $(if $(ENABLE_HEADLESS),vcl/headless/svpdata) \
vcl/headless/CustomWidgetDraw \
) \
vcl/headless/svpdummies \
diff --git a/vcl/source/app/salplug.cxx b/vcl/source/app/salplug.cxx
index 8179e0c95097..41a30c8ed5ec 100644
--- a/vcl/source/app/salplug.cxx
+++ b/vcl/source/app/salplug.cxx
@@ -46,10 +46,10 @@
#include <android/androidinst.hxx>
#endif
-#if !(defined _WIN32 || defined MACOSX)
#if USING_X11
#define DESKTOPDETECT
#endif
+#if ENABLE_HEADLESS
#define HEADLESS_VCLPLUG
#endif
diff --git a/vcl/source/font/fontcache.cxx b/vcl/source/font/fontcache.cxx
index 4ed38bc70153..8b6730a81447 100644
--- a/vcl/source/font/fontcache.cxx
+++ b/vcl/source/font/fontcache.cxx
@@ -24,10 +24,6 @@
#include <PhysicalFontFamily.hxx>
#include <sal/log.hxx>
-#if !(defined(_WIN32) || defined(MACOSX) || defined(IOS))
-#include <unx/glyphcache.hxx>
-#endif
-
size_t ImplFontCache::IFSD_Hash::operator()( const FontSelectPattern& rFSD ) const
{
return rFSD.hashCode();
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index ee2047548103..b2f6e4a874e7 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -8,6 +8,7 @@
*/
#include <vcl/opengl/OpenGLHelper.hxx>
+#include <config_vclplug.h>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
@@ -38,7 +39,7 @@
#include <vcl/skia/SkiaHelper.hxx>
#include <vcl/glxtestprocess.hxx>
-#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined HAIKU
+#if USING_X11
#include <opengl/x11/X11DeviceInfo.hxx>
#elif defined (_WIN32)
#include <opengl/win/WinDeviceInfo.hxx>
@@ -200,7 +201,7 @@ namespace
OString getDeviceInfoString()
{
-#if defined( SAL_UNX ) && !defined( MACOSX ) && !defined( IOS )&& !defined( ANDROID ) && !defined( HAIKU )
+#if USING_X11
const X11OpenGLDeviceInfo aInfo;
return aInfo.GetOS() +
aInfo.GetOSRelease() +
@@ -762,7 +763,7 @@ bool OpenGLHelper::isDeviceDenylisted()
{
OpenGLZone aZone;
-#if defined UNX && !defined MACOSX && !defined IOS && !defined ANDROID && !defined HAIKU
+#if USING_X11
X11OpenGLDeviceInfo aInfo;
bDenylisted = aInfo.isDeviceBlocked();
SAL_INFO("vcl.opengl", "denylisted: " << bDenylisted);
diff --git a/vcl/source/treelist/transfer2.cxx b/vcl/source/treelist/transfer2.cxx
index 0d43db107d9a..bc654bbb7975 100644
--- a/vcl/source/treelist/transfer2.cxx
+++ b/vcl/source/treelist/transfer2.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <config_features.h>
+#include <config_vclplug.h>
#include <osl/mutex.hxx>
#include <sot/exchange.hxx>
@@ -498,7 +498,7 @@ Reference<XClipboard> GetSystemPrimarySelection()
try
{
Reference<XComponentContext> xContext(comphelper::getProcessComponentContext());
-#if HAVE_FEATURE_X11
+#if USING_X11
// A hack, making the primary selection available as an instance
// of the SystemClipboard service on X11:
Sequence< Any > args(1);
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index e57485927eed..d1b3590ed97b 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -18,8 +18,8 @@
*/
-#include <config_features.h>
#include <config_feature_desktop.h>
+#include <config_vclplug.h>
#include <tools/time.hxx>
@@ -745,7 +745,7 @@ Reference< css::datatransfer::dnd::XDragSource > Window::GetDragSource()
aDropTargetSN = "com.sun.star.datatransfer.dnd.OleDropTarget";
aDragSourceAL[ 1 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->mpNSView) );
aDropTargetAL[ 0 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->mpNSView) );
-#elif HAVE_FEATURE_X11
+#elif USING_X11
aDragSourceSN = "com.sun.star.datatransfer.dnd.X11DragSource";
aDropTargetSN = "com.sun.star.datatransfer.dnd.X11DropTarget";