os/graphics/graphicscomposition/surfaceupdate/tsrc/tsurfaceupdateserverinteg.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #include "tsurfaceupdateserverinteg.h"
    17 #include "tsurfaceupdateinteg.h"
    18  
    19 _LIT(KServerName,"TSurfaceUpdateServerInteg");
    20 
    21 CTSurfaceUpdateServerInteg* CTSurfaceUpdateServerInteg::NewL()
    22 	{
    23 	CTSurfaceUpdateServerInteg * server = new (ELeave) CTSurfaceUpdateServerInteg();
    24 	CleanupStack::PushL(server);
    25 	// CServer base class call
    26 	server->StartL(KServerName);
    27 	CleanupStack::Pop(server);
    28 	return server;
    29 	}
    30 
    31 LOCAL_C void MainL()
    32 	{
    33  	RProcess().DataCaging(RProcess::EDataCagingOn);
    34 	RProcess().SecureApi(RProcess::ESecureApiOn);
    35 	CActiveScheduler* sched=NULL;
    36 	sched=new(ELeave) CActiveScheduler;
    37 	CActiveScheduler::Install(sched);
    38 	CTSurfaceUpdateServerInteg* server = NULL;
    39 	// Create the CTestServer derived server
    40 	TRAPD(err,server = CTSurfaceUpdateServerInteg::NewL());
    41 	if(!err)
    42 		{
    43 		// Sync with the client and enter the active scheduler
    44 		RProcess::Rendezvous(KErrNone);
    45 		sched->Start();
    46 		}
    47 	delete server;
    48 	delete sched;
    49 	}
    50 
    51 GLDEF_C TInt E32Main()
    52 	{
    53 	__UHEAP_MARK;
    54 	CTrapCleanup* cleanup = CTrapCleanup::New();
    55 	if(cleanup == NULL)
    56 		{
    57 		return KErrNoMemory;
    58 		}
    59 	TRAPD(err,MainL());
    60 	if (err)
    61 	    {
    62 		RDebug::Print(_L("TSurfaceUpdateServer::MainL - Error: %d"), err);
    63 	   	User::Panic(KServerName,err);
    64 	    }
    65 	delete cleanup;
    66 	__UHEAP_MARKEND;
    67 	return KErrNone;
    68     }
    69 
    70 CTestStep* CTSurfaceUpdateServerInteg::CreateTestStep(const TDesC& aStepName)
    71 	{
    72 	CTestStep* testStep = NULL;
    73 	
    74 	if(aStepName == KTSurfaceUpdateIntegStep)
    75 		{
    76 		testStep = new CTSurfaceUpdateIntegStep();
    77 		}
    78 		
    79 	return testStep;
    80 	}