emulator/emulatorbsp/specific/gui.cpp
branchRCL_3
changeset 9 0227b64654ad
parent 0 cec860690d41
equal deleted inserted replaced
7:582f97e694c5 9:0227b64654ad
     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".
  4106 TInt DMasterIni::DoXYHalFunction(TAny* aThis, TInt aFunction, TAny* a1, TAny* a2)
  4106 TInt DMasterIni::DoXYHalFunction(TAny* aThis, TInt aFunction, TAny* a1, TAny* a2)
  4107 	{
  4107 	{
  4108 	return static_cast<DMasterIni*>(aThis)->XYHalFunction(aFunction,a1,a2);
  4108 	return static_cast<DMasterIni*>(aThis)->XYHalFunction(aFunction,a1,a2);
  4109 	}
  4109 	}
  4110 
  4110 
  4111 TInt DMasterIni::XYHalFunction(TInt aFunction, TAny* a1, TAny* /*a2*/)
  4111 TInt DMasterIni::XYHalFunction(TInt aFunction, TAny* a1, TAny* a2)
  4112 	{
  4112 	{
  4113 	TInt r=KErrNone;
  4113 	TInt r=KErrNone;
  4114 	switch(aFunction)
  4114 	switch(aFunction)
  4115 		{
  4115 		{
  4116 		case EDigitiserHalXYInfo:
  4116 		case EDigitiserHalXYInfo:
  4127 				}
  4127 				}
  4128 			else
  4128 			else
  4129 				r=KErrNotSupported;
  4129 				r=KErrNotSupported;
  4130 			}
  4130 			}
  4131 			break;
  4131 			break;
       
  4132 			
       
  4133 		// a2 = TBool aSet (ETrue for setting, EFalse for retrieval) 
       
  4134 		// a1 = TDigitizerOrientation (set)
       
  4135 		// a1 = &TDigitizerOrientation (get)
       
  4136 		// Assume screen [0] here as this HAL function is only registered for
       
  4137 		// screen 0 on the emulator platform. Function only called if display==0
       
  4138 		case EDigitiserOrientation:	
       
  4139 			if ((TBool)a2)
       
  4140 				{
       
  4141 				// Set the orientation attribute
       
  4142 				// In case user thread, check it has WDD capability
       
  4143 				if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDigitiserOrientation")))
       
  4144 					return KErrPermissionDenied;
       
  4145 				systemIni->iScreens[0]->iXYOrientation = (TInt)a1;
       
  4146 				}
       
  4147 			else
       
  4148 				{
       
  4149 				// Get the orientation attribute, safe copy it into user memory
       
  4150 				kumemput32(a1, &(systemIni->iScreens[0]->iXYOrientation), sizeof(TInt));	
       
  4151 				}
       
  4152 			break; 
       
  4153 			
  4132 		default:
  4154 		default:
  4133 			r=KErrNotSupported;
  4155 			r=KErrNotSupported;
  4134 			break;
  4156 			break;
  4135 		}
  4157 		}
  4136 	return r;
  4158 	return r;