53 // --------------------------------------------------------------------------- |
53 // --------------------------------------------------------------------------- |
54 // |
54 // |
55 CAknFormPhysics* CAknFormPhysics::NewL( CEikDialogPage& aParent, |
55 CAknFormPhysics* CAknFormPhysics::NewL( CEikDialogPage& aParent, |
56 CAknRecordingGc& aRecordingGc ) |
56 CAknRecordingGc& aRecordingGc ) |
57 { |
57 { |
|
58 _AKNTRACE_FUNC_ENTER; |
58 CAknFormPhysics* self = new ( ELeave ) CAknFormPhysics( aParent, |
59 CAknFormPhysics* self = new ( ELeave ) CAknFormPhysics( aParent, |
59 aRecordingGc ); |
60 aRecordingGc ); |
60 CleanupStack::PushL( self ); |
61 CleanupStack::PushL( self ); |
61 self->ConstructL(); |
62 self->ConstructL(); |
62 CleanupStack::Pop( self ); |
63 CleanupStack::Pop( self ); |
|
64 _AKNTRACE_FUNC_EXIT; |
63 return self; |
65 return self; |
64 } |
66 } |
65 |
67 |
66 |
68 |
67 // --------------------------------------------------------------------------- |
69 // --------------------------------------------------------------------------- |
68 // CAknFormPhysics::~CAknFormPhysics |
70 // CAknFormPhysics::~CAknFormPhysics |
69 // --------------------------------------------------------------------------- |
71 // --------------------------------------------------------------------------- |
70 // |
72 // |
71 CAknFormPhysics::~CAknFormPhysics() |
73 CAknFormPhysics::~CAknFormPhysics() |
72 { |
74 { |
|
75 _AKNTRACE_FUNC_ENTER; |
73 delete iPhysics; |
76 delete iPhysics; |
|
77 _AKNTRACE_FUNC_EXIT; |
74 } |
78 } |
75 |
79 |
76 |
80 |
77 // --------------------------------------------------------------------------- |
81 // --------------------------------------------------------------------------- |
78 // CAknFormPhysics::InitPhysicsL |
82 // CAknFormPhysics::InitPhysicsL |
79 // --------------------------------------------------------------------------- |
83 // --------------------------------------------------------------------------- |
80 // |
84 // |
81 void CAknFormPhysics::InitPhysicsL( const TSize& aWorldSize, |
85 void CAknFormPhysics::InitPhysicsL( const TSize& aWorldSize, |
82 const TSize& aViewSize, const TPoint& aViewCenter ) |
86 const TSize& aViewSize, const TPoint& aViewCenter ) |
83 { |
87 { |
|
88 _AKNTRACE_FUNC_ENTER; |
84 iPhysics->InitPhysicsL( aWorldSize, aViewSize, EFalse ); |
89 iPhysics->InitPhysicsL( aWorldSize, aViewSize, EFalse ); |
85 iViewCenter = aViewCenter; |
90 iViewCenter = aViewCenter; |
86 iWorldSize = aWorldSize; |
91 iWorldSize = aWorldSize; |
87 iViewSize = aViewSize; |
92 iViewSize = aViewSize; |
|
93 _AKNTRACE_FUNC_EXIT; |
88 } |
94 } |
89 |
95 |
90 |
96 |
91 // --------------------------------------------------------------------------- |
97 // --------------------------------------------------------------------------- |
92 // CAknFormPhysics::Stop |
98 // CAknFormPhysics::Stop |
93 // --------------------------------------------------------------------------- |
99 // --------------------------------------------------------------------------- |
94 // |
100 // |
95 void CAknFormPhysics::Stop() |
101 void CAknFormPhysics::Stop() |
96 { |
102 { |
|
103 _AKNTRACE_FUNC_ENTER; |
97 iPhysics->StopPhysics(); |
104 iPhysics->StopPhysics(); |
98 iPhysics->ResetFriction(); |
105 iPhysics->ResetFriction(); |
|
106 _AKNTRACE_FUNC_EXIT; |
99 } |
107 } |
100 |
108 |
101 |
109 |
102 // --------------------------------------------------------------------------- |
110 // --------------------------------------------------------------------------- |
103 // CAknFormPhysics::StartFlick |
111 // CAknFormPhysics::StartFlick |
104 // --------------------------------------------------------------------------- |
112 // --------------------------------------------------------------------------- |
105 // |
113 // |
106 TBool CAknFormPhysics::StartFlick( const TPoint& aLength, |
114 TBool CAknFormPhysics::StartFlick( const TPoint& aLength, |
107 const TTime& aStartTime ) |
115 const TTime& aStartTime ) |
108 { |
116 { |
|
117 _AKNTRACE_FUNC_ENTER; |
109 if ( PhysicsAllowed() ) |
118 if ( PhysicsAllowed() ) |
110 { |
119 { |
111 TPoint drag( aLength ); |
120 TPoint drag( aLength ); |
112 if ( iPhysics->StartPhysics( drag, aStartTime ) ) |
121 if ( iPhysics->StartPhysics( drag, aStartTime ) ) |
113 { |
122 { |
157 // CAknFormPhysics::SetPanningPosition |
167 // CAknFormPhysics::SetPanningPosition |
158 // --------------------------------------------------------------------------- |
168 // --------------------------------------------------------------------------- |
159 // |
169 // |
160 void CAknFormPhysics::SetPanningPosition( const TPoint& aDelta ) |
170 void CAknFormPhysics::SetPanningPosition( const TPoint& aDelta ) |
161 { |
171 { |
|
172 _AKNTRACE_FUNC_ENTER; |
162 if ( PhysicsAllowed() && iPhysics ) |
173 if ( PhysicsAllowed() && iPhysics ) |
163 { |
174 { |
164 iPhysics->RegisterPanningPosition( aDelta ); |
175 iPhysics->RegisterPanningPosition( aDelta ); |
165 } |
176 } |
|
177 _AKNTRACE_FUNC_EXIT; |
166 } |
178 } |
167 |
179 |
168 |
180 |
169 // --------------------------------------------------------------------------- |
181 // --------------------------------------------------------------------------- |
170 // CAknFormPhysics::ViewPositionChanged |
182 // CAknFormPhysics::ViewPositionChanged |
198 |
213 |
199 TBuf<128> msg; |
214 TBuf<128> msg; |
200 msg.Format( _L( "%dfps" ), fps ); |
215 msg.Format( _L( "%dfps" ), fps ); |
201 |
216 |
202 iParent.ScrollCacheByPixels( iViewCenter.iY, msg, aDrawNow ); |
217 iParent.ScrollCacheByPixels( iViewCenter.iY, msg, aDrawNow ); |
|
218 _AKNTRACE_FUNC_EXIT; |
203 } |
219 } |
204 |
220 |
205 |
221 |
206 // --------------------------------------------------------------------------- |
222 // --------------------------------------------------------------------------- |
207 // CAknFormPhysics::PhysicEmulationEnded |
223 // CAknFormPhysics::PhysicEmulationEnded |
208 // --------------------------------------------------------------------------- |
224 // --------------------------------------------------------------------------- |
209 // |
225 // |
210 void CAknFormPhysics::PhysicEmulationEnded() |
226 void CAknFormPhysics::PhysicEmulationEnded() |
211 { |
227 { |
|
228 _AKNTRACE_FUNC_ENTER; |
212 iParent.Synchronize(); |
229 iParent.Synchronize(); |
213 iFrameCount = -1; |
230 iFrameCount = -1; |
|
231 _AKNTRACE_FUNC_EXIT; |
214 } |
232 } |
215 |
233 |
216 |
234 |
217 // --------------------------------------------------------------------------- |
235 // --------------------------------------------------------------------------- |
218 // CAknFormPhysics::ViewPosition |
236 // CAknFormPhysics::ViewPosition |