blob: 255c0dc0a95d26933539b4facbb5be2ac39a644c [file] [log] [blame]
Benny Prijonoc71ad432007-05-04 07:25:19 +00001/* $Id$ */
2/*
Nanang Izzuddina62ffc92011-05-05 06:14:19 +00003 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
Benny Prijono844653c2008-12-23 17:27:53 +00004 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
Benny Prijonoc71ad432007-05-04 07:25:19 +00005 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
Benny Prijonoba5926a2007-05-02 11:29:37 +000020#include "ua.h"
Benny Prijonoba5926a2007-05-02 11:29:37 +000021
22#include <e32std.h>
Benny Prijonoba5926a2007-05-02 11:29:37 +000023#include <e32base.h>
24#include <e32std.h>
Benny Prijonoc71ad432007-05-04 07:25:19 +000025#include <stdlib.h>
Benny Prijonoba5926a2007-05-02 11:29:37 +000026
27
28// Global Variables
29CConsoleBase* console;
Benny Prijonoba5926a2007-05-02 11:29:37 +000030
Nanang Izzuddincb2789a2008-07-24 15:30:44 +000031// Needed by APS
Nanang Izzuddin7f02df42009-05-05 10:46:51 +000032//TPtrC APP_UID = _L("200235D3");
33TPtrC APP_UID = _L("A000000D");
Nanang Izzuddincb2789a2008-07-24 15:30:44 +000034
Benny Prijonoba5926a2007-05-02 11:29:37 +000035
Benny Prijonoc71ad432007-05-04 07:25:19 +000036////////////////////////////////////////////////////////////////////////////
Benny Prijonoc71ad432007-05-04 07:25:19 +000037
Benny Prijonoba5926a2007-05-02 11:29:37 +000038LOCAL_C void DoStartL()
39{
Benny Prijono897f9f82007-05-03 19:56:21 +000040 CActiveScheduler *scheduler = new (ELeave) CActiveScheduler;
Benny Prijonoba5926a2007-05-02 11:29:37 +000041 CleanupStack::PushL(scheduler);
42 CActiveScheduler::Install(scheduler);
43
Nanang Izzuddin82f7a412008-12-17 11:36:22 +000044 ua_main();
Benny Prijono897f9f82007-05-03 19:56:21 +000045
46 CActiveScheduler::Install(NULL);
Benny Prijonoba5926a2007-05-02 11:29:37 +000047 CleanupStack::Pop(scheduler);
Benny Prijono897f9f82007-05-03 19:56:21 +000048 delete scheduler;
Benny Prijono5d542642007-05-02 18:54:19 +000049}
50
51
52////////////////////////////////////////////////////////////////////////////
53
Benny Prijonoc71ad432007-05-04 07:25:19 +000054// E32Main()
Benny Prijonoba5926a2007-05-02 11:29:37 +000055GLDEF_C TInt E32Main()
56{
Benny Prijonoc71ad432007-05-04 07:25:19 +000057 // Mark heap usage
Benny Prijono897f9f82007-05-03 19:56:21 +000058 __UHEAP_MARK;
Benny Prijonoc71ad432007-05-04 07:25:19 +000059
60 // Create cleanup stack
Benny Prijonoba5926a2007-05-02 11:29:37 +000061 CTrapCleanup* cleanup = CTrapCleanup::New();
62
63 // Create output console
64 TRAPD(createError, console = Console::NewL(_L("Console"), TSize(KConsFullScreen,KConsFullScreen)));
65 if (createError)
66 return createError;
67
68 TRAPD(startError, DoStartL());
69
70 console->Printf(_L("[press any key to close]\n"));
Benny Prijonoc71ad432007-05-04 07:25:19 +000071 console->Getch();
Benny Prijonoba5926a2007-05-02 11:29:37 +000072
73 delete console;
74 delete cleanup;
Benny Prijono897f9f82007-05-03 19:56:21 +000075
Benny Prijonoc71ad432007-05-04 07:25:19 +000076 CloseSTDLIB();
77
78 // Mark end of heap usage, detect memory leaks
Benny Prijono897f9f82007-05-03 19:56:21 +000079 __UHEAP_MARKEND;
Benny Prijonoba5926a2007-05-02 11:29:37 +000080 return KErrNone;
81}
82