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

Conflicts:
	src/corelib/tools/qhash.h
	src/gui/kernel/qevent.h
	src/widgets/kernel/qshortcut.cpp
	src/widgets/kernel/qshortcut.h

Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
bb10
Qt Forward Merge Bot 2019-11-25 01:00:25 +01:00 committed by Allan Sandfeld Jensen
commit 58c69df4d3
969 changed files with 43619 additions and 37236 deletions

View File

@ -209,6 +209,7 @@ sub classNames {
$$clean = 1;
$$requires = "";
my $suspended = 0;
my $ihdrbase = basename($iheader);
my $parsable = "";
@ -221,9 +222,11 @@ sub classNames {
$$clean = 0 if ($line =~ m/^#pragma qt_sync_skip_header_check/);
return @ret if($line =~ m/^#pragma qt_sync_stop_processing/);
push(@ret, $1) if($line =~ m/^#pragma qt_class\(([^)]*)\)[\r\n]*$/);
$suspended = 1 if ($line =~ m/^#pragma qt_sync_suspend_processing/);
$suspended = 0 if ($line =~ m/^#pragma qt_sync_resume_processing/);
$line = 0;
}
if($line) {
if ($line && !$suspended) {
$line =~ s,//.*$,,; #remove c++ comments
$line .= ";" if($line =~ m/^Q_[A-Z_0-9]*\(.*\)[\r\n]*$/); #qt macro
$line .= ";" if($line =~ m/^QT_(BEGIN|END)_HEADER[\r\n]*$/); #qt macro

View File

@ -130,7 +130,7 @@ Build options:
Currently supported backends are 'etw' (Windows) and
'lttng' (Linux), or 'yes' for auto-detection. [no]
-sanitize {address|thread|memory|undefined}
-sanitize {address|thread|memory|fuzzer-no-link|undefined}
Instrument with the specified compiler sanitizer.
Note that some sanitizers cannot be combined;
for example, -sanitize address cannot be combined with

3
configure vendored
View File

@ -445,8 +445,7 @@ while [ "$#" -gt 0 ]; do
-android-ndk| \
-android-ndk-platform| \
-android-ndk-host| \
-android-arch| \
-android-toolchain-version)
-android-arch)
VAR=`echo $1 | sed 's,^-\(.*\),\1,'`
shift
VAL="$1"

View File

@ -894,6 +894,12 @@
"autoDetect": false,
"output": [ "publicConfig" ]
},
"sanitize_fuzzer_no_link": {
"label": "Fuzzer (instrumentation only)",
"autoDetect": false,
"output": [ "publicConfig" ],
"purpose": [ "Adds instrumentation for fuzzing to the binaries but links to the usual main function instead of a fuzzer's." ]
},
"sanitize_undefined": {
"label": "Undefined",
"autoDetect": false,
@ -901,7 +907,7 @@
},
"sanitizer": {
"label": "Sanitizers",
"condition": "features.sanitize_address || features.sanitize_thread || features.sanitize_memory || features.sanitize_undefined",
"condition": "features.sanitize_address || features.sanitize_thread || features.sanitize_memory || features.sanitize_fuzzer_no_link || features.sanitize_undefined",
"output": [ "sanitizer", "publicConfig" ]
},
"coverage_trace_pc_guard": {
@ -1443,6 +1449,11 @@ Qt can be built in release mode with separate debug information, so
"type": "error",
"condition": "features.coverage && !config.clang",
"message": "Command line option -coverage is only supported with clang compilers."
},
{
"type": "error",
"condition": "features.sanitize_fuzzer_no_link && !config.clang",
"message": "Command line option -sanitize fuzzer-no-link is only supported with clang compilers."
}
],
@ -1580,7 +1591,13 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
{
"section": "Sanitizers",
"condition": "features.sanitizer",
"entries": [ "sanitize_address", "sanitize_thread", "sanitize_memory", "sanitize_undefined" ]
"entries": [
"sanitize_address",
"sanitize_thread",
"sanitize_memory",
"sanitize_fuzzer_no_link",
"sanitize_undefined"
]
},
{
"message": "Code Coverage Instrumentation",

View File

@ -53,6 +53,8 @@ defineTest(qtConfCommandline_sanitize) {
qtConfCommandlineSetInput("sanitize_thread", "yes")
} else: equals(val, "memory") {
qtConfCommandlineSetInput("sanitize_memory", "yes")
} else: equals(val, "fuzzer-no-link") {
qtConfCommandlineSetInput("sanitize_fuzzer_no_link", "yes")
} else: equals(val, "undefined") {
qtConfCommandlineSetInput("sanitize_undefined", "yes")
} else {
@ -607,8 +609,11 @@ defineTest(qtConfOutput_prepareOptions) {
qtConfAddNote("Available Android host does not match host architecture.")
}
} else {
!exists($$ndk_tc_pfx/$$ndk_host/*): \
qtConfFatalError("Specified Android NDK host is invalid.")
!exists($$ndk_tc_pfx/$$ndk_host/*) {
err = "Specified Android NDK host '$$ndk_host' is invalid. Expected files in the following directory to exist:"
err += '$${ndk_tc_pfx}/$${ndk_host}/'
qtConfFatalError($$err)
}
}
android_abis = $$eval(config.input.android-abis)

69
dist/changes-5.13.2 vendored Normal file
View File

@ -0,0 +1,69 @@
Qt 5.13.2 is a bug-fix release. It maintains both forward and backward
compatibility (source and binary) with Qt 5.13.0 through 5.13.1.
For more details, refer to the online documentation included in this
distribution. The documentation is also available online:
https://doc.qt.io/qt-5/index.html
The Qt version 5.13 series is binary compatible with the 5.12.x series.
Applications compiled for 5.12 will continue to run with 5.13.
Some of the changes listed in this file include issue tracking numbers
corresponding to tasks in the Qt Bug Tracker:
https://bugreports.qt.io/
Each of these identifiers can be entered in the bug tracker to obtain more
information about a particular change.
****************************************************************************
* QtCore *
****************************************************************************
- Fixed a bug that made qErrnoWarning() say there was no error when
generating the error message.
- QBitArray:
* Fixed two bugs that caused QBitArrays created using fromBits() not to
compare equal to the equivalent QBitArray created using other methods
if the size was zero or not a multiple of 4. If the size modulus 8 was
5, 6, or 7, the data was actually incorrect.
- QCryptographicHash:
* Fixed a bug that caused the SHA-3 and Keccak algorithms to crash if
passed 256 MB of data or more.
- QObject:
* Fixed a resource leak caused by a race condition if multiple QObjects
were created at the same time, for the first time in an application,
from multiple threads (implies threads not started with QThread).
****************************************************************************
* QtGui *
****************************************************************************
- Text:
* [QTBUG-69546] Fixed a crash bug in
QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack).
****************************************************************************
* QtSQL *
****************************************************************************
- sqlite:
* Updated to v3.29.0
****************************************************************************
* Platform-Specific Changes *
****************************************************************************
- Linux:
* [QTBUG-61916] Added an environment variable
QT_QPA_PRESERVE_CONSOLE_STATE that can be used to prevent Qt from
altering the tty screen and cursor settings when running with
platforms like linuxfb and eglfs.
- Android:
* [QTBUG-76036] Fixed an issue where menus would not work on 64 bit
builds.

View File

@ -0,0 +1,129 @@
/****************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/
//! [displayName]
Returns a localized display name for the given location \a type
or an empty QString if no relevant location can be found.
//! [displayName]
//! [findExecutable]
Finds the executable named \a executableName in the specified
\a paths, or the system paths if paths is empty.
On most operating systems the system path is determined by the
\c PATH environment variable. The directories where to search for
the executable can be set in the paths argument. To search in
both your own paths and the system paths, call findExecutable
twice, once with paths set and once with paths empty.
Symlinks are not resolved in order to preserve behavior for the
case of executables whose behavior depends on the name they are
invoked with
.
\note On Windows, the usual executable extensions (from the PATHEXT
environment variable) are automatically appended. For example, the
findExecutable("foo") call finds \c foo.exe or \c foo.bat if
present.
Returns the absolute file path to the executable, or an empty
string if not found.
//! [findExecutable]
//! [locate]
Finds a file or directory called \a fileName in the standard
locations for \a type.
The \a options flag lets you specify whether to look for files
or directories. By default, this flag is set to \c LocateFile.
Returns the absolute path to the first file or directory found,
otherwise returns an empty string.
//! [locate]
//! [locateAll]
Finds all files or directories by the name, \a fileName, in the
standard locations for \a type.
The \a options flag lets you specify whether to look for files
or directories. By default, this flag is set to \c LocateFile.
Returns the list of all the files that were found.
//! [locateAll]
//! [setTestModeEnabled]
If \a testMode is \c true, this enables a special "test mode" in
QStandardPaths, which changes writable locations to point to
test directories. This prevents auto tests from reading
or writing to the current user's configuration.
It affects the locations into which test programs might write
files: \c GenericDataLocation, \c DataLocation, \c ConfigLocation,
\c GenericConfigLocation, \c AppConfigLocation,
\c GenericCacheLocation, and \c CacheLocation. Other locations
are not affected.
On Unix, \c XDG_DATA_HOME is set to \c{~/.qttest/share},
\c XDG_CONFIG_HOME is set to \c{~/.qttest/config}, and
\c XDG_CACHE_HOME is set to \c{~/.qttest/cache}.
On macOS, data goes to \c{~/.qttest/Application Support},
cache goes to \c{~/.qttest/Cache}, and config goes to
\c{~/.qttest/Preferences}.
On Windows, everything goes to a "qttest" directory under
\c{%APPDATA%}.
//! [setTestModeEnabled]
//! [standardLocations]
Returns all the directories where files of \a type belong.
The list of directories is sorted from high to low priority,
starting with writableLocation() if it can be determined.
This list is empty if no locations for type are defined.
//! [standardLocations]
//! [writableLocation]
Returns the directory where files of \a type should be written to,
or an empty string if the location cannot be determined.
\note The storage location returned may not exist; that is,
it may need to be created by the system or the user.
//! [writableLocation]

View File

@ -80,34 +80,37 @@ BearerMonitor::BearerMonitor(QWidget *parent)
break;
}
}
connect(&manager, SIGNAL(onlineStateChanged(bool)), this ,SLOT(onlineStateChanged(bool)));
connect(&manager, SIGNAL(configurationAdded(const QNetworkConfiguration&)),
this, SLOT(configurationAdded(const QNetworkConfiguration&)));
connect(&manager, SIGNAL(configurationRemoved(const QNetworkConfiguration&)),
this, SLOT(configurationRemoved(const QNetworkConfiguration&)));
connect(&manager, SIGNAL(configurationChanged(const QNetworkConfiguration&)),
this, SLOT(configurationChanged(const QNetworkConfiguration)));
connect(&manager, SIGNAL(updateCompleted()), this, SLOT(updateConfigurations()));
connect(&manager, &QNetworkConfigurationManager::onlineStateChanged,
this, &BearerMonitor::onlineStateChanged);
connect(&manager, &QNetworkConfigurationManager::configurationAdded,
this, [this](const QNetworkConfiguration &config) { configurationAdded(config); });
connect(&manager, &QNetworkConfigurationManager::configurationRemoved,
this, &BearerMonitor::configurationRemoved);
connect(&manager, &QNetworkConfigurationManager::configurationChanged,
this, &BearerMonitor::configurationChanged);
connect(&manager, &QNetworkConfigurationManager::updateCompleted,
this, &BearerMonitor::updateConfigurations);
#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT)
connect(registerButton, SIGNAL(clicked()), this, SLOT(registerNetwork()));
connect(unregisterButton, SIGNAL(clicked()), this, SLOT(unregisterNetwork()));
connect(registerButton, &QPushButton::clicked,
this, &BearerMonitor::registerNetwork);
connect(unregisterButton, &QPushButton::clicked,
this, &BearerMonitor::unregisterNetwork);
#else // Q_OS_WIN && !Q_OS_WINRT
nlaGroup->hide();
#endif
connect(treeWidget, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
this, SLOT(createSessionFor(QTreeWidgetItem*)));
connect(treeWidget, &QTreeWidget::itemActivated,
this, &BearerMonitor::createSessionFor);
connect(treeWidget, &QTreeWidget::currentItemChanged,
this, &BearerMonitor::showConfigurationFor);
connect(treeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)),
this, SLOT(showConfigurationFor(QTreeWidgetItem*)));
connect(newSessionButton, SIGNAL(clicked()),
this, SLOT(createNewSession()));
connect(deleteSessionButton, SIGNAL(clicked()),
this, SLOT(deleteSession()));
connect(scanButton, SIGNAL(clicked()),
this, SLOT(performScan()));
connect(newSessionButton, &QPushButton::clicked,
this, &BearerMonitor::createNewSession);
connect(deleteSessionButton, &QPushButton::clicked,
this, &BearerMonitor::deleteSession);
connect(scanButton, &QPushButton::clicked,
this, &BearerMonitor::performScan);
// Just in case update all configurations so that all
// configurations are up to date.
@ -124,7 +127,7 @@ static void updateItem(QTreeWidgetItem *item, const QNetworkConfiguration &confi
item->setData(0, Qt::UserRole, config.identifier());
QFont font = item->font(1);
font.setBold((config.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active);
font.setBold(config.state().testFlag(QNetworkConfiguration::Active));
item->setFont(0, font);
}
@ -333,8 +336,6 @@ void BearerMonitor::showConfigurationFor(QTreeWidgetItem *item)
case QNetworkConfiguration::Undefined:
configurationState->setText(tr("Undefined"));
break;
default:
configurationState->setText(QString());
}
switch (conf.type()) {
@ -350,8 +351,6 @@ void BearerMonitor::showConfigurationFor(QTreeWidgetItem *item)
case QNetworkConfiguration::Invalid:
configurationType->setText(tr("Invalid"));
break;
default:
configurationType->setText(QString());
}
switch (conf.purpose()) {
@ -367,8 +366,6 @@ void BearerMonitor::showConfigurationFor(QTreeWidgetItem *item)
case QNetworkConfiguration::ServiceSpecificPurpose:
configurationPurpose->setText(tr("Service Specific"));
break;
default:
configurationPurpose->setText(QString());
}
configurationIdentifier->setText(conf.identifier());

View File

@ -51,8 +51,7 @@
#ifndef BEARERMONITOR_H
#define BEARERMONITOR_H
#include <qnetworkconfigmanager.h>
#include <qnetworksession.h>
#include <QNetworkConfigurationManager>
#include "ui_bearermonitor_640_480.h"
QT_USE_NAMESPACE
@ -64,11 +63,11 @@ class BearerMonitor : public QWidget, public Ui_BearerMonitor
Q_OBJECT
public:
BearerMonitor(QWidget *parent = 0);
BearerMonitor(QWidget *parent = nullptr);
~BearerMonitor();
private slots:
void configurationAdded(const QNetworkConfiguration &config, QTreeWidgetItem *parent = 0);
void configurationAdded(const QNetworkConfiguration &config, QTreeWidgetItem *parent = nullptr);
void configurationRemoved(const QNetworkConfiguration &config);
void configurationChanged(const QNetworkConfiguration &config);
void updateSnapConfiguration(QTreeWidgetItem *parent, const QNetworkConfiguration &snap);
@ -90,7 +89,7 @@ private slots:
private:
QNetworkConfigurationManager manager;
QList<SessionWidget *> sessionWidgets;
QVector<SessionWidget *> sessionWidgets;
};
#endif //BEARERMONITOR_H

View File

@ -48,8 +48,8 @@
**
****************************************************************************/
#include <QtWidgets/QApplication>
#include <QtWidgets/QMainWindow>
#include <QApplication>
#include <QMainWindow>
#include "bearermonitor.h"

View File

@ -49,10 +49,10 @@
****************************************************************************/
#include "sessionwidget.h"
#include "qnetworkconfigmanager.h"
#include <QNetworkConfigurationManager>
SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *parent)
: QWidget(parent), statsTimer(-1)
: QWidget(parent)
{
setupUi(this);
@ -65,10 +65,10 @@ SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *paren
session = new QNetworkSession(config, this);
connect(session, SIGNAL(stateChanged(QNetworkSession::State)),
this, SLOT(updateSession()));
connect(session, SIGNAL(error(QNetworkSession::SessionError)),
this, SLOT(updateSessionError(QNetworkSession::SessionError)));
connect(session, &QNetworkSession::stateChanged,
this, &SessionWidget::updateSession);
connect(session, QOverload<QNetworkSession::SessionError>::of(&QNetworkSession::error),
this, &SessionWidget::updateSessionError);
updateSession();
@ -76,14 +76,14 @@ SessionWidget::SessionWidget(const QNetworkConfiguration &config, QWidget *paren
configuration->setText(session->configuration().name());
connect(openSessionButton, SIGNAL(clicked()),
this, SLOT(openSession()));
connect(openSyncSessionButton, SIGNAL(clicked()),
this, SLOT(openSyncSession()));
connect(closeSessionButton, SIGNAL(clicked()),
this, SLOT(closeSession()));
connect(stopSessionButton, SIGNAL(clicked()),
this, SLOT(stopSession()));
connect(openSessionButton, &QPushButton::clicked,
this, &SessionWidget::openSession);
connect(openSyncSessionButton, &QPushButton::clicked,
this, &SessionWidget::openSyncSession);
connect(closeSessionButton, &QPushButton::clicked,
this, &SessionWidget::closeSession);
connect(stopSessionButton, &QPushButton::clicked,
this, &SessionWidget::stopSession);
}
SessionWidget::~SessionWidget()

View File

@ -51,7 +51,7 @@
#ifndef SESSIONWIDGET_H
#define SESSIONWIDGET_H
#include <qnetworksession.h>
#include <QNetworkSession>
#include "ui_sessionwidget.h"
@ -62,10 +62,10 @@ class SessionWidget : public QWidget, public Ui_SessionWidget
Q_OBJECT
public:
explicit SessionWidget(const QNetworkConfiguration &config, QWidget *parent = 0);
explicit SessionWidget(const QNetworkConfiguration &config, QWidget *parent = nullptr);
~SessionWidget();
void timerEvent(QTimerEvent *) override;
void timerEvent(QTimerEvent *e) override;
private:
void updateSessionState(QNetworkSession::State state);
@ -80,8 +80,8 @@ private Q_SLOTS:
void updateSessionError(QNetworkSession::SessionError error);
private:
QNetworkSession *session;
int statsTimer;
QNetworkSession *session = nullptr;
int statsTimer = -1;
};
#endif

View File

@ -96,20 +96,21 @@ BlockingClient::BlockingClient(QWidget *parent)
buttonBox->addButton(getFortuneButton, QDialogButtonBox::ActionRole);
buttonBox->addButton(quitButton, QDialogButtonBox::RejectRole);
connect(getFortuneButton, SIGNAL(clicked()), this, SLOT(requestNewFortune()));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
connect(getFortuneButton, &QPushButton::clicked,
this, &BlockingClient::requestNewFortune);
connect(quitButton, &QPushButton::clicked,
this, &BlockingClient::close);
connect(hostLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(enableGetFortuneButton()));
connect(portLineEdit, SIGNAL(textChanged(QString)),
this, SLOT(enableGetFortuneButton()));
connect(hostLineEdit, &QLineEdit::textChanged,
this, &BlockingClient::enableGetFortuneButton);
connect(portLineEdit, &QLineEdit::textChanged,
this, &BlockingClient::enableGetFortuneButton);
//! [0]
connect(&thread, &FortuneThread::newFortune,
this, &BlockingClient::showFortune);
connect(&thread, &FortuneThread::error,
this, &BlockingClient::displayError);
//! [0]
connect(&thread, SIGNAL(newFortune(QString)),
this, SLOT(showFortune(QString)));
//! [0] //! [1]
connect(&thread, SIGNAL(error(int,QString)),
this, SLOT(displayError(int,QString)));
//! [1]
QGridLayout *mainLayout = new QGridLayout;
mainLayout->addWidget(hostLabel, 0, 0);
@ -124,30 +125,30 @@ BlockingClient::BlockingClient(QWidget *parent)
portLineEdit->setFocus();
}
//! [2]
//! [1]
void BlockingClient::requestNewFortune()
{
getFortuneButton->setEnabled(false);
thread.requestNewFortune(hostLineEdit->text(),
portLineEdit->text().toInt());
}
//! [2]
//! [1]
//! [3]
//! [2]
void BlockingClient::showFortune(const QString &nextFortune)
{
if (nextFortune == currentFortune) {
requestNewFortune();
return;
}
//! [3]
//! [2]
//! [4]
//! [3]
currentFortune = nextFortune;
statusLabel->setText(currentFortune);
getFortuneButton->setEnabled(true);
}
//! [4]
//! [3]
void BlockingClient::displayError(int socketError, const QString &message)
{

View File

@ -69,7 +69,7 @@ class BlockingClient : public QWidget
Q_OBJECT
public:
BlockingClient(QWidget *parent = 0);
BlockingClient(QWidget *parent = nullptr);
private slots:
void requestNewFortune();

View File

@ -61,7 +61,7 @@ class FortuneThread : public QThread
Q_OBJECT
public:
FortuneThread(QObject *parent = 0);
FortuneThread(QObject *parent = nullptr);
~FortuneThread();
void requestNewFortune(const QString &hostName, quint16 port);

View File

@ -48,8 +48,10 @@
**
****************************************************************************/
#include <QtWidgets>
#include <QtNetwork>
#include <QLabel>
#include <QPushButton>
#include <QUdpSocket>
#include <QVBoxLayout>
#include "receiver.h"
@ -67,10 +69,11 @@ Receiver::Receiver(QWidget *parent)
//! [0]
//! [1]
connect(udpSocket, SIGNAL(readyRead()),
this, SLOT(processPendingDatagrams()));
connect(udpSocket, &QUdpSocket::readyRead,
this, &Receiver::processPendingDatagrams);
//! [1]
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
connect(quitButton, &QPushButton::clicked,
this, &Receiver::close);
auto buttonLayout = new QHBoxLayout;
buttonLayout->addStretch(1);

View File

@ -151,9 +151,9 @@ CommandLineParseResult parseCommandLine(QCommandLineParser &parser, DnsQuery *qu
//! [0]
DnsManager::DnsManager()
: dns(new QDnsLookup(this))
{
dns = new QDnsLookup(this);
connect(dns, SIGNAL(finished()), this, SLOT(showResults()));
connect(dns, &QDnsLookup::finished, this, &DnsManager::showResults);
}
void DnsManager::execute()

View File

@ -176,21 +176,20 @@
but its implementation is slightly different:
\snippet blockingfortuneclient/blockingclient.cpp 0
\snippet blockingfortuneclient/blockingclient.cpp 1
We connect our FortuneThread's two signals newFortune() and error() (which
are somewhat similar to QTcpSocket::readyRead() and QTcpSocket::error() in
the previous example) to requestNewFortune() and displayError().
\snippet blockingfortuneclient/blockingclient.cpp 2
\snippet blockingfortuneclient/blockingclient.cpp 1
The requestNewFortune() slot calls FortuneThread::requestNewFortune(),
which \e shedules the request. When the thread has received a new fortune
and emits newFortune(), our showFortune() slot is called:
\snippet blockingfortuneclient/blockingclient.cpp 3
\snippet blockingfortuneclient/blockingclient.cpp 2
\codeline
\snippet blockingfortuneclient/blockingclient.cpp 4
\snippet blockingfortuneclient/blockingclient.cpp 3
Here, we simply display the fortune we received as the argument.

View File

@ -80,8 +80,8 @@ public slots:
DownloadManager::DownloadManager()
{
connect(&manager, SIGNAL(finished(QNetworkReply*)),
SLOT(downloadFinished(QNetworkReply*)));
connect(&manager, &QNetworkAccessManager::finished,
this, &DownloadManager::downloadFinished);
}
void DownloadManager::doDownload(const QUrl &url)
@ -90,8 +90,8 @@ void DownloadManager::doDownload(const QUrl &url)
QNetworkReply *reply = manager.get(request);
#if QT_CONFIG(ssl)
connect(reply, SIGNAL(sslErrors(QList<QSslError>)),
SLOT(sslErrors(QList<QSslError>)));
connect(reply, &QNetworkReply::sslErrors,
this, &DownloadManager::sslErrors);
#endif
currentDownloads.append(reply);

View File

@ -67,13 +67,13 @@ void DownloadManager::append(const QStringList &urls)
append(QUrl::fromEncoded(urlAsString.toLocal8Bit()));
if (downloadQueue.isEmpty())
QTimer::singleShot(0, this, SIGNAL(finished()));
QTimer::singleShot(0, this, &DownloadManager::finished);
}
void DownloadManager::append(const QUrl &url)
{
if (downloadQueue.isEmpty())
QTimer::singleShot(0, this, SLOT(startNextDownload()));
QTimer::singleShot(0, this, &DownloadManager::startNextDownload);
downloadQueue.enqueue(url);
++totalCount;
@ -123,12 +123,12 @@ void DownloadManager::startNextDownload()
QNetworkRequest request(url);
currentDownload = manager.get(request);
connect(currentDownload, SIGNAL(downloadProgress(qint64,qint64)),
SLOT(downloadProgress(qint64,qint64)));
connect(currentDownload, SIGNAL(finished()),
SLOT(downloadFinished()));
connect(currentDownload, SIGNAL(readyRead()),
SLOT(downloadReadyRead()));
connect(currentDownload, &QNetworkReply::downloadProgress,
this, &DownloadManager::downloadProgress);
connect(currentDownload, &QNetworkReply::finished,
this, &DownloadManager::downloadFinished);
connect(currentDownload, &QNetworkReply::readyRead,
this, &DownloadManager::downloadReadyRead);
// prepare the output
printf("Downloading %s...\n", url.toEncoded().constData());

View File

@ -76,6 +76,7 @@ int main(int argc, char **argv)
DownloadManager manager;
manager.append(arguments);
QObject::connect(&manager, SIGNAL(finished()), &app, SLOT(quit()));
QObject::connect(&manager, &DownloadManager::finished,
&app, &QCoreApplication::quit);
app.exec();
}

View File

@ -48,9 +48,9 @@
**
****************************************************************************/
//! [1]
#include "googlesuggest.h"
//! [1]
const QString gsuggestUrl(QStringLiteral("http://google.com/complete/search?output=toolbar&q=%1"));
//! [1]
@ -74,16 +74,18 @@ GSuggestCompletion::GSuggestCompletion(QLineEdit *parent): QObject(parent), edit
popup->installEventFilter(this);
connect(popup, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
SLOT(doneCompletion()));
connect(popup, &QTreeWidget::itemClicked,
this, &GSuggestCompletion::doneCompletion);
timer.setSingleShot(true);
timer.setInterval(500);
connect(&timer, SIGNAL(timeout()), SLOT(autoSuggest()));
connect(editor, SIGNAL(textEdited(QString)), &timer, SLOT(start()));
connect(&timer, &QTimer::timeout,
this, &GSuggestCompletion::autoSuggest);
connect(editor, &QLineEdit::textEdited,
&timer, QOverload<>::of(&QTimer::start));
connect(&networkManager, SIGNAL(finished(QNetworkReply*)),
this, SLOT(handleNetworkData(QNetworkReply*)));
connect(&networkManager, &QNetworkAccessManager::finished,
this, &GSuggestCompletion::handleNetworkData);
}
//! [2]

View File

@ -57,11 +57,11 @@
const QString gsearchUrl = QStringLiteral("http://www.google.com/search?q=%1");
//! [1]
SearchBox::SearchBox(QWidget *parent): QLineEdit(parent)
SearchBox::SearchBox(QWidget *parent)
: QLineEdit(parent)
, completer(new GSuggestCompletion(this))
{
completer = new GSuggestCompletion(this);
connect(this, SIGNAL(returnPressed()),this, SLOT(doSearch()));
connect(this, &SearchBox::returnPressed, this, &SearchBox::doSearch);
setWindowTitle("Search with Google");

View File

@ -80,10 +80,12 @@ Receiver::Receiver(QWidget *parent)
!udpSocket6.joinMulticastGroup(groupAddress6))
statusLabel->setText(tr("Listening for multicast messages on IPv4 only"));
connect(&udpSocket4, SIGNAL(readyRead()),
this, SLOT(processPendingDatagrams()));
connect(&udpSocket6, &QUdpSocket::readyRead, this, &Receiver::processPendingDatagrams);
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
connect(&udpSocket4, &QUdpSocket::readyRead,
this, &Receiver::processPendingDatagrams);
connect(&udpSocket6, &QUdpSocket::readyRead,
this, &Receiver::processPendingDatagrams);
connect(quitButton, &QPushButton::clicked,
this, &Receiver::close);
}
void Receiver::processPendingDatagrams()

View File

@ -126,8 +126,8 @@ Client::Client(QWidget *parent)
connect(sctpSocket, &QSctpSocket::connected, this, &Client::connected);
connect(sctpSocket, &QSctpSocket::disconnected, this, &Client::disconnected);
connect(sctpSocket, &QSctpSocket::channelReadyRead, this, &Client::readDatagram);
connect(sctpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(displayError(QAbstractSocket::SocketError)));
connect(sctpSocket, QOverload<QAbstractSocket::SocketError>::of(&QSctpSocket::error),
this, &Client::displayError);
connect(consumers[SctpChannels::Time], &Consumer::writeDatagram, this, &Client::writeDatagram);
connect(consumers[SctpChannels::Chat], &Consumer::writeDatagram, this, &Client::writeDatagram);

View File

@ -62,14 +62,14 @@ ChatDialog::ChatDialog(QWidget *parent)
textEdit->setReadOnly(true);
listWidget->setFocusPolicy(Qt::NoFocus);
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed()));
connect(&client, SIGNAL(newMessage(QString,QString)),
this, SLOT(appendMessage(QString,QString)));
connect(&client, SIGNAL(newParticipant(QString)),
this, SLOT(newParticipant(QString)));
connect(&client, SIGNAL(participantLeft(QString)),
this, SLOT(participantLeft(QString)));
connect(lineEdit, &QLineEdit::returnPressed,
this, &ChatDialog::returnPressed);
connect(&client, &Client::newMessage,
this, &ChatDialog::appendMessage);
connect(&client, &Client::newParticipant,
this, &ChatDialog::newParticipant);
connect(&client, &Client::participantLeft,
this, &ChatDialog::participantLeft);
myNickName = client.nickName();
newParticipant(myNickName);

View File

@ -59,7 +59,7 @@ class ChatDialog : public QDialog, private Ui::ChatDialog
Q_OBJECT
public:
ChatDialog(QWidget *parent = 0);
ChatDialog(QWidget *parent = nullptr);
public slots:
void appendMessage(const QString &from, const QString &message);

View File

@ -60,10 +60,10 @@ Client::Client()
peerManager->setServerPort(server.serverPort());
peerManager->startBroadcasting();
QObject::connect(peerManager, SIGNAL(newConnection(Connection*)),
this, SLOT(newConnection(Connection*)));
QObject::connect(&server, SIGNAL(newConnection(Connection*)),
this, SLOT(newConnection(Connection*)));
connect(peerManager, &PeerManager::newConnection,
this, &Client::newConnection);
connect(&server, &Server::newConnection,
this, &Client::newConnection);
}
void Client::sendMessage(const QString &message)
@ -102,10 +102,10 @@ void Client::newConnection(Connection *connection)
{
connection->setGreetingMessage(peerManager->userName());
connect(connection, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(connectionError(QAbstractSocket::SocketError)));
connect(connection, SIGNAL(disconnected()), this, SLOT(disconnected()));
connect(connection, SIGNAL(readyForUse()), this, SLOT(readyForUse()));
connect(connection, QOverload<QAbstractSocket::SocketError>::of(&Connection::error),
this, &Client::connectionError);
connect(connection, &Connection::disconnected, this, &Client::disconnected);
connect(connection, &Connection::readyForUse, this, &Client::readyForUse);
}
void Client::readyForUse()
@ -115,8 +115,8 @@ void Client::readyForUse()
connection->peerPort()))
return;
connect(connection, SIGNAL(newMessage(QString,QString)),
this, SIGNAL(newMessage(QString,QString)));
connect(connection, &Connection::newMessage,
this, &Client::newMessage);
peers.insert(connection->peerAddress(), connection);
QString nick = connection->name();

