start branch sharp_contrib_0 sharp_contrib_0
authorMitsuaki Nakamura <nakamura-mitsuaki@sharp.co.jp>
Mon, 24 May 2010 14:11:29 +0900
branchsharp_contrib_0
changeset 80 823021ef148e
parent 71 9e048f93dc24
start branch sharp_contrib_0
windowing/windowserver/inc/pointerevent.h
windowing/windowserver/nonnga/SERVER/EVENT.CPP
windowing/windowserver/nonnga/SERVER/POINTER.CPP
windowing/windowserver/nonnga/SERVER/pointer.h
--- a/windowing/windowserver/inc/pointerevent.h	Tue May 18 14:02:18 2010 +0100
+++ b/windowing/windowserver/inc/pointerevent.h	Mon May 24 14:11:29 2010 +0900
@@ -9,6 +9,7 @@
 // Nokia Corporation - initial contribution.
 //
 // Contributors:
+// Sharp Corporation - contribution of modification for Enhancement of Pointer Event.
 //
 // Description:
 //
@@ -109,6 +110,38 @@
  		@publishedAll
  		@released */
 		EExitHighPressure,
+		/* Caused by "Tap" Gesture Event from pointing device directry */
+		EGestureTap = 0x0080,
+		/* Caused by "LongPress" Gesture Event from pointing device directry */
+		EGesturePress,
+		/* Caused by "FlickUp" Gesture Event from pointing device directry */
+		EGestureFlickup,
+		/* Caused by "FlickDown" Gesture Event from pointing device directry */
+		EGestureFlickDown,
+		/* Caused by "FlickLeft" Gesture Event from pointing device directry */
+		EGestureFlickLeft,
+		/* Caused by "FlickRight" Gesture Event from pointing device directry */
+		EGestureFlickRight,
+		/* Caused by General "Flick" Gesture Event from pointing device directry */
+		EGestureFlick,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom1,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom2,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom3,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom4,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom5,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom6,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom7,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom8,
+		/* Caused by Custom Gesture Event from pointing device directry (for Reserved) */
+		EGestureCustom9,
 		/** WSERV will never generate TPointerEvent with this type.
 		    
 		    WARNING: Enum for internal use ONLY.  Compatibility is not guaranteed in future releases. */
--- a/windowing/windowserver/nonnga/SERVER/EVENT.CPP	Tue May 18 14:02:18 2010 +0100
+++ b/windowing/windowserver/nonnga/SERVER/EVENT.CPP	Mon May 24 14:11:29 2010 +0900
@@ -9,6 +9,7 @@
 // Nokia Corporation - initial contribution.
 //
 // Contributors:
+// Sharp Corporation - contribution of modification for Enhancement of Pointer Event.
 //
 // Description:
 // Top level window server code
@@ -817,6 +818,24 @@
 	case TRawEvent::EPointerSwitchOn:
 		aType=TPointerEvent::ESwitchOn;
 		break;
+	case TRawEvent::EGestureTap:
+	case TRawEvent::EGesturePress:
+	case TRawEvent::EGestureFlickup:
+	case TRawEvent::EGestureFlickDown:
+	case TRawEvent::EGestureFlickLeft:
+	case TRawEvent::EGestureFlickRight:
+	case TRawEvent::EGestureFlick:
+	case TRawEvent::EGestureCustom1:
+	case TRawEvent::EGestureCustom2:
+	case TRawEvent::EGestureCustom3:
+	case TRawEvent::EGestureCustom4:
+	case TRawEvent::EGestureCustom5:
+	case TRawEvent::EGestureCustom6:
+	case TRawEvent::EGestureCustom7:
+	case TRawEvent::EGestureCustom8:
+	case TRawEvent::EGestureCustom9:
+		aType = static_cast<TPointerEvent::TType>(aRawEvent.Type());
+		break;
 	default:
 		aHandled=EFalse;
 		}
@@ -832,8 +851,9 @@
 	GetPointerEvent(type, aRawEvent, handled);
 	if (handled)
 		{
-		TPoint xy(aRawEvent.Pos());
-		WsPointer::ProcessEvent(type, xy, iKeyTranslator->GetModifierState(), aGroupWin, ETrue);
+		TRawEvent_Local* pEventLocal = (TRawEvent_Local*)&aRawEvent ;
+		TPoint xy(pEventLocal->GetPos());
+		WsPointer::ProcessEvent(type, xy, iKeyTranslator->GetModifierState(), aGroupWin, ETrue, &aRawEvent);
 		}
 	return handled;
 	}
@@ -1010,6 +1030,22 @@
 		case TRawEvent::EButton2Up:
 		case TRawEvent::EButton3Up:
 		case TRawEvent::EPointerMove:
+		case TRawEvent::EGestureTap:
+		case TRawEvent::EGesturePress:
+		case TRawEvent::EGestureFlickup:
+		case TRawEvent::EGestureFlickDown:
+		case TRawEvent::EGestureFlickLeft:
+		case TRawEvent::EGestureFlickRight:
+		case TRawEvent::EGestureFlick:
+		case TRawEvent::EGestureCustom1:
+		case TRawEvent::EGestureCustom2:
+		case TRawEvent::EGestureCustom3:
+		case TRawEvent::EGestureCustom4:
+		case TRawEvent::EGestureCustom5:
+		case TRawEvent::EGestureCustom6:
+		case TRawEvent::EGestureCustom7:
+		case TRawEvent::EGestureCustom8:
+		case TRawEvent::EGestureCustom9:
 			#if defined(_DEBUG)
 				WS_ASSERT_DEBUG(MousePress(aRawEvent,NULL), EWsPanicEventType);
 			#else
