os/graphics/graphicsapitest/screendriverhaitest/screendriver/src/t_screendriverserver.cpp
First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #include "t_screendriverserver.h"
20 #include "t_cfbsdrawdevicedata.h"
23 _LIT(KT_SCREENDRIVER,"CFbsDrawDevice");
28 * @return - Instance of the test server
29 * Same code for Secure and non-secure variants
30 * Called inside the MainL() function to create and start the
31 * CTestServer derived server.
33 CT_ScreenDriverServer* CT_ScreenDriverServer::NewL()
35 CT_ScreenDriverServer* server = new (ELeave) CT_ScreenDriverServer();
36 CleanupStack::PushL(server);
38 CleanupStack::Pop(server);
45 * Much simpler, uses the new Rendezvous() call to sync with the client
49 #if (defined __DATA_CAGING__)
50 RProcess().DataCaging(RProcess::EDataCagingOn);
51 RProcess().SecureApi(RProcess::ESecureApiOn);
53 CActiveScheduler* sched=NULL;
54 sched=new(ELeave) CActiveScheduler;
55 CActiveScheduler::Install(sched);
56 CT_ScreenDriverServer* server = NULL;
58 // Create the CTestServer derived server
59 TRAPD(err,server = CT_ScreenDriverServer::NewL());
62 // Sync with the client and enter the active scheduler
63 RProcess::Rendezvous(KErrNone);
73 * @return - Standard Epoc error code on process exit
75 * Process entry point. Called by client using RProcess API
77 GLDEF_C TInt E32Main()
80 CTrapCleanup* cleanup = CTrapCleanup::New();
86 #if (defined TRAP_IGNORE)
97 CDataWrapper* CT_ScreenDriverServer::CT_DisplayBlock::CreateDataL(const TDesC& aData)
99 CDataWrapper* wrapper=NULL;
101 if( KT_SCREENDRIVER() == aData )
103 wrapper=CT_CFbsDrawDeviceData::NewL();