diff -r 414d4b727fd9 -r 89bd4cfee505 windowing/windowserver/nga/CLIENT/RWINDOW.CPP --- a/windowing/windowserver/nga/CLIENT/RWINDOW.CPP Thu Sep 09 10:13:45 2010 +0300 +++ b/windowing/windowserver/nga/CLIENT/RWINDOW.CPP Fri Sep 17 17:00:49 2010 +0300 @@ -1009,7 +1009,7 @@ be sent to that window. Please note that the pointer grab works separately for each pointer present in the system -(for example, separately for each finger touching the multi-touch screen). +(for example, separately for each finger touching the multipointer screen). Pointer grab can be used for drag-and-drop or other situations when you want the events delivered to the same window even though the pen will be dragged @@ -1087,7 +1087,7 @@ // Due to the inclusion of the pointer number, which could be out of range or similar, this ClaimPointerGrab // overload needs to return an error code. // Returning this error code requires a flush of the command buffer (to avoid deadlocking the client/server) - // so this cannot be done for the older non-multitouch API as it would be a compatibility break; + // so this cannot be done for the older non-multipointer API as it would be a compatibility break; grabControlFlags |= TWsWinCmdGrabControl::ESendReply; TWsWinCmdGrabControl params(aPointerNumber, grabControlFlags); return(WriteReply(¶ms,sizeof(params),EWsWinOpClaimPointerGrab)); @@ -1185,6 +1185,32 @@ return(WriteReplyByProvidingRemoteReadAccess(®ionCount,sizeof(regionCount),&ptrRect,EWsWinOpSetShape)); } +/** Sets a region of a window that can receive pointer events. + +Once this region is set, pointer events must be within both this region and the window's base area to be received. +If an empty pointer acceptance region is set, then no pointer events will be received by this window. +Pointer events that fall outside of this region will be processed for any windows underneath. +Prior to calling this API the whole base area of the window can receive pointer events. + +If a window is moved, the pointer acceptance region will move with it. + +If a window is re-sized, the pointer region will NOT change shape/size automatically ( though it +will still be clipped by the window's base area ). +The new size/shape must be set explicitly from the client/application side using this API. + +This function always causes a flush of the window server buffer. + +@param aRegion Region defining the pointer acceptance region shape in window relative coordinates. +@return KErrNone if successful, otherwise one of the system-wide error codes. +*/ +EXPORT_C TInt RWindowBase::SetPointerAcceptanceRegion(const TRegion &aRegion) + { + __ASSERT_DEBUG(!aRegion.CheckError(),Panic(EW32PanicInvalidRegion)); + const TInt regionCount=aRegion.Count(); + TPtrC8 ptrRect(reinterpret_cast(aRegion.RectangleList()),regionCount*sizeof(TRect)); + return(WriteReplyByProvidingRemoteReadAccess(®ionCount,sizeof(regionCount),&ptrRect,EWsWinOpSetPointerAcceptanceRegion)); + } + /** This method has been deprecated. Windows can no longer be associated with a display mode other than the system display mode. This method no longer has any effect and will @@ -1322,7 +1348,7 @@ // Due to the inclusion of the pointer number, which could be out of range or similar, this ClaimPointerGrab // overload needs to return an error code. // Returning this error code requires a flush of the command buffer (to avoid deadlocking the client/server) - // so this cannot be done for the older non-multitouch API as it would be a compatibility break; + // so this cannot be done for the older non-multipointer API as it would be a compatibility break; TWsWinCmdRequestPointerRepeatEvent params(aTime,aRect,aPointerNumber,TWsWinCmdRequestPointerRepeatEvent::ERepeatFlagsSendReply); return WriteReply(¶ms,sizeof(params),EWsWinOpRequestPointerRepeatEvent); } @@ -1345,7 +1371,7 @@ // Due to the inclusion of the pointer number, which could be out of range or similar, this ClaimPointerGrab // overload needs to return an error code. // Returning this error code requires a flush of the command buffer (to avoid deadlocking the client/server) - // so this cannot be done for the older non-multitouch API as it would be a compatibility break; + // so this cannot be done for the older non-multipointer API as it would be a compatibility break; TWsWinCmdCancelPointerRepeatEventRequest params(aPointerNumber, TWsWinCmdCancelPointerRepeatEventRequest::ECancelRepeatFlagsSendReply); errNo = WriteReply(¶ms,sizeof(params),EWsWinOpCancelPointerRepeatEventRequest); } @@ -1410,7 +1436,7 @@ and then delivers the entire buffer when it is full. If there are multiple pointers available in the system (for example there is -a multi-touch screen present), for compatibility reasons only events coming from the +a multipointer screen present), for compatibility reasons only events coming from the single emulated pointer will be stored in a pointer buffer. For more information about emulated pointer please refer to the comment of RWindowBase::EnableAdvancedPointers() method.