#QUALITY by cg expecco_2_11_1
authorClaus Gittinger <cg@exept.de>
Tue, 08 Aug 2017 14:17:28 +0200
changeset 8062 abb27be500c2
parent 8061 55f525acfbbd
child 8063 e335948608ed
#QUALITY by cg class: XWorkstation changed: #primDrawBits:bitsPerPixel:depth:msb:padding:width:height:x:y:into:x:y:width:height:with:
XWorkstation.st
--- a/XWorkstation.st	Tue Aug 08 14:16:30 2017 +0200
+++ b/XWorkstation.st	Tue Aug 08 14:17:28 2017 +0200
@@ -5048,12 +5048,12 @@
 !
 
 primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth msb:msb padding:bitPadding
-			      width:imageWidth height:imageHeight
-				  x:srcx y:srcy
-			       into:aDrawableId
-				  x:dstx y:dsty
-			      width:w height:h
-			       with:aGCId
+                              width:imageWidth height:imageHeight
+                                  x:srcx y:srcy
+                               into:aDrawableId
+                                  x:dstx y:dsty
+                              width:w height:h
+                               with:aGCId
 
     <context: #return>
 
@@ -5081,82 +5081,84 @@
      && __bothSmallInteger(imageDepth, bitsPerPixel)
      && __isSmallInteger(bitPadding)
      && __isByteArrayLike(imageBits)) {
-	Display *dpy = myDpy;
-	int pad = __intVal(bitPadding);
-
-	gc = __GCVal(aGCId);
-	win = __WindowVal(aDrawableId);
-	if (! gc || !win)
-	    goto fail;
+        Display *dpy = myDpy;
+        int pad = __intVal(bitPadding);
+
+        gc = __GCVal(aGCId);
+        win = __WindowVal(aDrawableId);
+        if (! gc || !win)
+            goto fail;
 #ifdef ARGDEBUG
-	console_printf("args ok\n");
-#endif
-	image.data = (char *)__ByteArrayInstPtr(imageBits)->ba_element;
-	image.width = imgWdth = __intVal(imageWidth);
-	image.height = __intVal(imageHeight);
-	image.xoffset = 0;
-	image.format = ZPixmap;
-	image.byte_order = (msb == true) ? MSBFirst : LSBFirst;
-	image.bitmap_unit = 8;
-	image.bitmap_bit_order = MSBFirst;
-	image.bitmap_pad = pad;
-	image.depth = __intVal(imageDepth);
-	image.bits_per_pixel = __intVal(bitsPerPixel);
-
-	/*
-	image.bytes_per_line = ((((imgWdth * image.depth) + (pad-1)) / pad) * pad) / 8;
-	*/
-	image.bytes_per_line = ((((imgWdth * image.bits_per_pixel) + (pad-1)) / pad) * pad) / 8;
-
-	switch (image.bits_per_pixel) {
-	    case 1:
-	    case 2:
-	    case 4:
-	    case 8:
-	    case 16:
-	    case 24:
-	    case 32:
-		break;
-
-	    default:
+        console_printf("args ok\n");
+#endif
+        image.data = (char *)__ByteArrayInstPtr(imageBits)->ba_element;
+        image.width = imgWdth = __intVal(imageWidth);
+        image.height = __intVal(imageHeight);
+        image.xoffset = 0;
+        image.format = ZPixmap;
+        image.byte_order = (msb == true) ? MSBFirst : LSBFirst;
+        image.bitmap_unit = 8;
+        image.bitmap_bit_order = MSBFirst;
+        image.bitmap_pad = pad;
+        image.depth = __intVal(imageDepth);
+        image.bits_per_pixel = __intVal(bitsPerPixel);
+
+        /*
+        image.bytes_per_line = ((((imgWdth * image.depth) + (pad-1)) / pad) * pad) / 8;
+        */
+        image.bytes_per_line = ((((imgWdth * image.bits_per_pixel) + (pad-1)) / pad) * pad) / 8;
+
+        switch (image.bits_per_pixel) {
+            case 1:
+            case 2:
+            case 4:
+            case 8:
+            case 16:
+            case 24:
+            case 32:
+                break;
+
+            default:
 #ifdef ARGDEBUG
-		console_printf("bits_per_pixel=%d\n",image.bits_per_pixel);
-#endif
-		goto fail;
-	}
-
-	image.red_mask = 0xFFFF;
-	image.green_mask = 0xFFFF;
-	image.blue_mask = 0xFFFF;
-
-	/* ENTER_XLIB(); */
-	XPutImage(dpy, win, gc, &image, __intVal(srcx), __intVal(srcy),
-					__intVal(dstx), __intVal(dsty),
-					__intVal(w), __intVal(h));
-	/* LEAVE_XLIB(); */
-
-	RETURN ( true );
+                console_printf("bits_per_pixel=%d\n",image.bits_per_pixel);
+#endif
+                goto fail;
+        }
+
+        image.red_mask = 0xFFFF;
+        image.green_mask = 0xFFFF;
+        image.blue_mask = 0xFFFF;
+
+        /* ENTER_XLIB(); */
+        XPutImage(dpy, win, gc, &image, __intVal(srcx), __intVal(srcy),
+                                        __intVal(dstx), __intVal(dsty),
+                                        __intVal(w), __intVal(h));
+        /* LEAVE_XLIB(); */
+
+        RETURN ( true );
     }
 #ifdef ARGDEBUG
