sl@0
|
1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// Shell to launch test code
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
#include <e32std.h>
|
sl@0
|
19 |
#include <f32file.h>
|
sl@0
|
20 |
#include "W32STD.H"
|
sl@0
|
21 |
#include "../SERVER/w32cmd.h"
|
sl@0
|
22 |
#include <e32svr.h>
|
sl@0
|
23 |
#include <hal.h>
|
sl@0
|
24 |
#include "../test/tlib/testbase.h"
|
sl@0
|
25 |
#include "../test/TClick/CLICK.H"
|
sl@0
|
26 |
|
sl@0
|
27 |
#define __USING_PROCESS_
|
sl@0
|
28 |
|
sl@0
|
29 |
#if !defined(__USING_PROCESS_)
|
sl@0
|
30 |
#define RP_FILENAME_SET _L(".DLL")
|
sl@0
|
31 |
#endif
|
sl@0
|
32 |
|
sl@0
|
33 |
#define THE_PASSWORD _L("pass")
|
sl@0
|
34 |
#define INDEX_FOR_SHELL_TEST 0
|
sl@0
|
35 |
#define SHELL_TEST_NAME _L("ShellTest")
|
sl@0
|
36 |
#define INDEX_FOR_RESTART_TEST 1
|
sl@0
|
37 |
#define RESTART_TEST_NAME _L("RestartTest")
|
sl@0
|
38 |
#define INDEX_FOR_RESTART_EVENT_TEST 2
|
sl@0
|
39 |
#define RESTART_EVENT_TEST_NAME _L("RestartEventTest")
|
sl@0
|
40 |
|
sl@0
|
41 |
const TInt EDoubleClickTime=500000;
|
sl@0
|
42 |
const TInt EDoubleClickDistance=16;
|
sl@0
|
43 |
|
sl@0
|
44 |
#ifndef __USING_PROCESS_
|
sl@0
|
45 |
LOCAL_D const TUint KHeapSize=0x400000;
|
sl@0
|
46 |
#endif
|
sl@0
|
47 |
|
sl@0
|
48 |
enum TShellPanic
|
sl@0
|
49 |
{
|
sl@0
|
50 |
EShellPanicRunningProcessCancel,
|
sl@0
|
51 |
EShellPanicTemp,
|
sl@0
|
52 |
EShellPanicRunningProcessNullPtr,
|
sl@0
|
53 |
EShellPanicPassword,
|
sl@0
|
54 |
};
|
sl@0
|
55 |
|
sl@0
|
56 |
typedef TInt (*DllTestAppEntryPoint)(TAny *aParam);
|
sl@0
|
57 |
|
sl@0
|
58 |
class CShellClient;
|
sl@0
|
59 |
|
sl@0
|
60 |
class RShellWsSession : public RWsSession
|
sl@0
|
61 |
{
|
sl@0
|
62 |
public:
|
sl@0
|
63 |
static void Shutdown();
|
sl@0
|
64 |
void SendShutdown();
|
sl@0
|
65 |
};
|
sl@0
|
66 |
|
sl@0
|
67 |
class MProcessObserver
|
sl@0
|
68 |
{
|
sl@0
|
69 |
public:
|
sl@0
|
70 |
virtual void ProcessDied()=0;
|
sl@0
|
71 |
};
|
sl@0
|
72 |
|
sl@0
|
73 |
class CRunningProcess : public CActive
|
sl@0
|
74 |
{
|
sl@0
|
75 |
public:
|
sl@0
|
76 |
CRunningProcess(MProcessObserver* aObserver);
|
sl@0
|
77 |
~CRunningProcess();
|
sl@0
|
78 |
void ConstructL(const TDesC& aName);
|
sl@0
|
79 |
void ConstructTestExecuteL(const TDesC &aName);
|
sl@0
|
80 |
void Link(CRunningProcess** aRpPtr);
|
sl@0
|
81 |
#if defined(__USING_PROCESS_)
|
sl@0
|
82 |
inline RProcess& Process() {return iProcess;}
|
sl@0
|
83 |
#else
|
sl@0
|
84 |
inline RThread& Process() {return iProcess;}
|
sl@0
|
85 |
#endif
|
sl@0
|
86 |
private:
|
sl@0
|
87 |
virtual void DoCancel();
|
sl@0
|
88 |
virtual void RunL();
|
sl@0
|
89 |
private:
|
sl@0
|
90 |
#if defined(__WINS__)
|
sl@0
|
91 |
RLibrary iLib;
|
sl@0
|
92 |
#endif
|
sl@0
|
93 |
#if defined(__USING_PROCESS_)
|
sl@0
|
94 |
RProcess iProcess;
|
sl@0
|
95 |
#else
|
sl@0
|
96 |
RThread iProcess;
|
sl@0
|
97 |
#endif
|
sl@0
|
98 |
CRunningProcess* iNext;
|
sl@0
|
99 |
CRunningProcess** iPrevPtr;
|
sl@0
|
100 |
TParse iFileName;
|
sl@0
|
101 |
MProcessObserver* iObserver;
|
sl@0
|
102 |
};
|
sl@0
|
103 |
|
sl@0
|
104 |
class CShellErrorDialog : public CTDialog
|
sl@0
|
105 |
{
|
sl@0
|
106 |
public:
|
sl@0
|
107 |
CShellErrorDialog(CTWindowGroup *aGroupWin,CWindowGc *aGc);
|
sl@0
|
108 |
void ButtonPressL(TInt aButton);
|
sl@0
|
109 |
void ConstructLD();
|
sl@0
|
110 |
private:
|
sl@0
|
111 |
CTWindowGroup *iGroupWin;
|
sl@0
|
112 |
CWindowGc *iGc;
|
sl@0
|
113 |
};
|
sl@0
|
114 |
|
sl@0
|
115 |
class CTCalibWindow : public CTWin
|
sl@0
|
116 |
{
|
sl@0
|
117 |
public:
|
sl@0
|
118 |
CTCalibWindow();
|
sl@0
|
119 |
void InitWin();
|
sl@0
|
120 |
void DrawPoint(const TPoint &aPoint, const TDesC &aText);
|
sl@0
|
121 |
void Draw();
|
sl@0
|
122 |
void PointerL(const TPointerEvent &aPointer,const TTime& aTime);
|
sl@0
|
123 |
private:
|
sl@0
|
124 |
TInt iCount;
|
sl@0
|
125 |
TDigitizerCalibration iCalibPoints;
|
sl@0
|
126 |
TDigitizerCalibration iReturnValues;
|
sl@0
|
127 |
};
|
sl@0
|
128 |
|
sl@0
|
129 |
|
sl@0
|
130 |
class CListWindow : public CTTitledWindow
|
sl@0
|
131 |
{
|
sl@0
|
132 |
public:
|
sl@0
|
133 |
CListWindow();
|
sl@0
|
134 |
void CloseWindow();
|
sl@0
|
135 |
void ConstructL(CTWinBase &parent, TBool aExitOnEscape);
|
sl@0
|
136 |
void Draw();
|
sl@0
|
137 |
virtual void SelectedL(TInt aIndex)=0;
|
sl@0
|
138 |
virtual void WinKeyL(const TKeyEvent &aKey,const TTime& aTime);
|
sl@0
|
139 |
void SetExt(const TPoint &aPos, const TSize &aSize);
|
sl@0
|
140 |
void SetSize(const TSize &);
|
sl@0
|
141 |
protected:
|
sl@0
|
142 |
virtual TPtrC GetText(TInt aLine)=0;
|
sl@0
|
143 |
virtual TInt ListCount()=0;
|
sl@0
|
144 |
void SetSize();
|
sl@0
|
145 |
void PointerL(const TPointerEvent &aPointer,const TTime& aTime);
|
sl@0
|
146 |
private:
|
sl@0
|
147 |
void Resized(const TSize &aSize);
|
sl@0
|
148 |
void SetListPos(TInt aNewPos);
|
sl@0
|
149 |
TInt TextRowHeight() const;
|
sl@0
|
150 |
void RowBox(TRect &aRect, TInt aRow) const;
|
sl@0
|
151 |
private:
|
sl@0
|
152 |
TRgb iColorMap[4];
|
sl@0
|
153 |
TInt iListPos;
|
sl@0
|
154 |
TTime iPrevTime;
|
sl@0
|
155 |
TBool iExitOnEscape;
|
sl@0
|
156 |
};
|
sl@0
|
157 |
|
sl@0
|
158 |
class CShellWindow : public CListWindow, public MProcessObserver
|
sl@0
|
159 |
{
|
sl@0
|
160 |
public:
|
sl@0
|
161 |
CShellWindow();
|
sl@0
|
162 |
~CShellWindow();
|
sl@0
|
163 |
void ConstructL(CTWinBase &parent);
|
sl@0
|
164 |
TBool RunClientL(const TDesC &aName,TBool aTestExecute);
|
sl@0
|
165 |
void SelectedL(TInt aIndex);
|
sl@0
|
166 |
virtual void WinKeyL(const TKeyEvent &aKey,const TTime& aTime);
|
sl@0
|
167 |
void ForegroundAppDialogL();
|
sl@0
|
168 |
void HeapCountDialogL();
|
sl@0
|
169 |
void SetPointerZone(TInt aZone);
|
sl@0
|
170 |
void SetAutoLaunch(TBool aAutoLaunch);
|
sl@0
|
171 |
// Virtual function defined in CTBaseWin and overriden in CListWindow
|
sl@0
|
172 |
void PointerL(const TPointerEvent &aPointer,const TTime& aTime);
|
sl@0
|
173 |
// Virtual function defined in CTBaseWin and overriden in CTTitledWindow
|
sl@0
|
174 |
void FocusChanged(TBool aState);
|
sl@0
|
175 |
private:
|
sl@0
|
176 |
void DoShellTests();
|
sl@0
|
177 |
void BugHunt();
|
sl@0
|
178 |
void CheckTerminate();
|
sl@0
|
179 |
//Pure virtual functions defined in CListWindow
|
sl@0
|
180 |
TPtrC GetText(TInt aLine);
|
sl@0
|
181 |
TInt ListCount();
|
sl@0
|
182 |
//Pure virtual function defined in MProcessObserver
|
sl@0
|
183 |
void ProcessDied();
|
sl@0
|
184 |
//Simulates SwitchOffEvent
|
sl@0
|
185 |
void SimulateSwitchOffEvent();
|
sl@0
|
186 |
#ifdef SYMBIAN_PROCESS_MONITORING_AND_STARTUP
|
sl@0
|
187 |
//Simulates RestartSystemEvent
|
sl@0
|
188 |
void SimulateRestartEvent();
|
sl@0
|
189 |
//Simulates RestartSystemEvent and test the receiving of off event
|
sl@0
|
190 |
void SimulateAndReceiveRestartEvent();
|
sl@0
|
191 |
#endif
|
sl@0
|
192 |
|
sl@0
|
193 |
private:
|
sl@0
|
194 |
TBool iFailModeEnabled;
|
sl@0
|
195 |
TInt iPointerZone;
|
sl@0
|
196 |
CRunningProcess *iProcessList;
|
sl@0
|
197 |
CArrayFixFlat<TFileName> iFileNames;
|
sl@0
|
198 |
CTPointerCursor *iPointerCursor;
|
sl@0
|
199 |
RSoundPlugIn iClick;
|
sl@0
|
200 |
TInt iCaptureKey;
|
sl@0
|
201 |
TBool iAutoLaunch;
|
sl@0
|
202 |
TInt iNumWindowGroups;
|
sl@0
|
203 |
TBool iIsFocused;
|
sl@0
|
204 |
};
|
sl@0
|
205 |
|
sl@0
|
206 |
class CTIconWindow : public CTBlankWindow
|
sl@0
|
207 |
{
|
sl@0
|
208 |
public:
|
sl@0
|
209 |
CTIconWindow(TInt aType);
|
sl@0
|
210 |
void InitWinL();
|
sl@0
|
211 |
void SetExtentL();
|
sl@0
|
212 |
private:
|
sl@0
|
213 |
TInt iType;
|
sl@0
|
214 |
};
|
sl@0
|
215 |
|
sl@0
|
216 |
class CTPasswordWindow: public CTTitledWindow
|
sl@0
|
217 |
{
|
sl@0
|
218 |
public:
|
sl@0
|
219 |
CTPasswordWindow();
|
sl@0
|
220 |
void InitWin();
|
sl@0
|
221 |
void Draw();
|
sl@0
|
222 |
private:
|
sl@0
|
223 |
TPoint iTextPos;
|
sl@0
|
224 |
};
|
sl@0
|
225 |
|
sl@0
|
226 |
class CTaskListWindow : public CListWindow
|
sl@0
|
227 |
{
|
sl@0
|
228 |
public:
|
sl@0
|
229 |
CTaskListWindow();
|
sl@0
|
230 |
void ConstructL(CTWinBase &parent);
|
sl@0
|
231 |
void SelectedL(TInt aIndex);
|
sl@0
|
232 |
private:
|
sl@0
|
233 |
virtual TPtrC GetText(TInt aLine);
|
sl@0
|
234 |
virtual TInt ListCount();
|
sl@0
|
235 |
private:
|
sl@0
|
236 |
CArrayFixFlat<TInt> iWindowHandles;
|
sl@0
|
237 |
CArrayFixFlat<TFullName> iWindowThreadNames;
|
sl@0
|
238 |
TBuf<KMaxFullName+KMaxName+2> iLatestText;
|
sl@0
|
239 |
};
|
sl@0
|
240 |
|
sl@0
|
241 |
class CShellWindowGroup : public CTWindowGroup
|
sl@0
|
242 |
{
|
sl@0
|
243 |
public:
|
sl@0
|
244 |
CShellWindowGroup(CTClient *aClient);
|
sl@0
|
245 |
~CShellWindowGroup();
|
sl@0
|
246 |
void ConstructL();
|
sl@0
|
247 |
void KeyL(const TKeyEvent &aKey,const TTime& aTime);
|
sl@0
|
248 |
void ErrorMessage(const TWsErrorMessage &aErrorMessage, const TTime &);
|
sl@0
|
249 |
void ScreenDeviceChangedL();
|
sl@0
|
250 |
private:
|
sl@0
|
251 |
TUint32 iCapHandle1;
|
sl@0
|
252 |
TUint32 iCapHandle2;
|
sl@0
|
253 |
TUint32 iCapHandle3;
|
sl@0
|
254 |
TUint32 iCapHandle4;
|
sl@0
|
255 |
};
|
sl@0
|
256 |
|
sl@0
|
257 |
class CIconWindowGroup : public CTWindowGroup
|
sl@0
|
258 |
{
|
sl@0
|
259 |
public:
|
sl@0
|
260 |
CIconWindowGroup(CTClient *aClient);
|
sl@0
|
261 |
void ConstructL();
|
sl@0
|
262 |
};
|
sl@0
|
263 |
|
sl@0
|
264 |
class CPasswordWindowGroup : public CTWindowGroup
|
sl@0
|
265 |
{
|
sl@0
|
266 |
public:
|
sl@0
|
267 |
CPasswordWindowGroup(CTClient *aClient);
|
sl@0
|
268 |
~CPasswordWindowGroup();
|
sl@0
|
269 |
void ConstructL();
|
sl@0
|
270 |
void KeyL(const TKeyEvent &aKey,const TTime&aTime);
|
sl@0
|
271 |
void Cancel();
|
sl@0
|
272 |
void PasswordL(const TTime &aTime);
|
sl@0
|
273 |
private:
|
sl@0
|
274 |
CTPasswordWindow *iWin;
|
sl@0
|
275 |
TBool iPasswordMode;
|
sl@0
|
276 |
};
|
sl@0
|
277 |
|
sl@0
|
278 |
class CShellClient : public CTClient
|
sl@0
|
279 |
{
|
sl@0
|
280 |
public:
|
sl@0
|
281 |
CShellClient();
|
sl@0
|
282 |
~CShellClient();
|
sl@0
|
283 |
void ConstructL();
|
sl@0
|
284 |
void KeyL(const TKeyEvent &aKey,const TTime& aTime);
|
sl@0
|
285 |
void Exit();
|
sl@0
|
286 |
void CreateTestWindowL(CTWin *aWin, const TPoint &aPos);
|
sl@0
|
287 |
void CreateTestWindowL(CTWin *win, const TPoint &aPos, CTWinBase *parent);
|
sl@0
|
288 |
void ErrorDialog(const TDesC &aTitle, TInt aErr);
|
sl@0
|
289 |
void ScreenDeviceChangedL();
|
sl@0
|
290 |
public:
|
sl@0
|
291 |
RFs iFs;
|
sl@0
|
292 |
private:
|
sl@0
|
293 |
TInt iNum;
|
sl@0
|
294 |
CTWindowGroup *iIconGroup;
|
sl@0
|
295 |
CTIconWindow *iIconWin1;
|
sl@0
|
296 |
CTIconWindow *iIconWin2;
|
sl@0
|
297 |
CTPointerCursor *iPointerCursor;
|
sl@0
|
298 |
CPasswordWindowGroup *iPasswordGroup;
|
sl@0
|
299 |
};
|
sl@0
|
300 |
|
sl@0
|
301 |
class ROverrideProtectionInRSessionBase : public RWsSession
|
sl@0
|
302 |
{
|
sl@0
|
303 |
public:
|
sl@0
|
304 |
inline TInt Send(TInt aFunction) const {return(RSessionBase::Send(aFunction,TIpcArgs()));};
|
sl@0
|
305 |
};
|
sl@0
|
306 |
|
sl@0
|
307 |
const TInt Xmove=8;
|
sl@0
|
308 |
const TInt Ymove=6;
|
sl@0
|
309 |
|
sl@0
|
310 |
const TInt ENumPointerCursors=2;
|
sl@0
|
311 |
|
sl@0
|
312 |
void DrawShellDragCursor(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *aParam);
|
sl@0
|
313 |
void DrawShellListCursor(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *aParam);
|
sl@0
|
314 |
|
sl@0
|
315 |
TSpriteCreateParams spriteParams1(TSize(32,32),TPoint(-16,-16),DrawShellListCursor,NULL,EFalse,CGraphicsContext::EDrawModeXOR);
|
sl@0
|
316 |
TSpriteCreateParams spriteParams2(TSize(32,32),TPoint(-16,-16),DrawShellDragCursor,NULL,ETrue,CGraphicsContext::EDrawModePEN);
|
sl@0
|
317 |
|
sl@0
|
318 |
TSpriteCreateParams *PointerParams[ENumPointerCursors]={&spriteParams1,&spriteParams2};
|
sl@0
|
319 |
|
sl@0
|
320 |
|
sl@0
|
321 |
void Panic(TInt aPanic)
|
sl@0
|
322 |
{
|
sl@0
|
323 |
User::Panic(_L("Shell"),aPanic);
|
sl@0
|
324 |
}
|
sl@0
|
325 |
|
sl@0
|
326 |
void RShellWsSession::Shutdown()
|
sl@0
|
327 |
{
|
sl@0
|
328 |
RShellWsSession ShellSession;
|
sl@0
|
329 |
ShellSession.Connect();
|
sl@0
|
330 |
ShellSession.SendShutdown();
|
sl@0
|
331 |
}
|
sl@0
|
332 |
|
sl@0
|
333 |
void RShellWsSession::SendShutdown()
|
sl@0
|
334 |
{
|
sl@0
|
335 |
SendReceive(EWservMessShutdown,TIpcArgs(EWservShutdownCheck));
|
sl@0
|
336 |
}
|
sl@0
|
337 |
|
sl@0
|
338 |
//
|
sl@0
|
339 |
// Sprite drawing functions //
|
sl@0
|
340 |
//
|
sl@0
|
341 |
|
sl@0
|
342 |
void DrawPointerCursor(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *)
|
sl@0
|
343 |
{
|
sl@0
|
344 |
aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 2));
|
sl@0
|
345 |
aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
346 |
aGc->SetPenStyle(CGraphicsContext::ENullPen);
|
sl@0
|
347 |
aGc->DrawRect(TRect(aSize));
|
sl@0
|
348 |
aGc->SetPenStyle(CGraphicsContext::ESolidPen);
|
sl@0
|
349 |
aGc->SetPenColor(TRgb::Gray4(3));
|
sl@0
|
350 |
aGc->SetBrushColor(TRgb::Gray4(3));
|
sl@0
|
351 |
aGc->DrawRect(TRect(0,aSize.iHeight/2-1,aSize.iWidth,aSize.iHeight/2+2));
|
sl@0
|
352 |
aGc->DrawRect(TRect(aSize.iWidth/2-1,0,aSize.iWidth/2+2,aSize.iHeight));
|
sl@0
|
353 |
if (!aDoMask)
|
sl@0
|
354 |
{
|
sl@0
|
355 |
aGc->SetPenColor(TRgb::Gray4(0));
|
sl@0
|
356 |
aGc->DrawLine(TPoint(0,aSize.iHeight/2),TPoint(aSize.iWidth,aSize.iHeight/2));
|
sl@0
|
357 |
aGc->DrawLine(TPoint(aSize.iWidth/2,0),TPoint(aSize.iWidth/2,aSize.iHeight));
|
sl@0
|
358 |
}
|
sl@0
|
359 |
}
|
sl@0
|
360 |
|
sl@0
|
361 |
void DrawShellDragCursor(CBitmapContext *aGc,TInt , const TSize &aSize, TBool aDoMask, TAny *)
|
sl@0
|
362 |
{
|
sl@0
|
363 |
aGc->SetBrushColor(TRgb::Gray4(aDoMask ? 0 : 2));
|
sl@0
|
364 |
aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
365 |
aGc->SetPenStyle(CGraphicsContext::ENullPen);
|
sl@0
|
366 |
aGc->DrawRect(TRect(aSize));
|
sl@0
|
367 |
aGc->SetPenStyle(CGraphicsContext::ESolidPen);
|
sl@0
|
368 |
aGc->SetPenColor(TRgb::Gray4(aDoMask ? 3 : 1));
|
sl@0
|
369 |
for(TInt y=0;y<aSize.iHeight;y++)
|
sl@0
|
370 |
{
|
sl@0
|
371 |
TInt xfact=aSize.iWidth*Abs(y-aSize.iHeight/2)/aSize.iHeight;
|
sl@0
|
372 |
aGc->DrawLine(TPoint(xfact,y),TPoint(aSize.iWidth-xfact,y));
|
sl@0
|
373 |
}
|
sl@0
|
374 |
}
|
sl@0
|
375 |
|
sl@0
|
376 |
void DrawShellListCursor(CBitmapContext *aGc,TInt , const TSize &aSize, TBool , TAny *)
|
sl@0
|
377 |
{
|
sl@0
|
378 |
aGc->SetBrushColor(TRgb::Gray4(0));
|
sl@0
|
379 |
aGc->SetBrushStyle(CGraphicsContext::ESolidBrush);
|
sl@0
|
380 |
aGc->SetPenStyle(CGraphicsContext::ENullPen);
|
sl@0
|
381 |
aGc->DrawRect(TRect(aSize));
|
sl@0
|
382 |
aGc->SetBrushColor(TRgb::Gray4(3));
|
sl@0
|
383 |
aGc->DrawRect(TRect(0,aSize.iHeight/2-1,aSize.iWidth,aSize.iHeight/2+2));
|
sl@0
|
384 |
aGc->DrawRect(TRect(aSize.iWidth/2-1,0,aSize.iWidth/2+2,aSize.iHeight));
|
sl@0
|
385 |
}
|
sl@0
|
386 |
|
sl@0
|
387 |
//
|
sl@0
|
388 |
// Calibration window //
|
sl@0
|
389 |
//
|
sl@0
|
390 |
|
sl@0
|
391 |
CTCalibWindow::CTCalibWindow()
|
sl@0
|
392 |
{
|
sl@0
|
393 |
}
|
sl@0
|
394 |
|
sl@0
|
395 |
void CTCalibWindow::InitWin()
|
sl@0
|
396 |
{
|
sl@0
|
397 |
UserHal::CalibrationPoints(iCalibPoints);
|
sl@0
|
398 |
AssignGC(*Client()->iGc);
|
sl@0
|
399 |
iWin.SetOrdinalPosition(0,1);
|
sl@0
|
400 |
iWin.Activate();
|
sl@0
|
401 |
}
|
sl@0
|
402 |
|
sl@0
|
403 |
void CTCalibWindow::DrawPoint(const TPoint &aPoint, const TDesC &aText)
|
sl@0
|
404 |
{
|
sl@0
|
405 |
iGc->MoveTo(aPoint);
|
sl@0
|
406 |
iGc->MoveBy(TPoint(0,-20));
|
sl@0
|
407 |
iGc->DrawLineBy(TPoint(0,40));
|
sl@0
|
408 |
iGc->MoveBy(TPoint(-20,-20));
|
sl@0
|
409 |
iGc->DrawLineBy(TPoint(40,0));
|
sl@0
|
410 |
iGc->DrawText(aText, aPoint+TPoint(4,-4));
|
sl@0
|
411 |
}
|
sl@0
|
412 |
|
sl@0
|
413 |
void CTCalibWindow::Draw()
|
sl@0
|
414 |
{
|
sl@0
|
415 |
iGc->Clear();
|
sl@0
|
416 |
DrawPoint(iCalibPoints.iTl,_L("1"));
|
sl@0
|
417 |
DrawPoint(iCalibPoints.iBl,_L("2"));
|
sl@0
|
418 |
DrawPoint(iCalibPoints.iTr,_L("3"));
|
sl@0
|
419 |
DrawPoint(iCalibPoints.iBr,_L("4"));
|
sl@0
|
420 |
}
|
sl@0
|
421 |
|
sl@0
|
422 |
void CTCalibWindow::PointerL(const TPointerEvent &aPointer,const TTime& )
|
sl@0
|
423 |
{
|
sl@0
|
424 |
if (aPointer.iType==TPointerEvent::EButton1Down)
|
sl@0
|
425 |
{
|
sl@0
|
426 |
switch(iCount++)
|
sl@0
|
427 |
{
|
sl@0
|
428 |
case 0:
|
sl@0
|
429 |
iReturnValues.iTl=aPointer.iPosition;
|
sl@0
|
430 |
break;
|
sl@0
|
431 |
case 1:
|
sl@0
|
432 |
iReturnValues.iBl=aPointer.iPosition;
|
sl@0
|
433 |
break;
|
sl@0
|
434 |
case 2:
|
sl@0
|
435 |
iReturnValues.iTr=aPointer.iPosition;
|
sl@0
|
436 |
break;
|
sl@0
|
437 |
case 3:
|
sl@0
|
438 |
iReturnValues.iBr=aPointer.iPosition;
|
sl@0
|
439 |
UserHal::SetXYInputCalibration(iReturnValues);
|
sl@0
|
440 |
delete this;
|
sl@0
|
441 |
break;
|
sl@0
|
442 |
}
|
sl@0
|
443 |
}
|
sl@0
|
444 |
}
|
sl@0
|
445 |
|
sl@0
|
446 |
//
|
sl@0
|
447 |
// Error dialog //
|
sl@0
|
448 |
//
|
sl@0
|
449 |
|
sl@0
|
450 |
CShellErrorDialog::CShellErrorDialog(CTWindowGroup *aGroupWin,CWindowGc *aGc) : CTDialog(),
|
sl@0
|
451 |
iGroupWin(aGroupWin),
|
sl@0
|
452 |
iGc(aGc)
|
sl@0
|
453 |
{
|
sl@0
|
454 |
}
|
sl@0
|
455 |
|
sl@0
|
456 |
void CShellErrorDialog::ButtonPressL(TInt aButton)
|
sl@0
|
457 |
{
|
sl@0
|
458 |
if (aButton==0)
|
sl@0
|
459 |
CTDialog::ButtonPressL(aButton);
|
sl@0
|
460 |
}
|
sl@0
|
461 |
|
sl@0
|
462 |
void CShellErrorDialog::ConstructLD()
|
sl@0
|
463 |
{
|
sl@0
|
464 |
CTDialog::ConstructLD(*iGroupWin, *iGc);
|
sl@0
|
465 |
}
|
sl@0
|
466 |
|
sl@0
|
467 |
//
|
sl@0
|
468 |
// Offscreen icon->button window //
|
sl@0
|
469 |
//
|
sl@0
|
470 |
|
sl@0
|
471 |
CTIconWindow::CTIconWindow(TInt aType) : iType(aType)
|
sl@0
|
472 |
{
|
sl@0
|
473 |
}
|
sl@0
|
474 |
|
sl@0
|
475 |
void CTIconWindow::InitWinL()
|
sl@0
|
476 |
{
|
sl@0
|
477 |
SetExtentL();
|
sl@0
|
478 |
iWin.SetShadowDisabled(ETrue);
|
sl@0
|
479 |
Activate();
|
sl@0
|
480 |
}
|
sl@0
|
481 |
|
sl@0
|
482 |
void CTIconWindow::SetExtentL()
|
sl@0
|
483 |
{
|
sl@0
|
484 |
enum {ENumYKeys=5};
|
sl@0
|
485 |
enum {ENumXKeys=9};
|
sl@0
|
486 |
TRect digRect(Client()->iScreen->PointerRect());
|
sl@0
|
487 |
TSize scrSize(Client()->iScreen->SizeInPixels());
|
sl@0
|
488 |
TInt ypos=0;
|
sl@0
|
489 |
TInt count=0;
|
sl@0
|
490 |
iWin.RemoveAllKeyRects();
|
sl@0
|
491 |
if (iType==0)
|
sl@0
|
492 |
{
|
sl@0
|
493 |
for (;count<ENumYKeys;count++)
|
sl@0
|
494 |
{
|
sl@0
|
495 |
TInt oldypos=ypos;
|
sl@0
|
496 |
ypos=digRect.iTl.iY+(count+1)*digRect.Height()/ENumYKeys;
|
sl@0
|
497 |
User::LeaveIfError(iWin.AddKeyRect(TRect(0,oldypos,-digRect.iTl.iX,ypos),'A'+count,ETrue));
|
sl@0
|
498 |
}
|
sl@0
|
499 |
iWin.SetExtent(digRect.iTl,TSize(-digRect.iTl.iX,scrSize.iHeight));
|
sl@0
|
500 |
}
|
sl@0
|
501 |
else
|
sl@0
|
502 |
{
|
sl@0
|
503 |
TInt xpos=0;
|
sl@0
|
504 |
for (count=0;count<ENumXKeys;count++)
|
sl@0
|
505 |
{
|
sl@0
|
506 |
TInt oldxpos=xpos;
|
sl@0
|
507 |
xpos=digRect.iTl.iY+(count+1)*digRect.Width()/ENumXKeys;
|
sl@0
|
508 |
User::LeaveIfError(iWin.AddKeyRect(TRect(oldxpos,0,xpos,digRect.iBr.iY-scrSize.iHeight), EStdKeyF1+count, EFalse));
|
sl@0
|
509 |
}
|
sl@0
|
510 |
iWin.SetExtent(TPoint(digRect.iTl.iX,scrSize.iHeight),TSize(digRect.Width(),digRect.Height()-scrSize.iHeight));
|
sl@0
|
511 |
}
|
sl@0
|
512 |
}
|
sl@0
|
513 |
|
sl@0
|
514 |
//
|
sl@0
|
515 |
// Individual window sub-classes
|
sl@0
|
516 |
//
|
sl@0
|
517 |
|
sl@0
|
518 |
void CShellClient::ErrorDialog(const TDesC &aTitle, TInt aErr)
|
sl@0
|
519 |
{
|
sl@0
|
520 |
TBuf<0x20> err;
|
sl@0
|
521 |
err.Format(TRefByValue<const TDesC>(_L("Error %d")),aErr);
|
sl@0
|
522 |
DisplayDialog(this, aTitle, err,_L(""));
|
sl@0
|
523 |
}
|
sl@0
|
524 |
|
sl@0
|
525 |
CListWindow::CListWindow() : CTTitledWindow(), iPrevTime(0)
|
sl@0
|
526 |
{
|
sl@0
|
527 |
iColorMap[0]=TRgb::Gray4(0);
|
sl@0
|
528 |
iColorMap[1]=TRgb::Gray4(3);
|
sl@0
|
529 |
iColorMap[2]=TRgb::Gray4(3);
|
sl@0
|
530 |
iColorMap[3]=TRgb::Gray4(0);
|
sl@0
|
531 |
}
|
sl@0
|
532 |
|
sl@0
|
533 |
void CListWindow::CloseWindow()
|
sl@0
|
534 |
{
|
sl@0
|
535 |
CTClient *client=((CShellClient *)Client());
|
sl@0
|
536 |
CTWin::Delete(this);
|
sl@0
|
537 |
client->ResetFocus();
|
sl@0
|
538 |
}
|
sl@0
|
539 |
|
sl@0
|
540 |
void CListWindow::SetExt(const TPoint &aPos, const TSize &)
|
sl@0
|
541 |
{
|
sl@0
|
542 |
SetPos(aPos);
|
sl@0
|
543 |
}
|
sl@0
|
544 |
|
sl@0
|
545 |
void CListWindow::SetSize(const TSize &)
|
sl@0
|
546 |
{
|
sl@0
|
547 |
}
|
sl@0
|
548 |
|
sl@0
|
549 |
void CListWindow::SetSize()
|
sl@0
|
550 |
{
|
sl@0
|
551 |
iSize.iHeight=ListCount()*(iFont->HeightInPixels()+1)+iTitleHeight+2;
|
sl@0
|
552 |
iSize.iWidth=iFont->TextWidthInPixels(*Client()->Title())+30;
|
sl@0
|
553 |
for(TInt index=0;index<ListCount();index++)
|
sl@0
|
554 |
{
|
sl@0
|
555 |
TInt wid=iFont->TextWidthInPixels(GetText(index));
|
sl@0
|
556 |
if (wid>iSize.iWidth)
|
sl@0
|
557 |
iSize.iWidth=wid;
|
sl@0
|
558 |
}
|
sl@0
|
559 |
iSize.iWidth+=4;
|
sl@0
|
560 |
iWin.SetSize(iSize);
|
sl@0
|
561 |
Resized(iSize);
|
sl@0
|
562 |
}
|
sl@0
|
563 |
|
sl@0
|
564 |
void CListWindow::ConstructL(CTWinBase &parent, TBool aExitOnEscape)
|
sl@0
|
565 |
{
|
sl@0
|
566 |
iExitOnEscape=aExitOnEscape;
|
sl@0
|
567 |
CTTitledWindow::ConstructL(parent);
|
sl@0
|
568 |
}
|
sl@0
|
569 |
|
sl@0
|
570 |
void CListWindow::SetListPos(TInt aNewPos)
|
sl@0
|
571 |
{
|
sl@0
|
572 |
if (aNewPos>=0 && aNewPos<ListCount())
|
sl@0
|
573 |
{
|
sl@0
|
574 |
iListPos=aNewPos;
|
sl@0
|
575 |
Invalidate();
|
sl@0
|
576 |
}
|
sl@0
|
577 |
}
|
sl@0
|
578 |
|
sl@0
|
579 |
void CListWindow::WinKeyL(const TKeyEvent &aKey, const TTime&)
|
sl@0
|
580 |
{
|
sl@0
|
581 |
switch(aKey.iCode)
|
sl@0
|
582 |
{
|
sl@0
|
583 |
case EKeyUpArrow:
|
sl@0
|
584 |
SetListPos(iListPos-1);
|
sl@0
|
585 |
break;
|
sl@0
|
586 |
case EKeyDownArrow:
|
sl@0
|
587 |
SetListPos(iListPos+1);
|
sl@0
|
588 |
break;
|
sl@0
|
589 |
case EKeyEnter:
|
sl@0
|
590 |
SelectedL(iListPos);
|
sl@0
|
591 |
break;
|
sl@0
|
592 |
case EKeyEscape: // Fall through from EKeyEnter
|
sl@0
|
593 |
if (iExitOnEscape)
|
sl@0
|
594 |
CloseWindow();
|
sl@0
|
595 |
break;
|
sl@0
|
596 |
}
|
sl@0
|
597 |
}
|
sl@0
|
598 |
|
sl@0
|
599 |
void CListWindow::PointerL(const TPointerEvent &aPointer,const TTime& aTime)
|
sl@0
|
600 |
{
|
sl@0
|
601 |
if (aPointer.iType==TPointerEvent::EButton1Down)
|
sl@0
|
602 |
{
|
sl@0
|
603 |
TRect rect;
|
sl@0
|
604 |
for(TInt index=0;index<ListCount();index++)
|
sl@0
|
605 |
{
|
sl@0
|
606 |
RowBox(rect,index);
|
sl@0
|
607 |
if (rect.Contains(aPointer.iPosition))
|
sl@0
|
608 |
{
|
sl@0
|
609 |
if (index==iListPos && (aPointer.iModifiers&EModifierDoubleClick /*|| index<=INDEX_FOR_SHELL_TEST*/))
|
sl@0
|
610 |
SelectedL(iListPos);
|
sl@0
|
611 |
else
|
sl@0
|
612 |
{
|
sl@0
|
613 |
iPrevTime=aTime;
|
sl@0
|
614 |
SetListPos(index);
|
sl@0
|
615 |
}
|
sl@0
|
616 |
return;
|
sl@0
|
617 |
}
|
sl@0
|
618 |
}
|
sl@0
|
619 |
}
|
sl@0
|
620 |
CTTitledWindow::PointerL(aPointer,aTime);
|
sl@0
|
621 |
}
|
sl@0
|
622 |
|
sl@0
|
623 |
TInt CListWindow::TextRowHeight() const
|
sl@0
|
624 |
{
|
sl@0
|
625 |
return(iFont->HeightInPixels()+1);
|
sl@0
|
626 |
}
|
sl@0
|
627 |
|
sl@0
|
628 |
void CListWindow::RowBox(TRect &aRect, TInt aRow) const
|
sl@0
|
629 |
{
|
sl@0
|
630 |
aRect.iTl.iX=2;
|
sl@0
|
631 |
aRect.iTl.iY=iTitleHeight+TextRowHeight()*aRow;
|
sl@0
|
632 |
aRect.iBr.iX=iSize.iWidth-2;
|
sl@0
|
633 |
aRect.iBr.iY=aRect.iTl.iY+TextRowHeight();
|
sl@0
|
634 |
}
|
sl@0
|
635 |
|
sl@0
|
636 |
void CListWindow::Draw()
|
sl@0
|
637 |
{
|
sl@0
|
638 |
CTTitledWindow::Draw();
|
sl@0
|
639 |
iGc->SetPenColor(TRgb::Gray16(0));
|
sl@0
|
640 |
TPoint pos(2,iTitleHeight+iFont->AscentInPixels()+2);
|
sl@0
|
641 |
TInt gap=TextRowHeight();
|
sl@0
|
642 |
for(TInt index=0;index<ListCount();index++,pos.iY+=gap)
|
sl@0
|
643 |
{
|
sl@0
|
644 |
iGc->DrawText(GetText(index), pos);
|
sl@0
|
645 |
if (index==iListPos)
|
sl@0
|
646 |
{
|
sl@0
|
647 |
TRect rect;
|
sl@0
|
648 |
RowBox(rect,index);
|
sl@0
|
649 |
iGc->MapColors(rect,iColorMap);
|
sl@0
|
650 |
}
|
sl@0
|
651 |
}
|
sl@0
|
652 |
}
|
sl@0
|
653 |
|
sl@0
|
654 |
void CListWindow::Resized(const TSize &aSize)
|
sl@0
|
655 |
{
|
sl@0
|
656 |
SetDragRect(TRect(0,0,aSize.iWidth,iTitleHeight));
|
sl@0
|
657 |
}
|
sl@0
|
658 |
|
sl@0
|
659 |
//
|
sl@0
|
660 |
// CShellWindow class //
|
sl@0
|
661 |
//
|
sl@0
|
662 |
|
sl@0
|
663 |
CShellWindow::CShellWindow() : CListWindow(), iFileNames(4)
|
sl@0
|
664 |
{
|
sl@0
|
665 |
}
|
sl@0
|
666 |
|
sl@0
|
667 |
CShellWindow::~CShellWindow()
|
sl@0
|
668 |
{
|
sl@0
|
669 |
if (iCaptureKey)
|
sl@0
|
670 |
Client()->iGroup->GroupWin()->CancelCaptureKey(iCaptureKey);
|
sl@0
|
671 |
delete iPointerCursor;
|
sl@0
|
672 |
while(iProcessList)
|
sl@0
|
673 |
delete iProcessList;
|
sl@0
|
674 |
}
|
sl@0
|
675 |
|
sl@0
|
676 |
void CShellWindow::SetPointerZone(TInt aZone)
|
sl@0
|
677 |
{
|
sl@0
|
678 |
TRAPD(err,iPointerCursor->UpdateL(0, PointerParams[aZone]));
|
sl@0
|
679 |
if (err!=KErrNone)
|
sl@0
|
680 |
((CShellClient *)Client())->ErrorDialog(_L("Error Changing Pointer"), err);
|
sl@0
|
681 |
else
|
sl@0
|
682 |
iPointerZone=aZone;
|
sl@0
|
683 |
}
|
sl@0
|
684 |
|
sl@0
|
685 |
void CShellWindow::SetAutoLaunch(TBool aAutoLaunch)
|
sl@0
|
686 |
{
|
sl@0
|
687 |
iAutoLaunch=aAutoLaunch;
|
sl@0
|
688 |
if (aAutoLaunch)
|
sl@0
|
689 |
iNumWindowGroups=Client()->iWs.NumWindowGroups();
|
sl@0
|
690 |
}
|
sl@0
|
691 |
|
sl@0
|
692 |
void CShellWindow::PointerL(const TPointerEvent &aPointer,const TTime& aTime)
|
sl@0
|
693 |
{
|
sl@0
|
694 |
TInt zone=(aPointer.iPosition.iY<iTitleHeight) ? 1 : 0;
|
sl@0
|
695 |
if (iPointerZone!=zone)
|
sl@0
|
696 |
SetPointerZone(zone);
|
sl@0
|
697 |
CListWindow::PointerL(aPointer,aTime);
|
sl@0
|
698 |
}
|
sl@0
|
699 |
|
sl@0
|
700 |
void CShellWindow::ConstructL(CTWinBase &parent)
|
sl@0
|
701 |
{
|
sl@0
|
702 |
CListWindow::ConstructL(parent, EFalse);
|
sl@0
|
703 |
RFile dllList;
|
sl@0
|
704 |
RProcess thisProc;
|
sl@0
|
705 |
TParse dllListFileName;
|
sl@0
|
706 |
#if defined(__USING_PROCESS_)
|
sl@0
|
707 |
TFileName fName(thisProc.FileName());
|
sl@0
|
708 |
User::LeaveIfError(dllListFileName.Set(_L("\\SYSTEM\\DATA\\DLL_LIST.TXT"),&fName,NULL));
|
sl@0
|
709 |
User::LeaveIfError(dllList.Open(((CShellClient *)Client())->iFs,dllListFileName.FullName(),EFileShareReadersOnly|EFileStreamText));
|
sl@0
|
710 |
#else
|
sl@0
|
711 |
User::LeaveIfError(dllList.Open(((CShellClient *)Client())->iFs,_L("Z:\\SYSTEM\\DATA\\DLL_LIST.TXT"),EFileShareReadersOnly|EFileStreamText));
|
sl@0
|
712 |
#endif
|
sl@0
|
713 |
TBuf8<0x200> dllNames;
|
sl@0
|
714 |
User::LeaveIfError(dllList.Read(dllNames));
|
sl@0
|
715 |
dllList.Close();
|
sl@0
|
716 |
TPtrC8 name(dllNames);
|
sl@0
|
717 |
FOREVER
|
sl@0
|
718 |
{
|
sl@0
|
719 |
TInt pos=name.Locate('\r');
|
sl@0
|
720 |
if (pos==KErrNotFound)
|
sl@0
|
721 |
break;
|
sl@0
|
722 |
if (pos<=KMaxFileName)
|
sl@0
|
723 |
{
|
sl@0
|
724 |
TFileName buf;
|
sl@0
|
725 |
buf.Copy(name.Left(pos));
|
sl@0
|
726 |
iFileNames.AppendL(buf);
|
sl@0
|
727 |
}
|
sl@0
|
728 |
name.Set(name.Mid(pos+2));
|
sl@0
|
729 |
};
|
sl@0
|
730 |
SetSize();
|
sl@0
|
731 |
BaseWin()->PointerFilter(EPointerFilterMove|EPointerFilterDrag,0);
|
sl@0
|
732 |
iPointerCursor=new(ELeave) CTPointerCursor(Client()->iWs);
|
sl@0
|
733 |
iPointerCursor->ConstructL(0);
|
sl@0
|
734 |
SetPointerZone(0);
|
sl@0
|
735 |
iWin.SetCustomPointerCursor(iPointerCursor->PointerCursor());
|
sl@0
|
736 |
iClick=RSoundPlugIn(Client()->iWs);
|
sl@0
|
737 |
User::LeaveIfError(iClick.Construct(TUid::Uid(CLICK_THIRD_UID)));
|
sl@0
|
738 |
TBool isChangeAble;
|
sl@0
|
739 |
if (iClick.IsLoaded(isChangeAble))
|
sl@0
|
740 |
{
|
sl@0
|
741 |
TInt ret=Client()->iGroup->GroupWin()->CaptureKey(3,EModifierCtrl|EModifierShift|EModifierFunc
|
sl@0
|
742 |
,EModifierCtrl|EModifierShift|EModifierFunc); //Ctrl-Alt-Shift-C
|
sl@0
|
743 |
User::LeaveIfError(ret);
|
sl@0
|
744 |
iCaptureKey=ret;
|
sl@0
|
745 |
}
|
sl@0
|
746 |
}
|
sl@0
|
747 |
|
sl@0
|
748 |
TBool CShellWindow::RunClientL(const TDesC &aName,TBool aTestExecute)
|
sl@0
|
749 |
{
|
sl@0
|
750 |
if (aName.Length()!=0)
|
sl@0
|
751 |
{
|
sl@0
|
752 |
CRunningProcess* rp=new(ELeave) CRunningProcess(this);
|
sl@0
|
753 |
rp->Link(&iProcessList);
|
sl@0
|
754 |
CActiveScheduler::Add(rp);
|
sl@0
|
755 |
TInt err=KErrNone; //To stop a warning
|
sl@0
|
756 |
if (aTestExecute)
|
sl@0
|
757 |
{
|
sl@0
|
758 |
TRAP(err,rp->ConstructTestExecuteL(aName));
|
sl@0
|
759 |
}
|
sl@0
|
760 |
else
|
sl@0
|
761 |
{
|
sl@0
|
762 |
TRAP(err,rp->ConstructL(aName));
|
sl@0
|
763 |
}
|
sl@0
|
764 |
if (err!=KErrNone)
|
sl@0
|
765 |
{
|
sl@0
|
766 |
delete rp;
|
sl@0
|
767 |
User::Leave(err);
|
sl@0
|
768 |
}
|
sl@0
|
769 |
return ETrue;
|
sl@0
|
770 |
}
|
sl@0
|
771 |
return EFalse;
|
sl@0
|
772 |
}
|
sl@0
|
773 |
|
sl@0
|
774 |
void CShellWindow::SelectedL(TInt aIndex)
|
sl@0
|
775 |
{
|
sl@0
|
776 |
TPtrC name=GetText(aIndex);
|
sl@0
|
777 |
if (aIndex==INDEX_FOR_SHELL_TEST && name==SHELL_TEST_NAME)
|
sl@0
|
778 |
{
|
sl@0
|
779 |
DoShellTests();
|
sl@0
|
780 |
return;
|
sl@0
|
781 |
}
|
sl@0
|
782 |
#ifdef SYMBIAN_PROCESS_MONITORING_AND_STARTUP
|
sl@0
|
783 |
else if (aIndex==INDEX_FOR_RESTART_TEST && name==RESTART_TEST_NAME)
|
sl@0
|
784 |
{
|
sl@0
|
785 |
SimulateRestartEvent();
|
sl@0
|
786 |
return;
|
sl@0
|
787 |
}
|
sl@0
|
788 |
else if (aIndex==INDEX_FOR_RESTART_EVENT_TEST && name==RESTART_EVENT_TEST_NAME)
|
sl@0
|
789 |
{
|
sl@0
|
790 |
SimulateAndReceiveRestartEvent();
|
sl@0
|
791 |
return;
|
sl@0
|
792 |
}
|
sl@0
|
793 |
#endif
|
sl@0
|
794 |
TRAPD(err,RunClientL(GetText(aIndex),EFalse));
|
sl@0
|
795 |
if (err==KErrNotFound)
|
sl@0
|
796 |
{
|
sl@0
|
797 |
TRAP(err,RunClientL(GetText(aIndex),ETrue));
|
sl@0
|
798 |
}
|
sl@0
|
799 |
if (err!=KErrNone)
|
sl@0
|
800 |
((CShellClient *)Client())->ErrorDialog(_L("Error launching process"), err);
|
sl@0
|
801 |
}
|
sl@0
|
802 |
|
sl@0
|
803 |
TPtrC CShellWindow::GetText(TInt aLine)
|
sl@0
|
804 |
{
|
sl@0
|
805 |
return(TPtrC(iFileNames[aLine]));
|
sl@0
|
806 |
}
|
sl@0
|
807 |
|
sl@0
|
808 |
TInt CShellWindow::ListCount()
|
sl@0
|
809 |
{
|
sl@0
|
810 |
return(iFileNames.Count());
|
sl@0
|
811 |
}
|
sl@0
|
812 |
|
sl@0
|
813 |
void CShellWindow::ForegroundAppDialogL()
|
sl@0
|
814 |
{
|
sl@0
|
815 |
TInt focusGroup;
|
sl@0
|
816 |
TName winName;
|
sl@0
|
817 |
TThreadId threadId;
|
sl@0
|
818 |
User::LeaveIfError(focusGroup=Client()->iWs.GetFocusWindowGroup());
|
sl@0
|
819 |
User::LeaveIfError(Client()->iWs.GetWindowGroupClientThreadId(focusGroup, threadId));
|
sl@0
|
820 |
User::LeaveIfError(Client()->iWs.GetWindowGroupNameFromIdentifier(focusGroup,winName));
|
sl@0
|
821 |
RThread thread;
|
sl@0
|
822 |
User::LeaveIfError(thread.Open(threadId));
|
sl@0
|
823 |
CShellErrorDialog *dialog=new(ELeave) CShellErrorDialog(Client()->iGroup, iGc);
|
sl@0
|
824 |
dialog->ConstructLD();
|
sl@0
|
825 |
dialog->SetTitle(_L("The Foreground App Is"));
|
sl@0
|
826 |
dialog->SetLine1(thread.FullName());
|
sl@0
|
827 |
thread.Close();
|
sl@0
|
828 |
dialog->SetLine2(winName);
|
sl@0
|
829 |
dialog->SetNumButtons(1);
|
sl@0
|
830 |
dialog->SetButtonText(0,_L("Okay"));
|
sl@0
|
831 |
if (dialog->Display()!=0)
|
sl@0
|
832 |
Panic(0);
|
sl@0
|
833 |
dialog=NULL;
|
sl@0
|
834 |
}
|
sl@0
|
835 |
|
sl@0
|
836 |
void CShellWindow::HeapCountDialogL()
|
sl@0
|
837 |
{
|
sl@0
|
838 |
CShellErrorDialog *dialog=new(ELeave) CShellErrorDialog(Client()->iGroup, iGc);
|
sl@0
|
839 |
dialog->ConstructLD();
|
sl@0
|
840 |
dialog->SetTitle(_L("Wserv Heap Count"));
|
sl@0
|
841 |
TBuf<0x20> line1;
|
sl@0
|
842 |
line1.Format(TRefByValue<const TDesC>(_L("Count=%d")),Client()->iWs.HeapCount());
|
sl@0
|
843 |
dialog->SetLine1(line1);
|
sl@0
|
844 |
dialog->SetNumButtons(1);
|
sl@0
|
845 |
dialog->SetButtonText(0,_L("Okay"));
|
sl@0
|
846 |
if (dialog->Display()!=0)
|
sl@0
|
847 |
Panic(0);
|
sl@0
|
848 |
dialog=NULL;
|
sl@0
|
849 |
}
|
sl@0
|
850 |
|
sl@0
|
851 |
void CShellWindow::WinKeyL(const TKeyEvent &aKey,const TTime& aTime)
|
sl@0
|
852 |
{
|
sl@0
|
853 |
TBool funcKeyPressed=aKey.iModifiers&EModifierFunc;
|
sl@0
|
854 |
if (aKey.iModifiers&EModifierCtrl)
|
sl@0
|
855 |
{
|
sl@0
|
856 |
switch(aKey.iCode)
|
sl@0
|
857 |
{
|
sl@0
|
858 |
case EKeyLeftArrow:
|
sl@0
|
859 |
{
|
sl@0
|
860 |
TInt col=Client()->iWs.GetBackgroundColor().Gray16();
|
sl@0
|
861 |
if (col>0)
|
sl@0
|
862 |
Client()->iWs.SetBackgroundColor(TRgb::Gray16(col-1));
|
sl@0
|
863 |
}
|
sl@0
|
864 |
break;
|
sl@0
|
865 |
case EKeyRightArrow:
|
sl@0
|
866 |
{
|
sl@0
|
867 |
TInt col=Client()->iWs.GetBackgroundColor().Gray16();
|
sl@0
|
868 |
if (col<15)
|
sl@0
|
869 |
Client()->iWs.SetBackgroundColor(TRgb::Gray16(col+1));
|
sl@0
|
870 |
}
|
sl@0
|
871 |
break;
|
sl@0
|
872 |
case EKeyTab:
|
sl@0
|
873 |
if (funcKeyPressed)
|
sl@0
|
874 |
ForegroundAppDialogL();
|
sl@0
|
875 |
else
|
sl@0
|
876 |
{
|
sl@0
|
877 |
Group()->GroupWin()->SetOrdinalPosition(0);
|
sl@0
|
878 |
((CShellClient *)Client())->CreateTestWindowL(new(ELeave) CTaskListWindow(), TPoint(50,30));
|
sl@0
|
879 |
Client()->ResetFocus();
|
sl@0
|
880 |
}
|
sl@0
|
881 |
break;
|
sl@0
|
882 |
case 1: //Ctrl-A
|
sl@0
|
883 |
case 17: //Ctrl-Q
|
sl@0
|
884 |
SetPos(TPoint(3,(Client()->iScreen->SizeInPixels().iHeight-Size().iHeight)/2));
|
sl@0
|
885 |
break;
|
sl@0
|
886 |
case 2: //Ctrl-B
|
sl@0
|
887 |
case 23: //Ctrl-W
|
sl@0
|
888 |
SetPos(TPoint((Client()->iScreen->SizeInPixels().iWidth-Size().iWidth)/2,(Client()->iScreen->SizeInPixels().iHeight-Size().iHeight)/2));
|
sl@0
|
889 |
break;
|
sl@0
|
890 |
case 3: //Ctrl-C
|
sl@0
|
891 |
case 5: //Ctrl-E
|
sl@0
|
892 |
if (funcKeyPressed && aKey.iModifiers&EModifierShift && aKey.iCode==3) //Ctrl-Alt-Sh-C
|
sl@0
|
893 |
iClick.CommandReply(EClickCommandToggleOutput,TPtrC8(NULL,0));
|
sl@0
|
894 |
else
|
sl@0
|
895 |
SetPos(TPoint(Client()->iScreen->SizeInPixels().iWidth-Size().iWidth-3,(Client()->iScreen->SizeInPixels().iHeight-Size().iHeight)/2));
|
sl@0
|
896 |
break;
|
sl@0
|
897 |
case 18: //Ctrl-R
|
sl@0
|
898 |
{
|
sl@0
|
899 |
CWsScreenDevice* screen=Client()->iScreen;
|
sl@0
|
900 |
TPixelsAndRotation sizeAndRotation;
|
sl@0
|
901 |
screen->GetScreenModeSizeAndRotation(0,sizeAndRotation);
|
sl@0
|
902 |
Client()->iWs.SetPointerCursorArea(0,TRect(sizeAndRotation.iPixelSize));
|
sl@0
|
903 |
screen->SetCurrentRotations(0,CFbsBitGc::EGraphicsOrientationNormal);
|
sl@0
|
904 |
screen->SetScreenMode(0);
|
sl@0
|
905 |
CArrayFixFlat<TInt> *rotations=new(ELeave) CArrayFixFlat<TInt>(1);
|
sl@0
|
906 |
CleanupStack::PushL(rotations);
|
sl@0
|
907 |
TInt numModes=screen->NumScreenModes();
|
sl@0
|
908 |
TInt ii,err;
|
sl@0
|
909 |
for (ii=1;ii<numModes;++ii)
|
sl@0
|
910 |
{
|
sl@0
|
911 |
err=screen->GetRotationsList(ii,rotations);
|
sl@0
|
912 |
if (err==KErrNone)
|
sl@0
|
913 |
screen->SetCurrentRotations(ii,REINTERPRET_CAST(CFbsBitGc::TGraphicsOrientation&,(*rotations)[0]));
|
sl@0
|
914 |
}
|
sl@0
|
915 |
CleanupStack::PopAndDestroy();
|
sl@0
|
916 |
}
|
sl@0
|
917 |
break;
|
sl@0
|
918 |
default:
|
sl@0
|
919 |
goto not_used;
|
sl@0
|
920 |
}
|
sl@0
|
921 |
}
|
sl@0
|
922 |
else if (funcKeyPressed)
|
sl@0
|
923 |
{
|
sl@0
|
924 |
switch(aKey.iCode)
|
sl@0
|
925 |
{
|
sl@0
|
926 |
case 'c':
|
sl@0
|
927 |
{
|
sl@0
|
928 |
CTCalibWindow *win=new(ELeave) CTCalibWindow();
|
sl@0
|
929 |
win->ConstructL(*Client()->iGroup);
|
sl@0
|
930 |
}
|
sl@0
|
931 |
break;
|
sl@0
|
932 |
case 's': // Sleep
|
sl@0
|
933 |
User::After(2000000);
|
sl@0
|
934 |
break;
|
sl@0
|
935 |
case 'd':
|
sl@0
|
936 |
DisplayDialog(_L("Dialog test"),_L("Line of text"),_L(""));
|
sl@0
|
937 |
break;
|
sl@0
|
938 |
case 'o':
|
sl@0
|
939 |
UserHal::SwitchOff();
|
sl@0
|
940 |
break;
|
sl@0
|
941 |
case 'f':
|
sl@0
|
942 |
if (iFailModeEnabled)
|
sl@0
|
943 |
((CShellClient *)Client())->iWs.HeapSetFail(RHeap::ENone,0);
|
sl@0
|
944 |
else
|
sl@0
|
945 |
((CShellClient *)Client())->iWs.HeapSetFail(RHeap::ERandom,20);
|
sl@0
|
946 |
iFailModeEnabled=!iFailModeEnabled;
|
sl@0
|
947 |
break;
|
sl@0
|
948 |
case 'x':
|
sl@0
|
949 |
case 'X':
|
sl@0
|
950 |
if (aKey.iModifiers&EModifierShift)
|
sl@0
|
951 |
RShellWsSession::Shutdown();
|
sl@0
|
952 |
else
|
sl@0
|
953 |
((CShellClient *)Client())->Exit();
|
sl@0
|
954 |
break;
|
sl@0
|
955 |
case 'l':
|
sl@0
|
956 |
Client()->iWs.LogMessage(_L("Hello, this is log test"));
|
sl@0
|
957 |
break;
|
sl@0
|
958 |
case 'h':
|
sl@0
|
959 |
HeapCountDialogL();
|
sl@0
|
960 |
break;
|
sl@0
|
961 |
case 'b':
|
sl@0
|
962 |
BugHunt();
|
sl@0
|
963 |
break;
|
sl@0
|
964 |
case EKeyLeftArrow:
|
sl@0
|
965 |
AdjustSize(-Xmove,0,aKey.iModifiers);
|
sl@0
|
966 |
break;
|
sl@0
|
967 |
case EKeyRightArrow:
|
sl@0
|
968 |
AdjustSize(Xmove,0,aKey.iModifiers);
|
sl@0
|
969 |
break;
|
sl@0
|
970 |
case EKeyUpArrow:
|
sl@0
|
971 |
AdjustSize(0,-Ymove,aKey.iModifiers);
|
sl@0
|
972 |
break;
|
sl@0
|
973 |
case EKeyDownArrow:
|
sl@0
|
974 |
AdjustSize(0,Ymove,aKey.iModifiers);
|
sl@0
|
975 |
break;
|
sl@0
|
976 |
default:
|
sl@0
|
977 |
goto not_used;
|
sl@0
|
978 |
}
|
sl@0
|
979 |
}
|
sl@0
|
980 |
else
|
sl@0
|
981 |
goto not_used;
|
sl@0
|
982 |
return;
|
sl@0
|
983 |
not_used:
|
sl@0
|
984 |
CListWindow::WinKeyL(aKey,aTime);
|
sl@0
|
985 |
}
|
sl@0
|
986 |
|
sl@0
|
987 |
void CShellWindow::FocusChanged(TBool aState)
|
sl@0
|
988 |
{
|
sl@0
|
989 |
CListWindow::FocusChanged(aState);
|
sl@0
|
990 |
iIsFocused=aState;
|
sl@0
|
991 |
CheckTerminate();
|
sl@0
|
992 |
}
|
sl@0
|
993 |
|
sl@0
|
994 |
void CShellWindow::DoShellTests()
|
sl@0
|
995 |
//
|
sl@0
|
996 |
//Doing testing that can only be done from the shell
|
sl@0
|
997 |
//
|
sl@0
|
998 |
{
|
sl@0
|
999 |
/*Group()->GroupWin()->EnableReceiptOfFocus(EFalse);
|
sl@0
|
1000 |
BaseWin()->SetSizeErr(TSize(160,220));
|
sl@0
|
1001 |
Group()->GroupWin()->EnableReceiptOfFocus(ETrue);
|
sl@0
|
1002 |
*/
|
sl@0
|
1003 |
SimulateSwitchOffEvent();
|
sl@0
|
1004 |
}
|
sl@0
|
1005 |
|
sl@0
|
1006 |
/**
|
sl@0
|
1007 |
Sends the raw events to the current registered window session.
|
sl@0
|
1008 |
Since no Window Group is allowed to request the off events,
|
sl@0
|
1009 |
WServ shall handle these raw events.
|
sl@0
|
1010 |
*/
|
sl@0
|
1011 |
void CShellWindow::SimulateSwitchOffEvent()
|
sl@0
|
1012 |
{
|
sl@0
|
1013 |
TRawEvent rawEvent;
|
sl@0
|
1014 |
rawEvent.Set(TRawEvent::ESwitchOff);
|
sl@0
|
1015 |
Client()->iWs.SimulateRawEvent(rawEvent);
|
sl@0
|
1016 |
Client()->iWs.Flush();
|
sl@0
|
1017 |
}
|
sl@0
|
1018 |
|
sl@0
|
1019 |
#ifdef SYMBIAN_PROCESS_MONITORING_AND_STARTUP
|
sl@0
|
1020 |
/**
|
sl@0
|
1021 |
@SYMTestCaseID GRAPHICS-WSERV-0404
|
sl@0
|
1022 |
@SYMTestCaseDesc Restart system event can be successfully sent through WServ
|
sl@0
|
1023 |
@SYMPREQ PREQ1089
|
sl@0
|
1024 |
@SYMREQ REQ6883
|
sl@0
|
1025 |
@SYMTestStatus Implemented
|
sl@0
|
1026 |
@SYMTestPriority High
|
sl@0
|
1027 |
@SYMTestPurpose Test restart system event in WServ
|
sl@0
|
1028 |
@SYMTestActions The test code will simulate a 'restart event'.
|
sl@0
|
1029 |
@SYMTestExpectedResults The system should restart (manually observed).
|
sl@0
|
1030 |
*/
|
sl@0
|
1031 |
void CShellWindow::SimulateRestartEvent()
|
sl@0
|
1032 |
{
|
sl@0
|
1033 |
TRawEvent rawEvent;
|
sl@0
|
1034 |
rawEvent.Set(TRawEvent::ERestartSystem);
|
sl@0
|
1035 |
Client()->iWs.SimulateRawEvent(rawEvent);
|
sl@0
|
1036 |
Client()->iWs.Flush();
|
sl@0
|
1037 |
}
|
sl@0
|
1038 |
|
sl@0
|
1039 |
/**
|
sl@0
|
1040 |
@SYMTestCaseID GRAPHICS-WSERV-0405
|
sl@0
|
1041 |
@SYMTestCaseDesc Restart system event can be received by client that have registered for off event
|
sl@0
|
1042 |
@SYMPREQ PREQ1089
|
sl@0
|
1043 |
@SYMREQ REQ6883
|
sl@0
|
1044 |
@SYMTestStatus Implemented
|
sl@0
|
1045 |
@SYMTestPriority High
|
sl@0
|
1046 |
@SYMTestPurpose Test restart system event in WServ with off event handler
|
sl@0
|
1047 |
@SYMTestActions The test code will register for off event, simulate a 'restart event' and then receive the restart event
|
sl@0
|
1048 |
@SYMTestExpectedResults Verify that the restart event is received and the testPass dialog displayed for this test (manually observed).
|
sl@0
|
1049 |
*/
|
sl@0
|
1050 |
void CShellWindow::SimulateAndReceiveRestartEvent()
|
sl@0
|
1051 |
{
|
sl@0
|
1052 |
const TInt KEventWaitTimer = 5000000; // 5 sec, The wait time that this test will wait for the restart event before declaring this test fail
|
sl@0
|
1053 |
TInt err = Client()->iWs.RequestOffEvents(ETrue, Client()->iGroup->GroupWin());
|
sl@0
|
1054 |
if (err != KErrNone)
|
sl@0
|
1055 |
{
|
sl@0
|
1056 |
static_cast<CShellClient *>(Client())->ErrorDialog(_L("Failed to request off event"),err);
|
sl@0
|
1057 |
}
|
sl@0
|
1058 |
|
sl@0
|
1059 |
TRawEvent rawEvent;
|
sl@0
|
1060 |
rawEvent.Set(TRawEvent::ERestartSystem);
|
sl@0
|
1061 |
Client()->iWs.SimulateRawEvent(rawEvent);
|
sl@0
|
1062 |
|
sl@0
|
1063 |
TRequestStatus status;
|
sl@0
|
1064 |
Client()->iWs.EventReady(&status);
|
sl@0
|
1065 |
Client()->iWs.Flush();
|
sl@0
|
1066 |
User::WaitForRequest(status);
|
sl@0
|
1067 |
|
sl@0
|
1068 |
TWsEvent event;
|
sl@0
|
1069 |
RTimer timer;
|
sl@0
|
1070 |
timer.CreateLocal();
|
sl@0
|
1071 |
TRequestStatus timerStatus;
|
sl@0
|
1072 |
timer.After(timerStatus,KEventWaitTimer);
|
sl@0
|
1073 |
TBool testPass=EFalse;
|
sl@0
|
1074 |
while (timerStatus != KErrNone) // wait for the restart event until timer expire
|
sl@0
|
1075 |
{
|
sl@0
|
1076 |
Client()->iWs.GetEvent(event);
|
sl@0
|
1077 |
if (event.Type() == EEventRestartSystem)
|
sl@0
|
1078 |
{
|
sl@0
|
1079 |
timer.Cancel();
|
sl@0
|
1080 |
User::WaitForRequest(timerStatus); // to receive the cancel event
|
sl@0
|
1081 |
|
sl@0
|
1082 |
testPass = ETrue;
|
sl@0
|
1083 |
_LIT(KTestPass,"TestPassed");
|
sl@0
|
1084 |
TWindowTitle winTitle(KTestPass);
|
sl@0
|
1085 |
DisplayDialog(Client(), winTitle, _L("Received Restart Event"), KNullDesC);
|
sl@0
|
1086 |
break;
|
sl@0
|
1087 |
}
|
sl@0
|
1088 |
|
sl@0
|
1089 |
// probably got pointer event above instead of restart event, so try getting the next event until we see retart event
|
sl@0
|
1090 |
Client()->iWs.EventReady(&status);
|
sl@0
|
1091 |
User::WaitForRequest(status, timerStatus);
|
sl@0
|
1092 |
}
|
sl@0
|
1093 |
|
sl@0
|
1094 |
if (testPass == EFalse)
|
sl@0
|
1095 |
{
|
sl@0
|
1096 |
// timer expired before getting restart event
|
sl@0
|
1097 |
_LIT(KTestPass,"TestFailed");
|
sl@0
|
1098 |
TWindowTitle winTitle(KTestPass);
|
sl@0
|
1099 |
DisplayDialog(Client(), winTitle, _L("Did not receive Restart Event"), KNullDesC);
|
sl@0
|
1100 |
}
|
sl@0
|
1101 |
|
sl@0
|
1102 |
timer.Close();
|
sl@0
|
1103 |
|
sl@0
|
1104 |
Client()->iWs.RequestOffEvents(EFalse);
|
sl@0
|
1105 |
}
|
sl@0
|
1106 |
|
sl@0
|
1107 |
#endif
|
sl@0
|
1108 |
|
sl@0
|
1109 |
void CShellWindow::BugHunt()
|
sl@0
|
1110 |
//
|
sl@0
|
1111 |
// Attempt to reproduce messaging issue while program exiting with message outstanding
|
sl@0
|
1112 |
//
|
sl@0
|
1113 |
{
|
sl@0
|
1114 |
RThread().SetPriority(EPriorityRealTime);
|
sl@0
|
1115 |
((ROverrideProtectionInRSessionBase *)&(Client()->iWs))->Send(1);
|
sl@0
|
1116 |
RThread().Kill(0);
|
sl@0
|
1117 |
}
|
sl@0
|
1118 |
|
sl@0
|
1119 |
void CShellWindow::CheckTerminate()
|
sl@0
|
1120 |
{
|
sl@0
|
1121 |
if (iIsFocused && iAutoLaunch && iProcessList==NULL && iNumWindowGroups==Client()->iWs.NumWindowGroups())
|
sl@0
|
1122 |
{
|
sl@0
|
1123 |
#if defined(__WINS__)
|
sl@0
|
1124 |
delete this;
|
sl@0
|
1125 |
RShellWsSession::Shutdown();
|
sl@0
|
1126 |
#else
|
sl@0
|
1127 |
// on hardware for automated test purposes cause board to crash to
|
sl@0
|
1128 |
// indicate the completion of test run
|
sl@0
|
1129 |
User::SetCritical(User::ESystemCritical);
|
sl@0
|
1130 |
User::Panic(_L("test"), KErrGeneral);
|
sl@0
|
1131 |
#endif
|
sl@0
|
1132 |
}
|
sl@0
|
1133 |
}
|
sl@0
|
1134 |
|
sl@0
|
1135 |
void CShellWindow::ProcessDied()
|
sl@0
|
1136 |
{
|
sl@0
|
1137 |
CheckTerminate();
|
sl@0
|
1138 |
}
|
sl@0
|
1139 |
|
sl@0
|
1140 |
//
|
sl@0
|
1141 |
// End of CShellWindow class //
|
sl@0
|
1142 |
//
|
sl@0
|
1143 |
|
sl@0
|
1144 |
//
|
sl@0
|
1145 |
// CTaskListWindow class //
|
sl@0
|
1146 |
//
|
sl@0
|
1147 |
|
sl@0
|
1148 |
CTaskListWindow::CTaskListWindow() : CListWindow(), iWindowHandles(4), iWindowThreadNames(4)
|
sl@0
|
1149 |
{
|
sl@0
|
1150 |
}
|
sl@0
|
1151 |
|
sl@0
|
1152 |
void CTaskListWindow::ConstructL(CTWinBase &parent)
|
sl@0
|
1153 |
{
|
sl@0
|
1154 |
CListWindow::ConstructL(parent,ETrue);
|
sl@0
|
1155 |
User::LeaveIfError(Client()->iWs.WindowGroupList(0,&iWindowHandles));
|
sl@0
|
1156 |
for(TInt index=0;index<iWindowHandles.Count();index++)
|
sl@0
|
1157 |
{
|
sl@0
|
1158 |
TThreadId id;
|
sl@0
|
1159 |
Client()->iWs.GetWindowGroupClientThreadId(iWindowHandles[index],id);
|
sl@0
|
1160 |
RThread thread;
|
sl@0
|
1161 |
User::LeaveIfError(thread.Open(id));
|
sl@0
|
1162 |
iWindowThreadNames.AppendL(thread.FullName());
|
sl@0
|
1163 |
thread.Close();
|
sl@0
|
1164 |
}
|
sl@0
|
1165 |
SetSize();
|
sl@0
|
1166 |
}
|
sl@0
|
1167 |
|
sl@0
|
1168 |
void CTaskListWindow::SelectedL(TInt aIndex)
|
sl@0
|
1169 |
{
|
sl@0
|
1170 |
Client()->iWs.SetWindowGroupOrdinalPosition(iWindowHandles[aIndex], 0);
|
sl@0
|
1171 |
CloseWindow();
|
sl@0
|
1172 |
}
|
sl@0
|
1173 |
|
sl@0
|
1174 |
TPtrC CTaskListWindow::GetText(TInt aLine)
|
sl@0
|
1175 |
{
|
sl@0
|
1176 |
iLatestText=iWindowThreadNames[aLine];
|
sl@0
|
1177 |
iLatestText.Append(_L("::"));
|
sl@0
|
1178 |
TName winName;
|
sl@0
|
1179 |
if (Client()->iWs.GetWindowGroupNameFromIdentifier(iWindowHandles[aLine],winName)==KErrNone)
|
sl@0
|
1180 |
iLatestText.Append(winName);
|
sl@0
|
1181 |
return(iLatestText);
|
sl@0
|
1182 |
}
|
sl@0
|
1183 |
|
sl@0
|
1184 |
TInt CTaskListWindow::ListCount()
|
sl@0
|
1185 |
{
|
sl@0
|
1186 |
return(iWindowHandles.Count());
|
sl@0
|
1187 |
}
|
sl@0
|
1188 |
//
|
sl@0
|
1189 |
// End of CTaskListWindow class //
|
sl@0
|
1190 |
//
|
sl@0
|
1191 |
|
sl@0
|
1192 |
CShellWindowGroup::CShellWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
|
sl@0
|
1193 |
{
|
sl@0
|
1194 |
}
|
sl@0
|
1195 |
|
sl@0
|
1196 |
CShellWindowGroup::~CShellWindowGroup()
|
sl@0
|
1197 |
{
|
sl@0
|
1198 |
iGroupWin.CancelCaptureKey(iCapHandle1);
|
sl@0
|
1199 |
iGroupWin.CancelCaptureKey(iCapHandle2);
|
sl@0
|
1200 |
iGroupWin.CancelCaptureKey(iCapHandle3);
|
sl@0
|
1201 |
iGroupWin.CancelCaptureKey(iCapHandle4);
|
sl@0
|
1202 |
}
|
sl@0
|
1203 |
|
sl@0
|
1204 |
void CShellWindowGroup::ConstructL()
|
sl@0
|
1205 |
{
|
sl@0
|
1206 |
CTWindowGroup::ConstructL();
|
sl@0
|
1207 |
iCapHandle1=User::LeaveIfError(iGroupWin.CaptureKey(EKeyTab, EModifierCtrl|EModifierShift|EModifierPureKeycode,EModifierCtrl|EModifierShift|EModifierPureKeycode));
|
sl@0
|
1208 |
iGroupWin.DefaultOwningWindow();
|
sl@0
|
1209 |
iGroupWin.EnableErrorMessages(EEventControlOnlyWithKeyboardFocus);
|
sl@0
|
1210 |
iGroupWin.EnableScreenChangeEvents();
|
sl@0
|
1211 |
}
|
sl@0
|
1212 |
|
sl@0
|
1213 |
void CShellWindowGroup::KeyL(const TKeyEvent &aKey,const TTime& aTime)
|
sl@0
|
1214 |
{
|
sl@0
|
1215 |
if (iCurWin)
|
sl@0
|
1216 |
iCurWin->WinKeyL(aKey,aTime);
|
sl@0
|
1217 |
}
|
sl@0
|
1218 |
|
sl@0
|
1219 |
void CShellWindowGroup::ErrorMessage(const TWsErrorMessage &aErrorMessage, const TTime &)
|
sl@0
|
1220 |
{
|
sl@0
|
1221 |
TBuf<0x40> errorText;
|
sl@0
|
1222 |
switch(aErrorMessage.iErrorCategory)
|
sl@0
|
1223 |
{
|
sl@0
|
1224 |
case TWsErrorMessage::EDrawingRegion:
|
sl@0
|
1225 |
{
|
sl@0
|
1226 |
_LIT(Graphics,"Graphics %d");
|
sl@0
|
1227 |
errorText.Format(Graphics,aErrorMessage.iError);
|
sl@0
|
1228 |
}
|
sl@0
|
1229 |
break;
|
sl@0
|
1230 |
case TWsErrorMessage::EBackLight:
|
sl@0
|
1231 |
{
|
sl@0
|
1232 |
_LIT(Backlight,"Backlight %d");
|
sl@0
|
1233 |
errorText.Format(Backlight,aErrorMessage.iError);
|
sl@0
|
1234 |
}
|
sl@0
|
1235 |
break;
|
sl@0
|
1236 |
case TWsErrorMessage::ELogging:
|
sl@0
|
1237 |
{
|
sl@0
|
1238 |
_LIT(Logging,"Error Starting Logging: %d, Location: %d");
|
sl@0
|
1239 |
// minus the error value is stored in the bottom 8 bits
|
sl@0
|
1240 |
// an indication of position in the code, that the error occured in, is stored in the top 24 bits
|
sl@0
|
1241 |
TInt line=(aErrorMessage.iError)&0xFFFFFF00;
|
sl@0
|
1242 |
errorText.Format(Logging,line-aErrorMessage.iError,line>>8);
|
sl@0
|
1243 |
}
|
sl@0
|
1244 |
break;
|
sl@0
|
1245 |
case TWsErrorMessage::EContrast:
|
sl@0
|
1246 |
{
|
sl@0
|
1247 |
_LIT(Contrast,"Contrast %d");
|
sl@0
|
1248 |
errorText.Format(Contrast,aErrorMessage.iError);
|
sl@0
|
1249 |
}
|
sl@0
|
1250 |
break;
|
sl@0
|
1251 |
default:
|
sl@0
|
1252 |
{
|
sl@0
|
1253 |
_LIT(Unknown,"Unknown %d");
|
sl@0
|
1254 |
errorText.Format(Unknown,aErrorMessage.iError);
|
sl@0
|
1255 |
}
|
sl@0
|
1256 |
break;
|
sl@0
|
1257 |
}
|
sl@0
|
1258 |
_LIT(WservError,"Wserv error");
|
sl@0
|
1259 |
TWindowTitle winTitle(WservError);
|
sl@0
|
1260 |
DisplayDialog(Client(), winTitle, errorText, KNullDesC);
|
sl@0
|
1261 |
}
|
sl@0
|
1262 |
|
sl@0
|
1263 |
void CShellWindowGroup::ScreenDeviceChangedL()
|
sl@0
|
1264 |
{
|
sl@0
|
1265 |
TPixelsTwipsAndRotation sizeAndRotation;
|
sl@0
|
1266 |
Client()->iScreen->GetDefaultScreenSizeAndRotation(sizeAndRotation);
|
sl@0
|
1267 |
Client()->iScreen->SetScreenSizeAndRotation(sizeAndRotation);
|
sl@0
|
1268 |
((CShellClient *)Client())->ScreenDeviceChangedL();
|
sl@0
|
1269 |
}
|
sl@0
|
1270 |
|
sl@0
|
1271 |
//
|
sl@0
|
1272 |
|
sl@0
|
1273 |
CIconWindowGroup::CIconWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
|
sl@0
|
1274 |
{
|
sl@0
|
1275 |
}
|
sl@0
|
1276 |
|
sl@0
|
1277 |
void CIconWindowGroup::ConstructL()
|
sl@0
|
1278 |
{
|
sl@0
|
1279 |
CTWindowGroup::ConstructL();
|
sl@0
|
1280 |
iGroupWin.EnableReceiptOfFocus(EFalse);
|
sl@0
|
1281 |
iGroupWin.SetOrdinalPosition(0,100);
|
sl@0
|
1282 |
}
|
sl@0
|
1283 |
|
sl@0
|
1284 |
//
|
sl@0
|
1285 |
// password window //
|
sl@0
|
1286 |
//
|
sl@0
|
1287 |
|
sl@0
|
1288 |
CTPasswordWindow::CTPasswordWindow()
|
sl@0
|
1289 |
{
|
sl@0
|
1290 |
}
|
sl@0
|
1291 |
|
sl@0
|
1292 |
void CTPasswordWindow::InitWin()
|
sl@0
|
1293 |
{
|
sl@0
|
1294 |
TInt wid=iFont->TextWidthInPixels(_L("Press Enter"));
|
sl@0
|
1295 |
iTextPos.iX=(iWin.Size().iWidth-wid)/2;
|
sl@0
|
1296 |
iTextPos.iY=(iWin.Size().iHeight)/2;
|
sl@0
|
1297 |
}
|
sl@0
|
1298 |
|
sl@0
|
1299 |
void CTPasswordWindow::Draw()
|
sl@0
|
1300 |
{
|
sl@0
|
1301 |
CTTitledWindow::Draw();
|
sl@0
|
1302 |
iGc->DrawText(_L("Press Enter"),iTextPos);
|
sl@0
|
1303 |
}
|
sl@0
|
1304 |
|
sl@0
|
1305 |
//
|
sl@0
|
1306 |
|
sl@0
|
1307 |
CPasswordWindowGroup::CPasswordWindowGroup(CTClient *aClient) : CTWindowGroup(aClient)
|
sl@0
|
1308 |
{
|
sl@0
|
1309 |
}
|
sl@0
|
1310 |
|
sl@0
|
1311 |
CPasswordWindowGroup::~CPasswordWindowGroup()
|
sl@0
|
1312 |
{
|
sl@0
|
1313 |
delete iWin;
|
sl@0
|
1314 |
}
|
sl@0
|
1315 |
|
sl@0
|
1316 |
void CPasswordWindowGroup::PasswordL(const TTime &)
|
sl@0
|
1317 |
{
|
sl@0
|
1318 |
__ASSERT_DEBUG(!iPasswordMode,Panic(EShellPanicPassword));
|
sl@0
|
1319 |
iPasswordMode=ETrue;
|
sl@0
|
1320 |
iWin->SetTitle(_L("Password Mode Enabled"));
|
sl@0
|
1321 |
}
|
sl@0
|
1322 |
|
sl@0
|
1323 |
void CPasswordWindowGroup::Cancel()
|
sl@0
|
1324 |
{
|
sl@0
|
1325 |
iPasswordMode=EFalse;
|
sl@0
|
1326 |
iWin->SetVisible(EFalse);
|
sl@0
|
1327 |
iGroupWin.SetOrdinalPosition(0,-1000);
|
sl@0
|
1328 |
iWin->SetTitle(_L("Why am I here?"));
|
sl@0
|
1329 |
}
|
sl@0
|
1330 |
|
sl@0
|
1331 |
void CPasswordWindowGroup::KeyL(const TKeyEvent &aKey,const TTime&)
|
sl@0
|
1332 |
{
|
sl@0
|
1333 |
if (iPasswordMode && aKey.iCode==EKeyEnter)
|
sl@0
|
1334 |
{
|
sl@0
|
1335 |
Client()->iWs.PasswordEntered();
|
sl@0
|
1336 |
Cancel();
|
sl@0
|
1337 |
}
|
sl@0
|
1338 |
}
|
sl@0
|
1339 |
|
sl@0
|
1340 |
void CPasswordWindowGroup::ConstructL()
|
sl@0
|
1341 |
{
|
sl@0
|
1342 |
CTWindowGroup::ConstructL();
|
sl@0
|
1343 |
iGroupWin.SetOrdinalPosition(-1);
|
sl@0
|
1344 |
iWin=new(ELeave) CTPasswordWindow();
|
sl@0
|
1345 |
iWin->ConstructL(*this);
|
sl@0
|
1346 |
iWin->AssignGC(*Client()->iGc);
|
sl@0
|
1347 |
Cancel();
|
sl@0
|
1348 |
iWin->Win()->PasswordWindow(EPasswordAlwaysTriggerNow);
|
sl@0
|
1349 |
iWin->Activate();
|
sl@0
|
1350 |
SetCurrentWindow(iWin);
|
sl@0
|
1351 |
}
|
sl@0
|
1352 |
|
sl@0
|
1353 |
//
|
sl@0
|
1354 |
|
sl@0
|
1355 |
CShellClient::CShellClient()
|
sl@0
|
1356 |
{
|
sl@0
|
1357 |
}
|
sl@0
|
1358 |
|
sl@0
|
1359 |
void CShellClient::CreateTestWindowL(CTWin *aWin, const TPoint &aPos,CTWinBase *parent)
|
sl@0
|
1360 |
{
|
sl@0
|
1361 |
TRAPD(err,aWin->ConstructL(*parent));
|
sl@0
|
1362 |
if (err!=KErrNone)
|
sl@0
|
1363 |
{
|
sl@0
|
1364 |
delete aWin;
|
sl@0
|
1365 |
User::Leave(err);
|
sl@0
|
1366 |
}
|
sl@0
|
1367 |
aWin->SetInitialPos(aPos);
|
sl@0
|
1368 |
aWin->Activate();
|
sl@0
|
1369 |
aWin->AssignGC(*iGc);
|
sl@0
|
1370 |
}
|
sl@0
|
1371 |
|
sl@0
|
1372 |
void CShellClient::CreateTestWindowL(CTWin *aWin, const TPoint &aPos)
|
sl@0
|
1373 |
{
|
sl@0
|
1374 |
CreateTestWindowL(aWin, aPos, iGroup);
|
sl@0
|
1375 |
}
|
sl@0
|
1376 |
|
sl@0
|
1377 |
CShellClient::~CShellClient()
|
sl@0
|
1378 |
{
|
sl@0
|
1379 |
delete iPointerCursor;
|
sl@0
|
1380 |
delete iIconWin1;
|
sl@0
|
1381 |
delete iIconWin2;
|
sl@0
|
1382 |
delete iIconGroup;
|
sl@0
|
1383 |
delete iPasswordGroup;
|
sl@0
|
1384 |
iWs.FreeSystemPointerCursorList();
|
sl@0
|
1385 |
iFs.Close();
|
sl@0
|
1386 |
}
|
sl@0
|
1387 |
|
sl@0
|
1388 |
|
sl@0
|
1389 |
void CShellClient::ConstructL()
|
sl@0
|
1390 |
{
|
sl@0
|
1391 |
User::LeaveIfError(iFs.Connect());
|
sl@0
|
1392 |
CTClient::ConstructL();
|
sl@0
|
1393 |
iWs.RequestOffEvents(EFalse); //To test this function
|
sl@0
|
1394 |
|
sl@0
|
1395 |
TBool keyClicksSupported=EFalse;
|
sl@0
|
1396 |
HAL::Get(HALData::EKeyboardClick,keyClicksSupported);
|
sl@0
|
1397 |
if (keyClicksSupported)
|
sl@0
|
1398 |
{
|
sl@0
|
1399 |
HAL::Set(HALData::EKeyboardClickState,1);
|
sl@0
|
1400 |
TInt maxVol=1;
|
sl@0
|
1401 |
HAL::Get(HALData::EKeyboardClickVolumeMax,maxVol);
|
sl@0
|
1402 |
HAL::Set(HALData::EKeyboardClickVolume,maxVol);
|
sl@0
|
1403 |
}
|
sl@0
|
1404 |
|
sl@0
|
1405 |
iWs.SetDoubleClick(TTimeIntervalMicroSeconds32(EDoubleClickTime), EDoubleClickDistance);
|
sl@0
|
1406 |
|
sl@0
|
1407 |
User::LeaveIfError(iWs.SetHotKey(EHotKeyBacklightToggle, 2, EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl|EModifierShift));
|
sl@0
|
1408 |
User::LeaveIfError(iWs.SetHotKey(EHotKeyBacklightOn, 14, EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl|EModifierShift));
|
sl@0
|
1409 |
User::LeaveIfError(iWs.SetHotKey(EHotKeyBacklightOff, 13, EModifierFunc|EModifierCtrl|EModifierShift,EModifierFunc|EModifierCtrl|EModifierShift));
|
sl@0
|
1410 |
//
|
sl@0
|
1411 |
iGroup=new(ELeave) CShellWindowGroup(this);
|
sl@0
|
1412 |
iGroup->ConstructL();
|
sl@0
|
1413 |
iWs.RequestOffEvents(ETrue,iGroup->GroupWin()); //To test this function
|
sl@0
|
1414 |
iWs.RequestOffEvents(EFalse);
|
sl@0
|
1415 |
iIconGroup=new(ELeave) CIconWindowGroup(this);
|
sl@0
|
1416 |
iIconGroup->ConstructL();
|
sl@0
|
1417 |
iIconWin1=new(ELeave) CTIconWindow(0);
|
sl@0
|
1418 |
iIconWin1->ConstructL(*iIconGroup);
|
sl@0
|
1419 |
iIconWin2=new(ELeave) CTIconWindow(1);
|
sl@0
|
1420 |
iIconWin2->ConstructL(*iIconGroup);
|
sl@0
|
1421 |
|
sl@0
|
1422 |
CShellWindow *win=new(ELeave) CShellWindow();
|
sl@0
|
1423 |
CreateTestWindowL(win, TPoint(330,10));
|
sl@0
|
1424 |
TWinCommand command;
|
sl@0
|
1425 |
User::CommandLine(command);
|
sl@0
|
1426 |
win->SetAutoLaunch(win->RunClientL(command,EFalse));
|
sl@0
|
1427 |
|
sl@0
|
1428 |
iPointerCursor=new(ELeave) CTPointerCursor(iWs);
|
sl@0
|
1429 |
TSpriteCreateParams params(TSize(24,48),TPoint(-12,-24),DrawPointerCursor,NULL, ETrue,CGraphicsContext::EDrawModePEN);
|
sl@0
|
1430 |
iPointerCursor->ConstructL(1,¶ms,0);
|
sl@0
|
1431 |
iGroup->GroupWin()->SetCustomPointerCursor(iPointerCursor->PointerCursor());
|
sl@0
|
1432 |
ResetFocus();
|
sl@0
|
1433 |
}
|
sl@0
|
1434 |
|
sl@0
|
1435 |
void CShellClient::ScreenDeviceChangedL()
|
sl@0
|
1436 |
{
|
sl@0
|
1437 |
iIconWin1->SetExtentL();
|
sl@0
|
1438 |
iIconWin2->SetExtentL();
|
sl@0
|
1439 |
}
|
sl@0
|
1440 |
|
sl@0
|
1441 |
void CShellClient::Exit()
|
sl@0
|
1442 |
{
|
sl@0
|
1443 |
CActiveScheduler::Stop();
|
sl@0
|
1444 |
}
|
sl@0
|
1445 |
|
sl@0
|
1446 |
CRunningProcess::CRunningProcess(MProcessObserver* aObserver) : CActive(-5), iObserver(aObserver)
|
sl@0
|
1447 |
{}
|
sl@0
|
1448 |
|
sl@0
|
1449 |
CRunningProcess::~CRunningProcess()
|
sl@0
|
1450 |
{
|
sl@0
|
1451 |
Cancel();
|
sl@0
|
1452 |
if (iNext)
|
sl@0
|
1453 |
iNext->iPrevPtr=iPrevPtr;
|
sl@0
|
1454 |
*iPrevPtr=iNext;
|
sl@0
|
1455 |
#if defined(__WINS__)
|
sl@0
|
1456 |
iLib.Close();
|
sl@0
|
1457 |
#endif
|
sl@0
|
1458 |
#if defined(__USING_PROCESS_)
|
sl@0
|
1459 |
iProcess.Close();
|
sl@0
|
1460 |
#else
|
sl@0
|
1461 |
iProcess.Close();
|
sl@0
|
1462 |
#endif
|
sl@0
|
1463 |
if (iObserver)
|
sl@0
|
1464 |
iObserver->ProcessDied();
|
sl@0
|
1465 |
}
|
sl@0
|
1466 |
|
sl@0
|
1467 |
void CRunningProcess::ConstructL(const TDesC &aName)
|
sl@0
|
1468 |
{
|
sl@0
|
1469 |
#if defined(__USING_PROCESS_)
|
sl@0
|
1470 |
TParse fileName;
|
sl@0
|
1471 |
fileName.Set(_L("E:\\.EXE"),&aName,NULL);
|
sl@0
|
1472 |
TInt error = iProcess.Create(fileName.FullName(),_L(""));
|
sl@0
|
1473 |
if(error != KErrNone)
|
sl@0
|
1474 |
{
|
sl@0
|
1475 |
fileName.Set(_L(""),&aName,NULL);
|
sl@0
|
1476 |
User::LeaveIfError(iProcess.Create(fileName.FullName(),_L("")));
|
sl@0
|
1477 |
}
|
sl@0
|
1478 |
#else
|
sl@0
|
1479 |
User::LeaveIfError(iFileName.Set(RP_FILENAME_SET,&aName,NULL));
|
sl@0
|
1480 |
User::LeaveIfError(iLib.Load(iFileName.FullName()));
|
sl@0
|
1481 |
DllTestAppEntryPoint libFunc=(DllTestAppEntryPoint)iLib.Lookup(1);
|
sl@0
|
1482 |
User::LeaveIfNull((TAny *)libFunc);
|
sl@0
|
1483 |
TBuf<KMaxFileName> threadName;
|
sl@0
|
1484 |
TInt err;
|
sl@0
|
1485 |
TInt num=0;
|
sl@0
|
1486 |
do
|
sl@0
|
1487 |
{
|
sl@0
|
1488 |
threadName.Format(TRefByValue<const TDesC>(_L("%S%02d")),&aName,num++);
|
sl@0
|
1489 |
err=iProcess.Create(threadName,libFunc,KDefaultStackSize,NULL,&iLib,NULL,KHeapSize,KHeapSize,EOwnerProcess);
|
sl@0
|
1490 |
} while(err==KErrAlreadyExists);
|
sl@0
|
1491 |
User::LeaveIfError(err);
|
sl@0
|
1492 |
#endif
|
sl@0
|
1493 |
iProcess.Logon(iStatus);
|
sl@0
|
1494 |
iProcess.Resume();
|
sl@0
|
1495 |
SetActive();
|
sl@0
|
1496 |
}
|
sl@0
|
1497 |
|
sl@0
|
1498 |
void CRunningProcess::ConstructTestExecuteL(const TDesC &aName)
|
sl@0
|
1499 |
{
|
sl@0
|
1500 |
//testexecute z:\wstest\wstest_t_autotest.script
|
sl@0
|
1501 |
_LIT(KTestExecute,"testexecute");
|
sl@0
|
1502 |
_LIT(KComandLinePrefix,"z:\\wstest\\wstest_t_");
|
sl@0
|
1503 |
_LIT(KComandLinePostfix,"test.script");
|
sl@0
|
1504 |
#if defined(__USING_PROCESS_)
|
sl@0
|
1505 |
TParse fileName;
|
sl@0
|
1506 |
fileName.Set(KNullDesC,&KTestExecute,NULL);
|
sl@0
|
1507 |
TBuf<128> commandLine;
|
sl@0
|
1508 |
commandLine.Append(KComandLinePrefix);
|
sl@0
|
1509 |
commandLine.Append(aName);
|
sl@0
|
1510 |
commandLine.Append(KComandLinePostfix);
|
sl@0
|
1511 |
User::LeaveIfError(iProcess.Create(fileName.FullName(),commandLine));
|
sl@0
|
1512 |
iProcess.Logon(iStatus);
|
sl@0
|
1513 |
iProcess.Resume();
|
sl@0
|
1514 |
SetActive();
|
sl@0
|
1515 |
#endif
|
sl@0
|
1516 |
}
|
sl@0
|
1517 |
|
sl@0
|
1518 |
void CRunningProcess::Link(CRunningProcess **aRpPtr)
|
sl@0
|
1519 |
{
|
sl@0
|
1520 |
iNext=*aRpPtr;
|
sl@0
|
1521 |
if (iNext)
|
sl@0
|
1522 |
iNext->iPrevPtr=&iNext;
|
sl@0
|
1523 |
*aRpPtr=this;
|
sl@0
|
1524 |
iPrevPtr=aRpPtr;
|
sl@0
|
1525 |
}
|
sl@0
|
1526 |
|
sl@0
|
1527 |
void CRunningProcess::DoCancel()
|
sl@0
|
1528 |
{
|
sl@0
|
1529 |
iProcess.LogonCancel(iStatus);
|
sl@0
|
1530 |
}
|
sl@0
|
1531 |
|
sl@0
|
1532 |
void CRunningProcess::RunL()
|
sl@0
|
1533 |
{
|
sl@0
|
1534 |
if (iStatus!=KErrNone)
|
sl@0
|
1535 |
{
|
sl@0
|
1536 |
TBuf<32> buf;
|
sl@0
|
1537 |
buf.Num(iStatus.Int());
|
sl@0
|
1538 |
DisplayDialog(_L("Program exited with error"),iProcess.ExitCategory(),buf);
|
sl@0
|
1539 |
}
|
sl@0
|
1540 |
delete this;
|
sl@0
|
1541 |
}
|
sl@0
|
1542 |
|
sl@0
|
1543 |
GLDEF_C CTClient *CreateClientL()
|
sl@0
|
1544 |
{
|
sl@0
|
1545 |
return(new(ELeave) CShellClient());
|
sl@0
|
1546 |
}
|
sl@0
|
1547 |
|
sl@0
|
1548 |
GLDEF_C TInt E32Main()
|
sl@0
|
1549 |
{
|
sl@0
|
1550 |
return(TestLibStartUp(CreateClientL));
|
sl@0
|
1551 |
}
|