Update contrib.
1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 @internalComponent - Internal Symbian test code
22 #include "TGdiServer.h"
25 #include "TBiDiDefect.h"
26 #include "TLineBreak.h"
27 #include "TGlyphSel.h"
30 z:\GraphicsTest\gditest.script
33 _LIT(KServerName,"TTextBaseServer");
35 CTGdiServer* CTGdiServer::NewL()
37 @return - Instance of the test server
38 Same code for Secure and non-secure variants
39 Called inside the MainL() function to create and start the
40 CTestServer derived server.
43 CTGdiServer * server = new (ELeave) CTGdiServer();
44 CleanupStack::PushL(server);
45 // CServer base class call
46 server->StartL(KServerName);
47 CleanupStack::Pop(server);
55 // Much simpler, uses the new Rendezvous() call to sync with the client
58 #if (defined __DATA_CAGING__)
59 RProcess().DataCaging(RProcess::EDataCagingOn);
60 RProcess().SecureApi(RProcess::ESecureApiOn);
62 CActiveScheduler* sched=NULL;
63 sched=new(ELeave) CActiveScheduler;
64 CActiveScheduler::Install(sched);
65 CTGdiServer* server = NULL;
66 // Create the CTestServer derived server
67 TRAPD(err,server = CTGdiServer::NewL());
70 // Sync with the client and enter the active scheduler
71 RProcess::Rendezvous(KErrNone);
78 GLDEF_C TInt E32Main()
80 /** @return - Standard Epoc error code on process exit
82 Process entry point. Called by client using RProcess API
86 CTrapCleanup* cleanup = CTrapCleanup::New();
92 // This if statement is here just to shut up RVCT, which would otherwise warn
93 // that err was set but never used
103 CTestStep* CTGdiServer::CreateTestStep(const TDesC& aStepName)
105 @return - A CTestStep derived instance
106 Secure and non-secure variants
107 Implementation of CTestServer pure virtual
110 CTestStep* testStep = NULL;
111 if(aStepName == KTTypesStep)
112 testStep = new CTTypesStep();
113 else if(aStepName == KTBiDiStep)
114 testStep = new CTBiDiStep();
115 else if(aStepName == KTBiDiDefectStep)
116 testStep = new CTBiDiDefectStep();
117 else if(aStepName == KTLineBreakStep)
118 testStep = new CTLineBreakStep();
119 else if(aStepName == KTGlyphSelectionStep)
120 testStep = new CTGlyphSelectionStep();