Add BurstEmitter, and a simple render path for UltraParticles
[profile/ivi/qtdeclarative.git] / src / imports / particles / main.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the Declarative module of the Qt Toolkit.
8 **
9 ** $QT_BEGIN_LICENSE:LGPL$
10 ** No Commercial Usage
11 ** This file contains pre-release code and may not be distributed.
12 ** You may use this file in accordance with the terms and conditions
13 ** contained in the Technology Preview License Agreement accompanying
14 ** this package.
15 **
16 ** GNU Lesser General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU Lesser
18 ** General Public License version 2.1 as published by the Free Software
19 ** Foundation and appearing in the file LICENSE.LGPL included in the
20 ** packaging of this file.  Please review the following information to
21 ** ensure the GNU Lesser General Public License version 2.1 requirements
22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23 **
24 ** In addition, as a special exception, Nokia gives you certain additional
25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27 **
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
30 **
31 **
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "V1/qdeclarativeparticles_p.h"
43 #include "pluginmain.h"
44 #include "spritestate.h"
45 #include "spriteengine.h"
46 #include "particleaffector.h"
47 #include "wanderaffector.h"
48 //#include "rockingaffector.h"
49 //#include "scalingaffector.h"
50 #include "resetaffector.h"
51 #include "gravityaffector.h"
52 #include "driftaffector.h"
53 #include "gravitationalsingularityaffector.h"
54 #include "frictionaffector.h"
55 #include "meanderaffector.h"
56 #include "attractoraffector.h"
57 #include "speedlimitaffector.h"
58 #include "killaffector.h"
59 //#include "zoneaffector.h"
60 //#include "toggleaffector.h"
61 #include "spritegoalaffector.h"
62 #include "swarmaffector.h"
63 #include "turbulenceaffector.h"
64 #include "eternalaffector.h"
65 #include "particlesystem.h"
66 #include "particleemitter.h"
67 //#include "spriteemitter.h"
68 #include "trailsemitter.h"
69 #include "burstemitter.h"
70 #include "particle.h"
71 #include "coloredparticle.h"
72 #include "spriteparticle.h"
73 #include "modelparticle.h"
74 #include "superparticle.h"
75 #include "ultraparticle.h"
76 //#include "pairedparticle.h"
77 #include "spriteimage.h"
78 #include "followemitter.h"
79 #include "particleextruder.h"
80 #include "ellipseextruder.h"
81 #include "lineextruder.h"
82 #include "maskextruder.h"
83 #include "varyingvector.h"
84 #include "pointvector.h"
85 #include "angledvector.h"
86 #include "directedvector.h"
87 //#include "followaffector.h"
88 #include "deformableparticle.h"
89 #include "pictureaffector.h"
90
91 QT_BEGIN_NAMESPACE
92
93 void ParticlesPlugin::registerTypes(const char *uri)
94 {
95     Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.particles"));
96
97     qmlRegisterType<QDeclarativeParticles>(uri, 1, 0, "Particles");
98     qmlRegisterType<QDeclarativeParticleMotion>(uri,1,0,"ParticleMotion");
99     qmlRegisterType<QDeclarativeParticleMotionGravity>(uri,1,0,"ParticleMotionGravity");
100     qmlRegisterType<QDeclarativeParticleMotionLinear>(uri,1,0,"ParticleMotionLinear");
101     qmlRegisterType<QDeclarativeParticleMotionWander>(uri,1,0,"ParticleMotionWander");
102     qmlRegisterType<SpriteState>(uri, 2, 0, "Sprite");
103     qmlRegisterType<SpriteEngine>(uri, 2, 0, "SpriteEngine");
104     qmlRegisterType<SpriteImage>(uri, 2, 0, "SpriteImage");
105
106     qmlRegisterType<ParticleSystem>(uri, 2, 0, "ParticleSystem");
107
108     qmlRegisterType<ParticleType>(uri, 2, 0, "Particle");
109     qmlRegisterType<ColoredParticle>(uri, 2, 0, "ColoredParticle");
110     qmlRegisterType<SpriteParticle>(uri, 2, 0, "SpriteParticle");
111     qmlRegisterType<ModelParticle>(uri, 2, 0, "ModelParticle");
112     //qmlRegisterType<PairedParticle>(uri, 2, 0, "PairedParticle");
113     qmlRegisterType<DeformableParticle>(uri, 2, 0, "DeformableParticle");
114     qmlRegisterType<SuperParticle>(uri, 2, 0, "SuperParticle");
115     qmlRegisterType<UltraParticle>(uri, 2, 0, "UltraParticle");
116
117     qmlRegisterType<ParticleEmitter>(uri, 2, 0, "ParticleEmitter");
118     qmlRegisterType<TrailsEmitter>(uri, 2, 0, "TrailEmitter");
119     qmlRegisterType<TrailsEmitter>(uri, 2, 0, "BurstEmitter");
120
121     qmlRegisterType<FollowEmitter>(uri, 2, 0, "FollowEmitter");
122     qmlRegisterType<ParticleExtruder>(uri, 2, 0, "Box");
123     qmlRegisterType<EllipseExtruder>(uri, 2, 0, "Ellipse");
124     qmlRegisterType<LineExtruder>(uri, 2, 0, "Line");
125     qmlRegisterType<MaskExtruder>(uri, 2, 0, "Mask");
126
127     qmlRegisterType<VaryingVector>(uri, 2, 0, "NullVector");
128     qmlRegisterType<PointVector>(uri, 2, 0, "PointVector");
129     qmlRegisterType<AngledVector>(uri, 2, 0, "AngleVector");
130     qmlRegisterType<DirectedVector>(uri, 2, 0, "DirectedVector");
131
132     qmlRegisterType<ParticleAffector>(uri, 2, 0, "ParticleAffector");
133     qmlRegisterType<WanderAffector>(uri, 2, 0, "Wander");
134     //qmlRegisterType<ScalingAffector>(uri, 2, 0, "Scale");
135     //qmlRegisterType<RockingAffector>(uri, 2, 0, "Rocking");
136     qmlRegisterType<DriftAffector>(uri, 2, 0, "Drift");
137     qmlRegisterType<FrictionAffector>(uri, 2, 0, "Friction");
138     qmlRegisterType<GravitationalSingularityAffector>(uri, 2, 0, "GravitationalSingularity");
139     qmlRegisterType<AttractorAffector>(uri, 2, 0, "Attractor");
140     qmlRegisterType<MeanderAffector>(uri, 2, 0, "Meander");
141     qmlRegisterType<SpeedLimitAffector>(uri, 2, 0, "SpeedLimit");
142     qmlRegisterType<GravityAffector>(uri, 2, 0, "Gravity");
143     qmlRegisterType<EternalAffector>(uri, 2, 0, "Stasis");
144     qmlRegisterType<ResetAffector>(uri, 2, 0, "Reset");
145     //qmlRegisterType<ZoneAffector>(uri, 2, 0, "Zone");
146     //qmlRegisterType<ToggleAffector>(uri, 2, 0, "Toggle");
147     qmlRegisterType<KillAffector>(uri, 2, 0, "Kill");
148     qmlRegisterType<SpriteGoalAffector>(uri, 2, 0, "SpriteGoal");
149     qmlRegisterType<SwarmAffector>(uri, 2, 0 , "Swarm");
150     qmlRegisterType<TurbulenceAffector>(uri, 2, 0 , "Turbulence");
151     qmlRegisterType<PictureAffector>(uri, 2, 0, "Picture");
152 }
153
154 QT_END_NAMESPACE
155
156 Q_EXPORT_PLUGIN2(Particles, QT_PREPEND_NAMESPACE(ParticlesPlugin))