First public contribution.
1 // Copyright (c) 2005-2009 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"
26 #include "TBiDiDefect.h"
27 #include "TLineBreak.h"
28 #include "TGlyphSel.h"
31 z:\GraphicsTest\gditest.script
34 _LIT(KServerName,"TGdiServer");
36 CTGdiServer* CTGdiServer::NewL()
38 @return - Instance of the test server
39 Same code for Secure and non-secure variants
40 Called inside the MainL() function to create and start the
41 CTestServer derived server.
44 CTGdiServer * server = new (ELeave) CTGdiServer();
45 CleanupStack::PushL(server);
46 // CServer base class call
47 server->StartL(KServerName);
48 CleanupStack::Pop(server);
56 // Much simpler, uses the new Rendezvous() call to sync with the client
59 #if (defined __DATA_CAGING__)
60 RProcess().DataCaging(RProcess::EDataCagingOn);
61 RProcess().SecureApi(RProcess::ESecureApiOn);
63 CActiveScheduler* sched=NULL;
64 sched=new(ELeave) CActiveScheduler;
65 CActiveScheduler::Install(sched);
66 CTGdiServer* server = NULL;
67 // Create the CTestServer derived server
68 TRAPD(err,server = CTGdiServer::NewL());
71 // Sync with the client and enter the active scheduler
72 RProcess::Rendezvous(KErrNone);
79 GLDEF_C TInt E32Main()
81 /** @return - Standard Epoc error code on process exit
83 Process entry point. Called by client using RProcess API
87 CTrapCleanup* cleanup = CTrapCleanup::New();
93 // This if statement is here just to shut up RVCT, which would otherwise warn
94 // that err was set but never used
104 CTestStep* CTGdiServer::CreateTestStep(const TDesC& aStepName)
106 @return - A CTestStep derived instance
107 Secure and non-secure variants
108 Implementation of CTestServer pure virtual
111 CTestStep* testStep = NULL;
112 if(aStepName == KTRgbStep)
113 testStep = new CTRgbStep();
114 else if(aStepName == KTTypesStep)
115 testStep = new CTTypesStep();
116 else if(aStepName == KTBiDiStep)
117 testStep = new CTBiDiStep();
118 else if(aStepName == KTBiDiDefectStep)
119 testStep = new CTBiDiDefectStep();
120 else if(aStepName == KTLineBreakStep)
121 testStep = new CTLineBreakStep();
122 else if(aStepName == KTGlyphSelectionStep)
123 testStep = new CTGlyphSelectionStep();