--- a/windowing/windowserver/nonnga/SERVER/POINTER.CPP	Tue May 18 14:02:18 2010 +0100
+++ b/windowing/windowserver/nonnga/SERVER/POINTER.CPP	Mon May 24 14:11:29 2010 +0900
@@ -9,6 +9,7 @@
 // Nokia Corporation - initial contribution.
 //
 // Contributors:
+// Sharp Corporation - contribution of modification for Enhancement of Pointer Event.
 //
 // Description:
 // Pointer functions
@@ -404,11 +405,12 @@
 #endif
 	TRawEvent::TType type=aRawEvent.Type();
 	if (type<TRawEvent::EPointerMove || (type>TRawEvent::EPointerSwitchOn && type<TRawEvent::EButton1Down)
-																						|| type>TRawEvent::EButton3Up)
+			|| (type>TRawEvent::EButton3Up && type<TRawEvent::EGestureTap) || type>TRawEvent::EGestureCustom9)
 		return ETrue;
 	if (!XyInput())
 		return EFalse;
-	TPoint xy=aRawEvent.Pos();
+	TRawEvent_Local* pEventLocal = (TRawEvent_Local*)&aRawEvent ;
+	TPoint xy=pEventLocal->GetPos();
 	if (DeltaMouse())
 		{
 	#if defined(__WINS__)
@@ -451,8 +453,9 @@
 	}
 
 void WsPointer::ProcessEvent(TPointerEvent::TType aType, const TPoint &aPos, TUint aModifiers
-																				,const CWsWindowGroup *aForceInGroup,TBool aNatural)
+																				,const CWsWindowGroup *aForceInGroup,TBool aNatural, const TRawEvent* aEvent)
 	{
+	TRawEvent_Local* pEventLocal = (TRawEvent_Local*)aEvent ;
 	iCurrentPos=aPos;
 	if (aType==TPointerEvent::EMove && !MovesAvailable() && !iPointerDown)
 		return;
@@ -464,6 +467,14 @@
 	pointerEvent.iModifiers=aModifiers;
 	pointerEvent.iPosition=pos;
 	pointerEvent.iParentPosition=parPos;
+	if(aEvent!=NULL){
+		if (aEvent->DeviceNumber() == 1)
+			pointerEvent.iModifiers|=0x80000000;
+		TUint addr = reinterpret_cast<TUint>(&pointerEvent) + sizeof(TPointerEvent);
+		TPoint* extPtr = reinterpret_cast<TPoint *>(addr);
+		extPtr->iX=pEventLocal->GetZ();
+		extPtr->iY=pEventLocal->GetPhi();
+		}
 	switch(aType)
 		{
 		case TPointerEvent::EButton1Down:
--- a/windowing/windowserver/nonnga/SERVER/pointer.h	Tue May 18 14:02:18 2010 +0100
+++ b/windowing/windowserver/nonnga/SERVER/pointer.h	Mon May 24 14:11:29 2010 +0900
@@ -9,6 +9,7 @@
 // Nokia Corporation - initial contribution.
 //
 // Contributors:
+// Sharp Corporation - contribution of modification for Enhancement of Pointer Event.
 //
 // Description:
 // WsPointer and associated classes definitions
@@ -50,7 +51,7 @@
 	static TBool PreProcessEvent(TRawEvent &aRawEvent);
 #endif
 	static void ProcessEvent(TPointerEvent::TType type, const TPoint &aPos, TUint aModifiers
-																				,const CWsWindowGroup *aForceInGroup,TBool aNatural);
+																				,const CWsWindowGroup *aForceInGroup,TBool aNatural, const TRawEvent* aEvent=NULL);
 	static void GetDoubleClickSettings(TTimeIntervalMicroSeconds32 &aTime, TInt &aDistance);
 	static void SetDoubleClick(const TTimeIntervalMicroSeconds32 &aTime, TInt aDistance);
 	static void UpdatePointerCursor();
@@ -162,4 +163,24 @@
 	return (iXyInputType==EXYInputDeltaMouse);
 	}
 
+// internal use only for Enhancement of Pointer Event
+class TRawEvent_Local : public TRawEvent
+	{
+public:
+	inline TPoint GetPos() const
+		{return (TPoint(iU.pos.x,iU.pos.y));}
+	inline TInt GetX() const
+		{return iU.pos3D.x;}
+	inline TInt GetY() const
+		{return iU.pos3D.y;}
+	inline TInt GetZ() const
+		{return iU.pos3D.z;}
+	inline TInt GetPhi() const
+		{return iU.pos3D.phi;}
+	inline TInt GetTheta() const
+		{return iU.pos3D.theta;}
+	inline TInt GetAlpha() const
+		{return iU.pos3D.alpha;}
+	};
+
 #endif