WinWorkstation.st
changeset 2659 c181846c6f5a
parent 2653 f0ca966a5636
child 2661 c68f92ae1cb5
--- a/WinWorkstation.st	Sat May 08 17:45:07 1999 +0200
+++ b/WinWorkstation.st	Sat May 08 17:46:18 1999 +0200
@@ -676,12 +676,23 @@
 static int eventsendcount = 0;
 static int eventempfcount = 0;
 
+/*
+ * remember the last background-paint brush
+ * will be reused by next bg-paint, if it needs
+ * the same color. Otherwise, the next bg-erase
+ * will destroy this brush.
+ */
 #ifdef CACHE_LAST_WM_PAINT_BRUSH
  static HBRUSH wm_paint_brush = (HBRUSH) 0;
- static HWND   wm_paint_brush_hwnd = (HWND) 0;
  static HWND   wm_paint_brush_clr = (HWND) 0;
 #endif
 
+static HWND lastPos_win = 0;
+static int lastPos_w;
+static int lastPos_h;
+static int lastPos_x;
+static int lastPos_y;
+
 %}
 ! !
 
@@ -803,6 +814,40 @@
 # define _DeleteObject(o,lnr)  DeleteObject(o)
 #endif
 
+static int
+_DeleteBrush(br, lineNr)
+    HBRUSH br;
+{
+    int r;
+
+    if ((br != __whiteBrush)
+     && (br != __blackBrush)) {
+	r = DeleteObject(br);
+
+	if (r == 0)
+	    fprintf(stderr, "WinWorkstation: ERROR in DeleteBrush %x [%d]\n", br, lineNr);
+	return r;
+    }
+    return 1;
+}
+
+static int
+_DeletePen(p, lineNr)
+    HPEN p;
+{
+    int r;
+
+    if ((p != __whitePen)
+     && (p != __blackPen)) {
+	r = DeleteObject(p);
+
+	if (r == 0)
+	    fprintf(stderr, "WinWorkstation: ERROR in DeletePen %x [%d]\n", p, lineNr);
+	return r;
+    }
+    return 1;
+}
+
 static struct gcData *
 newGcData() {
     struct gcData *gcData = (struct gcData *)malloc(sizeof(struct gcData));
@@ -857,10 +902,7 @@
 	    SelectObject(__gcData__->_hDC, __gcData__->save_hPen); \
 	    __gcData__->save_hPen = 0;   \
 	} \
-	if ((__gcData__->hPen != __blackPen) \
-	 && (__gcData__->hPen != __whitePen)) { \
-	    _DeleteObject(__gcData__->hPen, __LINE__); \
-	} \
+	_DeletePen(__gcData__->hPen, __LINE__); \
 	__gcData__->hPen = 0; \
     }
 #else
@@ -874,10 +916,7 @@
 	    SelectObject(__gcData__->_hDC, __gcData__->save_hBrush); \
 	    __gcData__->save_hBrush = 0;   \
 	} \
-	if ((__gcData__->hBrush != __blackBrush) \
-	 && (__gcData__->hBrush != __whiteBrush)) { \
-	    _DeleteObject(__gcData__->hBrush, __LINE__); \
-	} \
+	_DeleteBrush(__gcData__->hBrush, __LINE__); \
 	__gcData__->hBrush = 0; \
     }
 #else
@@ -915,19 +954,13 @@
 
 #ifdef CACHE_LAST_PEN
     if (gcData->hPen) {
-	if ((gcData->hPen != __blackPen)
-	 && (gcData->hPen != __whitePen)) {
-	    _DeleteObject(gcData->hPen, __LINE__);
-	}
+	_DeletePen(gcData->hPen, __LINE__);
 	gcData->hPen = 0;
     }
 #endif
 #ifdef CACHE_LAST_BRUSH
     if (gcData->hBrush) {
-	if ((gcData->hBrush != __blackBrush)
-	 && (gcData->hBrush != __whiteBrush)) {
-	    _DeleteObject(gcData->hBrush, __LINE__);
-	}
+	_DeleteBrush(gcData->hBrush, __LINE__);
 	gcData->hBrush = 0;
     }
 #endif
@@ -1074,9 +1107,7 @@
 	SelectObject(hDC, gcData->save_hBrush);
 	gcData->save_hBrush = NULL;
     }
-    if ((hBrush != __blackBrush) && (hBrush != __whiteBrush)) {
-	_DeleteObject(hBrush, __LINE__); 
-    }
+    _DeleteBrush(hBrush, __LINE__); 
     gcData->hBrush = 0;
 }
 #endif
@@ -1235,9 +1266,7 @@
 	gcData->save_hPen = NULL;
     }
     hPen = gcData->hPen;
-    if ((hPen != __blackPen) && (hPen != __whitePen)) {
-	_DeleteObject(hPen, __LINE__); 
-    }
+    _DeletePen(hPen, __LINE__); 
     gcData->hPen = 0;
 }
 #endif /* CACHE_LAST_PEN */
@@ -1691,7 +1720,7 @@
 
 		if (br = GetWindow_viewBgBrush(hWnd)) {
 		    SetWindow_viewBgBrush(hWnd, 0);
-		    _DeleteObject(br, __LINE__);
+		    _DeleteBrush(br, __LINE__);
 		}
 	    }
 	    if (! DestroyWindow(hWnd)) {
@@ -1711,7 +1740,7 @@
 
 		    if (br = GetWindow_viewBgBrush(hWnd)) {
 			SetWindow_viewBgBrush(hWnd, 0);
-			_DeleteObject(br, __LINE__);
+			_DeleteBrush(br, __LINE__);
 		    }
 		}
 		if (! DestroyWindow(hWnd)) {
@@ -1738,7 +1767,7 @@
 		    }
 		    /* free all resources */
 		    /*if (GetWindow_bgBrush(hWnd))
-		     *    _DeleteObject(GetWindow_bgBrush(hWnd), __LINE__);
+		     *    _DeleteBrush(GetWindow_bgBrush(hWnd), __LINE__);
 		     */
 		    /* freeing now done in other thread */
 		    //free(GETLOCALWINDOWINFOPTR(hWnd));
