nanogui: GrReadArea for pixmaps


Previous by date: 3 Oct 2000 22:54:15 -0000 GrReadArea for pixmaps, peter.igelaus.com.au
Next by date: 3 Oct 2000 22:54:15 -0000 Re: GrReadArea for pixmaps, Greg Haerr
Previous in thread: 3 Oct 2000 22:54:15 -0000 GrReadArea for pixmaps, peter.igelaus.com.au
Next in thread: 3 Oct 2000 22:54:15 -0000 Re: GrReadArea for pixmaps, Greg Haerr

Subject: Re: GrReadArea for pixmaps
From: ####@####.####
Date: 3 Oct 2000 22:54:15 -0000
Message-Id: <Pine.LNX.4.10.10010040944550.1376-200000@helios.devel.igelaus.com.au>

Opps, I forgot one bracket... :)


--- srvfunc.nopixmap	Wed Oct  4 09:38:47 2000
+++ srvfunc.c	Wed Oct  4 09:44:04 2000
@@ -1863,21 +1863,35 @@
 	GR_PIXELVAL *pixels)
 {
 	GR_WINDOW	*wp;
+	GR_PIXMAP	*pp;
 
-	wp = GsFindWindow(id);			/* FIXME- should check pixmap */
-	if ((wp == NULL) || wp->unmapcount || (x >= wp->width) ||
-	    (y >= wp->height) || (x + width <= 0) || (y + height <= 0)) {
-		/* long		count;
-		 * GR_PIXELVAL	black;
-		 *
-		 * black = GdFindColor(BLACK);
-		 * count = width * height;
-		 * while (count-- > 0)
-		 *	*pixels++ = black;
-		 */
+	wp = GsFindWindow(id);
+	pp = GsFindPixmap(id);
+	if ((wp == NULL) && (pp == NULL))
 		return;
+
+	if (wp != NULL) {
+		if (wp->unmapcount || (x >= wp->width) || (y >= wp->height) ||
+		   (x + width <= 0) || (y + height <= 0)) {
+			/* long		count;
+			* GR_PIXELVAL	black;
+			*
+			* black = GdFindColor(BLACK);
+			* count = width * height;
+			* while (count-- > 0)
+			*	*pixels++ = black;
+			*/
+			return;
+		}
+		GdReadArea(wp->psd, wp->x, wp->y, width, height, pixels);
+	}
+	if (pp != NULL) {
+		if ((x >= pp->width) || (y >= pp->height) ||
+		    (x + width <= 0) || (y + height <= 0)) {
+			return;
+		}
+		GdReadArea(pp->psd, x, y, width, height, pixels);
 	}
-	GdReadArea(wp->psd, wp->x, wp->y, width, height, pixels);
 }
 
 /*

Previous by date: 3 Oct 2000 22:54:15 -0000 GrReadArea for pixmaps, peter.igelaus.com.au
Next by date: 3 Oct 2000 22:54:15 -0000 Re: GrReadArea for pixmaps, Greg Haerr
Previous in thread: 3 Oct 2000 22:54:15 -0000 GrReadArea for pixmaps, peter.igelaus.com.au
Next in thread: 3 Oct 2000 22:54:15 -0000 Re: GrReadArea for pixmaps, Greg Haerr


Powered by ezmlm-browse 0.20.