os/graphics/graphicsdeviceinterface/bitgdi/tbit/TBitgdiServer.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
/**
sl@0
    17
 @file
sl@0
    18
 @test
sl@0
    19
 @internalComponent - Internal Symbian test code 
sl@0
    20
*/
sl@0
    21
sl@0
    22
#include "TBitgdiServer.h"
sl@0
    23
#include "TAUTO.H"
sl@0
    24
#include "tbase.h"
sl@0
    25
#include "TClip.h"
sl@0
    26
#include "tparam.h"
sl@0
    27
#include "tswitch.h"
sl@0
    28
#include "TAccelerator.h"
sl@0
    29
#include "TDefect.h"
sl@0
    30
#include "TDefect2.h"
sl@0
    31
#include "tbitblt.h"
sl@0
    32
#include "TBitgdiScaling.h"
sl@0
    33
#include "TAlphaBlend.h"
sl@0
    34
#include "tfontselect.h"
sl@0
    35
#include "TFont.h"
sl@0
    36
#include "toutlineandshadowfonts.h"
sl@0
    37
#include "textendedbitmap.h"
sl@0
    38
#include "tmultiplescreens.h"
sl@0
    39
sl@0
    40
 
sl@0
    41
sl@0
    42
_LIT(KServerName,"TBitgdiServer");
sl@0
    43
sl@0
    44
CTBitgdiServer* CTBitgdiServer::NewL()
sl@0
    45
	{
sl@0
    46
	CTBitgdiServer * server = new (ELeave) CTBitgdiServer();
sl@0
    47
	CleanupStack::PushL(server);
sl@0
    48
	// CServer base class call
sl@0
    49
	server->StartL(KServerName);
sl@0
    50
	CleanupStack::Pop(server);
sl@0
    51
	return server;
sl@0
    52
	}
sl@0
    53
sl@0
    54
sl@0
    55
LOCAL_C void MainL()
sl@0
    56
	{
sl@0
    57
 	RProcess().DataCaging(RProcess::EDataCagingOn);
sl@0
    58
	RProcess().SecureApi(RProcess::ESecureApiOn);
sl@0
    59
	CActiveScheduler* sched=NULL;
sl@0
    60
	sched=new(ELeave) CActiveScheduler;
sl@0
    61
	CActiveScheduler::Install(sched);
sl@0
    62
	CTBitgdiServer* server = NULL;
sl@0
    63
	// Create the CTestServer derived server
sl@0
    64
	TRAPD(err,server = CTBitgdiServer::NewL());
sl@0
    65
	if(!err)
sl@0
    66
		{
sl@0
    67
		// Sync with the client and enter the active scheduler
sl@0
    68
		RProcess::Rendezvous(KErrNone);
sl@0
    69
		sched->Start();
sl@0
    70
		}
sl@0
    71
	delete server;
sl@0
    72
	delete sched;
sl@0
    73
	}
sl@0
    74
sl@0
    75
GLDEF_C TInt E32Main()
sl@0
    76
	{
sl@0
    77
	__UHEAP_MARK;
sl@0
    78
	CTrapCleanup* cleanup = CTrapCleanup::New();
sl@0
    79
	if(cleanup == NULL)
sl@0
    80
		{
sl@0
    81
		return KErrNoMemory;
sl@0
    82
		}
sl@0
    83
	TRAPD(err,MainL());
sl@0
    84
	if (err)
sl@0
    85
	    {
sl@0
    86
		RDebug::Print(_L("TBitgdiServer::MainL - Error: %d"), err);
sl@0
    87
	   	User::Panic(KServerName,err);
sl@0
    88
	    }
sl@0
    89
	delete cleanup;
sl@0
    90
	__UHEAP_MARKEND;
sl@0
    91
	return KErrNone;
sl@0
    92
    }
sl@0
    93
sl@0
    94
sl@0
    95
sl@0
    96
