windowing/windowserver/nga/CLIENT/RWINDOW.CPP
changeset 194 18f84489a694
parent 152 9f1c3fea0f87
--- a/windowing/windowserver/nga/CLIENT/RWINDOW.CPP	Fri Sep 17 08:36:49 2010 +0300
+++ b/windowing/windowserver/nga/CLIENT/RWINDOW.CPP	Mon Oct 04 02:31:51 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(&params,sizeof(params),EWsWinOpClaimPointerGrab));	
@@ -1185,6 +1185,32 @@
 	return(WriteReplyByProvidingRemoteReadAccess(&regionCount,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<const TUint8*>(aRegion.RectangleList()),regionCount*sizeof(TRect));
+    return(WriteReplyByProvidingRemoteReadAccess(&regionCount,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(&params,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(&params,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.