@@ -1898,6 +1927,18 @@
 		    if (!(wp->flags & SWP_NOSIZE) 
 		     || !(wp->flags & SWP_NOMOVE)) {
 			enqEvent(ENQ_AT_END, 0, hWnd, message, wParam, x, y, w, h);
+			/*
+			 * remember the current
+			 * window and size;
+			 * This allows the backend to ignore
+			 * intermediate events.
+			 */
+			lastPos_win = 0;
+			lastPos_w = w;
+			lastPos_h = h;
+			lastPos_x = x;
+			lastPos_y = y;
+			lastPos_win = hWnd;
 		    }
 		}
 #ifdef MAKES_GUI_PAINTER_START_SLOW
@@ -1944,10 +1985,7 @@
 				br = wm_paint_brush;
 			    } else {
 				if (wm_paint_brush) {
-				    if ((wm_paint_brush != __whiteBrush)
-				     && (wm_paint_brush != __blackBrush)) {
-					_DeleteObject(wm_paint_brush, __LINE__);
-				    }
+				    _DeleteBrush(wm_paint_brush, __LINE__);
 				}
 				if (bgClr == WhitePixel) {
 				    br = __whiteBrush;
@@ -1964,20 +2002,21 @@
 #  endif
 			}
 			if (br) {
-			    // printf("erase %d %d %d %d\n",rec.left,rec.top,rec.right,rec.bottom);
 			    SelectClipRgn(dc, 0);
 			    FillRect(dc, &upd, br);
 #  ifndef CACHE_LAST_WM_PAINT_BRUSH
 			    if (isSolidColorBrush) {
-				if ((br != __whiteBrush) && (br != __blackBrush)) {
-				    _DeleteObject(br, __LINE__);
-				}
+				_DeleteBrush(br, __LINE__);
 			    }
 #  endif
 			}
 			ReleaseDC(hWnd, dc);
 # endif
-			enqEvent(ENQ_AT_END, ExposureMask, hWnd, message, wParam, upd.left, upd.top, upd.right-upd.left+1, upd.bottom-upd.top+1);
+			enqEvent(ENQ_AT_END, ExposureMask, hWnd, message, wParam, 
+				 upd.left, 
+				 upd.top, 
+				 upd.right - upd.left + 1, 
+				 upd.bottom - upd.top + 1);
 		    }
 		}
 	    } else {
@@ -1990,17 +2029,6 @@
 
 	case WM_SIZE:
 	    EVENT_PRINTF(("WM_SIZE\n"));
-#if 0
-	    switch(wParam) {
-		case SIZE_RESTORED:
-		case SIZE_MAXIMIZED:
-		    GetClientRect(hWnd, (LPRECT) &upd);
-		    if (GetWindow_eventMask(hWnd) & ExposureMask)
-			enqEvent(ENQ_AT_END, ExposureMask, hWnd, WM_PAINT, wParam, upd.left, upd.top, upd.right-upd.left+1, upd.bottom-upd.top+1);
-		    DPRINTF(("WM_SIZE %x w %d h %d\n",hWnd,LOWORD(lParam),HIWORD(lParam)));
-		    break;
-	    }
-#endif
 	    *pDefault = 0;
 	    return 0;
 	    break;
@@ -2510,6 +2538,18 @@
 	    EVENT_PRINTF(("WM_NCMBUTTONUP\n"));
 	    break;
 
+	case WM_NCLBUTTONDBLCLK:
+	    EVENT_PRINTF(("WM_NCLBUTTONDBLCLK\n"));
+	    break;
+
+	case WM_NCRBUTTONDBLCLK:
+	    EVENT_PRINTF(("WM_NCRBUTTONDBLCLK\n"));
+	    break;
+
+	case WM_NCMBUTTONDBLCLK:
+	    EVENT_PRINTF(("WM_NCMBUTTONDBLCLK\n"));
+	    break;
+
 	case WM_SETTEXT:
 	    EVENT_PRINTF(("WM_SETTEXT\n"));
 	    break;
@@ -3276,10 +3316,8 @@
 
     StandardColorValues := Dictionary new.
     #(
-	(240 248 255)   'alice blue'
-	(240 248 255)   'AliceBlue'
-	(250 235 215)   'antique white'
-	(250 235 215)   'AntiqueWhite'
+	(240 248 255)   'aliceblue'
+	(250 235 215)   'antiquewhite'
 	(255 239 219)   'AntiqueWhite1'
 	(238 223 204)   'AntiqueWhite2'
 	(205 192 176)   'AntiqueWhite3'
@@ -3301,15 +3339,13 @@
 	(205 183 158)   'bisque3'
 	(139 125 107)   'bisque4'
 	(  0   0   0)   'black'
-	(255 235 205)   'blanched almond'
-	(255 235 205)   'BlanchedAlmond'
+	(255 235 205)   'blanchedalmond'
 	(  0   0 255)   'blue'
-	(138  43 226)   'blue violet'
+	(138  43 226)   'blueviolet'
 	(  0   0 255)   'blue1'
 	(  0   0 238)   'blue2'
 	(  0   0 205)   'blue3'
 	(  0   0 139)   'blue4'
-	(138  43 226)   'BlueViolet'
 	(165  42  42)   'brown'
 	(255  64  64)   'brown1'
 	(238  59  59)   'brown2'
@@ -3320,8 +3356,7 @@
 	(238 197 145)   'burlywood2'
 	(205 170 125)   'burlywood3'
 	(139 115  85)   'burlywood4'
-	( 95 158 160)   'cadet blue'
-	( 95 158 160)   'CadetBlue'
+	( 95 158 160)   'cadetblue'
 	(152 245 255)   'CadetBlue1'
 	(142 229 238)   'CadetBlue2'
 	(122 197 205)   'CadetBlue3'
@@ -3341,8 +3376,7 @@
 	(238 106  80)   'coral2'
 	(205  91  69)   'coral3'
 	(139  62  47)   'coral4'
-	(100 149 237)   'cornflower blue'
-	(100 149 237)   'CornflowerBlue'
+	(100 149 237)   'cornflowerblue'
 	(255 248 220)   'cornsilk'
 	(255 248 220)   'cornsilk1'
 	(238 232 205)   'cornsilk2'
@@ -3353,86 +3387,63 @@
 	(  0 238 238)   'cyan2'
 	(  0 205 205)   'cyan3'
 	(  0 139 139)   'cyan4'
-	(  0   0 139)   'dark blue'
-	(  0 139 139)   'dark cyan'
-	(184 134  11)   'dark goldenrod'
-	(169 169 169)   'dark gray'
-	(  0 100   0)   'dark green'
-	(169 169 169)   'dark grey'
-	(189 183 107)   'dark khaki'
-	(139   0 139)   'dark magenta'
-	( 85 107  47)   'dark olive green'
-	(255 140   0)   'dark orange'
-	(153  50 204)   'dark orchid'
-	(139   0   0)   'dark red'
-	(233 150 122)   'dark salmon'
-	(143 188 143)   'dark sea green'
-	( 72  61 139)   'dark slate blue'
-	( 47  79  79)   'dark slate gray'
-	( 47  79  79)   'dark slate grey'
-	(  0 206 209)   'dark turquoise'
-	(148   0 211)   'dark violet'
-	(  0   0 139)   'DarkBlue'
-	(  0 139 139)   'DarkCyan'
-	(184 134  11)   'DarkGoldenrod'
+	(  0   0 139)   'darkblue'
+	(  0 139 139)   'darkcyan'
+	(184 134  11)   'darkgoldenrod'
+	(169 169 169)   'darkgray'
+	(  0 100   0)   'darkgreen'
+	(169 169 169)   'darkgrey'
+	(189 183 107)   'darkkhaki'
+	(139   0 139)   'darkmagenta'
+	( 85 107  47)   'darkolivegreen'
+	(255 140   0)   'darkorange'
+	(153  50 204)   'darkorchid'
+	(139   0   0)   'darkred'
+	(233 150 122)   'darksalmon'
+	(143 188 143)   'darkseagreen'
+	( 72  61 139)   'darkslateblue'
+	( 47  79  79)   'darkslategray'
+	( 47  79  79)   'darkslategrey'
+	(  0 206 209)   'darkturquoise'
+	(148   0 211)   'darkviolet'
 	(255 185  15)   'DarkGoldenrod1'
 	(238 173  14)   'DarkGoldenrod2'
 	(205 149  12)   'DarkGoldenrod3'
 	(139 101   8)   'DarkGoldenrod4'
-	(169 169 169)   'DarkGray'
-	(  0 100   0)   'DarkGreen'
-	(169 169 169)   'DarkGrey'
-	(189 183 107)   'DarkKhaki'
-	(139   0 139)   'DarkMagenta'
-	( 85 107  47)   'DarkOliveGreen'
 	(202 255 112)   'DarkOliveGreen1'
 	(188 238 104)   'DarkOliveGreen2'
 	(162 205  90)   'DarkOliveGreen3'
 	(110 139  61)   'DarkOliveGreen4'
-	(255 140   0)   'DarkOrange'
 	(255 127   0)   'DarkOrange1'
 	(238 118   0)   'DarkOrange2'
 	(205 102   0)   'DarkOrange3'
 	(139  69   0)   'DarkOrange4'
-	(153  50 204)   'DarkOrchid'
 	(191  62 255)   'DarkOrchid1'
 	(178  58 238)   'DarkOrchid2'
 	(154  50 205)   'DarkOrchid3'
 	(104  34 139)   'DarkOrchid4'
-	(139   0   0)   'DarkRed'
-	(233 150 122)   'DarkSalmon'
-	(143 188 143)   'DarkSeaGreen'
 	(193 255 193)   'DarkSeaGreen1'
 	(180 238 180)   'DarkSeaGreen2'
 	(155 205 155)   'DarkSeaGreen3'
 	(105 139 105)   'DarkSeaGreen4'
-	( 72  61 139)   'DarkSlateBlue'
-	( 47  79  79)   'DarkSlateGray'
 	(151 255 255)   'DarkSlateGray1'
 	(141 238 238)   'DarkSlateGray2'
 	(121 205 205)   'DarkSlateGray3'
 	( 82 139 139)   'DarkSlateGray4'
-	( 47  79  79)   'DarkSlateGrey'
-	(  0 206 209)   'DarkTurquoise'
-	(148   0 211)   'DarkViolet'
-	(255  20 147)   'deep pink'
-	(  0 191 255)   'deep sky blue'
+	(255  20 147)   'deeppink'
+	(  0 191 255)   'deepskyblue'
 	(255  20 147)   'DeepPink'
 	(255  20 147)   'DeepPink1'
 	(238  18 137)   'DeepPink2'
 	(205  16 118)   'DeepPink3'
 	(139  10  80)   'DeepPink4'
-	(  0 191 255)   'DeepSkyBlue'
 	(  0 191 255)   'DeepSkyBlue1'
 	(  0 178 238)   'DeepSkyBlue2'
 	(  0 154 205)   'DeepSkyBlue3'
 	(  0 104 139)   'DeepSkyBlue4'
-	(105 105 105)   'dim gray'
-	(105 105 105)   'dim grey'
-	(105 105 105)   'DimGray'
-	(105 105 105)   'DimGrey'
-	( 30 144 255)   'dodger blue'
-	( 30 144 255)   'DodgerBlue'
+	(105 105 105)   'dimgray'
+	(105 105 105)   'dimgrey'
+	( 30 144 255)   'dodgerblue'
 	( 30 144 255)   'DodgerBlue1'
 	( 28 134 238)   'DodgerBlue2'
 	( 24 116 205)   'DodgerBlue3'
@@ -3442,13 +3453,10 @@
 	(238  44  44)   'firebrick2'
 	(205  38  38)   'firebrick3'
 	(139  26  26)   'firebrick4'
-	(255 250 240)   'floral white'
-	(255 250 240)   'FloralWhite'
-	( 34 139  34)   'forest green'
-	( 34 139  34)   'ForestGreen'
+	(255 250 240)   'floralwhite'
+	( 34 139  34)   'forestgreen'
 	(220 220 220)   'gainsboro'
-	(248 248 255)   'ghost white'
-	(248 248 255)   'GhostWhite'
+	(248 248 255)   'ghostwhite'
 	(255 215   0)   'gold'
 	(255 215   0)   'gold1'
 	(238 201   0)   'gold2'
@@ -3459,7 +3467,6 @@
 	(238 180  34)   'goldenrod2'
 	(205 155  29)   'goldenrod3'
 	(139 105  20)   'goldenrod4'
-
 	(192 192 192)   'grey'
 	(  0   0   0)   'grey0'
 	(  3   3   3)   'grey1'
@@ -3666,25 +3673,22 @@
 	(250 250 250)   'gray98'
 	(252 252 252)   'gray99'
 	(  0 255   0)   'green'
-	(173 255  47)   'green yellow'
+	(173 255  47)   'greenyellow'
 	(  0 255   0)   'green1'
 	(  0 238   0)   'green2'
 	(  0 205   0)   'green3'
 	(  0 139   0)   'green4'
-	(173 255  47)   'GreenYellow'
 	(240 255 240)   'honeydew'
 	(240 255 240)   'honeydew1'
 	(224 238 224)   'honeydew2'
 	(193 205 193)   'honeydew3'
 	(131 139 131)   'honeydew4'
-	(255 105 180)   'hot pink'
-	(255 105 180)   'HotPink'
+	(255 105 180)   'hotpink'
 	(255 110 180)   'HotPink1'
 	(238 106 167)   'HotPink2'
 	(205  96 144)   'HotPink3'
 	(139  58  98)   'HotPink4'
-	(205  92  92)   'indian red'
-	(205  92  92)   'IndianRed'
+	(205  92  92)   'indianred'
 	(255 106 106)   'IndianRed1'
 	(238  99  99)   'IndianRed2'
 	(205  85  85)   'IndianRed3'
@@ -3700,88 +3704,67 @@
 	(205 198 115)   'khaki3'
 	(139 134  78)   'khaki4'
 	(230 230 250)   'lavender'
-	(255 240 245)   'lavender blush'
-	(255 240 245)   'LavenderBlush'
+	(255 240 245)   'lavenderblush'
 	(255 240 245)   'LavenderBlush1'
 	(238 224 229)   'LavenderBlush2'
 	(205 193 197)   'LavenderBlush3'
 	(139 131 134)   'LavenderBlush4'
-	(124 252   0)   'lawn green'
-	(124 252   0)   'LawnGreen'
-	(255 250 205)   'lemon chiffon'
-	(255 250 205)   'LemonChiffon'
+	(124 252   0)   'lawngreen'
+	(255 250 205)   'lemonchiffon'
 	(255 250 205)   'LemonChiffon1'
 	(238 233 191)   'LemonChiffon2'
 	(205 201 165)   'LemonChiffon3'
 	(139 137 112)   'LemonChiffon4'
-	(173 216 230)   'light blue'
-	(240 128 128)   'light coral'
-	(224 255 255)   'light cyan'
-	(238 221 130)   'light goldenrod'
-	(250 250 210)   'light goldenrod yellow'
-	(211 211 211)   'light gray'
-	(144 238 144)   'light green'
-	(211 211 211)   'light grey'
-	(255 182 193)   'light pink'
-	(255 160 122)   'light salmon'
-	( 32 178 170)   'light sea green'
-	(135 206 250)   'light sky blue'
-	(132 112 255)   'light slate blue'
-	(119 136 153)   'light slate gray'
-	(119 136 153)   'light slate grey'
-	(176 196 222)   'light steel blue'
-	(255 255 224)   'light yellow'
-	(173 216 230)   'LightBlue'
+	(173 216 230)   'lightblue'
+	(240 128 128)   'lightcoral'
+	(224 255 255)   'lightcyan'
+	(238 221 130)   'lightgoldenrod'
+	(250 250 210)   'lightgoldenrodyellow'
+	(211 211 211)   'lightgray'
+	(144 238 144)   'lightgreen'
+	(211 211 211)   'lightgrey'
+	(255 182 193)   'lightpink'
+	(255 160 122)   'lightsalmon'
+	( 32 178 170)   'lightseagreen'
+	(135 206 250)   'lightskyblue'
+	(132 112 255)   'lightslateblue'
+	(119 136 153)   'lightslategray'
+	(119 136 153)   'lightslategrey'
+	(176 196 222)   'lightsteelblue'
+	(255 255 224)   'lightyellow'
 	(191 239 255)   'LightBlue1'
 	(178 223 238)   'LightBlue2'
 	(154 192 205)   'LightBlue3'
 	(104 131 139)   'LightBlue4'
-	(240 128 128)   'LightCoral'
-	(224 255 255)   'LightCyan'
 	(224 255 255)   'LightCyan1'
 	(209 238 238)   'LightCyan2'
 	(180 205 205)   'LightCyan3'
 	(122 139 139)   'LightCyan4'
-	(238 221 130)   'LightGoldenrod'
 	(255 236 139)   'LightGoldenrod1'
 	(238 220 130)   'LightGoldenrod2'
 	(205 190 112)   'LightGoldenrod3'
 	(139 129  76)   'LightGoldenrod4'
-	(250 250 210)   'LightGoldenrodYellow'
-	(211 211 211)   'LightGray'
-	(144 238 144)   'LightGreen'
-	(211 211 211)   'LightGrey'
-	(255 182 193)   'LightPink'
 	(255 174 185)   'LightPink1'
 	(238 162 173)   'LightPink2'
 	(205 140 149)   'LightPink3'
 	(139  95 101)   'LightPink4'
-	(255 160 122)   'LightSalmon'
 	(255 160 122)   'LightSalmon1'
 	(238 149 114)   'LightSalmon2'
 	(205 129  98)   'LightSalmon3'
 	(139  87  66)   'LightSalmon4'
-	( 32 178 170)   'LightSeaGreen'
-	(135 206 250)   'LightSkyBlue'
 	(176 226 255)   'LightSkyBlue1'
 	(164 211 238)   'LightSkyBlue2'
 	(141 182 205)   'LightSkyBlue3'
 	( 96 123 139)   'LightSkyBlue4'
-	(132 112 255)   'LightSlateBlue'
-	(119 136 153)   'LightSlateGray'
-	(119 136 153)   'LightSlateGrey'
-	(176 196 222)   'LightSteelBlue'
 	(202 225 255)   'LightSteelBlue1'
 	(188 210 238)   'LightSteelBlue2'
 	(162 181 205)   'LightSteelBlue3'
 	(110 123 139)   'LightSteelBlue4'
-	(255 255 224)   'LightYellow'
 	(255 255 224)   'LightYellow1'
 	(238 238 209)   'LightYellow2'
 	(205 205 180)   'LightYellow3'
 	(139 139 122)   'LightYellow4'
-	( 50 205  50)   'lime green'
-	( 50 205  50)   'LimeGreen'
+	( 50 205  50)   'limegreen'
 	(250 240 230)   'linen'
 	(255   0 255)   'magenta'
 	(255   0 255)   'magenta1'
@@ -3793,67 +3776,50 @@
 	(238  48 167)   'maroon2'
 	(205  41 144)   'maroon3'
 	(139  28  98)   'maroon4'
-	(102 205 170)   'medium aquamarine'
-	(  0   0 205)   'medium blue'
-	(186  85 211)   'medium orchid'
-	(147 112 219)   'medium purple'
-	( 60 179 113)   'medium sea green'
-	(123 104 238)   'medium slate blue'
-	(  0 250 154)   'medium spring green'
-	( 72 209 204)   'medium turquoise'
-	(199  21 133)   'medium violet red'
-	(102 205 170)   'MediumAquamarine'
-	(  0   0 205)   'MediumBlue'
-	(186  85 211)   'MediumOrchid'
+	(102 205 170)   'mediumaquamarine'
+	(  0   0 205)   'mediumblue'
+	(186  85 211)   'mediumorchid'
+	(147 112 219)   'mediumpurple'
+	( 60 179 113)   'mediumseagreen'
+	(123 104 238)   'mediumslateblue'
+	(  0 250 154)   'mediumspringgreen'
+	( 72 209 204)   'mediumturquoise'
+	(199  21 133)   'mediumvioletred'
 	(224 102 255)   'MediumOrchid1'
 	(209  95 238)   'MediumOrchid2'
 	(180  82 205)   'MediumOrchid3'
 	(122  55 139)   'MediumOrchid4'
-	(147 112 219)   'MediumPurple'
 	(171 130 255)   'MediumPurple1'
 	(159 121 238)   'MediumPurple2'
 	(137 104 205)   'MediumPurple3'
 	( 93  71 139)   'MediumPurple4'
-	( 60 179 113)   'MediumSeaGreen'
-	(123 104 238)   'MediumSlateBlue'
-	(  0 250 154)   'MediumSpringGreen'
-	( 72 209 204)   'MediumTurquoise'
-	(199  21 133)   'MediumVioletRed'
-	( 25  25 112)   'midnight blue'
-	( 25  25 112)   'MidnightBlue'
-	(245 255 250)   'mint cream'
-	(245 255 250)   'MintCream'
-	(255 228 225)   'misty rose'
-	(255 228 225)   'MistyRose'
+	( 25  25 112)   'midnightblue'
+	(245 255 250)   'mintcream'
+	(255 228 225)   'mistyrose'
 	(255 228 225)   'MistyRose1'
 	(238 213 210)   'MistyRose2'
 	(205 183 181)   'MistyRose3'
 	(139 125 123)   'MistyRose4'
 	(255 228 181)   'moccasin'
-	(255 222 173)   'navajo white'
-	(255 222 173)   'NavajoWhite'
+	(255 222 173)   'navajowhite'
 	(255 222 173)   'NavajoWhite1'
 	(238 207 161)   'NavajoWhite2'
 	(205 179 139)   'NavajoWhite3'
 	(139 121  94)   'NavajoWhite4'
 	(  0   0 128)   'navy'
-	(  0   0 128)   'navy blue'
-	(  0   0 128)   'NavyBlue'
-	(253 245 230)   'old lace'
-	(253 245 230)   'OldLace'
-	(107 142  35)   'olive drab'
-	(107 142  35)   'OliveDrab'
+	(  0   0 128)   'navyblue'
+	(253 245 230)   'oldlace'
+	(107 142  35)   'olivedrab'
 	(192 255  62)   'OliveDrab1'
 	(179 238  58)   'OliveDrab2'
 	(154 205  50)   'OliveDrab3'
 	(105 139  34)   'OliveDrab4'
 	(255 165   0)   'orange'
-	(255  69   0)   'orange red'
 	(255 165   0)   'orange1'
 	(238 154   0)   'orange2'
 	(205 133   0)   'orange3'
 	(139  90   0)   'orange4'
-	(255  69   0)   'OrangeRed'
+	(255  69   0)   'orangered'
 	(255  69   0)   'OrangeRed1'
 	(238  64   0)   'OrangeRed2'
 	(205  55   0)   'OrangeRed3'
@@ -3863,30 +3829,24 @@
 	(238 122 233)   'orchid2'
 	(205 105 201)   'orchid3'
 	(139  71 137)   'orchid4'
-	(238 232 170)   'pale goldenrod'
-	(152 251 152)   'pale green'
-	(175 238 238)   'pale turquoise'
-	(219 112 147)   'pale violet red'
-	(238 232 170)   'PaleGoldenrod'
-	(152 251 152)   'PaleGreen'
+	(238 232 170)   'palegoldenrod'
+	(152 251 152)   'palegreen'
+	(175 238 238)   'paleturquoise'
+	(219 112 147)   'palevioletred'
 	(154 255 154)   'PaleGreen1'
 	(144 238 144)   'PaleGreen2'
 	(124 205 124)   'PaleGreen3'
 	( 84 139  84)   'PaleGreen4'
-	(175 238 238)   'PaleTurquoise'
 	(187 255 255)   'PaleTurquoise1'
 	(174 238 238)   'PaleTurquoise2'
 	(150 205 205)   'PaleTurquoise3'
 	(102 139 139)   'PaleTurquoise4'
-	(219 112 147)   'PaleVioletRed'
 	(255 130 171)   'PaleVioletRed1'
 	(238 121 159)   'PaleVioletRed2'
 	(205 104 137)   'PaleVioletRed3'
 	(139  71  93)   'PaleVioletRed4'
-	(255 239 213)   'papaya whip'
-	(255 239 213)   'PapayaWhip'
-	(255 218 185)   'peach puff'
-	(255 218 185)   'PeachPuff'
+	(255 239 213)   'papayawhip'
+	(255 218 185)   'peachpuff'
 	(255 218 185)   'PeachPuff1'
 	(238 203 173)   'PeachPuff2'
 	(205 175 149)   'PeachPuff3'
@@ -3902,8 +3862,7 @@
 	(238 174 238)   'plum2'
 	(205 150 205)   'plum3'
 	(139 102 139)   'plum4'
-	(176 224 230)   'powder blue'
-	(176 224 230)   'PowderBlue'
+	(176 224 230)   'powderblue'
 	(160  32 240)   'purple'
 	(155  48 255)   'purple1'
 	(145  44 238)   'purple2'
@@ -3914,37 +3873,32 @@
 	(238   0   0)   'red2'
 	(205   0   0)   'red3'
 	(139   0   0)   'red4'
-	(188 143 143)   'rosy brown'
-	(188 143 143)   'RosyBrown'
+	(188 143 143)   'rosybrown'
 	(255 193 193)   'RosyBrown1'
 	(238 180 180)   'RosyBrown2'
 	(205 155 155)   'RosyBrown3'
 	(139 105 105)   'RosyBrown4'
-	( 65 105 225)   'royal blue'
-	( 65 105 225)   'RoyalBlue'
+	( 65 105 225)   'royalblue'
 	( 72 118 255)   'RoyalBlue1'
 	( 67 110 238)   'RoyalBlue2'
 	( 58  95 205)   'RoyalBlue3'
 	( 39  64 139)   'RoyalBlue4'
-	(139  69  19)   'saddle brown'
-	(139  69  19)   'SaddleBrown'
+	(139  69  19)   'saddlebrown'
 	(250 128 114)   'salmon'
 	(255 140 105)   'salmon1'
 	(238 130  98)   'salmon2'
 	(205 112  84)   'salmon3'
 	(139  76  57)   'salmon4'
-	(244 164  96)   'sandy brown'
-	(244 164  96)   'SandyBrown'
-	( 255 206 137)   'scoActiveBackground'
+	(244 164  96)   'sandybrown'
+	( 255 206 137)  'scoActiveBackground'
 	( 43  45  49)   'scoActiveForeground'
-	( 254 222 255)   'scoActiveTopShadow'
-	( 172 186 204)   'scoAltBackground'
-	( 203 203 192)   'scoBackground'
+	( 254 222 255)  'scoActiveTopShadow'
+	( 172 186 204)  'scoAltBackground'
+	( 203 203 192)  'scoBackground'
 	( 11   0 113)   'scoForeground'
-	( 141 178 215)   'scoHighlight'
-	( 255 240 248)   'scoTopShadow'
-	( 46 139  87)   'sea green'
-	( 46 139  87)   'SeaGreen'
+	( 141 178 215)  'scoHighlight'
+	( 255 240 248)  'scoTopShadow'
+	( 46 139  87)   'seagreen'
 	( 84 255 159)   'SeaGreen1'
 	( 78 238 148)   'SeaGreen2'
 	( 67 205 128)   'SeaGreen3'
@@ -3954,7 +3908,7 @@
 	(238 229 222)   'seashell2'
 	(205 197 191)   'seashell3'
 	(139 134 130)   'seashell4'
-	(142 56 142)   'sgi beet'
+	(142 56 142)    'sgi beet'
 	(197 193 170)   'sgi bright gray'
 	(197 193 170)   'sgi bright grey'
 	(113 198 113)   'sgi chartreuse'
@@ -4025,7 +3979,7 @@
 	( 40  40  40)   'sgi very dark grey'
 	(214 214 214)   'sgi very light gray'
 	(214 214 214)   'sgi very light grey'
-	(142 56 142)   'SGIBeet'
+	(142 56 142)    'SGIBeet'
 	(197 193 170)   'SGIBrightGray'
 	(197 193 170)   'SGIBrightGrey'
 	(113 198 113)   'SGIChartreuse'
@@ -4101,39 +4055,33 @@
 	(238 121  66)   'sienna2'
 	(205 104  57)   'sienna3'
 	(139  71  38)   'sienna4'
-	(135 206 235)   'sky blue'
-	(135 206 235)   'SkyBlue'
+	(135 206 235)   'skyblue'
 	(135 206 255)   'SkyBlue1'
 	(126 192 238)   'SkyBlue2'
 	(108 166 205)   'SkyBlue3'
 	( 74 112 139)   'SkyBlue4'
-	(106  90 205)   'slate blue'
-	(112 128 144)   'slate gray'
-	(112 128 144)   'slate grey'
-	(106  90 205)   'SlateBlue'
+	(112 128 144)   'slategray'
+	(112 128 144)   'slategrey'
+	(106  90 205)   'slateblue'
 	(131 111 255)   'SlateBlue1'
 	(122 103 238)   'SlateBlue2'
 	(105  89 205)   'SlateBlue3'
 	( 71  60 139)   'SlateBlue4'
-	(112 128 144)   'SlateGray'
 	(198 226 255)   'SlateGray1'
 	(185 211 238)   'SlateGray2'
 	(159 182 205)   'SlateGray3'
 	(108 123 139)   'SlateGray4'
-	(112 128 144)   'SlateGrey'
 	(255 250 250)   'snow'
 	(255 250 250)   'snow1'
 	(238 233 233)   'snow2'
 	(205 201 201)   'snow3'
 	(139 137 137)   'snow4'
-	(  0 255 127)   'spring green'
-	(  0 255 127)   'SpringGreen'
+	(  0 255 127)   'springgreen'
 	(  0 255 127)   'SpringGreen1'
 	(  0 238 118)   'SpringGreen2'
 	(  0 205 102)   'SpringGreen3'
 	(  0 139  69)   'SpringGreen4'
-	( 70 130 180)   'steel blue'
-	( 70 130 180)   'SteelBlue'
+	( 70 130 180)   'steelblue'
 	( 99 184 255)   'SteelBlue1'
 	( 92 172 238)   'SteelBlue2'
 	( 79 148 205)   'SteelBlue3'
@@ -4159,8 +4107,7 @@
 	(  0 197 205)   'turquoise3'
 	(  0 134 139)   'turquoise4'
 	(238 130 238)   'violet'
-	(208  32 144)   'violet red'
-	(208  32 144)   'VioletRed'
+	(208  32 144)   'violetred'
 	(255  62 150)   'VioletRed1'
 	(238  58 140)   'VioletRed2'
 	(205  50 120)   'VioletRed3'
@@ -4171,15 +4118,13 @@
 	(205 186 150)   'wheat3'
 	(139 126 102)   'wheat4'
 	(255 255 255)   'white'
-	(245 245 245)   'white smoke'
-	(245 245 245)   'WhiteSmoke'
+	(245 245 245)   'whitesmoke'
 	(255 255   0)   'yellow'
-	(154 205  50)   'yellow green'
+	(154 205  50)   'yellowgreen'
 	(255 255   0)   'yellow1'
 	(238 238   0)   'yellow2'
 	(205 205   0)   'yellow3'
 	(139 139   0)   'yellow4'
-	(154 205  50)   'YellowGreen'   
     ) pairWiseDo:[ :value :name |
 	StandardColorValues at:name put:value
     ].
