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
This commit is contained in:
Jan-Marek Glogowski
2017-10-30 18:45:46 +01:00
committed by Thorsten Behrens
parent bc00fcc0a0
commit 2ffb83daa4
43 changed files with 587 additions and 443 deletions

View File

@@ -290,7 +290,7 @@ $(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,kde, \
$(if $(ENABLE_KDE4),kde4be1) \ $(if $(ENABLE_KDE4),kde4be1) \
$(if $(USING_X11), \ $(if $(USING_X11), \
$(if $(ENABLE_KDE4),vclplug_kde4) \ $(if $(ENABLE_KDE4),vclplug_kde4) \
$(if $(ENABLE_KF5),vclplug_kf5) \ $(if $(ENABLE_QT5),vclplug_qt5) \
) \ ) \
)) ))

View File

@@ -3066,20 +3066,20 @@ endef
endif # ENABLE_KDE4 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),\ $(call gb_LinkTarget_set_include,$(1),\
$(subst -isystem/,-isystem /,$(filter -I% -isystem%,$(subst -isystem /,-isystem/,$(KF5_CFLAGS)))) \ $(subst -isystem/,-isystem /,$(filter -I% -isystem%,$(subst -isystem /,-isystem/,$(QT5_CFLAGS)))) \
$$(INCLUDE) \ $$(INCLUDE) \
) )
$(call gb_LinkTarget_add_defs,$(1),\ $(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),\ $(call gb_LinkTarget_add_libs,$(1),\
$(KF5_LIBS) \ $(QT5_LIBS) \
) )
ifeq ($(COM),GCC) ifeq ($(COM),GCC)
@@ -3090,13 +3090,13 @@ endif
endef endef
else # !ENABLE_KF5 else # !ENABLE_QT5
define gb_LinkTarget__use_kf5 define gb_LinkTarget__use_qt5
endef endef
endif # ENABLE_KF5 endif # ENABLE_QT5
# PYTHON # PYTHON
# extra python_headers external because pyuno wrapper must not link python # extra python_headers external because pyuno wrapper must not link python

View File

@@ -135,7 +135,6 @@ export ENABLE_GTK_PRINT=@ENABLE_GTK_PRINT@
export ENABLE_HEADLESS=@ENABLE_HEADLESS@ export ENABLE_HEADLESS=@ENABLE_HEADLESS@
export ENABLE_JAVA=@ENABLE_JAVA@ export ENABLE_JAVA=@ENABLE_JAVA@
export ENABLE_KDE4=@ENABLE_KDE4@ export ENABLE_KDE4=@ENABLE_KDE4@
export ENABLE_KF5=@ENABLE_KF5@
export ENABLE_LPSOLVE=@ENABLE_LPSOLVE@ export ENABLE_LPSOLVE=@ENABLE_LPSOLVE@
export ENABLE_LTO=@ENABLE_LTO@ export ENABLE_LTO=@ENABLE_LTO@
export ENABLE_LWP=@ENABLE_LWP@ export ENABLE_LWP=@ENABLE_LWP@

View File

@@ -571,7 +571,6 @@ linux-gnu*|k*bsd*-gnu*)
build_gstreamer_1_0=yes build_gstreamer_1_0=yes
build_gstreamer_0_10=yes build_gstreamer_0_10=yes
test_kde4=yes test_kde4=yes
test_kf5=yes
test_qt5=yes test_qt5=yes
if test "$enable_fuzzers" != yes; then if test "$enable_fuzzers" != yes; then
test_freetype=yes test_freetype=yes
@@ -666,7 +665,6 @@ freebsd*)
build_gstreamer_1_0=yes build_gstreamer_1_0=yes
build_gstreamer_0_10=yes build_gstreamer_0_10=yes
test_kde4=yes test_kde4=yes
test_kf5=yes
test_qt5=yes test_qt5=yes
test_freetype=yes test_freetype=yes
AC_MSG_CHECKING([the FreeBSD operating system release]) AC_MSG_CHECKING([the FreeBSD operating system release])
@@ -696,7 +694,6 @@ freebsd*)
build_gstreamer_1_0=yes build_gstreamer_1_0=yes
build_gstreamer_0_10=yes build_gstreamer_0_10=yes
test_kde4=yes test_kde4=yes
test_kf5=yes
test_qt5=yes test_qt5=yes
test_freetype=yes test_freetype=yes
PTHREAD_LIBS="-pthread -lpthread" PTHREAD_LIBS="-pthread -lpthread"
@@ -723,7 +720,6 @@ dragonfly*)
build_gstreamer_1_0=yes build_gstreamer_1_0=yes
build_gstreamer_0_10=yes build_gstreamer_0_10=yes
test_kde4=yes test_kde4=yes
test_kf5=yes
test_qt5=yes test_qt5=yes
test_freetype=yes test_freetype=yes
PTHREAD_LIBS="-pthread" PTHREAD_LIBS="-pthread"
@@ -748,7 +744,6 @@ linux-android*)
test_freetype=no test_freetype=no
test_gtk=no test_gtk=no
test_kde4=no test_kde4=no
test_kf5=no
test_qt5=no test_qt5=no
test_randr=no test_randr=no
test_xrender=no test_xrender=no
@@ -1187,10 +1182,10 @@ AC_ARG_ENABLE(kde4,
KDE4 are available.]), KDE4 are available.]),
,) ,)
AC_ARG_ENABLE(kf5, AC_ARG_ENABLE(qt5,
AS_HELP_STRING([--enable-kf5], AS_HELP_STRING([--enable-qt5],
[Determines whether to use KF5 vclplug on platforms where Qt5 and [Determines whether to use Qt5 vclplug on platforms where Qt5 is
KF5 are available.]), available.]),
,) ,)
libo_FUZZ_ARG_ENABLE(gui, libo_FUZZ_ARG_ENABLE(gui,
@@ -4516,7 +4511,6 @@ if test "$USING_X11" != TRUE; then
build_gstreamer_1_0=no build_gstreamer_1_0=no
build_gstreamer_0_10=no build_gstreamer_0_10=no
test_kde4=no test_kde4=no
test_kf5=no
test_qt5=no test_qt5=no
enable_cairo_canvas=no enable_cairo_canvas=no
fi fi
@@ -9764,13 +9758,13 @@ if test "x$enable_kde4" = "xyes"; then
fi fi
AC_SUBST(ENABLE_KDE4) AC_SUBST(ENABLE_KDE4)
ENABLE_KF5="" ENABLE_QT5=""
if test "x$enable_kf5" = "xyes"; then if test "x$enable_qt5" = "xyes"; then
ENABLE_KF5="TRUE" ENABLE_QT5="TRUE"
AC_DEFINE(ENABLE_KF5) AC_DEFINE(ENABLE_QT5)
R="$R kf5" R="$R qt5"
fi fi
AC_SUBST(ENABLE_KF5) AC_SUBST(ENABLE_QT5)
build_vcl_plugins="$R" build_vcl_plugins="$R"
if test -z "$build_vcl_plugins"; then if test -z "$build_vcl_plugins"; then
@@ -10550,7 +10544,7 @@ if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE"; then
else else
qmake4_test_ver="`$QMAKE4 -v 2>&1 | sed -n -e '/^Using Qt version 4\./p'`" qmake4_test_ver="`$QMAKE4 -v 2>&1 | sed -n -e '/^Using Qt version 4\./p'`"
if test -z "$qmake4_test_ver"; then 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
fi fi
@@ -10761,7 +10755,6 @@ QT5_GLIB_CFLAGS=""
QT5_GLIB_LIBS="" QT5_GLIB_LIBS=""
QT5_HAVE_GLIB="" QT5_HAVE_GLIB=""
if test \( "$test_kde5" = "yes" -a "$ENABLE_KDE5" = "TRUE" \) -o \ 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" \) \( "$test_qt5" = "yes" -a "$ENABLE_QT5" = "TRUE" \)
then then
qt5_incdirs="$QT5INC /usr/include/qt5 /usr/include $x_includes" 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]) AC_MSG_CHECKING([whether Qt has fixed ExcludeSocketNotifiers])
# Prepare meta object data # Prepare meta object data
TSTBASE="tst_exclude_socket_notifiers" TSTBASE="tst_exclude_socket_notifiers"
TSTMOC="${SRC_ROOT}/vcl/unx/kde5/${TSTBASE}" TSTMOC="${SRC_ROOT}/vcl/unx/qt5/${TSTBASE}"
ln -fs "${TSTMOC}.hxx" ln -fs "${TSTMOC}.hxx"
$MOC5 "${TSTBASE}.hxx" -o "${TSTBASE}.moc" $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]) AC_MSG_CHECKING([whether Qt avoids QClipboard recursion caused by posted events])
# Prepare meta object data # Prepare meta object data
TSTBASE="tst_exclude_posted_events" TSTBASE="tst_exclude_posted_events"
TSTMOC="${SRC_ROOT}/vcl/unx/kde5/${TSTBASE}" TSTMOC="${SRC_ROOT}/vcl/unx/qt5/${TSTBASE}"
ln -fs "${TSTMOC}.hxx" ln -fs "${TSTMOC}.hxx"
$MOC5 "${TSTBASE}.hxx" -o "${TSTBASE}.moc" $MOC5 "${TSTBASE}.hxx" -o "${TSTBASE}.moc"
@@ -10923,8 +10916,8 @@ int main(int argc, char *argv[])
CXX=$save_CXX CXX=$save_CXX
AC_LANG_POP([C++]) 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 fi
AC_SUBST(QT5_CFLAGS) AC_SUBST(QT5_CFLAGS)
AC_SUBST(QT5_LIBS) AC_SUBST(QT5_LIBS)

View File