View File

@ -82,11 +82,14 @@ Connection::Connection(QObject *parent)
isGreetingMessageSent = false;
pingTimer.setInterval(PingInterval);
QObject::connect(this, SIGNAL(readyRead()), this, SLOT(processReadyRead()));
QObject::connect(this, SIGNAL(disconnected()), &pingTimer, SLOT(stop()));
QObject::connect(&pingTimer, SIGNAL(timeout()), this, SLOT(sendPing()));
QObject::connect(this, SIGNAL(connected()),
this, SLOT(sendGreetingMessage()));
connect(this, &QTcpSocket::readyRead, this,
&Connection::processReadyRead);
connect(this, &QTcpSocket::disconnected,
&pingTimer, &QTimer::stop);
connect(&pingTimer, &QTimer::timeout,
this, &Connection::sendPing);
connect(this, &QTcpSocket::connected,
this, &Connection::sendGreetingMessage);
}
Connection::Connection(qintptr socketDescriptor, QObject *parent)

View File

@ -79,8 +79,8 @@ public:
Undefined
};
Connection(QObject *parent = 0);
Connection(qintptr socketDescriptor, QObject *parent = 0);
Connection(QObject *parent = nullptr);
Connection(qintptr socketDescriptor, QObject *parent = nullptr);
~Connection();
QString name() const;

View File

@ -81,12 +81,12 @@ PeerManager::PeerManager(Client *client)
broadcastSocket.bind(QHostAddress::Any, broadcastPort, QUdpSocket::ShareAddress
| QUdpSocket::ReuseAddressHint);
connect(&broadcastSocket, SIGNAL(readyRead()),
this, SLOT(readBroadcastDatagram()));
connect(&broadcastSocket, &QUdpSocket::readyRead,
this, &PeerManager::readBroadcastDatagram);
broadcastTimer.setInterval(BroadcastInterval);
connect(&broadcastTimer, SIGNAL(timeout()),
this, SLOT(sendBroadcastDatagram()));
connect(&broadcastTimer, &QTimer::timeout,
this, &PeerManager::sendBroadcastDatagram);
}
void PeerManager::setServerPort(int port)

View File

@ -60,7 +60,7 @@ class Server : public QTcpServer
Q_OBJECT
public:
Server(QObject *parent = 0);
Server(QObject *parent = nullptr);
signals:
void newConnection(Connection *connection);

View File

@ -63,8 +63,8 @@ int main(int argc, char **argv)
QApplication app(argc, argv);
if (!QSslSocket::supportsSsl()) {
QMessageBox::information(0, "Secure Socket Client",
"This system does not support SSL/TLS.");
QMessageBox::information(nullptr, "Secure Socket Client",
"This system does not support TLS.");
return -1;
}

View File

@ -54,8 +54,6 @@
#include "ui_sslclient.h"
#include "ui_sslerrors.h"
#include <QtCore>
SslClient::SslClient(QWidget *parent)
: QWidget(parent)
{
@ -185,16 +183,17 @@ void SslClient::setupUi()
form->hostNameEdit->setSelection(0, form->hostNameEdit->text().size());
form->sessionOutput->setHtml(tr("&lt;not connected&gt;"));
connect(form->hostNameEdit, SIGNAL(textChanged(QString)),
this, SLOT(updateEnabledState()));
connect(form->connectButton, SIGNAL(clicked()),
this, SLOT(secureConnect()));
connect(form->sendButton, SIGNAL(clicked()),
this, SLOT(sendData()));
connect(form->hostNameEdit, &QLineEdit::textChanged,
this, &SslClient::updateEnabledState);
connect(form->connectButton, &QPushButton::clicked,
this, &SslClient::secureConnect);
connect(form->sendButton, &QPushButton::clicked,
this, &SslClient::sendData);
padLock = new QToolButton;
padLock->setIcon(QIcon(":/encrypted.png"));
connect(padLock, SIGNAL(clicked()), this, SLOT(displayCertificateInfo()));
connect(padLock, &QToolButton::clicked,
this, &SslClient::displayCertificateInfo);
#if QT_CONFIG(cursor)
padLock->setCursor(Qt::ArrowCursor);
@ -223,16 +222,16 @@ void SslClient::setupSecureSocket()
socket = new QSslSocket(this);
connect(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
connect(socket, SIGNAL(encrypted()),
this, SLOT(socketEncrypted()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(socketError(QAbstractSocket::SocketError)));
connect(socket, SIGNAL(sslErrors(QList<QSslError>)),
this, SLOT(sslErrors(QList<QSslError>)));
connect(socket, SIGNAL(readyRead()),
this, SLOT(socketReadyRead()));
connect(socket, &QSslSocket::stateChanged,
this, &SslClient::socketStateChanged);
connect(socket, &QSslSocket::encrypted,
this, &SslClient::socketEncrypted);
connect(socket, QOverload<QAbstractSocket::SocketError>::of(&QSslSocket::error),
this, &SslClient::socketError);
connect(socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors),
this, &SslClient::sslErrors);
connect(socket, &QSslSocket::readyRead,
this, &SslClient::socketReadyRead);
}

View File

@ -89,7 +89,7 @@ Dialog::Dialog(QWidget *parent)
"Run the Fortune Client example now.")
.arg(ipAddress).arg(server.serverPort()));
connect(quitButton, SIGNAL(clicked()), this, SLOT(close()));
connect(quitButton, &QPushButton::clicked, this, &Dialog::close);
QHBoxLayout *buttonLayout = new QHBoxLayout;
buttonLayout->addStretch(1);

