kernel/eka/drivers/xyin/d_xyin.cpp
branchRCL_3
changeset 36 bbf8bed59bcb
parent 0 a41df078684a
equal deleted inserted replaced
28:5b5d147c7838 36:bbf8bed59bcb
     1 // Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1998-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 the License "Eclipse Public License v1.0"
     4 // under the terms of the License "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".
    17 //
    17 //
    18 
    18 
    19 
    19 
    20 #include <drivers/xyin.h>
    20 #include <drivers/xyin.h>
    21 #include <kernel/kern_priv.h>
    21 #include <kernel/kern_priv.h>
       
    22 #include <hal_data.h>
    22 
    23 
    23 _LIT(KLitDigitiser,"Digitiser");
    24 _LIT(KLitDigitiser,"Digitiser");
    24 
    25 
    25 LOCAL_C void sampleDfc(TAny* aPtr)
    26 LOCAL_C void sampleDfc(TAny* aPtr)
    26 	{
    27 	{
    48 
    49 
    49 DDigitiser::DDigitiser()
    50 DDigitiser::DDigitiser()
    50 	:	DPowerHandler(KLitDigitiser),
    51 	:	DPowerHandler(KLitDigitiser),
    51 		iMsgQ(rxMsg,this,NULL,1),
    52 		iMsgQ(rxMsg,this,NULL,1),
    52 		iSampleDfc(sampleDfc,this,5),
    53 		iSampleDfc(sampleDfc,this,5),
    53 		iPenUpDfc(penUpDfc,this,5)
    54 		iPenUpDfc(penUpDfc,this,5),
       
    55 		iOrientation(HALData::EDigitiserOrientation_default)
    54 	{
    56 	{
    55 //	iBufferIndex=0;
    57 //	iBufferIndex=0;
    56 //	iLastPos=TPoint(0,0);
    58 //	iLastPos=TPoint(0,0);
    57 //	iState=EIdle;
    59 //	iState=EIdle;
    58 //	iCount=0;
    60 //	iCount=0;
   356 			}
   358 			}
   357 			break;
   359 			break;
   358 		case EDigitiserHalXYState:
   360 		case EDigitiserHalXYState:
   359 			kumemput32(a1, (TBool*)&iPointerOn, sizeof(TBool));
   361 			kumemput32(a1, (TBool*)&iPointerOn, sizeof(TBool));
   360 			break;
   362 			break;
       
   363 			
       
   364 		// a2 = TBool aSet (ETrue for setting, EFalse for retrieval) 
       
   365 		// a1 = TDigitizerOrientation (set)
       
   366 		// a1 = &TDigitizerOrientation (get)
       
   367 		case EDigitiserOrientation:	
       
   368 			if ((TBool)a2)
       
   369 				{
       
   370 				// Set the orientation attribute
       
   371 				// In case user thread, check it has WDD capability
       
   372 				if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDigitiserOrientation")))
       
   373 					return KErrPermissionDenied;
       
   374 				iOrientation = (TInt)a1;
       
   375 				}
       
   376 			else
       
   377 				{
       
   378 				// Get the orientation attribute, safe copy it into user memory
       
   379 				kumemput32(a1, &iOrientation, sizeof(TInt));	
       
   380 				}
       
   381 			break; 
       
   382 			
   361 		default:
   383 		default:
   362 			r=KErrNotSupported;
   384 			r=KErrNotSupported;
   363 			break;
   385 			break;
   364 		}
   386 		}
   365 	return r;
   387 	return r;