@@ -5872,7 +5817,7 @@
     "get scaled rgb components (0..16rFFFF) of color named colorName,
      and evaluate the 3-arg block, aBlock with them"
 
-    |triple r g b found|
+    |triple r g b found cName|
 
     r := g := b := 0.
     found := false.
@@ -5883,10 +5828,17 @@
 	b := Integer readFrom:(colorName copyFrom:6 to:7) radix:16.
 	found := true.
     ] ifFalse:[
-
-	triple := StandardColorValues at:colorName asString ifAbsent:nil.
+	cName := colorName asString.
+	triple := StandardColorValues at:cName ifAbsent:nil.
 	triple isNil ifTrue:[
-	    triple := StandardColorValues at:colorName asString asLowercase ifAbsent:nil.
+	    "/ try lowercase name
+	    cName := cName asLowercase.
+	    triple := StandardColorValues at:cName ifAbsent:nil.
+	    triple isNil ifTrue:[
+		"/ try lowercase without intermixed spaces
+		cName := cName asCollectionOfWords asStringWith:nil.
+		triple := StandardColorValues at:cName ifAbsent:nil.
+	    ].
 	].
 	triple notNil ifTrue:[
 	    r := triple at:1.
@@ -6380,7 +6332,18 @@
 # endif
 #endif /* 0 */
 
+#if 0
 		UpdateWindow(srcGcData->hWnd);
+#else
+		if (GetUpdateRect(srcGcData->hWnd, &upd, FALSE)) {
+		    if ((upd.right >= upd.left)
+		     && (upd.bottom >= upd.top)) {
+			if (GetWindow_eventMask(srcGcData->hWnd) & ExposureMask) {
+			    enqEvent(ENQ_AT_FRONT, ExposureMask,srcGcData->hWnd, __WM_GEXPOSE, 0, upd.left, upd.top, upd.right-upd.left+1, upd.bottom-upd.top+1);
+			}
+		    }
+		}
+#endif
 		enqEvent(ENQ_AT_END, ExposureMask, srcGcData->hWnd, __WM_NOGEXPOSE, 0, 0, 0, 0, 0);
 		RETURN ( self );
 	    }
@@ -6625,6 +6588,7 @@
 	int savedLStyle = gcData->lStyle;
 	int savedLWidth = gcData->lineWidth;
 
+#ifdef OLD
 	/*
 	 * a point is a point - no matter what lineWidth we have set before
 	 */
@@ -6649,16 +6613,22 @@
 	    GcDataReleasePen(hDC, gcData);
 	}
 