View File

@ -64,7 +64,7 @@ class Dialog : public QWidget
Q_OBJECT
public:
Dialog(QWidget *parent = 0);
Dialog(QWidget *parent = nullptr);
private:
QLabel *statusLabel;

View File

@ -74,7 +74,7 @@ void FortuneServer::incomingConnection(qintptr socketDescriptor)
{
QString fortune = fortunes.at(QRandomGenerator::global()->bounded(fortunes.size()));
FortuneThread *thread = new FortuneThread(socketDescriptor, fortune, this);
connect(thread, SIGNAL(finished()), thread, SLOT(deleteLater()));
connect(thread, &FortuneThread::finished, thread, &FortuneThread::deleteLater);
thread->start();
}
//! [1]

View File

@ -60,7 +60,7 @@ class FortuneServer : public QTcpServer
Q_OBJECT
public:
FortuneServer(QObject *parent = 0);
FortuneServer(QObject *parent = nullptr);
protected:
void incomingConnection(qintptr socketDescriptor) override;

View File

@ -73,12 +73,12 @@ AddTorrentDialog::AddTorrentDialog(QWidget *parent)
{
ui.setupUi(this);
connect(ui.browseTorrents, SIGNAL(clicked()),
this, SLOT(selectTorrent()));
connect(ui.browseDestination, SIGNAL(clicked()),
this, SLOT(selectDestination()));
connect(ui.torrentFile, SIGNAL(textChanged(QString)),
this, SLOT(setTorrent(QString)));
connect(ui.browseTorrents, &QPushButton::clicked,
this, &AddTorrentDialog::selectTorrent);
connect(ui.browseDestination, &QPushButton::clicked,
this, &AddTorrentDialog::selectDestination);
connect(ui.torrentFile, &QLineEdit::textChanged,
this, &AddTorrentDialog::setTorrent);
ui.destinationFolder->setText(destinationDirectory = QDir::current().path());
ui.torrentFile->setFocus();

View File

@ -60,7 +60,7 @@ class AddTorrentDialog : public QDialog
Q_OBJECT
public:
AddTorrentDialog(QWidget *parent = 0);
AddTorrentDialog(QWidget *parent = nullptr);
QString torrentFileName() const;
QString destinationFolder() const;

View File

@ -70,7 +70,7 @@ class FileManager : public QThread
Q_OBJECT
public:
FileManager(QObject *parent = 0);
FileManager(QObject *parent = nullptr);
virtual ~FileManager();
inline void setMetaInfo(const MetaInfo &info) { metaInfo = info; }

View File

@ -60,7 +60,7 @@ class TorrentView : public QTreeWidget
{
Q_OBJECT
public:
TorrentView(QWidget *parent = 0);
TorrentView(QWidget *parent = nullptr);
#if QT_CONFIG(draganddrop)
signals:
@ -110,7 +110,7 @@ public:
};
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), quitDialog(0), saveChanges(false)
: QMainWindow(parent), quitDialog(nullptr), saveChanges(false)
{
// Initialize some static strings
QStringList headers;
@ -147,12 +147,12 @@ MainWindow::MainWindow(QWidget *parent)
fileMenu->addAction(pauseTorrentAction);
fileMenu->addAction(removeTorrentAction);
fileMenu->addSeparator();
fileMenu->addAction(QIcon(":/icons/exit.png"), tr("E&xit"), this, SLOT(close()));
fileMenu->addAction(QIcon(":/icons/exit.png"), tr("E&xit"), this, &MainWindow::close);
// Help menu
QMenu *helpMenu = menuBar()->addMenu(tr("&Help"));
helpMenu->addAction(tr("&About"), this, SLOT(about()));
helpMenu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
helpMenu->addAction(tr("&About"), this, &MainWindow::about);
helpMenu->addAction(tr("About &Qt"), qApp, QApplication::aboutQt);
// Top toolbar
QToolBar *topBar = new QToolBar(tr("Tools"));
@ -188,24 +188,24 @@ MainWindow::MainWindow(QWidget *parent)
#endif
// Set up connections
connect(torrentView, SIGNAL(itemSelectionChanged()),
this, SLOT(setActionsEnabled()));
connect(torrentView, SIGNAL(fileDropped(QString)),
this, SLOT(acceptFileDrop(QString)));
connect(uploadLimitSlider, SIGNAL(valueChanged(int)),
this, SLOT(setUploadLimit(int)));
connect(downloadLimitSlider, SIGNAL(valueChanged(int)),
this, SLOT(setDownloadLimit(int)));
connect(newTorrentAction, SIGNAL(triggered()),
this, SLOT(addTorrent()));
connect(pauseTorrentAction, SIGNAL(triggered()),
this, SLOT(pauseTorrent()));
connect(removeTorrentAction, SIGNAL(triggered()),
this, SLOT(removeTorrent()));
connect(upActionTool, SIGNAL(triggered(bool)),
this, SLOT(moveTorrentUp()));
connect(downActionTool, SIGNAL(triggered(bool)),
this, SLOT(moveTorrentDown()));
connect(torrentView, &TorrentView::itemSelectionChanged,
this, &MainWindow::setActionsEnabled);
connect(torrentView, &TorrentView::fileDropped,
this, &MainWindow::acceptFileDrop);
connect(uploadLimitSlider, &QSlider::valueChanged,
this, &MainWindow::setUploadLimit);
connect(downloadLimitSlider, &QSlider::valueChanged,
this, &MainWindow::setDownloadLimit);
connect(newTorrentAction, &QAction::triggered,
this, QOverload<>::of(&MainWindow::addTorrent));
connect(pauseTorrentAction, &QAction::triggered,
this, &MainWindow::pauseTorrent);
connect(removeTorrentAction, &QAction::triggered,
this, &MainWindow::removeTorrent);
connect(upActionTool, &QAction::triggered,
this, &MainWindow::moveTorrentUp);
connect(downActionTool, &QAction::triggered,
this, &MainWindow::moveTorrentDown);
// Load settings and start
setWindowTitle(tr("Torrent Client"));
@ -297,7 +297,7 @@ bool MainWindow::addTorrent()
addTorrent(fileName, addTorrentDialog->destinationFolder());
if (!saveChanges) {
saveChanges = true;
QTimer::singleShot(1000, this, SLOT(saveSettings()));
QTimer::singleShot(1000, this, &MainWindow::saveSettings);
}
return true;
}
@ -311,7 +311,8 @@ void MainWindow::removeTorrent()
// Stop the client.
client->disconnect();
connect(client, SIGNAL(stopped()), this, SLOT(torrentStopped()));
connect(client, &TorrentClient::stopped,
this, &MainWindow::torrentStopped);
client->stop();
// Remove the row from the view.
@ -379,13 +380,20 @@ bool MainWindow::addTorrent(const QString &fileName, const QString &destinationF
client->setDumpedState(resumeState);
// Setup the client connections.
connect(client, SIGNAL(stateChanged(TorrentClient::State)), this, SLOT(updateState(TorrentClient::State)));
connect(client, SIGNAL(peerInfoUpdated()), this, SLOT(updatePeerInfo()));
connect(client, SIGNAL(progressUpdated(int)), this, SLOT(updateProgress(int)));
connect(client, SIGNAL(downloadRateUpdated(int)), this, SLOT(updateDownloadRate(int)));
connect(client, SIGNAL(uploadRateUpdated(int)), this, SLOT(updateUploadRate(int)));
connect(client, SIGNAL(stopped()), this, SLOT(torrentStopped()));
connect(client, SIGNAL(error(TorrentClient::Error)), this, SLOT(torrentError(TorrentClient::Error)));
connect(client, &TorrentClient::stateChanged,
this, &MainWindow::updateState);
connect(client, &TorrentClient::peerInfoUpdated,
this, &MainWindow::updatePeerInfo);
connect(client, &TorrentClient::progressUpdated,
this, &MainWindow::updateProgress);
connect(client, &TorrentClient::downloadRateUpdated,
this, &MainWindow::updateDownloadRate);
connect(client, &TorrentClient::uploadRateUpdated,
this, &MainWindow::updateUploadRate);
connect(client, &TorrentClient::stopped,
this, &MainWindow::torrentStopped);
connect(client, QOverload<TorrentClient::Error>::of(&TorrentClient::error),
this, &MainWindow::torrentError);
// Add the client to the list of downloading jobs.
Job job;
@ -414,7 +422,7 @@ bool MainWindow::addTorrent(const QString &fileName, const QString &destinationF
if (!saveChanges) {
saveChanges = true;
QTimer::singleShot(5000, this, SLOT(saveSettings()));
QTimer::singleShot(5000, this, &MainWindow::saveSettings);
}
client->start();
return true;
@ -491,15 +499,15 @@ void MainWindow::setActionsEnabled()
{
// Find the view item and client for the current row, and update
// the states of the actions.
QTreeWidgetItem *item = 0;
QTreeWidgetItem *item = nullptr;
if (!torrentView->selectedItems().isEmpty())
item = torrentView->selectedItems().first();
TorrentClient *client = item ? jobs.at(torrentView->indexOfTopLevelItem(item)).client : 0;
TorrentClient *client = item ? jobs.at(torrentView->indexOfTopLevelItem(item)).client : nullptr;
bool pauseEnabled = client && ((client->state() == TorrentClient::Paused)
|| (client->state() > TorrentClient::Preparing));
removeTorrentAction->setEnabled(item != 0);
pauseTorrentAction->setEnabled(item != 0 && pauseEnabled);
removeTorrentAction->setEnabled(item != nullptr);
pauseTorrentAction->setEnabled(item && pauseEnabled);
if (client && client->state() == TorrentClient::Paused) {
pauseTorrentAction->setIcon(QIcon(":/icons/player_play.png"));
@ -524,7 +532,7 @@ void MainWindow::updateDownloadRate(int bytesPerSecond)
if (!saveChanges) {
saveChanges = true;
QTimer::singleShot(5000, this, SLOT(saveSettings()));
QTimer::singleShot(5000, this, &MainWindow::saveSettings);
}
}
@ -538,7 +546,7 @@ void MainWindow::updateUploadRate(int bytesPerSecond)
if (!saveChanges) {
saveChanges = true;
QTimer::singleShot(5000, this, SLOT(saveSettings()));
QTimer::singleShot(5000, this, &MainWindow::saveSettings);
}
}
@ -649,7 +657,7 @@ void MainWindow::about()
about.setWindowTitle(tr("About Torrent Client"));
about.setLayout(mainLayout);
connect(quitButton, SIGNAL(clicked()), &about, SLOT(close()));
connect(quitButton, &QPushButton::clicked, &about, &QDialog::close);
about.exec();
}
@ -688,7 +696,7 @@ void MainWindow::closeEvent(QCloseEvent *)
++jobsToStop;
TorrentClient *client = job.client;
client->disconnect();
connect(client, SIGNAL(stopped()), this, SLOT(torrentStopped()));
connect(client, &TorrentClient::stopped, this, &MainWindow::torrentStopped);
client->stop();
delete torrentView->takeTopLevelItem(0);
}
@ -696,7 +704,7 @@ void MainWindow::closeEvent(QCloseEvent *)
if (jobsToStop > jobsStopped)
quitDialog->exec();
quitDialog->deleteLater();
quitDialog = 0;
quitDialog = nullptr;
}
TorrentView::TorrentView(QWidget *parent)

View File

@ -71,7 +71,7 @@ class MainWindow : public QMainWindow
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
MainWindow(QWidget *parent = nullptr);
QSize sizeHint() const override;
const TorrentClient *clientForRow(int row) const;

View File

@ -87,7 +87,7 @@ PeerWireClient::PeerWireClient(const QByteArray &peerId, QObject *parent)
: QTcpSocket(parent), pendingBlockSizes(0),
pwState(ChokingPeer | ChokedByPeer), receivedHandShake(false), gotPeerId(false),
sentHandShake(false), nextPacketLength(-1), pendingRequestTimer(0), invalidateTimeout(false),
keepAliveTimer(0), torrentPeer(0)
keepAliveTimer(0), torrentPeer(nullptr)
{
memset(uploadSpeedData, 0, sizeof(uploadSpeedData));
memset(downloadSpeedData, 0, sizeof(downloadSpeedData));
@ -96,21 +96,23 @@ PeerWireClient::PeerWireClient(const QByteArray &peerId, QObject *parent)
timeoutTimer = startTimer(ConnectTimeout);
peerIdString = peerId;
connect(this, SIGNAL(readyRead()), this, SIGNAL(readyToTransfer()));
connect(this, SIGNAL(connected()), this, SIGNAL(readyToTransfer()));
connect(this, &PeerWireClient::readyRead,
this, &PeerWireClient::readyToTransfer);
connect(this, &PeerWireClient::connected,
this, &PeerWireClient::readyToTransfer);
connect(&socket, SIGNAL(connected()),
this, SIGNAL(connected()));
connect(&socket, SIGNAL(readyRead()),
this, SIGNAL(readyRead()));
connect(&socket, SIGNAL(disconnected()),
this, SIGNAL(disconnected()));
connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SIGNAL(error(QAbstractSocket::SocketError)));
connect(&socket, SIGNAL(bytesWritten(qint64)),
this, SIGNAL(bytesWritten(qint64)));
connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)),
this, SLOT(socketStateChanged(QAbstractSocket::SocketState)));
connect(&socket, &QTcpSocket::connected,
this, &PeerWireClient::connected);
connect(&socket, &QTcpSocket::readyRead,
this, &PeerWireClient::readyRead);
connect(&socket, &QTcpSocket::disconnected,
this, &PeerWireClient::disconnected);
connect(&socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
this, QOverload<QAbstractSocket::SocketError>::of(&PeerWireClient::error));
connect(&socket, &QTcpSocket::bytesWritten,
this, &PeerWireClient::bytesWritten);
connect(&socket, &QTcpSocket::stateChanged,
this, &PeerWireClient::socketStateChanged);
}

View File

@ -92,7 +92,7 @@ public:
};
Q_DECLARE_FLAGS(PeerWireState, PeerWireStateFlag)
explicit PeerWireClient(const QByteArray &peerId, QObject *parent = 0);
explicit PeerWireClient(const QByteArray &peerId, QObject *parent = nullptr);
void initialize(const QByteArray &infoHash, int pieceCount);
void setPeer(TorrentPeer *peer);

View File

@ -62,7 +62,8 @@ RateController *RateController::instance()
void RateController::addSocket(PeerWireClient *socket)
{
connect(socket, SIGNAL(readyToTransfer()), this, SLOT(scheduleTransfer()));
connect(socket, &PeerWireClient::readyToTransfer,
this, &RateController::scheduleTransfer);
socket->setReadBufferSize(downLimit * 4);
sockets << socket;
scheduleTransfer();
@ -70,7 +71,8 @@ void RateController::addSocket(PeerWireClient *socket)
void RateController::removeSocket(PeerWireClient *socket)
{
disconnect(socket, SIGNAL(readyToTransfer()), this, SLOT(scheduleTransfer()));
disconnect(socket, &PeerWireClient::readyToTransfer,
this, &RateController::scheduleTransfer);
socket->setReadBufferSize(0);
sockets.remove(socket);
}

View File

@ -62,8 +62,7 @@ class RateController : public QObject
Q_OBJECT
public:
inline RateController(QObject *parent = 0)
: QObject(parent), transferScheduled(false) { }
using QObject::QObject;
static RateController *instance();
void addSocket(PeerWireClient *socket);
@ -81,9 +80,9 @@ public slots:
private:
QElapsedTimer stopWatch;
QSet<PeerWireClient *> sockets;
int upLimit;
int downLimit;
bool transferScheduled;
int upLimit = 0;
int downLimit = 0;
bool transferScheduled = false;
};
#endif

View File

