--- a/windowing/windowserver/nga/SERVER/POINTER.CPP Tue Jul 06 15:45:57 2010 +0300
+++ b/windowing/windowserver/nga/SERVER/POINTER.CPP Wed Aug 18 11:05:09 2010 +0300
@@ -30,6 +30,7 @@
#include <hal.h>
#include "advancedpointereventhelper.h"
#include "graphics/pointereventdata.h"
+#include "debughelper.h"
TTimeIntervalMicroSeconds32 TWsPointer::iDoubleClickMaxInterval;
TInt TWsPointer::iDoubleClickMaxDistance;
@@ -110,6 +111,11 @@
}
}
+ //** Log the number of pointers here i,e iMaxPointers
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: Number of pointers system supports %d", iMaxPointers);
+#endif
+
// Does device support Z coordinate of the pointers?
if(HAL::Get(HALData::EPointer3D,iIs3DPointer)!=KErrNone)
{
@@ -117,6 +123,10 @@
}
WS_ASSERT_ALWAYS(!iIs3DPointer || XyInput(), EWsPanicPointer3DInconsistent);
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: Z coordinate supported %d", iIs3DPointer);
+#endif
+
// Initialize thresholds for EEnterCloseProximity, EExitCloseProximity,
// EEnterHighPressure and EExitHightPressure events.
if(HAL::Get(HALData::EPointer3DEnterCloseProximityThreshold,
@@ -485,6 +495,9 @@
{
CEventQueue* queue=aWindow->EventQueue();
aEvent.SetHandle(aWindow->ClientHandle());
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: TWsPointer::QueuePointerEvent with AdvancedPointerEnabled");
+#endif
if (aEvent.Handle()!=0)
{
if(!aWindow->AdvancedPointersEnabled())
@@ -508,12 +521,18 @@
case TPointerEvent::EExitHighPressure:
if (CheckMatchingEventPurged(aEvent.Pointer()->iType))
{
+ #ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: Check matching event has been purged so no addition of event 01");
+ #endif
return ETrue;
}
if (queue->CheckRoom())
{
if (CheckMatchingEventPurged(aEvent.Pointer()->iType))
{
+ #ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: Check matching event has been purged so no addition of event 02");
+ #endif
return ETrue;
}
}
@@ -527,6 +546,9 @@
break;
default:;
}
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: TWsPointer::QueuePointerEvent After adding event to clientqueue Event State %d ", iState);
+#endif
queue->QueueEvent(aEvent,priority);
}
}
@@ -657,6 +679,12 @@
return EFalse;
}
+ //** Log the type, pointer number, and its coordinates
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: Pointer number = %d RawEvent Type = %d Coordinates [%d, %d]",
+ aRawEvent.PointerNumber(), type, aRawEvent.Pos().iX, aRawEvent.Pos().iY);
+#endif
+
// check correctness of aRawEvent.PointerNumber()
if (iMaxPointers > 1)
{
@@ -710,6 +738,11 @@
aRawEvent.Set(type, xy.iX, xy.iY,
iIs3DPointer ? aRawEvent.Pos3D().iZ : 0);
}
+
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: Coordinates after Rotation and shift [%d, %d]",
+ aRawEvent.Pos().iX, aRawEvent.Pos().iY);
+#endif
return ETrue;
}
@@ -856,6 +889,11 @@
ReLogCurrentWindow(pointerEvent.iPosition,parPos,aForceInGroup);
pointerEvent.iParentPosition=parPos;
+
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: TWsPointer::ProcessEvent Event to be sent to this window %U", reinterpret_cast<TUint32>(iCurrentWindow));
+ RDebug::Print(_L("_WSEVENT_POINTER: TWsPointer::ProcessEvent EventName %S and Event State %d "), &WsEventName(aEvent), iState);
+#endif
// update state
switch(eventType)
{
@@ -1007,6 +1045,10 @@
{
if (iState != EPointerStateOutOfRange)
{
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: TWsPointer::ProcessOutOfRangeEvent Pointer Number = %d, iState =%d ", iNumber, iState);
+#endif
+
// OutOfRange event generated by driver doesn't contain correct coordinates,
// we update them from last state in order to deliver event to the proper window.
SendEnterExitEvent(EEventPointerExit);
@@ -1078,11 +1120,17 @@
}
else if (!WsKeyboardEmulator::PointerEvent(type,pos,iCurrentWindow->PointerKeyList()))
{
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: Calling ProcessPointerEvent for primary pointer");
+#endif
ProcessPointerEvent(aEvent);
}
}
else if (!iCurrentWindow->UsingPointerBuffer() || (type != TPointerEvent::EMove && type != TPointerEvent::EDrag))
{
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: Calling ProcessPointerEvent for non primary pointer");
+#endif
ProcessPointerEvent(aEvent);
}
}
@@ -1394,7 +1442,15 @@
TRawEvent::TType type=aRawEvent.Type();
TInt pointerNumber = aRawEvent.PointerNumber();
-
+
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: TWsPointer::UpdatePrimaryPointer Current Primary pointer = %d",iPrimaryPointer);
+ for(TInt i=0; i< iMaxPointers; i++)
+ {
+ RDebug::Printf("_WSEVENT_POINTER: TWsPointer::UpdatePrimaryPointer Pointer Number= %d State = %x XY(%d,%d)",iPointers[i].iNumber,iPointers[i].iState,iPointers[i].iPos.iX,iPointers[i].iPos.iY);
+ }
+#endif
+
// If primary pointer is out of range, then the first pointer that will
// start being detected (come back in range) will become primary.
if (iPointers[iPrimaryPointer].iState == EPointerStateOutOfRange)
@@ -1402,6 +1458,9 @@
if (type != TRawEvent::EPointer3DOutOfRange && iPointers[pointerNumber].iState == EPointerStateOutOfRange)
{
iPrimaryPointer = pointerNumber;
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: TWsPointer::UpdatePrimaryPointer New Primary pointer(OutRange) = %d",iPrimaryPointer);
+#endif
}
return;
}
@@ -1412,6 +1471,9 @@
iPointers[iPrimaryPointer].iState != EPointerStateDown)
{
iPrimaryPointer = pointerNumber;
+#ifdef LOG_WSERV_EVENTS
+ RDebug::Printf("_WSEVENT_POINTER: TWsPointer::UpdatePrimaryPointer New Primary pointer(ButtonDown) = %d",iPrimaryPointer);
+#endif
return;
}
}