Extract Particles code to an independent library

QtQuick clients that do not use particles features should not have
to load these classes.

Task-number: QTBUG-25178
Change-Id: Ib15f7655dc4d821595e06f9160d2770375279027
Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
This commit is contained in:
Matthew Vogt 2012-04-11 16:54:33 +10:00 committed by Qt by Nokia
parent e00c40a89a
commit f189b8934d
97 changed files with 169 additions and 37 deletions

View File

@ -0,0 +1,17 @@
QT.quickparticles.VERSION = 5.0.0
QT.quickparticles.MAJOR_VERSION = 5
QT.quickparticles.MINOR_VERSION = 0
QT.quickparticles.PATCH_VERSION = 0
QT.quickparticles.name = QtQuickParticles
QT.quickparticles.bins = $$QT_MODULE_BIN_BASE
QT.quickparticles.includes = $$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/QtQuickParticles
QT.quickparticles.private_includes = $$QT_MODULE_INCLUDE_BASE/QtQuickParticles/$$QT.quickparticles.VERSION
QT.quickparticles.sources = $$QT_MODULE_BASE/src/particles
QT.quickparticles.libs = $$QT_MODULE_LIB_BASE
QT.quickparticles.plugins = $$QT_MODULE_PLUGIN_BASE
QT.quickparticles.imports = $$QT_MODULE_IMPORT_BASE
QT.quickparticles.depends = qml quick
QT.quickparticles.DEFINES = QT_QUICKPARTICLES_LIB
QT_CONFIG += quickparticles

View File

@ -5,7 +5,7 @@ include(../qimportbase.pri)
SOURCES += \
plugin.cpp
QT += quick-private qml-private
QT += quick-private quickparticles-private qml-private
OTHER_FILES += \
qmldir

View File

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -28,7 +28,8 @@ HEADERS += \
$$PWD/qquickv8particledata_p.h \
$$PWD/qquickrectangleextruder_p.h \
$$PWD/qquickparticlegroup_p.h \
$$PWD/qquickgroupgoal_p.h
$$PWD/qquickgroupgoal_p.h \
$$PWD/qtquickparticlesglobal_p.h
SOURCES += \
$$PWD/qquickangledirection.cpp \

View File

@ -0,0 +1,40 @@
load(qt_module)
TARGET = QtQuickParticles
CONFIG += module
CONFIG += dll warn_on
MODULE_PRI = ../../modules/qt_quickparticles.pri
QT = core-private gui-private v8-private qml-private quick-private
DEFINES += QT_BUILD_QUICKPARTICLES_LIB QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES
win32-msvc*:DEFINES *= _CRT_SECURE_NO_WARNINGS
solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2
exists("qqml_enable_gcov") {
QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage -fno-elide-constructors
LIBS += -lgcov
}
MODULE = quickparticles
load(qt_module_config)
include(particles.pri)
mac {
# FIXME: this is a workaround for broken qmake logic in qtAddModule()
# This function refuses to use frameworks unless the framework exists on
# the filesystem at the time qmake is run, resulting in a build failure
# if QtQuick is qmaked before QtQml is built and frameworks are
# in use. qtAddLibrary() contains correct logic to deal with this, so
# we'll explicitly call that for now.
load(qt)
LIBS -= -lQtQml # in non-framework builds, these should be re-added
LIBS -= -lQtQml_debug # within the qtAddLibrary if appropriate, so no
qtAddLibrary(QtQml) # harm done :)
LIBS -= -lQtQuick
LIBS -= -lQtQuick_debug
qtAddLibrary(QtQuick)
}

View File