@ -75,13 +75,12 @@ static const int MinimumTimeBeforeRevisit = 30;
static const int MaxUploads = 4;
static const int UploadScheduleInterval = 10000;
class TorrentPiece {
public:
int index;
int length;
struct TorrentPiece {
QBitArray completedBlocks;
QBitArray requestedBlocks;
bool inProgress;
int index = 0;
int length = 0;
bool inProgress = false;
};
class TorrentClientPrivate
@ -227,7 +226,7 @@ void TorrentClientPrivate::callPeerConnector()
{
if (!connectingToClients) {
connectingToClients = true;
QTimer::singleShot(10000, q, SLOT(connectToPeers()));
QTimer::singleShot(10000, q, &TorrentClient::connectToPeers);
}
}
@ -235,22 +234,22 @@ TorrentClient::TorrentClient(QObject *parent)
: QObject(parent), d(new TorrentClientPrivate(this))
{
// Connect the file manager
connect(&d->fileManager, SIGNAL(dataRead(int,int,int,QByteArray)),
this, SLOT(sendToPeer(int,int,int,QByteArray)));
connect(&d->fileManager, SIGNAL(verificationProgress(int)),
this, SLOT(updateProgress(int)));
connect(&d->fileManager, SIGNAL(verificationDone()),
this, SLOT(fullVerificationDone()));
connect(&d->fileManager, SIGNAL(pieceVerified(int,bool)),
this, SLOT(pieceVerified(int,bool)));
connect(&d->fileManager, SIGNAL(error()),
this, SLOT(handleFileError()));
connect(&d->fileManager, &FileManager::dataRead,
this, &TorrentClient::sendToPeer);
connect(&d->fileManager, &FileManager::verificationProgress,
this, &TorrentClient::updateProgress);
connect(&d->fileManager, &FileManager::verificationDone,
this, &TorrentClient::fullVerificationDone);
connect(&d->fileManager, &FileManager::pieceVerified,
this, &TorrentClient::pieceVerified);
connect(&d->fileManager, &FileManager::error,
this, &TorrentClient::handleFileError);
// Connect the tracker client
connect(&d->trackerClient, SIGNAL(peerListUpdated(QList<TorrentPeer>)),
this, SLOT(addToPeerList(QList<TorrentPeer>)));
connect(&d->trackerClient, SIGNAL(stopped()),
this, SIGNAL(stopped()));
connect(&d->trackerClient, &TrackerClient::peerListUpdated,
this, &TorrentClient::addToPeerList);
connect(&d->trackerClient, &TrackerClient::stopped,
this, &TorrentClient::stopped);
}
TorrentClient::~TorrentClient()
@ -840,26 +839,26 @@ void TorrentClient::setupOutgoingConnection()
void TorrentClient::initializeConnection(PeerWireClient *client)
{
connect(client, SIGNAL(connected()),
this, SLOT(setupOutgoingConnection()));
connect(client, SIGNAL(disconnected()),
this, SLOT(removeClient()));
connect(client, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(removeClient()));
connect(client, SIGNAL(piecesAvailable(QBitArray)),
this, SLOT(peerPiecesAvailable(QBitArray)));
connect(client, SIGNAL(blockRequested(int,int,int)),
this, SLOT(peerRequestsBlock(int,int,int)));
connect(client, SIGNAL(blockReceived(int,int,QByteArray)),
this, SLOT(blockReceived(int,int,QByteArray)));
connect(client, SIGNAL(choked()),
this, SLOT(peerChoked()));
connect(client, SIGNAL(unchoked()),
this, SLOT(peerUnchoked()));
connect(client, SIGNAL(bytesWritten(qint64)),
this, SLOT(peerWireBytesWritten(qint64)));
connect(client, SIGNAL(bytesReceived(qint64)),
this, SLOT(peerWireBytesReceived(qint64)));
connect(client, &PeerWireClient::connected,
this, &TorrentClient::setupOutgoingConnection);
connect(client, &PeerWireClient::disconnected,
this, &TorrentClient::removeClient);
connect(client, QOverload<QAbstractSocket::SocketError>::of(&PeerWireClient::error),
this, &TorrentClient::removeClient);
connect(client, &PeerWireClient::piecesAvailable,
this, &TorrentClient::peerPiecesAvailable);
connect(client, &PeerWireClient::blockRequested,
this, &TorrentClient::peerRequestsBlock);
connect(client, &PeerWireClient::blockReceived,
this, &TorrentClient::blockReceived);
connect(client, &PeerWireClient::choked,
this, &TorrentClient::peerChoked);
connect(client, &PeerWireClient::unchoked,
this, &TorrentClient::peerUnchoked);
connect(client, &PeerWireClient::bytesWritten,
this, &TorrentClient::peerWireBytesWritten);
connect(client, &PeerWireClient::bytesReceived,
this, &TorrentClient::peerWireBytesReceived);
}
void TorrentClient::removeClient()
@ -890,7 +889,8 @@ void TorrentClient::removeClient()
}
// Delete the client later.
disconnect(client, SIGNAL(disconnected()), this, SLOT(removeClient()));
disconnect(client, &PeerWireClient::disconnected,
this, &TorrentClient::removeClient);
client->deleteLater();
ConnectionManager::instance()->removeConnection(client);
@ -905,7 +905,7 @@ void TorrentClient::peerPiecesAvailable(const QBitArray &pieces)
// Find the peer in our list of announced peers. If it's there,
// then we can use the piece list into to gather statistics that
// help us decide what peers to connect to.
TorrentPeer *peer = 0;
TorrentPeer *peer = nullptr;
QList<TorrentPeer *>::Iterator it = d->peers.begin();
while (it != d->peers.end()) {
if ((*it)->address == client->peerAddress() && (*it)->port == client->peerPort()) {
@ -1163,7 +1163,7 @@ void TorrentClient::schedulePieceForClient(PeerWireClient *client)
// many blocks have been requested.
QList<int> currentPieces;
bool somePiecesAreNotInProgress = false;
TorrentPiece *lastPendingPiece = 0;
TorrentPiece *lastPendingPiece = nullptr;
QMultiMap<PeerWireClient *, TorrentPiece *>::Iterator it = d->payloads.find(client);
while (it != d->payloads.end() && it.key() == client) {
lastPendingPiece = it.value();
@ -1183,7 +1183,7 @@ void TorrentClient::schedulePieceForClient(PeerWireClient *client)
// If all pieces are in progress, but we haven't filled up our
// block requesting quota, then we need to schedule another piece.
if (!somePiecesAreNotInProgress || client->incomingBlocks().size() > 0)
lastPendingPiece = 0;
lastPendingPiece = nullptr;
TorrentPiece *piece = lastPendingPiece;
// In warmup state, all clients request blocks from the same pieces.

View File

@ -58,8 +58,7 @@
class MetaInfo;
class PeerWireClient;
class TorrentClientPrivate;
class TorrentPeer;
class TorrentPiece;
struct TorrentPiece;
QT_BEGIN_NAMESPACE
class QTimerEvent;
QT_END_NAMESPACE
@ -110,7 +109,7 @@ public:
ServerError
};
TorrentClient(QObject *parent = 0);
TorrentClient(QObject *parent = nullptr);
~TorrentClient();
bool setTorrent(const QString &fileName);

View File

@ -78,10 +78,10 @@ void TorrentServer::incomingConnection(qintptr socketDescriptor)
if (client->setSocketDescriptor(socketDescriptor)) {
if (ConnectionManager::instance()->canAddConnection() && !clients.isEmpty()) {
connect(client, SIGNAL(infoHashReceived(QByteArray)),
this, SLOT(processInfoHash(QByteArray)));
connect(client, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(removeClient()));
connect(client, &PeerWireClient::infoHashReceived,
this, &TorrentServer::processInfoHash);
connect(client, QOverload<QAbstractSocket::SocketError>::of(&PeerWireClient::error),
this, QOverload<>::of(&TorrentServer::removeClient));
RateController::instance()->addSocket(client);
ConnectionManager::instance()->addConnection(client);
return;
@ -104,7 +104,7 @@ void TorrentServer::processInfoHash(const QByteArray &infoHash)
PeerWireClient *peer = qobject_cast<PeerWireClient *>(sender());
for (TorrentClient *client : qAsConst(clients)) {
if (client->state() >= TorrentClient::Searching && client->infoHash() == infoHash) {
peer->disconnect(peer, 0, this, 0);
peer->disconnect(peer, nullptr, this, nullptr);
client->setupIncomingConnection(peer);
return;
}

View File

@ -60,14 +60,8 @@
TrackerClient::TrackerClient(TorrentClient *downloader, QObject *parent)
: QObject(parent), torrentDownloader(downloader)
{
length = 0;
requestInterval = 5 * 60;
requestIntervalTimer = -1;
firstTrackerRequest = true;
lastTrackerRequest = false;
firstSeeding = true;
connect(&http, SIGNAL(finished(QNetworkReply*)), this, SLOT(httpRequestDone(QNetworkReply*)));
connect(&http, &QNetworkAccessManager::finished,
this, &TrackerClient::httpRequestDone);
}
void TrackerClient::start(const MetaInfo &info)
@ -157,8 +151,8 @@ void TrackerClient::fetchPeerList()
if (!url.userName().isEmpty()) {
uname = url.userName();
pwd = url.password();
connect(&http, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(provideAuthentication(QNetworkReply*,QAuthenticator*)));
connect(&http, &QNetworkAccessManager::authenticationRequired,
this, &TrackerClient::provideAuthentication);
}
http.get(req);
}

View File

@ -69,7 +69,7 @@ class TrackerClient : public QObject
Q_OBJECT
public:
explicit TrackerClient(TorrentClient *downloader, QObject *parent = 0);
explicit TrackerClient(TorrentClient *downloader, QObject *parent = nullptr);
void start(const MetaInfo &info);
void stop();
@ -98,21 +98,19 @@ private slots:
private:
TorrentClient *torrentDownloader;
int requestInterval;
int requestIntervalTimer;
int requestInterval = 5 * 60;
int requestIntervalTimer = -1;
QNetworkAccessManager http;
MetaInfo metaInfo;
QByteArray trackerId;
QList<TorrentPeer> peers;
qint64 uploadedBytes;
qint64 downloadedBytes;
qint64 length;
qint64 length = 0;
QString uname;
QString pwd;
bool firstTrackerRequest;
bool lastTrackerRequest;
bool firstSeeding;
bool firstTrackerRequest = true;
bool lastTrackerRequest = false;
bool firstSeeding = true;
};
#endif

View File

@ -171,7 +171,7 @@ static const char *fsDisplaySource =
"}\n";
static const char *csComputeSourceV =
"#define COMPUTEPATCHSIZE 32 \n"
"#define COMPUTEPATCHSIZE 10 // Setting this to 10 to comply with MAX_COMPUTE_WORK_GROUP_INVOCATIONS for both OpenGL and OpenGLES - see QTBUG-79374 \n"
"#define IMGFMT rgba8 \n"
"layout (local_size_x = COMPUTEPATCHSIZE, local_size_y = COMPUTEPATCHSIZE) in;\n"
"layout(binding=0, IMGFMT) uniform readonly highp image2D inputImage; // Use a sampler to improve performance \n"
@ -212,7 +212,7 @@ static const char *csComputeSourceV =
"}\n";
static const char *csComputeSourceH =
"#define COMPUTEPATCHSIZE 32 \n"
"#define COMPUTEPATCHSIZE 10 \n"
"#define IMGFMT rgba8 \n"
"layout (local_size_x = COMPUTEPATCHSIZE, local_size_y = COMPUTEPATCHSIZE) in;\n"
"layout(binding=0, IMGFMT) uniform readonly highp image2D inputImage; // Use a sampler to improve performance \n"
@ -381,7 +381,7 @@ void GLWindow::paintGL()
// Process input image
QSize workGroups = getWorkGroups( 32, QSize(m_texImageInput->width(), m_texImageInput->height()));
QSize workGroups = getWorkGroups(10, QSize(m_texImageInput->width(), m_texImageInput->height()));
// Pass 1
f->glBindImageTexture(0, m_texImageInput->textureId(), 0, 0, 0, GL_READ_WRITE, GL_RGBA8);
f->glBindImageTexture(1, m_texImageTmp->textureId(), 0, 0, 0, GL_READ_WRITE, GL_RGBA8);

View File

@ -43,15 +43,15 @@
\section1 TableEditor Class Definition
The \c TableEditor class inherits QDialog making the table editor
The \c TableEditor class inherits QWidget making the table editor
widget a top-level dialog window.
\snippet cachedtable/tableeditor.h 0
The \c TableEditor constructor takes two arguments: The first is a
pointer to the parent widget and is passed on to the base class
constructor. The other is a reference to the database table the \c
TableEditor object will operate on.
reference to the database table the \c TableEditor object will operate
on. The other is a pointer to the parent widget and is passed on to the
base class constructor.
Note the QSqlTableModel variable declaration: As we will see in
this example, the QSqlTableModel class can be used to provide data

View File

@ -320,7 +320,7 @@ QGroupBox* MainWindow::createAlbumGroupBox()
this, &MainWindow::showAlbumDetails);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(albumView, 0, 0);
layout->addWidget(albumView, 0, { });
box->setLayout(layout);
return box;

View File

@ -56,6 +56,7 @@
#include <QGraphicsView>
#include <QApplication>
#include <QMenu>
#include <QMenuBar>
#include <QLayout>
#ifndef QT_NO_OPENGL

View File

@ -492,7 +492,7 @@ void Dialog::questionMessage()
void Dialog::warningMessage()
{
QMessageBox msgBox(QMessageBox::Warning, tr("QMessageBox::warning()"),
MESSAGE, nullptr, this);
MESSAGE, { }, this);
msgBox.setDetailedText(MESSAGE_DETAILS);
msgBox.addButton(tr("Save &Again"), QMessageBox::AcceptRole);
msgBox.addButton(tr("&Continue"), QMessageBox::RejectRole);

View File

@ -232,8 +232,8 @@
combinations of states and modes for a given icon.
\li \c IconSizeSpinBox is a subclass of QSpinBox that lets the
user enter icon sizes (e.g., "48 x 48").
\li \c ImageDelegate is a subclass of QItemDelegate that provides
comboboxes for letting the user set the mode and state
\li \c ImageDelegate is a subclass of QStyledItemDelegate that
provides comboboxes for letting the user set the mode and state
associated with an image.
\endlist
@ -468,7 +468,6 @@
loaded into the application.
\snippet widgets/icons/mainwindow.cpp 13
\snippet widgets/icons/mainwindow.cpp 14
We retrieve the image name using the QFileInfo::baseName()
function that returns the base name of the file without the path,
@ -486,8 +485,6 @@
Qt::ItemIsEditable flag. Table items are editable by default.
\snippet widgets/icons/mainwindow.cpp 15
\snippet widgets/icons/mainwindow.cpp 16
\snippet widgets/icons/mainwindow.cpp 17
Then we create the second and third items in the row making the
default mode Normal and the default state Off. But if the \uicontrol
@ -498,7 +495,6 @@
example's \c images subdirectory respect this naming convention.
\snippet widgets/icons/mainwindow.cpp 18
\snippet widgets/icons/mainwindow.cpp 19
In the end we add the items to the associated row, and use the
QTableWidget::openPersistentEditor() function to create
@ -522,8 +518,6 @@
application.
\snippet widgets/icons/mainwindow.cpp 8
\snippet widgets/icons/mainwindow.cpp 9
\snippet widgets/icons/mainwindow.cpp 10
We also extract the image file's name using the
QTableWidgetItem::data() function. This function takes a
@ -571,24 +565,22 @@
delegate for the table widget. We create a \c ImageDelegate that
we make the item delegate for our view.
The QItemDelegate class can be used to provide an editor for an item view
The QStyledItemDelegate class can be used to provide an editor for an item view
class that is subclassed from QAbstractItemView. Using a delegate
for this purpose allows the editing mechanism to be customized and
developed independently from the model and view.
In this example we derive \c ImageDelegate from QItemDelegate.
QItemDelegate usually provides line editors, while our subclass
In this example we derive \c ImageDelegate from QStyledItemDelegate.
QStyledItemDelegate usually provides line editors, while our subclass
\c ImageDelegate, provides comboboxes for the mode and state
fields.
\snippet widgets/icons/mainwindow.cpp 22
\snippet widgets/icons/mainwindow.cpp 23
Then we customize the QTableWidget's horizontal header, and hide
the vertical header.
\snippet widgets/icons/mainwindow.cpp 24
\snippet widgets/icons/mainwindow.cpp 25
At the end, we connect the QTableWidget::itemChanged() signal to
the \c changeIcon() slot to ensure that the preview area is in
@ -750,23 +742,23 @@
\snippet widgets/icons/imagedelegate.h 0
The \c ImageDelegate class is a subclass of QItemDelegate. The
QItemDelegate class provides display and editing facilities for
data items from a model. A single QItemDelegate object is
The \c ImageDelegate class is a subclass of QStyledItemDelegate. The
QStyledItemDelegate class provides display and editing facilities for
data items from a model. A single QStyledItemDelegate object is
responsible for all items displayed in a item view (in our case,
a QTableWidget).
A QItemDelegate can be used to provide an editor for an item view
A QStyledItemDelegate can be used to provide an editor for an item view
class that is subclassed from QAbstractItemView. Using a delegate
for this purpose allows the editing mechanism to be customized and
developed independently from the model and view.
\snippet widgets/icons/imagedelegate.h 1
The default implementation of QItemDelegate creates a QLineEdit.
The default implementation of QStyledItemDelegate creates a QLineEdit.
Since we want the editor to be a QComboBox, we need to subclass
QItemDelegate and reimplement the QItemDelegate::createEditor(),
QItemDelegate::setEditorData() and QItemDelegate::setModelData()
QStyledItemDelegate and reimplement the QStyledItemDelegate::createEditor(),
QStyledItemDelegate::setEditorData() and QStyledItemDelegate::setModelData()
functions.
\snippet widgets/icons/imagedelegate.h 2
@ -783,7 +775,7 @@
\snippet widgets/icons/imagedelegate.cpp 1
The default QItemDelegate::createEditor() implementation returns
The default QStyledItemDelegate::createEditor() implementation returns
the widget used to edit the item specified by the model and item
index for editing. The parent widget and style option are used to
control the appearance of the editor widget.
@ -803,7 +795,7 @@
\snippet widgets/icons/imagedelegate.cpp 2
The QItemDelegate::setEditorData() function is used by
The QStyledItemDelegate::setEditorData() function is used by
QTableWidget to transfer data from a QTableWidgetItem to the
editor. The data is stored as a string; we use
QComboBox::findText() to locate it in the combobox.
@ -816,7 +808,7 @@
\snippet widgets/icons/imagedelegate.cpp 3
The QItemDelegate::setEditorData() function is used by QTableWidget
The QStyledItemDelegate::setEditorData() function is used by QTableWidget
to transfer data back from the editor to the \l{QTableWidgetItem}.
\snippet widgets/icons/imagedelegate.cpp 4

View File

@ -59,7 +59,7 @@ class CustomProxy : public QGraphicsProxyWidget
Q_OBJECT
public:
explicit CustomProxy(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = nullptr);
explicit CustomProxy(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = { });
QRectF boundingRect() const override;
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,

View File

@ -123,7 +123,7 @@ QLayoutItem *FlowLayout::takeAt(int index)
//! [6]
Qt::Orientations FlowLayout::expandingDirections() const
{
return 0;
return { };
}
//! [6]

View File

@ -62,7 +62,7 @@ class ColorSwatch : public QDockWidget
Q_OBJECT
public:
explicit ColorSwatch(const QString &colorName, QMainWindow *parent = nullptr, Qt::WindowFlags flags = 0);
explicit ColorSwatch(const QString &colorName, QMainWindow *parent = nullptr, Qt::WindowFlags flags = { });
void setCustomSizeHint(const QSize &size);
QMenu *colorSwatchMenu() const { return menu; }

View File

@ -65,7 +65,7 @@ public:
explicit MainWindow(const CustomSizeHintMap &customSizeHints,
QWidget *parent = nullptr,
Qt::WindowFlags flags = 0);
Qt::WindowFlags flags = { });
public slots:
void actionTriggered(QAction *action);

View File

@ -70,6 +70,11 @@ QMAKE_LFLAGS_NOUNDEF = -Wl,--no-undefined
QMAKE_LFLAGS_RPATH = -Wl,-rpath=
QMAKE_LFLAGS_RPATHLINK = -Wl,-rpath-link=
equals(QMAKE_HOST.os, Windows) {
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
}
QMAKE_LIBS_X11 =
QMAKE_LIBS_THREAD =
QMAKE_LIBS_OPENGL =

View File

@ -5,6 +5,7 @@ QMAKE_OBJCXXFLAGS_PRECOMPILE = -x objective-c++-header -c ${QMAKE_PCH_INPUT}
QMAKE_OBJCXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
QMAKE_XCODE_GCC_VERSION = com.apple.compilers.llvm.clang.1_0
QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO = -Wl,-object_path_lto,${OBJECTS_DIR}/${TARGET}_lto.o
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++

View File

@ -10,12 +10,12 @@
QMAKE_COMPILER = gcc
QMAKE_CC = gcc
QMAKE_CC = $${CROSS_COMPILE}gcc
QMAKE_LINK_C = $$QMAKE_CC
QMAKE_LINK_C_SHLIB = $$QMAKE_CC
QMAKE_CXX = g++
QMAKE_CXX = $${CROSS_COMPILE}g++
QMAKE_LINK = $$QMAKE_CXX
QMAKE_LINK_SHLIB = $$QMAKE_CXX

View File

@ -5,9 +5,13 @@
QMAKE_PLATFORM += macos osx macx
QMAKE_MAC_SDK = macosx
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13
QMAKE_APPLE_DEVICE_ARCHS = x86_64
QT_MAC_SDK_VERSION_MIN = 10.13
# Should be 10.15, but as long as the CI builds with
# older SDKs we have to keep this.
QT_MAC_SDK_VERSION_MIN = 10.14
QT_MAC_SDK_VERSION_MAX = 10.15
device.sdk = macosx

View File

@ -17,6 +17,10 @@ QMAKE_SANITIZE_MEMORY_CFLAGS = -fsanitize=memory
QMAKE_SANITIZE_MEMORY_CXXFLAGS = -fsanitize=memory
QMAKE_SANITIZE_MEMORY_LFLAGS = -fsanitize=memory
QMAKE_SANITIZE_FUZZERNL_CFLAGS = -fsanitize=fuzzer-no-link
QMAKE_SANITIZE_FUZZERNL_CXXFLAGS = -fsanitize=fuzzer-no-link
QMAKE_SANITIZE_FUZZERNL_LFLAGS = -fsanitize=fuzzer-no-link
QMAKE_SANITIZE_UNDEFINED_CFLAGS = -fsanitize=undefined
QMAKE_SANITIZE_UNDEFINED_CXXFLAGS = -fsanitize=undefined
QMAKE_SANITIZE_UNDEFINED_LFLAGS = -fsanitize=undefined

View File

@ -63,6 +63,22 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
QML_ROOT_PATH = $$_PRO_FILE_PWD_
FILE_CONTENT += " \"qml-root-path\": $$emitString($$QML_ROOT_PATH),"
FILE_CONTENT += " \"stdcpp-path\": $$emitString($$ANDROID_STDCPP_PATH),"
!isEmpty(RESOURCES) {
# Make sure that qmake generated qrc files are accounted for
load(resources_functions)
qtFlattenResources()
for(resource, RESOURCES) {
contains(resource, ".*\\qmake_qmake_immediate.qrc$") {
# They will be created for each architecture, since they could be different
# we need to account for all of them
for (arch, ANDROID_ABIS): \
rescopy += $$absolute_path("qmake_qmake_immediate.qrc", $$OUT_PWD/$$arch)
} else {
contains(resource, ".*\\.qrc$"): rescopy += $$absolute_path($$resource, $$_PRO_FILE_PWD_)
}
}
FILE_CONTENT += " \"qrcFiles\": $$emitString($$join(rescopy, ",")),"
}
FILE_CONTENT += ""
FILE_CONTENT += " \"application-binary\": $$emitString($$TARGET)"
FILE_CONTENT += "}"

View File

@ -1,6 +1,12 @@
static:no-static-ltcg {
# Static library but no-static-ltcg enabled: skip LTCG
} else: CONFIG(release, debug|release) {
separate_debug_info {
# Evaluate single-$ variable references that have no valid value at mkspec loading time
QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO ~= s/\\$\\{/\$\$\{/
eval(QMAKE_LFLAGS_LTCG += $$QMAKE_LFLAGS_LTCG_SEPARATE_DEBUG_INFO)
}
# We need fat object files when creating static libraries on some platforms
# so the linker will know to load a particular object from the library
# in the first place. On others, we have special ar and nm to create the symbol

View File

@ -1,5 +1,7 @@
qtPrepareTool(MOC_COLLECT_JSON, moc)
load(qt_build_paths)
QMAKE_MOC_OPTIONS += --output-json
MOC_JSON_H_BASE = $${QMAKE_H_MOD_MOC}
@ -26,17 +28,25 @@ moc_json_source.variable_out = MOC_JSON_FILES
MOC_COLLECT_JSON_OUTPUT = $$lower($$basename(TARGET))_metatypes.json
moc_collect_json.CONFIG += no_link combine
moc_collect_json.CONFIG += no_link combine target_predeps
moc_collect_json.commands = $$MOC_COLLECT_JSON --collect-json -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN}
moc_collect_json.input = MOC_JSON_FILES
moc_collect_json.output = $$MOC_COLLECT_JSON_OUTPUT
moc_collect_json.name = Collect moc JSON output into central file
install_metatypes {
do_install.path = $$[QT_INSTALL_LIBS]/metatypes
do_install.files = $$OUT_PWD/$$MOC_COLLECT_JSON_OUTPUT
prefix_build: INSTALLS += do_install
else: COPIES += do_install
do_install_metatypes.path = $$[QT_INSTALL_LIBS]/metatypes
do_install_metatypes.files = $$OUT_PWD/$$MOC_COLLECT_JSON_OUTPUT
prefix_build {
!isEmpty(MODULE_BASE_OUTDIR) {
metatypes_to_builddir.files = $$do_install_metatypes.files
metatypes_to_builddir.path = $$MODULE_BASE_OUTDIR/lib/metatypes
COPIES += metatypes_to_builddir
}
INSTALLS += do_install_metatypes
} else {
COPIES += do_install_metatypes
}
}
QMAKE_EXTRA_COMPILERS += moc_collect_json moc_json_header moc_json_source

View File

@ -68,7 +68,10 @@ load(qt_common)
# To regenerate run 'make qmltypes' which will update the plugins.qmltypes file in the source
# directory. Then review and commit the changes made to plugins.qmltypes.
#
!cross_compile {
# Due to the above mentioned drawbacks, there is a better mechanism available now: qmltyperegistrar
# can generate the .qmltypes files at compile time. It will do this when CONFIG += qmltypes is set.
# Therefore, don't try to generate the qmltypes files via qmlplugindump in that case.
!cross_compile:!qmltypes {
qmlplugindump = qmlplugindump
importpath.name = QML2_IMPORT_PATH
importpath.value =

View File

@ -759,6 +759,8 @@ defineTest(qtConfLibrary_pkgConfig) {
return(false)
contains($${1}.libs, ".*\\.$${QMAKE_EXTENSION_STATICLIB}$") {
qtRunLoggedCommand("$$pkg_config --static --libs $$args", libs)|return(false)
# Split by space
eval(libs = $$libs)
!qtConfResolveLibs($${1}.libs, $$libs): \
return(false)
}

View File

@ -16,63 +16,8 @@ defineReplace(xml_escape) {
return($$1)
}
RESOURCES += qmake_immediate
for(resource, RESOURCES) {
# Regular case of user qrc file
contains(resource, ".*\\.qrc$"): \
next()
# Fallback for stand-alone files/directories
!defined($${resource}.files, var) {
!equals(resource, qmake_immediate) {
!exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
warning("Failure to find: $$resource")
qmake_immediate.files += $$resource
OTHER_FILES *= $$resource
}
RESOURCES -= $$resource
next()
}
resource_file = $$absolute_path($$RCC_DIR/qmake_$${resource}.qrc, $$OUT_PWD)
isEmpty(BUILDS)|build_pass {
# Collection of files, generate qrc file
prefix = $$eval($${resource}.prefix)
isEmpty(prefix): \
prefix = "/"
resource_file_content = \
"<!DOCTYPE RCC><RCC version=\"1.0\">" \
"<qresource prefix=\"$$xml_escape($$prefix)\">"
abs_base = $$absolute_path($$eval($${resource}.base), $$_PRO_FILE_PWD_)
for(file, $${resource}.files) {
abs_path = $$absolute_path($$file, $$_PRO_FILE_PWD_)
files = $$files($$abs_path/*, true)
isEmpty(files): \
files = $$abs_path
for (file, files) {
exists($$file/*): next() # exclude directories
alias = $$relative_path($$file, $$abs_base)
resource_file_content += \
"<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>"
OTHER_FILES *= $$file
}
}
resource_file_content += \
"</qresource>" \
"</RCC>"
!write_file($$resource_file, resource_file_content): \
error()
}
RESOURCES -= $$resource
RESOURCES += $$resource_file
}
load(resources_functions)
qtFlattenResources()
!isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static {
pluginBaseName = $$basename(TARGET)

View File

@ -0,0 +1,63 @@
defineTest(qtFlattenResources) {
RESOURCES += qmake_immediate
for(resource, RESOURCES) {
# Regular case of user qrc file
contains(resource, ".*\\.qrc$"): \
next()
# Fallback for stand-alone files/directories
!defined($${resource}.files, var) {
!equals(resource, qmake_immediate) {
!exists($$absolute_path($$resource, $$_PRO_FILE_PWD_)): \
warning("Failure to find: $$resource")
qmake_immediate.files += $$resource
OTHER_FILES *= $$resource
}
RESOURCES -= $$resource
next()
}
resource_file = $$absolute_path($$RCC_DIR/qmake_$${resource}.qrc, $$OUT_PWD)
isEmpty(BUILDS)|build_pass {
# Collection of files, generate qrc file
prefix = $$eval($${resource}.prefix)
isEmpty(prefix): \
prefix = "/"
resource_file_content = \
"<!DOCTYPE RCC><RCC version=\"1.0\">" \
"<qresource prefix=\"$$xml_escape($$prefix)\">"
abs_base = $$absolute_path($$eval($${resource}.base), $$_PRO_FILE_PWD_)
for(file, $${resource}.files) {
abs_path = $$absolute_path($$file, $$_PRO_FILE_PWD_)
files = $$files($$abs_path/*, true)
isEmpty(files): \
files = $$abs_path
for (file, files) {
exists($$file/*): next() # exclude directories
alias = $$relative_path($$file, $$abs_base)
resource_file_content += \
"<file alias=\"$$xml_escape($$alias)\">$$xml_escape($$file)</file>"
OTHER_FILES *= $$file
}
}
resource_file_content += \
"</qresource>" \
"</RCC>"
!write_file($$resource_file, resource_file_content): \
error()
}
RESOURCES -= $$resource
RESOURCES += $$resource_file
}
export(RESOURCES)
export(OTHER_FILES)
export(qmake_immediate.files)
return(true)
}

View File

@ -42,6 +42,12 @@ sanitize_thread {
QMAKE_LFLAGS += $$QMAKE_SANITIZE_THREAD_LFLAGS
}
sanitize_fuzzer_no_link {
QMAKE_CFLAGS += $$QMAKE_SANITIZE_FUZZERNL_CFLAGS
QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_FUZZERNL_CXXFLAGS
QMAKE_LFLAGS += $$QMAKE_SANITIZE_FUZZERNL_LFLAGS
}
sanitize_undefined {
QMAKE_CFLAGS += $$QMAKE_SANITIZE_UNDEFINED_CFLAGS
QMAKE_CXXFLAGS += $$QMAKE_SANITIZE_UNDEFINED_CXXFLAGS

View File

@ -2,7 +2,7 @@
# qmake configuration for macx-ios-clang
#
QMAKE_IOS_DEPLOYMENT_TARGET = 11.0
QMAKE_IOS_DEPLOYMENT_TARGET = 12.0
# Universal target (iPhone and iPad)
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2

View File

@ -2,7 +2,7 @@
# qmake configuration for macx-tvos-clang
#
QMAKE_TVOS_DEPLOYMENT_TARGET = 11.0
QMAKE_TVOS_DEPLOYMENT_TARGET = 12.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 3

View File

@ -2,7 +2,7 @@
# qmake configuration for macx-watchos-clang
#
QMAKE_WATCHOS_DEPLOYMENT_TARGET = 4.0
QMAKE_WATCHOS_DEPLOYMENT_TARGET = 5.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 4

View File

@ -13,7 +13,7 @@ QMKSRC = $(SOURCE_PATH)\qmake
!if "$(QMAKESPEC)" == "win32-icc"
CXX = icl
LINKER = xilink
CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 /O3
CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11
!elseif "$(QMAKESPEC)" == "win32-clang-msvc"
CXX = clang-cl
LINKER = lld-link

View File

@ -3455,4 +3455,28 @@ ProKey MakefileGenerator::fullTargetVariable() const
return "TARGET";
}
void MakefileGenerator::createResponseFile(const QString &fileName, const ProStringList &objList)
{
QString filePath = Option::output_dir + QDir::separator() + fileName;
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
QString path = (*it).toQString();
// In response files, whitespace and special characters are
// escaped with a backslash; backslashes themselves can either
// be escaped into double backslashes, or, as this is a list of
// path names, converted to forward slashes.
path.replace(QLatin1Char('\\'), QLatin1String("/"))
.replace(QLatin1Char(' '), QLatin1String("\\ "))
.replace(QLatin1Char('\t'), QLatin1String("\\\t"))
.replace(QLatin1Char('"'), QLatin1String("\\\""))
.replace(QLatin1Char('\''), QLatin1String("\\'"));
t << path << Qt::endl;
}
t.flush();
file.close();
}
}
QT_END_NAMESPACE

View File

@ -257,6 +257,7 @@ protected:
const QStringRef &fixedBase, int slashOff);
bool processPrlFileCore(QString &origFile, const QStringRef &origName,
const QString &fixedFile);
void createResponseFile(const QString &fileName, const ProStringList &objList);
public:
QMakeProject *projectFile() const;

View File

@ -208,15 +208,15 @@ UnixMakefileGenerator::init()
escapeFilePath(pchBaseName + language + headerSuffix));
const ProStringList pchArchs = project->values("QMAKE_PCH_ARCHS");
for (const ProString &arch : pchArchs) {
QString suffix = headerSuffix;
suffix.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
QString file = pchBaseName + language + headerSuffix;
file.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
if (project->isActiveConfig("clang_pch_style")
&& (suffix.endsWith(QLatin1String(".pch"))
|| suffix.endsWith(QLatin1String(".gch")))) {
suffix.chop(4); // must omit header suffix for -include to recognize the PCH
&& (file.endsWith(QLatin1String(".pch"))
|| file.endsWith(QLatin1String(".gch")))) {
file.chop(4); // must omit header suffix for -include to recognize the PCH
}
pchFlags.replace(QLatin1String("${QMAKE_PCH_OUTPUT_") + arch + QLatin1Char('}'),
escapeFilePath(pchBaseName + language + suffix));
escapeFilePath(file));
}
}
}
@ -363,10 +363,11 @@ QStringList
if (pchArchs.isEmpty())
pchArchs << ProString(); // normal single-arch PCH
for (const ProString &arch : qAsConst(pchArchs)) {
QString suffix = header_suffix;
if (!arch.isEmpty())
suffix.replace(QLatin1String("${QMAKE_PCH_ARCH}"), arch.toQString());
QString precompiledHeader = header_prefix + language + suffix;
QString precompiledHeader = header_prefix + language + header_suffix;
if (!arch.isEmpty()) {
precompiledHeader.replace(QLatin1String("${QMAKE_PCH_ARCH}"),
arch.toQString());
}
if (!ret.contains(precompiledHeader))
ret += precompiledHeader;
}

View File

@ -58,7 +58,7 @@ protected:
void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags) override;
void writeMakeParts(QTextStream &);
bool writeMakefile(QTextStream &) override;
std::pair<bool, QString> writeObjectsPart(QTextStream &, bool do_incremental);
private:
void init2();
ProStringList libdirToFlags(const ProKey &key);

View File

@ -246,38 +246,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "####### Files\n\n";
// This is used by the dist target.
t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << Qt::endl;
if(do_incremental) {
const ProStringList &objs = project->values("OBJECTS");
const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
ProStringList incrs_out;
t << "OBJECTS = ";
for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
bool increment = false;
for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
QRegExp::Wildcard)) != -1) {
increment = true;
incrs_out.append((*objit));
break;
}
}
if(!increment)
t << "\\\n\t\t" << (*objit);
}
if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
} else if(!incrs_out.count()) {
t << Qt::endl;
} else {
src_incremental = true;
t << Qt::endl;
t << "INCREMENTAL_OBJECTS = "
<< escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
}
} else {
// Used all over the place in both deps and commands.
t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl;
}
auto objectParts = writeObjectsPart(t, do_incremental);
src_incremental = objectParts.first;
if(do_incremental && !src_incremental)
do_incremental = false;
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
@ -513,7 +483,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << mkdir_p_asstring(destdir) << "\n\t";
if (!project->isEmpty("QMAKE_PRE_LINK"))
t << var("QMAKE_PRE_LINK") << "\n\t";
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)";
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) "
<< objectParts.second << " $(OBJCOMP) $(LIBS)";
if (!project->isEmpty("QMAKE_POST_LINK"))
t << "\n\t" << var("QMAKE_POST_LINK");
}
@ -1046,10 +1017,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if (pchArchs.isEmpty())
pchArchs << ProString(); // normal single-arch PCH
for (const ProString &arch : qAsConst(pchArchs)) {
auto suffix = header_suffix.toQString();
QString file = precomph_out_dir + header_prefix + language + header_suffix;
if (!arch.isEmpty())
suffix.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
precomp_files += precomph_out_dir + header_prefix + language + suffix;
file.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
precomp_files += file;
}
}
}
@ -1169,7 +1140,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\n\techo \"// Automatically generated, do not modify\" > " << sourceFile_f
<< "\n\trm -f " << escapeFilePath(pchArchOutput);
} else {
t << "\n\t" << mkdir_p_asstring(pchOutputDir);
QString outDir = pchOutputDir;
if (!arch.isEmpty())
outDir.replace(QStringLiteral("${QMAKE_PCH_ARCH}"), arch.toQString());
t << "\n\t" << mkdir_p_asstring(outDir);
}
auto pchArchFlags = pchFlags;
@ -1545,4 +1519,56 @@ UnixMakefileGenerator::writeLibtoolFile()
"libdir='" << Option::fixPathToTargetOS(install_dir.toQString(), false) << "'\n";
}
std::pair<bool, QString> UnixMakefileGenerator::writeObjectsPart(QTextStream &t, bool do_incremental)
{
bool src_incremental = false;
QString objectsLinkLine;
const ProStringList &objs = project->values("OBJECTS");
if (do_incremental) {
const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
ProStringList incrs_out;
t << "OBJECTS = ";
for (ProStringList::ConstIterator objit = objs.begin(); objit != objs.end(); ++objit) {
bool increment = false;
for (ProStringList::ConstIterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) {
if ((*objit).toQString().indexOf(QRegExp((*incrit).toQString(), Qt::CaseSensitive,
QRegExp::Wildcard)) != -1) {
increment = true;
incrs_out.append((*objit));
break;
}
}
if (!increment)
t << "\\\n\t\t" << (*objit);
}
if (incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
} else if (!incrs_out.count()) {
t << Qt::endl;
} else {
src_incremental = true;
t << Qt::endl;
t << "INCREMENTAL_OBJECTS = "
<< escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
}
} else {
const ProString &objMax = project->first("QMAKE_LINK_OBJECT_MAX");
// Used all over the place in both deps and commands.
if (objMax.isEmpty() || project->values("OBJECTS").count() < objMax.toInt()) {
objectsLinkLine = "$(OBJECTS)";
} else {
QString ld_response_file = fileVar("OBJECTS_DIR");
ld_response_file += var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
if (!var("BUILD_NAME").isEmpty())
ld_response_file += "." + var("BUILD_NAME");
if (!var("MAKEFILE").isEmpty())
ld_response_file += "." + var("MAKEFILE");
createResponseFile(ld_response_file, objs);
objectsLinkLine = "@" + escapeFilePath(ld_response_file);
}
t << "OBJECTS = " << valList(escapeDependencyPaths(objs)) << Qt::endl;
}
return std::make_pair(src_incremental, objectsLinkLine);
}
QT_END_NAMESPACE

View File

@ -115,30 +115,6 @@ QString MingwMakefileGenerator::installRoot() const
return QStringLiteral("$(INSTALL_ROOT:@msyshack@%=%)");
}
static void createResponseFile(const QString &fileName, const ProStringList &objList)
{
QString filePath = Option::output_dir + QDir::separator() + fileName;
QFile file(filePath);
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream t(&file);
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
QString path = (*it).toQString();
// In response files, whitespace and special characters are
// escaped with a backslash; backslashes themselves can either
// be escaped into double backslashes, or, as this is a list of
// path names, converted to forward slashes.
path.replace(QLatin1Char('\\'), QLatin1String("/"))
.replace(QLatin1Char(' '), QLatin1String("\\ "))
.replace(QLatin1Char('\t'), QLatin1String("\\\t"))
.replace(QLatin1Char('"'), QLatin1String("\\\""))
.replace(QLatin1Char('\''), QLatin1String("\\'"));
t << path << Qt::endl;
}
t.flush();
file.close();
}
}
void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
{
writeStandardParts(t);

View File

@ -1581,12 +1581,14 @@ void VcprojGenerator::initExtraCompilerOutputs()
if (!outputVar.isEmpty() && otherFilters.contains(outputVar))
continue;
QString tmp_out = project->first(outputs.first().toKey()).toQString();
QString tmp_out;
if (!outputs.isEmpty())
tmp_out = project->first(outputs.first().toKey()).toQString();
if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) {
// Combined output, only one file result
extraCompile.addFile(Option::fixPathToTargetOS(
replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell), false));
} else {
} else if (!inputVars.isEmpty()) {
// One output file per input
const ProStringList &tmp_in = project->values(inputVars.first().toKey());
for (int i = 0; i < tmp_in.count(); ++i) {

View File

@ -1,5 +1,5 @@
FreeType 2.9.1
==============
FreeType 2.10.1
===============
Homepage: https://www.freetype.org
@ -15,8 +15,8 @@
Read the files `docs/INSTALL*' for installation instructions; see
the file `docs/LICENSE.TXT' for the available licenses.
The FreeType 2 API reference is located in `docs/reference'; use the
file `ft2-toc.html' as the top entry point. Additional
The FreeType 2 API reference is located in `docs/reference/site';
use the file `index.html' as the top entry point. Additional
documentation is available as a separate package from our sites. Go
to
@ -24,13 +24,13 @@
and download one of the following files.
freetype-doc-2.9.1.tar.bz2
freetype-doc-2.9.1.tar.gz
ftdoc291.zip
freetype-doc-2.10.1.tar.xz
freetype-doc-2.10.1.tar.gz
ftdoc2101.zip
To view the documentation online, go to
https://www.freetype.org/freetype2/documentation.html
https://www.freetype.org/freetype2/docs/
Mailing Lists
@ -71,7 +71,7 @@
----------------------------------------------------------------------
Copyright 2006-2018 by
Copyright (C) 2006-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
/* */
/* Unix-specific FreeType low-level system interface (body). */
/* */
/* Copyright 1996-2018 by */
/* Copyright (C) 1996-2019 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -173,7 +173,7 @@
/* messages during execution. */
/* */
#undef FT_COMPONENT
#define FT_COMPONENT trace_io
#define FT_COMPONENT io
/* We use the macro STREAM_FILE for convenience to extract the */
/* system-specific stream handle from a given FreeType stream object */

View File

@ -1,3 +1,184 @@
CHANGES BETWEEN 2.10.0 and 2.10.1
I. IMPORTANT BUG FIXES
- The bytecode hinting of OpenType variation fonts was flawed, since
the data in the `CVAR' table wasn't correctly applied.
II. MISCELLANEOUS
- Auto-hinter support for Mongolian.
- For distribution, `.tar.bz2' packages are replaced with `.tar.xz'
bundles.
- The handling of the default character in PCF fonts as introduced
in version 2.10.0 was partially broken, causing premature abortion
of charmap iteration for many fonts.
- If `FT_Set_Named_Instance' was called with the same arguments
twice in a row, the function returned an incorrect error code the
second time.
- Direct rendering using FT_RASTER_FLAG_DIRECT crashed (bug
introduced in version 2.10.0).
- Increased precision while computing OpenType font variation
instances.
- The flattening algorithm of cubic Bezier curves was slightly
changed to make it faster. This can cause very subtle rendering
changes, which aren't noticeable by the eye, however.
- The auto-hinter now disables hinting if there are blue zones
defined for a `style' (i.e., a certain combination of a script and
its related typographic features) but the font doesn't contain any
characters needed to set up at least one blue zone.
- The `ftmulti' demo program now supports multiple hidden axes with
the same name tag.
- `ftview', `ftstring', and `ftgrid' got a `-k' command line option
to emulate a sequence of keystrokes at start-up.
- `ftview', `ftstring', and `ftgrid' now support screen dumping to a
PNG file.
- The bytecode debugger, `ttdebug', now supports variation TrueType
fonts; a variation font instance can be selected with the new `-d'
command line option.
======================================================================
CHANGES BETWEEN 2.9.1 and 2.10.0
I. IMPORTANT CHANGES
- A bunch of new functions has been added to access and process
COLR/CPAL data of OpenType fonts with color-layered glyphs.
FT_Palette_Data_Get
Retrieve color palette data.
FT_Palette_Select
Select and activate a color palette for color-layered
glyphs.
FT_Palette_Set_Foreground_Color
Set text foreground color for palette index 0xFFFF.
FT_Get_Color_Glyph_Layer
Get color layers for a given glyph (using an interator
object).
FT_Bitmap_Blend
Blend one bitmap onto another with a given color.
- An experimental feature is the new behaviour of the
`FT_LOAD_COLOR' load flag for color-layered glyphs: Internally
it sets a flag so that if `FT_Render_Glyph' is called with
`FT_RENDER_MODE_NORMAL' (or `FT_Load_Glyph' with
`FT_LOAD_RENDER'), a default blending of the color glyph layers
will happen automatically for convenience.
- As a GSoC 2018 project, Nikhil Ramakrishnan completely
overhauled and modernized the API reference.
II. MISCELLANEOUS
- The logic for computing the global ascender, descender, and
height of OpenType fonts has been slightly adjusted for
consistency.
. If the `useTypoMetrics' flag (i.e., bit 7 in the `fsSelection'
field) in the `OS/2' table is set, use the `sTypo' fields in
`OS/2' unconditionally.
. Otherwise use the metrics data from the `hhea' table (if not
zero).
. Otherwise use the `sTypo' fields from the `OS/2' table (if not
zero).
. Otherwise use the `usWin' data from the `OS/2' table as a last
resort.
Variable fonts will apply the `MVAR' deltas to whichever metrics
were picked.
- `TT_Set_MM_Blend' could fail if call repeatedly with the same
arguments.
- The precision of handling deltas in Variation Fonts has been
increased. The problem did only show up with multidimensional
designspaces.
- New function `FT_Library_SetLcdGeometry' to set up the geometry
of LCD subpixels.
- FreeType now uses the `defaultChar' property of PCF fonts to set
the glyph for the undefined character at glyph index 0 (as
FreeType already does for all other supported font formats). As
a consequence, the order of glyphs of a PCF font if accessed
with FreeType can be different now compared to previous
versions.
This change doesn't affect PCF font access with cmaps.
- `FT_Select_Charmap' has been changed to allow parameter value
`FT_ENCODING_NONE', which is valid for BDF, PCF, and Windows FNT
formats to access built-in cmaps that don't have a predefined
`FT_Encoding' value.
- A previously reserved field in the `FT_GlyphSlotRec' structure
now holds the glyph index.
- On Win32 platforms, the use of `_DLL' to build the library has
been replaced with `DLL_EXPORT' and `DLL_IMPORT'.
- The usual round of fuzzer bug fixes to better reject malformed
fonts.
- `FT_Outline_New_Internal' and `FT_Outline_Done_Internal' have
been removed. These two functions were public by oversight only
and were never documented.
- A new function `FT_Error_String' returns descriptions of error
codes if configuration macro FT_CONFIG_OPTION_ERROR_STRINGS is
defined.
- `FT_Set_MM_WeightVector' and `FT_Get_MM_WeightVector' are new
functions limited to Adobe MultiMaster fonts to directly set and
get the weight vector.
- Support for Position Independent Code as needed by systems that
prohibit automatic address fixups, such as BREW, has been
removed. [Compilation with modern compilers that use flags like
`-fPIC' or `-fPIE' is not affected.]
- The `ftdump' demo program has new options `-c' and `-C' to
display charmaps in compact and detailed format, respectively.
Option `-V' has been removed.
- The `ftview', `ftstring', and `ftgrid' demo programs use a new
command line option `-d' to specify the program window's width,
height, and color depth.
- The `ftview' demo program now displays red boxes for zero-width
glyphs.
- `ftglyph' has limited support to display fonts with
color-layered glyphs. This will be improved later on.
- `ftgrid' can now display bitmap fonts also.
- The `ttdebug' demo program has a new option `-f' to select a
member of a TrueType collection (TTC).
- Other various improvements to the demo programs.
======================================================================
CHANGES BETWEEN 2.9 and 2.9.1
I. IMPORTANT BUG FIXES
@ -8,7 +189,7 @@ CHANGES BETWEEN 2.9 and 2.9.1
- CVE-2018-6942: Older FreeType versions can crash with certain
malformed variation fonts.
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6942
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6942
II. MISCELLANEOUS
@ -232,7 +413,7 @@ CHANGES BETWEEN 2.7.1 and 2.8
following properties can be handled: stem darkening, LCD filter
weights, and the random seed for the `random' CFF operator.
- The PCF change to show more `colourful' family names (introduced
- The PCF change to show more `colorful' family names (introduced
in version 2.7.1) was too radical; it can now be configured with
PCF_CONFIG_OPTION_LONG_FAMILY_NAMES at compile time. If
activated, it can be switched off at run time with the new pcf
@ -383,7 +564,7 @@ CHANGES BETWEEN 2.7 and 2.7.1
and the number of CVT entries. Please report if you encounter a
font where the selected values are not adequate.
- PCF family names are made more `colourful'; they now include the
- PCF family names are made more `colorful'; they now include the
foundry and information whether they contain wide characters.
For example, you no longer get `Fixed' but rather `Sony Fixed'
or `Misc Fixed Wide'.
@ -667,8 +848,8 @@ CHANGES BETWEEN 2.6.1 and 2.6.2
- The `ftstring' demo program now supports subpixel rendering; use
key `l' to cycle through the LCD modes.
- The `ftstring' demo program now supports colour rendering; use
the `space' key to cycle through various colour combinations.
- The `ftstring' demo program now supports color rendering; use
the `space' key to cycle through various color combinations.
- The graphical demo programs now use a default gamma value of 1.8
(instead of 1.2).
@ -1325,7 +1506,7 @@ CHANGES BETWEEN 2.4.10 and 2.4.11
Originally, it was a separate patch available from
http://www.infinality.net/blog/
https://web.archive.org/web/20150710073951/http://www.infinality.net:80/blog/
and which has been integrated.
@ -4047,7 +4228,7 @@ CHANGES BETWEEN beta8 and 2.0
untested for now.
- Updated `docs/docmaker.py', a draft API reference is available at
http://www.freetype.org/ft2api.html.
https://web.archive.org/web/20001215173400/http://www.freetype.org:80/ft2api.html.
- Changed `type1' to use `psaux'.
@ -5017,7 +5198,7 @@ Extensions support:
------------------------------------------------------------------------
Copyright 2000-2018 by
Copyright (C) 2000-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -139,7 +139,7 @@ IV. Overriding default configuration and module headers
----------------------------------------------------------------------
Copyright 2003-2018 by
Copyright (C) 2003-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -88,14 +88,13 @@ debugging its code:
for example as in
#undef FT_COMPONENT
#define FT_COMPONENT trace_io
#define FT_COMPONENT io
The value of the FT_COMPONENT macro is an enumeration named
`trace_XXXX' where `XXXX' is one of the component names defined in
the internal file `internal/fttrace.h'. If you modify FreeType
source and insert new `trace_XXXX' macro, you must register it in
`fttrace.h'. If you insert or remove many trace macros, you can
check the undefined or the unused trace macro by
The value of the FT_COMPONENT macro is one of the component
names defined in the internal file `internal/fttrace.h'. If you
modify FreeType source and insert new FT_COMPONENT macro, you must
register it in `fttrace.h'. If you insert or remove many trace
macros, you can check the undefined or the unused trace macro by
`src/tools/chktrcmp.py'.
Each such component is assigned a `debug level', ranging from 0 to
@ -138,8 +137,8 @@ behaviour of FreeType at runtime.
component1:level1 component2:level2 component3:level3 ...
where `componentX' is the name of a tracing component, as defined
in `fttrace.h', but without the `trace_' prefix. `levelX' is the
corresponding level to use at runtime.
in `fttrace.h'. `levelX' is the corresponding level to use at
runtime.
`any' is a special component name that will be interpreted as
`any/all components'. For example, the following definitions
@ -191,7 +190,7 @@ behaviour of FreeType at runtime.
------------------------------------------------------------------------
Copyright 2002-2018 by
Copyright (C) 2002-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -27,7 +27,7 @@ Other bugs have been registered at the savannah bugzilla of FreeType.
------------------------------------------------------------------------
Copyright 2001-2018 by
Copyright (C) 2001-2019 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -1,39 +1,38 @@
/***************************************************************************/
/* */
/* ftconfig.h */
/* */
/* ANSI-specific configuration file (specification only). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftconfig.h
*
* ANSI-specific configuration file (specification only).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This header file contains a number of macro definitions that are used */
/* by the rest of the engine. Most of the macros here are automatically */
/* determined at compile time, and you should not need to change it to */
/* port FreeType, except to compile the library with a non-ANSI */
/* compiler. */
/* */
/* Note however that if some specific modifications are needed, we */
/* advise you to place a modified copy in your build directory. */
/* */
/* The build directory is usually `builds/<system>', and contains */
/* system-specific files that are always included first when building */
/* the library. */
/* */
/* This ANSI version should stay in `include/config/'. */
/* */
/*************************************************************************/
/**************************************************************************
*
* This header file contains a number of macro definitions that are used by
* the rest of the engine. Most of the macros here are automatically
* determined at compile time, and you should not need to change it to port
* FreeType, except to compile the library with a non-ANSI compiler.
*
* Note however that if some specific modifications are needed, we advise
* you to place a modified copy in your build directory.
*
* The build directory is usually `builds/<system>`, and contains
* system-specific files that are always included first when building the
* library.
*
* This ANSI version should stay in `include/config/`.
*
*/
#ifndef FTCONFIG_H_
#define FTCONFIG_H_
@ -46,32 +45,32 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* PLATFORM-SPECIFIC CONFIGURATION MACROS */
/* */
/* These macros can be toggled to suit a specific system. The current */
/* ones are defaults used to compile FreeType in an ANSI C environment */
/* (16bit compilers are also supported). Copy this file to your own */
/* `builds/<system>' directory, and edit it to port the engine. */
/* */
/*************************************************************************/
/**************************************************************************
*
* PLATFORM-SPECIFIC CONFIGURATION MACROS
*
* These macros can be toggled to suit a specific system. The current ones
* are defaults used to compile FreeType in an ANSI C environment (16bit
* compilers are also supported). Copy this file to your own
* `builds/<system>` directory, and edit it to port the engine.
*
*/
/* There are systems (like the Texas Instruments 'C54x) where a `char' */
/* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
/* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
/* is probably unexpected. */
/* */
/* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
/* `char' type. */
/* There are systems (like the Texas Instruments 'C54x) where a `char` */
/* has 16~bits. ANSI~C says that `sizeof(char)` is always~1. Since an */
/* `int` has 16~bits also for this system, `sizeof(int)` gives~1 which */
/* is probably unexpected. */
/* */
/* `CHAR_BIT` (defined in `limits.h`) gives the number of bits in a */
/* `char` type. */
#ifndef FT_CHAR_BIT
#define FT_CHAR_BIT CHAR_BIT
#endif
/* The size of an `int' type. */
/* The size of an `int` type. */
#if FT_UINT_MAX == 0xFFFFUL
#define FT_SIZEOF_INT ( 16 / FT_CHAR_BIT )
#elif FT_UINT_MAX == 0xFFFFFFFFUL
@ -82,7 +81,7 @@ FT_BEGIN_HEADER
#error "Unsupported size of `int' type!"
#endif
/* The size of a `long' type. A five-byte `long' (as used e.g. on the */
/* The size of a `long` type. A five-byte `long` (as used e.g. on the */
/* DM642) is recognized but avoided. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
#define FT_SIZEOF_LONG ( 32 / FT_CHAR_BIT )
@ -95,35 +94,35 @@ FT_BEGIN_HEADER
#endif
/* FT_UNUSED is a macro used to indicate that a given parameter is not */
/* used -- this is only used to get rid of unpleasant compiler warnings */
/* `FT_UNUSED` indicates that a given parameter is not used -- */
/* this is only used to get rid of unpleasant compiler warnings. */
#ifndef FT_UNUSED
#define FT_UNUSED( arg ) ( (arg) = (arg) )
#endif
/*************************************************************************/
/* */
/* AUTOMATIC CONFIGURATION MACROS */
/* */
/* These macros are computed from the ones defined above. Don't touch */
/* their definition, unless you know precisely what you are doing. No */
/* porter should need to mess with them. */
/* */
/*************************************************************************/
/**************************************************************************
*
* AUTOMATIC CONFIGURATION MACROS
*
* These macros are computed from the ones defined above. Don't touch
* their definition, unless you know precisely what you are doing. No
* porter should need to mess with them.
*
*/
/*************************************************************************/
/* */
/* Mac support */
/* */
/* This is the only necessary change, so it is defined here instead */
/* providing a new configuration file. */
/* */
/**************************************************************************
*
* Mac support
*
* This is the only necessary change, so it is defined here instead
* providing a new configuration file.
*/
#if defined( __APPLE__ ) || ( defined( __MWERKS__ ) && defined( macintosh ) )
/* no Carbon frameworks for 64bit 10.4.x */
/* AvailabilityMacros.h is available since Mac OS X 10.2, */
/* so guess the system version by maximum errno before inclusion */
/* No Carbon frameworks for 64bit 10.4.x. */
/* `AvailabilityMacros.h` is available since Mac OS X 10.2, */
/* so guess the system version by maximum errno before inclusion. */
#include <errno.h>
#ifdef ECANCELED /* defined since 10.2 */
#include "AvailabilityMacros.h"
@ -143,7 +142,7 @@ FT_BEGIN_HEADER
#endif
/* Fix compiler warning with sgi compiler */
/* Fix compiler warning with sgi compiler. */
#if defined( __sgi ) && !defined( __GNUC__ )
#if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
#pragma set woff 3505
@ -151,33 +150,33 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/* */
/* <Section> */
/* basic_types */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* basic_types
*
*/
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int16 */
/* */
/* <Description> */
/* A typedef for a 16bit signed integer type. */
/* */
/**************************************************************************
*
* @type:
* FT_Int16
*
* @description:
* A typedef for a 16bit signed integer type.
*/
typedef signed short FT_Int16;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt16 */
/* */
/* <Description> */
/* A typedef for a 16bit unsigned integer type. */
/* */
/**************************************************************************
*
* @type:
* FT_UInt16
*
* @description:
* A typedef for a 16bit unsigned integer type.
*/
typedef unsigned short FT_UInt16;
/* */
@ -186,50 +185,50 @@ FT_BEGIN_HEADER
/* this #if 0 ... #endif clause is for documentation purposes */
#if 0
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int32 */
/* */
/* <Description> */
/* A typedef for a 32bit signed integer type. The size depends on */
/* the configuration. */
/* */
/**************************************************************************
*
* @type:
* FT_Int32
*
* @description:
* A typedef for a 32bit signed integer type. The size depends on the
* configuration.
*/
typedef signed XXX FT_Int32;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt32 */
/* */
/* A typedef for a 32bit unsigned integer type. The size depends on */
/* the configuration. */
/* */
/**************************************************************************
*
* @type:
* FT_UInt32
*
* A typedef for a 32bit unsigned integer type. The size depends on the
* configuration.
*/
typedef unsigned XXX FT_UInt32;
/*************************************************************************/
/* */
/* <Type> */
/* FT_Int64 */
/* */
/* A typedef for a 64bit signed integer type. The size depends on */
/* the configuration. Only defined if there is real 64bit support; */
/* otherwise, it gets emulated with a structure (if necessary). */
/* */
/**************************************************************************
*
* @type:
* FT_Int64
*
* A typedef for a 64bit signed integer type. The size depends on the
* configuration. Only defined if there is real 64bit support;
* otherwise, it gets emulated with a structure (if necessary).
*/
typedef signed XXX FT_Int64;
/*************************************************************************/
/* */
/* <Type> */
/* FT_UInt64 */
/* */
/* A typedef for a 64bit unsigned integer type. The size depends on */
/* the configuration. Only defined if there is real 64bit support; */
/* otherwise, it gets emulated with a structure (if necessary). */
/* */
/**************************************************************************
*
* @type:
* FT_UInt64
*
* A typedef for a 64bit unsigned integer type. The size depends on the
* configuration. Only defined if there is real 64bit support;
* otherwise, it gets emulated with a structure (if necessary).
*/
typedef unsigned XXX FT_UInt64;
/* */
@ -251,7 +250,7 @@ FT_BEGIN_HEADER
#endif
/* look up an integer type that is at least 32 bits */
/* look up an integer type that is at least 32~bits */
#if FT_SIZEOF_INT >= ( 32 / FT_CHAR_BIT )
typedef int FT_Fast;
@ -265,22 +264,22 @@ FT_BEGIN_HEADER
#endif
/* determine whether we have a 64-bit int type for platforms without */
/* Autoconf */
/* determine whether we have a 64-bit `int` type for platforms without */
/* Autoconf */
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
/* FT_LONG64 must be defined if a 64-bit type is available */
/* `FT_LONG64` must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
#define FT_UINT64 unsigned long
/*************************************************************************/
/* */
/* A 64-bit data type may create compilation problems if you compile */
/* in strict ANSI mode. To avoid them, we disable other 64-bit data */
/* types if __STDC__ is defined. You can however ignore this rule */
/* by defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro. */
/* */
/**************************************************************************
*
* A 64-bit data type may create compilation problems if you compile in
* strict ANSI mode. To avoid them, we disable other 64-bit data types if
* `__STDC__` is defined. You can however ignore this rule by defining the
* `FT_CONFIG_OPTION_FORCE_INT64` configuration macro.
*/
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
@ -289,19 +288,19 @@ FT_BEGIN_HEADER
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the __int64 type */
/* this compiler provides the `__int64` type */
#define FT_LONG64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
#elif defined( __BORLANDC__ ) /* Borland C++ */
/* XXXX: We should probably check the value of __BORLANDC__ in order */
/* to test the compiler version. */
/* XXXX: We should probably check the value of `__BORLANDC__` in order */
/* to test the compiler version. */
/* this compiler provides the __int64 type */
/* this compiler provides the `__int64` type */
#define FT_LONG64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
@ -318,7 +317,7 @@ FT_BEGIN_HEADER
#elif defined( __GNUC__ )
/* GCC provides the `long long' type */
/* GCC provides the `long long` type */
#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
@ -342,11 +341,11 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/* */
/* miscellaneous */
/* */
/*************************************************************************/
/**************************************************************************
*
* miscellaneous
*
*/
#define FT_BEGIN_STMNT do {
@ -354,7 +353,7 @@ FT_BEGIN_HEADER
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
/* typeof condition taken from gnulib's `intprops.h' header file */
/* `typeof` condition taken from gnulib's `intprops.h` header file */
#if ( ( defined( __GNUC__ ) && __GNUC__ >= 2 ) || \
( defined( __IBMC__ ) && __IBMC__ >= 1210 && \
defined( __IBM__TYPEOF__ ) ) || \
@ -365,14 +364,14 @@ FT_BEGIN_HEADER
#endif
/* Use FT_LOCAL and FT_LOCAL_DEF to declare and define, respectively, */
/* a function that gets used only within the scope of a module. */
/* Normally, both the header and source code files for such a */
/* function are within a single module directory. */
/* */
/* Intra-module arrays should be tagged with FT_LOCAL_ARRAY and */
/* FT_LOCAL_ARRAY_DEF. */
/* */
/* Use `FT_LOCAL` and `FT_LOCAL_DEF` to declare and define, */
/* respectively, a function that gets used only within the scope of a */
/* module. Normally, both the header and source code files for such a */
/* function are within a single module directory. */
/* */
/* Intra-module arrays should be tagged with `FT_LOCAL_ARRAY` and */
/* `FT_LOCAL_ARRAY_DEF`. */
/* */
#ifdef FT_MAKE_OPTION_SINGLE_OBJECT
#define FT_LOCAL( x ) static x
@ -394,12 +393,12 @@ FT_BEGIN_HEADER
#define FT_LOCAL_ARRAY_DEF( x ) const x
/* Use FT_BASE and FT_BASE_DEF to declare and define, respectively, */
/* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header */
/* file in the `include/freetype/internal' directory, and the */
/* function body is in a file in `src/base'. */
/* */
/* Use `FT_BASE` and `FT_BASE_DEF` to declare and define, respectively, */
/* functions that are used in more than a single module. In the */
/* current setup this implies that the declaration is in a header file */
/* in the `include/freetype/internal` directory, and the function body */
/* is in a file in `src/base`. */
/* */
#ifndef FT_BASE
#ifdef __cplusplus
@ -422,45 +421,50 @@ FT_BEGIN_HEADER
#endif /* !FT_BASE_DEF */
/* When compiling FreeType as a DLL or DSO with hidden visibility */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: FT_EXPORT and FT_EXPORT_DEF. */
/* */
/* FT_EXPORT( return_type ) */
/* */
/* is used in a function declaration, as in */
/* */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* */
/* */
/* FT_EXPORT_DEF( return_type ) */
/* */
/* is used in a function definition, as in */
/* */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* */
/* You can provide your own implementation of FT_EXPORT and */
/* FT_EXPORT_DEF here if you want. */
/* */
/* To export a variable, use FT_EXPORT_VAR. */
/* */
/* When compiling FreeType as a DLL or DSO with hidden visibility */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
/* */
/* - `FT_EXPORT( return_type )` */
/* */
/* is used in a function declaration, as in */
/* */
/* ``` */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* ``` */
/* */
/* - `FT_EXPORT_DEF( return_type )` */
/* */
/* is used in a function definition, as in */
/* */
/* ``` */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* ``` */
/* */
/* You can provide your own implementation of `FT_EXPORT` and */
/* `FT_EXPORT_DEF` here if you want. */
/* */
/* To export a variable, use `FT_EXPORT_VAR`. */
/* */
#ifndef FT_EXPORT
#ifdef FT2_BUILD_LIBRARY
#if defined( _WIN32 ) && ( defined( _DLL ) || defined( DLL_EXPORT ) )
#if defined( _WIN32 ) && defined( DLL_EXPORT )
#define FT_EXPORT( x ) __declspec( dllexport ) x
#elif defined( __GNUC__ ) && __GNUC__ >= 4
#define FT_EXPORT( x ) __attribute__(( visibility( "default" ) )) x
#elif defined( __SUNPRO_C ) && __SUNPRO_C >= 0x550
#define FT_EXPORT( x ) __global x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
#else
@ -469,7 +473,7 @@ FT_BEGIN_HEADER
#else
#if defined( FT2_DLLIMPORT )
#if defined( _WIN32 ) && defined( DLL_IMPORT )
#define FT_EXPORT( x ) __declspec( dllimport ) x
#elif defined( __cplusplus )
#define FT_EXPORT( x ) extern "C" x
@ -508,7 +512,7 @@ FT_BEGIN_HEADER
/* C++ compiler and with 16bit compilers. */
/* */
/* This is special. Within C++, you must specify `extern "C"' for */
/* This is special. Within C++, you must specify `extern "C"` for */
/* functions which are used via function pointers, and you also */
/* must do that for structures which contain function pointers to */
/* assure C linkage -- it's not possible to have (local) anonymous */
@ -531,7 +535,7 @@ FT_BEGIN_HEADER
/* */
/* */
/* Some 16bit compilers have to redefine these macros to insert */
/* the infamous `_cdecl' or `__fastcall' declarations. */
/* the infamous `_cdecl` or `__fastcall` declarations. */
/* */
#ifndef FT_CALLBACK_DEF
#ifdef __cplusplus

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftheader.h */
/* */
/* Build macros of the FreeType 2 library. */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftheader.h
*
* Build macros of the FreeType 2 library.
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTHEADER_H_
#define FTHEADER_H_
@ -27,7 +27,7 @@
/* <Description> */
/* This macro is used in association with @FT_END_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
@ -45,7 +45,7 @@
/* <Description> */
/* This macro is used in association with @FT_BEGIN_HEADER in header */
/* files to ensure that the declarations within are properly */
/* encapsulated in an `extern "C" { .. }' block when included from a */
/* encapsulated in an `extern "C" { .. }` block when included from a */
/* C++ compiler. */
/* */
#ifdef __cplusplus
@ -55,54 +55,54 @@
#endif
/*************************************************************************/
/* */
/* Aliases for the FreeType 2 public and configuration files. */
/* */
/*************************************************************************/
/**************************************************************************
*
* Aliases for the FreeType 2 public and configuration files.
*
*/
/*************************************************************************/
/* */
/* <Section> */
/* header_file_macros */
/* */
/* <Title> */
/* Header File Macros */
/* */
/* <Abstract> */
/* Macro definitions used to #include specific header files. */
/* */
/* <Description> */
/* The following macros are defined to the name of specific */
/* FreeType~2 header files. They can be used directly in #include */
/* statements as in: */
/* */
/* { */
/* #include FT_FREETYPE_H */
/* #include FT_MULTIPLE_MASTERS_H */
/* #include FT_GLYPH_H */
/* } */
/* */
/* There are several reasons why we are now using macros to name */
/* public header files. The first one is that such macros are not */
/* limited to the infamous 8.3~naming rule required by DOS (and */
/* `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h'). */
/* */
/* The second reason is that it allows for more flexibility in the */
/* way FreeType~2 is installed on a given system. */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* header_file_macros
*
* @title:
* Header File Macros
*
* @abstract:
* Macro definitions used to `#include` specific header files.
*
* @description:
* The following macros are defined to the name of specific FreeType~2
* header files. They can be used directly in `#include` statements as
* in:
*
* ```
* #include FT_FREETYPE_H
* #include FT_MULTIPLE_MASTERS_H
* #include FT_GLYPH_H
* ```
*
* There are several reasons why we are now using macros to name public
* header files. The first one is that such macros are not limited to
* the infamous 8.3~naming rule required by DOS (and
* `FT_MULTIPLE_MASTERS_H` is a lot more meaningful than `ftmm.h`).
*
* The second reason is that it allows for more flexibility in the way
* FreeType~2 is installed on a given system.
*
*/
/* configuration files */
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CONFIG_CONFIG_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* FreeType~2 configuration data.
*
*/
@ -111,13 +111,13 @@
#endif
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CONFIG_STANDARD_LIBRARY_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* FreeType~2 interface to the standard C library functions.
*
*/
@ -126,13 +126,13 @@
#endif
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CONFIG_OPTIONS_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* FreeType~2 project-specific configuration options.
*
*/
@ -141,13 +141,13 @@
#endif
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CONFIG_MODULES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* list of FreeType~2 modules that are statically linked to new library
* instances in @FT_Init_FreeType.
*
@ -160,26 +160,26 @@
/* public headers */
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_FREETYPE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* base FreeType~2 API.
*
*/
#define FT_FREETYPE_H <freetype/freetype.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* list of FreeType~2 error codes (and messages).
*
* It is included by @FT_FREETYPE_H.
@ -188,26 +188,26 @@
#define FT_ERRORS_H <freetype/fterrors.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_MODULE_ERRORS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* list of FreeType~2 module error offsets (and messages).
*
*/
#define FT_MODULE_ERRORS_H <freetype/ftmoderr.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_SYSTEM_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 interface to low-level operations (i.e., memory management
* and stream i/o).
*
@ -217,13 +217,13 @@
#define FT_SYSTEM_H <freetype/ftsystem.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_IMAGE_H
*
* @description:
* A macro used in #include statements to name the file containing type
* A macro used in `#include` statements to name the file containing type
* definitions related to glyph images (i.e., bitmaps, outlines,
* scan-converter parameters).
*
@ -233,13 +233,13 @@
#define FT_IMAGE_H <freetype/ftimage.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TYPES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* basic data types defined by FreeType~2.
*
* It is included by @FT_FREETYPE_H.
@ -248,13 +248,13 @@
#define FT_TYPES_H <freetype/fttypes.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_LIST_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* list management API of FreeType~2.
*
* (Most applications will never need to include this file.)
@ -263,151 +263,151 @@
#define FT_LIST_H <freetype/ftlist.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_OUTLINE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* scalable outline management API of FreeType~2.
*
*/
#define FT_OUTLINE_H <freetype/ftoutln.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_SIZES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API which manages multiple @FT_Size objects per face.
*
*/
#define FT_SIZES_H <freetype/ftsizes.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_MODULE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* module management API of FreeType~2.
*
*/
#define FT_MODULE_H <freetype/ftmodapi.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_RENDER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* renderer module management API of FreeType~2.
*
*/
#define FT_RENDER_H <freetype/ftrender.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the driver modules.
*
*/
#define FT_DRIVER_H <freetype/ftdriver.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_AUTOHINTER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the auto-hinting module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_AUTOHINTER_H FT_DRIVER_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CFF_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the CFF driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_CFF_DRIVER_H FT_DRIVER_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRUETYPE_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the TrueType driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_TRUETYPE_DRIVER_H FT_DRIVER_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_PCF_DRIVER_H
*
* @description:
* A macro used in #include statements to name the file containing
* A macro used in `#include` statements to name the file containing
* structures and macros related to the PCF driver module.
*
* Deprecated since version 2.9; use @FT_DRIVER_H instead.
* Deprecated since version~2.9; use @FT_DRIVER_H instead.
*
*/
#define FT_PCF_DRIVER_H FT_DRIVER_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TYPE1_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* types and API specific to the Type~1 format.
*
*/
#define FT_TYPE1_TABLES_H <freetype/t1tables.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRUETYPE_IDS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* enumeration values which identify name strings, languages, encodings,
* etc. This file really contains a _large_ set of constant macro
* definitions, taken from the TrueType and OpenType specifications.
@ -416,174 +416,172 @@
#define FT_TRUETYPE_IDS_H <freetype/ttnameid.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRUETYPE_TABLES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* types and API specific to the TrueType (as well as OpenType) format.
*
*/
#define FT_TRUETYPE_TABLES_H <freetype/tttables.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRUETYPE_TAGS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of TrueType four-byte `tags' which identify blocks in
* A macro used in `#include` statements to name the file containing the
* definitions of TrueType four-byte 'tags' which identify blocks in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_TRUETYPE_TAGS_H <freetype/tttags.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_BDF_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which accesses BDF-specific strings from a
* face.
* A macro used in `#include` statements to name the file containing the
* definitions of an API which accesses BDF-specific strings from a face.
*
*/
#define FT_BDF_H <freetype/ftbdf.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CID_H
*
* @description:
* A macro used in #include statements to name the file containing the
* definitions of an API which access CID font information from a
* face.
* A macro used in `#include` statements to name the file containing the
* definitions of an API which access CID font information from a face.
*
*/
#define FT_CID_H <freetype/ftcid.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_GZIP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* definitions of an API which supports gzip-compressed files.
*
*/
#define FT_GZIP_H <freetype/ftgzip.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_LZW_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* definitions of an API which supports LZW-compressed files.
*
*/
#define FT_LZW_H <freetype/ftlzw.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_BZIP2_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* definitions of an API which supports bzip2-compressed files.
*
*/
#define FT_BZIP2_H <freetype/ftbzip2.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_WINFONTS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* definitions of an API which supports Windows FNT files.
*
*/
#define FT_WINFONTS_H <freetype/ftwinfnt.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_GLYPH_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API of the optional glyph management component.
*
*/
#define FT_GLYPH_H <freetype/ftglyph.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_BITMAP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API of the optional bitmap conversion component.
*
*/
#define FT_BITMAP_H <freetype/ftbitmap.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_BBOX_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API of the optional exact bounding box computation routines.
*
*/
#define FT_BBOX_H <freetype/ftbbox.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_CACHE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* API of the optional FreeType~2 cache sub-system.
*
*/
#define FT_CACHE_H <freetype/ftcache.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_MAC_H
*
* @description:
* A macro used in #include statements to name the file containing the
* Macintosh-specific FreeType~2 API. The latter is used to access
* fonts embedded in resource forks.
* A macro used in `#include` statements to name the file containing the
* Macintosh-specific FreeType~2 API. The latter is used to access fonts
* embedded in resource forks.
*
* This header file must be explicitly included by client applications
* compiled on the Mac (note that the base API still works though).
@ -592,105 +590,105 @@
#define FT_MAC_H <freetype/ftmac.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_MULTIPLE_MASTERS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* optional multiple-masters management API of FreeType~2.
*
*/
#define FT_MULTIPLE_MASTERS_H <freetype/ftmm.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_SFNT_NAMES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which accesses embedded `name' strings in
* A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which accesses embedded 'name' strings in
* SFNT-based font formats (i.e., TrueType and OpenType).
*
*/
#define FT_SFNT_NAMES_H <freetype/ftsnames.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_OPENTYPE_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates OpenType tables (BASE, GDEF,
* GPOS, GSUB, JSTF).
* A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which validates OpenType tables ('BASE',
* 'GDEF', 'GPOS', 'GSUB', 'JSTF').
*
*/
#define FT_OPENTYPE_VALIDATE_H <freetype/ftotval.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_GX_VALIDATE_H
*
* @description:
* A macro used in #include statements to name the file containing the
* optional FreeType~2 API which validates TrueTypeGX/AAT tables (feat,
* mort, morx, bsln, just, kern, opbd, trak, prop).
* A macro used in `#include` statements to name the file containing the
* optional FreeType~2 API which validates TrueTypeGX/AAT tables ('feat',
* 'mort', 'morx', 'bsln', 'just', 'kern', 'opbd', 'trak', 'prop').
*
*/
#define FT_GX_VALIDATE_H <freetype/ftgxval.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_PFR_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which accesses PFR-specific data.
*
*/
#define FT_PFR_H <freetype/ftpfr.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_STROKER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which provides functions to stroke outline paths.
*/
#define FT_STROKER_H <freetype/ftstroke.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_SYNTHESIS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs artificial obliquing and emboldening.
*/
#define FT_SYNTHESIS_H <freetype/ftsynth.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_FONT_FORMATS_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which provides functions specific to font formats.
*/
#define FT_FONT_FORMATS_H <freetype/ftfntfmt.h>
@ -699,67 +697,79 @@
#define FT_XFREE86_H FT_FONT_FORMATS_H
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_TRIGONOMETRY_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs trigonometric computations (e.g.,
* cosines and arc tangents).
*/
#define FT_TRIGONOMETRY_H <freetype/fttrigon.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_LCD_FILTER_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs color filtering for subpixel rendering.
*/
#define FT_LCD_FILTER_H <freetype/ftlcdfil.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_INCREMENTAL_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which performs incremental glyph loading.
*/
#define FT_INCREMENTAL_H <freetype/ftincrem.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_GASP_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which returns entries from the TrueType GASP table.
*/
#define FT_GASP_H <freetype/ftgasp.h>
/*************************************************************************
/**************************************************************************
*
* @macro:
* FT_ADVANCES_H
*
* @description:
* A macro used in #include statements to name the file containing the
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which returns individual and ranged glyph advances.
*/
#define FT_ADVANCES_H <freetype/ftadvanc.h>
/**************************************************************************
*
* @macro:
* FT_COLOR_H
*
* @description:
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which handles the OpenType 'CPAL' table.
*/
#define FT_COLOR_H <freetype/ftcolor.h>
/* */
/* These header files don't need to be included by the user. */
@ -770,14 +780,14 @@
#define FT_UNPATENTED_HINTING_H <freetype/ftparams.h>
#define FT_TRUETYPE_UNPATENTED_H <freetype/ftparams.h>
/* FT_CACHE_H is the only header file needed for the cache subsystem. */
/* `FT_CACHE_H` is the only header file needed for the cache subsystem. */
#define FT_CACHE_IMAGE_H FT_CACHE_H
#define FT_CACHE_SMALL_BITMAPS_H FT_CACHE_H
#define FT_CACHE_CHARMAP_H FT_CACHE_H
/* The internals of the cache sub-system are no longer exposed. We */
/* default to FT_CACHE_H at the moment just in case, but we know of */
/* no rogue client that uses them. */
/* default to `FT_CACHE_H` at the moment just in case, but we know */
/* of no rogue client that uses them. */
/* */
#define FT_CACHE_MANAGER_H FT_CACHE_H
#define FT_CACHE_INTERNAL_MRU_H FT_CACHE_H
@ -789,8 +799,8 @@
/*
* Include internal headers definitions from <internal/...>
* only when building the library.
* Include internal headers definitions from `<internal/...>` only when
* building the library.
*/
#ifdef FT2_BUILD_LIBRARY
#define FT_INTERNAL_INTERNAL_H <freetype/internal/internal.h>

View File

@ -1,12 +1,12 @@
/*
* This file registers the FreeType modules compiled into the library.
* This file registers the FreeType modules compiled into the library.
*
* If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/') based on information
* from `<topdir>/modules.cfg'.
* If you use GNU make, this file IS NOT USED! Instead, it is created in
* the objects directory (normally `<topdir>/objs/`) based on information
* from `<topdir>/modules.cfg`.
*
* Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile
* FreeType without GNU make.
* Please read `docs/INSTALL.ANY` and `docs/CUSTOMIZE` how to compile
* FreeType without GNU make.
*
*/

File diff suppressed because it is too large Load Diff

View File

@ -1,31 +1,31 @@
/***************************************************************************/
/* */
/* ftstdlib.h */
/* */
/* ANSI-specific library and header configuration file (specification */
/* only). */
/* */
/* Copyright 2002-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftstdlib.h
*
* ANSI-specific library and header configuration file (specification
* only).
*
* Copyright (C) 2002-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This file is used to group all #includes to the ANSI C library that */
/* FreeType normally requires. It also defines macros to rename the */
/* standard functions within the FreeType source code. */
/* */
/* Load a file which defines FTSTDLIB_H_ before this one to override it. */
/* */
/*************************************************************************/
/**************************************************************************
*
* This file is used to group all `#includes` to the ANSI~C library that
* FreeType normally requires. It also defines macros to rename the
* standard functions within the FreeType source code.
*
* Load a file which defines `FTSTDLIB_H_` before this one to override it.
*
*/
#ifndef FTSTDLIB_H_
@ -37,23 +37,23 @@
#define ft_ptrdiff_t ptrdiff_t
/**********************************************************************/
/* */
/* integer limits */
/* */
/* UINT_MAX and ULONG_MAX are used to automatically compute the size */
/* of `int' and `long' in bytes at compile-time. So far, this works */
/* for all platforms the library has been tested on. */
/* */
/* Note that on the extremely rare platforms that do not provide */
/* integer types that are _exactly_ 16 and 32 bits wide (e.g. some */
/* old Crays where `int' is 36 bits), we do not make any guarantee */
/* about the correct behaviour of FT2 with all fonts. */
/* */
/* In these case, `ftconfig.h' will refuse to compile anyway with a */
/* message like `couldn't find 32-bit type' or something similar. */
/* */
/**********************************************************************/
/**************************************************************************
*
* integer limits
*
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
* `int` and `long` in bytes at compile-time. So far, this works for all
* platforms the library has been tested on.
*
* Note that on the extremely rare platforms that do not provide integer
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
* `int` is 36~bits), we do not make any guarantee about the correct
* behaviour of FreeType~2 with all fonts.
*
* In these cases, `ftconfig.h` will refuse to compile anyway with a
* message like 'couldn't find 32-bit type' or something similar.
*
*/
#include <limits.h>
@ -68,11 +68,11 @@
#define FT_ULONG_MAX ULONG_MAX
/**********************************************************************/
/* */
/* character and string processing */
/* */
/**********************************************************************/
/**************************************************************************
*
* character and string processing
*
*/
#include <string.h>
@ -92,11 +92,11 @@
#define ft_strstr strstr
/**********************************************************************/
/* */
/* file handling */
/* */
/**********************************************************************/
/**************************************************************************
*
* file handling
*
*/
#include <stdio.h>
@ -110,11 +110,11 @@
#define ft_sprintf sprintf
/**********************************************************************/
/* */
/* sorting */
/* */
/**********************************************************************/
/**************************************************************************
*
* sorting
*
*/
#include <stdlib.h>
@ -122,11 +122,11 @@
#define ft_qsort qsort
/**********************************************************************/
/* */
/* memory allocation */
/* */
/**********************************************************************/
/**************************************************************************
*
* memory allocation
*
*/
#define ft_scalloc calloc
@ -135,36 +135,36 @@
#define ft_srealloc realloc
/**********************************************************************/
/* */
/* miscellaneous */
/* */
/**********************************************************************/
/**************************************************************************
*
* miscellaneous
*
*/
#define ft_strtol strtol
#define ft_getenv getenv
/**********************************************************************/
/* */
/* execution control */
/* */
/**********************************************************************/
/**************************************************************************
*
* execution control
*
*/
#include <setjmp.h>
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* jmp_buf is defined as a macro */
/* on certain platforms */
#define ft_jmp_buf jmp_buf /* note: this cannot be a typedef since */
/* `jmp_buf` is defined as a macro */
/* on certain platforms */
#define ft_longjmp longjmp
#define ft_setjmp( b ) setjmp( *(ft_jmp_buf*) &(b) ) /* same thing here */
/* the following is only used for debugging purposes, i.e., if */
/* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined */
/* The following is only used for debugging purposes, i.e., if */
/* `FT_DEBUG_LEVEL_ERROR` or `FT_DEBUG_LEVEL_TRACE` are defined. */
#include <stdarg.h>

File diff suppressed because it is too large Load Diff

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftadvanc.h */
/* */
/* Quick computation of advance widths (specification only). */
/* */
/* Copyright 2008-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftadvanc.h
*
* Quick computation of advance widths (specification only).
*
* Copyright (C) 2008-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#ifndef FTADVANC_H_
@ -56,68 +56,67 @@ FT_BEGIN_HEADER
*/
/*************************************************************************/
/* */
/* <Const> */
/* FT_ADVANCE_FLAG_FAST_ONLY */
/* */
/* <Description> */
/* A bit-flag to be OR-ed with the `flags' parameter of the */
/* @FT_Get_Advance and @FT_Get_Advances functions. */
/* */
/* If set, it indicates that you want these functions to fail if the */
/* corresponding hinting mode or font driver doesn't allow for very */
/* quick advance computation. */
/* */
/* Typically, glyphs that are either unscaled, unhinted, bitmapped, */
/* or light-hinted can have their advance width computed very */
/* quickly. */
/* */
/* Normal and bytecode hinted modes that require loading, scaling, */
/* and hinting of the glyph outline, are extremely slow by */
/* comparison. */
/* */
/**************************************************************************
*
* @enum:
* FT_ADVANCE_FLAG_FAST_ONLY
*
* @description:
* A bit-flag to be OR-ed with the `flags` parameter of the
* @FT_Get_Advance and @FT_Get_Advances functions.
*
* If set, it indicates that you want these functions to fail if the
* corresponding hinting mode or font driver doesn't allow for very quick
* advance computation.
*
* Typically, glyphs that are either unscaled, unhinted, bitmapped, or
* light-hinted can have their advance width computed very quickly.
*
* Normal and bytecode hinted modes that require loading, scaling, and
* hinting of the glyph outline, are extremely slow by comparison.
*/
#define FT_ADVANCE_FLAG_FAST_ONLY 0x20000000L
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Advance */
/* */
/* <Description> */
/* Retrieve the advance value of a given glyph outline in an */
/* @FT_Face. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
/* */
/* gindex :: The glyph index. */
/* */
/* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph, used to determine what kind */
/* of advances you need. */
/* <Output> */
/* padvance :: The advance value. If scaling is performed (based on */
/* the value of `load_flags'), the advance value is in */
/* 16.16 format. Otherwise, it is in font units. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the */
/* vertical advance corresponding to a vertical layout. */
/* Otherwise, it is the horizontal advance in a */
/* horizontal layout. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */
/* */
/* A scaled advance is returned in 16.16 format but isn't transformed */
/* by the affine transformation specified by @FT_Set_Transform. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Advance
*
* @description:
* Retrieve the advance value of a given glyph outline in an @FT_Face.
*
* @input:
* face ::
* The source @FT_Face handle.
*
* gindex ::
* The glyph index.
*
* load_flags ::
* A set of bit flags similar to those used when calling
* @FT_Load_Glyph, used to determine what kind of advances you need.
* @output:
* padvance ::
* The advance value. If scaling is performed (based on the value of
* `load_flags`), the advance value is in 16.16 format. Otherwise, it
* is in font units.
*
* If @FT_LOAD_VERTICAL_LAYOUT is set, this is the vertical advance
* corresponding to a vertical layout. Otherwise, it is the horizontal
* advance in a horizontal layout.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
* the corresponding font backend doesn't have a quick way to retrieve
* the advances.
*
* A scaled advance is returned in 16.16 format but isn't transformed by
* the affine transformation specified by @FT_Set_Transform.
*/
FT_EXPORT( FT_Error )
FT_Get_Advance( FT_Face face,
FT_UInt gindex,
@ -125,50 +124,52 @@ FT_BEGIN_HEADER
FT_Fixed *padvance );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Advances */
/* */
/* <Description> */
/* Retrieve the advance values of several glyph outlines in an */
/* @FT_Face. */
/* */
/* <Input> */
/* face :: The source @FT_Face handle. */
/* */
/* start :: The first glyph index. */
/* */
/* count :: The number of advance values you want to retrieve. */
/* */
/* load_flags :: A set of bit flags similar to those used when */
/* calling @FT_Load_Glyph. */
/* */
/* <Output> */
/* padvance :: The advance values. This array, to be provided by the */
/* caller, must contain at least `count' elements. */
/* */
/* If scaling is performed (based on the value of */
/* `load_flags'), the advance values are in 16.16 format. */
/* Otherwise, they are in font units. */
/* */
/* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the */
/* vertical advances corresponding to a vertical layout. */
/* Otherwise, they are the horizontal advances in a */
/* horizontal layout. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and */
/* if the corresponding font backend doesn't have a quick way to */
/* retrieve the advances. */
/* */
/* Scaled advances are returned in 16.16 format but aren't */
/* transformed by the affine transformation specified by */
/* @FT_Set_Transform. */
/* */
/**************************************************************************
*
* @function:
* FT_Get_Advances
*
* @description:
* Retrieve the advance values of several glyph outlines in an @FT_Face.
*
* @input:
* face ::
* The source @FT_Face handle.
*
* start ::
* The first glyph index.
*
* count ::
* The number of advance values you want to retrieve.
*
* load_flags ::
* A set of bit flags similar to those used when calling
* @FT_Load_Glyph.
*
* @output:
* padvance ::
* The advance values. This array, to be provided by the caller, must
* contain at least `count` elements.
*
* If scaling is performed (based on the value of `load_flags`), the
* advance values are in 16.16 format. Otherwise, they are in font
* units.
*
* If @FT_LOAD_VERTICAL_LAYOUT is set, these are the vertical advances
* corresponding to a vertical layout. Otherwise, they are the
* horizontal advances in a horizontal layout.
*
* @return:
* FreeType error code. 0 means success.
*
* @note:
* This function may fail if you use @FT_ADVANCE_FLAG_FAST_ONLY and if
* the corresponding font backend doesn't have a quick way to retrieve
* the advances.
*
* Scaled advances are returned in 16.16 format but aren't transformed by
* the affine transformation specified by @FT_Set_Transform.
*/
FT_EXPORT( FT_Error )
FT_Get_Advances( FT_Face face,
FT_UInt start,

View File

@ -1,30 +1,30 @@
/***************************************************************************/
/* */
/* ftbbox.h */
/* */
/* FreeType exact bbox computation (specification). */
/* */
/* Copyright 1996-2018 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftbbox.h
*
* FreeType exact bbox computation (specification).
*
* Copyright (C) 1996-2019 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
/*************************************************************************/
/* */
/* This component has a _single_ role: to compute exact outline bounding */
/* boxes. */
/* */
/* It is separated from the rest of the engine for various technical */
/* reasons. It may well be integrated in `ftoutln' later. */
/* */
/*************************************************************************/
/**************************************************************************
*
* This component has a _single_ role: to compute exact outline bounding
* boxes.
*
* It is separated from the rest of the engine for various technical
* reasons. It may well be integrated in 'ftoutln' later.
*
*/
#ifndef FTBBOX_H_
@ -44,43 +44,44 @@
FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Section> */
/* outline_processing */
/* */
/*************************************************************************/
/**************************************************************************
*
* @section:
* outline_processing
*
*/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Outline_Get_BBox */
/* */
/* <Description> */
/* Compute the exact bounding box of an outline. This is slower */
/* than computing the control box. However, it uses an advanced */
/* algorithm that returns _very_ quickly when the two boxes */
/* coincide. Otherwise, the outline Bezier arcs are traversed to */
/* extract their extrema. */
/* */
/* <Input> */
/* outline :: A pointer to the source outline. */
/* */
/* <Output> */
/* abbox :: The outline's exact bounding box. */
/* */
/* <Return> */
/* FreeType error code. 0~means success. */
/* */
/* <Note> */
/* If the font is tricky and the glyph has been loaded with */
/* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get */
/* reasonable values for the BBox it is necessary to load the glyph */
/* at a large ppem value (so that the hinting instructions can */
/* properly shift and scale the subglyphs), then extracting the BBox, */
/* which can be eventually converted back to font units. */
/* */
/**************************************************************************
*
* @function:
* FT_Outline_Get_BBox
*
* @description:
* Compute the exact bounding box of an outline. This is slower than
* computing the control box. However, it uses an advanced algorithm
* that returns _very_ quickly when the two boxes coincide. Otherwise,
* the outline Bezier arcs are traversed to extract their extrema.
*
* @input:
* outline ::
* A pointer to the source outline.
*
* @output:
* abbox ::
* The outline's exact bounding box.
*
* @return:
* FreeType error code. 0~means success.
*
* @note:
* If the font is tricky and the glyph has been loaded with
* @FT_LOAD_NO_SCALE, the resulting BBox is meaningless. To get
* reasonable values for the BBox it is necessary to load the glyph at a
* large ppem value (so that the hinting instructions can properly shift
* and scale the subglyphs), then extracting the BBox, which can be
* eventually converted back to font units.
*/
FT_EXPORT( FT_Error )
FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox );

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