common/tools/ats/smoketest/graphics/wserv/TWsGraphicShare/TWsGraphicShare.cpp
author victorp@symbian.org
Wed, 03 Feb 2010 16:06:24 +0000
changeset 872 17498133d9ad
parent 833 6ffc235847d0
permissions -rw-r--r--
adding EPL headers to smoke test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
/*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 833
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
872
17498133d9ad adding EPL headers to smoke test
victorp@symbian.org
parents: 833
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
833
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
* Contributors:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
* Description:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
*
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
*/
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
//  Include Files  
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
#include "TWsGraphicShare.h"
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
#include <e32base.h>
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
#include <e32std.h>
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
#include <w32stdgraphic.h>
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
//  Local Functions
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
LOCAL_C void DrawSharedGraphicL(const TDesC& aSemName, TInt aScrNum, const TWsGraphicId& aId, const TRect& aDestRect, const TDesC8& aData)
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
	// Construct & Initiate
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
	RWsSession ws;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
	User::LeaveIfError(ws.Connect());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
	CleanupClosePushL(ws);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
	CWsScreenDevice* screenDevice = new(ELeave) CWsScreenDevice(ws);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
	CleanupStack::PushL(screenDevice);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
	User::LeaveIfError(screenDevice->Construct(aScrNum));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
	TSize screenSize = screenDevice->SizeInPixels();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
	CWindowGc* gc = new(ELeave) CWindowGc(screenDevice);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
	CleanupStack::PushL(gc);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
	User::LeaveIfError(gc->Construct());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
	RWindowGroup winGroup(ws);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
	CleanupClosePushL(winGroup);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
	User::LeaveIfError(winGroup.Construct(1));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
		
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
	RWindow win(ws);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
	CleanupClosePushL(win);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
	TUint32 handle = 0x0F00;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
	User::LeaveIfError(win.Construct(winGroup, handle));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
	win.SetBackgroundColor(TRgb(255, 255, 255));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
	win.SetPosition(TPoint(aDestRect.iTl.iX, aDestRect.iTl.iY));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
	win.SetSize(aDestRect.Size());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
	win.Activate();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
	// Draw
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
	gc->Activate(win);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
	win.Invalidate();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
	win.BeginRedraw();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
	ws.Flush();	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
	gc->DrawWsGraphic(aId, TRect(0,0,aDestRect.Width(),aDestRect.Height()), aData );
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
	gc->Deactivate();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
	win.EndRedraw();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
	ws.Flush();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
	// Synchronize with master process
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
	RSemaphore semaphore;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
	CleanupClosePushL(semaphore);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
	User::LeaveIfError(semaphore.OpenGlobal(aSemName));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
	semaphore.Signal();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
	semaphore.Wait();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
	semaphore.Close();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
    
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
	// Deconstruct
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
	CleanupStack::PopAndDestroy(6);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
LOCAL_C void MainL ( )
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
	TBuf<128> commandLine;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
	TLex lex;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
	TBuf<32> semName;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
	TInt screenNumber = 0; 
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
	TInt graphId;	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
	TInt left, top, right, bottom;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
	// Read arguments from the command line
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
	// There is a space between two adjacent parameters
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
	// Commandline's format looks like that:
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
	// 'screenNumber' 'graphId' 'left' 'top' 'right' 'bottom' 
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
	User::CommandLine(commandLine);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
	commandLine.TrimLeft();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
	_LIT(KSpace, " ");
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
	TInt pos;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
	// Get process name
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
	pos = commandLine.Find(KSpace);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
	semName = commandLine.Left(pos);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
	commandLine = commandLine.Mid(pos+1);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
	// Get screen number	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
	pos = commandLine.Find(KSpace);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
	lex = commandLine.Left(pos);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
	lex.Val(screenNumber);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
	commandLine = commandLine.Mid(pos+1);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
	// Get gragaphic id	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
	pos = commandLine.Find(KSpace);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
	lex = commandLine.Left(pos);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
	lex.Val(graphId);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
	commandLine = commandLine.Mid(pos+1);	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
	// Get coordinates
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
	pos = commandLine.Find(KSpace);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
	lex = commandLine.Left(pos);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
	lex.Val(left);	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
	commandLine = commandLine.Mid(pos+1);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
	pos = commandLine.Find(KSpace);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
	lex = commandLine.Left(pos);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
	lex.Val(top);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
	commandLine = commandLine.Mid(pos+1);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
	pos = commandLine.Find(KSpace);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
	lex = commandLine.Left(pos);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
	lex.Val(right);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
	commandLine = commandLine.Mid(pos+1);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
	pos = commandLine.Find(KSpace);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
	lex = commandLine.Left(pos);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
	lex.Val(bottom);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
	commandLine = commandLine.Mid(pos+1);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
	// Get data
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
	TBuf8<32> data;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
	data.Copy(commandLine);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
	TWsGraphicId id(TUid::Uid(graphId));
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
	TRect destRect(left, top, right, bottom);	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
	// Draw the graphic
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
	DrawSharedGraphicL(semName, screenNumber, id, destRect, data);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
	}
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
//  Global Functions
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
GLDEF_C TInt E32Main()
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
	{
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
	// Create cleanup stack
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
	__UHEAP_MARK;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
	CTrapCleanup* cleanup = CTrapCleanup::New();
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
	// Run application code inside TRAP harness, wait keypress when terminated
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
	TRAPD(error, MainL());
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
	User::LeaveIfError(error);
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
	
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
	delete cleanup;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
	__UHEAP_MARKEND;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
	return KErrNone;
6ffc235847d0 Added smoke test for Graphics
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
	}