xserver/Xext shape.c,3.19,3.20

Keith Packard xserver-commit at pdx.freedesktop.org
Tue Feb 8 13:51:43 PST 2005


Committed by: keithp

Update of /cvs/xserver/xserver/Xext
In directory gabe:/tmp/cvs-serv14618/Xext

Modified Files:
	shape.c 
Log Message:
2005-02-08  Keith Packard  <keithp at keithp.com>

	* Xext/shape.c: (SendShapeNotify):
	* dix/dispatch.c:
	* dix/events.c: (XYToWindow), (XineramaPointInWindowIsVisible):
	* dix/window.c: (FreeWindowResources):
	* xfixes/region.c: (ProcXFixesSetWindowShapeRegion):
	Add ShapeInput support


Index: shape.c
===================================================================
RCS file: /cvs/xserver/xserver/Xext/shape.c,v
retrieving revision 3.19
retrieving revision 3.20
diff -u -d -r3.19 -r3.20
--- shape.c	2 Nov 2003 19:56:10 -0000	3.19
+++ shape.c	8 Feb 2005 21:51:41 -0000	3.20
@@ -281,7 +281,6 @@
     RegionPtr		srcRgn;
     RegionPtr		*destRgn;
     CreateDftPtr	createDefault;
-    int			destBounding;
 
     REQUEST_AT_LEAST_SIZE (xShapeRectanglesReq);
     UpdateCurrentTime();