CTestStep* CTBitgdiServer::CreateTestStep(const TDesC& aStepName)
sl@0
    97
	{
sl@0
    98
	CTestStep* testStep = NULL;
sl@0
    99
	
sl@0
   100
	if(aStepName == KTAutoStep)
sl@0
   101
		{
sl@0
   102
		testStep = new CTAutoStep();
sl@0
   103
		}
sl@0
   104
	else if(aStepName == KTGdiStep)
sl@0
   105
		{
sl@0
   106
		testStep = new CTGdiStep();
sl@0
   107
		}
sl@0
   108
	else if(aStepName == KTClipStep)
sl@0
   109
		{
sl@0
   110
		testStep = new CTClipStep();
sl@0
   111
		}
sl@0
   112
	else if(aStepName == KTClip2Step)
sl@0
   113
		{
sl@0
   114
		testStep = new CTClip2Step();
sl@0
   115
		}
sl@0
   116
	else if(aStepName == KTParamStep)
sl@0
   117
		{
sl@0
   118
		testStep = new CTParamStep();
sl@0
   119
		}
sl@0
   120
	else if(aStepName == KTSwitchStep)
sl@0
   121
		{
sl@0
   122
		testStep = new CTSwitchStep();
sl@0
   123
		}
sl@0
   124
	else if(aStepName == KTAcceleratorStep)
sl@0
   125
		{
sl@0
   126
		testStep = new CTAcceleratorStep();
sl@0
   127
		}
sl@0
   128
	else if(aStepName == KTDefectStep)
sl@0
   129
		{
sl@0
   130
		testStep = new CTDefectStep();
sl@0
   131
		}
sl@0
   132
	else if(aStepName == KTDefect2Step)
sl@0
   133
		{
sl@0
   134
		testStep = new CTDefect2Step();
sl@0
   135
		}
sl@0
   136
	else if(aStepName == KTBitBltStep)
sl@0
   137
		{
sl@0
   138
		testStep = new CTBitBltStep();
sl@0
   139
		}
sl@0
   140
	else if(aStepName == KTBitgdiScalingStep)
sl@0
   141
		{
sl@0
   142
		testStep = new CTBitgdiScalingStep();
sl@0
   143
		}
sl@0
   144
	else if(aStepName == KTAlphaBlendingStep)
sl@0
   145
		{
sl@0
   146
		testStep = new CTAlphaBlendingStep();
sl@0
   147
		}
sl@0
   148
	else if(aStepName == KTFontSelectStep)
sl@0
   149
		{
sl@0
   150
		testStep = new CTFontSelectStep();
sl@0
   151
		}		
sl@0
   152
	else if(aStepName == KTFontStep)
sl@0
   153
		{
sl@0
   154
		testStep = new CTFontStep();
sl@0
   155
		}		
sl@0
   156
	else if(aStepName == KTOutlineAndShadowFontsStep)
sl@0
   157
		{
sl@0
   158
		testStep = new CTOutlineAndShadowFontsStep();
sl@0
   159
		}
sl@0
   160
	else if(aStepName == KTExtendedBitmapStep)
sl@0
   161
		{
sl@0
   162
		testStep = new CTExtendedBitmapStep();
sl@0
   163
		}
sl@0
   164
	else if(aStepName == KTExtendedBitmapNegativeStep)
sl@0
   165
		{
sl@0
   166
		testStep = new CTExtendedBitmapNegativeStep();
sl@0
   167
		}
sl@0
   168
	else if(aStepName == KTMultipleScreensStep)
sl@0
   169
		{
sl@0
   170
		testStep = new CTMultipleScreensStep();
sl@0
   171
		}
sl@0
   172
	TBuf<64> log;
sl@0
   173
	_LIT(KBitgdi,"BITGDI Test %S ");
sl@0
   174
	_LIT(KSucess,"created sucessfully.");
sl@0
   175
	_LIT(KFail,"failed to create.");
sl@0
   176
	log.Format(KBitgdi,&aStepName);
sl@0
   177
	if (testStep)
sl@0
   178
		log.Append(KSucess);
sl@0
   179
	else
sl@0
   180
		{
sl@0
   181
		log.Append(KFail);
sl@0
   182
		INFO_PRINTF1(log);
sl@0
   183
		}
sl@0
   184
	RDebug::Print(log);
sl@0
   185
	return testStep;
sl@0
   186
	}
sl@0
   187