Merge remote-tracking branch 'gerrit/master' into containers

Change-Id: I97ba222435ff50a9e5422e6f2c73e4bb8d1b865c
bb10
João Abecasis 2012-02-29 00:57:12 +01:00
commit c4ad58ed22
642 changed files with 16460 additions and 5991 deletions

1
.gitignore vendored
View File

@ -122,6 +122,7 @@ translations/*.qm
translations/*_untranslated.ts
qrc_*.cpp
src/concurrent/qtconcurrentversion.h
src/corelib/qtcoreversion.h
src/dbus/qtdbusversion.h
src/gui/qtguiversion.h

View File

@ -351,7 +351,7 @@ sub syncHeader {
#write it
my $iheader_out = fixPaths($iheader, $header_dir);
open HEADER, ">$header" || die "Could not open $header for writing!\n";
open(HEADER, ">$header") || die "Could not open $header for writing: $!\n";
print HEADER "#include \"$iheader_out\"\n";
close HEADER;
if(defined($ts)) {
@ -1133,7 +1133,7 @@ foreach my $lib (@modules_to_sync) {
my $header_dir = dirname($header_path);
make_path($header_dir, $lib, $verbose_level);
open HEADER, ">$header_path" || die "Could not open $header_path for writing!\n";
open(HEADER, ">$header_path") || die "Could not open $header_path for writing: $!\n";
print HEADER "#ifndef $guard\n";
print HEADER "#define $guard\n";
my $warning = "Header <$lib/";

View File

@ -1,3 +0,0 @@
SOURCES = ahi.cpp
CONFIG -= qt
LIBS += -lahi -lahioem

View File

@ -1,5 +0,0 @@
SOURCES = directfb.cpp
CONFIG -= qt
QMAKE_CXXFLAGS += $$QT_CFLAGS_DIRECTFB
LIBS += $$QT_LIBS_DIRECTFB

View File

@ -1,2 +0,0 @@
SOURCES = sound.cpp
CONFIG -= qt

View File

@ -1,3 +0,0 @@
SOURCES = svgalib.cpp
CONFIG -= qt
LIBS += -lvgagl -lvga

View File

@ -41,7 +41,11 @@ elif strings - $binary | grep MostSignificantByteFirst >/dev/null 2>&1; then
fi
# make clean as this tests is compiled for both the host and the target
$MAKE distclean
if [ "$VERBOSE" = "yes" ]; then
$MAKE distclean
else
$MAKE distclean >/dev/null 2>&1
fi
# done
if [ "$ENDIAN" = "LITTLE" ]; then

699
configure vendored

File diff suppressed because it is too large Load Diff

13
dist/changes-5.0.0 vendored
View File

@ -206,6 +206,7 @@ information about a particular change.
You might need to adjust your code if it used a QIconEngine.
- qmake
* Projects which explicitly set an empty TARGET are considered broken now.
* several functions and built-in variables were modified to return normalized paths.
- QTextCodecPlugin has been removed since it is no longer used. All text codecs
@ -214,6 +215,11 @@ information about a particular change.
- QDir::NoDotAndDotDot is QDir::NoDot|QDir::NoDotDot therefore there is no need
to use or check both.
- QFSFileEngine, QAbstractFileEngine, QAbstractFileEngineIterator and
QAbstractFileEngineHandler were removed from public API and are no longer
exported. They may temporarily live as private implementation details, but
they may be altogether dropped or otherwise changed at will in the future.
- QLocale
* toShort(), toUShort(), toInt(), toUInt(), toLongLong() and toULongLong() no
longer take a parameter for base, they will only perform localised base 10
@ -223,6 +229,9 @@ information about a particular change.
- QSqlQueryModel::indexInQuery() is now virtual. See note below under QSql.
- qMacVersion() has been removed. Use QSysInfo::macVersion() or
QSysInfo::MacintoshVersion instead.
****************************************************************************
* General *
****************************************************************************
@ -294,6 +303,10 @@ QtCore
* The QDate::addDays() and QDateTime::addDays() methods now take a qint64
* The QDate::daysTo() and QDateTime::daysTo() methods now return a qint64
* QTextCodec::codecForCStrings() and QTextCodec::setCodecForCStrings() have both
been removed. This was removed due to issues with breaking other code from
libraries, creating uncertainty/bugs in using QString easily, and (to a lesser
extent) performance issues.
* QIntValidator and QDoubleValidator no longer fall back to using the C locale if
the requested locale fails to validate the input.

View File

@ -76,7 +76,7 @@ extern "C" MY_EXPORT int avg(int a, int b)
//! [4]
#ifdef Q_WS_WIN
#ifdef Q_OS_WIN
#define MY_EXPORT __declspec(dllexport)
#else
#define MY_EXPORT

View File

@ -41,14 +41,16 @@
//! [0]
void MyWidget::wheelEvent(QWheelEvent *event)
{
int numDegrees = event->delta() / 8;
int numSteps = numDegrees / 15;
QPoint numPixels = envent->pixelDelta();
QPoint numDegrees = envent->angleDelta() / 8;
if (event->orientation() == Qt::Horizontal) {
scrollHorizontally(numSteps);
} else {
scrollVertically(numSteps);
if (!numPixels.isNull()) {
scrollWithPixels(numpixels);
} else if (!numDegrees.isNull()) {
QPoint numSteps = numDegrees / 15;
scrollWithDegrees(numSteps);
}
event->accept();
}
//! [0]

View File

@ -45,13 +45,13 @@
//Qt
#include <QGraphicsView>
#include <QApplication>
#include <QMenu>
#include <QMenuBar>
#include <QLayout>
#ifdef QT_NO_OPENGL
#include <QtGui/QMenuBar>
#include <QtGui/QLayout>
#include <QtGui/QApplication>
#else
#include <QtOpenGL/QtOpenGL>
#ifndef QT_NO_OPENGL
# include <QtOpenGL/QtOpenGL>
#endif
MainWindow::MainWindow() : QMainWindow(0)

View File

@ -48,9 +48,9 @@
PixmapItem::PixmapItem(const QString &fileName,GraphicsScene::Mode mode, QGraphicsItem * parent) : QGraphicsObject(parent)
{
if (mode == GraphicsScene::Big)
pix = ":/big/" + fileName;
pix = QPixmap(QStringLiteral(":/big/") + fileName);
else
pix = ":/small/" + fileName;
pix = QPixmap(QStringLiteral(":/small/") + fileName);
}
PixmapItem::PixmapItem(const QString &fileName, QGraphicsScene *scene) : QGraphicsObject(), pix(fileName)

View File

@ -1,4 +1,5 @@
contains(QT_CONFIG, opengl):QT += opengl widgets
QT += widgets
contains(QT_CONFIG, opengl):QT += opengl
HEADERS += boat.h \
bomb.h \
mainwindow.h \

View File

@ -1,14 +1,9 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
# Input
HEADERS += complexping.h ping-common.h
SOURCES += complexping.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong

View File

@ -1,14 +1,9 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
# Input
HEADERS += complexpong.h
SOURCES += complexpong.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/complexpingpong

View File

@ -1,9 +1,6 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += qdbus
QT += widgets
# Input
HEADERS += chat.h chat_adaptor.h chat_interface.h
SOURCES += chat.cpp chat_adaptor.cpp chat_interface.cpp
FORMS += chatmainwindow.ui chatsetnickname.ui
@ -17,5 +14,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/chat
INSTALLS += target sources
QT += widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,14 +1,9 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
win32:CONFIG += console
# Input
SOURCES += listnames.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/listnames
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/listnames

View File

@ -1,15 +1,9 @@
TEMPLATE = app
TARGET = ping
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
# Input
HEADERS += ping-common.h
SOURCES += ping.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong

View File

@ -1,15 +1,9 @@
TEMPLATE = app
TARGET = pong
DEPENDPATH += .
INCLUDEPATH += .
QT -= gui
CONFIG += qdbus
# Input
HEADERS += ping-common.h pong.h
SOURCES += pong.cpp
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/pingpong

View File

@ -1,13 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) Mon Aug 28 19:50:14 2006
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
CONFIG += qdbus
# Input
# DBUS_ADAPTORS += car.xml
HEADERS += car.h car_adaptor.h
SOURCES += car.cpp main.cpp car_adaptor.cpp
@ -18,5 +11,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/remotecontrolledcar/car
INSTALLS += target sources
QT += widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,13 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) Tue Aug 29 12:28:05 2006
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
CONFIG += qdbus
# Input
# DBUS_INTERFACES += car.xml
FORMS += controller.ui
HEADERS += car_interface.h controller.h
@ -19,5 +12,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.xml
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/dbus/remotecontrolledcar/controller
INSTALLS += target sources
QT += widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,6 +1,5 @@
TEMPLATE = app
QT += widgets
# Input
HEADERS += stylewidget.h
FORMS += stylewidget.ui
SOURCES += main.cpp stylewidget.cpp
@ -10,5 +9,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/embedded/styleexample
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.html
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/embedded/styleexample
INSTALLS += target sources
QT += widgets widgets

View File

@ -1,13 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) ma 3. nov 17:33:30 2008
######################################################################
QT += opengl widgets
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
# Input
HEADERS += 3rdparty/fbm.h \
glbuffers.h \
glextensions.h \
@ -27,8 +19,6 @@ SOURCES += 3rdparty/fbm.c \
RESOURCES += boxes.qrc
QT += opengl widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/boxes
sources.files = $$SOURCES $$HEADERS $$RESOURCES *.pro *.html *.jpg *.png *.fsh *.vsh *.par

View File

@ -1,12 +1,8 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
QMAKE_PROJECT_NAME = flowlayout_graphicsview
# Input
HEADERS += flowlayout.h window.h
SOURCES += flowlayout.cpp main.cpp window.cpp
QT += widgets
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -16,7 +16,8 @@ RESOURCES += \
FORMS += \
form.ui
contains(QT_CONFIG, opengl):QT += opengl widgets
QT += widgets
contains(QT_CONFIG, opengl):QT += opengl
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/padnavigator

View File

@ -1,8 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Tue May 12 15:22:25 2009
######################################################################
QT += widgets
# Input
SOURCES += main.cpp
RESOURCES += weatheranchorlayout.qrc
@ -12,5 +9,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES weatheranchorlayout.pro images
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/graphicsview/weatheranchorlayout
INSTALLS += target sources
QT += widgets
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -95,7 +95,7 @@ QVariant Model::data(const QModelIndex &index, int role) const
if (!index.isValid())
return QVariant();
if (role == Qt::DisplayRole)
return "Item " + QString::number(index.row()) + ":" + QString::number(index.column());
return QVariant("Item " + QString::number(index.row()) + ":" + QString::number(index.column()));
if (role == Qt::DecorationRole) {
if (index.column() == 0)
return iconProvider.icon(QFileIconProvider::Folder);

View File

@ -1,17 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) Thu Mar 5 14:39:33 2009
######################################################################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets printsupport
CONFIG += qt warn_on
#unix:contains(QT_CONFIG, dbus):QT += dbus widgets
# Input
HEADERS += printview.h spreadsheet.h spreadsheetdelegate.h spreadsheetitem.h
SOURCES += main.cpp \
printview.cpp \
@ -20,7 +9,6 @@ SOURCES += main.cpp \
spreadsheetitem.cpp
RESOURCES += spreadsheet.qrc
build_all:!build_pass {
CONFIG -= build_all
CONFIG += release

View File

@ -1,14 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) fr. nov. 16 13:18:20 2007
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT = core network
CONFIG += console
# Input
SOURCES += main.cpp
# install
@ -17,5 +9,4 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/download
INSTALLS += target sources
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -151,7 +151,7 @@ void DownloadManager::execute()
void DownloadManager::sslErrors(const QList<QSslError> &sslErrors)
{
#ifndef QT_NO_OPENSSL
#ifndef QT_NO_SSL
foreach (const QSslError &error, sslErrors)
fprintf(stderr, "SSL error: %s\n", qPrintable(error.errorString()));
#endif

View File

@ -1,14 +1,6 @@
######################################################################
# Automatically generated by qmake (2.01a) fr. nov. 16 14:11:36 2007
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT = core network
CONFIG += console
# Input
HEADERS += downloadmanager.h textprogressbar.h
SOURCES += downloadmanager.cpp main.cpp textprogressbar.cpp
@ -18,7 +10,6 @@ sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/network/downloadmanager
INSTALLS += target sources
OTHER_FILES += \
debian/changelog \
debian/compat \
@ -26,4 +17,5 @@ OTHER_FILES += \
debian/copyright \
debian/README \
debian/rules
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -47,7 +47,7 @@
HttpWindow::HttpWindow(QWidget *parent)
: QDialog(parent)
{
#ifndef QT_NO_OPENSSL
#ifndef QT_NO_SSL
urlLineEdit = new QLineEdit("https://qt.nokia.com/");
#else
urlLineEdit = new QLineEdit("http://qt.nokia.com/");
@ -75,7 +75,7 @@ HttpWindow::HttpWindow(QWidget *parent)
connect(&qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)),
this, SLOT(slotAuthenticationRequired(QNetworkReply*,QAuthenticator*)));
#ifndef QT_NO_OPENSSL
#ifndef QT_NO_SSL
connect(&qnam, SIGNAL(sslErrors(QNetworkReply*,QList<QSslError>)),
this, SLOT(sslErrors(QNetworkReply*,QList<QSslError>)));
#endif
@ -247,7 +247,7 @@ void HttpWindow::slotAuthenticationRequired(QNetworkReply*,QAuthenticator *authe
}
}
#ifndef QT_NO_OPENSSL
#ifndef QT_NO_SSL
void HttpWindow::sslErrors(QNetworkReply*,const QList<QSslError> &errors)
{
QString errorString;

View File

@ -76,7 +76,7 @@ private slots:
void updateDataReadProgress(qint64 bytesRead, qint64 totalBytes);
void enableDownloadButton();
void slotAuthenticationRequired(QNetworkReply*,QAuthenticator *);
#ifndef QT_NO_OPENSSL
#ifndef QT_NO_SSL
void sslErrors(QNetworkReply*,const QList<QSslError> &errors);
#endif

View File

@ -108,10 +108,10 @@ void TrackerClient::fetchPeerList()
// Percent encode the hash
QByteArray infoHash = torrentDownloader->infoHash();
QString encodedSum;
QByteArray encodedSum;
for (int i = 0; i < infoHash.size(); ++i) {
encodedSum += '%';
encodedSum += QString::number(infoHash[i], 16).right(2).rightJustified(2, '0');
encodedSum += QByteArray::number(infoHash[i], 16).right(2).rightJustified(2, '0');
}
bool seeding = (torrentDownloader->state() == TorrentClient::Seeding);

View File

@ -1,17 +1,12 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += gui
# Input
SOURCES += main.cpp
SOURCES += glwindow.cpp
HEADERS += glwindow.h
RESOURCES += texture.qrc
QT += gui
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es

View File

@ -1,12 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Thu Oct 4 19:01:12 2007
######################################################################
QT += opengl widgets
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
SOURCES += glwidget.cpp
SOURCES += mainwindow.cpp
@ -17,7 +10,6 @@ HEADERS += mainwindow.h
HEADERS += bubble.h
RESOURCES += texture.qrc
QT += opengl widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es2
@ -25,7 +17,6 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS hellogl_es2.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/hellogl_es2
INSTALLS += target sources
maemo5 {
# Debian package name may not contain numbers or special characters
# such as '_', lets change this in Maemo.

View File

@ -1,12 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Wed Apr 27 16:40:46 2011
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += gui-private core-private
# Input
HEADERS += hellowindow.h
SOURCES += hellowindow.cpp main.cpp

View File

@ -1,12 +1,3 @@
######################################################################
# Automatically generated by qmake (2.01a) Wed Apr 27 16:40:46 2011
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
HEADERS += paintedwindow.h
SOURCES += paintedwindow.cpp main.cpp
@ -15,4 +6,3 @@ target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/paintedwindow
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS paintedwindow.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/paintedwindow
INSTALLS += target sources

View File

@ -1,14 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Fri May 12 17:15:46 2006
######################################################################
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += opengl svg widgets
# Input
HEADERS += glwidget.h
SOURCES += glwidget.cpp main.cpp
RESOURCES += pbuffers2.qrc
@ -19,5 +10,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES pbuffers2.pro *.png *.svg
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/opengl/pbuffers2
INSTALLS += target sources
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -3,8 +3,9 @@ HEADERS += xform.h
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
SHARED_FOLDER = ../shared

View File

@ -8,8 +8,9 @@ include($$SHARED_FOLDER/shared.pri)
RESOURCES += composition.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/composition

View File

@ -9,8 +9,9 @@ RESOURCES += deform.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/deform

View File

@ -8,8 +8,9 @@ include($$SHARED_FOLDER/shared.pri)
RESOURCES += gradients.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/gradients

View File

@ -9,8 +9,9 @@ RESOURCES += pathstroke.qrc
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
QT += opengl widgets
QT += opengl
}
QT += widgets
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/painting/pathstroke

View File

@ -1,15 +1,5 @@
######################################################################
# Automatically generated by qmake (2.01a) Wed Apr 27 16:40:46 2011
######################################################################
CONFIG += console
QT += gui-private core-private
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
CONFIG+=console
QT += gui-private
QT += core-private
# Input
HEADERS += window.h
SOURCES += window.cpp main.cpp

View File

@ -1,20 +1,13 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
QT += concurrent
QT += concurrent widgets
# Input
SOURCES += main.cpp imagescaling.cpp
HEADERS += imagescaling.h
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/imagescaling
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/imagescaling
INSTALLS += target sources
wince*: DEPLOYMENT_PLUGIN += qgif qjpeg
QT += widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,14 +1,10 @@
TEMPLATE = app
TARGET = mapdemo
DEPENDPATH += .
INCLUDEPATH += .
QT += concurrent widgets
# Input
SOURCES += main.cpp
CONFIG += console
# install
SOURCES += main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/map
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/map

View File

@ -1,17 +1,11 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
QT += concurrent widgets
CONFIG += console
# install
SOURCES += main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/progressdialog
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/progressdialog
INSTALLS += target sources
QT += concurrent widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,17 +1,11 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
QT += concurrent widgets
CONFIG += console
# install
SOURCES += main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/runfunction
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/runfunction
INSTALLS += target sources
QT += concurrent widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,17 +1,11 @@
TEMPLATE = app
DEPENDPATH += .
INCLUDEPATH += .
# Input
SOURCES += main.cpp
QT += concurrent widgets
CONFIG += console
# install
SOURCES += main.cpp
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/wordcount
sources.files = $$SOURCES $$HEADERS $$FORMS $$RESOURCES *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/qtconcurrent/wordcount
INSTALLS += target sources
QT += concurrent widgets
simulator: warning(This example does not work on Simulator platform)

View File

@ -1,16 +1,8 @@
######################################################################
# Automatically generated by qmake (1.08a) Fri Jan 7 15:25:07 2005
######################################################################
TEMPLATE = app
QT = core gui
CONFIG -= moc app_bundle
DEPENDPATH += .
INCLUDEPATH += .
CONFIG += console
# Input
SOURCES += waitconditions.cpp
CONFIG += qt warn_on create_prl link_prl console
# install
target.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/waitconditions
@ -18,5 +10,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS waitconditions.pro
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/threads/waitconditions
INSTALLS += target sources
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -53,8 +53,10 @@ public:
QT_BEGIN_NAMESPACE
Q_DECLARE_INTERFACE(EchoInterface,
"com.trolltech.Plugin.EchoInterface/1.0");
#define EchoInterface_iid "org.qt-project.Qt.Examples.EchoInterface"
Q_DECLARE_INTERFACE(EchoInterface, EchoInterface_iid)
QT_END_NAMESPACE
//! [0]

View File

@ -48,7 +48,3 @@ QString EchoPlugin::echo(const QString &message)
return message;
}
//! [0]
//! [1]
Q_EXPORT_PLUGIN2(echoplugin, EchoPlugin);
//! [1]

View File

@ -42,6 +42,7 @@
#define ECHOPLUGIN_H
#include <QObject>
#include <QtPlugin>
#include "echoplugin.h"
#include "echointerface.h"
@ -49,6 +50,7 @@
class EchoPlugin : public QObject, EchoInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.EchoInterface" FILE "echoplugin.json")
Q_INTERFACES(EchoInterface)
public:

View File

@ -0,0 +1 @@
{}

View File

@ -4,6 +4,7 @@ CONFIG += plugin
INCLUDEPATH += ../echowindow
HEADERS = echoplugin.h
SOURCES = echoplugin.cpp
OTHER_FILES += echoplugin.json
TARGET = $$qtLibraryTarget(echoplugin)
DESTDIR = ../plugins
#! [0]

View File

@ -96,14 +96,18 @@ public:
QT_BEGIN_NAMESPACE
//! [3] //! [4]
Q_DECLARE_INTERFACE(BrushInterface,
"com.trolltech.PlugAndPaint.BrushInterface/1.0")
#define BrushInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface"
Q_DECLARE_INTERFACE(BrushInterface, BrushInterface_iid)
//! [3]
Q_DECLARE_INTERFACE(ShapeInterface,
"com.trolltech.PlugAndPaint.ShapeInterface/1.0")
#define ShapeInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.ShapeInterface"
Q_DECLARE_INTERFACE(ShapeInterface, ShapeInterface_iid)
//! [5]
Q_DECLARE_INTERFACE(FilterInterface,
"com.trolltech.PlugAndPaint.FilterInterface/1.0")
#define FilterInterface_iid "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface"
Q_DECLARE_INTERFACE(FilterInterface, FilterInterface_iid)
//! [4] //! [5]
QT_END_NAMESPACE

View File

@ -43,9 +43,7 @@
#include <QtPlugin>
#include <QApplication>
QT_BEGIN_NAMESPACE
Q_IMPORT_PLUGIN(pnp_basictools)
QT_END_NAMESPACE
Q_IMPORT_PLUGIN(BasicToolsPlugin)
int main(int argc, char *argv[])
{

View File

@ -0,0 +1 @@
{}

View File

@ -4,6 +4,7 @@ CONFIG += plugin static
INCLUDEPATH += ../..
HEADERS = basictoolsplugin.h
SOURCES = basictoolsplugin.cpp
OTHER_FILES += basictools.json
TARGET = $$qtLibraryTarget(pnp_basictools)
DESTDIR = ../../plugandpaint/plugins
#! [0]

View File

@ -189,9 +189,3 @@ QImage BasicToolsPlugin::filterImage(const QString &filter, const QImage &image,
return result;
}
//! [8]
QT_BEGIN_NAMESPACE
//! [9]
Q_EXPORT_PLUGIN2(pnp_basictools, BasicToolsPlugin)
//! [9]
QT_END_NAMESPACE

View File

@ -43,6 +43,7 @@
#include <QRect>
#include <QObject>
#include <QtPlugin>
#include <QStringList>
#include <QPainterPath>
#include <QImage>
@ -57,6 +58,7 @@ class BasicToolsPlugin : public QObject,
public FilterInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.BrushInterface" FILE "basictools.json")
Q_INTERFACES(BrushInterface ShapeInterface FilterInterface)
//! [0]

View File

@ -4,6 +4,7 @@ CONFIG += plugin
INCLUDEPATH += ../..
HEADERS = extrafiltersplugin.h
SOURCES = extrafiltersplugin.cpp
OTHER_FILES += extrafilters.json
TARGET = $$qtLibraryTarget(pnp_extrafilters)
DESTDIR = ../../plugandpaint/plugins

View File

@ -120,5 +120,3 @@ QImage ExtraFiltersPlugin::filterImage(const QString &filter,
}
return result;
}
Q_EXPORT_PLUGIN2(pnp_extrafilters, ExtraFiltersPlugin)

View File

@ -43,6 +43,7 @@
//! [0]
#include <QObject>
#include <QtPlugin>
#include <QStringList>
#include <QImage>
@ -51,6 +52,7 @@
class ExtraFiltersPlugin : public QObject, public FilterInterface
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.PlugAndPaint.FilterInterface" FILE "extrafilters.json")
Q_INTERFACES(FilterInterface)
public:

View File

@ -5,6 +5,7 @@ HEADERS = simplestyle.h \
simplestyleplugin.h
SOURCES = simplestyle.cpp \
simplestyleplugin.cpp
OTHER_FILES += simplestyle.json
TARGET = simplestyleplugin
#! [0]
win32 {

View File

@ -0,0 +1,3 @@
{
"Keys": [ "simplestyle" ]
}

View File

@ -58,7 +58,3 @@ QStyle *SimpleStylePlugin::create(const QString &key)
return 0;
}
//! [1]
QT_BEGIN_NAMESPACE
Q_EXPORT_PLUGIN2(simplestyleplugin, SimpleStylePlugin)
QT_END_NAMESPACE

View File

@ -52,9 +52,10 @@ QT_END_NAMESPACE
class SimpleStylePlugin : public QStylePlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QStyleFactoryInterface" FILE "simplestyle.json")
public:
SimpleStylePlugin() {};
SimpleStylePlugin() {}
QStringList keys() const;
QStyle *create(const QString &key);

View File

@ -1,16 +1,8 @@
######################################################################
# Automatically generated by qmake (2.01a) Tue Nov 28 13:20:04 2006
######################################################################
TEMPLATE = app
TARGET = validators
DEPENDPATH += .
INCLUDEPATH += .
QT += widgets
FORMS += validators.ui
RESOURCES += validators.qrc
# Input
SOURCES += main.cpp ledwidget.cpp localeselector.cpp
HEADERS += ledwidget.h localeselector.h
@ -20,6 +12,4 @@ sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS *.pro *.png
sources.path = $$[QT_INSTALL_EXAMPLES]/qtbase/widgets/validators
INSTALLS += target sources
QT += widgets
simulator: warning(This example might not fully work on Simulator platform)

View File

@ -6,7 +6,12 @@ set(Qt5$${CMAKE_MODULE_NAME}_VERSION_MINOR "$$eval(QT.$${MODULE}.MINOR_VERSION)"
set(Qt5$${CMAKE_MODULE_NAME}_VERSION_PATCH "$$eval(QT.$${MODULE}.PATCH_VERSION)")
set(Qt5$${CMAKE_MODULE_NAME}_LIBRARIES Qt5::$${CMAKE_MODULE_NAME})
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${_qt5_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_install_prefix}/$$CMAKE_INCLUDE_DIR/Qt$${CMAKE_MODULE_NAME}\")
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${_qt5_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_install_prefix}/$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
!!ELSE
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
!!ENDIF
string(TOUPPER "$${CMAKE_MODULE_NAME}" _CMAKE_MODULE_NAME_UPPER)
set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -DQT_\${_CMAKE_MODULE_NAME_UPPER}_LIB)
@ -21,53 +26,69 @@ foreach(_module_dep ${_Qt5_MODULE_DEPENDENCIES})
list(APPEND Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${Qt5${_module_dep}_INCLUDE_DIRS})
list(APPEND Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS ${Qt5${_module_dep}_DEFINITIONS})
list(APPEND Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS ${Qt5${_module_dep}_COMPILE_DEFINITIONS})
list(APPEND Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS ${Qt5${_module_dep}_EXECUTABLE_COMPILE_FLAGS})
endforeach()
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS)
if (Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
endif()
if (NOT _Qt5$${CMAKE_MODULE_NAME}_target)
set(_Qt5$${CMAKE_MODULE_NAME}_target 1)
if (\"$${CMAKE_STATIC_TYPE}\" STREQUAL \"\")
add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
else()
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
endif()
if (NOT \"$${CMAKE_BUILD_IS_FRAMEWORK}\" STREQUAL \"\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
endif()
!!IF !isEmpty(CMAKE_STATIC_TYPE)
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
!!ELSE
add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
!!ENDIF
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
!!ENDIF
endif()
if (NOT \"$${debug_type}\" STREQUAL \"\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG \"$${CMAKE_QT5_MODULE_DEPS}\"
IMPORTED_LOCATION_DEBUG \"${_qt5_install_prefix}/$$CMAKE_LIB_DIR/$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
)
if (NOT \"$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\" STREQUAL \"\")
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_IMPLIB_DEBUG \"${_qt5_install_prefix}/$$CMAKE_LIB_DIR/$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\"
)
endif()
endif()
!!IF !isEmpty(debug_type)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG \"$${CMAKE_QT5_MODULE_DEPS}\"
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_DEBUG \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
!!ELSE
IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
!!ENDIF
)
!!IF !isEmpty(CMAKE_IMPLIB_FILE_LOCATION_DEBUG)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_IMPLIB_DEBUG \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\"
)
!!ENDIF
!!ENDIF
if (NOT \"$${release_type}\" STREQUAL \"\")
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE \"$${CMAKE_QT5_MODULE_DEPS}\"
IMPORTED_LOCATION_RELEASE \"${_qt5_install_prefix}/$$CMAKE_LIB_DIR/$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
)
if (NOT \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" STREQUAL \"\")
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_IMPLIB_RELEASE \"${_qt5_install_prefix}/$$CMAKE_LIB_DIR/$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\"
)
endif()
endif()
!!IF !isEmpty(release_type)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE \"$${CMAKE_QT5_MODULE_DEPS}\"
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
!!ELSE
IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
!!ENDIF
)
!!IF !isEmpty(CMAKE_IMPLIB_FILE_LOCATION_RELEASE)
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_IMPLIB_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\"
!!ELSE
IMPORTED_IMPLIB_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\"
!!ENDIF
)
!!ENDIF
!!ENDIF
if (NOT \"$${CMAKE_MODULE_EXTRAS}\" STREQUAL \"\")
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
endif()
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
!!ENDIF
if (NOT \"$${CMAKE_MODULE_MACROS}\" STREQUAL \"\")
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
endif()
!!IF !isEmpty(CMAKE_MODULE_MACROS)
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
!!ENDIF

View File

@ -15,6 +15,7 @@ QMAKE_CFLAGS_RELEASE += -O2
QMAKE_CFLAGS_DEBUG += -g
QMAKE_CFLAGS_SHLIB += -fPIC
QMAKE_CFLAGS_STATIC_LIB += -fPIC
QMAKE_CFLAGS_APP += -fPIE
QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses
QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden
@ -26,6 +27,7 @@ QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
QMAKE_CXXFLAGS_APP += $$QMAKE_CFLAGS_APP
QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC
QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden

View File

@ -21,13 +21,40 @@ CMAKE_MODULE_DEPS = $$cmakeModuleList($$eval(QT.$${MODULE}.depends))
CMAKE_PARTIAL_MODULE_DEPS = $$replace(CMAKE_MODULE_DEPS, ";", ";Qt5::")
!isEmpty(CMAKE_PARTIAL_MODULE_DEPS):CMAKE_QT5_MODULE_DEPS = "Qt5::$${CMAKE_PARTIAL_MODULE_DEPS}"
CMAKE_INCLUDE_DIR = include
CMAKE_LIBS = $$eval(QT.$${MODULE}.libs)
CMAKE_LIB_DIR = $$replace(CMAKE_LIBS, ^.*/, )
CMAKE_BINS = $$eval(QT.$${MODULE}.bins)
CMAKE_BIN_DIR = $$replace(CMAKE_BINS, ^.*/, )
CMAKE_QT_INSTALL_PREFIX = $$replace($$list($$[QT_INSTALL_PREFIX]), \\\\, /)/
CMAKE_QT_INSTALL_PREFIX_ESCAPED = "^$$re_escape($$CMAKE_QT_INSTALL_PREFIX)"
CMAKE_RELATIVE_INSTALL_DIR = "../../../"
CMAKE_INCLUDE_DIR = $$[QT_INSTALL_HEADERS]
contains(CMAKE_INCLUDE_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
CMAKE_INCLUDE_DIR = $$replace(CMAKE_INCLUDE_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
} else {
CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True
}
CMAKE_LIB_DIR = $$replace($$list($$[QT_INSTALL_LIBS]), \\\\, /)/
contains(CMAKE_LIB_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
CMAKE_LIB_DIR = $$replace(CMAKE_LIB_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
CMAKE_RELATIVE_INSTALL_DIR = $$replace(CMAKE_LIB_DIR, "[^/]+", ..)
# We need to go up another two levels because the CMake files are
# installed in $${CMAKE_LIB_DIR}/cmake/Qt5$${CMAKE_MODULE_NAME}
CMAKE_RELATIVE_INSTALL_DIR = "$${CMAKE_RELATIVE_INSTALL_DIR}../../"
} else {
CMAKE_LIB_DIR_IS_ABSOLUTE = True
}
CMAKE_BIN_DIR = $$replace($$list($$[QT_INSTALL_BINS]), \\\\, /)/
contains(CMAKE_BIN_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
CMAKE_BIN_DIR = $$replace(CMAKE_BIN_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
} else {
CMAKE_BIN_DIR_IS_ABSOLUTE = True
}
CMAKE_DATA_DIR = $$replace($$list($$[QT_INSTALL_DATA]), \\\\, /)/ # For the mkspecs
contains(CMAKE_DATA_DIR, "$${CMAKE_QT_INSTALL_PREFIX_ESCAPED}.*") {
CMAKE_DATA_DIR = $$replace(CMAKE_DATA_DIR, "$$CMAKE_QT_INSTALL_PREFIX_ESCAPED", )
} else {
CMAKE_DATA_DIR_IS_ABSOLUTE = True
}
static|staticlib:CMAKE_STATIC_TYPE = true
@ -48,16 +75,35 @@ macx {
}
}
} else:win32 {
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d.lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.lib
} else {
CMAKE_LIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
CMAKE_LIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
}
CMAKE_WINDOWS_BUILD = "true"
CMAKE_BIN_SUFFIX = ".exe"
CMAKE_LIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
CMAKE_LIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).dll
win32-g++ {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = libqtmain$${QT_LIBINFIX}d.a
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = libqtmain$${QT_LIBINFIX}.a
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d.a
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a
} else {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).a
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).a
}
} else {
CMAKE_WINMAIN_FILE_LOCATION_DEBUG = qtmain$${QT_LIBINFIX}d.lib
CMAKE_WINMAIN_FILE_LOCATION_RELEASE = qtmain$${QT_LIBINFIX}.lib
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d.lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.lib
} else {
CMAKE_IMPLIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}d$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
CMAKE_IMPLIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}$$eval(QT.$${MODULE}.MAJOR_VERSION).lib
}
}
} else {
!isEmpty(CMAKE_STATIC_TYPE) {
CMAKE_LIB_FILE_LOCATION_DEBUG = libQt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.a

View File

@ -0,0 +1,2 @@
QMAKE_LIBS_OPENGL_ES2 =
LIBS += $$QMAKE_LIBS_OPENGL_ES1

View File

@ -131,7 +131,7 @@ QT = $$sort_depends(QT, "QT.")
QT_DEPENDS=
unset(using_privates)
for(QTLIB, $$list($$lower($$unique(QT)))) {
for(QTLIB, QT) {
# Figure out if we're wanting to use the private headers of a module
contains(QTLIB, .*-private) {
QTLIB ~= s/-private//

View File

@ -6,9 +6,10 @@ exists($$_QMAKE_CACHE_) {
QMAKE_EXTRA_MODULE_FORWARDS = $$fromfile($$_QMAKE_CACHE_, QMAKE_EXTRA_MODULE_FORWARDS)
}
isEmpty(QMAKE_QT_CONFIG)|!exists($$QMAKE_QT_CONFIG) {
!isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE/mkspecs/qconfig.pri
else:exists($$_QMAKE_CACHE_):infile($$_QMAKE_CACHE_, QT_BUILD_TREE):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)/mkspecs/qconfig.pri
isEmpty(QMAKE_QT_CONFIG):exists($$[QT_INSTALL_DATA]/mkspecs/qconfig.pri):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]/mkspecs/qconfig.pri
!isEmpty(QT_BUILD_TREE):QMAKE_QT_CONFIG = $$QT_BUILD_TREE
else:exists($$_QMAKE_CACHE_):QMAKE_QT_CONFIG = $$fromfile($$_QMAKE_CACHE_, QT_BUILD_TREE)
isEmpty(QMAKE_QT_CONFIG):QMAKE_QT_CONFIG = $$[QT_INSTALL_DATA]
QMAKE_QT_CONFIG = $$QMAKE_QT_CONFIG/mkspecs/qconfig.pri
}
!exists($$QMAKE_QT_CONFIG)|!include($$QMAKE_QT_CONFIG, "", true) {
debug(1, "Cannot load qconfig.pri!")

View File

@ -1,4 +1,4 @@
QMAKE_TARGET_COMPANY = Nokia Corporation and/or its subsidiary(-ies)
QMAKE_TARGET_PRODUCT = Qt4
QMAKE_TARGET_PRODUCT = Qt5
QMAKE_TARGET_DESCRIPTION = C++ application development framework.
QMAKE_TARGET_COPYRIGHT = Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).

View File

@ -2508,10 +2508,10 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(!in_directory.isEmpty()) {
t << mkdir_p_asstring(out_directory)
<< out_directory_cdin
<< "$(QMAKE) " << escapeFilePath(in) << buildArgs(in_directory) << " -o " << out
<< "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out
<< in_directory_cdout << endl;
} else {
t << "$(QMAKE) " << escapeFilePath(in) << buildArgs(in_directory) << " -o " << out << endl;
t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << endl;
}
t << subtarget->target << "-qmake_all: ";
if(project->isEmpty("QMAKE_NOFORCE"))
@ -2520,10 +2520,10 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
if(!in_directory.isEmpty()) {
t << mkdir_p_asstring(out_directory)
<< out_directory_cdin
<< "$(QMAKE) " << escapeFilePath(in) << buildArgs(in_directory) << " -o " << out
<< "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out
<< in_directory_cdout << endl;
} else {
t << "$(QMAKE) " << escapeFilePath(in) << buildArgs(in_directory) << " -o " << out << endl;
t << "$(QMAKE) " << in << buildArgs(in_directory) << " -o " << out << endl;
}
}
@ -3287,6 +3287,7 @@ MakefileGenerator::writePkgConfigFile()
} else {
pkgConfiglibDir = "-L${libdir}";
pkgConfiglibName = "-l" + lname.left(lname.length()-Option::libtool_ext.length());
pkgConfiglibName += project->first("TARGET_VERSION_EXT");
}
t << pkgConfiglibDir << " " << pkgConfiglibName << " " << endl;

View File

@ -85,12 +85,6 @@ ProjectGenerator::init()
templ.prepend(Option::user_template_prefix);
v["TEMPLATE_ASSIGN"] += templ;
//figure out target
if(Option::output.fileName() == "-")
v["TARGET_ASSIGN"] = QStringList("unknown");
else
v["TARGET_ASSIGN"] = QStringList(QFileInfo(Option::output).baseName());
//the scary stuff
if(project->first("TEMPLATE_ASSIGN") != "subdirs") {
QString builtin_regex = project_builtin_regx();
@ -360,6 +354,12 @@ ProjectGenerator::writeMakefile(QTextStream &t)
t << endl << "# Directories" << "\n"
<< getWritableVar("SUBDIRS");
} else {
//figure out target
QString ofn = QFileInfo(static_cast<QFile *>(t.device())->fileName()).completeBaseName();
if (ofn.isEmpty() || ofn == "-")
ofn = "unknown";
project->variables()["TARGET_ASSIGN"] = QStringList(ofn);
t << getWritableVar("TARGET_ASSIGN")
<< getWritableVar("CONFIG", false)
<< getWritableVar("CONFIG_REMOVE", false)

View File

@ -844,6 +844,12 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
QString dst_pc = pkgConfigFileName(false);
if (!dst_pc.isEmpty()) {
dst_pc = filePrefixRoot(root, targetdir + dst_pc);
const QString dst_pc_dir = fileInfo(dst_pc).path();
if (!dst_pc_dir.isEmpty()) {
if (!ret.isEmpty())
ret += "\n\t";
ret += mkdir_p_asstring(dst_pc_dir, true);
}
if(!ret.isEmpty())
ret += "\n\t";
ret += "-$(INSTALL_FILE) \"" + pkgConfigFileName(true) + "\" \"" + dst_pc + "\"";

View File

@ -163,6 +163,11 @@ int runQMake(int argc, char **argv)
fn = fn.right(fn.length() - di - 1);
}
if (!Option::prepareProject()) {
exit_val = 3;
break;
}
// read project..
if(!project.read(fn)) {
fprintf(stderr, "Error processing project file: %s\n",

View File

@ -116,6 +116,7 @@ bool Option::mkfile::do_dep_heuristics = true;
bool Option::mkfile::do_preprocess = false;
bool Option::mkfile::do_stub_makefile = false;
bool Option::mkfile::do_cache = true;
QString Option::mkfile::project_build_root;
QString Option::mkfile::cachefile;
QStringList Option::mkfile::project_files;
QString Option::mkfile::qmakespec_commandline;
@ -146,6 +147,14 @@ static QString detectProjectFile(const QString &path)
return ret;
}
static QString cleanSpec(const QString &spec)
{
QString ret = QDir::cleanPath(spec);
if (ret.contains('/'))
ret = QDir::cleanPath(QFileInfo(ret).absoluteFilePath());
return ret;
}
QString project_builtin_regx();
bool usage(const char *a0)
{
@ -314,7 +323,7 @@ Option::parseCommandLine(int argc, char **argv, int skip)
} else if(opt == "cache") {
Option::mkfile::cachefile = argv[++x];
} else if(opt == "platform" || opt == "spec") {
Option::mkfile::qmakespec = argv[++x];
Option::mkfile::qmakespec = cleanSpec(argv[++x]);
Option::mkfile::qmakespec_commandline = argv[x];
} else {
fprintf(stderr, "***Unknown option -%s\n", opt.toLatin1().constData());
@ -567,6 +576,34 @@ void Option::applyHostMode()
}
}
bool Option::prepareProject()
{
mkfile::project_build_root.clear();
if (mkfile::do_cache) {
if (mkfile::cachefile.isEmpty()) { //find it as it has not been specified
QDir dir(output_dir);
while (!dir.exists(QLatin1String(".qmake.cache")))
if (dir.isRoot() || !dir.cdUp())
goto no_cache;
mkfile::cachefile = dir.filePath(QLatin1String(".qmake.cache"));
mkfile::project_build_root = dir.path();
} else {
QFileInfo fi(mkfile::cachefile);
mkfile::cachefile = QDir::cleanPath(fi.absoluteFilePath());
mkfile::project_build_root = QDir::cleanPath(fi.absolutePath());
}
if (mkfile::qmakespec.isEmpty()) {
QMakeProject cproj;
if (!cproj.read(mkfile::cachefile, QMakeProject::ReadProFile))
return false;
mkfile::qmakespec = cproj.first(QLatin1String("QMAKESPEC"));
}
}
no_cache:
return true;
}
bool Option::postProcessProject(QMakeProject *project)
{
Option::cpp_ext = project->variables()["QMAKE_EXT_CPP"];

View File

@ -108,6 +108,7 @@ struct Option
//both of these must be called..
static int init(int argc=0, char **argv=0); //parse cmdline
static void applyHostMode();
static bool prepareProject();
static bool postProcessProject(QMakeProject *);
enum StringFixFlags {
@ -201,6 +202,7 @@ struct Option
static bool do_dep_heuristics;
static bool do_preprocess;
static bool do_stub_makefile;
static QString project_build_root;
static QString cachefile;
static int cachefile_depth;
static QStringList project_files;

View File

@ -590,10 +590,6 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
}
}
}
for(QStringList::Iterator concat_it = concat.begin();
concat_it != concat.end(); ++concat_it)
feature_roots << (QLibraryInfo::location(QLibraryInfo::PrefixPath) +
mkspecs_concat + (*concat_it));
for(QStringList::Iterator concat_it = concat.begin();
concat_it != concat.end(); ++concat_it)
feature_roots << (QLibraryInfo::location(QLibraryInfo::DataPath) +
@ -1285,35 +1281,9 @@ QMakeProject::read(uchar cmd)
base_vars["TEMPLATE_PREFIX"] = QStringList(Option::user_template_prefix);
if ((cmd & ReadSetup) && Option::mkfile::do_cache) { // parse the cache
int cache_depth = -1;
QString qmake_cache = Option::mkfile::cachefile;
if(qmake_cache.isEmpty()) { //find it as it has not been specified
QString dir = Option::output_dir;
while(!QFile::exists((qmake_cache = dir + QLatin1String("/.qmake.cache")))) {
dir = dir.left(dir.lastIndexOf(QLatin1Char('/')));
if(dir.isEmpty() || dir.indexOf(QLatin1Char('/')) == -1) {
qmake_cache = "";
break;
}
if(cache_depth == -1)
cache_depth = 1;
else
cache_depth++;
}
} else {
QString abs_cache = QFileInfo(Option::mkfile::cachefile).absoluteDir().path();
if(Option::output_dir.startsWith(abs_cache))
cache_depth = Option::output_dir.mid(abs_cache.length()).count('/');
}
if(!qmake_cache.isEmpty()) {
QHash<QString, QStringList> cache;
if(read(qmake_cache, cache)) {
Option::mkfile::cachefile_depth = cache_depth;
Option::mkfile::cachefile = qmake_cache;
if(Option::mkfile::qmakespec.isEmpty() && !cache["QMAKESPEC"].isEmpty())
Option::mkfile::qmakespec = cache["QMAKESPEC"].first();
}
}
if (Option::output_dir.startsWith(Option::mkfile::project_build_root))
Option::mkfile::cachefile_depth =
Option::output_dir.mid(Option::mkfile::project_build_root.length()).count('/');
}
if (cmd & ReadSetup) { // parse mkspec
QString qmakespec = fixEnvVariables(Option::mkfile::qmakespec);
@ -1444,16 +1414,6 @@ QMakeProject::read(uchar cmd)
parse("CONFIG += " + Option::after_user_configs.join(" "), vars);
}
if(pfile != "-" && vars["TARGET"].isEmpty())
vars["TARGET"].append(QFileInfo(pfile).baseName());
if ((cmd & ReadSetup) && !Option::user_configs.isEmpty()) {
parser.file = "(configs)";
parser.from_file = false;
parser.line_no = 1; //really arg count now.. duh
parse("CONFIG += " + Option::user_configs.join(" "), base_vars);
}
if(cmd & ReadFeatures) {
debug_msg(1, "Processing default_post: %s", vars["CONFIG"].join("::").toLatin1().constData());
doProjectInclude("default_post", IncludeFlagFeature, vars);
@ -1519,6 +1479,36 @@ void QMakeProject::validateModes()
}
}
void
QMakeProject::resolveSpec(QString *spec, const QString &qmakespec)
{
if (spec->isEmpty()) {
*spec = QFileInfo(qmakespec).fileName();
if (*spec == "default") {
#ifdef Q_OS_UNIX
char buffer[1024];
int l = readlink(qmakespec.toLatin1(), buffer, 1023);
if (l != -1) {
buffer[l] = '\0';
*spec = QString::fromLatin1(buffer);
#else
// We can't resolve symlinks as they do on Unix, so configure.exe puts the source of the
// qmake.conf at the end of the default/qmake.conf in the QMAKESPEC_ORG variable.
const QStringList &spec_org = base_vars["QMAKESPEC_ORIGINAL"];
if (spec_org.isEmpty()) {
// try again the next time around
*spec = QString();
} else {
*spec = spec_org.at(0);
#endif
int lastSlash = spec->lastIndexOf(QLatin1Char('/'));
if (lastSlash != -1)
spec->remove(0, lastSlash + 1);
}
}
}
}
bool
QMakeProject::isActiveConfig(const QString &x, bool regex, QHash<QString, QStringList> *place)
{
@ -1545,44 +1535,10 @@ QMakeProject::isActiveConfig(const QString &x, bool regex, QHash<QString, QStrin
//mkspecs
static QString spec;
if(spec.isEmpty())
spec = QFileInfo(Option::mkfile::qmakespec).fileName();
resolveSpec(&spec, Option::mkfile::qmakespec);
QRegExp re(x, Qt::CaseSensitive, QRegExp::Wildcard);
if((regex && re.exactMatch(spec)) || (!regex && spec == x))
return true;
#ifdef Q_OS_UNIX
else if(spec == "default") {
static char *buffer = NULL;
if(!buffer) {
buffer = (char *)malloc(1024);
qmakeAddCacheClear(qmakeFreeCacheClear, (void**)&buffer);
}
int l = readlink(Option::mkfile::qmakespec.toLatin1(), buffer, 1024);
if(l != -1) {
buffer[l] = '\0';
QString r = buffer;
if(r.lastIndexOf('/') != -1)
r = r.mid(r.lastIndexOf('/') + 1);
if((regex && re.exactMatch(r)) || (!regex && r == x))
return true;
}
}
#elif defined(Q_OS_WIN)
else if(spec == "default") {
// We can't resolve symlinks as they do on Unix, so configure.exe puts the source of the
// qmake.conf at the end of the default/qmake.conf in the QMAKESPEC_ORG variable.
const QStringList &spec_org = (place ? (*place)["QMAKESPEC_ORIGINAL"]
: vars["QMAKESPEC_ORIGINAL"]);
if (!spec_org.isEmpty()) {
spec = spec_org.at(0);
int lastSlash = spec.lastIndexOf('/');
if(lastSlash != -1)
spec = spec.mid(lastSlash + 1);
if((regex && re.exactMatch(spec)) || (!regex && spec == x))
return true;
}
}
#endif
//simple matching
const QStringList &configs = (place ? (*place)["CONFIG"] : vars["CONFIG"]);
@ -1726,9 +1682,6 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString
warn_msg(WarnParser, "%s:%d: QtScript support disabled for %s.",
pi.file.toLatin1().constData(), pi.line_no, orig_file.toLatin1().constData());
} else {
QStack<ScopeBlock> sc = scope_blocks;
IteratorBlock *it = iterator;
FunctionBlock *fu = function;
if(flags & (IncludeFlagNewProject|IncludeFlagNewParser)) {
// The "project's variables" are used in other places (eg. export()) so it's not
// possible to use "place" everywhere. Instead just set variables and grab them later
@ -1744,11 +1697,14 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString
}
place = proj.variables();
} else {
QStack<ScopeBlock> sc = scope_blocks;
IteratorBlock *it = iterator;
FunctionBlock *fu = function;
parsed = read(file, place);
iterator = it;
function = fu;
scope_blocks = sc;
}
iterator = it;
function = fu;
scope_blocks = sc;
}
if(parsed) {
if(place["QMAKE_INTERNAL_INCLUDED_FILES"].indexOf(orig_file) == -1)

View File

@ -108,6 +108,7 @@ class QMakeProject
void init(QMakeProperty *, const QHash<QString, QStringList> *);
QStringList &values(const QString &v, QHash<QString, QStringList> &place);
void validateModes();
void resolveSpec(QString *spec, const QString &qmakespec);
public:
QMakeProject() { init(0, 0); }

View File

@ -92,7 +92,7 @@ bootstrap { #Qt code
qdir_p.h \
qdiriterator.h \
qfile.h \
qabstractfileengine.h \
qabstractfileengine_p.h \
qfileinfo.h \
qglobal.h \
qnumeric.h \

View File

@ -265,6 +265,34 @@ static inline void positionCluster(HB_ShaperItem *item, int gfrom, int glast)
//qreal offsetBase = (size - 4) / 4 + qMin<qreal>(size, 4) + 1;
// qDebug("offset = %f", offsetBase);
// To fix some Thai character heights check for two above glyphs
if (nmarks == 2 && (attributes[gfrom+1].combiningClass == HB_Combining_AboveRight ||
attributes[gfrom+1].combiningClass == HB_Combining_AboveLeft ||
attributes[gfrom+1].combiningClass == HB_Combining_Above))
if (attributes[gfrom+2].combiningClass == 23 ||
attributes[gfrom+2].combiningClass == 24 ||
attributes[gfrom+2].combiningClass == 25 ||
attributes[gfrom+2].combiningClass == 27 ||
attributes[gfrom+2].combiningClass == 28 ||
attributes[gfrom+2].combiningClass == 30 ||
attributes[gfrom+2].combiningClass == 31 ||
attributes[gfrom+2].combiningClass == 33 ||
attributes[gfrom+2].combiningClass == 34 ||
attributes[gfrom+2].combiningClass == 35 ||
attributes[gfrom+2].combiningClass == 36 ||
attributes[gfrom+2].combiningClass == 107 ||
attributes[gfrom+2].combiningClass == 122) {
// Two above glyphs, check total height
int markTotalHeight = baseMetrics.height;
HB_GlyphMetrics markMetrics;
item->font->klass->getGlyphMetrics(item->font, glyphs[gfrom+1], &markMetrics);
markTotalHeight += markMetrics.height;
item->font->klass->getGlyphMetrics(item->font, glyphs[gfrom+2], &markMetrics);
markTotalHeight += markMetrics.height;
if ((markTotalHeight + 2 * offsetBase) > (size * 10))
offsetBase = ((size * 10) - markTotalHeight) / 2; // Use offset that just fits
}
bool rightToLeft = item->item.bidiLevel % 2;
int i;

View File

@ -74,10 +74,10 @@ static void to_tis620(const HB_UChar16 *string, hb_uint32 len, const char *cstr)
for (i = 0; i < len; ++i) {
if (string[i] <= 0xa0)
result[i] = (unsigned char)string[i];
if (string[i] >= 0xe01 && string[i] <= 0xe5b)
else if (string[i] >= 0xe01 && string[i] <= 0xe5b)
result[i] = (unsigned char)(string[i] - 0xe00 + 0xa0);
else
result[i] = '?';
result[i] = (unsigned char)~0; // Same encoding as libthai uses for invalid chars
}
result[len] = 0;
@ -259,8 +259,13 @@ static HB_Bool HB_ThaiConvertStringToGlyphIndices (HB_ShaperItem *item)
for (int lgi = 0; lgi < lgn; lgi++) {
if ( rglyphs[lgi] == 0xdd/*TH_BLANK_BASE_GLYPH*/ ) {
glyphString[slen++] = C_DOTTED_CIRCLE;
}
else {
} else if (cstr[i] == (signed char)~0) {
// The only glyphs that should be passed to this function that cannot be mapped to
// tis620 are the ones of type Inherited class. Pass these glyphs untouched.
glyphString[slen++] = string[i];
if (string[i] == 0x200D || string[i] == 0x200C)
item->attributes[slen-1].dontPrint = true; // Hide ZWJ and ZWNJ characters
} else {
glyphString[slen++] = (HB_UChar16) thai_get_glyph_index (font_type, rglyphs[lgi]);
}
}
@ -353,7 +358,7 @@ HB_Bool HB_ThaiShape (HB_ShaperItem *shaper_item)
const int availableGlyphs = shaper_item->num_glyphs;
if ( HB_SelectScript (shaper_item, thai_features) ) {
HB_OpenTypeShape (shaper_item, /*properties*/0);
return HB_OpenTypePosition (shaper_item, availableGlyphs, /*doLogClusters*/false);
return HB_OpenTypePosition (shaper_item, availableGlyphs, /*doLogClusters*/true);
}
#endif

28
src/3rdparty/rfc6234/sha-private.h vendored Normal file
View File

@ -0,0 +1,28 @@
/************************ sha-private.h ************************/
/***************** See RFC 6234 for details. *******************/
#ifndef _SHA_PRIVATE__H
#define _SHA_PRIVATE__H
/*
* These definitions are defined in FIPS 180-3, section 4.1.
* Ch() and Maj() are defined identically in sections 4.1.1,
* 4.1.2, and 4.1.3.
*
* The definitions used in FIPS 180-3 are as follows:
*/
#ifndef USE_MODIFIED_MACROS
#define SHA_Ch(x,y,z) (((x) & (y)) ^ ((~(x)) & (z)))
#define SHA_Maj(x,y,z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z)))
#else /* USE_MODIFIED_MACROS */
/*
* The following definitions are equivalent and potentially faster.
*/
#define SHA_Ch(x, y, z) (((x) & ((y) ^ (z))) ^ (z))
#define SHA_Maj(x, y, z) (((x) & ((y) | (z))) | ((y) & (z)))
#endif /* USE_MODIFIED_MACROS */
#define SHA_Parity(x, y, z) ((x) ^ (y) ^ (z))
#endif /* _SHA_PRIVATE__H */

357
src/3rdparty/rfc6234/sha.h vendored Normal file
View File

@ -0,0 +1,357 @@
/**************************** sha.h ****************************/
/***************** See RFC 6234 for details. *******************/
/*
Copyright (c) 2011 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
- Redistributions of source code must retain the above
copyright notice, this list of conditions and
the following disclaimer.
- Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
- Neither the name of Internet Society, IETF or IETF Trust, nor
the names of specific contributors, may be used to endorse or
promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _SHA_H_
#define _SHA_H_
/*
* Description:
* This file implements the Secure Hash Algorithms
* as defined in the U.S. National Institute of Standards
* and Technology Federal Information Processing Standards
* Publication (FIPS PUB) 180-3 published in October 2008
* and formerly defined in its predecessors, FIPS PUB 180-1
* and FIP PUB 180-2.
*
* A combined document showing all algorithms is available at
* http://csrc.nist.gov/publications/fips/
* fips180-3/fips180-3_final.pdf
*
* The five hashes are defined in these sizes:
* SHA-1 20 byte / 160 bit
* SHA-224 28 byte / 224 bit
* SHA-256 32 byte / 256 bit
* SHA-384 48 byte / 384 bit
* SHA-512 64 byte / 512 bit
*
* Compilation Note:
* These files may be compiled with two options:
* USE_32BIT_ONLY - use 32-bit arithmetic only, for systems
* without 64-bit integers
*
* USE_MODIFIED_MACROS - use alternate form of the SHA_Ch()
* and SHA_Maj() macros that are equivalent
* and potentially faster on many systems
*
*/
// stdint.h include commented out by Nokia, it is not available on all platforms.
// #include <stdint.h>
/*
* If you do not have the ISO standard stdint.h header file, then you
* must typedef the following:
* name meaning
* uint64_t unsigned 64-bit integer
* uint32_t unsigned 32-bit integer
* uint8_t unsigned 8-bit integer (i.e., unsigned char)
* int_least16_t integer of >= 16 bits
*
* See stdint-example.h
*/
#ifndef _SHA_enum_
#define _SHA_enum_
/*
* All SHA functions return one of these values.
*/
enum {
shaSuccess = 0,
shaNull, /* Null pointer parameter */
shaInputTooLong, /* input data too long */
shaStateError, /* called Input after FinalBits or Result */
shaBadParam /* passed a bad parameter */
};
#endif /* _SHA_enum_ */
/*
* These constants hold size information for each of the SHA
* hashing operations
*/
enum {
SHA1_Message_Block_Size = 64, SHA224_Message_Block_Size = 64,
SHA256_Message_Block_Size = 64, SHA384_Message_Block_Size = 128,
SHA512_Message_Block_Size = 128,
USHA_Max_Message_Block_Size = SHA512_Message_Block_Size,
SHA1HashSize = 20, SHA224HashSize = 28, SHA256HashSize = 32,
SHA384HashSize = 48, SHA512HashSize = 64,
USHAMaxHashSize = SHA512HashSize,
SHA1HashSizeBits = 160, SHA224HashSizeBits = 224,
SHA256HashSizeBits = 256, SHA384HashSizeBits = 384,
SHA512HashSizeBits = 512, USHAMaxHashSizeBits = SHA512HashSizeBits
};
/*
* These constants are used in the USHA (Unified SHA) functions.
*/
typedef enum SHAversion {
SHA1, SHA224, SHA256, SHA384, SHA512
} SHAversion;
/*
* This structure will hold context information for the SHA-1
* hashing operation.
*/
typedef struct SHA1Context {
uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */
uint32_t Length_High; /* Message length in bits */
uint32_t Length_Low; /* Message length in bits */
int_least16_t Message_Block_Index; /* Message_Block array index */
/* 512-bit message blocks */
uint8_t Message_Block[SHA1_Message_Block_Size];
int Computed; /* Is the hash computed? */
int Corrupted; /* Cumulative corruption code */
} SHA1Context;
/*
* This structure will hold context information for the SHA-256
* hashing operation.
*/
typedef struct SHA256Context {
uint32_t Intermediate_Hash[SHA256HashSize/4]; /* Message Digest */
uint32_t Length_High; /* Message length in bits */
uint32_t Length_Low; /* Message length in bits */
int_least16_t Message_Block_Index; /* Message_Block array index */
/* 512-bit message blocks */
uint8_t Message_Block[SHA256_Message_Block_Size];
int Computed; /* Is the hash computed? */
int Corrupted; /* Cumulative corruption code */
} SHA256Context;
/*
* This structure will hold context information for the SHA-512
* hashing operation.
*/
typedef struct SHA512Context {
#ifdef USE_32BIT_ONLY
uint32_t Intermediate_Hash[SHA512HashSize/4]; /* Message Digest */
uint32_t Length[4]; /* Message length in bits */
#else /* !USE_32BIT_ONLY */
uint64_t Intermediate_Hash[SHA512HashSize/8]; /* Message Digest */
uint64_t Length_High, Length_Low; /* Message length in bits */
#endif /* USE_32BIT_ONLY */
int_least16_t Message_Block_Index; /* Message_Block array index */
/* 1024-bit message blocks */
uint8_t Message_Block[SHA512_Message_Block_Size];
int Computed; /* Is the hash computed?*/
int Corrupted; /* Cumulative corruption code */
} SHA512Context;
/*
* This structure will hold context information for the SHA-224
* hashing operation. It uses the SHA-256 structure for computation.
*/
typedef struct SHA256Context SHA224Context;
/*
* This structure will hold context information for the SHA-384
* hashing operation. It uses the SHA-512 structure for computation.
*/
typedef struct SHA512Context SHA384Context;
/*
* This structure holds context information for all SHA
* hashing operations.
*/
typedef struct USHAContext {
int whichSha; /* which SHA is being used */
union {
SHA1Context sha1Context;
SHA224Context sha224Context; SHA256Context sha256Context;
SHA384Context sha384Context; SHA512Context sha512Context;
} ctx;
} USHAContext;
/*
* This structure will hold context information for the HMAC
* keyed-hashing operation.
*/
typedef struct HMACContext {
int whichSha; /* which SHA is being used */
int hashSize; /* hash size of SHA being used */
int blockSize; /* block size of SHA being used */
USHAContext shaContext; /* SHA context */
unsigned char k_opad[USHA_Max_Message_Block_Size];
/* outer padding - key XORd with opad */
int Computed; /* Is the MAC computed? */
int Corrupted; /* Cumulative corruption code */
} HMACContext;
/*
* This structure will hold context information for the HKDF
* extract-and-expand Key Derivation Functions.
*/
typedef struct HKDFContext {
int whichSha; /* which SHA is being used */
HMACContext hmacContext;
int hashSize; /* hash size of SHA being used */
unsigned char prk[USHAMaxHashSize];
/* pseudo-random key - output of hkdfInput */
int Computed; /* Is the key material computed? */
int Corrupted; /* Cumulative corruption code */
} HKDFContext;
/*
* Function Prototypes
*/
/* SHA-1 */
extern int SHA1Reset(SHA1Context *);
extern int SHA1Input(SHA1Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA1FinalBits(SHA1Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA1Result(SHA1Context *,
uint8_t Message_Digest[SHA1HashSize]);
/* SHA-224 */
extern int SHA224Reset(SHA224Context *);
extern int SHA224Input(SHA224Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA224FinalBits(SHA224Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA224Result(SHA224Context *,
uint8_t Message_Digest[SHA224HashSize]);
/* SHA-256 */
extern int SHA256Reset(SHA256Context *);
extern int SHA256Input(SHA256Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA256FinalBits(SHA256Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA256Result(SHA256Context *,
uint8_t Message_Digest[SHA256HashSize]);
/* SHA-384 */
extern int SHA384Reset(SHA384Context *);
extern int SHA384Input(SHA384Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA384FinalBits(SHA384Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA384Result(SHA384Context *,
uint8_t Message_Digest[SHA384HashSize]);
/* SHA-512 */
extern int SHA512Reset(SHA512Context *);
extern int SHA512Input(SHA512Context *, const uint8_t *bytes,
unsigned int bytecount);
extern int SHA512FinalBits(SHA512Context *, uint8_t bits,
unsigned int bit_count);
extern int SHA512Result(SHA512Context *,
uint8_t Message_Digest[SHA512HashSize]);
/* Unified SHA functions, chosen by whichSha */
extern int USHAReset(USHAContext *context, SHAversion whichSha);
extern int USHAInput(USHAContext *context,
const uint8_t *bytes, unsigned int bytecount);
extern int USHAFinalBits(USHAContext *context,
uint8_t bits, unsigned int bit_count);
extern int USHAResult(USHAContext *context,
uint8_t Message_Digest[USHAMaxHashSize]);
extern int USHABlockSize(enum SHAversion whichSha);
extern int USHAHashSize(enum SHAversion whichSha);
extern int USHAHashSizeBits(enum SHAversion whichSha);
extern const char *USHAHashName(enum SHAversion whichSha);
/*
* HMAC Keyed-Hashing for Message Authentication, RFC 2104,
* for all SHAs.
* This interface allows a fixed-length text input to be used.
*/
extern int hmac(SHAversion whichSha, /* which SHA algorithm to use */
const unsigned char *text, /* pointer to data stream */
int text_len, /* length of data stream */
const unsigned char *key, /* pointer to authentication key */
int key_len, /* length of authentication key */
uint8_t digest[USHAMaxHashSize]); /* caller digest to fill in */
/*
* HMAC Keyed-Hashing for Message Authentication, RFC 2104,
* for all SHAs.
* This interface allows any length of text input to be used.
*/
extern int hmacReset(HMACContext *context, enum SHAversion whichSha,
const unsigned char *key, int key_len);
extern int hmacInput(HMACContext *context, const unsigned char *text,
int text_len);
extern int hmacFinalBits(HMACContext *context, uint8_t bits,
unsigned int bit_count);
extern int hmacResult(HMACContext *context,
uint8_t digest[USHAMaxHashSize]);
/*
* HKDF HMAC-based Extract-and-Expand Key Derivation Function,
* RFC 5869, for all SHAs.
*/
extern int hkdf(SHAversion whichSha, const unsigned char *salt,
int salt_len, const unsigned char *ikm, int ikm_len,
const unsigned char *info, int info_len,
uint8_t okm[ ], int okm_len);
extern int hkdfExtract(SHAversion whichSha, const unsigned char *salt,
int salt_len, const unsigned char *ikm,
int ikm_len, uint8_t prk[USHAMaxHashSize]);
extern int hkdfExpand(SHAversion whichSha, const uint8_t prk[ ],
int prk_len, const unsigned char *info,
int info_len, uint8_t okm[ ], int okm_len);
/*
* HKDF HMAC-based Extract-and-Expand Key Derivation Function,
* RFC 5869, for all SHAs.
* This interface allows any length of text input to be used.
*/
extern int hkdfReset(HKDFContext *context, enum SHAversion whichSha,
const unsigned char *salt, int salt_len);
extern int hkdfInput(HKDFContext *context, const unsigned char *ikm,
int ikm_len);
extern int hkdfFinalBits(HKDFContext *context, uint8_t ikm_bits,
unsigned int ikm_bit_count);
extern int hkdfResult(HKDFContext *context,
uint8_t prk[USHAMaxHashSize],
const unsigned char *info, int info_len,
uint8_t okm[USHAMaxHashSize], int okm_len);
#endif /* _SHA_H_ */

583
src/3rdparty/rfc6234/sha224-256.c vendored Normal file
View File

@ -0,0 +1,583 @@
/************************* sha224-256.c ************************/
/***************** See RFC 6234 for details. *******************/
/* Copyright (c) 2011 IETF Trust and the persons identified as */
/* authors of the code. All rights reserved. */
/* See sha.h for terms of use and redistribution. */
/*
* Description:
* This file implements the Secure Hash Algorithms SHA-224 and
* SHA-256 as defined in the U.S. National Institute of Standards
* and Technology Federal Information Processing Standards
* Publication (FIPS PUB) 180-3 published in October 2008
* and formerly defined in its predecessors, FIPS PUB 180-1
* and FIP PUB 180-2.
*
* A combined document showing all algorithms is available at
* http://csrc.nist.gov/publications/fips/
* fips180-3/fips180-3_final.pdf
*
* The SHA-224 and SHA-256 algorithms produce 224-bit and 256-bit
* message digests for a given data stream. It should take about
* 2**n steps to find a message with the same digest as a given
* message and 2**(n/2) to find any two messages with the same
* digest, when n is the digest size in bits. Therefore, this
* algorithm can serve as a means of providing a
* "fingerprint" for a message.
*
* Portability Issues:
* SHA-224 and SHA-256 are defined in terms of 32-bit "words".
* This code uses <stdint.h> (included via "sha.h") to define 32-
* and 8-bit unsigned integer types. If your C compiler does not
* support 32-bit unsigned integers, this code is not
* appropriate.
*
* Caveats:
* SHA-224 and SHA-256 are designed to work with messages less
* than 2^64 bits long. This implementation uses SHA224/256Input()
* to hash the bits that are a multiple of the size of an 8-bit
* octet, and then optionally uses SHA224/256FinalBits()
* to hash the final few bits of the input.
*/
#include "sha.h"
#include "sha-private.h"
/* Define the SHA shift, rotate left, and rotate right macros */
#define SHA256_SHR(bits,word) ((word) >> (bits))
#define SHA256_ROTL(bits,word) \
(((word) << (bits)) | ((word) >> (32-(bits))))
#define SHA256_ROTR(bits,word) \
(((word) >> (bits)) | ((word) << (32-(bits))))
/* Define the SHA SIGMA and sigma macros */
#define SHA256_SIGMA0(word) \
(SHA256_ROTR( 2,word) ^ SHA256_ROTR(13,word) ^ SHA256_ROTR(22,word))
#define SHA256_SIGMA1(word) \
(SHA256_ROTR( 6,word) ^ SHA256_ROTR(11,word) ^ SHA256_ROTR(25,word))
#define SHA256_sigma0(word) \
(SHA256_ROTR( 7,word) ^ SHA256_ROTR(18,word) ^ SHA256_SHR( 3,word))
#define SHA256_sigma1(word) \
(SHA256_ROTR(17,word) ^ SHA256_ROTR(19,word) ^ SHA256_SHR(10,word))
/*
* Add "length" to the length.
* Set Corrupted when overflow has occurred.
*/
/* addTemp commented out by Nokia, static variables are not thread-safe */
/* static uint32_t addTemp; */
/* 'M' appended to Macro name by Nokia */
#define SHA224_256AddLengthM(context, length) \
(addTemp = (context)->Length_Low, (context)->Corrupted = \
(((context)->Length_Low += (length)) < addTemp) && \
(++(context)->Length_High == 0) ? shaInputTooLong : \
(context)->Corrupted )
/* Local Function Prototypes */
static int SHA224_256Reset(SHA256Context *context, uint32_t *H0);
static void SHA224_256ProcessMessageBlock(SHA256Context *context);
static void SHA224_256Finalize(SHA256Context *context,
uint8_t Pad_Byte);
static void SHA224_256PadMessage(SHA256Context *context,
uint8_t Pad_Byte);
static int SHA224_256ResultN(SHA256Context *context,
uint8_t Message_Digest[ ], int HashSize);
/* Initial Hash Values: FIPS 180-3 section 5.3.2 */
static uint32_t SHA224_H0[SHA256HashSize/4] = {
0xC1059ED8, 0x367CD507, 0x3070DD17, 0xF70E5939,
0xFFC00B31, 0x68581511, 0x64F98FA7, 0xBEFA4FA4
};
/* Initial Hash Values: FIPS 180-3 section 5.3.3 */
static uint32_t SHA256_H0[SHA256HashSize/4] = {
0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A,
0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19
};
/*
* SHA224Reset
*
* Description:
* This function will initialize the SHA224Context in preparation
* for computing a new SHA224 message digest.
*
* Parameters:
* context: [in/out]
* The context to reset.
*
* Returns:
* sha Error Code.
*/
int SHA224Reset(SHA224Context *context)
{
return SHA224_256Reset(context, SHA224_H0);
}
/*
* SHA224Input
*
* Description:
* This function accepts an array of octets as the next portion
* of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* message_array[ ]: [in]
* An array of octets representing the next portion of
* the message.
* length: [in]
* The length of the message in message_array.
*
* Returns:
* sha Error Code.
*
*/
int SHA224Input(SHA224Context *context, const uint8_t *message_array,
unsigned int length)
{
return SHA256Input(context, message_array, length);
}
/*
* SHA224FinalBits
*
* Description:
* This function will add in any final bits of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* message_bits: [in]
* The final bits of the message, in the upper portion of the
* byte. (Use 0b###00000 instead of 0b00000### to input the
* three bits ###.)
* length: [in]
* The number of bits in message_bits, between 1 and 7.
*
* Returns:
* sha Error Code.
*/
int SHA224FinalBits(SHA224Context *context,
uint8_t message_bits, unsigned int length)
{
return SHA256FinalBits(context, message_bits, length);
}
/*
* SHA224Result
*
* Description:
* This function will return the 224-bit message digest
* into the Message_Digest array provided by the caller.
* NOTE:
* The first octet of hash is stored in the element with index 0,
* the last octet of hash in the element with index 27.
*
* Parameters:
* context: [in/out]
* The context to use to calculate the SHA hash.
* Message_Digest[ ]: [out]
* Where the digest is returned.
*
* Returns:
* sha Error Code.
*/
int SHA224Result(SHA224Context *context,
uint8_t Message_Digest[SHA224HashSize])
{
return SHA224_256ResultN(context, Message_Digest, SHA224HashSize);
}
/*
* SHA256Reset
*
* Description:
* This function will initialize the SHA256Context in preparation
* for computing a new SHA256 message digest.
*
* Parameters:
* context: [in/out]
* The context to reset.
*
* Returns:
* sha Error Code.
*/
int SHA256Reset(SHA256Context *context)
{
return SHA224_256Reset(context, SHA256_H0);
}
/*
* SHA256Input
*
* Description:
* This function accepts an array of octets as the next portion
* of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* message_array[ ]: [in]
* An array of octets representing the next portion of
* the message.
* length: [in]
* The length of the message in message_array.
*
* Returns:
* sha Error Code.
*/
int SHA256Input(SHA256Context *context, const uint8_t *message_array,
unsigned int length)
{
if (!context) return shaNull;
if (!length) return shaSuccess;
if (!message_array) return shaNull;
if (context->Computed) return context->Corrupted = shaStateError;
if (context->Corrupted) return context->Corrupted;
while (length--) {
context->Message_Block[context->Message_Block_Index++] =
*message_array;
if ((SHA224_256AddLength(context, 8) == shaSuccess) &&
(context->Message_Block_Index == SHA256_Message_Block_Size))
SHA224_256ProcessMessageBlock(context);
message_array++;
}
return context->Corrupted;
}
/*
* SHA256FinalBits
*
* Description:
* This function will add in any final bits of the message.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* message_bits: [in]
* The final bits of the message, in the upper portion of the
* byte. (Use 0b###00000 instead of 0b00000### to input the
* three bits ###.)
* length: [in]
* The number of bits in message_bits, between 1 and 7.
*
* Returns:
* sha Error Code.
*/
int SHA256FinalBits(SHA256Context *context,
uint8_t message_bits, unsigned int length)
{
static uint8_t masks[8] = {
/* 0 0b00000000 */ 0x00, /* 1 0b10000000 */ 0x80,
/* 2 0b11000000 */ 0xC0, /* 3 0b11100000 */ 0xE0,
/* 4 0b11110000 */ 0xF0, /* 5 0b11111000 */ 0xF8,
/* 6 0b11111100 */ 0xFC, /* 7 0b11111110 */ 0xFE
};
static uint8_t markbit[8] = {
/* 0 0b10000000 */ 0x80, /* 1 0b01000000 */ 0x40,
/* 2 0b00100000 */ 0x20, /* 3 0b00010000 */ 0x10,
/* 4 0b00001000 */ 0x08, /* 5 0b00000100 */ 0x04,
/* 6 0b00000010 */ 0x02, /* 7 0b00000001 */ 0x01
};
if (!context) return shaNull;
if (!length) return shaSuccess;
if (context->Corrupted) return context->Corrupted;
if (context->Computed) return context->Corrupted = shaStateError;
if (length >= 8) return context->Corrupted = shaBadParam;
SHA224_256AddLength(context, length);
SHA224_256Finalize(context, (uint8_t)
((message_bits & masks[length]) | markbit[length]));
return context->Corrupted;
}
/*
* SHA256Result
*
* Description:
* This function will return the 256-bit message digest
* into the Message_Digest array provided by the caller.
* NOTE:
* The first octet of hash is stored in the element with index 0,
* the last octet of hash in the element with index 31.
*
* Parameters:
* context: [in/out]
* The context to use to calculate the SHA hash.
* Message_Digest[ ]: [out]
* Where the digest is returned.
*
* Returns:
* sha Error Code.
*/
int SHA256Result(SHA256Context *context,
uint8_t Message_Digest[SHA256HashSize])
{
return SHA224_256ResultN(context, Message_Digest, SHA256HashSize);
}
/*
* SHA224_256Reset
*
* Description:
* This helper function will initialize the SHA256Context in
* preparation for computing a new SHA-224 or SHA-256 message digest.
*
* Parameters:
* context: [in/out]
* The context to reset.
* H0[ ]: [in]
* The initial hash value array to use.
*
* Returns:
* sha Error Code.
*/
static int SHA224_256Reset(SHA256Context *context, uint32_t *H0)
{
if (!context) return shaNull;
context->Length_High = context->Length_Low = 0;
context->Message_Block_Index = 0;
context->Intermediate_Hash[0] = H0[0];
context->Intermediate_Hash[1] = H0[1];
context->Intermediate_Hash[2] = H0[2];
context->Intermediate_Hash[3] = H0[3];
context->Intermediate_Hash[4] = H0[4];
context->Intermediate_Hash[5] = H0[5];
context->Intermediate_Hash[6] = H0[6];
context->Intermediate_Hash[7] = H0[7];
context->Computed = 0;
context->Corrupted = shaSuccess;
return shaSuccess;
}
/*
* SHA224_256ProcessMessageBlock
*
* Description:
* This helper function will process the next 512 bits of the
* message stored in the Message_Block array.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
*
* Returns:
* Nothing.
*
* Comments:
* Many of the variable names in this code, especially the
* single character names, were used because those were the
* names used in the Secure Hash Standard.
*/
static void SHA224_256ProcessMessageBlock(SHA256Context *context)
{
/* Constants defined in FIPS 180-3, section 4.2.2 */
static const uint32_t K[64] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b,
0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01,
0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7,
0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152,
0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,
0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc,
0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819,
0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08,
0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f,
0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};
int t, t4; /* Loop counter */
uint32_t temp1, temp2; /* Temporary word value */
uint32_t W[64]; /* Word sequence */
uint32_t A, B, C, D, E, F, G, H; /* Word buffers */
/*
* Initialize the first 16 words in the array W
*/
for (t = t4 = 0; t < 16; t++, t4 += 4)
W[t] = (((uint32_t)context->Message_Block[t4]) << 24) |
(((uint32_t)context->Message_Block[t4 + 1]) << 16) |
(((uint32_t)context->Message_Block[t4 + 2]) << 8) |
(((uint32_t)context->Message_Block[t4 + 3]));
for (t = 16; t < 64; t++)
W[t] = SHA256_sigma1(W[t-2]) + W[t-7] +
SHA256_sigma0(W[t-15]) + W[t-16];
A = context->Intermediate_Hash[0];
B = context->Intermediate_Hash[1];
C = context->Intermediate_Hash[2];
D = context->Intermediate_Hash[3];
E = context->Intermediate_Hash[4];
F = context->Intermediate_Hash[5];
G = context->Intermediate_Hash[6];
H = context->Intermediate_Hash[7];
for (t = 0; t < 64; t++) {
temp1 = H + SHA256_SIGMA1(E) + SHA_Ch(E,F,G) + K[t] + W[t];
temp2 = SHA256_SIGMA0(A) + SHA_Maj(A,B,C);
H = G;
G = F;
F = E;
E = D + temp1;
D = C;
C = B;
B = A;
A = temp1 + temp2;
}
context->Intermediate_Hash[0] += A;
context->Intermediate_Hash[1] += B;
context->Intermediate_Hash[2] += C;
context->Intermediate_Hash[3] += D;
context->Intermediate_Hash[4] += E;
context->Intermediate_Hash[5] += F;
context->Intermediate_Hash[6] += G;
context->Intermediate_Hash[7] += H;
context->Message_Block_Index = 0;
}
/*
* SHA224_256Finalize
*
* Description:
* This helper function finishes off the digest calculations.
*
* Parameters:
* context: [in/out]
* The SHA context to update.
* Pad_Byte: [in]
* The last byte to add to the message block before the 0-padding
* and length. This will contain the last bits of the message
* followed by another single bit. If the message was an
* exact multiple of 8-bits long, Pad_Byte will be 0x80.
*
* Returns:
* sha Error Code.
*/
static void SHA224_256Finalize(SHA256Context *context,
uint8_t Pad_Byte)
{
int i;
SHA224_256PadMessage(context, Pad_Byte);
/* message may be sensitive, so clear it out */
for (i = 0; i < SHA256_Message_Block_Size; ++i)
context->Message_Block[i] = 0;
context->Length_High = 0; /* and clear length */
context->Length_Low = 0;
context->Computed = 1;
}
/*
* SHA224_256PadMessage
*
* Description:
* According to the standard, the message must be padded to the next
* even multiple of 512 bits. The first padding bit must be a '1'.
* The last 64 bits represent the length of the original message.
* All bits in between should be 0. This helper function will pad
* the message according to those rules by filling the
* Message_Block array accordingly. When it returns, it can be
* assumed that the message digest has been computed.
*
* Parameters:
* context: [in/out]
* The context to pad.
* Pad_Byte: [in]
* The last byte to add to the message block before the 0-padding
* and length. This will contain the last bits of the message
* followed by another single bit. If the message was an
* exact multiple of 8-bits long, Pad_Byte will be 0x80.
*
* Returns:
* Nothing.
*/
static void SHA224_256PadMessage(SHA256Context *context,
uint8_t Pad_Byte)
{
/*
* Check to see if the current message block is too small to hold
* the initial padding bits and length. If so, we will pad the
* block, process it, and then continue padding into a second
* block.
*/
if (context->Message_Block_Index >= (SHA256_Message_Block_Size-8)) {
context->Message_Block[context->Message_Block_Index++] = Pad_Byte;
while (context->Message_Block_Index < SHA256_Message_Block_Size)
context->Message_Block[context->Message_Block_Index++] = 0;
SHA224_256ProcessMessageBlock(context);
} else
context->Message_Block[context->Message_Block_Index++] = Pad_Byte;
while (context->Message_Block_Index < (SHA256_Message_Block_Size-8))
context->Message_Block[context->Message_Block_Index++] = 0;
/*
* Store the message length as the last 8 octets
*/
context->Message_Block[56] = (uint8_t)(context->Length_High >> 24);
context->Message_Block[57] = (uint8_t)(context->Length_High >> 16);
context->Message_Block[58] = (uint8_t)(context->Length_High >> 8);
context->Message_Block[59] = (uint8_t)(context->Length_High);
context->Message_Block[60] = (uint8_t)(context->Length_Low >> 24);
context->Message_Block[61] = (uint8_t)(context->Length_Low >> 16);
context->Message_Block[62] = (uint8_t)(context->Length_Low >> 8);
context->Message_Block[63] = (uint8_t)(context->Length_Low);
SHA224_256ProcessMessageBlock(context);
}
/*
* SHA224_256ResultN
*
* Description:
* This helper function will return the 224-bit or 256-bit message
* digest into the Message_Digest array provided by the caller.
* NOTE:
* The first octet of hash is stored in the element with index 0,
* the last octet of hash in the element with index 27/31.
*
* Parameters:
* context: [in/out]
* The context to use to calculate the SHA hash.
* Message_Digest[ ]: [out]
* Where the digest is returned.
* HashSize: [in]
* The size of the hash, either 28 or 32.
*
* Returns:
* sha Error Code.
*/
static int SHA224_256ResultN(SHA256Context *context,
uint8_t Message_Digest[ ], int HashSize)
{
int i;
if (!context) return shaNull;
if (!Message_Digest) return shaNull;
if (context->Corrupted) return context->Corrupted;
if (!context->Computed)
SHA224_256Finalize(context, 0x80);
for (i = 0; i < HashSize; ++i)
Message_Digest[i] = (uint8_t)
(context->Intermediate_Hash[i>>2] >> 8 * ( 3 - ( i & 0x03 ) ));
return shaSuccess;
}

1034
src/3rdparty/rfc6234/sha384-512.c vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -63,7 +63,7 @@ class Q_CONCURRENT_EXPORT QFutureWatcherBase : public QObject
Q_DECLARE_PRIVATE(QFutureWatcherBase)
public:
QFutureWatcherBase(QObject *parent = 0);
explicit QFutureWatcherBase(QObject *parent = 0);
int progressValue() const;
int progressMinimum() const;
@ -119,7 +119,7 @@ template <typename T>
class QFutureWatcher : public QFutureWatcherBase
{
public:
QFutureWatcher(QObject *_parent = 0)
explicit QFutureWatcher(QObject *_parent = 0)
: QFutureWatcherBase(_parent)
{ }
~QFutureWatcher()
@ -189,7 +189,7 @@ template <>
class QFutureWatcher<void> : public QFutureWatcherBase
{
public:
QFutureWatcher(QObject *_parent = 0)
explicit QFutureWatcher(QObject *_parent = 0)
: QFutureWatcherBase(_parent)
{ }
~QFutureWatcher()

View File

@ -1,18 +1,62 @@
get_filename_component(_qt5_corelib_install_prefix ${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR} ABSOLUTE)
# Required by default:
set(QT_QMAKE_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/qmake$$CMAKE_BIN_SUFFIX\")
set(QT_MOC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/moc$$CMAKE_BIN_SUFFIX\")
set(QT_RCC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/rcc$$CMAKE_BIN_SUFFIX\")
!!IF isEmpty(CMAKE_BIN_DIR_IS_ABSOLUTE)
set(QT_QMAKE_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
set(QT_MOC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
set(QT_RCC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
!!ELSE
set(QT_QMAKE_EXECUTABLE \"$${CMAKE_BIN_DIR}qmake$$CMAKE_BIN_SUFFIX\")
set(QT_MOC_EXECUTABLE \"$${CMAKE_BIN_DIR}moc$$CMAKE_BIN_SUFFIX\")
set(QT_RCC_EXECUTABLE \"$${CMAKE_BIN_DIR}rcc$$CMAKE_BIN_SUFFIX\")
!!ENDIF
!!IF isEmpty(CMAKE_DATA_DIR_IS_ABSOLUTE)
list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/default\")
!!ELSE
list(APPEND Qt5Core_INCLUDE_DIRS \"$${CMAKE_DATA_DIR}mkspecs/default\")
!!ENDIF
if (NOT \"$${CMAKE_ADD_FPIE_FLAGS}\" STREQUAL \"\")
set(Qt5Core_COMPILE_FLAGS "-fPIE")
!!IF !isEmpty(CMAKE_ADD_FPIE_FLAGS)
set(Qt5Core_EXECUTABLE_COMPILE_FLAGS "-fPIE")
!!ENDIF
!!IF !isEmpty(QT_NAMESPACE)
list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
!!ENDIF
!!IF !isEmpty(QT_LIBINFIX)
set(QT_LIBINFIX \"$${QT_LIBINFIX}\")
!!ENDIF
!!IF !isEmpty(CMAKE_WINDOWS_BUILD)
set(Qt5Core_QTMAIN_LIBRARIES Qt5::WinMain)
if (NOT _Qt5WinMain_target)
set(_Qt5WinMain_target 1)
add_library(Qt5::WinMain STATIC IMPORTED)
endif()
if (NOT \"$$QT_NAMESPACE\" STREQUAL \"\")
list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE)
list(APPEND Qt5Core_COMPILE_DEFINITIONS QT_NAMESPACE=$$QT_NAMESPACE)
endif()
!!IF !isEmpty(debug_type)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt5::WinMain PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_DEBUG "${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}"
!!ELSE
IMPORTED_LOCATION_DEBUG "$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_DEBUG}"
!!ENDIF
)
!!ENDIF
!!IF !isEmpty(release_type)
set_property(TARGET Qt5::WinMain APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(Qt5::WinMain PROPERTIES
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
IMPORTED_LOCATION_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
!!ELSE
IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_WINMAIN_FILE_LOCATION_RELEASE}\"
!!ENDIF
)
!!ENDIF
!!ENDIF

View File

@ -83,7 +83,7 @@ macro(QT5_GET_MOC_FLAGS _moc_flags)
set(${_moc_flags} ${${_moc_flags}} "-D${_current}")
endforeach()
if(Q_WS_WIN)
if(WIN32)
set(${_moc_flags} ${${_moc_flags}} -DWIN32)
endif()
endmacro()

View File

@ -1495,35 +1495,7 @@ QString QTextDecoder::toUnicode(const QByteArray &ba)
files to be loaded. For details of internationalization, see
\l{Internationalization with Qt}.
\sa codecForTr(), setCodecForCStrings()
*/
/*!
\fn QTextCodec* QTextCodec::codecForCStrings()
Returns the codec used by QString to convert to and from \c{const
char *} and QByteArrays. If this function returns 0 (the default),
QString assumes Latin-1.
\sa setCodecForCStrings()
*/
/*!
\fn void QTextCodec::setCodecForCStrings(QTextCodec *codec)
\nonreentrant
Sets the codec used by QString to convert to and from \c{const
char *} and QByteArrays. If the \a codec is 0 (the default),
QString assumes Latin-1.
\warning Some codecs do not preserve the characters in the ASCII
range (0x00 to 0x7F). For example, the Japanese Shift-JIS
encoding maps the backslash character (0x5A) to the Yen
character. To avoid undesirable side-effects, we recommend
avoiding such codecs with setCodecsForCString().
\sa codecForCStrings(), setCodecForTr()
\sa codecForTr()
*/
/*!

View File

@ -75,9 +75,6 @@ public:
static QTextCodec* codecForTr();
static void setCodecForTr(QTextCodec *c);
static QTextCodec* codecForCStrings();
static void setCodecForCStrings(QTextCodec *c);
static QTextCodec *codecForHtml(const QByteArray &ba);
static QTextCodec *codecForHtml(const QByteArray &ba, QTextCodec *defaultCodec);
@ -139,8 +136,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QTextCodec::ConversionFlags)
inline QTextCodec* QTextCodec::codecForTr() { return validCodecs() ? cftr : 0; }
inline void QTextCodec::setCodecForTr(QTextCodec *c) { cftr = c; }
inline QTextCodec* QTextCodec::codecForCStrings() { return validCodecs() ? QString::codecForCStrings : 0; }
inline void QTextCodec::setCodecForCStrings(QTextCodec *c) { QString::codecForCStrings = c; }
class Q_CORE_EXPORT QTextEncoder {
Q_DISABLE_COPY(QTextEncoder)

View File

@ -10,7 +10,8 @@ HEADERS += \
global/qnumeric_p.h \
global/qnumeric.h \
global/qlogging.h \
global/qtypeinfo.h
global/qtypeinfo.h \
global/qsysinfo.h
SOURCES += \
global/qglobal.cpp \

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