WinWorkstation.st
changeset 2264 817f27555776
parent 2260 954c7dce96aa
child 2270 b58aa9d04cfe
--- a/WinWorkstation.st	Mon Aug 24 13:20:22 1998 +0200
+++ b/WinWorkstation.st	Mon Aug 24 14:21:19 1998 +0200
@@ -653,7 +653,7 @@
 	return 0;
     }
     memset(gcData,0,sizeof(struct gcData));
-    gcData->bgColor = 0xffffff;
+    gcData->fgColor = 0xffffff;
     gcData->clipping = FALSE;
     gcData->clipByChild = TRUE;
     gcData->bitbltrop2 = BITBLT_COPY;
@@ -4922,7 +4922,7 @@
 
 %{  /* xxLIMITEDSTACK (WIN95 only) */
 
-    struct gcData *gcData = 0;
+    struct gcData *dstGcData = 0;
     struct gcData *srcGcData = 0;
     HDC srcDC = (HDC)0;
     HDC dstDC = (HDC)0;
@@ -4936,7 +4936,7 @@
 	goto fail;
     }
     if (__isExternalAddress(dstGCId)) {
-	gcData = _GCDATA(dstGCId);
+	dstGcData = _GCDATA(dstGCId);
     }
     else
     {
@@ -4948,9 +4948,9 @@
      && __bothSmallInteger(dstX, dstY))
     {
 	int fun = BITBLT_COPY;
-	if (srcGcData && gcData)
+	if (srcGcData && dstGcData)
 	{
-	  fun = gcData->bitbltrop2;
+	  fun = dstGcData->bitbltrop2;
 #if 0
 	  switch (fun)
 	  {
@@ -4971,7 +4971,7 @@
 	      break;
 	  }
 #endif
-	  if (srcGcData->hWnd && ((srcGcData->hWnd == gcData->hWnd) && (fun == BITBLT_COPY)))
+	  if (srcGcData->hWnd && ((srcGcData->hWnd == dstGcData->hWnd) && (fun == BITBLT_COPY)))
 	  {
 	    RECT rec,uprec;
 	    rec.left = __intVal(srcX);
@@ -4990,8 +4990,8 @@
 	  {
 	      /*printf("src is HWND %x\n",srcGcData->hWnd);*/
 	  }
-	  fun = gcData->bitbltrop2;
-	  if ((srcGcData == gcData) && (fun == BITBLT_COPY))
+	  fun = dstGcData->bitbltrop2;
+	  if ((srcGcData == dstGcData) && (fun == BITBLT_COPY))
 	  {
 	    RECT rec,uprec;
 	    rec.left = __intVal(srcX);
@@ -5008,7 +5008,9 @@
 	  else
 	  {
 	    srcDC = _getDC(srcGcData);
-	    dstDC = _getDC(gcData);
+	    dstDC = _getDC(dstGcData);
+            DDPRINTF(("bitblt src f:%x b:%x",GetTextColor(srcDC),GetBkColor(srcDC)));
+            DDPRINTF(("dst f:%x b:%x\n",GetTextColor(dstDC),GetBkColor(dstDC)));
 	    if (BitBlt(dstDC,
 		 __intVal(dstX), __intVal(dstY),
 		 __intVal(w), __intVal(h),
@@ -5021,7 +5023,7 @@
 		 printf("ERROR in BitBlt\n");
 	      }
 	  }
-	  _releaseDC(gcData);
+	  _releaseDC(dstGcData);
 	  _releaseDC(srcGcData);
 	  RETURN ( self );
 	}
@@ -5029,6 +5031,7 @@
 
  fail: ;
 %}.
+ self primitiveFailed.
  ^ nil
 
 !
@@ -7852,7 +7855,7 @@
 	struct gcData *gcData = _GCDATA(aGCId);
 	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
 	gcData->bgColor = (COLORREF)st2RGB(__intVal(bgColorIndex),gcData);
-	DPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
+	DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
 	RETURN (self);
     }
 %}
@@ -7873,7 +7876,7 @@
 	  gcData->hMask = _HBITMAPVAL(aBitmapId);
 	else
 	  gcData->hMask = 0;
-	DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
+	DDPRINTF(("setForeground: %x background: %x mask: %x\n", gcData->fgColor, gcData->bgColor,gcData->hMask));
 	RETURN (self);
     }
 %}
@@ -7895,7 +7898,7 @@
 	  gcData->hMask = _HBITMAPVAL(aBitmapId);
 	else
 	  gcData->hMask = 0;
-	DDPRINTF(("setForeground: %x background: %x\n", gcData->fgColor, gcData->bgColor));
+	DDPRINTF(("setForeground: %x background: %x mask: %x linewidth: %d\n", gcData->fgColor, gcData->bgColor,gcData->hMask,gcData->lineWidth));
 	RETURN (self);
     }
 %}
@@ -7912,7 +7915,7 @@
     {
 	struct gcData *gcData = _GCDATA(aGCId);
 	gcData->fgColor = (COLORREF)st2RGB(__intVal(fgColorIndex),gcData);
-	DDPRINTF(("setForeground: %x\n", fgColor));
+	DDPRINTF(("setForeground: %x\n", gcData->fgColor));
 	RETURN (self);
     }
 %}
@@ -9744,6 +9747,6 @@
 !WinWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.45 1998-08-21 17:48:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.46 1998-08-24 12:21:19 cg Exp $'
 ! !
 WinWorkstation initialize!