3 Symbian OS services for SDL
11 #include"sdlepocapi.h"
17 #include "vectorbuffer.h"
21 #include "SDL_epocevents_c.h"
22 #include "SDL_keysym.h"
33 extern SDLKey* KeyMap();
34 extern void ResetKeyMap();
38 //const TUid KSDLUid = { 0xF01F3D69 };
40 NONSHARABLE_CLASS(EnvUtils)
43 static void DisableKeyBlocking();
44 static TBool Rendezvous(RThread& aThread, TRequestStatus& aStatus);
47 TInt Panic(TInt aErr, TInt aLine)
50 b.Format(_L("Main at %d"), aLine);
56 NONSHARABLE_CLASS(CCurrentAppUi) : public CAknAppUi
59 static CCurrentAppUi* Cast(CEikAppUi* aUi);
60 void DisableKeyBlocking();
64 CCurrentAppUi* CCurrentAppUi::Cast(CEikAppUi* aUi)
66 return static_cast<CCurrentAppUi*>(aUi);
69 void CCurrentAppUi::DisableKeyBlocking()
71 SetKeyBlockMode(ENoKeyBlock);
75 class CEventQueue : public CBase, public MEventQueue
78 static CEventQueue* NewL();
81 TInt Append(const TWsEvent& aEvent);
82 const TWsEvent& Shift();
87 TVector<TWsEvent, 64> iVector;
91 CEventQueue* CEventQueue::NewL()
93 CEventQueue* q = new (ELeave) CEventQueue();
94 CleanupStack::PushL(q);
95 User::LeaveIfError(q->iCS.CreateLocal());
100 CEventQueue::~CEventQueue()
105 TInt CEventQueue::Append(const TWsEvent& aEvent)
108 const TInt err = iVector.Append(aEvent);
114 TBool CEventQueue::HasData()
116 return iVector.Size() > 0;
120 void CEventQueue::Lock()
125 void CEventQueue::Unlock()
130 const TWsEvent& CEventQueue::Shift()
132 const TWsEvent& event = iVector.Shift();
137 TSdlCleanupItem::TSdlCleanupItem(TSdlCleanupOperation aOperation, TAny* aItem) :
138 iOperation(aOperation), iItem(aItem), iThread(RThread().Id())
146 NONSHARABLE_CLASS(EpocSdlEnvData)
150 CEventQueue* iEventQueue;
156 CSdlAppServ* iAppSrv;
158 CArrayFix<TSdlCleanupItem>* iCleanupItems;
164 EpocSdlEnvData* gEpocEnv;
166 #define MAINFUNC(x) EXPORT_C TMainFunc::TMainFunc(mainfunc##x aFunc){Mem::FillZ(iMainFunc, sizeof(iMainFunc)); iMainFunc[x - 1] = (void*) aFunc;}
175 EXPORT_C TMainFunc::TMainFunc()
177 Mem::FillZ(iMainFunc, sizeof(iMainFunc));
181 const void* TMainFunc::operator[](TInt aIndex) const
183 return iMainFunc[aIndex];
187 NONSHARABLE_CLASS(CSdlAppServ) : public CActive
192 EAppSrvNoop = CDsa::ELastDsaRequest,
195 EAppSrvWindowDisplayMode,
196 EAppSrvWindowPointerCursorMode,
204 TInt Request(TInt aService);
205 TInt RequestValue(TInt aService);
207 void PanicMain(TInt aReason);
208 void PanicMain(const TDesC& aInfo, TInt aReason);
209 void SetObserver(MSDLObserver* aObserver);
210 TInt ObserverEvent(TInt aEvent, TInt aParam);
211 void SetParam(TInt aParam);
212 void HandleObserverValue(TInt aService, TInt aReturnValue, TBool aMainThread);
213 MSDLObserver* Observer();
218 const TThreadId iMainId;
223 MSDLObserver* iObserver;
224 TRequestStatus* iStatusPtr;
227 CSdlAppServ::CSdlAppServ() : CActive(CActive::EPriorityHigh), iMainId(RThread().Id())
233 MSDLObserver* CSdlAppServ::Observer()
239 void CSdlAppServ::SetObserver(MSDLObserver* aObserver)
241 iObserver = aObserver;
244 TInt CSdlAppServ::ObserverEvent(TInt aEvent, TInt aParam)
246 if(iObserver != NULL)
248 if(RThread().Id() == gEpocEnv->iId)
250 return iObserver->SdlThreadEvent(aEvent, aParam);
252 else if(RThread().Id() == iMainId)
254 return iObserver->SdlEvent(aEvent, aParam);
256 PANIC(KErrNotSupported);
261 void CSdlAppServ::PanicMain(TInt aReason)
263 iAppThread.Panic(RThread().Name(), aReason);
266 void CSdlAppServ::PanicMain(const TDesC& aInfo, TInt aReason)
268 iAppThread.Panic(aInfo, aReason);
271 void CSdlAppServ::ConstructL()
273 CActiveScheduler::Add(this);
274 User::LeaveIfError(iSema.CreateLocal(1));
275 iStatus = KRequestPending;
276 iStatusPtr = &iStatus;
280 CSdlAppServ::~CSdlAppServ()
283 if(iSema.Handle() != NULL)
289 TInt CSdlAppServ::Request(TInt aService)
291 if(RThread().Id() != iAppThread.Id())
295 iAppThread.RequestComplete(iStatusPtr, KErrNone);
298 return KErrBadHandle;
301 TInt CSdlAppServ::RequestValue(TInt aService)
304 Request(EAppSrvNoop);
308 void CSdlAppServ::Init()
310 PANIC_IF_ERROR(iAppThread.Open(iMainId));
313 void CSdlAppServ::SetParam(TInt aParam)
315 iReturnValue = aParam;
318 void CSdlAppServ::HandleObserverValue(TInt aService, TInt aReturnValue, TBool aMainThread)
320 if(iObserver != NULL && aMainThread)
324 case MSDLObserver::EEventScreenSizeChanged:
325 if(aReturnValue == MSDLObserver::EScreenSizeChangedDefaultPalette)
326 EpocSdlEnv::LockPalette(EFalse);
330 if(!aMainThread && aService == MSDLObserver::EEventSuspend)
332 if(iObserver == NULL ||
333 (gEpocEnv->iDsa->Stopped() && aReturnValue != MSDLObserver::ESuspendNoSuspend))
335 EpocSdlEnv::Suspend();
340 void CSdlAppServ::RunL()
342 if(iStatus == KErrNone)
346 case CSdlAppServ::EAppSrvWaitDsa:
347 EpocSdlEnv::SetWaitDsa();
348 iReturnValue = EpocSdlEnv::IsDsaAvailable();
350 // gEpocEnv->iDsa->Stop();
351 // gEpocEnv->iDsa->RestartL();
353 case CSdlAppServ::EAppSrvStopThread:
354 gEpocEnv->iDsa->SetSuspend();
356 case EpocSdlEnv::EDisableKeyBlocking:
357 EnvUtils::DisableKeyBlocking();
360 case EAppSrvWindowPointerCursorMode:
361 iReturnValue = gEpocEnv->iDsa != NULL ?
362 gEpocEnv->iDsa->Session().PointerCursorMode() : KErrNotReady;
364 case EAppSrvDsaStatus:
365 gEpocEnv->iDsa->Stop();
366 iReturnValue = KErrNone;
368 case CDsa::ERequestUpdate:
369 gEpocEnv->iDsa->UnlockHWSurfaceRequestComplete();
373 case MSDLObserver::EEventResume:
374 case MSDLObserver::EEventSuspend:
375 case MSDLObserver::EEventScreenSizeChanged:
376 case MSDLObserver::EEventWindowReserved:
377 case MSDLObserver::EEventKeyMapInit:
378 case MSDLObserver::EEventWindowNotAvailable:
379 case MSDLObserver::EEventMainExit:
380 iReturnValue = ObserverEvent(iService, iReturnValue);
381 HandleObserverValue(iService, iReturnValue, ETrue);
384 PANIC(KErrNotSupported);
386 iStatus = KRequestPending;
387 iStatusPtr = &iStatus;
393 void CSdlAppServ::DoCancel()
396 TRequestStatus* s = &iStatus;
397 iAppThread.RequestComplete(s, KErrCancel);
402 MEventQueue& EpocSdlEnv::EventQueue()
404 __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
405 return *gEpocEnv->iEventQueue;
409 TBool EpocSdlEnv::Flags(TInt aFlag)
411 const TInt flag = gEpocEnv->iEpocEnvFlags & aFlag;
412 return flag == aFlag;
415 TInt EpocSdlEnv::Argc()
417 __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
418 return gEpocEnv->iArgc;
422 char** EpocSdlEnv::Argv()
424 __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
425 return gEpocEnv->iArgv;
429 TBool EpocSdlEnv::IsDsaAvailable()
431 __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
432 return gEpocEnv->iDsa != NULL && gEpocEnv->iDsa->IsDsaAvailable();
436 void EpocSdlEnv::WaitDsaAvailable()
438 EpocSdlEnv::ObserverEvent(MSDLObserver::EEventWindowNotAvailable, 0);
439 gEpocEnv->iAppSrv->Request(CSdlAppServ::EAppSrvStopThread);
440 if(EpocSdlEnv::Flags(CSDL::EEnableFocusStop))
442 EpocSdlEnv::ObserverEvent(MSDLObserver::EEventSuspend, 0);
446 void EpocSdlEnv::Suspend()
448 if(gEpocEnv->iDsa->Stopped() || EpocSdlEnv::Flags(CSDL::EEnableFocusStop))
450 // gEpocEnv->iDsa->ReleaseStop();
451 gEpocEnv->iDsa->SetSuspend();
453 EpocSdlEnv::ObserverEvent(MSDLObserver::EEventResume, 0);
457 void EpocSdlEnv::SetWaitDsa()
459 if(!IsDsaAvailable())
462 th.Open(gEpocEnv->iId);
465 gEpocEnv->iDsa->SetSuspend();
469 void EpocSdlEnv::Resume()
471 gEpocEnv->iDsa->Resume();
473 th.Open(gEpocEnv->iId);
477 const TInt value = gEpocEnv->iAppSrv->ObserverEvent(MSDLObserver::EEventResume, 0);
478 gEpocEnv->iAppSrv->HandleObserverValue(MSDLObserver::EEventResume, value, ETrue);
482 TInt EpocSdlEnv::AllocSwSurface(const TSize& aSize, TDisplayMode aMode)
484 return gEpocEnv->iDsa->AllocSurface(EFalse, aSize, aMode);
487 TInt EpocSdlEnv::AllocHwSurface(const TSize& aSize, TDisplayMode aMode)
489 return gEpocEnv->iDsa->AllocSurface(ETrue, aSize, aMode);
493 void EpocSdlEnv::UnlockHwSurface()
495 gEpocEnv->iDsa->UnlockHwSurface();
498 TUint8* EpocSdlEnv::LockHwSurface()
500 return gEpocEnv->iDsa->LockHwSurface();
504 void EpocSdlEnv::UpdateSwSurface()
506 gEpocEnv->iDsa->UpdateSwSurface();
509 TBool EpocSdlEnv::AddUpdateRect(TUint8* aAddress, const TRect& aUpdateRect, const TRect& aRect)
511 return gEpocEnv->iDsa->AddUpdateRect(aAddress, aUpdateRect, aRect);
514 void EpocSdlEnv::Request(TInt aService)
516 __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
517 gEpocEnv->iAppSrv->Request(aService);
521 TSize EpocSdlEnv::WindowSize(const TSize& aRequestedSize)
523 __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
524 if(EpocSdlEnv::Flags(CSDL::EAllowImageResize) && gEpocEnv->iDsa->WindowSize() != aRequestedSize)
526 TRAP_IGNORE(gEpocEnv->iDsa->CreateZoomerL(aRequestedSize));
528 return gEpocEnv->iDsa->WindowSize();
531 TSize EpocSdlEnv::WindowSize()
533 __ASSERT_DEBUG(gEpocEnv != NULL, PANIC(KErrNotReady));
534 return gEpocEnv->iDsa->WindowSize();
537 TDisplayMode EpocSdlEnv::DisplayMode()
539 return gEpocEnv->iDsa->DisplayMode();
542 TPointerCursorMode EpocSdlEnv::PointerMode()
544 return static_cast<TPointerCursorMode>
545 (gEpocEnv->iAppSrv->RequestValue(CSdlAppServ::EAppSrvWindowPointerCursorMode));
548 TInt EpocSdlEnv::SetPalette(TInt aFirstcolor, TInt aColorCount, TUint32* aPalette)
550 return gEpocEnv->iDsa->SetPalette(aFirstcolor, aColorCount, aPalette);
553 void EpocSdlEnv::PanicMain(TInt aErr)
555 gEpocEnv->iAppSrv->PanicMain(aErr);
559 TInt EpocSdlEnv::AppendCleanupItem(const TSdlCleanupItem& aItem)
561 TRAPD(err, gEpocEnv->iCleanupItems->AppendL(aItem));
565 void EpocSdlEnv::RemoveCleanupItem(TAny* aItem)
567 for(TInt i = 0; i < gEpocEnv->iCleanupItems->Count(); i++)
569 if(gEpocEnv->iCleanupItems->At(i).iItem == aItem)
570 gEpocEnv->iCleanupItems->Delete(i);
574 void EpocSdlEnv::CleanupItems()
576 const TThreadId id = RThread().Id();
577 TInt last = gEpocEnv->iCleanupItems->Count() - 1;
579 for(i = last; i >= 0 ; i--)
581 TSdlCleanupItem& item = gEpocEnv->iCleanupItems->At(i);
582 if(item.iThread == id)
584 item.iThread = TThreadId(0);
585 item.iOperation(item.iItem);
588 last = gEpocEnv->iCleanupItems->Count() - 1;
589 for(i = last; i >= 0 ; i--)
591 TSdlCleanupItem& item = gEpocEnv->iCleanupItems->At(i);
592 if(item.iThread == TThreadId(0))
594 gEpocEnv->iCleanupItems->Delete(i);
599 void EpocSdlEnv::FreeSurface()
601 Request(CSdlAppServ::EAppSrvDsaStatus);
602 gEpocEnv->iDsa->Free();
605 void EpocSdlEnv::LockPalette(TBool aLock)
607 gEpocEnv->iDsa->LockPalette(aLock);
610 void EpocSdlEnv::ObserverEvent(TInt aService, TInt aParam)
612 const TBool sdlThread = RThread().Id() == gEpocEnv->iId;
613 const TInt valuea = gEpocEnv->iAppSrv->ObserverEvent(aService, aParam);
614 gEpocEnv->iAppSrv->HandleObserverValue(aService, valuea, !sdlThread);
617 gEpocEnv->iAppSrv->SetParam(aParam);
618 const TInt valuet = gEpocEnv->iAppSrv->RequestValue(aService);
619 gEpocEnv->iAppSrv->HandleObserverValue(aService, valuet, EFalse);
624 TPoint EpocSdlEnv::WindowCoordinates(const TPoint& aPoint)
626 return gEpocEnv->iDsa->WindowCoordinates(aPoint);
629 void EpocSdlEnv::PanicMain(const TDesC& aInfo, TInt aErr)
631 gEpocEnv->iAppSrv->PanicMain(aInfo, aErr);
633 //Dsa is a low priority ao, it has to wait if its pending event, but ws
634 //event has been prioritized before it
635 //this is not called from app thread!
636 void EpocSdlEnv::WaitDeviceChange()
639 gEpocEnv->iAppSrv->RequestValue(CSdlAppServ::EAppSrvWaitDsa);
640 const TSize sz = WindowSize();
641 const TInt param = reinterpret_cast<TInt>(&sz);
642 ObserverEvent(MSDLObserver::EEventScreenSizeChanged, param);
644 // RThread().Suspend();
647 LOCAL_C TBool CheckSdl()
651 if(sdl.Open(gEpocEnv->iId) == KErrNone)
653 if(sdl.ExitType() == EExitPending)
662 void EpocSdlEnvData::Free()
664 if(RThread().Id() == gEpocEnv->iId)
670 __ASSERT_ALWAYS(iArgv == NULL || CheckSdl(), PANIC(KErrNotReady));
672 for(TInt i = 0; i < iArgc; i++)
673 User::Free( iArgv[i] );
687 _LIT(KSDLMain, "SDLMain");
691 gEpocEnv->iCleanupItems = new (ELeave) CArrayFixFlat<TSdlCleanupItem>(8);
694 /* !! process exits here if there is "exit()" in main! */
696 for(TInt i = 0; i < 6; i++)
698 void* f = (void*) gEpocEnv->iMain[i];
704 ret = ((mainfunc1)f)();
710 ret = ((mainfunc2)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv());
713 ((mainfunc2)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv());
716 ret = ((mainfunc3)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv(), envp);
719 ((mainfunc3)f)(EpocSdlEnv::Argc(), EpocSdlEnv::Argv(), envp);
728 LOCAL_C TInt DoMain(TAny* /*aParam*/)
732 CTrapCleanup* cleanup = CTrapCleanup::New();
734 TBool fbsconnected = EFalse;
735 if(RFbsSession::GetSession() == NULL)
737 PANIC_IF_ERROR(RFbsSession::Connect());
738 fbsconnected = ETrue;
741 gEpocEnv->iAppSrv->Init();
751 //completes waiting rendesvous
752 RThread::Rendezvous(KErrNone);
754 TRAPD(err, err = MainL());
756 EpocSdlEnv::ObserverEvent(MSDLObserver::EEventMainExit, err);
758 // Free resources and return
760 EpocSdlEnv::CleanupItems();
762 gEpocEnv->iCleanupItems->Reset();
763 delete gEpocEnv->iCleanupItems;
764 gEpocEnv->iCleanupItems = NULL;
766 gEpocEnv->Free(); //free up in thread resources
769 _cleanup(); //this is normally called at exit, I call it here
773 RFbsSession::Disconnect();
782 return err == KErrNone ? ret : err;;
787 EXPORT_C CSDL::~CSDL()
790 User::Free(gEpocEnv);
791 gEpocEnv->iSdl = NULL;
794 EXPORT_C CSDL* CSDL::NewL(TInt aFlags)
796 __ASSERT_ALWAYS(gEpocEnv == NULL, PANIC(KErrAlreadyExists));
797 gEpocEnv = (EpocSdlEnvData*) User::AllocL(sizeof(EpocSdlEnvData));
798 Mem::FillZ(gEpocEnv, sizeof(EpocSdlEnvData));
800 gEpocEnv->iEpocEnvFlags = aFlags;
801 gEpocEnv->iEventQueue = CEventQueue::NewL();
803 gEpocEnv->iAppSrv = new (ELeave) CSdlAppServ();
804 gEpocEnv->iAppSrv->ConstructL();
806 CSDL* sdl = new (ELeave) CSDL();
808 gEpocEnv->iSdl = sdl;
814 EXPORT_C void CSDL::ReInitL(TFlags aFlags)
816 const TFlags prevFlags = gEpocEnv->iEpocEnvFlags;
817 gEpocEnv->iEpocEnvFlags = aFlags;
819 if(((prevFlags & EDrawModeDSB) != (aFlags & EDrawModeDSB)) && gEpocEnv->iDsa)
821 delete gEpocEnv->iDsa;
822 gEpocEnv->iDsa = NULL;
823 gEpocEnv->iDsa = CDsa::RecreateL(EpocSdlEnv::Flags(CSDL::EDrawModeDSB));
829 EXPORT_C void CSDL::SetContainerWindowL(RWindow& aWindow, RWsSession& aSession, CWsScreenDevice& aDevice)
831 if(gEpocEnv->iDsa == NULL)
832 gEpocEnv->iDsa = CDsa::CreateL(aSession);
833 gEpocEnv->iDsa->ConstructL(aWindow, aDevice);
837 EXPORT_C TThreadId CSDL::CallMainL(const TMainFunc& aFunc, TRequestStatus* const aStatus, const CDesC8Array* const aArg, TInt aFlags, TInt aStackSize)
839 ASSERT(gEpocEnv != NULL);
840 gEpocEnv->iMain = aFunc;
841 const TBool args = aArg != NULL;
843 gEpocEnv->iArgc = aArg->Count() + 1;
844 gEpocEnv->iArgv = (char**) User::AllocL(sizeof(char*) * (gEpocEnv->iArgc + 1));
847 const TFileName processName = RProcess().FileName();
848 const TInt len = processName.Length();
849 gEpocEnv->iArgv[k] = (char*) User::AllocL(len + 1);
850 Mem::Copy(gEpocEnv->iArgv[k], processName.Ptr(), len);
851 gEpocEnv->iArgv[k][len] = 0;
853 for(TInt i = 0; args && (i < aArg->Count()); i++)
856 const TInt len = aArg->MdcaPoint(i).Length();
857 gEpocEnv->iArgv[k] = (char*) User::AllocL(len + 1);
858 Mem::Copy(gEpocEnv->iArgv[k], aArg->MdcaPoint(i).Ptr(), len);
859 gEpocEnv->iArgv[k][len] = 0;
862 gEpocEnv->iArgv[gEpocEnv->iArgc] = NULL;
865 User::LeaveIfError(thread.Create(KSDLMain, DoMain, aStackSize, NULL, NULL));
869 thread.Logon(*aStatus);
872 gEpocEnv->iId = thread.Id();
873 thread.SetPriority(EPriorityLess);
874 if((aFlags & CSDL::ERequestResume) == 0)
879 return gEpocEnv->iId;
882 EXPORT_C TInt CSDL::AppendWsEvent(const TWsEvent& aEvent)
884 return EpocSdlEnv::EventQueue().Append(aEvent);
887 EXPORT_C void CSDL::SDLPanic(const TDesC& aInfo, TInt aErr)
889 EpocSdlEnv::PanicMain(aInfo, aErr);
892 EXPORT_C TInt CSDL::GetSDLCode(TInt aScanCode)
896 if(aScanCode >= MAX_SCANCODE)
898 return KeyMap()[aScanCode];
901 EXPORT_C TInt CSDL::SDLCodesCount() const
906 EXPORT_C void CSDL::ResetSDLCodes()
911 EXPORT_C void CSDL::SetOrientation(TOrientationMode aMode)
913 gEpocEnv->iDsa->SetOrientation(aMode);
916 EXPORT_C TInt CSDL::SetSDLCode(TInt aScanCode, TInt aSDLCode)
918 const TInt current = GetSDLCode(aScanCode);
919 if(aScanCode >= 0 && aScanCode < MAX_SCANCODE)
920 KeyMap()[aScanCode] = static_cast<SDLKey>(aSDLCode);
925 EXPORT_C MSDLObserver* CSDL::Observer()
927 return gEpocEnv->iAppSrv->Observer();
930 EXPORT_C void CSDL::SetObserver(MSDLObserver* aObserver)
932 gEpocEnv->iAppSrv->SetObserver(aObserver);
935 EXPORT_C void CSDL::Resume()
937 EpocSdlEnv::Resume();
940 EXPORT_C void CSDL::Suspend()
942 gEpocEnv->iDsa->DoStop();
945 EXPORT_C CSDL::CSDL()
949 EXPORT_C void CSDL::DisableKeyBlocking(CAknAppUi& aAppUi) const
951 gEpocEnv->iAppUi = &aAppUi;
952 EnvUtils::DisableKeyBlocking();
955 EXPORT_C TInt CSDL::SetBlitter(MBlitter* aBlitter)
957 if(gEpocEnv && gEpocEnv->iDsa)
959 gEpocEnv->iDsa->SetBlitter(aBlitter);
966 EXPORT_C TInt CSDL::AppendOverlay(MOverlay& aOverlay, TInt aPriority)
968 if(gEpocEnv && gEpocEnv->iDsa)
970 return gEpocEnv->iDsa->AppendOverlay(aOverlay, aPriority);
975 EXPORT_C TInt CSDL::RemoveOverlay(MOverlay& aOverlay)
977 if(gEpocEnv && gEpocEnv->iDsa)
979 return gEpocEnv->iDsa->RemoveOverlay(aOverlay);
984 EXPORT_C TInt CSDL::RedrawRequest()
986 if(gEpocEnv && gEpocEnv->iDsa)
988 return gEpocEnv->iDsa->RedrawRequest();
994 EXPORT_C CSDL* CSDL::Current()
996 return gEpocEnv != NULL ? gEpocEnv->iSdl : NULL;
1000 EXPORT_C TInt CSDL::SetVolume(TInt aVolume)
1002 return EpocSdlEnv::SetVolume(aVolume);
1005 EXPORT_C TInt CSDL::Volume() const
1007 return EpocSdlEnv::Volume();
1010 EXPORT_C TInt CSDL::MaxVolume() const
1012 return EpocSdlEnv::MaxVolume();
1016 void EnvUtils::DisableKeyBlocking()
1018 if(gEpocEnv->iAppUi != NULL)
1019 return CCurrentAppUi::Cast(gEpocEnv->iAppUi)->DisableKeyBlocking();
1022 TBool EnvUtils::Rendezvous(RThread& aThread, TRequestStatus& aStatus)
1024 if(gEpocEnv->iId != TThreadId(0) &&
1025 aThread.Open(gEpocEnv->iId) &&
1026 aThread.ExitType() == EExitPending)
1028 aThread.Rendezvous(aStatus);