summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYann Bodson <yann.bodson@nokia.com>2010-03-11 05:26:42 (GMT)
committerYann Bodson <yann.bodson@nokia.com>2010-03-11 05:26:42 (GMT)
commitfcea69d5136749827439fd6b2b45371034ca9599 (patch)
tree2b168f4863cafd5caa69fd0dc227ca102a7ea87a /src
parent16b28550f03ec69cee8481d93c3ba2c8830e53f5 (diff)
downloadQt-fcea69d5136749827439fd6b2b45371034ca9599.zip
Qt-fcea69d5136749827439fd6b2b45371034ca9599.tar.gz
Qt-fcea69d5136749827439fd6b2b45371034ca9599.tar.bz2
Move particles in their own plugin (Qt.labs.particles)
Task-number: QT-2846
Diffstat (limited to 'src')
-rw-r--r--src/declarative/graphicsitems/graphicsitems.pri4
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp6
-rw-r--r--src/imports/imports.pro2
-rw-r--r--src/imports/particles/particles.cpp69
-rw-r--r--src/imports/particles/particles.pro21
-rw-r--r--src/imports/particles/qdeclarativeparticles.cpp (renamed from src/declarative/graphicsitems/qdeclarativeparticles.cpp)9
-rw-r--r--src/imports/particles/qdeclarativeparticles_p.h (renamed from src/declarative/graphicsitems/qdeclarativeparticles_p.h)14
-rw-r--r--src/imports/particles/qmldir1
8 files changed, 104 insertions, 22 deletions
diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri
index 3ff92b1..d30651b 100644
--- a/src/declarative/graphicsitems/graphicsitems.pri
+++ b/src/declarative/graphicsitems/graphicsitems.pri
@@ -48,7 +48,6 @@ HEADERS += \
$$PWD/qdeclarativevisualitemmodel_p.h \
$$PWD/qdeclarativelistview_p.h \
$$PWD/qdeclarativegraphicsobjectcontainer_p.h \
- $$PWD/qdeclarativeparticles_p.h \
$$PWD/qdeclarativelayoutitem_p.h \
$$PWD/qdeclarativeitemchangelistener_p.h \
$$PWD/qdeclarativeeffects.cpp
@@ -82,5 +81,4 @@ SOURCES += \
$$PWD/qdeclarativevisualitemmodel.cpp \
$$PWD/qdeclarativelistview.cpp \
$$PWD/qdeclarativegraphicsobjectcontainer.cpp \
- $$PWD/qdeclarativeparticles.cpp \
- $$PWD/qdeclarativelayoutitem.cpp \
+ $$PWD/qdeclarativelayoutitem.cpp
diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
index 2d05c7c..2ac55a4 100644
--- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp
@@ -65,7 +65,6 @@
#include "qdeclarativelistview_p.h"
#include "qdeclarativeloader_p.h"
#include "qdeclarativemousearea_p.h"
-#include "qdeclarativeparticles_p.h"
#include "qdeclarativepath_p.h"
#include "qdeclarativepathview_p.h"
#include "qdeclarativerectangle_p.h"
@@ -108,11 +107,6 @@ void QDeclarativeItemModule::defineModule()
qmlRegisterType<QDeclarativeLoader>("Qt",4,6,"Loader");
qmlRegisterType<QDeclarativeMouseArea>("Qt",4,6,"MouseArea");
qmlRegisterType<QGraphicsOpacityEffect>("Qt",4,6,"Opacity");
- qmlRegisterType<QDeclarativeParticleMotion>("Qt",4,6,"ParticleMotion");
- qmlRegisterType<QDeclarativeParticleMotionGravity>("Qt",4,6,"ParticleMotionGravity");
- qmlRegisterType<QDeclarativeParticleMotionLinear>("Qt",4,6,"ParticleMotionLinear");
- qmlRegisterType<QDeclarativeParticleMotionWander>("Qt",4,6,"ParticleMotionWander");
- qmlRegisterType<QDeclarativeParticles>("Qt",4,6,"Particles");
qmlRegisterType<QDeclarativePath>("Qt",4,6,"Path");
qmlRegisterType<QDeclarativePathAttribute>("Qt",4,6,"PathAttribute");
qmlRegisterType<QDeclarativePathCubic>("Qt",4,6,"PathCubic");
diff --git a/src/imports/imports.pro b/src/imports/imports.pro
index 8b47043..3886f5c 100644
--- a/src/imports/imports.pro
+++ b/src/imports/imports.pro
@@ -1,6 +1,6 @@
TEMPLATE = subdirs
-SUBDIRS += widgets
+SUBDIRS += widgets particles
contains(QT_CONFIG, webkit): SUBDIRS += webkit
contains(QT_CONFIG, multimedia): SUBDIRS += multimedia
diff --git a/src/imports/particles/particles.cpp b/src/imports/particles/particles.cpp
new file mode 100644
index 0000000..ae3f318
--- /dev/null
+++ b/src/imports/particles/particles.cpp
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 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.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtDeclarative/qdeclarativeextensionplugin.h>
+#include <QtDeclarative/qdeclarative.h>
+
+#include "qdeclarativeparticles_p.h"
+
+QT_BEGIN_NAMESPACE
+
+class QParticlesQmlModule : public QDeclarativeExtensionPlugin
+{
+ Q_OBJECT
+public:
+ virtual void registerTypes(const char *uri)
+ {
+ Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.particles"));
+ qmlRegisterType<QDeclarativeParticleMotion>(uri,1,0,"ParticleMotion");
+ qmlRegisterType<QDeclarativeParticleMotionGravity>(uri,1,0,"ParticleMotionGravity");
+ qmlRegisterType<QDeclarativeParticleMotionLinear>(uri,1,0,"ParticleMotionLinear");
+ qmlRegisterType<QDeclarativeParticleMotionWander>(uri,1,0,"ParticleMotionWander");
+ qmlRegisterType<QDeclarativeParticles>(uri,1,0,"Particles");
+ }
+};
+
+QT_END_NAMESPACE
+
+#include "particles.moc"
+
+Q_EXPORT_PLUGIN2(particlesqmlmodule, QT_PREPEND_NAMESPACE(QParticlesQmlModule));
+
diff --git a/src/imports/particles/particles.pro b/src/imports/particles/particles.pro
new file mode 100644
index 0000000..2a0b8f5
--- /dev/null
+++ b/src/imports/particles/particles.pro
@@ -0,0 +1,21 @@
+TARGET = particles
+TARGETPATH = Qt/labs/particles
+include(../qimportbase.pri)
+
+QT += declarative
+
+SOURCES += \
+ qdeclarativeparticles.cpp \
+ particles.cpp
+
+HEADERS += \
+ qdeclarativeparticles_p.h
+
+QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH
+target.path = $$TARGETPATH
+
+# install qmldir file
+qmldir.files += qmldir
+qmldir.path = $$[QT_INSTALL_IMPORTS]/$$TARGETPATH
+
+INSTALLS += target qmldir
diff --git a/src/declarative/graphicsitems/qdeclarativeparticles.cpp b/src/imports/particles/qdeclarativeparticles.cpp
index 593c80a..caa0754 100644
--- a/src/declarative/graphicsitems/qdeclarativeparticles.cpp
+++ b/src/imports/particles/qdeclarativeparticles.cpp
@@ -41,13 +41,12 @@
#include "qdeclarativeparticles_p.h"
-#include "qdeclarativeitem_p.h"
+#include <private/qdeclarativeitem_p.h>
-#include <qdeclarativepixmapcache_p.h>
-#include <qfxperf_p_p.h>
-#include <qdeclarativeanimation_p_p.h>
+#include <private/qdeclarativepixmapcache_p.h>
+#include <private/qfxperf_p_p.h>
+#include <private/qdeclarativeanimation_p_p.h>
-#include <QNetworkReply>
#include <QPainter>
#include <QtGui/qdrawutil.h>
#include <QVarLengthArray>
diff --git a/src/declarative/graphicsitems/qdeclarativeparticles_p.h b/src/imports/particles/qdeclarativeparticles_p.h
index 06acbb9..993796d 100644
--- a/src/declarative/graphicsitems/qdeclarativeparticles_p.h
+++ b/src/imports/particles/qdeclarativeparticles_p.h
@@ -42,7 +42,7 @@
#ifndef QDECLARATIVEPARTICLES_H
#define QDECLARATIVEPARTICLES_H
-#include "qdeclarativeitem.h"
+#include <QtDeclarative/qdeclarativeitem.h>
QT_BEGIN_HEADER
@@ -52,7 +52,7 @@ QT_MODULE(Declarative)
class QDeclarativeParticle;
class QDeclarativeParticles;
-class Q_DECLARATIVE_EXPORT QDeclarativeParticleMotion : public QObject
+class QDeclarativeParticleMotion : public QObject
{
Q_OBJECT
public:
@@ -63,7 +63,7 @@ public:
virtual void destroy(QDeclarativeParticle &);
};
-class Q_DECLARATIVE_EXPORT QDeclarativeParticleMotionLinear : public QDeclarativeParticleMotion
+class QDeclarativeParticleMotionLinear : public QDeclarativeParticleMotion
{
Q_OBJECT
public:
@@ -73,7 +73,7 @@ public:
virtual void advance(QDeclarativeParticle &, int interval);
};
-class Q_DECLARATIVE_EXPORT QDeclarativeParticleMotionGravity : public QDeclarativeParticleMotion
+class QDeclarativeParticleMotionGravity : public QDeclarativeParticleMotion
{
Q_OBJECT
@@ -106,7 +106,7 @@ private:
qreal _accel;
};
-class Q_DECLARATIVE_EXPORT QDeclarativeParticleMotionWander : public QDeclarativeParticleMotion
+class QDeclarativeParticleMotionWander : public QDeclarativeParticleMotion
{
Q_OBJECT
public:
@@ -142,7 +142,7 @@ Q_SIGNALS:
void xvarianceChanged();
void yvarianceChanged();
void paceChanged();
-
+
private:
QDeclarativeParticles *particles;
qreal _xvariance;
@@ -151,7 +151,7 @@ private:
};
class QDeclarativeParticlesPrivate;
-class Q_DECLARATIVE_EXPORT QDeclarativeParticles : public QDeclarativeItem
+class QDeclarativeParticles : public QDeclarativeItem
{
Q_OBJECT
diff --git a/src/imports/particles/qmldir b/src/imports/particles/qmldir
new file mode 100644
index 0000000..15456bb
--- /dev/null
+++ b/src/imports/particles/qmldir
@@ -0,0 +1 @@
+plugin particles