1 /****************************************************************************
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
7 ** This file is part of the Declarative module of the Qt Toolkit.
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
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.
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.
28 ** If you have questions regarding the use of this file, please contact
29 ** Nokia at qt-info@nokia.com.
40 ****************************************************************************/
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"
70 #include "coloredparticle.h"
71 #include "spriteparticle.h"
72 #include "modelparticle.h"
73 #include "superparticle.h"
74 #include "ultraparticle.h"
75 //#include "pairedparticle.h"
76 #include "spriteimage.h"
77 #include "followemitter.h"
78 #include "particleextruder.h"
79 #include "ellipseextruder.h"
80 #include "lineextruder.h"
81 #include "maskextruder.h"
82 #include "varyingvector.h"
83 #include "pointvector.h"
84 #include "angledvector.h"
85 #include "directedvector.h"
86 //#include "followaffector.h"
87 #include "deformableparticle.h"
88 #include "pictureaffector.h"
92 void ParticlesPlugin::registerTypes(const char *uri)
94 Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.particles"));
96 qmlRegisterType<QDeclarativeParticles>(uri, 1, 0, "Particles");
97 qmlRegisterType<QDeclarativeParticleMotion>(uri,1,0,"ParticleMotion");
98 qmlRegisterType<QDeclarativeParticleMotionGravity>(uri,1,0,"ParticleMotionGravity");
99 qmlRegisterType<QDeclarativeParticleMotionLinear>(uri,1,0,"ParticleMotionLinear");
100 qmlRegisterType<QDeclarativeParticleMotionWander>(uri,1,0,"ParticleMotionWander");
101 qmlRegisterType<SpriteState>(uri, 2, 0, "Sprite");
102 qmlRegisterType<SpriteEngine>(uri, 2, 0, "SpriteEngine");
103 qmlRegisterType<SpriteImage>(uri, 2, 0, "SpriteImage");
105 qmlRegisterType<ParticleSystem>(uri, 2, 0, "ParticleSystem");
107 qmlRegisterType<ParticleType>(uri, 2, 0, "Particle");
108 qmlRegisterType<ColoredParticle>(uri, 2, 0, "ColoredParticle");
109 qmlRegisterType<SpriteParticle>(uri, 2, 0, "SpriteParticle");
110 qmlRegisterType<ModelParticle>(uri, 2, 0, "ModelParticle");
111 //qmlRegisterType<PairedParticle>(uri, 2, 0, "PairedParticle");
112 qmlRegisterType<DeformableParticle>(uri, 2, 0, "DeformableParticle");
113 qmlRegisterType<SuperParticle>(uri, 2, 0, "SuperParticle");
114 qmlRegisterType<UltraParticle>(uri, 2, 0, "UltraParticle");
116 qmlRegisterType<ParticleEmitter>(uri, 2, 0, "ParticleEmitter");
117 qmlRegisterType<TrailsEmitter>(uri, 2, 0, "TrailEmitter");
119 qmlRegisterType<FollowEmitter>(uri, 2, 0, "FollowEmitter");
120 qmlRegisterType<ParticleExtruder>(uri, 2, 0, "Box");
121 qmlRegisterType<EllipseExtruder>(uri, 2, 0, "Ellipse");
122 qmlRegisterType<LineExtruder>(uri, 2, 0, "Line");
123 qmlRegisterType<MaskExtruder>(uri, 2, 0, "Mask");
125 qmlRegisterType<VaryingVector>(uri, 2, 0, "NullVector");
126 qmlRegisterType<PointVector>(uri, 2, 0, "PointVector");
127 qmlRegisterType<AngledVector>(uri, 2, 0, "AngleVector");
128 qmlRegisterType<DirectedVector>(uri, 2, 0, "DirectedVector");
130 qmlRegisterType<ParticleAffector>(uri, 2, 0, "ParticleAffector");
131 qmlRegisterType<WanderAffector>(uri, 2, 0, "Wander");
132 //qmlRegisterType<ScalingAffector>(uri, 2, 0, "Scale");
133 //qmlRegisterType<RockingAffector>(uri, 2, 0, "Rocking");
134 qmlRegisterType<DriftAffector>(uri, 2, 0, "Drift");
135 qmlRegisterType<FrictionAffector>(uri, 2, 0, "Friction");
136 qmlRegisterType<GravitationalSingularityAffector>(uri, 2, 0, "GravitationalSingularity");
137 qmlRegisterType<AttractorAffector>(uri, 2, 0, "Attractor");
138 qmlRegisterType<MeanderAffector>(uri, 2, 0, "Meander");
139 qmlRegisterType<SpeedLimitAffector>(uri, 2, 0, "SpeedLimit");
140 qmlRegisterType<GravityAffector>(uri, 2, 0, "Gravity");
141 qmlRegisterType<EternalAffector>(uri, 2, 0, "Stasis");
142 qmlRegisterType<ResetAffector>(uri, 2, 0, "Reset");
143 //qmlRegisterType<ZoneAffector>(uri, 2, 0, "Zone");
144 //qmlRegisterType<ToggleAffector>(uri, 2, 0, "Toggle");
145 qmlRegisterType<KillAffector>(uri, 2, 0, "Kill");
146 qmlRegisterType<SpriteGoalAffector>(uri, 2, 0, "SpriteGoal");
147 qmlRegisterType<SwarmAffector>(uri, 2, 0 , "Swarm");
148 qmlRegisterType<TurbulenceAffector>(uri, 2, 0 , "Turbulence");
149 qmlRegisterType<PictureAffector>(uri, 2, 0, "Picture");
154 Q_EXPORT_PLUGIN2(Particles, QT_PREPEND_NAMESPACE(ParticlesPlugin))