windowing/windowserver/nonnga/SERVER/POINTER.CPP
branchsharp_contrib_0
changeset 80 823021ef148e
parent 36 01a6848ebfd7
equal deleted inserted replaced
71:9e048f93dc24 80:823021ef148e
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
       
    12 // Sharp Corporation - contribution of modification for Enhancement of Pointer Event.
    12 //
    13 //
    13 // Description:
    14 // Description:
    14 // Pointer functions
    15 // Pointer functions
    15 // 
    16 // 
    16 //
    17 //
   402 	WS_ASSERT_DEBUG(TRawEvent::EPointerSwitchOn+8==TRawEvent::EButton1Down, EWsPanicRawEventsTypeChanged);
   403 	WS_ASSERT_DEBUG(TRawEvent::EPointerSwitchOn+8==TRawEvent::EButton1Down, EWsPanicRawEventsTypeChanged);
   403 	WS_ASSERT_DEBUG(TRawEvent::EButton1Down+5==TRawEvent::EButton3Up, EWsPanicRawEventsTypeChanged);
   404 	WS_ASSERT_DEBUG(TRawEvent::EButton1Down+5==TRawEvent::EButton3Up, EWsPanicRawEventsTypeChanged);
   404 #endif
   405 #endif
   405 	TRawEvent::TType type=aRawEvent.Type();
   406 	TRawEvent::TType type=aRawEvent.Type();
   406 	if (type<TRawEvent::EPointerMove || (type>TRawEvent::EPointerSwitchOn && type<TRawEvent::EButton1Down)
   407 	if (type<TRawEvent::EPointerMove || (type>TRawEvent::EPointerSwitchOn && type<TRawEvent::EButton1Down)
   407 																						|| type>TRawEvent::EButton3Up)
   408 			|| (type>TRawEvent::EButton3Up && type<TRawEvent::EGestureTap) || type>TRawEvent::EGestureCustom9)
   408 		return ETrue;
   409 		return ETrue;
   409 	if (!XyInput())
   410 	if (!XyInput())
   410 		return EFalse;
   411 		return EFalse;
   411 	TPoint xy=aRawEvent.Pos();
   412 	TRawEvent_Local* pEventLocal = (TRawEvent_Local*)&aRawEvent ;
       
   413 	TPoint xy=pEventLocal->GetPos();
   412 	if (DeltaMouse())
   414 	if (DeltaMouse())
   413 		{
   415 		{
   414 	#if defined(__WINS__)
   416 	#if defined(__WINS__)
   415 		if (aFromHardware)
   417 		if (aFromHardware)
   416 			return EFalse;
   418 			return EFalse;
   449 	aRawEvent.Set(type,xy.iX,xy.iY);
   451 	aRawEvent.Set(type,xy.iX,xy.iY);
   450 	return ETrue;
   452 	return ETrue;
   451 	}
   453 	}
   452 
   454 
   453 void WsPointer::ProcessEvent(TPointerEvent::TType aType, const TPoint &aPos, TUint aModifiers
   455 void WsPointer::ProcessEvent(TPointerEvent::TType aType, const TPoint &aPos, TUint aModifiers
   454 																				,const CWsWindowGroup *aForceInGroup,TBool aNatural)
   456 																				,const CWsWindowGroup *aForceInGroup,TBool aNatural, const TRawEvent* aEvent)
   455 	{
   457 	{
       
   458 	TRawEvent_Local* pEventLocal = (TRawEvent_Local*)aEvent ;
   456 	iCurrentPos=aPos;
   459 	iCurrentPos=aPos;
   457 	if (aType==TPointerEvent::EMove && !MovesAvailable() && !iPointerDown)
   460 	if (aType==TPointerEvent::EMove && !MovesAvailable() && !iPointerDown)
   458 		return;
   461 		return;
   459 	TPoint pos(iCurrentPos);	// We need a non-const TPoint for 'ReLogCurrentWindow'
   462 	TPoint pos(iCurrentPos);	// We need a non-const TPoint for 'ReLogCurrentWindow'
   460 	TPoint parPos;
   463 	TPoint parPos;
   462 	TWsEvent event;
   465 	TWsEvent event;
   463 	TPointerEvent& pointerEvent=*event.Pointer();
   466 	TPointerEvent& pointerEvent=*event.Pointer();
   464 	pointerEvent.iModifiers=aModifiers;
   467 	pointerEvent.iModifiers=aModifiers;
   465 	pointerEvent.iPosition=pos;
   468 	pointerEvent.iPosition=pos;
   466 	pointerEvent.iParentPosition=parPos;
   469 	pointerEvent.iParentPosition=parPos;
       
   470 	if(aEvent!=NULL){
       
   471 		if (aEvent->DeviceNumber() == 1)
       
   472 			pointerEvent.iModifiers|=0x80000000;
       
   473 		TUint addr = reinterpret_cast<TUint>(&pointerEvent) + sizeof(TPointerEvent);
       
   474 		TPoint* extPtr = reinterpret_cast<TPoint *>(addr);
       
   475 		extPtr->iX=pEventLocal->GetZ();
       
   476 		extPtr->iY=pEventLocal->GetPhi();
       
   477 		}
   467 	switch(aType)
   478 	switch(aType)
   468 		{
   479 		{
   469 		case TPointerEvent::EButton1Down:
   480 		case TPointerEvent::EButton1Down:
   470 			iPointerDown=ETrue;
   481 			iPointerDown=ETrue;
   471 			if (iGrabWindow==NULL && iCurrentWindow->HasPointerGrab())
   482 			if (iGrabWindow==NULL && iCurrentWindow->HasPointerGrab())