00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00029 #include "userinterface.h"
00030
00031 LOCAL_D CConsoleBase* console;
00032
00033 LOCAL_C void DoStartL();
00034 LOCAL_C void CallExampleL();
00035
00036 LOCAL_C void DoStartL()
00037 {
00038
00039 CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
00040 CleanupStack::PushL(scheduler);
00041 CActiveScheduler::Install(scheduler);
00042
00043 _LIT(KTextExample, "Delta Queue Example\nCreating and starting timer object\n");
00044 console->Printf(KTextExample);
00045
00046
00047 CTimerEntry* entry = CTimerEntry::NewL(console);
00048 CleanupStack::PushL(entry);
00049
00050
00051 CUserInterface* interface = CUserInterface::NewL(console,entry);
00052 CleanupStack::PushL(interface);
00053
00054
00055
00056 interface->ReadFunc();
00057
00058
00059 CActiveScheduler::Start();
00060
00061
00062 CleanupStack::PopAndDestroy(3,scheduler);
00063 }
00064
00065 GLDEF_C TInt E32Main()
00066 {
00067 __UHEAP_MARK;
00068 CTrapCleanup* cleanup=CTrapCleanup::New();
00069 TRAPD(error, CallExampleL());
00070 delete cleanup;
00071 __ASSERT_ALWAYS(!error, User::Panic(KTxtEPOC32EX, error));
00072 __UHEAP_MARKEND;
00073 return 0;
00074 }
00075
00076 LOCAL_C void CallExampleL()
00077 {
00078 console=Console::NewL(KTxtExampleCode, TSize(KConsFullScreen, KConsFullScreen));
00079 CleanupStack::PushL(console);
00080 TRAPD(error, DoStartL());
00081 if (error)
00082 console->Printf(KFormatFailed, error);
00083 else
00084 console->Printf(KTxtOK);
00085 console->Printf(KTextPressAnyKey);
00086 console->Getch();
00087 CleanupStack::PopAndDestroy();
00088 }