Merge remote-tracking branch 'origin/5.6' into dev

Based on merge done by Liang Qi

Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
This commit is contained in:
Frederik Gladhorn 2016-01-08 12:30:57 +01:00
commit ad16478a76
150 changed files with 3154 additions and 994 deletions

4
.gitignore vendored
View File

@ -47,6 +47,10 @@ pcviewer.cfg
*_resource.rc
.#*
*.*#
*_wrapper.sh
*_wrapper.bat
wrapper.sh
wrapper.bat
core
.qmake.cache
.qmake.vars

View File

@ -489,6 +489,6 @@
*/
/*!
\externalpage http://qt.digia.com/Try-Buy/Qt-Account-Sign-up/
\externalpage https://login.qt.io/
\title Qt Account Sign-up
*/

View File

@ -78,9 +78,9 @@ QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib
QMAKE_LIBS += runtimeobject.lib
QMAKE_LIBS_CORE =
QMAKE_LIBS_CORE += ws2_32.lib
QMAKE_LIBS_GUI =
QMAKE_LIBS_NETWORK =
QMAKE_LIBS_NETWORK += ws2_32.lib
QMAKE_LIBS_OPENGL_ES2 = $${LIBEGL_NAME}.lib $${LIBGLESV2_NAME}.lib
QMAKE_LIBS_OPENGL_ES2_DEBUG = $${LIBEGL_NAME}d.lib $${LIBGLESV2_NAME}d.lib

View File

@ -130,14 +130,4 @@
typedef int mode_t;
#ifndef INADDR_ANY
# define INADDR_ANY (u_long)0x00000000
#endif
#ifndef INADDR_LOOPBACK
# define INADDR_LOOPBACK 0x7f000001
#endif
#ifndef INADDR_BROADCAST
# define INADDR_BROADCAST (u_long)0xffffffff
#endif
#endif // QPLATFORMDEFS_H

View File