@@ -463,7 +463,6 @@ certain functionality.
@li @c vcl.icontest @li @c vcl.icontest
@li @c vcl.kde4 - KDE4 @li @c vcl.kde4 - KDE4
@li @c vcl.kde5 - KDE5 @li @c vcl.kde5 - KDE5
@li @c vcl.kf5 - KF5
@li @c vcl.layout - Widget layout @li @c vcl.layout - Widget layout
@li @c vcl.lazydelete @li @c vcl.lazydelete
@li @c vcl.opengl @li @c vcl.opengl
@@ -471,6 +470,7 @@ certain functionality.
@li @c vcl.osx.print @li @c vcl.osx.print
@li @c vcl.pdfwriter @li @c vcl.pdfwriter
@li @c vcl.plugadapt - the Unix/X11 backend plugin mechanism @li @c vcl.plugadapt - the Unix/X11 backend plugin mechanism
@li @c vcl.qt5 - QT5
@li @c vcl.quartz @li @c vcl.quartz
@li @c vcl.schedule - scheduler / main-loop information @li @c vcl.schedule - scheduler / main-loop information
@li @c vcl.schedule.deinit @li @c vcl.schedule.deinit

View File

@@ -35,7 +35,7 @@ $(eval $(call gb_InstallScript_use_modules,setup_osl,\
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\ $(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\
scp2/gnome \ scp2/gnome \
) \ ) \
$(if $(filter TRUE,$(ENABLE_KDE4) $(ENABLE_KF5)),\ $(if $(filter TRUE,$(ENABLE_KDE4) $(ENABLE_QT5)),\
scp2/kde \ scp2/kde \
) \ ) \
$(if $(filter TRUE,$(ENABLE_ONLINE_UPDATE)),\ $(if $(filter TRUE,$(ENABLE_ONLINE_UPDATE)),\

View File

@@ -39,7 +39,7 @@ $(eval $(call gb_Module_add_targets,scp2,\
$(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\ $(if $(filter TRUE,$(ENABLE_EVOAB2) $(ENABLE_GIO) $(ENABLE_GTK) $(ENABLE_GTK3)),\
InstallModule_gnome \ InstallModule_gnome \
) \ ) \
$(if $(filter TRUE,$(ENABLE_KDE4) $(ENABLE_KF5)),\ $(if $(filter TRUE,$(ENABLE_KDE4) $(ENABLE_QT5)),\
InstallModule_kde \ InstallModule_kde \
) \ ) \
)) ))

View File

@@ -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_GTK),$(call gb_Library_get_target,vclplug_gtk)) \
$(if $(ENABLE_GTK3),$(call gb_Library_get_target,vclplug_gtk3)) \ $(if $(ENABLE_GTK3),$(call gb_Library_get_target,vclplug_gtk3)) \
$(if $(ENABLE_KDE4),$(call gb_Library_get_target,vclplug_kde4)) \ $(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 endif

View File

@@ -14,7 +14,7 @@ ifeq ($(ENABLE_GIO),TRUE)
brand_URIPARAM := --urls brand_URIPARAM := --urls
else ifeq ($(ENABLE_KDE4),TRUE) else ifeq ($(ENABLE_KDE4),TRUE)
brand_URIPARAM := --urls brand_URIPARAM := --urls
else ifeq ($(ENABLE_KF5),TRUE) else ifeq ($(ENABLE_QT5),TRUE)
brand_URIPARAM := --urls brand_URIPARAM := --urls
else else
brand_URIPARAM := brand_URIPARAM :=

View File

@@ -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:

View File

@@ -17,24 +17,24 @@
# the License at http://www.apache.org/licenses/LICENSE-2.0 . # 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) \ $$(INCLUDE) \
-I$(SRCDIR)/vcl/inc \ -I$(SRCDIR)/vcl/inc \
)) ))
$(eval $(call gb_Library_add_defs,vclplug_kf5,\ $(eval $(call gb_Library_add_defs,vclplug_qt5,\
-DVCLPLUG_KF5_IMPLEMENTATION \ -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 \ vclplug_gen \
vcl \ vcl \
tl \ tl \
@@ -52,49 +52,49 @@ $(eval $(call gb_Library_use_libraries,vclplug_kf5,\
sal \ sal \
)) ))
$(eval $(call gb_Library_use_externals,vclplug_kf5,\ $(eval $(call gb_Library_use_externals,vclplug_qt5,\
boost_headers \ boost_headers \
icuuc \ icuuc \
kf5 \ qt5 \
epoxy \ 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),) ifneq ($(QT5_HAVE_GLIB),)
$(eval $(call gb_Library_add_defs,vclplug_kf5,\ $(eval $(call gb_Library_add_defs,vclplug_qt5,\
$(QT5_GLIB_CFLAGS) \ $(QT5_GLIB_CFLAGS) \
)) ))
$(eval $(call gb_Library_add_libs,vclplug_kf5,\ $(eval $(call gb_Library_add_libs,vclplug_qt5,\
$(QT5_GLIB_LIBS) \ $(QT5_GLIB_LIBS) \
)) ))
endif endif
$(eval $(call gb_Library_add_defs,vclplug_kf5,\ $(eval $(call gb_Library_add_exception_objects,vclplug_qt5,\
$(KF5_CFLAGS) \ vcl/qt5/Qt5Bitmap \
)) vcl/qt5/Qt5Data \
$(eval $(call gb_Library_add_libs,vclplug_kf5,\ vcl/qt5/Qt5Frame \
$(KF5_LIBS) \ vcl/qt5/Qt5FontFace \
)) vcl/qt5/Qt5Graphics \
vcl/qt5/Qt5Graphics_Controls \
$(eval $(call gb_Library_add_exception_objects,vclplug_kf5,\ vcl/qt5/Qt5Graphics_GDI \
vcl/unx/kf5/Kf5Bitmap \ vcl/qt5/Qt5Graphics_Text \
vcl/unx/kf5/Kf5Data \ vcl/qt5/Qt5Instance \
vcl/unx/kf5/Kf5Frame \ vcl/qt5/Qt5Instance_Print \
vcl/unx/kf5/Kf5FontFace \ vcl/qt5/Qt5Object \
vcl/unx/kf5/Kf5Graphics \ vcl/qt5/Qt5Printer \
vcl/unx/kf5/Kf5Graphics_Controls \ vcl/qt5/Qt5Timer \
vcl/unx/kf5/Kf5Graphics_GDI \ vcl/qt5/Qt5VirtualDevice \
vcl/unx/kf5/Kf5Graphics_Text \ vcl/qt5/Qt5Widget \
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 \
)) ))
ifeq ($(OS),LINUX) ifeq ($(OS),LINUX)
$(eval $(call gb_Library_add_libs,vclplug_kf5,\ $(eval $(call gb_Library_add_libs,vclplug_qt5,\
-lm \ -lm \
-ldl \ -ldl \
-lpthread \ -lpthread \

View File

@@ -87,10 +87,10 @@ $(eval $(call gb_Module_add_targets,vcl,\
Library_vclplug_kde5 \ Library_vclplug_kde5 \
)) ))
endif endif
ifneq ($(ENABLE_KF5),) ifneq ($(ENABLE_QT5),)
$(eval $(call gb_Module_add_targets,vcl,\ $(eval $(call gb_Module_add_targets,vcl,\
CustomTarget_kf5_moc \ CustomTarget_qt5_moc \
Library_vclplug_kf5 \ Library_vclplug_qt5 \
)) ))
endif endif
endif endif

View File

@@ -23,7 +23,7 @@ enum GenericUnixSalDataType { SAL_DATA_GTK, SAL_DATA_GTK3,
SAL_DATA_KDE4, SAL_DATA_KDE5, SAL_DATA_KDE4, SAL_DATA_KDE5,
SAL_DATA_UNX, SAL_DATA_SVP, SAL_DATA_UNX, SAL_DATA_SVP,
SAL_DATA_ANDROID, SAL_DATA_IOS, SAL_DATA_ANDROID, SAL_DATA_IOS,
SAL_DATA_HEADLESS, SAL_DATA_KF5 }; SAL_DATA_HEADLESS, SAL_DATA_QT5 };
class VCL_DLLPUBLIC GenericUnixSalData : public SalData class VCL_DLLPUBLIC GenericUnixSalData : public SalData
{ {

View File

@@ -41,10 +41,10 @@
#define VCLPLUG_KDE4_PUBLIC SAL_DLLPUBLIC_IMPORT #define VCLPLUG_KDE4_PUBLIC SAL_DLLPUBLIC_IMPORT
#endif #endif
#if defined VCLPLUG_KF5_IMPLEMENTATION #if defined VCLPLUG_QT5_IMPLEMENTATION
#define VCLPLUG_KF5_PUBLIC SAL_DLLPUBLIC_EXPORT #define VCLPLUG_QT5_PUBLIC SAL_DLLPUBLIC_EXPORT
#else #else
#define VCLPLUG_KF5_PUBLIC SAL_DLLPUBLIC_IMPORT #define VCLPLUG_QT5_PUBLIC SAL_DLLPUBLIC_IMPORT
#endif #endif
#if defined VCLPLUG_SVP_IMPLEMENTATION #if defined VCLPLUG_SVP_IMPLEMENTATION

View File

@@ -17,28 +17,28 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Bitmap.hxx" #include "Qt5Bitmap.hxx"
#include "Kf5Tools.hxx" #include "Qt5Tools.hxx"
#include "Kf5Graphics.hxx" #include "Qt5Graphics.hxx"
#include <QtGui/QImage> #include <QtGui/QImage>
#include <QtCore/QVector> #include <QtCore/QVector>
#include <QtGui/QColor> #include <QtGui/QColor>
Kf5Bitmap::Kf5Bitmap() Qt5Bitmap::Qt5Bitmap()
{ {
} }
Kf5Bitmap::Kf5Bitmap( const QImage &rImage ) Qt5Bitmap::Qt5Bitmap( const QImage &rImage )
{ {
m_pImage.reset( new 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 ) const BitmapPalette& rPal )
{ {
assert( assert(
@@ -83,9 +83,9 @@ bool Kf5Bitmap::Create( const Size& rSize, sal_uInt16 nBitCount,
return true; 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() ) if ( pBitmap->m_pImage.get() )
{ {
m_pImage.reset( new QImage( *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; return true;
} }
bool Kf5Bitmap::Create( const SalBitmap& rSalBmp, bool Qt5Bitmap::Create( const SalBitmap& rSalBmp,
SalGraphics* pSalGraphics ) SalGraphics* pSalGraphics )
{ {
const Kf5Bitmap *pBitmap = static_cast< const Kf5Bitmap *>( &rSalBmp ); const Qt5Bitmap *pBitmap = static_cast< const Qt5Bitmap *>( &rSalBmp );
Kf5Graphics *pGraphics = static_cast< Kf5Graphics* >( pSalGraphics ); Qt5Graphics *pGraphics = static_cast< Qt5Graphics* >( pSalGraphics );
QImage *pImage = pGraphics->m_pQImage; QImage *pImage = pGraphics->m_pQImage;
m_pImage.reset( new QImage( pBitmap->m_pImage->convertToFormat( pImage->format() ) ) ); m_pImage.reset( new QImage( pBitmap->m_pImage->convertToFormat( pImage->format() ) ) );
m_pBuffer.reset(); m_pBuffer.reset();
return true; return true;
} }
bool Kf5Bitmap::Create( const SalBitmap& rSalBmp, bool Qt5Bitmap::Create( const SalBitmap& rSalBmp,
sal_uInt16 nNewBitCount ) sal_uInt16 nNewBitCount )
{ {
assert( assert(
@@ -126,7 +126,7 @@ bool Kf5Bitmap::Create( const SalBitmap& rSalBmp,
|| nNewBitCount == 32) || nNewBitCount == 32)
&& "Unsupported BitCount!"); && "Unsupported BitCount!");
const Kf5Bitmap *pBitmap = static_cast< const Kf5Bitmap *>( &rSalBmp ); const Qt5Bitmap *pBitmap = static_cast< const Qt5Bitmap *>( &rSalBmp );
if ( pBitmap->m_pBuffer.get() ) if ( pBitmap->m_pBuffer.get() )
return false; return false;
@@ -134,19 +134,19 @@ bool Kf5Bitmap::Create( const SalBitmap& rSalBmp,
return true; 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 ) Size& rSize, bool bMask )
{ {
return false; return false;
} }
void Kf5Bitmap::Destroy() void Qt5Bitmap::Destroy()
{ {
m_pImage.reset(); m_pImage.reset();
m_pBuffer.reset(); m_pBuffer.reset();
} }
Size Kf5Bitmap::GetSize() const Size Qt5Bitmap::GetSize() const
{ {
if ( m_pBuffer.get() ) if ( m_pBuffer.get() )
return m_aSize; return m_aSize;
@@ -155,7 +155,7 @@ Size Kf5Bitmap::GetSize() const
return Size(); return Size();
} }
sal_uInt16 Kf5Bitmap::GetBitCount() const sal_uInt16 Qt5Bitmap::GetBitCount() const
{ {
if ( m_pBuffer.get() ) if ( m_pBuffer.get() )
return 4; return 4;
@@ -164,7 +164,7 @@ sal_uInt16 Kf5Bitmap::GetBitCount() const
return 0; return 0;
} }
BitmapBuffer* Kf5Bitmap::AcquireBuffer( BitmapAccessMode nMode ) BitmapBuffer* Qt5Bitmap::AcquireBuffer( BitmapAccessMode nMode )
{ {
static const BitmapPalette aEmptyPalette; static const BitmapPalette aEmptyPalette;
@@ -236,28 +236,28 @@ BitmapBuffer* Kf5Bitmap::AcquireBuffer( BitmapAccessMode nMode )
return pBuffer; return pBuffer;
} }
void Kf5Bitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode ) void Qt5Bitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode )
{ {
m_aPalette = pBuffer->maPalette; m_aPalette = pBuffer->maPalette;
delete pBuffer; delete pBuffer;
} }
bool Kf5Bitmap::GetSystemData( BitmapSystemData& rData ) bool Qt5Bitmap::GetSystemData( BitmapSystemData& rData )
{ {
return false; return false;
} }
bool Kf5Bitmap::ScalingSupported() const bool Qt5Bitmap::ScalingSupported() const
{ {
return false; 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; 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; return false;
} }

View File

@@ -25,7 +25,7 @@
class QImage; class QImage;
class VCL_DLLPUBLIC Kf5Bitmap : public SalBitmap class VCL_DLLPUBLIC Qt5Bitmap : public SalBitmap
{ {
std::unique_ptr< QImage > m_pImage; std::unique_ptr< QImage > m_pImage;
BitmapPalette m_aPalette; BitmapPalette m_aPalette;
@@ -36,9 +36,9 @@ class VCL_DLLPUBLIC Kf5Bitmap : public SalBitmap
sal_uInt32 m_nScanline; sal_uInt32 m_nScanline;
public: public:
Kf5Bitmap(); Qt5Bitmap();
Kf5Bitmap( const QImage& rQImage ); Qt5Bitmap( const QImage& rQImage );
virtual ~Kf5Bitmap() override; virtual ~Qt5Bitmap() override;
const QImage* GetQImage() const { return m_pImage.get(); } const QImage* GetQImage() const { return m_pImage.get(); }

View File

@@ -20,10 +20,10 @@
#include <QtWidgets/QStyle> #include <QtWidgets/QStyle>
#include <QtWidgets/QApplication> #include <QtWidgets/QApplication>
#include "Kf5Data.hxx" #include "Qt5Data.hxx"
Kf5Data::Kf5Data( SalInstance *pInstance ) Qt5Data::Qt5Data( SalInstance *pInstance )
: GenericUnixSalData( SAL_DATA_KF5, pInstance ) : GenericUnixSalData( SAL_DATA_QT5, pInstance )
{ {
ImplSVData *pSVData = ImplGetSVData(); ImplSVData *pSVData = ImplGetSVData();
@@ -33,15 +33,15 @@ Kf5Data::Kf5Data( SalInstance *pInstance )
pSVData->maNWFData.mbFlatMenu = true; 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; return false;
} }

View File

@@ -21,11 +21,11 @@
#include <unx/gendata.hxx> #include <unx/gendata.hxx>
class Kf5Data : public GenericUnixSalData class Qt5Data : public GenericUnixSalData
{ {
public: public:
explicit Kf5Data( SalInstance *pInstance ); explicit Qt5Data( SalInstance *pInstance );
virtual ~Kf5Data() override; virtual ~Qt5Data() override;
virtual void ErrorTrapPush() override; virtual void ErrorTrapPush() override;
virtual bool ErrorTrapPop( bool bIgnoreError = true ) override; virtual bool ErrorTrapPop( bool bIgnoreError = true ) override;

View File

@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5FontFace.hxx" #include "Qt5FontFace.hxx"
#include "Kf5Tools.hxx" #include "Qt5Tools.hxx"
#include <sft.hxx> #include <sft.hxx>
#include <impfontcharmap.hxx> #include <impfontcharmap.hxx>
@@ -31,7 +31,7 @@
using namespace vcl; using namespace vcl;
Kf5FontFace::Kf5FontFace( const Kf5FontFace& rSrc ) Qt5FontFace::Qt5FontFace( const Qt5FontFace& rSrc )
: PhysicalFontFace( rSrc ) : PhysicalFontFace( rSrc )
, m_aFontId( rSrc.m_aFontId ) , m_aFontId( rSrc.m_aFontId )
{ {
@@ -39,33 +39,33 @@ Kf5FontFace::Kf5FontFace( const Kf5FontFace& rSrc )
m_xCharMap = rSrc.m_xCharMap; m_xCharMap = rSrc.m_xCharMap;
} }
Kf5FontFace* Kf5FontFace::fromQFont( const QFont &rFont ) Qt5FontFace* Qt5FontFace::fromQFont( const QFont &rFont )
{ {
FontAttributes aFA; FontAttributes aFA;
aFA.SetFamilyName( toOUString( rFont.family() ) ); aFA.SetFamilyName( toOUString( rFont.family() ) );
aFA.SetStyleName( toOUString( rFont.styleName() ) ); aFA.SetStyleName( toOUString( rFont.styleName() ) );
aFA.SetItalic( rFont.italic() ? ITALIC_NORMAL : ITALIC_NONE ); 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 ) : PhysicalFontFace( rFA )
, m_aFontId( rFontID ) , m_aFontId( rFontID )
, m_bFontCapabilitiesRead( false ) , m_bFontCapabilitiesRead( false )
{ {
} }
Kf5FontFace::~Kf5FontFace() Qt5FontFace::~Qt5FontFace()
{ {
} }
sal_IntPtr Kf5FontFace::GetFontId() const sal_IntPtr Qt5FontFace::GetFontId() const
{ {
return reinterpret_cast<sal_IntPtr>( &m_aFontId ); return reinterpret_cast<sal_IntPtr>( &m_aFontId );
} }
const FontCharMapRef Kf5FontFace::GetFontCharMap() const FontCharMapRef Qt5FontFace::GetFontCharMap()
{ {
if( m_xCharMap.is() ) if( m_xCharMap.is() )
return m_xCharMap; return m_xCharMap;
@@ -88,7 +88,7 @@ const FontCharMapRef Kf5FontFace::GetFontCharMap()
return m_xCharMap; return m_xCharMap;
} }
bool Kf5FontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) bool Qt5FontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities)
{ {
// read this only once per font // read this only once per font
if( m_bFontCapabilitiesRead ) if( m_bFontCapabilitiesRead )
@@ -114,12 +114,12 @@ bool Kf5FontFace::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities)
return rFontCapabilities.oUnicodeRange || rFontCapabilities.oCodePageRange; 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 ); return new LogicalFontInstance( rFSD );
} }

View File

@@ -31,12 +31,12 @@ class FontAttributes;
class FontSelectPattern; class FontSelectPattern;
class QFont; class QFont;
class Kf5FontFace : public PhysicalFontFace class Qt5FontFace : public PhysicalFontFace
{ {
public: public:
virtual ~Kf5FontFace() override; virtual ~Qt5FontFace() override;
static Kf5FontFace* fromQFont( const QFont &rFont ); static Qt5FontFace* fromQFont( const QFont &rFont );
PhysicalFontFace* Clone() const override; PhysicalFontFace* Clone() const override;
LogicalFontInstance* CreateFontInstance( const FontSelectPattern& ) const override; LogicalFontInstance* CreateFontInstance( const FontSelectPattern& ) const override;
@@ -49,8 +49,8 @@ public:
bool HasChar( sal_uInt32 cChar ) const; bool HasChar( sal_uInt32 cChar ) const;
protected: protected:
Kf5FontFace( const Kf5FontFace& ); Qt5FontFace( const Qt5FontFace& );
Kf5FontFace( const FontAttributes& rFA, const QString &rFontID ); Qt5FontFace( const FontAttributes& rFA, const QString &rFontID );
private: private:
const QString m_aFontId; const QString m_aFontId;

View File

@@ -17,12 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Frame.hxx" #include "Qt5Frame.hxx"
#include "Kf5Tools.hxx" #include "Qt5Tools.hxx"
#include "Kf5Instance.hxx" #include "Qt5Instance.hxx"
#include "Kf5Graphics.hxx" #include "Qt5Graphics.hxx"
#include "Kf5Widget.hxx" #include "Qt5Widget.hxx"
#include <QtCore/QPoint> #include <QtCore/QPoint>
#include <QtCore/QSize> #include <QtCore/QSize>
@@ -32,10 +32,10 @@
#include <saldatabasic.hxx> #include <saldatabasic.hxx>
#include <vcl/syswin.hxx> #include <vcl/syswin.hxx>
Kf5Frame::Kf5Frame( Kf5Frame* pParent, SalFrameStyleFlags nStyle ) Qt5Frame::Qt5Frame( Qt5Frame* pParent, SalFrameStyleFlags nStyle )
: m_bGraphicsInUse( false ) : m_bGraphicsInUse( false )
{ {
Kf5Instance *pInst = static_cast<Kf5Instance*>( GetSalData()->m_pInstance ); Qt5Instance *pInst = static_cast<Qt5Instance*>( GetSalData()->m_pInstance );
pInst->insertFrame( this ); pInst->insertFrame( this );
if( nStyle & SalFrameStyleFlags::DEFAULT ) // ensure default style if( nStyle & SalFrameStyleFlags::DEFAULT ) // ensure default style
@@ -68,7 +68,7 @@ Kf5Frame::Kf5Frame( Kf5Frame* pParent, SalFrameStyleFlags nStyle )
aWinFlags |= Qt::Window; 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)) 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 ); pInst->eraseFrame( this );
} }
void Kf5Frame::TriggerPaintEvent() void Qt5Frame::TriggerPaintEvent()
{ {
QSize aSize( m_pQWidget->size() ); QSize aSize( m_pQWidget->size() );
SalPaintEvent aPaintEvt(0, 0, aSize.width(), aSize.height(), true); SalPaintEvent aPaintEvt(0, 0, aSize.width(), aSize.height(), true);
CallCallback(SalEvent::Paint, &aPaintEvt); CallCallback(SalEvent::Paint, &aPaintEvt);
} }
SalGraphics* Kf5Frame::AcquireGraphics() SalGraphics* Qt5Frame::AcquireGraphics()
{ {
if( m_bGraphicsInUse ) if( m_bGraphicsInUse )
return nullptr; return nullptr;
if( !m_pGraphics.get() ) 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_pQImage.reset( new QImage( m_pQWidget->size(), QImage::Format_ARGB32 ) );
m_pGraphics->ChangeQImage( m_pQImage.get() ); m_pGraphics->ChangeQImage( m_pQImage.get() );
TriggerPaintEvent(); TriggerPaintEvent();
@@ -109,26 +109,26 @@ SalGraphics* Kf5Frame::AcquireGraphics()
return m_pGraphics.get(); return m_pGraphics.get();
} }
void Kf5Frame::ReleaseGraphics( SalGraphics* pSalGraph ) void Qt5Frame::ReleaseGraphics( SalGraphics* pSalGraph )
{ {
(void) pSalGraph; (void) pSalGraph;
assert( pSalGraph == m_pGraphics.get() ); assert( pSalGraph == m_pGraphics.get() );
m_bGraphicsInUse = false; 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 ); pInst->PostEvent( this, pData, SalEvent::UserEvent );
return true; return true;
} }
void Kf5Frame::SetTitle( const OUString& rTitle ) void Qt5Frame::SetTitle( const OUString& rTitle )
{ {
m_pQWidget->window()->setWindowTitle( toQString( rTitle ) ); m_pQWidget->window()->setWindowTitle( toQString( rTitle ) );
} }
void Kf5Frame::SetIcon( sal_uInt16 nIcon ) void Qt5Frame::SetIcon( sal_uInt16 nIcon )
{ {
if( m_nStyle & (SalFrameStyleFlags::PLUG | if( m_nStyle & (SalFrameStyleFlags::PLUG |
SalFrameStyleFlags::SYSTEMCHILD | SalFrameStyleFlags::SYSTEMCHILD |
@@ -159,56 +159,56 @@ void Kf5Frame::SetIcon( sal_uInt16 nIcon )
m_pQWidget->window()->setWindowIcon( aIcon ); 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() ); assert( m_pQWidget.get() );
m_pQWidget->setVisible( bVisible ); m_pQWidget->setVisible( bVisible );
} }
void Kf5Frame::SetMinClientSize( long nWidth, long nHeight ) void Qt5Frame::SetMinClientSize( long nWidth, long nHeight )
{ {
if( ! isChild() ) if( ! isChild() )
m_pQWidget->setMinimumSize( nWidth, nHeight ); m_pQWidget->setMinimumSize( nWidth, nHeight );
} }
void Kf5Frame::SetMaxClientSize( long nWidth, long nHeight ) void Qt5Frame::SetMaxClientSize( long nWidth, long nHeight )
{ {
if( ! isChild() ) if( ! isChild() )
m_pQWidget->setMaximumSize( nWidth, nHeight ); 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(); rWidth = m_pQWidget->width();
rHeight = m_pQWidget->height(); 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; return m_pParent;
} }
void Kf5Frame::SetWindowState( const SalFrameState* pState ) void Qt5Frame::SetWindowState( const SalFrameState* pState )
{ {
if( !m_pQWidget->isWindow() || !pState || isChild( true, false ) ) if( !m_pQWidget->isWindow() || !pState || isChild( true, false ) )
return; 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->mnState = WindowStateState::Normal;
pState->mnMask = WindowStateMask::State; pState->mnMask = WindowStateMask::State;
@@ -273,123 +273,123 @@ bool Kf5Frame::GetWindowState( SalFrameState* pState )
return true; 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(); 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; return false;
} }
LanguageType Kf5Frame::GetInputLanguage() LanguageType Qt5Frame::GetInputLanguage()
{ {
return LANGUAGE_DONTKNOW; 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; return nullptr;
} }
SalFrame::SalPointerState Kf5Frame::GetPointerState() SalFrame::SalPointerState Qt5Frame::GetPointerState()
{ {
return SalPointerState(); return SalPointerState();
} }
KeyIndicatorState Kf5Frame::GetIndicatorState() KeyIndicatorState Qt5Frame::GetIndicatorState()
{ {
return KeyIndicatorState(); 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; 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 &)
{ {
} }

View File

@@ -23,24 +23,24 @@
#include <memory> #include <memory>
class Kf5Graphics; class Qt5Graphics;
class Kf5Instance; class Qt5Instance;
class Kf5Widget; class Qt5Widget;
class QWidget; class QWidget;
class QPaintDevice; class QPaintDevice;
class QImage; class QImage;
class Kf5Frame class Qt5Frame
: public SalFrame : public SalFrame
{ {
friend class Kf5Widget; friend class Qt5Widget;
std::unique_ptr< QWidget > m_pQWidget; std::unique_ptr< QWidget > m_pQWidget;
std::unique_ptr< QImage > m_pQImage; std::unique_ptr< QImage > m_pQImage;
std::unique_ptr< Kf5Graphics > m_pGraphics; std::unique_ptr< Qt5Graphics > m_pGraphics;
bool m_bGraphicsInUse; bool m_bGraphicsInUse;
SalFrameStyleFlags m_nStyle; SalFrameStyleFlags m_nStyle;
Kf5Frame *m_pParent; Qt5Frame *m_pParent;
bool isChild( bool bPlug = true, bool bSysChild = true ) bool isChild( bool bPlug = true, bool bSysChild = true )
{ {
@@ -55,9 +55,9 @@ class Kf5Frame
void TriggerPaintEvent(); void TriggerPaintEvent();
public: public:
Kf5Frame( Kf5Frame* pParent, Qt5Frame( Qt5Frame* pParent,
SalFrameStyleFlags nSalFrameStyle ); SalFrameStyleFlags nSalFrameStyle );
virtual ~Kf5Frame() override; virtual ~Qt5Frame() override;
QWidget* GetQWidget() const { return m_pQWidget.get(); } QWidget* GetQWidget() const { return m_pQWidget.get(); }

View File

@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Graphics.hxx" #include "Qt5Graphics.hxx"
#include "Kf5Frame.hxx" #include "Qt5Frame.hxx"
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
@@ -26,25 +26,25 @@
#include <QtGui/QImage> #include <QtGui/QImage>
Kf5Graphics::Kf5Graphics( Kf5Frame *pFrame ) Qt5Graphics::Qt5Graphics( Qt5Frame *pFrame )
: m_pFrame( pFrame ) : m_pFrame( pFrame )
, m_pQImage( nullptr ) , m_pQImage( nullptr )
, m_pFontCollection( nullptr ) , m_pFontCollection( nullptr )
{ {
} }
Kf5Graphics::Kf5Graphics( QImage *pQImage ) Qt5Graphics::Qt5Graphics( QImage *pQImage )
: m_pFrame( nullptr ) : m_pFrame( nullptr )
, m_pQImage( pQImage ) , m_pQImage( pQImage )
, m_pFontCollection( nullptr ) , m_pFontCollection( nullptr )
{ {
} }
Kf5Graphics::~Kf5Graphics() Qt5Graphics::~Qt5Graphics()
{ {
} }
void Kf5Graphics::PreparePainter() void Qt5Graphics::PreparePainter()
{ {
if ( m_pPainter.get() ) if ( m_pPainter.get() )
return; return;
@@ -59,55 +59,55 @@ void Kf5Graphics::PreparePainter()
m_pPainter->setClipRegion( m_aClipRegion ); m_pPainter->setClipRegion( m_aClipRegion );
} }
void Kf5Graphics::ChangeQImage( QImage *pQImage ) void Qt5Graphics::ChangeQImage( QImage *pQImage )
{ {
m_pPainter.reset(); m_pPainter.reset();
m_pQImage = pQImage; m_pQImage = pQImage;
} }
SalGraphicsImpl* Kf5Graphics::GetImpl() const SalGraphicsImpl* Qt5Graphics::GetImpl() const
{ {
return nullptr; return nullptr;
} }
SystemGraphicsData Kf5Graphics::GetGraphicsData() const SystemGraphicsData Qt5Graphics::GetGraphicsData() const
{ {
return SystemGraphicsData(); return SystemGraphicsData();
} }
bool Kf5Graphics::supportsOperation( OutDevSupportType ) const bool Qt5Graphics::supportsOperation( OutDevSupportType ) const
{ {
return false; return false;
} }
#if ENABLE_CAIRO_CANVAS #if ENABLE_CAIRO_CANVAS
bool Kf5Graphics::SupportsCairo() const bool Qt5Graphics::SupportsCairo() const
{ {
return false; return false;
} }
cairo::SurfaceSharedPtr Kf5Graphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const cairo::SurfaceSharedPtr Qt5Graphics::CreateSurface(const cairo::CairoSurfaceSharedPtr& rSurface) const
{ {
return nullptr; 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; 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; 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(); return css::uno::Any();
} }
SystemFontData Kf5Graphics::GetSysFontData( int nFallbacklevel ) const SystemFontData Qt5Graphics::GetSysFontData( int nFallbacklevel ) const
{ {
return SystemFontData(); return SystemFontData();
} }

View File

@@ -25,17 +25,17 @@
#include <QtGui/QRegion> #include <QtGui/QRegion>
class Kf5Frame; class Qt5Frame;
class PhysicalFontCollection; class PhysicalFontCollection;
class PhysicalFontFace; class PhysicalFontFace;
class QImage; class QImage;
class QPainter; 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; QImage *m_pQImage;
QRegion m_aClipRegion; QRegion m_aClipRegion;
std::unique_ptr< QPainter > m_pPainter; std::unique_ptr< QPainter > m_pPainter;
@@ -45,9 +45,9 @@ class Kf5Graphics : public SalGraphics
void PreparePainter(); void PreparePainter();
public: public:
Kf5Graphics( Kf5Frame *pFrame ); Qt5Graphics( Qt5Frame *pFrame );
Kf5Graphics( QImage *pImage ); Qt5Graphics( QImage *pImage );
virtual ~Kf5Graphics() override; virtual ~Qt5Graphics() override;
void ChangeQImage( QImage *pImage ); void ChangeQImage( QImage *pImage );

View File

@@ -17,21 +17,21 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * 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; return false;
} }
bool Kf5Graphics::hitTestNativeControl( ControlType nType, ControlPart nPart, bool Qt5Graphics::hitTestNativeControl( ControlType nType, ControlPart nPart,
const tools::Rectangle& rControlRegion, const tools::Rectangle& rControlRegion,
const Point& aPos, bool& rIsInside ) const Point& aPos, bool& rIsInside )
{ {
return false; return false;
} }
bool Kf5Graphics::drawNativeControl( ControlType nType, ControlPart nPart, bool Qt5Graphics::drawNativeControl( ControlType nType, ControlPart nPart,
const tools::Rectangle& rControlRegion, const tools::Rectangle& rControlRegion,
ControlState nState, const ImplControlValue& aValue, ControlState nState, const ImplControlValue& aValue,
const OUString& aCaption ) const OUString& aCaption )
@@ -39,7 +39,7 @@ bool Kf5Graphics::drawNativeControl( ControlType nType, ControlPart nPart,
return false; return false;
} }
bool Kf5Graphics::getNativeControlRegion( ControlType nType, ControlPart nPart, bool Qt5Graphics::getNativeControlRegion( ControlType nType, ControlPart nPart,
const tools::Rectangle& rControlRegion, ControlState nState, const tools::Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue, const OUString& aCaption, const ImplControlValue& aValue, const OUString& aCaption,
tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeBoundingRegion,

View File

@@ -17,18 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Graphics.hxx" #include "Qt5Graphics.hxx"
#include "Kf5Bitmap.hxx" #include "Qt5Bitmap.hxx"
#include "Kf5Frame.hxx" #include "Qt5Frame.hxx"
#include "Kf5Tools.hxx" #include "Qt5Tools.hxx"
#include <QtGui/QPainter> #include <QtGui/QPainter>
#include <QtGui/QScreen> #include <QtGui/QScreen>
#include <QtGui/QWindow> #include <QtGui/QWindow>
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
bool Kf5Graphics::setClipRegion( const vcl::Region& rRegion ) bool Qt5Graphics::setClipRegion( const vcl::Region& rRegion )
{ {
PreparePainter(); PreparePainter();
if ( rRegion.IsRectangle() ) if ( rRegion.IsRectangle() )
@@ -50,38 +50,38 @@ bool Kf5Graphics::setClipRegion( const vcl::Region& rRegion )
return true; return true;
} }
void Kf5Graphics::ResetClipRegion() void Qt5Graphics::ResetClipRegion()
{ {
m_aClipRegion = QRegion( m_pQImage->rect() ); m_aClipRegion = QRegion( m_pQImage->rect() );
PreparePainter(); PreparePainter();
} }
void Kf5Graphics::drawPixel( long nX, long nY ) void Qt5Graphics::drawPixel( long nX, long nY )
{ {
PreparePainter(); PreparePainter();
m_pPainter->drawPoint( nX, nY ); m_pPainter->drawPoint( nX, nY );
} }
void Kf5Graphics::drawPixel( long nX, long nY, SalColor nSalColor ) void Qt5Graphics::drawPixel( long nX, long nY, SalColor nSalColor )
{ {
PreparePainter(); PreparePainter();
m_pPainter->setPen( QColor( QRgb( nSalColor ) ) ); m_pPainter->setPen( QColor( QRgb( nSalColor ) ) );
m_pPainter->drawPoint( nX, nY ); 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(); PreparePainter();
m_pPainter->drawLine( nX1, nY1, nX2, nY2 ); 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(); PreparePainter();
m_pPainter->drawRect( nX, nY, nWidth, nHeight ); 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(); PreparePainter();
QPoint *pPoints = new QPoint[ nPoints ]; QPoint *pPoints = new QPoint[ nPoints ];
@@ -91,7 +91,7 @@ void Kf5Graphics::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry )
delete [] pPoints; delete [] pPoints;
} }
void Kf5Graphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry ) void Qt5Graphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry )
{ {
PreparePainter(); PreparePainter();
QPoint *pPoints = new QPoint[ nPoints ]; QPoint *pPoints = new QPoint[ nPoints ];
@@ -101,34 +101,34 @@ void Kf5Graphics::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry )
delete [] pPoints; 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 ) if( 0 == nPoly )
return; return;
} }
bool Kf5Graphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double fTransparency ) bool Qt5Graphics::drawPolyPolygon( const basegfx::B2DPolyPolygon&, double fTransparency )
{ {
return false; 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; 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; 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 ) const SalPoint* const* pPtAry, const PolyFlags* const* pFlgAry )
{ {
return false; return false;
} }
bool Kf5Graphics::drawPolyLine( const basegfx::B2DPolygon&, bool Qt5Graphics::drawPolyLine( const basegfx::B2DPolygon&,
double fTransparency, double fTransparency,
const basegfx::B2DVector& rLineWidths, const basegfx::B2DVector& rLineWidths,
basegfx::B2DLineJoin, basegfx::B2DLineJoin,
@@ -138,12 +138,12 @@ bool Kf5Graphics::drawPolyLine( const basegfx::B2DPolygon&,
return false; return false;
} }
bool Kf5Graphics::drawGradient( const tools::PolyPolygon&, const Gradient& ) bool Qt5Graphics::drawGradient( const tools::PolyPolygon&, const Gradient& )
{ {
return false; 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 ) long nSrcHeight, bool bWindowInvalidate )
{ {
if ( nDestX == nSrcX && nDestY == nSrcY ) if ( nDestX == nSrcX && nDestY == nSrcY )
@@ -154,7 +154,7 @@ void Kf5Graphics::copyArea( long nDestX, long nDestY, long nSrcX, long nSrcY, lo
copyBits( aTR, this ); 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 if( rPosAry.mnSrcWidth <= 0 || rPosAry.mnSrcHeight <= 0
|| rPosAry.mnDestWidth <= 0 || rPosAry.mnDestHeight <= 0 ) || rPosAry.mnDestWidth <= 0 || rPosAry.mnDestHeight <= 0 )
@@ -175,7 +175,7 @@ void Kf5Graphics::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics
pImage = &aImage; pImage = &aImage;
} }
else else
pImage = static_cast< Kf5Graphics*>( pSrcGraphics )->m_pQImage; pImage = static_cast< Qt5Graphics* >( pSrcGraphics )->m_pQImage;
PreparePainter(); PreparePainter();
m_pPainter->drawImage( QPoint( rPosAry.mnDestX, rPosAry.mnDestY ), m_pPainter->drawImage( QPoint( rPosAry.mnDestX, rPosAry.mnDestY ),
@@ -183,7 +183,7 @@ void Kf5Graphics::copyBits( const SalTwoRect& rPosAry, SalGraphics* pSrcGraphics
rPosAry.mnSrcWidth, rPosAry.mnSrcHeight) ); 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 if( rPosAry.mnSrcWidth <= 0 || rPosAry.mnSrcHeight <= 0
|| rPosAry.mnDestWidth <= 0 || rPosAry.mnDestHeight <= 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 ); assert( rPosAry.mnSrcHeight == rPosAry.mnDestHeight );
PreparePainter(); 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 ), m_pPainter->drawImage( QPoint( rPosAry.mnDestX, rPosAry.mnDestY ),
*pImage, QRect( rPosAry.mnSrcX, rPosAry.mnSrcY, *pImage, QRect( rPosAry.mnSrcX, rPosAry.mnSrcY,
@@ -204,48 +204,48 @@ void Kf5Graphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBi
m_pFrame->GetQWidget()->update(); m_pFrame->GetQWidget()->update();
} }
void Kf5Graphics::drawBitmap( const SalTwoRect& rPosAry, void Qt5Graphics::drawBitmap( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap, const SalBitmap& rSalBitmap,
const SalBitmap& rTransparentBitmap ) const SalBitmap& rTransparentBitmap )
{ {
} }
void Kf5Graphics::drawMask( const SalTwoRect& rPosAry, void Qt5Graphics::drawMask( const SalTwoRect& rPosAry,
const SalBitmap& rSalBitmap, const SalBitmap& rSalBitmap,
SalColor nMaskColor ) 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 ); 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; return false;
} }
bool Kf5Graphics::blendBitmap( const SalTwoRect&, bool Qt5Graphics::blendBitmap( const SalTwoRect&,
const SalBitmap& rBitmap ) const SalBitmap& rBitmap )
{ {
return false; return false;
} }
bool Kf5Graphics::blendAlphaBitmap( const SalTwoRect&, bool Qt5Graphics::blendAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSrcBitmap, const SalBitmap& rSrcBitmap,
const SalBitmap& rMaskBitmap, const SalBitmap& rMaskBitmap,
const SalBitmap& rAlphaBitmap ) const SalBitmap& rAlphaBitmap )
@@ -253,14 +253,14 @@ bool Kf5Graphics::blendAlphaBitmap( const SalTwoRect&,
return false; return false;
} }
bool Kf5Graphics::drawAlphaBitmap( const SalTwoRect&, bool Qt5Graphics::drawAlphaBitmap( const SalTwoRect&,
const SalBitmap& rSourceBitmap, const SalBitmap& rSourceBitmap,
const SalBitmap& rAlphaBitmap ) const SalBitmap& rAlphaBitmap )
{ {
return false; return false;
} }
bool Kf5Graphics::drawTransformedBitmap( bool Qt5Graphics::drawTransformedBitmap(
const basegfx::B2DPoint& rNull, const basegfx::B2DPoint& rNull,
const basegfx::B2DPoint& rX, const basegfx::B2DPoint& rX,
const basegfx::B2DPoint& rY, const basegfx::B2DPoint& rY,
@@ -270,13 +270,13 @@ bool Kf5Graphics::drawTransformedBitmap(
return false; 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 ) long nHeight, sal_uInt8 nTransparency )
{ {
return false; return false;
} }
void Kf5Graphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) void Qt5Graphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
{ {
char* pForceDpi; char* pForceDpi;
if ((pForceDpi = getenv("SAL_FORCEDPI"))) if ((pForceDpi = getenv("SAL_FORCEDPI")))
@@ -294,41 +294,41 @@ void Kf5Graphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
rDPIY = pScreen->physicalDotsPerInchY(); rDPIY = pScreen->physicalDotsPerInchY();
} }
sal_uInt16 Kf5Graphics::GetBitCount() const sal_uInt16 Qt5Graphics::GetBitCount() const
{ {
return getFormatBits( m_pQImage->format() ); return getFormatBits( m_pQImage->format() );
} }
long Kf5Graphics::GetGraphicsWidth() const long Qt5Graphics::GetGraphicsWidth() const
{ {
return m_pQImage->width(); 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 )
{ {
} }

View File

@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Graphics.hxx" #include "Qt5Graphics.hxx"
#include "Kf5FontFace.hxx" #include "Qt5FontFace.hxx"
#include <vcl/fontcharmap.hxx> #include <vcl/fontcharmap.hxx>
@@ -27,29 +27,29 @@
#include <QtGui/QFontDatabase> #include <QtGui/QFontDatabase>
#include <QtCore/QStringList> #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; return nullptr;
} }
bool Kf5Graphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const bool Qt5Graphics::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
{ {
return false; return false;
} }
void Kf5Graphics::GetDevFontList( PhysicalFontCollection* pPFC ) void Qt5Graphics::GetDevFontList( PhysicalFontCollection* pPFC )
{ {
m_pFontCollection = pPFC; m_pFontCollection = pPFC;
if ( pPFC->Count() ) if ( pPFC->Count() )
@@ -61,57 +61,57 @@ void Kf5Graphics::GetDevFontList( PhysicalFontCollection* pPFC )
{ {
// Just get any size - we don't care // Just get any size - we don't care
QList<int> sizes = aFDB.smoothSizes(family, style); 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; 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, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding,
sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo )
{ {
return false; return false;
} }
const void* Kf5Graphics::GetEmbedFontData( const PhysicalFontFace*, long* pDataLen ) const void* Qt5Graphics::GetEmbedFontData( const PhysicalFontFace*, long* pDataLen )
{ {
return nullptr; 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, std::vector< sal_Int32 >& rWidths,
Ucs2UIntMap& rUnicodeEnc ) Ucs2UIntMap& rUnicodeEnc )
{ {
} }
bool Kf5Graphics::GetGlyphBoundRect( const GlyphItem&, tools::Rectangle& ) bool Qt5Graphics::GetGlyphBoundRect( const GlyphItem&, tools::Rectangle& )
{ {
return false; return false;
} }
bool Kf5Graphics::GetGlyphOutline( const GlyphItem&, basegfx::B2DPolyPolygon& ) bool Qt5Graphics::GetGlyphOutline( const GlyphItem&, basegfx::B2DPolyPolygon& )
{ {
return false; return false;
} }
SalLayout* Kf5Graphics::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) SalLayout* Qt5Graphics::GetTextLayout( ImplLayoutArgs&, int nFallbackLevel )
{ {
return nullptr; return nullptr;
} }
void Kf5Graphics::DrawTextLayout( const CommonSalLayout& ) void Qt5Graphics::DrawTextLayout( const CommonSalLayout& )
{ {
} }

View File

@@ -17,15 +17,15 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Instance.hxx" #include "Qt5Instance.hxx"
#include <Kf5Instance.moc> #include <Qt5Instance.moc>
#include "Kf5Frame.hxx" #include "Qt5Frame.hxx"
#include "Kf5Data.hxx" #include "Qt5Data.hxx"
#include "Kf5Timer.hxx" #include "Qt5Timer.hxx"
#include "Kf5VirtualDevice.hxx" #include "Qt5VirtualDevice.hxx"
#include "Kf5Object.hxx" #include "Qt5Object.hxx"
#include "Kf5Bitmap.hxx" #include "Qt5Bitmap.hxx"
#include <QtCore/QThread> #include <QtCore/QThread>
#include <QtWidgets/QApplication> #include <QtWidgets/QApplication>
@@ -38,11 +38,7 @@
#include <headless/svpdummies.hxx> #include <headless/svpdummies.hxx>
#include <headless/svpbmp.hxx> #include <headless/svpbmp.hxx>
#include <KAboutData> Qt5Instance::Qt5Instance( SalYieldMutex* pMutex )
#include <KLocalizedString>
#include <KStartupInfo>
Kf5Instance::Kf5Instance( SalYieldMutex* pMutex )
: SalGenericInstance( pMutex ) : SalGenericInstance( pMutex )
, m_postUserEventId( -1 ) , m_postUserEventId( -1 )
{ {
@@ -54,7 +50,7 @@ Kf5Instance::Kf5Instance( SalYieldMutex* pMutex )
this, SLOT( ImplYield( bool, bool )), Qt::BlockingQueuedConnection ); this, SLOT( ImplYield( bool, bool )), Qt::BlockingQueuedConnection );
} }
Kf5Instance::~Kf5Instance() Qt5Instance::~Qt5Instance()
{ {
// force freeing the QApplication before freeing the arguments, // force freeing the QApplication before freeing the arguments,
// as it uses references to the provided arguments! // as it uses references to the provided arguments!
@@ -63,59 +59,59 @@ Kf5Instance::~Kf5Instance()
free( m_pFakeArgvFreeable[i] ); 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 ) ); assert( !pParent || dynamic_cast<Qt5Frame*>( pParent ) );
return new Kf5Frame( static_cast<Kf5Frame*>( pParent ), nStyle ); return new Qt5Frame( static_cast<Qt5Frame*>( pParent ), nStyle );
} }
void Kf5Instance::DestroyFrame( SalFrame* pFrame ) void Qt5Instance::DestroyFrame( SalFrame* pFrame )
{ {
delete 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 ) ); assert( !pParent || dynamic_cast<Qt5Frame*>( pParent ) );
return new Kf5Object( static_cast<Kf5Frame*>( pParent ), bShow ); return new Qt5Object( static_cast<Qt5Frame*>( pParent ), bShow );
} }
void Kf5Instance::DestroyObject( SalObject* pObject ) void Qt5Instance::DestroyObject( SalObject* pObject )
{ {
delete pObject; delete pObject;
} }
SalVirtualDevice* Kf5Instance::CreateVirtualDevice( SalGraphics* /* pGraphics */, SalVirtualDevice* Qt5Instance::CreateVirtualDevice( SalGraphics* /* pGraphics */,
long &nDX, long &nDY, long &nDX, long &nDY,
DeviceFormat eFormat, DeviceFormat eFormat,
const SystemGraphicsData* /* pData */ ) const SystemGraphicsData* /* pData */ )
{ {
Kf5VirtualDevice* pVD = new Kf5VirtualDevice( eFormat, 1 ); Qt5VirtualDevice* pVD = new Qt5VirtualDevice( eFormat, 1 );
pVD->SetSize( nDX, nDY ); pVD->SetSize( nDX, nDY );
return pVD; return pVD;
} }
SalTimer* Kf5Instance::CreateSalTimer() SalTimer* Qt5Instance::CreateSalTimer()
{ {
return new Kf5Timer(); return new Qt5Timer();
} }
SalSystem* Kf5Instance::CreateSalSystem() SalSystem* Qt5Instance::CreateSalSystem()
{ {
return new SvpSalSystem(); 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 ); bool wasEvent = DispatchUserEvents( bHandleAllCurrentEvents );
if ( !bHandleAllCurrentEvents && wasEvent ) if ( !bHandleAllCurrentEvents && wasEvent )
@@ -133,7 +129,7 @@ bool Kf5Instance::ImplYield( bool bWait, bool bHandleAllCurrentEvents )
return wasEvent; return wasEvent;
} }
bool Kf5Instance::DoYield(bool bWait, bool bHandleAllCurrentEvents) bool Qt5Instance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
{ {
bool bWasEvent = false; bool bWasEvent = false;
if( qApp->thread() == QThread::currentThread() ) if( qApp->thread() == QThread::currentThread() )
@@ -159,47 +155,47 @@ bool Kf5Instance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
return bWasEvent; return bWasEvent;
} }
bool Kf5Instance::AnyInput( VclInputFlags nType ) bool Qt5Instance::AnyInput( VclInputFlags nType )
{ {
return false; return false;
} }
SalSession* Kf5Instance::CreateSalSession() SalSession* Qt5Instance::CreateSalSession()
{ {
return nullptr; return nullptr;
} }
OUString Kf5Instance::GetConnectionIdentifier() OUString Qt5Instance::GetConnectionIdentifier()
{ {
return OUString(); 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; return nullptr;
} }
bool Kf5Instance::IsMainThread() const bool Qt5Instance::IsMainThread() const
{ {
return qApp->thread() != QThread::currentThread(); return qApp->thread() != QThread::currentThread();
} }
void Kf5Instance::TriggerUserEventProcessing() void Qt5Instance::TriggerUserEventProcessing()
{ {
QApplication::postEvent(this, new QEvent(QEvent::Type( m_postUserEventId ))); 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 ); aEvent.m_pFrame->CallCallback( aEvent.m_nEvent, aEvent.m_pData );
} }
extern "C" { extern "C" {
VCLPLUG_KF5_PUBLIC SalInstance* create_SalInstance() VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance()
{ {
OString aVersion( qVersion() ); OString aVersion( qVersion() );
SAL_INFO( "vcl.kf5", "qt version string is " << aVersion ); SAL_INFO( "vcl.kf5", "qt version string is " << aVersion );
@@ -263,28 +259,12 @@ extern "C" {
free( session_manager ); 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); QApplication::setQuitOnLastWindowClosed(false);
Kf5Instance* pInstance = new Kf5Instance( new SalYieldMutex() ); Qt5Instance* pInstance = new Qt5Instance( new SalYieldMutex() );
// initialize SalData // initialize SalData
new Kf5Data( pInstance ); new Qt5Data( pInstance );
pInstance->m_pQApplication.reset( pQApplication ); pInstance->m_pQApplication.reset( pQApplication );
pInstance->m_pFakeArgvFreeable.reset( pFakeArgvFreeable ); pInstance->m_pFakeArgvFreeable.reset( pFakeArgvFreeable );

View File

@@ -30,7 +30,7 @@ class QApplication;
class SalYieldMutex; class SalYieldMutex;
class SalFrame; class SalFrame;
class Kf5Instance class Qt5Instance
: public QObject : public QObject
, public SalGenericInstance , public SalGenericInstance
, public SalUserEventList , public SalUserEventList
@@ -53,8 +53,8 @@ Q_SIGNALS:
bool ImplYieldSignal( bool bWait, bool bHandleAllCurrentEvents ); bool ImplYieldSignal( bool bWait, bool bHandleAllCurrentEvents );
public: public:
explicit Kf5Instance( SalYieldMutex* pMutex ); explicit Qt5Instance( SalYieldMutex* pMutex );
virtual ~Kf5Instance() override; virtual ~Qt5Instance() override;
virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override; virtual SalFrame* CreateFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) override;
virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override; virtual SalFrame* CreateChildFrame( SystemParentData* pParent, SalFrameStyleFlags nStyle ) override;

View File

@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Instance.hxx" #include "Qt5Instance.hxx"
#include "Kf5Printer.hxx" #include "Qt5Printer.hxx"
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/timer.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 ) ImplJobSetup* pJobSetup )
{ {
// create and initialize SalInfoPrinter // create and initialize SalInfoPrinter
Kf5InfoPrinter* pPrinter = new Kf5InfoPrinter; Qt5InfoPrinter* pPrinter = new Qt5InfoPrinter;
if( pJobSetup ) if( pJobSetup )
{ {
@@ -181,26 +181,26 @@ SalInfoPrinter* Kf5Instance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
return pPrinter; return pPrinter;
} }
void Kf5Instance::DestroyInfoPrinter( SalInfoPrinter* pPrinter ) void Qt5Instance::DestroyInfoPrinter( SalInfoPrinter* pPrinter )
{ {
delete pPrinter; delete pPrinter;
} }
SalPrinter* Kf5Instance::CreatePrinter( SalInfoPrinter* pInfoPrinter ) SalPrinter* Qt5Instance::CreatePrinter( SalInfoPrinter* pInfoPrinter )
{ {
// create and initialize SalPrinter // create and initialize SalPrinter
Kf5Printer* pPrinter = new Kf5Printer( pInfoPrinter ); Qt5Printer* pPrinter = new Qt5Printer( pInfoPrinter );
pPrinter->m_aJobData = static_cast<Kf5InfoPrinter*>(pInfoPrinter)->m_aJobData; pPrinter->m_aJobData = static_cast<Qt5InfoPrinter*>(pInfoPrinter)->m_aJobData;
return pPrinter; return pPrinter;
} }
void Kf5Instance::DestroyPrinter( SalPrinter* pPrinter ) void Qt5Instance::DestroyPrinter( SalPrinter* pPrinter )
{ {
delete pPrinter; delete pPrinter;
} }
void Kf5Instance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) void Qt5Instance::GetPrinterQueueInfo( ImplPrnQueueList* pList )
{ {
PrinterInfoManager& rManager( PrinterInfoManager::get() ); PrinterInfoManager& rManager( PrinterInfoManager::get() );
static const char* pNoSyncDetection = getenv( "SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION" ); 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; delete pInfo;
} }
void Kf5Instance::GetPrinterQueueState( SalPrinterQueueInfo* ) void Qt5Instance::GetPrinterQueueState( SalPrinterQueueInfo* )
{ {
} }
OUString Kf5Instance::GetDefaultPrinter() OUString Qt5Instance::GetDefaultPrinter()
{ {
PrinterInfoManager& rManager( PrinterInfoManager::get() ); PrinterInfoManager& rManager( PrinterInfoManager::get() );
return rManager.getDefaultPrinter(); return rManager.getDefaultPrinter();
} }
void Kf5Instance::PostPrintersChanged() void Qt5Instance::PostPrintersChanged()
{ {
} }
GenPspGraphics *Kf5Instance::CreatePrintGraphics() GenPspGraphics *Qt5Instance::CreatePrintGraphics()
{ {
return new GenPspGraphics(); return new GenPspGraphics();
} }

View File

@@ -17,14 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Object.hxx" #include "Qt5Object.hxx"
#include "Kf5Frame.hxx" #include "Qt5Frame.hxx"
#include "Kf5Widget.hxx"
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
Kf5Object::Kf5Object( Kf5Frame* pParent, bool bShow ) Qt5Object::Qt5Object( Qt5Frame* pParent, bool bShow )
: m_pParent( pParent ) : m_pParent( pParent )
{ {
if ( !m_pParent || !pParent->GetQWidget() ) if ( !m_pParent || !pParent->GetQWidget() )
@@ -34,11 +33,11 @@ Kf5Object::Kf5Object( Kf5Frame* pParent, bool bShow )
m_pQWidget->show(); m_pQWidget->show();
} }
Kf5Object::~Kf5Object() Qt5Object::~Qt5Object()
{ {
} }
void Kf5Object::ResetClipRegion() void Qt5Object::ResetClipRegion()
{ {
if ( m_pQWidget.get() ) if ( m_pQWidget.get() )
m_pRegion = QRegion( m_pQWidget->geometry() ); m_pRegion = QRegion( m_pQWidget->geometry() );
@@ -46,38 +45,38 @@ void Kf5Object::ResetClipRegion()
m_pRegion = QRegion(); m_pRegion = QRegion();
} }
void Kf5Object::BeginSetClipRegion( sal_uLong ) void Qt5Object::BeginSetClipRegion( sal_uLong )
{ {
m_pRegion = QRegion(); 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 ); m_pRegion += QRect( nX, nY, nWidth, nHeight );
} }
void Kf5Object::EndSetClipRegion() void Qt5Object::EndSetClipRegion()
{ {
if ( m_pQWidget.get() ) if ( m_pQWidget.get() )
m_pRegion = m_pRegion.intersected( m_pQWidget->geometry() ); 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 ) if( m_pQWidget )
m_pQWidget->setVisible( bVisible ); 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; return nullptr;
} }

View File

@@ -27,18 +27,18 @@
#include <QtGui/QRegion> #include <QtGui/QRegion>
class QWidget; class QWidget;
class Kf5Frame; class Qt5Frame;
class Kf5Object : public SalObject class Qt5Object : public SalObject
{ {
SystemEnvData m_aSystemData; SystemEnvData m_aSystemData;
std::unique_ptr< QWidget > m_pQWidget; std::unique_ptr< QWidget > m_pQWidget;
Kf5Frame* m_pParent; Qt5Frame* m_pParent;
QRegion m_pRegion; QRegion m_pRegion;
public: public:
Kf5Object( Kf5Frame* pParent, bool bShow ); Qt5Object( Qt5Frame* pParent, bool bShow );
virtual ~Kf5Object() override; virtual ~Qt5Object() override;
virtual void ResetClipRegion() override; virtual void ResetClipRegion() override;
virtual void BeginSetClipRegion( sal_uLong nRects ) override; virtual void BeginSetClipRegion( sal_uLong nRects ) override;

View File

@@ -17,14 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * 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; return false;
} }
Kf5Printer::Kf5Printer( SalInfoPrinter* pInfoPrinter ) Qt5Printer::Qt5Printer( SalInfoPrinter* pInfoPrinter )
: PspSalPrinter( pInfoPrinter ) : PspSalPrinter( pInfoPrinter )
{ {
} }

View File

@@ -24,16 +24,16 @@
class SalFrame; class SalFrame;
class ImplJobSetup; class ImplJobSetup;
class Kf5InfoPrinter : public PspSalInfoPrinter class Qt5InfoPrinter : public PspSalInfoPrinter
{ {
public: public:
virtual bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) override; virtual bool Setup( SalFrame* pFrame, ImplJobSetup* pSetupData ) override;
}; };
class Kf5Printer : public PspSalPrinter class Qt5Printer : public PspSalPrinter
{ {
public: public:
Kf5Printer( SalInfoPrinter* pInfoPrinter ); Qt5Printer( SalInfoPrinter* pInfoPrinter );
}; };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -17,13 +17,13 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Timer.hxx" #include "Qt5Timer.hxx"
#include <Kf5Timer.moc> #include <Qt5Timer.moc>
#include <QtWidgets/QApplication> #include <QtWidgets/QApplication>
#include <QtCore/QThread> #include <QtCore/QThread>
Kf5Timer::Kf5Timer() Qt5Timer::Qt5Timer()
{ {
m_aTimer.setSingleShot( true ); m_aTimer.setSingleShot( true );
// run the timer itself in the main / creator thread // run the timer itself in the main / creator thread
@@ -34,21 +34,21 @@ Kf5Timer::Kf5Timer()
this, SLOT( startTimer() ), Qt::QueuedConnection ); this, SLOT( startTimer() ), Qt::QueuedConnection );
} }
Kf5Timer::~Kf5Timer() Qt5Timer::~Qt5Timer()
{ {
} }
void Kf5Timer::timeoutActivated() void Qt5Timer::timeoutActivated()
{ {
CallCallback(); CallCallback();
} }
void Kf5Timer::startTimer() void Qt5Timer::startTimer()
{ {
m_aTimer.start(); m_aTimer.start();
} }
void Kf5Timer::Start( sal_uIntPtr nMS ) void Qt5Timer::Start( sal_uIntPtr nMS )
{ {
m_aTimer.setInterval( nMS ); m_aTimer.setInterval( nMS );
if( qApp->thread() == QThread::currentThread() ) if( qApp->thread() == QThread::currentThread() )
@@ -57,7 +57,7 @@ void Kf5Timer::Start( sal_uIntPtr nMS )
Q_EMIT startTimerSignal(); Q_EMIT startTimerSignal();
} }
void Kf5Timer::Stop() void Qt5Timer::Stop()
{ {
m_aTimer.stop(); m_aTimer.stop();
} }

