windowing/windowserver/nga/SERVER/openwfc/GROUPWIN.CPP
changeset 188 1b081cb0800b
parent 0 5d03bc08d59c
child 164 25ffed67c7ef
equal deleted inserted replaced
187:9f66f99ee56f 188:1b081cb0800b
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   513 				if (*pData.UInt!=0)	// Ignore null handle
   513 				if (*pData.UInt!=0)	// Ignore null handle
   514 					{
   514 					{
   515 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_KEY);
   515 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_KEY);
   516 					if (destroyObj)
   516 					if (destroyObj)
   517 						{
   517 						{
   518 						//Cancel any repeat that is underway for this key
   518 						// Cancel any repeat that is underway for this capture
   519 						const TWsWinCmdCaptureKey& capKey(*pData.CaptureKey);
   519 						CKeyboardRepeat::CancelRepeat(destroyObj, EFalse);
   520 						CKeyboardRepeat::CancelRepeat(this,capKey.key,EFalse,capKey.modifierMask);
       
   521 						delete destroyObj;
   520 						delete destroyObj;
   522 						}
   521 						}
   523 					else
   522 					else
   524 						{
   523 						{
   525 #ifdef _DEBUG
   524 #ifdef _DEBUG
   533 				if (*pData.UInt!=0)	// Ignore null handle
   532 				if (*pData.UInt!=0)	// Ignore null handle
   534 					{
   533 					{
   535 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_KEY_UPDOWNS);
   534 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_KEY_UPDOWNS);
   536 					if (destroyObj)
   535 					if (destroyObj)
   537 						{
   536 						{
   538 						//Cancel any repeat that is underway for this key
       
   539 						const TWsWinCmdCaptureKey& capKey(*pData.CaptureKey);
       
   540 						CKeyboardRepeat::CancelRepeat(this,capKey.key,EFalse,capKey.modifierMask);
       
   541 						delete destroyObj;
   537 						delete destroyObj;
   542 						}
   538 						}
   543 					else
   539 					else
   544 						{
   540 						{
   545 #ifdef _DEBUG						
   541 #ifdef _DEBUG						
   553 				if (*pData.UInt!=0)	// Ignore null handle
   549 				if (*pData.UInt!=0)	// Ignore null handle
   554 					{
   550 					{
   555 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_LONG_KEY);
   551 					CWsObject *destroyObj = iWsOwner->HandleToObj(*pData.UInt, WS_HANDLE_CAPTURE_LONG_KEY);
   556 					if (destroyObj)
   552 					if (destroyObj)
   557 						{
   553 						{
   558 						//Cancel any repeat that is underway for this key
   554 						// Cancel any repeat that is underway for this capture
   559 						const TWsWinCmdCaptureLongKey& capKey(*pData.CaptureLongKey);
   555 						CKeyboardRepeat::CancelRepeat(destroyObj, ETrue);
   560 						CKeyboardRepeat::CancelRepeat(this,capKey.inputKey,ETrue,capKey.modifierMask);
       
   561 						delete destroyObj;
   556 						delete destroyObj;
   562 						} 
   557 						} 
   563 					else
   558 					else
   564 						{
   559 						{
   565 #ifdef _DEBUG						
   560 #ifdef _DEBUG						
   904 	}
   899 	}
   905 
   900 
   906 TBool CWsWindowGroup::SetOrdinalPosition(TInt aPos,CWsWindowGroup* aClosingWindow)
   901 TBool CWsWindowGroup::SetOrdinalPosition(TInt aPos,CWsWindowGroup* aClosingWindow)
   907 	{
   902 	{
   908 	TBool ret=ETrue;
   903 	TBool ret=ETrue;
       
   904 	
       
   905 	// Remember if the window group tree is actually changed or not, so that we know whether to 
       
   906 	// check the render orientation after the re-ordering is done ( see CWsTop::CheckRenderOrientation()
       
   907 	// call at end of this method
       
   908 	TBool changed = CheckOrdinalPositionChange(aPos);	
       
   909 	
   909 	if (!iQueue)
   910 	if (!iQueue)
   910 		ret=DoSetOrdinalPosition1(aPos,aClosingWindow);
   911 		ret=DoSetOrdinalPosition1(aPos,aClosingWindow);
   911 	else
   912 	else
   912 		{
   913 		{
   913 		TDblQueIter<CWsWindowGroup> iter(*iQueue);
   914 		TDblQueIter<CWsWindowGroup> iter(*iQueue);
   960 			}
   961 			}
   961 		WS_ASSERT_DEBUG(ok, EWsPanicGroupWindowChainError);
   962 		WS_ASSERT_DEBUG(ok, EWsPanicGroupWindowChainError);
   962 #endif
   963 #endif
   963 		}
   964 		}
   964 
   965 
       
   966 	// If the ordinal positions have changed, check to see if there is a new render orientation
       
   967 	// and publish it if so
       
   968 	if(changed)
       
   969 	    CWsTop::CheckRenderOrientation();
       
   970 	
   965 	return ret;
   971 	return ret;
   966 	}
   972 	}
   967 
   973 
   968 
   974 
   969 void CWsWindowGroup::MoveChainedWindows(TDblQueIter<CWsWindowGroup>& aIter,TBool aForward,TInt aPos,CWsWindowGroup* aClosingWindow)
   975 void CWsWindowGroup::MoveChainedWindows(TDblQueIter<CWsWindowGroup>& aIter,TBool aForward,TInt aPos,CWsWindowGroup* aClosingWindow)
  1346 		delete pk;
  1352 		delete pk;
  1347 		pk=next;
  1353 		pk=next;
  1348 		}
  1354 		}
  1349 	}
  1355 	}
  1350 
  1356 
  1351 TBool CWsWindowGroup::CheckForPriorityKey(const TKeyData &aKey, TInt aScanCode)
  1357 TBool CWsWindowGroup::CheckForPriorityKey(const TKeyEvent &aKeyEvent)
  1352 	{
  1358 	{
  1353 	for(TPriorityKey *pk=iPriorityKeys;pk;pk=pk->iNext)
  1359 	for(TPriorityKey *pk=iPriorityKeys;pk;pk=pk->iNext)
  1354 		{
  1360 		{
  1355 		if (pk->KeyMatches(aKey))
  1361 		if (pk->KeyMatches(aKeyEvent))
  1356 			{	
  1362 			{	
  1357 			WsOwner()->PriorityKeyPressed(ClientHandle(),aKey, aScanCode);
  1363 			WsOwner()->PriorityKeyPressed(ClientHandle(), aKeyEvent);
  1358 			return(ETrue);
  1364 			return(ETrue);
  1359 			}
  1365 			}
  1360 		}
  1366 		}
  1361 	return(EFalse);
  1367 	return(EFalse);
  1362 	}
  1368 	}