@ -3,7 +3,7 @@ contains(TEMPLATE, ".*app") {
!contains(TARGET, ".so"): TARGET = lib$${TARGET}.so
QMAKE_LFLAGS += -Wl,-soname,$$shell_quote($$TARGET)
android_install: {
android_install {
target.path=/libs/$$ANDROID_TARGET_ARCH/
INSTALLS *= target
}

View File

@ -1,11 +1,11 @@
set(PACKAGE_VERSION $$CMAKE_PACKAGE_VERSION)
if(\"\${PACKAGE_VERSION}\" VERSION_LESS \"\${PACKAGE_FIND_VERSION}\")
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if(\"\${PACKAGE_FIND_VERSION}\" STREQUAL \"\${PACKAGE_VERSION}\")
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

View File

@ -33,8 +33,21 @@
#############################################################################
use strict;
my $syntax = "findclasslist.pl [private header list]\n" .
my $syntax = "findclasslist.pl <file (containing private header list)>\n" .
"Replaces \@CLASSLIST\@ with the classes found in the header files\n";
die("Expected exactly one argument") if (@ARGV != 1);
my @headers = ();
# Expand contents of the command-line arguments file
open ARGFILE, "<$ARGV[0]" or die("Could not open arguments file $ARGV[0]: $!");
while (my $line = <ARGFILE>) {
chomp($line);
push @headers, $line;
}
close ARGFILE;
$\ = $/;
while (<STDIN>) {
chomp;
@ -44,7 +57,7 @@ while (<STDIN>) {
}
# Replace @CLASSLIST@ with the class list
for my $header (@ARGV) {
for my $header (@headers) {
open HDR, "<$header" or die("Could not open header $header: $!");
my $comment = " /* $header */";
while (my $line = <HDR>) {

View File

@ -208,7 +208,7 @@ contains(qt_module_deps, qml): \
!isEmpty(IMPORTS._KEYS_) {
# add import plugins to LIBS line
for (key, IMPORTS._KEYS_): {
for (key, IMPORTS._KEYS_) {
PATH = $$eval(IMPORTS.$${key}.path)
PLUGIN = $$eval(IMPORTS.$${key}.plugin)
!isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix()
@ -347,7 +347,7 @@ for(QT_CURRENT_VERIFY, $$list($$QT_PLUGIN_VERIFY)) {
QT_LINKAGE = -l$${QTPLUG}$$qtPlatformTargetSuffix()
# Only link against plugin in static builds
isEqual(QT_CURRENT_VERIFY, QTPLUGIN): {
isEqual(QT_CURRENT_VERIFY, QTPLUGIN) {
!isEmpty(QT_PLUGINPATH) {
plugpath = $$eval(QT_PLUGIN.$${QTPLUG}.PATH)
isEmpty(plugpath): \

View File

@ -31,9 +31,9 @@ qtdocs.value = $$[QT_INSTALL_DOCS/src]
QT_TOOL_ENV = qtver qtmver qtvertag qtdocs
qtPrepareTool(QDOC, qdoc)
QT_TOOL_ENV =
QDOC += -outputdir $$QMAKE_DOCS_OUTPUTDIR
QDOC += -outputdir $$shell_quote($$QMAKE_DOCS_OUTPUTDIR)
!build_online_docs: \
QDOC += -installdir $$[QT_INSTALL_DOCS]
QDOC += -installdir $$shell_quote($$[QT_INSTALL_DOCS])
PREP_DOC_INDEXES =
DOC_INDEXES =
!isEmpty(QTREPOS) {
@ -46,14 +46,14 @@ DOC_INDEXES =
mps += $$dirname(QT.$${d}.libs)
mps = $$unique(mps)
for (mp, mps): \
PREP_DOC_INDEXES += -indexdir $$mp/doc
PREP_DOC_INDEXES += -indexdir $$shell_quote($$mp/doc)
}
for(qrep, QTREPOS): \
DOC_INDEXES += -indexdir $$qrep/doc
DOC_INDEXES += -indexdir $$shell_quote($$qrep/doc)
} else {
prepare_docs: \
PREP_DOC_INDEXES += -indexdir $$[QT_INSTALL_DOCS/get]
DOC_INDEXES += -indexdir $$[QT_INSTALL_DOCS/get]
PREP_DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
DOC_INDEXES += -indexdir $$shell_quote($$[QT_INSTALL_DOCS/get])
}
doc_command = $$QDOC $$QMAKE_DOCS
prepare_docs {
@ -65,7 +65,7 @@ prepare_docs {
!build_online_docs {
qtPrepareTool(QHELPGENERATOR, qhelpgenerator)
qch_docs.commands = $$QHELPGENERATOR $$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp -o $$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch
qch_docs.commands = $$QHELPGENERATOR $$shell_quote($$QMAKE_DOCS_OUTPUTDIR/$${QMAKE_DOCS_TARGET}.qhp) -o $$shell_quote($$QMAKE_DOCS_BASE_OUTDIR/$${QMAKE_DOCS_TARGET}.qch)
inst_html_docs.files = $$QMAKE_DOCS_OUTPUTDIR
inst_html_docs.path = $$[QT_INSTALL_DOCS]

View File

@ -70,6 +70,7 @@ defineTest(qtPrepareTool) {
}
}
QT_TOOL_ENV += $$eval(QT_TOOL.$${2}.envvars)
QT_TOOL_NAME = $$2
!isEmpty(3)|!isEmpty(4) {
$$1$$3 =
for (arg, cmd): \
@ -90,29 +91,73 @@ defineTest(qtAddToolEnv) {
ds = $$QMAKE_DIR_SEP
else: \
ds = $$DIR_SEPARATOR
batch_sets =
for(env, 2) {
value = $$eval($${env}.value)
!isEmpty(value) {
name = $$eval($${env}.name)
config = $$eval($${env}.CONFIG)
equals(ds, /) {
contains($${env}.CONFIG, prepend): infix = \${$$name:+:\$$$name}
contains(config, prepend): infix = \${$$name:+:\$$$name}
else: contains(config, always_prepend): infix = :\$$$name
else: infix =
val = "$$name=$$shell_quote($$join(value, :))$$infix"
# Under msys, this path is taken only in the non-system()
# case, so using shell_quote() always works.
batch_sets += \
"$$name=$$shell_quote($$join(value, :))$$infix" \
"export $$name"
} else {
# Escape closing parens when expanding the variable, otherwise cmd confuses itself.
contains($${env}.CONFIG, prepend): infix = ;%$$name:)=^)%
else: infix =
value ~= s,\\^,^^^^,g
value ~= s,!,^^!,g
value ~= s,\\),^),g
val = "(set $$name=$$join(value, ;)$$infix) &"
contains(config, prepend) {
batch_sets += \
"if defined $$name (" \
" set $$name=$$join(value, ;);!$$name!" \
") else (" \
" set $$name=$$join(value, ;)" \
")"
} else: contains(config, always_prepend) {
batch_sets += "(set $$name=$$join(value, ;);!$$name!)"
} else {
batch_sets += "(set $$name=$$join(value, ;))"
}
isEmpty(3): !contains(TEMPLATE, vc.*) {
contains(MAKEFILE_GENERATOR, MS.*): val ~= s,%,%%,g
val ~= s,\\\$,\$\$,g
}
$$1 = "$$val $$eval($$1)"
}
}
!isEmpty(batch_sets) {
batch_name = wrapper
!isEmpty(QT_TOOL_NAME): batch_name = $${QT_TOOL_NAME}_wrapper
cmd = $$eval($$1)
!isEmpty(cmd): cmd = "$$cmd "
equals(ds, /) {
batch_name = $${batch_name}.sh
batch_cont = \
"$$LITERAL_HASH!/bin/sh" \
$$batch_sets \
"exec $$cmd\"$@\""
# It would be nicer to use the '.' command (without 'exec' above),
# but that doesn't set the positional arguments under (d)ash.
$$1 =
} else {
batch_name = $${batch_name}.bat
batch_cont = \
"@echo off" \
"SetLocal EnableDelayedExpansion" \
$$batch_sets \
"$$cmd%*" \
"EndLocal"
$$1 = call
}
!build_pass:!write_file($$OUT_PWD/$$batch_name, batch_cont, exe): error("Aborting.")
isEmpty(3): \
$$1 += $$shell_quote($$shell_path($$OUT_PWD/$$batch_name))
else: \
$$1 += $$system_quote($$system_path($$OUT_PWD/$$batch_name))
QMAKE_DISTCLEAN += $$OUT_PWD/$$batch_name
}
export($$1)
export(QMAKE_DISTCLEAN)
}
# target variable, dependency var name, [non-empty: prepare for system(), not make]
@ -120,9 +165,9 @@ defineTest(qtAddTargetEnv) {
deps = $$replace($$2, -private$, _private)
deps = $$resolve_depends(deps, "QT.", ".depends" ".run_depends")
!isEmpty(deps) {
libs = libs
deppath.CONFIG = prepend
equals(QMAKE_HOST.os, Windows) {
libs = bins
deppath.CONFIG = always_prepend
deppath.name = PATH
} else:contains(QMAKE_HOST.os, Linux|FreeBSD|OpenBSD|NetBSD|DragonFly|SunOS|HP-UX|QNX|GNU) {
deppath.name = LD_LIBRARY_PATH
@ -141,13 +186,12 @@ defineTest(qtAddTargetEnv) {
ptypes =
for(dep, deps) {
isEmpty(3): \
deppath += $$shell_path($$eval(QT.$${dep}.$$libs))
deppath += $$shell_path($$eval(QT.$${dep}.libs))
else: \
deppath += $$system_path($$eval(QT.$${dep}.$$libs))
deppath += $$system_path($$eval(QT.$${dep}.libs))
ptypes += $$eval(QT.$${dep}.plugin_types)
}
deppath.value = $$unique(deppath)
deppath.CONFIG = prepend
pluginpath.value =
ppaths = $$[QT_INSTALL_PLUGINS/get]

View File

@ -215,11 +215,12 @@ android: CONFIG += qt_android_deps no_linker_version_script
}
# Add a post-processing step to replace the @CLASSLIST@
verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < $^ > $@
verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < $${verscript}.in $${verscript}.in.args > $@
verscriptprocess.target = $$verscript
verscriptprocess.depends = $${verscript}.in
for(header, SYNCQT.PRIVATE_HEADER_FILES): \
verscriptprocess.depends += $${_PRO_FILE_PWD_}/$$header
write_file($${verscript}.in.args, verscriptprocess.depends)|error("Aborting.")
verscriptprocess.depends += $${verscript}.in $${verscript}.in.args
QMAKE_EXTRA_TARGETS += verscriptprocess
PRE_TARGETDEPS += $$verscript
verscript = $${verscript}.in

View File

@ -9,6 +9,11 @@ testcase_exceptions: CONFIG += exceptions
check.files =
check.path = .
# Add environment for non-installed builds. Do this first, so the
# 'make' variable expansions don't end up in a batch file/script.
QT_TOOL_NAME = target
qtAddTargetEnv(check.commands, QT)
# If the test ends up in a different directory, we should cd to that directory.
TESTRUN_CWD = $$DESTDIR
@ -40,10 +45,6 @@ unix {
# Allow for custom arguments to tests
check.commands += $(TESTARGS)
# Add environment for non-installed builds
qtAddTargetEnv(check.commands, QT)
# This must happen after adding the environment.
!isEmpty(TESTRUN_CWD):!contains(TESTRUN_CWD, ^\\./?): \
check.commands = cd $$shell_path($$TESTRUN_CWD) && $$check.commands

View File

@ -1,4 +1,4 @@
build_pass:console: {
build_pass:console {
warning("QAxServer applications cannot be console applications.")
warning("Remove 'console' from your CONFIG.")
}

View File

@ -5,7 +5,7 @@ contains(TEMPLATE, ".*app") {
mingw:DEFINES += QT_NEEDS_QMAIN
qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
isEqual(entryLib, -lqtmain): {
isEqual(entryLib, -lqtmain) {
!contains(QMAKE_DEFAULT_LIBDIRS, $$QT.core.libs): \
QMAKE_LIBS += -L$$QT.core.libs
CONFIG(debug, debug|release): QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}d

View File

@ -85,7 +85,6 @@ QMAKE_LFLAGS_CXX11 =
QMAKE_LFLAGS_CXX14 =
QMAKE_LFLAGS_CXX1Z =
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
QMAKE_LFLAGS_USE_GOLD = -fuse-ld=gold
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
QMAKE_PREFIX_SHLIB =

View File

@ -628,7 +628,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tagValue("Platform", tool.SingleProjects.at(i).PlatformName)
<< closetag();
isWinRT = isWinRT || tool.SingleProjects.at(i).Configuration.WinRT;
isWinPhone = isWinPhone = tool.SingleProjects.at(i).Configuration.WinPhone;
isWinPhone = isWinPhone || tool.SingleProjects.at(i).Configuration.WinPhone;
}
xml << closetag()

View File

@ -2399,11 +2399,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
if (!CustomBuildTool.Description.isEmpty())
CustomBuildTool.Description += ", ";
CustomBuildTool.Description += cmd_name;
// Execute custom build steps in an environment variable scope to prevent unwanted
// side effects for downstream build steps
CustomBuildTool.CommandLine += QLatin1String("setlocal");
CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed());
CustomBuildTool.CommandLine += QLatin1String("endlocal");
int space = cmd.indexOf(' ');
QFileInfo finf(cmd.left(space));
if (CustomBuildTool.ToolPath.isEmpty())

View File

@ -1428,11 +1428,11 @@ void VcprojGenerator::initWinDeployQtTool()
// itself contains the original subdirectories as parameters and hence the
// call fails.
// Neither there is a way to disable this behavior for Windows Phone, nor
// to influence the parameters. Hence the only way to get a release build
// to influence the parameters. Hence the only way to get a build
// done is to recreate the directory structure manually by invoking
// windeployqt a second time, so that the MDILXapCompile call succeeds and
// deployment continues.
if (conf.WinPhone && conf.Name == QStringLiteral("Release|ARM")) {
if (conf.WinPhone) {
conf.windeployqt.CommandLine = commandLine
+ QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\\")
+ var("OBJECTS_DIR")

View File

@ -358,10 +358,10 @@ static QMakeEvaluator::VisitReturn parseJsonInto(const QByteArray &json, const Q
QMakeEvaluator::VisitReturn
QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode,
const QString &contents)
bool exe, const QString &contents)
{
QString errStr;
if (!m_vfs->writeFile(fn, mode, contents, &errStr)) {
if (!m_vfs->writeFile(fn, mode, exe, contents, &errStr)) {
evalError(fL1S("Cannot write %1file %2: %3")
.arg(ctx, QDir::toNativeSeparators(fn), errStr));
return ReturnFalse;
@ -1470,8 +1470,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
fputs(msg.toLatin1().constData(), stderr);
#endif
} else {
m_handler->fileMessage(fL1S("Project %1: %2")
.arg(function.toQString(m_tmp1).toUpper(), msg));
m_handler->fileMessage(
(func_t == T_ERROR ? QMakeHandler::ErrorMessage :
func_t == T_WARNING ? QMakeHandler::WarningMessage :
QMakeHandler::InfoMessage)
| (m_cumulative ? QMakeHandler::CumulativeEvalMessage : 0),
fL1S("Project %1: %2").arg(function.toQString(m_tmp1).toUpper(), msg));
}
}
return (func_t == T_ERROR && !m_cumulative) ? ReturnError : ReturnTrue;
@ -1543,22 +1547,33 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
case T_WRITE_FILE: {
if (args.count() > 3) {
evalError(fL1S("write_file(name, [content var, [append]]) requires one to three arguments."));
evalError(fL1S("write_file(name, [content var, [append] [exe]]) requires one to three arguments."));
return ReturnFalse;
}
QIODevice::OpenMode mode = QIODevice::Truncate;
bool exe = false;
QString contents;
if (args.count() >= 2) {
const ProStringList &vals = values(args.at(1).toKey());
if (!vals.isEmpty())
contents = vals.join(QLatin1Char('\n')) + QLatin1Char('\n');
if (args.count() >= 3)
if (!args.at(2).toQString(m_tmp1).compare(fL1S("append"), Qt::CaseInsensitive))
if (args.count() >= 3) {
foreach (const ProString &opt, split_value_list(args.at(2).toQString(m_tmp2))) {
opt.toQString(m_tmp3);
if (m_tmp3 == QLatin1String("append")) {
mode = QIODevice::Append;
} else if (m_tmp3 == QLatin1String("exe")) {
exe = true;
} else {
evalError(fL1S("write_file(): invalid flag %1.").arg(m_tmp3));
return ReturnFalse;
}
}
}
}
QString path = resolvePath(args.at(0).toQString(m_tmp1));
path.detach(); // make sure to not leak m_tmp1 into the map of written files.
return writeFile(QString(), path, mode, contents);
return writeFile(QString(), path, mode, exe, contents);
}
case T_TOUCH: {
if (args.count() != 2) {
@ -1769,7 +1784,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
valuesRef(ProKey("_QMAKE_STASH_")) << ProString(fn);
}
}
return writeFile(fL1S("cache "), fn, QIODevice::Append, varstr);
return writeFile(fL1S("cache "), fn, QIODevice::Append, false, varstr);
}
default:
evalError(fL1S("Function '%1' is not implemented.").arg(function.toQString(m_tmp1)));

View File

@ -1308,7 +1308,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConfigFeatures()
config.detach();
processed.insert(config);
VisitReturn vr = evaluateFeatureFile(config, true);
if (vr == ReturnError)
if (vr == ReturnError && !m_cumulative)
return vr;
if (vr == ReturnTrue) {
finished = false;

View File

@ -41,7 +41,6 @@
#include "qmakeparser.h"
#include "ioutils.h"
#include <qiodevice.h>
#include <qlist.h>
#include <qlinkedlist.h>
#include <qmap.h>
@ -52,6 +51,8 @@
#include <qshareddata.h>
#ifndef QT_BOOTSTRAPPED
# include <qprocess.h>
#else
# include <qiodevice.h>
#endif
#ifdef PROEVALUATOR_THREAD_SAFE
# include <qmutex.h>
@ -67,6 +68,8 @@ public:
enum {
SourceEvaluator = 0x10,
CumulativeEvalMessage = 0x1000,
EvalWarnLanguage = SourceEvaluator | WarningMessage | WarnLanguage,
EvalWarnDeprecated = SourceEvaluator | WarningMessage | WarnDeprecated,
@ -74,7 +77,7 @@ public:
};
// error(), warning() and message() from .pro file
virtual void fileMessage(const QString &msg) = 0;
virtual void fileMessage(int type, const QString &msg) = 0;
enum EvalFileType { EvalProjectFile, EvalIncludeFile, EvalConfigFile, EvalFeatureFile, EvalAuxFile };
virtual void aboutToEval(ProFile *parent, ProFile *proFile, EvalFileType type) = 0;
@ -235,7 +238,7 @@ public:
QMultiMap<int, ProString> &rootSet) const;
VisitReturn writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode,
const QString &contents);
bool exe, const QString &contents);
#ifndef QT_BOOTSTRAPPED
void runProcess(QProcess *proc, const QString &command) const;
#endif

View File

@ -50,8 +50,9 @@ class QMAKE_EXPORT QMakeParserHandler
public:
enum {
CategoryMask = 0xf00,
WarningMessage = 0x000,
ErrorMessage = 0x100,
InfoMessage = 0x100,
WarningMessage = 0x200,
ErrorMessage = 0x300,
SourceMask = 0xf0,
SourceParser = 0,

View File

@ -52,8 +52,8 @@ QMakeVfs::QMakeVfs()
{
}
bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QString &contents,
QString *errStr)
bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, bool exe,
const QString &contents, QString *errStr)
{
#ifndef PROEVALUATOR_FULL
# ifdef PROEVALUATOR_THREAD_SAFE
@ -75,8 +75,16 @@ bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QStr
QByteArray bytes = contents.toLocal8Bit();
QFile cfile(fn);
if (!(mode & QIODevice::Append) && cfile.open(QIODevice::ReadOnly | QIODevice::Text)) {
if (cfile.readAll() == bytes)
if (cfile.readAll() == bytes) {
if (exe) {
cfile.setPermissions(cfile.permissions()
| QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
} else {
cfile.setPermissions(cfile.permissions()
& ~(QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther));
}
return true;
}
cfile.close();
}
if (!cfile.open(mode | QIODevice::WriteOnly | QIODevice::Text)) {
@ -89,6 +97,9 @@ bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QStr
*errStr = cfile.errorString();
return false;
}
if (exe)
cfile.setPermissions(cfile.permissions()
| QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
return true;
#endif
}

View File

@ -52,7 +52,7 @@ class QMAKE_EXPORT QMakeVfs
public:
QMakeVfs();
bool writeFile(const QString &fn, QIODevice::OpenMode mode, const QString &contents, QString *errStr);
bool writeFile(const QString &fn, QIODevice::OpenMode mode, bool exe, const QString &contents, QString *errStr);
bool readFile(const QString &fn, QString *contents, QString *errStr);
bool exists(const QString &fn);

View File

@ -602,8 +602,9 @@ void EvalHandler::message(int type, const QString &msg, const QString &fileName,
fprintf(stderr, "%s%s\n", qPrintable(pfx), qPrintable(msg));
}
void EvalHandler::fileMessage(const QString &msg)
void EvalHandler::fileMessage(int type, const QString &msg)
{
Q_UNUSED(type)
fprintf(stderr, "%s\n", qPrintable(msg));
}

View File

@ -67,7 +67,7 @@ class EvalHandler : public QMakeHandler {
public:
void message(int type, const QString &msg, const QString &fileName, int lineNo);
void fileMessage(const QString &msg);
void fileMessage(int type, const QString &msg);
void aboutToEval(ProFile *, ProFile *, EvalFileType);
void doneWithEval(ProFile *);

View File

@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
/* The current PCRE version information. */
#define PCRE_MAJOR 8
#define PCRE_MINOR 38
#define PCRE_MINOR 39
#define PCRE_PRERELEASE -RC1
#define PCRE_DATE 2015-05-03
#define PCRE_DATE 2015-11-23
/* When an application links to a PCRE DLL in Windows, the symbols that are
imported have to be identified as such. When building PCRE, the appropriate

View File

@ -4639,16 +4639,16 @@ for (;; ptr++)
/* In the real compile phase, just check the workspace used by the forward
reference list. */
else if (cd->hwm > cd->start_workspace + cd->workspace_size -
WORK_SIZE_SAFETY_MARGIN)
else if (cd->hwm > cd->start_workspace + cd->workspace_size)
{
*errorcodeptr = ERR52;
goto FAILED;
}
/* If in \Q...\E, check for the end; if not, we have a literal */
/* If in \Q...\E, check for the end; if not, we have a literal. Otherwise an
isolated \E is ignored. */
if (inescq && c != CHAR_NULL)
if (c != CHAR_NULL)
{
if (c == CHAR_BACKSLASH && ptr[1] == CHAR_E)
{
@ -4656,7 +4656,7 @@ for (;; ptr++)
ptr++;
continue;
}
else
else if (inescq)
{
if (previous_callout != NULL)
{
@ -4671,18 +4671,27 @@ for (;; ptr++)
}
goto NORMAL_CHAR;
}
/* Control does not reach here. */
/* Check for the start of a \Q...\E sequence. We must do this here rather
than later in case it is immediately followed by \E, which turns it into a
"do nothing" sequence. */
if (c == CHAR_BACKSLASH && ptr[1] == CHAR_Q)
{
inescq = TRUE;
ptr++;
continue;
}
}
/* In extended mode, skip white space and comments. We need a loop in order
to check for more white space and more comments after a comment. */
/* In extended mode, skip white space and comments. */
if ((options & PCRE_EXTENDED) != 0)
{
for (;;)
{
const pcre_uchar *wscptr = ptr;
while (MAX_255(c) && (cd->ctypes[c] & ctype_space) != 0) c = *(++ptr);
if (c != CHAR_NUMBER_SIGN) break;
if (c == CHAR_NUMBER_SIGN)
{
ptr++;
while (*ptr != CHAR_NULL)
{
@ -4696,8 +4705,33 @@ for (;; ptr++)
if (utf) FORWARDCHAR(ptr);
#endif
}
c = *ptr; /* Either NULL or the char after a newline */
}
/* If we skipped any characters, restart the loop. Otherwise, we didn't see
a comment. */
if (ptr > wscptr)
{
ptr--;
continue;
}
}
/* Skip over (?# comments. We need to do this here because we want to know if
the next thing is a quantifier, and these comments may come between an item
and its quantifier. */
if (c == CHAR_LEFT_PARENTHESIS && ptr[1] == CHAR_QUESTION_MARK &&
ptr[2] == CHAR_NUMBER_SIGN)
{
ptr += 3;
while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
if (*ptr == CHAR_NULL)
{
*errorcodeptr = ERR18;
goto FAILED;
}
continue;
}
/* See if the next thing is a quantifier. */
@ -4941,9 +4975,10 @@ for (;; ptr++)
(which is on the stack). We have to remember that there was XCLASS data,
however. */
if (class_uchardata > class_uchardata_base) xclass = TRUE;
if (lengthptr != NULL && class_uchardata > class_uchardata_base)
{
xclass = TRUE;
*lengthptr += (int)(class_uchardata - class_uchardata_base);
class_uchardata = class_uchardata_base;
}
@ -5046,10 +5081,28 @@ for (;; ptr++)
ptr = tempptr + 1;
continue;
/* For all other POSIX classes, no special action is taken in UCP
mode. Fall through to the non_UCP case. */
/* For the other POSIX classes (ascii, cntrl, xdigit) we are going
to fall through to the non-UCP case and build a bit map for
characters with code points less than 256. If we are in a negated
POSIX class, characters with code points greater than 255 must
either all match or all not match. In the special case where we
have not yet generated any xclass data, and this is the final item
in the overall class, we need do nothing: later on, the opcode
OP_NCLASS will be used to indicate that characters greater than 255
are acceptable. If we have already seen an xclass item or one may
follow (we have to assume that it might if this is not the end of
the class), explicitly list all wide codepoints, which will then
either not match or match, depending on whether the class is or is
not negated. */
default:
if (local_negate &&
(xclass || tempptr[2] != CHAR_RIGHT_SQUARE_BRACKET))
{
*class_uchardata++ = XCL_RANGE;
class_uchardata += PRIV(ord2utf)(0x100, class_uchardata);
class_uchardata += PRIV(ord2utf)(0x10ffff, class_uchardata);
}
break;
}
}
@ -5388,16 +5441,20 @@ for (;; ptr++)
CLASS_SINGLE_CHARACTER:
if (class_one_char < 2) class_one_char++;
/* If class_one_char is 1, we have the first single character in the
class, and there have been no prior ranges, or XCLASS items generated by
escapes. If this is the final character in the class, we can optimize by
turning the item into a 1-character OP_CHAR[I] if it's positive, or
OP_NOT[I] if it's negative. In the positive case, it can cause firstchar
to be set. Otherwise, there can be no first char if this item is first,
whatever repeat count may follow. In the case of reqchar, save the
previous value for reinstating. */
/* If xclass_has_prop is false and class_one_char is 1, we have the first
single character in the class, and there have been no prior ranges, or
XCLASS items generated by escapes. If this is the final character in the
class, we can optimize by turning the item into a 1-character OP_CHAR[I]
if it's positive, or OP_NOT[I] if it's negative. In the positive case, it
can cause firstchar to be set. Otherwise, there can be no first char if
this item is first, whatever repeat count may follow. In the case of
reqchar, save the previous value for reinstating. */
if (!inescq && class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
if (!inescq &&
#ifdef SUPPORT_UCP
!xclass_has_prop &&
#endif
class_one_char == 1 && ptr[1] == CHAR_RIGHT_SQUARE_BRACKET)
{
ptr++;
zeroreqchar = reqchar;
@ -5513,9 +5570,10 @@ for (;; ptr++)
actual compiled code. */
#ifdef SUPPORT_UTF
if (xclass && (!should_flip_negation || (options & PCRE_UCP) != 0))
if (xclass && (xclass_has_prop || !should_flip_negation ||
(options & PCRE_UCP) != 0))
#elif !defined COMPILE_PCRE8
if (xclass && !should_flip_negation)
if (xclass && (xclass_has_prop || !should_flip_negation))
#endif
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
{
@ -6508,21 +6566,6 @@ for (;; ptr++)
case CHAR_LEFT_PARENTHESIS:
ptr++;
/* First deal with comments. Putting this code right at the start ensures
that comments have no bad side effects. */
if (ptr[0] == CHAR_QUESTION_MARK && ptr[1] == CHAR_NUMBER_SIGN)
{
ptr += 2;
while (*ptr != CHAR_NULL && *ptr != CHAR_RIGHT_PARENTHESIS) ptr++;
if (*ptr == CHAR_NULL)
{
*errorcodeptr = ERR18;
goto FAILED;
}
continue;
}
/* Now deal with various "verbs" that can be introduced by '*'. */
if (ptr[0] == CHAR_ASTERISK && (ptr[1] == ':'
@ -6613,9 +6656,17 @@ for (;; ptr++)
goto FAILED;
}
setverb = *code++ = verbs[i].op_arg;
if (lengthptr != NULL) /* In pass 1 just add in the length */
{ /* to avoid potential workspace */
*lengthptr += arglen; /* overflow. */
*code++ = 0;
}
else
{
*code++ = arglen;
memcpy(code, arg, IN_UCHARS(arglen));
code += arglen;
}
*code++ = 0;
}
@ -7229,7 +7280,7 @@ for (;; ptr++)
issue is fixed "properly" in PCRE2. As PCRE1 is now in maintenance
only mode, we finesse the bug by allowing more memory always. */
*lengthptr += 2 + 2*LINK_SIZE;
*lengthptr += 4 + 4*LINK_SIZE;
/* It is even worse than that. The current reference may be to an
existing named group with a different number (so apparently not
@ -7556,39 +7607,15 @@ for (;; ptr++)
newoptions = (options | set) & (~unset);
/* If the options ended with ')' this is not the start of a nested
group with option changes, so the options change at this level. If this
item is right at the start of the pattern, the options can be
abstracted and made external in the pre-compile phase, and ignored in
the compile phase. This can be helpful when matching -- for instance in
caseless checking of required bytes.
If the code pointer is not (cd->start_code + 1 + LINK_SIZE), we are
definitely *not* at the start of the pattern because something has been
compiled. In the pre-compile phase, however, the code pointer can have
that value after the start, because it gets reset as code is discarded
during the pre-compile. However, this can happen only at top level - if
we are within parentheses, the starting BRA will still be present. At
any parenthesis level, the length value can be used to test if anything
has been compiled at that level. Thus, a test for both these conditions
is necessary to ensure we correctly detect the start of the pattern in
both phases.
group with option changes, so the options change at this level.
If we are not at the pattern start, reset the greedy defaults and the
case value for firstchar and reqchar. */
if (*ptr == CHAR_RIGHT_PARENTHESIS)
{
if (code == cd->start_code + 1 + LINK_SIZE &&
(lengthptr == NULL || *lengthptr == 2 + 2*LINK_SIZE))
{
cd->external_options = newoptions;
}
else
{
greedy_default = ((newoptions & PCRE_UNGREEDY) != 0);
greedy_non_default = greedy_default ^ 1;
req_caseopt = ((newoptions & PCRE_CASELESS) != 0)? REQ_CASELESS:0;
}
/* Change options at this level, and pass them back for use
in subsequent branches. */
@ -7867,16 +7894,6 @@ for (;; ptr++)
c = ec;
else
{
if (escape == ESC_Q) /* Handle start of quoted string */
{
if (ptr[1] == CHAR_BACKSLASH && ptr[2] == CHAR_E)
ptr += 2; /* avoid empty string */
else inescq = TRUE;
continue;
}
if (escape == ESC_E) continue; /* Perl ignores an orphan \E */
/* For metasequences that actually match a character, we disable the
setting of a first character if it hasn't already been set. */

View File

@ -250,6 +250,7 @@ Arguments:
code the compiled regex
stringname the name of the capturing substring
ovector the vector of matched substrings
stringcount number of captured substrings
Returns: the number of the first that is set,
or the number of the last one if none are set,
@ -258,13 +259,16 @@ Returns: the number of the first that is set,
#if defined COMPILE_PCRE8
static int
get_first_set(const pcre *code, const char *stringname, int *ovector)
get_first_set(const pcre *code, const char *stringname, int *ovector,
int stringcount)
#elif defined COMPILE_PCRE16
static int
get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector)
get_first_set(const pcre16 *code, PCRE_SPTR16 stringname, int *ovector,
int stringcount)
#elif defined COMPILE_PCRE32
static int
get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector)
get_first_set(const pcre32 *code, PCRE_SPTR32 stringname, int *ovector,
int stringcount)
#endif
{
const REAL_PCRE *re = (const REAL_PCRE *)code;
@ -295,7 +299,7 @@ if (entrysize <= 0) return entrysize;
for (entry = (pcre_uchar *)first; entry <= (pcre_uchar *)last; entry += entrysize)
{
int n = GET2(entry, 0);
if (ovector[n*2] >= 0) return n;
if (n < stringcount && ovector[n*2] >= 0) return n;
}
return GET2(entry, 0);
}
@ -402,7 +406,7 @@ pcre32_copy_named_substring(const pcre32 *code, PCRE_SPTR32 subject,
PCRE_UCHAR32 *buffer, int size)
#endif
{
int n = get_first_set(code, stringname, ovector);
int n = get_first_set(code, stringname, ovector, stringcount);
if (n <= 0) return n;
#if defined COMPILE_PCRE8
return pcre_copy_substring(subject, ovector, stringcount, n, buffer, size);
@ -457,7 +461,10 @@ pcre_uchar **stringlist;
pcre_uchar *p;
for (i = 0; i < double_count; i += 2)
size += sizeof(pcre_uchar *) + IN_UCHARS(ovector[i+1] - ovector[i] + 1);
{
size += sizeof(pcre_uchar *) + IN_UCHARS(1);
if (ovector[i+1] > ovector[i]) size += IN_UCHARS(ovector[i+1] - ovector[i]);
}
stringlist = (pcre_uchar **)(PUBL(malloc))(size);
if (stringlist == NULL) return PCRE_ERROR_NOMEMORY;
@ -473,7 +480,7 @@ p = (pcre_uchar *)(stringlist + stringcount + 1);
for (i = 0; i < double_count; i += 2)
{
int len = ovector[i+1] - ovector[i];
int len = (ovector[i+1] > ovector[i])? (ovector[i+1] - ovector[i]) : 0;
memcpy(p, subject + ovector[i], IN_UCHARS(len));
*stringlist++ = p;
p += len;
@ -619,7 +626,7 @@ pcre32_get_named_substring(const pcre32 *code, PCRE_SPTR32 subject,
PCRE_SPTR32 *stringptr)
#endif
{
int n = get_first_set(code, stringname, ovector);
int n = get_first_set(code, stringname, ovector, stringcount);
if (n <= 0) return n;
#if defined COMPILE_PCRE8
return pcre_get_substring(subject, ovector, stringcount, n, stringptr);

View File

@ -4342,8 +4342,10 @@ switch(length)
case 4:
if ((ranges[1] - ranges[0]) == (ranges[3] - ranges[2])
&& (ranges[0] | (ranges[2] - ranges[0])) == ranges[2]
&& (ranges[1] & (ranges[2] - ranges[0])) == 0
&& is_powerof2(ranges[2] - ranges[0]))
{
SLJIT_ASSERT((ranges[0] & (ranges[2] - ranges[0])) == 0 && (ranges[2] & ranges[3] & (ranges[2] - ranges[0])) != 0);
OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, ranges[2] - ranges[0]);
if (ranges[2] + 1 != ranges[3])
{
@ -4931,7 +4933,8 @@ else if ((cc[-1] & XCL_MAP) != 0)
if (!check_class_ranges(common, (const pcre_uint8 *)cc, FALSE, TRUE, list))
{
#ifdef COMPILE_PCRE8
SLJIT_ASSERT(common->utf);
jump = NULL;
if (common->utf)
#endif
jump = CMP(SLJIT_GREATER, TMP1, 0, SLJIT_IMM, 255);
@ -4942,6 +4945,9 @@ else if ((cc[-1] & XCL_MAP) != 0)
OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
add_jump(compiler, list, JUMP(SLJIT_NOT_ZERO));
#ifdef COMPILE_PCRE8
if (common->utf)
#endif
JUMPHERE(jump);
}
@ -5250,7 +5256,7 @@ while (*cc != XCL_END)
OP_FLAGS(SLJIT_MOV, TMP2, 0, SLJIT_UNUSED, 0, SLJIT_LESS_EQUAL);
SET_CHAR_OFFSET(0);
OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xff);
OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x7f);
OP_FLAGS(SLJIT_AND, TMP2, 0, TMP2, 0, SLJIT_LESS_EQUAL);
SET_TYPE_OFFSET(ucp_Pc);
@ -8477,7 +8483,6 @@ while (cc < ccend)
OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(1), STR_PTR, 0);
}
BACKTRACK_AS(braminzero_backtrack)->matchingpath = LABEL();
if (cc[1] > OP_ASSERTBACK_NOT)
count_match(common);
break;
@ -9660,7 +9665,7 @@ static SLJIT_INLINE void compile_recurse(compiler_common *common)
DEFINE_COMPILER;
pcre_uchar *cc = common->start + common->currententry->start;
pcre_uchar *ccbegin = cc + 1 + LINK_SIZE + (*cc == OP_BRA ? 0 : IMM2_SIZE);
pcre_uchar *ccend = bracketend(cc);
pcre_uchar *ccend = bracketend(cc) - (1 + LINK_SIZE);
BOOL needs_control_head;
int framesize = get_framesize(common, cc, NULL, TRUE, &needs_control_head);
int private_data_size = get_private_data_copy_length(common, ccbegin, ccend, needs_control_head);

View File

@ -246,7 +246,7 @@ while ((t = *data++) != XCL_END)
case PT_PXPUNCT:
if ((PRIV(ucp_gentype)[prop->chartype] == ucp_P ||
(c < 256 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
(c < 128 && PRIV(ucp_gentype)[prop->chartype] == ucp_S)) == isprop)
return !negated;
break;

View File

@ -869,34 +869,6 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op2(struct sljit_compiler *compiler
sljit_si src1, sljit_sw src1w,
sljit_si src2, sljit_sw src2w);
/* The following function is a helper function for sljit_emit_op_custom.
It returns with the real machine register index ( >=0 ) of any SLJIT_R,
SLJIT_S and SLJIT_SP registers.
Note: it returns with -1 for virtual registers (only on x86-32). */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg);
/* The following function is a helper function for sljit_emit_op_custom.
It returns with the real machine register index of any SLJIT_FLOAT register.
Note: the index is always an even number on ARM (except ARM-64), MIPS, and SPARC. */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg);
/* Any instruction can be inserted into the instruction stream by
sljit_emit_op_custom. It has a similar purpose as inline assembly.
The size parameter must match to the instruction size of the target
architecture:
x86: 0 < size <= 15. The instruction argument can be byte aligned.
Thumb2: if size == 2, the instruction argument must be 2 byte aligned.
if size == 4, the instruction argument must be 4 byte aligned.
Otherwise: size must be 4 and instruction argument must be 4 byte aligned. */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size);
/* Returns with non-zero if fpu is available. */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_is_fpu_available(void);
@ -1214,4 +1186,64 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_function_context(void** func_ptr, struct
#endif /* !(defined SLJIT_INDIRECT_CALL && SLJIT_INDIRECT_CALL) */
/* --------------------------------------------------------------------- */
/* CPU specific functions */
/* --------------------------------------------------------------------- */
/* The following function is a helper function for sljit_emit_op_custom.
It returns with the real machine register index ( >=0 ) of any SLJIT_R,
SLJIT_S and SLJIT_SP registers.
Note: it returns with -1 for virtual registers (only on x86-32). */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_register_index(sljit_si reg);
/* The following function is a helper function for sljit_emit_op_custom.
It returns with the real machine register index of any SLJIT_FLOAT register.
Note: the index is always an even number on ARM (except ARM-64), MIPS, and SPARC. */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_get_float_register_index(sljit_si reg);
/* Any instruction can be inserted into the instruction stream by
sljit_emit_op_custom. It has a similar purpose as inline assembly.
The size parameter must match to the instruction size of the target
architecture:
x86: 0 < size <= 15. The instruction argument can be byte aligned.
Thumb2: if size == 2, the instruction argument must be 2 byte aligned.
if size == 4, the instruction argument must be 4 byte aligned.
Otherwise: size must be 4 and instruction argument must be 4 byte aligned. */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_emit_op_custom(struct sljit_compiler *compiler,
void *instruction, sljit_si size);
#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86)
/* Returns with non-zero if sse2 is available. */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_sse2_available(void);
/* Returns with non-zero if cmov instruction is available. */
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_cmov_available(void);
/* Emit a conditional mov instruction on x86 CPUs. This instruction
moves src to destination, if the condition is satisfied. Unlike
other arithmetic instructions, destination must be a register.
Before such instructions are emitted, cmov support should be
checked by sljit_x86_is_cmov_available function.
type must be between SLJIT_EQUAL and SLJIT_S_ORDERED
dst_reg must be a valid register and it can be combined
with SLJIT_INT_OP to perform 32 bit arithmetic
Flags: I - (never set any flags)
*/
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_emit_cmov(struct sljit_compiler *compiler,
sljit_si type,
sljit_si dst_reg,
sljit_si src, sljit_sw srcw);
#endif
#endif /* _SLJIT_LIR_H_ */

View File

@ -2936,3 +2936,69 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_set_const(sljit_uw addr, sljit_sw new_consta
{
*(sljit_sw*)addr = new_constant;
}
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_sse2_available(void)
{
#if (defined SLJIT_DETECT_SSE2 && SLJIT_DETECT_SSE2)
if (cpu_has_sse2 == -1)
get_cpu_features();
return cpu_has_sse2;
#else
return 1;
#endif
}
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_is_cmov_available(void)
{
if (cpu_has_cmov == -1)
get_cpu_features();
return cpu_has_cmov;
}
SLJIT_API_FUNC_ATTRIBUTE sljit_si sljit_x86_emit_cmov(struct sljit_compiler *compiler,
sljit_si type,
sljit_si dst_reg,
sljit_si src, sljit_sw srcw)
{
sljit_ub* inst;
CHECK_ERROR();
#if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
CHECK_ARGUMENT(sljit_x86_is_cmov_available());
CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_INT_OP)));
CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_D_ORDERED);
CHECK_ARGUMENT(FUNCTION_CHECK_IS_REG(dst_reg & ~SLJIT_INT_OP));
FUNCTION_CHECK_SRC(src, srcw);
#endif
#if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
if (SLJIT_UNLIKELY(!!compiler->verbose)) {
fprintf(compiler->verbose, " x86_cmov%s %s%s, ",
!(dst_reg & SLJIT_INT_OP) ? "" : ".i",
JUMP_PREFIX(type), jump_names[type & 0xff]);
sljit_verbose_reg(compiler, dst_reg & ~SLJIT_INT_OP);
fprintf(compiler->verbose, ", ");
sljit_verbose_param(compiler, src, srcw);
fprintf(compiler->verbose, "\n");
}
#endif
ADJUST_LOCAL_OFFSET(src, srcw);
CHECK_EXTRA_REGS(src, srcw, (void)0);
#if (defined SLJIT_CONFIG_X86_64 && SLJIT_CONFIG_X86_64)
compiler->mode32 = dst_reg & SLJIT_INT_OP;
#endif
dst_reg &= ~SLJIT_INT_OP;
if (SLJIT_UNLIKELY(src & SLJIT_IMM)) {
EMIT_MOV(compiler, TMP_REG1, 0, SLJIT_IMM, srcw);
src = TMP_REG1;
srcw = 0;
}
inst = emit_x86_instruction(compiler, 2, dst_reg, 0, src, srcw);
FAIL_IF(!inst);
*inst++ = GROUP_0F;
*inst = get_jump_code(type & 0xff) - 0x40;
return SLJIT_SUCCESS;
}

View File

@ -1,6 +1,6 @@
Contains the header and sources files from selected xcb libraries:
libxcb-1.5 together with xcb-proto-1.6 (sync, xfixes, randr sources)
libxcb-1.5 together with xcb-proto-1.6 (sync, xfixes, randr, xinerama sources)
# libxkbcommon-x11 requires libxcb-xkb >= 1.10
libxcb-1.10 together with xcb-proto-1.10 (xkb sources)
libxcb-util-image-0.3.9

808
src/3rdparty/xcb/include/xcb/xinerama.h vendored Normal file
View File

@ -0,0 +1,808 @@
/*
* This file generated automatically from xinerama.xml by c_client.py.
* Edit at your peril.
*/
/**
* @defgroup XCB_Xinerama_API XCB Xinerama API
* @brief Xinerama XCB Protocol Implementation.
* @{
**/
#ifndef __XINERAMA_H
#define __XINERAMA_H
#include "xcb.h"
#include "xproto.h"
#ifdef __cplusplus
extern "C" {
#endif
#define XCB_XINERAMA_MAJOR_VERSION 1
#define XCB_XINERAMA_MINOR_VERSION 1
extern xcb_extension_t xcb_xinerama_id;
/**
* @brief xcb_xinerama_screen_info_t
**/
typedef struct xcb_xinerama_screen_info_t {
int16_t x_org; /**< */
int16_t y_org; /**< */
uint16_t width; /**< */
uint16_t height; /**< */
} xcb_xinerama_screen_info_t;
/**
* @brief xcb_xinerama_screen_info_iterator_t
**/
typedef struct xcb_xinerama_screen_info_iterator_t {
xcb_xinerama_screen_info_t *data; /**< */
int rem; /**< */
int index; /**< */
} xcb_xinerama_screen_info_iterator_t;
/**
* @brief xcb_xinerama_query_version_cookie_t
**/
typedef struct xcb_xinerama_query_version_cookie_t {
unsigned int sequence; /**< */
} xcb_xinerama_query_version_cookie_t;
/** Opcode for xcb_xinerama_query_version. */
#define XCB_XINERAMA_QUERY_VERSION 0
/**
* @brief xcb_xinerama_query_version_request_t
**/
typedef struct xcb_xinerama_query_version_request_t {
uint8_t major_opcode; /**< */
uint8_t minor_opcode; /**< */
uint16_t length; /**< */
uint8_t major; /**< */
uint8_t minor; /**< */
} xcb_xinerama_query_version_request_t;
/**
* @brief xcb_xinerama_query_version_reply_t
**/
typedef struct xcb_xinerama_query_version_reply_t {
uint8_t response_type; /**< */
uint8_t pad0; /**< */
uint16_t sequence; /**< */
uint32_t length; /**< */
uint16_t major; /**< */
uint16_t minor; /**< */
} xcb_xinerama_query_version_reply_t;
/**
* @brief xcb_xinerama_get_state_cookie_t
**/
typedef struct xcb_xinerama_get_state_cookie_t {
unsigned int sequence; /**< */
} xcb_xinerama_get_state_cookie_t;
/** Opcode for xcb_xinerama_get_state. */
#define XCB_XINERAMA_GET_STATE 1
/**
* @brief xcb_xinerama_get_state_request_t
**/
typedef struct xcb_xinerama_get_state_request_t {
uint8_t major_opcode; /**< */
uint8_t minor_opcode; /**< */
uint16_t length; /**< */
xcb_window_t window; /**< */
} xcb_xinerama_get_state_request_t;
/**
* @brief xcb_xinerama_get_state_reply_t
**/
typedef struct xcb_xinerama_get_state_reply_t {
uint8_t response_type; /**< */
uint8_t state; /**< */
uint16_t sequence; /**< */
uint32_t length; /**< */
xcb_window_t window; /**< */
} xcb_xinerama_get_state_reply_t;
/**
* @brief xcb_xinerama_get_screen_count_cookie_t
**/
typedef struct xcb_xinerama_get_screen_count_cookie_t {
unsigned int sequence; /**< */
} xcb_xinerama_get_screen_count_cookie_t;
/** Opcode for xcb_xinerama_get_screen_count. */
#define XCB_XINERAMA_GET_SCREEN_COUNT 2
/**
* @brief xcb_xinerama_get_screen_count_request_t
**/
typedef struct xcb_xinerama_get_screen_count_request_t {
uint8_t major_opcode; /**< */
uint8_t minor_opcode; /**< */
uint16_t length; /**< */
xcb_window_t window; /**< */
} xcb_xinerama_get_screen_count_request_t;
/**
* @brief xcb_xinerama_get_screen_count_reply_t
**/
typedef struct xcb_xinerama_get_screen_count_reply_t {
uint8_t response_type; /**< */
uint8_t screen_count; /**< */
uint16_t sequence; /**< */
uint32_t length; /**< */
xcb_window_t window; /**< */
} xcb_xinerama_get_screen_count_reply_t;
/**
* @brief xcb_xinerama_get_screen_size_cookie_t
**/
typedef struct xcb_xinerama_get_screen_size_cookie_t {
unsigned int sequence; /**< */
} xcb_xinerama_get_screen_size_cookie_t;
/** Opcode for xcb_xinerama_get_screen_size. */
#define XCB_XINERAMA_GET_SCREEN_SIZE 3
/**
* @brief xcb_xinerama_get_screen_size_request_t
**/
typedef struct xcb_xinerama_get_screen_size_request_t {
uint8_t major_opcode; /**< */
uint8_t minor_opcode; /**< */
uint16_t length; /**< */
xcb_window_t window; /**< */
uint32_t screen; /**< */
} xcb_xinerama_get_screen_size_request_t;
/**
* @brief xcb_xinerama_get_screen_size_reply_t
**/
typedef struct xcb_xinerama_get_screen_size_reply_t {
uint8_t response_type; /**< */
uint8_t pad0; /**< */
uint16_t sequence; /**< */
uint32_t length; /**< */
uint32_t width; /**< */
uint32_t height; /**< */
xcb_window_t window; /**< */
uint32_t screen; /**< */
} xcb_xinerama_get_screen_size_reply_t;
/**
* @brief xcb_xinerama_is_active_cookie_t
**/
typedef struct xcb_xinerama_is_active_cookie_t {
unsigned int sequence; /**< */
} xcb_xinerama_is_active_cookie_t;
/** Opcode for xcb_xinerama_is_active. */
#define XCB_XINERAMA_IS_ACTIVE 4
/**
* @brief xcb_xinerama_is_active_request_t
**/
typedef struct xcb_xinerama_is_active_request_t {
uint8_t major_opcode; /**< */
uint8_t minor_opcode; /**< */
uint16_t length; /**< */
} xcb_xinerama_is_active_request_t;
/**
* @brief xcb_xinerama_is_active_reply_t
**/
typedef struct xcb_xinerama_is_active_reply_t {
uint8_t response_type; /**< */
uint8_t pad0; /**< */
uint16_t sequence; /**< */
uint32_t length; /**< */
uint32_t state; /**< */
} xcb_xinerama_is_active_reply_t;
/**
* @brief xcb_xinerama_query_screens_cookie_t
**/
typedef struct xcb_xinerama_query_screens_cookie_t {
unsigned int sequence; /**< */
} xcb_xinerama_query_screens_cookie_t;
/** Opcode for xcb_xinerama_query_screens. */
#define XCB_XINERAMA_QUERY_SCREENS 5
/**
* @brief xcb_xinerama_query_screens_request_t
**/
typedef struct xcb_xinerama_query_screens_request_t {
uint8_t major_opcode; /**< */
uint8_t minor_opcode; /**< */
uint16_t length; /**< */
} xcb_xinerama_query_screens_request_t;
/**
* @brief xcb_xinerama_query_screens_reply_t
**/
typedef struct xcb_xinerama_query_screens_reply_t {
uint8_t response_type; /**< */
uint8_t pad0; /**< */
uint16_t sequence; /**< */
uint32_t length; /**< */
uint32_t number; /**< */
uint8_t pad1[20]; /**< */
} xcb_xinerama_query_screens_reply_t;
/**
* Get the next element of the iterator
* @param i Pointer to a xcb_xinerama_screen_info_iterator_t
*
* Get the next element in the iterator. The member rem is
* decreased by one. The member data points to the next
* element. The member index is increased by sizeof(xcb_xinerama_screen_info_t)
*/
/*****************************************************************************
**
** void xcb_xinerama_screen_info_next
**
** @param xcb_xinerama_screen_info_iterator_t *i
** @returns void
**
*****************************************************************************/
void
xcb_xinerama_screen_info_next (xcb_xinerama_screen_info_iterator_t *i /**< */);
/**
* Return the iterator pointing to the last element
* @param i An xcb_xinerama_screen_info_iterator_t
* @return The iterator pointing to the last element
*
* Set the current element in the iterator to the last element.
* The member rem is set to 0. The member data points to the
* last element.
*/
/*****************************************************************************
**
** xcb_generic_iterator_t xcb_xinerama_screen_info_end
**
** @param xcb_xinerama_screen_info_iterator_t i
** @returns xcb_generic_iterator_t
**
*****************************************************************************/
xcb_generic_iterator_t
xcb_xinerama_screen_info_end (xcb_xinerama_screen_info_iterator_t i /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
*/
/*****************************************************************************
**
** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version
**
** @param xcb_connection_t *c
** @param uint8_t major
** @param uint8_t minor
** @returns xcb_xinerama_query_version_cookie_t
**
*****************************************************************************/
xcb_xinerama_query_version_cookie_t
xcb_xinerama_query_version (xcb_connection_t *c /**< */,
uint8_t major /**< */,
uint8_t minor /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
* This form can be used only if the request will cause
* a reply to be generated. Any returned error will be
* placed in the event queue.
*/
/*****************************************************************************
**
** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version_unchecked
**
** @param xcb_connection_t *c
** @param uint8_t major
** @param uint8_t minor
** @returns xcb_xinerama_query_version_cookie_t
**
*****************************************************************************/
xcb_xinerama_query_version_cookie_t
xcb_xinerama_query_version_unchecked (xcb_connection_t *c /**< */,
uint8_t major /**< */,
uint8_t minor /**< */);
/**
* Return the reply
* @param c The connection
* @param cookie The cookie
* @param e The xcb_generic_error_t supplied
*
* Returns the reply of the request asked by
*
* The parameter @p e supplied to this function must be NULL if
* xcb_xinerama_query_version_unchecked(). is used.
* Otherwise, it stores the error if any.
*
* The returned value must be freed by the caller using free().
*/
/*****************************************************************************
**
** xcb_xinerama_query_version_reply_t * xcb_xinerama_query_version_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_query_version_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_query_version_reply_t *
**
*****************************************************************************/
xcb_xinerama_query_version_reply_t *
xcb_xinerama_query_version_reply (xcb_connection_t *c /**< */,
xcb_xinerama_query_version_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
*/
/*****************************************************************************
**
** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @returns xcb_xinerama_get_state_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_state_cookie_t
xcb_xinerama_get_state (xcb_connection_t *c /**< */,
xcb_window_t window /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
* This form can be used only if the request will cause
* a reply to be generated. Any returned error will be
* placed in the event queue.
*/
/*****************************************************************************
**
** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state_unchecked
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @returns xcb_xinerama_get_state_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_state_cookie_t
xcb_xinerama_get_state_unchecked (xcb_connection_t *c /**< */,
xcb_window_t window /**< */);
/**
* Return the reply
* @param c The connection
* @param cookie The cookie
* @param e The xcb_generic_error_t supplied
*
* Returns the reply of the request asked by
*
* The parameter @p e supplied to this function must be NULL if
* xcb_xinerama_get_state_unchecked(). is used.
* Otherwise, it stores the error if any.
*
* The returned value must be freed by the caller using free().
*/
/*****************************************************************************
**
** xcb_xinerama_get_state_reply_t * xcb_xinerama_get_state_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_get_state_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_get_state_reply_t *
**
*****************************************************************************/
xcb_xinerama_get_state_reply_t *
xcb_xinerama_get_state_reply (xcb_connection_t *c /**< */,
xcb_xinerama_get_state_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
*/
/*****************************************************************************
**
** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @returns xcb_xinerama_get_screen_count_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_screen_count_cookie_t
xcb_xinerama_get_screen_count (xcb_connection_t *c /**< */,
xcb_window_t window /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
* This form can be used only if the request will cause
* a reply to be generated. Any returned error will be
* placed in the event queue.
*/
/*****************************************************************************
**
** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count_unchecked
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @returns xcb_xinerama_get_screen_count_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_screen_count_cookie_t
xcb_xinerama_get_screen_count_unchecked (xcb_connection_t *c /**< */,
xcb_window_t window /**< */);
/**
* Return the reply
* @param c The connection
* @param cookie The cookie
* @param e The xcb_generic_error_t supplied
*
* Returns the reply of the request asked by
*
* The parameter @p e supplied to this function must be NULL if
* xcb_xinerama_get_screen_count_unchecked(). is used.
* Otherwise, it stores the error if any.
*
* The returned value must be freed by the caller using free().
*/
/*****************************************************************************
**
** xcb_xinerama_get_screen_count_reply_t * xcb_xinerama_get_screen_count_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_get_screen_count_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_get_screen_count_reply_t *
**
*****************************************************************************/
xcb_xinerama_get_screen_count_reply_t *
xcb_xinerama_get_screen_count_reply (xcb_connection_t *c /**< */,
xcb_xinerama_get_screen_count_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
*/
/*****************************************************************************
**
** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @param uint32_t screen
** @returns xcb_xinerama_get_screen_size_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_screen_size_cookie_t
xcb_xinerama_get_screen_size (xcb_connection_t *c /**< */,
xcb_window_t window /**< */,
uint32_t screen /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
* This form can be used only if the request will cause
* a reply to be generated. Any returned error will be
* placed in the event queue.
*/
/*****************************************************************************
**
** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size_unchecked
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @param uint32_t screen
** @returns xcb_xinerama_get_screen_size_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_screen_size_cookie_t
xcb_xinerama_get_screen_size_unchecked (xcb_connection_t *c /**< */,
xcb_window_t window /**< */,
uint32_t screen /**< */);
/**
* Return the reply
* @param c The connection
* @param cookie The cookie
* @param e The xcb_generic_error_t supplied
*
* Returns the reply of the request asked by
*
* The parameter @p e supplied to this function must be NULL if
* xcb_xinerama_get_screen_size_unchecked(). is used.
* Otherwise, it stores the error if any.
*
* The returned value must be freed by the caller using free().
*/
/*****************************************************************************
**
** xcb_xinerama_get_screen_size_reply_t * xcb_xinerama_get_screen_size_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_get_screen_size_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_get_screen_size_reply_t *
**
*****************************************************************************/
xcb_xinerama_get_screen_size_reply_t *
xcb_xinerama_get_screen_size_reply (xcb_connection_t *c /**< */,
xcb_xinerama_get_screen_size_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
*/
/*****************************************************************************
**
** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active
**
** @param xcb_connection_t *c
** @returns xcb_xinerama_is_active_cookie_t
**
*****************************************************************************/
xcb_xinerama_is_active_cookie_t
xcb_xinerama_is_active (xcb_connection_t *c /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
* This form can be used only if the request will cause
* a reply to be generated. Any returned error will be
* placed in the event queue.
*/
/*****************************************************************************
**
** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active_unchecked
**
** @param xcb_connection_t *c
** @returns xcb_xinerama_is_active_cookie_t
**
*****************************************************************************/
xcb_xinerama_is_active_cookie_t
xcb_xinerama_is_active_unchecked (xcb_connection_t *c /**< */);
/**
* Return the reply
* @param c The connection
* @param cookie The cookie
* @param e The xcb_generic_error_t supplied
*
* Returns the reply of the request asked by
*
* The parameter @p e supplied to this function must be NULL if
* xcb_xinerama_is_active_unchecked(). is used.
* Otherwise, it stores the error if any.
*
* The returned value must be freed by the caller using free().
*/
/*****************************************************************************
**
** xcb_xinerama_is_active_reply_t * xcb_xinerama_is_active_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_is_active_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_is_active_reply_t *
**
*****************************************************************************/
xcb_xinerama_is_active_reply_t *
xcb_xinerama_is_active_reply (xcb_connection_t *c /**< */,
xcb_xinerama_is_active_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
*/
/*****************************************************************************
**
** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens
**
** @param xcb_connection_t *c
** @returns xcb_xinerama_query_screens_cookie_t
**
*****************************************************************************/
xcb_xinerama_query_screens_cookie_t
xcb_xinerama_query_screens (xcb_connection_t *c /**< */);
/**
* Delivers a request to the X server
* @param c The connection
* @return A cookie
*
* Delivers a request to the X server.
*
* This form can be used only if the request will cause
* a reply to be generated. Any returned error will be
* placed in the event queue.
*/
/*****************************************************************************
**
** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens_unchecked
**
** @param xcb_connection_t *c
** @returns xcb_xinerama_query_screens_cookie_t
**
*****************************************************************************/
xcb_xinerama_query_screens_cookie_t
xcb_xinerama_query_screens_unchecked (xcb_connection_t *c /**< */);
/*****************************************************************************
**
** xcb_xinerama_screen_info_t * xcb_xinerama_query_screens_screen_info
**
** @param const xcb_xinerama_query_screens_reply_t *R
** @returns xcb_xinerama_screen_info_t *
**
*****************************************************************************/
xcb_xinerama_screen_info_t *
xcb_xinerama_query_screens_screen_info (const xcb_xinerama_query_screens_reply_t *R /**< */);
/*****************************************************************************
**
** int xcb_xinerama_query_screens_screen_info_length
**
** @param const xcb_xinerama_query_screens_reply_t *R
** @returns int
**
*****************************************************************************/
int
xcb_xinerama_query_screens_screen_info_length (const xcb_xinerama_query_screens_reply_t *R /**< */);
/*****************************************************************************
**
** xcb_xinerama_screen_info_iterator_t xcb_xinerama_query_screens_screen_info_iterator
**
** @param const xcb_xinerama_query_screens_reply_t *R
** @returns xcb_xinerama_screen_info_iterator_t
**
*****************************************************************************/
xcb_xinerama_screen_info_iterator_t
xcb_xinerama_query_screens_screen_info_iterator (const xcb_xinerama_query_screens_reply_t *R /**< */);
/**
* Return the reply
* @param c The connection
* @param cookie The cookie
* @param e The xcb_generic_error_t supplied
*
* Returns the reply of the request asked by
*
* The parameter @p e supplied to this function must be NULL if
* xcb_xinerama_query_screens_unchecked(). is used.
* Otherwise, it stores the error if any.
*
* The returned value must be freed by the caller using free().
*/
/*****************************************************************************
**
** xcb_xinerama_query_screens_reply_t * xcb_xinerama_query_screens_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_query_screens_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_query_screens_reply_t *
**
*****************************************************************************/
xcb_xinerama_query_screens_reply_t *
xcb_xinerama_query_screens_reply (xcb_connection_t *c /**< */,
xcb_xinerama_query_screens_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */);
#ifdef __cplusplus
}
#endif
#endif
/**
* @}
*/

655
src/3rdparty/xcb/libxcb/xinerama.c vendored Normal file
View File

@ -0,0 +1,655 @@
/*
* This file generated automatically from xinerama.xml by c_client.py.
* Edit at your peril.
*/
#include <string.h>
#include <assert.h>
#include "xcbext.h"
#include "xinerama.h"
#include "xproto.h"
xcb_extension_t xcb_xinerama_id = { "XINERAMA", 0 };
/*****************************************************************************
**
** void xcb_xinerama_screen_info_next
**
** @param xcb_xinerama_screen_info_iterator_t *i
** @returns void
**
*****************************************************************************/
void
xcb_xinerama_screen_info_next (xcb_xinerama_screen_info_iterator_t *i /**< */)
{
--i->rem;
++i->data;
i->index += sizeof(xcb_xinerama_screen_info_t);
}
/*****************************************************************************
**
** xcb_generic_iterator_t xcb_xinerama_screen_info_end
**
** @param xcb_xinerama_screen_info_iterator_t i
** @returns xcb_generic_iterator_t
**
*****************************************************************************/
xcb_generic_iterator_t
xcb_xinerama_screen_info_end (xcb_xinerama_screen_info_iterator_t i /**< */)
{
xcb_generic_iterator_t ret;
ret.data = i.data + i.rem;
ret.index = i.index + ((char *) ret.data - (char *) i.data);
ret.rem = 0;
return ret;
}
/*****************************************************************************
**
** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version
**
** @param xcb_connection_t *c
** @param uint8_t major
** @param uint8_t minor
** @returns xcb_xinerama_query_version_cookie_t
**
*****************************************************************************/
xcb_xinerama_query_version_cookie_t
xcb_xinerama_query_version (xcb_connection_t *c /**< */,
uint8_t major /**< */,
uint8_t minor /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_QUERY_VERSION,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_query_version_cookie_t xcb_ret;
xcb_xinerama_query_version_request_t xcb_out;
xcb_out.major = major;
xcb_out.minor = minor;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_query_version_cookie_t xcb_xinerama_query_version_unchecked
**
** @param xcb_connection_t *c
** @param uint8_t major
** @param uint8_t minor
** @returns xcb_xinerama_query_version_cookie_t
**
*****************************************************************************/
xcb_xinerama_query_version_cookie_t
xcb_xinerama_query_version_unchecked (xcb_connection_t *c /**< */,
uint8_t major /**< */,
uint8_t minor /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_QUERY_VERSION,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_query_version_cookie_t xcb_ret;
xcb_xinerama_query_version_request_t xcb_out;
xcb_out.major = major;
xcb_out.minor = minor;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_query_version_reply_t * xcb_xinerama_query_version_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_query_version_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_query_version_reply_t *
**
*****************************************************************************/
xcb_xinerama_query_version_reply_t *
xcb_xinerama_query_version_reply (xcb_connection_t *c /**< */,
xcb_xinerama_query_version_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */)
{
return (xcb_xinerama_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
}
/*****************************************************************************
**
** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @returns xcb_xinerama_get_state_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_state_cookie_t
xcb_xinerama_get_state (xcb_connection_t *c /**< */,
xcb_window_t window /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_GET_STATE,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_get_state_cookie_t xcb_ret;
xcb_xinerama_get_state_request_t xcb_out;
xcb_out.window = window;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_get_state_cookie_t xcb_xinerama_get_state_unchecked
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @returns xcb_xinerama_get_state_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_state_cookie_t
xcb_xinerama_get_state_unchecked (xcb_connection_t *c /**< */,
xcb_window_t window /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_GET_STATE,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_get_state_cookie_t xcb_ret;
xcb_xinerama_get_state_request_t xcb_out;
xcb_out.window = window;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_get_state_reply_t * xcb_xinerama_get_state_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_get_state_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_get_state_reply_t *
**
*****************************************************************************/
xcb_xinerama_get_state_reply_t *
xcb_xinerama_get_state_reply (xcb_connection_t *c /**< */,
xcb_xinerama_get_state_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */)
{
return (xcb_xinerama_get_state_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
}
/*****************************************************************************
**
** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @returns xcb_xinerama_get_screen_count_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_screen_count_cookie_t
xcb_xinerama_get_screen_count (xcb_connection_t *c /**< */,
xcb_window_t window /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_get_screen_count_cookie_t xcb_ret;
xcb_xinerama_get_screen_count_request_t xcb_out;
xcb_out.window = window;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_get_screen_count_cookie_t xcb_xinerama_get_screen_count_unchecked
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @returns xcb_xinerama_get_screen_count_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_screen_count_cookie_t
xcb_xinerama_get_screen_count_unchecked (xcb_connection_t *c /**< */,
xcb_window_t window /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_GET_SCREEN_COUNT,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_get_screen_count_cookie_t xcb_ret;
xcb_xinerama_get_screen_count_request_t xcb_out;
xcb_out.window = window;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_get_screen_count_reply_t * xcb_xinerama_get_screen_count_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_get_screen_count_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_get_screen_count_reply_t *
**
*****************************************************************************/
xcb_xinerama_get_screen_count_reply_t *
xcb_xinerama_get_screen_count_reply (xcb_connection_t *c /**< */,
xcb_xinerama_get_screen_count_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */)
{
return (xcb_xinerama_get_screen_count_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
}
/*****************************************************************************
**
** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @param uint32_t screen
** @returns xcb_xinerama_get_screen_size_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_screen_size_cookie_t
xcb_xinerama_get_screen_size (xcb_connection_t *c /**< */,
xcb_window_t window /**< */,
uint32_t screen /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_get_screen_size_cookie_t xcb_ret;
xcb_xinerama_get_screen_size_request_t xcb_out;
xcb_out.window = window;
xcb_out.screen = screen;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_get_screen_size_cookie_t xcb_xinerama_get_screen_size_unchecked
**
** @param xcb_connection_t *c
** @param xcb_window_t window
** @param uint32_t screen
** @returns xcb_xinerama_get_screen_size_cookie_t
**
*****************************************************************************/
xcb_xinerama_get_screen_size_cookie_t
xcb_xinerama_get_screen_size_unchecked (xcb_connection_t *c /**< */,
xcb_window_t window /**< */,
uint32_t screen /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_GET_SCREEN_SIZE,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_get_screen_size_cookie_t xcb_ret;
xcb_xinerama_get_screen_size_request_t xcb_out;
xcb_out.window = window;
xcb_out.screen = screen;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_get_screen_size_reply_t * xcb_xinerama_get_screen_size_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_get_screen_size_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_get_screen_size_reply_t *
**
*****************************************************************************/
xcb_xinerama_get_screen_size_reply_t *
xcb_xinerama_get_screen_size_reply (xcb_connection_t *c /**< */,
xcb_xinerama_get_screen_size_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */)
{
return (xcb_xinerama_get_screen_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
}
/*****************************************************************************
**
** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active
**
** @param xcb_connection_t *c
** @returns xcb_xinerama_is_active_cookie_t
**
*****************************************************************************/
xcb_xinerama_is_active_cookie_t
xcb_xinerama_is_active (xcb_connection_t *c /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_IS_ACTIVE,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_is_active_cookie_t xcb_ret;
xcb_xinerama_is_active_request_t xcb_out;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_is_active_cookie_t xcb_xinerama_is_active_unchecked
**
** @param xcb_connection_t *c
** @returns xcb_xinerama_is_active_cookie_t
**
*****************************************************************************/
xcb_xinerama_is_active_cookie_t
xcb_xinerama_is_active_unchecked (xcb_connection_t *c /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_IS_ACTIVE,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_is_active_cookie_t xcb_ret;
xcb_xinerama_is_active_request_t xcb_out;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_is_active_reply_t * xcb_xinerama_is_active_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_is_active_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_is_active_reply_t *
**
*****************************************************************************/
xcb_xinerama_is_active_reply_t *
xcb_xinerama_is_active_reply (xcb_connection_t *c /**< */,
xcb_xinerama_is_active_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */)
{
return (xcb_xinerama_is_active_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
}
/*****************************************************************************
**
** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens
**
** @param xcb_connection_t *c
** @returns xcb_xinerama_query_screens_cookie_t
**
*****************************************************************************/
xcb_xinerama_query_screens_cookie_t
xcb_xinerama_query_screens (xcb_connection_t *c /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_QUERY_SCREENS,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_query_screens_cookie_t xcb_ret;
xcb_xinerama_query_screens_request_t xcb_out;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_query_screens_cookie_t xcb_xinerama_query_screens_unchecked
**
** @param xcb_connection_t *c
** @returns xcb_xinerama_query_screens_cookie_t
**
*****************************************************************************/
xcb_xinerama_query_screens_cookie_t
xcb_xinerama_query_screens_unchecked (xcb_connection_t *c /**< */)
{
static const xcb_protocol_request_t xcb_req = {
/* count */ 2,
/* ext */ &xcb_xinerama_id,
/* opcode */ XCB_XINERAMA_QUERY_SCREENS,
/* isvoid */ 0
};
struct iovec xcb_parts[4];
xcb_xinerama_query_screens_cookie_t xcb_ret;
xcb_xinerama_query_screens_request_t xcb_out;
xcb_parts[2].iov_base = (char *) &xcb_out;
xcb_parts[2].iov_len = sizeof(xcb_out);
xcb_parts[3].iov_base = 0;
xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
return xcb_ret;
}
/*****************************************************************************
**
** xcb_xinerama_screen_info_t * xcb_xinerama_query_screens_screen_info
**
** @param const xcb_xinerama_query_screens_reply_t *R
** @returns xcb_xinerama_screen_info_t *
**
*****************************************************************************/
xcb_xinerama_screen_info_t *
xcb_xinerama_query_screens_screen_info (const xcb_xinerama_query_screens_reply_t *R /**< */)
{
return (xcb_xinerama_screen_info_t *) (R + 1);
}
/*****************************************************************************
**
** int xcb_xinerama_query_screens_screen_info_length
**
** @param const xcb_xinerama_query_screens_reply_t *R
** @returns int
**
*****************************************************************************/
int
xcb_xinerama_query_screens_screen_info_length (const xcb_xinerama_query_screens_reply_t *R /**< */)
{
return R->number;
}
/*****************************************************************************
**
** xcb_xinerama_screen_info_iterator_t xcb_xinerama_query_screens_screen_info_iterator
**
** @param const xcb_xinerama_query_screens_reply_t *R
** @returns xcb_xinerama_screen_info_iterator_t
**
*****************************************************************************/
xcb_xinerama_screen_info_iterator_t
xcb_xinerama_query_screens_screen_info_iterator (const xcb_xinerama_query_screens_reply_t *R /**< */)
{
xcb_xinerama_screen_info_iterator_t i;
i.data = (xcb_xinerama_screen_info_t *) (R + 1);
i.rem = R->number;
i.index = (char *) i.data - (char *) R;
return i;
}
/*****************************************************************************
**
** xcb_xinerama_query_screens_reply_t * xcb_xinerama_query_screens_reply
**
** @param xcb_connection_t *c
** @param xcb_xinerama_query_screens_cookie_t cookie
** @param xcb_generic_error_t **e
** @returns xcb_xinerama_query_screens_reply_t *
**
*****************************************************************************/
xcb_xinerama_query_screens_reply_t *
xcb_xinerama_query_screens_reply (xcb_connection_t *c /**< */,
xcb_xinerama_query_screens_cookie_t cookie /**< */,
xcb_generic_error_t **e /**< */)
{
return (xcb_xinerama_query_screens_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
}

View File

@ -34,13 +34,8 @@
#include "zconf.h"
#include <qglobal.h>
#if defined(QT_VISIBILITY_AVAILABLE)
# undef ZEXTERN
# define ZEXTERN __attribute__((visibility("default")))
#else
# undef ZEXTERN
# define ZEXTERN Q_DECL_EXPORT
#endif
#undef ZEXTERN
#define ZEXTERN Q_CORE_EXPORT
#ifdef __cplusplus
extern "C" {

View File

@ -16,7 +16,7 @@ equals(QMAKE_HOST.os, Windows) {
gnutools.value = $$absolute_path(../../../../gnuwin32/bin)
exists($$gnutools.value/gperf.exe) {
gnutools.name = PATH
gnutools.CONFIG = prepend
gnutools.CONFIG = always_prepend
}
}

View File

@ -70,7 +70,14 @@ set(_qt5_corelib_extra_includes)
# Qt5_POSITION_INDEPENDENT_CODE variable is used in the # qt5_use_module
# macro to add it.
set(Qt5_POSITION_INDEPENDENT_CODE True)
set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\")
# On x86 and x86-64 systems with ELF binaries (especially Linux), due to
# a new optimization in GCC 5.x in combination with a recent version of
# GNU binutils, compiling Qt applications with -fPIE is no longer
# enough.
# Applications now need to be compiled with the -fPIC option if the Qt option
# \"reduce relocations\" is active. For backward compatibility only, Qt accepts
# the use of -fPIE for GCC 4.x versions.
if (CMAKE_VERSION VERSION_LESS 2.8.12
AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"
OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
@ -79,6 +86,20 @@ else()
set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP)
endif()
# Applications using qmake or cmake >= 2.8.12 as their build system will
# adapt automatically. Applications using an older release of cmake in
# combination with GCC 5.x need to change their CMakeLists.txt to add
# Qt5Core_EXECUTABLE_COMPILE_FLAGS to CMAKE_CXX_FLAGS. In particular,
# applications using cmake >= 2.8.9 and < 2.8.11 will continue to build
# with the -fPIE option and invoke the special compatibility mode if using
# GCC 4.x.
set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"\")
if (CMAKE_VERSION VERSION_LESS 2.8.12
AND (CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\"
AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))
set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\")
endif()
!!IF !isEmpty(QT_NAMESPACE)
list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)

View File

@ -94,7 +94,7 @@ endmacro()
# helper macro to set up a moc rule
function(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target)
function(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target moc_depends)
# Pass the parameters in a file. Set the working directory to
# be that containing the parameters file and reference it by
# just the file name. This is necessary because the moc tool on
@ -131,7 +131,7 @@ function(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target)
set(_moc_extra_parameters_file @${_moc_parameters_file})
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_MOC_EXECUTABLE} ${_moc_extra_parameters_file}
DEPENDS ${infile}
DEPENDS ${infile} ${moc_depends}
${_moc_working_dir}
VERBATIM)
endfunction()
@ -151,7 +151,7 @@ function(QT5_GENERATE_MOC infile outfile )
endif()
set(moc_target ${ARGV3})
endif()
qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}")
qt5_create_moc_command(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}" "")
set_source_files_properties(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
endfunction()
@ -164,13 +164,14 @@ function(QT5_WRAP_CPP outfiles )
set(options)
set(oneValueArgs TARGET)
set(multiValueArgs OPTIONS)
set(multiValueArgs OPTIONS DEPENDS)
cmake_parse_arguments(_WRAP_CPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(moc_files ${_WRAP_CPP_UNPARSED_ARGUMENTS})
set(moc_options ${_WRAP_CPP_OPTIONS})
set(moc_target ${_WRAP_CPP_TARGET})
set(moc_depends ${_WRAP_CPP_DEPENDS})
if (moc_target AND CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "The TARGET parameter to qt5_wrap_cpp is only available when using CMake 2.8.12 or later.")
@ -178,7 +179,7 @@ function(QT5_WRAP_CPP outfiles )
foreach(it ${moc_files})
get_filename_component(it ${it} ABSOLUTE)
qt5_make_output_file(${it} moc_ cpp outfile)
qt5_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}")
qt5_create_moc_command(${it} ${outfile} "${moc_flags}" "${moc_options}" "${moc_target}" "${moc_depends}")
list(APPEND ${outfiles} ${outfile})
endforeach()
set(${outfiles} ${${outfiles}} PARENT_SCOPE)

View File

@ -66,18 +66,8 @@
#endif
#ifdef Q_OS_WINRT
#include <wrl.h>
#include <windows.networking.h>
#include <windows.networking.sockets.h>
#include <windows.networking.connectivity.h>
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Foundation::Collections;
using namespace ABI::Windows::Networking;
using namespace ABI::Windows::Networking::Connectivity;
using namespace ABI::Windows::Networking::Sockets;
#endif
#include <Ws2tcpip.h>
#endif // Q_OS_WINRT
#if defined(Q_OS_VXWORKS) && defined(_WRS_KERNEL)
# include <envLib.h>
@ -1881,8 +1871,6 @@ QT_BEGIN_INCLUDE_NAMESPACE
#include "qt_windows.h"
QT_END_INCLUDE_NAMESPACE
#ifndef Q_OS_WINRT
# ifndef QT_BOOTSTRAPPED
class QWindowsSockInit
{
@ -1913,8 +1901,6 @@ QWindowsSockInit::~QWindowsSockInit()
Q_GLOBAL_STATIC(QWindowsSockInit, winsockInit)
# endif // QT_BOOTSTRAPPED
#endif // !Q_OS_WINRT
#ifdef Q_OS_WINRT
static inline HMODULE moduleHandleForFunction(LPCVOID address)
{
@ -2807,42 +2793,6 @@ QString QSysInfo::machineHostName()
struct utsname u;
if (uname(&u) == 0)
return QString::fromLocal8Bit(u.nodename);
#elif defined(Q_OS_WINRT)
ComPtr<INetworkInformationStatics> statics;
GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Connectivity_NetworkInformation).Get(), &statics);
ComPtr<IVectorView<HostName *>> hostNames;
statics->GetHostNames(&hostNames);
if (!hostNames)
return QString();
unsigned int size;
hostNames->get_Size(&size);
if (size == 0)
return QString();
for (unsigned int i = 0; i < size; ++i) {
ComPtr<IHostName> hostName;
hostNames->GetAt(i, &hostName);
HostNameType type;
hostName->get_Type(&type);
if (type != HostNameType_DomainName)
continue;
HString name;
hostName->get_CanonicalName(name.GetAddressOf());
UINT32 length;
PCWSTR rawString = name.GetRawBuffer(&length);
return QString::fromWCharArray(rawString, length);
}
ComPtr<IHostName> firstHost;
hostNames->GetAt(0, &firstHost);
HString name;
firstHost->get_CanonicalName(name.GetAddressOf());
UINT32 length;
PCWSTR rawString = name.GetRawBuffer(&length);
return QString::fromWCharArray(rawString, length);
#else
# ifdef Q_OS_WIN
// Important: QtNetwork depends on machineHostName() initializing ws2_32.dll

View File

@ -611,7 +611,6 @@ class QDataStream;
#if defined(Q_OS_WINRT)
# define QT_NO_FILESYSTEMWATCHER
# define QT_NO_GETADDRINFO
# define QT_NO_NETWORKPROXY
# define QT_NO_PROCESS
# define QT_NO_SOCKETNOTIFIER

View File

@ -1719,8 +1719,8 @@
\value Key_unknown
\value Key_Call A key to answer or initiate a call (see Qt::Key_ToggleCallHangup for a key to toggle current call state)
\value Key_Camera A key to activate the camera shutter
\value Key_CameraFocus A key to focus the camera
\value Key_Camera A key to activate the camera shutter. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
\value Key_CameraFocus A key to focus the camera. On Windows Runtime, the environment variable QT_QPA_ENABLE_CAMERA_KEYS must be set to receive the event.
\value Key_Context1
\value Key_Context2
\value Key_Context3

View File

@ -88,47 +88,51 @@
auto-detection implemented below.
*/
#if defined(__arm__) || defined(__TARGET_ARCH_ARM) || defined(_M_ARM) || defined(__aarch64__)
# define Q_PROCESSOR_ARM
# if defined(__aarch64__)
# define Q_PROCESSOR_ARM_64
# define Q_PROCESSOR_WORDSIZE 8
# else
# define Q_PROCESSOR_ARM_32
# endif
# if defined(__ARM64_ARCH_8__) \
|| defined(__ARM_ARCH_8A) \
|| (defined(__ARM_ARCH) && __ARM_ARCH == 8)
# define Q_PROCESSOR_ARM_V8
# define Q_PROCESSOR_ARM_V7
# define Q_PROCESSOR_ARM_V6
# define Q_PROCESSOR_ARM_V5
# if defined(__ARM_ARCH) && __ARM_ARCH > 1
# define Q_PROCESSOR_ARM __ARM_ARCH
# elif defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM > 1
# define Q_PROCESSOR_ARM __TARGET_ARCH_ARM
# elif defined(_M_ARM) && _M_ARM > 1
# define Q_PROCESSOR_ARM _M_ARM
# elif defined(__ARM64_ARCH_8__)
# define Q_PROCESSOR_ARM 8
# elif defined(__ARM_ARCH_7__) \
|| defined(__ARM_ARCH_7A__) \
|| defined(__ARM_ARCH_7R__) \
|| defined(__ARM_ARCH_7M__) \
|| defined(__ARM_ARCH_7S__) \
|| defined(_ARM_ARCH_7) \
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7) \
|| (defined(_M_ARM) && _M_ARM-0 >= 7) \
|| (defined(__ARMv7__))
# define Q_PROCESSOR_ARM_V7
# define Q_PROCESSOR_ARM_V6
# define Q_PROCESSOR_ARM_V5
|| defined(_ARM_ARCH_7)
# define Q_PROCESSOR_ARM 7
# elif defined(__ARM_ARCH_6__) \
|| defined(__ARM_ARCH_6J__) \
|| defined(__ARM_ARCH_6T2__) \
|| defined(__ARM_ARCH_6Z__) \
|| defined(__ARM_ARCH_6K__) \
|| defined(__ARM_ARCH_6ZK__) \
|| defined(__ARM_ARCH_6M__) \
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6) \
|| (defined(_M_ARM) && _M_ARM-0 >= 6)
# define Q_PROCESSOR_ARM_V6
# define Q_PROCESSOR_ARM_V5
|| defined(__ARM_ARCH_6M__)
# define Q_PROCESSOR_ARM 6
# elif defined(__ARM_ARCH_5TEJ__) \
|| defined(__ARM_ARCH_5TE__) \
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5) \
|| (defined(_M_ARM) && _M_ARM-0 >= 5)
|| defined(__ARM_ARCH_5TE__)
# define Q_PROCESSOR_ARM 5
# else
# define Q_PROCESSOR_ARM 0
# endif
# if Q_PROCESSOR_ARM >= 8
# define Q_PROCESSOR_ARM_V8
# endif
# if Q_PROCESSOR_ARM >= 7
# define Q_PROCESSOR_ARM_V7
# endif
# if Q_PROCESSOR_ARM >= 6
# define Q_PROCESSOR_ARM_V6
# endif
# if Q_PROCESSOR_ARM >= 5
# define Q_PROCESSOR_ARM_V5
# endif
# if defined(__ARMEL__)

View File

@ -235,20 +235,14 @@ bool QProcessPrivate::waitForFinished(int msecs)
qDebug("QProcessPrivate::waitForFinished(%d)", msecs);
#endif
QIncrementalSleepTimer timer(msecs);
forever {
if (!pid)
return true;
if (WaitForSingleObject(pid->hProcess, timer.nextSleepTime()) == WAIT_OBJECT_0) {
if (WaitForSingleObject(pid->hProcess, msecs == -1 ? INFINITE : msecs) == WAIT_OBJECT_0) {
_q_processDied();
return true;
}
if (timer.hasTimedOut())
break;
}
setError(QProcess::Timedout);
return false;
}

View File

@ -113,21 +113,33 @@ QString QStandardPaths::writableLocation(StandardLocation type)
{
const uid_t myUid = geteuid();
// http://standards.freedesktop.org/basedir-spec/latest/
QFileInfo fileInfo;
QString xdgRuntimeDir = QFile::decodeName(qgetenv("XDG_RUNTIME_DIR"));
if (xdgRuntimeDir.isEmpty()) {
const QString userName = QFileSystemEngine::resolveUserName(myUid);
xdgRuntimeDir = QDir::tempPath() + QLatin1String("/runtime-") + userName;
QDir dir(xdgRuntimeDir);
if (!dir.exists()) {
fileInfo.setFile(xdgRuntimeDir);
if (!fileInfo.isDir()) {
if (!QDir().mkdir(xdgRuntimeDir)) {
qWarning("QStandardPaths: error creating runtime directory %s: %s", qPrintable(xdgRuntimeDir), qPrintable(qt_error_string(errno)));
return QString();
}
}
qWarning("QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '%s'", qPrintable(xdgRuntimeDir));
} else {
fileInfo.setFile(xdgRuntimeDir);
if (!fileInfo.exists()) {
qWarning("QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '%s', "
"please create it with 0700 permissions.", qPrintable(xdgRuntimeDir));
return QString();
}
if (!fileInfo.isDir()) {
qWarning("QStandardPaths: XDG_RUNTIME_DIR points to '%s' which is not a directory",
qPrintable(xdgRuntimeDir));
return QString();
}
}
// "The directory MUST be owned by the user"
QFileInfo fileInfo(xdgRuntimeDir);
if (fileInfo.ownerId() != myUid) {
qWarning("QStandardPaths: wrong ownership on runtime directory %s, %d instead of %d", qPrintable(xdgRuntimeDir),
fileInfo.ownerId(), myUid);
@ -135,14 +147,16 @@ QString QStandardPaths::writableLocation(StandardLocation type)
}
// "and he MUST be the only one having read and write access to it. Its Unix access mode MUST be 0700."
// since the current user is the owner, set both xxxUser and xxxOwner
QFile file(xdgRuntimeDir);
const QFile::Permissions wantedPerms = QFile::ReadUser | QFile::WriteUser | QFile::ExeUser
| QFile::ReadOwner | QFile::WriteOwner | QFile::ExeOwner;
if (file.permissions() != wantedPerms && !file.setPermissions(wantedPerms)) {
if (fileInfo.permissions() != wantedPerms) {
QFile file(xdgRuntimeDir);
if (!file.setPermissions(wantedPerms)) {
qWarning("QStandardPaths: could not set correct permissions on runtime directory %s: %s",
qPrintable(xdgRuntimeDir), qPrintable(file.errorString()));
return QString();
}
}
return xdgRuntimeDir;
}
default:

View File

@ -2470,8 +2470,10 @@ void QUrl::setPath(const QString &path, ParsingMode mode)
mode = TolerantMode;
}
data = qt_normalizePathSegments(data, false);
d->setPath(data, 0, data.length());
int from = 0;
while (from < data.length() - 2 && data.midRef(from, 2) == QLatin1String("//"))
++from;
d->setPath(data, from, data.length());
// optimized out, since there is no path delimiter
// if (path.isNull())

View File

@ -102,7 +102,8 @@ public:
OVERLAPPED *waitForAnyNotified(int msecs);
void notify(DWORD numberOfBytes, DWORD errorCode, OVERLAPPED *overlapped);
OVERLAPPED *_q_notified();
void _q_notified();
OVERLAPPED *dispatchNextIoResult();
static QWinIoCompletionPort *iocp;
static HANDLE iocpInstanceLock;
@ -302,8 +303,7 @@ OVERLAPPED *QWinOverlappedIoNotifierPrivate::waitForAnyNotified(int msecs)
const DWORD wfso = WaitForSingleObject(hSemaphore, msecs == -1 ? INFINITE : DWORD(msecs));
switch (wfso) {
case WAIT_OBJECT_0:
ReleaseSemaphore(hSemaphore, 1, NULL);
return _q_notified();
return dispatchNextIoResult();
case WAIT_TIMEOUT:
return 0;
default:
@ -385,17 +385,20 @@ void QWinOverlappedIoNotifierPrivate::notify(DWORD numberOfBytes, DWORD errorCod
emit q->_q_notify();
}
OVERLAPPED *QWinOverlappedIoNotifierPrivate::_q_notified()
void QWinOverlappedIoNotifierPrivate::_q_notified()
{
if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0)
dispatchNextIoResult();
}
OVERLAPPED *QWinOverlappedIoNotifierPrivate::dispatchNextIoResult()
{
Q_Q(QWinOverlappedIoNotifier);
if (WaitForSingleObject(hSemaphore, 0) == WAIT_OBJECT_0) {
WaitForSingleObject(hResultsMutex, INFINITE);
IOResult ioresult = results.dequeue();
ReleaseMutex(hResultsMutex);
emit q->notified(ioresult.numberOfBytes, ioresult.errorCode, ioresult.overlapped);
return ioresult.overlapped;
}
return 0;
}
QT_END_NAMESPACE

View File

@ -58,7 +58,7 @@ class Q_CORE_EXPORT QWinOverlappedIoNotifier : public QObject
Q_OBJECT
Q_DISABLE_COPY(QWinOverlappedIoNotifier)
Q_DECLARE_PRIVATE(QWinOverlappedIoNotifier)
Q_PRIVATE_SLOT(d_func(), OVERLAPPED *_q_notified())
Q_PRIVATE_SLOT(d_func(), void _q_notified())
friend class QWinIoCompletionPort;
public:
QWinOverlappedIoNotifier(QObject *parent = 0);

View File

@ -420,6 +420,18 @@ QJsonValue QJsonValue::fromVariant(const QVariant &variant)
return QJsonValue(QJsonObject::fromVariantMap(variant.toMap()));
case QVariant::Hash:
return QJsonValue(QJsonObject::fromVariantHash(variant.toHash()));
#ifndef QT_BOOTSTRAPPED
case QMetaType::QJsonValue:
return variant.toJsonValue();
case QMetaType::QJsonObject:
return variant.toJsonObject();
case QMetaType::QJsonArray:
return variant.toJsonArray();
case QMetaType::QJsonDocument: {
QJsonDocument doc = variant.toJsonDocument();
return doc.isArray() ? QJsonValue(doc.array()) : QJsonValue(doc.object());
}
#endif
default:
break;
}

View File

@ -46,51 +46,72 @@
//
#include "qbytearray.h"
#include "qhash.h"
#include "qvector.h"
QT_BEGIN_NAMESPACE
// Environment ------------------------------------------------------
Q_CORE_EXPORT QHash<QByteArray, QByteArray> &qt_app_environment()
{
static QHash<QByteArray, QByteArray> internalEnvironment;
return internalEnvironment;
}
struct Variable {
Variable() { }
Variable(const QByteArray &name, const QByteArray &value)
: name(name), value(value) { }
QByteArray name;
QByteArray value;
};
Q_DECLARE_TYPEINFO(Variable, Q_MOVABLE_TYPE);
struct NameEquals {
typedef bool result_type;
const char *name;
explicit NameEquals(const char *name) Q_DECL_NOTHROW : name(name) {}
result_type operator()(const Variable &other) const Q_DECL_NOTHROW
{ return qstrcmp(other.name, name) == 0; }
};
Q_GLOBAL_STATIC(QVector<Variable>, qt_app_environment)
errno_t qt_fake_getenv_s(size_t *sizeNeeded, char *buffer, size_t bufferSize, const char *varName)
{
if (!sizeNeeded)
return EINVAL;
QHash<QByteArray, QByteArray>::const_iterator iterator = qt_app_environment().constFind(varName);
if (iterator == qt_app_environment().constEnd()) {
QVector<Variable>::const_iterator end = qt_app_environment->constEnd();
QVector<Variable>::const_iterator iterator = std::find_if(qt_app_environment->constBegin(),
end,
NameEquals(varName));
if (iterator == end) {
if (buffer)
buffer[0] = '\0';
return ENOENT;
}
const int size = iterator->size() + 1;
const int size = iterator->value.size() + 1;
if (bufferSize < size_t(size)) {
*sizeNeeded = size;
return ERANGE;
}
qstrcpy(buffer, iterator->constData());
qstrcpy(buffer, iterator->value.constData());
return 0;
}
errno_t qt_fake__putenv_s(const char *varName, const char *value)
{
QHash<QByteArray, QByteArray>::iterator iterator = qt_app_environment().find(varName);
QHash<QByteArray, QByteArray>::iterator end = qt_app_environment().end();
QVector<Variable>::iterator end = qt_app_environment->end();
QVector<Variable>::iterator iterator = std::find_if(qt_app_environment->begin(),
end,
NameEquals(varName));
if (!value || !*value) {
if (iterator != end)
qt_app_environment().erase(iterator);
qt_app_environment->erase(iterator);
} else {
if (iterator == end)
qt_app_environment()[varName] = QByteArray(value);
qt_app_environment->append(Variable(varName, value));
else
(*iterator) = value;
iterator->value = value;
}
return 0;

View File

@ -40,6 +40,7 @@
#include <QtCore/QThread>
#include <QtCore/QAbstractEventDispatcher>
#include <QtCore/QElapsedTimer>
#include <QtCore/qt_windows.h>
// Convenience macros for handling HRESULT values
@ -160,7 +161,7 @@ enum AwaitStyle
};
template <typename T>
static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle)
static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle, uint timeout)
{
Microsoft::WRL::ComPtr<IAsyncInfo> asyncInfo;
HRESULT hr = asyncOp.As(&asyncInfo);
@ -168,22 +169,34 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
return hr;
AsyncStatus status;
QElapsedTimer t;
if (timeout)
t.start();
switch (awaitStyle) {
case ProcessMainThreadEvents:
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) {
QCoreApplication::processEvents();
if (timeout && t.hasExpired(timeout))
return ERROR_TIMEOUT;
}
break;
case ProcessThreadEvents:
if (QAbstractEventDispatcher *dispatcher = QThread::currentThread()->eventDispatcher()) {
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) {
dispatcher->processEvents(QEventLoop::AllEvents);
if (timeout && t.hasExpired(timeout))
return ERROR_TIMEOUT;
}
break;
}
// fall through
default:
case YieldThread:
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started)
while (SUCCEEDED(hr = asyncInfo->get_Status(&status)) && status == Started) {
QThread::yieldCurrentThread();
if (timeout && t.hasExpired(timeout))
return ERROR_TIMEOUT;
}
break;
}
@ -199,9 +212,9 @@ static inline HRESULT _await_impl(const Microsoft::WRL::ComPtr<T> &asyncOp, Awai
}
template <typename T>
static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle = YieldThread)
static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle awaitStyle = YieldThread, uint timeout = 0)
{
HRESULT hr = _await_impl(asyncOp, awaitStyle);
HRESULT hr = _await_impl(asyncOp, awaitStyle, timeout);
if (FAILED(hr))
return hr;
@ -209,9 +222,9 @@ static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, AwaitStyle
}
template <typename T, typename U>
static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, U *results, AwaitStyle awaitStyle = YieldThread)
static inline HRESULT await(const Microsoft::WRL::ComPtr<T> &asyncOp, U *results, AwaitStyle awaitStyle = YieldThread, uint timeout = 0)
{
HRESULT hr = _await_impl(asyncOp, awaitStyle);
HRESULT hr = _await_impl(asyncOp, awaitStyle, timeout);
if (FAILED(hr))
return hr;

View File

@ -355,9 +355,10 @@ QMimeType QMimeDatabase::mimeTypeForFile(const QFileInfo &fileInfo, MatchMode mo
#ifdef Q_OS_UNIX
// Cannot access statBuf.st_mode from the filesystem engine, so we have to stat again.
// In addition we want to follow symlinks.
const QByteArray nativeFilePath = QFile::encodeName(file.fileName());
QT_STATBUF statBuffer;
if (QT_LSTAT(nativeFilePath.constData(), &statBuffer) == 0) {
if (QT_STAT(nativeFilePath.constData(), &statBuffer) == 0) {
if (S_ISCHR(statBuffer.st_mode))
return d->mimeTypeForName(QLatin1String("inode/chardevice"));
if (S_ISBLK(statBuffer.st_mode))

View File

@ -204,8 +204,8 @@ void QThreadPoolPrivate::enqueueTask(QRunnable *runnable, int priority)
++runnable->ref;
// put it on the queue
QList<QPair<QRunnable *, int> >::const_iterator begin = queue.constBegin();
QList<QPair<QRunnable *, int> >::const_iterator it = queue.constEnd();
QVector<QPair<QRunnable *, int> >::const_iterator begin = queue.constBegin();
QVector<QPair<QRunnable *, int> >::const_iterator it = queue.constEnd();
if (it != begin && priority > (*(it - 1)).second)
it = std::upper_bound(begin, --it, priority);
queue.insert(it - begin, qMakePair(runnable, priority));
@ -299,7 +299,7 @@ bool QThreadPoolPrivate::waitForDone(int msecs)
void QThreadPoolPrivate::clear()
{
QMutexLocker locker(&mutex);
for (QList<QPair<QRunnable *, int> >::const_iterator it = queue.constBegin();
for (QVector<QPair<QRunnable *, int> >::const_iterator it = queue.constBegin();
it != queue.constEnd(); ++it) {
QRunnable* r = it->first;
if (r->autoDelete() && !--r->ref)
@ -319,8 +319,8 @@ bool QThreadPoolPrivate::stealRunnable(QRunnable *runnable)
return false;
{
QMutexLocker locker(&mutex);
QList<QPair<QRunnable *, int> >::iterator it = queue.begin();
QList<QPair<QRunnable *, int> >::iterator end = queue.end();
QVector<QPair<QRunnable *, int> >::iterator it = queue.begin();
QVector<QPair<QRunnable *, int> >::iterator end = queue.end();
while (it != end) {
if (it->first == runnable) {

View File

@ -83,7 +83,7 @@ public:
QSet<QThreadPoolThread *> allThreads;
QQueue<QThreadPoolThread *> waitingThreads;
QQueue<QThreadPoolThread *> expiredThreads;
QList<QPair<QRunnable *, int> > queue;
QVector<QPair<QRunnable *, int> > queue;
QWaitCondition noActiveThreads;
bool isExiting;

View File

@ -540,7 +540,13 @@ static inline bool displayMessageBox()
static void showParserMessage(const QString &message, MessageType type)
{
#if defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINCE) && !defined(Q_OS_WINRT)
#if defined(Q_OS_WINRT)
if (type == UsageMessage)
qInfo(qPrintable(message));
else
qCritical(qPrintable(message));
return;
#elif defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) && !defined(Q_OS_WINCE)
if (displayMessageBox()) {
const UINT flags = MB_OK | MB_TOPMOST | MB_SETFOREGROUND
| (type == UsageMessage ? MB_ICONINFORMATION : MB_ICONERROR);
@ -553,7 +559,7 @@ static void showParserMessage(const QString &message, MessageType type)
reinterpret_cast<const wchar_t *>(title.utf16()), flags);
return;
}
#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WIN && !Q_OS_WINRT
#endif // Q_OS_WIN && !QT_BOOTSTRAPPED && !Q_OS_WINCE
fputs(qPrintable(message), type == UsageMessage ? stdout : stderr);
}

View File

@ -1675,21 +1675,12 @@ void QString::resize(int size)
return;
}
if (size == 0 && !d->capacityReserved) {
Data *x = Data::allocate(0);
if (!d->ref.deref())
Data::deallocate(d);
d = x;
} else {
if (d->ref.isShared() || uint(size) + 1u > d->alloc
|| (!d->capacityReserved && size < d->size
&& uint(size) + 1u < uint(d->alloc >> 1)))
if (d->ref.isShared() || uint(size) + 1u > d->alloc)
reallocData(uint(size) + 1u, true);
if (d->alloc) {
d->size = size;
d->data()[size] = '\0';
}
}
}
/*!

View File

@ -286,6 +286,8 @@ DEFINEFUNC(const char* , dbus_message_get_sender, (DBusMessage *message),
(message), return)
DEFINEFUNC(dbus_uint32_t , dbus_message_get_serial, (DBusMessage *message),
(message), return)
DEFINEFUNC(dbus_uint32_t , dbus_message_get_reply_serial, (DBusMessage *message),
(message), return)
DEFINEFUNC(const char* , dbus_message_get_signature, (DBusMessage *message),
(message), return)
DEFINEFUNC(int , dbus_message_get_type, (DBusMessage *message),

View File

@ -38,6 +38,7 @@
#include <qdebug.h>
#include <qcoreapplication.h>
#include <qstringlist.h>
#include <qtimer.h>
#include <qthread.h>
#include "qdbusconnectioninterface.h"
@ -59,6 +60,24 @@ QT_BEGIN_NAMESPACE
Q_GLOBAL_STATIC(QDBusConnectionManager, _q_manager)
// can be replaced with a lambda in Qt 5.7
class QDBusConnectionDispatchEnabler : public QObject
{
Q_OBJECT
QDBusConnectionPrivate *con;
public:
QDBusConnectionDispatchEnabler(QDBusConnectionPrivate *con) : con(con) {}
public slots:
void execute()
{
con->setDispatchEnabled(true);
if (!con->ref.deref())
con->deleteLater();
deleteLater();
}
};
struct QDBusConnectionManager::ConnectionRequestData
{
enum RequestType {
@ -74,6 +93,8 @@ struct QDBusConnectionManager::ConnectionRequestData
const QString *name;
QDBusConnectionPrivate *result;
bool suspendedDelivery;
};
QDBusConnectionPrivate *QDBusConnectionManager::busConnection(QDBusConnection::BusType type)
@ -84,6 +105,10 @@ QDBusConnectionPrivate *QDBusConnectionManager::busConnection(QDBusConnection::B
if (!qdbus_loadLibDBus())
return 0;
// we'll start in suspended delivery mode if we're in the main thread
// (the event loop will resume delivery)
bool suspendedDelivery = qApp && qApp->thread() == QThread::currentThread();
QMutexLocker lock(&defaultBusMutex);
if (defaultBuses[type])
return defaultBuses[type];
@ -91,7 +116,7 @@ QDBusConnectionPrivate *QDBusConnectionManager::busConnection(QDBusConnection::B
QString name = QStringLiteral("qt_default_session_bus");
if (type == QDBusConnection::SystemBus)
name = QStringLiteral("qt_default_system_bus");
return defaultBuses[type] = connectToBus(type, name);
return defaultBuses[type] = connectToBus(type, name, suspendedDelivery);
}
QDBusConnectionPrivate *QDBusConnectionManager::connection(const QString &name) const
@ -169,14 +194,22 @@ void QDBusConnectionManager::run()
moveToThread(Q_NULLPTR);
}
QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(QDBusConnection::BusType type, const QString &name)
QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(QDBusConnection::BusType type, const QString &name,
bool suspendedDelivery)
{
ConnectionRequestData data;
data.type = ConnectionRequestData::ConnectToStandardBus;
data.busType = type;
data.name = &name;
data.suspendedDelivery = suspendedDelivery;
emit connectionRequested(&data);
if (suspendedDelivery) {
data.result->ref.ref();
QDBusConnectionDispatchEnabler *o = new QDBusConnectionDispatchEnabler(data.result);
QTimer::singleShot(0, o, SLOT(execute()));
o->moveToThread(qApp->thread()); // qApp was checked in the caller
}
return data.result;
}
@ -186,6 +219,7 @@ QDBusConnectionPrivate *QDBusConnectionManager::connectToBus(const QString &addr
data.type = ConnectionRequestData::ConnectToBusByAddress;
data.busAddress = &address;
data.name = &name;
data.suspendedDelivery = false;
emit connectionRequested(&data);
return data.result;
@ -197,6 +231,7 @@ QDBusConnectionPrivate *QDBusConnectionManager::connectToPeer(const QString &add
data.type = ConnectionRequestData::ConnectToPeerByAddress;
data.busAddress = &address;
data.name = &name;
data.suspendedDelivery = false;
emit connectionRequested(&data);
return data.result;
@ -252,6 +287,8 @@ void QDBusConnectionManager::executeConnectionRequest(QDBusConnectionManager::Co
// will lock in QDBusConnectionPrivate::connectRelay()
d->setConnection(c, error);
d->createBusService();
if (data->suspendedDelivery)
d->setDispatchEnabled(false);
}
}
@ -456,7 +493,7 @@ QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
QDBusConnectionPrivate *d = 0;
return QDBusConnection(d);
}
return QDBusConnection(_q_manager()->connectToBus(type, name));
return QDBusConnection(_q_manager()->connectToBus(type, name, false));
}
/*!
@ -1232,4 +1269,6 @@ QByteArray QDBusConnection::localMachineId()
QT_END_NAMESPACE
#include "qdbusconnection.moc"
#endif // QT_NO_DBUS

View File

@ -169,12 +169,12 @@ public:
// typedefs
typedef QMultiHash<int, Watcher> WatcherHash;
typedef QHash<int, DBusTimeout *> TimeoutHash;
typedef QVector<QPair<DBusTimeout *, int> > PendingTimeoutList;
typedef QVector<QDBusMessage> PendingMessageList;
typedef QMultiHash<QString, SignalHook> SignalHookHash;
typedef QHash<QString, QDBusMetaObject* > MetaObjectHash;
typedef QHash<QByteArray, int> MatchRefCountHash;
typedef QList<QDBusPendingCallPrivate*> PendingCallList;
typedef QVector<QDBusPendingCallPrivate*> PendingCallList;
struct WatchedServiceData {
WatchedServiceData() : refcount(0) {}
@ -192,6 +192,7 @@ public:
~QDBusConnectionPrivate();
void createBusService();
void setDispatchEnabled(bool enable);
void setPeer(DBusConnection *connection, const QDBusErrorInternal &error);
void setConnection(DBusConnection *connection, const QDBusErrorInternal &error);
void setServer(QDBusServer *object, DBusServer *server, const QDBusErrorInternal &error);
@ -309,7 +310,7 @@ public:
};
WatcherHash watchers;
TimeoutHash timeouts;
PendingTimeoutList timeoutsPendingAdd;
PendingMessageList pendingMessages;
// the master lock protects our own internal state
QReadWriteLock lock;
@ -324,6 +325,7 @@ public:
PendingCallList pendingCalls;
bool anonymousAuthenticationAllowed;
bool dispatchEnabled; // protected by the dispatch lock, not the main lock
public:
// static methods

View File

@ -67,7 +67,7 @@ public:
QDBusConnectionPrivate *connection(const QString &name) const;
void removeConnection(const QString &name);
void setConnection(const QString &name, QDBusConnectionPrivate *c);
QDBusConnectionPrivate *connectToBus(QDBusConnection::BusType type, const QString &name);
QDBusConnectionPrivate *connectToBus(QDBusConnection::BusType type, const QString &name, bool suspendedDelivery);
QDBusConnectionPrivate *connectToBus(const QString &address, const QString &name);
QDBusConnectionPrivate *connectToPeer(const QString &address, const QString &name);

View File

@ -496,6 +496,11 @@ bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
if (!ref.load())
return false;
if (!dispatchEnabled && !QDBusMessagePrivate::isLocal(amsg)) {
// queue messages only, we'll handle them later
pendingMessages << amsg;
return amsg.type() == QDBusMessage::MethodCallMessage;
}
switch (amsg.type()) {
case QDBusMessage::SignalMessage:
@ -689,6 +694,20 @@ static int findSlot(const QMetaObject *mo, const QByteArray &name, int flags,
return -1;
}
/*!
\internal
Enables or disables the delivery of incoming method calls and signals. If
\a enable is true, this will also cause any queued, pending messages to be
delivered.
*/
void QDBusConnectionPrivate::setDispatchEnabled(bool enable)
{
QDBusDispatchLocker locker(SetDispatchEnabledAction, this);
dispatchEnabled = enable;
if (enable)
emit dispatchStatusChanged();
}
static QDBusCallDeliveryEvent * const DIRECT_DELIVERY = (QDBusCallDeliveryEvent *)1;
QDBusCallDeliveryEvent* QDBusConnectionPrivate::prepareReply(QDBusConnectionPrivate *target,
@ -945,7 +964,8 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
: QObject(p), ref(1), capabilities(0), mode(InvalidMode), busService(0),
dispatchLock(QMutex::Recursive), connection(0),
rootNode(QString(QLatin1Char('/'))),
anonymousAuthenticationAllowed(false)
anonymousAuthenticationAllowed(false),
dispatchEnabled(true)
{
static const bool threads = q_dbus_threads_init_default();
if (::isDebugging == -1)
@ -1065,8 +1085,17 @@ void QDBusConnectionPrivate::timerEvent(QTimerEvent *e)
void QDBusConnectionPrivate::doDispatch()
{
QDBusDispatchLocker locker(DoDispatchAction, this);
if (mode == ClientMode || mode == PeerMode)
if (mode == ClientMode || mode == PeerMode) {
while (q_dbus_connection_dispatch(connection) == DBUS_DISPATCH_DATA_REMAINS) ;
if (dispatchEnabled && !pendingMessages.isEmpty()) {
// dispatch previously queued messages
PendingMessageList::Iterator it = pendingMessages.begin();
PendingMessageList::Iterator end = pendingMessages.end();
for ( ; it != end; ++it)
handleMessage(qMove(*it));
pendingMessages.clear();
}
}
}
void QDBusConnectionPrivate::socketRead(int fd)
@ -1789,8 +1818,8 @@ bool QDBusConnectionPrivate::send(const QDBusMessage& message)
}
q_dbus_message_set_no_reply(msg, true); // the reply would not be delivered to anything
qDBusDebug() << this << "sending message (no reply):" << message;
emit messageNeedsSending(Q_NULLPTR, msg);
qDBusDebug() << this << "sending message (no reply):" << message;
return true;
}
@ -1989,8 +2018,8 @@ QDBusPendingCallPrivate *QDBusConnectionPrivate::sendWithReplyAsync(const QDBusM
lastError = error;
processFinishedCall(pcall);
} else {
qDBusDebug() << this << "sending message:" << message;
emit messageNeedsSending(pcall, msg, timeout);
qDBusDebug() << this << "sending message:" << message;
}
return pcall;
}

View File

@ -188,7 +188,12 @@ DBusMessage *QDBusMessagePrivate::toDBusMessage(const QDBusMessage &message, QDB
// check if everything is ok
if (marshaller.ok)
{
QDBusMessage *m = (QDBusMessage*)&message;
q_dbus_message_ref(msg);
m->d_ptr->msg = msg;
return msg;
}
// not ok;
q_dbus_message_unref(msg);
@ -317,6 +322,16 @@ QDBusMessage QDBusMessagePrivate::makeLocalReply(const QDBusConnectionPrivate &c
return QDBusMessage(); // failed
}
uint QDBusMessagePrivate::serial()
{
return msg ? q_dbus_message_get_serial(msg) : reply ? q_dbus_message_get_serial(reply) : 0;
}
uint QDBusMessagePrivate::replySerial()
{
return msg ? q_dbus_message_get_reply_serial(msg) : reply ? q_dbus_message_get_reply_serial(reply) : 0;
}
/*!
\class QDBusMessage
\inmodule QtDBus
@ -632,6 +647,32 @@ QString QDBusMessage::signature() const
return d_ptr->signature;
}
/*!
Returns the serial of the message or 0 if undefined.
The serial number is a unique identifier of a message coming from a
given connection.
The serial is set to a non zero value after the message has been sent
over a D-Bus connection.
*/
uint QDBusMessage::serial() const
{
return d_ptr->serial();
}
/*!
Returns the serial of the message this is a reply to or 0 if undefined.
The serial number is a unique identifier of a message coming from a
given connection and D-Bus messages of 'method return' or 'error' type
use them to match the reply to the method call message.
*/
uint QDBusMessage::replySerial() const
{
return d_ptr->replySerial();
}
/*!
Returns the flag that indicates if this message should see a reply
or not. This is only meaningful for \l {MethodCallMessage}{method
@ -820,10 +861,16 @@ QDebug operator<<(QDebug dbg, const QDBusMessage &msg)
msg.type() == QDBusMessage::SignalMessage)
dbg.nospace() << ", path=" << msg.path()
<< ", interface=" << msg.interface()
<< ", member=" << msg.member();
<< ", member=" << msg.member()
<< ", serial=" << msg.serial();
if (msg.type() == QDBusMessage::ErrorMessage)
dbg.nospace() << ", error name=" << msg.errorName()
<< ", error message=" << msg.errorMessage();
<< ", error message=" << msg.errorMessage()
<< ", serial=" << msg.serial()
<< ", reply serial=" << msg.replySerial();
else if (msg.type() == QDBusMessage::ReplyMessage)
dbg.nospace() << ", serial=" << msg.serial()
<< ", reply serial=" << msg.replySerial();
dbg.nospace() << ", signature=" << msg.signature()
<< ", contents=(";
debugVariantList(dbg, msg.arguments());

View File

@ -104,6 +104,8 @@ public:
QString errorMessage() const;
MessageType type() const;
QString signature() const;
uint serial() const;
uint replySerial() const;
bool isReplyRequired() const;

View File

@ -93,6 +93,8 @@ public:
const QDBusMessage &asSent);
static QDBusMessage makeLocalReply(const QDBusConnectionPrivate &conn,
const QDBusMessage &asSent);
uint serial();
uint replySerial();
};
QT_END_NAMESPACE

View File

@ -106,7 +106,7 @@ public:
void waitForFinished(); // non-virtual override
Q_SIGNALS:
void finished(QDBusPendingCallWatcher *self);
void finished(QDBusPendingCallWatcher *self = Q_NULLPTR);
private:
Q_DECLARE_PRIVATE(QDBusPendingCallWatcher)

View File

@ -83,7 +83,7 @@ enum ThreadAction {
HandleObjectCallPostEventAction = 22,
HandleObjectCallSemaphoreAction = 23,
DoDispatchAction = 24,
// unused: 25,
SetDispatchEnabledAction = 25,
MessageResultReceivedAction = 26,
ActivateSignalAction = 27,
PendingCallBlockAction = 28,

View File

@ -996,18 +996,38 @@ qreal QGuiApplication::devicePixelRatio() const
*/
QWindow *QGuiApplication::topLevelAt(const QPoint &pos)
{
QList<QScreen *> screens = QGuiApplication::screens();
QList<QScreen *>::const_iterator screen = screens.constBegin();
QList<QScreen *>::const_iterator end = screens.constEnd();
const QList<QScreen *> screens = QGuiApplication::screens();
if (!screens.isEmpty()) {
const QList<QScreen *> primaryScreens = screens.first()->virtualSiblings();
QScreen *windowScreen = Q_NULLPTR;
while (screen != end) {
if ((*screen)->geometry().contains(pos)) {
const QPoint devicePosition = QHighDpi::toNativePixels(pos, *screen);
return (*screen)->handle()->topLevelAt(devicePosition);
// Find the window on the primary virtual desktop first
foreach (QScreen *screen, primaryScreens) {
if (screen->geometry().contains(pos)) {
windowScreen = screen;
break;
}
++screen;
}
return 0;
// If the window is not found on primary virtual desktop, find it on all screens
// except the first which was for sure in the previous loop. Some other screens
// may repeat. Find only when there is more than one virtual desktop.
if (!windowScreen && screens.count() != primaryScreens.count()) {
for (int i = 1; i < screens.size(); ++i) {
QScreen *screen = screens[i];
if (screen->geometry().contains(pos)) {
windowScreen = screen;
break;
}
}
}
if (windowScreen) {
const QPoint devicePosition = QHighDpi::toNativePixels(pos, windowScreen);
return windowScreen->handle()->topLevelAt(devicePosition);
}
}
return Q_NULLPTR;
}
/*!
@ -2102,10 +2122,12 @@ void QGuiApplicationPrivate::processWindowStateChangedEvent(QWindowSystemInterfa
void QGuiApplicationPrivate::processWindowScreenChangedEvent(QWindowSystemInterfacePrivate::WindowScreenChangedEvent *wse)
{
if (QWindow *window = wse->window.data()) {
if (window->isTopLevel()) {
if (QScreen *screen = wse->screen.data())
window->d_func()->setTopLevelScreen(screen, false /* recreate */);
else // Fall back to default behavior, and try to find some appropriate screen
window->setScreen(0);
}
// we may have changed scaling, so trigger resize event if needed
if (window->handle()) {
QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window), QRect());

View File

@ -173,7 +173,7 @@ static inline qreal initialGlobalScaleFactor()
include X11, Windows, and Android.
There are two APIs for enabling or disabling this behavior:
- The QT_AUTO_SCALE_FACTOR environment variable.
- The QT_AUTO_SCREEN_SCALE_FACTOR environment variable.
- The AA_EnableHighDpiScaling and AA_DisableHighDpiScaling
application attributes

View File

@ -1459,11 +1459,11 @@ void QOpenGLContextGroupPrivate::deletePendingResources(QOpenGLContext *ctx)
{
QMutexLocker locker(&m_mutex);
QList<QOpenGLSharedResource *> pending = m_pendingDeletion;
const QList<QOpenGLSharedResource *> pending = m_pendingDeletion;
m_pendingDeletion.clear();
QList<QOpenGLSharedResource *>::iterator it = pending.begin();
QList<QOpenGLSharedResource *>::iterator end = pending.end();
QList<QOpenGLSharedResource *>::const_iterator it = pending.begin();
QList<QOpenGLSharedResource *>::const_iterator end = pending.end();
while (it != end) {
(*it)->freeResource(ctx);
delete *it;

View File

@ -453,260 +453,192 @@ void QOpenGLTextureHelper::dsa_CompressedTextureImage3D(GLuint texture, GLenum t
CompressedTextureImage3DEXT(texture, target, level, internalFormat, width, height, depth, border, imageSize, bits);
}
namespace {
class TextureBinder
{
public:
TextureBinder(QOpenGLTextureHelper *textureFunctions, GLuint texture, GLenum target, GLenum bindingTarget)
: m_textureFunctions(textureFunctions)
{
// For cubemaps we can't use the standard DSA emulation as it is illegal to
// try to bind a texture to one of the cubemap face targets. So we force the
// target and binding target to the cubemap values in this case.
switch (target) {
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
bindingTarget = GL_TEXTURE_BINDING_CUBE_MAP;
m_target = GL_TEXTURE_CUBE_MAP;
break;
default:
m_target = target;
break;
}
m_textureFunctions->glGetIntegerv(bindingTarget, &m_oldTexture);
m_textureFunctions->glBindTexture(m_target, texture);
}
~TextureBinder()
{
m_textureFunctions->glBindTexture(m_target, m_oldTexture);
}
private:
QOpenGLTextureHelper *m_textureFunctions;
GLenum m_target;
GLint m_oldTexture;
};
} // namespace
void QOpenGLTextureHelper::qt_TextureParameteri(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLint param)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexParameteri(target, pname, param);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureParameteriv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLint *params)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexParameteriv(target, pname, params);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureParameterf(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, GLfloat param)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexParameterf(target, pname, param);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureParameterfv(GLuint texture, GLenum target, GLenum bindingTarget, GLenum pname, const GLfloat *params)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexParameterfv(target, pname, params);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_GenerateTextureMipmap(GLuint texture, GLenum target, GLenum bindingTarget)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glGenerateMipmap(target);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage3D(target, levels, internalFormat, width, height, depth);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage2D(target, levels, internalFormat, width, height);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei levels, GLenum internalFormat, GLsizei width)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage1D(target, levels, internalFormat, width);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage3DMultisample(target, samples, internalFormat, width, height, depth, fixedSampleLocations);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureStorage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexStorage2DMultisample(target, samples, internalFormat, width, height, fixedSampleLocations);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexImage3D(target, level, internalFormat, width, height, depth, border, format, type, pixels);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
// For cubemaps we can't use the standard DSA emulation as it is illegal to
// try to bind a texture to one of the cubemap face targets. So we force the
// target and binding target to the cubemap values in this case.
GLint oldTexture;
switch (target) {
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &oldTexture);
glBindTexture(GL_TEXTURE_CUBE_MAP, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
glBindTexture(GL_TEXTURE_CUBE_MAP, oldTexture);
break;
default:
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
glTexImage2D(target, level, internalFormat, width, height, border, format, type, pixels);
glBindTexture(target, oldTexture);
break;
}
}
void QOpenGLTextureHelper::qt_TextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexImage1D(target, level, internalFormat, width, border, format, type, pixels);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
{
// For cubemaps we can't use the standard DSA emulation as it is illegal to
// try to bind a texture to one of the cubemap face targets. So we force the
// target and binding target to the cubemap values in this case.
GLint oldTexture;
switch (target) {
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &oldTexture);
glBindTexture(GL_TEXTURE_CUBE_MAP, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
glBindTexture(GL_TEXTURE_CUBE_MAP, oldTexture);
break;
default:
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
glBindTexture(target, oldTexture);
break;
}
}
void QOpenGLTextureHelper::qt_TextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexSubImage1D(target, level, xoffset, width, format, type, pixels);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureImage3DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexImage3DMultisample(target, samples, internalFormat, width, height, depth, fixedSampleLocations);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_TextureImage2DMultisample(GLuint texture, GLenum target, GLenum bindingTarget, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glTexImage2DMultisample(target, samples, internalFormat, width, height, fixedSampleLocations);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureSubImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *bits)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, bits);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureSubImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *bits)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, bits);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureSubImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *bits)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, bits);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureImage1D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *bits)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexImage1D(target, level, internalFormat, width, border, imageSize, bits);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureImage2D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *bits)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexImage2D(target, level, internalFormat, width, height, border, imageSize, bits);
glBindTexture(target, oldTexture);
}
void QOpenGLTextureHelper::qt_CompressedTextureImage3D(GLuint texture, GLenum target, GLenum bindingTarget, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *bits)
{
GLint oldTexture;
glGetIntegerv(bindingTarget, &oldTexture);
glBindTexture(target, texture);
TextureBinder binder(this, texture, target, bindingTarget);
glCompressedTexImage3D(target, level, internalFormat, width, height, depth, border, imageSize, bits);
glBindTexture(target, oldTexture);
}
QT_END_NAMESPACE

View File

@ -4150,7 +4150,7 @@ public:
inline const QRgba64 *getBuffer(const QGradient &gradient, int opacity) {
quint64 hash_val = 0;
QGradientStops stops = gradient.stops();
const QGradientStops stops = gradient.stops();
for (int i = 0; i < stops.size() && i <= 2; i++)
hash_val += stops[i].second.rgba64();

View File

@ -3154,7 +3154,7 @@ void QPainter::shear(qreal sh, qreal sv)
/*!
\fn void QPainter::rotate(qreal angle)
Rotates the coordinate system clockwise. The given \a angle parameter uses degree unit.
Rotates the coordinate system clockwise. The given \a angle parameter is in degrees.
\sa setWorldTransform(), {QPainter#Coordinate Transformations}{Coordinate Transformations}
*/

View File

@ -371,17 +371,13 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
if (textureId) {
if (d_ptr->needsSwizzle)
d_ptr->blitter->setSwizzleRB(true);
// offset is usually (0, 0) unless we have native child widgets.
if (offset.isNull()) {
d_ptr->blitter->blit(textureId, QMatrix4x4(), origin);
} else {
// The backingstore is for the entire tlw. offset tells the position of the native child in the tlw.
// The backingstore is for the entire tlw.
// In case of native children offset tells the position relative to the tlw.
const QRect srcRect = toBottomLeftRect(deviceWindowRect.translated(offset), d_ptr->textureSize.height());
const QMatrix3x3 source = QOpenGLTextureBlitter::sourceTransform(deviceRect(srcRect, window),
d_ptr->textureSize,
origin);
d_ptr->blitter->blit(textureId, QMatrix4x4(), source);
}
if (d_ptr->needsSwizzle)
d_ptr->blitter->setSwizzleRB(false);
}

View File

@ -243,11 +243,11 @@ static QFile::Permissions modeToPermissions(quint32 mode)
static quint32 permissionsToMode(QFile::Permissions perms)
{
quint32 mode = 0;
if (mode & (QFile::ReadOwner | QFile::ReadUser))
if (perms & (QFile::ReadOwner | QFile::ReadUser))
mode |= UnixFileAttributes::ReadUser;
if (mode & (QFile::WriteOwner | QFile::WriteUser))
if (perms & (QFile::WriteOwner | QFile::WriteUser))
mode |= UnixFileAttributes::WriteUser;
if (mode & (QFile::ExeOwner | QFile::ExeUser))
if (perms & (QFile::ExeOwner | QFile::ExeUser))
mode |= UnixFileAttributes::WriteUser;
if (perms & QFile::ReadGroup)
mode |= UnixFileAttributes::ReadGroup;

View File

@ -1584,7 +1584,7 @@ QNetworkCacheMetaData QNetworkReplyHttpImplPrivate::fetchCacheMetaData(const QNe
QByteArray maxAge = cacheControl.value("max-age");
if (!maxAge.isEmpty()) {
checkExpired = false;
QDateTime dt = QDateTime::currentDateTime();
QDateTime dt = QDateTime::currentDateTimeUtc();
dt = dt.addSecs(maxAge.toInt());
metaData.setExpirationDate(dt);
}

View File

@ -33,16 +33,16 @@ android {
}
win32: {
SOURCES += kernel/qhostinfo_win.cpp
!winrt {
SOURCES += kernel/qdnslookup_win.cpp \
kernel/qhostinfo_win.cpp \
kernel/qnetworkinterface_win.cpp
LIBS_PRIVATE += -ldnsapi -liphlpapi
DEFINES += WINVER=0x0600 _WIN32_WINNT=0x0600
} else {
SOURCES += kernel/qdnslookup_winrt.cpp \
kernel/qhostinfo_winrt.cpp \
kernel/qnetworkinterface_winrt.cpp
}
}

View File

@ -33,6 +33,7 @@
#include "qdnslookup_p.h"
#include <qfunctions_winrt.h>
#include <qurl.h>
#include <qdebug.h>
@ -50,6 +51,8 @@ using namespace ABI::Windows::Networking;
using namespace ABI::Windows::Networking::Connectivity;
using namespace ABI::Windows::Networking::Sockets;
#define E_NO_SUCH_HOST 0x80072af9
QT_BEGIN_NAMESPACE
void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestName, const QHostAddress &nameserver, QDnsLookupReply *reply)
@ -83,40 +86,47 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
}
ComPtr<IHostName> host;
HStringReference hostNameRef((const wchar_t*)aceHostname.utf16());
hostnameFactory->CreateHostName(hostNameRef.Get(), &host);
hr = hostnameFactory->CreateHostName(hostNameRef.Get(), &host);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IDatagramSocketStatics> datagramSocketStatics;
GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IAsyncOperation<IVectorView<EndpointPair *> *>> op;
datagramSocketStatics->GetEndpointPairsAsync(host.Get(),
hr = datagramSocketStatics->GetEndpointPairsAsync(host.Get(),
HString::MakeReference(L"0").Get(),
&op);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IVectorView<EndpointPair *>> endpointPairs;
hr = op->GetResults(&endpointPairs);
int waitCount = 0;
while (hr == E_ILLEGAL_METHOD_CALL) {
WaitForSingleObjectEx(GetCurrentThread(), 50, FALSE);
hr = op->GetResults(&endpointPairs);
if (++waitCount > 1200) // Wait for 1 minute max
hr = QWinRTFunctions::await(op, endpointPairs.GetAddressOf(), QWinRTFunctions::YieldThread, 60 * 1000);
if (hr == E_NO_SUCH_HOST || !endpointPairs) {
reply->error = QDnsLookup::NotFoundError;
reply->errorString = tr("Host %1 could not be found.").arg(aceHostname);
return;
}
if (FAILED(hr)) {
reply->error = QDnsLookup::ServerFailureError;
reply->errorString = tr("Unknown error");
return;
}
if (!endpointPairs)
return;
unsigned int size;
endpointPairs->get_Size(&size);
hr = endpointPairs->get_Size(&size);
Q_ASSERT_SUCCEEDED(hr);
// endpoint pairs might contain duplicates so we temporarily store addresses in a QSet
QSet<QHostAddress> addresses;
for (unsigned int i = 0; i < size; ++i) {
ComPtr<IEndpointPair> endpointpair;
endpointPairs->GetAt(i, &endpointpair);
hr = endpointPairs->GetAt(i, &endpointpair);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IHostName> remoteHost;
endpointpair->get_RemoteHostName(&remoteHost);
hr = endpointpair->get_RemoteHostName(&remoteHost);
Q_ASSERT_SUCCEEDED(hr);
HostNameType type;
remoteHost->get_Type(&type);
hr = remoteHost->get_Type(&type);
Q_ASSERT_SUCCEEDED(hr);
if (type == HostNameType_Bluetooth || type == HostNameType_DomainName
|| (requestType != QDnsLookup::ANY
&& ((type == HostNameType_Ipv4 && requestType == QDnsLookup::AAAA)
@ -124,7 +134,8 @@ void QDnsLookupRunnable::query(const int requestType, const QByteArray &requestN
continue;
HString name;
remoteHost->get_CanonicalName(name.GetAddressOf());
hr = remoteHost->get_CanonicalName(name.GetAddressOf());
Q_ASSERT_SUCCEEDED(hr);
UINT32 length;
PCWSTR rawString = name.GetRawBuffer(&length);
addresses.insert(QHostAddress(QString::fromWCharArray(rawString, length)));

View File

@ -379,7 +379,7 @@ void QNetmaskAddress::setPrefixLength(QAbstractSocket::NetworkLayerProtocol prot
\value Any The dual stack any-address. A socket bound with this address will listen on both IPv4 and IPv6 interfaces.
*/
/*! Constructs a host address object with the IP address 0.0.0.0.
/*! Constructs a null host address object, i.e. an address which is not valid for any host or interface.
\sa clear()
*/

View File

@ -34,7 +34,6 @@
#include <winsock2.h>
#include "qhostinfo_p.h"
#include "private/qnativesocketengine_p.h"
#include <ws2tcpip.h>
#include <private/qsystemlibrary_p.h>
#include <qmutex.h>
@ -77,14 +76,18 @@ static void resolveLibrary()
{
// Attempt to resolve getaddrinfo(); without it we'll have to fall
// back to gethostbyname(), which has no IPv6 support.
#if !defined(Q_OS_WINCE)
local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getaddrinfo");
local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "freeaddrinfo");
local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getnameinfo");
#else
#if defined(Q_OS_WINCE)
local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "getaddrinfo");
local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "freeaddrinfo");
local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2"), "getnameinfo");
#elif defined (Q_OS_WINRT)
local_getaddrinfo = (getaddrinfoProto) &getaddrinfo;
local_freeaddrinfo = (freeaddrinfoProto) &freeaddrinfo;
local_getnameinfo = (getnameinfoProto) getnameinfo;
#else
local_getaddrinfo = (getaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getaddrinfo");
local_freeaddrinfo = (freeaddrinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "freeaddrinfo");
local_getnameinfo = (getnameinfoProto) QSystemLibrary::resolve(QLatin1String("ws2_32"), "getnameinfo");
#endif
}

View File

@ -1,150 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the QtNetwork module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qhostinfo_p.h"
#include <qfunctions_winrt.h>
#include <qurl.h>
#include <wrl.h>
#include <windows.networking.h>
#include <windows.networking.sockets.h>
#include <windows.networking.connectivity.h>
using namespace Microsoft::WRL;
using namespace Microsoft::WRL::Wrappers;
using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Foundation::Collections;
using namespace ABI::Windows::Networking;
using namespace ABI::Windows::Networking::Connectivity;
using namespace ABI::Windows::Networking::Sockets;
QT_BEGIN_NAMESPACE
#define E_NO_SUCH_HOST 0x80072af9
//#define QHOSTINFO_DEBUG
QHostInfo QHostInfoAgent::fromName(const QString &hostName)
{
QHostInfo results;
QHostAddress address;
if (address.setAddress(hostName)) {
// Reverse lookup
// TODO: is there a replacement for getnameinfo for winrt?
Q_UNIMPLEMENTED();
return results;
}
QByteArray aceHostname = QUrl::toAce(hostName);
results.setHostName(hostName);
if (aceHostname.isEmpty()) {
results.setError(QHostInfo::HostNotFound);
results.setErrorString(hostName.isEmpty() ? tr("No host name given") : tr("Invalid hostname"));
return results;
}
ComPtr<IHostNameFactory> hostnameFactory;
HRESULT hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_HostName).Get(),
IID_PPV_ARGS(&hostnameFactory));
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IHostName> host;
HStringReference hostNameRef((const wchar_t*)hostName.utf16());
hr = hostnameFactory->CreateHostName(hostNameRef.Get(), &host);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IDatagramSocketStatics> datagramSocketStatics;
hr = GetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Networking_Sockets_DatagramSocket).Get(), &datagramSocketStatics);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IAsyncOperation<IVectorView<EndpointPair *> *>> op;
hr = datagramSocketStatics->GetEndpointPairsAsync(host.Get(),
HString::MakeReference(L"0").Get(),
&op);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IVectorView<EndpointPair *>> endpointPairs;
hr = op->GetResults(&endpointPairs);
int waitCount = 0;
while (hr == E_ILLEGAL_METHOD_CALL) {
WaitForSingleObjectEx(GetCurrentThread(), 50, FALSE);
hr = op->GetResults(&endpointPairs);
if (++waitCount > 1200) // Wait for 1 minute max
return results;
}
if (hr == E_NO_SUCH_HOST || !endpointPairs) {
results.setError(QHostInfo::HostNotFound);
results.setErrorString(tr("Host %1 could not be found.").arg(hostName));
return results;
}
Q_ASSERT_SUCCEEDED(hr);
unsigned int size;
hr = endpointPairs->get_Size(&size);
Q_ASSERT_SUCCEEDED(hr);
QList<QHostAddress> addresses;
for (unsigned int i = 0; i < size; ++i) {
ComPtr<IEndpointPair> endpointpair;
hr = endpointPairs->GetAt(i, &endpointpair);
Q_ASSERT_SUCCEEDED(hr);
ComPtr<IHostName> remoteHost;
hr = endpointpair->get_RemoteHostName(&remoteHost);
Q_ASSERT_SUCCEEDED(hr);
if (!remoteHost)
continue;
HostNameType type;
hr = remoteHost->get_Type(&type);
Q_ASSERT_SUCCEEDED(hr);
if (type == HostNameType_DomainName)
continue;
HString name;
hr = remoteHost->get_CanonicalName(name.GetAddressOf());
Q_ASSERT_SUCCEEDED(hr);
UINT32 length;
PCWSTR rawString = name.GetRawBuffer(&length);
QHostAddress addr;
addr.setAddress(QString::fromWCharArray(rawString, length));
if (!addresses.contains(addr))
addresses.append(addr);
}
results.setAddresses(addresses);
return results;
}
// QString QHostInfo::localDomainName() defined in qnetworkinterface_win.cpp
QT_END_NAMESPACE

View File

@ -972,7 +972,7 @@ qint64 QNativeSocketEnginePrivate::nativeSendDatagram(const char *data, qint64 l
# elif defined(IP_SENDSRCADDR)
struct in_addr *data = reinterpret_cast<in_addr *>(CMSG_DATA(cmsgptr));
cmsgptr->cmsg_type = IP_SENDSRCADDR;
addr->s_addr = htonl(header.senderAddress.toIPv4Address());
data->s_addr = htonl(header.senderAddress.toIPv4Address());
# endif
cmsgptr->cmsg_level = IPPROTO_IP;
msg.msg_controllen += CMSG_SPACE(sizeof(*data));

View File

@ -1111,14 +1111,16 @@ bool QSocks5SocketEngine::connectInternal()
}
}
if (d->socks5State == QSocks5SocketEnginePrivate::Uninitialized
&& d->socketState != QAbstractSocket::ConnectingState) {
if (d->socketState != QAbstractSocket::ConnectingState) {
if (d->socks5State == QSocks5SocketEnginePrivate::Uninitialized) {
setState(QAbstractSocket::ConnectingState);
//limit buffer in internal socket, data is buffered in the external socket under application control
d->data->controlSocket->setReadBufferSize(65536);
d->data->controlSocket->connectToHost(d->proxyInfo.hostName(), d->proxyInfo.port());
return false;
}
d->data->controlSocket->connectToHost(d->proxyInfo.hostName(), d->proxyInfo.port());
}
return false;
}

View File

@ -111,9 +111,13 @@ QAndroidPlatformScreen::~QAndroidPlatformScreen()
QWindow *QAndroidPlatformScreen::topWindow() const
{
foreach (QAndroidPlatformWindow *w, m_windowStack)
if (w->window()->type() == Qt::Window || w->window()->type() == Qt::Dialog)
foreach (QAndroidPlatformWindow *w, m_windowStack) {
if (w->window()->type() == Qt::Window ||
w->window()->type() == Qt::Popup ||
w->window()->type() == Qt::Dialog) {
return w->window();
}
}
return 0;
}

View File

@ -707,6 +707,7 @@ void qt_mac_cleanUpMacColorSpaces()
CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice)
{
#ifdef QT_NO_WIDGETS
Q_UNUSED(paintDevice)
return qt_mac_displayColorSpace(0);
#else
bool isWidget = (paintDevice->devType() == QInternal::Widget);

View File

@ -157,6 +157,7 @@ void *QCocoaNativeInterface::NSPrintInfoForPrintEngine(QPrintEngine *printEngine
macPrintEnginePriv->initialize();
return macPrintEnginePriv->printInfo;
#else
Q_UNUSED(printEngine);
qFatal("Printing is not supported when Qt is configured with -no-widgets");
return 0;
#endif

View File

@ -439,17 +439,18 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wobjc-method-access")
enum { NSWindowOcclusionStateVisible = 1UL << 1 };
#endif
// Several unit tests expect paint and/or expose events for windows that are
// sometimes (unpredictably) occluded and some unit tests depend on QWindow::isExposed -
// don't send Expose/Obscure events when running under QTestLib.
static const bool onTestLib = qt_mac_resolveOption(false, "QT_QTESTLIB_RUNNING");
if (!onTestLib) {
if ((NSUInteger)[self.window occlusionState] & NSWindowOcclusionStateVisible) {
m_platformWindow->exposeWindow();
} else {
// Send Obscure events on window occlusion to stop animations. Several
// unit tests expect paint and/or expose events for windows that are
// sometimes (unpredictably) occlouded: Don't send Obscure events when
// running under QTestLib.
static bool onTestLib = qt_mac_resolveOption(false, "QT_QTESTLIB_RUNNING");
if (!onTestLib)
// Send Obscure events on window occlusion to stop animations.
m_platformWindow->obscureWindow();
}
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
QT_WARNING_POP
#endif

View File

@ -107,8 +107,10 @@ QIOSIntegration::QIOSIntegration()
m_touchDevice = new QTouchDevice;
m_touchDevice->setType(QTouchDevice::TouchScreen);
QTouchDevice::Capabilities touchCapabilities = QTouchDevice::Position | QTouchDevice::NormalizedPosition;
if ([mainScreen respondsToSelector:@selector(traitCollection)]) {
if (mainScreen.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
touchCapabilities |= QTouchDevice::Pressure;
}
m_touchDevice->setCapabilities(touchCapabilities);
QWindowSystemInterface::registerTouchDevice(m_touchDevice);
QMacInternalPasteboardMime::initializeMimeTypes();

View File

@ -308,7 +308,7 @@ static QStringList fontNamesFromTTCFile(const QString &filename)
if (ttcTableHeader.majorVersion < 1 || ttcTableHeader.majorVersion > 2)
return retVal;
QVarLengthArray<quint32> offsetTable(ttcTableHeader.numFonts);
bytesToRead = sizeof(offsetTable) * ttcTableHeader.numFonts;
bytesToRead = sizeof(quint32) * ttcTableHeader.numFonts;
bytesRead = f.read((char*)offsetTable.data(), bytesToRead);
if (bytesToRead != bytesRead)
return retVal;

View File

@ -50,6 +50,7 @@
#include <QtCore/QtEndian>
#include <QtCore/QVarLengthArray>
#include <private/qstringiterator_p.h>
#include <QtCore/private/qsystemlibrary_p.h>
#include <dwrite.h>
#include <d2d1.h>
@ -645,6 +646,16 @@ QFontEngine *QWindowsFontEngineDirectWrite::cloneWithSize(qreal pixelSize) const
return fontEngine;
}
// Dynamically resolve GetUserDefaultLocaleName, which is available from Windows
// Vista onwards. ### fixme 5.7: Consider reverting to direct linking.
typedef int (WINAPI *GetUserDefaultLocaleNamePtr)(LPWSTR, int);
static inline GetUserDefaultLocaleNamePtr resolveGetUserDefaultLocaleName()
{
QSystemLibrary library(QStringLiteral("kernel32"));
return (GetUserDefaultLocaleNamePtr)library.resolve("GetUserDefaultLocaleName");
}
void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request,
int dpi, IDWriteFont *font)
{
@ -663,7 +674,9 @@ void QWindowsFontEngineDirectWrite::initFontInfo(const QFontDef &request,
BOOL exists = false;
wchar_t localeName[LOCALE_NAME_MAX_LENGTH];
int defaultLocaleSuccess = GetUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH);
static const GetUserDefaultLocaleNamePtr getUserDefaultLocaleName = resolveGetUserDefaultLocaleName();
const int defaultLocaleSuccess = getUserDefaultLocaleName
? getUserDefaultLocaleName(localeName, LOCALE_NAME_MAX_LENGTH) : 0;
if (defaultLocaleSuccess)
hr = familyNames->FindLocaleName(localeName, &index, &exists);

View File

@ -131,7 +131,7 @@ static inline bool booleanSystemParametersInfo(UINT what, bool defaultValue)
return defaultValue;
}
static inline bool dWordSystemParametersInfo(UINT what, DWORD defaultValue)
static inline DWORD dWordSystemParametersInfo(UINT what, DWORD defaultValue)
{
DWORD result;
if (SystemParametersInfo(what, 0, &result, 0))
@ -394,7 +394,7 @@ QVariant QWindowsTheme::themeHint(ThemeHint hint) const
case ContextMenuOnMouseRelease:
return QVariant(true);
case WheelScrollLines:
return dWordSystemParametersInfo(SPI_GETWHEELSCROLLLINES, 3);
return QVariant(int(dWordSystemParametersInfo(SPI_GETWHEELSCROLLLINES, 3)));
default:
break;
}

View File

@ -79,6 +79,7 @@ typedef IEventHandler<IInspectable *> ResumeHandler;
typedef IEventHandler<SuspendingEventArgs *> SuspendHandler;
#ifdef Q_OS_WINPHONE
typedef IEventHandler<BackPressedEventArgs*> BackPressedHandler;
typedef IEventHandler<CameraEventArgs*> CameraButtonHandler;
#endif
QT_BEGIN_NAMESPACE
@ -88,6 +89,8 @@ uint qHash(CoreApplicationCallbackRemover key) { void *ptr = *(void **)(&key); r
#ifdef Q_OS_WINPHONE
typedef HRESULT (__stdcall IHardwareButtonsStatics::*HardwareButtonsCallbackRemover)(EventRegistrationToken);
uint qHash(HardwareButtonsCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
typedef HRESULT (__stdcall IHardwareButtonsStatics2::*HardwareButtons2CallbackRemover)(EventRegistrationToken);
uint qHash(HardwareButtons2CallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
#endif
class QWinRTIntegrationPrivate
@ -103,6 +106,10 @@ public:
#ifdef Q_OS_WINPHONE
ComPtr<IHardwareButtonsStatics> hardwareButtons;
QHash<HardwareButtonsCallbackRemover, EventRegistrationToken> buttonsTokens;
ComPtr<IHardwareButtonsStatics2> cameraButtons;
QHash<HardwareButtons2CallbackRemover, EventRegistrationToken> cameraTokens;
bool cameraHalfPressed : 1;
bool cameraPressed : 1;
#endif
};
@ -130,6 +137,23 @@ QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate)
hr = d->hardwareButtons->add_BackPressed(Callback<BackPressedHandler>(this, &QWinRTIntegration::onBackButtonPressed).Get(),
&d->buttonsTokens[&IHardwareButtonsStatics::remove_BackPressed]);
Q_ASSERT_SUCCEEDED(hr);
hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(),
IID_PPV_ARGS(&d->cameraButtons));
Q_ASSERT_SUCCEEDED(hr);
if (qEnvironmentVariableIntValue("QT_QPA_ENABLE_CAMERA_KEYS")) {
hr = d->cameraButtons->add_CameraPressed(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraPressed).Get(),
&d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraPressed]);
Q_ASSERT_SUCCEEDED(hr);
hr = d->cameraButtons->add_CameraHalfPressed(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraHalfPressed).Get(),
&d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraHalfPressed]);
Q_ASSERT_SUCCEEDED(hr);
hr = d->cameraButtons->add_CameraReleased(Callback<CameraButtonHandler>(this, &QWinRTIntegration::onCameraReleased).Get(),
&d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraReleased]);
Q_ASSERT_SUCCEEDED(hr);
}
d->cameraPressed = false;
d->cameraHalfPressed = false;
#endif // Q_OS_WINPHONE
QEventDispatcherWinRT::runOnXamlThread([d]() {
@ -151,6 +175,10 @@ QWinRTIntegration::~QWinRTIntegration()
hr = (d->hardwareButtons.Get()->*i.key())(i.value());
Q_ASSERT_SUCCEEDED(hr);
}
for (QHash<HardwareButtons2CallbackRemover, EventRegistrationToken>::const_iterator i = d->cameraTokens.begin(); i != d->cameraTokens.end(); ++i) {
hr = (d->cameraButtons.Get()->*i.key())(i.value());
Q_ASSERT_SUCCEEDED(hr);
}
#endif
for (QHash<CoreApplicationCallbackRemover, EventRegistrationToken>::const_iterator i = d->applicationTokens.begin(); i != d->applicationTokens.end(); ++i) {
hr = (d->application.Get()->*i.key())(i.value());
@ -268,6 +296,42 @@ HRESULT QWinRTIntegration::onBackButtonPressed(IInspectable *, IBackPressedEvent
args->put_Handled(pressed || released);
return S_OK;
}
HRESULT QWinRTIntegration::onCameraPressed(IInspectable *, ICameraEventArgs *)
{
Q_D(QWinRTIntegration);
QWindow *window = d->mainScreen->topWindow();
QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_Camera, Qt::NoModifier,
0, 0, 0, QString(), false, 1, false);
d->cameraPressed = true;
return S_OK;
}
HRESULT QWinRTIntegration::onCameraHalfPressed(IInspectable *, ICameraEventArgs *)
{
Q_D(QWinRTIntegration);
QWindow *window = d->mainScreen->topWindow();
QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_CameraFocus, Qt::NoModifier,
0, 0, 0, QString(), false, 1, false);
d->cameraHalfPressed = true;
return S_OK;
}
HRESULT QWinRTIntegration::onCameraReleased(IInspectable *, ICameraEventArgs *)
{
Q_D(QWinRTIntegration);
QWindow *window = d->mainScreen->topWindow();
if (d->cameraHalfPressed)
QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_CameraFocus, Qt::NoModifier,
0, 0, 0, QString(), false, 1, false);
if (d->cameraPressed)
QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_Camera, Qt::NoModifier,
0, 0, 0, QString(), false, 1, false);
d->cameraHalfPressed = false;
d->cameraPressed = false;
return S_OK;
}
#endif // Q_OS_WINPHONE
HRESULT QWinRTIntegration::onSuspended(IInspectable *, ISuspendingEventArgs *)

View File

@ -52,6 +52,7 @@ namespace ABI {
namespace UI {
namespace Input {
struct IBackPressedEventArgs;
struct ICameraEventArgs;
}
}
}
@ -100,6 +101,9 @@ public:
private:
#ifdef Q_OS_WINPHONE
HRESULT onBackButtonPressed(IInspectable *, ABI::Windows::Phone::UI::Input::IBackPressedEventArgs *args);
HRESULT onCameraPressed(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
HRESULT onCameraHalfPressed(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
HRESULT onCameraReleased(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *);
#endif
HRESULT onSuspended(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *);
HRESULT onResume(IInspectable *, IInspectable *);

View File

@ -3,14 +3,14 @@ Requires libxcb >= 1.5.
PACKAGE DEPENDENCIES
Required packages:
libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm1 libxcb-icccm1-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev
libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm1 libxcb-icccm1-dev libxcb-sync0 libxcb-sync0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxcb-xinerama0-dev
On Ubuntu 11.10 icccm1 is replaced by icccm4 and xcb-render-util is not available:
libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev
libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-glx0-dev libxcb-xinerama0-dev
The packages for xcb-render-util can be installed manually from http://packages.ubuntu.com/natty/libxcb-render-util0 and http://packages.ubuntu.com/natty/libxcb-render-util0-dev
On Ubuntu 12.04 icccm1 is replaced by icccm4 and xcb-render-util can be installed automatically:
libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-dev
libxcb1 libxcb1-dev libx11-xcb1 libx11-xcb-dev libxcb-keysyms1 libxcb-keysyms1-dev libxcb-image0 libxcb-image0-dev libxcb-shm0 libxcb-shm0-dev libxcb-icccm4 libxcb-icccm4-dev libxcb-sync0 libxcb-sync0-dev libxcb-xfixes0-dev libxrender-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0 libxcb-render-util0-dev libxcb-glx0-dev libxcb-xinerama0-dev
On Fedora, the following packages are required:

View File

@ -175,7 +175,11 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat
void QGLXContext::init(QXcbScreen *screen, QPlatformOpenGLContext *share)
{
if (m_format.renderableType() == QSurfaceFormat::DefaultRenderableType)
#if defined(QT_OPENGL_ES_2)
m_format.setRenderableType(QSurfaceFormat::OpenGLES);
#else
m_format.setRenderableType(QSurfaceFormat::OpenGL);
#endif
if (m_format.renderableType() != QSurfaceFormat::OpenGL && m_format.renderableType() != QSurfaceFormat::OpenGLES)
return;

View File

@ -60,6 +60,7 @@
#include <xcb/shm.h>
#include <xcb/sync.h>
#include <xcb/xfixes.h>
#include <xcb/xinerama.h>
#ifdef XCB_USE_XLIB
#include <X11/Xlib.h>
@ -386,6 +387,7 @@ void QXcbConnection::initializeScreens()
xcb_screen_t *xcbScreen = it.data;
QXcbVirtualDesktop *virtualDesktop = new QXcbVirtualDesktop(this, xcbScreen, xcbScreenNumber);
m_virtualDesktops.append(virtualDesktop);
QList<QPlatformScreen *> siblings;
if (has_randr_extension) {
xcb_generic_error_t *error = NULL;
// RRGetScreenResourcesCurrent is fast but it may return nothing if the
@ -429,7 +431,6 @@ void QXcbConnection::initializeScreens()
qWarning("failed to get the primary output of the screen");
free(error);
} else {
QList<QPlatformScreen *> siblings;
for (int i = 0; i < outputCount; i++) {
QScopedPointer<xcb_randr_get_output_info_reply_t, QScopedPointerPodDeleter> output(
xcb_randr_get_output_info_reply(xcb_connection(),
@ -471,12 +472,30 @@ void QXcbConnection::initializeScreens()
}
}
}
virtualDesktop->setScreens(siblings);
}
}
}
} else if (has_xinerama_extension) {
// Xinerama is available
xcb_xinerama_query_screens_cookie_t cookie = xcb_xinerama_query_screens(m_connection);
xcb_xinerama_query_screens_reply_t *screens = xcb_xinerama_query_screens_reply(m_connection,
cookie,
Q_NULLPTR);
if (screens) {
xcb_xinerama_screen_info_iterator_t it = xcb_xinerama_query_screens_screen_info_iterator(screens);
while (it.rem) {
xcb_xinerama_screen_info_t *screen_info = it.data;
QXcbScreen *screen = new QXcbScreen(this, virtualDesktop,
XCB_NONE, Q_NULLPTR,
screen_info, it.index);
siblings << screen;
m_screens << screen;
xcb_xinerama_screen_info_next(&it);
}
if (virtualDesktop->screens().isEmpty()) {
free(screens);
}
}
if (siblings.isEmpty()) {
// If there are no XRandR outputs or XRandR extension is missing,
// then create a fake/legacy screen.
QXcbScreen *screen = new QXcbScreen(this, virtualDesktop, XCB_NONE, Q_NULLPTR);
@ -486,8 +505,9 @@ void QXcbConnection::initializeScreens()
primaryScreen = screen;
primaryScreen->setPrimary(true);
}
virtualDesktop->addScreen(screen);
siblings << screen;
}
virtualDesktop->setScreens(siblings);
xcb_screen_next(&it);
++xcbScreenNumber;
} // for each xcb screen
@ -529,12 +549,14 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
, xfixes_first_event(0)
, xrandr_first_event(0)
, xkb_first_event(0)
, has_xinerama_extension(false)
, has_shape_extension(false)
, has_randr_extension(false)
, has_input_shape(false)
, has_xkb(false)
, m_buttons(0)
, m_focusWindow(0)
, m_mouseGrabber(0)
, m_clientLeader(0)
, m_systemTrayTracker(0)
, m_glIntegration(Q_NULLPTR)
@ -583,7 +605,10 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, bool canGra
m_time = XCB_CURRENT_TIME;
m_netWmUserTime = XCB_CURRENT_TIME;
if (!qEnvironmentVariableIsSet("QT_XCB_NO_XRANDR"))
initializeXRandr();
if (!has_randr_extension)
initializeXinerama();
initializeXFixes();
initializeScreens();
@ -1331,6 +1356,10 @@ void QXcbConnection::setFocusWindow(QXcbWindow *w)
{
m_focusWindow = w;
}
void QXcbConnection::setMouseGrabber(QXcbWindow *w)
{
m_mouseGrabber = w;
}
void QXcbConnection::grabServer()
{
@ -2090,6 +2119,22 @@ void QXcbConnection::initializeXRandr()
}
}
void QXcbConnection::initializeXinerama()
{
const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_connection, &xcb_xinerama_id);
if (!reply || !reply->present)
return;
xcb_generic_error_t *error = Q_NULLPTR;
xcb_xinerama_is_active_cookie_t xinerama_query_cookie = xcb_xinerama_is_active(m_connection);
xcb_xinerama_is_active_reply_t *xinerama_is_active = xcb_xinerama_is_active_reply(m_connection,
xinerama_query_cookie,
&error);
has_xinerama_extension = xinerama_is_active && !error && xinerama_is_active->state;
free(error);
free(xinerama_is_active);
}
void QXcbConnection::initializeXShape()
{
const xcb_query_extension_reply_t *xshape_reply = xcb_get_extension_data(m_connection, &xcb_shape_id);
@ -2177,7 +2222,9 @@ void QXcbConnection::initializeXKB()
bool QXcbConnection::xi2MouseEvents() const
{
static bool mouseViaXI2 = !qEnvironmentVariableIsSet("QT_XCB_NO_XI2_MOUSE");
return mouseViaXI2;
// Don't use XInput2 when Xinerama extension is enabled,
// because it causes problems with multi-monitor setup.
return mouseViaXI2 && !has_xinerama_extension;
}
#if defined(XCB_USE_XINPUT2)

View File

@ -469,6 +469,8 @@ public:
QXcbWindow *focusWindow() const { return m_focusWindow; }
void setFocusWindow(QXcbWindow *);
QXcbWindow *mouseGrabber() const { return m_mouseGrabber; }
void setMouseGrabber(QXcbWindow *);
QByteArray startupId() const { return m_startupId; }
void setStartupId(const QByteArray &nextId) { m_startupId = nextId; }
@ -515,6 +517,7 @@ private:
void initializeXFixes();
void initializeXRender();
void initializeXRandr();
void initializeXinerama();
void initializeXShape();
void initializeXKB();
void handleClientMessageEvent(const xcb_client_message_event_t *event);
@ -643,6 +646,7 @@ private:
uint32_t xrandr_first_event;
uint32_t xkb_first_event;
bool has_xinerama_extension;
bool has_shape_extension;
bool has_randr_extension;
bool has_input_shape;
@ -651,6 +655,7 @@ private:
Qt::MouseButtons m_buttons;
QXcbWindow *m_focusWindow;
QXcbWindow *m_mouseGrabber;
xcb_window_t m_clientLeader;
QByteArray m_startupId;

View File

@ -274,7 +274,7 @@ void QXcbConnection::finalizeXInput2()
void QXcbConnection::xi2Select(xcb_window_t window)
{
if (!m_xi2Enabled)
if (!m_xi2Enabled || window == rootWindow())
return;
Display *xDisplay = static_cast<Display *>(m_xlib_display);

View File

@ -194,6 +194,8 @@ void QXcbDrag::startDrag()
setUseCompositing(current_virtual_desktop->compositingActive());
QBasicDrag::startDrag();
if (connection()->mouseGrabber() == Q_NULLPTR)
shapedPixmapWindow()->setMouseGrabEnabled(true);
}
void QXcbDrag::endDrag()

View File

@ -155,8 +155,15 @@ void QXcbVirtualDesktop::updateWorkArea()
}
}
static inline QSizeF sizeInMillimeters(const QSize &size, const QDpi &dpi)
{
return QSizeF(Q_MM_PER_INCH * size.width() / dpi.first,
Q_MM_PER_INCH * size.height() / dpi.second);
}
QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop,
xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output)
xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *output,
const xcb_xinerama_screen_info_t *xineramaScreenInfo, int xineramaScreenIdx)
: QXcbObject(connection)
, m_virtualDesktop(virtualDesktop)
, m_output(outputId)
@ -188,6 +195,14 @@ QXcbScreen::QXcbScreen(QXcbConnection *connection, QXcbVirtualDesktop *virtualDe
updateRefreshRate(crtc->mode);
free(crtc);
}
} else if (xineramaScreenInfo) {
m_geometry = QRect(xineramaScreenInfo->x_org, xineramaScreenInfo->y_org,
xineramaScreenInfo->width, xineramaScreenInfo->height);
m_nativeGeometry = m_geometry;
m_availableGeometry = m_geometry & m_virtualDesktop->workArea();
m_sizeMillimeters = sizeInMillimeters(m_geometry.size(), virtualDpi());
if (xineramaScreenIdx > -1)
m_outputName += QLatin1Char('-') + QString::number(xineramaScreenIdx);
}
if (m_geometry.isEmpty()) {
@ -536,11 +551,8 @@ void QXcbScreen::updateGeometry(const QRect &geom, uint8_t rotation)
// It can be that physical size is unknown while virtual size
// is known (probably back-calculated from DPI and resolution),
// e.g. on VNC or with some hardware.
if (m_sizeMillimeters.isEmpty()) {
QDpi dpi = virtualDpi();
m_sizeMillimeters = QSizeF(Q_MM_PER_INCH * xGeometry.width() / dpi.first,
Q_MM_PER_INCH * xGeometry.width() / dpi.second);
}
if (m_sizeMillimeters.isEmpty())
m_sizeMillimeters = sizeInMillimeters(xGeometry.size(), virtualDpi());
qreal dpi = xGeometry.width() / physicalSize().width() * qreal(25.4);
m_pixelDensity = qRound(dpi/96);

Some files were not shown because too many files have changed in this diff Show More