@ -42,13 +42,13 @@
#ifndef QQUICKPARTICLESMODULE_H
#define QQUICKPARTICLESMODULE_H
#include <private/qtquickglobal_p.h>
#include <private/qtquickparticlesglobal_p.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class Q_QUICK_PRIVATE_EXPORT QQuickParticlesModule
class Q_QUICKPARTICLES_PRIVATE_EXPORT QQuickParticlesModule
{
public:
static void defineModule();

View File

@ -0,0 +1,69 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/
**
** This file is part of the QtQuickParticles module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** GNU Lesser General Public License Usage
** This file may be used under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation and
** appearing in the file LICENSE.LGPL included in the packaging of this
** file. Please review the following information to ensure the GNU Lesser
** General Public License version 2.1 requirements will be met:
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU General
** Public License version 3.0 as published by the Free Software Foundation
** and appearing in the file LICENSE.GPL included in the packaging of this
** file. Please review the following information to ensure the GNU General
** Public License version 3.0 requirements will be met:
** http://www.gnu.org/copyleft/gpl.html.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms and
** conditions contained in a signed written agreement between you and Nokia.
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef QTQUICKPARTICLESGLOBAL_P_H
#define QTQUICKPARTICLESGLOBAL_P_H
#include <QtCore/qglobal.h>
// We only have private exports from this library
#if defined(Q_OS_WIN)
# if defined(QT_MAKEDLL) /* create a Qt DLL library */
# if defined(QT_BUILD_QUICKPARTICLES_LIB)
# define Q_QUICKPARTICLES_PRIVATE_EXPORT Q_DECL_EXPORT
# else
# define Q_QUICKPARTICLES_PRIVATE_EXPORT Q_DECL_IMPORT
# endif
# elif defined(QT_DLL) /* use a Qt DLL library */
# define Q_QUICKPARTICLES_PRIVATE_EXPORT Q_DECL_IMPORT
# endif
#endif
#if !defined(Q_QUICKPARTICLES_PRIVATE_EXPORT)
# if defined(QT_SHARED)
# define Q_QUICKPARTICLES_PRIVATE_EXPORT Q_DECL_EXPORT
# else
# define Q_QUICKPARTICLES_PRIVATE_EXPORT
# endif
#endif
#endif // QTQUICKPARTICLESGLOBAL_P_H

View File

@ -45,6 +45,7 @@
#include <QtQuick/qquickitem.h>
#include <QtQuick/qsgmaterial.h>
#include <private/qtquickglobal_p.h>
#include <private/qsgadaptationlayer_p.h>
#include <private/qquickshadereffectnode_p.h>
#include "qquickshadereffectmesh_p.h"
@ -63,7 +64,7 @@ class QSignalMapper;
class QQuickCustomMaterialShader;
// Common class for QQuickShaderEffect and QQuickCustomParticle.
struct QQuickShaderEffectCommon
struct Q_QUICK_PRIVATE_EXPORT QQuickShaderEffectCommon
{
typedef QQuickShaderEffectMaterialKey Key;
typedef QQuickShaderEffectMaterial::UniformData UniformData;

View File

@ -46,6 +46,7 @@
#include <QtQuick/qsgmaterial.h>
#include <QtQuick/qsgtextureprovider.h>
#include <QtQuick/qquickitem.h>
#include <private/qtquickglobal_p.h>
#include <QtCore/qsharedpointer.h>
#include <QtCore/qpointer.h>
@ -73,7 +74,7 @@ uint qHash(const QQuickShaderEffectMaterialKey &key);
class QQuickCustomMaterialShader;
class QQuickShaderEffectNode;
class QQuickShaderEffectMaterial : public QSGMaterial
class Q_QUICK_PRIVATE_EXPORT QQuickShaderEffectMaterial : public QSGMaterial
{
public:
struct UniformData
@ -127,7 +128,7 @@ protected:
class QSGShaderEffectMesh;
class QQuickShaderEffectNode : public QObject, public QSGGeometryNode
class Q_QUICK_PRIVATE_EXPORT QQuickShaderEffectNode : public QObject, public QSGGeometryNode
{
Q_OBJECT
public:

View File

@ -50,14 +50,15 @@
#include <QQmlListProperty>
#include <QImage>
#include <QPair>
#include <QtQuick/private/qquickpixmapcache_p.h>
#include <private/qquickpixmapcache_p.h>
#include <private/qtquickglobal_p.h>
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
class QQuickSprite;
class Q_AUTOTEST_EXPORT QQuickStochasticState : public QObject //Currently for internal use only - Sprite and ParticleGroup
class Q_QUICK_PRIVATE_EXPORT QQuickStochasticState : public QObject //Currently for internal use only - Sprite and ParticleGroup
{
Q_OBJECT
Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
@ -173,7 +174,7 @@ private:
bool m_randomStart;
};
class Q_AUTOTEST_EXPORT QQuickStochasticEngine : public QObject
class Q_QUICK_PRIVATE_EXPORT QQuickStochasticEngine : public QObject
{
Q_OBJECT
//TODO: Optimize single state case?
@ -252,7 +253,7 @@ protected:
bool m_addAdvance;
};
class QQuickSpriteEngine : public QQuickStochasticEngine
class Q_QUICK_PRIVATE_EXPORT QQuickSpriteEngine : public QQuickStochasticEngine
{
Q_OBJECT
Q_PROPERTY(QQmlListProperty<QQuickSprite> sprites READ sprites)

View File

@ -22,7 +22,6 @@ load(qt_module_config)
include(util/util.pri)
include(scenegraph/scenegraph.pri)
include(items/items.pri)
include(particles/particles.pri)
include(designer/designer.pri)
HEADERS += \

View File

@ -56,7 +56,7 @@ class Q_QUICK_EXPORT QSGGeometry
{
public:
struct Attribute
struct Q_QUICK_EXPORT Attribute
{
int position;
int tupleSize;

View File

@ -1,6 +1,6 @@
TEMPLATE = subdirs
CONFIG += ordered
SUBDIRS += qml quick plugins
SUBDIRS += qml quick particles plugins
contains(QT_CONFIG, qmltest): SUBDIRS += qmltest

View File

@ -1,6 +1,7 @@
%modules = ( # path to module name map
"QtQml" => "$basedir/src/qml",
"QtQuick" => "$basedir/src/quick",
"QtQuickParticles" => "$basedir/src/particles",
"QtQuickTest" => "$basedir/src/qmltest",
"QtQmlDevTools" => "$basedir/src/qmldevtools",
"QtDeclarative" => "$basedir/src/compatibility",
@ -18,10 +19,12 @@
"network" => "#include <QtNetwork/QtNetwork>\n",
"testlib" => "#include <QtTest/QtTest>\n",
"qml" => "#include <QtQml/QtQml>\n",
"quick" => "#include <QtQuick/QtQuick>\n",
);
%modulepris = (
"QtQml" => "$basedir/modules/qt_qml.pri",
"QtQuick" => "$basedir/modules/qt_quick.pri",
"QtQuickParticles" => "$basedir/modules/qt_quickparticles.pri",
"QtQuickTest" => "$basedir/modules/qt_qmltest.pri",
"QtQmlDevTools" => "$basedir/modules/qt_qmldevtools.pri",
"QtDeclarative" => "$basedir/modules/qt_declarative.pri",

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private testlib quick-private
QT += core-private gui-private v8-private qml-private testlib quick-private quickparticles-private

View File

@ -6,4 +6,4 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private testlib quick-private
QT += core-private gui-private v8-private qml-private testlib quick-private quickparticles-private

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib

View File

@ -6,5 +6,5 @@ macx:CONFIG -= app_bundle
include (../../shared/util.pri)
TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
QT += core-private gui-private v8-private qml-private quick-private quickparticles-private testlib