WinWorkstation.st
changeset 4161 976a1b3ce175
parent 4155 b557b9991c9c
child 4181 91439783248a
--- a/WinWorkstation.st	Thu Apr 15 16:05:45 2004 +0200
+++ b/WinWorkstation.st	Mon Apr 19 13:31:37 2004 +0200
@@ -1589,14 +1589,14 @@
 
 #ifndef PRE_07_APR_04
 
-            hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK), lw, gcData->fgColor);
-
-            RESPRINTF(("CreatePen %x %d(%d) %x %x\n",
+	    hPen = CreatePen((gcData->lStyle & PS_STYLE_MASK), lw, gcData->fgColor);
+
+	    RESPRINTF(("CreatePen %x %d(%d) %x %x\n",
 			gcData->lStyle,
 			lw, gcData->lineWidth,
 			gcData->fgColor, gcData->hMask));
 
-            SetBkMode(hDC, TRANSPARENT);
+	    SetBkMode(hDC, TRANSPARENT);
 	    gcData->bkMode = BK_TRANSPARENT;
 
 #else
@@ -1606,21 +1606,21 @@
 #endif
 	}
 
-        if (! hPen)
-        {
+	if (! hPen)
+	{
 	    hPen = ExtCreatePen(PS_GEOMETRIC | gcData->lStyle,
 			    lw, /* gcData->lineWidth, */
 			    &Brush,
 			    0, 0);
 
-            RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
+	    RESPRINTF(("ExtCreatePen1 %x %d(%d) %x %x\n",
 			gcData->lStyle,
 			lw, gcData->lineWidth,
 			gcData->fgColor, gcData->hMask));
 
 	    if (gcData->hMask) {
-	        SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
-            }
+		SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);
+	    }
 	}
     } else {
 	/*
@@ -1761,12 +1761,12 @@
 #endif
 
     if (dwWaitResult == WAIT_OBJECT_0)
-        return (TRUE);
+	return (TRUE);
 
     if (dwWaitResult == WAIT_TIMEOUT)
-        fprintf(stderr, "WinWorkstation [info]: lockEventF timeout\n");
+	fprintf(stderr, "WinWorkstation [info]: lockEventF timeout\n");
     else
-        fprintf(stderr, "WinWorkstation [info]: lockEventF abandoned\n");
+	fprintf(stderr, "WinWorkstation [info]: lockEventF abandoned\n");
 
     return (FALSE);
 }
@@ -1827,12 +1827,12 @@
     */
     while (! eventFreeList)
     {
-        if (repeatCount++ >= 5) {
+	if (repeatCount++ >= 5) {
 	    /* throw away sorry */
 	    fprintf(stderr, "WinWorkstation [info]: event throw away\n");
 	    return;
 	}
-        fprintf(stderr, "WinWorkstation [info]: wait for event memory (%d)\n", repeatCount);
+	fprintf(stderr, "WinWorkstation [info]: wait for event memory (%d)\n", repeatCount);
 	WaitForSingleObject( hNeverTriggered, 100L );
     }
     lockEvents();
@@ -1840,9 +1840,9 @@
     ev = eventFreeList;
 
     if (! ev) {
-        fprintf(stderr, "WinWorkstation [error]: event throw away\n");
-        unlockEvents();
-        return;
+	fprintf(stderr, "WinWorkstation [error]: event throw away\n");
+	unlockEvents();
+	return;
     }
     eventFreeList  = ev->ev_next;
     ev->ev_flag    = flag;
@@ -1891,28 +1891,28 @@
   again:
 
     if (! eventQueueHead)
-        return (0);
+	return (0);
 
     if (! lockEvents())
-        return (0);
+	return (0);
 
     TH_DPRINTF(("TDEQ\n"));
     ev = eventQueueHead;
 
     if (! ev) {
-        unlockEvents();
-        return (0);
+	unlockEvents();
+	return (0);
     }
     eventQueueHead = ev->ev_next;
 
     if (! eventQueueHead) {
-        eventQueueTail = (struct queuedEvent *) 0;
+	eventQueueTail = (struct queuedEvent *) 0;
     }
 
     if (ev->count != -1) {
-        static int anyGoodEventReceived = 1;
-
-        if (eventempfcount != ev->count) {
+	static int anyGoodEventReceived = 1;
+
+	if (eventempfcount != ev->count) {
 	    if (anyGoodEventReceived) {
 		fprintf(stderr, "WinWorkstation [warning]: lost event (eventcount error %d <-> %d)\n",
 				 eventempfcount, ev->count);
@@ -1932,7 +1932,7 @@
 	 * it must be freed by the stx-process ('cause it was malloc'd by it)
 	 */
 	if (ev->ev_arg2) {
-            freeArg2 = (char *) ev->ev_arg2;
+	    freeArg2 = (char *) ev->ev_arg2;
 	    ev->ev_arg2 = 0;
 	}
 
@@ -1946,7 +1946,7 @@
 
 	    } else {
 		/* noch einmal in die queue
-                */
+		*/
 		if (ev->ev_arg2++ < 100) {
 		    ev->ev_next = (struct queuedEvent *)0;
 		    ev->count   = eventsendcount++;
@@ -1959,10 +1959,10 @@
 		    eventQueueTail = ev;
 		    unlockEvents();
 
-                    if (freeArg2) {
-                        free (freeArg2);
-                        freeArg2 = NULL;
-                    }
+		    if (freeArg2) {
+			free (freeArg2);
+			freeArg2 = NULL;
+		    }
 
 		    if (ev->ev_arg2 > 98) {
 			fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed. Wait 1 sec.\n",(char*)ev->ev_arg1);
@@ -1973,11 +1973,11 @@
 		    goto again;
 		}
 		/* fail evtl. später ändern und in st verzögert aufrufen
-                */
+		*/
 		fprintf(stderr, "WinWorkstation [info]: UnregisterClass %s failed.\n",(char*)ev->ev_arg1);
 	    }
-            free((char*)ev->ev_arg1);
-            ev->ev_arg1 = 0;
+	    free((char*)ev->ev_arg1);
+	    ev->ev_arg1 = 0;
 	}
 #endif
     }
@@ -1989,7 +1989,7 @@
     unlockEvents();
 
     if (freeArg2) {
-        free (freeArg2);
+	free (freeArg2);
     }
     return (1);
 }
@@ -2676,12 +2676,12 @@
 	case WM_GETMINMAXINFO:
 
 #ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
-            if (inMove) {
-                *pDefault = 0;
-                return 0;
-            }
-#endif
-            
+	    if (inMove) {
+		*pDefault = 0;
+		return 0;
+	    }
+#endif
+
 	    {
 		int minW, maxW;
 		localWindowInfo *lI;
@@ -2737,10 +2737,10 @@
 	case WM_WINDOWPOSCHANGED:
 
 #ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
-            if (inMove) {
-                *pDefault = 0;
-                return 0;
-            }
+	    if (inMove) {
+		*pDefault = 0;
+		return 0;
+	    }
 #endif
 	    if (hWnd == __rootWinSpezial) {
 		/* can this happen ? */
@@ -2826,54 +2826,54 @@
 		w = rct.right - rct.left;
 		h = rct.bottom - rct.top;
 
-                if (__debug__) {
+		if (__debug__) {
 		    EVENT_PRINTF(("WM_WINDOWPOSCHANGED ["));
 
 		    if (wp->flags & SWP_NOSIZE) {
-		        EVENT_PRINTF(("NOSIZE "));
+			EVENT_PRINTF(("NOSIZE "));
 		    }
 		    if (wp->flags & SWP_NOMOVE) {
-		        EVENT_PRINTF(("NOMOVE "));
+			EVENT_PRINTF(("NOMOVE "));
 		    }
 		    if (wp->flags & SWP_NOZORDER) {
-		        EVENT_PRINTF(("NOZORDER "));
+			EVENT_PRINTF(("NOZORDER "));
 		    }
 		    if (wp->flags & SWP_NOREDRAW) {
-		        EVENT_PRINTF(("NOREDRAW "));
+			EVENT_PRINTF(("NOREDRAW "));
 		    }
 		    if (wp->flags & SWP_NOACTIVATE) {
-		        EVENT_PRINTF(("NOACTIVATE "));
+			EVENT_PRINTF(("NOACTIVATE "));
 		    }
 		    if (wp->flags & SWP_FRAMECHANGED) {
-		        EVENT_PRINTF(("FRAMECHANGED "));
+			EVENT_PRINTF(("FRAMECHANGED "));
 		    }
 		    if (wp->flags & SWP_NOCOPYBITS) {
-		        EVENT_PRINTF(("NOCOPYBITS "));
+			EVENT_PRINTF(("NOCOPYBITS "));
 		    }
 		    if (wp->flags & SWP_NOOWNERZORDER) {
-		        EVENT_PRINTF(("NOOWNERZORDER "));
+			EVENT_PRINTF(("NOOWNERZORDER "));
 		    }
 		    if (wp->flags & SWP_NOSENDCHANGING) {
-		        EVENT_PRINTF(("NOSENDCHANGING "));
+			EVENT_PRINTF(("NOSENDCHANGING "));
 		    }
 		    if (wp->flags & SWP_DEFERERASE) {
-		        EVENT_PRINTF(("DEFERERASE "));
+			EVENT_PRINTF(("DEFERERASE "));
 		    }
 		    if (wp->flags & SWP_ASYNCWINDOWPOS) {
-		        EVENT_PRINTF(("ASYNCWINDOWPOS "));
+			EVENT_PRINTF(("ASYNCWINDOWPOS "));
 		    }
 		    if (wp->flags & SWP_HIDEWINDOW) {
-		        EVENT_PRINTF(("HIDEWINDOW "));
+			EVENT_PRINTF(("HIDEWINDOW "));
 		    }
 		    if (wp->flags & SWP_SHOWWINDOW) {
-		        EVENT_PRINTF(("SHOWWINDOW "));
+			EVENT_PRINTF(("SHOWWINDOW "));
 		    }
 
 		    EVENT_PRINTF(("] %d/%d %d/%d flags:%d (0x%x) ->",
 				wp->x, wp->y, wp->cx, wp->cy, wp->flags, wp->flags));
 		    EVENT_PRINTF(("  client rect now: %d/%d %d/%d\n",x, y, w, h));
 
-                } /* __debug__ */
+		} /* __debug__ */
 
 		if ((w == 0) && (h == 0)) {
 		    EVENT_PRINTF(("w,h = 0.\n"));
@@ -4065,33 +4065,33 @@
 	    EVENT_PRINTF(("WM_EXITSIZEMOVE\n"));
 
 #ifndef PRE_13_APR_04_POSCHANGED_IN_EXITSIZEMOVE
-            if (inMove) {
-                /* generate WM_WINDOWPOSCHANGED
-                */
-                RECT rct;
-                int x, y, w, h;
-
-                GetClientRect(hWnd, &rct);
-
-                x = rct.left;
-                y = rct.top;
-                w = rct.right - rct.left;
-                h = rct.bottom - rct.top;
-
-                if ((w == 0) && (h == 0)) {
-                    if (! GetWindow_iconified(hWnd)) {
-                        SetWindow_iconified(hWnd, 1);
-                    }
-                    enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
-                } else {
-                    if (GetWindow_iconified(hWnd)) {
-                        SetWindow_iconified(hWnd, 0);
-                        enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
-                    } else {
-                        enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
-                    }
-                }
-            }
+	    if (inMove) {
+		/* generate WM_WINDOWPOSCHANGED
+		*/
+		RECT rct;
+		int x, y, w, h;
+
+		GetClientRect(hWnd, &rct);
+
+		x = rct.left;
+		y = rct.top;
+		w = rct.right - rct.left;
+		h = rct.bottom - rct.top;
+
+		if ((w == 0) && (h == 0)) {
+		    if (! GetWindow_iconified(hWnd)) {
+			SetWindow_iconified(hWnd, 1);
+		    }
+		    enqEvent(0, hWnd, __WM_ICONIFIED, 1, 0, 0, 0, 0, EV_NOTIME);
+		} else {
+		    if (GetWindow_iconified(hWnd)) {
+			SetWindow_iconified(hWnd, 0);
+			enqEvent(0, hWnd, __WM_ICONIFIED, 0, 0, 0, 0, 0, EV_NOTIME);
+		    } else {
+			enqEvent(0, hWnd, WM_WINDOWPOSCHANGED, 0, x, y, w, h, EV_NOTIME);
+		    }
+		}
+	    }
 #endif
 
 	    inSizeMove = inMove = inSize = 0;
@@ -4324,7 +4324,7 @@
 #endif
 
 	default:
-	    fprintf(stderr, "WinWorkstat [info] unhandled msg = %d 0x%x [%d]\n", message, message, __LINE__);
+	    EVENT_PRINTF(( "WinWorkstat [info] unhandled msg = %d 0x%x [%d]\n", message, message, __LINE__));
 	    break;
     }
     return 0;
@@ -15943,7 +15943,7 @@
 !WinWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.267 2004-04-13 06:16:16 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.268 2004-04-19 11:31:37 ca Exp $'
 ! !
 
 WinWorkstation initialize!