windowing/windowserver/test/t_gdcoverage/wsgdcov.cpp
author William Roberts <williamr@symbian.org>
Thu, 03 Jun 2010 17:39:46 +0100
branchNewGraphicsArchitecture
changeset 87 0709f76d91e5
parent 0 5d03bc08d59c
permissions -rw-r--r--
Add MMP files to build libOpenVG_sw.lib which uses LINKAS to redirect to libOpenVG.dll (and the same for libEGL_sw.lib and libOpenVGU_sw.lib). Only the libEGL_sw.lib redirection isn't activated - this can't happen until there is a merged libEGL.dll which supports the OpenWF synchronisation and also implements the graphical support functions. The overall aim is to eliminate the *_sw.dll implementations, at least as a compile-time way of choosing a software-only implementation.The correct way to choose is to put the right set of libraries into a ROM with suitable renaming, and in the emulator to use the "switching DLL" technique to pick the right set. As the Symbian Foundation doesn't have any alternative implementations, we don't need the switching DLLs and we can build directly to the correct name.

// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// Client that calls the plugin that does the actual coverage tests
// 
//

/**
 @file
 @test
 @internalComponent - Internal Symbian coverage test code,
*/

#include "wsgdcov.h"

const TUid KGraphicDrawerCoverageInterfaceId = {0x10285D5A};
const TUid KGraphicDrawerCoverageImplId = {0x10285D5B};

EXPORT_C CWsGdCoverage* CWsGdCoverage::NewL()
	{
	return NewL(0);
	}

EXPORT_C CWsGdCoverage* CWsGdCoverage::NewL(TInt aScreenId)
	{
	CWsGdCoverage* self = new(ELeave) CWsGdCoverage;
	CleanupStack::PushL(self);
	TBuf8<1> data;
	data.Append((TUint8)aScreenId);
	self->BaseConstructL(KGraphicDrawerCoverageInterfaceId, KGraphicDrawerCoverageImplId, data);
	CleanupStack::Pop(self);
	self->iIsReady = ETrue;
	return self;
	}

EXPORT_C CWsGdCoverage::~CWsGdCoverage()
	{
	iIsReady = EFalse;
	}

void CWsGdCoverage::HandleMessage(const TDesC8& aData)
	{
	if (aData.Size()>1 && aData[0]==KGdCoverageInfoSig)
		{
		if (aData.Size() <= sizeof(TGdCoverageInfo))
			{
			Mem::Copy(iReq, aData.Ptr(), aData.Size());
			}
		}
	iCallBack.CallBack();
	}

void CWsGdCoverage::OnReplace()
	{
	}

EXPORT_C TInt CWsGdCoverage::RunTest(TInt aCode)
	{
	if (!iIsReady)
		return KErrNotReady;
	
	TBuf8<1> cmd;
	cmd.Append(aCode);
	
	SendMessage(cmd);
	return Flush();
	}

EXPORT_C TInt CWsGdCoverage::QueryPlugin(TGdCoverageInfo& aInfo)
	{
	TBuf8<1> cmd;
	cmd.Append(KGdCoverageCmdQuery);
	SendMessage(cmd);
	TInt err = Flush();
	if (err!=KErrNone)
		return err;
	iReq = &aInfo;
	return KErrNone;
	}

EXPORT_C void CWsGdCoverage::SetCallBack(TCallBack aCallBack)
	{
	iCallBack = aCallBack;
	}