View File

@@ -22,7 +22,7 @@
#include <saltimer.hxx> #include <saltimer.hxx>
#include <QtCore/QTimer> #include <QtCore/QTimer>
class Kf5Timer final : public QObject, public SalTimer class Qt5Timer final : public QObject, public SalTimer
{ {
Q_OBJECT Q_OBJECT
@@ -36,8 +36,8 @@ Q_SIGNALS:
void startTimerSignal(); void startTimerSignal();
public: public:
Kf5Timer(); Qt5Timer();
virtual ~Kf5Timer() override; virtual ~Qt5Timer() override;
virtual void Start( sal_uIntPtr nMS ) override; virtual void Start( sal_uIntPtr nMS ) override;
virtual void Stop() override; virtual void Stop() override;

View File

@@ -17,40 +17,42 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * 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> #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 ); assert( m_pImage );
Kf5Graphics* pGraphics = new Kf5Graphics( m_pImage.get() ); Qt5Graphics* pGraphics = new Qt5Graphics( m_pImage.get() );
m_aGraphics.push_back( pGraphics ); m_aGraphics.push_back( pGraphics );
return 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; delete pGraphics;
} }
bool Kf5VirtualDevice::SetSize( long nNewDX, long nNewDY ) bool Qt5VirtualDevice::SetSize( long nNewDX, long nNewDY )
{ {
return SetSizeUsingBuffer( nNewDX, nNewDY, nullptr ); return SetSizeUsingBuffer( nNewDX, nNewDY, nullptr );
} }
bool Kf5VirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, bool Qt5VirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
sal_uInt8 * pBuffer ) sal_uInt8 * pBuffer )
{ {
if( nNewDX == 0 ) if( nNewDX == 0 )
@@ -82,18 +84,18 @@ bool Kf5VirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY,
m_pImage->setDevicePixelRatio( m_fScale ); m_pImage->setDevicePixelRatio( m_fScale );
// update device in existing graphics // update device in existing graphics
for( auto pKf5Graph : m_aGraphics ) for( auto pQt5Graph : m_aGraphics )
pKf5Graph->ChangeQImage( m_pImage.get() ); pQt5Graph->ChangeQImage( m_pImage.get() );
return true; return true;
} }
long Kf5VirtualDevice::GetWidth() const long Qt5VirtualDevice::GetWidth() const
{ {
return m_pImage ? m_aFrameSize.getX() : 0; return m_pImage ? m_aFrameSize.getX() : 0;
} }
long Kf5VirtualDevice::GetHeight() const long Qt5VirtualDevice::GetHeight() const
{ {
return m_pImage ? m_aFrameSize.getY() : 0; return m_pImage ? m_aFrameSize.getY() : 0;
} }

