diff -r e880629062dd -r e4a7b1cbe40c kernel/eka/drivers/xyin/d_xyin.cpp --- a/kernel/eka/drivers/xyin/d_xyin.cpp Wed May 05 05:11:16 2010 +0100 +++ b/kernel/eka/drivers/xyin/d_xyin.cpp Mon May 10 11:40:53 2010 +0100 @@ -1,4 +1,4 @@ -// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies). +// Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of the License "Eclipse Public License v1.0" @@ -19,6 +19,7 @@ #include #include +#include _LIT(KLitDigitiser,"Digitiser"); @@ -50,7 +51,8 @@ : DPowerHandler(KLitDigitiser), iMsgQ(rxMsg,this,NULL,1), iSampleDfc(sampleDfc,this,5), - iPenUpDfc(penUpDfc,this,5) + iPenUpDfc(penUpDfc,this,5), + iOrientation(HALData::EDigitiserOrientation_default) { // iBufferIndex=0; // iLastPos=TPoint(0,0); @@ -358,6 +360,26 @@ case EDigitiserHalXYState: kumemput32(a1, (TBool*)&iPointerOn, sizeof(TBool)); break; + + // a2 = TBool aSet (ETrue for setting, EFalse for retrieval) + // a1 = TDigitizerOrientation (set) + // a1 = &TDigitizerOrientation (get) + case EDigitiserOrientation: + if ((TBool)a2) + { + // Set the orientation attribute + // In case user thread, check it has WDD capability + if(!Kern::CurrentThreadHasCapability(ECapabilityWriteDeviceData,__PLATSEC_DIAGNOSTIC_STRING("Checked by Hal function EDigitiserOrientation"))) + return KErrPermissionDenied; + iOrientation = (TInt)a1; + } + else + { + // Get the orientation attribute, safe copy it into user memory + kumemput32(a1, &iOrientation, sizeof(TInt)); + } + break; + default: r=KErrNotSupported; break;