os/graphics/graphicscomposition/surfaceupdate/tsrc/tsurfaceupdateserverinteg.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/graphicscomposition/surfaceupdate/tsrc/tsurfaceupdateserverinteg.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,80 @@
     1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include "tsurfaceupdateserverinteg.h"
    1.20 +#include "tsurfaceupdateinteg.h"
    1.21 + 
    1.22 +_LIT(KServerName,"TSurfaceUpdateServerInteg");
    1.23 +
    1.24 +CTSurfaceUpdateServerInteg* CTSurfaceUpdateServerInteg::NewL()
    1.25 +	{
    1.26 +	CTSurfaceUpdateServerInteg * server = new (ELeave) CTSurfaceUpdateServerInteg();
    1.27 +	CleanupStack::PushL(server);
    1.28 +	// CServer base class call
    1.29 +	server->StartL(KServerName);
    1.30 +	CleanupStack::Pop(server);
    1.31 +	return server;
    1.32 +	}
    1.33 +
    1.34 +LOCAL_C void MainL()
    1.35 +	{
    1.36 + 	RProcess().DataCaging(RProcess::EDataCagingOn);
    1.37 +	RProcess().SecureApi(RProcess::ESecureApiOn);
    1.38 +	CActiveScheduler* sched=NULL;
    1.39 +	sched=new(ELeave) CActiveScheduler;
    1.40 +	CActiveScheduler::Install(sched);
    1.41 +	CTSurfaceUpdateServerInteg* server = NULL;
    1.42 +	// Create the CTestServer derived server
    1.43 +	TRAPD(err,server = CTSurfaceUpdateServerInteg::NewL());
    1.44 +	if(!err)
    1.45 +		{
    1.46 +		// Sync with the client and enter the active scheduler
    1.47 +		RProcess::Rendezvous(KErrNone);
    1.48 +		sched->Start();
    1.49 +		}
    1.50 +	delete server;
    1.51 +	delete sched;
    1.52 +	}
    1.53 +
    1.54 +GLDEF_C TInt E32Main()
    1.55 +	{
    1.56 +	__UHEAP_MARK;
    1.57 +	CTrapCleanup* cleanup = CTrapCleanup::New();
    1.58 +	if(cleanup == NULL)
    1.59 +		{
    1.60 +		return KErrNoMemory;
    1.61 +		}
    1.62 +	TRAPD(err,MainL());
    1.63 +	if (err)
    1.64 +	    {
    1.65 +		RDebug::Print(_L("TSurfaceUpdateServer::MainL - Error: %d"), err);
    1.66 +	   	User::Panic(KServerName,err);
    1.67 +	    }
    1.68 +	delete cleanup;
    1.69 +	__UHEAP_MARKEND;
    1.70 +	return KErrNone;
    1.71 +    }
    1.72 +
    1.73 +CTestStep* CTSurfaceUpdateServerInteg::CreateTestStep(const TDesC& aStepName)
    1.74 +	{
    1.75 +	CTestStep* testStep = NULL;
    1.76 +	
    1.77 +	if(aStepName == KTSurfaceUpdateIntegStep)
    1.78 +		{
    1.79 +		testStep = new CTSurfaceUpdateIntegStep();
    1.80 +		}
    1.81 +		
    1.82 +	return testStep;
    1.83 +	}