View File

@@ -25,21 +25,21 @@
#include <memory> #include <memory>
#include <list> #include <list>
class Kf5Graphics; class Qt5Graphics;
class QImage; class QImage;
enum class DeviceFormat; 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; std::unique_ptr< QImage > m_pImage;
DeviceFormat m_eFormat; DeviceFormat m_eFormat;
basegfx::B2IVector m_aFrameSize; basegfx::B2IVector m_aFrameSize;
double m_fScale; double m_fScale;
public: public:
Kf5VirtualDevice( DeviceFormat eFormat, double fScale ); Qt5VirtualDevice( DeviceFormat eFormat, double fScale );
virtual ~Kf5VirtualDevice() override; virtual ~Qt5VirtualDevice() override;
// SalVirtualDevice // SalVirtualDevice
virtual SalGraphics* AcquireGraphics() override; virtual SalGraphics* AcquireGraphics() override;

View File

@@ -17,34 +17,34 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "Kf5Widget.hxx" #include "Qt5Widget.hxx"
#include <Kf5Widget.moc> #include <Qt5Widget.moc>
#include "Kf5Frame.hxx" #include "Qt5Frame.hxx"
#include "Kf5Graphics.hxx" #include "Qt5Graphics.hxx"
#include <QtGui/QImage> #include <QtGui/QImage>
#include <QtGui/QPainter> #include <QtGui/QPainter>
#include <QtGui/QPaintEvent> #include <QtGui/QPaintEvent>
Kf5Widget::Kf5Widget( Kf5Frame &rFrame, QWidget *parent, Qt::WindowFlags f ) Qt5Widget::Qt5Widget( Qt5Frame &rFrame, QWidget *parent, Qt::WindowFlags f )
: QWidget( parent, f ) : QWidget( parent, f )
, m_pFrame( &rFrame ) , m_pFrame( &rFrame )
{ {
create(); create();
} }
Kf5Widget::~Kf5Widget() Qt5Widget::~Qt5Widget()
{ {
} }
void Kf5Widget::paintEvent( QPaintEvent *pEvent ) void Qt5Widget::paintEvent( QPaintEvent *pEvent )
{ {
QPainter p( this ); QPainter p( this );
p.drawImage( pEvent->rect().topLeft(), *m_pFrame->m_pQImage, pEvent->rect() ); 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 ); QImage *pImage = new QImage( m_pFrame->m_pQWidget->size(), QImage::Format_ARGB32 );
m_pFrame->m_pGraphics->ChangeQImage( pImage ); m_pFrame->m_pGraphics->ChangeQImage( pImage );

View File

@@ -21,25 +21,26 @@
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
class Kf5Frame; class Qt5Frame;
class Qt5Object;
class QPaintEvent; class QPaintEvent;
class QResizeEvent; class QResizeEvent;
class Kf5Widget class Qt5Widget
: public QWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
Kf5Frame *m_pFrame; Qt5Frame *m_pFrame;
void paintEvent( QPaintEvent* ) override; void paintEvent( QPaintEvent* ) override;
void resizeEvent( QResizeEvent* ) override; void resizeEvent( QResizeEvent* ) override;
public: public:
Kf5Widget( Kf5Frame &rFrame, Qt5Widget( Qt5Frame &rFrame,
QWidget *parent = Q_NULLPTR, QWidget *parent = Q_NULLPTR,
Qt::WindowFlags f = Qt::WindowFlags() ); Qt::WindowFlags f = Qt::WindowFlags() );
virtual ~Kf5Widget() override; virtual ~Qt5Widget() override;
}; };
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -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;
}

View File

@@ -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( &notifier, 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;
}