-#ifndef CACHE_LAST_DC
+# ifndef CACHE_LAST_DC
 	_releaseDC(gcData);
-#endif
+# endif
 	if ((gcData->lStyle != savedLStyle)
 	 || (gcData->lineWidth != savedLWidth)) {
 	    FLUSH_CACHED_DC(gcData);
 	    gcData->lStyle = savedLStyle;
 	    gcData->lineWidth = savedLWidth;
 	}
-
+#else
+	hDC = _getDC(gcData);
+	SetPixel(hDC, __x, __y, gcData->fgColor);
+# ifndef CACHE_LAST_DC
+	_releaseDC(gcData);
+# endif
+#endif
 	RETURN ( self );
     }
 %}
@@ -7173,7 +7143,7 @@
 
 		rct.left = __intVal(x);
 		rct.top = __intVal(y);
-		rct.right = rct.left + w + 1;
+		rct.right = rct.left + w + 1;    /* definitiv ! */
 		rct.bottom = rct.top + h + 1;
 
 		CPRINTF(("fillRectangle:%d.%d -> %d.%d\n",rct.left,rct.top,rct.right,rct.bottom));
@@ -7824,7 +7794,7 @@
 			SelectClipRgn(dc,0);
 			FillRect(dc, &rec, br);
 			if (mustDeleteBrush) {
-			    _DeleteObject(br, __LINE__);
+			    _DeleteBrush(br, __LINE__);
 			}
 		    }
 		    ReleaseDC(ev->ev_hWnd,dc);
