diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-10-30 18:45:46 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-11-06 12:05:32 +0100 |
commit | 2ffb83daa4358aaad0cba7ddb67847282ac6fcce (patch) | |
tree | 2bf819492eb68134e8678e8138c983c57845e7e8 | |
parent | bc00fcc0a05ce2fa9f0e01a291a6917c3630cfab (diff) |
QT5 rename from KF5
Move out of unx, as this will eventually compile on other
OS platforms. At least currently it doesn't contain platform
dependant code.
Change-Id: Iea0bebf574201881ea158381fe7ba8af2a9a6488
-rw-r--r-- | Repository.mk | 2 | ||||
-rw-r--r-- | RepositoryExternal.mk | 18 | ||||
-rw-r--r-- | config_host.mk.in | 1 | ||||
-rw-r--r-- | configure.ac | 37 | ||||
-rw-r--r-- | include/sal/log-areas.dox | 2 | ||||
-rw-r--r-- | scp2/InstallScript_setup_osl.mk | 2 | ||||
-rw-r--r-- | scp2/Module_scp2.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/CppunitTest.mk | 2 | ||||
-rw-r--r-- | sysui/CustomTarget_share.mk | 2 | ||||
-rw-r--r-- | vcl/CustomTarget_qt5_moc.mk | 23 | ||||
-rw-r--r-- | vcl/Library_vclplug_qt5.mk (renamed from vcl/Library_vclplug_kf5.mk) | 72 | ||||
-rw-r--r-- | vcl/Module_vcl.mk | 6 | ||||
-rw-r--r-- | vcl/inc/unx/gendata.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/vclpluginapi.h | 6 | ||||
-rw-r--r-- | vcl/qt5/Qt5Bitmap.cxx (renamed from vcl/unx/kf5/Kf5Bitmap.cxx) | 48 | ||||
-rw-r--r-- | vcl/qt5/Qt5Bitmap.hxx (renamed from vcl/unx/kf5/Kf5Bitmap.hxx) | 8 | ||||
-rw-r--r-- | vcl/qt5/Qt5Data.cxx (renamed from vcl/unx/kf5/Kf5Data.cxx) | 12 | ||||
-rw-r--r-- | vcl/qt5/Qt5Data.hxx (renamed from vcl/unx/kf5/Kf5Data.hxx) | 6 | ||||
-rw-r--r-- | vcl/qt5/Qt5FontFace.cxx (renamed from vcl/unx/kf5/Kf5FontFace.cxx) | 26 | ||||
-rw-r--r-- | vcl/qt5/Qt5FontFace.hxx (renamed from vcl/unx/kf5/Kf5FontFace.hxx) | 10 | ||||
-rw-r--r-- | vcl/qt5/Qt5Frame.cxx (renamed from vcl/unx/kf5/Kf5Frame.cxx) | 118 | ||||
-rw-r--r-- | vcl/qt5/Qt5Frame.hxx (renamed from vcl/unx/kf5/Kf5Frame.hxx) | 18 | ||||
-rw-r--r-- | vcl/qt5/Qt5Graphics.cxx (renamed from vcl/unx/kf5/Kf5Graphics.cxx) | 32 | ||||
-rw-r--r-- | vcl/qt5/Qt5Graphics.hxx (renamed from vcl/unx/kf5/Kf5Graphics.hxx) | 14 | ||||
-rw-r--r-- | vcl/qt5/Qt5Graphics_Controls.cxx (renamed from vcl/unx/kf5/Kf5Graphics_Controls.cxx) | 10 | ||||
-rw-r--r-- | vcl/qt5/Qt5Graphics_GDI.cxx (renamed from vcl/unx/kf5/Kf5Graphics_GDI.cxx) | 94 | ||||
-rw-r--r-- | vcl/qt5/Qt5Graphics_Text.cxx (renamed from vcl/unx/kf5/Kf5Graphics_Text.cxx) | 38 | ||||
-rw-r--r-- | vcl/qt5/Qt5Instance.cxx (renamed from vcl/unx/kf5/Kf5Instance.cxx) | 100 | ||||
-rw-r--r-- | vcl/qt5/Qt5Instance.hxx (renamed from vcl/unx/kf5/Kf5Instance.hxx) | 6 | ||||
-rw-r--r-- | vcl/qt5/Qt5Instance_Print.cxx (renamed from vcl/unx/kf5/Kf5Instance_Print.cxx) | 30 | ||||
-rw-r--r-- | vcl/qt5/Qt5Object.cxx (renamed from vcl/unx/kf5/Kf5Object.cxx) | 25 | ||||
-rw-r--r-- | vcl/qt5/Qt5Object.hxx (renamed from vcl/unx/kf5/Kf5Object.hxx) | 10 | ||||
-rw-r--r-- | vcl/qt5/Qt5Printer.cxx (renamed from vcl/unx/kf5/Kf5Printer.cxx) | 6 | ||||
-rw-r--r-- | vcl/qt5/Qt5Printer.hxx (renamed from vcl/unx/kf5/Kf5Printer.hxx) | 6 | ||||
-rw-r--r-- | vcl/qt5/Qt5Timer.cxx (renamed from vcl/unx/kf5/Kf5Timer.cxx) | 16 | ||||
-rw-r--r-- | vcl/qt5/Qt5Timer.hxx (renamed from vcl/unx/kf5/Kf5Timer.hxx) | 6 | ||||
-rw-r--r-- | vcl/qt5/Qt5Tools.hxx (renamed from vcl/unx/kf5/Kf5Tools.hxx) | 0 | ||||
-rw-r--r-- | vcl/qt5/Qt5VirtualDevice.cxx (renamed from vcl/unx/kf5/Kf5VirtualDevice.cxx) | 30 | ||||
-rw-r--r-- | vcl/qt5/Qt5VirtualDevice.hxx (renamed from vcl/unx/kf5/Kf5VirtualDevice.hxx) | 10 | ||||
-rw-r--r-- | vcl/qt5/Qt5Widget.cxx (renamed from vcl/unx/kf5/Kf5Widget.cxx) | 16 | ||||
-rw-r--r-- | vcl/qt5/Qt5Widget.hxx (renamed from vcl/unx/kf5/Kf5Widget.hxx) | 11 | ||||
-rw-r--r-- | vcl/qt5/tst_exclude_posted_events.hxx | 67 | ||||
-rw-r--r-- | vcl/qt5/tst_exclude_socket_notifiers.hxx | 80 |
43 files changed, 587 insertions, 443 deletions
diff --git a/Repository.mk b/Repository.mk index 1f5a1529c69e..a67ae41f77c4 100644 --- a/Repository.mk +++ b/Repository.mk @@ -290,7 +290,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,kde, \ $(if $(ENABLE_KDE4),kde4be1) \ $(if $(USING_X11), \ $(if $(ENABLE_KDE4),vclplug_kde4) \ - $(if $(ENABLE_KF5),vclplug_kf5) \ + $(if $(ENABLE_QT5),vclplug_qt5) \ ) \ )) diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 2fc8f3fbafb6..0e4c15b6ba5f 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -3066,20 +3066,20 @@ endef endif # ENABLE_KDE4 -ifeq ($(ENABLE_KF5),TRUE) +ifeq ($(ENABLE_QT5),TRUE) -define gb_LinkTarget__use_kf5 +define gb_LinkTarget__use_qt5 $(call gb_LinkTarget_set_include,$(1),\ - $(subst -isystem/,-isystem /,$(filter -I% -isystem%,$(subst -isystem /,-isystem/,$(KF5_CFLAGS)))) \ - $$(INCLUDE) \ + $(subst -isystem/,-isystem /,$(filter -I% -isystem%,$(subst -isystem /,-isystem/,$(QT5_CFLAGS)))) \ + $$(INCLUDE) \ ) $(call gb_LinkTarget_add_defs,$(1),\ - $(filter-out -I% -isystem%,$(subst -isystem /,-isystem/,$(KF5_CFLAGS))) \ + $(filter-out -I% -isystem%,$(subst -isystem /,-isystem/,$(QT5_CFLAGS))) \ ) $(call gb_LinkTarget_add_libs,$(1),\ - $(KF5_LIBS) \ + $(QT5_LIBS) \ ) ifeq ($(COM),GCC) @@ -3090,13 +3090,13 @@ endif endef -else # !ENABLE_KF5 +else # !ENABLE_QT5 -define gb_LinkTarget__use_kf5 +define gb_LinkTarget__use_qt5 endef -endif # ENABLE_KF5 +endif # ENABLE_QT5 # PYTHON # extra python_headers external because pyuno wrapper must not link python diff --git a/config_host.mk.in b/config_host.mk.in index 0d39b1f286fe..4ea5595baaaf 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -135,7 +135,6 @@ export ENABLE_GTK_PRINT=@ENABLE_GTK_PRINT@ export ENABLE_HEADLESS=@ENABLE_HEADLESS@ export ENABLE_JAVA=@ENABLE_JAVA@ export ENABLE_KDE4=@ENABLE_KDE4@ -export ENABLE_KF5=@ENABLE_KF5@ export ENABLE_LPSOLVE=@ENABLE_LPSOLVE@ export ENABLE_LTO=@ENABLE_LTO@ export ENABLE_LWP=@ENABLE_LWP@ diff --git a/configure.ac b/configure.ac index 12e805545853..6ee677e222a1 100644 --- a/configure.ac +++ b/configure.ac @@ -571,7 +571,6 @@ linux-gnu*|k*bsd*-gnu*) build_gstreamer_1_0=yes build_gstreamer_0_10=yes test_kde4=yes - test_kf5=yes test_qt5=yes if test "$enable_fuzzers" != yes; then test_freetype=yes @@ -666,7 +665,6 @@ freebsd*) build_gstreamer_1_0=yes build_gstreamer_0_10=yes test_kde4=yes - test_kf5=yes test_qt5=yes test_freetype=yes AC_MSG_CHECKING([the FreeBSD operating system release]) @@ -696,7 +694,6 @@ freebsd*) build_gstreamer_1_0=yes build_gstreamer_0_10=yes test_kde4=yes - test_kf5=yes test_qt5=yes test_freetype=yes PTHREAD_LIBS="-pthread -lpthread" @@ -723,7 +720,6 @@ dragonfly*) build_gstreamer_1_0=yes build_gstreamer_0_10=yes test_kde4=yes - test_kf5=yes test_qt5=yes test_freetype=yes PTHREAD_LIBS="-pthread" @@ -748,7 +744,6 @@ linux-android*) test_freetype=no test_gtk=no test_kde4=no - test_kf5=no test_qt5=no test_randr=no test_xrender=no @@ -1187,10 +1182,10 @@ AC_ARG_ENABLE(kde4, KDE4 are available.]), ,) -AC_ARG_ENABLE(kf5, - AS_HELP_STRING([--enable-kf5], - [Determines whether to use KF5 vclplug on platforms where Qt5 and - KF5 are available.]), +AC_ARG_ENABLE(qt5, + AS_HELP_STRING([--enable-qt5], + [Determines whether to use Qt5 vclplug on platforms where Qt5 is + available.]), ,) libo_FUZZ_ARG_ENABLE(gui, @@ -4516,7 +4511,6 @@ if test "$USING_X11" != TRUE; then build_gstreamer_1_0=no build_gstreamer_0_10=no test_kde4=no - test_kf5=no test_qt5=no enable_cairo_canvas=no fi @@ -9764,13 +9758,13 @@ if test "x$enable_kde4" = "xyes"; then fi AC_SUBST(ENABLE_KDE4) -ENABLE_KF5="" -if test "x$enable_kf5" = "xyes"; then - ENABLE_KF5="TRUE" - AC_DEFINE(ENABLE_KF5) - R="$R kf5" +ENABLE_QT5="" +if test "x$enable_qt5" = "xyes"; then + ENABLE_QT5="TRUE" + AC_DEFINE(ENABLE_QT5) + R="$R qt5" fi -AC_SUBST(ENABLE_KF5) +AC_SUBST(ENABLE_QT5) build_vcl_plugins="$R" if test -z "$build_vcl_plugins"; then @@ -10550,7 +10544,7 @@ if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then else qmake4_test_ver="`$QMAKE4 -v 2>&1 | sed -n -e '/^Using Qt version 4\./p'`" if test -z "$qmake4_test_ver"; then - AC_MSG_ERROR([Wrong qmake for Qt4 found. Please specify the root of your Qt installation by exporting QT5DIR before running "configure".]) + AC_MSG_ERROR([Wrong qmake for Qt4 found. Please specify the root of your Qt installation by exporting QT4DIR before running "configure".]) fi fi @@ -10761,7 +10755,6 @@ QT5_GLIB_CFLAGS="" QT5_GLIB_LIBS="" QT5_HAVE_GLIB="" if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \ - \( "$test_kf5" = "yes" -a "$ENABLE_KF5" = "TRUE" \) -o \ \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \) then qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes" @@ -10853,7 +10846,7 @@ the root of your Qt installation by exporting QT5DIR before running "configure". AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers]) # Prepare meta object data TSTBASE="tst_exclude_socket_notifiers" - TSTMOC="${SRC_ROOT}/vcl/unx/kde5/${TSTBASE}" + TSTMOC="${SRC_ROOT}/vcl/unx/qt5/${TSTBASE}" ln -fs "${TSTMOC}.hxx" $MOC5 "${TSTBASE}.hxx" -o "${TSTBASE}.moc" @@ -10885,7 +10878,7 @@ int main(int argc, char *argv[]) AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events]) # Prepare meta object data TSTBASE="tst_exclude_posted_events" - TSTMOC="${SRC_ROOT}/vcl/unx/kde5/${TSTBASE}" + TSTMOC="${SRC_ROOT}/vcl/unx/qt5/${TSTBASE}" ln -fs "${TSTMOC}.hxx" $MOC5 "${TSTBASE}.hxx" -o "${TSTBASE}.moc" @@ -10923,8 +10916,8 @@ int main(int argc, char *argv[]) CXX=$save_CXX AC_LANG_POP([C++]) ], - AC_MSG_WARN([[No Glib found, Qt5 support will not use native file pickers!]])) - + AC_MSG_WARN([[No Glib found, Qt5 support will not use native file pickers!]]) + ) fi AC_SUBST(QT5_CFLAGS) AC_SUBST(QT5_LIBS) diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 6f4bc1478ec3..dac4e7312efd 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -463,7 +463,6 @@ certain functionality. @li @c vcl.icontest @li @c vcl.kde4 - KDE4 @li @c vcl.kde5 - KDE5 -@li @c vcl.kf5 - KF5 @li @c vcl.layout - Widget layout @li @c vcl.lazydelete @li @c vcl.opengl @@ -471,6 +470,7 @@ certain functionality. @li @c vcl.osx.print @li @c vcl.pdfwriter @li @c vcl.plugadapt - the Unix/X11 backend plugin mechanism +@li @c vcl.qt5 - QT5 @li @c vcl.quartz @li @c vcl.schedule - scheduler / main-loop information @li @c vcl.schedule.deinit diff --git a/scp2/InstallScript_setup_osl.mk b/scp2/InstallScript_setup_osl.mk index a5b28135c62a..f362fe5cc102 100644 --- a/scp2/InstallScript_setup_osl.mk +++ b/scp2/InstallScript_setup_osl.mk @@ -35,7 +35,7 @@ $(eval $(call gb_InstallScript_use_modules,setup_osl,\ $(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\ scp2/gnome \ ) \ - $(if $(filter TRUE,$(ENABLE_KDE4) $(ENABLE_KF5)),\ + $(if $(filter TRUE,$(ENABLE_KDE4) $(ENABLE_QT5)),\ scp2/kde \ ) \ $(if $(filter TRUE,$(ENABLE_ONLINE_UPDATE)),\ diff --git a/scp2/Module_scp2.mk b/scp2/Module_scp2.mk index f8a7fb0669fe..847e35a6c269 100644 --- a/scp2/Module_scp2.mk +++ b/scp2/Module_scp2.mk @@ -39,7 +39,7 @@ $(eval $(call gb_Module_add_targets,scp2,\ $(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\ InstallModule_gnome \ ) \ - $(if $(filter TRUE,$(ENABLE_KDE4) $(ENABLE_KF5)),\ + $(if $(filter TRUE,$(ENABLE_KDE4) $(ENABLE_QT5)),\ InstallModule_kde \ ) \ )) diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index dbcbc97a9701..310d39ea61bb 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -227,7 +227,7 @@ $(call gb_CppunitTest_get_target,$(1)) : $(if $(filter $(2),$(true)),, \ $(if $(ENABLE_GTK),$(call gb_Library_get_target,vclplug_gtk)) \ $(if $(ENABLE_GTK3),$(call gb_Library_get_target,vclplug_gtk3)) \ $(if $(ENABLE_KDE4),$(call gb_Library_get_target,vclplug_kde4)) \ - $(if $(ENABLE_KF5),$(call gb_Library_get_target,vclplug_kf5)) \ + $(if $(ENABLE_QT5),$(call gb_Library_get_target,vclplug_qt5)) \ ) endif diff --git a/sysui/CustomTarget_share.mk b/sysui/CustomTarget_share.mk index 079c04686658..ebbd713c45b5 100644 --- a/sysui/CustomTarget_share.mk +++ b/sysui/CustomTarget_share.mk @@ -14,7 +14,7 @@ ifeq ($(ENABLE_GIO),TRUE) brand_URIPARAM := --urls else ifeq ($(ENABLE_KDE4),TRUE) brand_URIPARAM := --urls -else ifeq ($(ENABLE_KF5),TRUE) +else ifeq ($(ENABLE_QT5),TRUE) brand_URIPARAM := --urls else brand_URIPARAM := diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk new file mode 100644 index 000000000000..8d22eb6e9288 --- /dev/null +++ b/vcl/CustomTarget_qt5_moc.mk @@ -0,0 +1,23 @@ +# -*- 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/qt5)) + +$(call gb_CustomTarget_get_target,vcl/unx/qt5) : \ + $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Instance.moc \ + $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Timer.moc \ + $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Widget.moc \ + +$(call gb_CustomTarget_get_workdir,vcl/unx/qt5)/%.moc : \ + $(SRCDIR)/vcl/qt5/%.hxx \ + | $(call gb_CustomTarget_get_workdir,vcl/qt5)/.dir + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MOC,1) + $(MOC5) $< -o $@ + +# vim: set noet sw=4: diff --git a/vcl/Library_vclplug_kf5.mk b/vcl/Library_vclplug_qt5.mk index 72b03822dc6c..8274d90e8820 100644 --- a/vcl/Library_vclplug_kf5.mk +++ b/vcl/Library_vclplug_qt5.mk @@ -17,24 +17,24 @@ # the License at http://www.apache.org/licenses/LICENSE-2.0 . # -$(eval $(call gb_Library_Library,vclplug_kf5)) +$(eval $(call gb_Library_Library,vclplug_qt5)) -$(eval $(call gb_Library_set_warnings_not_errors,vclplug_kf5)) +$(eval $(call gb_Library_set_warnings_not_errors,vclplug_qt5)) -$(eval $(call gb_Library_use_custom_headers,vclplug_kf5,vcl/unx/kf5)) +$(eval $(call gb_Library_use_custom_headers,vclplug_qt5,vcl/qt5)) -$(eval $(call gb_Library_set_include,vclplug_kf5,\ +$(eval $(call gb_Library_set_include,vclplug_qt5,\ $$(INCLUDE) \ -I$(SRCDIR)/vcl/inc \ )) -$(eval $(call gb_Library_add_defs,vclplug_kf5,\ - -DVCLPLUG_KF5_IMPLEMENTATION \ +$(eval $(call gb_Library_add_defs,vclplug_qt5,\ + -DVCLPLUG_QT5_IMPLEMENTATION \ )) -$(eval $(call gb_Library_use_sdk_api,vclplug_kf5)) +$(eval $(call gb_Library_use_sdk_api,vclplug_qt5)) -$(eval $(call gb_Library_use_libraries,vclplug_kf5,\ +$(eval $(call gb_Library_use_libraries,vclplug_qt5,\ vclplug_gen \ vcl \ tl \ @@ -52,49 +52,49 @@ $(eval $(call gb_Library_use_libraries,vclplug_kf5,\ sal \ )) -$(eval $(call gb_Library_use_externals,vclplug_kf5,\ +$(eval $(call gb_Library_use_externals,vclplug_qt5,\ boost_headers \ icuuc \ - kf5 \ + qt5 \ epoxy \ )) +$(eval $(call gb_Library_add_defs,vclplug_qt5,\ + $(QT5_CFLAGS) \ +)) +$(eval $(call gb_Library_add_libs,vclplug_qt5,\ + $(QT5_LIBS) \ +)) + ifneq ($(QT5_HAVE_GLIB),) -$(eval $(call gb_Library_add_defs,vclplug_kf5,\ +$(eval $(call gb_Library_add_defs,vclplug_qt5,\ $(QT5_GLIB_CFLAGS) \ )) -$(eval $(call gb_Library_add_libs,vclplug_kf5,\ +$(eval $(call gb_Library_add_libs,vclplug_qt5,\ $(QT5_GLIB_LIBS) \ )) endif -$(eval $(call gb_Library_add_defs,vclplug_kf5,\ - $(KF5_CFLAGS) \ -)) -$(eval $(call gb_Library_add_libs,vclplug_kf5,\ - $(KF5_LIBS) \ -)) - -$(eval $(call gb_Library_add_exception_objects,vclplug_kf5,\ - vcl/unx/kf5/Kf5Bitmap \ - vcl/unx/kf5/Kf5Data \ - vcl/unx/kf5/Kf5Frame \ - vcl/unx/kf5/Kf5FontFace \ - vcl/unx/kf5/Kf5Graphics \ - vcl/unx/kf5/Kf5Graphics_Controls \ - vcl/unx/kf5/Kf5Graphics_GDI \ - vcl/unx/kf5/Kf5Graphics_Text \ - vcl/unx/kf5/Kf5Instance \ - vcl/unx/kf5/Kf5Instance_Print \ - vcl/unx/kf5/Kf5Object \ - vcl/unx/kf5/Kf5Printer \ - vcl/unx/kf5/Kf5Timer \ - vcl/unx/kf5/Kf5VirtualDevice \ - vcl/unx/kf5/Kf5Widget \ +$(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\ + vcl/qt5/Qt5Bitmap \ + vcl/qt5/Qt5Data \ + vcl/qt5/Qt5Frame \ + vcl/qt5/Qt5FontFace \ + vcl/qt5/Qt5Graphics \ + vcl/qt5/Qt5Graphics_Controls \ + vcl/qt5/Qt5Graphics_GDI \ + vcl/qt5/Qt5Graphics_Text \ + vcl/qt5/Qt5Instance \ + vcl/qt5/Qt5Instance_Print \ + vcl/qt5/Qt5Object \ + vcl/qt5/Qt5Printer \ + vcl/qt5/Qt5Timer \ + vcl/qt5/Qt5VirtualDevice \ + vcl/qt5/Qt5Widget \ )) ifeq ($(OS),LINUX) -$(eval $(call gb_Library_add_libs,vclplug_kf5,\ +$(eval $(call gb_Library_add_libs,vclplug_qt5,\ -lm \ -ldl \ -lpthread \ diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 0587add8ce8c..d8b19c260709 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -87,10 +87,10 @@ $(eval $(call gb_Module_add_targets,vcl,\ Library_vclplug_kde5 \ )) endif -ifneq ($(ENABLE_KF5),) +ifneq ($(ENABLE_QT5),) $(eval $(call gb_Module_add_targets,vcl,\ - CustomTarget_kf5_moc \ - Library_vclplug_kf5 \ + CustomTarget_qt5_moc \ + Library_vclplug_qt5 \ )) endif endif diff --git a/vcl/inc/unx/gendata.hxx b/vcl/inc/unx/gendata.hxx index 4410f435ba86..0c043c34e023 100644 --- a/vcl/inc/unx/gendata.hxx +++ b/vcl/inc/unx/gendata.hxx @@ -23,7 +23,7 @@ enum GenericUnixSalDataType { SAL_DATA_GTK, SAL_DATA_GTK3, SAL_DATA_KDE4, SAL_DATA_KDE5, SAL_DATA_UNX, SAL_DATA_SVP, SAL_DATA_ANDROID, SAL_DATA_IOS, - SAL_DATA_HEADLESS, SAL_DATA_KF5 }; + SAL_DATA_HEADLESS, SAL_DATA_QT5 }; class VCL_DLLPUBLIC GenericUnixSalData : public SalData { diff --git a/vcl/inc/vclpluginapi.h b/vcl/inc/vclpluginapi.h index 41567284c99e..aaf9f7cc4577 100644 --- a/vcl/inc/vclpluginapi.h +++ b/vcl/inc/vclpluginapi.h @@ -41,10 +41,10 @@ #define VCLPLUG_KDE4_PUBLIC SAL_DLLPUBLIC_IMPORT #endif -#if defined VCLPLUG_KF5_IMPLEMENTATION -#define VCLPLUG_KF5_PUBLIC SAL_DLLPUBLIC_EXPORT +#if defined VCLPLUG_QT5_IMPLEMENTATION +#define VCLPLUG_QT5_PUBLIC SAL_DLLPUBLIC_EXPORT #else -#define VCLPLUG_KF5_PUBLIC SAL_DLLPUBLIC_IMPORT +#define VCLPLUG_QT5_PUBLIC SAL_DLLPUBLIC_IMPORT #endif #if defined VCLPLUG_SVP_IMPLEMENTATION diff --git a/vcl/unx/kf5/Kf5Bitmap.cxx b/vcl/qt5/Qt5Bitmap.cxx index d1e40ee39887..524eaf6048c2 100644 --- a/vcl/unx/kf5/Kf5Bitmap.cxx +++ b/vcl/qt5/Qt5Bitmap.cxx @@ -17,28 +17,28 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Bitmap.hxx" -#include "Kf5Tools.hxx" -#include "Kf5Graphics.hxx" +#include "Qt5Bitmap.hxx" +#include "Qt5Tools.hxx" +#include "Qt5Graphics.hxx" #include <QtGui/QImage> #include <QtCore/QVector> #include <QtGui/QColor> -Kf5Bitmap::Kf5Bitmap() +Qt5Bitmap::Qt5Bitmap() { } -Kf5Bitmap::Kf5Bitmap( const QImage &rImage ) +Qt5Bitmap::Qt5Bitmap( const QImage &rImage ) { m_pImage.reset( new QImage( rImage ) ); } -Kf5Bitmap::~Kf5Bitmap() +Qt5Bitmap::~Qt5Bitmap() { } -bool Kf5Bitmap::Create( const Size& rSize, sal_uInt16 nBitCount, +bool Qt5Bitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPal ) { assert( @@ -83,9 +83,9 @@ bool Kf5Bitmap::Create( const Size& rSize, sal_uInt16 nBitCount, return true; } -bool Kf5Bitmap::Create( const SalBitmap& rSalBmp ) +bool Qt5Bitmap::Create( const SalBitmap& rSalBmp ) { - const Kf5Bitmap *pBitmap = static_cast< const Kf5Bitmap*>( &rSalBmp ); + const Qt5Bitmap *pBitmap = static_cast< const Qt5Bitmap*>( &rSalBmp ); if ( pBitmap->m_pImage.get() ) { m_pImage.reset( new QImage( *pBitmap->m_pImage.get() ) ); @@ -103,18 +103,18 @@ bool Kf5Bitmap::Create( const SalBitmap& rSalBmp ) return true; } -bool Kf5Bitmap::Create( const SalBitmap& rSalBmp, +bool Qt5Bitmap::Create( const SalBitmap& rSalBmp, SalGraphics* pSalGraphics ) { - const Kf5Bitmap *pBitmap = static_cast< const Kf5Bitmap *>( &rSalBmp ); - Kf5Graphics *pGraphics = static_cast< Kf5Graphics* >( pSalGraphics ); + const Qt5Bitmap *pBitmap = static_cast< const Qt5Bitmap *>( &rSalBmp ); + Qt5Graphics *pGraphics = static_cast< Qt5Graphics* >( pSalGraphics ); QImage *pImage = pGraphics->m_pQImage; m_pImage.reset( new QImage( pBitmap->m_pImage->convertToFormat( pImage->format() ) ) ); m_pBuffer.reset(); return true; } -bool Kf5Bitmap::Create( const SalBitmap& rSalBmp, +bool Qt5Bitmap::Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount ) { assert( @@ -126,7 +126,7 @@ bool Kf5Bitmap::Create( const SalBitmap& rSalBmp, || nNewBitCount == 32) && "Unsupported BitCount!"); - const Kf5Bitmap *pBitmap = static_cast< const Kf5Bitmap *>( &rSalBmp ); + const Qt5Bitmap *pBitmap = static_cast< const Qt5Bitmap *>( &rSalBmp ); if ( pBitmap->m_pBuffer.get() ) return false; @@ -134,19 +134,19 @@ bool Kf5Bitmap::Create( const SalBitmap& rSalBmp, return true; } -bool Kf5Bitmap::Create( const css::uno::Reference< css::rendering::XBitmapCanvas >& rBitmapCanvas, +bool Qt5Bitmap::Create( const css::uno::Reference< css::rendering::XBitmapCanvas >& rBitmapCanvas, Size& rSize, bool bMask ) { return false; } -void Kf5Bitmap::Destroy() +void Qt5Bitmap::Destroy() { m_pImage.reset(); m_pBuffer.reset(); } -Size Kf5Bitmap::GetSize() const +Size Qt5Bitmap::GetSize() const { if ( m_pBuffer.get() ) return m_aSize; @@ -155,7 +155,7 @@ Size Kf5Bitmap::GetSize() const return Size(); } -sal_uInt16 Kf5Bitmap::GetBitCount() const +sal_uInt16 Qt5Bitmap::GetBitCount() const { if ( m_pBuffer.get() ) return 4; @@ -164,7 +164,7 @@ sal_uInt16 Kf5Bitmap::GetBitCount() const return 0; } -BitmapBuffer* Kf5Bitmap::AcquireBuffer( BitmapAccessMode nMode ) +BitmapBuffer* Qt5Bitmap::AcquireBuffer( BitmapAccessMode nMode ) { static const BitmapPalette aEmptyPalette; @@ -236,28 +236,28 @@ BitmapBuffer* Kf5Bitmap::AcquireBuffer( BitmapAccessMode nMode ) return pBuffer; } -void Kf5Bitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ) +void Qt5Bitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ) { m_aPalette = pBuffer->maPalette; delete pBuffer; } -bool Kf5Bitmap::GetSystemData( BitmapSystemData& rData ) +bool Qt5Bitmap::GetSystemData( BitmapSystemData& rData ) { return false; } -bool Kf5Bitmap::ScalingSupported() const +bool Qt5Bitmap::ScalingSupported() const { return false; } -bool Kf5Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) +bool Qt5Bitmap::Scale( const double& rScaleX, const double& rScaleY, BmpScaleFlag nScaleFlag ) { return false; } -bool Kf5Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) +bool Qt5Bitmap::Replace( const Color& rSearchColor, const Color& rReplaceColor, sal_uLong nTol ) { return false; } diff --git a/vcl/unx/kf5/Kf5Bitmap.hxx b/vcl/qt5/Qt5Bitmap.hxx index 2ea4accc8e9c..99c9641db789 100644 --- a/vcl/unx/kf5/Kf5Bitmap.hxx +++ b/vcl/qt5/Qt5Bitmap.hxx @@ -25,7 +25,7 @@ class QImage; -class VCL_DLLPUBLIC Kf5Bitmap : public SalBitmap +class VCL_DLLPUBLIC Qt5Bitmap : public SalBitmap { std::unique_ptr< QImage > m_pImage; BitmapPalette m_aPalette; @@ -36,9 +36,9 @@ class VCL_DLLPUBLIC Kf5Bitmap : public SalBitmap sal_uInt32 m_nScanline; public: - Kf5Bitmap(); - Kf5Bitmap( const QImage& rQImage ); - virtual ~Kf5Bitmap() override; + Qt5Bitmap(); + Qt5Bitmap( const QImage& rQImage ); + virtual ~Qt5Bitmap() override; const QImage* GetQImage() const { return m_pImage.get(); } diff --git a/vcl/unx/kf5/Kf5Data.cxx b/vcl/qt5/Qt5Data.cxx index b54054dc4cfe..f8d4483bf761 100644 --- a/vcl/unx/kf5/Kf5Data.cxx +++ b/vcl/qt5/Qt5Data.cxx @@ -20,10 +20,10 @@ #include <QtWidgets/QStyle> #include <QtWidgets/QApplication> -#include "Kf5Data.hxx" +#include "Qt5Data.hxx" -Kf5Data::Kf5Data( SalInstance *pInstance ) - : GenericUnixSalData( SAL_DATA_KF5, pInstance ) +Qt5Data::Qt5Data( SalInstance *pInstance ) + : GenericUnixSalData( SAL_DATA_QT5, pInstance ) { ImplSVData *pSVData = ImplGetSVData(); @@ -33,15 +33,15 @@ Kf5Data::Kf5Data( SalInstance *pInstance ) pSVData->maNWFData.mbFlatMenu = true; } -Kf5Data::~Kf5Data() +Qt5Data::~Qt5Data() { } -void Kf5Data::ErrorTrapPush() +void Qt5Data::ErrorTrapPush() { } -bool Kf5Data::ErrorTrapPop( bool bIgnoreError ) +bool Qt5Data::ErrorTrapPop( bool bIgnoreError ) { return false; } diff --git a/vcl/unx/kf5/Kf5Data.hxx b/vcl/qt5/Qt5Data.hxx index 16f1e24ba710..31859ce9637c 100644 --- a/vcl/unx/kf5/Kf5Data.hxx +++ b/vcl/qt5/Qt5Data.hxx @@ -21,11 +21,11 @@ #include <unx/gendata.hxx> -class Kf5Data : public GenericUnixSalData +class Qt5Data : public GenericUnixSalData { public: - explicit Kf5Data( SalInstance *pInstance ); - virtual ~Kf5Data() override; + explicit Qt5Data( SalInstance *pInstance ); + virtual ~Qt5Data() override; virtual void ErrorTrapPush() override; virtual bool ErrorTrapPop( bool bIgnoreError = true ) override; diff --git a/vcl/unx/kf5/Kf5FontFace.cxx b/vcl/qt5/Qt5FontFace.cxx index 2bfa45cc2348..701509b06108 100644 --- a/vcl/unx/kf5/Kf5FontFace.cxx +++ b/vcl/qt5/Qt5FontFace.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5FontFace.hxx" -#include "Kf5Tools.hxx" +#include "Qt5FontFace.hxx" +#include "Qt5Tools.hxx" #include <sft.hxx> #include <impfontcharmap.hxx> @@ -31,7 +31,7 @@ using namespace vcl; -Kf5FontFace::Kf5FontFace( const Kf5FontFace& rSrc ) +Qt5FontFace::Qt5FontFace( const Qt5FontFace& rSrc ) : PhysicalFontFace( rSrc ) , m_aFontId( rSrc.m_aFontId ) { @@ -39,33 +39,33 @@ Kf5FontFace::Kf5FontFace( const Kf5FontFace& rSrc ) m_xCharMap = rSrc.m_xCharMap; } -Kf5FontFace* Kf5FontFace::fromQFont( const QFont &rFont ) +Qt5FontFace* Qt5FontFace::fromQFont( const QFont &rFont ) { FontAttributes aFA; aFA.SetFamilyName( toOUString( rFont.family() ) ); aFA.SetStyleName( toOUString( rFont.styleName() ) ); aFA.SetItalic( rFont.italic() ? ITALIC_NORMAL : ITALIC_NONE ); - return new Kf5FontFace( aFA, rFont.toString() ) ; + return new Qt5FontFace( aFA, rFont.toString() ) ; } -Kf5FontFace::Kf5FontFace( const FontAttributes& rFA, const QString &rFontID ) +Qt5FontFace::Qt5FontFace( const FontAttributes& rFA, const QString &rFontID ) : PhysicalFontFace( rFA ) , m_aFontId( rFontID ) , m_bFontCapabilitiesRead( false ) { } -Kf5FontFace::~Kf5FontFace() +Qt5FontFace::~Qt5FontFace() { } -sal_IntPtr Kf5FontFace::GetFontId() const +sal_IntPtr Qt5FontFace::GetFontId() const { return reinterpret_cast<sal_IntPtr>( &m_aFontId ); } -const FontCharMapRef Kf5FontFace::GetFontCharMap() +const FontCharMapRef Qt5FontFace::GetFontCharMap() { if( m_xCharMap.is() ) return m_xCharMap; @@ -88,7 +88,7 @@ const FontCharMapRef Kf5FontFace::GetFontCharMap() return m_xCharMap; } -bool Kf5FontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) +bool Qt5FontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) { // read this only once per font if( m_bFontCapabilitiesRead ) @@ -114,12 +114,12 @@ bool Kf5FontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) return rFontCapabilities.oUnicodeRange || rFontCapabilities.oCodePageRange; } -PhysicalFontFace* Kf5FontFace::Clone() const +PhysicalFontFace* Qt5FontFace::Clone() const { - return new Kf5FontFace( *this ); + return new Qt5FontFace( *this ); } -LogicalFontInstance* Kf5FontFace::CreateFontInstance( const FontSelectPattern& rFSD ) const +LogicalFontInstance* Qt5FontFace::CreateFontInstance( const FontSelectPattern& rFSD ) const { return new LogicalFontInstance( rFSD ); } diff --git a/vcl/unx/kf5/Kf5FontFace.hxx b/vcl/qt5/Qt5FontFace.hxx index d2ae8099f345..76b8fdee99f1 100644 --- a/vcl/unx/kf5/Kf5FontFace.hxx +++ b/vcl/qt5/Qt5FontFace.hxx @@ -31,12 +31,12 @@ class FontAttributes; class FontSelectPattern; class QFont; -class Kf5FontFace : public PhysicalFontFace +class Qt5FontFace : public PhysicalFontFace { public: - virtual ~Kf5FontFace() override; + virtual ~Qt5FontFace() override; - static Kf5FontFace* fromQFont( const QFont &rFont ); + static Qt5FontFace* fromQFont( const QFont &rFont ); PhysicalFontFace* Clone() const override; LogicalFontInstance* CreateFontInstance( const FontSelectPattern& ) const override; @@ -49,8 +49,8 @@ public: bool HasChar( sal_uInt32 cChar ) const; protected: - Kf5FontFace( const Kf5FontFace& ); - Kf5FontFace( const FontAttributes& rFA, const QString &rFontID ); + Qt5FontFace( const Qt5FontFace& ); + Qt5FontFace( const FontAttributes& rFA, const QString &rFontID ); private: const QString m_aFontId; diff --git a/vcl/unx/kf5/Kf5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index 2d73a53b80c8..ff9dc769f00b 100644 --- a/vcl/unx/kf5/Kf5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -17,12 +17,12 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Frame.hxx" +#include "Qt5Frame.hxx" -#include "Kf5Tools.hxx" -#include "Kf5Instance.hxx" -#include "Kf5Graphics.hxx" -#include "Kf5Widget.hxx" +#include "Qt5Tools.hxx" +#include "Qt5Instance.hxx" +#include "Qt5Graphics.hxx" +#include "Qt5Widget.hxx" #include <QtCore/QPoint> #include <QtCore/QSize> @@ -32,10 +32,10 @@ #include <saldatabasic.hxx> #include <vcl/syswin.hxx> -Kf5Frame::Kf5Frame( Kf5Frame* pParent, SalFrameStyleFlags nStyle ) +Qt5Frame::Qt5Frame( Qt5Frame* pParent, SalFrameStyleFlags nStyle ) : m_bGraphicsInUse( false ) { - Kf5Instance *pInst = static_cast<Kf5Instance*>( GetSalData()->m_pInstance ); + Qt5Instance *pInst = static_cast<Qt5Instance*>( GetSalData()->m_pInstance ); pInst->insertFrame( this ); if( nStyle & SalFrameStyleFlags::DEFAULT ) // ensure default style @@ -68,7 +68,7 @@ Kf5Frame::Kf5Frame( Kf5Frame* pParent, SalFrameStyleFlags nStyle ) aWinFlags |= Qt::Window; } - m_pQWidget.reset( new Kf5Widget( *this, pParent ? pParent->GetQWidget() : nullptr, aWinFlags ) ); + m_pQWidget.reset( new Qt5Widget( *this, pParent ? pParent->GetQWidget() : nullptr, aWinFlags ) ); if (pParent && !(pParent->m_nStyle & SalFrameStyleFlags::PLUG)) { @@ -79,27 +79,27 @@ Kf5Frame::Kf5Frame( Kf5Frame* pParent, SalFrameStyleFlags nStyle ) } } -Kf5Frame::~Kf5Frame() +Qt5Frame::~Qt5Frame() { - Kf5Instance *pInst = static_cast<Kf5Instance*>( GetSalData()->m_pInstance ); + Qt5Instance *pInst = static_cast<Qt5Instance*>( GetSalData()->m_pInstance ); pInst->eraseFrame( this ); } -void Kf5Frame::TriggerPaintEvent() +void Qt5Frame::TriggerPaintEvent() { QSize aSize( m_pQWidget->size() ); SalPaintEvent aPaintEvt(0, 0, aSize.width(), aSize.height(), true); CallCallback(SalEvent::Paint, &aPaintEvt); } -SalGraphics* Kf5Frame::AcquireGraphics() +SalGraphics* Qt5Frame::AcquireGraphics() { if( m_bGraphicsInUse ) return nullptr; if( !m_pGraphics.get() ) { - m_pGraphics.reset( new Kf5Graphics( this ) ); + m_pGraphics.reset( new Qt5Graphics( this ) ); m_pQImage.reset( new QImage( m_pQWidget->size(), QImage::Format_ARGB32 ) ); m_pGraphics->ChangeQImage( m_pQImage.get() ); TriggerPaintEvent(); @@ -109,26 +109,26 @@ SalGraphics* Kf5Frame::AcquireGraphics() return m_pGraphics.get(); } -void Kf5Frame::ReleaseGraphics( SalGraphics* pSalGraph ) +void Qt5Frame::ReleaseGraphics( SalGraphics* pSalGraph ) { (void) pSalGraph; assert( pSalGraph == m_pGraphics.get() ); m_bGraphicsInUse = false; } -bool Kf5Frame::PostEvent( ImplSVEvent* pData ) +bool Qt5Frame::PostEvent( ImplSVEvent* pData ) { - Kf5Instance *pInst = static_cast<Kf5Instance*>( GetSalData()->m_pInstance ); + Qt5Instance *pInst = static_cast<Qt5Instance*>( GetSalData()->m_pInstance ); pInst->PostEvent( this, pData, SalEvent::UserEvent ); return true; } -void Kf5Frame::SetTitle( const OUString& rTitle ) +void Qt5Frame::SetTitle( const OUString& rTitle ) { m_pQWidget->window()->setWindowTitle( toQString( rTitle ) ); } -void Kf5Frame::SetIcon( sal_uInt16 nIcon ) +void Qt5Frame::SetIcon( sal_uInt16 nIcon ) { if( m_nStyle & (SalFrameStyleFlags::PLUG | SalFrameStyleFlags::SYSTEMCHILD | @@ -159,56 +159,56 @@ void Kf5Frame::SetIcon( sal_uInt16 nIcon ) m_pQWidget->window()->setWindowIcon( aIcon ); } -void Kf5Frame::SetMenu( SalMenu* pMenu ) +void Qt5Frame::SetMenu( SalMenu* pMenu ) { } -void Kf5Frame::DrawMenuBar() +void Qt5Frame::DrawMenuBar() { } -void Kf5Frame::SetExtendedFrameStyle( SalExtStyle nExtStyle ) +void Qt5Frame::SetExtendedFrameStyle( SalExtStyle nExtStyle ) { } -void Kf5Frame::Show( bool bVisible, bool bNoActivate ) +void Qt5Frame::Show( bool bVisible, bool bNoActivate ) { assert( m_pQWidget.get() ); m_pQWidget->setVisible( bVisible ); } -void Kf5Frame::SetMinClientSize( long nWidth, long nHeight ) +void Qt5Frame::SetMinClientSize( long nWidth, long nHeight ) { if( ! isChild() ) m_pQWidget->setMinimumSize( nWidth, nHeight ); } -void Kf5Frame::SetMaxClientSize( long nWidth, long nHeight ) +void Qt5Frame::SetMaxClientSize( long nWidth, long nHeight ) { if( ! isChild() ) m_pQWidget->setMaximumSize( nWidth, nHeight ); } -void Kf5Frame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) +void Qt5Frame::SetPosSize( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags ) { } -void Kf5Frame::GetClientSize( long& rWidth, long& rHeight ) +void Qt5Frame::GetClientSize( long& rWidth, long& rHeight ) { rWidth = m_pQWidget->width(); rHeight = m_pQWidget->height(); } -void Kf5Frame::GetWorkArea( tools::Rectangle& rRect ) +void Qt5Frame::GetWorkArea( tools::Rectangle& rRect ) { } -SalFrame* Kf5Frame::GetParent() const +SalFrame* Qt5Frame::GetParent() const { return m_pParent; } -void Kf5Frame::SetWindowState( const SalFrameState* pState ) +void Qt5Frame::SetWindowState( const SalFrameState* pState ) { if( !m_pQWidget->isWindow() || !pState || isChild( true, false ) ) return; @@ -246,7 +246,7 @@ void Kf5Frame::SetWindowState( const SalFrameState* pState ) } } -bool Kf5Frame::GetWindowState( SalFrameState* pState ) +bool Qt5Frame::GetWindowState( SalFrameState* pState ) { pState->mnState = WindowStateState::Normal; pState->mnMask = WindowStateMask::State; @@ -273,123 +273,123 @@ bool Kf5Frame::GetWindowState( SalFrameState* pState ) return true; } -void Kf5Frame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) +void Qt5Frame::ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) { } -void Kf5Frame::StartPresentation( bool bStart ) +void Qt5Frame::StartPresentation( bool bStart ) { } -void Kf5Frame::SetAlwaysOnTop( bool bOnTop ) +void Qt5Frame::SetAlwaysOnTop( bool bOnTop ) { } -void Kf5Frame::ToTop( SalFrameToTop nFlags ) +void Qt5Frame::ToTop( SalFrameToTop nFlags ) { } -void Kf5Frame::SetPointer( PointerStyle ePointerStyle ) +void Qt5Frame::SetPointer( PointerStyle ePointerStyle ) { } -void Kf5Frame::CaptureMouse( bool bMouse ) +void Qt5Frame::CaptureMouse( bool bMouse ) { } -void Kf5Frame::SetPointerPos( long nX, long nY ) +void Qt5Frame::SetPointerPos( long nX, long nY ) { } -void Kf5Frame::Flush() +void Qt5Frame::Flush() { } -void Kf5Frame::Flush( const tools::Rectangle& rRect ) +void Qt5Frame::Flush( const tools::Rectangle& rRect ) { } -void Kf5Frame::SetInputContext( SalInputContext* pContext ) +void Qt5Frame::SetInputContext( SalInputContext* pContext ) { } -void Kf5Frame::EndExtTextInput( EndExtTextInputFlags nFlags ) +void Qt5Frame::EndExtTextInput( EndExtTextInputFlags nFlags ) { } -OUString Kf5Frame::GetKeyName( sal_uInt16 nKeyCode ) +OUString Qt5Frame::GetKeyName( sal_uInt16 nKeyCode ) { return OUString(); } -bool Kf5Frame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) +bool Qt5Frame::MapUnicodeToKeyCode( sal_Unicode aUnicode, LanguageType aLangType, vcl::KeyCode& rKeyCode ) { return false; } -LanguageType Kf5Frame::GetInputLanguage() +LanguageType Qt5Frame::GetInputLanguage() { return LANGUAGE_DONTKNOW; } -void Kf5Frame::UpdateSettings( AllSettings& rSettings ) +void Qt5Frame::UpdateSettings( AllSettings& rSettings ) { } -void Kf5Frame::Beep() +void Qt5Frame::Beep() { } -const SystemEnvData* Kf5Frame::GetSystemData() const +const SystemEnvData* Qt5Frame::GetSystemData() const { return nullptr; } -SalFrame::SalPointerState Kf5Frame::GetPointerState() +SalFrame::SalPointerState Qt5Frame::GetPointerState() { return SalPointerState(); } -KeyIndicatorState Kf5Frame::GetIndicatorState() +KeyIndicatorState Qt5Frame::GetIndicatorState() { return KeyIndicatorState(); } -void Kf5Frame::SimulateKeyPress( sal_uInt16 nKeyCode ) +void Qt5Frame::SimulateKeyPress( sal_uInt16 nKeyCode ) { } -void Kf5Frame::SetParent( SalFrame* pNewParent ) +void Qt5Frame::SetParent( SalFrame* pNewParent ) { - m_pParent = static_cast< Kf5Frame* >( pNewParent ); + m_pParent = static_cast< Qt5Frame* >( pNewParent ); } -bool Kf5Frame::SetPluginParent( SystemParentData* pNewParent ) +bool Qt5Frame::SetPluginParent( SystemParentData* pNewParent ) { return false; } -void Kf5Frame::ResetClipRegion() +void Qt5Frame::ResetClipRegion() { } -void Kf5Frame::BeginSetClipRegion( sal_uLong nRects ) +void Qt5Frame::BeginSetClipRegion( sal_uLong nRects ) { } -void Kf5Frame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) +void Qt5Frame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) { } -void Kf5Frame::EndSetClipRegion() +void Qt5Frame::EndSetClipRegion() { } -void Kf5Frame::SetScreenNumber( unsigned int ) +void Qt5Frame::SetScreenNumber( unsigned int ) { } -void Kf5Frame::SetApplicationID(const OUString &) +void Qt5Frame::SetApplicationID(const OUString &) { } diff --git a/vcl/unx/kf5/Kf5Frame.hxx b/vcl/qt5/Qt5Frame.hxx index d7746c9cb5e5..209561780414 100644 --- a/vcl/unx/kf5/Kf5Frame.hxx +++ b/vcl/qt5/Qt5Frame.hxx @@ -23,24 +23,24 @@ #include <memory> -class Kf5Graphics; -class Kf5Instance; -class Kf5Widget; +class Qt5Graphics; +class Qt5Instance; +class Qt5Widget; class QWidget; class QPaintDevice; class QImage; -class Kf5Frame +class Qt5Frame : public SalFrame { - friend class Kf5Widget; + friend class Qt5Widget; std::unique_ptr< QWidget > m_pQWidget; std::unique_ptr< QImage > m_pQImage; - std::unique_ptr< Kf5Graphics > m_pGraphics; + std::unique_ptr< Qt5Graphics > m_pGraphics; bool m_bGraphicsInUse; SalFrameStyleFlags m_nStyle; - Kf5Frame *m_pParent; + Qt5Frame *m_pParent; bool isChild( bool bPlug = true, bool bSysChild = true ) { @@ -55,9 +55,9 @@ class Kf5Frame void TriggerPaintEvent(); public: - Kf5Frame( Kf5Frame* pParent, + Qt5Frame( Qt5Frame* pParent, SalFrameStyleFlags nSalFrameStyle ); - virtual ~Kf5Frame() override; + virtual ~Qt5Frame() override; QWidget* GetQWidget() const { return m_pQWidget.get(); } diff --git a/vcl/unx/kf5/Kf5Graphics.cxx b/vcl/qt5/Qt5Graphics.cxx index 0cd252fe06ff..1d0d15677eb4 100644 --- a/vcl/unx/kf5/Kf5Graphics.cxx +++ b/vcl/qt5/Qt5Graphics.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Graphics.hxx" -#include "Kf5Frame.hxx" +#include "Qt5Graphics.hxx" +#include "Qt5Frame.hxx" #include <QtWidgets/QWidget> @@ -26,25 +26,25 @@ #include <QtGui/QImage> -Kf5Graphics::Kf5Graphics( Kf5Frame *pFrame ) +Qt5Graphics::Qt5Graphics( Qt5Frame *pFrame ) : m_pFrame( pFrame ) , m_pQImage( nullptr ) , m_pFontCollection( nullptr ) { } -Kf5Graphics::Kf5Graphics( QImage *pQImage ) +Qt5Graphics::Qt5Graphics( QImage *pQImage ) : m_pFrame( nullptr ) , m_pQImage( pQImage ) , m_pFontCollection( nullptr ) { } -Kf5Graphics::~Kf5Graphics() +Qt5Graphics::~Qt5Graphics() { } -void Kf5Graphics::PreparePainter() +void Qt5Graphics::PreparePainter() { if ( m_pPainter.get() ) return; @@ -59,55 +59,55 @@ void Kf5Graphics::PreparePainter() m_pPainter->setClipRegion( m_aClipRegion ); } -void Kf5Graphics::ChangeQImage( QImage *pQImage ) +void Qt5Graphics::ChangeQImage( QImage *pQImage ) { m_pPainter.reset(); m_pQImage = pQImage; } -SalGraphicsImpl* Kf5Graphics::GetImpl() const +SalGraphicsImpl* Qt5Graphics::GetImpl() const { return nullptr; } -SystemGraphicsData Kf5Graphics::GetGraphicsData() const +SystemGraphicsData Qt5Graphics::GetGraphicsData() const { return SystemGraphicsData(); } -bool Kf5Graphics::supportsOperation( OutDevSupportType ) const +bool Qt5Graphics::supportsOperation( OutDevSupportType ) const { return false; } #if ENABLE_CAIRO_CANVAS -bool Kf5Graphics::SupportsCairo() const +bool Qt5Graphics::SupportsCairo() const { return false; } -cairo::SurfaceSharedPtr Kf5Graphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const +cairo::SurfaceSharedPtr Qt5Graphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const { return nullptr; } -cairo::SurfaceSharedPtr Kf5Graphics::CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const +cairo::SurfaceSharedPtr Qt5Graphics::CreateSurface(const OutputDevice& rRefDevice, int x, int y, int width, int height) const { return nullptr; } -cairo::SurfaceSharedPtr Kf5Graphics::CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const +cairo::SurfaceSharedPtr Qt5Graphics::CreateBitmapSurface(const OutputDevice& rRefDevice, const BitmapSystemData& rData, const Size& rSize) const { return nullptr; } -css::uno::Any Kf5Graphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const +css::uno::Any Qt5Graphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& rSize) const { return css::uno::Any(); } -SystemFontData Kf5Graphics::GetSysFontData( int nFallbacklevel ) const +SystemFontData Qt5Graphics::GetSysFontData( int nFallbacklevel ) const { return SystemFontData(); } diff --git a/vcl/unx/kf5/Kf5Graphics.hxx b/vcl/qt5/Qt5Graphics.hxx index 55f1fc245aff..b021134e54b7 100644 --- a/vcl/unx/kf5/Kf5Graphics.hxx +++ b/vcl/qt5/Qt5Graphics.hxx @@ -25,17 +25,17 @@ #include <QtGui/QRegion> -class Kf5Frame; +class Qt5Frame; class PhysicalFontCollection; class PhysicalFontFace; class QImage; class QPainter; -class Kf5Graphics : public SalGraphics +class Qt5Graphics : public SalGraphics { - friend class Kf5Bitmap; + friend class Qt5Bitmap; - Kf5Frame *m_pFrame; + Qt5Frame *m_pFrame; QImage *m_pQImage; QRegion m_aClipRegion; std::unique_ptr< QPainter > m_pPainter; @@ -45,9 +45,9 @@ class Kf5Graphics : public SalGraphics void PreparePainter(); public: - Kf5Graphics( Kf5Frame *pFrame ); - Kf5Graphics( QImage *pImage ); - virtual ~Kf5Graphics() override; + Qt5Graphics( Qt5Frame *pFrame ); + Qt5Graphics( QImage *pImage ); + virtual ~Qt5Graphics() override; void ChangeQImage( QImage *pImage ); diff --git a/vcl/unx/kf5/Kf5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx index b55f7f190e94..42b6b3caf729 100644 --- a/vcl/unx/kf5/Kf5Graphics_Controls.cxx +++ b/vcl/qt5/Qt5Graphics_Controls.cxx @@ -17,21 +17,21 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Graphics.hxx" +#include "Qt5Graphics.hxx" -bool Kf5Graphics::IsNativeControlSupported( ControlType nType, ControlPart nPart ) +bool Qt5Graphics::IsNativeControlSupported( ControlType nType, ControlPart nPart ) { return false; } -bool Kf5Graphics::hitTestNativeControl( ControlType nType, ControlPart nPart, +bool Qt5Graphics::hitTestNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, const Point& aPos, bool& rIsInside ) { return false; } -bool Kf5Graphics::drawNativeControl( ControlType nType, ControlPart nPart, +bool Qt5Graphics::drawNativeControl( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& aCaption ) @@ -39,7 +39,7 @@ bool Kf5Graphics::drawNativeControl( ControlType nType, ControlPart nPart, return false; } -bool Kf5Graphics::getNativeControlRegion( ControlType nType, ControlPart nPart, +bool Qt5Graphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const tools::Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const OUString& aCaption, tools::Rectangle &rNativeBoundingRegion, diff --git a/vcl/unx/kf5/Kf5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx index b1b42fd7adcf..b790278cdce0 100644 --- a/vcl/unx/kf5/Kf5Graphics_GDI.cxx +++ b/vcl/qt5/Qt5Graphics_GDI.cxx @@ -17,18 +17,18 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Graphics.hxx" +#include "Qt5Graphics.hxx" -#include "Kf5Bitmap.hxx" -#include "Kf5Frame.hxx" -#include "Kf5Tools.hxx" +#include "Qt5Bitmap.hxx" +#include "Qt5Frame.hxx" +#include "Qt5Tools.hxx" #include <QtGui/QPainter> #include <QtGui/QScreen> #include <QtGui/QWindow> #include <QtWidgets/QWidget> -bool Kf5Graphics::setClipRegion( const vcl::Region& rRegion ) +bool Qt5Graphics::setClipRegion( const vcl::Region& rRegion ) { PreparePainter(); if ( rRegion.IsRectangle() ) @@ -50,38 +50,38 @@ bool Kf5Graphics::setClipRegion( const vcl::Region& rRegion ) return true; } -void Kf5Graphics::ResetClipRegion() +void Qt5Graphics::ResetClipRegion() { m_aClipRegion = QRegion( m_pQImage->rect() ); PreparePainter(); } -void Kf5Graphics::drawPixel( long nX, long nY ) +void Qt5Graphics::drawPixel( long nX, long nY ) { PreparePainter(); m_pPainter->drawPoint( nX, nY ); } -void Kf5Graphics::drawPixel( long nX, long nY, SalColor nSalColor ) +void Qt5Graphics::drawPixel( long nX, long nY, SalColor nSalColor ) { PreparePainter(); m_pPainter->setPen( QColor( QRgb( nSalColor ) ) ); m_pPainter->drawPoint( nX, nY ); } -void Kf5Graphics::drawLine( long nX1, long nY1, long nX2, long nY2 ) +void Qt5Graphics::drawLine( long nX1, long nY1, long nX2, long nY2 ) { PreparePainter(); m_pPainter->drawLine( nX1, nY1, nX2, nY2 ); } -void Kf5Graphics::drawRect( long nX, long nY, long nWidth, long nHeight ) +void Qt5Graphics::drawRect( long nX, long nY, long nWidth, long nHeight ) { PreparePainter(); m_pPainter->drawRect( nX, nY, nWidth, nHeight ); } -void Kf5Graphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) +void Qt5Graphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) { PreparePainter(); QPoint *pPoints = new QPoint[ nPoints ]; @@ -91,7 +91,7 @@ void Kf5Graphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry ) delete [] pPoints; } -void Kf5Graphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) +void Qt5Graphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) { PreparePainter(); QPoint *pPoints = new QPoint[ nPoints ]; @@ -101,34 +101,34 @@ void Kf5Graphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) delete [] pPoints; } -void Kf5Graphics::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) +void Qt5Graphics::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pPoints, PCONSTSALPOINT* pPtAry ) { if( 0 == nPoly ) return; } -bool Kf5Graphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double fTransparency ) +bool Qt5Graphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double fTransparency ) { return false; } -bool Kf5Graphics::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) +bool Qt5Graphics::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) { return false; } -bool Kf5Graphics::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) +bool Qt5Graphics::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint* pPtAry, const PolyFlags* pFlgAry ) { return false; } -bool Kf5Graphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, +bool Qt5Graphics::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt32* pPoints, const SalPoint* const* pPtAry, const PolyFlags* const* pFlgAry ) { return false; } -bool Kf5Graphics::drawPolyLine( const basegfx::B2DPolygon&, +bool Qt5Graphics::drawPolyLine( const basegfx::B2DPolygon&, double fTransparency, const basegfx::B2DVector& rLineWidths, basegfx::B2DLineJoin, @@ -138,12 +138,12 @@ bool Kf5Graphics::drawPolyLine( const basegfx::B2DPolygon&, return false; } -bool Kf5Graphics::drawGradient( const tools::PolyPolygon&, const Gradient& ) +bool Qt5Graphics::drawGradient( const tools::PolyPolygon&, const Gradient& ) { return false; } -void Kf5Graphics::copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, +void Qt5Graphics::copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, long nSrcWidth, long nSrcHeight, bool bWindowInvalidate ) { if ( nDestX == nSrcX && nDestY == nSrcY ) @@ -154,7 +154,7 @@ void Kf5Graphics::copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, lo copyBits( aTR, this ); } -void Kf5Graphics::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) +void Qt5Graphics::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics ) { if( rPosAry.mnSrcWidth <= 0 || rPosAry.mnSrcHeight <= 0 || rPosAry.mnDestWidth <= 0 || rPosAry.mnDestHeight <= 0 ) @@ -175,7 +175,7 @@ void Kf5Graphics::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics pImage = &aImage; } else - pImage = static_cast< Kf5Graphics*>( pSrcGraphics )->m_pQImage; + pImage = static_cast< Qt5Graphics* >( pSrcGraphics )->m_pQImage; PreparePainter(); m_pPainter->drawImage( QPoint( rPosAry.mnDestX, rPosAry.mnDestY ), @@ -183,7 +183,7 @@ void Kf5Graphics::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics rPosAry.mnSrcWidth, rPosAry.mnSrcHeight) ); } -void Kf5Graphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) +void Qt5Graphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap ) { if( rPosAry.mnSrcWidth <= 0 || rPosAry.mnSrcHeight <= 0 || rPosAry.mnDestWidth <= 0 || rPosAry.mnDestHeight <= 0 ) @@ -193,7 +193,7 @@ void Kf5Graphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBi assert( rPosAry.mnSrcHeight == rPosAry.mnDestHeight ); PreparePainter(); - const QImage *pImage = static_cast< const Kf5Bitmap* >( &rSalBitmap )->GetQImage(); + const QImage *pImage = static_cast< const Qt5Bitmap* >( &rSalBitmap )->GetQImage(); m_pPainter->drawImage( QPoint( rPosAry.mnDestX, rPosAry.mnDestY ), *pImage, QRect( rPosAry.mnSrcX, rPosAry.mnSrcY, @@ -204,48 +204,48 @@ void Kf5Graphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBi m_pFrame->GetQWidget()->update(); } -void Kf5Graphics::drawBitmap( const SalTwoRect& rPosAry, +void Qt5Graphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, const SalBitmap& rTransparentBitmap ) { } -void Kf5Graphics::drawMask( const SalTwoRect& rPosAry, +void Qt5Graphics::drawMask( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, SalColor nMaskColor ) { } -SalBitmap* Kf5Graphics::getBitmap( long nX, long nY, long nWidth, long nHeight ) +SalBitmap* Qt5Graphics::getBitmap( long nX, long nY, long nWidth, long nHeight ) { - return new Kf5Bitmap( m_pQImage->copy( nX, nY, nWidth, nHeight ) ); + return new Qt5Bitmap( m_pQImage->copy( nX, nY, nWidth, nHeight ) ); } -SalColor Kf5Graphics::getPixel( long nX, long nY ) +SalColor Qt5Graphics::getPixel( long nX, long nY ) { return m_pQImage->pixel( nX, nY ); } -void Kf5Graphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) +void Qt5Graphics::invert( long nX, long nY, long nWidth, long nHeight, SalInvert nFlags) { } -void Kf5Graphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) +void Qt5Graphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalInvert nFlags ) { } -bool Kf5Graphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) +bool Qt5Graphics::drawEPS( long nX, long nY, long nWidth, long nHeight, void* pPtr, sal_uLong nSize ) { return false; } -bool Kf5Graphics::blendBitmap( const SalTwoRect&, +bool Qt5Graphics::blendBitmap( const SalTwoRect&, const SalBitmap& rBitmap ) { return false; } -bool Kf5Graphics::blendAlphaBitmap( const SalTwoRect&, +bool Qt5Graphics::blendAlphaBitmap( const SalTwoRect&, const SalBitmap& rSrcBitmap, const SalBitmap& rMaskBitmap, const SalBitmap& rAlphaBitmap ) @@ -253,14 +253,14 @@ bool Kf5Graphics::blendAlphaBitmap( const SalTwoRect&, return false; } -bool Kf5Graphics::drawAlphaBitmap( const SalTwoRect&, +bool Qt5Graphics::drawAlphaBitmap( const SalTwoRect&, const SalBitmap& rSourceBitmap, const SalBitmap& rAlphaBitmap ) { return false; } -bool Kf5Graphics::drawTransformedBitmap( +bool Qt5Graphics::drawTransformedBitmap( const basegfx::B2DPoint& rNull, const basegfx::B2DPoint& rX, const basegfx::B2DPoint& rY, @@ -270,13 +270,13 @@ bool Kf5Graphics::drawTransformedBitmap( return false; } -bool Kf5Graphics::drawAlphaRect( long nX, long nY, long nWidth, +bool Qt5Graphics::drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ) { return false; } -void Kf5Graphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) +void Qt5Graphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) { char* pForceDpi; if ((pForceDpi = getenv("SAL_FORCEDPI"))) @@ -294,41 +294,41 @@ void Kf5Graphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) rDPIY = pScreen->physicalDotsPerInchY(); } -sal_uInt16 Kf5Graphics::GetBitCount() const +sal_uInt16 Qt5Graphics::GetBitCount() const { return getFormatBits( m_pQImage->format() ); } -long Kf5Graphics::GetGraphicsWidth() const +long Qt5Graphics::GetGraphicsWidth() const { return m_pQImage->width(); } -void Kf5Graphics::SetLineColor() +void Qt5Graphics::SetLineColor() { } -void Kf5Graphics::SetLineColor( SalColor nSalColor ) +void Qt5Graphics::SetLineColor( SalColor nSalColor ) { } -void Kf5Graphics::SetFillColor() +void Qt5Graphics::SetFillColor() { } -void Kf5Graphics::SetFillColor( SalColor nSalColor ) +void Qt5Graphics::SetFillColor( SalColor nSalColor ) { } -void Kf5Graphics::SetXORMode( bool bSet ) +void Qt5Graphics::SetXORMode( bool bSet ) { } -void Kf5Graphics::SetROPLineColor( SalROPColor nROPColor ) +void Qt5Graphics::SetROPLineColor( SalROPColor nROPColor ) { } -void Kf5Graphics::SetROPFillColor( SalROPColor nROPColor ) +void Qt5Graphics::SetROPFillColor( SalROPColor nROPColor ) { } diff --git a/vcl/unx/kf5/Kf5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx index 28af6be1bf65..fe6931c84458 100644 --- a/vcl/unx/kf5/Kf5Graphics_Text.cxx +++ b/vcl/qt5/Qt5Graphics_Text.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Graphics.hxx" -#include "Kf5FontFace.hxx" +#include "Qt5Graphics.hxx" +#include "Qt5FontFace.hxx" #include <vcl/fontcharmap.hxx> @@ -27,29 +27,29 @@ #include <QtGui/QFontDatabase> #include <QtCore/QStringList> -void Kf5Graphics::SetTextColor( SalColor nSalColor ) +void Qt5Graphics::SetTextColor( SalColor nSalColor ) { } -void Kf5Graphics::SetFont( const FontSelectPattern*, int nFallbackLevel ) +void Qt5Graphics::SetFont( const FontSelectPattern*, int nFallbackLevel ) { } -void Kf5Graphics::GetFontMetric( ImplFontMetricDataRef &rFMD, int nFallbackLevel ) +void Qt5Graphics::GetFontMetric( ImplFontMetricDataRef &rFMD, int nFallbackLevel ) { } -const FontCharMapRef Kf5Graphics::GetFontCharMap() const +const FontCharMapRef Qt5Graphics::GetFontCharMap() const { return nullptr; } -bool Kf5Graphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const +bool Qt5Graphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const { return false; } -void Kf5Graphics::GetDevFontList( PhysicalFontCollection* pPFC ) +void Qt5Graphics::GetDevFontList( PhysicalFontCollection* pPFC ) { m_pFontCollection = pPFC; if ( pPFC->Count() ) @@ -61,57 +61,57 @@ void Kf5Graphics::GetDevFontList( PhysicalFontCollection* pPFC ) { // Just get any size - we don't care QList<int> sizes = aFDB.smoothSizes(family, style); - pPFC->Add( Kf5FontFace::fromQFont( aFDB.font( family, style, *sizes.begin() ) ) ); + pPFC->Add( Qt5FontFace::fromQFont( aFDB.font( family, style, *sizes.begin() ) ) ); } } -void Kf5Graphics::ClearDevFontCache() +void Qt5Graphics::ClearDevFontCache() { } -bool Kf5Graphics::AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) +bool Qt5Graphics::AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) { return false; } -bool Kf5Graphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, +bool Qt5Graphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) { return false; } -const void* Kf5Graphics::GetEmbedFontData( const PhysicalFontFace*, long* pDataLen ) +const void* Qt5Graphics::GetEmbedFontData( const PhysicalFontFace*, long* pDataLen ) { return nullptr; } -void Kf5Graphics::FreeEmbedFontData( const void* pData, long nDataLen ) +void Qt5Graphics::FreeEmbedFontData( const void* pData, long nDataLen ) { } -void Kf5Graphics::GetGlyphWidths( const PhysicalFontFace*, bool bVertical, +void Qt5Graphics::GetGlyphWidths( const PhysicalFontFace*, bool bVertical, std::vector< sal_Int32 >& rWidths, Ucs2UIntMap& rUnicodeEnc ) { } -bool Kf5Graphics::GetGlyphBoundRect( const GlyphItem&, tools::Rectangle& ) +bool Qt5Graphics::GetGlyphBoundRect( const GlyphItem&, tools::Rectangle& ) { return false; } -bool Kf5Graphics::GetGlyphOutline( const GlyphItem&, basegfx::B2DPolyPolygon& ) +bool Qt5Graphics::GetGlyphOutline( const GlyphItem&, basegfx::B2DPolyPolygon& ) { return false; } -SalLayout* Kf5Graphics::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) +SalLayout* Qt5Graphics::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) { return nullptr; } -void Kf5Graphics::DrawTextLayout( const CommonSalLayout& ) +void Qt5Graphics::DrawTextLayout( const CommonSalLayout& ) { } diff --git a/vcl/unx/kf5/Kf5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 3eb7e20cfa4e..dd2daf7e8b8b 100644 --- a/vcl/unx/kf5/Kf5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -17,15 +17,15 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Instance.hxx" -#include <Kf5Instance.moc> +#include "Qt5Instance.hxx" +#include <Qt5Instance.moc> -#include "Kf5Frame.hxx" -#include "Kf5Data.hxx" -#include "Kf5Timer.hxx" -#include "Kf5VirtualDevice.hxx" -#include "Kf5Object.hxx" -#include "Kf5Bitmap.hxx" +#include "Qt5Frame.hxx" +#include "Qt5Data.hxx" +#include "Qt5Timer.hxx" +#include "Qt5VirtualDevice.hxx" +#include "Qt5Object.hxx" +#include "Qt5Bitmap.hxx" #include <QtCore/QThread> #include <QtWidgets/QApplication> @@ -38,11 +38,7 @@ #include <headless/svpdummies.hxx> #include <headless/svpbmp.hxx> -#include <KAboutData> -#include <KLocalizedString> -#include <KStartupInfo> - -Kf5Instance::Kf5Instance( SalYieldMutex* pMutex ) +Qt5Instance::Qt5Instance( SalYieldMutex* pMutex ) : SalGenericInstance( pMutex ) , m_postUserEventId( -1 ) { @@ -54,7 +50,7 @@ Kf5Instance::Kf5Instance( SalYieldMutex* pMutex ) this, SLOT( ImplYield( bool, bool )), Qt::BlockingQueuedConnection ); } -Kf5Instance::~Kf5Instance() +Qt5Instance::~Qt5Instance() { // force freeing the QApplication before freeing the arguments, // as it uses references to the provided arguments! @@ -63,59 +59,59 @@ Kf5Instance::~Kf5Instance() free( m_pFakeArgvFreeable[i] ); } -SalFrame* Kf5Instance::CreateChildFrame( SystemParentData* /*pParent*/, SalFrameStyleFlags nStyle ) +SalFrame* Qt5Instance::CreateChildFrame( SystemParentData* /*pParent*/, SalFrameStyleFlags nStyle ) { - return new Kf5Frame( nullptr, nStyle ); + return new Qt5Frame( nullptr, nStyle ); } -SalFrame* Kf5Instance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) +SalFrame* Qt5Instance::CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) { - assert( !pParent || dynamic_cast<Kf5Frame*>( pParent ) ); - return new Kf5Frame( static_cast<Kf5Frame*>( pParent ), nStyle ); + assert( !pParent || dynamic_cast<Qt5Frame*>( pParent ) ); + return new Qt5Frame( static_cast<Qt5Frame*>( pParent ), nStyle ); } -void Kf5Instance::DestroyFrame( SalFrame* pFrame ) +void Qt5Instance::DestroyFrame( SalFrame* pFrame ) { delete pFrame; } -SalObject* Kf5Instance::CreateObject( SalFrame* pParent, SystemWindowData*, bool bShow ) +SalObject* Qt5Instance::CreateObject( SalFrame* pParent, SystemWindowData*, bool bShow ) { - assert( !pParent || dynamic_cast<Kf5Frame*>( pParent ) ); - return new Kf5Object( static_cast<Kf5Frame*>( pParent ), bShow ); + assert( !pParent || dynamic_cast<Qt5Frame*>( pParent ) ); + return new Qt5Object( static_cast<Qt5Frame*>( pParent ), bShow ); } -void Kf5Instance::DestroyObject( SalObject* pObject ) +void Qt5Instance::DestroyObject( SalObject* pObject ) { delete pObject; } -SalVirtualDevice* Kf5Instance::CreateVirtualDevice( SalGraphics* /* pGraphics */, +SalVirtualDevice* Qt5Instance::CreateVirtualDevice( SalGraphics* /* pGraphics */, long &nDX, long &nDY, DeviceFormat eFormat, const SystemGraphicsData* /* pData */ ) { - Kf5VirtualDevice* pVD = new Kf5VirtualDevice( eFormat, 1 ); + Qt5VirtualDevice* pVD = new Qt5VirtualDevice( eFormat, 1 ); pVD->SetSize( nDX, nDY ); return pVD; } -SalTimer* Kf5Instance::CreateSalTimer() +SalTimer* Qt5Instance::CreateSalTimer() { - return new Kf5Timer(); + return new Qt5Timer(); } -SalSystem* Kf5Instance::CreateSalSystem() +SalSystem* Qt5Instance::CreateSalSystem() { return new SvpSalSystem(); } -SalBitmap* Kf5Instance::CreateSalBitmap() +SalBitmap* Qt5Instance::CreateSalBitmap() { - return new Kf5Bitmap(); + return new Qt5Bitmap(); } -bool Kf5Instance::ImplYield( bool bWait, bool bHandleAllCurrentEvents ) +bool Qt5Instance::ImplYield( bool bWait, bool bHandleAllCurrentEvents ) { bool wasEvent = DispatchUserEvents( bHandleAllCurrentEvents ); if ( !bHandleAllCurrentEvents && wasEvent ) @@ -133,7 +129,7 @@ bool Kf5Instance::ImplYield( bool bWait, bool bHandleAllCurrentEvents ) return wasEvent; } -bool Kf5Instance::DoYield(bool bWait, bool bHandleAllCurrentEvents) +bool Qt5Instance::DoYield(bool bWait, bool bHandleAllCurrentEvents) { bool bWasEvent = false; if( qApp->thread() == QThread::currentThread() ) @@ -159,47 +155,47 @@ bool Kf5Instance::DoYield(bool bWait, bool bHandleAllCurrentEvents) return bWasEvent; } -bool Kf5Instance::AnyInput( VclInputFlags nType ) +bool Qt5Instance::AnyInput( VclInputFlags nType ) { return false; } -SalSession* Kf5Instance::CreateSalSession() +SalSession* Qt5Instance::CreateSalSession() { return nullptr; } -OUString Kf5Instance::GetConnectionIdentifier() +OUString Qt5Instance::GetConnectionIdentifier() { return OUString(); } -void Kf5Instance::AddToRecentDocumentList(const OUString&, const OUString&, const OUString&) +void Qt5Instance::AddToRecentDocumentList(const OUString&, const OUString&, const OUString&) { } -OpenGLContext* Kf5Instance::CreateOpenGLContext() +OpenGLContext* Qt5Instance::CreateOpenGLContext() { return nullptr; } -bool Kf5Instance::IsMainThread() const +bool Qt5Instance::IsMainThread() const { return qApp->thread() != QThread::currentThread(); } -void Kf5Instance::TriggerUserEventProcessing() +void Qt5Instance::TriggerUserEventProcessing() { QApplication::postEvent(this, new QEvent(QEvent::Type( m_postUserEventId ))); } -void Kf5Instance::ProcessEvent( SalUserEvent aEvent ) +void Qt5Instance::ProcessEvent( SalUserEvent aEvent ) { aEvent.m_pFrame->CallCallback( aEvent.m_nEvent, aEvent.m_pData ); } extern "C" { - VCLPLUG_KF5_PUBLIC SalInstance* create_SalInstance() + VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance() { OString aVersion( qVersion() ); SAL_INFO( "vcl.kf5", "qt version string is " << aVersion ); @@ -263,28 +259,12 @@ extern "C" { free( session_manager ); } - KAboutData *kAboutData = new KAboutData( I18N_NOOP("LibreOffice"), - i18n( "LibreOffice" ), - "6.0.0", - i18n( "LibreOffice with KF5 Native Widget Support." ), - KAboutLicense::File, - i18n("Copyright (c) 2017 LibreOffice contributors" ), - i18n( "LibreOffice is an office suite." ), - "http://libreoffice.org", - QLatin1String("libreoffice@lists.freedesktop.org") ); - - kAboutData->addAuthor( i18n( "Jan-Marek Glogowski" ), - i18n( "Original author and maintainer of the KF5 NWF." ), - "glogow@fbihome.de" ); - - KAboutData::setApplicationData( *kAboutData ); - QApplication::setQuitOnLastWindowClosed(false); - Kf5Instance* pInstance = new Kf5Instance( new SalYieldMutex() ); + Qt5Instance* pInstance = new Qt5Instance( new SalYieldMutex() ); // initialize SalData - new Kf5Data( pInstance ); + new Qt5Data( pInstance ); pInstance->m_pQApplication.reset( pQApplication ); pInstance->m_pFakeArgvFreeable.reset( pFakeArgvFreeable ); diff --git a/vcl/unx/kf5/Kf5Instance.hxx b/vcl/qt5/Qt5Instance.hxx index 98cfa31c1579..ff0cacc7be97 100644 --- a/vcl/unx/kf5/Kf5Instance.hxx +++ b/vcl/qt5/Qt5Instance.hxx @@ -30,7 +30,7 @@ class QApplication; class SalYieldMutex; class SalFrame; -class Kf5Instance +class Qt5Instance : public QObject , public SalGenericInstance , public SalUserEventList @@ -53,8 +53,8 @@ Q_SIGNALS: bool ImplYieldSignal( bool bWait, bool bHandleAllCurrentEvents ); public: - explicit Kf5Instance( SalYieldMutex* pMutex ); - virtual ~Kf5Instance() override; + explicit Qt5Instance( SalYieldMutex* pMutex ); + virtual ~Qt5Instance() override; virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override; virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override; diff --git a/vcl/unx/kf5/Kf5Instance_Print.cxx b/vcl/qt5/Qt5Instance_Print.cxx index e716c8953ec1..4c1afd4f482f 100644 --- a/vcl/unx/kf5/Kf5Instance_Print.cxx +++ b/vcl/qt5/Qt5Instance_Print.cxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Instance.hxx" -#include "Kf5Printer.hxx" +#include "Qt5Instance.hxx" +#include "Qt5Printer.hxx" #include <vcl/svapp.hxx> #include <vcl/timer.hxx> @@ -155,11 +155,11 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) } } -SalInfoPrinter* Kf5Instance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, +SalInfoPrinter* Qt5Instance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, ImplJobSetup* pJobSetup ) { // create and initialize SalInfoPrinter - Kf5InfoPrinter* pPrinter = new Kf5InfoPrinter; + Qt5InfoPrinter* pPrinter = new Qt5InfoPrinter; if( pJobSetup ) { @@ -181,26 +181,26 @@ SalInfoPrinter* Kf5Instance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, return pPrinter; } -void Kf5Instance::DestroyInfoPrinter( SalInfoPrinter* pPrinter ) +void Qt5Instance::DestroyInfoPrinter( SalInfoPrinter* pPrinter ) { delete pPrinter; } -SalPrinter* Kf5Instance::CreatePrinter( SalInfoPrinter* pInfoPrinter ) +SalPrinter* Qt5Instance::CreatePrinter( SalInfoPrinter* pInfoPrinter ) { // create and initialize SalPrinter - Kf5Printer* pPrinter = new Kf5Printer( pInfoPrinter ); - pPrinter->m_aJobData = static_cast<Kf5InfoPrinter*>(pInfoPrinter)->m_aJobData; + Qt5Printer* pPrinter = new Qt5Printer( pInfoPrinter ); + pPrinter->m_aJobData = static_cast<Qt5InfoPrinter*>(pInfoPrinter)->m_aJobData; return pPrinter; } -void Kf5Instance::DestroyPrinter( SalPrinter* pPrinter ) +void Qt5Instance::DestroyPrinter( SalPrinter* pPrinter ) { delete pPrinter; } -void Kf5Instance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) +void Qt5Instance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) { PrinterInfoManager& rManager( PrinterInfoManager::get() ); static const char* pNoSyncDetection = getenv( "SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION" ); @@ -238,26 +238,26 @@ void Kf5Instance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) } } -void Kf5Instance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) +void Qt5Instance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) { delete pInfo; } -void Kf5Instance::GetPrinterQueueState( SalPrinterQueueInfo* ) +void Qt5Instance::GetPrinterQueueState( SalPrinterQueueInfo* ) { } -OUString Kf5Instance::GetDefaultPrinter() +OUString Qt5Instance::GetDefaultPrinter() { PrinterInfoManager& rManager( PrinterInfoManager::get() ); return rManager.getDefaultPrinter(); } -void Kf5Instance::PostPrintersChanged() +void Qt5Instance::PostPrintersChanged() { } -GenPspGraphics *Kf5Instance::CreatePrintGraphics() +GenPspGraphics *Qt5Instance::CreatePrintGraphics() { return new GenPspGraphics(); } diff --git a/vcl/unx/kf5/Kf5Object.cxx b/vcl/qt5/Qt5Object.cxx index 5e9a23b1dd4c..ad7dfea8817e 100644 --- a/vcl/unx/kf5/Kf5Object.cxx +++ b/vcl/qt5/Qt5Object.cxx @@ -17,14 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Object.hxx" +#include "Qt5Object.hxx" -#include "Kf5Frame.hxx" -#include "Kf5Widget.hxx" +#include "Qt5Frame.hxx" #include <QtWidgets/QWidget> -Kf5Object::Kf5Object( Kf5Frame* pParent, bool bShow ) +Qt5Object::Qt5Object( Qt5Frame* pParent, bool bShow ) : m_pParent( pParent ) { if ( !m_pParent || !pParent->GetQWidget() ) @@ -34,11 +33,11 @@ Kf5Object::Kf5Object( Kf5Frame* pParent, bool bShow ) m_pQWidget->show(); } -Kf5Object::~Kf5Object() +Qt5Object::~Qt5Object() { } -void Kf5Object::ResetClipRegion() +void Qt5Object::ResetClipRegion() { if ( m_pQWidget.get() ) m_pRegion = QRegion( m_pQWidget->geometry() ); @@ -46,38 +45,38 @@ void Kf5Object::ResetClipRegion() m_pRegion = QRegion(); } -void Kf5Object::BeginSetClipRegion( sal_uLong ) +void Qt5Object::BeginSetClipRegion( sal_uLong ) { m_pRegion = QRegion(); } -void Kf5Object::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) +void Qt5Object::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) { m_pRegion += QRect( nX, nY, nWidth, nHeight ); } -void Kf5Object::EndSetClipRegion() +void Qt5Object::EndSetClipRegion() { if ( m_pQWidget.get() ) m_pRegion = m_pRegion.intersected( m_pQWidget->geometry() ); } -void Kf5Object::SetPosSize( long nX, long nY, long nWidth, long nHeight ) +void Qt5Object::SetPosSize( long nX, long nY, long nWidth, long nHeight ) { } -void Kf5Object::Show( bool bVisible ) +void Qt5Object::Show( bool bVisible ) { if( m_pQWidget ) m_pQWidget->setVisible( bVisible ); } -void Kf5Object::SetForwardKey( bool bEnable ) +void Qt5Object::SetForwardKey( bool bEnable ) { } -const SystemEnvData* Kf5Object::GetSystemData() const +const SystemEnvData* Qt5Object::GetSystemData() const { return nullptr; } diff --git a/vcl/unx/kf5/Kf5Object.hxx b/vcl/qt5/Qt5Object.hxx index f4eceb770725..b66f55063d2c 100644 --- a/vcl/unx/kf5/Kf5Object.hxx +++ b/vcl/qt5/Qt5Object.hxx @@ -27,18 +27,18 @@ #include <QtGui/QRegion> class QWidget; -class Kf5Frame; +class Qt5Frame; -class Kf5Object : public SalObject +class Qt5Object : public SalObject { SystemEnvData m_aSystemData; std::unique_ptr< QWidget > m_pQWidget; - Kf5Frame* m_pParent; + Qt5Frame* m_pParent; QRegion m_pRegion; public: - Kf5Object( Kf5Frame* pParent, bool bShow ); - virtual ~Kf5Object() override; + Qt5Object( Qt5Frame* pParent, bool bShow ); + virtual ~Qt5Object() override; virtual void ResetClipRegion() override; virtual void BeginSetClipRegion( sal_uLong nRects ) override; diff --git a/vcl/unx/kf5/Kf5Printer.cxx b/vcl/qt5/Qt5Printer.cxx index ffa784280731..ad457a0904ba 100644 --- a/vcl/unx/kf5/Kf5Printer.cxx +++ b/vcl/qt5/Qt5Printer.cxx @@ -17,14 +17,14 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Printer.hxx" +#include "Qt5Printer.hxx" -bool Kf5InfoPrinter::Setup( SalFrame*, ImplJobSetup* ) +bool Qt5InfoPrinter::Setup( SalFrame*, ImplJobSetup* ) { return false; } -Kf5Printer::Kf5Printer( SalInfoPrinter* pInfoPrinter ) +Qt5Printer::Qt5Printer( SalInfoPrinter* pInfoPrinter ) : PspSalPrinter( pInfoPrinter ) { } diff --git a/vcl/unx/kf5/Kf5Printer.hxx b/vcl/qt5/Qt5Printer.hxx index de1487db33a1..635f880561b5 100644 --- a/vcl/unx/kf5/Kf5Printer.hxx +++ b/vcl/qt5/Qt5Printer.hxx @@ -24,16 +24,16 @@ class SalFrame; class ImplJobSetup; -class Kf5InfoPrinter : public PspSalInfoPrinter +class Qt5InfoPrinter : public PspSalInfoPrinter { public: virtual bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) override; }; -class Kf5Printer : public PspSalPrinter +class Qt5Printer : public PspSalPrinter { public: - Kf5Printer( SalInfoPrinter* pInfoPrinter ); + Qt5Printer( SalInfoPrinter* pInfoPrinter ); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/kf5/Kf5Timer.cxx b/vcl/qt5/Qt5Timer.cxx index 4db725ec5ac3..3e0b11bc983e 100644 --- a/vcl/unx/kf5/Kf5Timer.cxx +++ b/vcl/qt5/Qt5Timer.cxx @@ -17,13 +17,13 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Timer.hxx" -#include <Kf5Timer.moc> +#include "Qt5Timer.hxx" +#include <Qt5Timer.moc> #include <QtWidgets/QApplication> #include <QtCore/QThread> -Kf5Timer::Kf5Timer() +Qt5Timer::Qt5Timer() { m_aTimer.setSingleShot( true ); // run the timer itself in the main / creator thread @@ -34,21 +34,21 @@ Kf5Timer::Kf5Timer() this, SLOT( startTimer() ), Qt::QueuedConnection ); } -Kf5Timer::~Kf5Timer() +Qt5Timer::~Qt5Timer() { } -void Kf5Timer::timeoutActivated() +void Qt5Timer::timeoutActivated() { CallCallback(); } -void Kf5Timer::startTimer() +void Qt5Timer::startTimer() { m_aTimer.start(); } -void Kf5Timer::Start( sal_uIntPtr nMS ) +void Qt5Timer::Start( sal_uIntPtr nMS ) { m_aTimer.setInterval( nMS ); if( qApp->thread() == QThread::currentThread() ) @@ -57,7 +57,7 @@ void Kf5Timer::Start( sal_uIntPtr nMS ) Q_EMIT startTimerSignal(); } -void Kf5Timer::Stop() +void Qt5Timer::Stop() { m_aTimer.stop(); } diff --git a/vcl/unx/kf5/Kf5Timer.hxx b/vcl/qt5/Qt5Timer.hxx index 0b08968743d9..cdf890dd86ed 100644 --- a/vcl/unx/kf5/Kf5Timer.hxx +++ b/vcl/qt5/Qt5Timer.hxx @@ -22,7 +22,7 @@ #include <saltimer.hxx> #include <QtCore/QTimer> -class Kf5Timer final : public QObject, public SalTimer +class Qt5Timer final : public QObject, public SalTimer { Q_OBJECT @@ -36,8 +36,8 @@ Q_SIGNALS: void startTimerSignal(); public: - Kf5Timer(); - virtual ~Kf5Timer() override; + Qt5Timer(); + virtual ~Qt5Timer() override; virtual void Start( sal_uIntPtr nMS ) override; virtual void Stop() override; diff --git a/vcl/unx/kf5/Kf5Tools.hxx b/vcl/qt5/Qt5Tools.hxx index 40c34d9d4303..40c34d9d4303 100644 --- a/vcl/unx/kf5/Kf5Tools.hxx +++ b/vcl/qt5/Qt5Tools.hxx diff --git a/vcl/unx/kf5/Kf5VirtualDevice.cxx b/vcl/qt5/Qt5VirtualDevice.cxx index 9c0e4864a55c..10f286049456 100644 --- a/vcl/unx/kf5/Kf5VirtualDevice.cxx +++ b/vcl/qt5/Qt5VirtualDevice.cxx @@ -17,40 +17,42 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5VirtualDevice.hxx" +#include "Qt5VirtualDevice.hxx" -#include "Kf5Graphics.hxx" +#include "Qt5Graphics.hxx" #include <QtGui/QImage> -Kf5VirtualDevice::Kf5VirtualDevice( DeviceFormat eFormat, double fScale ) +Qt5VirtualDevice::Qt5VirtualDevice( DeviceFormat eFormat, double fScale ) + : m_eFormat( eFormat ) + , m_fScale( fScale ) { } -Kf5VirtualDevice::~Kf5VirtualDevice() +Qt5VirtualDevice::~Qt5VirtualDevice() { } -SalGraphics* Kf5VirtualDevice::AcquireGraphics() +SalGraphics* Qt5VirtualDevice::AcquireGraphics() { assert( m_pImage ); - Kf5Graphics* pGraphics = new Kf5Graphics( m_pImage.get() ); + Qt5Graphics* pGraphics = new Qt5Graphics( m_pImage.get() ); m_aGraphics.push_back( pGraphics ); return pGraphics; } -void Kf5VirtualDevice::ReleaseGraphics( SalGraphics* pGraphics ) +void Qt5VirtualDevice::ReleaseGraphics( SalGraphics* pGraphics ) { - m_aGraphics.remove( dynamic_cast<Kf5Graphics*>( pGraphics ) ); + m_aGraphics.remove( dynamic_cast<Qt5Graphics*>( pGraphics ) ); delete pGraphics; } -bool Kf5VirtualDevice::SetSize( long nNewDX, long nNewDY ) +bool Qt5VirtualDevice::SetSize( long nNewDX, long nNewDY ) { return SetSizeUsingBuffer( nNewDX, nNewDY, nullptr ); } -bool Kf5VirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, +bool Qt5VirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, sal_uInt8 * pBuffer ) { if( nNewDX == 0 ) @@ -82,18 +84,18 @@ bool Kf5VirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, m_pImage->setDevicePixelRatio( m_fScale ); // update device in existing graphics - for( auto pKf5Graph : m_aGraphics ) - pKf5Graph->ChangeQImage( m_pImage.get() ); + for( auto pQt5Graph : m_aGraphics ) + pQt5Graph->ChangeQImage( m_pImage.get() ); return true; } -long Kf5VirtualDevice::GetWidth() const +long Qt5VirtualDevice::GetWidth() const { return m_pImage ? m_aFrameSize.getX() : 0; } -long Kf5VirtualDevice::GetHeight() const +long Qt5VirtualDevice::GetHeight() const { return m_pImage ? m_aFrameSize.getY() : 0; } diff --git a/vcl/unx/kf5/Kf5VirtualDevice.hxx b/vcl/qt5/Qt5VirtualDevice.hxx index 7b50a6e7d2dc..23d464d43751 100644 --- a/vcl/unx/kf5/Kf5VirtualDevice.hxx +++ b/vcl/qt5/Qt5VirtualDevice.hxx @@ -25,21 +25,21 @@ #include <memory> #include <list> -class Kf5Graphics; +class Qt5Graphics; class QImage; enum class DeviceFormat; -class Kf5VirtualDevice : public SalVirtualDevice +class Qt5VirtualDevice : public SalVirtualDevice { - std::list< Kf5Graphics* > m_aGraphics; + std::list< Qt5Graphics* > m_aGraphics; std::unique_ptr< QImage > m_pImage; DeviceFormat m_eFormat; basegfx::B2IVector m_aFrameSize; double m_fScale; public: - Kf5VirtualDevice( DeviceFormat eFormat, double fScale ); - virtual ~Kf5VirtualDevice() override; + Qt5VirtualDevice( DeviceFormat eFormat, double fScale ); + virtual ~Qt5VirtualDevice() override; // SalVirtualDevice virtual SalGraphics* AcquireGraphics() override; diff --git a/vcl/unx/kf5/Kf5Widget.cxx b/vcl/qt5/Qt5Widget.cxx index f40a2e85a2cb..739708148876 100644 --- a/vcl/unx/kf5/Kf5Widget.cxx +++ b/vcl/qt5/Qt5Widget.cxx @@ -17,34 +17,34 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include "Kf5Widget.hxx" -#include <Kf5Widget.moc> +#include "Qt5Widget.hxx" +#include <Qt5Widget.moc> -#include "Kf5Frame.hxx" -#include "Kf5Graphics.hxx" +#include "Qt5Frame.hxx" +#include "Qt5Graphics.hxx" #include <QtGui/QImage> #include <QtGui/QPainter> #include <QtGui/QPaintEvent> -Kf5Widget::Kf5Widget( Kf5Frame &rFrame, QWidget *parent, Qt::WindowFlags f ) +Qt5Widget::Qt5Widget( Qt5Frame &rFrame, QWidget *parent, Qt::WindowFlags f ) : QWidget( parent, f ) , m_pFrame( &rFrame ) { create(); } -Kf5Widget::~Kf5Widget() +Qt5Widget::~Qt5Widget() { } -void Kf5Widget::paintEvent( QPaintEvent *pEvent ) +void Qt5Widget::paintEvent( QPaintEvent *pEvent ) { QPainter p( this ); p.drawImage( pEvent->rect().topLeft(), *m_pFrame->m_pQImage, pEvent->rect() ); } -void Kf5Widget::resizeEvent( QResizeEvent* ) +void Qt5Widget::resizeEvent( QResizeEvent* ) { QImage *pImage = new QImage( m_pFrame->m_pQWidget->size(), QImage::Format_ARGB32 ); m_pFrame->m_pGraphics->ChangeQImage( pImage ); diff --git a/vcl/unx/kf5/Kf5Widget.hxx b/vcl/qt5/Qt5Widget.hxx index 60296a620fe8..3f6b32dfd613 100644 --- a/vcl/unx/kf5/Kf5Widget.hxx +++ b/vcl/qt5/Qt5Widget.hxx @@ -21,25 +21,26 @@ #include <QtWidgets/QWidget> -class Kf5Frame; +class Qt5Frame; +class Qt5Object; class QPaintEvent; class QResizeEvent; -class Kf5Widget +class Qt5Widget : public QWidget { Q_OBJECT - Kf5Frame *m_pFrame; + Qt5Frame *m_pFrame; void paintEvent( QPaintEvent* ) override; void resizeEvent( QResizeEvent* ) override; public: - Kf5Widget( Kf5Frame &rFrame, + Qt5Widget( Qt5Frame &rFrame, QWidget *parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags() ); - virtual ~Kf5Widget() override; + virtual ~Qt5Widget() override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/tst_exclude_posted_events.hxx b/vcl/qt5/tst_exclude_posted_events.hxx new file mode 100644 index 000000000000..c07ca895a9dc --- /dev/null +++ b/vcl/qt5/tst_exclude_posted_events.hxx @@ -0,0 +1,67 @@ +/* -*- 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 . + * + * This code is based on the SocketEventsTester from the Qt4 test suite. + */ + +#pragma once + +#include <QtCore/QCoreApplication> +#include <QtCore/QEventLoop> + +const QEvent::Type eventType = QEvent::User; + +class TestExcludePostedEvents + : public QObject +{ + Q_OBJECT + public: + TestExcludePostedEvents(); + virtual bool event( QEvent* e ) override; + bool processed; +}; + +TestExcludePostedEvents::TestExcludePostedEvents() + : processed( false ) +{ +} + +bool TestExcludePostedEvents::event( QEvent* e ) +{ + if( e->type() == eventType ) + processed = true; + return QObject::event( e ); +} + +#define QVERIFY(a) \ + if (!a) return 1; + +static int tst_excludePostedEvents() +{ + TestExcludePostedEvents test; + QCoreApplication::postEvent( &test, new QEvent( eventType )); + QEventLoop loop; + loop.processEvents(QEventLoop::ExcludeUserInputEvents + | QEventLoop::ExcludeSocketNotifiers +// | QEventLoop::WaitForMoreEvents + | QEventLoop::X11ExcludeTimers); + QVERIFY( !test.processed ); + loop.processEvents(); + QVERIFY( test.processed ); + return 0; +} diff --git a/vcl/qt5/tst_exclude_socket_notifiers.hxx b/vcl/qt5/tst_exclude_socket_notifiers.hxx new file mode 100644 index 000000000000..d0acafede239 --- /dev/null +++ b/vcl/qt5/tst_exclude_socket_notifiers.hxx @@ -0,0 +1,80 @@ +/* -*- 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 . + * + * This code is based on the SocketEventsTester from the Qt4 test suite. + */ + +#pragma once + +#include <QtCore/QCoreApplication> +#include <QtCore/QEventLoop> +#include <QtCore/QSocketNotifier> +#include <unistd.h> + +class TestExcludeSocketNotifiers + : public QObject +{ + Q_OBJECT + public: + TestExcludeSocketNotifiers( const int* pipes ); + virtual ~TestExcludeSocketNotifiers() override; + bool received; + public slots: + void slotReceived(); + private: + const int* pipes; +}; + +TestExcludeSocketNotifiers::TestExcludeSocketNotifiers( const int* thePipes ) + : received( false ) + , pipes( thePipes ) +{ +} + +TestExcludeSocketNotifiers::~TestExcludeSocketNotifiers() +{ + close( pipes[ 0 ] ); + close( pipes[ 1 ] ); +} + +void TestExcludeSocketNotifiers::slotReceived() +{ + received = true; +} + +#define QVERIFY(a) \ + if (!a) return 1; + +static int tst_processEventsExcludeSocket() +{ + int pipes[ 2 ]; + if( pipe( pipes ) < 0 ) + return 1; + TestExcludeSocketNotifiers test( pipes ); + QSocketNotifier notifier( pipes[ 0 ], QSocketNotifier::Read ); + QObject::connect( ¬ifier, SIGNAL( activated( int )), &test, SLOT( slotReceived())); + char dummy = 'a'; + if( 1 != write( pipes[ 1 ], &dummy, 1 ) ) + return 1; + QEventLoop loop; + loop.processEvents( QEventLoop::ExcludeSocketNotifiers ); + QVERIFY( !test.received ); + loop.processEvents(); + QVERIFY( test.received ); + return 0; +} |