Merge master into api_changes
Conflicts: src/corelib/global/qisenum.h src/dbus/qdbusconnection_p.h src/widgets/kernel/qwidget.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: I85102515d5fec835832cc20ffdc5c1ba578bd01d
This commit is contained in:
commit
d236fe2214
1
.gitignore
vendored
1
.gitignore
vendored
@ -97,6 +97,7 @@ configure.cache
|
|||||||
config.status
|
config.status
|
||||||
mkspecs/default
|
mkspecs/default
|
||||||
mkspecs/qconfig.pri
|
mkspecs/qconfig.pri
|
||||||
|
mkspecs/qdevice.pri
|
||||||
moc_*.cpp
|
moc_*.cpp
|
||||||
qmake/qmake.exe
|
qmake/qmake.exe
|
||||||
qmake/Makefile.bak
|
qmake/Makefile.bak
|
||||||
|
@ -68,7 +68,7 @@ test -r Makefile && $MAKE distclean >/dev/null 2>&1
|
|||||||
# Make sure output from possible previous tests is gone
|
# Make sure output from possible previous tests is gone
|
||||||
rm -f "$EXE" "${EXE}.exe"
|
rm -f "$EXE" "${EXE}.exe"
|
||||||
|
|
||||||
"$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
|
OUTDIR=$OUTDIR "$OUTDIR/bin/qmake" -nocache -spec "$QMKSPEC" "CONFIG+=$QMAKE_CONFIG" "CONFIG-=debug_and_release" "LIBS*=$LFLAGS" "LIBS+=$MAC_ARCH_LFLAGS" "INCLUDEPATH*=$INCLUDEPATH" "QMAKE_CXXFLAGS*=$CXXFLAGS" "QMAKE_CXXFLAGS+=$MAC_ARCH_CXXFLAGS" "QT_BUILD_TREE=$OUTDIR" "$SRCDIR/$TEST/$EXE.pro" -o "$OUTDIR/$TEST/Makefile"
|
||||||
|
|
||||||
if [ "$VERBOSE" = "yes" ]; then
|
if [ "$VERBOSE" = "yes" ]; then
|
||||||
$MAKE
|
$MAKE
|
||||||
|
57
configure
vendored
57
configure
vendored
@ -71,8 +71,10 @@ QTCONFIG_CONFIG=
|
|||||||
QT_CONFIG=
|
QT_CONFIG=
|
||||||
SUPPORTED=
|
SUPPORTED=
|
||||||
QMAKE_VARS_FILE=.qmake.vars
|
QMAKE_VARS_FILE=.qmake.vars
|
||||||
|
DEVICE_VARS_FILE=.device.vars
|
||||||
|
|
||||||
:> "$QMAKE_VARS_FILE"
|
:> "$QMAKE_VARS_FILE"
|
||||||
|
:> "$DEVICE_VARS_FILE"
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# utility functions
|
# utility functions
|
||||||
@ -223,6 +225,23 @@ linkerSupportsFlag()
|
|||||||
compilerSupportsFlag "$lflags" >/dev/null 2>&1
|
compilerSupportsFlag "$lflags" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# device options
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
DeviceVar()
|
||||||
|
{
|
||||||
|
case "$1" in
|
||||||
|
set)
|
||||||
|
eq="="
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo >&2 "BUG: wrong command to QMakeVar: $1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
echo "$2" "$eq" "$3" >> "$DEVICE_VARS_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# operating system detection
|
# operating system detection
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
@ -733,7 +752,6 @@ CFG_SSE4_2=auto
|
|||||||
CFG_AVX=auto
|
CFG_AVX=auto
|
||||||
CFG_AVX2=auto
|
CFG_AVX2=auto
|
||||||
CFG_REDUCE_RELOCATIONS=auto
|
CFG_REDUCE_RELOCATIONS=auto
|
||||||
CFG_NAS=no
|
|
||||||
CFG_ACCESSIBILITY=auto
|
CFG_ACCESSIBILITY=auto
|
||||||
CFG_IWMMXT=no
|
CFG_IWMMXT=no
|
||||||
CFG_NEON=auto
|
CFG_NEON=auto
|
||||||
@ -909,7 +927,7 @@ while [ "$#" -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
VAL=$1
|
VAL=$1
|
||||||
;;
|
;;
|
||||||
-prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir)
|
-prefix|-docdir|-headerdir|-plugindir|-importdir|-datadir|-libdir|-bindir|-translationdir|-sysconfdir|-examplesdir|-testsdir|-depths|-make|-nomake|-platform|-xplatform|-device|-device-option|-sdk|-arch|-host-arch|-mysql_config|-sysroot|-hostdatadir|-hostbindir)
|
||||||
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
|
VAR=`echo $1 | sed "s,^-\(.*\),\1,"`
|
||||||
shift
|
shift
|
||||||
VAL="$1"
|
VAL="$1"
|
||||||
@ -1305,6 +1323,14 @@ while [ "$#" -gt 0 ]; do
|
|||||||
XPLATFORM="$VAL"
|
XPLATFORM="$VAL"
|
||||||
case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
|
case `basename "$XPLATFORM"` in win32-g++*) XPLATFORM_MINGW=yes;; esac
|
||||||
;;
|
;;
|
||||||
|
device)
|
||||||
|
XPLATFORM="devices/$VAL"
|
||||||
|
;;
|
||||||
|
device-option)
|
||||||
|
DEV_VAR=`echo $VAL | sed "s,^\(.*\)=.*,\1,"`
|
||||||
|
DEV_VAL=`echo $VAL | sed "s,^.*=\(.*\),\1,"`
|
||||||
|
DeviceVar set $DEV_VAR $DEV_VAL
|
||||||
|
;;
|
||||||
debug-and-release)
|
debug-and-release)
|
||||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
|
||||||
CFG_DEBUG_RELEASE="$VAL"
|
CFG_DEBUG_RELEASE="$VAL"
|
||||||
@ -1582,13 +1608,6 @@ while [ "$#" -gt 0 ]; do
|
|||||||
UNKNOWN_OPT=yes
|
UNKNOWN_OPT=yes
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
nas-sound)
|
|
||||||
if [ "$VAL" = "system" ] || [ "$VAL" = "no" ]; then
|
|
||||||
CFG_NAS="$VAL"
|
|
||||||
else
|
|
||||||
UNKNOWN_OPT=yes
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
xcursor)
|
xcursor)
|
||||||
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
|
if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ] || [ "$VAL" = "runtime" ]; then
|
||||||
CFG_XCURSOR="$VAL"
|
CFG_XCURSOR="$VAL"
|
||||||
@ -2448,6 +2467,15 @@ if [ "$CFG_RTOS_ENABLED" = "no" ]; then
|
|||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# write out device config before we run the test.
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
if cmp -s "$DEVICE_VARS_FILE" "$outpath/mkspecs/qdevice.pri"; then
|
||||||
|
rm -f "$DEVICE_VARS_FILE"
|
||||||
|
else
|
||||||
|
mv -f $DEVICE_VARS_FILE "$outpath/mkspecs/qdevice.pri"
|
||||||
|
fi
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# tests that don't need qmake (must be run before displaying help)
|
# tests that don't need qmake (must be run before displaying help)
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
@ -2921,6 +2949,7 @@ Usage: $relconf [-h] [-prefix <dir>] [-prefix-install] [-bindir <dir>] [-libdir
|
|||||||
[-no-openssl] [-openssl] [-openssl-linked]
|
[-no-openssl] [-openssl] [-openssl-linked]
|
||||||
[-no-gtkstyle] [-gtkstyle]
|
[-no-gtkstyle] [-gtkstyle]
|
||||||
[-qt-pcre] [-system-pcre]
|
[-qt-pcre] [-system-pcre]
|
||||||
|
[-device <name>] [-device-option <key=value>]
|
||||||
[additional platform specific options (see below)]
|
[additional platform specific options (see below)]
|
||||||
|
|
||||||
|
|
||||||
@ -3182,6 +3211,10 @@ Additional options:
|
|||||||
|
|
||||||
-force-asserts ........ Force Q_ASSERT to be enabled even in release builds.
|
-force-asserts ........ Force Q_ASSERT to be enabled even in release builds.
|
||||||
|
|
||||||
|
-device <name> ............... Cross-compile for device <name> (experimental)
|
||||||
|
-device-option <key=value> ... Add device specific options for the device mkspec
|
||||||
|
(experimental)
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
|
if [ "$CFG_SEPARATE_DEBUG_INFO" = "auto" ]; then
|
||||||
@ -3915,12 +3948,12 @@ fi # Build qmake
|
|||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Use config.tests/arch/arch.pro to has the compiler tell us what the target architecture is
|
# Use config.tests/arch/arch.pro to has the compiler tell us what the target architecture is
|
||||||
CFG_ARCH=`"$outpath/bin/qmake" -spec "$XQMAKESPEC" -o /dev/null "$relpath/config.tests/arch/arch.pro" 2>&1 | sed -n -e 's,^Project MESSAGE:.*Architecture: \([a-zA-Z0-9_]*\).*,\1,p'`
|
CFG_ARCH=`OUTDIR="$outpath" "$outpath/bin/qmake" -spec "$XQMAKESPEC" -o /dev/null "$relpath/config.tests/arch/arch.pro" 2>&1 | sed -n -e 's,^Project MESSAGE:.*Architecture: \([a-zA-Z0-9_]*\).*,\1,p'`
|
||||||
|
|
||||||
[ -z "$CFG_ARCH" ] && CFG_ARCH="unknown"
|
[ -z "$CFG_ARCH" ] && CFG_ARCH="unknown"
|
||||||
if [ "$QMAKESPEC" != "$XQMAKESPEC" ]; then
|
if [ "$QMAKESPEC" != "$XQMAKESPEC" ]; then
|
||||||
# Do the same test again, using the host compiler
|
# Do the same test again, using the host compiler
|
||||||
CFG_HOST_ARCH=`"$outpath/bin/qmake" -spec "$QMAKESPEC" -o /dev/null "$relpath/config.tests/arch/arch.pro" 2>&1 | sed -n -e 's,^Project MESSAGE:.*Architecture: \([a-zA-Z0-9]*\).*,\1,p'`
|
CFG_HOST_ARCH=`OUTDIR="$outpath" "$outpath/bin/qmake" -spec "$QMAKESPEC" -o /dev/null "$relpath/config.tests/arch/arch.pro" 2>&1 | sed -n -e 's,^Project MESSAGE:.*Architecture: \([a-zA-Z0-9_]*\).*,\1,p'`
|
||||||
[ -z "$CFG_HOST_ARCH" ] && CFG_HOST_ARCH="unknown"
|
[ -z "$CFG_HOST_ARCH" ] && CFG_HOST_ARCH="unknown"
|
||||||
else
|
else
|
||||||
# not cross compiling, host == target
|
# not cross compiling, host == target
|
||||||
@ -5667,7 +5700,6 @@ fi
|
|||||||
[ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer"
|
[ "$CFG_GSTREAMER" = "yes" ] && QT_CONFIG="$QT_CONFIG gstreamer"
|
||||||
[ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus"
|
[ "$CFG_DBUS" = "yes" ] && QT_CONFIG="$QT_CONFIG dbus"
|
||||||
[ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked"
|
[ "$CFG_DBUS" = "linked" ] && QT_CONFIG="$QT_CONFIG dbus dbus-linked"
|
||||||
[ "$CFG_NAS" = "system" ] && QT_CONFIG="$QT_CONFIG nas"
|
|
||||||
[ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl"
|
[ "$CFG_OPENSSL" = "yes" ] && QT_CONFIG="$QT_CONFIG openssl"
|
||||||
[ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked"
|
[ "$CFG_OPENSSL" = "linked" ] && QT_CONFIG="$QT_CONFIG openssl-linked"
|
||||||
[ "$CFG_MAC_HARFBUZZ" = "yes" ] && QT_CONFIG="$QT_CONFIG harfbuzz"
|
[ "$CFG_MAC_HARFBUZZ" = "yes" ] && QT_CONFIG="$QT_CONFIG harfbuzz"
|
||||||
@ -6150,7 +6182,6 @@ QMakeVar set sql-plugins "$SQL_PLUGINS"
|
|||||||
[ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"
|
[ "$CFG_IPV6IFNAME" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_IPV6IFNAME"
|
||||||
[ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
|
[ "$CFG_GETIFADDRS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_GETIFADDRS"
|
||||||
[ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
|
[ "$CFG_INOTIFY" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_INOTIFY"
|
||||||
[ "$CFG_NAS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NAS"
|
|
||||||
[ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
|
[ "$CFG_NIS" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_NIS"
|
||||||
[ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL QT_NO_SSL"
|
[ "$CFG_OPENSSL" = "no" ] && QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_OPENSSL QT_NO_SSL"
|
||||||
[ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
|
[ "$CFG_OPENSSL" = "linked" ]&& QCONFIG_FLAGS="$QCONFIG_FLAGS QT_LINKED_OPENSSL"
|
||||||
|
@ -560,3 +560,26 @@ bool readConfiguration(const QFile &file)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
//! [qunlikely]
|
//! [qunlikely]
|
||||||
|
|
||||||
|
//! [qunreachable-enum]
|
||||||
|
enum Shapes {
|
||||||
|
Rectangle,
|
||||||
|
Triangle,
|
||||||
|
Circle,
|
||||||
|
NumShapes
|
||||||
|
};
|
||||||
|
//! [qunreachable-enum]
|
||||||
|
|
||||||
|
//! [qunreachable-switch]
|
||||||
|
switch (shape) {
|
||||||
|
case Rectangle:
|
||||||
|
return rectangle();
|
||||||
|
case Triangle:
|
||||||
|
return triangle();
|
||||||
|
case Circle:
|
||||||
|
return circle();
|
||||||
|
case NumShapes:
|
||||||
|
Q_UNREACHABLE();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
//! [qunreachable-switch]
|
||||||
|
27
mkspecs/features/device_config.prf
Normal file
27
mkspecs/features/device_config.prf
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
# Load generated qdevice.pri
|
||||||
|
exists($$_QMAKE_CACHE_) {
|
||||||
|
# set in default_pre, so it's the first place to check for qdevice.pri
|
||||||
|
DIR = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)
|
||||||
|
!isEmpty(DIR):DEVICE_PRI = $$DIR/mkspecs/qdevice.pri
|
||||||
|
}
|
||||||
|
|
||||||
|
isEmpty(DEVICE_PRI) {
|
||||||
|
# OUTDIR environ is set by configure (arch detection) and compile.test
|
||||||
|
DIR = $$(OUTDIR)
|
||||||
|
!isEmpty(DIR):DEVICE_PRI = $$DIR/mkspecs/qdevice.pri
|
||||||
|
}
|
||||||
|
|
||||||
|
isEmpty(DEVICE_PRI) {
|
||||||
|
DIR = $$[QT_HOST_DATA]
|
||||||
|
!isEmpty(DIR):DEVICE_PRI = $$DIR/mkspecs/qdevice.pri
|
||||||
|
}
|
||||||
|
|
||||||
|
isEmpty(DEVICE_PRI) {
|
||||||
|
error(Could not locate qdevice.pri)
|
||||||
|
}
|
||||||
|
|
||||||
|
exists($$DEVICE_PRI):include($$DEVICE_PRI)
|
||||||
|
|
||||||
|
unset(DEVICE_PRI)
|
||||||
|
unset(DIR)
|
||||||
|
|
@ -180,7 +180,13 @@ defineTest(qtPrepareTool) {
|
|||||||
} else {
|
} else {
|
||||||
$$1 = $$eval($$1).exe
|
$$1 = $$eval($$1).exe
|
||||||
}
|
}
|
||||||
|
} else:contains(QMAKE_HOST.os, Darwin) {
|
||||||
|
BUNDLENAME = $$eval($$1).app/Contents/MacOS/$$2
|
||||||
|
exists($$BUNDLENAME) {
|
||||||
|
$$1 = $$BUNDLENAME
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export($$1)
|
export($$1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ CONFIG -= fix_output_dirs
|
|||||||
win32|mac:!macx-xcode:CONFIG += debug_and_release
|
win32|mac:!macx-xcode:CONFIG += debug_and_release
|
||||||
linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
|
linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
|
||||||
|
|
||||||
CONFIG += create_cmake
|
!isEmpty(MODULE):CONFIG += create_cmake
|
||||||
|
|
||||||
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
|
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
|
||||||
unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
|
unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
|
||||||
|
@ -15,7 +15,7 @@ QMAKE_YACC = yacc
|
|||||||
QMAKE_YACCFLAGS = -d
|
QMAKE_YACCFLAGS = -d
|
||||||
QMAKE_CFLAGS = -falign-stack=maintain-16-byte
|
QMAKE_CFLAGS = -falign-stack=maintain-16-byte
|
||||||
QMAKE_CFLAGS_DEPS = -M
|
QMAKE_CFLAGS_DEPS = -M
|
||||||
QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125,2259
|
QMAKE_CFLAGS_WARN_ON = -w1 -Wcheck -wd654,1572,411,873,1125,2259,2261
|
||||||
QMAKE_CFLAGS_WARN_OFF = -w
|
QMAKE_CFLAGS_WARN_OFF = -w
|
||||||
QMAKE_CFLAGS_RELEASE = -O2 -falign-functions=16 -ansi-alias -fstrict-aliasing
|
QMAKE_CFLAGS_RELEASE = -O2 -falign-functions=16 -ansi-alias -fstrict-aliasing
|
||||||
QMAKE_CFLAGS_DEBUG = -O0 -g
|
QMAKE_CFLAGS_DEBUG = -O0 -g
|
||||||
|
9
mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf
Normal file
9
mkspecs/unsupported/blackberry-armv7le-qcc/qmake.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# qmake configuration for blackberry x86 systems
|
||||||
|
#
|
||||||
|
|
||||||
|
DEFINES += Q_OS_BLACKBERRY
|
||||||
|
CONFIG += blackberry
|
||||||
|
LIBS += -lbps
|
||||||
|
|
||||||
|
include(../qnx-armv7le-qcc/qmake.conf)
|
42
mkspecs/unsupported/blackberry-armv7le-qcc/qplatformdefs.h
Normal file
42
mkspecs/unsupported/blackberry-armv7le-qcc/qplatformdefs.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2012 Research In Motion Limited. <blackberry-qt@qnx.com>
|
||||||
|
** Contact: http://www.qt-project.org/
|
||||||
|
**
|
||||||
|
** This file is part of the QtCore module of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||||
|
** file. Please review the following information to ensure the GNU Lesser
|
||||||
|
** General Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU General
|
||||||
|
** Public License version 3.0 as published by the Free Software Foundation
|
||||||
|
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||||
|
** file. Please review the following information to ensure the GNU General
|
||||||
|
** Public License version 3.0 requirements will be met:
|
||||||
|
** http://www.gnu.org/copyleft/gpl.html.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "../qnx-armv7le-qcc/qplatformdefs.h"
|
9
mkspecs/unsupported/blackberry-x86-qcc/qmake.conf
Normal file
9
mkspecs/unsupported/blackberry-x86-qcc/qmake.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
# qmake configuration for blackberry x86 systems
|
||||||
|
#
|
||||||
|
|
||||||
|
DEFINES += Q_OS_BLACKBERRY
|
||||||
|
CONFIG += blackberry
|
||||||
|
LIBS += -lbps
|
||||||
|
|
||||||
|
include(../qnx-x86-qcc/qmake.conf)
|
42
mkspecs/unsupported/blackberry-x86-qcc/qplatformdefs.h
Normal file
42
mkspecs/unsupported/blackberry-x86-qcc/qplatformdefs.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2012 Research In Motion Limited. <blackberry-qt@qnx.com>
|
||||||
|
** Contact: http://www.qt-project.org/
|
||||||
|
**
|
||||||
|
** This file is part of the QtCore module of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||||
|
** file. Please review the following information to ensure the GNU Lesser
|
||||||
|
** General Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU General
|
||||||
|
** Public License version 3.0 as published by the Free Software Foundation
|
||||||
|
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||||
|
** file. Please review the following information to ensure the GNU General
|
||||||
|
** Public License version 3.0 requirements will be met:
|
||||||
|
** http://www.gnu.org/copyleft/gpl.html.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "../qnx-x86-qcc/qplatformdefs.h"
|
@ -72,6 +72,7 @@ unix {
|
|||||||
$(DEL_FILE) src/corelib/global/qconfig.h; \
|
$(DEL_FILE) src/corelib/global/qconfig.h; \
|
||||||
$(DEL_FILE) src/corelib/global/qconfig.cpp; \
|
$(DEL_FILE) src/corelib/global/qconfig.cpp; \
|
||||||
$(DEL_FILE) mkspecs/qconfig.pri; \
|
$(DEL_FILE) mkspecs/qconfig.pri; \
|
||||||
|
$(DEL_FILE) mkspecs/qdevice.pri; \
|
||||||
$(DEL_FILE) mkspecs/qmodule.pri; \
|
$(DEL_FILE) mkspecs/qmodule.pri; \
|
||||||
$(DEL_FILE) .qmake.cache; \
|
$(DEL_FILE) .qmake.cache; \
|
||||||
(cd qmake && $(MAKE) distclean);
|
(cd qmake && $(MAKE) distclean);
|
||||||
@ -80,6 +81,7 @@ win32 {
|
|||||||
confclean.commands += -$(DEL_FILE) src\\corelib\\global\\qconfig.h $$escape_expand(\\n\\t) \
|
confclean.commands += -$(DEL_FILE) src\\corelib\\global\\qconfig.h $$escape_expand(\\n\\t) \
|
||||||
-$(DEL_FILE) src\\corelib\\global\\qconfig.cpp $$escape_expand(\\n\\t) \
|
-$(DEL_FILE) src\\corelib\\global\\qconfig.cpp $$escape_expand(\\n\\t) \
|
||||||
-$(DEL_FILE) mkspecs\\qconfig.pri $$escape_expand(\\n\\t) \
|
-$(DEL_FILE) mkspecs\\qconfig.pri $$escape_expand(\\n\\t) \
|
||||||
|
-$(DEL_FILE) mkspecs\\qdevice.pri $$escape_expand(\\n\\t) \
|
||||||
-$(DEL_FILE) mkspecs\\qmodule.pri $$escape_expand(\\n\\t) \
|
-$(DEL_FILE) mkspecs\\qmodule.pri $$escape_expand(\\n\\t) \
|
||||||
-$(DEL_FILE) .qmake.cache $$escape_expand(\\n\\t) \
|
-$(DEL_FILE) .qmake.cache $$escape_expand(\\n\\t) \
|
||||||
(cd qmake && $(MAKE) distclean)
|
(cd qmake && $(MAKE) distclean)
|
||||||
@ -115,7 +117,7 @@ INSTALLS += configtests
|
|||||||
|
|
||||||
#mkspecs
|
#mkspecs
|
||||||
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
|
mkspecs.path = $$[QT_HOST_DATA]/mkspecs
|
||||||
mkspecs.files = $$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri $$files($$PWD/mkspecs/*)
|
mkspecs.files = $$OUT_PWD/mkspecs/qconfig.pri $$OUT_PWD/mkspecs/qmodule.pri $$OUT_PWD/mkspecs/qdevice.pri $$files($$PWD/mkspecs/*)
|
||||||
mkspecs.files -= $$PWD/mkspecs/modules
|
mkspecs.files -= $$PWD/mkspecs/modules
|
||||||
unix {
|
unix {
|
||||||
DEFAULT_QMAKESPEC = $$QMAKESPEC
|
DEFAULT_QMAKESPEC = $$QMAKESPEC
|
||||||
|
@ -387,6 +387,7 @@ bool QBasicAtomicOps<2>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa
|
|||||||
asm volatile("0:\n"
|
asm volatile("0:\n"
|
||||||
"ldrexh %[result], [%[_q_value]]\n"
|
"ldrexh %[result], [%[_q_value]]\n"
|
||||||
"eors %[result], %[result], %[expectedValue]\n"
|
"eors %[result], %[result], %[expectedValue]\n"
|
||||||
|
"itt eq\n"
|
||||||
"strexheq %[result], %[newValue], [%[_q_value]]\n"
|
"strexheq %[result], %[newValue], [%[_q_value]]\n"
|
||||||
"teqeq %[result], #1\n"
|
"teqeq %[result], #1\n"
|
||||||
"beq 0b\n"
|
"beq 0b\n"
|
||||||
@ -497,6 +498,7 @@ bool QBasicAtomicOps<8>::testAndSetRelaxed(T &_q_value, T expectedValue, T newVa
|
|||||||
"eor %[result], %[result], %[expectedValue]\n"
|
"eor %[result], %[result], %[expectedValue]\n"
|
||||||
"eor %H[result], %H[result], %H[expectedValue]\n"
|
"eor %H[result], %H[result], %H[expectedValue]\n"
|
||||||
"orrs %[result], %[result], %H[result]\n"
|
"orrs %[result], %[result], %H[result]\n"
|
||||||
|
"itt eq\n"
|
||||||
"strexdeq %[result], %[newValue], %H[newValue], [%[_q_value]]\n"
|
"strexdeq %[result], %[newValue], %H[newValue], [%[_q_value]]\n"
|
||||||
"teqeq %[result], #1\n"
|
"teqeq %[result], #1\n"
|
||||||
"beq 0b\n"
|
"beq 0b\n"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
||||||
|
** Copyright (C) 2012 Intel Corporation
|
||||||
** Contact: http://www.qt-project.org/
|
** Contact: http://www.qt-project.org/
|
||||||
**
|
**
|
||||||
** This file is part of the QtCore module of the Qt Toolkit.
|
** This file is part of the QtCore module of the Qt Toolkit.
|
||||||
@ -87,6 +88,8 @@
|
|||||||
# define Q_NO_TEMPLATE_FRIENDS
|
# define Q_NO_TEMPLATE_FRIENDS
|
||||||
# define Q_ALIGNOF(type) __alignof(type)
|
# define Q_ALIGNOF(type) __alignof(type)
|
||||||
# define Q_DECL_ALIGN(n) __declspec(align(n))
|
# define Q_DECL_ALIGN(n) __declspec(align(n))
|
||||||
|
# define Q_ASSUME(expr) __assume(expr)
|
||||||
|
# define Q_UNREACHABLE() __assume(0)
|
||||||
/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */
|
/* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */
|
||||||
# if defined(__INTEL_COMPILER)
|
# if defined(__INTEL_COMPILER)
|
||||||
# define Q_CC_INTEL
|
# define Q_CC_INTEL
|
||||||
@ -140,11 +143,19 @@
|
|||||||
# if defined(__INTEL_COMPILER)
|
# if defined(__INTEL_COMPILER)
|
||||||
/* Intel C++ also masquerades as GCC */
|
/* Intel C++ also masquerades as GCC */
|
||||||
# define Q_CC_INTEL
|
# define Q_CC_INTEL
|
||||||
# endif
|
# define Q_ASSUME(expr) __assume(expr)
|
||||||
# if defined(__clang__)
|
# define Q_UNREACHABLE() __assume(0)
|
||||||
|
# elif defined(__clang__)
|
||||||
/* Clang also masquerades as GCC */
|
/* Clang also masquerades as GCC */
|
||||||
# define Q_CC_CLANG
|
# define Q_CC_CLANG
|
||||||
|
# define Q_ASSUME(expr) if (expr){} else __builtin_unreachable()
|
||||||
|
# define Q_UNREACHABLE() __builtin_unreachable()
|
||||||
|
# else
|
||||||
|
/* Plain GCC */
|
||||||
|
# define Q_ASSUME(expr) if (expr){} else __builtin_unreachable()
|
||||||
|
# define Q_UNREACHABLE() __builtin_unreachable()
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# define Q_ALIGNOF(type) __alignof__(type)
|
# define Q_ALIGNOF(type) __alignof__(type)
|
||||||
# define Q_TYPEOF(expr) __typeof__(expr)
|
# define Q_TYPEOF(expr) __typeof__(expr)
|
||||||
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
|
# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n)))
|
||||||
@ -157,44 +168,8 @@
|
|||||||
# define QT_NO_ARM_EABI
|
# define QT_NO_ARM_EABI
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
|
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403 && !defined(Q_CC_CLANG)
|
||||||
# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
|
# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
|
||||||
# endif
|
|
||||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(__clang__) /* clang C++11 enablers are found below, don't do them here */
|
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
|
|
||||||
/* C++0x features supported in GCC 4.3: */
|
|
||||||
# define Q_COMPILER_VARIADIC_MACROS
|
|
||||||
# define Q_COMPILER_RVALUE_REFS
|
|
||||||
# define Q_COMPILER_DECLTYPE
|
|
||||||
# define Q_COMPILER_STATIC_ASSERT
|
|
||||||
# endif
|
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404
|
|
||||||
/* C++0x features supported in GCC 4.4: */
|
|
||||||
# define Q_COMPILER_UNICODE_STRINGS
|
|
||||||
# define Q_COMPILER_VARIADIC_TEMPLATES
|
|
||||||
# define Q_COMPILER_AUTO_TYPE
|
|
||||||
# define Q_COMPILER_EXTERN_TEMPLATES
|
|
||||||
# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
|
|
||||||
# define Q_COMPILER_CLASS_ENUM
|
|
||||||
# define Q_COMPILER_INITIALIZER_LISTS
|
|
||||||
# define Q_COMPILER_ATOMICS
|
|
||||||
# endif
|
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
|
|
||||||
/* C++0x features supported in GCC 4.5: */
|
|
||||||
# define Q_COMPILER_LAMBDA
|
|
||||||
# endif
|
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
|
||||||
/* C++0x features supported in GCC 4.6: */
|
|
||||||
# define Q_COMPILER_NULLPTR
|
|
||||||
# define Q_COMPILER_CONSTEXPR
|
|
||||||
# define Q_COMPILER_UNRESTRICTED_UNIONS
|
|
||||||
# define Q_COMPILER_RANGE_FOR
|
|
||||||
# endif
|
|
||||||
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
|
|
||||||
/* C++0x features supported in GCC 4.7: */
|
|
||||||
# define Q_COMPILER_EXPLICIT_OVERRIDES
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* IBM compiler versions are a bit messy. There are actually two products:
|
/* IBM compiler versions are a bit messy. There are actually two products:
|
||||||
@ -420,22 +395,66 @@
|
|||||||
# error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
|
# error "Qt has not been tested with this compiler - see http://www.qt-project.org/"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* C++11 support
|
||||||
|
*
|
||||||
|
* Paper Macro
|
||||||
|
* N2341 Q_COMPILER_ALIGNAS
|
||||||
|
* N2341 Q_COMPILER_ALIGNOF
|
||||||
|
* N2427 Q_COMPILER_ATOMICS
|
||||||
|
* N2761 Q_COMPILER_ATTRIBUTES
|
||||||
|
* N2541 Q_COMPILER_AUTO_FUNCTION
|
||||||
|
* N1984 N2546 Q_COMPILER_AUTO_TYPE
|
||||||
|
* N2437 Q_COMPILER_CLASS_ENUM
|
||||||
|
* N2235 N3276 Q_COMPILER_DECLTYPE
|
||||||
|
* N2346 Q_COMPILER_DEFAULT_DELETE_MEMBERS
|
||||||
|
* N1986 Q_COMPILER_DELEGATING_CONSTRUCTORS
|
||||||
|
* N3206 N3272 Q_COMPILER_EXPLICIT_OVERRIDES (v0.9 and above only)
|
||||||
|
* N1987 Q_COMPILER_EXTERN_TEMPLATES
|
||||||
|
* N2540 Q_COMPILER_INHERITING_CONSTRUCTORS
|
||||||
|
* N2672 Q_COMPILER_INITIALIZER_LISTS
|
||||||
|
* N2658 N2927 Q_COMPILER_LAMBDA (v1.0 and above only)
|
||||||
|
* N2756 Q_COMPILER_NONSTATIC_MEMBER_INIT
|
||||||
|
* N2431 Q_COMPILER_NULLPTR
|
||||||
|
* N2930 Q_COMPILER_RANGE_FOR
|
||||||
|
* N2442 Q_COMPILER_RAW_STRINGS
|
||||||
|
* N2439 Q_COMPILER_REF_QUALIFIERS
|
||||||
|
* N2118 N2844 N3053 Q_COMPILER_RVALUE_REFS (Note: GCC 4.3 implements only the oldest)
|
||||||
|
* N1720 Q_COMPILER_STATIC_ASSERT
|
||||||
|
* N2258 Q_COMPILER_TEMPLATE_ALIAS
|
||||||
|
* N2659 Q_COMPILER_THREAD_LOCAL
|
||||||
|
* N2756 Q_COMPILER_UDL
|
||||||
|
* N2442 Q_COMPILER_UNICODE_STRINGS
|
||||||
|
* N2544 Q_COMPILER_UNRESTRICTED_UNIONS
|
||||||
|
* N1653 Q_COMPILER_VARIADIC_MACROS
|
||||||
|
* N2242 N2555 Q_COMPILER_VARIADIC_TEMPLATES
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef Q_CC_INTEL
|
#ifdef Q_CC_INTEL
|
||||||
# if __INTEL_COMPILER < 1200
|
# if __INTEL_COMPILER < 1200
|
||||||
# define Q_NO_TEMPLATE_FRIENDS
|
# define Q_NO_TEMPLATE_FRIENDS
|
||||||
# endif
|
# endif
|
||||||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(__GXX_EXPERIMENTAL_CPP0X__)
|
# if defined(_CHAR16T) || __cplusplus >= 201103L
|
||||||
|
# define Q_COMPILER_VARIADIC_MACROS
|
||||||
# if __INTEL_COMPILER >= 1200
|
# if __INTEL_COMPILER >= 1200
|
||||||
# define Q_COMPILER_RVALUE_REFS
|
|
||||||
# define Q_COMPILER_EXTERN_TEMPLATES
|
|
||||||
# define Q_COMPILER_DECLTYPE
|
|
||||||
# define Q_COMPILER_VARIADIC_TEMPLATES
|
|
||||||
# define Q_COMPILER_AUTO_TYPE
|
# define Q_COMPILER_AUTO_TYPE
|
||||||
# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
|
|
||||||
# define Q_COMPILER_CLASS_ENUM
|
# define Q_COMPILER_CLASS_ENUM
|
||||||
|
# define Q_COMPILER_DECLTYPE
|
||||||
|
# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
|
||||||
|
# define Q_COMPILER_EXTERN_TEMPLATES
|
||||||
# define Q_COMPILER_LAMBDA
|
# define Q_COMPILER_LAMBDA
|
||||||
|
# define Q_COMPILER_RVALUE_REFS
|
||||||
# define Q_COMPILER_STATIC_ASSERT
|
# define Q_COMPILER_STATIC_ASSERT
|
||||||
|
# define Q_COMPILER_THREAD_LOCAL
|
||||||
|
# define Q_COMPILER_VARIADIC_MACROS
|
||||||
|
# endif
|
||||||
|
# if __INTEL_COMPILER >= 1210
|
||||||
|
# define Q_COMPILER_ATTRIBUTES
|
||||||
|
# define Q_COMPILER_AUTO_FUNCTION
|
||||||
|
# define Q_COMPILER_NULLPTR
|
||||||
|
# define Q_COMPILER_TEMPLATE_ALIAS
|
||||||
|
# define Q_COMPILER_UNICODE_STRINGS
|
||||||
|
# define Q_COMPILER_VARIADIC_TEMPLATES
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@ -463,6 +482,7 @@
|
|||||||
# define Q_COMPILER_CLASS_ENUM
|
# define Q_COMPILER_CLASS_ENUM
|
||||||
/* defaulted members in 3.0, deleted members in 2.9 */
|
/* defaulted members in 3.0, deleted members in 2.9 */
|
||||||
# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
|
# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
|
||||||
|
# define Q_COMPILER_DELEGATING_CONSTRUCTORS
|
||||||
# define Q_COMPILER_EXPLICIT_OVERRIDES
|
# define Q_COMPILER_EXPLICIT_OVERRIDES
|
||||||
# define Q_COMPILER_NULLPTR
|
# define Q_COMPILER_NULLPTR
|
||||||
# define Q_COMPILER_RANGE_FOR
|
# define Q_COMPILER_RANGE_FOR
|
||||||
@ -487,6 +507,60 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif // Q_CC_CLANG
|
#endif // Q_CC_CLANG
|
||||||
|
|
||||||
|
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && !defined(Q_CC_CLANG)
|
||||||
|
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L
|
||||||
|
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 403
|
||||||
|
/* C++11 features supported in GCC 4.3: */
|
||||||
|
# define Q_COMPILER_DECLTYPE
|
||||||
|
# define Q_COMPILER_RVALUE_REFS
|
||||||
|
# define Q_COMPILER_STATIC_ASSERT
|
||||||
|
# define Q_COMPILER_VARIADIC_MACROS
|
||||||
|
# endif
|
||||||
|
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 404
|
||||||
|
/* C++11 features supported in GCC 4.4: */
|
||||||
|
# define Q_COMPILER_ATOMICS
|
||||||
|
# define Q_COMPILER_AUTO_FUNCTION
|
||||||
|
# define Q_COMPILER_AUTO_TYPE
|
||||||
|
# define Q_COMPILER_CLASS_ENUM
|
||||||
|
# define Q_COMPILER_DEFAULT_DELETE_MEMBERS
|
||||||
|
# define Q_COMPILER_EXTERN_TEMPLATES
|
||||||
|
# define Q_COMPILER_INITIALIZER_LISTS
|
||||||
|
# define Q_COMPILER_UNICODE_STRINGS
|
||||||
|
# define Q_COMPILER_VARIADIC_TEMPLATES
|
||||||
|
# endif
|
||||||
|
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 405
|
||||||
|
/* C++11 features supported in GCC 4.5: */
|
||||||
|
# define Q_COMPILER_LAMBDA
|
||||||
|
# define Q_COMPILER_RAW_STRINGS
|
||||||
|
# endif
|
||||||
|
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406
|
||||||
|
/* C++11 features supported in GCC 4.6: */
|
||||||
|
# define Q_COMPILER_CONSTEXPR
|
||||||
|
# define Q_COMPILER_NULLPTR
|
||||||
|
# define Q_COMPILER_UNRESTRICTED_UNIONS
|
||||||
|
# define Q_COMPILER_RANGE_FOR
|
||||||
|
# endif
|
||||||
|
# if (__GNUC__ * 100 + __GNUC_MINOR__) >= 407
|
||||||
|
/* C++11 features supported in GCC 4.7: */
|
||||||
|
# define Q_COMPILER_NONSTATIC_MEMBER_INIT
|
||||||
|
# define Q_COMPILER_DELEGATING_CONSTRUCTORS
|
||||||
|
# define Q_COMPILER_EXPLICIT_OVERRIDES
|
||||||
|
# define Q_COMPILER_TEMPLATE_ALIAS
|
||||||
|
# define Q_COMPILER_UDL
|
||||||
|
# endif
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_CC_MSVC) && _MSC_VER >= 1600 && !defined(Q_CC_INTEL)
|
||||||
|
# define Q_COMPILER_AUTO_TYPE
|
||||||
|
# define Q_COMPILER_LAMBDA
|
||||||
|
# define Q_COMPILER_DECLTYPE
|
||||||
|
# define Q_COMPILER_RVALUE_REFS
|
||||||
|
# define Q_COMPILER_STATIC_ASSERT
|
||||||
|
// MSVC has std::initilizer_list, but does not support the braces initialization
|
||||||
|
//# define Q_COMPILER_INITIALIZER_LISTS
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef Q_COMPILER_MANGLES_RETURN_TYPE
|
#ifndef Q_COMPILER_MANGLES_RETURN_TYPE
|
||||||
# if defined(Q_CC_MSVC)
|
# if defined(Q_CC_MSVC)
|
||||||
# define Q_COMPILER_MANGLES_RETURN_TYPE
|
# define Q_COMPILER_MANGLES_RETURN_TYPE
|
||||||
|
@ -1798,6 +1798,63 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion()
|
|||||||
\sa Q_ASSERT(), qFatal(), {Debugging Techniques}
|
\sa Q_ASSERT(), qFatal(), {Debugging Techniques}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\macro void Q_ASSUME(bool expr)
|
||||||
|
\relates <QtGlobal>
|
||||||
|
\since 5.0
|
||||||
|
|
||||||
|
Causes the compiler to assume that \a expr is true. This macro is useful
|
||||||
|
for improving code generation, by providing the compiler with hints about
|
||||||
|
conditions that it would not otherwise know about. However, there is no
|
||||||
|
guarantee that the compiler will actually use those hints.
|
||||||
|
|
||||||
|
This macro could be considered a "lighter" version of \ref Q_ASSERT. While
|
||||||
|
Q_ASSERT will abort the program's execution if the condition is false,
|
||||||
|
Q_ASSUME will tell the compiler not to generate code for those conditions.
|
||||||
|
Therefore, it is important that the assumptions always hold, otherwise
|
||||||
|
undefined behaviour may occur.
|
||||||
|
|
||||||
|
If \a expr is a constantly false condition, Q_ASSUME will tell the compiler
|
||||||
|
that the current code execution cannot be reached. That is, Q_ASSUME(false)
|
||||||
|
is equivalent to Q_UNREACHABLE().
|
||||||
|
|
||||||
|
\note Q_LIKELY() tells the compiler that the expression is likely, but not
|
||||||
|
the only possibility. Q_ASSUME tells the compiler that it is the only
|
||||||
|
possibility.
|
||||||
|
|
||||||
|
\sa Q_ASSERT(), Q_UNREACHABLE(), Q_LIKELY()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\macro void Q_UNREACHABLE()
|
||||||
|
\relates <QtGlobal>
|
||||||
|
\since 5.0
|
||||||
|
|
||||||
|
Tells the compiler that the current point cannot be reached by any
|
||||||
|
execution, so it may optimise any code paths leading here as dead code, as
|
||||||
|
well as code continuing from here.
|
||||||
|
|
||||||
|
This macro is useful to mark impossible conditions. For example, given the
|
||||||
|
following enum:
|
||||||
|
|
||||||
|
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qunreachable-enum
|
||||||
|
|
||||||
|
One can write a switch table like so:
|
||||||
|
|
||||||
|
\snippet doc/src/snippets/code/src_corelib_global_qglobal.cpp qunreachable-switch
|
||||||
|
|
||||||
|
The advantage of inserting Q_UNREACHABLE() at that point is that the
|
||||||
|
compiler is told not to generate code for a shape variable containing that
|
||||||
|
value. If the macro is missing, the compiler will still generate the
|
||||||
|
necessary comparisons for that value. If the case label were removed, some
|
||||||
|
compilers could produce a warning that some enum values were not checked.
|
||||||
|
|
||||||
|
By using this macro in impossible conditions, code coverage may be improved
|
||||||
|
as dead code paths may be eliminated.
|
||||||
|
|
||||||
|
\sa Q_ASSERT(), Q_ASSUME(), qFatal()
|
||||||
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\macro void Q_CHECK_PTR(void *pointer)
|
\macro void Q_CHECK_PTR(void *pointer)
|
||||||
\relates <QtGlobal>
|
\relates <QtGlobal>
|
||||||
|
@ -163,6 +163,12 @@ namespace QT_NAMESPACE {}
|
|||||||
#ifndef Q_UNLIKELY
|
#ifndef Q_UNLIKELY
|
||||||
# define Q_UNLIKELY(x) (x)
|
# define Q_UNLIKELY(x) (x)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef Q_ASSUME
|
||||||
|
# define Q_ASSUME(expr)
|
||||||
|
#endif
|
||||||
|
#ifndef Q_UNREACHABLE
|
||||||
|
# define Q_UNREACHABLE()
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef Q_ALLOC_SIZE
|
#ifndef Q_ALLOC_SIZE
|
||||||
# define Q_ALLOC_SIZE(x)
|
# define Q_ALLOC_SIZE(x)
|
||||||
@ -476,6 +482,10 @@ QT_END_INCLUDE_NAMESPACE
|
|||||||
# define Q_DECL_FINAL_CLASS
|
# define Q_DECL_FINAL_CLASS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(Q_COMPILER_ALIGNOF) && !defined(Q_ALIGNOF)
|
||||||
|
# define Q_ALIGNOF(x) alignof(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
//defines the type for the WNDPROC on windows
|
//defines the type for the WNDPROC on windows
|
||||||
//the alignment needs to be forced for sse2 to not crash with mingw
|
//the alignment needs to be forced for sse2 to not crash with mingw
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
@ -866,7 +876,7 @@ Q_CORE_EXPORT bool qSharedBuild();
|
|||||||
Avoid "unused parameter" warnings
|
Avoid "unused parameter" warnings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(Q_CC_INTEL) && !defined(Q_OS_WIN) || defined(Q_CC_RVCT)
|
#if defined(Q_CC_RVCT)
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline void qUnused(T &x) { (void)x; }
|
inline void qUnused(T &x) { (void)x; }
|
||||||
# define Q_UNUSED(x) qUnused(x);
|
# define Q_UNUSED(x) qUnused(x);
|
||||||
@ -1355,20 +1365,7 @@ template <typename T>
|
|||||||
inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase *base, const T *)
|
inline const QForeachContainer<T> *qForeachContainer(const QForeachContainerBase *base, const T *)
|
||||||
{ return static_cast<const QForeachContainer<T> *>(base); }
|
{ return static_cast<const QForeachContainer<T> *>(base); }
|
||||||
|
|
||||||
#if defined(Q_CC_MIPS)
|
#if defined(Q_CC_DIAB)
|
||||||
/*
|
|
||||||
Proper for-scoping in MIPSpro CC
|
|
||||||
*/
|
|
||||||
# define Q_FOREACH(variable,container) \
|
|
||||||
if(0){}else \
|
|
||||||
for (const QForeachContainerBase &_container_ = qForeachContainerNew(container); \
|
|
||||||
qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->condition(); \
|
|
||||||
++qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i) \
|
|
||||||
for (variable = *qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->i; \
|
|
||||||
qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk; \
|
|
||||||
--qForeachContainer(&_container_, true ? 0 : qForeachPointer(container))->brk)
|
|
||||||
|
|
||||||
#elif defined(Q_CC_DIAB)
|
|
||||||
// VxWorks DIAB generates unresolvable symbols, if container is a function call
|
// VxWorks DIAB generates unresolvable symbols, if container is a function call
|
||||||
# define Q_FOREACH(variable,container) \
|
# define Q_FOREACH(variable,container) \
|
||||||
if(0){}else \
|
if(0){}else \
|
||||||
|
@ -44,9 +44,6 @@
|
|||||||
#ifndef QISENUM_H
|
#ifndef QISENUM_H
|
||||||
#define QISENUM_H
|
#define QISENUM_H
|
||||||
|
|
||||||
QT_BEGIN_HEADER
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
#ifndef Q_IS_ENUM
|
#ifndef Q_IS_ENUM
|
||||||
# if defined(Q_CC_GNU) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
# if defined(Q_CC_GNU) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||||
# define Q_IS_ENUM(x) __is_enum(x)
|
# define Q_IS_ENUM(x) __is_enum(x)
|
||||||
@ -64,7 +61,4 @@ QT_BEGIN_NAMESPACE
|
|||||||
# define Q_IS_ENUM(x) QtPrivate::is_enum<x>::value
|
# define Q_IS_ENUM(x) QtPrivate::is_enum<x>::value
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QT_END_HEADER
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QISENUM_H
|
#endif // QISENUM_H
|
||||||
|
@ -51,7 +51,7 @@ QT_BEGIN_HEADER
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
|
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wextra"
|
# pragma GCC diagnostic ignored "-Wextra"
|
||||||
#endif
|
#endif
|
||||||
@ -157,7 +157,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
|
#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406) && !defined(Q_CC_INTEL)
|
||||||
# pragma GCC diagnostic pop
|
# pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -45,15 +45,47 @@
|
|||||||
#ifndef QT_NO_THREAD
|
#ifndef QT_NO_THREAD
|
||||||
#include "qatomic.h"
|
#include "qatomic.h"
|
||||||
#include "qmutex_p.h"
|
#include "qmutex_p.h"
|
||||||
# include "qelapsedtimer.h"
|
#include "qelapsedtimer.h"
|
||||||
|
|
||||||
#include <linux/futex.h>
|
#include <linux/futex.h>
|
||||||
#include <sys/syscall.h>
|
#include <sys/syscall.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifndef QT_LINUX_FUTEX
|
||||||
|
# error "Qt build is broken: qmutex_linux.cpp is being built but futex support is not wanted"
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
static inline int futexFlags()
|
||||||
|
{
|
||||||
|
int value = 0;
|
||||||
|
#if defined(FUTEX_PRIVATE_FLAG)
|
||||||
|
// check if the kernel supports extra futex flags
|
||||||
|
// FUTEX_PRIVATE_FLAG appeared in v2.6.22
|
||||||
|
static QBasicAtomicInt futexFlagSupport = Q_BASIC_ATOMIC_INITIALIZER(-1);
|
||||||
|
|
||||||
|
value = futexFlagSupport.load();
|
||||||
|
if (value == -1) {
|
||||||
|
// try an operation that has no side-effects: wake up 42 threads
|
||||||
|
// futex will return -1 (errno==ENOSYS) if the flag isn't supported
|
||||||
|
// there should be no other error conditions
|
||||||
|
value = syscall(SYS_futex, &futexFlagSupport,
|
||||||
|
FUTEX_WAKE | FUTEX_PRIVATE_FLAG,
|
||||||
|
42, 0, 0, 0);
|
||||||
|
if (value != -1) {
|
||||||
|
value = FUTEX_PRIVATE_FLAG;
|
||||||
|
futexFlagSupport.store(value);
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
value = 0;
|
||||||
|
futexFlagSupport.store(value);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
static inline int _q_futex(void *addr, int op, int val, const struct timespec *timeout)
|
static inline int _q_futex(void *addr, int op, int val, const struct timespec *timeout)
|
||||||
{
|
{
|
||||||
volatile int *int_addr = reinterpret_cast<volatile int *>(addr);
|
volatile int *int_addr = reinterpret_cast<volatile int *>(addr);
|
||||||
@ -62,7 +94,8 @@ static inline int _q_futex(void *addr, int op, int val, const struct timespec *t
|
|||||||
#endif
|
#endif
|
||||||
int *addr2 = 0;
|
int *addr2 = 0;
|
||||||
int val2 = 0;
|
int val2 = 0;
|
||||||
return syscall(SYS_futex, int_addr, op, val, timeout, addr2, val2);
|
|
||||||
|
return syscall(SYS_futex, int_addr, op | futexFlags(), val, timeout, addr2, val2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline QMutexData *dummyFutexValue()
|
static inline QMutexData *dummyFutexValue()
|
||||||
|
@ -2080,7 +2080,7 @@ QLocale::MeasurementSystem QLocalePrivate::measurementSystem() const
|
|||||||
for (int i = 0; i < ImperialMeasurementSystemsCount; ++i) {
|
for (int i = 0; i < ImperialMeasurementSystemsCount; ++i) {
|
||||||
if (ImperialMeasurementSystems[i].languageId == m_language_id
|
if (ImperialMeasurementSystems[i].languageId == m_language_id
|
||||||
&& ImperialMeasurementSystems[i].countryId == m_country_id) {
|
&& ImperialMeasurementSystems[i].countryId == m_country_id) {
|
||||||
return QLocale::ImperialSystem;
|
return ImperialMeasurementSystems[i].system;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return QLocale::MetricSystem;
|
return QLocale::MetricSystem;
|
||||||
|
@ -565,7 +565,12 @@ public:
|
|||||||
};
|
};
|
||||||
// GENERATED PART ENDS HERE
|
// GENERATED PART ENDS HERE
|
||||||
|
|
||||||
enum MeasurementSystem { MetricSystem, ImperialSystem };
|
enum MeasurementSystem {
|
||||||
|
MetricSystem,
|
||||||
|
ImperialUSSystem,
|
||||||
|
ImperialUKSystem,
|
||||||
|
ImperialSystem = ImperialUSSystem // Qt 4 compatibility
|
||||||
|
};
|
||||||
|
|
||||||
enum FormatType { LongFormat, ShortFormat, NarrowFormat };
|
enum FormatType { LongFormat, ShortFormat, NarrowFormat };
|
||||||
enum NumberOption {
|
enum NumberOption {
|
||||||
|
@ -672,9 +672,11 @@
|
|||||||
|
|
||||||
\value MetricSystem This value indicates metric units, such as meters,
|
\value MetricSystem This value indicates metric units, such as meters,
|
||||||
centimeters and millimeters.
|
centimeters and millimeters.
|
||||||
\value ImperialSystem This value indicates imperial units, such as inches and
|
\value ImperialUSSystem This value indicates imperial units, such as inches and
|
||||||
miles. There are several distinct imperial systems in the world; this
|
miles as they are used in the United States.
|
||||||
value stands for the official United States imperial units.
|
\value ImperialUKSystem This value indicates imperial units, such as inches and
|
||||||
|
miles as they are used in the United Kingdom.
|
||||||
|
\value ImperialSystem Provided for compatibility. Same as ImperialUSSystem
|
||||||
|
|
||||||
\since 4.4
|
\since 4.4
|
||||||
*/
|
*/
|
||||||
|
@ -62,12 +62,14 @@ struct CountryLanguage
|
|||||||
{
|
{
|
||||||
quint16 languageId;
|
quint16 languageId;
|
||||||
quint16 countryId;
|
quint16 countryId;
|
||||||
|
QLocale::MeasurementSystem system;
|
||||||
};
|
};
|
||||||
static const CountryLanguage ImperialMeasurementSystems[] = {
|
static const CountryLanguage ImperialMeasurementSystems[] = {
|
||||||
{ 31, 225 },
|
{ QLocale::English, QLocale::UnitedStates, QLocale::ImperialUSSystem },
|
||||||
{ 31, 226 },
|
{ QLocale::English, QLocale::UnitedStatesMinorOutlyingIslands, QLocale::ImperialUSSystem },
|
||||||
{ 111, 225 },
|
{ QLocale::Spanish, QLocale::UnitedStates, QLocale::ImperialUSSystem },
|
||||||
{ 163, 225 }
|
{ QLocale::Hawaiian, QLocale::UnitedStates, QLocale::ImperialUSSystem },
|
||||||
|
{ QLocale::English, QLocale::UnitedKingdom, QLocale::ImperialUKSystem }
|
||||||
};
|
};
|
||||||
static const int ImperialMeasurementSystemsCount =
|
static const int ImperialMeasurementSystemsCount =
|
||||||
sizeof(ImperialMeasurementSystems)/sizeof(ImperialMeasurementSystems[0]);
|
sizeof(ImperialMeasurementSystems)/sizeof(ImperialMeasurementSystems[0]);
|
||||||
|
@ -81,9 +81,19 @@ bool qt_initIcu(const QString &localeString)
|
|||||||
if (status == NotLoaded) {
|
if (status == NotLoaded) {
|
||||||
|
|
||||||
// resolve libicui18n
|
// resolve libicui18n
|
||||||
QLibrary lib(QLatin1String("icui18n"), QLatin1String(U_ICU_VERSION_SHORT));
|
const QString version = QString::fromLatin1(U_ICU_VERSION_SHORT);
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
|
// QLibrary on Windows does not use the version number, the libraries
|
||||||
|
// are named "icuin<version>.dll", though.
|
||||||
|
QString libName = QStringLiteral("icuin") + version;
|
||||||
|
#else
|
||||||
|
QString libName = QStringLiteral("icui18n");
|
||||||
|
#endif
|
||||||
|
QLibrary lib(libName, version);
|
||||||
if (!lib.load()) {
|
if (!lib.load()) {
|
||||||
qWarning() << "Unable to load library icui18n" << lib.errorString();
|
qWarning("Unable to load library '%s' version %s: %s",
|
||||||
|
qPrintable(libName), qPrintable(version),
|
||||||
|
qPrintable(lib.errorString()));
|
||||||
status = ErrorLoading;
|
status = ErrorLoading;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -104,15 +114,22 @@ bool qt_initIcu(const QString &localeString)
|
|||||||
ptr_ucol_close = 0;
|
ptr_ucol_close = 0;
|
||||||
ptr_ucol_strcoll = 0;
|
ptr_ucol_strcoll = 0;
|
||||||
|
|
||||||
qWarning("Unable to find symbols in icui18n");
|
qWarning("Unable to find symbols in '%s'.", qPrintable(libName));
|
||||||
status = ErrorLoading;
|
status = ErrorLoading;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// resolve libicuuc
|
// resolve libicuuc
|
||||||
QLibrary ucLib(QLatin1String("icuuc"), QLatin1String(U_ICU_VERSION_SHORT));
|
#ifdef Q_OS_WIN
|
||||||
|
libName = QStringLiteral("icuuc") + version;
|
||||||
|
#else
|
||||||
|
libName = QStringLiteral("icuuc");
|
||||||
|
#endif
|
||||||
|
QLibrary ucLib(libName, version);
|
||||||
if (!ucLib.load()) {
|
if (!ucLib.load()) {
|
||||||
qWarning() << "Unable to load library icuuc" << ucLib.errorString();
|
qWarning("Unable to load library '%s' version %s: %s",
|
||||||
|
qPrintable(libName), qPrintable(version),
|
||||||
|
qPrintable(ucLib.errorString()));
|
||||||
status = ErrorLoading;
|
status = ErrorLoading;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -129,7 +146,7 @@ bool qt_initIcu(const QString &localeString)
|
|||||||
ptr_u_strToUpper = 0;
|
ptr_u_strToUpper = 0;
|
||||||
ptr_u_strToLower = 0;
|
ptr_u_strToLower = 0;
|
||||||
|
|
||||||
qWarning("Unable to find symbols in icuuc");
|
qWarning("Unable to find symbols in '%s'", qPrintable(libName));
|
||||||
status = ErrorLoading;
|
status = ErrorLoading;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -44,24 +44,8 @@
|
|||||||
|
|
||||||
#include <qglobal.h>
|
#include <qglobal.h>
|
||||||
|
|
||||||
|
|
||||||
QT_BEGIN_HEADER
|
QT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
#if defined(QT_NO_MAC_XARCH) || (defined(Q_OS_DARWIN) && (defined(__ppc__) || defined(__ppc64__)))
|
|
||||||
// Disable MMX and SSE on Mac/PPC builds, or if the compiler
|
|
||||||
// does not support -Xarch argument passing
|
|
||||||
#undef QT_HAVE_SSE
|
|
||||||
#undef QT_HAVE_SSE2
|
|
||||||
#undef QT_HAVE_SSE3
|
|
||||||
#undef QT_HAVE_SSSE3
|
|
||||||
#undef QT_HAVE_SSE4_1
|
|
||||||
#undef QT_HAVE_SSE4_2
|
|
||||||
#undef QT_HAVE_AVX
|
|
||||||
#undef QT_HAVE_3DNOW
|
|
||||||
#undef QT_HAVE_MMX
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __MINGW64_VERSION_MAJOR
|
#ifdef __MINGW64_VERSION_MAJOR
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -51,7 +51,9 @@ PUB_HEADERS = qdbusargument.h \
|
|||||||
qdbuspendingcall.h \
|
qdbuspendingcall.h \
|
||||||
qdbuspendingreply.h \
|
qdbuspendingreply.h \
|
||||||
qdbuscontext.h \
|
qdbuscontext.h \
|
||||||
qdbusvirtualobject.h
|
qdbusvirtualobject.h \
|
||||||
|
qdbusservicewatcher.h \
|
||||||
|
qdbusunixfiledescriptor.h
|
||||||
HEADERS += $$PUB_HEADERS \
|
HEADERS += $$PUB_HEADERS \
|
||||||
qdbusconnection_p.h \
|
qdbusconnection_p.h \
|
||||||
qdbusmessage_p.h \
|
qdbusmessage_p.h \
|
||||||
@ -66,8 +68,7 @@ HEADERS += $$PUB_HEADERS \
|
|||||||
qdbusintegrator_p.h \
|
qdbusintegrator_p.h \
|
||||||
qdbuspendingcall_p.h \
|
qdbuspendingcall_p.h \
|
||||||
qdbus_symbols_p.h \
|
qdbus_symbols_p.h \
|
||||||
qdbusservicewatcher.h \
|
qdbusintrospection_p.h
|
||||||
qdbusunixfiledescriptor.h
|
|
||||||
SOURCES += qdbusconnection.cpp \
|
SOURCES += qdbusconnection.cpp \
|
||||||
qdbusconnectioninterface.cpp \
|
qdbusconnectioninterface.cpp \
|
||||||
qdbuserror.cpp \
|
qdbuserror.cpp \
|
||||||
|
@ -296,7 +296,7 @@ void QDBusAdaptorConnector::relay(QObject *senderObj, int lastSignalIdx, void **
|
|||||||
realObject = realObject->parent();
|
realObject = realObject->parent();
|
||||||
|
|
||||||
// break down the parameter list
|
// break down the parameter list
|
||||||
QList<int> types;
|
QVector<int> types;
|
||||||
int inputCount = qDBusParametersForMethod(mm, types);
|
int inputCount = qDBusParametersForMethod(mm, types);
|
||||||
if (inputCount == -1)
|
if (inputCount == -1)
|
||||||
// invalid signal signature
|
// invalid signal signature
|
||||||
|
@ -126,7 +126,7 @@ public:
|
|||||||
QString service, path, signature;
|
QString service, path, signature;
|
||||||
QObject* obj;
|
QObject* obj;
|
||||||
int midx;
|
int midx;
|
||||||
QList<int> params;
|
QVector<int> params;
|
||||||
QStringList argumentMatch;
|
QStringList argumentMatch;
|
||||||
QByteArray matchRule;
|
QByteArray matchRule;
|
||||||
};
|
};
|
||||||
@ -243,7 +243,7 @@ private:
|
|||||||
|
|
||||||
void sendError(const QDBusMessage &msg, QDBusError::ErrorType code);
|
void sendError(const QDBusMessage &msg, QDBusError::ErrorType code);
|
||||||
void deliverCall(QObject *object, int flags, const QDBusMessage &msg,
|
void deliverCall(QObject *object, int flags, const QDBusMessage &msg,
|
||||||
const QList<int> &metaTypes, int slotIdx);
|
const QVector<int> &metaTypes, int slotIdx);
|
||||||
|
|
||||||
bool isServiceRegisteredByThread(const QString &serviceName) const;
|
bool isServiceRegisteredByThread(const QString &serviceName) const;
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
// static methods
|
// static methods
|
||||||
static int findSlot(QObject *obj, const QByteArray &normalizedName, QList<int>& params);
|
static int findSlot(QObject *obj, const QByteArray &normalizedName, QVector<int> ¶ms);
|
||||||
static bool prepareHook(QDBusConnectionPrivate::SignalHook &hook, QString &key,
|
static bool prepareHook(QDBusConnectionPrivate::SignalHook &hook, QString &key,
|
||||||
const QString &service,
|
const QString &service,
|
||||||
const QString &path, const QString &interface, const QString &name,
|
const QString &path, const QString &interface, const QString &name,
|
||||||
@ -323,7 +323,7 @@ public:
|
|||||||
int idx, const QList<int> &metaTypes,
|
int idx, const QList<int> &metaTypes,
|
||||||
const QDBusMessage &msg);
|
const QDBusMessage &msg);
|
||||||
static QDBusCallDeliveryEvent *prepareReply(QDBusConnectionPrivate *target, QObject *object,
|
static QDBusCallDeliveryEvent *prepareReply(QDBusConnectionPrivate *target, QObject *object,
|
||||||
int idx, const QList<int> &metaTypes,
|
int idx, const QVector<int> &metaTypes,
|
||||||
const QDBusMessage &msg);
|
const QDBusMessage &msg);
|
||||||
static void processFinishedCall(QDBusPendingCallPrivate *call);
|
static void processFinishedCall(QDBusPendingCallPrivate *call);
|
||||||
|
|
||||||
@ -337,9 +337,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// in qdbusmisc.cpp
|
// in qdbusmisc.cpp
|
||||||
extern int qDBusParametersForMethod(const QMetaMethod &mm, QList<int>& metaTypes);
|
extern int qDBusParametersForMethod(const QMetaMethod &mm, QVector<int> &metaTypes);
|
||||||
#endif // QT_BOOTSTRAPPED
|
#endif // QT_BOOTSTRAPPED
|
||||||
extern int qDBusParametersForMethod(const QList<QByteArray> ¶meters, QList<int>& metaTypes);
|
extern int qDBusParametersForMethod(const QList<QByteArray> ¶meters, QVector<int>& metaTypes);
|
||||||
extern bool qDBusCheckAsyncTag(const char *tag);
|
extern bool qDBusCheckAsyncTag(const char *tag);
|
||||||
#ifndef QT_BOOTSTRAPPED
|
#ifndef QT_BOOTSTRAPPED
|
||||||
extern bool qDBusInterfaceInObject(QObject *obj, const QString &interface_name);
|
extern bool qDBusInterfaceInObject(QObject *obj, const QString &interface_name);
|
||||||
|
@ -624,7 +624,7 @@ static void huntAndEmit(DBusConnection *connection, DBusMessage *msg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
|
static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
|
||||||
const QString &signature_, QList<int>& metaTypes)
|
const QString &signature_, QVector<int> &metaTypes)
|
||||||
{
|
{
|
||||||
QByteArray msgSignature = signature_.toLatin1();
|
QByteArray msgSignature = signature_.toLatin1();
|
||||||
|
|
||||||
@ -722,7 +722,7 @@ static QDBusCallDeliveryEvent * const DIRECT_DELIVERY = (QDBusCallDeliveryEvent
|
|||||||
|
|
||||||
QDBusCallDeliveryEvent* QDBusConnectionPrivate::prepareReply(QDBusConnectionPrivate *target,
|
QDBusCallDeliveryEvent* QDBusConnectionPrivate::prepareReply(QDBusConnectionPrivate *target,
|
||||||
QObject *object, int idx,
|
QObject *object, int idx,
|
||||||
const QList<int> &metaTypes,
|
const QVector<int> &metaTypes,
|
||||||
const QDBusMessage &msg)
|
const QDBusMessage &msg)
|
||||||
{
|
{
|
||||||
Q_ASSERT(object);
|
Q_ASSERT(object);
|
||||||
@ -860,7 +860,7 @@ bool QDBusConnectionPrivate::activateCall(QObject* object, int flags, const QDBu
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const QDBusMessage &msg,
|
void QDBusConnectionPrivate::deliverCall(QObject *object, int /*flags*/, const QDBusMessage &msg,
|
||||||
const QList<int> &metaTypes, int slotIdx)
|
const QVector<int> &metaTypes, int slotIdx)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(!object || QThread::currentThread() == object->thread(),
|
Q_ASSERT_X(!object || QThread::currentThread() == object->thread(),
|
||||||
"QDBusConnection: internal threading error",
|
"QDBusConnection: internal threading error",
|
||||||
@ -1235,7 +1235,7 @@ void QDBusConnectionPrivate::serviceOwnerChangedNoLock(const QString &name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int QDBusConnectionPrivate::findSlot(QObject* obj, const QByteArray &normalizedName,
|
int QDBusConnectionPrivate::findSlot(QObject* obj, const QByteArray &normalizedName,
|
||||||
QList<int> ¶ms)
|
QVector<int> ¶ms)
|
||||||
{
|
{
|
||||||
int midx = obj->metaObject()->indexOfMethod(normalizedName);
|
int midx = obj->metaObject()->indexOfMethod(normalizedName);
|
||||||
if (midx == -1)
|
if (midx == -1)
|
||||||
|
@ -84,7 +84,7 @@ struct QDBusSlotCache
|
|||||||
{
|
{
|
||||||
int flags;
|
int flags;
|
||||||
int slotIdx;
|
int slotIdx;
|
||||||
QList<int> metaTypes;
|
QVector<int> metaTypes;
|
||||||
};
|
};
|
||||||
typedef QMultiHash<QString, Data> Hash;
|
typedef QMultiHash<QString, Data> Hash;
|
||||||
Hash hash;
|
Hash hash;
|
||||||
@ -94,7 +94,7 @@ class QDBusCallDeliveryEvent: public QMetaCallEvent
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QDBusCallDeliveryEvent(const QDBusConnection &c, int id, QObject *sender,
|
QDBusCallDeliveryEvent(const QDBusConnection &c, int id, QObject *sender,
|
||||||
const QDBusMessage &msg, const QList<int> &types, int f = 0)
|
const QDBusMessage &msg, const QVector<int> &types, int f = 0)
|
||||||
: QMetaCallEvent(0, id, 0, sender, -1), connection(c), message(msg), metaTypes(types), flags(f)
|
: QMetaCallEvent(0, id, 0, sender, -1), connection(c), message(msg), metaTypes(types), flags(f)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
QDBusConnection connection; // just for refcounting
|
QDBusConnection connection; // just for refcounting
|
||||||
QDBusMessage message;
|
QDBusMessage message;
|
||||||
QList<int> metaTypes;
|
QVector<int> metaTypes;
|
||||||
int flags;
|
int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include "qdbusconnection_p.h"
|
#include "qdbusconnection_p.h"
|
||||||
#include "qdbusabstractadaptor_p.h" // for QCLASSINFO_DBUS_*
|
#include "qdbusabstractadaptor_p.h" // for QCLASSINFO_DBUS_*
|
||||||
#endif
|
#endif
|
||||||
|
#include <QtCore/qvector.h>
|
||||||
#include "qdbusmetatype_p.h"
|
#include "qdbusmetatype_p.h"
|
||||||
|
|
||||||
#ifndef QT_NO_DBUS
|
#ifndef QT_NO_DBUS
|
||||||
@ -130,14 +131,14 @@ bool qDBusInterfaceInObject(QObject *obj, const QString &interface_name)
|
|||||||
// metaTypes.count() >= retval + 1 in all cases
|
// metaTypes.count() >= retval + 1 in all cases
|
||||||
//
|
//
|
||||||
// sig must be the normalised signature for the method
|
// sig must be the normalised signature for the method
|
||||||
int qDBusParametersForMethod(const QMetaMethod &mm, QList<int>& metaTypes)
|
int qDBusParametersForMethod(const QMetaMethod &mm, QVector<int> &metaTypes)
|
||||||
{
|
{
|
||||||
return qDBusParametersForMethod(mm.parameterTypes(), metaTypes);
|
return qDBusParametersForMethod(mm.parameterTypes(), metaTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // QT_BOOTSTRAPPED
|
#endif // QT_BOOTSTRAPPED
|
||||||
|
|
||||||
int qDBusParametersForMethod(const QList<QByteArray> ¶meterTypes, QList<int>& metaTypes)
|
int qDBusParametersForMethod(const QList<QByteArray> ¶meterTypes, QVector<int>& metaTypes)
|
||||||
{
|
{
|
||||||
QDBusMetaTypeId::init();
|
QDBusMetaTypeId::init();
|
||||||
metaTypes.clear();
|
metaTypes.clear();
|
||||||
|
@ -180,12 +180,7 @@ bool QDBusPendingCallPrivate::setReplyCallback(QObject *target, const char *memb
|
|||||||
if (metaTypes.at(count) == QDBusMetaTypeId::message)
|
if (metaTypes.at(count) == QDBusMetaTypeId::message)
|
||||||
--count;
|
--count;
|
||||||
|
|
||||||
if (count == 0) {
|
setMetaTypes(count, count ? metaTypes.constData() + 1 : 0);
|
||||||
setMetaTypes(count, 0);
|
|
||||||
} else {
|
|
||||||
QVector<int> types = QVector<int>::fromList(metaTypes);
|
|
||||||
setMetaTypes(count, types.constData() + 1);
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
#include <qshareddata.h>
|
#include <qshareddata.h>
|
||||||
#include <qpointer.h>
|
#include <qpointer.h>
|
||||||
#include <qlist.h>
|
#include <qvector.h>
|
||||||
#include <qmutex.h>
|
#include <qmutex.h>
|
||||||
#include <qwaitcondition.h>
|
#include <qwaitcondition.h>
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ public:
|
|||||||
|
|
||||||
// for the callback mechanism (see setReplyCallback and QDBusConnectionPrivate::sendWithReplyAsync)
|
// for the callback mechanism (see setReplyCallback and QDBusConnectionPrivate::sendWithReplyAsync)
|
||||||
QPointer<QObject> receiver;
|
QPointer<QObject> receiver;
|
||||||
QList<int> metaTypes;
|
QVector<int> metaTypes;
|
||||||
int methodIdx;
|
int methodIdx;
|
||||||
|
|
||||||
bool autoDelete;
|
bool autoDelete;
|
||||||
|
@ -166,7 +166,7 @@ static QString generateInterfaceXml(const QMetaObject *mo, int flags, int method
|
|||||||
continue; // wasn't a valid type
|
continue; // wasn't a valid type
|
||||||
|
|
||||||
QList<QByteArray> names = mm.parameterNames();
|
QList<QByteArray> names = mm.parameterNames();
|
||||||
QList<int> types;
|
QVector<int> types;
|
||||||
int inputCount = qDBusParametersForMethod(mm, types);
|
int inputCount = qDBusParametersForMethod(mm, types);
|
||||||
if (inputCount == -1)
|
if (inputCount == -1)
|
||||||
continue; // invalid form
|
continue; // invalid form
|
||||||
|
@ -56,12 +56,6 @@ class QModelIndex;
|
|||||||
|
|
||||||
namespace QAccessible2
|
namespace QAccessible2
|
||||||
{
|
{
|
||||||
enum CoordinateType
|
|
||||||
{
|
|
||||||
RelativeToScreen = 0,
|
|
||||||
RelativeToParent = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
enum BoundaryType {
|
enum BoundaryType {
|
||||||
CharBoundary,
|
CharBoundary,
|
||||||
WordBoundary,
|
WordBoundary,
|
||||||
@ -80,9 +74,9 @@ public:
|
|||||||
virtual void addSelection(int startOffset, int endOffset) = 0;
|
virtual void addSelection(int startOffset, int endOffset) = 0;
|
||||||
virtual QString attributes(int offset, int *startOffset, int *endOffset) const = 0;
|
virtual QString attributes(int offset, int *startOffset, int *endOffset) const = 0;
|
||||||
virtual int cursorPosition() const = 0;
|
virtual int cursorPosition() const = 0;
|
||||||
virtual QRect characterRect(int offset, QAccessible2::CoordinateType coordType) const = 0;
|
virtual QRect characterRect(int offset) const = 0;
|
||||||
virtual int selectionCount() const = 0;
|
virtual int selectionCount() const = 0;
|
||||||
virtual int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType) const = 0;
|
virtual int offsetAtPoint(const QPoint &point) const = 0;
|
||||||
virtual void selection(int selectionIndex, int *startOffset, int *endOffset) const = 0;
|
virtual void selection(int selectionIndex, int *startOffset, int *endOffset) const = 0;
|
||||||
virtual QString text(int startOffset, int endOffset) const = 0;
|
virtual QString text(int startOffset, int endOffset) const = 0;
|
||||||
virtual QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
virtual QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
||||||
@ -249,7 +243,7 @@ public:
|
|||||||
|
|
||||||
virtual QString imageDescription() const = 0;
|
virtual QString imageDescription() const = 0;
|
||||||
virtual QSize imageSize() const = 0;
|
virtual QSize imageSize() const = 0;
|
||||||
virtual QRect imagePosition(QAccessible2::CoordinateType coordType) const = 0;
|
virtual QRect imagePosition() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_ACCESSIBILITY
|
#endif // QT_NO_ACCESSIBILITY
|
||||||
|
@ -70,10 +70,10 @@ struct QImageData;
|
|||||||
class QImageDataMisc; // internal
|
class QImageDataMisc; // internal
|
||||||
#ifndef QT_NO_IMAGE_TEXT
|
#ifndef QT_NO_IMAGE_TEXT
|
||||||
#if QT_DEPRECATED_SINCE(5, 0)
|
#if QT_DEPRECATED_SINCE(5, 0)
|
||||||
class QT_DEPRECATED QImageTextKeyLang {
|
class QImageTextKeyLang {
|
||||||
public:
|
public:
|
||||||
QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { }
|
QT_DEPRECATED QImageTextKeyLang(const char* k, const char* l) : key(k), lang(l) { }
|
||||||
QImageTextKeyLang() { }
|
QT_DEPRECATED QImageTextKeyLang() { }
|
||||||
|
|
||||||
QByteArray key;
|
QByteArray key;
|
||||||
QByteArray lang;
|
QByteArray lang;
|
||||||
@ -315,6 +315,14 @@ Q_GUI_EXPORT_INLINE void QImage::setPixel(const QPoint &pt, uint index_or_rgb) {
|
|||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(5, 0)
|
#if QT_DEPRECATED_SINCE(5, 0)
|
||||||
#ifndef QT_NO_IMAGE_TEXT
|
#ifndef QT_NO_IMAGE_TEXT
|
||||||
|
|
||||||
|
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
#elif defined(Q_CC_MSVC)
|
||||||
|
# pragma warning(disable: 4996)
|
||||||
|
#endif
|
||||||
|
|
||||||
inline QString QImage::text(const char* key, const char* lang) const
|
inline QString QImage::text(const char* key, const char* lang) const
|
||||||
{
|
{
|
||||||
if (!d)
|
if (!d)
|
||||||
@ -384,6 +392,13 @@ inline void QImage::setText(const char* key, const char* lang, const QString &s)
|
|||||||
k += QLatin1Char('/') + QString::fromAscii(lang);
|
k += QLatin1Char('/') + QString::fromAscii(lang);
|
||||||
setText(k, s);
|
setText(k, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#elif defined(Q_CC_MSVC)
|
||||||
|
# pragma warning(default: 4996)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline int QImage::numColors() const
|
inline int QImage::numColors() const
|
||||||
|
@ -996,6 +996,7 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo
|
|||||||
}
|
}
|
||||||
|
|
||||||
QWindow *window = e->window.data();
|
QWindow *window = e->window.data();
|
||||||
|
modifier_buttons = e->modifiers;
|
||||||
|
|
||||||
if (!window)
|
if (!window)
|
||||||
window = QGuiApplication::topLevelAt(e->globalPos.toPoint());
|
window = QGuiApplication::topLevelAt(e->globalPos.toPoint());
|
||||||
@ -1098,6 +1099,7 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh
|
|||||||
|
|
||||||
QPointF globalPoint = e->globalPos;
|
QPointF globalPoint = e->globalPos;
|
||||||
QGuiApplicationPrivate::lastCursorPosition = globalPoint;
|
QGuiApplicationPrivate::lastCursorPosition = globalPoint;
|
||||||
|
modifier_buttons = e->modifiers;
|
||||||
|
|
||||||
QWindow *window = e->window.data();
|
QWindow *window = e->window.data();
|
||||||
|
|
||||||
@ -1114,6 +1116,7 @@ void QGuiApplicationPrivate::processWheelEvent(QWindowSystemInterfacePrivate::Wh
|
|||||||
void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e)
|
void QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent *e)
|
||||||
{
|
{
|
||||||
QWindow *window = e->window.data();
|
QWindow *window = e->window.data();
|
||||||
|
modifier_buttons = e->modifiers;
|
||||||
if (e->nullWindow)
|
if (e->nullWindow)
|
||||||
window = QGuiApplication::activeWindow();
|
window = QGuiApplication::activeWindow();
|
||||||
if (!window)
|
if (!window)
|
||||||
@ -1271,6 +1274,7 @@ Q_GUI_EXPORT bool operator==(const QGuiApplicationPrivate::ActiveTouchPointsKey
|
|||||||
void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e)
|
void QGuiApplicationPrivate::processTouchEvent(QWindowSystemInterfacePrivate::TouchEvent *e)
|
||||||
{
|
{
|
||||||
QGuiApplicationPrivate *d = self;
|
QGuiApplicationPrivate *d = self;
|
||||||
|
modifier_buttons = e->modifiers;
|
||||||
|
|
||||||
if (e->touchType == QEvent::TouchCancel) {
|
if (e->touchType == QEvent::TouchCancel) {
|
||||||
// The touch sequence has been canceled (e.g. by the compositor).
|
// The touch sequence has been canceled (e.g. by the compositor).
|
||||||
|
@ -291,6 +291,8 @@ QVariant QPlatformIntegration::styleHint(StyleHint hint) const
|
|||||||
return 500;
|
return 500;
|
||||||
case ShowIsFullScreen:
|
case ShowIsFullScreen:
|
||||||
return false;
|
return false;
|
||||||
|
case PasswordMaskDelay:
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -121,7 +121,8 @@ public:
|
|||||||
StartDragDistance,
|
StartDragDistance,
|
||||||
StartDragTime,
|
StartDragTime,
|
||||||
KeyboardAutoRepeatRate,
|
KeyboardAutoRepeatRate,
|
||||||
ShowIsFullScreen
|
ShowIsFullScreen,
|
||||||
|
PasswordMaskDelay
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual QVariant styleHint(StyleHint hint) const;
|
virtual QVariant styleHint(StyleHint hint) const;
|
||||||
|
@ -170,7 +170,7 @@ Qt::WindowFlags QPlatformWindow::setWindowFlags(Qt::WindowFlags flags)
|
|||||||
bool QPlatformWindow::isExposed() const
|
bool QPlatformWindow::isExposed() const
|
||||||
{
|
{
|
||||||
Q_D(const QPlatformWindow);
|
Q_D(const QPlatformWindow);
|
||||||
return d->window->visible();
|
return d->window->isVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -96,4 +96,9 @@ bool QStyleHints::showIsFullScreen() const
|
|||||||
return hint(QPlatformIntegration::ShowIsFullScreen).toBool();
|
return hint(QPlatformIntegration::ShowIsFullScreen).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int QStyleHints::passwordMaskDelay() const
|
||||||
|
{
|
||||||
|
return hint(QPlatformIntegration::PasswordMaskDelay).toInt();
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -62,6 +62,8 @@ public:
|
|||||||
int keyboardAutoRepeatRate() const;
|
int keyboardAutoRepeatRate() const;
|
||||||
int cursorFlashTime() const;
|
int cursorFlashTime() const;
|
||||||
bool showIsFullScreen() const;
|
bool showIsFullScreen() const;
|
||||||
|
int passwordMaskDelay() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class QGuiApplication;
|
friend class QGuiApplication;
|
||||||
QStyleHints();
|
QStyleHints();
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
|
|
||||||
#include "qwindow_p.h"
|
#include "qwindow_p.h"
|
||||||
#include "qguiapplication_p.h"
|
#include "qguiapplication_p.h"
|
||||||
|
#include "qaccessible.h"
|
||||||
|
|
||||||
#include <private/qevent_p.h>
|
#include <private/qevent_p.h>
|
||||||
|
|
||||||
@ -746,9 +747,6 @@ void QWindow::setWindowState(Qt::WindowState state)
|
|||||||
void QWindow::setTransientParent(QWindow *parent)
|
void QWindow::setTransientParent(QWindow *parent)
|
||||||
{
|
{
|
||||||
Q_D(QWindow);
|
Q_D(QWindow);
|
||||||
|
|
||||||
QWindow *previousParent = d->transientParent;
|
|
||||||
|
|
||||||
d->transientParent = parent;
|
d->transientParent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1454,13 +1452,25 @@ bool QWindow::event(QEvent *ev)
|
|||||||
keyReleaseEvent(static_cast<QKeyEvent *>(ev));
|
keyReleaseEvent(static_cast<QKeyEvent *>(ev));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QEvent::FocusIn:
|
case QEvent::FocusIn: {
|
||||||
focusInEvent(static_cast<QFocusEvent *>(ev));
|
focusInEvent(static_cast<QFocusEvent *>(ev));
|
||||||
break;
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
|
QAccessible::State state;
|
||||||
|
state.active = true;
|
||||||
|
QAccessibleStateChangeEvent event(this, state);
|
||||||
|
QAccessible::updateAccessibility(&event);
|
||||||
|
#endif
|
||||||
|
break; }
|
||||||
|
|
||||||
case QEvent::FocusOut:
|
case QEvent::FocusOut: {
|
||||||
focusOutEvent(static_cast<QFocusEvent *>(ev));
|
focusOutEvent(static_cast<QFocusEvent *>(ev));
|
||||||
break;
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
|
QAccessible::State state;
|
||||||
|
state.active = true;
|
||||||
|
QAccessibleStateChangeEvent event(this, state);
|
||||||
|
QAccessible::updateAccessibility(&event);
|
||||||
|
#endif
|
||||||
|
break; }
|
||||||
|
|
||||||
#ifndef QT_NO_WHEELEVENT
|
#ifndef QT_NO_WHEELEVENT
|
||||||
case QEvent::Wheel:
|
case QEvent::Wheel:
|
||||||
|
@ -159,6 +159,8 @@ bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, int k
|
|||||||
bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
|
bool QWindowSystemInterface::tryHandleSynchronousShortcutEvent(QWindow *w, ulong timestamp, int k, Qt::KeyboardModifiers mods,
|
||||||
const QString & text, bool autorep, ushort count)
|
const QString & text, bool autorep, ushort count)
|
||||||
{
|
{
|
||||||
|
QGuiApplicationPrivate::modifier_buttons = mods;
|
||||||
|
|
||||||
QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count);
|
QKeyEvent qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count);
|
||||||
qevent.setTimestamp(timestamp);
|
qevent.setTimestamp(timestamp);
|
||||||
return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent);
|
return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent);
|
||||||
@ -176,6 +178,8 @@ bool QWindowSystemInterface::tryHandleSynchronousExtendedShortcutEvent(QWindow *
|
|||||||
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
|
quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
|
||||||
const QString &text, bool autorep, ushort count)
|
const QString &text, bool autorep, ushort count)
|
||||||
{
|
{
|
||||||
|
QGuiApplicationPrivate::modifier_buttons = mods;
|
||||||
|
|
||||||
QKeyEventEx qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count, nativeScanCode, nativeVirtualKey, nativeModifiers);
|
QKeyEventEx qevent(QEvent::ShortcutOverride, k, mods, text, autorep, count, nativeScanCode, nativeVirtualKey, nativeModifiers);
|
||||||
qevent.setTimestamp(timestamp);
|
qevent.setTimestamp(timestamp);
|
||||||
return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent);
|
return QGuiApplicationPrivate::instance()->shortcutMap.tryShortcutEvent(w, &qevent);
|
||||||
|
@ -199,7 +199,7 @@ public:
|
|||||||
void updateBrushUniforms();
|
void updateBrushUniforms();
|
||||||
void updateMatrix();
|
void updateMatrix();
|
||||||
void updateCompositionMode();
|
void updateCompositionMode();
|
||||||
void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = -1);
|
void updateTextureFilter(GLenum target, GLenum wrapMode, bool smoothPixmapTransform, GLuint id = GLuint(-1));
|
||||||
|
|
||||||
void resetGLState();
|
void resetGLState();
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ public:
|
|||||||
SourceOverScaledPixmapCapability = 0x0008,
|
SourceOverScaledPixmapCapability = 0x0008,
|
||||||
|
|
||||||
// Internal ones
|
// Internal ones
|
||||||
OutlineCapability = 0x0001000,
|
OutlineCapability = 0x0001000
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS (Capabilities, Capability);
|
Q_DECLARE_FLAGS (Capabilities, Capability);
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public:
|
|||||||
enum Caps {
|
enum Caps {
|
||||||
NoCaps = 0,
|
NoCaps = 0,
|
||||||
CapBegin = 0x1,
|
CapBegin = 0x1,
|
||||||
CapEnd = 0x2,
|
CapEnd = 0x2
|
||||||
};
|
};
|
||||||
|
|
||||||
// used to avoid drop outs or duplicated points
|
// used to avoid drop outs or duplicated points
|
||||||
|
@ -814,7 +814,6 @@ template<TextureBlendType blendType>
|
|||||||
void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2);
|
void fetchTransformedBilinear_pixelBounds(int max, int l1, int l2, int &v1, int &v2);
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
Q_STATIC_TEMPLATE_SPECIALIZATION
|
|
||||||
inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinearTiled>(int max, int, int, int &v1, int &v2)
|
inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinearTiled>(int max, int, int, int &v1, int &v2)
|
||||||
{
|
{
|
||||||
v1 %= max;
|
v1 %= max;
|
||||||
@ -828,7 +827,6 @@ inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinearTiled>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
Q_STATIC_TEMPLATE_SPECIALIZATION
|
|
||||||
inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(int, int l1, int l2, int &v1, int &v2)
|
inline void fetchTransformedBilinear_pixelBounds<BlendTransformedBilinear>(int, int l1, int l2, int &v1, int &v2)
|
||||||
{
|
{
|
||||||
if (v1 < l1)
|
if (v1 < l1)
|
||||||
|
@ -67,12 +67,6 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#if defined(Q_CC_MSVC) && _MSCVER <= 1300 && !defined(Q_CC_INTEL)
|
|
||||||
#define Q_STATIC_TEMPLATE_SPECIALIZATION static
|
|
||||||
#else
|
|
||||||
#define Q_STATIC_TEMPLATE_SPECIALIZATION
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(Q_CC_RVCT)
|
#if defined(Q_CC_RVCT)
|
||||||
// RVCT doesn't like static template functions
|
// RVCT doesn't like static template functions
|
||||||
# define Q_STATIC_TEMPLATE_FUNCTION
|
# define Q_STATIC_TEMPLATE_FUNCTION
|
||||||
|
@ -423,7 +423,6 @@ inline void qt_memrotate270_template(const T *src, int srcWidth, int srcHeight,
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
Q_STATIC_TEMPLATE_SPECIALIZATION
|
|
||||||
inline void qt_memrotate90_template<quint24>(const quint24 *src, int srcWidth, int srcHeight,
|
inline void qt_memrotate90_template<quint24>(const quint24 *src, int srcWidth, int srcHeight,
|
||||||
int srcStride, quint24 *dest, int dstStride)
|
int srcStride, quint24 *dest, int dstStride)
|
||||||
{
|
{
|
||||||
|
@ -425,7 +425,7 @@ public:
|
|||||||
enum LayoutState {
|
enum LayoutState {
|
||||||
LayoutEmpty,
|
LayoutEmpty,
|
||||||
InLayout,
|
InLayout,
|
||||||
LayoutFailed,
|
LayoutFailed
|
||||||
};
|
};
|
||||||
struct Q_GUI_EXPORT LayoutData {
|
struct Q_GUI_EXPORT LayoutData {
|
||||||
LayoutData(const QString &str, void **stack_memory, int mem_size);
|
LayoutData(const QString &str, void **stack_memory, int mem_size);
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
#include <qmutex.h>
|
#include <qmutex.h>
|
||||||
#include <qplatformservices_qpa.h>
|
#include <qplatformservices_qpa.h>
|
||||||
#include <qplatformintegration_qpa.h>
|
#include <qplatformintegration_qpa.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -283,6 +284,23 @@ void QDesktopServices::unsetUrlHandler(const QString &scheme)
|
|||||||
Use QStandardPaths::displayName()
|
Use QStandardPaths::displayName()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
QString QDesktopServices::storageLocationImpl(StandardLocation type)
|
||||||
|
{
|
||||||
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
||||||
|
if (type == DataLocation) {
|
||||||
|
QString xdgDataHome = QLatin1String(qgetenv("XDG_DATA_HOME"));
|
||||||
|
if (xdgDataHome.isEmpty())
|
||||||
|
xdgDataHome = QDir::homePath() + QLatin1String("/.local/share");
|
||||||
|
xdgDataHome += QLatin1String("/data/")
|
||||||
|
+ QCoreApplication::organizationName() + QLatin1Char('/')
|
||||||
|
+ QCoreApplication::applicationName();
|
||||||
|
return xdgDataHome;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return QStandardPaths::writableLocation(static_cast<QStandardPaths::StandardLocation>(type));
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#include "qdesktopservices.moc"
|
#include "qdesktopservices.moc"
|
||||||
|
@ -79,12 +79,14 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
QT_DEPRECATED static QString storageLocation(StandardLocation type) {
|
QT_DEPRECATED static QString storageLocation(StandardLocation type) {
|
||||||
return QStandardPaths::writableLocation(static_cast<QStandardPaths::StandardLocation>(type));
|
return storageLocationImpl(type);
|
||||||
}
|
}
|
||||||
QT_DEPRECATED static QString displayName(StandardLocation type) {
|
QT_DEPRECATED static QString displayName(StandardLocation type) {
|
||||||
return QStandardPaths::displayName(static_cast<QStandardPaths::StandardLocation>(type));
|
return QStandardPaths::displayName(static_cast<QStandardPaths::StandardLocation>(type));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
private:
|
||||||
|
static QString storageLocationImpl(StandardLocation type);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // QT_NO_DESKTOPSERVICES
|
#endif // QT_NO_DESKTOPSERVICES
|
||||||
|
@ -380,6 +380,8 @@ void QAuthenticatorPrivate::parseHttpResponse(const QList<QPair<QByteArray, QByt
|
|||||||
break;
|
break;
|
||||||
case Ntlm:
|
case Ntlm:
|
||||||
// #### extract from header
|
// #### extract from header
|
||||||
|
if (user.isEmpty() && password.isEmpty())
|
||||||
|
phase = Done;
|
||||||
break;
|
break;
|
||||||
case DigestMd5: {
|
case DigestMd5: {
|
||||||
this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
|
this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm"));
|
||||||
|
@ -641,17 +641,15 @@ QStringList QFontconfigDatabase::fallbacksForFamily(const QString family, const
|
|||||||
FcPatternDestroy(pattern);
|
FcPatternDestroy(pattern);
|
||||||
|
|
||||||
if (fontSet) {
|
if (fontSet) {
|
||||||
if (result == FcResultMatch) {
|
for (int i = 0; i < fontSet->nfont; i++) {
|
||||||
for (int i = 0; i < fontSet->nfont; i++) {
|
FcChar8 *value = 0;
|
||||||
FcChar8 *value = 0;
|
if (FcPatternGetString(fontSet->fonts[i], FC_FAMILY, 0, &value) != FcResultMatch)
|
||||||
if (FcPatternGetString(fontSet->fonts[i], FC_FAMILY, 0, &value) != FcResultMatch)
|
continue;
|
||||||
continue;
|
// capitalize(value);
|
||||||
// capitalize(value);
|
QString familyName = QString::fromUtf8((const char *)value);
|
||||||
QString familyName = QString::fromUtf8((const char *)value);
|
if (!fallbackFamilies.contains(familyName,Qt::CaseInsensitive) &&
|
||||||
if (!fallbackFamilies.contains(familyName,Qt::CaseInsensitive) &&
|
familyName.compare(family, Qt::CaseInsensitive)) {
|
||||||
familyName.compare(family, Qt::CaseInsensitive)) {
|
fallbackFamilies << familyName;
|
||||||
fallbackFamilies << familyName;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FcFontSetDestroy(fontSet);
|
FcFontSetDestroy(fontSet);
|
||||||
|
@ -98,7 +98,7 @@ public:
|
|||||||
virtual QFixed emSquareSize() const;
|
virtual QFixed emSquareSize() const;
|
||||||
|
|
||||||
virtual QFontEngine *cloneWithSize(qreal pixelSize) const;
|
virtual QFontEngine *cloneWithSize(qreal pixelSize) const;
|
||||||
virtual int glyphMargin(QFontEngineGlyphCache::Type type) { return 0; }
|
virtual int glyphMargin(QFontEngineGlyphCache::Type type) { Q_UNUSED(type); return 0; }
|
||||||
|
|
||||||
static int antialiasingThreshold;
|
static int antialiasingThreshold;
|
||||||
static QFontEngineGlyphCache::Type defaultGlyphFormat;
|
static QFontEngineGlyphCache::Type defaultGlyphFormat;
|
||||||
|
@ -234,8 +234,10 @@ QAccessibleInterface *AccessibleFactory::create(const QString &classname, QObjec
|
|||||||
#endif
|
#endif
|
||||||
} else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) {
|
} else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) {
|
||||||
iface = new QAccessibleDisplay(widget);
|
iface = new QAccessibleDisplay(widget);
|
||||||
|
#ifndef QT_NO_GROUPBOX
|
||||||
} else if (classname == QLatin1String("QGroupBox")) {
|
} else if (classname == QLatin1String("QGroupBox")) {
|
||||||
iface = new QAccessibleDisplay(widget, QAccessible::Grouping);
|
iface = new QAccessibleGroupBox(widget);
|
||||||
|
#endif
|
||||||
} else if (classname == QLatin1String("QStatusBar")) {
|
} else if (classname == QLatin1String("QStatusBar")) {
|
||||||
iface = new QAccessibleWidget(widget, QAccessible::StatusBar);
|
iface = new QAccessibleWidget(widget, QAccessible::StatusBar);
|
||||||
#ifndef QT_NO_PROGRESSBAR
|
#ifndef QT_NO_PROGRESSBAR
|
||||||
|
@ -271,7 +271,7 @@ int QAccessibleTextEdit::cursorPosition() const
|
|||||||
return textEdit()->textCursor().position();
|
return textEdit()->textCursor().position();
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect QAccessibleTextEdit::characterRect(int offset, CoordinateType coordType) const
|
QRect QAccessibleTextEdit::characterRect(int offset) const
|
||||||
{
|
{
|
||||||
QTextEdit *edit = textEdit();
|
QTextEdit *edit = textEdit();
|
||||||
QTextCursor cursor(edit->document());
|
QTextCursor cursor(edit->document());
|
||||||
@ -292,14 +292,7 @@ QRect QAccessibleTextEdit::characterRect(int offset, CoordinateType coordType) c
|
|||||||
r.setWidth(averageCharWidth);
|
r.setWidth(averageCharWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (coordType) {
|
r.moveTo(edit->viewport()->mapToGlobal(r.topLeft()));
|
||||||
case RelativeToScreen:
|
|
||||||
r.moveTo(edit->viewport()->mapToGlobal(r.topLeft()));
|
|
||||||
break;
|
|
||||||
case RelativeToParent:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,13 +301,11 @@ int QAccessibleTextEdit::selectionCount() const
|
|||||||
return textEdit()->textCursor().hasSelection() ? 1 : 0;
|
return textEdit()->textCursor().hasSelection() ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QAccessibleTextEdit::offsetAtPoint(const QPoint &point, CoordinateType coordType) const
|
int QAccessibleTextEdit::offsetAtPoint(const QPoint &point) const
|
||||||
{
|
{
|
||||||
QTextEdit *edit = textEdit();
|
QTextEdit *edit = textEdit();
|
||||||
|
|
||||||
QPoint p = point;
|
QPoint p = edit->viewport()->mapFromGlobal(point);
|
||||||
if (coordType == RelativeToScreen)
|
|
||||||
p = edit->viewport()->mapFromGlobal(p);
|
|
||||||
// convert to document coordinates
|
// convert to document coordinates
|
||||||
p += QPoint(edit->horizontalScrollBar()->value(), edit->verticalScrollBar()->value());
|
p += QPoint(edit->horizontalScrollBar()->value(), edit->verticalScrollBar()->value());
|
||||||
|
|
||||||
|
@ -80,9 +80,9 @@ public:
|
|||||||
void addSelection(int startOffset, int endOffset);
|
void addSelection(int startOffset, int endOffset);
|
||||||
QString attributes(int offset, int *startOffset, int *endOffset) const;
|
QString attributes(int offset, int *startOffset, int *endOffset) const;
|
||||||
int cursorPosition() const;
|
int cursorPosition() const;
|
||||||
QRect characterRect(int offset, QAccessible2::CoordinateType coordType) const;
|
QRect characterRect(int offset) const;
|
||||||
int selectionCount() const;
|
int selectionCount() const;
|
||||||
int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType) const;
|
int offsetAtPoint(const QPoint &point) const;
|
||||||
void selection(int selectionIndex, int *startOffset, int *endOffset) const;
|
void selection(int selectionIndex, int *startOffset, int *endOffset) const;
|
||||||
QString text(int startOffset, int endOffset) const;
|
QString text(int startOffset, int endOffset) const;
|
||||||
QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
||||||
|
@ -399,10 +399,6 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
|
|||||||
if (str.isEmpty()) {
|
if (str.isEmpty()) {
|
||||||
if (qobject_cast<QLabel*>(object())) {
|
if (qobject_cast<QLabel*>(object())) {
|
||||||
str = qobject_cast<QLabel*>(object())->text();
|
str = qobject_cast<QLabel*>(object())->text();
|
||||||
#ifndef QT_NO_GROUPBOX
|
|
||||||
} else if (qobject_cast<QGroupBox*>(object())) {
|
|
||||||
str = qobject_cast<QGroupBox*>(object())->title();
|
|
||||||
#endif
|
|
||||||
#ifndef QT_NO_LCDNUMBER
|
#ifndef QT_NO_LCDNUMBER
|
||||||
} else if (qobject_cast<QLCDNumber*>(object())) {
|
} else if (qobject_cast<QLCDNumber*>(object())) {
|
||||||
QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
|
QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
|
||||||
@ -439,15 +435,6 @@ QAccessibleDisplay::relations(QAccessible::Relation match /*= QAccessible::AllRe
|
|||||||
#ifndef QT_NO_SHORTCUT
|
#ifndef QT_NO_SHORTCUT
|
||||||
if (QLabel *label = qobject_cast<QLabel*>(object())) {
|
if (QLabel *label = qobject_cast<QLabel*>(object())) {
|
||||||
relatedObjects.append(label->buddy());
|
relatedObjects.append(label->buddy());
|
||||||
#endif
|
|
||||||
#ifndef QT_NO_GROUPBOX
|
|
||||||
} else if (QGroupBox *groupbox = qobject_cast<QGroupBox*>(object())) {
|
|
||||||
if (!groupbox->title().isEmpty()) {
|
|
||||||
const QList<QWidget*> kids = childWidgets(widget());
|
|
||||||
for (int i = 0; i < kids.count(); ++i) {
|
|
||||||
relatedObjects.append(kids.at(i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
for (int i = 0; i < relatedObjects.count(); ++i) {
|
for (int i = 0; i < relatedObjects.count(); ++i) {
|
||||||
@ -490,7 +477,7 @@ QSize QAccessibleDisplay::imageSize() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*! \internal */
|
/*! \internal */
|
||||||
QRect QAccessibleDisplay::imagePosition(QAccessible2::CoordinateType coordType) const
|
QRect QAccessibleDisplay::imagePosition() const
|
||||||
{
|
{
|
||||||
QLabel *label = qobject_cast<QLabel *>(widget());
|
QLabel *label = qobject_cast<QLabel *>(widget());
|
||||||
if (!label)
|
if (!label)
|
||||||
@ -499,16 +486,90 @@ QRect QAccessibleDisplay::imagePosition(QAccessible2::CoordinateType coordType)
|
|||||||
if (!pixmap)
|
if (!pixmap)
|
||||||
return QRect();
|
return QRect();
|
||||||
|
|
||||||
switch (coordType) {
|
return QRect(label->mapToGlobal(label->pos()), label->size());
|
||||||
case QAccessible2::RelativeToScreen:
|
}
|
||||||
return QRect(label->mapToGlobal(label->pos()), label->size());
|
|
||||||
case QAccessible2::RelativeToParent:
|
#ifndef QT_NO_GROUPBOX
|
||||||
return label->geometry();
|
QAccessibleGroupBox::QAccessibleGroupBox(QWidget *w)
|
||||||
|
: QAccessibleWidget(w)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
QGroupBox* QAccessibleGroupBox::groupBox() const
|
||||||
|
{
|
||||||
|
return static_cast<QGroupBox *>(widget());
|
||||||
|
}
|
||||||
|
|
||||||
|
QString QAccessibleGroupBox::text(QAccessible::Text t) const
|
||||||
|
{
|
||||||
|
QString txt = QAccessibleWidget::text(t);
|
||||||
|
|
||||||
|
if (txt.isEmpty()) {
|
||||||
|
switch (t) {
|
||||||
|
case QAccessible::Name:
|
||||||
|
txt = qt_accStripAmp(groupBox()->title());
|
||||||
|
case QAccessible::Description:
|
||||||
|
txt = qt_accStripAmp(groupBox()->title());
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QRect();
|
return txt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QAccessible::State QAccessibleGroupBox::state() const
|
||||||
|
{
|
||||||
|
QAccessible::State st = QAccessibleWidget::state();
|
||||||
|
st.checkable = groupBox()->isCheckable();
|
||||||
|
st.checked = groupBox()->isChecked();
|
||||||
|
return st;
|
||||||
|
}
|
||||||
|
|
||||||
|
QAccessible::Role QAccessibleGroupBox::role() const
|
||||||
|
{
|
||||||
|
return groupBox()->isCheckable() ? QAccessible::CheckBox : QAccessible::Grouping;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >
|
||||||
|
QAccessibleGroupBox::relations(QAccessible::Relation match /*= QAccessible::AllRelations*/) const
|
||||||
|
{
|
||||||
|
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match);
|
||||||
|
|
||||||
|
if ((match & QAccessible::Labelled) && (!groupBox()->title().isEmpty())) {
|
||||||
|
const QList<QWidget*> kids = childWidgets(widget());
|
||||||
|
for (int i = 0; i < kids.count(); ++i) {
|
||||||
|
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(kids.at(i));
|
||||||
|
if (iface)
|
||||||
|
rels.append(qMakePair(iface, QAccessible::Relation(QAccessible::Labelled)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rels;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList QAccessibleGroupBox::actionNames() const
|
||||||
|
{
|
||||||
|
QStringList actions = QAccessibleWidget::actionNames();
|
||||||
|
|
||||||
|
if (groupBox()->isCheckable()) {
|
||||||
|
actions.prepend(QAccessibleActionInterface::checkAction());
|
||||||
|
}
|
||||||
|
return actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
void QAccessibleGroupBox::doAction(const QString &actionName)
|
||||||
|
{
|
||||||
|
if (actionName == QAccessibleActionInterface::checkAction())
|
||||||
|
groupBox()->setChecked(!groupBox()->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
|
QStringList QAccessibleGroupBox::keyBindingsForAction(const QString &) const
|
||||||
|
{
|
||||||
|
return QStringList();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_LINEEDIT
|
#ifndef QT_NO_LINEEDIT
|
||||||
/*!
|
/*!
|
||||||
\class QAccessibleLineEdit
|
\class QAccessibleLineEdit
|
||||||
@ -613,7 +674,7 @@ int QAccessibleLineEdit::cursorPosition() const
|
|||||||
return lineEdit()->cursorPosition();
|
return lineEdit()->cursorPosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect QAccessibleLineEdit::characterRect(int /*offset*/, CoordinateType /*coordType*/) const
|
QRect QAccessibleLineEdit::characterRect(int /*offset*/) const
|
||||||
{
|
{
|
||||||
// QLineEdit doesn't hand out character rects
|
// QLineEdit doesn't hand out character rects
|
||||||
return QRect();
|
return QRect();
|
||||||
@ -624,11 +685,9 @@ int QAccessibleLineEdit::selectionCount() const
|
|||||||
return lineEdit()->hasSelectedText() ? 1 : 0;
|
return lineEdit()->hasSelectedText() ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QAccessibleLineEdit::offsetAtPoint(const QPoint &point, CoordinateType coordType) const
|
int QAccessibleLineEdit::offsetAtPoint(const QPoint &point) const
|
||||||
{
|
{
|
||||||
QPoint p = point;
|
QPoint p = lineEdit()->mapFromGlobal(point);
|
||||||
if (coordType == RelativeToScreen)
|
|
||||||
p = lineEdit()->mapFromGlobal(p);
|
|
||||||
|
|
||||||
return lineEdit()->cursorPositionAt(p);
|
return lineEdit()->cursorPositionAt(p);
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QAbstractButton;
|
class QAbstractButton;
|
||||||
class QLineEdit;
|
class QLineEdit;
|
||||||
class QToolButton;
|
class QToolButton;
|
||||||
|
class QGroupBox;
|
||||||
class QProgressBar;
|
class QProgressBar;
|
||||||
|
|
||||||
class QAccessibleButton : public QAccessibleWidget
|
class QAccessibleButton : public QAccessibleWidget
|
||||||
@ -110,9 +111,31 @@ public:
|
|||||||
// QAccessibleImageInterface
|
// QAccessibleImageInterface
|
||||||
QString imageDescription() const;
|
QString imageDescription() const;
|
||||||
QSize imageSize() const;
|
QSize imageSize() const;
|
||||||
QRect imagePosition(QAccessible2::CoordinateType coordType) const;
|
QRect imagePosition() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifndef QT_NO_GROUPBOX
|
||||||
|
class QAccessibleGroupBox : public QAccessibleWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
explicit QAccessibleGroupBox(QWidget *w);
|
||||||
|
|
||||||
|
QAccessible::State state() const;
|
||||||
|
QAccessible::Role role() const;
|
||||||
|
QString text(QAccessible::Text t) const;
|
||||||
|
|
||||||
|
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >relations(QAccessible::Relation match = QAccessible::AllRelations) const;
|
||||||
|
|
||||||
|
//QAccessibleActionInterface
|
||||||
|
QStringList actionNames() const;
|
||||||
|
void doAction(const QString &actionName);
|
||||||
|
QStringList keyBindingsForAction(const QString &) const;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QGroupBox *groupBox() const;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef QT_NO_LINEEDIT
|
#ifndef QT_NO_LINEEDIT
|
||||||
class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface,
|
class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface,
|
||||||
public QAccessibleSimpleEditableTextInterface
|
public QAccessibleSimpleEditableTextInterface
|
||||||
@ -129,9 +152,9 @@ public:
|
|||||||
void addSelection(int startOffset, int endOffset);
|
void addSelection(int startOffset, int endOffset);
|
||||||
QString attributes(int offset, int *startOffset, int *endOffset) const;
|
QString attributes(int offset, int *startOffset, int *endOffset) const;
|
||||||
int cursorPosition() const;
|
int cursorPosition() const;
|
||||||
QRect characterRect(int offset, QAccessible2::CoordinateType coordType) const;
|
QRect characterRect(int offset) const;
|
||||||
int selectionCount() const;
|
int selectionCount() const;
|
||||||
int offsetAtPoint(const QPoint &point, QAccessible2::CoordinateType coordType) const;
|
int offsetAtPoint(const QPoint &point) const;
|
||||||
void selection(int selectionIndex, int *startOffset, int *endOffset) const;
|
void selection(int selectionIndex, int *startOffset, int *endOffset) const;
|
||||||
QString text(int startOffset, int endOffset) const;
|
QString text(int startOffset, int endOffset) const;
|
||||||
QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
QString textBeforeOffset (int offset, QAccessible2::BoundaryType boundaryType,
|
||||||
|
@ -172,8 +172,8 @@ static void cleanupCocoaApplicationDelegate()
|
|||||||
// QApplicationPrivate::globalAppleEventProcessor in qapplication_mac.mm
|
// QApplicationPrivate::globalAppleEventProcessor in qapplication_mac.mm
|
||||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
Q_UNUSED(sender);
|
Q_UNUSED(sender);
|
||||||
|
/*
|
||||||
// The reflection delegate gets precedence
|
// The reflection delegate gets precedence
|
||||||
if (reflectionDelegate
|
if (reflectionDelegate
|
||||||
&& [reflectionDelegate respondsToSelector:@selector(applicationShouldTerminate:)]) {
|
&& [reflectionDelegate respondsToSelector:@selector(applicationShouldTerminate:)]) {
|
||||||
|
@ -60,6 +60,7 @@ public:
|
|||||||
QPaintDevice *paintDevice();
|
QPaintDevice *paintDevice();
|
||||||
void flush(QWindow *widget, const QRegion ®ion, const QPoint &offset);
|
void flush(QWindow *widget, const QRegion ®ion, const QPoint &offset);
|
||||||
void resize (const QSize &size, const QRegion &);
|
void resize (const QSize &size, const QRegion &);
|
||||||
|
bool scroll(const QRegion &area, int dx, int dy);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QCocoaWindow *m_cocoaWindow;
|
QCocoaWindow *m_cocoaWindow;
|
||||||
|
@ -47,23 +47,10 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QRect flipedRect(const QRect &sourceRect,int height)
|
|
||||||
{
|
|
||||||
if (!sourceRect.isValid())
|
|
||||||
return QRect();
|
|
||||||
QRect flippedRect = sourceRect;
|
|
||||||
flippedRect.moveTop(height - sourceRect.y());
|
|
||||||
return flippedRect;
|
|
||||||
}
|
|
||||||
|
|
||||||
QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
|
QCocoaBackingStore::QCocoaBackingStore(QWindow *window)
|
||||||
: QPlatformBackingStore(window)
|
: QPlatformBackingStore(window)
|
||||||
{
|
{
|
||||||
m_cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
|
m_cocoaWindow = static_cast<QCocoaWindow *>(window->handle());
|
||||||
|
|
||||||
const QRect geo = window->geometry();
|
|
||||||
NSRect rect = NSMakeRect(geo.x(),geo.y(),geo.width(),geo.height());
|
|
||||||
|
|
||||||
m_image = new QImage(window->geometry().size(),QImage::Format_ARGB32_Premultiplied);
|
m_image = new QImage(window->geometry().size(),QImage::Format_ARGB32_Premultiplied);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -84,7 +71,6 @@ void QCocoaBackingStore::flush(QWindow *widget, const QRegion ®ion, const QPo
|
|||||||
QCocoaAutoReleasePool pool;
|
QCocoaAutoReleasePool pool;
|
||||||
|
|
||||||
QRect geo = region.boundingRect();
|
QRect geo = region.boundingRect();
|
||||||
|
|
||||||
NSRect rect = NSMakeRect(geo.x(), geo.y(), geo.width(), geo.height());
|
NSRect rect = NSMakeRect(geo.x(), geo.y(), geo.width(), geo.height());
|
||||||
[m_cocoaWindow->m_contentView displayRect:rect];
|
[m_cocoaWindow->m_contentView displayRect:rect];
|
||||||
}
|
}
|
||||||
@ -92,9 +78,20 @@ void QCocoaBackingStore::flush(QWindow *widget, const QRegion ®ion, const QPo
|
|||||||
void QCocoaBackingStore::resize(const QSize &size, const QRegion &)
|
void QCocoaBackingStore::resize(const QSize &size, const QRegion &)
|
||||||
{
|
{
|
||||||
delete m_image;
|
delete m_image;
|
||||||
m_image = new QImage(size,QImage::Format_ARGB32_Premultiplied);
|
m_image = new QImage(size, QImage::Format_ARGB32_Premultiplied);
|
||||||
NSSize newSize = NSMakeSize(size.width(),size.height());
|
|
||||||
[static_cast<QNSView *>(m_cocoaWindow->m_contentView) setImage:m_image];
|
[static_cast<QNSView *>(m_cocoaWindow->m_contentView) setImage:m_image];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QCocoaBackingStore::scroll(const QRegion &area, int dx, int dy)
|
||||||
|
{
|
||||||
|
extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);
|
||||||
|
QPoint qpoint(dx, dy);
|
||||||
|
const QVector<QRect> qrects = area.rects();
|
||||||
|
for (int i = 0; i < qrects.count(); ++i) {
|
||||||
|
const QRect &qrect = qrects.at(i);
|
||||||
|
qt_scrollRectInImage(*m_image, qrect, qpoint);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -81,6 +81,7 @@ bool QCocoaClipboard::supportsMode(QClipboard::Mode mode) const
|
|||||||
|
|
||||||
bool QCocoaClipboard::ownsMode(QClipboard::Mode mode) const
|
bool QCocoaClipboard::ownsMode(QClipboard::Mode mode) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(mode);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +59,8 @@ QCocoaCursor::QCocoaCursor()
|
|||||||
|
|
||||||
void QCocoaCursor::changeCursor(QCursor *cursor, QWindow *window)
|
void QCocoaCursor::changeCursor(QCursor *cursor, QWindow *window)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(window);
|
||||||
|
|
||||||
// Check for a suitable built-in NSCursor first:
|
// Check for a suitable built-in NSCursor first:
|
||||||
switch (cursor->shape()) {
|
switch (cursor->shape()) {
|
||||||
case Qt::ArrowCursor:
|
case Qt::ArrowCursor:
|
||||||
|
@ -895,6 +895,7 @@ QCocoaEventDispatcherPrivate::QCocoaEventDispatcherPrivate()
|
|||||||
nsAppRunCalledByQt(false),
|
nsAppRunCalledByQt(false),
|
||||||
cleanupModalSessionsNeeded(false),
|
cleanupModalSessionsNeeded(false),
|
||||||
currentModalSessionCached(0),
|
currentModalSessionCached(0),
|
||||||
|
lastSerial(-1),
|
||||||
interrupt(false)
|
interrupt(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -504,17 +504,6 @@ typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
static bool qt_mac_is_macsheet(const QWidget *w)
|
|
||||||
{
|
|
||||||
if (!w)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
Qt::WindowModality modality = w->windowModality();
|
|
||||||
if (modality == Qt::ApplicationModal)
|
|
||||||
return false;
|
|
||||||
return w->parentWidget() && (modality == Qt::WindowModal || w->windowType() == Qt::Sheet);
|
|
||||||
}
|
|
||||||
|
|
||||||
QCocoaFileDialogHelper::QCocoaFileDialogHelper()
|
QCocoaFileDialogHelper::QCocoaFileDialogHelper()
|
||||||
:mDelegate(0)
|
:mDelegate(0)
|
||||||
{
|
{
|
||||||
|
@ -45,6 +45,8 @@
|
|||||||
#include <QtGui/QPlatformNativeInterface>
|
#include <QtGui/QPlatformNativeInterface>
|
||||||
#include <QtPrintSupport/QPlatformPrinterSupport>
|
#include <QtPrintSupport/QPlatformPrinterSupport>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QWidget;
|
class QWidget;
|
||||||
|
|
||||||
class QCocoaNativeInterface : public QPlatformNativeInterface
|
class QCocoaNativeInterface : public QPlatformNativeInterface
|
||||||
@ -74,3 +76,5 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif // QCOCOANATIVEINTERFACE_H
|
#endif // QCOCOANATIVEINTERFACE_H
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
@ -54,6 +54,8 @@
|
|||||||
|
|
||||||
#include "qprintengine_mac_p.h"
|
#include "qprintengine_mac_p.h"
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
void *QCocoaNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
|
void *QCocoaNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window)
|
||||||
{
|
{
|
||||||
if (!window->handle()) {
|
if (!window->handle()) {
|
||||||
@ -81,3 +83,5 @@ void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine
|
|||||||
QMacPrintEngine *macPrintEngine = static_cast<QMacPrintEngine *>(printEngine);
|
QMacPrintEngine *macPrintEngine = static_cast<QMacPrintEngine *>(printEngine);
|
||||||
return macPrintEngine->d_func()->printInfo;
|
return macPrintEngine->d_func()->printInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
#include "qcocoaglcontext.h"
|
#include "qcocoaglcontext.h"
|
||||||
#include "qnsview.h"
|
#include "qnsview.h"
|
||||||
class QCocoaWindow;
|
class QT_PREPEND_NAMESPACE(QCocoaWindow);
|
||||||
|
|
||||||
@interface QNSWindow : NSWindow {
|
@interface QNSWindow : NSWindow {
|
||||||
@public QCocoaWindow *m_cocoaPlatformWindow;
|
@public QCocoaWindow *m_cocoaPlatformWindow;
|
||||||
@ -59,7 +59,7 @@ class QCocoaWindow;
|
|||||||
@end
|
@end
|
||||||
|
|
||||||
@interface QNSPanel : NSPanel {
|
@interface QNSPanel : NSPanel {
|
||||||
@public QCocoaWindow *m_cocoaPlatformWindow;
|
@public QT_PREPEND_NAMESPACE(QCocoaWindow) *m_cocoaPlatformWindow;
|
||||||
}
|
}
|
||||||
- (BOOL)canBecomeKeyWindow;
|
- (BOOL)canBecomeKeyWindow;
|
||||||
@end
|
@end
|
||||||
@ -99,6 +99,7 @@ public:
|
|||||||
void raise();
|
void raise();
|
||||||
void lower();
|
void lower();
|
||||||
void propagateSizeHints();
|
void propagateSizeHints();
|
||||||
|
void setOpacity(qreal level);
|
||||||
bool setKeyboardGrabEnabled(bool grab);
|
bool setKeyboardGrabEnabled(bool grab);
|
||||||
bool setMouseGrabEnabled(bool grab);
|
bool setMouseGrabEnabled(bool grab);
|
||||||
|
|
||||||
@ -133,7 +134,7 @@ public: // for QNSView
|
|||||||
friend class QCocoaNativeInterface;
|
friend class QCocoaNativeInterface;
|
||||||
|
|
||||||
QNSView *m_contentView;
|
QNSView *m_contentView;
|
||||||
QNSWindow *m_nsWindow;
|
NSWindow *m_nsWindow;
|
||||||
Qt::WindowFlags m_windowFlags;
|
Qt::WindowFlags m_windowFlags;
|
||||||
QPointer<QWindow> m_activePopupWindow;
|
QPointer<QWindow> m_activePopupWindow;
|
||||||
|
|
||||||
|
@ -111,8 +111,8 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
|
|||||||
|
|
||||||
QCocoaWindow::~QCocoaWindow()
|
QCocoaWindow::~QCocoaWindow()
|
||||||
{
|
{
|
||||||
[m_contentView release];
|
|
||||||
clearNSWindow(m_nsWindow);
|
clearNSWindow(m_nsWindow);
|
||||||
|
[m_contentView release];
|
||||||
[m_nsWindow release];
|
[m_nsWindow release];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,13 +198,17 @@ void QCocoaWindow::raise()
|
|||||||
{
|
{
|
||||||
//qDebug() << "raise" << this;
|
//qDebug() << "raise" << this;
|
||||||
// ### handle spaces (see Qt 4 raise_sys in qwidget_mac.mm)
|
// ### handle spaces (see Qt 4 raise_sys in qwidget_mac.mm)
|
||||||
if (m_nsWindow)
|
if (!m_nsWindow)
|
||||||
|
return;
|
||||||
|
if ([m_nsWindow isVisible])
|
||||||
[m_nsWindow orderFront: m_nsWindow];
|
[m_nsWindow orderFront: m_nsWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
void QCocoaWindow::lower()
|
void QCocoaWindow::lower()
|
||||||
{
|
{
|
||||||
if (m_nsWindow)
|
if (!m_nsWindow)
|
||||||
|
return;
|
||||||
|
if ([m_nsWindow isVisible])
|
||||||
[m_nsWindow orderBack: m_nsWindow];
|
[m_nsWindow orderBack: m_nsWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -233,6 +237,12 @@ void QCocoaWindow::propagateSizeHints()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QCocoaWindow::setOpacity(qreal level)
|
||||||
|
{
|
||||||
|
if (m_nsWindow)
|
||||||
|
[m_nsWindow setAlphaValue:level];
|
||||||
|
}
|
||||||
|
|
||||||
bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
|
bool QCocoaWindow::setKeyboardGrabEnabled(bool grab)
|
||||||
{
|
{
|
||||||
if (!m_nsWindow)
|
if (!m_nsWindow)
|
||||||
@ -439,7 +449,9 @@ void QCocoaWindow::setNSWindow(NSWindow *window)
|
|||||||
|
|
||||||
void QCocoaWindow::clearNSWindow(NSWindow *window)
|
void QCocoaWindow::clearNSWindow(NSWindow *window)
|
||||||
{
|
{
|
||||||
|
[window setDelegate:nil];
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:m_contentView];
|
[[NSNotificationCenter defaultCenter] removeObserver:m_contentView];
|
||||||
|
[m_contentView removeFromSuperviewWithoutNeedingDisplay];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns the current global screen geometry for the nswindow associated with this window.
|
// Returns the current global screen geometry for the nswindow associated with this window.
|
||||||
|
@ -49,6 +49,8 @@
|
|||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QMacPasteboard
|
class QMacPasteboard
|
||||||
{
|
{
|
||||||
struct Promise {
|
struct Promise {
|
||||||
@ -90,4 +92,6 @@ public:
|
|||||||
|
|
||||||
QString qt_mac_get_pasteboardString(PasteboardRef paste);
|
QString qt_mac_get_pasteboardString(PasteboardRef paste);
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -56,8 +56,6 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
QT_USE_NAMESPACE
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
QClipboard debug facilities
|
QClipboard debug facilities
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@ -548,6 +546,4 @@ QString qt_mac_get_pasteboardString(PasteboardRef paste)
|
|||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -46,6 +46,8 @@
|
|||||||
|
|
||||||
#include <CoreFoundation/CoreFoundation.h>
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class Q_GUI_EXPORT QMacPasteboardMime {
|
class Q_GUI_EXPORT QMacPasteboardMime {
|
||||||
char type;
|
char type;
|
||||||
public:
|
public:
|
||||||
@ -74,5 +76,7 @@ public:
|
|||||||
virtual QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav) = 0;
|
virtual QList<QByteArray> convertFromMime(const QString &mime, QVariant data, QString flav) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -238,6 +238,7 @@ static QTouchDevice *touchDevice = 0;
|
|||||||
|
|
||||||
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
|
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(theEvent);
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -638,6 +639,43 @@ static QTouchDevice *touchDevice = 0;
|
|||||||
[self handleKeyEvent:nsevent eventType:int(QEvent::KeyRelease)];
|
[self handleKeyEvent:nsevent eventType:int(QEvent::KeyRelease)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)flagsChanged:(NSEvent *)nsevent
|
||||||
|
{
|
||||||
|
ulong timestamp = [nsevent timestamp] * 1000;
|
||||||
|
ulong modifiers = [nsevent modifierFlags];
|
||||||
|
Qt::KeyboardModifiers qmodifiers = [self convertKeyModifiers:modifiers];
|
||||||
|
|
||||||
|
// calculate the delta and remember the current modifiers for next time
|
||||||
|
static ulong m_lastKnownModifiers;
|
||||||
|
ulong lastKnownModifiers = m_lastKnownModifiers;
|
||||||
|
ulong delta = lastKnownModifiers ^ modifiers;
|
||||||
|
m_lastKnownModifiers = modifiers;
|
||||||
|
|
||||||
|
struct qt_mac_enum_mapper
|
||||||
|
{
|
||||||
|
ulong mac_mask;
|
||||||
|
Qt::Key qt_code;
|
||||||
|
};
|
||||||
|
static qt_mac_enum_mapper modifier_key_symbols[] = {
|
||||||
|
{ NSShiftKeyMask, Qt::Key_Shift },
|
||||||
|
{ NSControlKeyMask, Qt::Key_Meta },
|
||||||
|
{ NSCommandKeyMask, Qt::Key_Control },
|
||||||
|
{ NSAlternateKeyMask, Qt::Key_Alt },
|
||||||
|
{ NSAlphaShiftKeyMask, Qt::Key_CapsLock },
|
||||||
|
{ 0ul, Qt::Key_unknown } };
|
||||||
|
for (int i = 0; modifier_key_symbols[i].mac_mask != 0u; ++i) {
|
||||||
|
uint mac_mask = modifier_key_symbols[i].mac_mask;
|
||||||
|
if ((delta & mac_mask) == 0u)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
QWindowSystemInterface::handleKeyEvent(m_window,
|
||||||
|
timestamp,
|
||||||
|
(lastKnownModifiers & mac_mask) ? QEvent::KeyRelease : QEvent::KeyPress,
|
||||||
|
modifier_key_symbols[i].qt_code,
|
||||||
|
qmodifiers);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void) doCommandBySelector:(SEL)aSelector
|
- (void) doCommandBySelector:(SEL)aSelector
|
||||||
{
|
{
|
||||||
[self tryToPerform:aSelector with:self];
|
[self tryToPerform:aSelector with:self];
|
||||||
|
@ -87,7 +87,6 @@
|
|||||||
- (id)accessibilityHitTest:(NSPoint)point {
|
- (id)accessibilityHitTest:(NSPoint)point {
|
||||||
if (!m_accessibleRoot)
|
if (!m_accessibleRoot)
|
||||||
return [super accessibilityHitTest:point];
|
return [super accessibilityHitTest:point];
|
||||||
NSPoint windowPoint = [[self window] convertScreenToBase:point];
|
|
||||||
|
|
||||||
QAccessibleInterface *childInterface = m_accessibleRoot->childAt(point.x, qt_mac_flipYCoordinate(point.y));
|
QAccessibleInterface *childInterface = m_accessibleRoot->childAt(point.x, qt_mac_flipYCoordinate(point.y));
|
||||||
// No child found, meaning we hit the NSView
|
// No child found, meaning we hit the NSView
|
||||||
|
@ -3,10 +3,6 @@ load(qt_plugin)
|
|||||||
|
|
||||||
QT += core-private gui-private platformsupport-private
|
QT += core-private gui-private platformsupport-private
|
||||||
|
|
||||||
!contains(QT_CONFIG, no-widgets) {
|
|
||||||
QT += opengl opengl-private widgets-private
|
|
||||||
}
|
|
||||||
|
|
||||||
DESTDIR = $$QT.gui.plugins/platforms
|
DESTDIR = $$QT.gui.plugins/platforms
|
||||||
|
|
||||||
#DEFINES += QEGL_EXTRA_DEBUG
|
#DEFINES += QEGL_EXTRA_DEBUG
|
||||||
|
@ -41,67 +41,54 @@
|
|||||||
|
|
||||||
#include "qeglfsbackingstore.h"
|
#include "qeglfsbackingstore.h"
|
||||||
|
|
||||||
#ifndef QT_NO_WIDGETS
|
#include <QtGui/QOpenGLContext>
|
||||||
#include <QtOpenGL/private/qgl_p.h>
|
#include <QtGui/QOpenGLPaintDevice>
|
||||||
#include <QtOpenGL/private/qglpaintdevice_p.h>
|
|
||||||
#endif //QT_NO_WIDGETS
|
|
||||||
|
|
||||||
#include <QtGui/QPlatformOpenGLContext>
|
|
||||||
#include <QtGui/QScreen>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
#ifndef QT_NO_WIDGETS
|
|
||||||
class QEglFSPaintDevice : public QGLPaintDevice
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
QEglFSPaintDevice(QEglFSScreen *screen)
|
|
||||||
:QGLPaintDevice(), m_screen(screen)
|
|
||||||
{
|
|
||||||
#ifdef QEGL_EXTRA_DEBUG
|
|
||||||
qWarning("QEglPaintDevice %p, %p",this, screen);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
QSize size() const { return m_screen->geometry().size(); }
|
|
||||||
QGLContext* context() const { return QGLContext::fromOpenGLContext(m_screen->platformContext()->context()); }
|
|
||||||
|
|
||||||
QPaintEngine *paintEngine() const { return qt_qgl_paint_engine(); }
|
|
||||||
|
|
||||||
void beginPaint(){
|
|
||||||
QGLPaintDevice::beginPaint();
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
QEglFSScreen *m_screen;
|
|
||||||
QGLContext *m_context;
|
|
||||||
};
|
|
||||||
#endif //QT_NO_WIDGETS
|
|
||||||
|
|
||||||
QEglFSBackingStore::QEglFSBackingStore(QWindow *window)
|
QEglFSBackingStore::QEglFSBackingStore(QWindow *window)
|
||||||
: QPlatformBackingStore(window),
|
: QPlatformBackingStore(window)
|
||||||
m_paintDevice(0)
|
, m_context(new QOpenGLContext)
|
||||||
{
|
{
|
||||||
#ifdef QEGL_EXTRA_DEBUG
|
m_context->setFormat(window->requestedFormat());
|
||||||
qWarning("QEglBackingStore %p, %p", window, window->screen());
|
m_context->setScreen(window->screen());
|
||||||
#endif
|
m_context->create();
|
||||||
#ifdef QT_NO_WIDGETS
|
}
|
||||||
m_paintDevice = new QImage(0,0);
|
|
||||||
#else
|
QEglFSBackingStore::~QEglFSBackingStore()
|
||||||
m_paintDevice = new QEglFSPaintDevice(static_cast<QEglFSScreen *>(window->screen()->handle()));
|
{
|
||||||
#endif //QT_NO_WIDGETS
|
delete m_context;
|
||||||
|
}
|
||||||
|
|
||||||
|
QPaintDevice *QEglFSBackingStore::paintDevice()
|
||||||
|
{
|
||||||
|
return m_device;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEglFSBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset)
|
void QEglFSBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset)
|
||||||
{
|
{
|
||||||
Q_UNUSED(window);
|
|
||||||
Q_UNUSED(region);
|
Q_UNUSED(region);
|
||||||
Q_UNUSED(offset);
|
Q_UNUSED(offset);
|
||||||
|
|
||||||
#ifdef QEGL_EXTRA_DEBUG
|
#ifdef QEGL_EXTRA_DEBUG
|
||||||
qWarning("QEglBackingStore::flush %p", window);
|
qWarning("QEglBackingStore::flush %p", window);
|
||||||
#endif
|
#endif
|
||||||
#ifndef QT_NO_WIDGETS
|
|
||||||
static_cast<QEglFSPaintDevice *>(m_paintDevice)->context()->swapBuffers();
|
m_context->swapBuffers(window);
|
||||||
#endif //QT_NO_WIDGETS
|
}
|
||||||
|
|
||||||
|
void QEglFSBackingStore::beginPaint(const QRegion &)
|
||||||
|
{
|
||||||
|
// needed to prevent QOpenGLContext::makeCurrent() from failing
|
||||||
|
window()->setSurfaceType(QSurface::OpenGLSurface);
|
||||||
|
|
||||||
|
m_context->makeCurrent(window());
|
||||||
|
m_device = new QOpenGLPaintDevice(window()->size());
|
||||||
|
}
|
||||||
|
|
||||||
|
void QEglFSBackingStore::endPaint()
|
||||||
|
{
|
||||||
|
delete m_device;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents)
|
void QEglFSBackingStore::resize(const QSize &size, const QRegion &staticContents)
|
||||||
|
@ -42,25 +42,30 @@
|
|||||||
#ifndef QEGLWINDOWSURFACE_H
|
#ifndef QEGLWINDOWSURFACE_H
|
||||||
#define QEGLWINDOWSURFACE_H
|
#define QEGLWINDOWSURFACE_H
|
||||||
|
|
||||||
#include "qeglfsintegration.h"
|
|
||||||
#include "qeglfswindow.h"
|
|
||||||
|
|
||||||
#include <QtGui/qplatformbackingstore_qpa.h>
|
#include <QtGui/qplatformbackingstore_qpa.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
class QOpenGLContext;
|
||||||
|
class QOpenGLPaintDevice;
|
||||||
|
|
||||||
class QEglFSBackingStore : public QPlatformBackingStore
|
class QEglFSBackingStore : public QPlatformBackingStore
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QEglFSBackingStore(QWindow *window);
|
QEglFSBackingStore(QWindow *window);
|
||||||
~QEglFSBackingStore() { delete m_paintDevice; }
|
~QEglFSBackingStore();
|
||||||
|
|
||||||
|
QPaintDevice *paintDevice();
|
||||||
|
|
||||||
|
void beginPaint(const QRegion &);
|
||||||
|
void endPaint();
|
||||||
|
|
||||||
QPaintDevice *paintDevice() { return m_paintDevice; }
|
|
||||||
void flush(QWindow *window, const QRegion ®ion, const QPoint &offset);
|
void flush(QWindow *window, const QRegion ®ion, const QPoint &offset);
|
||||||
void resize(const QSize &size, const QRegion &staticContents);
|
void resize(const QSize &size, const QRegion &staticContents);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPaintDevice *m_paintDevice;
|
QOpenGLContext *m_context;
|
||||||
|
QOpenGLPaintDevice *m_device;
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -37,6 +37,7 @@ SOURCES = main.cpp \
|
|||||||
qqnxclipboard.cpp \
|
qqnxclipboard.cpp \
|
||||||
qqnxrootwindow.cpp
|
qqnxrootwindow.cpp
|
||||||
|
|
||||||
|
|
||||||
HEADERS = qqnxbuffer.h \
|
HEADERS = qqnxbuffer.h \
|
||||||
qqnxeventthread.h \
|
qqnxeventthread.h \
|
||||||
qqnxkeytranslator.h \
|
qqnxkeytranslator.h \
|
||||||
@ -51,6 +52,11 @@ HEADERS = qqnxbuffer.h \
|
|||||||
qqnxclipboard.h \
|
qqnxclipboard.h \
|
||||||
qqnxrootwindow.h
|
qqnxrootwindow.h
|
||||||
|
|
||||||
|
CONFIG(blackberry) {
|
||||||
|
SOURCES += qqnxservices.cpp
|
||||||
|
HEADERS += qqnxservices.h
|
||||||
|
}
|
||||||
|
|
||||||
CONFIG(qqnx_imf) {
|
CONFIG(qqnx_imf) {
|
||||||
DEFINES += QQNX_IMF
|
DEFINES += QQNX_IMF
|
||||||
HEADERS += qqnxinputcontext_imf.h
|
HEADERS += qqnxinputcontext_imf.h
|
||||||
@ -64,6 +70,10 @@ QMAKE_CXXFLAGS += -I./private
|
|||||||
|
|
||||||
LIBS += -lpps -lscreen -lEGL -lclipboard
|
LIBS += -lpps -lscreen -lEGL -lclipboard
|
||||||
|
|
||||||
|
CONFIG(blackberry) {
|
||||||
|
LIBS += -lbps
|
||||||
|
}
|
||||||
|
|
||||||
include (../../../platformsupport/eglconvenience/eglconvenience.pri)
|
include (../../../platformsupport/eglconvenience/eglconvenience.pri)
|
||||||
include (../../../platformsupport/fontdatabases/fontdatabases.pri)
|
include (../../../platformsupport/fontdatabases/fontdatabases.pri)
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include "qqnxvirtualkeyboard.h"
|
#include "qqnxvirtualkeyboard.h"
|
||||||
#include "qqnxclipboard.h"
|
#include "qqnxclipboard.h"
|
||||||
#include "qqnxglcontext.h"
|
#include "qqnxglcontext.h"
|
||||||
|
#include "qqnxservices.h"
|
||||||
|
|
||||||
#if defined(QQnx_IMF)
|
#if defined(QQnx_IMF)
|
||||||
#include "qqnxinputcontext_imf.h"
|
#include "qqnxinputcontext_imf.h"
|
||||||
@ -82,6 +83,7 @@ QQnxIntegration::QQnxIntegration()
|
|||||||
, m_fontDatabase(new QGenericUnixFontDatabase())
|
, m_fontDatabase(new QGenericUnixFontDatabase())
|
||||||
, m_paintUsingOpenGL(false)
|
, m_paintUsingOpenGL(false)
|
||||||
, m_eventDispatcher(createUnixEventDispatcher())
|
, m_eventDispatcher(createUnixEventDispatcher())
|
||||||
|
, m_services(0)
|
||||||
#ifndef QT_NO_CLIPBOARD
|
#ifndef QT_NO_CLIPBOARD
|
||||||
, m_clipboard(0)
|
, m_clipboard(0)
|
||||||
#endif
|
#endif
|
||||||
@ -124,6 +126,11 @@ QQnxIntegration::QQnxIntegration()
|
|||||||
|
|
||||||
// Set up the input context
|
// Set up the input context
|
||||||
m_inputContext = new QQnxInputContext;
|
m_inputContext = new QQnxInputContext;
|
||||||
|
|
||||||
|
// Create services handling class
|
||||||
|
#ifdef Q_OS_BLACKBERRY
|
||||||
|
m_services = new QQnxServices;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QQnxIntegration::~QQnxIntegration()
|
QQnxIntegration::~QQnxIntegration()
|
||||||
@ -154,6 +161,11 @@ QQnxIntegration::~QQnxIntegration()
|
|||||||
// Cleanup global OpenGL resources
|
// Cleanup global OpenGL resources
|
||||||
QQnxGLContext::shutdown();
|
QQnxGLContext::shutdown();
|
||||||
|
|
||||||
|
// Destroy services class
|
||||||
|
#ifdef Q_OS_BLACKBERRY
|
||||||
|
delete m_services;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(QQNXINTEGRATION_DEBUG)
|
#if defined(QQNXINTEGRATION_DEBUG)
|
||||||
qDebug() << "QQnx: platform plugin shutdown end";
|
qDebug() << "QQnx: platform plugin shutdown end";
|
||||||
#endif
|
#endif
|
||||||
@ -266,6 +278,11 @@ QVariant QQnxIntegration::styleHint(QPlatformIntegration::StyleHint hint) const
|
|||||||
return QPlatformIntegration::styleHint(hint);
|
return QPlatformIntegration::styleHint(hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPlatformServices * QQnxIntegration::services() const
|
||||||
|
{
|
||||||
|
return m_services;
|
||||||
|
}
|
||||||
|
|
||||||
QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
|
QWindow *QQnxIntegration::window(screen_window_t qnxWindow)
|
||||||
{
|
{
|
||||||
#if defined(QQNXINTEGRATION_DEBUG)
|
#if defined(QQNXINTEGRATION_DEBUG)
|
||||||
|
@ -54,6 +54,7 @@ class QQnxEventThread;
|
|||||||
class QQnxInputContext;
|
class QQnxInputContext;
|
||||||
class QQnxNavigatorEventHandler;
|
class QQnxNavigatorEventHandler;
|
||||||
class QQnxWindow;
|
class QQnxWindow;
|
||||||
|
class QQnxServices;
|
||||||
|
|
||||||
#ifndef QT_NO_CLIPBOARD
|
#ifndef QT_NO_CLIPBOARD
|
||||||
class QQnxClipboard;
|
class QQnxClipboard;
|
||||||
@ -91,6 +92,8 @@ public:
|
|||||||
|
|
||||||
bool paintUsingOpenGL() const { return m_paintUsingOpenGL; }
|
bool paintUsingOpenGL() const { return m_paintUsingOpenGL; }
|
||||||
|
|
||||||
|
virtual QPlatformServices *services() const;
|
||||||
|
|
||||||
static QWindow *window(screen_window_t qnxWindow);
|
static QWindow *window(screen_window_t qnxWindow);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -104,6 +107,7 @@ private:
|
|||||||
QPlatformFontDatabase *m_fontDatabase;
|
QPlatformFontDatabase *m_fontDatabase;
|
||||||
bool m_paintUsingOpenGL;
|
bool m_paintUsingOpenGL;
|
||||||
QAbstractEventDispatcher *m_eventDispatcher;
|
QAbstractEventDispatcher *m_eventDispatcher;
|
||||||
|
QQnxServices *m_services;
|
||||||
#ifndef QT_NO_CLIPBOARD
|
#ifndef QT_NO_CLIPBOARD
|
||||||
mutable QQnxClipboard* m_clipboard;
|
mutable QQnxClipboard* m_clipboard;
|
||||||
#endif
|
#endif
|
||||||
|
81
src/plugins/platforms/qnx/qqnxservices.cpp
Normal file
81
src/plugins/platforms/qnx/qqnxservices.cpp
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
/***************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2011 - 2012 Research In Motion
|
||||||
|
** Contact: http://www.qt-project.org/
|
||||||
|
**
|
||||||
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:LGPL$
|
||||||
|
** GNU Lesser General Public License Usage
|
||||||
|
** This file may be used under the terms of the GNU Lesser General Public
|
||||||
|
** License version 2.1 as published by the Free Software Foundation and
|
||||||
|
** appearing in the file LICENSE.LGPL included in the packaging of this
|
||||||
|
** file. Please review the following information to ensure the GNU Lesser
|
||||||
|
** General Public License version 2.1 requirements will be met:
|
||||||
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||||
|
**
|
||||||
|
** In addition, as a special exception, Nokia gives you certain additional
|
||||||
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
||||||
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||||
|
**
|
||||||
|
** GNU General Public License Usage
|
||||||
|
** Alternatively, this file may be used under the terms of the GNU General
|
||||||
|
** Public License version 3.0 as published by the Free Software Foundation
|
||||||
|
** and appearing in the file LICENSE.GPL included in the packaging of this
|
||||||
|
** file. Please review the following information to ensure the GNU General
|
||||||
|
** Public License version 3.0 requirements will be met:
|
||||||
|
** http://www.gnu.org/copyleft/gpl.html.
|
||||||
|
**
|
||||||
|
** Other Usage
|
||||||
|
** Alternatively, this file may be used in accordance with the terms and
|
||||||
|
** conditions contained in a signed written agreement between you and Nokia.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#include "qqnxservices.h"
|
||||||
|
|
||||||
|
#include <bps/navigator.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <sys/platform.h>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
QQnxServices::QQnxServices()
|
||||||
|
{
|
||||||
|
bps_initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
QQnxServices::~QQnxServices()
|
||||||
|
{
|
||||||
|
bps_shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QQnxServices::openUrl(const QUrl &url)
|
||||||
|
{
|
||||||
|
return navigatorInvoke(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QQnxServices::openDocument(const QUrl &url)
|
||||||
|
{
|
||||||
|
return navigatorInvoke(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QQnxServices::navigatorInvoke(const QUrl &url)
|
||||||
|
{
|
||||||
|
if (!url.isValid() || url.isRelative())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
int ret = navigator_invoke(url.toString().toUtf8(), 0);
|
||||||
|
|
||||||
|
return (ret == BPS_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
|
QT_END_NAMESPACE
|
@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/***************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
** Copyright (C) 2011 - 2012 Research In Motion
|
||||||
** Contact: http://www.qt-project.org/
|
** Contact: http://www.qt-project.org/
|
||||||
**
|
**
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
** This file is part of the plugins of the Qt Toolkit.
|
||||||
@ -39,53 +39,26 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef QXCBSHAREDGRAPHICSCACHE
|
#ifndef QQNXSERVICES_H
|
||||||
#define QXCBSHAREDGRAPHICSCACHE
|
#define QQNXSERVICES_H
|
||||||
|
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
#include <QtGui/QPlatformServices>
|
||||||
|
|
||||||
#include <QtGui/qplatformsharedgraphicscache_qpa.h>
|
|
||||||
|
|
||||||
QT_BEGIN_HEADER
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QXcbSharedBufferManager;
|
class QQnxServices : public QPlatformServices
|
||||||
class QXcbSharedGraphicsCache : public QPlatformSharedGraphicsCache
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
public:
|
public:
|
||||||
explicit QXcbSharedGraphicsCache(QObject *parent = 0);
|
QQnxServices();
|
||||||
|
~QQnxServices();
|
||||||
|
|
||||||
virtual void ensureCacheInitialized(const QByteArray &cacheId, BufferType bufferType,
|
bool openUrl(const QUrl &url);
|
||||||
PixelFormat pixelFormat);
|
bool openDocument(const QUrl &url);
|
||||||
|
|
||||||
virtual void requestItems(const QByteArray &cacheId, const QVector<quint32> &itemIds);
|
|
||||||
virtual void insertItems(const QByteArray &cacheId,
|
|
||||||
const QVector<quint32> &itemIds,
|
|
||||||
const QVector<QImage> &items);
|
|
||||||
virtual void releaseItems(const QByteArray &cacheId, const QVector<quint32> &itemIds);
|
|
||||||
|
|
||||||
virtual void serializeBuffer(void *bufferId, QByteArray *serializedData, int *fileDescriptor) const;
|
|
||||||
virtual uint textureIdForBuffer(void *bufferId);
|
|
||||||
virtual void referenceBuffer(void *bufferId);
|
|
||||||
virtual bool dereferenceBuffer(void *bufferId);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct ReadyItem {
|
bool navigatorInvoke(const QUrl &url);
|
||||||
QVector<quint32> itemIds;
|
|
||||||
QVector<QPoint> positions;
|
|
||||||
};
|
|
||||||
|
|
||||||
void processPendingItems();
|
|
||||||
|
|
||||||
QXcbSharedBufferManager *m_bufferManager;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
QT_END_HEADER
|
#endif // QQNXSERVICES_H
|
||||||
|
|
||||||
#endif // QT_USE_XCB_SHARED_GRAPHICS_CACHE
|
|
||||||
|
|
||||||
#endif // QXCBSHAREDGRAPHICSCACHE
|
|
@ -1,19 +1,16 @@
|
|||||||
SOURCES += \
|
SOURCES += \
|
||||||
$$PWD/qwindowsaccessibility.cpp
|
$$PWD/qwindowsmsaaaccessible.cpp \
|
||||||
|
$$PWD/qwindowsaccessibility.cpp \
|
||||||
|
$$PWD/comutils.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
$$PWD/qwindowsaccessibility.h
|
$$PWD/qwindowsmsaaaccessible.h \
|
||||||
|
$$PWD/qwindowsaccessibility.h \
|
||||||
!*g++* {
|
$$PWD/comutils.h
|
||||||
SOURCES += \
|
|
||||||
$$PWD/qwindowsmsaaaccessible.cpp \
|
|
||||||
$$PWD/iaccessible2.cpp \
|
|
||||||
$$PWD/comutils.cpp
|
|
||||||
|
|
||||||
HEADERS += \
|
|
||||||
$$PWD/qwindowsmsaaaccessible.h \
|
|
||||||
$$PWD/iaccessible2.h \
|
|
||||||
$$PWD/comutils.h
|
|
||||||
|
|
||||||
|
!*g++: {
|
||||||
|
SOURCES += $$PWD/iaccessible2.cpp
|
||||||
|
HEADERS += $$PWD/iaccessible2.h
|
||||||
include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
|
include(../../../../3rdparty/iaccessible2/iaccessible2.pri)
|
||||||
} # !g++
|
}
|
||||||
|
|
||||||
|
@ -167,81 +167,62 @@ HRESULT STDMETHODCALLTYPE AccessibleRelation::get_targets(
|
|||||||
**************************************************************/
|
**************************************************************/
|
||||||
HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryInterface(REFIID id, LPVOID *iface)
|
HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::QueryInterface(REFIID id, LPVOID *iface)
|
||||||
{
|
{
|
||||||
*iface = 0;
|
HRESULT hr = QWindowsMsaaAccessible::QueryInterface(id, iface);
|
||||||
|
if (!SUCCEEDED(hr)) {
|
||||||
QByteArray strIID = IIDToString(id);
|
if (id == IID_IAccessible2) {
|
||||||
if (!strIID.isEmpty()) {
|
*iface = (IAccessible2*)this;
|
||||||
QString ss; QDebug dbg(&ss); dbg << accessible;
|
} else if (id == IID_IAccessibleAction) {
|
||||||
accessibleDebug("QWindowsIA2Accessible::QI() - IID:%s, iface:%s ", strIID.constData(), qPrintable(ss));
|
if (accessible->actionInterface())
|
||||||
|
*iface = (IAccessibleAction*)this;
|
||||||
|
} else if (id == IID_IAccessibleComponent) {
|
||||||
|
*iface = (IAccessibleComponent*)this;
|
||||||
|
} else if (id == IID_IAccessibleEditableText) {
|
||||||
|
//if (accessible->editableTextInterface()) {
|
||||||
|
//*iface = (IAccessibleEditableText*)this;
|
||||||
|
//}
|
||||||
|
} else if (id == IID_IAccessibleHyperlink) {
|
||||||
|
//*iface = (IAccessibleHyperlink*)this;
|
||||||
|
} else if (id == IID_IAccessibleHypertext) {
|
||||||
|
//*iface = (IAccessibleHypertext*)this;
|
||||||
|
} else if (id == IID_IAccessibleImage) {
|
||||||
|
//*iface = (IAccessibleImage*)this;
|
||||||
|
} else if (id == IID_IAccessibleRelation) {
|
||||||
|
*iface = (IAccessibleRelation*)this;
|
||||||
|
} else if (id == IID_IAccessibleTable) {
|
||||||
|
//*iface = (IAccessibleTable*)this; // not supported
|
||||||
|
} else if (id == IID_IAccessibleTable2) {
|
||||||
|
if (accessible->tableInterface())
|
||||||
|
*iface = (IAccessibleTable2*)this;
|
||||||
|
} else if (id == IID_IAccessibleTableCell) {
|
||||||
|
if (accessible->tableCellInterface())
|
||||||
|
*iface = (IAccessibleTableCell*)this;
|
||||||
|
} else if (id == IID_IAccessibleText) {
|
||||||
|
if (accessible->textInterface())
|
||||||
|
*iface = (IAccessibleText*)this;
|
||||||
|
} else if (id == IID_IAccessibleValue) {
|
||||||
|
if (accessible->valueInterface())
|
||||||
|
*iface = (IAccessibleValue*)this;
|
||||||
|
}
|
||||||
|
if (*iface) {
|
||||||
|
AddRef();
|
||||||
|
hr = S_OK;
|
||||||
|
} else {
|
||||||
|
hr = E_NOINTERFACE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (id == IID_IUnknown) {
|
return hr;
|
||||||
*iface = (IUnknown*)(IDispatch*)this;
|
|
||||||
} else if (id == IID_IDispatch) {
|
|
||||||
*iface = (IDispatch*)this;
|
|
||||||
} else if (id == IID_IAccessible) {
|
|
||||||
*iface = (IAccessible*)this;
|
|
||||||
} else if (id == IID_IOleWindow) {
|
|
||||||
*iface = (IOleWindow*)this;
|
|
||||||
} else if (id == IID_IServiceProvider) {
|
|
||||||
*iface = (IServiceProvider*)this;
|
|
||||||
} else if (id == IID_IAccessible2) {
|
|
||||||
*iface = (IAccessible2*)this;
|
|
||||||
} else if (id == IID_IAccessibleAction) {
|
|
||||||
if (accessible->actionInterface())
|
|
||||||
*iface = (IAccessibleAction*)this;
|
|
||||||
} else if (id == IID_IAccessibleComponent) {
|
|
||||||
*iface = (IAccessibleComponent*)this;
|
|
||||||
} else if (id == IID_IAccessibleEditableText) {
|
|
||||||
//if (accessible->editableTextInterface()) {
|
|
||||||
//*iface = (IAccessibleEditableText*)this;
|
|
||||||
//}
|
|
||||||
} else if (id == IID_IAccessibleHyperlink) {
|
|
||||||
//*iface = (IAccessibleHyperlink*)this;
|
|
||||||
} else if (id == IID_IAccessibleHypertext) {
|
|
||||||
//*iface = (IAccessibleHypertext*)this;
|
|
||||||
} else if (id == IID_IAccessibleImage) {
|
|
||||||
//*iface = (IAccessibleImage*)this;
|
|
||||||
} else if (id == IID_IAccessibleRelation) {
|
|
||||||
*iface = (IAccessibleRelation*)this;
|
|
||||||
} else if (id == IID_IAccessibleTable) {
|
|
||||||
//*iface = (IAccessibleTable*)this; // not supported
|
|
||||||
} else if (id == IID_IAccessibleTable2) {
|
|
||||||
if (accessible->tableInterface())
|
|
||||||
*iface = (IAccessibleTable2*)this;
|
|
||||||
} else if (id == IID_IAccessibleTableCell) {
|
|
||||||
if (accessible->tableCellInterface())
|
|
||||||
*iface = (IAccessibleTableCell*)this;
|
|
||||||
} else if (id == IID_IAccessibleText) {
|
|
||||||
if (accessible->textInterface())
|
|
||||||
*iface = (IAccessibleText*)this;
|
|
||||||
} else if (id == IID_IAccessibleValue) {
|
|
||||||
if (accessible->valueInterface())
|
|
||||||
*iface = (IAccessibleValue*)this;
|
|
||||||
}
|
|
||||||
if (*iface) {
|
|
||||||
AddRef();
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
return E_NOINTERFACE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE QWindowsIA2Accessible::AddRef()
|
ULONG STDMETHODCALLTYPE QWindowsIA2Accessible::AddRef()
|
||||||
{
|
{
|
||||||
return ++ref;
|
return QWindowsMsaaAccessible::AddRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE QWindowsIA2Accessible::Release()
|
ULONG STDMETHODCALLTYPE QWindowsIA2Accessible::Release()
|
||||||
{
|
{
|
||||||
if (!--ref) {
|
return QWindowsMsaaAccessible::Release();
|
||||||
delete this;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return ref;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************\
|
/**************************************************************\
|
||||||
* *
|
* *
|
||||||
* IAccessible2 *
|
* IAccessible2 *
|
||||||
@ -1028,6 +1009,7 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_caretOffset(long *offset)
|
|||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_characterExtents(long offset,
|
HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_characterExtents(long offset,
|
||||||
enum IA2CoordinateType coordType,
|
enum IA2CoordinateType coordType,
|
||||||
long *x,
|
long *x,
|
||||||
@ -1037,9 +1019,8 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_characterExtents(long offse
|
|||||||
{
|
{
|
||||||
accessibleDebugClientCalls(accessible);
|
accessibleDebugClientCalls(accessible);
|
||||||
if (QAccessibleTextInterface *text = textInterface()) {
|
if (QAccessibleTextInterface *text = textInterface()) {
|
||||||
const QRect rect = text->characterRect(offset, (QAccessible2::CoordinateType)coordType);
|
QRect rect = text->characterRect(offset);
|
||||||
*x = rect.x();
|
mapFromScreenPos(coordType, rect.topLeft(), x, y);
|
||||||
*y = rect.y();
|
|
||||||
*width = rect.width();
|
*width = rect.width();
|
||||||
*height = rect.height();
|
*height = rect.height();
|
||||||
return S_OK;
|
return S_OK;
|
||||||
@ -1064,7 +1045,8 @@ HRESULT STDMETHODCALLTYPE QWindowsIA2Accessible::get_offsetAtPoint(long x,
|
|||||||
{
|
{
|
||||||
accessibleDebugClientCalls(accessible);
|
accessibleDebugClientCalls(accessible);
|
||||||
if (QAccessibleTextInterface *text = textInterface()) {
|
if (QAccessibleTextInterface *text = textInterface()) {
|
||||||
*offset = text->offsetAtPoint(QPoint(x,y), (QAccessible2::CoordinateType)coordType);
|
QPoint screenPos = mapToScreenPos(coordType, x, y);
|
||||||
|
*offset = text->offsetAtPoint(screenPos);
|
||||||
return (*offset >=0 ? S_OK : S_FALSE);
|
return (*offset >=0 ? S_OK : S_FALSE);
|
||||||
}
|
}
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
@ -1429,6 +1411,10 @@ uint QWindowsIA2Accessible::uniqueID() const
|
|||||||
|
|
||||||
QByteArray QWindowsIA2Accessible::IIDToString(REFIID id)
|
QByteArray QWindowsIA2Accessible::IIDToString(REFIID id)
|
||||||
{
|
{
|
||||||
|
QByteArray strGuid = QWindowsMsaaAccessible::IIDToString(id);
|
||||||
|
if (!strGuid.isEmpty())
|
||||||
|
return strGuid;
|
||||||
|
|
||||||
IF_EQUAL_RETURN_IIDSTRING(id, IID_IUnknown);
|
IF_EQUAL_RETURN_IIDSTRING(id, IID_IUnknown);
|
||||||
IF_EQUAL_RETURN_IIDSTRING(id, IID_IDispatch);
|
IF_EQUAL_RETURN_IIDSTRING(id, IID_IDispatch);
|
||||||
IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessible);
|
IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessible);
|
||||||
@ -1450,7 +1436,6 @@ QByteArray QWindowsIA2Accessible::IIDToString(REFIID id)
|
|||||||
IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleValue);
|
IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessibleValue);
|
||||||
|
|
||||||
// else...
|
// else...
|
||||||
QByteArray strGuid;
|
|
||||||
#if 0 // Can be useful for debugging, but normally we'd like to reduce the noise a bit...
|
#if 0 // Can be useful for debugging, but normally we'd like to reduce the noise a bit...
|
||||||
OLECHAR szGuid[39]={0};
|
OLECHAR szGuid[39]={0};
|
||||||
::StringFromGUID2(id, szGuid, 39);
|
::StringFromGUID2(id, szGuid, 39);
|
||||||
|
@ -66,9 +66,7 @@
|
|||||||
#include "AccessibleRole.h"
|
#include "AccessibleRole.h"
|
||||||
#include "AccessibleStates.h"
|
#include "AccessibleStates.h"
|
||||||
|
|
||||||
#ifdef Q_CC_MINGW
|
#include <servprov.h>
|
||||||
# include <servprov.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -229,14 +227,45 @@ private:
|
|||||||
return accessible->tableCellInterface();
|
return accessible->tableCellInterface();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\internal
|
||||||
|
\a screenPos is in screen relative position
|
||||||
|
\a x and \y (out) is in parent relative position if coordType == IA2_COORDTYPE_PARENT_RELATIVE
|
||||||
|
*/
|
||||||
|
void mapFromScreenPos(enum IA2CoordinateType coordType, const QPoint &screenPos, long *x, long *y) const {
|
||||||
|
if (coordType == IA2_COORDTYPE_PARENT_RELATIVE) {
|
||||||
|
// caller wants relative to parent
|
||||||
|
if (QAccessibleInterface *parent = accessible->parent()) {
|
||||||
|
const QRect parentScreenRect = parent->rect();
|
||||||
|
*x = parentScreenRect.x() - screenPos.x();
|
||||||
|
*y = parentScreenRect.y() - screenPos.y();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*x = screenPos.x();
|
||||||
|
*y = screenPos.y();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\internal
|
||||||
|
\a x and \y is in parent relative position if coordType == IA2_COORDTYPE_PARENT_RELATIVE
|
||||||
|
\return a screen relative position
|
||||||
|
*/
|
||||||
|
QPoint mapToScreenPos(enum IA2CoordinateType coordType, long x, long y) const {
|
||||||
|
if (coordType == IA2_COORDTYPE_PARENT_RELATIVE) {
|
||||||
|
if (QAccessibleInterface *parent = accessible->parent()) {
|
||||||
|
const QRect parentScreenRect = parent->rect();
|
||||||
|
return QPoint(parentScreenRect.x() + x, parentScreenRect.y() + y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QPoint(x,y);
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT getRelationsHelper(IAccessibleRelation **relations, int startIndex, long maxRelations, long *nRelations = 0);
|
HRESULT getRelationsHelper(IAccessibleRelation **relations, int startIndex, long maxRelations, long *nRelations = 0);
|
||||||
HRESULT wrapListOfCells(const QList<QAccessibleInterface*> &inputCells, IUnknown ***outputAccessibles, long *nCellCount);
|
HRESULT wrapListOfCells(const QList<QAccessibleInterface*> &inputCells, IUnknown ***outputAccessibles, long *nCellCount);
|
||||||
uint uniqueID() const;
|
uint uniqueID() const;
|
||||||
QByteArray IIDToString(REFIID id);
|
QByteArray IIDToString(REFIID id);
|
||||||
|
|
||||||
private:
|
|
||||||
ULONG ref;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**************************************************************\
|
/**************************************************************\
|
||||||
|
@ -56,11 +56,11 @@
|
|||||||
#include <QtGui/qguiapplication.h>
|
#include <QtGui/qguiapplication.h>
|
||||||
|
|
||||||
#include "qwindowsaccessibility.h"
|
#include "qwindowsaccessibility.h"
|
||||||
|
#ifdef Q_CC_MINGW
|
||||||
#ifndef Q_CC_MINGW
|
# include "qwindowsmsaaaccessible.h"
|
||||||
# include "iaccessible2.h"
|
#else
|
||||||
#endif // !Q_CC_MINGW
|
# include "iaccessible2.h"
|
||||||
|
#endif
|
||||||
#include "comutils.h"
|
#include "comutils.h"
|
||||||
|
|
||||||
#include <oleacc.h>
|
#include <oleacc.h>
|
||||||
@ -237,7 +237,11 @@ IAccessible *QWindowsAccessibility::wrap(QAccessibleInterface *acc)
|
|||||||
#else
|
#else
|
||||||
if (!acc)
|
if (!acc)
|
||||||
return 0;
|
return 0;
|
||||||
|
#ifdef Q_CC_MINGW
|
||||||
|
QWindowsMsaaAccessible *wacc = new QWindowsMsaaAccessible(acc);
|
||||||
|
#else
|
||||||
QWindowsIA2Accessible *wacc = new QWindowsIA2Accessible(acc);
|
QWindowsIA2Accessible *wacc = new QWindowsIA2Accessible(acc);
|
||||||
|
#endif
|
||||||
IAccessible *iacc = 0;
|
IAccessible *iacc = 0;
|
||||||
wacc->QueryInterface(IID_IAccessible, (void**)&iacc);
|
wacc->QueryInterface(IID_IAccessible, (void**)&iacc);
|
||||||
return iacc;
|
return iacc;
|
||||||
|
@ -224,6 +224,53 @@ void accessibleDebugClientCalls_helper(const char* funcName, const QAccessibleIn
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**************************************************************\
|
||||||
|
* *
|
||||||
|
* IUnknown *
|
||||||
|
* *
|
||||||
|
**************************************************************/
|
||||||
|
HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::QueryInterface(REFIID id, LPVOID *iface)
|
||||||
|
{
|
||||||
|
*iface = 0;
|
||||||
|
|
||||||
|
QByteArray strIID = IIDToString(id);
|
||||||
|
if (!strIID.isEmpty()) {
|
||||||
|
QString ss; QDebug dbg(&ss); dbg << accessible;
|
||||||
|
accessibleDebug("QWindowsIA2Accessible::QI() - IID:%s, iface:%s ", strIID.constData(), qPrintable(ss));
|
||||||
|
}
|
||||||
|
if (id == IID_IUnknown) {
|
||||||
|
*iface = (IUnknown*)(IDispatch*)this;
|
||||||
|
} else if (id == IID_IDispatch) {
|
||||||
|
*iface = (IDispatch*)this;
|
||||||
|
} else if (id == IID_IAccessible) {
|
||||||
|
*iface = (IAccessible*)this;
|
||||||
|
} else if (id == IID_IOleWindow) {
|
||||||
|
*iface = (IOleWindow*)this;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*iface) {
|
||||||
|
AddRef();
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return E_NOINTERFACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG STDMETHODCALLTYPE QWindowsMsaaAccessible::AddRef()
|
||||||
|
{
|
||||||
|
return ++ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
ULONG STDMETHODCALLTYPE QWindowsMsaaAccessible::Release()
|
||||||
|
{
|
||||||
|
if (!--ref) {
|
||||||
|
delete this;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return ref;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
IDispatch
|
IDispatch
|
||||||
*/
|
*/
|
||||||
@ -1208,6 +1255,17 @@ HRESULT STDMETHODCALLTYPE QWindowsMsaaAccessible::ContextSensitiveHelp(BOOL)
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define IF_EQUAL_RETURN_IIDSTRING(id, iid) if (id == iid) return QByteArray(#iid)
|
||||||
|
QByteArray QWindowsMsaaAccessible::IIDToString(REFIID id)
|
||||||
|
{
|
||||||
|
IF_EQUAL_RETURN_IIDSTRING(id, IID_IUnknown);
|
||||||
|
IF_EQUAL_RETURN_IIDSTRING(id, IID_IDispatch);
|
||||||
|
IF_EQUAL_RETURN_IIDSTRING(id, IID_IAccessible);
|
||||||
|
IF_EQUAL_RETURN_IIDSTRING(id, IID_IOleWindow);
|
||||||
|
|
||||||
|
return QByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
#endif //QT_NO_ACCESSIBILITY
|
#endif //QT_NO_ACCESSIBILITY
|
||||||
|
@ -43,12 +43,19 @@
|
|||||||
|
|
||||||
#include <QtCore/QtConfig>
|
#include <QtCore/QtConfig>
|
||||||
#ifndef QT_NO_ACCESSIBILITY
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
#include "../qtwindows_additional.h"
|
#include "../qtwindows_additional.h"
|
||||||
#include <oleacc.h>
|
|
||||||
#include "Accessible2.h"
|
|
||||||
#include <QtCore/qsharedpointer.h>
|
#include <QtCore/qsharedpointer.h>
|
||||||
#include <QtGui/qaccessible.h>
|
#include <QtGui/qaccessible.h>
|
||||||
|
#ifndef Q_CC_MINGW
|
||||||
|
# include <oleacc.h>
|
||||||
|
# include "Accessible2.h" // IAccessible2 inherits from IAccessible
|
||||||
|
#else
|
||||||
|
// MinGW
|
||||||
|
# include <basetyps.h>
|
||||||
|
# include <oleacc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -74,7 +81,13 @@ QWindow *window_helper(const QAccessibleInterface *iface);
|
|||||||
/**************************************************************\
|
/**************************************************************\
|
||||||
* QWindowsAccessible *
|
* QWindowsAccessible *
|
||||||
**************************************************************/
|
**************************************************************/
|
||||||
class QWindowsMsaaAccessible : public IAccessible2, public IOleWindow
|
class QWindowsMsaaAccessible : public
|
||||||
|
#ifdef Q_CC_MINGW
|
||||||
|
IAccessible
|
||||||
|
#else
|
||||||
|
IAccessible2
|
||||||
|
#endif
|
||||||
|
, public IOleWindow
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QWindowsMsaaAccessible(QAccessibleInterface *a)
|
QWindowsMsaaAccessible(QAccessibleInterface *a)
|
||||||
@ -87,6 +100,10 @@ public:
|
|||||||
delete accessible;
|
delete accessible;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* IUnknown */
|
||||||
|
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID *);
|
||||||
|
ULONG STDMETHODCALLTYPE AddRef();
|
||||||
|
ULONG STDMETHODCALLTYPE Release();
|
||||||
|
|
||||||
/* IDispatch */
|
/* IDispatch */
|
||||||
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(unsigned int *);
|
HRESULT STDMETHODCALLTYPE GetTypeInfoCount(unsigned int *);
|
||||||
@ -124,12 +141,18 @@ public:
|
|||||||
HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
|
HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual QByteArray IIDToString(REFIID id);
|
||||||
|
|
||||||
QAccessibleInterface *accessible;
|
QAccessibleInterface *accessible;
|
||||||
|
|
||||||
QAIPointer childPointer(VARIANT varID)
|
QAIPointer childPointer(VARIANT varID)
|
||||||
{
|
{
|
||||||
return QAIPointer(accessible->child(varID.lVal - 1));
|
return QAIPointer(accessible->child(varID.lVal - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ULONG ref;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
#include "qxcbnativeinterface.h"
|
#include "qxcbnativeinterface.h"
|
||||||
#include "qxcbclipboard.h"
|
#include "qxcbclipboard.h"
|
||||||
#include "qxcbdrag.h"
|
#include "qxcbdrag.h"
|
||||||
#include "qxcbsharedgraphicscache.h"
|
|
||||||
|
|
||||||
#include <xcb/xcb.h>
|
#include <xcb/xcb.h>
|
||||||
|
|
||||||
@ -118,10 +117,6 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters)
|
|||||||
#ifndef QT_NO_ACCESSIBILITY
|
#ifndef QT_NO_ACCESSIBILITY
|
||||||
m_accessibility.reset(new QPlatformAccessibility());
|
m_accessibility.reset(new QPlatformAccessibility());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
|
||||||
m_sharedGraphicsCache.reset(new QXcbSharedGraphicsCache);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QXcbIntegration::~QXcbIntegration()
|
QXcbIntegration::~QXcbIntegration()
|
||||||
@ -203,10 +198,6 @@ QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *wind
|
|||||||
bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
||||||
{
|
{
|
||||||
switch (cap) {
|
switch (cap) {
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
|
||||||
case SharedGraphicsCache: return true;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case ThreadedPixmaps: return true;
|
case ThreadedPixmaps: return true;
|
||||||
case OpenGL: return true;
|
case OpenGL: return true;
|
||||||
case ThreadedOpenGL: return false;
|
case ThreadedOpenGL: return false;
|
||||||
@ -257,26 +248,6 @@ QPlatformAccessibility *QXcbIntegration::accessibility() const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
|
||||||
static bool sharedGraphicsCacheDisabled()
|
|
||||||
{
|
|
||||||
static const char *environmentVariable = "QT_DISABLE_SHARED_CACHE";
|
|
||||||
static bool cacheDisabled = !qgetenv(environmentVariable).isEmpty()
|
|
||||||
&& qgetenv(environmentVariable).toInt() != 0;
|
|
||||||
return cacheDisabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
QPlatformSharedGraphicsCache *QXcbIntegration::createPlatformSharedGraphicsCache(const char *cacheId) const
|
|
||||||
{
|
|
||||||
Q_UNUSED(cacheId);
|
|
||||||
|
|
||||||
if (sharedGraphicsCacheDisabled())
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return m_sharedGraphicsCache.data();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QPlatformServices *QXcbIntegration::services() const
|
QPlatformServices *QXcbIntegration::services() const
|
||||||
{
|
{
|
||||||
return m_services.data();
|
return m_services.data();
|
||||||
|
@ -81,10 +81,6 @@ public:
|
|||||||
QPlatformAccessibility *accessibility() const;
|
QPlatformAccessibility *accessibility() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
|
||||||
QPlatformSharedGraphicsCache *createPlatformSharedGraphicsCache(const char *cacheId) const;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QPlatformServices *services() const;
|
QPlatformServices *services() const;
|
||||||
|
|
||||||
QStringList themeNames() const;
|
QStringList themeNames() const;
|
||||||
@ -103,10 +99,6 @@ private:
|
|||||||
QScopedPointer<QPlatformAccessibility> m_accessibility;
|
QScopedPointer<QPlatformAccessibility> m_accessibility;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
|
||||||
QScopedPointer<QPlatformSharedGraphicsCache> m_sharedGraphicsCache;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QScopedPointer<QPlatformServices> m_services;
|
QScopedPointer<QPlatformServices> m_services;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,640 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** This file may be used under the terms of the GNU Lesser General Public
|
|
||||||
** License version 2.1 as published by the Free Software Foundation and
|
|
||||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
|
||||||
** file. Please review the following information to ensure the GNU Lesser
|
|
||||||
** General Public License version 2.1 requirements will be met:
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Nokia gives you certain additional
|
|
||||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU General
|
|
||||||
** Public License version 3.0 as published by the Free Software Foundation
|
|
||||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
|
||||||
** file. Please review the following information to ensure the GNU General
|
|
||||||
** Public License version 3.0 requirements will be met:
|
|
||||||
** http://www.gnu.org/copyleft/gpl.html.
|
|
||||||
**
|
|
||||||
** Other Usage
|
|
||||||
** Alternatively, this file may be used in accordance with the terms and
|
|
||||||
** conditions contained in a signed written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
|
||||||
|
|
||||||
#include "qxcbsharedbuffermanager.h"
|
|
||||||
|
|
||||||
#include <QtCore/quuid.h>
|
|
||||||
#include <QtGui/qimage.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#if !defined(SHAREDGRAPHICSCACHE_MAX_MEMORY_USED)
|
|
||||||
# define SHAREDGRAPHICSCACHE_MAX_MEMORY_USED 16 * 1024 * 1024 // 16 MB limit
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SHAREDGRAPHICSCACHE_MAX_TEXTURES_PER_CACHE)
|
|
||||||
# define SHAREDGRAPHICSCACHE_MAX_TEXTURES_PER_CACHE 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(SHAREDGRAPHICSCACHE_TEXTURE_SIZE)
|
|
||||||
# define SHAREDGRAPHICSCACHE_TEXTURE_SIZE 2048
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define SHAREDBUFFERMANAGER_DEBUG 1
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
QXcbSharedBufferManager::QXcbSharedBufferManager()
|
|
||||||
: m_memoryUsed(0)
|
|
||||||
, m_mostRecentlyUsed(0)
|
|
||||||
, m_leastRecentlyUsed(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
QXcbSharedBufferManager::~QXcbSharedBufferManager()
|
|
||||||
{
|
|
||||||
{
|
|
||||||
QHash<QByteArray, Buffer *>::const_iterator it = m_buffers.constBegin();
|
|
||||||
while (it != m_buffers.constEnd()) {
|
|
||||||
Buffer *buffer = it.value();
|
|
||||||
delete buffer;
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
QHash<QByteArray, Items *>::const_iterator it = m_items.constBegin();
|
|
||||||
while (it != m_items.constEnd()) {
|
|
||||||
Items *items = it.value();
|
|
||||||
QHash<quint32, Item *>::const_iterator itemIt = items->items.constBegin();
|
|
||||||
while (itemIt != items->items.constEnd()) {
|
|
||||||
delete itemIt.value();
|
|
||||||
++itemIt;
|
|
||||||
}
|
|
||||||
delete it.value();
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::getBufferForItem(const QByteArray &cacheId, quint32 itemId,
|
|
||||||
Buffer **buffer, int *x, int *y) const
|
|
||||||
{
|
|
||||||
Q_ASSERT_X(m_currentCacheId.isEmpty(), Q_FUNC_INFO,
|
|
||||||
"Call endSharedBufferAction before accessing data");
|
|
||||||
|
|
||||||
Q_ASSERT(buffer != 0);
|
|
||||||
Q_ASSERT(x != 0);
|
|
||||||
Q_ASSERT(y != 0);
|
|
||||||
|
|
||||||
Items *items = itemsForCache(cacheId);
|
|
||||||
Item *item = items->items.value(itemId);
|
|
||||||
if (item != 0) {
|
|
||||||
*buffer = item->buffer;
|
|
||||||
*x = item->x;
|
|
||||||
*y = item->y;
|
|
||||||
} else {
|
|
||||||
*buffer = 0;
|
|
||||||
*x = -1;
|
|
||||||
*y = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QPair<QByteArray, int> QXcbSharedBufferManager::serializeBuffer(QSharedMemory *buffer) const
|
|
||||||
{
|
|
||||||
Q_ASSERT_X(m_currentCacheId.isEmpty(), Q_FUNC_INFO,
|
|
||||||
"Call endSharedBufferAction before accessing data");
|
|
||||||
|
|
||||||
return qMakePair(buffer->key().toLatin1(), 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::beginSharedBufferAction(const QByteArray &cacheId)
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::beginSharedBufferAction() called for %s", cacheId.constData());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_ASSERT(m_currentCacheId.isEmpty());
|
|
||||||
Q_ASSERT(!cacheId.isEmpty());
|
|
||||||
|
|
||||||
m_pendingInvalidatedItems.clear();
|
|
||||||
m_pendingReadyItems.clear();
|
|
||||||
m_pendingMissingItems.clear();
|
|
||||||
|
|
||||||
m_currentCacheId = cacheId;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::requestItems(const QSet<quint32> &itemIds)
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::requestItems for %d items", itemIds.size());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_ASSERT_X(!m_currentCacheId.isEmpty(), Q_FUNC_INFO,
|
|
||||||
"Call beginSharedBufferAction before requesting items");
|
|
||||||
Items *items = itemsForCache(m_currentCacheId);
|
|
||||||
|
|
||||||
QSet<quint32>::const_iterator it = itemIds.constBegin();
|
|
||||||
while (it != itemIds.constEnd()) {
|
|
||||||
if (items->items.contains(*it))
|
|
||||||
m_pendingReadyItems[m_currentCacheId].insert(*it);
|
|
||||||
else
|
|
||||||
m_pendingMissingItems[m_currentCacheId].insert(*it);
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::releaseItems(const QSet<quint32> &itemIds)
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::releaseItems for %d items", itemIds.size());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Items *items = itemsForCache(m_currentCacheId);
|
|
||||||
|
|
||||||
QSet<quint32>::const_iterator it;
|
|
||||||
for (it = itemIds.constBegin(); it != itemIds.constEnd(); ++it) {
|
|
||||||
Item *item = items->items.value(*it);
|
|
||||||
if (item != 0)
|
|
||||||
pushItemToBack(items, item);
|
|
||||||
|
|
||||||
m_pendingReadyItems[m_currentCacheId].remove(*it);
|
|
||||||
m_pendingMissingItems[m_currentCacheId].remove(*it);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::insertItem(quint32 itemId, uchar *data,
|
|
||||||
int itemWidth, int itemHeight)
|
|
||||||
{
|
|
||||||
Q_ASSERT_X(!m_currentCacheId.isEmpty(), Q_FUNC_INFO,
|
|
||||||
"Call beginSharedBufferAction before inserting items");
|
|
||||||
Items *items = itemsForCache(m_currentCacheId);
|
|
||||||
|
|
||||||
if (!items->items.contains(itemId)) {
|
|
||||||
Buffer *sharedBuffer = 0;
|
|
||||||
int x = 0;
|
|
||||||
int y = 0;
|
|
||||||
|
|
||||||
findAvailableBuffer(itemWidth, itemHeight, &sharedBuffer, &x, &y);
|
|
||||||
copyIntoBuffer(sharedBuffer, x, y, itemWidth, itemHeight, data);
|
|
||||||
|
|
||||||
// static int counter=0;
|
|
||||||
// QString fileName = QString::fromLatin1("buffer%1.png").arg(counter++);
|
|
||||||
// saveBuffer(sharedBuffer, fileName);
|
|
||||||
|
|
||||||
Item *item = new Item;
|
|
||||||
item->itemId = itemId;
|
|
||||||
item->buffer = sharedBuffer;
|
|
||||||
item->x = x;
|
|
||||||
item->y = y;
|
|
||||||
|
|
||||||
items->items[itemId] = item;
|
|
||||||
|
|
||||||
touchItem(items, item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::endSharedBufferAction()
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::endSharedBufferAction() called for %s",
|
|
||||||
m_currentCacheId.constData());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_ASSERT(!m_currentCacheId.isEmpty());
|
|
||||||
|
|
||||||
// Do an extra validation pass on the invalidated items since they may have been re-inserted
|
|
||||||
// after they were invalidated
|
|
||||||
if (m_pendingInvalidatedItems.contains(m_currentCacheId)) {
|
|
||||||
QSet<quint32> &invalidatedItems = m_pendingInvalidatedItems[m_currentCacheId];
|
|
||||||
QSet<quint32>::iterator it = invalidatedItems.begin();
|
|
||||||
while (it != invalidatedItems.end()) {
|
|
||||||
Items *items = m_items.value(m_currentCacheId);
|
|
||||||
|
|
||||||
if (items->items.contains(*it)) {
|
|
||||||
m_pendingReadyItems[m_currentCacheId].insert(*it);
|
|
||||||
it = invalidatedItems.erase(it);
|
|
||||||
} else {
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_currentCacheId.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::pushItemToBack(Items *items, Item *item)
|
|
||||||
{
|
|
||||||
if (items->leastRecentlyUsed == item)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (item->next != 0)
|
|
||||||
item->next->prev = item->prev;
|
|
||||||
if (item->prev != 0)
|
|
||||||
item->prev->next = item->next;
|
|
||||||
|
|
||||||
if (items->mostRecentlyUsed == item)
|
|
||||||
items->mostRecentlyUsed = item->prev;
|
|
||||||
|
|
||||||
if (items->leastRecentlyUsed != 0)
|
|
||||||
items->leastRecentlyUsed->prev = item;
|
|
||||||
|
|
||||||
item->prev = 0;
|
|
||||||
item->next = items->leastRecentlyUsed;
|
|
||||||
items->leastRecentlyUsed = item;
|
|
||||||
if (items->mostRecentlyUsed == 0)
|
|
||||||
items->mostRecentlyUsed = item;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::touchItem(Items *items, Item *item)
|
|
||||||
{
|
|
||||||
if (items->mostRecentlyUsed == item)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (item->next != 0)
|
|
||||||
item->next->prev = item->prev;
|
|
||||||
if (item->prev != 0)
|
|
||||||
item->prev->next = item->next;
|
|
||||||
|
|
||||||
if (items->leastRecentlyUsed == item)
|
|
||||||
items->leastRecentlyUsed = item->next;
|
|
||||||
|
|
||||||
if (items->mostRecentlyUsed != 0)
|
|
||||||
items->mostRecentlyUsed->next = item;
|
|
||||||
|
|
||||||
item->next = 0;
|
|
||||||
item->prev = items->mostRecentlyUsed;
|
|
||||||
items->mostRecentlyUsed = item;
|
|
||||||
if (items->leastRecentlyUsed == 0)
|
|
||||||
items->leastRecentlyUsed = item;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::deleteItem(Items *items, Item *item)
|
|
||||||
{
|
|
||||||
Q_ASSERT(items != 0);
|
|
||||||
Q_ASSERT(item != 0);
|
|
||||||
|
|
||||||
if (items->mostRecentlyUsed == item)
|
|
||||||
items->mostRecentlyUsed = item->prev;
|
|
||||||
if (items->leastRecentlyUsed == item)
|
|
||||||
items->leastRecentlyUsed = item->next;
|
|
||||||
|
|
||||||
if (item->next != 0)
|
|
||||||
item->next->prev = item->prev;
|
|
||||||
if (item->prev != 0)
|
|
||||||
item->prev->next = item->next;
|
|
||||||
|
|
||||||
m_pendingInvalidatedItems[items->cacheId].insert(item->itemId);
|
|
||||||
|
|
||||||
{
|
|
||||||
QHash<quint32, Item *>::iterator it = items->items.find(item->itemId);
|
|
||||||
while (it != items->items.end() && it.value()->itemId == item->itemId)
|
|
||||||
it = items->items.erase(it);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::recycleItem(Buffer **sharedBuffer, int *glyphX, int *glyphY)
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::recycleItem() called for %s", m_currentCacheId.constData());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Items *items = itemsForCache(m_currentCacheId);
|
|
||||||
|
|
||||||
Item *recycledItem = items->leastRecentlyUsed;
|
|
||||||
Q_ASSERT(recycledItem != 0);
|
|
||||||
|
|
||||||
*sharedBuffer = recycledItem->buffer;
|
|
||||||
*glyphX = recycledItem->x;
|
|
||||||
*glyphY = recycledItem->y;
|
|
||||||
|
|
||||||
deleteItem(items, recycledItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::touchBuffer(Buffer *buffer)
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::touchBuffer() called for %s", buffer->cacheId.constData());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (buffer == m_mostRecentlyUsed)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (buffer->next != 0)
|
|
||||||
buffer->next->prev = buffer->prev;
|
|
||||||
if (buffer->prev != 0)
|
|
||||||
buffer->prev->next = buffer->next;
|
|
||||||
|
|
||||||
if (m_leastRecentlyUsed == buffer)
|
|
||||||
m_leastRecentlyUsed = buffer->next;
|
|
||||||
|
|
||||||
buffer->next = 0;
|
|
||||||
buffer->prev = m_mostRecentlyUsed;
|
|
||||||
if (m_mostRecentlyUsed != 0)
|
|
||||||
m_mostRecentlyUsed->next = buffer;
|
|
||||||
if (m_leastRecentlyUsed == 0)
|
|
||||||
m_leastRecentlyUsed = buffer;
|
|
||||||
m_mostRecentlyUsed = buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::deleteLeastRecentlyUsed()
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::deleteLeastRecentlyUsed() called");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (m_leastRecentlyUsed == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
Buffer *old = m_leastRecentlyUsed;
|
|
||||||
m_leastRecentlyUsed = old->next;
|
|
||||||
m_leastRecentlyUsed->prev = 0;
|
|
||||||
|
|
||||||
QByteArray cacheId = old->cacheId;
|
|
||||||
Items *items = itemsForCache(cacheId);
|
|
||||||
|
|
||||||
QHash<quint32, Item *>::iterator it = items->items.begin();
|
|
||||||
while (it != items->items.end()) {
|
|
||||||
Item *item = it.value();
|
|
||||||
if (item->buffer == old) {
|
|
||||||
deleteItem(items, item);
|
|
||||||
it = items->items.erase(it);
|
|
||||||
} else {
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
m_buffers.remove(cacheId, old);
|
|
||||||
m_memoryUsed -= old->width * old->height * old->bytesPerPixel;
|
|
||||||
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::deleteLeastRecentlyUsed: Memory used: %d / %d (%6.2f %%)",
|
|
||||||
m_memoryUsed, SHAREDGRAPHICSCACHE_MAX_MEMORY_USED,
|
|
||||||
100.0f * float(m_memoryUsed) / float(SHAREDGRAPHICSCACHE_MAX_MEMORY_USED));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
delete old;
|
|
||||||
}
|
|
||||||
|
|
||||||
QXcbSharedBufferManager::Buffer *QXcbSharedBufferManager::createNewBuffer(const QByteArray &cacheId,
|
|
||||||
int heightRequired)
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::createNewBuffer() called for %s", cacheId.constData());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ###
|
|
||||||
// if (bufferCount of cacheId == SHAREDGRAPHICACHE_MAX_TEXTURES_PER_CACHE)
|
|
||||||
// deleteLeastRecentlyUsedBufferForCache(cacheId);
|
|
||||||
|
|
||||||
// ### Take pixel format into account
|
|
||||||
while (m_memoryUsed + SHAREDGRAPHICSCACHE_TEXTURE_SIZE * heightRequired >= SHAREDGRAPHICSCACHE_MAX_MEMORY_USED)
|
|
||||||
deleteLeastRecentlyUsed();
|
|
||||||
|
|
||||||
Buffer *buffer = allocateBuffer(SHAREDGRAPHICSCACHE_TEXTURE_SIZE, heightRequired);
|
|
||||||
buffer->cacheId = cacheId;
|
|
||||||
|
|
||||||
buffer->currentLineMaxHeight = 0;
|
|
||||||
m_buffers.insert(cacheId, buffer);
|
|
||||||
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int qt_next_power_of_two(int v)
|
|
||||||
{
|
|
||||||
v--;
|
|
||||||
v |= v >> 1;
|
|
||||||
v |= v >> 2;
|
|
||||||
v |= v >> 4;
|
|
||||||
v |= v >> 8;
|
|
||||||
v |= v >> 16;
|
|
||||||
++v;
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
|
|
||||||
QXcbSharedBufferManager::Buffer *QXcbSharedBufferManager::resizeBuffer(Buffer *oldBuffer, const QSize &newSize)
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::resizeBuffer() called for %s (current size: %dx%d, new size: %dx%d)",
|
|
||||||
oldBuffer->cacheId.constData(), oldBuffer->width, oldBuffer->height,
|
|
||||||
newSize.width(), newSize.height());
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Remove old buffer from lists to avoid deleting it under our feet
|
|
||||||
if (m_leastRecentlyUsed == oldBuffer)
|
|
||||||
m_leastRecentlyUsed = oldBuffer->next;
|
|
||||||
if (m_mostRecentlyUsed == oldBuffer)
|
|
||||||
m_mostRecentlyUsed = oldBuffer->prev;
|
|
||||||
|
|
||||||
if (oldBuffer->prev != 0)
|
|
||||||
oldBuffer->prev->next = oldBuffer->next;
|
|
||||||
if (oldBuffer->next != 0)
|
|
||||||
oldBuffer->next->prev = oldBuffer->prev;
|
|
||||||
|
|
||||||
m_memoryUsed -= oldBuffer->width * oldBuffer->height * oldBuffer->bytesPerPixel;
|
|
||||||
m_buffers.remove(oldBuffer->cacheId, oldBuffer);
|
|
||||||
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::resizeBuffer: Memory used: %d / %d (%6.2f %%)",
|
|
||||||
m_memoryUsed, SHAREDGRAPHICSCACHE_MAX_MEMORY_USED,
|
|
||||||
100.0f * float(m_memoryUsed) / float(SHAREDGRAPHICSCACHE_MAX_MEMORY_USED));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Buffer *resizedBuffer = createNewBuffer(oldBuffer->cacheId, newSize.height());
|
|
||||||
copyIntoBuffer(resizedBuffer, 0, 0, oldBuffer->width, oldBuffer->height,
|
|
||||||
reinterpret_cast<uchar *>(oldBuffer->buffer->data()));
|
|
||||||
|
|
||||||
resizedBuffer->currentLineMaxHeight = oldBuffer->currentLineMaxHeight;
|
|
||||||
|
|
||||||
Items *items = itemsForCache(oldBuffer->cacheId);
|
|
||||||
QHash<quint32, Item *>::const_iterator it = items->items.constBegin();
|
|
||||||
while (it != items->items.constEnd()) {
|
|
||||||
Item *item = it.value();
|
|
||||||
if (item->buffer == oldBuffer) {
|
|
||||||
m_pendingReadyItems[oldBuffer->cacheId].insert(item->itemId);
|
|
||||||
item->buffer = resizedBuffer;
|
|
||||||
}
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
|
|
||||||
resizedBuffer->nextX = oldBuffer->nextX;
|
|
||||||
resizedBuffer->nextY = oldBuffer->nextY;
|
|
||||||
resizedBuffer->currentLineMaxHeight = oldBuffer->currentLineMaxHeight;
|
|
||||||
|
|
||||||
delete oldBuffer;
|
|
||||||
return resizedBuffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::findAvailableBuffer(int itemWidth, int itemHeight,
|
|
||||||
Buffer **sharedBuffer, int *glyphX, int *glyphY)
|
|
||||||
{
|
|
||||||
Q_ASSERT(sharedBuffer != 0);
|
|
||||||
Q_ASSERT(glyphX != 0);
|
|
||||||
Q_ASSERT(glyphY != 0);
|
|
||||||
|
|
||||||
QMultiHash<QByteArray, Buffer *>::iterator it = m_buffers.find(m_currentCacheId);
|
|
||||||
|
|
||||||
int bufferCount = 0;
|
|
||||||
while (it != m_buffers.end() && it.key() == m_currentCacheId) {
|
|
||||||
Buffer *buffer = it.value();
|
|
||||||
|
|
||||||
int x = buffer->nextX;
|
|
||||||
int y = buffer->nextY;
|
|
||||||
int width = buffer->width;
|
|
||||||
int height = buffer->height;
|
|
||||||
|
|
||||||
if (x + itemWidth <= width && y + itemHeight <= height) {
|
|
||||||
// There is space on the current line, put the item there
|
|
||||||
buffer->currentLineMaxHeight = qMax(buffer->currentLineMaxHeight, itemHeight);
|
|
||||||
*sharedBuffer = buffer;
|
|
||||||
*glyphX = x;
|
|
||||||
*glyphY = y;
|
|
||||||
|
|
||||||
buffer->nextX += itemWidth;
|
|
||||||
|
|
||||||
return;
|
|
||||||
} else if (itemWidth <= width && y + buffer->currentLineMaxHeight + itemHeight <= height) {
|
|
||||||
// There is space for a new line, put the item on the new line
|
|
||||||
buffer->nextX = 0;
|
|
||||||
buffer->nextY += buffer->currentLineMaxHeight;
|
|
||||||
buffer->currentLineMaxHeight = 0;
|
|
||||||
|
|
||||||
*sharedBuffer = buffer;
|
|
||||||
*glyphX = buffer->nextX;
|
|
||||||
*glyphY = buffer->nextY;
|
|
||||||
|
|
||||||
buffer->nextX += itemWidth;
|
|
||||||
|
|
||||||
return;
|
|
||||||
} else if (y + buffer->currentLineMaxHeight + itemHeight <= SHAREDGRAPHICSCACHE_TEXTURE_SIZE) {
|
|
||||||
// There is space if we resize the buffer, so we do that
|
|
||||||
int newHeight = qt_next_power_of_two(y + buffer->currentLineMaxHeight + itemHeight);
|
|
||||||
buffer = resizeBuffer(buffer, QSize(width, newHeight));
|
|
||||||
|
|
||||||
buffer->nextX = 0;
|
|
||||||
buffer->nextY += buffer->currentLineMaxHeight;
|
|
||||||
buffer->currentLineMaxHeight = 0;
|
|
||||||
|
|
||||||
*sharedBuffer = buffer;
|
|
||||||
*glyphX = buffer->nextX;
|
|
||||||
*glyphY = buffer->nextY;
|
|
||||||
|
|
||||||
buffer->nextX += itemWidth;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bufferCount++;
|
|
||||||
++it;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (bufferCount == SHAREDGRAPHICSCACHE_MAX_TEXTURES_PER_CACHE) {
|
|
||||||
// There is no space in any buffer, and there is no space for a new buffer
|
|
||||||
// recycle an old item
|
|
||||||
recycleItem(sharedBuffer, glyphX, glyphY);
|
|
||||||
} else {
|
|
||||||
// Create a new buffer for the item
|
|
||||||
*sharedBuffer = createNewBuffer(m_currentCacheId, qt_next_power_of_two(itemHeight));
|
|
||||||
if (*sharedBuffer == 0) {
|
|
||||||
Q_ASSERT(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
*glyphX = (*sharedBuffer)->nextX;
|
|
||||||
*glyphY = (*sharedBuffer)->nextY;
|
|
||||||
|
|
||||||
(*sharedBuffer)->nextX += itemWidth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QXcbSharedBufferManager::Buffer *QXcbSharedBufferManager::allocateBuffer(int width, int height)
|
|
||||||
{
|
|
||||||
Buffer *buffer = new Buffer;
|
|
||||||
buffer->nextX = 0;
|
|
||||||
buffer->nextY = 0;
|
|
||||||
buffer->width = width;
|
|
||||||
buffer->height = height;
|
|
||||||
buffer->bytesPerPixel = 1; // ### Use pixel format here
|
|
||||||
|
|
||||||
buffer->buffer = new QSharedMemory(QUuid::createUuid().toString());
|
|
||||||
bool ok = buffer->buffer->create(buffer->width * buffer->height * buffer->bytesPerPixel,
|
|
||||||
QSharedMemory::ReadWrite);
|
|
||||||
if (!ok) {
|
|
||||||
qWarning("QXcbSharedBufferManager::findAvailableBuffer: Can't create new buffer (%s)",
|
|
||||||
qPrintable(buffer->buffer->errorString()));
|
|
||||||
delete buffer;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
qMemSet(buffer->buffer->data(), 0, buffer->buffer->size());
|
|
||||||
|
|
||||||
m_memoryUsed += buffer->width * buffer->height * buffer->bytesPerPixel;
|
|
||||||
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::allocateBuffer: Memory used: %d / %d (%6.2f %%)",
|
|
||||||
int(m_memoryUsed), int(SHAREDGRAPHICSCACHE_MAX_MEMORY_USED),
|
|
||||||
100.0f * float(m_memoryUsed) / float(SHAREDGRAPHICSCACHE_MAX_MEMORY_USED));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedBufferManager::copyIntoBuffer(Buffer *buffer,
|
|
||||||
int bufferX, int bufferY, int width, int height,
|
|
||||||
uchar *data)
|
|
||||||
{
|
|
||||||
#if defined(SHAREDBUFFERMANAGER_DEBUG)
|
|
||||||
qDebug("QXcbSharedBufferManager::copyIntoBuffer() called for %s (coords: %d, %d)",
|
|
||||||
buffer->cacheId.constData(), bufferX, bufferY);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_ASSERT(bufferX >= 0);
|
|
||||||
Q_ASSERT(bufferX + width <= buffer->width);
|
|
||||||
Q_ASSERT(bufferY >= 0);
|
|
||||||
Q_ASSERT(bufferY + height <= buffer->height);
|
|
||||||
|
|
||||||
uchar *dest = reinterpret_cast<uchar *>(buffer->buffer->data());
|
|
||||||
dest += bufferX + bufferY * buffer->width;
|
|
||||||
for (int y=0; y<height; ++y) {
|
|
||||||
qMemCopy(dest, data, width);
|
|
||||||
|
|
||||||
data += width;
|
|
||||||
dest += buffer->width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QXcbSharedBufferManager::Items *QXcbSharedBufferManager::itemsForCache(const QByteArray &cacheId) const
|
|
||||||
{
|
|
||||||
Items *items = m_items.value(cacheId);
|
|
||||||
if (items == 0) {
|
|
||||||
items = new Items;
|
|
||||||
items->cacheId = cacheId;
|
|
||||||
m_items[cacheId] = items;
|
|
||||||
}
|
|
||||||
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QT_USE_XCB_SHARED_GRAPHICS_CACHE
|
|
@ -1,215 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** This file may be used under the terms of the GNU Lesser General Public
|
|
||||||
** License version 2.1 as published by the Free Software Foundation and
|
|
||||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
|
||||||
** file. Please review the following information to ensure the GNU Lesser
|
|
||||||
** General Public License version 2.1 requirements will be met:
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Nokia gives you certain additional
|
|
||||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU General
|
|
||||||
** Public License version 3.0 as published by the Free Software Foundation
|
|
||||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
|
||||||
** file. Please review the following information to ensure the GNU General
|
|
||||||
** Public License version 3.0 requirements will be met:
|
|
||||||
** http://www.gnu.org/copyleft/gpl.html.
|
|
||||||
**
|
|
||||||
** Other Usage
|
|
||||||
** Alternatively, this file may be used in accordance with the terms and
|
|
||||||
** conditions contained in a signed written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#ifndef XCBSHAREDBUFFERMANAGER_H
|
|
||||||
#define XCBSHAREDBUFFERMANAGER_H
|
|
||||||
|
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
|
||||||
|
|
||||||
#include <QtCore/qset.h>
|
|
||||||
#include <QtCore/qhash.h>
|
|
||||||
#include <QtCore/qsharedmemory.h>
|
|
||||||
|
|
||||||
#include <GLES2/gl2.h>
|
|
||||||
|
|
||||||
#include <EGL/egl.h>
|
|
||||||
|
|
||||||
#include <EGL/eglext.h>
|
|
||||||
|
|
||||||
class wl_resource;
|
|
||||||
|
|
||||||
QT_BEGIN_HEADER
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
class QXcbSharedBufferManager
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
struct Buffer {
|
|
||||||
Buffer()
|
|
||||||
: width(-1)
|
|
||||||
, height(-1)
|
|
||||||
, bytesPerPixel(1)
|
|
||||||
, nextX(-1)
|
|
||||||
, nextY(-1)
|
|
||||||
, currentLineMaxHeight(0)
|
|
||||||
, next(0)
|
|
||||||
, prev(0)
|
|
||||||
, buffer(0)
|
|
||||||
, textureId(0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
~Buffer()
|
|
||||||
{
|
|
||||||
delete buffer;
|
|
||||||
|
|
||||||
if (textureId != 0)
|
|
||||||
glDeleteTextures(1, &textureId);
|
|
||||||
}
|
|
||||||
|
|
||||||
QByteArray cacheId;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
int bytesPerPixel;
|
|
||||||
int nextX;
|
|
||||||
int nextY;
|
|
||||||
int currentLineMaxHeight;
|
|
||||||
|
|
||||||
Buffer *next;
|
|
||||||
Buffer *prev;
|
|
||||||
|
|
||||||
QSharedMemory *buffer;
|
|
||||||
|
|
||||||
GLuint textureId;
|
|
||||||
|
|
||||||
QAtomicInt ref;
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef QHash<QByteArray, QSet<quint32> > PendingItemIds;
|
|
||||||
|
|
||||||
QXcbSharedBufferManager();
|
|
||||||
~QXcbSharedBufferManager();
|
|
||||||
|
|
||||||
void beginSharedBufferAction(const QByteArray &cacheId);
|
|
||||||
void insertItem(quint32 itemId, uchar *data, int itemWidth, int itemHeight);
|
|
||||||
void requestItems(const QSet<quint32> &itemIds);
|
|
||||||
void releaseItems(const QSet<quint32> &itemIds);
|
|
||||||
void endSharedBufferAction();
|
|
||||||
|
|
||||||
void getBufferForItem(const QByteArray &cacheId, quint32 itemId, Buffer **buffer,
|
|
||||||
int *x, int *y) const;
|
|
||||||
QPair<QByteArray, int> serializeBuffer(QSharedMemory *buffer) const;
|
|
||||||
|
|
||||||
PendingItemIds pendingItemsInvalidated() const
|
|
||||||
{
|
|
||||||
Q_ASSERT_X(m_currentCacheId.isEmpty(), Q_FUNC_INFO,
|
|
||||||
"Call endSharedBufferAction() before accessing data");
|
|
||||||
return m_pendingInvalidatedItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
PendingItemIds pendingItemsReady() const
|
|
||||||
{
|
|
||||||
Q_ASSERT_X(m_currentCacheId.isEmpty(), Q_FUNC_INFO,
|
|
||||||
"Call endSharedBufferAction() before accessing data");
|
|
||||||
return m_pendingReadyItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
PendingItemIds pendingItemsMissing() const
|
|
||||||
{
|
|
||||||
Q_ASSERT_X(m_currentCacheId.isEmpty(), Q_FUNC_INFO,
|
|
||||||
"Call endSharedBufferAction() before accessing data");
|
|
||||||
return m_pendingMissingItems;
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
struct Item {
|
|
||||||
Item()
|
|
||||||
: next(0)
|
|
||||||
, prev(0)
|
|
||||||
, buffer(0)
|
|
||||||
, itemId(0)
|
|
||||||
, x(-1)
|
|
||||||
, y(-1)
|
|
||||||
, width(-1)
|
|
||||||
, height(-1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Item *next;
|
|
||||||
Item *prev;
|
|
||||||
|
|
||||||
Buffer *buffer;
|
|
||||||
quint32 itemId;
|
|
||||||
int x;
|
|
||||||
int y;
|
|
||||||
int width;
|
|
||||||
int height;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Items
|
|
||||||
{
|
|
||||||
Items() : leastRecentlyUsed(0), mostRecentlyUsed(0) {}
|
|
||||||
|
|
||||||
Item *leastRecentlyUsed;
|
|
||||||
Item *mostRecentlyUsed;
|
|
||||||
|
|
||||||
QByteArray cacheId;
|
|
||||||
QHash<quint32, Item *> items;
|
|
||||||
};
|
|
||||||
|
|
||||||
void findAvailableBuffer(int itemWidth, int itemHeight, Buffer **buffer, int *x, int *y);
|
|
||||||
void recycleItem(Buffer **buffer, int *x, int *y);
|
|
||||||
void copyIntoBuffer(Buffer *buffer, int x, int y, int itemWidth, int itemHeight, uchar *data);
|
|
||||||
void touchBuffer(Buffer *buffer);
|
|
||||||
void deleteLeastRecentlyUsed();
|
|
||||||
|
|
||||||
Buffer *createNewBuffer(const QByteArray &cacheId, int heightRequired);
|
|
||||||
Buffer *resizeBuffer(Buffer *buffer, const QSize &newSize);
|
|
||||||
Buffer *allocateBuffer(int width, int height);
|
|
||||||
|
|
||||||
Items *itemsForCache(const QByteArray &cacheId) const;
|
|
||||||
void pushItemToBack(Items *items, Item *item);
|
|
||||||
void touchItem(Items *items, Item *item);
|
|
||||||
void deleteItem(Items *items, Item *item);
|
|
||||||
void recycleItem(const QByteArray &cacheId, Buffer **sharedBuffer, int *glyphX, int *glyphY);
|
|
||||||
|
|
||||||
QByteArray m_currentCacheId;
|
|
||||||
|
|
||||||
quint32 m_memoryUsed;
|
|
||||||
Buffer *m_mostRecentlyUsed;
|
|
||||||
Buffer *m_leastRecentlyUsed;
|
|
||||||
|
|
||||||
mutable QHash<QByteArray, Items *> m_items;
|
|
||||||
QMultiHash<QByteArray, Buffer *> m_buffers;
|
|
||||||
|
|
||||||
PendingItemIds m_pendingInvalidatedItems;
|
|
||||||
PendingItemIds m_pendingReadyItems;
|
|
||||||
PendingItemIds m_pendingMissingItems;
|
|
||||||
};
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
QT_END_HEADER
|
|
||||||
|
|
||||||
#endif // QT_USE_XCB_SHARED_GRAPHICS_CACHE
|
|
||||||
|
|
||||||
#endif // XCBSHAREDBUFFERMANAGER_H
|
|
@ -1,290 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
|
||||||
** Contact: http://www.qt-project.org/
|
|
||||||
**
|
|
||||||
** This file is part of the plugins of the Qt Toolkit.
|
|
||||||
**
|
|
||||||
** $QT_BEGIN_LICENSE:LGPL$
|
|
||||||
** GNU Lesser General Public License Usage
|
|
||||||
** This file may be used under the terms of the GNU Lesser General Public
|
|
||||||
** License version 2.1 as published by the Free Software Foundation and
|
|
||||||
** appearing in the file LICENSE.LGPL included in the packaging of this
|
|
||||||
** file. Please review the following information to ensure the GNU Lesser
|
|
||||||
** General Public License version 2.1 requirements will be met:
|
|
||||||
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
||||||
**
|
|
||||||
** In addition, as a special exception, Nokia gives you certain additional
|
|
||||||
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
||||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
||||||
**
|
|
||||||
** GNU General Public License Usage
|
|
||||||
** Alternatively, this file may be used under the terms of the GNU General
|
|
||||||
** Public License version 3.0 as published by the Free Software Foundation
|
|
||||||
** and appearing in the file LICENSE.GPL included in the packaging of this
|
|
||||||
** file. Please review the following information to ensure the GNU General
|
|
||||||
** Public License version 3.0 requirements will be met:
|
|
||||||
** http://www.gnu.org/copyleft/gpl.html.
|
|
||||||
**
|
|
||||||
** Other Usage
|
|
||||||
** Alternatively, this file may be used in accordance with the terms and
|
|
||||||
** conditions contained in a signed written agreement between you and Nokia.
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
**
|
|
||||||
** $QT_END_LICENSE$
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
#if defined(QT_USE_XCB_SHARED_GRAPHICS_CACHE)
|
|
||||||
|
|
||||||
#include "qxcbsharedgraphicscache.h"
|
|
||||||
#include "qxcbsharedbuffermanager.h"
|
|
||||||
|
|
||||||
#include <QtCore/qsharedmemory.h>
|
|
||||||
|
|
||||||
#include <QtGui/qopenglcontext.h>
|
|
||||||
#include <QtGui/qscreen.h>
|
|
||||||
|
|
||||||
#define GL_GLEXT_PROTOTYPES
|
|
||||||
#include <GLES2/gl2ext.h>
|
|
||||||
|
|
||||||
#define SHAREDGRAPHICSCACHE_DEBUG 1
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
QXcbSharedGraphicsCache::QXcbSharedGraphicsCache(QObject *parent)
|
|
||||||
: QPlatformSharedGraphicsCache(parent)
|
|
||||||
, m_bufferManager(new QXcbSharedBufferManager)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedGraphicsCache::requestItems(const QByteArray &cacheId,
|
|
||||||
const QVector<quint32> &itemIds)
|
|
||||||
{
|
|
||||||
m_bufferManager->beginSharedBufferAction(cacheId);
|
|
||||||
|
|
||||||
QSet<quint32> itemsForRequest;
|
|
||||||
for (int i=0; i<itemIds.size(); ++i)
|
|
||||||
itemsForRequest.insert(itemIds.at(i));
|
|
||||||
|
|
||||||
m_bufferManager->requestItems(itemsForRequest);
|
|
||||||
m_bufferManager->endSharedBufferAction();
|
|
||||||
|
|
||||||
processPendingItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedGraphicsCache::insertItems(const QByteArray &cacheId,
|
|
||||||
const QVector<quint32> &itemIds,
|
|
||||||
const QVector<QImage> &items)
|
|
||||||
{
|
|
||||||
m_bufferManager->beginSharedBufferAction(cacheId);
|
|
||||||
|
|
||||||
QSet<quint32> itemsForRequest;
|
|
||||||
for (int i=0; i<itemIds.size(); ++i) {
|
|
||||||
QImage image = items.at(i);
|
|
||||||
m_bufferManager->insertItem(itemIds.at(i), image.bits(), image.width(), image.height());
|
|
||||||
itemsForRequest.insert(itemIds.at(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ### To avoid loops, we could check missing items here and notify the client
|
|
||||||
m_bufferManager->requestItems(itemsForRequest);
|
|
||||||
|
|
||||||
m_bufferManager->endSharedBufferAction();
|
|
||||||
|
|
||||||
processPendingItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedGraphicsCache::ensureCacheInitialized(const QByteArray &cacheId,
|
|
||||||
BufferType bufferType,
|
|
||||||
PixelFormat pixelFormat)
|
|
||||||
{
|
|
||||||
Q_UNUSED(cacheId);
|
|
||||||
Q_UNUSED(bufferType);
|
|
||||||
Q_UNUSED(pixelFormat);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void QXcbSharedGraphicsCache::releaseItems(const QByteArray &cacheId,
|
|
||||||
const QVector<quint32> &itemIds)
|
|
||||||
{
|
|
||||||
m_bufferManager->beginSharedBufferAction(cacheId);
|
|
||||||
|
|
||||||
QSet<quint32> itemsToRelease;
|
|
||||||
for (int i=0; i<itemIds.size(); ++i)
|
|
||||||
itemsToRelease.insert(itemIds.at(i));
|
|
||||||
|
|
||||||
m_bufferManager->releaseItems(itemsToRelease);
|
|
||||||
|
|
||||||
m_bufferManager->endSharedBufferAction();
|
|
||||||
|
|
||||||
processPendingItems();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedGraphicsCache::serializeBuffer(void *bufferId,
|
|
||||||
QByteArray *serializedData,
|
|
||||||
int *fileDescriptor) const
|
|
||||||
{
|
|
||||||
QXcbSharedBufferManager::Buffer *buffer =
|
|
||||||
reinterpret_cast<QXcbSharedBufferManager::Buffer *>(bufferId);
|
|
||||||
|
|
||||||
QPair<QByteArray, int> bufferName = m_bufferManager->serializeBuffer(buffer->buffer);
|
|
||||||
|
|
||||||
*serializedData = bufferName.first;
|
|
||||||
*fileDescriptor = bufferName.second;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLuint QXcbSharedGraphicsCache::textureIdForBuffer(void *bufferId)
|
|
||||||
{
|
|
||||||
# if defined(SHAREDGRAPHICSCACHE_DEBUG)
|
|
||||||
qDebug("QXcbSharedGraphicsCache::textureIdForBuffer");
|
|
||||||
# endif
|
|
||||||
|
|
||||||
QXcbSharedBufferManager::Buffer *buffer =
|
|
||||||
reinterpret_cast<QXcbSharedBufferManager::Buffer *>(bufferId);
|
|
||||||
|
|
||||||
if (buffer->textureId == 0) {
|
|
||||||
glGenTextures(1, &buffer->textureId);
|
|
||||||
if (buffer->textureId == 0) {
|
|
||||||
qWarning("QXcbSharedGraphicsCache::textureIdForBuffer: Failed to generate texture (gl error: 0x%x)",
|
|
||||||
glGetError());
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, buffer->textureId);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
|
||||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
|
||||||
}
|
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_2D, buffer->textureId);
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, buffer->width, buffer->height, 0, GL_ALPHA,
|
|
||||||
GL_UNSIGNED_BYTE, buffer->buffer->data());
|
|
||||||
glBindTexture(GL_TEXTURE_2D, 0);
|
|
||||||
|
|
||||||
return buffer->textureId;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedGraphicsCache::referenceBuffer(void *bufferId)
|
|
||||||
{
|
|
||||||
QXcbSharedBufferManager::Buffer *buffer =
|
|
||||||
reinterpret_cast<QXcbSharedBufferManager::Buffer *>(bufferId);
|
|
||||||
|
|
||||||
buffer->ref.ref();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool QXcbSharedGraphicsCache::dereferenceBuffer(void *bufferId)
|
|
||||||
{
|
|
||||||
QXcbSharedBufferManager::Buffer *buffer =
|
|
||||||
reinterpret_cast<QXcbSharedBufferManager::Buffer *>(bufferId);
|
|
||||||
|
|
||||||
if (buffer->ref.deref())
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (buffer->textureId != 0) {
|
|
||||||
glDeleteTextures(1, &buffer->textureId);
|
|
||||||
buffer->textureId = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void QXcbSharedGraphicsCache::processPendingItems()
|
|
||||||
{
|
|
||||||
# if defined(SHAREDGRAPHICSCACHE_DEBUG)
|
|
||||||
qDebug("QXcbSharedGraphicsCache::processPendingItems");
|
|
||||||
# endif
|
|
||||||
|
|
||||||
{
|
|
||||||
QXcbSharedBufferManager::PendingItemIds pendingMissingItems = m_bufferManager->pendingItemsMissing();
|
|
||||||
QXcbSharedBufferManager::PendingItemIds::const_iterator it;
|
|
||||||
|
|
||||||
|
|
||||||
for (it = pendingMissingItems.constBegin(); it != pendingMissingItems.constEnd(); ++it) {
|
|
||||||
QVector<quint32> missingItems;
|
|
||||||
|
|
||||||
const QSet<quint32> &items = it.value();
|
|
||||||
QSet<quint32>::const_iterator itemIt;
|
|
||||||
for (itemIt = items.constBegin(); itemIt != items.constEnd(); ++itemIt)
|
|
||||||
missingItems.append(*itemIt);
|
|
||||||
|
|
||||||
# if defined(SHAREDGRAPHICSCACHE_DEBUG)
|
|
||||||
qDebug("QXcbSharedGraphicsCache::processPendingItems: %d missing items",
|
|
||||||
missingItems.size());
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (!missingItems.isEmpty())
|
|
||||||
emit itemsMissing(it.key(), missingItems);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
QXcbSharedBufferManager::PendingItemIds pendingInvalidatedItems = m_bufferManager->pendingItemsInvalidated();
|
|
||||||
QXcbSharedBufferManager::PendingItemIds::const_iterator it;
|
|
||||||
|
|
||||||
for (it = pendingInvalidatedItems.constBegin(); it != pendingInvalidatedItems.constEnd(); ++it) {
|
|
||||||
QVector<quint32> invalidatedItems;
|
|
||||||
|
|
||||||
const QSet<quint32> &items = it.value();
|
|
||||||
QSet<quint32>::const_iterator itemIt;
|
|
||||||
for (itemIt = items.constBegin(); itemIt != items.constEnd(); ++itemIt)
|
|
||||||
invalidatedItems.append(*itemIt);
|
|
||||||
|
|
||||||
# if defined(SHAREDGRAPHICSCACHE_DEBUG)
|
|
||||||
qDebug("QXcbSharedGraphicsCache::processPendingItems: %d invalidated items",
|
|
||||||
invalidatedItems.size());
|
|
||||||
# endif
|
|
||||||
|
|
||||||
if (!invalidatedItems.isEmpty())
|
|
||||||
emit itemsInvalidated(it.key(), invalidatedItems);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
QXcbSharedBufferManager::PendingItemIds pendingReadyItems = m_bufferManager->pendingItemsReady();
|
|
||||||
QXcbSharedBufferManager::PendingItemIds::const_iterator it;
|
|
||||||
|
|
||||||
for (it = pendingReadyItems.constBegin(); it != pendingReadyItems.constEnd(); ++it) {
|
|
||||||
QHash<QXcbSharedBufferManager::Buffer *, ReadyItem> readyItemsForBuffer;
|
|
||||||
const QSet<quint32> &items = it.value();
|
|
||||||
|
|
||||||
QByteArray cacheId = it.key();
|
|
||||||
|
|
||||||
QSet<quint32>::const_iterator itemIt;
|
|
||||||
for (itemIt = items.constBegin(); itemIt != items.constEnd(); ++itemIt) {
|
|
||||||
QXcbSharedBufferManager::Buffer *buffer;
|
|
||||||
int x = -1;
|
|
||||||
int y = -1;
|
|
||||||
|
|
||||||
m_bufferManager->getBufferForItem(cacheId, *itemIt, &buffer, &x, &y);
|
|
||||||
|
|
||||||
readyItemsForBuffer[buffer].itemIds.append(*itemIt);
|
|
||||||
readyItemsForBuffer[buffer].positions.append(QPoint(x, y));
|
|
||||||
}
|
|
||||||
|
|
||||||
QHash<QXcbSharedBufferManager::Buffer*, ReadyItem>::iterator readyItemIt
|
|
||||||
= readyItemsForBuffer.begin();
|
|
||||||
while (readyItemIt != readyItemsForBuffer.end()) {
|
|
||||||
QXcbSharedBufferManager::Buffer *buffer = readyItemIt.key();
|
|
||||||
if (!readyItemIt.value().itemIds.isEmpty()) {
|
|
||||||
# if defined(SHAREDGRAPHICSCACHE_DEBUG)
|
|
||||||
qDebug("QXcbSharedGraphicsCache::processPendingItems: %d ready items",
|
|
||||||
readyItemIt.value().itemIds.size());
|
|
||||||
# endif
|
|
||||||
|
|
||||||
emit itemsAvailable(cacheId, buffer, QSize(buffer->width, buffer->height),
|
|
||||||
readyItemIt.value().itemIds, readyItemIt.value().positions);
|
|
||||||
}
|
|
||||||
++readyItemIt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
|
||||||
|
|
||||||
#endif // QT_USE_XCB_SHARED_GRAPHICS_CACHE
|
|
@ -398,12 +398,14 @@ void QXcbWindow::setGeometry(const QRect &rect)
|
|||||||
propagateSizeHints();
|
propagateSizeHints();
|
||||||
|
|
||||||
const quint32 mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
|
const quint32 mask = XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
|
||||||
const quint32 values[] = { rect.x(),
|
const qint32 values[] = {
|
||||||
rect.y(),
|
qBound<qint32>(-XCOORD_MAX, rect.x(), XCOORD_MAX),
|
||||||
qBound(1, rect.width(), XCOORD_MAX),
|
qBound<qint32>(-XCOORD_MAX, rect.y(), XCOORD_MAX),
|
||||||
qBound(1, rect.height(), XCOORD_MAX) };
|
qBound<qint32>(1, rect.width(), XCOORD_MAX),
|
||||||
|
qBound<qint32>(1, rect.height(), XCOORD_MAX),
|
||||||
|
};
|
||||||
|
|
||||||
Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, values));
|
Q_XCB_CALL(xcb_configure_window(xcb_connection(), m_window, mask, reinterpret_cast<const quint32*>(values)));
|
||||||
|
|
||||||
xcb_flush(xcb_connection());
|
xcb_flush(xcb_connection());
|
||||||
}
|
}
|
||||||
@ -551,7 +553,7 @@ void QXcbWindow::show()
|
|||||||
updateNetWmStateBeforeMap();
|
updateNetWmStateBeforeMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connection()->time() != CurrentTime)
|
if (connection()->time() != XCB_TIME_CURRENT_TIME)
|
||||||
updateNetWmUserTime(connection()->time());
|
updateNetWmUserTime(connection()->time());
|
||||||
|
|
||||||
Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
|
Q_XCB_CALL(xcb_map_window(xcb_connection(), m_window));
|
||||||
@ -1300,6 +1302,7 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
|
|||||||
connection()->drag()->handleLeave(window(), event);
|
connection()->drag()->handleLeave(window(), event);
|
||||||
} else if (event->type == atom(QXcbAtom::XdndDrop)) {
|
} else if (event->type == atom(QXcbAtom::XdndDrop)) {
|
||||||
connection()->drag()->handleDrop(window(), event);
|
connection()->drag()->handleDrop(window(), event);
|
||||||
|
} else if (event->type == atom(QXcbAtom::_XEMBED)) { // QSystemTrayIcon
|
||||||
} else {
|
} else {
|
||||||
qWarning() << "QXcbWindow: Unhandled client message:" << connection()->atomName(event->type);
|
qWarning() << "QXcbWindow: Unhandled client message:" << connection()->atomName(event->type);
|
||||||
}
|
}
|
||||||
|
@ -20,9 +20,7 @@ SOURCES = \
|
|||||||
main.cpp \
|
main.cpp \
|
||||||
qxcbnativeinterface.cpp \
|
qxcbnativeinterface.cpp \
|
||||||
qxcbcursor.cpp \
|
qxcbcursor.cpp \
|
||||||
qxcbimage.cpp \
|
qxcbimage.cpp
|
||||||
qxcbsharedbuffermanager.cpp \
|
|
||||||
qxcbsharedgraphicscache.cpp
|
|
||||||
|
|
||||||
HEADERS = \
|
HEADERS = \
|
||||||
qxcbclipboard.h \
|
qxcbclipboard.h \
|
||||||
@ -38,9 +36,7 @@ HEADERS = \
|
|||||||
qxcbwmsupport.h \
|
qxcbwmsupport.h \
|
||||||
qxcbnativeinterface.h \
|
qxcbnativeinterface.h \
|
||||||
qxcbcursor.h \
|
qxcbcursor.h \
|
||||||
qxcbimage.h \
|
qxcbimage.h
|
||||||
qxcbsharedbuffermanager.h \
|
|
||||||
qxcbsharedgraphicscache.h
|
|
||||||
|
|
||||||
contains(QT_CONFIG, xcb-poll-for-queued-event) {
|
contains(QT_CONFIG, xcb-poll-for-queued-event) {
|
||||||
DEFINES += XCB_POLL_FOR_QUEUED_EVENT
|
DEFINES += XCB_POLL_FOR_QUEUED_EVENT
|
||||||
@ -91,10 +87,11 @@ contains(DEFINES, XCB_USE_DRI2) {
|
|||||||
DEFINES += XCB_USE_GLX
|
DEFINES += XCB_USE_GLX
|
||||||
HEADERS += qglxintegration.h
|
HEADERS += qglxintegration.h
|
||||||
SOURCES += qglxintegration.cpp
|
SOURCES += qglxintegration.cpp
|
||||||
|
LIBS += $$QMAKE_LIBS_DYNLOAD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LIBS += -lxcb -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shape
|
LIBS += -lxcb -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-sync -lxcb-xfixes -lxcb-shape -lxcb-shm
|
||||||
|
|
||||||
DEFINES += $$QMAKE_DEFINES_XCB
|
DEFINES += $$QMAKE_DEFINES_XCB
|
||||||
LIBS += $$QMAKE_LIBS_XCB
|
LIBS += $$QMAKE_LIBS_XCB
|
||||||
|
@ -59,7 +59,9 @@ QWindowsPrinterSupport::QWindowsPrinterSupport()
|
|||||||
if (EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 4, buffer, needed, &needed, &returned)) {
|
if (EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, NULL, 4, buffer, needed, &needed, &returned)) {
|
||||||
PPRINTER_INFO_4 infoList = reinterpret_cast<PPRINTER_INFO_4>(buffer);
|
PPRINTER_INFO_4 infoList = reinterpret_cast<PPRINTER_INFO_4>(buffer);
|
||||||
QString defaultPrinterName;
|
QString defaultPrinterName;
|
||||||
QWin32PrintEngine::queryDefaultPrinter(defaultPrinterName, QString(), QString());
|
QString program;
|
||||||
|
QString port;
|
||||||
|
QWin32PrintEngine::queryDefaultPrinter(defaultPrinterName, program, port);
|
||||||
for (uint i = 0; i < returned; ++i) {
|
for (uint i = 0; i < returned; ++i) {
|
||||||
QString printerName(QString::fromWCharArray(infoList[i].pPrinterName));
|
QString printerName(QString::fromWCharArray(infoList[i].pPrinterName));
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user