@@ -8426,9 +8396,23 @@
 	} else{
 	    wWanted = 0;
 	}
-	if (deqEvent(ev, wWanted, evMask)) {
-	    RETURN ( true );
-	}
+	do { /* only to allow continue */
+	    if (deqEvent(ev, wWanted, evMask)) {
+		if ((ev->ev_hWnd == lastPos_win)
+		 && (ev->ev_message == WM_WINDOWPOSCHANGED)
+		 && ((ev->ev_arg1 != lastPos_x)
+		     || (ev->ev_arg2 != lastPos_y)
+		     || (ev->ev_arg3 != lastPos_w)
+		     || (ev->ev_arg4 != lastPos_h))) {
+		    /*
+		     * ignore resize 
+		     * (that event is an intermediate one)
+		     */
+		    continue;
+		}
+		RETURN ( true );
+	    }
+	} while (0);
     }
 %}.
     ^ false
@@ -11659,7 +11643,7 @@
 
 	if (oldBrush = GetWindow_viewBgBrush(hWnd)) {
 	    SetWindow_viewBgBrush(hWnd, 0);
-	    _DeleteObject(oldBrush, __LINE__);
+	    _DeleteBrush(oldBrush, __LINE__);
 	}
 	clr = st2RGB(__intVal(aColorIndex), 0);
 	SetWindow_viewBgColor(hWnd, clr);
@@ -11691,11 +11675,11 @@
 
 	if (oldBrush = GetWindow_viewBgBrush(hWnd)) {
 	    SetWindow_viewBgBrush(hWnd, 0);
-	    _DeleteObject(oldBrush, __LINE__);
+	    _DeleteBrush(oldBrush, __LINE__);
 	}
 	if (pixmap) {
 	    newBrush = CreatePatternBrush(pixmap);
-	    SetWindow_viewBgBrush(newBrush, 0);
+	    SetWindow_viewBgBrush(hWnd, newBrush);
 /*
  *            SetBrushOrgEx(hDC, gcData->maskOrgX, gcData->maskOrgY, 0);       
  */
@@ -11878,6 +11862,6 @@
 !WinWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.117 1999-05-06 19:59:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/WinWorkstation.st,v 1.118 1999-05-08 15:46:18 cg Exp $'
 ! !
 WinWorkstation initialize!