@@ -290,13 +289,14 @@
 	return BadWindow;
     switch (stuff->destKind) {
     case ShapeBounding:
-	destBounding = 1;
 	createDefault = CreateBoundingShape;
 	break;
     case ShapeClip:
-	destBounding = 0;
 	createDefault = CreateClipShape;
 	break;
+    case ShapeInput:
+	createDefault = CreateBoundingShape;
+	break;
     default:
 	client->errorValue = stuff->destKind;
 	return BadValue;
@@ -320,10 +320,19 @@
 
     if (!pWin->optional)
 	MakeWindowOptional (pWin);
-    if (destBounding)
+    switch (stuff->destKind) {
+    case ShapeBounding:
 	destRgn = &pWin->optional->boundingShape;
-    else
+	break;
+    case ShapeClip:
 	destRgn = &pWin->optional->clipShape;
+	break;
+    case ShapeInput:
+	destRgn = &pWin->optional->inputShape;
+	break;
+    default:
+	return BadValue;
+    }
 
     return RegionOperate (client, pWin, (int)stuff->destKind,
 			  destRgn, srcRgn, (int)stuff->op,
@@ -371,7 +380,6 @@
     RegionPtr		*destRgn;
     PixmapPtr		pPixmap;
     CreateDftPtr	createDefault;
-    int			destBounding;
 
     REQUEST_SIZE_MATCH (xShapeMaskReq);
     UpdateCurrentTime();
@@ -380,13 +388,14 @@
 	return BadWindow;
     switch (stuff->destKind) {
     case ShapeBounding:
-	destBounding = 1;
 	createDefault = CreateBoundingShape;
 	break;
     case ShapeClip:
-	destBounding = 0;
 	createDefault = CreateClipShape;
 	break;
+    case ShapeInput:
+	createDefault = CreateBoundingShape;
+	break;
     default:
 	client->errorValue = stuff->destKind;
 	return BadValue;
@@ -409,10 +418,19 @@
 
     if (!pWin->optional)
 	MakeWindowOptional (pWin);
-    if (destBounding)
+    switch (stuff->destKind) {
+    case ShapeBounding:
 	destRgn = &pWin->optional->boundingShape;
-    else
+	break;
+    case ShapeClip:
 	destRgn = &pWin->optional->clipShape;
+	break;
+    case ShapeInput:
+	destRgn = &pWin->optional->inputShape;
+	break;
+    default:
+	return BadValue;
+    }
 
     return RegionOperate (client, pWin, (int)stuff->destKind,
 			  destRgn, srcRgn, (int)stuff->op,
@@ -469,7 +487,6 @@
     CreateDftPtr	createDefault;
     CreateDftPtr	createSrc;
     RegionPtr		tmp;
-    int			destBounding;
 
     REQUEST_SIZE_MATCH (xShapeCombineReq);
     UpdateCurrentTime();
@@ -480,13 +497,14 @@
 	MakeWindowOptional (pDestWin);
     switch (stuff->destKind) {
     case ShapeBounding:
-	destBounding = 1;
 	createDefault = CreateBoundingShape;
 	break;
     case ShapeClip:
-	destBounding = 0;
 	createDefault = CreateClipShape;
 	break;
+    case ShapeInput:
+	createDefault = CreateBoundingShape;
+	break;
     default:
 	client->errorValue = stuff->destKind;
 	return BadValue;
@@ -505,6 +523,10 @@
 	srcRgn = wClipShape (pSrcWin);
 	createSrc = CreateClipShape;
 	break;
+    case ShapeInput:
+	srcRgn = wInputShape (pSrcWin);
+	createSrc = CreateBoundingShape;
+	break;
     default:
 	client->errorValue = stuff->srcKind;
 	return BadValue;
@@ -523,10 +545,19 @@
 
     if (!pDestWin->optional)
 	MakeWindowOptional (pDestWin);
-    if (destBounding)
+    switch (stuff->destKind) {
+    case ShapeBounding:
 	destRgn = &pDestWin->optional->boundingShape;
-    else
+	break;
+    case ShapeClip:
 	destRgn = &pDestWin->optional->clipShape;
+	break;
+    case ShapeInput:
+	destRgn = &pDestWin->optional->inputShape;
+	break;
+    default:
+	return BadValue;
+    }
 
     return RegionOperate (client, pDestWin, (int)stuff->destKind,
 			  destRgn, srcRgn, (int)stuff->op,
@@ -588,6 +619,9 @@
     case ShapeClip:
 	srcRgn = wClipShape(pWin);
 	break;
+    case ShapeInput:
+	srcRgn = wInputShape (pWin);
+	break;
     default:
 	client->errorValue = stuff->destKind;
 	return BadValue;
@@ -847,7 +881,8 @@
     pHead = (ShapeEventPtr *) LookupIDByType(pWin->drawable.id, EventType);
     if (!pHead)
 	return;
-    if (which == ShapeBounding) {
+    switch (which) {
+    case ShapeBounding:
 	region = wBoundingShape(pWin);
 	if (region) {
 	    extents = *REGION_EXTENTS(pWin->drawable.pScreen, region);
@@ -859,7 +894,8 @@
 	    extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
 	    shaped = xFalse;
 	}
-    } else {
+	break;
+    case ShapeClip:
 	region = wClipShape(pWin);
 	if (region) {
 	    extents = *REGION_EXTENTS(pWin->drawable.pScreen, region);
@@ -871,6 +907,22 @@
 	    extents.y2 = pWin->drawable.height;
 	    shaped = xFalse;
 	}
+	break;
+    case ShapeInput:
+	region = wInputShape(pWin);
+	if (region) {
+	    extents = *REGION_EXTENTS(pWin->drawable.pScreen, region);
+	    shaped = xTrue;
+	} else {
+	    extents.x1 = -wBorderWidth (pWin);
+	    extents.y1 = -wBorderWidth (pWin);
+	    extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
+	    extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
+	    shaped = xFalse;
+	}
+	break;
+    default:
+	return;
     }
     for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) {
 	client = pShapeEvent->client;
@@ -954,6 +1006,9 @@
     case ShapeClip:
 	region = wClipShape(pWin);
 	break;
+    case ShapeInput:
+	region = wInputShape (pWin);
+	break;
     default:
 	client->errorValue = stuff->kind;
 	return BadValue;
@@ -976,6 +1031,12 @@
 	    rects->width = pWin->drawable.width;
 	    rects->height = pWin->drawable.height;
 	    break;
+	case ShapeInput:
+	    rects->x = - (int) wBorderWidth (pWin);
+	    rects->y = - (int) wBorderWidth (pWin);
+	    rects->width = pWin->drawable.width + wBorderWidth (pWin);
+	    rects->height = pWin->drawable.height + wBorderWidth (pWin);
+	    break;
 	}
     } else {
 	BoxPtr box;



More information about the xserver-commit mailing list