[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 0 commits -
Rebased ref, commits from common ancestor: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 3764 commits - accessibility/inc accessibility/Library_acc.mk accessibility/source android/Bootstrap android/CustomTarget_lo_android.mk a
Rebased ref, commits from common ancestor: commit f5f2e624db4710040d5b240a3b81ebb95bcdfe3c Author: Jan-Marek Glogowski AuthorDate: Fri Jan 25 21:56:41 2019 +0100 Commit: Jan-Marek Glogowski CommitDate: Fri Jan 25 23:50:19 2019 +0100 Just define the __clang_major___WORKAROUND_GUARD Change-Id: I84e969005ac2a96da449b5434ee5fdb37fc9b432 diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk index f20bd08d8c15..86f52ded439e 100644 --- a/external/boost/UnpackedTarball_boost.mk +++ b/external/boost/UnpackedTarball_boost.mk @@ -40,8 +40,6 @@ boost_patches += msvc2017.patch.0 boost_patches += sse.patch.0 -boost_patches += Wundef.patch.0 - $(eval $(call gb_UnpackedTarball_UnpackedTarball,boost)) $(eval $(call gb_UnpackedTarball_set_tarball,boost,$(BOOST_TARBALL))) diff --git a/external/boost/Wundef.patch.0 b/external/boost/Wundef.patch.0 deleted file mode 100644 index aa2d383435d0.. --- a/external/boost/Wundef.patch.0 +++ /dev/null @@ -1,11 +0,0 @@ boost/type_traits/detail/config.hpp -+++ boost/type_traits/detail/config.hpp -@@ -82,7 +82,7 @@ - // Can we implement accurate is_function/is_member_function_pointer (post C++03)? - // - #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !BOOST_WORKAROUND(BOOST_GCC, < 40900)\ -- && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(__clang_major__, <= 4) -+ && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !(defined __clang_major__ && BOOST_WORKAROUND(__clang_major__, <= 4)) - # define BOOST_TT_HAS_ASCCURATE_IS_FUNCTION - #endif - diff --git a/external/boost/boost_1_60_0.undef.warning.patch b/external/boost/boost_1_60_0.undef.warning.patch index 79441d6cc1fc..0678afa9d5ce 100644 --- a/external/boost/boost_1_60_0.undef.warning.patch +++ b/external/boost/boost_1_60_0.undef.warning.patch @@ -1,6 +1,6 @@ --- a/b/boost/boost/config/workaround.hpp +++ a/b/boost/boost/config/workaround.hpp -@@ -237,6 +237,13 @@ +@@ -237,6 +237,19 @@ #else #define BOOST_INTEL_WORKAROUND_GUARD 0 #endif @@ -11,6 +11,12 @@ +#define BOOST_GCC_VERSION_WORKAROUND_GUARD 0 +#endif + ++#ifndef __clang_major___WORKAROUND_GUARD ++#define __clang_major___WORKAROUND_GUARD 1 ++#else ++#define __clang_major___WORKAROUND_GUARD 0 ++#endif ++ // Always define to zero, if it's used it'll be defined my MPL: #define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0 commit f3608cf105a4b180e45a51a8fba2529ab1840c5a Author: Jan-Marek Glogowski AuthorDate: Wed Nov 28 09:24:22 2018 +0100 Commit: Jan-Marek Glogowski CommitDate: Fri Jan 25 23:50:17 2019 +0100 Revert OSX baseline bump Revert "Bump Xcode baseline to 9.3" This reverts commit b4f666f2e677b05cab8395fe7972b45b15f60c3f. Revert "Clang (and GCC) always has __cplusplus >= C++17 now" This reverts commit 3d79f0ff9eedec74a131796016add94f4a1be02d. This also includes some patches to fix some other stuff, mainly Apples broken std::regexp in libnumbertext and Boost 1.69. Change-Id: I040feeb382a0125ac8baa2900993ea0fd9f77d4d diff --git a/configure.ac b/configure.ac index 527e24a49c1f..ca7d7a0ff157 100644 --- a/configure.ac +++ b/configure.ac @@ -2766,16 +2766,6 @@ if test $_os = Darwin -o $_os = iOS; then FRAMEWORKSHOME="$MACOSX_SDK_PATH/System/Library/Frameworks" MACOSX_DEPLOYMENT_TARGET="$with_macosx_version_min_required" -AC_MSG_CHECKING([whether Xcode is new enough]) -my_xcode_ver1=$(xcrun xcodebuild -version | head -n 1) -my_xcode_ver2=${my_xcode_ver1#Xcode } -my_xcode_ver3=$(printf %s "$my_xcode_ver2" | $AWK -F. '{ print $1*100+($2<100?$2:99) }') -if test "$my_xcode_ver3" -ge 903; then -AC_MSG_RESULT([yes ($my_xcode_ver2)]) -else -AC_MSG_ERROR(["$my_xcode_ver1" is too old or unrecognized, must be at least Xcode 9.3]) -fi - case "$with_macosx_version_min_required" in 10.10) MAC_OS_X_VERSION_MIN_REQUIRED="101000" diff --git a/external/boost/boost-android-unified.patch.1 b/external/boost/boost-android-unified.patch.1 index 46181b862f49..6412cdcf6ded 100644 --- a/external/boost/boost-android-unified.patch.1 +++ b/external/boost/boost-android-unified.patch.1 @@ -1,22 +1,26 @@ --- a/boost/type_traits/detail/is_function_cxx_11.hpp +++ b/boost/type_traits/detail/is_function_cxx_11.hpp -@@ -18,7 +18,7 @@ +@@ -18,7 +18,9 @@ template struct is_function : public false_type {}; -#if defined(__cpp_noexcept_function_type) && !defined(_MSC_VER) -+#if defined(__cpp_noexcept_function_type) && !defined(_MSC_VER) && !(defined __ANDROID__ && defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 && __clang_patchlevel__ == 300080) ++#if defined(__cpp_noexcept_function_type) && !defined(_MSC_VER) && \ ++ !(defined __ANDROID__ && defined __clang__ && __clang_major__ == 5 && __clang_minor__ == 0 && __clang_patchlevel__ == 300080) && \ ++ !(defined __apple_build_version__ && __apple_build_version__ <= 9
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 62 commits - accessibility/source android/source avmedia/source basctl/source basegfx/source basegfx/test basic/source canvas/source char
Rebased ref, commits from common ancestor: commit 8079a5e43bbb1ed54327ac48b0781d597f797be8 Author: Jan-Marek Glogowski AuthorDate: Mon Sep 17 11:01:59 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Fri Oct 19 13:20:11 2018 + Qt5 use LO provided native file pickers This uses the native file pickers on Windows and MacOSX. Change-Id: Ic836d3ed8de0760c6c94c68d61f6eaa96f773000 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 8ef4108a3558..25671ca498eb 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -91,7 +91,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Clipboard \ vcl/qt5/Qt5Data \ vcl/qt5/Qt5DragAndDrop \ -vcl/qt5/Qt5FilePicker \ +$(if $(USING_X11),vcl/qt5/Qt5FilePicker) \ vcl/qt5/Qt5Font \ vcl/qt5/Qt5FontFace \ vcl/qt5/Qt5Frame \ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index ca11acb2a788..289ba32fff19 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -215,17 +215,27 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent) } css::uno::Reference -Qt5Instance::createFilePicker(const css::uno::Reference&) +Qt5Instance::createFilePicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFilePicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::ExistingFile)); +#endif } css::uno::Reference -Qt5Instance::createFolderPicker(const css::uno::Reference&) +Qt5Instance::createFolderPicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFolderPicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::Directory)); +#endif } css::uno::Reference commit 9f5451279912c4f84bf02cfbafdd1e9f1f8d31c6 Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 11:32:12 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Fri Oct 19 13:19:52 2018 + Qt5 build VCL plugin on MacOSX Change-Id: I6ddec483703c95faf69b7b146363376765d5d6f8 diff --git a/Repository.mk b/Repository.mk index 430e1d6bc6de..6c81261a6722 100644 --- a/Repository.mk +++ b/Repository.mk @@ -483,6 +483,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ AppleRemote \ ) \ fps_aqua \ + $(if $(ENABLE_QT5),vclplug_qt5) \ vclplug_osx \ MacOSXSpell \ ) \ diff --git a/configure.ac b/configure.ac index 3fd916fb4f8f..e27378c3449e 100644 --- a/configure.ac +++ b/configure.ac @@ -671,6 +671,7 @@ darwin*) # Mac OS X or iOS host=x86_64-apple-darwin fi else +test_qt5=yes _os=Darwin INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app INSTROOTCONTENTSUFFIX=/Contents @@ -11176,13 +11177,7 @@ if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \ \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \ \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \) then -qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes" -qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries" - -if test -n "$supports_multilib"; then -qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64" -fi - +qt5_fwk_search="QtCore QtGui QtWidgets QtNetwork" qt5_test_include="QtWidgets/qapplication.h" if test $_os == "WINNT"; then qt5_test_library="Qt5Widgets.lib" @@ -11190,12 +11185,25 @@ then qt5_test_library="libQt5Widgets.so" fi +qt5_incdirs="" +qt5_libdirs="" +if test "$USING_X11" = TRUE; then +qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes" +qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries" +if test -n "$supports_multilib"; then +qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64" +fi +fi + dnl Check for qmake5 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] ) if test "$QMAKE5" = "no"; then AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".]) else -qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`" +case "$host_os" in +darwin*) qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\{0,\}\).*$/\1/p'`" ;; +*) qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`" ;; +esac if test -z "$qmake5_test_ver"; then AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 746 commits - accessibility/inc accessibility/source android/source avmedia/source basctl/source basctl/uiconfig basegfx/source basegfx/t
Rebased ref, commits from common ancestor: commit c8bb78f4e7d4eec251b23a8783442a6dd97f3ca5 Author: Jan-Marek Glogowski AuthorDate: Mon Sep 17 11:01:59 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Thu Oct 18 11:30:46 2018 +0200 Qt5 use LO provided native file pickers This uses the native file pickers on Windows and MacOSX. Change-Id: Ic836d3ed8de0760c6c94c68d61f6eaa96f773000 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index d01d0508145a..e74d864f7998 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -90,7 +90,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Bitmap \ vcl/qt5/Qt5Clipboard \ vcl/qt5/Qt5Data \ -vcl/qt5/Qt5FilePicker \ +$(if $(USING_X11),vcl/qt5/Qt5FilePicker) \ vcl/qt5/Qt5Font \ vcl/qt5/Qt5FontFace \ vcl/qt5/Qt5Frame \ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index ffbbf103a7ae..7fded10d934b 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -214,17 +214,27 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent) } css::uno::Reference -Qt5Instance::createFilePicker(const css::uno::Reference&) +Qt5Instance::createFilePicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFilePicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::ExistingFile)); +#endif } css::uno::Reference -Qt5Instance::createFolderPicker(const css::uno::Reference&) +Qt5Instance::createFolderPicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFolderPicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::Directory)); +#endif } css::uno::Reference commit adf416594016696db87d37d530fc39a8659809a1 Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 11:32:12 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Thu Oct 18 11:30:43 2018 +0200 Qt5 build VCL plugin on MacOSX Change-Id: I6ddec483703c95faf69b7b146363376765d5d6f8 diff --git a/Repository.mk b/Repository.mk index 73ef91a888f8..eb6166eceb3d 100644 --- a/Repository.mk +++ b/Repository.mk @@ -483,6 +483,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ AppleRemote \ ) \ fps_aqua \ + $(if $(ENABLE_QT5),vclplug_qt5) \ vclplug_osx \ MacOSXSpell \ ) \ diff --git a/configure.ac b/configure.ac index 3fd916fb4f8f..e27378c3449e 100644 --- a/configure.ac +++ b/configure.ac @@ -671,6 +671,7 @@ darwin*) # Mac OS X or iOS host=x86_64-apple-darwin fi else +test_qt5=yes _os=Darwin INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app INSTROOTCONTENTSUFFIX=/Contents @@ -11176,13 +11177,7 @@ if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \ \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \ \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \) then -qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes" -qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries" - -if test -n "$supports_multilib"; then -qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64" -fi - +qt5_fwk_search="QtCore QtGui QtWidgets QtNetwork" qt5_test_include="QtWidgets/qapplication.h" if test $_os == "WINNT"; then qt5_test_library="Qt5Widgets.lib" @@ -11190,12 +11185,25 @@ then qt5_test_library="libQt5Widgets.so" fi +qt5_incdirs="" +qt5_libdirs="" +if test "$USING_X11" = TRUE; then +qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes" +qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries" +if test -n "$supports_multilib"; then +qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64" +fi +fi + dnl Check for qmake5 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] ) if test "$QMAKE5" = "no"; then AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".]) else -qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`" +case "$host_os" in +darwin*) qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\{0,\}\).*$/\1/p'`" ;; +*) qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`" ;; +esac if test -z "$qmake5_test_ver"; then AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
[Libreoffice-commits] core.git: Branch 'feature/qt5' - 0 commits -
Rebased ref, commits from common ancestor: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 201 commits - accessibility/source avmedia/source basctl/source basctl/uiconfig basegfx/source basic/source bin/find-unneeded-includes bi
Rebased ref, commits from common ancestor: commit c478ac5cc1311e7cf67289d67d273db514ec06a9 Author: Jan-Marek Glogowski AuthorDate: Mon Sep 17 11:01:59 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Sat Sep 29 01:57:12 2018 +0200 Qt5 use LO provided native file pickers This uses the native file pickers on Windows and MacOSX. Change-Id: Ic836d3ed8de0760c6c94c68d61f6eaa96f773000 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 33b45bd8becb..4dc743f28b74 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -86,7 +86,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5AccessibleWidget \ vcl/qt5/Qt5Bitmap \ vcl/qt5/Qt5Data \ -vcl/qt5/Qt5FilePicker \ +$(if $(USING_X11),vcl/qt5/Qt5FilePicker) \ vcl/qt5/Qt5Font \ vcl/qt5/Qt5FontFace \ vcl/qt5/Qt5Frame \ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 8557834064d8..334aba4fbdea 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -211,17 +211,27 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent) } css::uno::Reference -Qt5Instance::createFilePicker(const css::uno::Reference&) +Qt5Instance::createFilePicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFilePicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::ExistingFile)); +#endif } css::uno::Reference -Qt5Instance::createFolderPicker(const css::uno::Reference&) +Qt5Instance::createFolderPicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFolderPicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::Directory)); +#endif } extern "C" { commit 949fa1a81be65bc1b9590d3d65f36e2d6bdf17db Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 11:32:12 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Sat Sep 29 01:57:11 2018 +0200 Qt5 build VCL plugin on MacOSX Change-Id: I6ddec483703c95faf69b7b146363376765d5d6f8 diff --git a/Repository.mk b/Repository.mk index b2c806307083..d1aa2540d266 100644 --- a/Repository.mk +++ b/Repository.mk @@ -482,6 +482,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ AppleRemote \ ) \ fps_aqua \ + $(if $(ENABLE_QT5),vclplug_qt5) \ vclplug_osx \ MacOSXSpell \ ) \ diff --git a/configure.ac b/configure.ac index f88f9a4ae1f7..24c2bb2f04b4 100644 --- a/configure.ac +++ b/configure.ac @@ -672,6 +672,7 @@ darwin*) # Mac OS X or iOS host=x86_64-apple-darwin fi else +test_qt5=yes _os=Darwin INSTROOTBASESUFFIX=/$PRODUCTNAME_WITHOUT_SPACES.app INSTROOTCONTENTSUFFIX=/Contents @@ -11163,13 +11164,7 @@ if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \ \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) -o \ \( "$test_gtk3_kde5" = "yes" -a "$ENABLE_GTK3_KDE5" = "TRUE" \) then -qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes" -qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries" - -if test -n "$supports_multilib"; then -qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64" -fi - +qt5_fwk_search="QtCore QtGui QtWidgets QtNetwork" qt5_test_include="QtWidgets/qapplication.h" if test $_os == "WINNT"; then qt5_test_library="Qt5Widgets.lib" @@ -11177,12 +11172,25 @@ then qt5_test_library="libQt5Widgets.so" fi +qt5_incdirs="" +qt5_libdirs="" +if test "$USING_X11" = TRUE; then +qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes" +qt5_libdirs="$QT5LIB /usr/lib/qt5 /usr/lib $x_libraries" +if test -n "$supports_multilib"; then +qt5_libdirs="$qt5_libdirs /usr/lib64/qt5 /usr/lib64/qt /usr/lib64" +fi +fi + dnl Check for qmake5 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] ) if test "$QMAKE5" = "no"; then AC_MSG_ERROR([Qmake not found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".]) else -qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`" +case "$host_os" in +darwin*) qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\{0,\}\).*$/\1/p'`" ;; +*) qmake5_test_ver="`$QMAKE5 -v 2>&1 | $SED -n -e 's/^Using Qt version \(5\.[[0-9.]]\+\).*$/\1/p'`" ;; +esac if test -z "$qmake5_test_ver"; then AC_MSG_ERROR([Wrong qmake for Qt5 found. Please specify the root of your Qt5 installation by exporting QT5DIR before running "configure".])
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 219 commits - basctl/source basctl/uiconfig chart2/source chart2/uiconfig comphelper/source compilerplugins/clang config_host/config_vclp
Rebased ref, commits from common ancestor: commit d355fabee1d34a2d7a64c051dd37443c8a7eef79 Author: Jan-Marek Glogowski AuthorDate: Mon Sep 17 11:01:59 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Thu Sep 20 19:09:54 2018 +0200 Qt5 use LO provided native file pickers This uses the native file pickers on Windows and MacOSX. Change-Id: Ic836d3ed8de0760c6c94c68d61f6eaa96f773000 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index ae29d4054bd9..ec30f06b7a9f 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -85,7 +85,7 @@ endif $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Bitmap \ vcl/qt5/Qt5Data \ -vcl/qt5/Qt5FilePicker \ +$(if $(USING_X11),vcl/qt5/Qt5FilePicker) \ vcl/qt5/Qt5Font \ vcl/qt5/Qt5FontFace \ vcl/qt5/Qt5Frame \ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 8557834064d8..334aba4fbdea 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -211,17 +211,27 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent) } css::uno::Reference -Qt5Instance::createFilePicker(const css::uno::Reference&) +Qt5Instance::createFilePicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFilePicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::ExistingFile)); +#endif } css::uno::Reference -Qt5Instance::createFolderPicker(const css::uno::Reference&) +Qt5Instance::createFolderPicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFolderPicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::Directory)); +#endif } extern "C" { commit a793bb8bd1405a0042592d81b7d12d9ff3d11007 Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 12:23:36 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Thu Sep 20 19:09:51 2018 +0200 Unify sal plugin loaders Change-Id: Ic099761eaff80349e985ccf62e3f4aa6b2e98022 diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index e3c33af5d774..8fd852a5cb53 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -259,8 +259,6 @@ public: platform specific data structures. @attention The initialization of the application itself is done in Init() - -@seeInitSalData is implemented by platform specific code. */ Application(); @@ -268,9 +266,6 @@ public: Deinitializes the LibreOffice global instance data structure, then deinitializes any platform specific data structures. - - @see ImplDeInitSVData deinitializes the global instance data, -DeInitSalData is implemented by platform specific code */ virtual ~Application(); diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index bcb5733ee12a..1b9f24a6c8a6 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -17915,7 +17915,6 @@ 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 @@ -17958,6 +17957,7 @@ vcl/source/app/dndhelp.cxx vcl/source/app/help.cxx vcl/source/app/i18nhelp.cxx vcl/source/app/idle.cxx +vcl/source/app/salplug.cxx vcl/source/app/salusereventlist.cxx vcl/source/app/salvtables.cxx vcl/source/app/scheduler.cxx @@ -18323,7 +18323,6 @@ vcl/unx/generic/gdi/xrender_peer.cxx vcl/unx/generic/gdi/xrender_peer.hxx vcl/unx/generic/glyphs/freetype_glyphcache.cxx vcl/unx/generic/glyphs/glyphcache.cxx -vcl/unx/generic/plugadapt/salplug.cxx vcl/unx/generic/print/bitmap_gfx.cxx vcl/unx/generic/print/common_gfx.cxx vcl/unx/generic/print/genprnpsp.cxx @@ -18447,7 +18446,6 @@ vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx -vcl/win/salplug.cxx vcl/win/app/saldata.cxx vcl/win/app/salinfo.cxx vcl/win/app/salinst.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 184c84248eb0..e75ff64b2b34 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -106,6 +106,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ lcms2 \ mdds_headers \ )) + ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,vcl,\ epoxy \ @@ -474,7 +475,7 @@ vcl_headless_freetype_code=\ ifeq ($(USING_X11),TRUE) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/unx/generic/plugadapt/salplug \ +vcl/source/app/salplug \ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/gdi/nativewindowhandleprovider \ @@ -520,8 +521,10 @@ $(eval $(call gb_Library_add_libs,vcl,\ -lpthread \ )) endif -else - $(eval $(call gb_Library_add_exception_obj
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 97 commits - bridges/source chart2/source chart2/uiconfig compilerplugins/clang config_host/config_vclplug.h.in configure.ac connectivity
Rebased ref, commits from common ancestor: commit b9d2ce78ea4522dbd341044c7fea6bb4d637ca4f Author: Jan-Marek Glogowski AuthorDate: Mon Sep 17 11:01:59 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Tue Sep 18 21:13:35 2018 +0200 Qt5 use LO provided native file pickers This uses the native file pickers on Windows and MacOSX. Change-Id: Ic836d3ed8de0760c6c94c68d61f6eaa96f773000 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index ae29d4054bd9..ec30f06b7a9f 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -85,7 +85,7 @@ endif $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Bitmap \ vcl/qt5/Qt5Data \ -vcl/qt5/Qt5FilePicker \ +$(if $(USING_X11),vcl/qt5/Qt5FilePicker) \ vcl/qt5/Qt5Font \ vcl/qt5/Qt5FontFace \ vcl/qt5/Qt5Frame \ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 8557834064d8..334aba4fbdea 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -211,17 +211,27 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent) } css::uno::Reference -Qt5Instance::createFilePicker(const css::uno::Reference&) +Qt5Instance::createFilePicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFilePicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::ExistingFile)); +#endif } css::uno::Reference -Qt5Instance::createFolderPicker(const css::uno::Reference&) +Qt5Instance::createFolderPicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFolderPicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::Directory)); +#endif } extern "C" { commit 3ddf0f0eaeb746d2f99a545baed5c81a2282710c Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 12:23:36 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Tue Sep 18 21:13:33 2018 +0200 Unify sal plugin loaders Change-Id: Ic099761eaff80349e985ccf62e3f4aa6b2e98022 diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index e3c33af5d774..8fd852a5cb53 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -259,8 +259,6 @@ public: platform specific data structures. @attention The initialization of the application itself is done in Init() - -@seeInitSalData is implemented by platform specific code. */ Application(); @@ -268,9 +266,6 @@ public: Deinitializes the LibreOffice global instance data structure, then deinitializes any platform specific data structures. - - @see ImplDeInitSVData deinitializes the global instance data, -DeInitSalData is implemented by platform specific code */ virtual ~Application(); diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index bcb5733ee12a..1b9f24a6c8a6 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -17915,7 +17915,6 @@ 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 @@ -17958,6 +17957,7 @@ vcl/source/app/dndhelp.cxx vcl/source/app/help.cxx vcl/source/app/i18nhelp.cxx vcl/source/app/idle.cxx +vcl/source/app/salplug.cxx vcl/source/app/salusereventlist.cxx vcl/source/app/salvtables.cxx vcl/source/app/scheduler.cxx @@ -18323,7 +18323,6 @@ vcl/unx/generic/gdi/xrender_peer.cxx vcl/unx/generic/gdi/xrender_peer.hxx vcl/unx/generic/glyphs/freetype_glyphcache.cxx vcl/unx/generic/glyphs/glyphcache.cxx -vcl/unx/generic/plugadapt/salplug.cxx vcl/unx/generic/print/bitmap_gfx.cxx vcl/unx/generic/print/common_gfx.cxx vcl/unx/generic/print/genprnpsp.cxx @@ -18447,7 +18446,6 @@ vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx -vcl/win/salplug.cxx vcl/win/app/saldata.cxx vcl/win/app/salinfo.cxx vcl/win/app/salinst.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 184c84248eb0..e75ff64b2b34 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -106,6 +106,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ lcms2 \ mdds_headers \ )) + ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,vcl,\ epoxy \ @@ -474,7 +475,7 @@ vcl_headless_freetype_code=\ ifeq ($(USING_X11),TRUE) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/unx/generic/plugadapt/salplug \ +vcl/source/app/salplug \ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/gdi/nativewindowhandleprovider \ @@ -520,8 +521,10 @@ $(eval $(call gb_Library_add_libs,vcl,\ -lpthread \ )) endif -else - $(eval $(call gb_Library_add_exception_obj
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 107 commits - animations/source basctl/source basegfx/source basegfx/test basic/source bin/ios-mapfile-statistics bin/oss-fuzz-build.sh b
Rebased ref, commits from common ancestor: commit 71749d19a511da3ca81748f0b8a887f8ae08b8e9 Author: Jan-Marek Glogowski AuthorDate: Mon Sep 17 11:01:59 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Mon Sep 17 11:58:42 2018 +0200 Qt5 use LO provided native file pickers This uses the native file pickers on Windows and MacOSX. Change-Id: Ic836d3ed8de0760c6c94c68d61f6eaa96f773000 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index ae29d4054bd9..ec30f06b7a9f 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -85,7 +85,7 @@ endif $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Bitmap \ vcl/qt5/Qt5Data \ -vcl/qt5/Qt5FilePicker \ +$(if $(USING_X11),vcl/qt5/Qt5FilePicker) \ vcl/qt5/Qt5Font \ vcl/qt5/Qt5FontFace \ vcl/qt5/Qt5Frame \ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 8557834064d8..334aba4fbdea 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -211,17 +211,27 @@ void Qt5Instance::ProcessEvent(SalUserEvent aEvent) } css::uno::Reference -Qt5Instance::createFilePicker(const css::uno::Reference&) +Qt5Instance::createFilePicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFilePicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::ExistingFile)); +#endif } css::uno::Reference -Qt5Instance::createFolderPicker(const css::uno::Reference&) +Qt5Instance::createFolderPicker(const css::uno::Reference& cntxt) { +#if (defined _WIN32 || defined MACOSX) +return SalInstance::createFolderPicker(cntxt); +#else +(void)cntxt; return css::uno::Reference( new Qt5FilePicker(QFileDialog::Directory)); +#endif } extern "C" { commit a3485c301e222f19ff3874edcd098389d796823d Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 12:23:36 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Mon Sep 17 11:58:41 2018 +0200 Unify sal plugin loaders Change-Id: Ic099761eaff80349e985ccf62e3f4aa6b2e98022 diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index e3c33af5d774..8fd852a5cb53 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -259,8 +259,6 @@ public: platform specific data structures. @attention The initialization of the application itself is done in Init() - -@seeInitSalData is implemented by platform specific code. */ Application(); @@ -268,9 +266,6 @@ public: Deinitializes the LibreOffice global instance data structure, then deinitializes any platform specific data structures. - - @see ImplDeInitSVData deinitializes the global instance data, -DeInitSalData is implemented by platform specific code */ virtual ~Application(); diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index bcb5733ee12a..1b9f24a6c8a6 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -17915,7 +17915,6 @@ 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 @@ -17958,6 +17957,7 @@ vcl/source/app/dndhelp.cxx vcl/source/app/help.cxx vcl/source/app/i18nhelp.cxx vcl/source/app/idle.cxx +vcl/source/app/salplug.cxx vcl/source/app/salusereventlist.cxx vcl/source/app/salvtables.cxx vcl/source/app/scheduler.cxx @@ -18323,7 +18323,6 @@ vcl/unx/generic/gdi/xrender_peer.cxx vcl/unx/generic/gdi/xrender_peer.hxx vcl/unx/generic/glyphs/freetype_glyphcache.cxx vcl/unx/generic/glyphs/glyphcache.cxx -vcl/unx/generic/plugadapt/salplug.cxx vcl/unx/generic/print/bitmap_gfx.cxx vcl/unx/generic/print/common_gfx.cxx vcl/unx/generic/print/genprnpsp.cxx @@ -18447,7 +18446,6 @@ vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx -vcl/win/salplug.cxx vcl/win/app/saldata.cxx vcl/win/app/salinfo.cxx vcl/win/app/salinst.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 184c84248eb0..e75ff64b2b34 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -106,6 +106,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ lcms2 \ mdds_headers \ )) + ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,vcl,\ epoxy \ @@ -474,7 +475,7 @@ vcl_headless_freetype_code=\ ifeq ($(USING_X11),TRUE) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/unx/generic/plugadapt/salplug \ +vcl/source/app/salplug \ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/gdi/nativewindowhandleprovider \ @@ -520,8 +521,10 @@ $(eval $(call gb_Library_add_libs,vcl,\ -lpthread \ )) endif -else - $(eval $(call gb_Library_add_exception_obj
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 15 commits - config_host/config_vclplug.h.in configure.ac connectivity/source include/comphelper include/vcl officecfg/registry qadevOOo/
Rebased ref, commits from common ancestor: commit 4b2c5e9225068fa4fa66050d7732b02f06ed85d6 Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 12:23:36 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Thu Sep 13 18:05:46 2018 +0200 Unify sal plugin loaders Change-Id: Ic099761eaff80349e985ccf62e3f4aa6b2e98022 diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 92a422cb7072..235110e5eba1 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -259,8 +259,6 @@ public: platform specific data structures. @attention The initialization of the application itself is done in Init() - -@seeInitSalData is implemented by platform specific code. */ Application(); @@ -268,9 +266,6 @@ public: Deinitializes the LibreOffice global instance data structure, then deinitializes any platform specific data structures. - - @see ImplDeInitSVData deinitializes the global instance data, -DeInitSalData is implemented by platform specific code */ virtual ~Application(); diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index bcb5733ee12a..1b9f24a6c8a6 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -17915,7 +17915,6 @@ 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 @@ -17958,6 +17957,7 @@ vcl/source/app/dndhelp.cxx vcl/source/app/help.cxx vcl/source/app/i18nhelp.cxx vcl/source/app/idle.cxx +vcl/source/app/salplug.cxx vcl/source/app/salusereventlist.cxx vcl/source/app/salvtables.cxx vcl/source/app/scheduler.cxx @@ -18323,7 +18323,6 @@ vcl/unx/generic/gdi/xrender_peer.cxx vcl/unx/generic/gdi/xrender_peer.hxx vcl/unx/generic/glyphs/freetype_glyphcache.cxx vcl/unx/generic/glyphs/glyphcache.cxx -vcl/unx/generic/plugadapt/salplug.cxx vcl/unx/generic/print/bitmap_gfx.cxx vcl/unx/generic/print/common_gfx.cxx vcl/unx/generic/print/genprnpsp.cxx @@ -18447,7 +18446,6 @@ vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx -vcl/win/salplug.cxx vcl/win/app/saldata.cxx vcl/win/app/salinfo.cxx vcl/win/app/salinst.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 184c84248eb0..e75ff64b2b34 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -106,6 +106,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ lcms2 \ mdds_headers \ )) + ifeq ($(DISABLE_GUI),) $(eval $(call gb_Library_use_externals,vcl,\ epoxy \ @@ -474,7 +475,7 @@ vcl_headless_freetype_code=\ ifeq ($(USING_X11),TRUE) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/unx/generic/plugadapt/salplug \ +vcl/source/app/salplug \ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/gdi/nativewindowhandleprovider \ @@ -520,8 +521,10 @@ $(eval $(call gb_Library_add_libs,vcl,\ -lpthread \ )) endif -else - $(eval $(call gb_Library_add_exception_objects,vcl,\ + +else # ! DISABLE_GUI + +$(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/opengl/DeviceInfo \ vcl/opengl/gdiimpl \ vcl/opengl/salbmp \ @@ -547,7 +550,8 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/opengl/x11/X11DeviceInfo \ )) endif -endif +endif # ! DISABLE_GUI + ifeq ($(OS),HAIKU) $(eval $(call gb_Library_add_exception_objects,vcl,\ @@ -563,7 +567,7 @@ $(eval $(call gb_Library_add_libs,vcl,\ )) $(eval $(call gb_Library_add_exception_objects,vcl, \ -$(if $(or $(ENABLE_QT5),$(ENABLE_KDE5)),vcl/unx/generic/plugadapt/salplug) \ +$(if $(or $(ENABLE_QT5),$(ENABLE_KDE5)),vcl/source/app/salplug) \ )) $(eval $(call gb_Library_use_externals,vcl,\ @@ -574,6 +578,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ )) endif + ifeq ($(OS),ANDROID) $(eval $(call gb_Library_add_libs,vcl,\ -llog \ @@ -605,7 +610,6 @@ $(eval $(call gb_Library_add_cxxflags,vcl,\ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/ios/iosinst \ vcl/ios/dummies \ -$(vcl_really_generic_code) \ $(vcl_coretext_code) \ $(vcl_quartz_code) \ $(vcl_headless_code) \ @@ -624,7 +628,7 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\ )) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/osx/salplug \ +vcl/source/app/salplug \ )) endif @@ -633,7 +637,7 @@ ifeq ($(OS),WNT) $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/opengl/win/WinDeviceInfo \ vcl/opengl/win/blocklist_parser \ -vcl/win/salplug \ +vcl/source/app/salplug \ )) $(eval $(call gb_Library_use_system_win32_libs,vcl,\ diff --git a/vcl/README b/vcl/README index ae0408b830a2..5a869ef77b9f 100644 --- a/vcl/README +++ b/vcl/README @@ -80,7 +80,7 @@ LibreOffice (and OpenOffice). == COM threading ==
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 6 commits - config_host/config_vclplug.h.in configure.ac include/comphelper include/vcl Repository.mk solenv/clang-format vcl/android vcl
Rebased ref, commits from common ancestor: commit c2dfc38ac808b756efeb7aba8c2ab0108a242877 Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 12:23:36 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Thu Sep 13 15:06:35 2018 +0200 Unify sal plugin loaders Change-Id: Ic099761eaff80349e985ccf62e3f4aa6b2e98022 diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 92a422cb7072..235110e5eba1 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -259,8 +259,6 @@ public: platform specific data structures. @attention The initialization of the application itself is done in Init() - -@seeInitSalData is implemented by platform specific code. */ Application(); @@ -268,9 +266,6 @@ public: Deinitializes the LibreOffice global instance data structure, then deinitializes any platform specific data structures. - - @see ImplDeInitSVData deinitializes the global instance data, -DeInitSalData is implemented by platform specific code */ virtual ~Application(); diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index bcb5733ee12a..1b9f24a6c8a6 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -17915,7 +17915,6 @@ 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 @@ -17958,6 +17957,7 @@ vcl/source/app/dndhelp.cxx vcl/source/app/help.cxx vcl/source/app/i18nhelp.cxx vcl/source/app/idle.cxx +vcl/source/app/salplug.cxx vcl/source/app/salusereventlist.cxx vcl/source/app/salvtables.cxx vcl/source/app/scheduler.cxx @@ -18323,7 +18323,6 @@ vcl/unx/generic/gdi/xrender_peer.cxx vcl/unx/generic/gdi/xrender_peer.hxx vcl/unx/generic/glyphs/freetype_glyphcache.cxx vcl/unx/generic/glyphs/glyphcache.cxx -vcl/unx/generic/plugadapt/salplug.cxx vcl/unx/generic/print/bitmap_gfx.cxx vcl/unx/generic/print/common_gfx.cxx vcl/unx/generic/print/genprnpsp.cxx @@ -18447,7 +18446,6 @@ vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx -vcl/win/salplug.cxx vcl/win/app/saldata.cxx vcl/win/app/salinfo.cxx vcl/win/app/salinst.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 975f6790ad4f..f5564c59b7bb 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -490,7 +490,7 @@ vcl_headless_freetype_code=\ ifeq ($(USING_X11),TRUE) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/unx/generic/plugadapt/salplug \ +vcl/source/app/salplug \ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/gdi/nativewindowhandleprovider \ @@ -579,7 +579,7 @@ $(eval $(call gb_Library_add_libs,vcl,\ )) $(eval $(call gb_Library_add_exception_objects,vcl, \ -$(if $(or $(ENABLE_QT5),$(ENABLE_KDE5)),vcl/unx/generic/plugadapt/salplug) \ +$(if $(or $(ENABLE_QT5),$(ENABLE_KDE5)),vcl/source/app/salplug) \ )) $(eval $(call gb_Library_use_externals,vcl,\ @@ -641,7 +641,7 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\ )) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/osx/salplug \ +vcl/source/app/salplug \ )) endif @@ -649,7 +649,7 @@ ifeq ($(OS),WNT) $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/opengl/win/WinDeviceInfo \ vcl/opengl/win/blocklist_parser \ -vcl/win/salplug \ +vcl/source/app/salplug \ )) $(eval $(call gb_Library_use_system_win32_libs,vcl,\ diff --git a/vcl/README b/vcl/README index ae0408b830a2..5a869ef77b9f 100644 --- a/vcl/README +++ b/vcl/README @@ -80,7 +80,7 @@ LibreOffice (and OpenOffice). == COM threading == The way COM is used in LO generally: -- vcl InitSalData() puts main thread into Single-threaded Apartment (STA) +- vcl puts main thread into Single-threaded Apartment (STA) - oslWorkerWrapperFunction() puts every thread spawned via oslCreateThread() into MTA (free-threaded) diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx index 42830ef66dbf..da3889145bb7 100644 --- a/vcl/android/androidinst.cxx +++ b/vcl/android/androidinst.cxx @@ -152,11 +152,6 @@ SalFrame *AndroidSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags return new AndroidSalFrame( this, pParent, nStyle ); } -// All the interesting stuff is slaved from the AndroidSalInstance -void InitSalData() {} -void DeInitSalData() {} -void InitSalMain() {} - void SalAbort( const OUString& rErrorText, bool bDumpCore ) { OUString aError( rErrorText ); diff --git a/vcl/headless/headlessinst.cxx b/vcl/headless/headlessinst.cxx index 8326592c7da0..cd9982e208da 100644 --- a/vcl/headless/headlessinst.cxx +++ b/vcl/headless/headlessinst.cxx @@ -51,11 +51,6 @@ public: virtual bool ErrorTrapPop( bool ) override { return false; } }; -/
[Libreoffice-commits] core.git: Branch 'feature/qt5-win+mac' - 13 commits - compilerplugins/clang config_host/config_vclplug.h.in configure.ac include/comphelper include/vcl include/xmloff officecfg/r
Rebased ref, commits from common ancestor: commit 98808c00387aa0714ead291cbe4a1ddb90024afe Author: Jan-Marek Glogowski AuthorDate: Thu Sep 13 12:23:36 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Thu Sep 13 12:36:50 2018 + Unify sal plugin loaders Change-Id: Ic099761eaff80349e985ccf62e3f4aa6b2e98022 diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 92a422cb7072..235110e5eba1 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -259,8 +259,6 @@ public: platform specific data structures. @attention The initialization of the application itself is done in Init() - -@seeInitSalData is implemented by platform specific code. */ Application(); @@ -268,9 +266,6 @@ public: Deinitializes the LibreOffice global instance data structure, then deinitializes any platform specific data structures. - - @see ImplDeInitSVData deinitializes the global instance data, -DeInitSalData is implemented by platform specific code */ virtual ~Application(); diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index bcb5733ee12a..1b9f24a6c8a6 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -17915,7 +17915,6 @@ 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 @@ -17958,6 +17957,7 @@ vcl/source/app/dndhelp.cxx vcl/source/app/help.cxx vcl/source/app/i18nhelp.cxx vcl/source/app/idle.cxx +vcl/source/app/salplug.cxx vcl/source/app/salusereventlist.cxx vcl/source/app/salvtables.cxx vcl/source/app/scheduler.cxx @@ -18323,7 +18323,6 @@ vcl/unx/generic/gdi/xrender_peer.cxx vcl/unx/generic/gdi/xrender_peer.hxx vcl/unx/generic/glyphs/freetype_glyphcache.cxx vcl/unx/generic/glyphs/glyphcache.cxx -vcl/unx/generic/plugadapt/salplug.cxx vcl/unx/generic/print/bitmap_gfx.cxx vcl/unx/generic/print/common_gfx.cxx vcl/unx/generic/print/genprnpsp.cxx @@ -18447,7 +18446,6 @@ vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx -vcl/win/salplug.cxx vcl/win/app/saldata.cxx vcl/win/app/salinfo.cxx vcl/win/app/salinst.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 975f6790ad4f..f5564c59b7bb 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -490,7 +490,7 @@ vcl_headless_freetype_code=\ ifeq ($(USING_X11),TRUE) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/unx/generic/plugadapt/salplug \ +vcl/source/app/salplug \ vcl/unx/generic/printer/jobdata \ vcl/unx/generic/printer/ppdparser \ vcl/unx/generic/gdi/nativewindowhandleprovider \ @@ -579,7 +579,7 @@ $(eval $(call gb_Library_add_libs,vcl,\ )) $(eval $(call gb_Library_add_exception_objects,vcl, \ -$(if $(or $(ENABLE_QT5),$(ENABLE_KDE5)),vcl/unx/generic/plugadapt/salplug) \ +$(if $(or $(ENABLE_QT5),$(ENABLE_KDE5)),vcl/source/app/salplug) \ )) $(eval $(call gb_Library_use_externals,vcl,\ @@ -641,7 +641,7 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,vcl,\ )) $(eval $(call gb_Library_add_exception_objects,vcl,\ -vcl/osx/salplug \ +vcl/source/app/salplug \ )) endif @@ -649,7 +649,7 @@ ifeq ($(OS),WNT) $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/opengl/win/WinDeviceInfo \ vcl/opengl/win/blocklist_parser \ -vcl/win/salplug \ +vcl/source/app/salplug \ )) $(eval $(call gb_Library_use_system_win32_libs,vcl,\ diff --git a/vcl/README b/vcl/README index ae0408b830a2..5a869ef77b9f 100644 --- a/vcl/README +++ b/vcl/README @@ -80,7 +80,7 @@ LibreOffice (and OpenOffice). == COM threading == The way COM is used in LO generally: -- vcl InitSalData() puts main thread into Single-threaded Apartment (STA) +- vcl puts main thread into Single-threaded Apartment (STA) - oslWorkerWrapperFunction() puts every thread spawned via oslCreateThread() into MTA (free-threaded) diff --git a/vcl/android/androidinst.cxx b/vcl/android/androidinst.cxx index 42830ef66dbf..da3889145bb7 100644 --- a/vcl/android/androidinst.cxx +++ b/vcl/android/androidinst.cxx @@ -152,11 +152,6 @@ SalFrame *AndroidSalInstance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags return new AndroidSalFrame( this, pParent, nStyle ); } -// All the interesting stuff is slaved from the AndroidSalInstance -void InitSalData() {} -void DeInitSalData() {} -void InitSalMain() {} - void SalAbort( const OUString& rErrorText, bool bDumpCore ) { OUString aError( rErrorText ); diff --git a/vcl/headless/headlessinst.cxx b/vcl/headless/headlessinst.cxx index 8326592c7da0..cd9982e208da 100644 --- a/vcl/headless/headlessinst.cxx +++ b/vcl/headless/headlessinst.cxx @@ -51,11 +51,6 @@ public: virtual bool ErrorTrapPop( bool ) override { return false; } }; -/
[Libreoffice-commits] core.git: Branch 'feature/qt5-win' - 0 commits -
Rebased ref, commits from common ancestor: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5-win' - include/vcl Repository.mk vcl/inc vcl/Library_vcl.mk vcl/Library_vclplug_osx.mk vcl/Module_vcl.mk vcl/osx vcl/source
Repository.mk |1 include/vcl/ImageTree.hxx |2 include/vcl/svmain.hxx|2 include/vcl/window.hxx|2 vcl/Library_vcl.mk| 113 +++- vcl/Library_vclplug_osx.mk| 195 ++ vcl/Module_vcl.mk |1 vcl/inc/bmpfast.hxx |4 vcl/inc/osx/salinst.h |5 - vcl/inc/salinst.hxx |4 vcl/inc/vclpluginapi.h|6 + vcl/osx/saldata.cxx |8 + vcl/osx/salinst.cxx | 137 +++-- vcl/osx/salmenu.cxx | 190 +++- vcl/osx/salplug.cxx | 167 +++ vcl/osx/vclnsapp.mm | 16 --- vcl/source/app/svmain.cxx | 10 -- vcl/source/app/svmainhook.cxx | 34 --- 18 files changed, 528 insertions(+), 369 deletions(-) New commits: commit 55a591004d84bf4a5c5814c9e5ff7dd73f3c Author: Jan-Marek Glogowski AuthorDate: Wed Sep 12 19:56:39 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Wed Sep 12 18:03:52 2018 + Make osx a vclplug Also removes this nested NSApplicationMain calling. Now builds our own app menu. Still needs passing of debug options to cocoa. Change-Id: I4179ec6e03b5e3d7ba9dd4cee38aa51cb452d20f diff --git a/Repository.mk b/Repository.mk index bf5af2f647c2..fff511dc8fed 100644 --- a/Repository.mk +++ b/Repository.mk @@ -485,6 +485,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ AppleRemote \ ) \ fps_aqua \ + vclplug_osx \ MacOSXSpell \ ) \ )) diff --git a/include/vcl/ImageTree.hxx b/include/vcl/ImageTree.hxx index 66a82b000ebc..6598c34c09e9 100644 --- a/include/vcl/ImageTree.hxx +++ b/include/vcl/ImageTree.hxx @@ -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 diff --git a/include/vcl/svmain.hxx b/include/vcl/svmain.hxx index c4437b27d556..6305c090d289 100644 --- a/include/vcl/svmain.hxx +++ b/include/vcl/svmain.hxx @@ -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(); diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index fc74f2918ab5..ef26ea68e1bf 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -555,7 +555,7 @@ public: SalFrame* ImplGetFrame() const; SAL_DLLPRIVATE ImplFrameData* ImplGetFrameData(); -SAL_DLLPRIVATE vcl::Window* ImplGetWindow(); +SAL_DLLPUBLIC 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 = 0x, sal_uInt16* pIndex = nullptr ); diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index a2e66ebba63b..1c7fc607f5a1 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -373,7 +373,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/app/svapp \ vcl/source/app/svdata \ vcl/source/app/svmain \ -vcl/source/app/svmainhook \ vcl/source/app/timer \ vcl/source/app/unohelp2 \ vcl/source/app/unohelp \ @@ -444,7 +443,11 @@ $(eval $(call gb_Library_add_cobjects,vcl,\ vcl/source/filter/jpeg/transupp \ )) -# optional parts +ifneq ($(ENABLE_MACOSX_SANDBOX),TRUE) +$(eval $(call gb_Library_use_libraries,vcl,\ +AppleRemote \ +)) +endif vcl_quartz_code= \ vcl/quartz/salbmp \ @@ -456,100 +459,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/a11y
[Libreoffice-commits] core.git: Branch 'feature/qt5-win' - 90 commits - avmedia/source basctl/source basegfx/source binaryurp/source bin/find-unneeded-includes canvas/source chart2/IwyuFilter_chart2.y
Rebased ref, commits from common ancestor: commit 84e3c51aa147fd071a2c94c95dcfef08a4f7a556 Author: Jan-Marek Glogowski AuthorDate: Wed Sep 12 10:30:05 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Wed Sep 12 09:07:01 2018 + QT5 build VCL plugin on Windows Change-Id: I1bb673eb2c228d767caca6a9a860bd9d113d082f diff --git a/Repository.mk b/Repository.mk index 73432c0112e3..bf5af2f647c2 100644 --- a/Repository.mk +++ b/Repository.mk @@ -476,6 +476,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ado \ oleautobridge \ smplmail \ + $(if $(ENABLE_QT5),vclplug_qt5) \ vclplug_win \ wininetbe1 \ ) \ diff --git a/config_host/config_vclplug.h.in b/config_host/config_vclplug.h.in index be9c136245ee..c02853d5282d 100644 --- a/config_host/config_vclplug.h.in +++ b/config_host/config_vclplug.h.in @@ -11,5 +11,6 @@ Settings about which X11 desktops have support enabled. #define ENABLE_KDE4 0 #define ENABLE_KDE5 0 #define ENABLE_GTK3_KDE5 0 +#define ENABLE_QT5 0 #endif diff --git a/configure.ac b/configure.ac index 685408e99062..768376b4b547 100644 --- a/configure.ac +++ b/configure.ac @@ -636,6 +636,7 @@ cygwin*|interix*) test_xrender=no test_freetype=no test_fontconfig=no +test_qt5=yes _os=WINNT DLLPOST=".dll" @@ -4677,7 +4678,6 @@ if test "$USING_X11" != TRUE; then build_gstreamer_0_10=no test_kde4=no test_kde5=no -test_qt5=no test_gtk3_kde5=no enable_cairo_canvas=no fi @@ -10016,10 +10016,16 @@ dnl === dnl Test which vclplugs have to be built. dnl === R="" -if test "$USING_X11" != TRUE; then +if test "$USING_X11" = TRUE; then +R="gen" +else enable_gtk=no enable_gtk3=no +if test "$_os" = "WINNT"; then +R="win" +fi fi + GTK3_CFLAGS="" GTK3_LIBS="" ENABLE_GTK3="" @@ -10030,7 +10036,7 @@ if test "x$enable_gtk3" = "xyes"; then : ${with_system_cairo:=yes} PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.18 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="") if test "x$ENABLE_GTK3" = "xTRUE"; then -R="gtk3" +R=" gtk3" dnl Avoid installed by unpackaged files for now. if test -z "$PKGFORMAT"; then GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION) @@ -11165,7 +11171,11 @@ then fi qt5_test_include="QtWidgets/qapplication.h" -qt5_test_library="libQt5Widgets.so" +if test $_os == "WINNT"; then +qt5_test_library="Qt5Widgets.lib" +else +qt5_test_library="libQt5Widgets.so" +fi dnl Check for qmake5 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] ) @@ -11187,6 +11197,10 @@ then qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs" qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs" +if test $_os == "WINNT"; then +qt5_incdirs="`cygpath -m $qt5_incdirs`" +qt5_libdirs="`cygpath -m $qt5_libdirs`" +fi AC_MSG_CHECKING([for Qt5 headers]) qt5_incdir="no" @@ -11216,7 +11230,11 @@ then QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT" QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g") -QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network" +if test $_os == "WINNT"; then +QT5_LIBS="-LIBPATH:$qt5_libdir Qt5Core.lib Qt5Gui.lib Qt5Widgets.lib Qt5Network.lib" +else +QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network" +fi dnl Check for Meta Object Compiler diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index d66a82319ed2..782bea8707a9 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -35,6 +35,7 @@ $(eval $(call gb_Library_use_sdk_api,vclplug_qt5)) $(eval $(call gb_Library_use_libraries,vclplug_qt5,\ $(if $(USING_X11),vclplug_gen) \ +$(if $(filter WNT,$(OS)),vclplug_win) \ vcl \ tl \ utl \ @@ -54,7 +55,7 @@ $(eval $(call gb_Library_use_libraries,vclplug_qt5,\ $(eval $(call gb_Library_use_externals,vclplug_qt5,\ boost_headers \ -cairo \ +$(if $(USING_X11),cairo) \ epoxy \ graphite \ harfbuzz \ @@ -97,7 +98,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ -vcl/qt5/Qt5System \ +$(if $(USING_X11),vcl/qt5/Qt5System) \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ vcl/qt5/Qt5VirtualDevice \ @@ -106,9 +107,9 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_libs,vclplug_qt5,\ - -lm \ - -ldl \ - -lpthread \ +
[Libreoffice-commits] core.git: Branch 'feature/qt5-win' - 2 commits - config_host/config_vclplug.h.in configure.ac include/vcl Repository.mk vcl/inc vcl/Library_vcl.mk vcl/Library_vclplug_qt5.mk vcl/
Rebased ref, commits from common ancestor: commit 96e80d95d74ee419a7caf04d2d044f4dd6c495f2 Author: Jan-Marek Glogowski AuthorDate: Wed Sep 12 10:30:05 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Wed Sep 12 10:33:13 2018 +0200 QT5 build VCL plugin on Windows Change-Id: I1bb673eb2c228d767caca6a9a860bd9d113d082f diff --git a/Repository.mk b/Repository.mk index 73432c0112e3..bf5af2f647c2 100644 --- a/Repository.mk +++ b/Repository.mk @@ -476,6 +476,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ado \ oleautobridge \ smplmail \ + $(if $(ENABLE_QT5),vclplug_qt5) \ vclplug_win \ wininetbe1 \ ) \ diff --git a/config_host/config_vclplug.h.in b/config_host/config_vclplug.h.in index be9c136245ee..c02853d5282d 100644 --- a/config_host/config_vclplug.h.in +++ b/config_host/config_vclplug.h.in @@ -11,5 +11,6 @@ Settings about which X11 desktops have support enabled. #define ENABLE_KDE4 0 #define ENABLE_KDE5 0 #define ENABLE_GTK3_KDE5 0 +#define ENABLE_QT5 0 #endif diff --git a/configure.ac b/configure.ac index 9861188660e2..1058d0dedf3e 100644 --- a/configure.ac +++ b/configure.ac @@ -636,6 +636,7 @@ cygwin*|interix*) test_xrender=no test_freetype=no test_fontconfig=no +test_qt5=yes _os=WINNT DLLPOST=".dll" @@ -4679,7 +4680,6 @@ if test "$USING_X11" != TRUE; then build_gstreamer_0_10=no test_kde4=no test_kde5=no -test_qt5=no test_gtk3_kde5=no enable_cairo_canvas=no fi @@ -9960,10 +9960,16 @@ dnl === dnl Test which vclplugs have to be built. dnl === R="" -if test "$USING_X11" != TRUE; then +if test "$USING_X11" = TRUE; then +R="gen" +else enable_gtk=no enable_gtk3=no +if test "$_os" = "WINNT"; then +R="win" +fi fi + GTK3_CFLAGS="" GTK3_LIBS="" ENABLE_GTK3="" @@ -9974,7 +9980,7 @@ if test "x$enable_gtk3" = "xyes"; then : ${with_system_cairo:=yes} PKG_CHECK_MODULES(GTK3, gtk+-3.0 >= 3.18 gtk+-unix-print-3.0 gmodule-no-export-2.0 glib-2.0 >= 2.38 cairo, ENABLE_GTK3="TRUE", ENABLE_GTK3="") if test "x$ENABLE_GTK3" = "xTRUE"; then -R="gtk3" +R=" gtk3" dnl Avoid installed by unpackaged files for now. if test -z "$PKGFORMAT"; then GOBJECT_INTROSPECTION_CHECK(INTROSPECTION_REQUIRED_VERSION) @@ -11109,7 +5,11 @@ then fi qt5_test_include="QtWidgets/qapplication.h" -qt5_test_library="libQt5Widgets.so" +if test $_os == "WINNT"; then +qt5_test_library="Qt5Widgets.lib" +else +qt5_test_library="libQt5Widgets.so" +fi dnl Check for qmake5 AC_PATH_PROGS( QMAKE5, [qmake-qt5 qmake], no, [$QT5DIR/bin:$PATH] ) @@ -11131,6 +11141,10 @@ then qt5_incdirs="`$QMAKE5 -query QT_INSTALL_HEADERS` $qt5_incdirs" qt5_libdirs="`$QMAKE5 -query QT_INSTALL_LIBS` $qt5_libdirs" +if test $_os == "WINNT"; then +qt5_incdirs="`cygpath -m $qt5_incdirs`" +qt5_libdirs="`cygpath -m $qt5_libdirs`" +fi AC_MSG_CHECKING([for Qt5 headers]) qt5_incdir="no" @@ -11160,7 +11174,11 @@ then QT5_CFLAGS="-I$qt5_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT" QT5_CFLAGS=$(printf '%s' "$QT5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g") -QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network" +if test $_os == "WINNT"; then +QT5_LIBS="-LIBPATH:$qt5_libdir Qt5Core.lib Qt5Gui.lib Qt5Widgets.lib Qt5Network.lib" +else +QT5_LIBS="-L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network" +fi dnl Check for Meta Object Compiler diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index d66a82319ed2..782bea8707a9 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -35,6 +35,7 @@ $(eval $(call gb_Library_use_sdk_api,vclplug_qt5)) $(eval $(call gb_Library_use_libraries,vclplug_qt5,\ $(if $(USING_X11),vclplug_gen) \ +$(if $(filter WNT,$(OS)),vclplug_win) \ vcl \ tl \ utl \ @@ -54,7 +55,7 @@ $(eval $(call gb_Library_use_libraries,vclplug_qt5,\ $(eval $(call gb_Library_use_externals,vclplug_qt5,\ boost_headers \ -cairo \ +$(if $(USING_X11),cairo) \ epoxy \ graphite \ harfbuzz \ @@ -97,7 +98,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ -vcl/qt5/Qt5System \ +$(if $(USING_X11),vcl/qt5/Qt5System) \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ vcl/qt5/Qt5VirtualDevice \ @@ -106,9 +107,9 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_libs,vclplug_qt5,\ - -lm \ - -ldl \ - -lpthread \ +-lm
[Libreoffice-commits] core.git: Branch 'feature/qt5-win' - Repository.mk vcl/Library_vclplug_qt5.mk vcl/Library_vclplug_win.mk vcl/qt5 vcl/win
Repository.mk |2 +- vcl/Library_vclplug_qt5.mk|8 vcl/Library_vclplug_win.mk|2 +- vcl/qt5/Qt5Data.cxx | 12 ++-- vcl/win/gdi/salprn.cxx|7 ++- vcl/win/plugadapt/salplug.cxx | 15 --- 6 files changed, 22 insertions(+), 24 deletions(-) New commits: commit 2c11cfad90e2e394bd6c23e17c8c82d0c991e6e7 Author: Jan-Marek Glogowski AuthorDate: Tue Sep 11 14:02:22 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Tue Sep 11 16:02:34 2018 +0200 First working version with qt5 on Windows Change-Id: I22846705c65209b796a4d4a1baaa3832c27eeb3e diff --git a/Repository.mk b/Repository.mk index 3076c6a55aab..260310dd54af 100644 --- a/Repository.mk +++ b/Repository.mk @@ -476,6 +476,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,ooo, \ ado \ oleautobridge \ smplmail \ +$(if $(ENABLE_QT5),vclplug_qt5) \ vclplug_win \ wininetbe1 \ ) \ @@ -653,7 +654,6 @@ $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \ inprocserv \ UAccCOM \ winaccessibility \ -$(if $(ENABLE_QT5),vclplug_qt5) \ ) \ )) diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index c46856d5db9f..782bea8707a9 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -35,7 +35,7 @@ $(eval $(call gb_Library_use_sdk_api,vclplug_qt5)) $(eval $(call gb_Library_use_libraries,vclplug_qt5,\ $(if $(USING_X11),vclplug_gen) \ - $(if $(filter WNT,$(OS)),vclplug_win) \ +$(if $(filter WNT,$(OS)),vclplug_win) \ vcl \ tl \ utl \ @@ -107,9 +107,9 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_libs,vclplug_qt5,\ - -lm \ - -ldl \ - -lpthread \ +-lm \ +-ldl \ +-lpthread \ )) endif diff --git a/vcl/Library_vclplug_win.mk b/vcl/Library_vclplug_win.mk index f26e0afa390c..587f5c02f32b 100644 --- a/vcl/Library_vclplug_win.mk +++ b/vcl/Library_vclplug_win.mk @@ -64,7 +64,7 @@ $(eval $(call gb_Library_use_libraries,vclplug_win,\ $(eval $(call gb_Library_use_externals,vclplug_win,\ boost_headers \ epoxy \ - glm_headers \ +glm_headers \ graphite \ harfbuzz \ icu_headers \ diff --git a/vcl/qt5/Qt5Data.cxx b/vcl/qt5/Qt5Data.cxx index b01e969f8296..50175c79758a 100644 --- a/vcl/qt5/Qt5Data.cxx +++ b/vcl/qt5/Qt5Data.cxx @@ -149,14 +149,22 @@ #include #include -// #include +#ifndef _WIN32 +#include +#endif -Qt5Data::Qt5Data(SalInstance* /* pInstance */) +Qt5Data::Qt5Data(SalInstance* pInstance) #ifndef _WIN32 : GenericUnixSalData(SAL_DATA_QT5, pInstance) , m_pGlyphCache(new GlyphCache()) +#else +: SalData() #endif { +#ifdef _WIN32 +m_pInstance = pInstance; +SetSalData(this); +#endif ImplSVData* pSVData = ImplGetSVData(); // draw toolbars on separate lines diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 4e2b7788ce05..119f27c20b44 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -1287,6 +1287,7 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ ) { SalData*pSalData = GetSalData(); WinSalPrinter* pPrinter; +int i = 0; boolbWhile = true; // Ensure we handle the mutex which will be released in WinSalInstance::DoYield @@ -1295,6 +1296,10 @@ BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ ) { // process messages bWhile = Application::Reschedule( true ); +if (i > 15) +bWhile = false; +else +++i; pPrinter = pSalData->mpFirstPrinter; while ( pPrinter ) @@ -1457,7 +1462,7 @@ bool WinSalPrinter::StartJob( const OUString* pFileName, // As the Telecom Balloon Fax driver tends to send messages repeatedly // we try to process first all, and then insert a dummy message -while ( Application::Reschedule( true ) ); +for (int i = 0; Application::Reschedule( true ) && i <= 15; ++i); BOOL const ret = PostMessageW(GetSalData()->mpInstance->mhComWnd, SAL_MSG_DUMMY, 0, 0); SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); diff --git a/vcl/win/plugadapt/salplug.cxx b/vcl/win/plugadapt/salplug.cxx index 17124cc23e98..706d3564a367 100644 --- a/vcl/win/plugadapt/salplug.cxx +++ b/vcl/win/plugadapt/salplug.cxx @@ -83,21 +83,6 @@ static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = fals { pCloseModule = static_cast(aMod); aMod.release(); - -#ifndef ANDROID -/* - * Recent GTK+ versions load their modules with RTLD_LOCAL, so we can - * not access the 'gnome_accessibility_module_shutdown' anymore. -
[Libreoffice-commits] core.git: Branch 'feature/qt5-win' - 2 commits - vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5 vcl/win
vcl/Library_vclplug_qt5.mk|4 +-- vcl/inc/fontselect.hxx|2 - vcl/inc/fontsubset.hxx|2 - vcl/inc/helpwin.hxx |2 - vcl/inc/opengl/FixedTextureAtlas.hxx |3 ++ vcl/inc/opengl/PackedTextureAtlas.hxx |3 ++ vcl/inc/qt5/Qt5Frame.hxx |2 + vcl/inc/qt5/Qt5Graphics.hxx |4 +++ vcl/inc/qt5/Qt5Instance.hxx | 35 +++--- vcl/inc/qt5/Qt5Printer.hxx|2 + vcl/inc/qt5/Qt5System.hxx | 14 - vcl/inc/salprn.hxx|3 ++ vcl/inc/salsys.hxx|2 - vcl/inc/sft.hxx | 10 - vcl/inc/svdata.hxx|2 - vcl/inc/unx/geninst.h |5 vcl/inc/vclpluginapi.h|6 + vcl/inc/win/salprn.h |2 - vcl/inc/win/salsys.h |4 ++- vcl/qt5/Qt5Instance.cxx | 28 +++ vcl/qt5/Qt5Instance_Print.cxx | 14 + vcl/qt5/Qt5Printer.cxx|5 ++-- vcl/win/app/salinst.cxx |8 ++- vcl/win/plugadapt/salplug.cxx |7 -- 24 files changed, 134 insertions(+), 35 deletions(-) New commits: commit af83477ea96c26029a170fe8d88dbf773cff2084 Author: Jan-Marek Glogowski AuthorDate: Mon Sep 10 18:43:36 2018 +0200 Commit: Jan-Marek Glogowski CommitDate: Mon Sep 10 18:43:46 2018 +0200 more link and compile fixes initial working win plugin, still crashes on shutdown. Change-Id: If8d69fcd8807215617d0604bf89f834602dde4ee diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 491c10985a34..c46856d5db9f 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -97,13 +97,13 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Menu \ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ -vcl/qt5/Qt5System \ +vcl/qt5/Qt5Printer \ +$(if $(USING_X11),vcl/qt5/Qt5System) \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ vcl/qt5/Qt5VirtualDevice \ vcl/qt5/Qt5Widget \ )) -# vcl/qt5/Qt5Printer \ ifeq ($(OS),LINUX) $(eval $(call gb_Library_add_libs,vclplug_qt5,\ diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx index 3821627c17ae..626b36521f78 100644 --- a/vcl/inc/qt5/Qt5Frame.hxx +++ b/vcl/inc/qt5/Qt5Frame.hxx @@ -114,7 +114,9 @@ public: void Damage(sal_Int32 nExtentsX, sal_Int32 nExtentsY, sal_Int32 nExtentsWidth, sal_Int32 nExtentsHeight) const; +#ifndef _WIN32 virtual void InitSvpSalGraphics(SvpSalGraphics* pSvpSalGraphics); +#endif virtual SalGraphics* AcquireGraphics() override; virtual void ReleaseGraphics(SalGraphics* pGraphics) override; diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx index e68e55e8a5ef..5064e2677640 100644 --- a/vcl/inc/qt5/Qt5Instance.hxx +++ b/vcl/inc/qt5/Qt5Instance.hxx @@ -20,7 +20,6 @@ #pragma once #include -#include #include #include @@ -31,8 +30,27 @@ class QApplication; class SalYieldMutex; class SalFrame; +#ifndef _WIN32 +#include +#else +#include +#include + +class SalYieldMutex : public comphelper::SolarMutex +{ +SalYieldMutex( const SalYieldMutex& ) = delete; +SalYieldMutex& operator=( const SalYieldMutex& ) = delete; + +public: +SalYieldMutex(); +}; + +#endif + class VCLPLUG_QT5_PUBLIC Qt5Instance : public QObject, - public SalGenericInstance, +// moc doesn't understand _WIN32 +// public SalGenericInstance, + public SalInstance, public SalUserEventList { Q_OBJECT @@ -41,6 +59,10 @@ class VCLPLUG_QT5_PUBLIC Qt5Instance : public QObject, int m_postUserEventId; const bool m_bUseCairo; +#ifdef _WIN32 +std::unique_ptr m_pSalYieldMutex; +#endif + public: std::unique_ptr m_pQApplication; std::unique_ptr m_pFakeArgvFreeable; @@ -78,7 +100,13 @@ public: virtual void GetPrinterQueueState(SalPrinterQueueInfo* pInfo) override; virtual void DeletePrinterQueueInfo(SalPrinterQueueInfo* pInfo) override; virtual OUString GetDefaultPrinter() override; +#ifndef _WIN32 virtual void PostPrintersChanged() override; +#endif + +virtual comphelper::SolarMutex* GetYieldMutex() override; +virtual sal_uInt32 ReleaseYieldMutexAll() override; +virtual void AcquireYieldMutex( sal_uInt32 nCount = 1 ) override; virtual std::unique_ptr CreateMenu(bool, Menu*) override; virtual std::unique_ptr CreateMenuItem(const SalItemParams&) override; @@ -96,8 +124,9 @@ public: virtual void AddToRecentDocumentList(const OUString& rFileUrl, const OUString& rMimeType, const OUS
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 6 commits - icon-themes/colibre icon-themes/colibre_svg include/vcl vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5 vcl/source vcl/unx
Rebased ref, commits from common ancestor: commit fa62b9c4b857eab162282972bc33d2aa001f73e4 Author: Katarina Behrens Date: Fri Jul 6 16:35:13 2018 +0200 Implement reading screen count and screen geometry this improves restoring window location should it be within the secondary screen Change-Id: Iaac6bcead6bfcb7ae9eda579e5a4ad6b2482cc39 diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx index 0de1940d9eff..ca533923913b 100644 --- a/vcl/qt5/Qt5System.cxx +++ b/vcl/qt5/Qt5System.cxx @@ -7,21 +7,23 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include +#include + #include #include #include +#include Qt5System::Qt5System() {} Qt5System::~Qt5System() {} -unsigned int Qt5System::GetDisplayScreenCount() { return 1; } +unsigned int Qt5System::GetDisplayScreenCount() { return QApplication::desktop()->screenCount(); } tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) { -tools::Rectangle aRect; -if (nScreen == 0) -aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); -return aRect; +QRect qRect = QApplication::desktop()->screenGeometry(nScreen); +return toRectangle(qRect); } int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector&) commit 1bb7761b0aa0c7c62806ccf8a8fde365d640cb37 Author: Katarina Behrens Date: Thu Jul 5 11:45:45 2018 +0200 Basic Qt5 system display data copied from dummy headless implementation Change-Id: I1b184745627acd065b4c0cc54f044c47ec980c93 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 4fcd649e1777..1ad01555ed3a 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -96,6 +96,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ +vcl/qt5/Qt5System \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ vcl/qt5/Qt5VirtualDevice \ diff --git a/vcl/inc/qt5/Qt5System.hxx b/vcl/inc/qt5/Qt5System.hxx new file mode 100644 index ..fbc753757b36 --- /dev/null +++ b/vcl/inc/qt5/Qt5System.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/. + */ + +#pragma once + +#include +#include + +class Qt5System : public SalGenericSystem +{ +public: +Qt5System(); +virtual ~Qt5System() override; + +virtual unsigned int GetDisplayScreenCount() override; +virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) override; +virtual int ShowNativeDialog(const OUString& rTitle, const OUString& rMessage, + const std::vector& rButtons) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 6ea2610e03f7..fc06d47d317b 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ #include #include -#include #include Qt5Instance::Qt5Instance(SalYieldMutex* pMutex, bool bUseCairo) @@ -128,7 +128,7 @@ std::unique_ptr Qt5Instance::CreateMenuItem(const SalItemParams& rI SalTimer* Qt5Instance::CreateSalTimer() { return new Qt5Timer(); } -SalSystem* Qt5Instance::CreateSalSystem() { return new SvpSalSystem(); } +SalSystem* Qt5Instance::CreateSalSystem() { return new Qt5System(); } std::shared_ptr Qt5Instance::CreateSalBitmap() { diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx new file mode 100644 index ..0de1940d9eff --- /dev/null +++ b/vcl/qt5/Qt5System.cxx @@ -0,0 +1,32 @@ +/* -*- 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/. + */ + +#include +#include +#include + +Qt5System::Qt5System() {} +Qt5System::~Qt5System() {} + +unsigned int Qt5System::GetDisplayScreenCount() { return 1; } + +tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) +{ +tools::Rectangle aRect; +if (nScreen == 0) +aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); +return aRect; +} + +int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector&) +{ +return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 5f33fa5ded2bb168a51f2b6f8e42a1373d15a0ac Author: Katarina Behrens Date: Thu Jul 5 11:28:39 2018 +0200 Don't d
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 7 commits - sw/inc sw/source translations vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5 vcl/source vcl/unx
Rebased ref, commits from common ancestor: commit 73e7c823fe604ef046622ed6dc9ee42dc1326bc2 Author: Katarina Behrens Date: Fri Jul 6 16:35:13 2018 +0200 Implement reading screen count and screen geometry this improves restoring window location should it be within the secondary screen Change-Id: Iaac6bcead6bfcb7ae9eda579e5a4ad6b2482cc39 diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx index 0de1940d9eff..ca533923913b 100644 --- a/vcl/qt5/Qt5System.cxx +++ b/vcl/qt5/Qt5System.cxx @@ -7,21 +7,23 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include +#include + #include #include #include +#include Qt5System::Qt5System() {} Qt5System::~Qt5System() {} -unsigned int Qt5System::GetDisplayScreenCount() { return 1; } +unsigned int Qt5System::GetDisplayScreenCount() { return QApplication::desktop()->screenCount(); } tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) { -tools::Rectangle aRect; -if (nScreen == 0) -aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); -return aRect; +QRect qRect = QApplication::desktop()->screenGeometry(nScreen); +return toRectangle(qRect); } int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector&) commit bc1945d264765ee87463a3cfb017b4b42312d361 Author: Katarina Behrens Date: Thu Jul 5 11:45:45 2018 +0200 Basic Qt5 system display data copied from dummy headless implementation Change-Id: I1b184745627acd065b4c0cc54f044c47ec980c93 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 4fcd649e1777..1ad01555ed3a 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -96,6 +96,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ +vcl/qt5/Qt5System \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ vcl/qt5/Qt5VirtualDevice \ diff --git a/vcl/inc/qt5/Qt5System.hxx b/vcl/inc/qt5/Qt5System.hxx new file mode 100644 index ..fbc753757b36 --- /dev/null +++ b/vcl/inc/qt5/Qt5System.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/. + */ + +#pragma once + +#include +#include + +class Qt5System : public SalGenericSystem +{ +public: +Qt5System(); +virtual ~Qt5System() override; + +virtual unsigned int GetDisplayScreenCount() override; +virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) override; +virtual int ShowNativeDialog(const OUString& rTitle, const OUString& rMessage, + const std::vector& rButtons) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 6ea2610e03f7..fc06d47d317b 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ #include #include -#include #include Qt5Instance::Qt5Instance(SalYieldMutex* pMutex, bool bUseCairo) @@ -128,7 +128,7 @@ std::unique_ptr Qt5Instance::CreateMenuItem(const SalItemParams& rI SalTimer* Qt5Instance::CreateSalTimer() { return new Qt5Timer(); } -SalSystem* Qt5Instance::CreateSalSystem() { return new SvpSalSystem(); } +SalSystem* Qt5Instance::CreateSalSystem() { return new Qt5System(); } std::shared_ptr Qt5Instance::CreateSalBitmap() { diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx new file mode 100644 index ..0de1940d9eff --- /dev/null +++ b/vcl/qt5/Qt5System.cxx @@ -0,0 +1,32 @@ +/* -*- 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/. + */ + +#include +#include +#include + +Qt5System::Qt5System() {} +Qt5System::~Qt5System() {} + +unsigned int Qt5System::GetDisplayScreenCount() { return 1; } + +tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) +{ +tools::Rectangle aRect; +if (nScreen == 0) +aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); +return aRect; +} + +int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector&) +{ +return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 52b736acd26b3714ea80e289ce2ef94cebb6f10c Author: Katarina Behrens Date: Thu Jul 5 11:28:39 2018 +0200 Don't d
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 218 commits - accessibility/source animations/source avmedia/source basctl/source basegfx/source basic/source bin/find-unneeded-includes bin
Rebased ref, commits from common ancestor: commit f897d09d9ec9792ec5077fd49bd3260b1782927f Author: Katarina Behrens Date: Fri Jul 6 16:35:13 2018 +0200 Implement reading screen count and screen geometry this improves restoring window location should it be within the secondary screen Change-Id: Iaac6bcead6bfcb7ae9eda579e5a4ad6b2482cc39 diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx index 0de1940d9eff..ca533923913b 100644 --- a/vcl/qt5/Qt5System.cxx +++ b/vcl/qt5/Qt5System.cxx @@ -7,21 +7,23 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include +#include + #include #include #include +#include Qt5System::Qt5System() {} Qt5System::~Qt5System() {} -unsigned int Qt5System::GetDisplayScreenCount() { return 1; } +unsigned int Qt5System::GetDisplayScreenCount() { return QApplication::desktop()->screenCount(); } tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) { -tools::Rectangle aRect; -if (nScreen == 0) -aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); -return aRect; +QRect qRect = QApplication::desktop()->screenGeometry(nScreen); +return toRectangle(qRect); } int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector&) commit 938770f669433a1336b6558aef5a971f341a7fa0 Author: Katarina Behrens Date: Thu Jul 5 11:45:45 2018 +0200 Basic Qt5 system display data copied from dummy headless implementation Change-Id: I1b184745627acd065b4c0cc54f044c47ec980c93 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 4fcd649e1777..1ad01555ed3a 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -96,6 +96,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ +vcl/qt5/Qt5System \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ vcl/qt5/Qt5VirtualDevice \ diff --git a/vcl/inc/qt5/Qt5System.hxx b/vcl/inc/qt5/Qt5System.hxx new file mode 100644 index ..fbc753757b36 --- /dev/null +++ b/vcl/inc/qt5/Qt5System.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/. + */ + +#pragma once + +#include +#include + +class Qt5System : public SalGenericSystem +{ +public: +Qt5System(); +virtual ~Qt5System() override; + +virtual unsigned int GetDisplayScreenCount() override; +virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) override; +virtual int ShowNativeDialog(const OUString& rTitle, const OUString& rMessage, + const std::vector& rButtons) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 6ea2610e03f7..fc06d47d317b 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ #include #include -#include #include Qt5Instance::Qt5Instance(SalYieldMutex* pMutex, bool bUseCairo) @@ -128,7 +128,7 @@ std::unique_ptr Qt5Instance::CreateMenuItem(const SalItemParams& rI SalTimer* Qt5Instance::CreateSalTimer() { return new Qt5Timer(); } -SalSystem* Qt5Instance::CreateSalSystem() { return new SvpSalSystem(); } +SalSystem* Qt5Instance::CreateSalSystem() { return new Qt5System(); } std::shared_ptr Qt5Instance::CreateSalBitmap() { diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx new file mode 100644 index ..0de1940d9eff --- /dev/null +++ b/vcl/qt5/Qt5System.cxx @@ -0,0 +1,32 @@ +/* -*- 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/. + */ + +#include +#include +#include + +Qt5System::Qt5System() {} +Qt5System::~Qt5System() {} + +unsigned int Qt5System::GetDisplayScreenCount() { return 1; } + +tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) +{ +tools::Rectangle aRect; +if (nScreen == 0) +aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); +return aRect; +} + +int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector&) +{ +return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 64e2c27650c3ea34e0b1e6fa7af5bf916d4af779 Author: Katarina Behrens Date: Thu Jul 5 11:28:39 2018 +0200 Don't d
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/qt5
vcl/qt5/Qt5System.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit 689e3c8b91bb95bf13800833354f843edcfa1a5d Author: Katarina Behrens Date: Fri Jul 6 16:35:13 2018 +0200 Implement reading screen count and screen geometry this improves restoring window location should it be within the secondary screen Change-Id: Iaac6bcead6bfcb7ae9eda579e5a4ad6b2482cc39 diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx index 0de1940d9eff..ca533923913b 100644 --- a/vcl/qt5/Qt5System.cxx +++ b/vcl/qt5/Qt5System.cxx @@ -7,21 +7,23 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include +#include + #include #include #include +#include Qt5System::Qt5System() {} Qt5System::~Qt5System() {} -unsigned int Qt5System::GetDisplayScreenCount() { return 1; } +unsigned int Qt5System::GetDisplayScreenCount() { return QApplication::desktop()->screenCount(); } tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) { -tools::Rectangle aRect; -if (nScreen == 0) -aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); -return aRect; +QRect qRect = QApplication::desktop()->screenGeometry(nScreen); +return toRectangle(qRect); } int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector&) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc
vcl/inc/qt5/Qt5Tools.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit fcafc74f883f193a10c8be4eaa3c4ec7ed826f94 Author: Katarina Behrens Date: Fri Jul 6 15:39:54 2018 +0200 It's top-left-right-bottom, not top-left-width-height yeh tools::Rect class is odd Change-Id: I5a49a2e8f35647029bb584903fee7b2245367af1 diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx index f075468ca3d3..c919b401e191 100644 --- a/vcl/inc/qt5/Qt5Tools.hxx +++ b/vcl/inc/qt5/Qt5Tools.hxx @@ -49,7 +49,7 @@ inline QRect toQRect(const tools::Rectangle& rRect) inline tools::Rectangle toRectangle(const QRect& rRect) { -return tools::Rectangle(rRect.left(), rRect.top(), rRect.width(), rRect.height()); +return tools::Rectangle(rRect.left(), rRect.top(), rRect.right(), rRect.bottom()); } inline QSize toQSize(const Size& rSize) { return QSize(rSize.Width(), rSize.Height()); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5 vcl/unx
vcl/Library_vclplug_qt5.mk |1 + vcl/inc/qt5/Qt5System.hxx| 27 +++ vcl/qt5/Qt5Instance.cxx |4 ++-- vcl/qt5/Qt5System.cxx| 32 vcl/unx/kde5/KDE5SalGraphics.cxx |4 5 files changed, 66 insertions(+), 2 deletions(-) New commits: commit 34fec433197c5ec3e2a0c6603392fd5f1067c44b Author: Katarina Behrens Date: Thu Jul 5 11:45:45 2018 +0200 Basic Qt5 system display data copied from dummy headless implementation Change-Id: I1b184745627acd065b4c0cc54f044c47ec980c93 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 4fcd649e1777..1ad01555ed3a 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -96,6 +96,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ +vcl/qt5/Qt5System \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ vcl/qt5/Qt5VirtualDevice \ diff --git a/vcl/inc/qt5/Qt5System.hxx b/vcl/inc/qt5/Qt5System.hxx new file mode 100644 index ..fbc753757b36 --- /dev/null +++ b/vcl/inc/qt5/Qt5System.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/. + */ + +#pragma once + +#include +#include + +class Qt5System : public SalGenericSystem +{ +public: +Qt5System(); +virtual ~Qt5System() override; + +virtual unsigned int GetDisplayScreenCount() override; +virtual tools::Rectangle GetDisplayScreenPosSizePixel(unsigned int nScreen) override; +virtual int ShowNativeDialog(const OUString& rTitle, const OUString& rMessage, + const std::vector& rButtons) override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index ef618e18fa7f..c2f2b7eb1566 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -40,7 +41,6 @@ #include #include -#include #include Qt5Instance::Qt5Instance(SalYieldMutex* pMutex, bool bUseCairo) @@ -125,7 +125,7 @@ std::unique_ptr Qt5Instance::CreateMenuItem(const SalItemParams& rI SalTimer* Qt5Instance::CreateSalTimer() { return new Qt5Timer(); } -SalSystem* Qt5Instance::CreateSalSystem() { return new SvpSalSystem(); } +SalSystem* Qt5Instance::CreateSalSystem() { return new Qt5System(); } std::shared_ptr Qt5Instance::CreateSalBitmap() { diff --git a/vcl/qt5/Qt5System.cxx b/vcl/qt5/Qt5System.cxx new file mode 100644 index ..0de1940d9eff --- /dev/null +++ b/vcl/qt5/Qt5System.cxx @@ -0,0 +1,32 @@ +/* -*- 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/. + */ + +#include +#include +#include + +Qt5System::Qt5System() {} +Qt5System::~Qt5System() {} + +unsigned int Qt5System::GetDisplayScreenCount() { return 1; } + +tools::Rectangle Qt5System::GetDisplayScreenPosSizePixel(unsigned int nScreen) +{ +tools::Rectangle aRect; +if (nScreen == 0) +aRect = tools::Rectangle(Point(0, 0), Size(1024, 768)); +return aRect; +} + +int Qt5System::ShowNativeDialog(const OUString&, const OUString&, const std::vector&) +{ +return 0; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 3d8dbf46e69a00049132108808e0c00cdb5bcc55 Author: Katarina Behrens Date: Thu Jul 5 11:28:39 2018 +0200 Don't draw focus around checkboxes and radiobuttons it is drawn separately around cb/rb's text Change-Id: I22737944048c4d501ba4dc5416fa79d4d081e91c diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 9377a134fdc4..f26e559b921e 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -468,6 +468,8 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, if (part == ControlPart::Entire) { QStyleOptionButton option; +// clear FOCUSED bit, focus is drawn separately +nControlState &= ~(ControlState::FOCUSED); draw(QStyle::CE_CheckBox, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value)); } @@ -548,6 +550,8 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, if (part == ControlPart::Entire) { QSt
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/source vcl/unx
vcl/source/control/button.cxx | 12 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |8 +++- 2 files changed, 7 insertions(+), 13 deletions(-) New commits: commit b6af8a05ee5ab4b7051fd1d26b9b5f4f4dff58a2 Author: Katarina Behrens Date: Wed Jul 4 10:22:23 2018 +0200 Try to move adjusting focus rect down to gtk3 code as it makes the focus rect look oddly shifted for kde5 widgets Change-Id: Ia42ccf30207a8c804d23ba45870d839f94c3f858 diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 6facf9159838..50b62c50b020 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2918,12 +2918,6 @@ void RadioButton::ShowFocus(const tools::Rectangle& rRect) aInRect.SetLeft( rRect.Left() ); // exclude the radio element itself from the focusrect -//to-do, figure out a better solution here -aInRect.AdjustLeft( -2 ); -aInRect.AdjustRight(2 ); -aInRect.AdjustTop( -2 ); -aInRect.AdjustBottom(2 ); - DrawNativeControl(ControlType::Radiobutton, ControlPart::Focus, aInRect, ControlState::FOCUSED, aControlValue, OUString()); } @@ -3743,12 +3737,6 @@ void CheckBox::ShowFocus(const tools::Rectangle& rRect) aInRect.SetLeft( rRect.Left() ); // exclude the checkbox itself from the focusrect -//to-do, figure out a better solution here -aInRect.AdjustLeft( -2 ); -aInRect.AdjustRight(2 ); -aInRect.AdjustTop( -2 ); -aInRect.AdjustBottom(2 ); - DrawNativeControl(ControlType::Checkbox, ControlPart::Focus, aInRect, ControlState::FOCUSED, aControlValue, OUString()); } diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx index 9ed8d7c96dc3..180a050ebc59 100644 --- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx @@ -2499,7 +2499,13 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co break; case RenderType::Focus: { -if (nType != ControlType::Checkbox) +if (nType == ControlType::Checkbox || +nType == ControlType::Radiobutton) +{ +nX -= 2; nY -=2; +nHeight += 4; nWidth += 4; +} +else { GtkBorder border; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 13 commits - sc/source sd/source sfx2/source sw/qa vcl/headless vcl/inc vcl/qt5 vcl/unx
Rebased ref, commits from common ancestor: commit 63f0dbdd61df0bf390d201b4ea4215b0077a2f9d Author: Katarina Behrens Date: Mon Jul 2 11:41:10 2018 +0200 Draw button focus so that it doesn't obscure the actual button Change-Id: I0df51b8dfd75dd966639d0893c379f2038c949ff diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 75e7c8664ab4..9377a134fdc4 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -81,6 +81,7 @@ void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf) KDE5SalGraphics::KDE5SalGraphics() : SvpSalGraphics() { +initStyles(); } bool KDE5SalGraphics::IsNativeControlSupported(ControlType type, ControlPart part) @@ -218,12 +219,6 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, case ControlType::Tooltip: m_image->fill(QApplication::palette().color(QPalette::ToolTipBase).rgb()); break; -case ControlType::Pushbutton: -if (nControlState & ControlState::FOCUSED) - m_image->fill(QApplication::palette().color(QPalette::Highlight).rgb()); -else - m_image->fill(QApplication::palette().color(QPalette::Button).rgb()); -break; case ControlType::Scrollbar: if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) @@ -241,9 +236,21 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, if (type == ControlType::Pushbutton) { -QStyleOptionButton option; -draw(QStyle::CE_PushButton, &option, m_image.get(), - vclStateValue2StateFlag(nControlState, value)); +if (part == ControlPart::Entire) +{ +QStyleOptionButton option; +draw(QStyle::CE_PushButton, &option, m_image.get(), + vclStateValue2StateFlag(nControlState, value)); +} +else if (part == ControlPart::Focus) +{ +QStyleOptionButton option; +option.state = QStyle::State_HasFocus; +option.rect = m_image->rect(); +QPainter painter(m_image.get()); +m_focusedButton->style()->drawControl(QStyle::CE_PushButton, &option, &painter, + m_focusedButton.get()); +} } else if (type == ControlType::Menubar) { @@ -991,4 +998,15 @@ bool KDE5SalGraphics::hitTestNativeControl(ControlType nType, ControlPart nPart, return false; } +void KDE5SalGraphics::initStyles() +{ +// button focus +m_focusedButton.reset(new QPushButton()); +QString aHighlightColor = QApplication::palette().color(QPalette::Highlight).name(); +QString focusStyleSheet("background-color: rgb(0,0,0,0%); border: 1px; border-radius: 2px; " +"border-color: %1; border-style:solid;"); +focusStyleSheet.replace("%1", aHighlightColor); +m_focusedButton->setStyleSheet(focusStyleSheet); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx index 77121459e8be..e70159ba9568 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.hxx +++ b/vcl/unx/kde5/KDE5SalGraphics.hxx @@ -25,6 +25,7 @@ #include #include +#include class KDE5SalFrame; @@ -49,6 +50,11 @@ public: std::unique_ptr m_image; QRect lastPopupRect; + +private: +void initStyles(); + +std::unique_ptr m_focusedButton; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit dc8f347f5fed638f07ef88246950460e3ed284d1 Author: Katarina Behrens Date: Thu Jun 28 13:42:00 2018 +0200 Use cairo's OVER operator to preserve transparency Change-Id: I1afae266a5308fa0dbf2488777ddb963e99199c7 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 9163d8cf8133..de1145a6cc7c 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -35,8 +35,6 @@ #include #include -#include - #if ENABLE_CAIRO_CANVAS # if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0) # define CAIRO_OPERATOR_DIFFERENCE (static_cast(23)) @@ -1134,8 +1132,8 @@ void SvpSalGraphics::copyArea( long nDestX, copyBits(aTR, this); } -static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, - cairo_surface_t* source) +static basegfx::B2DRange renderWithOperator(cairo_t* cr, const SalTwoRect& rTR, + cairo_surface_t* source, cairo_operator_t eOperator = CAIRO_OPERATOR_SOURCE) { cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight); @@ -1160,24 +1158,35 @@ static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, cairo_pattern_set_extend(sourcepattern, CAIRO_EXTEND_REPEAT); cairo_pattern_set_filter(sourcepattern, CAIRO
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 537 commits - accessibility/source android/source autogen.sh basctl/source basctl/uiconfig basegfx/Library_basegfx.mk basegfx/source basic/q
Rebased ref, commits from common ancestor: commit 0451efeb735359c04c71a6f58e031ebac27b3761 Author: Katarina Behrens Date: Mon Jul 2 11:41:10 2018 +0200 Draw button focus so that it doesn't obscure the actual button Change-Id: I0df51b8dfd75dd966639d0893c379f2038c949ff diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 75e7c8664ab4..9377a134fdc4 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -81,6 +81,7 @@ void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf) KDE5SalGraphics::KDE5SalGraphics() : SvpSalGraphics() { +initStyles(); } bool KDE5SalGraphics::IsNativeControlSupported(ControlType type, ControlPart part) @@ -218,12 +219,6 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, case ControlType::Tooltip: m_image->fill(QApplication::palette().color(QPalette::ToolTipBase).rgb()); break; -case ControlType::Pushbutton: -if (nControlState & ControlState::FOCUSED) - m_image->fill(QApplication::palette().color(QPalette::Highlight).rgb()); -else - m_image->fill(QApplication::palette().color(QPalette::Button).rgb()); -break; case ControlType::Scrollbar: if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) @@ -241,9 +236,21 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, if (type == ControlType::Pushbutton) { -QStyleOptionButton option; -draw(QStyle::CE_PushButton, &option, m_image.get(), - vclStateValue2StateFlag(nControlState, value)); +if (part == ControlPart::Entire) +{ +QStyleOptionButton option; +draw(QStyle::CE_PushButton, &option, m_image.get(), + vclStateValue2StateFlag(nControlState, value)); +} +else if (part == ControlPart::Focus) +{ +QStyleOptionButton option; +option.state = QStyle::State_HasFocus; +option.rect = m_image->rect(); +QPainter painter(m_image.get()); +m_focusedButton->style()->drawControl(QStyle::CE_PushButton, &option, &painter, + m_focusedButton.get()); +} } else if (type == ControlType::Menubar) { @@ -991,4 +998,15 @@ bool KDE5SalGraphics::hitTestNativeControl(ControlType nType, ControlPart nPart, return false; } +void KDE5SalGraphics::initStyles() +{ +// button focus +m_focusedButton.reset(new QPushButton()); +QString aHighlightColor = QApplication::palette().color(QPalette::Highlight).name(); +QString focusStyleSheet("background-color: rgb(0,0,0,0%); border: 1px; border-radius: 2px; " +"border-color: %1; border-style:solid;"); +focusStyleSheet.replace("%1", aHighlightColor); +m_focusedButton->setStyleSheet(focusStyleSheet); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx index 77121459e8be..e70159ba9568 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.hxx +++ b/vcl/unx/kde5/KDE5SalGraphics.hxx @@ -25,6 +25,7 @@ #include #include +#include class KDE5SalFrame; @@ -49,6 +50,11 @@ public: std::unique_ptr m_image; QRect lastPopupRect; + +private: +void initStyles(); + +std::unique_ptr m_focusedButton; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit ab1e307f3232f2ef3d3d9626e949081d3aa9a3c5 Author: Katarina Behrens Date: Thu Jun 28 13:42:00 2018 +0200 Use cairo's OVER operator to preserve transparency Change-Id: I1afae266a5308fa0dbf2488777ddb963e99199c7 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 9163d8cf8133..de1145a6cc7c 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -35,8 +35,6 @@ #include #include -#include - #if ENABLE_CAIRO_CANVAS # if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0) # define CAIRO_OPERATOR_DIFFERENCE (static_cast(23)) @@ -1134,8 +1132,8 @@ void SvpSalGraphics::copyArea( long nDestX, copyBits(aTR, this); } -static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, - cairo_surface_t* source) +static basegfx::B2DRange renderWithOperator(cairo_t* cr, const SalTwoRect& rTR, + cairo_surface_t* source, cairo_operator_t eOperator = CAIRO_OPERATOR_SOURCE) { cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight); @@ -1160,24 +1158,35 @@ static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, cairo_pattern_set_extend(sourcepattern, CAIRO_EXTEND_REPEAT); cairo_pattern_set_filter(sourcepattern, CAIRO
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5SalGraphics.cxx | 36 +++- vcl/unx/kde5/KDE5SalGraphics.hxx |6 ++ 2 files changed, 33 insertions(+), 9 deletions(-) New commits: commit 72a2500327ef6aaa3854b248fef5bfc1ccc99101 Author: Katarina Behrens Date: Mon Jul 2 11:41:10 2018 +0200 Draw button focus so that it doesn't obscure the actual button Change-Id: I0df51b8dfd75dd966639d0893c379f2038c949ff diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 75e7c8664ab4..9377a134fdc4 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -81,6 +81,7 @@ void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf) KDE5SalGraphics::KDE5SalGraphics() : SvpSalGraphics() { +initStyles(); } bool KDE5SalGraphics::IsNativeControlSupported(ControlType type, ControlPart part) @@ -218,12 +219,6 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, case ControlType::Tooltip: m_image->fill(QApplication::palette().color(QPalette::ToolTipBase).rgb()); break; -case ControlType::Pushbutton: -if (nControlState & ControlState::FOCUSED) - m_image->fill(QApplication::palette().color(QPalette::Highlight).rgb()); -else - m_image->fill(QApplication::palette().color(QPalette::Button).rgb()); -break; case ControlType::Scrollbar: if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) @@ -241,9 +236,21 @@ bool KDE5SalGraphics::drawNativeControl(ControlType type, ControlPart part, if (type == ControlType::Pushbutton) { -QStyleOptionButton option; -draw(QStyle::CE_PushButton, &option, m_image.get(), - vclStateValue2StateFlag(nControlState, value)); +if (part == ControlPart::Entire) +{ +QStyleOptionButton option; +draw(QStyle::CE_PushButton, &option, m_image.get(), + vclStateValue2StateFlag(nControlState, value)); +} +else if (part == ControlPart::Focus) +{ +QStyleOptionButton option; +option.state = QStyle::State_HasFocus; +option.rect = m_image->rect(); +QPainter painter(m_image.get()); +m_focusedButton->style()->drawControl(QStyle::CE_PushButton, &option, &painter, + m_focusedButton.get()); +} } else if (type == ControlType::Menubar) { @@ -991,4 +998,15 @@ bool KDE5SalGraphics::hitTestNativeControl(ControlType nType, ControlPart nPart, return false; } +void KDE5SalGraphics::initStyles() +{ +// button focus +m_focusedButton.reset(new QPushButton()); +QString aHighlightColor = QApplication::palette().color(QPalette::Highlight).name(); +QString focusStyleSheet("background-color: rgb(0,0,0,0%); border: 1px; border-radius: 2px; " +"border-color: %1; border-style:solid;"); +focusStyleSheet.replace("%1", aHighlightColor); +m_focusedButton->setStyleSheet(focusStyleSheet); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx index 77121459e8be..e70159ba9568 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.hxx +++ b/vcl/unx/kde5/KDE5SalGraphics.hxx @@ -25,6 +25,7 @@ #include #include +#include class KDE5SalFrame; @@ -49,6 +50,11 @@ public: std::unique_ptr m_image; QRect lastPopupRect; + +private: +void initStyles(); + +std::unique_ptr m_focusedButton; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/headless vcl/inc vcl/unx
vcl/headless/svpgdi.cxx | 29 +++-- vcl/inc/headless/svpgdi.hxx |6 +- vcl/unx/kde5/KDE5SalGraphics.cxx |2 +- 3 files changed, 25 insertions(+), 12 deletions(-) New commits: commit 96f6aaa4e80a27edfc5fe3c141eb984effc9f1a7 Author: Katarina Behrens Date: Thu Jun 28 13:42:00 2018 +0200 Use cairo's OVER operator to preserve transparency Change-Id: I1afae266a5308fa0dbf2488777ddb963e99199c7 diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 9163d8cf8133..de1145a6cc7c 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -35,8 +35,6 @@ #include #include -#include - #if ENABLE_CAIRO_CANVAS # if defined CAIRO_VERSION && CAIRO_VERSION < CAIRO_VERSION_ENCODE(1, 10, 0) # define CAIRO_OPERATOR_DIFFERENCE (static_cast(23)) @@ -1134,8 +1132,8 @@ void SvpSalGraphics::copyArea( long nDestX, copyBits(aTR, this); } -static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, - cairo_surface_t* source) +static basegfx::B2DRange renderWithOperator(cairo_t* cr, const SalTwoRect& rTR, + cairo_surface_t* source, cairo_operator_t eOperator = CAIRO_OPERATOR_SOURCE) { cairo_rectangle(cr, rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight); @@ -1160,24 +1158,35 @@ static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, cairo_pattern_set_extend(sourcepattern, CAIRO_EXTEND_REPEAT); cairo_pattern_set_filter(sourcepattern, CAIRO_FILTER_NEAREST); } -cairo_set_operator(cr, CAIRO_OPERATOR_SOURCE); +cairo_set_operator(cr, eOperator); cairo_paint(cr); cairo_restore(cr); return extents; } -void SvpSalGraphics::copySource( const SalTwoRect& rTR, - cairo_surface_t* source ) +static basegfx::B2DRange renderSource(cairo_t* cr, const SalTwoRect& rTR, + cairo_surface_t* source) +{ +return renderWithOperator(cr, rTR, source, CAIRO_OPERATOR_SOURCE); +} + +void SvpSalGraphics::copyWithOperator( const SalTwoRect& rTR, cairo_surface_t* source, + cairo_operator_t eOp ) { cairo_t* cr = getCairoContext(false); clipRegion(cr); -basegfx::B2DRange extents = renderSource(cr, rTR, source); +basegfx::B2DRange extents = renderWithOperator(cr, rTR, source, eOp); releaseCairoContext(cr, false, extents); } +void SvpSalGraphics::copySource( const SalTwoRect& rTR, cairo_surface_t* source ) +{ + copyWithOperator(rTR, source, CAIRO_OPERATOR_SOURCE); +} + void SvpSalGraphics::copyBits( const SalTwoRect& rTR, SalGraphics* pSrcGraphics ) { @@ -1224,10 +1233,10 @@ void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceB copySource(rTR, source); } -void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, BitmapBuffer* pBuffer) +void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, BitmapBuffer* pBuffer, cairo_operator_t eOp) { cairo_surface_t* source = createCairoSurface( pBuffer ); -copySource(rTR, source); +copyWithOperator(rTR, source, eOp); } void SvpSalGraphics::drawBitmap( const SalTwoRect& rTR, diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 860eacec7cbf..6571d21cf89d 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -111,6 +112,8 @@ public: private: void invert(const basegfx::B2DPolygon &rPoly, SalInvert nFlags); void copySource(const SalTwoRect& rTR, cairo_surface_t* source); +void copyWithOperator(const SalTwoRect& rTR, cairo_surface_t* source, + cairo_operator_t eOp = CAIRO_OPERATOR_SOURCE); void setupPolyPolygon(cairo_t* cr, const basegfx::B2DPolyPolygon& rPolyPoly); void applyColor(cairo_t *cr, Color rColor); void drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly); @@ -225,7 +228,8 @@ public: virtual voiddrawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) override; voiddrawBitmap( const SalTwoRect& rPosAry, -BitmapBuffer* pBuffer ); +BitmapBuffer* pBuffer, +cairo_operator_t eOp ); virtual voiddrawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, const SalBitmap& rTransparentBitmap ) override; diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 6ec1e6e385ea..75e7c8664ab4 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -6
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Frame.hxx |1 + vcl/qt5/Qt5Frame.cxx | 12 2 files changed, 13 insertions(+) New commits: commit 588a4b353d712cadc88830c994156a4b318a9f2d Author: Katarina Behrens Date: Wed Jun 27 10:41:03 2018 +0200 Implement native modality for modal dialogs instead of hack with hiding the window and showing it again (otherwise modality change has no effect and worse yet, weird things happen) it would be much easier to use QDialog Change-Id: Ie7029ca66380495c4aad246d02f4b96cb55eb01e diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx index 268441ea688a..96446c28a358 100644 --- a/vcl/inc/qt5/Qt5Frame.hxx +++ b/vcl/inc/qt5/Qt5Frame.hxx @@ -107,6 +107,7 @@ public: virtual void GetClientSize(long& rWidth, long& rHeight) override; virtual void GetWorkArea(tools::Rectangle& rRect) override; virtual SalFrame* GetParent() const override; +virtual void SetModal(bool bModal) override; virtual void SetWindowState(const SalFrameState* pState) override; virtual bool GetWindowState(SalFrameState* pState) override; virtual void ShowFullScreen(bool bFullScreen, sal_Int32 nDisplay) override; diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 9c5b8edbc5be..b47b64ab1cb8 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -345,6 +345,18 @@ void Qt5Frame::GetWorkArea(tools::Rectangle& rRect) SalFrame* Qt5Frame::GetParent() const { return m_pParent; } +void Qt5Frame::SetModal(bool bModal) +{ +if (m_pQWidget->isWindow()) +{ +// modality change is only effective if the window is hidden +m_pQWidget->windowHandle()->hide(); +m_pQWidget->windowHandle()->setModality(bModal ? Qt::WindowModal : Qt::NonModal); +// and shown again +m_pQWidget->windowHandle()->show(); +} +} + void Qt5Frame::SetWindowState(const SalFrameState* pState) { if (!m_pQWidget->isWindow() || !pState || isChild(true, false)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/qt5
vcl/qt5/Qt5Widget.cxx |4 1 file changed, 4 insertions(+) New commits: commit 868909ea7f18fd8da3e36e2452f9572e38a42457 Author: Katarina Behrens Date: Tue Jun 26 11:48:52 2018 +0200 Traversing dialog controls backwards (Shift-Tab) works now Change-Id: If0e8d7307dd37436751e524d7ed24e89d5b72db3 diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 3e3448381946..c4d38264782c 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -257,6 +257,10 @@ static sal_uInt16 GetKeyCode(int keyval) nCode = KEY_ESCAPE; break; case Qt::Key_Tab: +// oddly enough, Qt doesn't send Shift-Tab event as 'Tab key pressed with Shift +// modifier' but as 'Backtab key pressed' (while its modifier bits are still +// set to Shift) -- so let's map both Key_Tab and Key_Backtab to VCL's KEY_TAB +case Qt::Key_Backtab: nCode = KEY_TAB; break; case Qt::Key_Backspace: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 3 commits - vcl/qt5 vcl/unx
Rebased ref, commits from common ancestor: commit d7f5d35a389b1f77cbec4650df371880f094f041 Author: Katarina Behrens Date: Fri Jun 22 15:53:51 2018 +0200 Ignore closeEvent if user has vetoed closing the frame Change-Id: Ib86ec0d297e23c02ad50ce1044859e029eae2ba9 diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 8c62280d3f99..3e3448381946 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -199,9 +199,18 @@ void VclQtMixinBase::mixinShowEvent(QShowEvent*) m_pFrame->CallCallback(SalEvent::Paint, &aPaintEvt); } -void VclQtMixinBase::mixinCloseEvent(QCloseEvent* /*pEvent*/) +void VclQtMixinBase::mixinCloseEvent(QCloseEvent* pEvent) { -m_pFrame->CallCallback(SalEvent::Close, nullptr); +bool bRet = false; +bRet = m_pFrame->CallCallback(SalEvent::Close, nullptr); + +if (bRet) +pEvent->accept(); +// SalEvent::Close returning false may mean that user has vetoed +// closing the frame ("you have unsaved changes" dialog for example) +// We should't process the event in such case +else +pEvent->ignore(); } static sal_uInt16 GetKeyCode(int keyval) commit 31c7fe19ca88831ec8405925e3f6d772450731f1 Author: Katarina Behrens Date: Fri Jun 22 15:20:34 2018 +0200 Rearrange and annotate funcs by XInterface Change-Id: Ie429074fdbe8fb4e28b1af47486bc70c5f8070e8 diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index d4e6d507dd79..123df3a09118 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -105,17 +105,33 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged); connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged); -connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this, -&KDE5FilePicker::setTitleSlot /*(const OUString&)*/, Qt::BlockingQueuedConnection); -connect(this, &KDE5FilePicker::setDefaultNameSignal, this, &KDE5FilePicker::setDefaultNameSlot, + +// XExecutableDialog +connect(this, &KDE5FilePicker::setTitleSignal, this, &KDE5FilePicker::setTitleSlot, Qt::BlockingQueuedConnection); -connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this, -&KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/, +// XFilePicker +connect(this, &KDE5FilePicker::setMultiSelectionSignal, this, +&KDE5FilePicker::setMultiSelectionSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::setDefaultNameSignal, this, &KDE5FilePicker::setDefaultNameSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::setDisplayDirectorySignal, this, +&KDE5FilePicker::setDisplayDirectorySlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::getDisplayDirectorySignal, this, &KDE5FilePicker::getDisplayDirectorySlot, Qt::BlockingQueuedConnection); -connect(this, &KDE5FilePicker::setMultiSelectionSignal, this, -&KDE5FilePicker::setMultiSelectionSlot, Qt::BlockingQueuedConnection); +// XFolderPicker +connect(this, &KDE5FilePicker::getDirectorySignal, this, &KDE5FilePicker::getDirectorySlot, +Qt::BlockingQueuedConnection); +// XFilterManager +connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot, +Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::setCurrentFilterSignal, this, +&KDE5FilePicker::setCurrentFilterSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::getCurrentFilterSignal, this, +&KDE5FilePicker::getCurrentFilterSlot, Qt::BlockingQueuedConnection); +// XFilterGroupManager +connect(this, &KDE5FilePicker::appendFilterGroupSignal, this, +&KDE5FilePicker::appendFilterGroupSlot, Qt::BlockingQueuedConnection); +// XFilePickerControlAccess connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::getValueSignal, this, &KDE5FilePicker::getValueSlot, @@ -126,18 +142,9 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::enableControlSignal, this, &KDE5FilePicker::enableControlSlot, Qt::BlockingQueuedConnection); -connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot, -Qt::BlockingQueuedConnection); -connect(this, &KDE5FilePicker::appendFilterGroupSignal, this, -&KDE5FilePicker::appendFilterGroupSlot, Qt::BlockingQueuedConnection); -connect(this, &KDE5FilePicker::setCurrentFilterSignal, this, -&KDE5FilePicker::setCurrentFilterSlot, Qt::Block
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5FilePicker.hxx |5 - vcl/unx/kde5/KDE5FilePicker2.cxx | 20 +--- 2 files changed, 21 insertions(+), 4 deletions(-) New commits: commit bb883e06a3d4808d6d338f02c0bc4d8604c47e6d Author: Katarina Behrens Date: Wed Jun 20 11:51:35 2018 +0200 Implement getDirectory, signal+slot also factor some shared code out into separate func Change-Id: I49d25eeb4eb647b72dae78c42301091d198eeff4 diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 6f175cc375cf..d1a300be014c 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -157,6 +157,7 @@ public: private: //add a custom control widget to the file dialog void addCustomControl(sal_Int16 controlId); +OUString implGetDirectory(); // emit XFilePickerListener controlStateChanged event void filterChanged(); @@ -171,6 +172,7 @@ Q_SIGNALS: void setDefaultNameSignal(const OUString& rName); void setDisplayDirectorySignal(const OUString& rDir); OUString getDisplayDirectorySignal(); +OUString getDirectorySignal(); void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue); css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction); @@ -189,7 +191,8 @@ private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } void setDefaultNameSlot(const OUString& rName) { return setDefaultName(rName); } void setDisplayDirectorySlot(const OUString& rDir) { return setDisplayDirectory(rDir); } -OUString getDisplayDirectorySlot() { return getDisplayDirectory(); } +OUString getDisplayDirectorySlot() { return implGetDirectory(); } +OUString getDirectorySlot() { return implGetDirectory(); } void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue) { return setValue(nControlId, nControlAction, rValue); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 56734b4d36e9..1bc9fa82f69f 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -227,8 +227,7 @@ OUString SAL_CALL KDE5FilePicker::getDisplayDirectory() return Q_EMIT getDisplayDirectorySignal(); } -OUString dir = toOUString(_dialog->directoryUrl().url()); -return dir; +return implGetDirectory(); } uno::Sequence SAL_CALL KDE5FilePicker::getFiles() @@ -432,7 +431,16 @@ OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId) return label; } -OUString SAL_CALL KDE5FilePicker::getDirectory() { return OUString(); } +OUString SAL_CALL KDE5FilePicker::getDirectory() +{ +if (qApp->thread() != QThread::currentThread()) +{ +SolarMutexReleaser aReleaser; +return Q_EMIT getDirectorySignal(); +} + +return implGetDirectory(); +} void SAL_CALL KDE5FilePicker::setDescription(const OUString&) {} @@ -530,6 +538,12 @@ void KDE5FilePicker::addCustomControl(sal_Int16 controlId) } } +OUString KDE5FilePicker::implGetDirectory() +{ +OUString dir = toOUString(_dialog->directoryUrl().url()); +return dir; +} + void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence& args) { // parameter checking ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 39 commits - basctl/source configure.ac cui/source filter/source filter/uiconfig include/sfx2 include/vcl sc/inc sc/IwyuFilter_sc.yaml sc/so
Rebased ref, commits from common ancestor: commit f9fd65b28f7d9c402b4e2bfb1b88e7b9b420d47b Author: Katarina Behrens Date: Tue Jun 19 15:59:50 2018 +0200 Folder picker is now really a folder picker and not a regular file picker with wrong title Change-Id: I849e7bb3d0cad197880fadd865f4d39f13245e97 diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 4fbbc487394c..6f175cc375cf 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -79,6 +79,7 @@ protected: QGridLayout* _layout; bool allowRemoteUrls; +bool mbIsFolderPicker; public: explicit KDE5FilePicker(QFileDialog::FileMode); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 46bcccf4bd24..56734b4d36e9 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -83,6 +83,7 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) , _extraControls(new QWidget) , _layout(new QGridLayout(_extraControls)) , allowRemoteUrls(false) +, mbIsFolderPicker(eMode == QFileDialog::Directory) { _dialog->setSupportedSchemes({ QStringLiteral("file"), @@ -96,14 +97,12 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) _dialog->setFileMode(eMode); -if (eMode == QFileDialog::Directory) +if (mbIsFolderPicker) { _dialog->setOption(QFileDialog::ShowDirsOnly, true); _dialog->setWindowTitle(toQString(VclResId(STR_FPICKER_FOLDER_DEFAULT_TITLE))); } -setMultiSelectionMode(false); - connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged); connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged); connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this, @@ -191,6 +190,9 @@ void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) return Q_EMIT setMultiSelectionSignal(multiSelect); } +if (mbIsFolderPicker) +return; + _dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile); } commit 276adef1703ad1594fee3aaf7a170823cb583447 Author: Katarina Behrens Date: Tue Jun 19 13:01:43 2018 +0200 Fix initial switch to folder in fileopen dlg the argument passed is an URL, so using setDirectory wouldn't do the trick, setDirectoryUrl would Change-Id: I312f6e2a06b46777dc126f95f63ec0dbcb1f5799 diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 3d1491eab5cc..46bcccf4bd24 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -213,7 +213,8 @@ void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir) return Q_EMIT setDisplayDirectorySignal(dir); } -_dialog->setDirectory(toQString(dir)); +QString qDir(toQString(dir)); +_dialog->setDirectoryUrl(QUrl(qDir)); } OUString SAL_CALL KDE5FilePicker::getDisplayDirectory() commit 2e57b03efda51e3bf53386e2572e816c4d3382d6 Author: Stephan Bergmann Date: Mon Jun 18 18:05:29 2018 +0200 loplugin:{implicitboolconversion,salbool} Change-Id: I795a50241b9d77127b5ee5558e0cd706e0fdb76b diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 69d86c5107a9..4fbbc487394c 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -173,7 +173,7 @@ Q_SIGNALS: void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue); css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction); -void enableControlSignal(sal_Int16 nControlId, sal_Bool bEnable); +void enableControlSignal(sal_Int16 nControlId, bool bEnable); void setLabelSignal(sal_Int16 nControlId, const OUString& rLabel); OUString getLabelSignal(sal_Int16 nControlId); void appendFilterSignal(const OUString& rTitle, const OUString& rFilter); @@ -199,7 +199,7 @@ private Q_SLOTS: return getValue(nControlId, nControlAction); } -void enableControlSlot(sal_Int16 nControlId, sal_Bool bEnable) +void enableControlSlot(sal_Int16 nControlId, bool bEnable) { return enableControl(nControlId, bEnable); } diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index ce8af6a7eaf2..3d1491eab5cc 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -180,7 +180,7 @@ sal_Int16 SAL_CALL KDE5FilePicker::execute() _dialog->show(); //block and wait for user input -return _dialog->exec() == QFileDialog::Accepted; +return _dialog->exec() == QFileDialog::Accepted ? 1 : 0; } void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) commit 4bd93b662f5ad0556d573cb67ae7f4da5577ee23 Author: Katarina Behrens Date: Mon Jun 18 11:24:36 2018 +0200
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 777 commits - accessibility/source avmedia/source basctl/source basctl/uiconfig basic/source bin/distro-install-desktop-integration bin/oss-
Rebased ref, commits from common ancestor: commit 4e56db888a90d866d1f515be54f19f28b79e78db Author: Katarina Behrens Date: Mon Jun 18 11:24:36 2018 +0200 VCLKDE5Application is now unused as well Change-Id: Ib11274b6039596246aa232b83fa4d85095a93e08 diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index 11fa740926e4..4d134d0fbf8b 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -84,7 +84,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ vcl/unx/kde5/KDE5SalFrame \ vcl/unx/kde5/KDE5SalGraphics \ vcl/unx/kde5/KDE5SalInstance \ -vcl/unx/kde5/VCLKDE5Application \ )) ifeq ($(OS),LINUX) diff --git a/vcl/unx/kde5/VCLKDE5Application.cxx b/vcl/unx/kde5/VCLKDE5Application.cxx deleted file mode 100644 index 2d9532f1def9.. --- a/vcl/unx/kde5/VCLKDE5Application.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- 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 "VCLKDE5Application.hxx" - -#include -#include -#include - -VCLKDE5Application::VCLKDE5Application(int argc, char** argv) -: QApplication(argc, argv) -{ -} - -// various hacks to be performed before re-entering Qt's event loop -// because of showing a Qt dialog -void VCLKDE5Application::preDialogSetup() -{ -// KFileDialog integration requires using event loop with QClipboard. -// Opening the KDE file dialog here can lead to QClipboard -// asking for clipboard contents. If LO core is the owner of the clipboard -// content, without event loop use this will block for 5 seconds and timeout, -// since the clipboard thread will not be able to acquire SolarMutex -// and thus won't be able to respond. If the event loops -// are properly integrated and QClipboard can use a nested event loop -// (see the KDE VCL plug), then this won't happen. -// We cannot simply release SolarMutex here, because the event loop started -// by the file dialog would also call back to LO code. - assert(QApplication::clipboard()->property("useEventLoopWhenWaiting").toBool()); -} - -// various hacks to be performed after a Qt dialog has been closed -void VCLKDE5Application::postDialogCleanup() -{ -// HACK: KFileDialog uses KConfig("kdeglobals") for saving some settings -// (such as the auto-extension flag), but that doesn't update KGlobal::config() -// (which is probably a KDE bug), so force reading the new configuration, -// otherwise the next opening of the dialog would use the old settings. -KConfig config; -config.reparseConfiguration(); -// HACK: If Qt owns clipboard or selection, give up on their ownership now. Otherwise -// LO core might ask for the contents, but it would block while doing so (i.e. it -// doesn't seem to have an equivalent of QClipboard's "useEventLoopWhenWaiting"), -// therefore QClipboard wouldn't be able to respond, and whole LO would block until -// a timeout. Given that Klipper is most probably running, giving up clipboard/selection -// ownership will not only avoid the blocking, but even pasting that content in LO -// will in fact work, if Klipper can handle it. -// Technically proper solution would be of course to allow Qt to process QClipboard -// events while LO waits for clipboard contents, or short-circuit to QClipboard somehow -// (it's a mystery why LO's clipboard handling has its own thread when whole LO can -// get blocked by both trying to send and receive clipboard contents anyway). -QClipboard* clipboard = QApplication::clipboard(); -if (clipboard->ownsSelection()) -clipboard->clear(QClipboard::Selection); -if (clipboard->ownsClipboard()) -clipboard->clear(); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/VCLKDE5Application.hxx b/vcl/unx/kde5/VCLKDE5Application.hxx deleted file mode 100644 index 5503db32c901.. --- a/vcl/unx/kde5/VCLKDE5Application.hxx +++ /dev/null @@ -1,41 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part o
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 3 commits - vcl/Library_vclplug_kde5.mk vcl/unx
vcl/Library_vclplug_kde5.mk |2 vcl/unx/kde5/FPServiceInfo.hxx | 28 - vcl/unx/kde5/KDE5FilePicker.cxx | 59 vcl/unx/kde5/KDE5FilePicker2.cxx| 26 +++- vcl/unx/kde5/VCLKDE5Application.cxx | 75 vcl/unx/kde5/VCLKDE5Application.hxx | 41 --- 6 files changed, 24 insertions(+), 207 deletions(-) New commits: commit 5a3ee6623c161838ddc1ebf65ac6be3eece5be09 Author: Katarina Behrens Date: Mon Jun 18 11:24:36 2018 +0200 VCLKDE5Application is now unused as well Change-Id: Ib11274b6039596246aa232b83fa4d85095a93e08 diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index 11fa740926e4..4d134d0fbf8b 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -84,7 +84,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ vcl/unx/kde5/KDE5SalFrame \ vcl/unx/kde5/KDE5SalGraphics \ vcl/unx/kde5/KDE5SalInstance \ -vcl/unx/kde5/VCLKDE5Application \ )) ifeq ($(OS),LINUX) diff --git a/vcl/unx/kde5/VCLKDE5Application.cxx b/vcl/unx/kde5/VCLKDE5Application.cxx deleted file mode 100644 index 2d9532f1def9.. --- a/vcl/unx/kde5/VCLKDE5Application.cxx +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- 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 "VCLKDE5Application.hxx" - -#include -#include -#include - -VCLKDE5Application::VCLKDE5Application(int argc, char** argv) -: QApplication(argc, argv) -{ -} - -// various hacks to be performed before re-entering Qt's event loop -// because of showing a Qt dialog -void VCLKDE5Application::preDialogSetup() -{ -// KFileDialog integration requires using event loop with QClipboard. -// Opening the KDE file dialog here can lead to QClipboard -// asking for clipboard contents. If LO core is the owner of the clipboard -// content, without event loop use this will block for 5 seconds and timeout, -// since the clipboard thread will not be able to acquire SolarMutex -// and thus won't be able to respond. If the event loops -// are properly integrated and QClipboard can use a nested event loop -// (see the KDE VCL plug), then this won't happen. -// We cannot simply release SolarMutex here, because the event loop started -// by the file dialog would also call back to LO code. - assert(QApplication::clipboard()->property("useEventLoopWhenWaiting").toBool()); -} - -// various hacks to be performed after a Qt dialog has been closed -void VCLKDE5Application::postDialogCleanup() -{ -// HACK: KFileDialog uses KConfig("kdeglobals") for saving some settings -// (such as the auto-extension flag), but that doesn't update KGlobal::config() -// (which is probably a KDE bug), so force reading the new configuration, -// otherwise the next opening of the dialog would use the old settings. -KConfig config; -config.reparseConfiguration(); -// HACK: If Qt owns clipboard or selection, give up on their ownership now. Otherwise -// LO core might ask for the contents, but it would block while doing so (i.e. it -// doesn't seem to have an equivalent of QClipboard's "useEventLoopWhenWaiting"), -// therefore QClipboard wouldn't be able to respond, and whole LO would block until -// a timeout. Given that Klipper is most probably running, giving up clipboard/selection -// ownership will not only avoid the blocking, but even pasting that content in LO -// will in fact work, if Klipper can handle it. -// Technically proper solution would be of course to allow Qt to process QClipboard -// events while LO waits for clipboard contents, or short-circuit to QClipboard somehow -// (it's a mystery why LO's clipboard handling has its own thread when whole LO can -// get blocked by both trying to send and receive clipboard contents anyway). -QClipboard* clipboard = QApplication::clipboard(); -if (clipboard->ownsSelection()) -clipboard->clear(QClipboard::Selection); -if (clipboard->ownsClipboard()) -cli
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx |3 --- vcl/unx/kde5/KDE5FilePicker.hxx |4 vcl/unx/kde5/KDE5FilePicker2.cxx |1 - 3 files changed, 8 deletions(-) New commits: commit ff7c0e22363afafda45d95520a65baf4e7111c9c Author: Katarina Behrens Date: Fri Jun 15 15:30:16 2018 +0200 Drop winId and KWindowSystem::setMainWindow as fpicker isn't a separate binary anymore Change-Id: I9c9c57a21f5dc79714f37f8bc65b998887c29e78 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 5d9acdcd7a50..19bea46654a3 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -40,8 +40,6 @@ KDE5FilePicker::~KDE5FilePicker() delete _dialog; } -void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; } - bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e) { if (e->type() == QEvent::Show && o->isWidgetType()) @@ -49,7 +47,6 @@ bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e) auto* w = static_cast(o); if (!w->parentWidget() && w->isModal()) { -KWindowSystem::setMainWindow(w, _winId); if (auto* fileWidget = w->findChild({}, Qt::FindDirectChildrenOnly)) fileWidget->setCustomWidget(_extraControls); } diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 4b45052827c4..69d86c5107a9 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -78,8 +78,6 @@ protected: //layout for extra custom controls QGridLayout* _layout; -sal_uIntPtr _winId; - bool allowRemoteUrls; public: @@ -140,8 +138,6 @@ public: // XFilePicker2 functions virtual css::uno::Sequence SAL_CALL getSelectedFiles() override; -void setWinId(sal_uIntPtr winId); - // XInitialization virtual void SAL_CALL initialize(const css::uno::Sequence& rArguments) override; diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index cebd2ee4f4f9..b7c3320344bf 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -82,7 +82,6 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) , _dialog(new QFileDialog(nullptr, {}, QDir::homePath())) , _extraControls(new QWidget) , _layout(new QGridLayout(_extraControls)) -, _winId(0) , allowRemoteUrls(false) { _dialog->setSupportedSchemes({ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx |6 -- vcl/unx/kde5/KDE5FilePicker.hxx |2 -- vcl/unx/kde5/KDE5FilePicker2.cxx |9 - 3 files changed, 8 insertions(+), 9 deletions(-) New commits: commit 9054848924082a4c979f0bbefcbf4070108e4e61 Author: Katarina Behrens Date: Fri Jun 15 14:35:20 2018 +0200 Fold enableFolderMode into ctor Change-Id: I8674395271b83d9c50477bdf0242cd9f46af7a30 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 7a30359ef580..5d9acdcd7a50 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -34,12 +34,6 @@ // KDE5FilePicker -void KDE5FilePicker::enableFolderMode() -{ -_dialog->setOption(QFileDialog::ShowDirsOnly, true); -_dialog->setFileMode(QFileDialog::Directory); -} - KDE5FilePicker::~KDE5FilePicker() { delete _extraControls; diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 4fae59304fed..4b45052827c4 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -86,8 +86,6 @@ public: explicit KDE5FilePicker(QFileDialog::FileMode); virtual ~KDE5FilePicker() override; -void enableFolderMode(); - // XFilePickerNotifier virtual void SAL_CALL addFilePickerListener( const css::uno::Reference& xListener) override; diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index bc37f3c02127..cebd2ee4f4f9 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -94,8 +94,15 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) QStringLiteral("webdavs"), QStringLiteral("smb"), }); + _dialog->setFileMode(eMode); +if (eMode == QFileDialog::Directory) +{ +_dialog->setOption(QFileDialog::ShowDirsOnly, true); + _dialog->setWindowTitle(toQString(VclResId(STR_FPICKER_FOLDER_DEFAULT_TITLE))); +} + setMultiSelectionMode(false); connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged); commit 5af46248bd82d25e9d8eb1364d4d945dbc897c78 Author: Katarina Behrens Date: Fri Jun 15 13:14:34 2018 +0200 Fix suggesting file name (for new documents) Change-Id: I39eb672f7dd097e12ddb323ce702c6c28235b5d9 diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 72519f656bec..bc37f3c02127 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -190,7 +190,7 @@ void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name) return Q_EMIT setDefaultNameSignal(name); } -_dialog->selectUrl(QUrl(toQString(name))); +_dialog->selectFile(toQString(name)); } void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 27 --- vcl/unx/kde5/KDE5FilePicker.hxx | 11 ++- vcl/unx/kde5/KDE5FilePicker2.cxx | 37 - 3 files changed, 46 insertions(+), 29 deletions(-) New commits: commit cf04394a10f27218475b4a6aab0a5a705841cf2e Author: Katarina Behrens Date: Thu Jun 14 17:09:45 2018 +0200 Fix copy&pasta Change-Id: I493fa7a14557a919fab6bc6cf9f955507488af6d diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 3a6f2e9b94c4..4fae59304fed 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -197,7 +197,7 @@ private Q_SLOTS: OUString getDisplayDirectorySlot() { return getDisplayDirectory(); } void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue) { -return setValue(nControlAction, nControlAction, rValue); +return setValue(nControlId, nControlAction, rValue); } css::uno::Any getValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction) commit 16646bc1d2dc9b8127ff9120c8b6f8a94c7616d2 Author: Katarina Behrens Date: Thu Jun 14 17:08:17 2018 +0200 Implement get|setLabel, signal+slot Change-Id: I0188f7609b7a934949ffdf0a6e64547b08ff03a8 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 95eb6a5c3ba7..7a30359ef580 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -46,33 +46,6 @@ KDE5FilePicker::~KDE5FilePicker() delete _dialog; } -/*void KDE5FilePicker::setLabel(sal_Int16 controlId, const QString& label) -{ -if (_customWidgets.contains(controlId)) -{ -QCheckBox* cb = dynamic_cast(_customWidgets.value(controlId)); -if (cb) -cb->setText(label); -} -else -qWarning() << "set label on unknown control" << controlId; -} - -QString KDE5FilePicker::getLabel(sal_Int16 controlId) const -{ -QString label; -if (_customWidgets.contains(controlId)) -{ -QCheckBox* cb = dynamic_cast(_customWidgets.value(controlId)); -if (cb) -label = cb->text(); -} -else -qWarning() << "get label on unknown control" << controlId; - -return label; -}*/ - void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; } bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e) diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index fd0ed95da27a..3a6f2e9b94c4 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -180,6 +180,8 @@ Q_SIGNALS: const css::uno::Any& rValue); css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction); void enableControlSignal(sal_Int16 nControlId, sal_Bool bEnable); +void setLabelSignal(sal_Int16 nControlId, const OUString& rLabel); +OUString getLabelSignal(sal_Int16 nControlId); void appendFilterSignal(const OUString& rTitle, const OUString& rFilter); void appendFilterGroupSignal(const OUString& rTitle, const css::uno::Sequence& rFilters); @@ -208,6 +210,13 @@ private Q_SLOTS: return enableControl(nControlId, bEnable); } +void setLabelSlot(sal_Int16 nControId, const OUString& rLabel) +{ +return setLabel(nControId, rLabel); +} + +OUString getLabelSlot(sal_Int16 nControlId) { return getLabel(nControlId); } + void appendFilterSlot(const OUString& rTitle, const OUString& rFilter) { return appendFilter(rTitle, rFilter); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index ad229c880001..72519f656bec 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -115,6 +115,10 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::getValueSignal, this, &KDE5FilePicker::getValueSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::setLabelSignal, this, &KDE5FilePicker::setLabelSlot, +Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::getLabelSignal, this, &KDE5FilePicker::getLabelSlot, +Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::enableControlSignal, this, &KDE5FilePicker::enableControlSlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot, @@ -374,11 +378,42 @@ void SAL_CALL KDE5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable SAL_WARN("vcl.kde5", "enable on unknown control" << controlId); } -void SAL_CALL KDE5FilePicker::setLabel(sal_Int16 controlId, const OUString& label) {} +void SAL_CALL KDE5FilePicker::setLabel(sal_Int16 controlId, const OUString& label) +{ +if (qApp->thread() != QThr
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 25 + vcl/unx/kde5/KDE5FilePicker.hxx | 12 vcl/unx/kde5/KDE5FilePicker2.cxx | 32 +++- 3 files changed, 44 insertions(+), 25 deletions(-) New commits: commit 7a3f11b994568e6d8706817f15cb28e217005d14 Author: Katarina Behrens Date: Thu Jun 14 14:21:35 2018 +0200 Implement enableControl, signal+slot Change-Id: I84f81f689167ec332772c706b0d0c6d7562b5ac8 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index f69eb3435aa0..95eb6a5c3ba7 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -46,15 +46,7 @@ KDE5FilePicker::~KDE5FilePicker() delete _dialog; } -/*void KDE5FilePicker::enableControl(sal_Int16 controlId, bool enable) -{ -if (_customWidgets.contains(controlId)) -_customWidgets.value(controlId)->setEnabled(enable); -else -qWarning() << "enable on unknown control" << controlId; -} - -void KDE5FilePicker::setLabel(sal_Int16 controlId, const QString& label) +/*void KDE5FilePicker::setLabel(sal_Int16 controlId, const QString& label) { if (_customWidgets.contains(controlId)) { diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index da2dd7a09d16..fd0ed95da27a 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -179,6 +179,7 @@ Q_SIGNALS: void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue); css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction); +void enableControlSignal(sal_Int16 nControlId, sal_Bool bEnable); void appendFilterSignal(const OUString& rTitle, const OUString& rFilter); void appendFilterGroupSignal(const OUString& rTitle, const css::uno::Sequence& rFilters); @@ -202,6 +203,11 @@ private Q_SLOTS: return getValue(nControlId, nControlAction); } +void enableControlSlot(sal_Int16 nControlId, sal_Bool bEnable) +{ +return enableControl(nControlId, bEnable); +} + void appendFilterSlot(const OUString& rTitle, const OUString& rFilter) { return appendFilter(rTitle, rFilter); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 75488e88041b..ad229c880001 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -115,6 +115,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::getValueSignal, this, &KDE5FilePicker::getValueSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::enableControlSignal, this, &KDE5FilePicker::enableControlSlot, +Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::appendFilterGroupSignal, this, @@ -358,7 +360,19 @@ uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nContr return uno::Any(value); } -void SAL_CALL KDE5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable) {} +void SAL_CALL KDE5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable) +{ +if (qApp->thread() != QThread::currentThread()) +{ +SolarMutexReleaser aReleaser; +return Q_EMIT enableControlSignal(controlId, enable); +} + +if (_customWidgets.contains(controlId)) +_customWidgets.value(controlId)->setEnabled(enable); +else +SAL_WARN("vcl.kde5", "enable on unknown control" << controlId); +} void SAL_CALL KDE5FilePicker::setLabel(sal_Int16 controlId, const OUString& label) {} commit ff9e4f1f7ac84df15ecbf57f8ce56105e6985b05 Author: Katarina Behrens Date: Thu Jun 14 12:36:48 2018 +0200 Implement getValue, signal+slot Change-Id: Ic009ea5dc3ca3bf791d3348fce8d007022598c49 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 231e045f4ef5..f69eb3435aa0 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -46,22 +46,7 @@ KDE5FilePicker::~KDE5FilePicker() delete _dialog; } -/*bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const -{ -bool ret = false; -if (_customWidgets.contains(controlId)) -{ -QCheckBox* cb = dynamic_cast(_customWidgets.value(controlId)); -if (cb) -ret = cb->isChecked(); -} -else -qWarning() << "get value on unknown control" << controlId; - -return ret; -} - -void KDE5FilePicker::enableControl(sal_Int16 controlId, bool enable) +/*void KDE5FilePicker::enableControl(sal_Int16 controlId, bool enable) { if (_customWidgets.contains(controlId)) _customWidgets.value(controlId)
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 11 +-- vcl/unx/kde5/KDE5FilePicker.hxx |6 ++ vcl/unx/kde5/KDE5FilePicker2.cxx | 39 ++- 3 files changed, 41 insertions(+), 15 deletions(-) New commits: commit 4e48c8ec4fe35e91a8a3c41576a0be9adf74291a Author: Katarina Behrens Date: Wed Jun 13 13:51:46 2018 +0200 Add 2 more file/dir methods, signal+slot Change-Id: I0152e4e0fa72e27a144ca96f83fe6a282b272cbe diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 5d87022e36fb..231e045f4ef5 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -46,11 +46,7 @@ KDE5FilePicker::~KDE5FilePicker() delete _dialog; } -/*void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QUrl(name)); } - -QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryUrl().url(); } - -bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const +/*bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const { bool ret = false; if (_customWidgets.contains(controlId)) diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index f1bbcf7545df..8fbc24f73a63 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -173,7 +173,9 @@ protected: Q_SIGNALS: void setTitleSignal(const OUString& rTitle); +void setDefaultNameSignal(const OUString& rName); void setDisplayDirectorySignal(const OUString& rDir); +OUString getDisplayDirectorySignal(); void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue); void appendFilterSignal(const OUString& rTitle, const OUString& rFilter); @@ -186,7 +188,9 @@ Q_SIGNALS: private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } +void setDefaultNameSlot(const OUString& rName) { return setDefaultName(rName); } void setDisplayDirectorySlot(const OUString& rDir) { return setDisplayDirectory(rDir); } +OUString getDisplayDirectorySlot() { return getDisplayDirectory(); } void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue) { return setValue(nControlAction, nControlAction, rValue); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index fd0fedd7c7ac..87119f9e6bc9 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -102,9 +102,13 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged); connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this, &KDE5FilePicker::setTitleSlot /*(const OUString&)*/, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::setDefaultNameSignal, this, &KDE5FilePicker::setDefaultNameSlot, +Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this, &KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::getDisplayDirectorySignal, this, +&KDE5FilePicker::getDisplayDirectorySlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::setMultiSelectionSignal, this, &KDE5FilePicker::setMultiSelectionSlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot, @@ -170,7 +174,16 @@ void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) _dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile); } -void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name) {} +void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name) +{ +if (qApp->thread() != QThread::currentThread()) +{ +SolarMutexReleaser aReleaser; +return Q_EMIT setDefaultNameSignal(name); +} + +_dialog->selectUrl(QUrl(toQString(name))); +} void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir) { @@ -185,7 +198,13 @@ void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir) OUString SAL_CALL KDE5FilePicker::getDisplayDirectory() { -OUString dir; +if (qApp->thread() != QThread::currentThread()) +{ +SolarMutexReleaser aReleaser; +return Q_EMIT getDisplayDirectorySignal(); +} + +OUString dir = toOUString(_dialog->directoryUrl().url()); return dir; } commit 8172107173b63f4bfdd1add4d1ab7c4baacb79f4 Author: Katarina Behrens Date: Wed Jun 13 13:09:13 2018 +0200 Implement setMultiSelectionMode, signal+slot Change-Id: Idc411dc87a84b60a22fe7b6e7bba50b2c5302128 diff --git a/vcl/unx/kd
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
Rebased ref, commits from common ancestor: commit 4dd64053fa3d5b9f3e8d55aa0d2b31768d3f8474 Author: Katarina Behrens Date: Tue Jun 12 16:25:25 2018 +0200 Implement getSelectedFiles, signal+slot this finally makes fpicker usable Change-Id: Iedf7ed8de04947ffbc0e88348c95f2a937a8e69e diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index a8486bbcb6b2..2e9f3bd66752 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -55,8 +55,6 @@ void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QU QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryUrl().url(); } -QList KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); } - bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const { bool ret = false; diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index d4d6cae229cc..36cfb4263a11 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -181,6 +181,7 @@ Q_SIGNALS: const css::uno::Sequence& rFilters); void setCurrentFilterSignal(const OUString& rFilter); OUString getCurrentFilterSignal(); +css::uno::Sequence getSelectedFilesSignal(); private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } @@ -203,6 +204,7 @@ private Q_SLOTS: void setCurrentFilterSlot(const OUString& rFilter) { return setCurrentFilter(rFilter); } OUString getCurrentFilterSlot() { return getCurrentFilter(); } +css::uno::Sequence getSelectedFilesSlot() { return getFiles(); } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 05e9c61976e2..da068240a502 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -115,6 +115,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) &KDE5FilePicker::setCurrentFilterSlot, Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::getCurrentFilterSignal, this, &KDE5FilePicker::getCurrentFilterSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::getSelectedFilesSignal, this, +&KDE5FilePicker::getSelectedFilesSlot, Qt::BlockingQueuedConnection); qApp->installEventFilter(this); setMultiSelectionMode(false); @@ -187,7 +189,21 @@ uno::Sequence SAL_CALL KDE5FilePicker::getFiles() uno::Sequence SAL_CALL KDE5FilePicker::getSelectedFiles() { -uno::Sequence seq; +if (qApp->thread() != QThread::currentThread()) +{ +SolarMutexReleaser aReleaser; +return Q_EMIT getSelectedFilesSignal(); +} + +QList aURLs = _dialog->selectedUrls(); +uno::Sequence seq(aURLs.size()); + +size_t i = 0; +for (auto& aURL : aURLs) +{ +seq[i++] = toOUString(aURL.toString()); +} + return seq; } commit 64d69910115df2a9b58d4940976bd2aa104b6aee Author: Katarina Behrens Date: Tue Jun 12 12:54:59 2018 +0200 Implement get|setCurrentFilter, signal+slot Change-Id: I1fb29b673e5cb474de7230407b7924844b1460e0 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index be8a6050426e..a8486bbcb6b2 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -57,22 +57,6 @@ QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryU QList KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); } -void KDE5FilePicker::setCurrentFilter(const QString& title) -{ -_currentFilter = _titleToFilters.value(title); -} - -QString KDE5FilePicker::getCurrentFilter() const -{ -QString filter = _titleToFilters.key(_dialog->selectedNameFilter()); - -//default if not found -if (filter.isEmpty()) -filter = "ODF Text Document (.odt)"; - -return filter; -} - bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const { bool ret = false; diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index a5ab496a289b..d4d6cae229cc 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -179,6 +179,8 @@ Q_SIGNALS: void appendFilterSignal(const OUString& rTitle, const OUString& rFilter); void appendFilterGroupSignal(const OUString& rTitle, const css::uno::Sequence& rFilters); +void setCurrentFilterSignal(const OUString& rFilter); +OUString getCurrentFilterSignal(); private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } @@ -198,6 +200,9 @@ private Q_SLOTS: { return appendFilterGroup(rTitle, rFilters); } + +void setCurrentFilterSlot(const OUString& rFilter) { return setCurrentFilter(rFilter); } +OUString getCurre
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 16 vcl/unx/kde5/KDE5FilePicker.hxx |5 + vcl/unx/kde5/KDE5FilePicker2.cxx | 16 ++-- 3 files changed, 19 insertions(+), 18 deletions(-) New commits: commit 89a570b0215865f4ade0778052cba6e8e5bca8e8 Author: Katarina Behrens Date: Tue Jun 12 12:54:59 2018 +0200 Implement get|setCurrentFilter, signal+slot Change-Id: I1fb29b673e5cb474de7230407b7924844b1460e0 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index be8a6050426e..a8486bbcb6b2 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -57,22 +57,6 @@ QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryU QList KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); } -void KDE5FilePicker::setCurrentFilter(const QString& title) -{ -_currentFilter = _titleToFilters.value(title); -} - -QString KDE5FilePicker::getCurrentFilter() const -{ -QString filter = _titleToFilters.key(_dialog->selectedNameFilter()); - -//default if not found -if (filter.isEmpty()) -filter = "ODF Text Document (.odt)"; - -return filter; -} - bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const { bool ret = false; diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index a5ab496a289b..d4d6cae229cc 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -179,6 +179,8 @@ Q_SIGNALS: void appendFilterSignal(const OUString& rTitle, const OUString& rFilter); void appendFilterGroupSignal(const OUString& rTitle, const css::uno::Sequence& rFilters); +void setCurrentFilterSignal(const OUString& rFilter); +OUString getCurrentFilterSignal(); private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } @@ -198,6 +200,9 @@ private Q_SLOTS: { return appendFilterGroup(rTitle, rFilters); } + +void setCurrentFilterSlot(const OUString& rFilter) { return setCurrentFilter(rFilter); } +OUString getCurrentFilterSlot() { return getCurrentFilter(); } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index c75c56c21095..e73feeb13adb 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -111,6 +111,10 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::appendFilterGroupSignal, this, &KDE5FilePicker::appendFilterGroupSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::setCurrentFilterSignal, this, +&KDE5FilePicker::setCurrentFilterSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::getCurrentFilterSignal, this, +&KDE5FilePicker::getCurrentFilterSlot, Qt::BlockingQueuedConnection); qApp->installEventFilter(this); setMultiSelectionMode(false); @@ -211,11 +215,19 @@ void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString _titleToFilters[t] = _filters.constLast(); } -void SAL_CALL KDE5FilePicker::setCurrentFilter(const OUString& title) {} +void SAL_CALL KDE5FilePicker::setCurrentFilter(const OUString& title) +{ +_currentFilter = _titleToFilters.value(toQString(title)); +} OUString SAL_CALL KDE5FilePicker::getCurrentFilter() { -OUString filter; +OUString filter = toOUString(_titleToFilters.key(_dialog->selectedNameFilter())); + +//default if not found +if (filter.isEmpty()) +filter = "ODF Text Document (.odt)"; + return filter; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 18 -- vcl/unx/kde5/KDE5FilePicker.hxx | 14 ++ vcl/unx/kde5/KDE5FilePicker2.cxx | 36 ++-- 3 files changed, 48 insertions(+), 20 deletions(-) New commits: commit 857524324f3c4f99fb96ebe0b9b04d25d1febe62 Author: Katarina Behrens Date: Mon Jun 11 15:22:07 2018 +0200 Implement appendFilter[Group], signal+slot Change-Id: I0a195de54a8631c2218f6704ca564c0c9f06becf diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index dd5f3c0ecc45..be8a6050426e 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -57,24 +57,6 @@ QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryU QList KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); } -void KDE5FilePicker::appendFilter(const QString& title, const QString& filter) -{ -QString t = title; -QString f = filter; -// '/' need to be escaped else they are assumed to be mime types by kfiledialog -//see the docs -t.replace("/", "\\/"); - -// openoffice gives us filters separated by ';' qt dialogs just want space separated -f.replace(";", " "); - -// make sure "*.*" is not used as "all files" -f.replace("*.*", "*"); - -_filters << QStringLiteral("%1 (%2)").arg(t, f); -_titleToFilters[t] = _filters.constLast(); -} - void KDE5FilePicker::setCurrentFilter(const QString& title) { _currentFilter = _titleToFilters.value(title); diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 675becf0bf68..a5ab496a289b 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -176,6 +176,9 @@ Q_SIGNALS: void setDisplayDirectorySignal(const OUString& rDir); void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue); +void appendFilterSignal(const OUString& rTitle, const OUString& rFilter); +void appendFilterGroupSignal(const OUString& rTitle, + const css::uno::Sequence& rFilters); private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } @@ -184,6 +187,17 @@ private Q_SLOTS: { return setValue(nControlAction, nControlAction, rValue); } + +void appendFilterSlot(const OUString& rTitle, const OUString& rFilter) +{ +return appendFilter(rTitle, rFilter); +} + +void appendFilterGroupSlot(const OUString& rTitle, + const css::uno::Sequence& rFilters) +{ +return appendFilterGroup(rTitle, rFilters); +} }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index ab3cc61191ed..c75c56c21095 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -107,6 +107,10 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) Qt::BlockingQueuedConnection); connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot, +Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::appendFilterGroupSignal, this, +&KDE5FilePicker::appendFilterGroupSlot, Qt::BlockingQueuedConnection); qApp->installEventFilter(this); setMultiSelectionMode(false); @@ -183,7 +187,29 @@ uno::Sequence SAL_CALL KDE5FilePicker::getSelectedFiles() return seq; } -void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString& filter) {} +void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString& filter) +{ +if (qApp->thread() != QThread::currentThread()) +{ +SolarMutexReleaser aReleaser; +return Q_EMIT appendFilterSignal(title, filter); +} + +QString t(toQString(title)); +QString f(toQString(filter)); +// '/' need to be escaped else they are assumed to be mime types by kfiledialog +//see the docs +t.replace("/", "\\/"); + +// libreoffice separates by filters by ';' qt dialogs by space +f.replace(";", " "); + +// make sure "*.*" is not used as "all files" +f.replace("*.*", "*"); + +_filters << QStringLiteral("%1 (%2)").arg(t, f); +_titleToFilters[t] = _filters.constLast(); +} void SAL_CALL KDE5FilePicker::setCurrentFilter(const OUString& title) {} @@ -193,9 +219,15 @@ OUString SAL_CALL KDE5FilePicker::getCurrentFilter() return filter; } -void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& /*rGroupTitle*/, +void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& rGroupTitle, const uno::Sequence& filters) { +if (qApp->thre
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 27 --- vcl/unx/kde5/KDE5FilePicker.hxx |6 ++ vcl/unx/kde5/KDE5FilePicker2.cxx | 31 +++ 3 files changed, 37 insertions(+), 27 deletions(-) New commits: commit d0f6f32a5217106c14ba0a6e234c8ee90011894e Author: Katarina Behrens Date: Fri Jun 8 22:49:26 2018 +0200 Distinguish between open vs. save file dialog Change-Id: I1b9dee1a8cd4034f64c2c1b843cee1863a5dc1d9 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 02135eaa4a9a..dd5f3c0ecc45 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -141,21 +141,6 @@ QString KDE5FilePicker::getLabel(sal_Int16 controlId) const return label; }*/ -/*void KDE5FilePicker::initialize(bool saveDialog) -{ -//default is opening -QFileDialog::AcceptMode operationMode -= saveDialog ? QFileDialog::AcceptSave : QFileDialog::AcceptOpen; - -_dialog->setAcceptMode(operationMode); - -if (saveDialog) -{ -_dialog->setConfirmOverwrite(true); -_dialog->setFileMode(QFileDialog::AnyFile); -} -}*/ - void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; } bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e) diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index a920b9f3cbb7..ab3cc61191ed 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -452,6 +452,19 @@ void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence& args) OSL_TRACE("Unknown templates %d", templateId); return; } + +//default is opening +QFileDialog::AcceptMode operationMode += saveDialog ? QFileDialog::AcceptSave : QFileDialog::AcceptOpen; + +_dialog->setAcceptMode(operationMode); + +if (saveDialog) +{ +_dialog->setConfirmOverwrite(true); +_dialog->setFileMode(QFileDialog::AnyFile); +} + setTitle(VclResId(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN)); } commit 5c628b4bd569eec4d7624e8f11c3b4d8812c4ec8 Author: Katarina Behrens Date: Fri Jun 8 22:40:45 2018 +0200 Implement setValue of fpicker checkboxes, signal+slot Change-Id: I0d75ef9f5584935d05a0526a626145e00761efd9 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index d3939e1d7e1f..02135eaa4a9a 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -91,18 +91,6 @@ QString KDE5FilePicker::getCurrentFilter() const return filter; } -void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, bool value) -{ -if (_customWidgets.contains(controlId)) -{ -QCheckBox* cb = dynamic_cast(_customWidgets.value(controlId)); -if (cb) -cb->setChecked(value); -} -else -qWarning() << "set value on unknown control" << controlId; -} - bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const { bool ret = false; diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index d303ba30a6ac..675becf0bf68 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -174,10 +174,16 @@ protected: Q_SIGNALS: void setTitleSignal(const OUString& rTitle); void setDisplayDirectorySignal(const OUString& rDir); +void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction, +const css::uno::Any& rValue); private Q_SLOTS: void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); } void setDisplayDirectorySlot(const OUString& rDir) { return setDisplayDirectory(rDir); } +void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue) +{ +return setValue(nControlAction, nControlAction, rValue); +} }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 96b6a0fe3c4f..a920b9f3cbb7 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -105,6 +105,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this, &KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/, Qt::BlockingQueuedConnection); +connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot, +Qt::BlockingQueuedConnection); qApp->installEventFilter(this); setMultiSelectionMode(false); @@ -205,6 +207,23 @@ void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& /*rGroupTitle*/, void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, const uno::Any& value) { +if (qApp->thread() != QThread::currentThread())
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 14 -- vcl/unx/kde5/KDE5FilePicker2.cxx | 11 +++ 2 files changed, 11 insertions(+), 14 deletions(-) New commits: commit e110ef21224398b68719658340bcfd31fdcbe859 Author: Katarina Behrens Date: Thu Jun 7 15:48:12 2018 +0200 Show LibO's custom checkboxes in native fpicker Change-Id: I9cd6b0b393024957c3dec1bd7e381db62f711a24 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 9891439ae0ee..d3939e1d7e1f 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -153,20 +153,6 @@ QString KDE5FilePicker::getLabel(sal_Int16 controlId) const return label; }*/ -/*void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool hidden) -{ -auto resString = label; -resString.replace('~', '&'); - -auto widget = new QCheckBox(resString, _extraControls); -widget->setHidden(hidden); -if (!hidden) -{ -_layout->addWidget(widget); -} -_customWidgets.insert(controlId, widget); -}*/ - /*void KDE5FilePicker::initialize(bool saveDialog) { //default is opening diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 759b2fccf790..96b6a0fe3c4f 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -303,6 +303,17 @@ void KDE5FilePicker::addCustomControl(sal_Int16 controlId) // the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify // code, but the checkbox is hidden and ignored bool hidden = controlId == CHECKBOX_AUTOEXTENSION; +auto resString = toQString(VclResId(resId)); +resString.replace('~', '&'); + +auto widget = new QCheckBox(resString, _extraControls); +widget->setHidden(hidden); +if (!hidden) +{ +_layout->addWidget(widget); +} +_customWidgets.insert(controlId, widget); + break; } case PUSHBUTTON_PLAY: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 3 commits - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx |4 --- vcl/unx/kde5/KDE5FilePicker.hxx | 19 -- vcl/unx/kde5/KDE5FilePicker2.cxx | 40 +-- vcl/unx/kde5/KDE5SalInstance.cxx | 10 +++-- vcl/unx/kde5/KDE5SalInstance.hxx |3 ++ 5 files changed, 62 insertions(+), 14 deletions(-) New commits: commit 9cec4e710b11eff5e258d2a4c631c6a9989ddb6d Author: Katarina Behrens Date: Thu Jun 7 14:20:07 2018 +0200 Basic native folder picker Change-Id: I1b77d7a1c8a4a3581554fb5c481b7d9039497ced diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index 3a02c770eda6..d303ba30a6ac 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -37,13 +38,15 @@ #include #include #include +#include class QFileDialog; class QGridLayout; class QWidget; typedef ::cppu::WeakComponentImplHelper @@ -80,7 +83,7 @@ protected: bool allowRemoteUrls; public: -explicit KDE5FilePicker(const css::uno::Reference&); +explicit KDE5FilePicker(QFileDialog::FileMode); virtual ~KDE5FilePicker() override; void enableFolderMode(); @@ -121,6 +124,10 @@ public: virtual void SAL_CALL setLabel(sal_Int16 nControlId, const OUString& rLabel) override; virtual OUString SAL_CALL getLabel(sal_Int16 nControlId) override; +// XFolderPicker stuff +virtual OUString SAL_CALL getDirectory() override; +virtual void SAL_CALL setDescription(const OUString& rDescription) override; + /* TODO XFilePreview virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( ); diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 93e6d503d32b..759b2fccf790 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -77,7 +77,7 @@ uno::Sequence FilePicker_getSupportedServiceNames() // KDE5FilePicker -KDE5FilePicker::KDE5FilePicker(const uno::Reference&) +KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode) : KDE5FilePicker_Base(_helperMutex) , _dialog(new QFileDialog(nullptr, {}, QDir::homePath())) , _extraControls(new QWidget) @@ -94,6 +94,7 @@ KDE5FilePicker::KDE5FilePicker(const uno::Reference&) QStringLiteral("webdavs"), QStringLiteral("smb"), }); +_dialog->setFileMode(eMode); setMultiSelectionMode(false); @@ -231,6 +232,10 @@ OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId) return label; } +OUString SAL_CALL KDE5FilePicker::getDirectory() { return OUString(); } + +void SAL_CALL KDE5FilePicker::setDescription(const OUString&) {} + void KDE5FilePicker::addCustomControl(sal_Int16 controlId) { const char* resId = nullptr; diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx index ac6173e13550..37021cbe9315 100644 --- a/vcl/unx/kde5/KDE5SalInstance.cxx +++ b/vcl/unx/kde5/KDE5SalInstance.cxx @@ -49,9 +49,15 @@ SalFrame* KDE5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nSt } uno::Reference -KDE5SalInstance::createFilePicker(const uno::Reference& xMSF) +KDE5SalInstance::createFilePicker(const uno::Reference& /*xMSF*/) { -return uno::Reference(new KDE5FilePicker(xMSF)); +return uno::Reference(new KDE5FilePicker(QFileDialog::ExistingFile)); +} + +uno::Reference +KDE5SalInstance::createFolderPicker(const uno::Reference& /*xMSF*/) +{ +return uno::Reference(new KDE5FilePicker(QFileDialog::Directory)); } bool KDE5SalInstance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); } diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kde5/KDE5SalInstance.hxx index cc7d7ad7cbce..0bf30ab8b235 100644 --- a/vcl/unx/kde5/KDE5SalInstance.hxx +++ b/vcl/unx/kde5/KDE5SalInstance.hxx @@ -36,6 +36,9 @@ public: virtual css::uno::Reference createFilePicker(const css::uno::Reference&) override; +virtual css::uno::Reference +createFolderPicker(const css::uno::Reference&) override; + virtual bool IsMainThread() const override; }; commit d9e66bd17cbb6f377cfe9994c1ac2c9e4c18f928 Author: Katarina Behrens Date: Thu Jun 7 13:26:59 2018 +0200 Implement setDisplayDirectory, signal+slot Change-Id: Ieb3fb6bb9afa8cddbfd7f14ddfb36faebd524701 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index 3968a0f686a6..9891439ae0ee 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -53,8 +53,6 @@ KDE5FilePicker::~KDE5FilePicker() void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QUrl(name)); } -void KDE5FilePicker::setDisplayDirectory(const QString& dir) { _dialog->selectUrl(QUrl(dir)); } - QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryUrl().url(); } QList KDE5FilePicker::getSelectedFiles() const {
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - configure.ac vcl/Library_vclplug_kde5.mk vcl/unx
Rebased ref, commits from common ancestor: commit f04f227ee3193b604f23c4977a86d17247f64c04 Author: Katarina Behrens Date: Wed Jun 6 15:35:00 2018 +0200 We don't need to link X11 libs either Change-Id: I01b9f897abda67b12ed6f05844dca05dabb185a2 diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index 5e9559c159f1..655ae6b80d96 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -61,13 +61,6 @@ $(eval $(call gb_Library_use_externals,vclplug_kde5,\ epoxy \ )) -$(eval $(call gb_Library_add_libs,vclplug_kde5,\ - -lX11 \ - -lXext \ - -lSM \ - -lICE \ -)) - ifneq ($(QT5_HAVE_GLIB),) $(eval $(call gb_Library_add_defs,vclplug_kde5,\ $(QT5_GLIB_CFLAGS) \ commit 735595cf8b74e3e7197b6805db204088438f972e Author: Katarina Behrens Date: Wed Jun 6 13:32:47 2018 +0200 [Try to] get rid of dependency on X11 also kill KDE5SalDisplay with fire, it is not used anywhere anymore Change-Id: I4fe439b01322a6e3a809cf518e32d844c303daca diff --git a/configure.ac b/configure.ac index 09cadec75714..04535026584c 100644 --- a/configure.ac +++ b/configure.ac @@ -11199,7 +11199,7 @@ then PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])]) KF5_CFLAGS="-I$kf5_incdir -I$kf5_incdir/KCoreAddons -I$kf5_incdir/KI18n -I$kf5_incdir/KConfigCore -I$kf5_incdir/KWindowSystem -I$kf5_incdir/KIOCore -I$kf5_incdir/KIOWidgets -I$kf5_incdir/KIOFileWidgets -I$qt5_incdir -I$qt5_incdir/QtCore -I$qt5_incdir/QtGui -I$qt5_incdir/QtWidgets -I$qt5_incdir/QtNetwork -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT $KF5_XCB_CFLAGS" -KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network -lQt5X11Extras $KF5_XCB_LIBS" +KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network $KF5_XCB_LIBS" KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g") AC_LANG_PUSH([C++]) diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index 37a830b068dd..5e9559c159f1 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -34,7 +34,6 @@ $(eval $(call gb_Library_add_defs,vclplug_kde5,\ $(eval $(call gb_Library_use_sdk_api,vclplug_kde5)) $(eval $(call gb_Library_use_libraries,vclplug_kde5,\ -vclplug_gen \ vclplug_qt5 \ vcl \ tl \ @@ -90,7 +89,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ vcl/unx/kde5/KDE5FilePicker \ vcl/unx/kde5/KDE5FilePicker2 \ vcl/unx/kde5/KDE5SalData \ -vcl/unx/kde5/KDE5SalDisplay \ vcl/unx/kde5/KDE5SalFrame \ vcl/unx/kde5/KDE5SalGraphics \ vcl/unx/kde5/KDE5SalInstance \ diff --git a/vcl/unx/kde5/KDE5SalDisplay.cxx b/vcl/unx/kde5/KDE5SalDisplay.cxx deleted file mode 100644 index fa5e40f56ff9.. --- a/vcl/unx/kde5/KDE5SalDisplay.cxx +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- 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 "VCLKDE5Application.hxx" -#include "KDE5SalDisplay.hxx" - -#ifdef Bool -#undef Bool -#endif - -#include - -SalKDE5Display* SalKDE5Display::selfptr = nullptr; - -SalKDE5Display::SalKDE5Display(Display* pDisp) -: SalX11Display(pDisp) -{ -assert(selfptr == nullptr); -selfptr = this; -xim_protocol = XInternAtom(pDisp_, "_XIM_PROTOCOL", False); -} - -SalKDE5Display::~SalKDE5Display() -{ -// in case never a frame opened -// clean up own members -doDestruct(); -selfptr = nullptr; -// prevent SalDisplay from closing KApplication's display -pDisp_ = nullptr; -} - -void SalKDE5Display::Yield() -{ -if (DispatchInternalEvent()) -return; - -// Prevent blocking from Drag'n'Drop events, which may have already have processed the event -if (XEventsQueued(pDisp_, QueuedAfterReading) == 0) -return; - -DBG_ASSERT(GetSalData()->m_pInstance->GetYieldMutex()->IsCu
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - configure.ac vcl/Library_vclplug_kde5.mk vcl/unx
configure.ac |2 vcl/Library_vclplug_kde5.mk |2 vcl/unx/kde5/KDE5SalDisplay.cxx | 93 --- vcl/unx/kde5/KDE5SalDisplay.hxx | 45 -- vcl/unx/kde5/KDE5SalFrame.hxx|2 vcl/unx/kde5/KDE5SalGraphics.hxx |2 6 files changed, 1 insertion(+), 145 deletions(-) New commits: commit f4d93e637f9457c850d3869f7ad6384e3d1dd9f9 Author: Katarina Behrens Date: Wed Jun 6 13:32:47 2018 +0200 [Try to] get rid of dependency on X11 also kill KDE5SalDisplay with fire, it is not used anywhere anymore Change-Id: I4fe439b01322a6e3a809cf518e32d844c303daca diff --git a/configure.ac b/configure.ac index 09cadec75714..04535026584c 100644 --- a/configure.ac +++ b/configure.ac @@ -11199,7 +11199,7 @@ then PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])]) KF5_CFLAGS="-I$kf5_incdir -I$kf5_incdir/KCoreAddons -I$kf5_incdir/KI18n -I$kf5_incdir/KConfigCore -I$kf5_incdir/KWindowSystem -I$kf5_incdir/KIOCore -I$kf5_incdir/KIOWidgets -I$kf5_incdir/KIOFileWidgets -I$qt5_incdir -I$qt5_incdir/QtCore -I$qt5_incdir/QtGui -I$qt5_incdir/QtWidgets -I$qt5_incdir/QtNetwork -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT $KF5_XCB_CFLAGS" -KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network -lQt5X11Extras $KF5_XCB_LIBS" +KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network $KF5_XCB_LIBS" KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g") AC_LANG_PUSH([C++]) diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index 37a830b068dd..5e9559c159f1 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -34,7 +34,6 @@ $(eval $(call gb_Library_add_defs,vclplug_kde5,\ $(eval $(call gb_Library_use_sdk_api,vclplug_kde5)) $(eval $(call gb_Library_use_libraries,vclplug_kde5,\ -vclplug_gen \ vclplug_qt5 \ vcl \ tl \ @@ -90,7 +89,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ vcl/unx/kde5/KDE5FilePicker \ vcl/unx/kde5/KDE5FilePicker2 \ vcl/unx/kde5/KDE5SalData \ -vcl/unx/kde5/KDE5SalDisplay \ vcl/unx/kde5/KDE5SalFrame \ vcl/unx/kde5/KDE5SalGraphics \ vcl/unx/kde5/KDE5SalInstance \ diff --git a/vcl/unx/kde5/KDE5SalDisplay.cxx b/vcl/unx/kde5/KDE5SalDisplay.cxx deleted file mode 100644 index fa5e40f56ff9.. --- a/vcl/unx/kde5/KDE5SalDisplay.cxx +++ /dev/null @@ -1,93 +0,0 @@ -/* -*- 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 "VCLKDE5Application.hxx" -#include "KDE5SalDisplay.hxx" - -#ifdef Bool -#undef Bool -#endif - -#include - -SalKDE5Display* SalKDE5Display::selfptr = nullptr; - -SalKDE5Display::SalKDE5Display(Display* pDisp) -: SalX11Display(pDisp) -{ -assert(selfptr == nullptr); -selfptr = this; -xim_protocol = XInternAtom(pDisp_, "_XIM_PROTOCOL", False); -} - -SalKDE5Display::~SalKDE5Display() -{ -// in case never a frame opened -// clean up own members -doDestruct(); -selfptr = nullptr; -// prevent SalDisplay from closing KApplication's display -pDisp_ = nullptr; -} - -void SalKDE5Display::Yield() -{ -if (DispatchInternalEvent()) -return; - -// Prevent blocking from Drag'n'Drop events, which may have already have processed the event -if (XEventsQueued(pDisp_, QueuedAfterReading) == 0) -return; - -DBG_ASSERT(GetSalData()->m_pInstance->GetYieldMutex()->IsCurrentThread(), - "will crash soon since solar mutex not locked in SalKDE5Display::Yield"); - -/*XEvent event; -XNextEvent( pDisp_, &event ); -if( checkDirectInputEvent( &event )) -return; -qApp->x11ProcessEvent( &event );*/ -} - -// HACK: When using Qt event loop, input methods (japanese, etc.) will get broken because -// of XFilterEvent() ge
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 14 +- vcl/unx/kde5/KDE5FilePicker2.cxx | 12 +++- vcl/unx/kde5/KDE5SalInstance.cxx |3 ++- 3 files changed, 14 insertions(+), 15 deletions(-) New commits: commit de9210e0be28225e36818789d2b692c5a7a14c52 Author: Katarina Behrens Date: Wed Jun 6 12:20:13 2018 +0200 Basic KDE5 native file picker opens now Change-Id: I3bb5d45f3337fbe26d80acb1fac7a433de904546 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index bfbe56304d0d..3e1387da7fd2 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -48,19 +48,7 @@ KDE5FilePicker::~KDE5FilePicker() //void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); } -/*bool KDE5FilePicker::execute() -{ -if (!_filters.isEmpty()) -_dialog->setNameFilters(_filters); -if (!_currentFilter.isEmpty()) -_dialog->selectNameFilter(_currentFilter); - -_dialog->show(); -//block and wait for user input -return _dialog->exec() == QFileDialog::Accepted; -} - -void KDE5FilePicker::setMultiSelectionMode(bool multiSelect) +/*void KDE5FilePicker::setMultiSelectionMode(bool multiSelect) { _dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile); } diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 12a29c8d4d29..e505791cad03 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -119,7 +119,17 @@ void SAL_CALL KDE5FilePicker::removeFilePickerListener(const uno::ReferencesetNameFilters(_filters); +if (!_currentFilter.isEmpty()) +_dialog->selectNameFilter(_currentFilter); + +_dialog->show(); +//block and wait for user input +return _dialog->exec() == QFileDialog::Accepted; +} void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) {} diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx index 120bf409b36c..b4e2b68e8045 100644 --- a/vcl/unx/kde5/KDE5SalInstance.cxx +++ b/vcl/unx/kde5/KDE5SalInstance.cxx @@ -26,6 +26,7 @@ #include +#include "KDE5FilePicker.hxx" #include "KDE5SalData.hxx" #include "KDE5SalInstance.hxx" #include "KDE5SalFrame.hxx" @@ -51,7 +52,7 @@ SalFrame* KDE5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nSt uno::Reference KDE5SalInstance::createFilePicker(const uno::Reference& xMSF) { -return SalInstance::createFilePicker(xMSF); +return uno::Reference(new KDE5FilePicker(xMSF)); } bool KDE5SalInstance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5FilePicker.cxx | 44 ++-- vcl/unx/kde5/KDE5FilePicker.hxx | 118 +- vcl/unx/kde5/KDE5FilePicker2.cxx | 103 +++--- vcl/unx/kde5/KDE5FilePicker2.hxx | 133 --- 4 files changed, 163 insertions(+), 235 deletions(-) New commits: commit 0159606e77d78ad8c699ddd60188f5424ac9813e Author: Katarina Behrens Date: Mon Jun 4 18:49:45 2018 +0200 Start folding KDE5FilePicker2 into KDE5FilePicker Change-Id: I1004ccba52fb23549dd85c20068da5c62d7bc964 diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index bda9de9b9ae3..bfbe56304d0d 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -34,32 +34,6 @@ // KDE5FilePicker -KDE5FilePicker::KDE5FilePicker(QObject* parent) -: QObject(parent) -, _dialog(new QFileDialog(nullptr, {}, QDir::homePath())) -, _extraControls(new QWidget) -, _layout(new QGridLayout(_extraControls)) -, _winId(0) -, allowRemoteUrls(false) -{ -_dialog->setSupportedSchemes({ -QStringLiteral("file"), -QStringLiteral("ftp"), -QStringLiteral("http"), -QStringLiteral("https"), -QStringLiteral("webdav"), -QStringLiteral("webdavs"), -QStringLiteral("smb"), -}); - -setMultiSelectionMode(false); - -connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged); -connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged); - -qApp->installEventFilter(this); -} - void KDE5FilePicker::enableFolderMode() { _dialog->setOption(QFileDialog::ShowDirsOnly, true); @@ -72,9 +46,9 @@ KDE5FilePicker::~KDE5FilePicker() delete _dialog; } -void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); } +//void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); } -bool KDE5FilePicker::execute() +/*bool KDE5FilePicker::execute() { if (!_filters.isEmpty()) _dialog->setNameFilters(_filters); @@ -133,7 +107,7 @@ QString KDE5FilePicker::getCurrentFilter() const return filter; } -void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 /*nControlAction*/, bool value) +void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, bool value) { if (_customWidgets.contains(controlId)) { @@ -145,7 +119,7 @@ void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 /*nControlAction*/, qWarning() << "set value on unknown control" << controlId; } -bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 /*nControlAction*/) const +bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const { bool ret = false; if (_customWidgets.contains(controlId)) @@ -193,9 +167,9 @@ QString KDE5FilePicker::getLabel(sal_Int16 controlId) const qWarning() << "get label on unknown control" << controlId; return label; -} +}*/ -void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool hidden) +/*void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool hidden) { auto resString = label; resString.replace('~', '&'); @@ -207,9 +181,9 @@ void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool _layout->addWidget(widget); } _customWidgets.insert(controlId, widget); -} +}*/ -void KDE5FilePicker::initialize(bool saveDialog) +/*void KDE5FilePicker::initialize(bool saveDialog) { //default is opening QFileDialog::AcceptMode operationMode @@ -222,7 +196,7 @@ void KDE5FilePicker::initialize(bool saveDialog) _dialog->setConfirmOverwrite(true); _dialog->setFileMode(QFileDialog::AnyFile); } -} +}*/ void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; } diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx index d999f7bf7a09..ea18b3298ed4 100644 --- a/vcl/unx/kde5/KDE5FilePicker.hxx +++ b/vcl/unx/kde5/KDE5FilePicker.hxx @@ -19,21 +19,43 @@ #pragma once +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + #include #include #include #include -#include - class QFileDialog; -class QWidget; class QGridLayout; +class QWidget; + +typedef ::cppu::WeakComponentImplHelper +KDE5FilePicker_Base; -class KDE5FilePicker : public QObject +class KDE5FilePicker : public QObject, public KDE5FilePicker_Base { Q_OBJECT protected: +css::uno::Reference m_xListener; +osl::Mutex _helperMutex; + //the dialog to display QFileDialog* _dialog; @@ -58,53 +80,89 @@ protected: bool allowRemoteUrls; public: -explicit KDE5FilePicker(QObject* parent = nullptr); -~KDE5FilePicker() override; +explicit KDE5FilePicker(const css::uno::Reference&); +vi
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc
vcl/inc/qt5/Qt5Tools.hxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit e56c81cc996747e3768cf171d0d6e94753b7d2af Author: Katarina Behrens Date: Mon Jun 4 16:45:58 2018 +0200 Qt's interpretation of transparency is different from vcl's one thanks Sergei Reznikov for pointing this out Change-Id: Ib07d144bb50b178ee7b36f2c7b2eaede27ed10bc diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx index a714f19e8a87..f075468ca3d3 100644 --- a/vcl/inc/qt5/Qt5Tools.hxx +++ b/vcl/inc/qt5/Qt5Tools.hxx @@ -58,7 +58,8 @@ inline Size toSize(const QSize& rSize) { return Size(rSize.width(), rSize.height inline QColor toQColor(const Color& rColor) { -return QColor(rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue(), rColor.GetTransparency()); +return QColor(rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue(), + 255 - rColor.GetTransparency()); } static constexpr QImage::Format Qt5_DefaultFormat32 = QImage::Format_ARGB32; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 174 commits - android/source basctl/source bin/check-elf-dynamic-objects bin/oss-fuzz-build.sh canvas/source chart2/qa chart2/source comphel
Rebased ref, commits from common ancestor: commit a4186c6c0d413c557c199dbb9814c5e787e8608b Author: Katarina Behrens Date: Mon Jun 4 15:39:40 2018 +0200 Basic structures of KDE5 native filepicker build now Change-Id: I174a4a01f2191d935ea069a0e04b5c88f4bf8193 diff --git a/vcl/CustomTarget_kde5_moc.mk b/vcl/CustomTarget_kde5_moc.mk index 8bcaf1ed3700..5c7fea94428b 100644 --- a/vcl/CustomTarget_kde5_moc.mk +++ b/vcl/CustomTarget_kde5_moc.mk @@ -10,6 +10,7 @@ $(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kde5)) $(call gb_CustomTarget_get_target,vcl/unx/kde5) : \ + $(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/KDE5FilePicker.moc \ $(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_socket_notifiers.moc \ $(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_posted_events.moc diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index 377698d1f93c..37a830b068dd 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -87,6 +87,8 @@ $(eval $(call gb_Library_add_libs,vclplug_kde5,\ )) $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ +vcl/unx/kde5/KDE5FilePicker \ +vcl/unx/kde5/KDE5FilePicker2 \ vcl/unx/kde5/KDE5SalData \ vcl/unx/kde5/KDE5SalDisplay \ vcl/unx/kde5/KDE5SalFrame \ diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx index f3b48b837836..bda9de9b9ae3 100644 --- a/vcl/unx/kde5/KDE5FilePicker.cxx +++ b/vcl/unx/kde5/KDE5FilePicker.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "kde5_filepicker.hxx" +#include "KDE5FilePicker.hxx" #include #include @@ -241,6 +241,6 @@ bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e) return QObject::eventFilter(o, e); } -#include +#include /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx index 011769091f6d..b2bafcdda95b 100644 --- a/vcl/unx/kde5/KDE5FilePicker2.cxx +++ b/vcl/unx/kde5/KDE5FilePicker2.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "gtk3_kde5_filepicker.hxx" +#include "KDE5FilePicker2.hxx" #include #include @@ -88,33 +88,19 @@ void SAL_CALL KDE5FilePicker2::removeFilePickerListener(const uno::Reference SAL_CALL KDE5FilePicker2::getFiles() uno::Sequence SAL_CALL KDE5FilePicker2::getSelectedFiles() { -auto id = m_ipc.sendCommand(Commands::GetSelectedFiles); uno::Sequence seq; -m_ipc.readResponse(id, seq); return seq; } -void SAL_CALL KDE5FilePicker2::appendFilter(const OUString& title, const OUString& filter) -{ -m_ipc.sendCommand(Commands::AppendFilter, title, filter); -} +void SAL_CALL KDE5FilePicker2::appendFilter(const OUString& title, const OUString& filter) {} -void SAL_CALL KDE5FilePicker2::setCurrentFilter(const OUString& title) -{ -m_ipc.sendCommand(Commands::SetCurrentFilter, title); -} +void SAL_CALL KDE5FilePicker2::setCurrentFilter(const OUString& title) {} OUString SAL_CALL KDE5FilePicker2::getCurrentFilter() { -auto id = m_ipc.sendCommand(Commands::GetCurrentFilter); OUString filter; -m_ipc.readResponse(id, filter); return filter; } @@ -166,14 +142,6 @@ void SAL_CALL KDE5FilePicker2::appendFilterGroup(const OUString& /*rGroupTitle*/ void SAL_CALL KDE5FilePicker2::setValue(sal_Int16 controlId, sal_Int16 nControlAction, const uno::Any& value) { -if (value.has()) -{ -m_ipc.sendCommand(Commands::SetValue, controlId, nControlAction, value.get()); -} -else -{ -OSL_TRACE("set value of unhandled type %d", controlId); -} } uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nControlAction) @@ -186,29 +154,18 @@ uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nCont // saves the value of the setting, so LO core is not needed for that either. return uno::Any(false); -auto id = m_ipc.sendCommand(Commands::GetValue, controlId, nControlAction); - bool value = false; -m_ipc.readResponse(id, value); return uno::Any(value); } -void SAL_CALL KDE5FilePicker2::enableControl(sal_Int16 controlId, sal_Bool enable) -{ -m_ipc.sendCommand(Commands::EnableControl, controlId, bool(enable)); -} +void SAL_CALL KDE5FilePicker2::enableControl(sal_Int16 controlId, sal_Bool enable) {} -void SAL_CALL KDE5FilePicker2::setLabel(sal_Int16 controlId, const OUString& label) -{ -m_ipc.sendCommand(Commands::SetLabel, controlId, label); -} +void SAL_CALL KDE5FilePicker2::setLabel(sal_Int16 controlId, const OUString& label) {} OUString SAL_CALL KDE5FilePicker2::getLabel(sal_Int16 controlId) { -auto id = m_ipc.sendCommand(Commands::GetLabel, controlId); OUString label; -m_ipc.readResponse(id, label); return label;
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - solenv/clang-format vcl/inc vcl/qt5 vcl/unx
Rebased ref, commits from common ancestor: commit 9e2528e19beeed25e41bf069edf6083d36429b22 Author: Katarina Behrens Date: Thu May 31 12:14:55 2018 +0200 Make clang-format happy, remove vcl/unx/kde5 from blacklist just between us girls, I hate you clang-format Change-Id: I4cd041eff7a9fa01eb9192cf357e3f07a26fa6ad diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index 7dcd63136243..79c639c82cb9 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -18501,24 +18501,6 @@ vcl/unx/kde4/VCLKDEApplication.hxx vcl/unx/kde4/main.cxx vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx -vcl/unx/kde5/FPServiceInfo.hxx -vcl/unx/kde5/KDE5Data.cxx -vcl/unx/kde5/KDE5Data.hxx -vcl/unx/kde5/KDE5SalDisplay.cxx -vcl/unx/kde5/KDE5SalDisplay.hxx -vcl/unx/kde5/KDE5SalFrame.cxx -vcl/unx/kde5/KDE5SalFrame.hxx -vcl/unx/kde5/KDE5SalGraphics.cxx -vcl/unx/kde5/KDE5SalGraphics.hxx -vcl/unx/kde5/KDE5SalInstance.cxx -vcl/unx/kde5/KDE5SalInstance.hxx -vcl/unx/kde5/KDE5XLib.cxx -vcl/unx/kde5/KDE5XLib.hxx -vcl/unx/kde5/VCLKDE5Application.cxx -vcl/unx/kde5/VCLKDE5Application.hxx -vcl/unx/kde5/main.cxx -vcl/unx/kde5/tst_exclude_posted_events.hxx -vcl/unx/kde5/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx vcl/win/app/saldata.cxx diff --git a/vcl/inc/qt5/Qt5FilePicker.hxx b/vcl/inc/qt5/Qt5FilePicker.hxx index 1aa19b3459f4..9133c4353295 100644 --- a/vcl/inc/qt5/Qt5FilePicker.hxx +++ b/vcl/inc/qt5/Qt5FilePicker.hxx @@ -43,190 +43,218 @@ class QGridLayout; class QLabel; class QWidget; -typedef ::cppu::WeakComponentImplHelper -< css::ui::dialogs::XFilePicker3 -, css::ui::dialogs::XFilePickerControlAccess -, css::ui::dialogs::XFolderPicker2 -, css::lang::XInitialization -, css::lang::XServiceInfo -> Qt5FilePicker_Base; - -class Qt5FilePicker -: public QObject -, public Qt5FilePicker_Base +typedef ::cppu::WeakComponentImplHelper< +css::ui::dialogs::XFilePicker3, css::ui::dialogs::XFilePickerControlAccess, +css::ui::dialogs::XFolderPicker2, css::lang::XInitialization, css::lang::XServiceInfo> +Qt5FilePicker_Base; + +class Qt5FilePicker : public QObject, public Qt5FilePicker_Base { Q_OBJECT protected: -css::uno::Reference< css::ui::dialogs::XFilePickerListener > m_xListener; +css::uno::Reference m_xListener; -QFileDialog* m_pFileDialog;///< the non-extendable file picker dialog +QFileDialog* m_pFileDialog; ///< the non-extendable file picker dialog -osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper +osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper -QStringList m_aNamedFilterList; ///< named filter list for the QFileDialog -QStringList m_aFilterTitleList; ///< the original filter titles -QString m_aCurrentFilterTitle; ///< the current filter title +QStringList m_aNamedFilterList; ///< named filter list for the QFileDialog +QStringList m_aFilterTitleList; ///< the original filter titles +QString m_aCurrentFilterTitle; ///< the current filter title -QDialog*m_pOptionsDialog;///< an extra options dialog window -QLabel *m_pFilenameLabel;///< label to display the filename -QLabel *m_pFilterLabel; ///< label to display the filter -QHash m_aCustomWidgetsMap; ///< map of SAL control ID's to widget +QDialog* m_pOptionsDialog; ///< an extra options dialog window +QLabel* m_pFilenameLabel; ///< label to display the filename +QLabel* m_pFilterLabel; ///< label to display the filter +QHash m_aCustomWidgetsMap; ///< map of SAL control ID's to widget public: -explicit Qt5FilePicker( QFileDialog::FileMode ); +explicit Qt5FilePicker(QFileDialog::FileMode); virtual ~Qt5FilePicker() override; // XFilePickerNotifier -virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) override; -virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) override; +virtual void SAL_CALL addFilePickerListener( +const css::uno::Reference& xListener) override; +virtual void SAL_CALL removeFilePickerListener( +const css::uno::Reference& xListener) override; // XFilterManager functions -virtual void SAL_CALL appendFilter( const OUString &rTitle, const OUString &rFilter ) override; -virtual void SAL_CALL setCurrentFilter( const OUString &rTitle ) override; +virtual void SAL_CALL appendFilter(const OUString& rTitle, const OUString& rFilter) override; +virtual void SAL_CALL setCurrentFilter(const OUString& rTitle) override; virtual OUString SAL_CALL getCurrentFilter() override; // XFilterGroupManager functions -vi
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' -
Rebased ref, commits from common ancestor: commit be906bddf6c6541a5290a7619ff132148f33d97e Author: Katarina Behrens Date: Thu May 31 12:57:05 2018 +0200 Hullo Jenkins, please build this branch TY Change-Id: Iee67879c72aefa3013eb40dd24d10119c1093e5d ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - solenv/clang-format vcl/inc vcl/qt5 vcl/unx
Rebased ref, commits from common ancestor: commit 26284ef5df7442a6bd66b960c87e117a94c4038b Author: Katarina Behrens Date: Thu May 31 12:57:05 2018 +0200 Hullo Jenkins, please build this branch TY Change-Id: Idfc1c0ca9645068bb4d7dadc8db9381d753516ef commit 3bd7aa9136353f1bef7b6c49584d24cfc9f68b72 Author: Katarina Behrens Date: Thu May 31 12:14:55 2018 +0200 Make clang-format happy, remove vcl/unx/kde5 from blacklist just between us girls, I hate you clang-format Change-Id: I4cd041eff7a9fa01eb9192cf357e3f07a26fa6ad diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index 7dcd63136243..79c639c82cb9 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -18501,24 +18501,6 @@ vcl/unx/kde4/VCLKDEApplication.hxx vcl/unx/kde4/main.cxx vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx -vcl/unx/kde5/FPServiceInfo.hxx -vcl/unx/kde5/KDE5Data.cxx -vcl/unx/kde5/KDE5Data.hxx -vcl/unx/kde5/KDE5SalDisplay.cxx -vcl/unx/kde5/KDE5SalDisplay.hxx -vcl/unx/kde5/KDE5SalFrame.cxx -vcl/unx/kde5/KDE5SalFrame.hxx -vcl/unx/kde5/KDE5SalGraphics.cxx -vcl/unx/kde5/KDE5SalGraphics.hxx -vcl/unx/kde5/KDE5SalInstance.cxx -vcl/unx/kde5/KDE5SalInstance.hxx -vcl/unx/kde5/KDE5XLib.cxx -vcl/unx/kde5/KDE5XLib.hxx -vcl/unx/kde5/VCLKDE5Application.cxx -vcl/unx/kde5/VCLKDE5Application.hxx -vcl/unx/kde5/main.cxx -vcl/unx/kde5/tst_exclude_posted_events.hxx -vcl/unx/kde5/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx vcl/win/app/saldata.cxx diff --git a/vcl/inc/qt5/Qt5FilePicker.hxx b/vcl/inc/qt5/Qt5FilePicker.hxx index 1aa19b3459f4..9133c4353295 100644 --- a/vcl/inc/qt5/Qt5FilePicker.hxx +++ b/vcl/inc/qt5/Qt5FilePicker.hxx @@ -43,190 +43,218 @@ class QGridLayout; class QLabel; class QWidget; -typedef ::cppu::WeakComponentImplHelper -< css::ui::dialogs::XFilePicker3 -, css::ui::dialogs::XFilePickerControlAccess -, css::ui::dialogs::XFolderPicker2 -, css::lang::XInitialization -, css::lang::XServiceInfo -> Qt5FilePicker_Base; - -class Qt5FilePicker -: public QObject -, public Qt5FilePicker_Base +typedef ::cppu::WeakComponentImplHelper< +css::ui::dialogs::XFilePicker3, css::ui::dialogs::XFilePickerControlAccess, +css::ui::dialogs::XFolderPicker2, css::lang::XInitialization, css::lang::XServiceInfo> +Qt5FilePicker_Base; + +class Qt5FilePicker : public QObject, public Qt5FilePicker_Base { Q_OBJECT protected: -css::uno::Reference< css::ui::dialogs::XFilePickerListener > m_xListener; +css::uno::Reference m_xListener; -QFileDialog* m_pFileDialog;///< the non-extendable file picker dialog +QFileDialog* m_pFileDialog; ///< the non-extendable file picker dialog -osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper +osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper -QStringList m_aNamedFilterList; ///< named filter list for the QFileDialog -QStringList m_aFilterTitleList; ///< the original filter titles -QString m_aCurrentFilterTitle; ///< the current filter title +QStringList m_aNamedFilterList; ///< named filter list for the QFileDialog +QStringList m_aFilterTitleList; ///< the original filter titles +QString m_aCurrentFilterTitle; ///< the current filter title -QDialog*m_pOptionsDialog;///< an extra options dialog window -QLabel *m_pFilenameLabel;///< label to display the filename -QLabel *m_pFilterLabel; ///< label to display the filter -QHash m_aCustomWidgetsMap; ///< map of SAL control ID's to widget +QDialog* m_pOptionsDialog; ///< an extra options dialog window +QLabel* m_pFilenameLabel; ///< label to display the filename +QLabel* m_pFilterLabel; ///< label to display the filter +QHash m_aCustomWidgetsMap; ///< map of SAL control ID's to widget public: -explicit Qt5FilePicker( QFileDialog::FileMode ); +explicit Qt5FilePicker(QFileDialog::FileMode); virtual ~Qt5FilePicker() override; // XFilePickerNotifier -virtual void SAL_CALL addFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) override; -virtual void SAL_CALL removeFilePickerListener( const css::uno::Reference< css::ui::dialogs::XFilePickerListener >& xListener ) override; +virtual void SAL_CALL addFilePickerListener( +const css::uno::Reference& xListener) override; +virtual void SAL_CALL removeFilePickerListener( +const css::uno::Reference& xListener) override; // XFilterManager functions -virtual void SAL_CALL appendFilter( const OUString &rTitle, const OUString &rFilter ) override; -virtual void SAL_CALL setCurrentFilter( const OUString &rTitle ) override; +virtual void SAL_CALL appendFilter(const OUString& rTitle
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - solenv/clang-format vcl/inc vcl/qt5 vcl/unx
solenv/clang-format/blacklist | 18 vcl/inc/qt5/Qt5FilePicker.hxx | 186 --- vcl/inc/qt5/Qt5Frame.hxx |2 vcl/inc/qt5/Qt5Instance.hxx | 20 vcl/inc/qt5/Qt5Menu.hxx | 73 +- vcl/inc/qt5/Qt5Tools.hxx |2 vcl/inc/qt5/Qt5Widget.hxx |4 vcl/qt5/Qt5FilePicker.cxx | 558 +++--- vcl/qt5/Qt5Font.cxx |3 vcl/qt5/Qt5Frame.cxx | 15 vcl/qt5/Qt5Graphics_Text.cxx | 22 vcl/qt5/Qt5Instance.cxx | 36 - vcl/qt5/Qt5Menu.cxx | 160 ++ vcl/qt5/Qt5Widget.cxx | 56 -- vcl/unx/kde5/FPServiceInfo.hxx|2 vcl/unx/kde5/KDE5SalData.cxx | 22 vcl/unx/kde5/KDE5SalData.hxx |8 vcl/unx/kde5/KDE5SalDisplay.cxx | 25 - vcl/unx/kde5/KDE5SalDisplay.hxx | 24 vcl/unx/kde5/KDE5SalFrame.cxx | 219 vcl/unx/kde5/KDE5SalFrame.hxx | 30 - vcl/unx/kde5/KDE5SalGraphics.cxx | 642 +- vcl/unx/kde5/KDE5SalGraphics.hxx | 16 vcl/unx/kde5/KDE5SalInstance.cxx | 17 vcl/unx/kde5/KDE5SalInstance.hxx |7 vcl/unx/kde5/VCLKDE5Application.cxx | 12 vcl/unx/kde5/VCLKDE5Application.hxx |9 vcl/unx/kde5/tst_exclude_posted_events.hxx| 36 - vcl/unx/kde5/tst_exclude_socket_notifiers.hxx | 58 +- 29 files changed, 1146 insertions(+), 1136 deletions(-) New commits: commit 1bc048066ae0c169768fbec2286ab356df641ae6 Author: Katarina Behrens Date: Thu May 31 12:34:16 2018 +0200 Hullo Jenkins, please build this branch TY Change-Id: Idfc1c0ca9645068bb4d7dadc8db9381d753516ef commit 34d8744ec3a17e6080f9e7a40d116160db7a41cf Author: Katarina Behrens Date: Thu May 31 12:14:55 2018 +0200 Make clang-format happy, remove vcl/unx/kde5 from blacklist just between us girls, I hate you clang-format Change-Id: I4cd041eff7a9fa01eb9192cf357e3f07a26fa6ad diff --git a/solenv/clang-format/blacklist b/solenv/clang-format/blacklist index 7dcd63136243..79c639c82cb9 100644 --- a/solenv/clang-format/blacklist +++ b/solenv/clang-format/blacklist @@ -18501,24 +18501,6 @@ vcl/unx/kde4/VCLKDEApplication.hxx vcl/unx/kde4/main.cxx vcl/unx/kde4/tst_exclude_posted_events.hxx vcl/unx/kde4/tst_exclude_socket_notifiers.hxx -vcl/unx/kde5/FPServiceInfo.hxx -vcl/unx/kde5/KDE5Data.cxx -vcl/unx/kde5/KDE5Data.hxx -vcl/unx/kde5/KDE5SalDisplay.cxx -vcl/unx/kde5/KDE5SalDisplay.hxx -vcl/unx/kde5/KDE5SalFrame.cxx -vcl/unx/kde5/KDE5SalFrame.hxx -vcl/unx/kde5/KDE5SalGraphics.cxx -vcl/unx/kde5/KDE5SalGraphics.hxx -vcl/unx/kde5/KDE5SalInstance.cxx -vcl/unx/kde5/KDE5SalInstance.hxx -vcl/unx/kde5/KDE5XLib.cxx -vcl/unx/kde5/KDE5XLib.hxx -vcl/unx/kde5/VCLKDE5Application.cxx -vcl/unx/kde5/VCLKDE5Application.hxx -vcl/unx/kde5/main.cxx -vcl/unx/kde5/tst_exclude_posted_events.hxx -vcl/unx/kde5/tst_exclude_socket_notifiers.hxx vcl/unx/x11/x11sys.cxx vcl/unx/x11/xlimits.cxx vcl/win/app/saldata.cxx diff --git a/vcl/inc/qt5/Qt5FilePicker.hxx b/vcl/inc/qt5/Qt5FilePicker.hxx index 1aa19b3459f4..9133c4353295 100644 --- a/vcl/inc/qt5/Qt5FilePicker.hxx +++ b/vcl/inc/qt5/Qt5FilePicker.hxx @@ -43,190 +43,218 @@ class QGridLayout; class QLabel; class QWidget; -typedef ::cppu::WeakComponentImplHelper -< css::ui::dialogs::XFilePicker3 -, css::ui::dialogs::XFilePickerControlAccess -, css::ui::dialogs::XFolderPicker2 -, css::lang::XInitialization -, css::lang::XServiceInfo -> Qt5FilePicker_Base; - -class Qt5FilePicker -: public QObject -, public Qt5FilePicker_Base +typedef ::cppu::WeakComponentImplHelper< +css::ui::dialogs::XFilePicker3, css::ui::dialogs::XFilePickerControlAccess, +css::ui::dialogs::XFolderPicker2, css::lang::XInitialization, css::lang::XServiceInfo> +Qt5FilePicker_Base; + +class Qt5FilePicker : public QObject, public Qt5FilePicker_Base { Q_OBJECT protected: -css::uno::Reference< css::ui::dialogs::XFilePickerListener > m_xListener; +css::uno::Reference m_xListener; -QFileDialog* m_pFileDialog;///< the non-extendable file picker dialog +QFileDialog* m_pFileDialog; ///< the non-extendable file picker dialog -osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper +osl::Mutex m_aHelperMutex; ///< mutex used by the WeakComponentImplHelper -QStringList m_aNamedFilterList; ///< named filter list for the QFileDialog -QStringList m_aFilterTitleList; ///< the original filter titles -QString m_aCurrentFilterTitle; ///< the current filter title +QStringList m_aNamedFilterList; ///< named filter list for the QFileDialog +QStringLis
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/qt5
vcl/qt5/Qt5Menu.cxx | 23 +++ 1 file changed, 23 insertions(+) New commits: commit d81634d3815c2c4e0acdf26811afbe656bc98fb9 Author: Katarina Behrens Date: Tue May 29 09:53:43 2018 +0200 Add radiobuttons to native menus Change-Id: I015bbb0a337b917096ca6f542a73c24c79fbef7d diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 6c219aff7557..e61595af4850 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -87,6 +87,7 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) if ( mbMenuBar && mpQMenuBar ) mpQMenuBar->clear(); +QActionGroup* pQAG = nullptr; for ( sal_Int32 nItem = 0; nItem < static_cast(GetItemCount()); nItem++ ) { @@ -105,8 +106,11 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) else { if( pSalMenuItem->mpSubMenu ) +{ // submenu pQMenu = pQMenu->addMenu( toQString(aText) ); +pQAG = new QActionGroup( pQMenu ); +} else { if ( pSalMenuItem->mnType == MenuItemType::SEPARATOR ) @@ -122,6 +126,16 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) pAction->setCheckable( true ); pAction->setChecked( bChecked ); } +else if (itemBits & MenuItemBits::RADIOCHECK) +{ +pAction->setCheckable(true); +if ( !pQAG ) +{ +pQAG = new QActionGroup( pQMenu ); +pQAG->setExclusive(true); +} +pQAG->addAction( pAction ); +} connect( pAction, &QAction::triggered, this, [this, pSalMenuItem]{ DispatchCommand(pSalMenuItem); } ); commit 1cd7a03876f665289c4e4a6b9f4cb73fc54d987a Author: Katarina Behrens Date: Mon May 28 13:59:43 2018 +0200 Add checkmark buttons to native menus Change-Id: If64227af287006cb4f9b980dac97b2fb401eac88 diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 91de0defccff..6c219aff7557 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -96,6 +96,8 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) QMenu* pQMenu = pParentMenu; NativeItemText( aText ); vcl::KeyCode nAccelKey = pVCLMenu->GetAccelKey( nId ); +bool bChecked = pVCLMenu->IsItemChecked( nId ); +MenuItemBits itemBits = pVCLMenu->GetItemBits( nId ); if (mbMenuBar && mpQMenuBar) // top-level menu @@ -114,6 +116,13 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) // leaf menu QAction *pAction = pQMenu->addAction( toQString(aText) ); pAction->setShortcut( toQString( nAccelKey.GetName(GetFrame()->GetWindow()) ) ); + +if (itemBits & MenuItemBits::CHECKABLE) +{ +pAction->setCheckable( true ); +pAction->setChecked( bChecked ); +} + connect( pAction, &QAction::triggered, this, [this, pSalMenuItem]{ DispatchCommand(pSalMenuItem); } ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Menu.hxx |3 ++- vcl/qt5/Qt5Menu.cxx | 21 ++--- 2 files changed, 20 insertions(+), 4 deletions(-) New commits: commit 08c2927e0587428d2c242ffcdf142d39f23df092 Author: Katarina Behrens Date: Fri May 25 16:04:24 2018 +0200 Dispatch commands from menus for real Change-Id: I01997caa22e14c1350bd83100edb74397ebab5d7 diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx index 408d97e76520..37887045506f 100644 --- a/vcl/inc/qt5/Qt5Menu.hxx +++ b/vcl/inc/qt5/Qt5Menu.hxx @@ -42,6 +42,7 @@ public: virtual voidSetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) override; virtual voidSetFrame( const SalFrame* pFrame ) override; const Qt5Frame* GetFrame() const; +Qt5Menu*GetTopLevel(); virtual voidCheckItem( unsigned nPos, bool bCheck ) override; virtual voidEnableItem( unsigned nPos, bool bEnable ) override; virtual voidShowItem( unsigned nPos, bool bShow ) override; @@ -56,7 +57,7 @@ public: Qt5MenuItem*GetItemAtPos( unsigned nPos ) { return maItems[ nPos ]; } private slots: -void DispatchCommand(); +void DispatchCommand( Qt5MenuItem* pQItem ); }; class Qt5MenuItem : public SalMenuItem diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index f7ebc5617d8c..91de0defccff 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -114,7 +114,8 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) // leaf menu QAction *pAction = pQMenu->addAction( toQString(aText) ); pAction->setShortcut( toQString( nAccelKey.GetName(GetFrame()->GetWindow()) ) ); -connect( pAction, &QAction::triggered, this, &Qt5Menu::DispatchCommand ); +connect( pAction, &QAction::triggered, this, + [this, pSalMenuItem]{ DispatchCommand(pSalMenuItem); } ); } } } @@ -156,6 +157,14 @@ void Qt5Menu::GetSystemMenuData( SystemMenuData* pData ) { } +Qt5Menu* Qt5Menu::GetTopLevel() +{ +Qt5Menu *pMenu = this; +while (pMenu->mpParentSalMenu) +pMenu = pMenu->mpParentSalMenu; +return pMenu; +} + const Qt5Frame* Qt5Menu::GetFrame() const { SolarMutexGuard aGuard; @@ -165,9 +174,15 @@ const Qt5Frame* Qt5Menu::GetFrame() const return pMenu ? pMenu->mpFrame : nullptr; } -void Qt5Menu::DispatchCommand() +void Qt5Menu::DispatchCommand( Qt5MenuItem *pQItem ) { -SAL_WARN("vcl.qt5", "menu triggered"); +if ( pQItem ) +{ +Qt5Menu* pSalMenu = pQItem->mpParentMenu; +Qt5Menu* pTopLevel = pSalMenu->GetTopLevel(); +pTopLevel->GetMenu()->HandleMenuCommandEvent(pSalMenu->GetMenu(), pQItem->mnId); +SAL_WARN("vcl.qt5", "menu triggered " << pQItem->mnId ); +} } void Qt5Menu::NativeItemText( OUString& rItemText ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/CustomTarget_qt5_moc.mk vcl/inc vcl/qt5
vcl/CustomTarget_qt5_moc.mk |1 + vcl/inc/qt5/Qt5Menu.hxx |6 +- vcl/qt5/Qt5Menu.cxx |8 +++- 3 files changed, 13 insertions(+), 2 deletions(-) New commits: commit ff4d75891fb947989d16df58a6b2805f20102fc6 Author: Katarina Behrens Date: Thu May 24 15:04:02 2018 +0200 Basic structure of a slot to dispatch commands from menu Change-Id: If3a134f67f59d3238c27eb0fef99bf49a8970433 diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk index aabe77d9a9c5..3962a730d388 100644 --- a/vcl/CustomTarget_qt5_moc.mk +++ b/vcl/CustomTarget_qt5_moc.mk @@ -12,6 +12,7 @@ $(eval $(call gb_CustomTarget_CustomTarget,vcl/qt5)) $(call gb_CustomTarget_get_target,vcl/qt5) : \ $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5FilePicker.moc \ $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Instance.moc \ + $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Menu.moc \ $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Timer.moc \ $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Widget.moc \ diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx index 38dcc3688b1f..408d97e76520 100644 --- a/vcl/inc/qt5/Qt5Menu.hxx +++ b/vcl/inc/qt5/Qt5Menu.hxx @@ -17,8 +17,9 @@ class QMenuBar; class Qt5MenuItem; class Qt5Frame; -class Qt5Menu : public SalMenu +class Qt5Menu : public QObject, public SalMenu { +Q_OBJECT private: std::vector< Qt5MenuItem* > maItems; VclPtr mpVCLMenu; @@ -53,6 +54,9 @@ public: Menu* GetMenu() { return mpVCLMenu; } unsignedGetItemCount() { return maItems.size(); } Qt5MenuItem*GetItemAtPos( unsigned nPos ) { return maItems[ nPos ]; } + +private slots: +void DispatchCommand(); }; class Qt5MenuItem : public SalMenuItem diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index fd864e8b2422..f7ebc5617d8c 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -9,6 +9,7 @@ #include "Qt5Frame.hxx" #include "Qt5Menu.hxx" +#include #include @@ -62,7 +63,6 @@ void Qt5Menu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned pQSubMenu->mpParentSalMenu = this; pItem->mpSubMenu = pQSubMenu; - } void Qt5Menu::SetFrame( const SalFrame* pFrame ) @@ -114,6 +114,7 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) // leaf menu QAction *pAction = pQMenu->addAction( toQString(aText) ); pAction->setShortcut( toQString( nAccelKey.GetName(GetFrame()->GetWindow()) ) ); +connect( pAction, &QAction::triggered, this, &Qt5Menu::DispatchCommand ); } } } @@ -164,6 +165,11 @@ const Qt5Frame* Qt5Menu::GetFrame() const return pMenu ? pMenu->mpFrame : nullptr; } +void Qt5Menu::DispatchCommand() +{ +SAL_WARN("vcl.qt5", "menu triggered"); +} + void Qt5Menu::NativeItemText( OUString& rItemText ) { rItemText = rItemText.replace( '~', '&' ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/qt5
vcl/qt5/Qt5Menu.cxx | 23 +-- 1 file changed, 21 insertions(+), 2 deletions(-) New commits: commit 46391493f6c28c86aa5c100fc0f490e74b083cd5 Author: Katarina Behrens Date: Wed May 23 17:39:44 2018 +0200 Add shortcuts to native menu entries something's wrong though, they don't really show Change-Id: Id8559fd9b6a5d4b2b49442d179571d31a99b5b20 diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 0575d5aab693..fd864e8b2422 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -95,6 +95,7 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) OUString aText = pVCLMenu->GetItemText( nId ); QMenu* pQMenu = pParentMenu; NativeItemText( aText ); +vcl::KeyCode nAccelKey = pVCLMenu->GetAccelKey( nId ); if (mbMenuBar && mpQMenuBar) // top-level menu @@ -109,8 +110,11 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) if ( pSalMenuItem->mnType == MenuItemType::SEPARATOR ) pQMenu->addSeparator(); else +{ // leaf menu -pQMenu->addAction( toQString(aText) ); +QAction *pAction = pQMenu->addAction( toQString(aText) ); +pAction->setShortcut( toQString( nAccelKey.GetName(GetFrame()->GetWindow()) ) ); +} } } @@ -151,6 +155,15 @@ void Qt5Menu::GetSystemMenuData( SystemMenuData* pData ) { } +const Qt5Frame* Qt5Menu::GetFrame() const +{ +SolarMutexGuard aGuard; +const Qt5Menu* pMenu = this; +while( pMenu && ! pMenu->mpFrame ) +pMenu = pMenu->mpParentSalMenu; +return pMenu ? pMenu->mpFrame : nullptr; +} + void Qt5Menu::NativeItemText( OUString& rItemText ) { rItemText = rItemText.replace( '~', '&' ); commit 130e23a672383d220ebf2a8cf8715d6ecf52fe58 Author: Katarina Behrens Date: Wed May 23 11:23:34 2018 +0200 Insert separators into native menu Change-Id: I88bb70b1e443821cc8d1904039f2a8fb52df1ff9 diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 65bf726252df..0575d5aab693 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -105,8 +105,13 @@ void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) // submenu pQMenu = pQMenu->addMenu( toQString(aText) ); else -// leaf menu -pQMenu->addAction( toQString(aText) ); +{ +if ( pSalMenuItem->mnType == MenuItemType::SEPARATOR ) +pQMenu->addSeparator(); +else +// leaf menu +pQMenu->addAction( toQString(aText) ); +} } if ( pSalMenuItem->mpSubMenu != nullptr ) @@ -153,6 +158,7 @@ void Qt5Menu::NativeItemText( OUString& rItemText ) Qt5MenuItem::Qt5MenuItem( const SalItemParams* pItemData ) : mnId( pItemData->nId ), +mnType( pItemData->eType ), mpVCLMenu( pItemData->pMenu ), mpParentMenu( nullptr ), mpSubMenu( nullptr ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Menu.hxx |6 + vcl/qt5/Qt5Menu.cxx | 50 2 files changed, 32 insertions(+), 24 deletions(-) New commits: commit 718982237e15948e4e3d45d63b8a25de049af271 Author: Katarina Behrens Date: Wed May 23 10:51:30 2018 +0200 Native leaf menus and submenus are now visible Change-Id: Ieaac0966b167d82c8bdeb60f3ce4b9cc8589ec62 diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx index aa3948ce6d2d..38dcc3688b1f 100644 --- a/vcl/inc/qt5/Qt5Menu.hxx +++ b/vcl/inc/qt5/Qt5Menu.hxx @@ -12,6 +12,7 @@ #include class MenuItemList; +class QMenu; class QMenuBar; class Qt5MenuItem; class Qt5Frame; @@ -24,12 +25,9 @@ private: Qt5Menu* mpParentSalMenu; Qt5Frame*mpFrame; bool mbMenuBar; - QMenuBar*mpQMenuBar; -void ActivateAllSubMenus( Menu* pMenuBar ); -void Update(); - +void DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu = nullptr ); void NativeItemText( OUString &rItemText ); public: diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 586130925356..65bf726252df 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -53,6 +53,16 @@ void Qt5Menu::RemoveItem( unsigned nPos ) void Qt5Menu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) { +SolarMutexGuard aGuard; +Qt5MenuItem *pItem = static_cast< Qt5MenuItem* >( pSalMenuItem ); +Qt5Menu *pQSubMenu = static_cast< Qt5Menu* >( pSubMenu ); + +if ( pQSubMenu == nullptr ) +return; + +pQSubMenu->mpParentSalMenu = this; +pItem->mpSubMenu = pQSubMenu; + } void Qt5Menu::SetFrame( const SalFrame* pFrame ) @@ -68,26 +78,10 @@ void Qt5Menu::SetFrame( const SalFrame* pFrame ) if( pMainWindow ) mpQMenuBar = pMainWindow->menuBar(); -ActivateAllSubMenus( mpVCLMenu ); - -Update(); +DoFullMenuUpdate( mpVCLMenu ); } -void Qt5Menu::ActivateAllSubMenus( Menu* pMenuBar ) -{ -for (Qt5MenuItem* pSalItem : maItems) -{ -if ( pSalItem->mpSubMenu != nullptr ) -{ -pMenuBar->HandleMenuActivateEvent(pSalItem->mpSubMenu->GetMenu()); -pSalItem->mpSubMenu->ActivateAllSubMenus(pMenuBar); -pSalItem->mpSubMenu->Update(); - pMenuBar->HandleMenuDeActivateEvent(pSalItem->mpSubMenu->GetMenu()); -} -} -} - -void Qt5Menu::Update() +void Qt5Menu::DoFullMenuUpdate( Menu* pMenuBar, QMenu* pParentMenu ) { Menu* pVCLMenu = mpVCLMenu; @@ -99,11 +93,27 @@ void Qt5Menu::Update() Qt5MenuItem *pSalMenuItem = GetItemAtPos( nItem ); sal_uInt16 nId = pSalMenuItem->mnId; OUString aText = pVCLMenu->GetItemText( nId ); +QMenu* pQMenu = pParentMenu; +NativeItemText( aText ); if (mbMenuBar && mpQMenuBar) +// top-level menu +pQMenu = mpQMenuBar->addMenu( toQString(aText) ); +else +{ +if( pSalMenuItem->mpSubMenu ) +// submenu +pQMenu = pQMenu->addMenu( toQString(aText) ); +else +// leaf menu +pQMenu->addAction( toQString(aText) ); +} + +if ( pSalMenuItem->mpSubMenu != nullptr ) { - NativeItemText( aText ); - mpQMenuBar->addMenu( toQString(aText) ); + pMenuBar->HandleMenuActivateEvent(pSalMenuItem->mpSubMenu->GetMenu()); +pSalMenuItem->mpSubMenu->DoFullMenuUpdate( pMenuBar, pQMenu ); + pMenuBar->HandleMenuDeActivateEvent(pSalMenuItem->mpSubMenu->GetMenu()); } } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Menu.hxx |2 ++ vcl/qt5/Qt5Menu.cxx |8 2 files changed, 10 insertions(+) New commits: commit a8780a356ac1ce0d45a6114b2a631fdf93ba2502 Author: Katarina Behrens Date: Thu May 17 16:48:53 2018 +0200 Clear menubar before opening a new app Change-Id: Icab19e31f7aa737351460790d2028114b24284ad diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index e70e2d1896a9..586130925356 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -91,6 +91,9 @@ void Qt5Menu::Update() { Menu* pVCLMenu = mpVCLMenu; +if ( mbMenuBar && mpQMenuBar ) +mpQMenuBar->clear(); + for ( sal_Int32 nItem = 0; nItem < static_cast(GetItemCount()); nItem++ ) { Qt5MenuItem *pSalMenuItem = GetItemAtPos( nItem ); commit d66f970aace835e921d8ac62ed7837255eea0396 Author: Katarina Behrens Date: Thu May 17 15:09:48 2018 +0200 Replace ~ with & (Qt accelerator marker) in menu entries Change-Id: Ie7866357d4e74b778849262c1c2b60605a26faad diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx index 1d1048881fbc..aa3948ce6d2d 100644 --- a/vcl/inc/qt5/Qt5Menu.hxx +++ b/vcl/inc/qt5/Qt5Menu.hxx @@ -30,6 +30,8 @@ private: void ActivateAllSubMenus( Menu* pMenuBar ); void Update(); +void NativeItemText( OUString &rItemText ); + public: Qt5Menu( bool bMenuBar ); virtual ~Qt5Menu() override; diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index b82b525462c0..e70e2d1896a9 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -99,6 +99,7 @@ void Qt5Menu::Update() if (mbMenuBar && mpQMenuBar) { + NativeItemText( aText ); mpQMenuBar->addMenu( toQString(aText) ); } } @@ -132,6 +133,10 @@ void Qt5Menu::GetSystemMenuData( SystemMenuData* pData ) { } +void Qt5Menu::NativeItemText( OUString& rItemText ) +{ +rItemText = rItemText.replace( '~', '&' ); +} Qt5MenuItem::Qt5MenuItem( const SalItemParams* pItemData ) : mnId( pItemData->nId ), ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Tools.hxx |6 ++ vcl/qt5/Qt5Graphics_GDI.cxx |2 +- vcl/qt5/Qt5Graphics_Text.cxx |2 +- vcl/qt5/Qt5Painter.cxx |4 ++-- 4 files changed, 10 insertions(+), 4 deletions(-) New commits: commit 14b000986d1bc98bb3ecb7ada5b10f33ee7bdefe Author: Katarina Behrens Date: Thu May 17 12:55:55 2018 +0200 Unify Color -> QColor conversion this also resolves build failures on 32bit platforms Change-Id: I53fa2faae52a8cb322644c5bd5e5e84d71110d8e diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx index d632a5ed8ce5..06c02572473c 100644 --- a/vcl/inc/qt5/Qt5Tools.hxx +++ b/vcl/inc/qt5/Qt5Tools.hxx @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -55,6 +56,11 @@ inline QSize toQSize(const Size& rSize) { return QSize(rSize.Width(), rSize.Heig inline Size toSize(const QSize& rSize) { return Size(rSize.width(), rSize.height()); } +inline QColor toQColor(const Color& rColor) +{ +return QColor( rColor.GetRed(), rColor.GetGreen(), rColor.GetBlue(), rColor.GetTransparency() ); +} + static constexpr QImage::Format Qt5_DefaultFormat32 = QImage::Format_ARGB32; inline QImage::Format getBitFormat(sal_uInt16 nBitCount) diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx index fe1b98112b33..8c1445970f62 100644 --- a/vcl/qt5/Qt5Graphics_GDI.cxx +++ b/vcl/qt5/Qt5Graphics_GDI.cxx @@ -172,7 +172,7 @@ void Qt5Graphics::drawPixel(long nX, long nY) void Qt5Graphics::drawPixel(long nX, long nY, SalColor nSalColor) { Qt5Painter aPainter(*this); -aPainter.setPen(QColor(QRgb(nSalColor))); +aPainter.setPen(toQColor(nSalColor)); aPainter.setPen(Qt::SolidLine); aPainter.drawPoint(nX, nY); aPainter.update(nX, nY, 1, 1); diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx index b31975e6f527..a7d005d426cd 100644 --- a/vcl/qt5/Qt5Graphics_Text.cxx +++ b/vcl/qt5/Qt5Graphics_Text.cxx @@ -185,7 +185,7 @@ void Qt5Graphics::DrawTextLayout(const CommonSalLayout &rLayout ) aGlyphRun.setRawFont( aRawFont ); Qt5Painter aPainter(*this); -QColor aColor = QColor::fromRgb(QRgb(m_aTextColor)); +QColor aColor = toQColor(m_aTextColor); aPainter.setPen(aColor); aPainter.drawGlyphRun( QPointF(), aGlyphRun ); } diff --git a/vcl/qt5/Qt5Painter.cxx b/vcl/qt5/Qt5Painter.cxx index 5bf0db22b3f0..88e9b10b1885 100644 --- a/vcl/qt5/Qt5Painter.cxx +++ b/vcl/qt5/Qt5Painter.cxx @@ -37,7 +37,7 @@ Qt5Painter::Qt5Painter(Qt5Graphics& rGraphics, bool bPrepareBrush, sal_uInt8 nTr setClipRegion(rGraphics.m_aClipRegion); if (SALCOLOR_NONE != rGraphics.m_aLineColor) { -QColor aColor = QColor::fromRgb(QRgb(rGraphics.m_aLineColor)); +QColor aColor = toQColor(rGraphics.m_aLineColor); aColor.setAlpha(nTransparency); setPen(aColor); } @@ -45,7 +45,7 @@ Qt5Painter::Qt5Painter(Qt5Graphics& rGraphics, bool bPrepareBrush, sal_uInt8 nTr setPen(Qt::NoPen); if (bPrepareBrush && SALCOLOR_NONE != rGraphics.m_aFillColor) { -QColor aColor = QColor::fromRgb(QRgb(rGraphics.m_aFillColor)); +QColor aColor = toQColor(rGraphics.m_aFillColor); aColor.setAlpha(nTransparency); setBrush(Qt::SolidPattern); setBrush(aColor); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Menu.hxx |1 + vcl/qt5/Qt5Menu.cxx | 19 +++ vcl/qt5/Qt5Widget.cxx |1 - 3 files changed, 20 insertions(+), 1 deletion(-) New commits: commit f93a07b5215f68f7c54a7012c2c4c2e2de0c2012 Author: Katarina Behrens Date: Wed May 16 11:37:09 2018 +0200 Top-level native menubar items are now visible Change-Id: I6746b4a41a99c75234e64ab48ce81ea97333da04 diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx index 1c0f03b3342c..1d1048881fbc 100644 --- a/vcl/inc/qt5/Qt5Menu.hxx +++ b/vcl/inc/qt5/Qt5Menu.hxx @@ -28,6 +28,7 @@ private: QMenuBar*mpQMenuBar; void ActivateAllSubMenus( Menu* pMenuBar ); +void Update(); public: Qt5Menu( bool bMenuBar ); diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 4869a78b8a05..b82b525462c0 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -69,6 +69,8 @@ void Qt5Menu::SetFrame( const SalFrame* pFrame ) mpQMenuBar = pMainWindow->menuBar(); ActivateAllSubMenus( mpVCLMenu ); + +Update(); } void Qt5Menu::ActivateAllSubMenus( Menu* pMenuBar ) @@ -85,6 +87,23 @@ void Qt5Menu::ActivateAllSubMenus( Menu* pMenuBar ) } } +void Qt5Menu::Update() +{ +Menu* pVCLMenu = mpVCLMenu; + +for ( sal_Int32 nItem = 0; nItem < static_cast(GetItemCount()); nItem++ ) +{ +Qt5MenuItem *pSalMenuItem = GetItemAtPos( nItem ); +sal_uInt16 nId = pSalMenuItem->mnId; +OUString aText = pVCLMenu->GetItemText( nId ); + +if (mbMenuBar && mpQMenuBar) +{ + mpQMenuBar->addMenu( toQString(aText) ); +} +} +} + void Qt5Menu::ShowItem( unsigned nPos, bool bCheck ) { } diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 8d910434b600..5331d32000a8 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -464,7 +464,6 @@ private: : QMainWindow(Q_NULLPTR, f), maMixin(&rFrame) { Init(); -ParentClassT::menuBar()->addMenu("ExperimentMenu"); } void Init() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Frame.hxx |3 +++ vcl/inc/qt5/Qt5Menu.hxx |5 + vcl/qt5/Qt5Frame.cxx |6 +- vcl/qt5/Qt5Menu.cxx | 28 +++- 4 files changed, 40 insertions(+), 2 deletions(-) New commits: commit 8521eb0cbeed45a7c366b252968b8f9935afbda3 Author: Katarina Behrens Date: Tue May 15 16:29:15 2018 +0200 Expose menu bar of the main window and some addional work on activating menus Change-Id: I0c4d87dc158f3253aa97d151385fce14551c11b9 diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx index 8772ee7bbfcc..1f881d706881 100644 --- a/vcl/inc/qt5/Qt5Frame.hxx +++ b/vcl/inc/qt5/Qt5Frame.hxx @@ -28,6 +28,7 @@ class Qt5Graphics; class Qt5Instance; +class Qt5Menu; class QWidget; class QPaintDevice; class QImage; @@ -55,6 +56,8 @@ class VCLPLUG_QT5_PUBLIC Qt5Frame : public SalFrame Qt5Frame* m_pParent; PointerStyle m_ePointerStyle; +Qt5Menu* m_pSalMenu; + bool m_bDefaultSize; bool m_bDefaultPos; diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx index cf7a715f5911..1c0f03b3342c 100644 --- a/vcl/inc/qt5/Qt5Menu.hxx +++ b/vcl/inc/qt5/Qt5Menu.hxx @@ -12,6 +12,7 @@ #include class MenuItemList; +class QMenuBar; class Qt5MenuItem; class Qt5Frame; @@ -24,6 +25,10 @@ private: Qt5Frame*mpFrame; bool mbMenuBar; +QMenuBar*mpQMenuBar; + +void ActivateAllSubMenus( Menu* pMenuBar ); + public: Qt5Menu( bool bMenuBar ); virtual ~Qt5Menu() override; diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index ec210c15ade0..4a36bee27776 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -24,6 +24,7 @@ #include "Qt5Graphics.hxx" #include "Qt5Widget.hxx" #include "Qt5Data.hxx" +#include #include #include @@ -233,7 +234,10 @@ void Qt5Frame::SetIcon(sal_uInt16 nIcon) m_pQWidget->window()->setWindowIcon(aIcon); } -void Qt5Frame::SetMenu(SalMenu* /*pMenu*/) {} +void Qt5Frame::SetMenu(SalMenu* pMenu) +{ +m_pSalMenu = static_cast( pMenu ); +} void Qt5Frame::DrawMenuBar() {} diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 5a3753b6433a..4869a78b8a05 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -10,6 +10,8 @@ #include "Qt5Frame.hxx" #include "Qt5Menu.hxx" +#include + #include Qt5Menu::Qt5Menu( bool bMenuBar ) : @@ -55,8 +57,32 @@ void Qt5Menu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned void Qt5Menu::SetFrame( const SalFrame* pFrame ) { - +SolarMutexGuard aGuard; +assert(mbMenuBar); mpFrame = const_cast( static_cast( pFrame ) ); + +mpFrame->SetMenu( this ); + +QWidget* pWidget = mpFrame->GetQWidget(); +QMainWindow* pMainWindow = dynamic_cast(pWidget); +if( pMainWindow ) +mpQMenuBar = pMainWindow->menuBar(); + +ActivateAllSubMenus( mpVCLMenu ); +} + +void Qt5Menu::ActivateAllSubMenus( Menu* pMenuBar ) +{ +for (Qt5MenuItem* pSalItem : maItems) +{ +if ( pSalItem->mpSubMenu != nullptr ) +{ +pMenuBar->HandleMenuActivateEvent(pSalItem->mpSubMenu->GetMenu()); +pSalItem->mpSubMenu->ActivateAllSubMenus(pMenuBar); +pSalItem->mpSubMenu->Update(); + pMenuBar->HandleMenuDeActivateEvent(pSalItem->mpSubMenu->GetMenu()); +} +} } void Qt5Menu::ShowItem( unsigned nPos, bool bCheck ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
Rebased ref, commits from common ancestor: commit 625696ad3cb8b3d406676de1364830b72a530cfd Author: Katarina Behrens Date: Mon May 14 15:39:30 2018 +0200 Templatize Qt5Widget class to distinguish between QMainWindow (top-level SalFrame) and QWidget (everything else). The former are going to receive a native menu Change-Id: I9023d1e464345f96f13967f5e2c8b0716890fbc9 diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx index 4b0a99113536..8772ee7bbfcc 100644 --- a/vcl/inc/qt5/Qt5Frame.hxx +++ b/vcl/inc/qt5/Qt5Frame.hxx @@ -28,7 +28,6 @@ class Qt5Graphics; class Qt5Instance; -class Qt5Widget; class QWidget; class QPaintDevice; class QImage; @@ -36,7 +35,7 @@ class SvpSalGraphics; class VCLPLUG_QT5_PUBLIC Qt5Frame : public SalFrame { -friend class Qt5Widget; +friend class VclQtMixinBase; std::unique_ptr m_pQWidget; diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx index 7e7ed8240802..c95bc94c1f0c 100644 --- a/vcl/inc/qt5/Qt5Widget.hxx +++ b/vcl/inc/qt5/Qt5Widget.hxx @@ -21,43 +21,8 @@ #include -class Qt5Frame; -class Qt5Object; -class QFocusEvent; -class QKeyEvent; -class QMouseEvent; -class QMoveEvent; -class QPaintEvent; -class QResizeEvent; -class QShowEvent; -class QWheelEvent; +#include "Qt5Frame.hxx" -class Qt5Widget : public QWidget -{ -Q_OBJECT - -Qt5Frame* m_pFrame; - -bool handleKeyEvent(QKeyEvent*, bool); -void handleMouseButtonEvent(QMouseEvent*, bool); - -virtual void focusInEvent(QFocusEvent*) override; -virtual void focusOutEvent(QFocusEvent*) override; -virtual void keyPressEvent(QKeyEvent*) override; -virtual void keyReleaseEvent(QKeyEvent*) override; -virtual void mouseMoveEvent(QMouseEvent*) override; -virtual void mousePressEvent(QMouseEvent*) override; -virtual void mouseReleaseEvent(QMouseEvent*) override; -virtual void moveEvent(QMoveEvent*) override; -virtual void paintEvent(QPaintEvent*) override; -virtual void resizeEvent(QResizeEvent*) override; -virtual void showEvent(QShowEvent*) override; -virtual void wheelEvent(QWheelEvent*) override; -virtual void closeEvent(QCloseEvent*) override; - -public: -Qt5Widget(Qt5Frame& rFrame, QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); -virtual ~Qt5Widget() override; -}; +QWidget* createQt5Widget(Qt5Frame &rFrame, QWidget* parent, Qt::WindowFlags f); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5FilePicker.cxx b/vcl/qt5/Qt5FilePicker.cxx index cb599b6822a7..7dee36de35d3 100644 --- a/vcl/qt5/Qt5FilePicker.cxx +++ b/vcl/qt5/Qt5FilePicker.cxx @@ -193,7 +193,7 @@ sal_Int16 SAL_CALL Qt5FilePicker::execute() vcl::Window *pWindow = ::Application::GetActiveTopWindow(); assert( pWindow ); -Qt5Widget *pTransientParent = nullptr; +QWidget *pTransientParent = nullptr; QWindow *pTransientWindow = nullptr; if( pWindow ) { @@ -201,7 +201,7 @@ sal_Int16 SAL_CALL Qt5FilePicker::execute() assert( pFrame ); if( pFrame ) { -pTransientParent = static_cast( pFrame->GetQWidget() ); +pTransientParent = pFrame->GetQWidget(); pTransientWindow = pTransientParent->window()->windowHandle(); } } diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 2af95ee039dd..ec210c15ade0 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -90,7 +90,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo) aWinFlags |= Qt::Window; } -m_pQWidget.reset(new Qt5Widget(*this, pParent ? pParent->GetQWidget() : nullptr, aWinFlags)); +m_pQWidget.reset(createQt5Widget(*this, pParent ? pParent->GetQWidget() : nullptr, aWinFlags)); if (pParent && !(pParent->m_nStyle & SalFrameStyleFlags::PLUG)) { diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index bb3ca8aaa44b..8d910434b600 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -32,43 +32,61 @@ #include #include #include +#include +#include #include #include -Qt5Widget::Qt5Widget(Qt5Frame& rFrame, QWidget* parent, Qt::WindowFlags f) -: QWidget(parent, f) -, m_pFrame(&rFrame) +class VclQtMixinBase { -create(); -setMouseTracking(true); -setFocusPolicy(Qt::StrongFocus); -} - -Qt5Widget::~Qt5Widget() {} - -void Qt5Widget::paintEvent(QPaintEvent* pEvent) +public: +VclQtMixinBase( Qt5Frame *pFrame) { m_pFrame = pFrame; } + +void mixinFocusInEvent(QFocusEvent*); +void mixinFocusOutEvent(QFocusEvent*); +void mixinKeyPressEvent(QKeyEvent*); +void mixinKeyReleaseEvent(QKeyEvent*); +void mixinMouseMoveEvent(QMouseEvent*); +void mixinMousePressEvent(QMouseEvent*); +void mixinMouseReleaseEvent(QMouseEvent*); +void mixinMoveEvent(QMoveEvent*); +void mixinPaintEvent(QPaintEvent*, QWidget* widget); +void mixinResizeEvent(QResizeEvent*, QS
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Frame.hxx |3 vcl/inc/qt5/Qt5Widget.hxx | 40 vcl/qt5/Qt5FilePicker.cxx |4 vcl/qt5/Qt5Frame.cxx |2 vcl/qt5/Qt5Widget.cxx | 209 ++ 5 files changed, 180 insertions(+), 78 deletions(-) New commits: commit 60945431deaaf853ebcbbc8121c194c13a087f66 Author: Katarina Behrens Date: Mon May 14 15:39:30 2018 +0200 Templatize Qt5Widget class to distinguish between QMainWindow (top-level SalFrame) and QWidget (everything else). The former are going to receive a native menu Change-Id: I9023d1e464345f96f13967f5e2c8b0716890fbc9 diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx index 4b0a99113536..8772ee7bbfcc 100644 --- a/vcl/inc/qt5/Qt5Frame.hxx +++ b/vcl/inc/qt5/Qt5Frame.hxx @@ -28,7 +28,6 @@ class Qt5Graphics; class Qt5Instance; -class Qt5Widget; class QWidget; class QPaintDevice; class QImage; @@ -36,7 +35,7 @@ class SvpSalGraphics; class VCLPLUG_QT5_PUBLIC Qt5Frame : public SalFrame { -friend class Qt5Widget; +friend class VclQtMixinBase; std::unique_ptr m_pQWidget; diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx index 7e7ed8240802..376ccf58ac18 100644 --- a/vcl/inc/qt5/Qt5Widget.hxx +++ b/vcl/inc/qt5/Qt5Widget.hxx @@ -20,44 +20,10 @@ #pragma once #include +#include -class Qt5Frame; -class Qt5Object; -class QFocusEvent; -class QKeyEvent; -class QMouseEvent; -class QMoveEvent; -class QPaintEvent; -class QResizeEvent; -class QShowEvent; -class QWheelEvent; +#include "Qt5Frame.hxx" -class Qt5Widget : public QWidget -{ -Q_OBJECT - -Qt5Frame* m_pFrame; - -bool handleKeyEvent(QKeyEvent*, bool); -void handleMouseButtonEvent(QMouseEvent*, bool); - -virtual void focusInEvent(QFocusEvent*) override; -virtual void focusOutEvent(QFocusEvent*) override; -virtual void keyPressEvent(QKeyEvent*) override; -virtual void keyReleaseEvent(QKeyEvent*) override; -virtual void mouseMoveEvent(QMouseEvent*) override; -virtual void mousePressEvent(QMouseEvent*) override; -virtual void mouseReleaseEvent(QMouseEvent*) override; -virtual void moveEvent(QMoveEvent*) override; -virtual void paintEvent(QPaintEvent*) override; -virtual void resizeEvent(QResizeEvent*) override; -virtual void showEvent(QShowEvent*) override; -virtual void wheelEvent(QWheelEvent*) override; -virtual void closeEvent(QCloseEvent*) override; - -public: -Qt5Widget(Qt5Frame& rFrame, QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); -virtual ~Qt5Widget() override; -}; +QWidget* createQt5Widget(Qt5Frame &rFrame, QWidget* parent, Qt::WindowFlags f); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5FilePicker.cxx b/vcl/qt5/Qt5FilePicker.cxx index cb599b6822a7..7dee36de35d3 100644 --- a/vcl/qt5/Qt5FilePicker.cxx +++ b/vcl/qt5/Qt5FilePicker.cxx @@ -193,7 +193,7 @@ sal_Int16 SAL_CALL Qt5FilePicker::execute() vcl::Window *pWindow = ::Application::GetActiveTopWindow(); assert( pWindow ); -Qt5Widget *pTransientParent = nullptr; +QWidget *pTransientParent = nullptr; QWindow *pTransientWindow = nullptr; if( pWindow ) { @@ -201,7 +201,7 @@ sal_Int16 SAL_CALL Qt5FilePicker::execute() assert( pFrame ); if( pFrame ) { -pTransientParent = static_cast( pFrame->GetQWidget() ); +pTransientParent = pFrame->GetQWidget(); pTransientWindow = pTransientParent->window()->windowHandle(); } } diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 2af95ee039dd..ec210c15ade0 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -90,7 +90,7 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo) aWinFlags |= Qt::Window; } -m_pQWidget.reset(new Qt5Widget(*this, pParent ? pParent->GetQWidget() : nullptr, aWinFlags)); +m_pQWidget.reset(createQt5Widget(*this, pParent ? pParent->GetQWidget() : nullptr, aWinFlags)); if (pParent && !(pParent->m_nStyle & SalFrameStyleFlags::PLUG)) { diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index bb3ca8aaa44b..3359be6d0055 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -27,48 +27,66 @@ #include #include #include +#include #include #include #include #include #include +#include #include #include -Qt5Widget::Qt5Widget(Qt5Frame& rFrame, QWidget* parent, Qt::WindowFlags f) -: QWidget(parent, f) -, m_pFrame(&rFrame) +class VclQtMixinBase { -create(); -setMouseTracking(true); -setFocusPolicy(Qt::StrongFocus); -} - -Qt5Widget::~Qt5Widget() {} - -void Qt5Widget::paintEvent(QPaintEvent* pEvent) +public: +VclQtMixinBase( Qt5Frame *pFrame) { m_pFrame = pFrame; } + +void mixinFocusInEvent(QFocusEvent*); +void mixinFocusOutEvent(QFocusEvent*); +void mixinKeyPressEvent(QKe
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/qt5
vcl/qt5/Qt5Menu.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit ef5e0f518a561cc30b72719c561e9f18f8fe2009 Author: Katarina Behrens Date: Wed May 9 14:34:24 2018 +0200 Basic ops (add, remove) with native menu items nothing's visible yet Change-Id: Iee9d31ecdb931e64016f8430b51b619a39528726 diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index 2471f779c463..5a3753b6433a 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -10,6 +10,8 @@ #include "Qt5Frame.hxx" #include "Qt5Menu.hxx" +#include + Qt5Menu::Qt5Menu( bool bMenuBar ) : mpVCLMenu( nullptr ), mpParentSalMenu( nullptr ), @@ -20,6 +22,7 @@ Qt5Menu::Qt5Menu( bool bMenuBar ) : Qt5Menu::~Qt5Menu() { +maItems.clear(); } bool Qt5Menu::VisibleMenuBar() @@ -29,10 +32,21 @@ bool Qt5Menu::VisibleMenuBar() void Qt5Menu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) { +SolarMutexGuard aGuard; +Qt5MenuItem *pItem = static_cast( pSalMenuItem ); + +if ( nPos == MENU_APPEND ) +maItems.push_back( pItem ); +else +maItems.insert( maItems.begin() + nPos, pItem ); + +pItem->mpParentMenu = this; } void Qt5Menu::RemoveItem( unsigned nPos ) { +SolarMutexGuard aGuard; +maItems.erase( maItems.begin() + nPos ); } void Qt5Menu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/inc vcl/Library_vclplug_qt5.mk vcl/qt5
vcl/Library_vclplug_qt5.mk |1 vcl/inc/qt5/Qt5Instance.hxx |5 ++ vcl/inc/qt5/Qt5Menu.hxx | 66 vcl/qt5/Qt5Instance.cxx | 23 +++ vcl/qt5/Qt5Menu.cxx | 89 5 files changed, 184 insertions(+) New commits: commit 3e386ed3652133a9835bb0243dd94e02ecc83005 Author: Katarina Behrens Date: Tue May 8 18:35:44 2018 +0200 Prep Qt5Instance for native menus Change-Id: I7ec34b13823b943ef5e99b92d919c2df795d6ace diff --git a/vcl/inc/qt5/Qt5Instance.hxx b/vcl/inc/qt5/Qt5Instance.hxx index 19d3bfc2d9f8..da27b187789e 100644 --- a/vcl/inc/qt5/Qt5Instance.hxx +++ b/vcl/inc/qt5/Qt5Instance.hxx @@ -79,6 +79,11 @@ public: virtual OUString GetDefaultPrinter() override; virtual void PostPrintersChanged() override; +virtual SalMenu*CreateMenu( bool, Menu* ) override; +virtual voidDestroyMenu( SalMenu* pMenu ) override; +virtual SalMenuItem*CreateMenuItem( const SalItemParams* ) override; +virtual voidDestroyMenuItem( SalMenuItem* pItem ) override; + virtual SalTimer* CreateSalTimer() override; virtual SalSystem* CreateSalSystem() override; virtual SalBitmap* CreateSalBitmap() override; diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index beab3ed902b8..e8c6c5786888 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -24,6 +24,7 @@ #include "Qt5Data.hxx" #include "Qt5FilePicker.hxx" #include "Qt5Frame.hxx" +#include "Qt5Menu.hxx" #include "Qt5Object.hxx" #include "Qt5Timer.hxx" #include "Qt5VirtualDevice.hxx" @@ -107,6 +108,28 @@ SalVirtualDevice* Qt5Instance::CreateVirtualDevice(SalGraphics* /* pGraphics */, } } +SalMenu* Qt5Instance::CreateMenu( bool bMenuBar, Menu* pVCLMenu ) +{ +Qt5Menu* pSalMenu = new Qt5Menu( bMenuBar ); +pSalMenu->SetMenu( pVCLMenu ); +return pSalMenu; +} + +void Qt5Instance::DestroyMenu( SalMenu* pMenu ) +{ +delete pMenu; +} + +SalMenuItem* Qt5Instance::CreateMenuItem( const SalItemParams* pItemData ) +{ +return new Qt5MenuItem( pItemData ); +} + +void Qt5Instance::DestroyMenuItem( SalMenuItem* pItem ) +{ +delete pItem; +} + SalTimer* Qt5Instance::CreateSalTimer() { return new Qt5Timer(); } SalSystem* Qt5Instance::CreateSalSystem() { return new SvpSalSystem(); } commit 748da4ae6657b2205c8006dbfa5c0c309ed7ccb3 Author: Katarina Behrens Date: Tue May 8 16:05:59 2018 +0200 Basic skeleton of native menus in the closet Change-Id: Ic54b3853b53987b3e5a85444da0b9167a785bd81 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index 8ebee18f71e4..075eb0bb0be8 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -91,6 +91,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Graphics_Text \ vcl/qt5/Qt5Instance \ vcl/qt5/Qt5Instance_Print \ +vcl/qt5/Qt5Menu \ vcl/qt5/Qt5Object \ vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ diff --git a/vcl/inc/qt5/Qt5Menu.hxx b/vcl/inc/qt5/Qt5Menu.hxx new file mode 100644 index ..cf7a715f5911 --- /dev/null +++ b/vcl/inc/qt5/Qt5Menu.hxx @@ -0,0 +1,66 @@ +/* -*- 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/. + */ + +#pragma once + +#include + +class MenuItemList; +class Qt5MenuItem; +class Qt5Frame; + +class Qt5Menu : public SalMenu +{ +private: +std::vector< Qt5MenuItem* > maItems; +VclPtr mpVCLMenu; +Qt5Menu* mpParentSalMenu; +Qt5Frame*mpFrame; +bool mbMenuBar; + +public: +Qt5Menu( bool bMenuBar ); +virtual ~Qt5Menu() override; + +virtual boolVisibleMenuBar() override; // must return TRUE to actually DISPLAY native menu bars + +virtual voidInsertItem( SalMenuItem* pSalMenuItem, unsigned nPos ) override; +virtual voidRemoveItem( unsigned nPos ) override; +virtual voidSetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsigned nPos ) override; +virtual voidSetFrame( const SalFrame* pFrame ) override; +const Qt5Frame* GetFrame() const; +virtual voidCheckItem( unsigned nPos, bool bCheck ) override; +virtual voidEnableItem( unsigned nPos, bool bEnable ) override; +virtual voidShowItem( unsigned nPos, bool bShow ) override; +virtual voidSetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const OUString& rText ) override; +virtual voidSetIt
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5SalData.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 897176bc99730f3389ce44b13c868dab1bcddb33 Author: Katarina Behrens Date: Thu May 3 17:22:08 2018 +0200 Get rid of annoying focus rectangles in start centre Change-Id: I7ef38b226cd2bab7641638c500341cf7c198026d diff --git a/vcl/unx/kde5/KDE5SalData.cxx b/vcl/unx/kde5/KDE5SalData.cxx index f995fa549768..1b0e2071770b 100644 --- a/vcl/unx/kde5/KDE5SalData.cxx +++ b/vcl/unx/kde5/KDE5SalData.cxx @@ -45,6 +45,7 @@ void KDE5SalData::initNWF() pSVData->maNWFData.mbRolloverMenubar = true; pSVData->maNWFData.mbNoFocusRects = true; +pSVData->maNWFData.mbNoFocusRectsForFlatButtons = true; // Styled menus need additional space QStyle *style = QApplication::style(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5SalGraphics.cxx |9 + 1 file changed, 9 insertions(+) New commits: commit 826f2e7d7de87d03dcdb1f0433730bff8ce4f7a8 Author: Katarina Behrens Date: Thu May 3 16:45:57 2018 +0200 Render list headers natively they have somehow odd colour though Change-Id: I645581cc594ba3e06c4475957565aadc633b9d20 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 92275052013a..070a18c0f57c 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -90,6 +90,9 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Pushbutton: return (part == ControlPart::Entire) || (part == ControlPart::Focus); +case ControlType::ListHeader: +return (part == ControlPart::Button); + case ControlType::Menubar: case ControlType::MenuPopup: case ControlType::Editbox: @@ -422,6 +425,12 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::PE_IndicatorBranch, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } +else if (type == ControlType::ListHeader) +{ +QStyleOptionHeader option; +draw(QStyle::CE_HeaderSection, &option, m_image.get(), + vclStateValue2StateFlag(nControlState, value) ); +} else if (type == ControlType::Checkbox) { if (part == ControlPart::Entire) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/unx
vcl/inc/qt5/Qt5Tools.hxx |1 + vcl/unx/kde5/KDE5SalGraphics.cxx |2 +- 2 files changed, 2 insertions(+), 1 deletion(-) New commits: commit dbcd55464c80237431a255c95f85f576bd419ad0 Author: Katarina Behrens Date: Thu May 3 12:03:12 2018 +0200 Use QImage format with premultiplied alpha as that's what cairo (almost) silently expects Change-Id: If1ad6f28fcc6fb7ddc2ac4fcec0a31bad512cb2a diff --git a/vcl/inc/qt5/Qt5Tools.hxx b/vcl/inc/qt5/Qt5Tools.hxx index c7b47014beb0..d632a5ed8ce5 100644 --- a/vcl/inc/qt5/Qt5Tools.hxx +++ b/vcl/inc/qt5/Qt5Tools.hxx @@ -91,6 +91,7 @@ inline sal_uInt16 getFormatBits(QImage::Format eFormat) case QImage::Format_RGB888: return 24; case Qt5_DefaultFormat32: +case QImage::Format_ARGB32_Premultiplied: return 32; default: std::abort(); diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 13b791943199..92275052013a 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -180,7 +180,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, //if no image, or resized, make a new image if (!m_image || m_image->size() != widgetRect.size()) { -m_image.reset(new QImage( widgetRect.width(), widgetRect.height(), QImage::Format_ARGB32 ) ); +m_image.reset(new QImage( widgetRect.width(), widgetRect.height(), QImage::Format_ARGB32_Premultiplied ) ); } // Default image color - just once ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
vcl/unx/kde5/KDE5SalGraphics.cxx | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) New commits: commit 4a04579cac010c1082ee368233be1bfb6722424a Author: Katarina Behrens Date: Wed May 2 16:42:56 2018 +0200 Native focus rectangles for push buttons far from perfect, they also hide the button text (but at least focus frame in contrast colour is visible) Change-Id: I9a7c2b429ae14b8604f894de64a7328cde6cb270 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index e110c0b04722..13b791943199 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -80,7 +80,6 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa { switch (type) { -case ControlType::Pushbutton: case ControlType::Tooltip: case ControlType::Progress: case ControlType::ListNode: @@ -88,6 +87,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Radiobutton: case ControlType::Checkbox: +case ControlType::Pushbutton: return (part == ControlPart::Entire) || (part == ControlPart::Focus); case ControlType::Menubar: @@ -203,7 +203,10 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, m_image->fill(QApplication::palette().color(QPalette::ToolTipBase).rgb()); break; case ControlType::Pushbutton: - m_image->fill(QApplication::palette().color(QPalette::Button).rgb()); +if ( nControlState & ControlState::FOCUSED ) + m_image->fill(QApplication::palette().color(QPalette::Highlight).rgb()); +else + m_image->fill(QApplication::palette().color(QPalette::Button).rgb()); break; case ControlType::Scrollbar: if ((part == ControlPart::DrawBackgroundVert) commit 39ac3dc45013ef2c8397a208f0f37e794e8c57f3 Author: Katarina Behrens Date: Wed May 2 14:00:01 2018 +0200 Native focus rectangles for radiobuttons that suffer from the same problem (lack of transparency) as those of checkboxes Change-Id: I4bb81c5f95b07e57a7d6cdb86ba4e31ec7660f5a diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 849865641fb1..e110c0b04722 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -81,12 +81,12 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa switch (type) { case ControlType::Pushbutton: -case ControlType::Radiobutton: case ControlType::Tooltip: case ControlType::Progress: case ControlType::ListNode: return (part == ControlPart::Entire); +case ControlType::Radiobutton: case ControlType::Checkbox: return (part == ControlPart::Entire) || (part == ControlPart::Focus); @@ -501,9 +501,18 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, } else if (type == ControlType::Radiobutton) { -QStyleOptionButton option; -draw( QStyle::CE_RadioButton, &option, m_image.get(), - vclStateValue2StateFlag(nControlState, value) ); +if (part == ControlPart::Entire) +{ +QStyleOptionButton option; +draw( QStyle::CE_RadioButton, &option, m_image.get(), + vclStateValue2StateFlag(nControlState, value) ); +} +else if (part == ControlPart::Focus) +{ +QStyleOptionFocusRect option; +draw( QStyle::PE_FrameFocusRect, &option, m_image.get(), + vclStateValue2StateFlag(nControlState, value) ); +} } else if (type == ControlType::Tooltip) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/Library_vclplug_kde5.mk vcl/unx
Rebased ref, commits from common ancestor: commit 6e0d7ce5c38cfab790b073c9e8ea5a7e08a8921d Author: Katarina Behrens Date: Wed May 2 13:25:43 2018 +0200 Native focus rectangles for checkboxes done only half-way, they need to be made transparent Change-Id: Id7b1ebce33ef6f8912ee5250c13e38592b383f81 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 59cdd1347fb9..849865641fb1 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -82,12 +82,14 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa { case ControlType::Pushbutton: case ControlType::Radiobutton: -case ControlType::Checkbox: case ControlType::Tooltip: case ControlType::Progress: case ControlType::ListNode: return (part == ControlPart::Entire); +case ControlType::Checkbox: +return (part == ControlPart::Entire) || (part == ControlPart::Focus); + case ControlType::Menubar: case ControlType::MenuPopup: case ControlType::Editbox: @@ -419,10 +421,18 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, } else if (type == ControlType::Checkbox) { -QStyleOptionButton option; -draw( QStyle::CE_CheckBox, &option, m_image.get(), +if (part == ControlPart::Entire) +{ +QStyleOptionButton option; +draw( QStyle::CE_CheckBox, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); -//m_image->save("/tmp/checkbox.png"); +} +else if (part == ControlPart::Focus) +{ +QStyleOptionFocusRect option; +draw( QStyle::PE_FrameFocusRect, &option, m_image.get(), + vclStateValue2StateFlag(nControlState, value) ); +} } else if (type == ControlType::Scrollbar) { commit d8cd9b1aeeaef8f4d071b88570885867ac81a54b Author: Katarina Behrens Date: Wed May 2 13:14:29 2018 +0200 KDE5SalData derives from Qt5Data A step back since now mbNoFocusRects (= draw focus rectangle natively) is set, but native drawing itself is not yet implemented and no focus rectangles are drawn Change-Id: I4dde734d057f6c594eb11162990430697277f029 diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index f82227722c55..0f6cffad5d3c 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -85,6 +85,7 @@ $(eval $(call gb_Library_add_libs,vclplug_kde5,\ )) $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ +vcl/unx/kde5/KDE5SalData \ vcl/unx/kde5/KDE5SalDisplay \ vcl/unx/kde5/KDE5SalFrame \ vcl/unx/kde5/KDE5SalGraphics \ diff --git a/vcl/unx/kde5/KDE5SalData.cxx b/vcl/unx/kde5/KDE5SalData.cxx new file mode 100644 index ..f995fa549768 --- /dev/null +++ b/vcl/unx/kde5/KDE5SalData.cxx @@ -0,0 +1,59 @@ +/* -*- 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 +#include + +#undef Region + +#include "KDE5SalData.hxx" + +KDE5SalData::KDE5SalData( SalInstance *pInstance ) +: Qt5Data( pInstance ) +{ +} + +KDE5SalData::~KDE5SalData() +{ +} + +void KDE5SalData::initNWF() +{ +ImplSVData *pSVData = ImplGetSVData(); + +// draw toolbars on separate lines +pSVData->maNWFData.mbDockingAreaSeparateTB = true; +// no borders for menu, theming does that +pSVData->maNWFData.mbFlatMenu = true; +// Qt theme engines may support a rollover menubar +pSVData->maNWFData.mbRolloverMenubar = true; + +pSVData->maNWFData.mbNoFocusRects = true; + +// Styled menus need additional space +QStyle *style = QApplication::style(); +pSVData->maNWFData.mnMenuFormatBorderX = + style->pixelMetric( QStyle::PM_MenuPanelWidth ) + + style->pixelMetric( QStyle::PM_MenuHMargin ); +pSVData->maNWFData.mnMenuFormatBorderY = + style->pixelMetric( QStyle::PM_MenuPanelWidth ) + + style->pixelMetric( QStyle::PM_MenuVMargin ); +} + +/* vim:set shiftwidth=4 softtabs
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - include/sfx2 sfx2/source vcl/Library_vclplug_kde5.mk vcl/unx
include/sfx2/infobar.hxx |4 ++ include/sfx2/viewfrm.hxx |2 + sfx2/source/dialog/infobar.cxx | 34 +- sfx2/source/doc/objserv.cxx | 33 + sfx2/source/view/viewfrm.cxx | 21 + vcl/Library_vclplug_kde5.mk |1 vcl/unx/kde5/KDE5SalData.cxx | 59 +++ vcl/unx/kde5/KDE5SalData.hxx | 33 + vcl/unx/kde5/KDE5SalInstance.cxx |6 ++- 9 files changed, 170 insertions(+), 23 deletions(-) New commits: commit 9cd8b3d2db27792673436ec0fdc6727b0b8e04fe Author: Katarina Behrens Date: Wed May 2 13:14:29 2018 +0200 KDE5SalData derives from Qt5Data A step back since now mbNoFocusRects (= draw focus rectangle natively) is set, but native drawing itself is not yet implemented and no focus rectangles are draw Change-Id: I4dde734d057f6c594eb11162990430697277f029 diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index f82227722c55..0f6cffad5d3c 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -85,6 +85,7 @@ $(eval $(call gb_Library_add_libs,vclplug_kde5,\ )) $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ +vcl/unx/kde5/KDE5SalData \ vcl/unx/kde5/KDE5SalDisplay \ vcl/unx/kde5/KDE5SalFrame \ vcl/unx/kde5/KDE5SalGraphics \ diff --git a/vcl/unx/kde5/KDE5SalData.cxx b/vcl/unx/kde5/KDE5SalData.cxx new file mode 100644 index ..f995fa549768 --- /dev/null +++ b/vcl/unx/kde5/KDE5SalData.cxx @@ -0,0 +1,59 @@ +/* -*- 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 +#include + +#undef Region + +#include "KDE5SalData.hxx" + +KDE5SalData::KDE5SalData( SalInstance *pInstance ) +: Qt5Data( pInstance ) +{ +} + +KDE5SalData::~KDE5SalData() +{ +} + +void KDE5SalData::initNWF() +{ +ImplSVData *pSVData = ImplGetSVData(); + +// draw toolbars on separate lines +pSVData->maNWFData.mbDockingAreaSeparateTB = true; +// no borders for menu, theming does that +pSVData->maNWFData.mbFlatMenu = true; +// Qt theme engines may support a rollover menubar +pSVData->maNWFData.mbRolloverMenubar = true; + +pSVData->maNWFData.mbNoFocusRects = true; + +// Styled menus need additional space +QStyle *style = QApplication::style(); +pSVData->maNWFData.mnMenuFormatBorderX = + style->pixelMetric( QStyle::PM_MenuPanelWidth ) + + style->pixelMetric( QStyle::PM_MenuHMargin ); +pSVData->maNWFData.mnMenuFormatBorderY = + style->pixelMetric( QStyle::PM_MenuPanelWidth ) + + style->pixelMetric( QStyle::PM_MenuVMargin ); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalData.hxx b/vcl/unx/kde5/KDE5SalData.hxx new file mode 100644 index ..a72180694d7b --- /dev/null +++ b/vcl/unx/kde5/KDE5SalData.hxx @@ -0,0 +1,33 @@ +/* -*- 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 . + */ + +#pragma once + +#include + +class KDE5SalData : public Qt5Data +{ +public: +KDE5SalData( SalInstance *pInstance ); +virtual ~KDE5SalData(); + +static void initNWF() ; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalIns
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5SalGraphics.cxx | 33 - 1 file changed, 33 deletions(-) New commits: commit 56946751df8d7e7ad6e75326bb08b469d9b317fd Author: Katarina Behrens Date: Fri Apr 27 10:04:14 2018 +0200 Remove IMAGE_BASED_PAINTING dead code Change-Id: I2d30c61c2a8cbf69e04dd24098c0fffb7dac442d diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 1685a772a88b..59cdd1347fb9 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -157,39 +157,6 @@ namespace } } -#if QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 ) -#define IMAGE_BASED_PAINTING -#else -#undef IMAGE_BASED_PAINTING -#endif - -#ifdef IMAGE_BASED_PAINTING -// There is a small catch with this function, although hopefully only philosophical. -// Officially Xlib's vcl::Region is an opaque data type, with only functions for manipulating it. -// However, whoever designed it apparently didn't give it that much thought, as it's impossible -// to find out what exactly a region actually is (except for really weird ways like XClipBox() -// and repeated XPointInRegion(), which would be awfully slow). Fortunately, the header file -// describing the structure actually happens to be installed too, and there's at least one -// widely used software using it (Compiz). So access the data directly too and assume that -// everybody who compiles with Qt4 support has Xlib new enough and good enough to support this. -// In case this doesn't work for somebody, try #include instead, or build -// without IMAGE_BASED_PAINTING (in which case QApplication::setGraphicsSystem( "native" ) may -// be needed too). -#include -static QRegion XRegionToQRegion( Region xr ) -{ -QRegion qr; -for( long i = 0; - i < xr->numRects; - ++i ) -{ -BOX& b = xr->rects[ i ]; -qr |= QRect( b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1 ); // x2,y2 is outside, not the bottom-right corner -} -return qr; -} -#endif - bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, const tools::Rectangle& rControlRegion, ControlState nControlState, const ImplControlValue& value, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
Rebased ref, commits from common ancestor: commit 1152f6d90e2e3a5e3e9dcb5d2440652a022d98fa Author: Katarina Behrens Date: Wed Apr 25 15:42:59 2018 +0200 Render tooltips natively with this, all widgets that used to be rendered natively with kde4 are rendered natively also in kde5 Change-Id: If814b121e928a9d743c74836f000b3230b946caf diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 931b6a2d23b8..1685a772a88b 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -83,7 +83,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Pushbutton: case ControlType::Radiobutton: case ControlType::Checkbox: -/*case ControlType::Tooltip:*/ +case ControlType::Tooltip: case ControlType::Progress: case ControlType::ListNode: return (part == ControlPart::Entire); @@ -528,12 +528,12 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_RadioButton, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } -/*else if (type == ControlType::Tooltip) +else if (type == ControlType::Tooltip) { QStyleOption option; draw( QStyle::PE_PanelTipLabel, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); -}*/ +} else if (type == ControlType::Frame) { lcl_drawFrame( QStyle::PE_Frame, m_image.get(), commit d685cb23f72de6e619bda68d7d1a557e2562eaab Author: Katarina Behrens Date: Wed Apr 25 15:19:28 2018 +0200 Render scrollbars natively Change-Id: I7f7e5bb8cf6e7307b0563a9ef84845a99dc54e1e diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 4c5a70a89a77..931b6a2d23b8 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -95,7 +95,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Combobox: case ControlType::Toolbar: case ControlType::Frame: -/*case ControlType::Scrollbar:*/ +case ControlType::Scrollbar: case ControlType::WindowBackground: case ControlType::Fixedline: return true; @@ -457,7 +457,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, vclStateValue2StateFlag(nControlState, value) ); //m_image->save("/tmp/checkbox.png"); } -/*else if (type == ControlType::Scrollbar) +else if (type == ControlType::Scrollbar) { if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) { @@ -495,7 +495,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, { returnVal = false; } -}*/ +} else if (type == ControlType::Spinbox) { QStyleOptionSpinBox option; @@ -857,7 +857,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } break; } -/*case ControlType::Scrollbar: +case ControlType::Scrollbar: { // core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(), // for the rest also provide the track area (i.e. area not taken by buttons) @@ -889,7 +889,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part retVal = true; } break; -}*/ +} default: break; } @@ -910,7 +910,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } /** Test whether the position is in the native widget. -If the return value is TRUE, bIsInside contains information whether +If the return value is true, bIsInside contains information whether aPos was or was not inside the native widget specified by the nType/nPart combination. */ @@ -918,15 +918,15 @@ bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart const tools::Rectangle& rControlRegion, const Point& rPos, bool& rIsInside ) { -/*if ( nType == ControlType::Scrollbar ) +if ( nType == ControlType::Scrollbar ) { if( nPart != ControlPart::ButtonUp && nPart != ControlPart::ButtonDown && nPart != ControlPart::ButtonLeft && nPart != ControlPart::ButtonRight ) { // we adjust only for buttons (because some scrollbars have 3 buttons, // and LO core doesn't handle such scrollbars well) -return FALSE; +return false; } -rIsInside = FALSE; +rIsInside = false; bool bHorizontal = ( nP
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 3 commits - sc/qa sc/source vcl/unx
sc/qa/unit/data/ods/tdf62268.ods |binary sc/qa/unit/subsequent_filters-test.cxx | 25 + sc/source/filter/xml/xmlimprt.cxx | 12 vcl/unx/kde5/KDE5SalGraphics.cxx | 28 ++-- 4 files changed, 47 insertions(+), 18 deletions(-) New commits: commit d7f60e4f888ddd1cbad9291b58177755c1df607b Author: Katarina Behrens Date: Wed Apr 25 15:42:59 2018 +0200 Render tooltips natively with this, all widgets that used to be rendered natively with kde4 are rendered natively also in kde5 Change-Id: If814b121e928a9d743c74836f000b3230b946caf diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 931b6a2d23b8..1685a772a88b 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -83,7 +83,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Pushbutton: case ControlType::Radiobutton: case ControlType::Checkbox: -/*case ControlType::Tooltip:*/ +case ControlType::Tooltip: case ControlType::Progress: case ControlType::ListNode: return (part == ControlPart::Entire); @@ -528,12 +528,12 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_RadioButton, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } -/*else if (type == ControlType::Tooltip) +else if (type == ControlType::Tooltip) { QStyleOption option; draw( QStyle::PE_PanelTipLabel, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); -}*/ +} else if (type == ControlType::Frame) { lcl_drawFrame( QStyle::PE_Frame, m_image.get(), commit 6a0e5d1f14c2e06812fe54d3e27fe593fd913387 Author: Katarina Behrens Date: Wed Apr 25 15:19:28 2018 +0200 Render scrollbars natively Change-Id: I7f7e5bb8cf6e7307b0563a9ef84845a99dc54e1e diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 4c5a70a89a77..931b6a2d23b8 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -95,7 +95,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Combobox: case ControlType::Toolbar: case ControlType::Frame: -/*case ControlType::Scrollbar:*/ +case ControlType::Scrollbar: case ControlType::WindowBackground: case ControlType::Fixedline: return true; @@ -457,7 +457,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, vclStateValue2StateFlag(nControlState, value) ); //m_image->save("/tmp/checkbox.png"); } -/*else if (type == ControlType::Scrollbar) +else if (type == ControlType::Scrollbar) { if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) { @@ -495,7 +495,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, { returnVal = false; } -}*/ +} else if (type == ControlType::Spinbox) { QStyleOptionSpinBox option; @@ -857,7 +857,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } break; } -/*case ControlType::Scrollbar: +case ControlType::Scrollbar: { // core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(), // for the rest also provide the track area (i.e. area not taken by buttons) @@ -889,7 +889,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part retVal = true; } break; -}*/ +} default: break; } @@ -910,7 +910,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } /** Test whether the position is in the native widget. -If the return value is TRUE, bIsInside contains information whether +If the return value is true, bIsInside contains information whether aPos was or was not inside the native widget specified by the nType/nPart combination. */ @@ -918,15 +918,15 @@ bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart const tools::Rectangle& rControlRegion, const Point& rPos, bool& rIsInside ) { -/*if ( nType == ControlType::Scrollbar ) +if ( nType == ControlType::Scrollbar ) { if( nPart != ControlPart::ButtonUp && nPart != ControlPart::ButtonDown && nPart != ControlPart::ButtonLeft && nPart != ControlPart::ButtonRight ) { // we ad
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 5 commits - vcl/unx
vcl/unx/kde5/KDE5SalGraphics.cxx | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) New commits: commit 55cc229fbc2e1ae9c9cf80df15d9249abb81e2ba Author: Katarina Behrens Date: Tue Apr 24 16:45:55 2018 +0200 Render frames and window background natively Change-Id: I947abe375fc74acbb8628076a0938d1074d1427c diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index bf58a1f6706f..4c5a70a89a77 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -94,9 +94,9 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::MultilineEditbox: case ControlType::Combobox: case ControlType::Toolbar: -/*case ControlType::Frame: -case ControlType::Scrollbar: -case ControlType::WindowBackground:*/ +case ControlType::Frame: +/*case ControlType::Scrollbar:*/ +case ControlType::WindowBackground: case ControlType::Fixedline: return true; @@ -533,7 +533,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, QStyleOption option; draw( QStyle::PE_PanelTipLabel, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); -} +}*/ else if (type == ControlType::Frame) { lcl_drawFrame( QStyle::PE_Frame, m_image.get(), @@ -545,7 +545,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, else if (type == ControlType::WindowBackground) { // Nothing to do - see "Default image color" switch ^^ -}*/ +} else if (type == ControlType::Fixedline) { QStyleOptionMenuItem option; @@ -791,7 +791,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } break; } -/*case ControlType::Frame: +case ControlType::Frame: { if( part == ControlPart::Border ) { @@ -805,7 +805,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part retVal = true; } break; -}*/ +} case ControlType::Radiobutton: { const int h = QApplication::style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight); commit e71c16fbf551dfd2ec5c862d34aa4c2ff49c503a Author: Katarina Behrens Date: Tue Apr 24 16:38:01 2018 +0200 Render toolbars natively Change-Id: Ib3716fa63dfccce66a6e43ba183820dc15497d07 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 0ead29ea09fd..bf58a1f6706f 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -93,8 +93,8 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Editbox: case ControlType::MultilineEditbox: case ControlType::Combobox: -/*case ControlType::Toolbar: -case ControlType::Frame: +case ControlType::Toolbar: +/*case ControlType::Frame: case ControlType::Scrollbar: case ControlType::WindowBackground:*/ case ControlType::Fixedline: @@ -377,7 +377,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_ToolBar, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } -/*else if ( (type == ControlType::Toolbar) +else if ( (type == ControlType::Toolbar) && (part == ControlPart::ThumbVert || part == ControlPart::ThumbHorz) ) { // reduce paint area only to the handle area const int handleExtend = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent); @@ -398,7 +398,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value), rect ); -}*/ +} else if (type == ControlType::Editbox || type == ControlType::MultilineEditbox) { lcl_drawFrame( QStyle::PE_FrameLineEdit, m_image.get(), @@ -840,7 +840,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } break; } -/*case ControlType::Toolbar: +case ControlType::Toolbar: { const int nWorH = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent); if( part == ControlPart::ThumbHorz ) @@ -857,7 +857,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } break; } -case ControlType::Scrollbar: +/*case ControlType::Scrollbar: { // core can't handle 3-button scrollbars well, so we
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/unx
vcl/unx/kde5/KDE5SalGraphics.cxx | 38 ++ 1 file changed, 14 insertions(+), 24 deletions(-) New commits: commit 9741a9d1ff3e9ffeeb2e5d46dd18f845b35eb0cf Author: Katarina Behrens Date: Tue Apr 24 13:47:30 2018 +0200 Drop duplicate implementation of conversion to QRect use the one from Qt5Tools class Change-Id: I4dc33b14fc6ab7fa7c426d6b1a56c299aed62c55 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 1a974bfbf089..c8682bfd62ee 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -71,16 +71,6 @@ void QImage2BitmapBuffer( QImage* pImg, BitmapBuffer* pBuf ) pBuf->mnScanlineSize = pImg->bytesPerLine(); } -/** - Convert tools::Rectangle to QRect. - @param rControlRegion The tools::Rectangle to convert. - @return The matching QRect -*/ -QRect region2QRect( const tools::Rectangle& rControlRegion ) -{ -return QRect(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.GetWidth(), rControlRegion.GetHeight()); -} - KDE5SalGraphics::KDE5SalGraphics() : SvpSalGraphics() { @@ -216,7 +206,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, bool returnVal = true; -QRect widgetRect = region2QRect(rControlRegion); +QRect widgetRect = toQRect(rControlRegion); //if no image, or resized, make a new image if (!m_image || m_image->size() != widgetRect.size()) @@ -342,7 +332,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, // is painted after menuitem highlight, otherwise there would be a grey area assert( value.getType() == ControlType::MenuPopup ); const MenupopupValue* menuVal = static_cast(&value); -QRect menuItemRect( region2QRect( menuVal->maItemRect )); +QRect menuItemRect( toQRect( menuVal->maItemRect )); QRect rect( menuItemRect.topLeft() - widgetRect.topLeft(), widgetRect.size().expandedTo( menuItemRect.size())); // checkboxes are always displayed next to images in menus, so are never centered @@ -619,7 +609,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part { bool retVal = false; -QRect boundingRect = region2QRect( controlRegion ); +QRect boundingRect = toQRect( controlRegion ); QRect contentRect = boundingRect; QStyleOptionComplex styleOption; @@ -938,7 +928,7 @@ bool KDE5SalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart } rIsInside = FALSE; bool bHorizontal = ( nPart == ControlPart::ButtonLeft || nPart == ControlPart::ButtonRight ); -QRect rect = region2QRect( rControlRegion ); +QRect rect = toQRect( rControlRegion ); QPoint pos( rPos.X(), rPos.Y()); // Adjust coordinates to make the widget appear to be at (0,0), i.e. make // widget and screen coordinates the same. QStyle functions should use screen commit b38c7a223ce436dc1af6aaf95227316e4e66abeb Author: Katarina Behrens Date: Tue Apr 24 13:43:14 2018 +0200 Render sliders and spinboxes natively Change-Id: I307930eca8a82f3153f38362ee8f55cb121707b7 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index b0fbdbb5..1a974bfbf089 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -113,11 +113,11 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa case ControlType::Listbox: return (part == ControlPart::Entire || part == ControlPart::HasBackgroundTexture); -/*case ControlType::Spinbox: +case ControlType::Spinbox: return (part == ControlPart::Entire || part == ControlPart::HasBackgroundTexture); case ControlType::Slider: -return (part == ControlPart::TrackHorzArea || part == ControlPart::TrackVertArea);*/ +return (part == ControlPart::TrackHorzArea || part == ControlPart::TrackVertArea); default: break; @@ -505,7 +505,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, { returnVal = false; } -} +}*/ else if (type == ControlType::Spinbox) { QStyleOptionSpinBox option; @@ -531,7 +531,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CC_SpinBox, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); -}*/ +} else if (type == ControlType::Radiobutton) { QStyleOptionButton option; @@ -564,7 +564,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_MenuItem, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); -} +}*/ else if
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5SalGraphics.cxx | 29 - 1 file changed, 8 insertions(+), 21 deletions(-) New commits: commit 45eb2f9ea2347b618c208b4705b5e931d5c8a37b Author: Katarina Behrens Date: Tue Apr 24 12:23:58 2018 +0200 Render text edits (single and multiline) natively also drop deprecated QStyleOptionFrameV3 and ancient code for Qt < 4.5 Change-Id: I1f7cf92d23eebc032263b25bdf37651e14994c73 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 7a072938743a..b0fbdbb5 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -99,9 +99,9 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa return (part == ControlPart::Entire); /*case ControlType::Menubar: -case ControlType::MenuPopup: +case ControlType::MenuPopup:*/ case ControlType::Editbox: -case ControlType::MultilineEditbox:*/ +case ControlType::MultilineEditbox: case ControlType::Combobox: /*case ControlType::Toolbar: case ControlType::Frame: @@ -159,23 +159,10 @@ namespace void lcl_drawFrame( QStyle::PrimitiveElement element, QImage* image, QStyle::State const & state, QStyle::PixelMetric eLineMetric = QStyle::PM_DefaultFrameWidth ) { -#if ( QT_VERSION >= QT_VERSION_CHECK( 4, 5, 0 ) ) -QStyleOptionFrameV3 option; +QStyleOptionFrame option; option.frameShape = QFrame::StyledPanel; option.state = QStyle::State_Sunken; option.lineWidth = QApplication::style()->pixelMetric( eLineMetric ); -#else -QStyleOptionFrame option; - -QFrame aFrame( nullptr ); -aFrame.setFrameRect( QRect(0, 0, image->width(), image->height()) ); -aFrame.setFrameStyle( QFrame::StyledPanel | QFrame::Sunken ); -aFrame.ensurePolished(); - -option.initFrom( &aFrame ); -option.lineWidth = aFrame.lineWidth(); -option.midLineWidth = aFrame.midLineWidth(); -#endif draw(element, &option, image, state); } } @@ -421,12 +408,12 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value), rect ); -} +}*/ else if (type == ControlType::Editbox || type == ControlType::MultilineEditbox) { lcl_drawFrame( QStyle::PE_FrameLineEdit, m_image.get(), vclStateValue2StateFlag(nControlState, value)); -}*/ +} else if (type == ControlType::Combobox) { QStyleOptionComboBox option; @@ -653,10 +640,10 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } } break; -/*case ControlType::Editbox: +case ControlType::Editbox: case ControlType::MultilineEditbox: { -QStyleOptionFrameV3 fo; +QStyleOptionFrame fo; fo.frameShape = QFrame::StyledPanel; fo.state = QStyle::State_Sunken; fo.lineWidth = QApplication::style()->pixelMetric(QStyle::PM_DefaultFrameWidth); @@ -676,7 +663,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } retVal = true; break; -}*/ +} case ControlType::Checkbox: if (part == ControlPart::Entire) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 3 commits - vcl/unx
vcl/unx/kde5/KDE5SalGraphics.cxx | 40 +++ 1 file changed, 20 insertions(+), 20 deletions(-) New commits: commit 3aa593fe271451f7b8cbc4ac8fca9f436b6c7aca Author: Katarina Behrens Date: Mon Apr 23 15:14:22 2018 +0200 Render listboxes and comboboxes natively Change-Id: Ia8d46717df43b088bb72d1f937998a64795f663e diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index e686565b46f2..7a072938743a 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -101,19 +101,19 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa /*case ControlType::Menubar: case ControlType::MenuPopup: case ControlType::Editbox: -case ControlType::MultilineEditbox: +case ControlType::MultilineEditbox:*/ case ControlType::Combobox: -case ControlType::Toolbar: +/*case ControlType::Toolbar: case ControlType::Frame: case ControlType::Scrollbar: case ControlType::WindowBackground: -case ControlType::Fixedline: +case ControlType::Fixedline:*/ return true; case ControlType::Listbox: return (part == ControlPart::Entire || part == ControlPart::HasBackgroundTexture); -case ControlType::Spinbox: +/*case ControlType::Spinbox: return (part == ControlPart::Entire || part == ControlPart::HasBackgroundTexture); case ControlType::Slider: @@ -426,7 +426,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, { lcl_drawFrame( QStyle::PE_FrameLineEdit, m_image.get(), vclStateValue2StateFlag(nControlState, value)); -} +}*/ else if (type == ControlType::Combobox) { QStyleOptionComboBox option; @@ -462,7 +462,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, break; } } -else if (type == ControlType::ListNode) +/*else if (type == ControlType::ListNode) { QStyleOption option; option.state = QStyle::State_Item | QStyle::State_Children; @@ -699,7 +699,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part retVal = true; } break; -/*case ControlType::Combobox: +case ControlType::Combobox: case ControlType::Listbox: { QStyleOptionComboBox cbo; @@ -712,7 +712,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part case ControlPart::Entire: { // find out the minimum size that should be used -// assume contents is a text ling +// assume contents is a text line int nHeight = QApplication::fontMetrics().height(); QSize aContentSize( contentRect.width(), nHeight ); QSize aMinSize = QApplication::style()-> @@ -742,7 +742,7 @@ bool KDE5SalGraphics::getNativeControlRegion( ControlType type, ControlPart part } break; } -case ControlType::Spinbox: +/*case ControlType::Spinbox: { QStyleOptionSpinBox sbo; sbo.frame = true; commit 358cf52e21d9744d8dde324eb180fccf72c85377 Author: Katarina Behrens Date: Mon Apr 23 14:39:42 2018 +0200 Render pushbuttons natively Change-Id: I1a8e82d70841765cad3d5838877489aab4656678 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 1556eac7c694..e686565b46f2 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -90,7 +90,7 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa { switch (type) { -/*case ControlType::Pushbutton:*/ +case ControlType::Pushbutton: case ControlType::Radiobutton: case ControlType::Checkbox: /*case ControlType::Tooltip: @@ -274,13 +274,13 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, QRegion* localClipRegion = nullptr; -/*if (type == ControlType::Pushbutton) +if (type == ControlType::Pushbutton) { QStyleOptionButton option; draw( QStyle::CE_PushButton, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); } -else if (type == ControlType::Menubar) +/*else if (type == ControlType::Menubar) { if (part == ControlPart::MenuItem) { @@ -473,7 +473,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::PE_IndicatorBranch, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); }*/ -if (type == ControlType::Checkbox) +
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/CustomTarget_kde5_moc.mk vcl/Library_vclplug_kde5.mk vcl/unx
vcl/CustomTarget_kde5_moc.mk |1 vcl/Library_vclplug_kde5.mk |2 vcl/unx/kde5/KDE5Data.cxx| 73 -- vcl/unx/kde5/KDE5Data.hxx| 45 vcl/unx/kde5/KDE5SalDisplay.cxx |3 vcl/unx/kde5/KDE5SalFrame.cxx|1 vcl/unx/kde5/KDE5SalInstance.cxx |8 vcl/unx/kde5/KDE5SalInstance.hxx |5 vcl/unx/kde5/KDE5XLib.cxx| 410 --- vcl/unx/kde5/KDE5XLib.hxx| 101 - 10 files changed, 1 insertion(+), 648 deletions(-) New commits: commit 01706113ffd395ea41c59bb40774392a5f1f03c6 Author: Katarina Behrens Date: Mon Apr 23 13:13:07 2018 +0200 Remove now unused KDE5XLib and KDE5Data Change-Id: Ic3b3c0c41fb0992e8cc43410d5fb5c0bacc215fa diff --git a/vcl/CustomTarget_kde5_moc.mk b/vcl/CustomTarget_kde5_moc.mk index 2c8540cb065a..8bcaf1ed3700 100644 --- a/vcl/CustomTarget_kde5_moc.mk +++ b/vcl/CustomTarget_kde5_moc.mk @@ -10,7 +10,6 @@ $(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kde5)) $(call gb_CustomTarget_get_target,vcl/unx/kde5) : \ - $(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/KDE5XLib.moc \ $(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_socket_notifiers.moc \ $(call gb_CustomTarget_get_workdir,vcl/unx/kde5)/tst_exclude_posted_events.moc diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk index 086cae5332f2..f82227722c55 100644 --- a/vcl/Library_vclplug_kde5.mk +++ b/vcl/Library_vclplug_kde5.mk @@ -85,12 +85,10 @@ $(eval $(call gb_Library_add_libs,vclplug_kde5,\ )) $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\ -vcl/unx/kde5/KDE5Data \ vcl/unx/kde5/KDE5SalDisplay \ vcl/unx/kde5/KDE5SalFrame \ vcl/unx/kde5/KDE5SalGraphics \ vcl/unx/kde5/KDE5SalInstance \ -vcl/unx/kde5/KDE5XLib \ vcl/unx/kde5/VCLKDE5Application \ )) diff --git a/vcl/unx/kde5/KDE5Data.cxx b/vcl/unx/kde5/KDE5Data.cxx deleted file mode 100644 index 66bcde41210e.. --- a/vcl/unx/kde5/KDE5Data.cxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- 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 -#include - -#undef Region - -#include "KDE5Data.hxx" - -#include "KDE5XLib.hxx" -#include "KDE5SalDisplay.hxx" - -KDE5Data::~KDE5Data() -{ -} - -void KDE5Data::Init() -{ -pXLib_ = new KDE5XLib(); -pXLib_->Init(); -//SetDisplay( SalKDE5Display::self() ); - -int argc = 1; -qMyApp = new QApplication(argc, nullptr); -} - -void KDE5Data::initNWF() -{ -ImplSVData *pSVData = ImplGetSVData(); - -// draw toolbars on separate lines -pSVData->maNWFData.mbDockingAreaSeparateTB = true; -// no borders for menu, theming does that -pSVData->maNWFData.mbFlatMenu = true; -// Qt theme engines may support a rollover menubar -pSVData->maNWFData.mbRolloverMenubar = true; - -pSVData->maNWFData.mbNoFocusRects = true; - -// Styled menus need additional space -//QStyle *style = QApplication::style(); -QStyle *style = qMyApp->style(); -pSVData->maNWFData.mnMenuFormatBorderX = - style->pixelMetric( QStyle::PM_MenuPanelWidth ) + - style->pixelMetric( QStyle::PM_MenuHMargin ); -pSVData->maNWFData.mnMenuFormatBorderY = - style->pixelMetric( QStyle::PM_MenuPanelWidth ) + - style->pixelMetric( QStyle::PM_MenuVMargin ); -} - -void KDE5Data::deInitNWF() -{ -delete qMyApp; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5Data.hxx b/vcl/unx/kde5/KDE5Data.hxx deleted file mode 100644 index 6feedbe81734.. --- a/vcl/unx/kde5/KDE5Data.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- 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) unde
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 2 commits - vcl/headless vcl/inc vcl/unx
vcl/headless/svpgdi.cxx |6 +++ vcl/inc/headless/svpgdi.hxx |2 + vcl/unx/kde5/KDE5SalGraphics.cxx | 63 +-- 3 files changed, 49 insertions(+), 22 deletions(-) New commits: commit 018cb201437acf5212f241c1b3cd1755bda0faf0 Author: Katarina Behrens Date: Mon Apr 23 10:20:29 2018 +0200 Render checkboxes natively Change-Id: I687746c3d464feff4762c94ae5e228da503559a9 diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx index 45600c3b1bb7..e8076ebb18f9 100644 --- a/vcl/unx/kde5/KDE5SalGraphics.cxx +++ b/vcl/unx/kde5/KDE5SalGraphics.cxx @@ -29,6 +29,8 @@ #include "KDE5SalFrame.hxx" #include "KDE5SalInstance.hxx" +#include +#include #include #include #include @@ -60,6 +62,15 @@ QStyle::State vclStateValue2StateFlag( ControlState nControlState, return nState; } +void QImage2BitmapBuffer( QImage* pImg, BitmapBuffer* pBuf ) +{ +pBuf->mnWidth = pImg->width(); +pBuf->mnHeight = pImg->height(); +pBuf->mnBitCount = getFormatBits( pImg->format() ); +pBuf->mpBits = pImg->bits(); +pBuf->mnScanlineSize = pImg->bytesPerLine(); +} + /** Convert tools::Rectangle to QRect. @param rControlRegion The tools::Rectangle to convert. @@ -77,17 +88,17 @@ KDE5SalGraphics::KDE5SalGraphics() bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart part ) { -/*switch (type) +switch (type) { -case ControlType::Pushbutton: -case ControlType::Radiobutton: +/*case ControlType::Pushbutton: +case ControlType::Radiobutton:*/ case ControlType::Checkbox: -case ControlType::Tooltip: +/*case ControlType::Tooltip: case ControlType::Progress: -case ControlType::ListNode: +case ControlType::ListNode:*/ return (part == ControlPart::Entire); -case ControlType::Menubar: +/*case ControlType::Menubar: case ControlType::MenuPopup: case ControlType::Editbox: case ControlType::MultilineEditbox: @@ -106,11 +117,11 @@ bool KDE5SalGraphics::IsNativeControlSupported( ControlType type, ControlPart pa return (part == ControlPart::Entire || part == ControlPart::HasBackgroundTexture); case ControlType::Slider: -return (part == ControlPart::TrackHorzArea || part == ControlPart::TrackVertArea); +return (part == ControlPart::TrackHorzArea || part == ControlPart::TrackVertArea);*/ default: break; -}*/ +} return false; } @@ -207,7 +218,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, const ImplControlValue& value, const OUString& ) { -/*bool nativeSupport = IsNativeControlSupported( type, part ); +bool nativeSupport = IsNativeControlSupported( type, part ); if( ! nativeSupport ) { assert( ! nativeSupport && "drawNativeControl called without native support!" ); return false; @@ -263,7 +274,7 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, QRegion* localClipRegion = nullptr; -if (type == ControlType::Pushbutton) +/*if (type == ControlType::Pushbutton) { QStyleOptionButton option; draw( QStyle::CE_PushButton, &option, m_image.get(), @@ -461,14 +472,15 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::PE_IndicatorBranch, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); -} -else if (type == ControlType::Checkbox) +}*/ +if (type == ControlType::Checkbox) { QStyleOptionButton option; draw( QStyle::CE_CheckBox, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); +//m_image->save("/tmp/checkbox.png"); } -else if (type == ControlType::Scrollbar) +/*else if (type == ControlType::Scrollbar) { if ((part == ControlPart::DrawBackgroundVert) || (part == ControlPart::DrawBackgroundHorz)) { @@ -595,14 +607,21 @@ bool KDE5SalGraphics::drawNativeControl( ControlType type, ControlPart part, draw( QStyle::CE_ProgressBar, &option, m_image.get(), vclStateValue2StateFlag(nControlState, value) ); -} +}*/ else { returnVal = false; } -delete localClipRegion;*/ -return false; +BitmapBuffer *pBuffer = new BitmapBuffer; +QImage2BitmapBuffer( m_image.get(), pBuffer ); +SalTwoRect aTR( 0, 0, m_image.get()->width(), m_image.get()->height(), +rControlRegion.getX(), rControlRegion.getY(), +rControlRegion.GetWidth(), rControlRegion.GetHeight() ); +drawBitmap( aTR, pBuffer ); + +delete localClipRegion; +return returnVal; } bool KDE5S
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 3 commits - vcl/inc vcl/qt5 vcl/unx
vcl/inc/qt5/Qt5Frame.hxx |7 ++- vcl/qt5/Qt5Frame.cxx | 28 +--- vcl/unx/kde5/KDE5SalFrame.cxx| 32 vcl/unx/kde5/KDE5SalFrame.hxx| 24 +--- vcl/unx/kde5/KDE5SalGraphics.cxx | 26 -- vcl/unx/kde5/KDE5SalGraphics.hxx |6 +- 6 files changed, 57 insertions(+), 66 deletions(-) New commits: commit b49dffa71654488e296b02cbab343ff5a56f52cc Author: Katarina Behrens Date: Thu Apr 19 17:09:14 2018 +0200 Kill GraphicsHolder with fire Change-Id: I6bcdb872a1c7279bd08fbbfecd582e698532e0b3 diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx index 0709a79e6fe6..23e800cb5558 100644 --- a/vcl/unx/kde5/KDE5SalFrame.cxx +++ b/vcl/unx/kde5/KDE5SalFrame.cxx @@ -334,28 +334,4 @@ void KDE5SalFrame::ReleaseGraphics( SalGraphics* pSalGraph ) m_bGraphicsInUse = false; } -void KDE5SalFrame::updateGraphics( bool bClear ) -{ -vcl::Window* pWindow = GetWindow(); -for( int i = 0; i < nMaxGraphics; i++ ) -{ -/*if( m_aGraphics[i].bInUse ) -m_aGraphics[i].pGraphics->SetDrawable( aDrawable, GetScreenNumber() );*/ -} -} - -cairo_t* KDE5SalFrame::getCairoContext() const -{ -for( int i = 0; i < nMaxGraphics; i++ ) -{ -if( ! m_aGraphics[i].bInUse ) -{ -cairo_t* cr = cairo_create( m_aGraphics[i].pSurface ); -assert(cr); -return cr; -} -} -} - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx index 2066b443e19f..64f43867a8d4 100644 --- a/vcl/unx/kde5/KDE5SalFrame.hxx +++ b/vcl/unx/kde5/KDE5SalFrame.hxx @@ -20,7 +20,6 @@ #pragma once #include -#include #undef Status @@ -36,18 +35,6 @@ class KDE5SalGraphics; class KDE5SalFrame : public Qt5Frame { private: -static const int nMaxGraphics = 2; - -struct GraphicsHolder -{ -std::unique_ptr pGraphics; -bool bInUse; -cairo_surface_t* pSurface; - -GraphicsHolder() : bInUse( false ), pSurface(nullptr) {} -}; - -GraphicsHolder m_aGraphics[ nMaxGraphics ]; std::unique_ptr m_pKDE5Graphics; bool m_bGraphicsInUse; @@ -56,7 +43,6 @@ class KDE5SalFrame : public Qt5Frame virtual SalGraphics* AcquireGraphics() override; virtual void ReleaseGraphics( SalGraphics *pGraphics ) override; -void updateGraphics( bool bClear ); virtual void UpdateSettings( AllSettings& rSettings ) override; virtual void DrawMenuBar() override { return; } @@ -68,8 +54,6 @@ class KDE5SalFrame : public Qt5Frame virtual KeyIndicatorState GetIndicatorState() override { return KeyIndicatorState(); } virtual void SetScreenNumber( unsigned int ) override { return; } - -cairo_t* getCairoContext() const; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit a05e74491a78a91d791d3952e6bd53c82269253d Author: Katarina Behrens Date: Thu Apr 19 15:09:36 2018 +0200 Restore Acquire/ReleaseGraphics, use KDE5SalGraphics commented out most of KDE5SalGraphics code for the time being Change-Id: I73654bd8376a9648a462505702dcf284f46ef315 diff --git a/vcl/unx/kde5/KDE5SalFrame.cxx b/vcl/unx/kde5/KDE5SalFrame.cxx index ffee47165a37..0709a79e6fe6 100644 --- a/vcl/unx/kde5/KDE5SalFrame.cxx +++ b/vcl/unx/kde5/KDE5SalFrame.cxx @@ -49,6 +49,7 @@ KDE5SalFrame::KDE5SalFrame( KDE5SalFrame* pParent, SalFrameStyleFlags nState, bool bUseCairo ) :Qt5Frame( pParent, nState, bUseCairo ) +,m_bGraphicsInUse(false) { } @@ -310,6 +311,29 @@ void KDE5SalFrame::UpdateSettings( AllSettings& rSettings ) rSettings.SetStyleSettings( style ); } +SalGraphics* KDE5SalFrame::AcquireGraphics() +{ +if (m_bGraphicsInUse) +return nullptr; + +m_bGraphicsInUse = true; + +if ( !m_pKDE5Graphics.get() ) +{ +m_pKDE5Graphics.reset( new KDE5SalGraphics()); +Qt5Frame::InitSvpSalGraphics( m_pKDE5Graphics.get() ); +} + +return m_pKDE5Graphics.get(); +} + +void KDE5SalFrame::ReleaseGraphics( SalGraphics* pSalGraph ) +{ +(void)pSalGraph; +assert( pSalGraph == m_pKDE5Graphics.get() ); +m_bGraphicsInUse = false; +} + void KDE5SalFrame::updateGraphics( bool bClear ) { vcl::Window* pWindow = GetWindow(); diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx index c939141ec4e0..2066b443e19f 100644 --- a/vcl/unx/kde5/KDE5SalFrame.hxx +++ b/vcl/unx/kde5/KDE5SalFrame.hxx @@ -24,8 +24,8 @@ #undef Status -#include #include +#include #include #include "KDE5SalGraphics.hxx" @@ -48,12 +48,14 @@ class KDE5SalFrame : public Qt5Frame }; GraphicsHolder m_aGraphics[ nMaxGraphics ]; - -QWidget* m_pWindow; +std::unique_ptr m_pKDE5Graphics; +
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
Rebased ref, commits from common ancestor: commit 03b28bf39f4b41e1e0abf85dba15a24d358a06db Author: Katarina Behrens Date: Mon Apr 16 13:30:23 2018 +0200 Frames can now be closed by clicking top-right corner [x] Change-Id: I4f841bfd8fe819a322af1ecaa95d17273d3031ec diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx index 83077796298f..7e7ed8240802 100644 --- a/vcl/inc/qt5/Qt5Widget.hxx +++ b/vcl/inc/qt5/Qt5Widget.hxx @@ -53,6 +53,7 @@ class Qt5Widget : public QWidget virtual void resizeEvent(QResizeEvent*) override; virtual void showEvent(QShowEvent*) override; virtual void wheelEvent(QWheelEvent*) override; +virtual void closeEvent(QCloseEvent*) override; public: Qt5Widget(Qt5Frame& rFrame, QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 6b082eef1c1f..bb3ca8aaa44b 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -173,6 +173,11 @@ void Qt5Widget::showEvent(QShowEvent*) m_pFrame->CallCallback(SalEvent::Paint, &aPaintEvt); } +void Qt5Widget::closeEvent(QCloseEvent* /*pEvent*/) +{ +m_pFrame->CallCallback(SalEvent::Close, nullptr); +} + static sal_uInt16 GetKeyCode(int keyval) { sal_uInt16 nCode = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/inc vcl/qt5
vcl/inc/qt5/Qt5Widget.hxx |1 + vcl/qt5/Qt5Widget.cxx |5 + 2 files changed, 6 insertions(+) New commits: commit c06a42cffdb54e9a8399a293293f0e8111adc336 Author: Katarina Behrens Date: Mon Apr 16 13:30:23 2018 +0200 Frames can now be closed by clicking top-right corner [x] Change-Id: I4f841bfd8fe819a322af1ecaa95d17273d3031ec diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx index 83077796298f..7e7ed8240802 100644 --- a/vcl/inc/qt5/Qt5Widget.hxx +++ b/vcl/inc/qt5/Qt5Widget.hxx @@ -53,6 +53,7 @@ class Qt5Widget : public QWidget virtual void resizeEvent(QResizeEvent*) override; virtual void showEvent(QShowEvent*) override; virtual void wheelEvent(QWheelEvent*) override; +virtual void closeEvent(QCloseEvent*) override; public: Qt5Widget(Qt5Frame& rFrame, QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index 6b082eef1c1f..b52d48fbcb67 100644 --- a/vcl/qt5/Qt5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -173,6 +173,11 @@ void Qt5Widget::showEvent(QShowEvent*) m_pFrame->CallCallback(SalEvent::Paint, &aPaintEvt); } +void Qt5Widget::closeEvent(QCloseEvent* pEvent) +{ +m_pFrame->CallCallback(SalEvent::Close, nullptr); +} + static sal_uInt16 GetKeyCode(int keyval) { sal_uInt16 nCode = 0; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - 3 commits - vcl/unx
Rebased ref, commits from common ancestor: commit fcfea920058b32c455a7624bc5c6ccfec67159b6 Author: Katarina Behrens 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(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 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(GetDisplay()->GetXLib()); -pXLib->doStartup(); -} - -
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/unx
vcl/unx/kde5/KDE5SalInstance.cxx |6 -- vcl/unx/kde5/KDE5SalInstance.hxx |1 - 2 files changed, 7 deletions(-) New commits: commit 8c1d2df66aadcecb9add585307a4cad2fa3d19e1 Author: Katarina Behrens 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 #include #include -#include #include #include @@ -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..45a20e6cfaa2 100644 --- a/vcl/unx/kde5/KDE5SalInstance.hxx +++ b/vcl/unx/kde5/KDE5SalInstance.hxx @@ -19,7 +19,6 @@ #pragma once -#include #include #include "KDE5SalFrame.hxx" ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5+kde5' - vcl/qt5
vcl/qt5/Qt5Instance.cxx |4 1 file changed, 4 insertions(+) New commits: commit 5e99c65386159470461c6e77e8f56e7191a4cdd8 Author: Katarina Behrens Date: Wed Apr 11 18:24:55 2018 +0200 Qt5 plugin now identifies itself as such (in About dialog) Change-Id: Icdc3d8dd20469bc2b2ca6e94a1318f313b9a5aa9 diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 69acffb151dd..beab3ed902b8 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -47,6 +47,10 @@ Qt5Instance::Qt5Instance(SalYieldMutex* pMutex, bool bUseCairo) , m_postUserEventId(-1) , m_bUseCairo(bUseCairo) { +ImplSVData* pSVData = ImplGetSVData(); +delete pSVData->maAppData.mpToolkitName; +pSVData->maAppData.mpToolkitName = new OUString("qt5"); + m_postUserEventId = QEvent::registerEventType(); // this one needs to be blocking, so that the handling in main thread ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5' - 140 commits - animations/source basctl/source basic/source canvas/source chart2/source .clang-format comphelper/source config_host/config_qt5.h.i
Rebased ref, commits from common ancestor: commit 0b1e8399df0045fe900d5558afc8590114d4b922 Author: Jan-Marek Glogowski Date: Fri Nov 3 18:43:30 2017 +0100 QT5 fix build issues & cleanups 1. Linking problem on Windows due to Windows macros via include 2. Drop the custom MOC target for the old KF5 plugin 3. Correctly handle QT5 build without using QFont 4. ImplJobSetup is in the VL library, not the gen plugin Change-Id: Iad97b1b9b57a8c356aaa88178aff03d0c14558c7 diff --git a/vcl/CustomTarget_kf5_moc.mk b/vcl/CustomTarget_kf5_moc.mk deleted file mode 100644 index f636ef5d125c.. --- a/vcl/CustomTarget_kf5_moc.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -*- 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/. -# - -$(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kf5)) - -$(call gb_CustomTarget_get_target,vcl/unx/kf5) : \ - $(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/Kf5Timer.moc \ - $(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/Kf5Widget.moc \ - -$(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/%.moc : \ - $(SRCDIR)/vcl/unx/kf5/%.hxx \ - | $(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/.dir - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1) - $(MOC5) $< -o $@ - -# vim: set noet sw=4: diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx index a44fee5cfe10..a8808bac8414 100644 --- a/vcl/inc/CommonSalLayout.hxx +++ b/vcl/inc/CommonSalLayout.hxx @@ -45,13 +45,6 @@ class Qt5Font; class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout { -#if ENABLE_QT5 -friend hb_blob_t* getFontTable(hb_face_t*, hb_tag_t, void*); -explicitCommonSalLayout(const FontSelectPattern &rFSP, -FreetypeFont *pFreetypeFont, -Qt5Font *pFont, bool bUseQt5); -#endif - hb_font_t* mpHbFont; const FontSelectPattern& mrFontSelData; css::uno::Reference mxBreak; @@ -84,19 +77,23 @@ class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout public: #if defined(_WIN32) explicitCommonSalLayout(HDC, WinFontInstance&, const WinFontFace&); -const FontSelectPattern& getFontSelData() const { return mrFontSelData; }; +const FontSelectPattern& getFontSelData() const { return mrFontSelData; } HFONT getHFONT() const { return mhFont; } WinFontInstance&getWinFontInstance() const { return mrWinFontInstance; } boolhasHScale() const; #elif defined(MACOSX) || defined(IOS) explicitCommonSalLayout(const CoreTextStyle&); -const CoreTextStyle&getFontData() const { return mrCoreTextStyle; }; +const CoreTextStyle&getFontData() const { return mrCoreTextStyle; } #else explicitCommonSalLayout(FreetypeFont&); -const FreetypeFont* getFreetypeFont() const { return mpFreetypeFont; }; +const FreetypeFont* getFreetypeFont() const { return mpFreetypeFont; } #if ENABLE_QT5 +explicitCommonSalLayout(const FontSelectPattern &rFSP, +FreetypeFont *pFreetypeFont, +Qt5Font *pFont, bool bUseQt5); explicitCommonSalLayout(Qt5Font&); -const Qt5Font* getQt5Font() const { return mpQFont; }; +const Qt5Font* getQt5Font() const { return mpQFont; } +booluseQt5() const { return mbUseQt5; } #endif #endif diff --git a/vcl/inc/jobset.h b/vcl/inc/jobset.h index dc04e9a54bd1..5ff4c38e9a24 100644 --- a/vcl/inc/jobset.h +++ b/vcl/inc/jobset.h @@ -29,7 +29,7 @@ #define JOBSETUP_SYSTEM_UNIX3 #define JOBSETUP_SYSTEM_MAC 4 -class VCL_PLUGIN_PUBLIC ImplJobSetup +class VCL_DLLPUBLIC ImplJobSetup { private: sal_uInt16 mnSystem; //< System - JOBSETUP_SYSTEM_ diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index a368630ebd74..1a9157ca9747 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -21,7 +21,6 @@ #define INCLUDED_VCL_INC_SALGDI_HXX #include -#include #include "impfontmetricdata.hxx" #include "salgdiimpl.hxx" @@ -46,6 +45,7 @@ class OpenGLContext; class OutputDevice; class FreetypeFont; class CommonSalLayout; +struct SystemGraphicsData; #if ENABLE_CAIRO_CANVAS struct SystemFontData; diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx index df183dba2056..c512628862fa 100644 --- a/vcl/inc/unx/glyphcache.hxx +++ b/vcl/inc/unx/glyphcache.hxx @@ -133,7 +133,7 @@ public: const FontSelectPattern& GetFontSelData() co
[Libreoffice-commits] core.git: Branch 'feature/qt5' - vcl/CustomTarget_kf5_moc.mk vcl/inc vcl/source vcl/unx
vcl/CustomTarget_kf5_moc.mk| 22 vcl/inc/CommonSalLayout.hxx| 19 -- vcl/inc/jobset.h |2 - vcl/inc/salgdi.hxx |2 - vcl/inc/unx/glyphcache.hxx |2 - vcl/source/gdi/CommonSalLayout.cxx | 45 + vcl/unx/generic/glyphs/freetype_glyphcache.cxx |2 - 7 files changed, 37 insertions(+), 57 deletions(-) New commits: commit 868d27410d3aae8cd0a8aae70be201b671df091b Author: Jan-Marek Glogowski Date: Fri Nov 3 18:43:30 2017 +0100 Fix multiple problems 1. Linking problem on Windows due to Windows macros via include 2. Drop the custom MOC target for the old KF5 plugin 3. Correctly handle QT5 build without using QFont 4. ImplJobSetup is in the VL library, not the gen plugin Change-Id: Iad97b1b9b57a8c356aaa88178aff03d0c14558c7 diff --git a/vcl/CustomTarget_kf5_moc.mk b/vcl/CustomTarget_kf5_moc.mk deleted file mode 100644 index f636ef5d125c.. --- a/vcl/CustomTarget_kf5_moc.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -*- 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/. -# - -$(eval $(call gb_CustomTarget_CustomTarget,vcl/unx/kf5)) - -$(call gb_CustomTarget_get_target,vcl/unx/kf5) : \ - $(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/Kf5Timer.moc \ - $(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/Kf5Widget.moc \ - -$(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/%.moc : \ - $(SRCDIR)/vcl/unx/kf5/%.hxx \ - | $(call gb_CustomTarget_get_workdir,vcl/unx/kf5)/.dir - $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1) - $(MOC5) $< -o $@ - -# vim: set noet sw=4: diff --git a/vcl/inc/CommonSalLayout.hxx b/vcl/inc/CommonSalLayout.hxx index a44fee5cfe10..a8808bac8414 100644 --- a/vcl/inc/CommonSalLayout.hxx +++ b/vcl/inc/CommonSalLayout.hxx @@ -45,13 +45,6 @@ class Qt5Font; class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout { -#if ENABLE_QT5 -friend hb_blob_t* getFontTable(hb_face_t*, hb_tag_t, void*); -explicitCommonSalLayout(const FontSelectPattern &rFSP, -FreetypeFont *pFreetypeFont, -Qt5Font *pFont, bool bUseQt5); -#endif - hb_font_t* mpHbFont; const FontSelectPattern& mrFontSelData; css::uno::Reference mxBreak; @@ -84,19 +77,23 @@ class VCL_DLLPUBLIC CommonSalLayout : public GenericSalLayout public: #if defined(_WIN32) explicitCommonSalLayout(HDC, WinFontInstance&, const WinFontFace&); -const FontSelectPattern& getFontSelData() const { return mrFontSelData; }; +const FontSelectPattern& getFontSelData() const { return mrFontSelData; } HFONT getHFONT() const { return mhFont; } WinFontInstance&getWinFontInstance() const { return mrWinFontInstance; } boolhasHScale() const; #elif defined(MACOSX) || defined(IOS) explicitCommonSalLayout(const CoreTextStyle&); -const CoreTextStyle&getFontData() const { return mrCoreTextStyle; }; +const CoreTextStyle&getFontData() const { return mrCoreTextStyle; } #else explicitCommonSalLayout(FreetypeFont&); -const FreetypeFont* getFreetypeFont() const { return mpFreetypeFont; }; +const FreetypeFont* getFreetypeFont() const { return mpFreetypeFont; } #if ENABLE_QT5 +explicitCommonSalLayout(const FontSelectPattern &rFSP, +FreetypeFont *pFreetypeFont, +Qt5Font *pFont, bool bUseQt5); explicitCommonSalLayout(Qt5Font&); -const Qt5Font* getQt5Font() const { return mpQFont; }; +const Qt5Font* getQt5Font() const { return mpQFont; } +booluseQt5() const { return mbUseQt5; } #endif #endif diff --git a/vcl/inc/jobset.h b/vcl/inc/jobset.h index dc04e9a54bd1..5ff4c38e9a24 100644 --- a/vcl/inc/jobset.h +++ b/vcl/inc/jobset.h @@ -29,7 +29,7 @@ #define JOBSETUP_SYSTEM_UNIX3 #define JOBSETUP_SYSTEM_MAC 4 -class VCL_PLUGIN_PUBLIC ImplJobSetup +class VCL_DLLPUBLIC ImplJobSetup { private: sal_uInt16 mnSystem; //< System - JOBSETUP_SYSTEM_ diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index a368630ebd74..1a9157ca9747 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -21,7 +21,6 @@ #define INCLUDED_VCL_INC_SALGDI_HXX #include -#include #include "impfontmetricdata.hxx" #inclu
[Libreoffice-commits] core.git: Branch 'feature/qt5' - 42 commits - bridges/source .clang-format config_host/config_qt5.h.in config_host.mk.in configure.ac connectivity/source cppcanvas/source desktop
Rebased ref, commits from common ancestor: commit 403668b2c19f7e9b244e970e197f45f88a1e553b Author: Thorsten Behrens Date: Thu Nov 2 01:49:00 2017 +0100 QT5 fixup non-qt5 build Change-Id: Ifea73d81ba3863fd6a99453cb38303eb729f6ff4 diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 132766753174..936369983d14 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -70,8 +70,8 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData } #else const char* pBuffer = nullptr; -CommonSalLayout *pLayout = static_cast( pUserData ); #if ENABLE_QT5 +CommonSalLayout *pLayout = static_cast( pUserData ); QByteArray aTable; if ( pLayout->mbUseQt5 ) { @@ -83,8 +83,9 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData else #endif { +FreetypeFont* pFont = static_cast(pUserData); pBuffer = reinterpret_cast( -pLayout->mpFreetypeFont->GetTable(pTagName, &nLength) ); +pFont->GetTable(pTagName, &nLength) ); } #endif @@ -256,41 +257,44 @@ CommonSalLayout::CommonSalLayout(const CoreTextStyle& rCoreTextStyle) #else +#if ENABLE_QT5 CommonSalLayout::CommonSalLayout(const FontSelectPattern &rFSP, FreetypeFont *pFreetypeFont, Qt5Font *pQt5Font, bool bUseQt5) : mrFontSelData(rFSP) , mpFreetypeFont(pFreetypeFont) -#if ENABLE_QT5 , mbUseQt5(bUseQt5) , mpQFont(pQt5Font) -#endif , mpVertGlyphs(nullptr) { -#if ENABLE_QT5 if (mbUseQt5) mpHbFont = mpQFont->GetHbFont(); else -#endif mpHbFont = mpFreetypeFont->GetHbFont(); if (!mpHbFont) { hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, this, nullptr); mpHbFont = createHbFont(pHbFace); -#if ENABLE_QT5 if (mbUseQt5) mpQFont->SetHbFont(mpHbFont); else -#endif mpFreetypeFont->SetHbFont(mpHbFont); } } +#endif -CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) -: CommonSalLayout(rFreetypeFont.GetFontSelData(), - &rFreetypeFont, nullptr, false) +CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) : +mrFontSelData(rFreetypeFont.GetFontSelData()) +, mpFreetypeFont(&rFreetypeFont) +, mpVertGlyphs(nullptr) { +mpHbFont = rFreetypeFont.GetHbFont(); +if (!mpHbFont) +{ +hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, &rFreetypeFont, nullptr); +mpHbFont = createHbFont(pHbFace); +} } #if ENABLE_QT5 commit e5b57ef74a9e6d8aba21d4b633980ed06774e5e9 Author: Jan-Marek Glogowski Date: Mon Oct 30 16:11:09 2017 +0100 QT5 implement Graphics damage tracking Since we implement SalGraphics handling like the gtk3 backend, we need damage tracking to queue updates. Since there is no native damage tracking in Qt5, we have to log the damage in our subclassed QPainter, which will queue an update on destruction. Change-Id: Ife17770750a5be9959c2fc2633b422908d196869 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index d82b7d2fcd31..fba78d738883 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -91,6 +91,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Instance \ vcl/qt5/Qt5Instance_Print \ vcl/qt5/Qt5Object \ +vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ diff --git a/vcl/qt5/Qt5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx index 676e9e54664e..eae47c5f21e9 100644 --- a/vcl/qt5/Qt5Graphics.cxx +++ b/vcl/qt5/Qt5Graphics.cxx @@ -18,7 +18,11 @@ */ #include "Qt5Graphics.hxx" + #include "Qt5Frame.hxx" +#include "Qt5Painter.hxx" + +#include #include @@ -46,30 +50,6 @@ Qt5Graphics::~Qt5Graphics() delete m_pTextStyle[ i ]; } -void Qt5Graphics::PreparePainter( QPainter& rPainter, sal_uInt8 nTransparency ) -{ -if ( m_pQImage ) -rPainter.begin( m_pQImage ); -else -{ -assert( dynamic_cast< QPaintDevice* >( m_pFrame->GetQWidget() ) ); -rPainter.begin( m_pFrame->GetQWidget() ); -} -if ( !m_aClipPath.isEmpty() ) -rPainter.setClipPath( m_aClipPath ); -else -rPainter.setClipRegion( m_aClipRegion ); -if ( SALCOLOR_NONE != m_aLineColor ) -{ -QColor aColor = QColor::fromRgb( QRgb( m_aLineColor ) ); -aColor.setAlpha( nTransparency ); -rPainter.setPen( aColor ); -} -else -rPainter.setPen( Qt::NoPen ); -rPainter.setCompositionMode( m_eCompositionMode ); -} - void Qt5Graphics::ChangeQImage( QImage *pQImage ) { m_pQImage = pQImage; diff --git a/vcl/qt5/Qt5Graphics.hxx b/vcl/qt5/Qt5Graphics.hxx index 52c1c90ec5df..9ffe2c47e461 100644 --- a/vcl/qt5/Qt5Graphics.hxx +
[Libreoffice-commits] core.git: Branch 'feature/qt5' - 64 commits - compilerplugins/clang config_host/config_qt5.h.in config_host.mk.in configmgr/source configure.ac desktop/unx extensions/source exte
Rebased ref, commits from common ancestor: commit abd62d0b9320b492ccd47831e7215865688c6811 Author: Thorsten Behrens Date: Thu Nov 2 01:49:00 2017 +0100 QT5 fixup non-qt5 build Change-Id: Ifea73d81ba3863fd6a99453cb38303eb729f6ff4 diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 132766753174..936369983d14 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -70,8 +70,8 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData } #else const char* pBuffer = nullptr; -CommonSalLayout *pLayout = static_cast( pUserData ); #if ENABLE_QT5 +CommonSalLayout *pLayout = static_cast( pUserData ); QByteArray aTable; if ( pLayout->mbUseQt5 ) { @@ -83,8 +83,9 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData else #endif { +FreetypeFont* pFont = static_cast(pUserData); pBuffer = reinterpret_cast( -pLayout->mpFreetypeFont->GetTable(pTagName, &nLength) ); +pFont->GetTable(pTagName, &nLength) ); } #endif @@ -256,41 +257,44 @@ CommonSalLayout::CommonSalLayout(const CoreTextStyle& rCoreTextStyle) #else +#if ENABLE_QT5 CommonSalLayout::CommonSalLayout(const FontSelectPattern &rFSP, FreetypeFont *pFreetypeFont, Qt5Font *pQt5Font, bool bUseQt5) : mrFontSelData(rFSP) , mpFreetypeFont(pFreetypeFont) -#if ENABLE_QT5 , mbUseQt5(bUseQt5) , mpQFont(pQt5Font) -#endif , mpVertGlyphs(nullptr) { -#if ENABLE_QT5 if (mbUseQt5) mpHbFont = mpQFont->GetHbFont(); else -#endif mpHbFont = mpFreetypeFont->GetHbFont(); if (!mpHbFont) { hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, this, nullptr); mpHbFont = createHbFont(pHbFace); -#if ENABLE_QT5 if (mbUseQt5) mpQFont->SetHbFont(mpHbFont); else -#endif mpFreetypeFont->SetHbFont(mpHbFont); } } +#endif -CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) -: CommonSalLayout(rFreetypeFont.GetFontSelData(), - &rFreetypeFont, nullptr, false) +CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) : +mrFontSelData(rFreetypeFont.GetFontSelData()) +, mpFreetypeFont(&rFreetypeFont) +, mpVertGlyphs(nullptr) { +mpHbFont = rFreetypeFont.GetHbFont(); +if (!mpHbFont) +{ +hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, &rFreetypeFont, nullptr); +mpHbFont = createHbFont(pHbFace); +} } #if ENABLE_QT5 commit e4ff3a34d90100d1f7c3eed86299b2f7f047cf3d Author: Jan-Marek Glogowski Date: Mon Oct 30 16:11:09 2017 +0100 QT5 implement Graphics damage tracking Since we implement SalGraphics handling like the gtk3 backend, we need damage tracking to queue updates. Since there is no native damage tracking in Qt5, we have to log the damage in our subclassed QPainter, which will queue an update on destruction. Change-Id: Ife17770750a5be9959c2fc2633b422908d196869 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index d82b7d2fcd31..fba78d738883 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -91,6 +91,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Instance \ vcl/qt5/Qt5Instance_Print \ vcl/qt5/Qt5Object \ +vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ diff --git a/vcl/qt5/Qt5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx index 676e9e54664e..eae47c5f21e9 100644 --- a/vcl/qt5/Qt5Graphics.cxx +++ b/vcl/qt5/Qt5Graphics.cxx @@ -18,7 +18,11 @@ */ #include "Qt5Graphics.hxx" + #include "Qt5Frame.hxx" +#include "Qt5Painter.hxx" + +#include #include @@ -46,30 +50,6 @@ Qt5Graphics::~Qt5Graphics() delete m_pTextStyle[ i ]; } -void Qt5Graphics::PreparePainter( QPainter& rPainter, sal_uInt8 nTransparency ) -{ -if ( m_pQImage ) -rPainter.begin( m_pQImage ); -else -{ -assert( dynamic_cast< QPaintDevice* >( m_pFrame->GetQWidget() ) ); -rPainter.begin( m_pFrame->GetQWidget() ); -} -if ( !m_aClipPath.isEmpty() ) -rPainter.setClipPath( m_aClipPath ); -else -rPainter.setClipRegion( m_aClipRegion ); -if ( SALCOLOR_NONE != m_aLineColor ) -{ -QColor aColor = QColor::fromRgb( QRgb( m_aLineColor ) ); -aColor.setAlpha( nTransparency ); -rPainter.setPen( aColor ); -} -else -rPainter.setPen( Qt::NoPen ); -rPainter.setCompositionMode( m_eCompositionMode ); -} - void Qt5Graphics::ChangeQImage( QImage *pQImage ) { m_pQImage = pQImage; diff --git a/vcl/qt5/Qt5Graphics.hxx b/vcl/qt5/Qt5Graphics.hxx index 52c1c90ec5df..9ffe2c47e461 100644 --- a/vcl/qt5/Qt5Graphics.hxx +
[Libreoffice-commits] core.git: Branch 'feature/qt5' - 33 commits - config_host/config_qt5.h.in config_host.mk.in configure.ac forms/source framework/inc include/sal include/svx RepositoryExternal.mk
Rebased ref, commits from common ancestor: commit 47b82eb72d89db9081cca17a43ad4b091d565e56 Author: Thorsten Behrens Date: Thu Nov 2 01:49:00 2017 +0100 QT5 fixup non-qt5 build Change-Id: Ifea73d81ba3863fd6a99453cb38303eb729f6ff4 diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 132766753174..936369983d14 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -70,8 +70,8 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData } #else const char* pBuffer = nullptr; -CommonSalLayout *pLayout = static_cast( pUserData ); #if ENABLE_QT5 +CommonSalLayout *pLayout = static_cast( pUserData ); QByteArray aTable; if ( pLayout->mbUseQt5 ) { @@ -83,8 +83,9 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData else #endif { +FreetypeFont* pFont = static_cast(pUserData); pBuffer = reinterpret_cast( -pLayout->mpFreetypeFont->GetTable(pTagName, &nLength) ); +pFont->GetTable(pTagName, &nLength) ); } #endif @@ -256,41 +257,44 @@ CommonSalLayout::CommonSalLayout(const CoreTextStyle& rCoreTextStyle) #else +#if ENABLE_QT5 CommonSalLayout::CommonSalLayout(const FontSelectPattern &rFSP, FreetypeFont *pFreetypeFont, Qt5Font *pQt5Font, bool bUseQt5) : mrFontSelData(rFSP) , mpFreetypeFont(pFreetypeFont) -#if ENABLE_QT5 , mbUseQt5(bUseQt5) , mpQFont(pQt5Font) -#endif , mpVertGlyphs(nullptr) { -#if ENABLE_QT5 if (mbUseQt5) mpHbFont = mpQFont->GetHbFont(); else -#endif mpHbFont = mpFreetypeFont->GetHbFont(); if (!mpHbFont) { hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, this, nullptr); mpHbFont = createHbFont(pHbFace); -#if ENABLE_QT5 if (mbUseQt5) mpQFont->SetHbFont(mpHbFont); else -#endif mpFreetypeFont->SetHbFont(mpHbFont); } } +#endif -CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) -: CommonSalLayout(rFreetypeFont.GetFontSelData(), - &rFreetypeFont, nullptr, false) +CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) : +mrFontSelData(rFreetypeFont.GetFontSelData()) +, mpFreetypeFont(&rFreetypeFont) +, mpVertGlyphs(nullptr) { +mpHbFont = rFreetypeFont.GetHbFont(); +if (!mpHbFont) +{ +hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, &rFreetypeFont, nullptr); +mpHbFont = createHbFont(pHbFace); +} } #if ENABLE_QT5 commit 4bceffaa07ba464a7e9d083e989981ba1d896f85 Author: Jan-Marek Glogowski Date: Mon Oct 30 16:11:09 2017 +0100 QT5 implement Graphics damage tracking Since we implement SalGraphics handling like the gtk3 backend, we need damage tracking to queue updates. Since there is no native damage tracking in Qt5, we have to log the damage in our subclassed QPainter, which will queue an update on destruction. Change-Id: Ife17770750a5be9959c2fc2633b422908d196869 diff --git a/vcl/Library_vclplug_qt5.mk b/vcl/Library_vclplug_qt5.mk index d82b7d2fcd31..fba78d738883 100644 --- a/vcl/Library_vclplug_qt5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -91,6 +91,7 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ vcl/qt5/Qt5Instance \ vcl/qt5/Qt5Instance_Print \ vcl/qt5/Qt5Object \ +vcl/qt5/Qt5Painter \ vcl/qt5/Qt5Printer \ vcl/qt5/Qt5Timer \ vcl/qt5/Qt5Tools \ diff --git a/vcl/qt5/Qt5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx index 676e9e54664e..eae47c5f21e9 100644 --- a/vcl/qt5/Qt5Graphics.cxx +++ b/vcl/qt5/Qt5Graphics.cxx @@ -18,7 +18,11 @@ */ #include "Qt5Graphics.hxx" + #include "Qt5Frame.hxx" +#include "Qt5Painter.hxx" + +#include #include @@ -46,30 +50,6 @@ Qt5Graphics::~Qt5Graphics() delete m_pTextStyle[ i ]; } -void Qt5Graphics::PreparePainter( QPainter& rPainter, sal_uInt8 nTransparency ) -{ -if ( m_pQImage ) -rPainter.begin( m_pQImage ); -else -{ -assert( dynamic_cast< QPaintDevice* >( m_pFrame->GetQWidget() ) ); -rPainter.begin( m_pFrame->GetQWidget() ); -} -if ( !m_aClipPath.isEmpty() ) -rPainter.setClipPath( m_aClipPath ); -else -rPainter.setClipRegion( m_aClipRegion ); -if ( SALCOLOR_NONE != m_aLineColor ) -{ -QColor aColor = QColor::fromRgb( QRgb( m_aLineColor ) ); -aColor.setAlpha( nTransparency ); -rPainter.setPen( aColor ); -} -else -rPainter.setPen( Qt::NoPen ); -rPainter.setCompositionMode( m_eCompositionMode ); -} - void Qt5Graphics::ChangeQImage( QImage *pQImage ) { m_pQImage = pQImage; diff --git a/vcl/qt5/Qt5Graphics.hxx b/vcl/qt5/Qt5Graphics.hxx index 52c1c90ec5df..9ffe2c47e461 100644 --- a/vcl/qt5/Qt5Graphics.hxx +
[Libreoffice-commits] core.git: Branch 'feature/qt5' - 139 commits - basctl/source basegfx/source basic/source canvas/source chart2/source codemaker/source compilerplugins/clang config_host/config_qt5
Rebased ref, commits from common ancestor: commit a341b4559c36227fb69eab56c1cfa0b057a09d2c Author: Thorsten Behrens Date: Thu Nov 2 01:49:00 2017 +0100 QT5 fixup non-qt5 build Change-Id: Ifea73d81ba3863fd6a99453cb38303eb729f6ff4 diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 132766753174..936369983d14 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -70,8 +70,8 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData } #else const char* pBuffer = nullptr; -CommonSalLayout *pLayout = static_cast( pUserData ); #if ENABLE_QT5 +CommonSalLayout *pLayout = static_cast( pUserData ); QByteArray aTable; if ( pLayout->mbUseQt5 ) { @@ -83,8 +83,9 @@ hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData else #endif { +FreetypeFont* pFont = static_cast(pUserData); pBuffer = reinterpret_cast( -pLayout->mpFreetypeFont->GetTable(pTagName, &nLength) ); +pFont->GetTable(pTagName, &nLength) ); } #endif @@ -256,41 +257,44 @@ CommonSalLayout::CommonSalLayout(const CoreTextStyle& rCoreTextStyle) #else +#if ENABLE_QT5 CommonSalLayout::CommonSalLayout(const FontSelectPattern &rFSP, FreetypeFont *pFreetypeFont, Qt5Font *pQt5Font, bool bUseQt5) : mrFontSelData(rFSP) , mpFreetypeFont(pFreetypeFont) -#if ENABLE_QT5 , mbUseQt5(bUseQt5) , mpQFont(pQt5Font) -#endif , mpVertGlyphs(nullptr) { -#if ENABLE_QT5 if (mbUseQt5) mpHbFont = mpQFont->GetHbFont(); else -#endif mpHbFont = mpFreetypeFont->GetHbFont(); if (!mpHbFont) { hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, this, nullptr); mpHbFont = createHbFont(pHbFace); -#if ENABLE_QT5 if (mbUseQt5) mpQFont->SetHbFont(mpHbFont); else -#endif mpFreetypeFont->SetHbFont(mpHbFont); } } +#endif -CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) -: CommonSalLayout(rFreetypeFont.GetFontSelData(), - &rFreetypeFont, nullptr, false) +CommonSalLayout::CommonSalLayout(FreetypeFont& rFreetypeFont) : +mrFontSelData(rFreetypeFont.GetFontSelData()) +, mpFreetypeFont(&rFreetypeFont) +, mpVertGlyphs(nullptr) { +mpHbFont = rFreetypeFont.GetHbFont(); +if (!mpHbFont) +{ +hb_face_t* pHbFace = hb_face_create_for_tables(getFontTable, &rFreetypeFont, nullptr); +mpHbFont = createHbFont(pHbFace); +} } #if ENABLE_QT5 commit 8d654277ef2c81fb89cbb18d74c89631593b3937 Author: Thorsten Behrens Date: Thu Nov 2 01:46:38 2017 +0100 vcl: fix dbg_util build after enum class change Fixup after 74ab2a686144545255a2f07dde3f14f66f37753e Change-Id: I57492bdee7cc4d3676b476a2a867211e5aa0bd13 diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index d9c21bb2b998..d8bbd11e4b50 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -782,12 +782,12 @@ PPDParser::PPDParser( const OUString& rFile ) : char const* pSetupType = ""; switch( pKey->m_eSetupType ) { -case PPDKey::ExitServer:pSetupType = "ExitServer";break; -case PPDKey::Prolog:pSetupType = "Prolog";break; -case PPDKey::DocumentSetup: pSetupType = "DocumentSetup";break; -case PPDKey::PageSetup: pSetupType = "PageSetup";break; -case PPDKey::JCLSetup: pSetupType = "JCLSetup";break; -case PPDKey::AnySetup: pSetupType = "AnySetup";break; +case PPDKey::SetupType::ExitServer:pSetupType = "ExitServer";break; +case PPDKey::SetupType::Prolog:pSetupType = "Prolog";break; +case PPDKey::SetupType::DocumentSetup: pSetupType = "DocumentSetup";break; +case PPDKey::SetupType::PageSetup: pSetupType = "PageSetup";break; +case PPDKey::SetupType::JCLSetup: pSetupType = "JCLSetup";break; +case PPDKey::SetupType::AnySetup: pSetupType = "AnySetup";break; default: break; }; SAL_INFO("vcl.unx.print", "\t\"" << pKey->getKey() << "\" (" commit 1bc785dd7a79f46d3a616cad26842bd0850841fb Author: Jan-Marek Glogowski Date: Mon Oct 30 16:11:09 2017 +0100 QT5 implement Graphics damage tracking Since we implement SalGraphics handling like the gtk3 backend, we need damage tracking to queue updates. Since there is no native damage tracking in Qt5, we have to log the damage in our subclassed QPainter, which will queue an update on destruction. Change-Id: Ife17770750a5be9959c2fc2633b422908d196869 diff --git a/vcl/Lib
[Libreoffice-commits] core.git: Branch 'feature/qt5' - 0 commits -
Rebased ref, commits from common ancestor: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/qt5' -
0 files changed New commits: commit 27b757bd1f848e69ebfc4068e99c7898a00e4a2d Author: Thorsten Behrens Date: Wed Nov 1 00:29:09 2017 +0100 Trigger CI Change-Id: I5680ac9f706af4e3df22c9105e2405c2c474caf6 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits