void RWsTextCursor::doDraw(CFbsBitGc* aGc, const TRegion& aRegion) { TRegionFix<1> justInCase; const TRegion *pr= &aRegion; if (aRegion.CheckError()) { justInCase.AddRect(iWin->AbsRect()); pr= &justInCase; } if (!pr->IsEmpty()) { aGc->SetUserDisplayMode(iWin->DisplayMode()); aGc->SetDitherOrigin(iWin->Origin()); aGc->SetDrawMode(CGraphicsContext::EDrawModeXOR); switch (iType) { case TTextCursor::ETypeRectangle: { aGc->SetBrushStyle(CGraphicsContext::ESolidBrush); aGc->SetPenStyle(CGraphicsContext::ENullPen); aGc->SetBrushColor(iColor); } break; case TTextCursor::ETypeHollowRectangle: { aGc->SetBrushStyle(CGraphicsContext::ENullBrush); aGc->SetPenStyle(CGraphicsContext::ESolidPen); aGc->SetPenColor(iColor); } break; default: WS_PANIC_ALWAYS(EWsPanicInvalidCursorType); } aGc->SetClippingRegion(pr); aGc->DrawRect(RectRelativeToScreen()); aGc->SetUserDisplayMode(ENone); TWindowServerEvent::NotifyScreenDrawingEvent(pr); } }
TInt E32Main() { __UHEAP_MARK; UserSvr::WsRegisterThread(); RThread thread; // Set wserv's main thread to system permanent TInt err; err = User::SetCritical(User::ESystemPermanent); if (err!=KErrNone) { WS_PANIC_ALWAYS(EWsPanicFailedToSetThread); } // If in the future wserv becomes multi-threaded, // we can uncomment the following lines to set any new threads to be system permanent as well. // err = User::SetProcessCritical(User::ESystemPermanent); // if (err!=KErrNone) // { // WS_PANIC_ALWAYS(EWsPanicFailedToSetProcess); // } thread.SetPriority(EPriorityMore); err = User::RenameThread(KWSERVThreadName); if (err==KErrNone) { thread.Close(); } else { return err; } CTrapCleanup* CleanUpStack=CTrapCleanup::New(); TRAP(err, WsIniFile = CIniFile::NewL()); if (err!=KErrNone) { WS_PANIC_ALWAYS(EWsPanicFailedToInitialise); } _LIT(KMemLeakCheck, "MEMLEAKCHECK"); if (WsIniFile->FindVar(KMemLeakCheck)) { RDebug::Printf("The Memory Leak Check is Enabled => ECOM plugins are preload"); CWsPluginManager* pm = NULL; TRAP(err,pm = CWsPluginManager::NewL()); delete pm; if (err!=KErrNone) { WS_PANIC_ALWAYS(EWsPanicFailedToInitialise); } } // Define properties for singleton callbacks. This must only be done ONCE // to ensure the properties can't be hijacked. gReleaseSingletonsOnExit = ETrue; DefineSingletonKey(KOpenWfcInteropCleanupKey); DefineSingletonKey(KOpenWfcImplCleanupKey); TInt startCount; do { User::Heap().__DbgMarkStart(); startCount=User::Heap().Count(); TRAP(err,CWsTop::RunServerL()); if (err!=KErrNone) { WS_PANIC_ALWAYS(EWsPanicFailedToInitialise); } UserSvr::ReleaseEventHook(); } while (CWsTop::NeedsHeapCheckAndRestart(startCount)); REComSession::FinalClose(); // Now we can unload the plugins' dlls delete WsIniFile; delete CleanUpStack; __UHEAP_MARKEND; return(err); }
void CWsRootWindow::CommandL(TInt , const TAny *) { WS_PANIC_ALWAYS(EWsPanicRootCommand); }