124 //construct |
123 //construct |
125 CWsClient(); |
124 CWsClient(); |
126 CWsScreenDevice* iScreen; |
125 CWsScreenDevice* iScreen; |
127 RWsSession iWs; |
126 RWsSession iWs; |
128 public: |
127 public: |
129 void ConstructL(); |
128 void ConstructL(CBupPlugin* aSampler); |
130 // destruct |
129 // destruct |
131 ~CWsClient(); |
130 ~CWsClient(); |
132 // main window |
131 // main window |
133 virtual void ConstructMainWindowL(); |
132 virtual void ConstructMainWindowL(); |
134 // terminate cleanly |
|
135 void Exit(); |
133 void Exit(); |
136 // active object protocol |
134 // active object protocol |
137 void IssueRequest(); // request an event |
135 void IssueRequest(); // request an event |
138 void DoCancel(); // cancel the request |
136 void DoCancel(); // cancel the request |
139 virtual TInt RunError(TInt aError) = 0; |
|
140 virtual void RunL() = 0; // handle completed request |
137 virtual void RunL() = 0; // handle completed request |
141 virtual void HandleKeyEventL (TKeyEvent& aKeyEvent) = 0; |
138 virtual void HandleKeyEventL (TKeyEvent& aKeyEvent) = 0; |
142 |
139 virtual void HandleEvent(TInt c) = 0; |
143 RWindowGroup Group() {return iGroup;}; |
140 RWindowGroup Group() {return iGroup;}; |
144 |
141 CBupPlugin* GetSampler(); |
145 private: |
142 private: |
146 RWindowGroup iGroup; |
143 RWindowGroup iGroup; |
147 CWindowGc* iGc; |
144 CWindowGc* iGc; |
148 friend class CWindow; // needs to get at session |
145 friend class CWindow; // needs to get at session |
149 RProperty iProperty; |
146 RProperty iProperty; |
150 |
147 CBupPlugin* iSampler; |
151 }; |
148 }; |
152 |
|
153 |
|
154 |
|
155 class CWindow; |
|
156 |
|
157 class CProfilerButtonListener : public CWsClient |
|
158 { |
|
159 public: |
|
160 static CProfilerButtonListener* NewL(CBupPlugin* aSamplerm); |
|
161 ~CProfilerButtonListener(); |
|
162 private: |
|
163 CProfilerButtonListener(CBupPlugin* aSampler); |
|
164 |
|
165 |
|
166 public: |
|
167 void ConstructMainWindowL(); |
|
168 void HandleKeyEventL (TKeyEvent& aKeyEvent); |
|
169 void RunL(); |
|
170 TInt RunError(TInt aError); |
|
171 TInt StartL(); |
|
172 TInt Stop(); |
|
173 |
|
174 private: |
|
175 TUint8 iSample[8]; |
|
176 |
|
177 CBupPlugin* iSampler; |
|
178 RProfilerTouchEventAnim* iAnim; |
|
179 RAnimDll* iAnimDll; |
|
180 CWindow* iMainWindow; // main window |
|
181 |
|
182 TInt iSampleStartTime; |
|
183 }; |
|
184 |
|
185 |
|
186 |
149 |
187 /* |
150 /* |
188 * |
151 * |
189 * CWindow declaration |
152 * CWindow declaration |
190 * |
153 * |
191 */ |
154 */ |
192 class CWindow : public CBase |
155 class CWindow : public CBase |
193 { |
156 { |
194 protected: |
157 protected: |
195 RWindow iWindow; // window server window |
158 RWindow iWindow; // window server window |
196 TRect iRect; // rectangle re owning window |
159 TRect iRect; // rectangle re owning window |
197 public: |
160 public: |
198 CWindow(CWsClient* aClient); |
161 CWindow(CWsClient* aClient); |
199 void ConstructL (const TRect& aRect, CWindow* aParent=0); |
162 void ConstructL (const TRect& aRect, CWindow* aParent=0); |
200 ~CWindow(); |
163 ~CWindow(); |
201 // access |
164 // access |
202 RWindow& Window(); // our own window |
165 RWindow& Window(); // our own window |
203 CWindowGc* SystemGc(); // system graphics context |
166 CWindowGc* SystemGc(); // system graphics context |
204 |
167 // empty drawing functions |
205 CWsClient* Client() {return iClient;}; |
168 virtual void Draw(const TRect& aRect) = 0; |
206 private: |
169 virtual void HandlePointerEvent (TPointerEvent& aPointerEvent) = 0; |
207 CWsClient* iClient; // client including session and group |
170 |
208 }; |
171 CWsClient* Client() {return iClient;}; |
209 |
172 private: |
|
173 CWsClient* iClient; // client including session and group |
|
174 }; |
|
175 |
|
176 class CMainWindow : public CWindow |
|
177 { |
|
178 public: |
|
179 CMainWindow (CWsClient* aClient); |
|
180 void Draw (const TRect& aRect); |
|
181 ~CMainWindow (); |
|
182 void HandlePointerEvent (TPointerEvent& aPointerEvent); |
|
183 void ConstructL (const TRect& aRect, CWindow* aParent=0); |
|
184 }; |
|
185 |
|
186 class CProfilerButtonListener : public CWsClient |
|
187 { |
|
188 public: |
|
189 CProfilerButtonListener(); |
|
190 void ConstructMainWindowL(); |
|
191 ~CProfilerButtonListener(); |
|
192 void RunL(); |
|
193 void DoCancel(); |
|
194 void HandleKeyEventL (TKeyEvent& aKeyEvent); |
|
195 void HandleEvent(TInt c); |
|
196 private: |
|
197 CMainWindow* iMainWindow; // main window |
|
198 TInt iSampleStartTime; |
|
199 TUint8 iSample[8]; |
|
200 RProfilerTouchEventAnim* iAnim; |
|
201 RAnimDll* iAnimDll; |
|
202 }; |
210 |
203 |
211 #endif |
204 #endif |