-    if (!! __isExternalAddress(aGCId)) console_printf("GC\n");
-    if (!! __isExternalAddress(aDrawableId)) console_printf("aDrawableId\n");
-    if (!! __isSmallInteger(srcx)) console_printf("srcx\n");
-    if (!! __isSmallInteger(srcy)) console_printf("srcy\n");
-    if (!! __isSmallInteger(dstx)) console_printf("dstx\n");
-    if (!! __isSmallInteger(dsty)) console_printf("dsty\n");
-    if (!! __isSmallInteger(w)) console_printf("w\n");
-    if (!! __isSmallInteger(h)) console_printf("h\n");
-    if (!! __isSmallInteger(imageWidth)) console_printf("imageWidth\n");
-    if (!! __isSmallInteger(imageHeight)) console_printf("imageHeight\n");
-    if (!! __isSmallInteger(imageDepth)) console_printf("imageDepth\n");
-    if (!! __isSmallInteger(bitsPerPixel)) console_printf("bitsPerPixel\n");
-    if (!! __isByteArrayLike(imageBits)) console_printf("imageBits\n");
+    if (! __isExternalAddress(aGCId)) console_printf("GC\n");
+    if (! __isExternalAddress(aDrawableId)) console_printf("aDrawableId\n");
+    if (! __isSmallInteger(srcx)) console_printf("srcx\n");
+    if (! __isSmallInteger(srcy)) console_printf("srcy\n");
+    if (! __isSmallInteger(dstx)) console_printf("dstx\n");
+    if (! __isSmallInteger(dsty)) console_printf("dsty\n");
+    if (! __isSmallInteger(w)) console_printf("w\n");
+    if (! __isSmallInteger(h)) console_printf("h\n");
+    if (! __isSmallInteger(imageWidth)) console_printf("imageWidth\n");
+    if (! __isSmallInteger(imageHeight)) console_printf("imageHeight\n");
+    if (! __isSmallInteger(imageDepth)) console_printf("imageDepth\n");
+    if (! __isSmallInteger(bitsPerPixel)) console_printf("bitsPerPixel\n");
+    if (! __isByteArrayLike(imageBits)) console_printf("imageBits\n");
 #endif
 
 fail: ;
 %}
 .
     ^ false
+
+    "Modified: / 08-08-2017 / 14:16:52 / cg"
 ! !
 
 !XWorkstation methodsFor:'event forwarding'!