1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/graphicsdeviceinterface/bitgdi/tbit/TBitgdiServer.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,187 @@
1.4 +// Copyright (c) 2006-2010 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 +/**
1.20 + @file
1.21 + @test
1.22 + @internalComponent - Internal Symbian test code
1.23 +*/
1.24 +
1.25 +#include "TBitgdiServer.h"
1.26 +#include "TAUTO.H"
1.27 +#include "tbase.h"
1.28 +#include "TClip.h"
1.29 +#include "tparam.h"
1.30 +#include "tswitch.h"
1.31 +#include "TAccelerator.h"
1.32 +#include "TDefect.h"
1.33 +#include "TDefect2.h"
1.34 +#include "tbitblt.h"
1.35 +#include "TBitgdiScaling.h"
1.36 +#include "TAlphaBlend.h"
1.37 +#include "tfontselect.h"
1.38 +#include "TFont.h"
1.39 +#include "toutlineandshadowfonts.h"
1.40 +#include "textendedbitmap.h"
1.41 +#include "tmultiplescreens.h"
1.42 +
1.43 +
1.44 +
1.45 +_LIT(KServerName,"TBitgdiServer");
1.46 +
1.47 +CTBitgdiServer* CTBitgdiServer::NewL()
1.48 + {
1.49 + CTBitgdiServer * server = new (ELeave) CTBitgdiServer();
1.50 + CleanupStack::PushL(server);
1.51 + // CServer base class call
1.52 + server->StartL(KServerName);
1.53 + CleanupStack::Pop(server);
1.54 + return server;
1.55 + }
1.56 +
1.57 +
1.58 +LOCAL_C void MainL()
1.59 + {
1.60 + RProcess().DataCaging(RProcess::EDataCagingOn);
1.61 + RProcess().SecureApi(RProcess::ESecureApiOn);
1.62 + CActiveScheduler* sched=NULL;
1.63 + sched=new(ELeave) CActiveScheduler;
1.64 + CActiveScheduler::Install(sched);
1.65 + CTBitgdiServer* server = NULL;
1.66 + // Create the CTestServer derived server
1.67 + TRAPD(err,server = CTBitgdiServer::NewL());
1.68 + if(!err)
1.69 + {
1.70 + // Sync with the client and enter the active scheduler
1.71 + RProcess::Rendezvous(KErrNone);
1.72 + sched->Start();
1.73 + }
1.74 + delete server;
1.75 + delete sched;
1.76 + }
1.77 +
1.78 +GLDEF_C TInt E32Main()
1.79 + {
1.80 + __UHEAP_MARK;
1.81 + CTrapCleanup* cleanup = CTrapCleanup::New();
1.82 + if(cleanup == NULL)
1.83 + {
1.84 + return KErrNoMemory;
1.85 + }
1.86 + TRAPD(err,MainL());
1.87 + if (err)
1.88 + {
1.89 + RDebug::Print(_L("TBitgdiServer::MainL - Error: %d"), err);
1.90 + User::Panic(KServerName,err);
1.91 + }
1.92 + delete cleanup;
1.93 + __UHEAP_MARKEND;
1.94 + return KErrNone;
1.95 + }
1.96 +
1.97 +
1.98 +
1.99 +CTestStep* CTBitgdiServer::CreateTestStep(const TDesC& aStepName)
1.100 + {
1.101 + CTestStep* testStep = NULL;
1.102 +
1.103 + if(aStepName == KTAutoStep)
1.104 + {
1.105 + testStep = new CTAutoStep();
1.106 + }
1.107 + else if(aStepName == KTGdiStep)
1.108 + {
1.109 + testStep = new CTGdiStep();
1.110 + }
1.111 + else if(aStepName == KTClipStep)
1.112 + {
1.113 + testStep = new CTClipStep();
1.114 + }
1.115 + else if(aStepName == KTClip2Step)
1.116 + {
1.117 + testStep = new CTClip2Step();
1.118 + }
1.119 + else if(aStepName == KTParamStep)
1.120 + {
1.121 + testStep = new CTParamStep();
1.122 + }
1.123 + else if(aStepName == KTSwitchStep)
1.124 + {
1.125 + testStep = new CTSwitchStep();
1.126 + }
1.127 + else if(aStepName == KTAcceleratorStep)
1.128 + {
1.129 + testStep = new CTAcceleratorStep();
1.130 + }
1.131 + else if(aStepName == KTDefectStep)
1.132 + {
1.133 + testStep = new CTDefectStep();
1.134 + }
1.135 + else if(aStepName == KTDefect2Step)
1.136 + {
1.137 + testStep = new CTDefect2Step();
1.138 + }
1.139 + else if(aStepName == KTBitBltStep)
1.140 + {
1.141 + testStep = new CTBitBltStep();
1.142 + }
1.143 + else if(aStepName == KTBitgdiScalingStep)
1.144 + {
1.145 + testStep = new CTBitgdiScalingStep();
1.146 + }
1.147 + else if(aStepName == KTAlphaBlendingStep)
1.148 + {
1.149 + testStep = new CTAlphaBlendingStep();
1.150 + }
1.151 + else if(aStepName == KTFontSelectStep)
1.152 + {
1.153 + testStep = new CTFontSelectStep();
1.154 + }
1.155 + else if(aStepName == KTFontStep)
1.156 + {
1.157 + testStep = new CTFontStep();
1.158 + }
1.159 + else if(aStepName == KTOutlineAndShadowFontsStep)
1.160 + {
1.161 + testStep = new CTOutlineAndShadowFontsStep();
1.162 + }
1.163 + else if(aStepName == KTExtendedBitmapStep)
1.164 + {
1.165 + testStep = new CTExtendedBitmapStep();
1.166 + }
1.167 + else if(aStepName == KTExtendedBitmapNegativeStep)
1.168 + {
1.169 + testStep = new CTExtendedBitmapNegativeStep();
1.170 + }
1.171 + else if(aStepName == KTMultipleScreensStep)
1.172 + {
1.173 + testStep = new CTMultipleScreensStep();
1.174 + }
1.175 + TBuf<64> log;
1.176 + _LIT(KBitgdi,"BITGDI Test %S ");
1.177 + _LIT(KSucess,"created sucessfully.");
1.178 + _LIT(KFail,"failed to create.");
1.179 + log.Format(KBitgdi,&aStepName);
1.180 + if (testStep)
1.181 + log.Append(KSucess);
1.182 + else
1.183 + {
1.184 + log.Append(KFail);
1.185 + INFO_PRINTF1(log);
1.186 + }
1.187 + RDebug::Print(log);
1.188 + return testStep;
1.189 + }
1.190 +