# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1270060506 -10800 # Node ID 3e521e99f8131a79528491b5fe9b7ad60d99da01 # Parent 50bbdc59f9c4aa355a8f36a756064398d5b13597 Revision: 201011 Kit: 201013 diff -r 50bbdc59f9c4 -r 3e521e99f813 package_definition.xml --- a/package_definition.xml Mon Mar 15 12:40:49 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r 50bbdc59f9c4 -r 3e521e99f813 vtengines/videoteleng/Inc/Commands/CVtEngCommandHandler.h --- a/vtengines/videoteleng/Inc/Commands/CVtEngCommandHandler.h Mon Mar 15 12:40:49 2010 +0200 +++ b/vtengines/videoteleng/Inc/Commands/CVtEngCommandHandler.h Wed Mar 31 21:35:06 2010 +0300 @@ -76,6 +76,11 @@ /** * @see MVtEngCommandHandler */ + virtual TVtEngCommandId InvalidCommand(); + + /** + * @see MVtEngCommandHandler + */ virtual void AddObserverL( MVtEngCommandObserver& aObserver ); /** @@ -185,6 +190,7 @@ CVtEngHandlerContainer& iHandlers; CVtEngOperation* iActiveOp; CVtEngCmdPool* iCommandPool; + TVtEngCommandId iInvalidCommandId; }; diff -r 50bbdc59f9c4 -r 3e521e99f813 vtengines/videoteleng/Inc/Commands/MVtEngCommandHandler.h --- a/vtengines/videoteleng/Inc/Commands/MVtEngCommandHandler.h Mon Mar 15 12:40:49 2010 +0200 +++ b/vtengines/videoteleng/Inc/Commands/MVtEngCommandHandler.h Wed Mar 31 21:35:06 2010 +0300 @@ -97,6 +97,12 @@ virtual TVtEngCommandId PendingCommand() = 0; /** + * Returns invalid command. + * @return invalid command + */ + virtual TVtEngCommandId InvalidCommand() = 0; + + /** * Sets command observer. First call on this is guaranteed * to succeed. * @param aObserver command observer. diff -r 50bbdc59f9c4 -r 3e521e99f813 vtengines/videoteleng/Src/Commands/CVtEngCommandHandler.cpp --- a/vtengines/videoteleng/Src/Commands/CVtEngCommandHandler.cpp Mon Mar 15 12:40:49 2010 +0200 +++ b/vtengines/videoteleng/Src/Commands/CVtEngCommandHandler.cpp Wed Mar 31 21:35:06 2010 +0300 @@ -53,7 +53,8 @@ CVtEngCommandHandler::CVtEngCommandHandler( CVtEngHandlerContainer& aHandlers ) : iObservers( 1 ), - iHandlers( aHandlers ) + iHandlers( aHandlers ), + iInvalidCommandId( KVtEngCommandNone ) { } @@ -265,6 +266,16 @@ } // ----------------------------------------------------------------------------- +// CVtEngCommandHandler::InvalidCommand +// +// ----------------------------------------------------------------------------- +// +TVtEngCommandId CVtEngCommandHandler::InvalidCommand() + { + return iInvalidCommandId; + } + +// ----------------------------------------------------------------------------- // CVtEngCommandHandler::AddObserverL // // ----------------------------------------------------------------------------- @@ -483,6 +494,7 @@ const TVtEngCommandId aCommandId, TInt& aCaps ) { + iInvalidCommandId = KVtEngCommandNone; aCaps &= (~EAttribEnabled); if ( !(iActiveOp && ( aCaps & EAttribAsync ) ) ) { @@ -491,12 +503,11 @@ { aCaps |= EAttribEnabled; } -#ifdef VTDEBUG else { + iInvalidCommandId = aCommandId; __VTPRINT( DEBUG_GEN, "ComHlr.ChkState INVALID" ) } -#endif // VTDEBUG } __VTPRINT3( DEBUG_GEN | DEBUG_DETAIL, " capsState cmd=%d,caps=%d", aCommandId, aCaps ) } diff -r 50bbdc59f9c4 -r 3e521e99f813 vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp --- a/vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp Mon Mar 15 12:40:49 2010 +0200 +++ b/vtengines/videoteleng/Src/Media/CVtEngLocalVideo.cpp Wed Mar 31 21:35:06 2010 +0300 @@ -1279,7 +1279,7 @@ { TVtEngProviderType delayedSelect( iDelayedSelect.DelayedSelectTarget() ); if ( delayedSelect != KVtEngProviderNone && - delayedSelect != KVtEngProviderDefaultStillImage ) + delayedSelect != KVtEngProviderImage ) { aSource = delayedSelect; } diff -r 50bbdc59f9c4 -r 3e521e99f813 vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp --- a/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp Mon Mar 15 12:40:49 2010 +0200 +++ b/vtengines/videoteleng/Src/Media/CVtEngMediaHandler.cpp Wed Mar 31 21:35:06 2010 +0300 @@ -543,7 +543,9 @@ case KVtEngHandleLayoutChange: if ( iLocalVideo && iLocalVideo->ActiveProvider() != - CVtEngLocalVideo::KVtEngProviderNone && !iPendingOp ) + CVtEngLocalVideo::KVtEngProviderNone && + !iPendingOp && iLocalVideo->ActiveProvider() != + CVtEngLocalVideo::KVtEngProviderImage ) { okToPerform = KErrNone; } diff -r 50bbdc59f9c4 -r 3e521e99f813 vtengines/vtmediatorplugin/inc/cvtmediatorplugin.h --- a/vtengines/vtmediatorplugin/inc/cvtmediatorplugin.h Mon Mar 15 12:40:49 2010 +0200 +++ b/vtengines/vtmediatorplugin/inc/cvtmediatorplugin.h Wed Mar 31 21:35:06 2010 +0300 @@ -286,8 +286,6 @@ // Application thread id. TThreadId iAppThreadId; - // Owned window server session. - RWsSession iWsSession; /** * Active object for waiting thread death. * diff -r 50bbdc59f9c4 -r 3e521e99f813 vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp --- a/vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp Mon Mar 15 12:40:49 2010 +0200 +++ b/vtengines/vtmediatorplugin/src/cvtmediatorplugin.cpp Wed Mar 31 21:35:06 2010 +0300 @@ -154,8 +154,6 @@ { delete iAppDeathActive; iAppThread.Close(); - iWsSession.Close(); - } TRACE("CVtMediatorPlugin::~CVtMediatorPlugin>") @@ -528,7 +526,9 @@ iAppDeathActive = new ( ELeave ) CAppDeathActive( *this, iAppThread ); - User::LeaveIfError( iWsSession.Connect() ); + RWsSession wsSession; + User::LeaveIfError( wsSession.Connect() ); + CleanupClosePushL( wsSession ); TInt wgId = 0; TBool found = EFalse; @@ -539,10 +539,10 @@ { CApaWindowGroupName::FindByAppUid( KVtCmVideoTelUiUid, - iWsSession, + wsSession, wgId ); - TApaTask task( iWsSession ); + TApaTask task( wsSession ); task.SetWgId( wgId ); if ( task.Exists() ) { @@ -563,7 +563,8 @@ iAppThread.Close(); } } - + CleanupStack::PopAndDestroy(); // CleanupClosePushL + // If application was not found, then launch new application. if ( !found ) { @@ -931,7 +932,6 @@ TRACE("CVtMediatorPlugin.StopDeathActive<") delete iAppDeathActive; iAppThread.Close(); - iWsSession.Close(); //if there is a waiting call, check if we need to launch it TRACE2("CVtMediatorPlugin.StopDeathActive WaitintCallID=%d>", iWaitingVideoCallInfo.iCallId) diff -r 50bbdc59f9c4 -r 3e521e99f813 vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp --- a/vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp Mon Mar 15 12:40:49 2010 +0200 +++ b/vtprotocolplugins/VideoSource/src/CVSStillImageDataProvider.cpp Wed Mar 31 21:35:06 2010 +0300 @@ -327,7 +327,7 @@ iActiveWait = new (ELeave) CVSActiveWait< CVSStillImageDataProvider > ( this ); //Create viewer - iViewer = CMultiframeProvider::NewL( this , iDisplayMode ); + iViewer = CMultiframeProvider::NewL( this , EColor16MU/*iDisplayMode*/ ); User::LeaveIfError( iFreezeCS.CreateLocal() ); __IF_DEBUG(Print(_L("VideoSource [%d]: CVSStillImageDataProvider::CommonInitializeL() <<"), RThread().Id().operator TUint())); diff -r 50bbdc59f9c4 -r 3e521e99f813 vtuis/videotelui/data/videotelui.rss --- a/vtuis/videotelui/data/videotelui.rss Mon Mar 15 12:40:49 2010 +0200 +++ b/vtuis/videotelui/data/videotelui.rss Wed Mar 31 21:35:06 2010 +0300 @@ -1761,8 +1761,8 @@ { CBA_BUTTON { - id = EAknSoftkeyEmpty; - txt = text_softkey_empty; + id = EVtUiCmdDialerEmergencyCall; + txt = qtn_incal_softk_emergency_call; }, CBA_BUTTON { diff -r 50bbdc59f9c4 -r 3e521e99f813 vtuis/videotelui/inc/CVtUiAppUi.h --- a/vtuis/videotelui/inc/CVtUiAppUi.h Mon Mar 15 12:40:49 2010 +0200 +++ b/vtuis/videotelui/inc/CVtUiAppUi.h Wed Mar 31 21:35:06 2010 +0300 @@ -1185,6 +1185,11 @@ * This function hides the brightness, contrast, volume slider if their mode is on. */ void StopSliders(); + + /* + * This function can get the focus window group id + */ + TInt GetFocusWindowGroupId(); /** * Does pre handling to key events, especially for Zoom in and Zoom out diff -r 50bbdc59f9c4 -r 3e521e99f813 vtuis/videotelui/inc/videotelui.hrh --- a/vtuis/videotelui/inc/videotelui.hrh Mon Mar 15 12:40:49 2010 +0200 +++ b/vtuis/videotelui/inc/videotelui.hrh Wed Mar 31 21:35:06 2010 +0300 @@ -110,7 +110,9 @@ // Adjust video colour tone EVtUiCmdAdjustVideoColourTone, //6114 // Dialer close - EVtUiDialerExit //6115 + EVtUiDialerExit, //6115 + // Dialer emergency call + EVtUiCmdDialerEmergencyCall //6116 }; // Enumerates bitmap identifiers diff -r 50bbdc59f9c4 -r 3e521e99f813 vtuis/videotelui/loc/videotelui.loc --- a/vtuis/videotelui/loc/videotelui.loc Mon Mar 15 12:40:49 2010 +0200 +++ b/vtuis/videotelui/loc/videotelui.loc Wed Mar 31 21:35:06 2010 +0300 @@ -398,4 +398,10 @@ // r: 5.0 // #define qtn_vt_button_end_call "End Call" + +// d: It is text in softkey to make emergency call. +// l: control_pane_t1/opt7 +// r: 5.0 +// +#define qtn_incal_softk_emergency_call "Emerg. Call" // End of File diff -r 50bbdc59f9c4 -r 3e521e99f813 vtuis/videotelui/src/CVtUiAppUi.cpp --- a/vtuis/videotelui/src/CVtUiAppUi.cpp Mon Mar 15 12:40:49 2010 +0200 +++ b/vtuis/videotelui/src/CVtUiAppUi.cpp Wed Mar 31 21:35:06 2010 +0300 @@ -1481,8 +1481,7 @@ { // If focus window group is not this application nor window server, // then this application can not be in focus. - const TInt windowGroupId = - iCoeEnv->WsSession().GetFocusWindowGroup(); + const TInt windowGroupId = GetFocusWindowGroupId(); if ( ( windowGroupId != iThisApplicationWgId ) && ( windowGroupId != iEikonServerWgId ) && @@ -1552,6 +1551,62 @@ } // ----------------------------------------------------------------------------- +// CVtUiAppUi::GetFocusWindowGroupId +// ----------------------------------------------------------------------------- +// +TInt CVtUiAppUi::GetFocusWindowGroupId() + { + __VTPRINTENTER( "VtUi.GetFocusWindowGroupId" ) + RWsSession& ws = iCoeEnv->WsSession(); + RArray* allWgIds = + new (ELeave) RArray( 4 ); + + CleanupDeletePushL( allWgIds ); + CleanupClosePushL( *allWgIds ); + + User::LeaveIfError( ws.WindowGroupList( 0, allWgIds) ); + + const TInt chainCount = allWgIds->Count(); + + RApaLsSession appArcSession; + User::LeaveIfError( appArcSession.Connect() ); + + appArcSession.GetAllApps(); + + CApaWindowGroupName* windowName; + TInt firstAppWgId = KErrNone; + for ( TInt index=0; index < chainCount; index++ ) + { + RWsSession::TWindowGroupChainInfo& info = (*allWgIds)[index]; + if ( info.iParentId <= 0 ) + { + TInt wgId=info.iId; + windowName = CApaWindowGroupName::NewLC(ws, wgId); + TUid applicationUid = windowName->AppUid(); + + // application screen (0 = main screen, 1 = cover ui ) + // the possible error value is omitted + TInt appScreen = -1; + TInt errId = appArcSession.GetDefaultScreenNumber( appScreen, applicationUid ); + if ( errId != KErrNone ) + { + CleanupStack::PopAndDestroy( windowName ); //windowName + continue; + } + if ( firstAppWgId == KErrNone && ( appScreen == 0 || appScreen == -1 ) ) + { + firstAppWgId = wgId; // firstAppWgId should be the top windows group id. + } + + CleanupStack::PopAndDestroy(); //windowName + } + } + __VTPRINTEXIT( "VtUi.GetFocusWindowGroupId" ) + return firstAppWgId; + } + + +// ----------------------------------------------------------------------------- // CVtUiAppUi::PreHandleKeyEventL // // ----------------------------------------------------------------------------- @@ -2259,6 +2314,11 @@ CmdGoToIdleL(); break; + // Dial emergency call + case EVtUiCmdDialerEmergencyCall: + __VTPRINT( DEBUG_GEN, "VtUiHandleCommand.CmdEmergencyCall" ); + CmdSimulateKeyEvent( EStdKeyYes ); + break; // Object sharing related case EVtUiCmdShareObjectImage: @@ -4921,13 +4981,15 @@ __VTPRINT( DEBUG_GEN, "VtUi.DoLayoutChg KVtEngHandleLayoutChange == KErrNotReady (ok)" ) TVtEngCommandId pendingCommand = Model().CommandHandler().PendingCommand(); + TVtEngCommandId invalidCommand = Model().CommandHandler().InvalidCommand(); if ( pendingCommand == KVtEngMuteOutgoingAudio || pendingCommand == KVtEngUnmuteOutgoingAudio || pendingCommand == KVtEngSetAudioRouting || pendingCommand == KVtEngSetAudioVolume || pendingCommand == KVtEngSetSource || pendingCommand == KVtEngPrepareCamera || - pendingCommand == KVtEngUnfreeze ) + pendingCommand == KVtEngUnfreeze || + invalidCommand == KVtEngHandleLayoutChange ) { iUiStates->SetLayoutChangeNeeded( ETrue ); } @@ -6977,7 +7039,8 @@ aCommand == KVtEngSetAudioVolume || aCommand == KVtEngSetSource || aCommand == KVtEngPrepareCamera || - aCommand == KVtEngUnfreeze ) ) + aCommand == KVtEngUnfreeze || + aCommand == KVtEngHandleLayoutChange ) ) { iAppUi.iUiStates->SetLayoutChangeNeeded( EFalse ); iAppUi.DoHandleLayoutChangedL(); diff -r 50bbdc59f9c4 -r 3e521e99f813 vtuis/videotelui/src/features/toolbar/cvtuifixedtoolbar.cpp --- a/vtuis/videotelui/src/features/toolbar/cvtuifixedtoolbar.cpp Mon Mar 15 12:40:49 2010 +0200 +++ b/vtuis/videotelui/src/features/toolbar/cvtuifixedtoolbar.cpp Wed Mar 31 21:35:06 2010 +0300 @@ -159,7 +159,11 @@ { iIdle = CIdle::NewL( CActive::EPriorityIdle ); } - iIdle->Start( TCallBack( &DoDimToolbarButtons, this ) ); + + if ( !iIdle->IsActive() ) + { + iIdle->Start( TCallBack( &DoDimToolbarButtons, this ) ); + } } // Landsacpe to portrait hide tb else @@ -181,8 +185,8 @@ void CVtUiFixedToolbar::DimToolbarbuttons( TBool aIsDimmed ) { __VTPRINTENTER( "FixedToolbar.DimToolbarbuttons" ) - iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleVideo, aIsDimmed, EFalse ); - iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleMicrophone, aIsDimmed, EFalse ); + iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleVideo, aIsDimmed, ETrue ); + iToolbar->SetItemDimmed( EVtUiCmdToolbarToggleMicrophone, aIsDimmed, ETrue ); iToolbar->SetItemDimmed( EVtUiCmdToolbarAudioRouting, aIsDimmed, ETrue ); __VTPRINTEXITR( "FixedToolbar.DimToolbarbuttons %d", aIsDimmed ) }