pasteFromClipboard goes via the sensor,
authorClaus Gittinger <cg@exept.de>
Thu, 13 Feb 1997 13:44:40 +0100
changeset 1341 026bdf39f4ea
parent 1340 f028f125f606
child 1342 d2bcd2e582aa
pasteFromClipboard goes via the sensor, to avoid blocking the event dispatcher
XWorkstat.st
XWorkstation.st
--- a/XWorkstat.st	Thu Feb 13 13:41:46 1997 +0100
+++ b/XWorkstat.st	Thu Feb 13 13:44:40 1997 +0100
@@ -1,6 +1,6 @@
 "
 COPYRIGHT (c) 1989 by Claus Gittinger
-	      All Rights Reserved
+              All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -11,17 +11,18 @@
 "
 
 DeviceWorkstation subclass:#XWorkstation
-	instanceVariableNames:'screen hasShapeExtension hasShmExtension hasDPSExtension
-		hasMbufExtension hasXVideoExtension hasSaveUnder hasPEXExtension
-		hasImageExtension hasInputExtension ignoreBackingStore blackpixel
-		whitepixel protocolsAtom deleteWindowAtom saveYourselfAtom
-		quitAppAtom primaryAtom secondaryAtom cutBuffer0Atom stringAtom
-		lengthAtom listOfXFonts buttonsPressed eventRootX eventRootY
-		displayName eventTrace dispatchingExpose rgbVisual virtualRootId
-		rootId eventBuffer altModifierMask metaModifierMask multiClickTime'
-	classVariableNames:'RawKeysymTranslation ConservativeSync'
-	poolDictionaries:''
-	category:'Interface-Graphics'
+        instanceVariableNames:'screen hasShapeExtension hasShmExtension hasDPSExtension
+                hasMbufExtension hasXVideoExtension hasSaveUnder hasPEXExtension
+                hasImageExtension hasInputExtension ignoreBackingStore blackpixel
+                whitepixel protocolsAtom deleteWindowAtom saveYourselfAtom
+                quitAppAtom primaryAtom secondaryAtom cutBuffer0Atom stringAtom
+                lengthAtom listOfXFonts buttonsPressed eventRootX eventRootY
+                displayName eventTrace dispatchingExpose rgbVisual virtualRootId
+                rootId eventBuffer altModifierMask metaModifierMask
+                multiClickTime'
+        classVariableNames:'RawKeysymTranslation ConservativeSync'
+        poolDictionaries:''
+        category:'Interface-Graphics'
 !
 
 !XWorkstation primitiveDefinitions!
@@ -180,23 +181,23 @@
 
 # define BEGIN_INTERRUPTSBLOCKED        \
     {                                   \
-	int needUnblock = 0;            \
-					\
-	__BEGIN_PROTECT_REGISTERS__     \
-	if (!__interruptsBlocked) {     \
-	    __BLOCKINTERRUPTS();        \
-	    needUnblock = 1;            \
-	}
+        int needUnblock = 0;            \
+                                        \
+        __BEGIN_PROTECT_REGISTERS__     \
+        if (!__interruptsBlocked) {     \
+            __BLOCKINTERRUPTS();        \
+            needUnblock = 1;            \
+        }
 
 # define END_INTERRUPTSBLOCKED_NOW      \
-	__END_PROTECT_REGISTERS__       \
-	if (needUnblock) {              \
-	    __UNBLOCKINTERRUPTS();      \
-	}                               \
+        __END_PROTECT_REGISTERS__       \
+        if (needUnblock) {              \
+            __UNBLOCKINTERRUPTS();      \
+        }                               \
     }
 
 # define END_INTERRUPTSBLOCKED          \
-	__END_PROTECT_REGISTERS__
+        __END_PROTECT_REGISTERS__
 
 #endif
 %}
@@ -226,18 +227,18 @@
 
 static
 dummyToForceLoading() {
-	XCreateSimpleWindow(0, 0, 0, 0, 0, 0, 0, 0, 0);
-	XCloseDisplay(0);
-	XCreateImage(0, 0, 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0);
-	XSetWindowColormap(0, 0, 0);
-	XQueryColors(0,0,0,0);
+        XCreateSimpleWindow(0, 0, 0, 0, 0, 0, 0, 0, 0);
+        XCloseDisplay(0);
+        XCreateImage(0, 0, 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0);
+        XSetWindowColormap(0, 0, 0);
+        XQueryColors(0,0,0,0);
 #ifdef SHM
-	XShmAttach(0, 0);
-	XShmCreateImage(0, 0, 0, 0, 0, 0, 0 ,0);
-	XShmDetach(0, 0);
-	XShmPutImage(0, 0, 0, 0 , 0,0,0,0,0,0,0);
-	shmctl(0,0,0);
-	fgetc(0);
+        XShmAttach(0, 0);
+        XShmCreateImage(0, 0, 0, 0, 0, 0, 0 ,0);
+        XShmDetach(0, 0);
+        XShmPutImage(0, 0, 0, 0 , 0,0,0,0,0,0,0);
+        shmctl(0,0,0);
+        fgetc(0);
 #endif
 }
 
@@ -258,25 +259,25 @@
     lastErrorMsg[79] = '\0';
 
     if (lastErrorMsg[0] == '\0') {
-	sprintf(lastErrorMsg, "code: %d", event->error_code);
+        sprintf(lastErrorMsg, "code: %d", event->error_code);
     }
     lastRequestCode = event->request_code;
     lastMinorCode = event->minor_code;
     lastResource = event->resourceid;
     if ((event->error_code == BadWindow) && (lastRequestCode == 4) && (lastMinorCode == 0)) {
-	/* 
-	 * this is a BadWindow error for X_DestroyWindow.
-	 * ignore it here, since it results from the GC freeing windows
-	 * in non bottom-up window order.
-	 */
-	return 0;
+        /* 
+         * this is a BadWindow error for X_DestroyWindow.
+         * ignore it here, since it results from the GC freeing windows
+         * in non bottom-up window order.
+         */
+        return 0;
     }
 
     if (@global(ErrorPrinting) == true) {
-	fprintf(stderr, "XWorkstation [error]: x-error cought maj=%d (0x%x) min=%d (0x%x) resource=%x\n",
-			event->request_code, event->request_code, 
-			event->minor_code, event->minor_code, event->resourceid);
-	fprintf(stderr, "XWorkstation [error]: x-error message is [%d] '%s'\n", event->error_code, lastErrorMsg);
+        fprintf(stderr, "XWorkstation [error]: x-error cought maj=%d (0x%x) min=%d (0x%x) resource=%x\n",
+                        event->request_code, event->request_code, 
+                        event->minor_code, event->minor_code, event->resourceid);
+        fprintf(stderr, "XWorkstation [error]: x-error message is [%d] '%s'\n", event->error_code, lastErrorMsg);
     }
 
     __errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy));
@@ -306,27 +307,27 @@
      */
 # if !defined(IRIS) || defined(IRIX5)
     if (XQueryTree(dpy, root, &rootReturn, &parentReturn, &children, &numChildren)) {
-	vRootAtom = XInternAtom(dpy, "__SWM_VROOT", True );
-	if (vRootAtom != None) {
-	    for (i=0; i < numChildren; i++) {
-		Atom actual_type;
-		int actual_format;
-		unsigned long nitems, bytesafter;
-		Window* newRoot = (Window*) 0;
-
-		if (children[i]) {
-		    if (XGetWindowProperty(dpy, children[i], vRootAtom,
-					   0L, 1L, False, XA_WINDOW,
-					   &actual_type, &actual_format, &nitems, &bytesafter,
-					   (unsigned char**) &newRoot) == Success && newRoot) {
-			root = *newRoot;
-			XFree(newRoot); /* XXX */
-			break;
-		    }
-		}
-	    }
-	}
-	if (children) XFree( children );
+        vRootAtom = XInternAtom(dpy, "__SWM_VROOT", True );
+        if (vRootAtom != None) {
+            for (i=0; i < numChildren; i++) {
+                Atom actual_type;
+                int actual_format;
+                unsigned long nitems, bytesafter;
+                Window* newRoot = (Window*) 0;
+
+                if (children[i]) {
+                    if (XGetWindowProperty(dpy, children[i], vRootAtom,
+                                           0L, 1L, False, XA_WINDOW,
+                                           &actual_type, &actual_format, &nitems, &bytesafter,
+                                           (unsigned char**) &newRoot) == Success && newRoot) {
+                        root = *newRoot;
+                        XFree(newRoot); /* XXX */
+                        break;
+                    }
+                }
+            }
+        }
+        if (children) XFree( children );
     }
 # endif
     return root;
@@ -340,7 +341,7 @@
 copyright
 "
 COPYRIGHT (c) 1989 by Claus Gittinger
-	      All Rights Reserved
+              All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -365,7 +366,7 @@
     See more documentation in my superclass, DeviceWorkstation.
 
     [author:]
-	Claus Gittinger
+        Claus Gittinger
 "
 ! !
 
@@ -377,17 +378,17 @@
     super initialize.
 
     RawKeysymTranslation isNil ifTrue:[
-	"/ the following table maps X-keyevents to ST/X
-	"/ device independed events. 
-	"/ It is NOT meant as a keyboardMap replacement.
-
-	RawKeysymTranslation := d := Dictionary new.
-	d at:'Delete_line' put:#DeleteLine.
-	d at:'Delete_word' put:#DeleteWord.
-	d at:'Down' put:#CursorDown.
-	d at:'Up' put:#CursorUp.
-	d at:'Left' put:#CursorLeft.
-	d at:'Right' put:#CursorRight.
+        "/ the following table maps X-keyevents to ST/X
+        "/ device independed events. 
+        "/ It is NOT meant as a keyboardMap replacement.
+
+        RawKeysymTranslation := d := Dictionary new.
+        d at:'Delete_line' put:#DeleteLine.
+        d at:'Delete_word' put:#DeleteWord.
+        d at:'Down' put:#CursorDown.
+        d at:'Up' put:#CursorUp.
+        d at:'Left' put:#CursorLeft.
+        d at:'Right' put:#CursorRight.
     ]
 ! !
 
@@ -404,8 +405,8 @@
 %{
 #ifdef COUNT_RESOURCES
     printf("colors %d bitmaps %d view %d gc %d cursor %d font %d\n",
-	    __cnt_color, __cnt_bitmap,
-	    __cnt_view, __cnt_gc, __cnt_cursor, __cnt_font);
+            __cnt_color, __cnt_bitmap,
+            __cnt_view, __cnt_gc, __cnt_cursor, __cnt_font);
 #endif
 %}
 !
@@ -431,12 +432,12 @@
     "
     s := '/usr/lib/X11/XErrorDB' asFilename readStream.
     s notNil ifTrue:[
-	match := 'XRequest.' , requestCode printString.
-	line := s peekForLineStartingWith:match.
-	line notNil ifTrue:[
-	    string := string , ' in ' , (line copyFrom:(line indexOf:$:)+1)
-	].
-	s close.
+        match := 'XRequest.' , requestCode printString.
+        line := s peekForLineStartingWith:match.
+        line notNil ifTrue:[
+            string := string , ' in ' , (line copyFrom:(line indexOf:$:)+1)
+        ].
+        s close.
     ].
     ^ string
 !
@@ -528,13 +529,13 @@
 
 %{  /* NOCONTEXT */
     if (aButton == __MKSMALLINT(1)) {
-	RETURN (__MKSMALLINT(Button1MotionMask));
+        RETURN (__MKSMALLINT(Button1MotionMask));
     }
     if (aButton == __MKSMALLINT(2)) {
-	RETURN (__MKSMALLINT(Button2MotionMask));
+        RETURN (__MKSMALLINT(Button2MotionMask));
     }
     if (aButton == __MKSMALLINT(3)) {
-	RETURN (__MKSMALLINT(Button3MotionMask));
+        RETURN (__MKSMALLINT(Button3MotionMask));
     }
 %}.
     ^ nil
@@ -553,9 +554,9 @@
 
 %{  /* NOCONTEXT */
     RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
-			 KeyPressMask | KeyReleaseMask |
-			 EnterWindowMask | LeaveWindowMask |
-			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
+                         KeyPressMask | KeyReleaseMask |
+                         EnterWindowMask | LeaveWindowMask |
+                         ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
 %}
 !
 
@@ -565,7 +566,7 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	RETURN ( __MKSMALLINT(ConnectionNumber(myDpy)) );
+        RETURN ( __MKSMALLINT(ConnectionNumber(myDpy)) );
     }
     RETURN (nil);
 %}
@@ -586,7 +587,7 @@
 
 %{  /* NOCONTEXT */
     if (ISCONNECTED) {
-	RETURN ( __MKSMALLINT(XProtocolVersion(myDpy)) );
+        RETURN ( __MKSMALLINT(XProtocolVersion(myDpy)) );
     }
     RETURN (nil);
 %}
@@ -602,7 +603,7 @@
      (to avoid bugs in certain implementations)"
 %{
     if (ISCONNECTED) {
-	RETURN ( __MKSTRING(XServerVendor(myDpy)) );
+        RETURN ( __MKSTRING(XServerVendor(myDpy)) );
     }
     RETURN (nil);
 %}
@@ -639,28 +640,28 @@
      && __isExternalAddress(windowId1)
      && __isExternalAddress(windowId2)
      && __bothSmallInteger(x1, y1)) {
-	Display *dpy = myDpy;
-
-	w1 = _WindowVal(windowId1);
-	w2 = _WindowVal(windowId2);
+        Display *dpy = myDpy;
+
+        w1 = _WindowVal(windowId1);
+        w2 = _WindowVal(windowId2);
 #ifdef VIRTUAL_ROOT
-	if ((w1 == RootWindow(dpy, screen))
-	 || (w2 == RootWindow(dpy, screen))) {
-	    if (w1 == RootWindow(dpy, screen)) {
-		w1 = getRootWindow(dpy, screen);
-	    }
-	    if (w2 == RootWindow(dpy, screen)) {
-		w2 = getRootWindow(dpy, screen);
-	    }
-	}
+        if ((w1 == RootWindow(dpy, screen))
+         || (w2 == RootWindow(dpy, screen))) {
+            if (w1 == RootWindow(dpy, screen)) {
+                w1 = getRootWindow(dpy, screen);
+            }
+            if (w2 == RootWindow(dpy, screen)) {
+                w2 = getRootWindow(dpy, screen);
+            }
+        }
 #endif
-	BEGIN_INTERRUPTSBLOCKED
-	XTranslateCoordinates(dpy, w1, w2,
-			      __intVal(x1), __intVal(y1), 
-			      &xpos, &ypos, &child_return);
-	END_INTERRUPTSBLOCKED
-	x2 = __MKSMALLINT(xpos);
-	y2 = __MKSMALLINT(ypos);
+        BEGIN_INTERRUPTSBLOCKED
+        XTranslateCoordinates(dpy, w1, w2,
+                              __intVal(x1), __intVal(y1), 
+                              &xpos, &ypos, &child_return);
+        END_INTERRUPTSBLOCKED
+        x2 = __MKSMALLINT(xpos);
+        y2 = __MKSMALLINT(ypos);
     }
 %}.
 
@@ -674,7 +675,7 @@
 
 %{  /* NOCONTEXT */
     if (ISCONNECTED) {
-	RETURN ( __MKSMALLINT(XVendorRelease(myDpy)) );
+        RETURN ( __MKSMALLINT(XVendorRelease(myDpy)) );
     }
     RETURN (nil);
 %}
@@ -700,29 +701,29 @@
     if (ISCONNECTED
      && __isExternalAddress(windowId)
      && __isPoint(aPoint)) {
-	Display *dpy = myDpy;
-
-	xp = _point_X(aPoint);
-	yp = _point_Y(aPoint);
-	if (__bothSmallInteger(xp, yp)) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XTranslateCoordinates(dpy,
-				  RootWindow(dpy, screen),
-				  _WindowVal(windowId),
-				  __intVal(xp), __intVal(yp), 
-				  &xpos, &ypos, &child_return);
-	    END_INTERRUPTSBLOCKED
-	    if (child_return) {
-		RETURN ( __MKOBJ(child_return) );
-	    }
-	    RETURN ( nil );
-	}
+        Display *dpy = myDpy;
+
+        xp = _point_X(aPoint);
+        yp = _point_Y(aPoint);
+        if (__bothSmallInteger(xp, yp)) {
+            BEGIN_INTERRUPTSBLOCKED
+            XTranslateCoordinates(dpy,
+                                  RootWindow(dpy, screen),
+                                  _WindowVal(windowId),
+                                  __intVal(xp), __intVal(yp), 
+                                  &xpos, &ypos, &child_return);
+            END_INTERRUPTSBLOCKED
+            if (child_return) {
+                RETURN ( __MKOBJ(child_return) );
+            }
+            RETURN ( nil );
+        }
     }
 %}.
     windowId notNil ifTrue:[
-	aPoint isPoint ifTrue:[
-	    ^ self viewIdFromPoint:aPoint asPoint truncated in:windowId
-	]
+        aPoint isPoint ifTrue:[
+            ^ self viewIdFromPoint:aPoint asPoint truncated in:windowId
+        ]
     ].
 
     ^ nil
@@ -738,17 +739,17 @@
     if (ISCONNECTED
      && (__INST(rootId) != __INST(virtualRootId)) 
      && __isExternalAddress(__INST(virtualRootId))) {
-	Window vRootWin;
-	Window root;
-	int x, y;
-	unsigned int width, height;
-	unsigned int dummy;
-
-	vRootWin = _WindowVal(__INST(virtualRootId));
-	if (XGetGeometry(myDpy, vRootWin, &root, &x, &y, &width, &height,
-					  &dummy, &dummy)) {
-	    RETURN ( __MKPOINT_INT(width, height) );
-	}
+        Window vRootWin;
+        Window root;
+        int x, y;
+        unsigned int width, height;
+        unsigned int dummy;
+
+        vRootWin = _WindowVal(__INST(virtualRootId));
+        if (XGetGeometry(myDpy, vRootWin, &root, &x, &y, &width, &height,
+                                          &dummy, &dummy)) {
+            RETURN ( __MKPOINT_INT(width, height) );
+        }
     }
 %}.
     ^ width @ height
@@ -784,9 +785,9 @@
     int dummy;
 
     if (__isString(extensionString) && ISCONNECTED) {
-	if (XQueryExtension(myDpy, __stringVal(extensionString), &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
+        if (XQueryExtension(myDpy, __stringVal(extensionString), &dummy, &dummy, &dummy)) {
+            RETURN ( true );
+        }
     }
 %}.
     ^ false
@@ -899,40 +900,40 @@
     int cnt;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (XGetIconSizes(myDpy, RootWindow(dpy, screen), &sizeList, &cnt) > 0) {
-	   xIconSizes = __MKEXTERNALBYTES(sizeList);
-	   count = __MKSMALLINT(cnt);
-	}
+        Display *dpy = myDpy;
+
+        if (XGetIconSizes(myDpy, RootWindow(dpy, screen), &sizeList, &cnt) > 0) {
+           xIconSizes = __MKEXTERNALBYTES(sizeList);
+           count = __MKSMALLINT(cnt);
+        }
     }
 %}.
     xIconSizes isNil ifTrue:[^ nil].
 
     ret := OrderedCollection new:count.
     1 to:count do:[ :i |
-	|minWidth minHeight maxWidth maxHeight widthStep heightStep d|
+        |minWidth minHeight maxWidth maxHeight widthStep heightStep d|
 
 %{
-	XIconSize *slp;
-
-	slp = &((XIconSize *)__externalBytesAddress(xIconSizes))[__intVal(i)-1];
-	minWidth = __MKSMALLINT(slp->min_width);
-	minHeight = __MKSMALLINT(slp->min_height);
-	maxWidth = __MKSMALLINT(slp->max_width);
-	maxHeight = __MKSMALLINT(slp->max_height);
-	widthStep = __MKSMALLINT(slp->width_inc);
-	heightStep = __MKSMALLINT(slp->height_inc);
+        XIconSize *slp;
+
+        slp = &((XIconSize *)__externalBytesAddress(xIconSizes))[__intVal(i)-1];
+        minWidth = __MKSMALLINT(slp->min_width);
+        minHeight = __MKSMALLINT(slp->min_height);
+        maxWidth = __MKSMALLINT(slp->max_width);
+        maxHeight = __MKSMALLINT(slp->max_height);
+        widthStep = __MKSMALLINT(slp->width_inc);
+        heightStep = __MKSMALLINT(slp->height_inc);
 %}.
-	d := IdentityDictionary new.
-	d at:#minWidth put:minWidth.
-	d at:#maxWidth put:maxWidth.
-	d at:#widthStep put:widthStep.
-	d at:#minHeight put:minHeight.
-	d at:#maxHeight put:maxHeight.
-	d at:#heightStep put:heightStep.
-
-	ret add:d
+        d := IdentityDictionary new.
+        d at:#minWidth put:minWidth.
+        d at:#maxWidth put:maxWidth.
+        d at:#widthStep put:widthStep.
+        d at:#minHeight put:minHeight.
+        d at:#maxHeight put:maxHeight.
+        d at:#heightStep put:heightStep.
+
+        ret add:d
     ].
 
     xIconSizes free.
@@ -956,7 +957,7 @@
      Redefined to return a special value on SGI servers."
 
     self serverVendor = 'Silicon Graphics' ifTrue:[
-	^ 86@68
+        ^ 86@68
     ].
     ^ super preferredIconSize
 
@@ -982,7 +983,7 @@
     Display *dpy;
 
     if (! ISCONNECTED) {
-	RETURN (nil);
+        RETURN (nil);
     }
 
     dpy = myDpy;
@@ -990,24 +991,24 @@
 %}.
     formatArray := Array new:nFormats.
     1 to:nFormats do:[:index |
-	|info bitsPerPixelInfo depthInfo paddingInfo i|
-
-	i := index.
+        |info bitsPerPixelInfo depthInfo paddingInfo i|
+
+        i := index.
 %{
-	ScreenFormat *format;
-	Display *dpy = myDpy;
-
-	format = DISPLAYACCESS(dpy)->pixmap_format;
-	format += (__intVal(i)-1);
-	bitsPerPixelInfo = __MKSMALLINT(format->bits_per_pixel);
-	depthInfo = __MKSMALLINT(format->depth);
-	paddingInfo = __MKSMALLINT(format->scanline_pad);
+        ScreenFormat *format;
+        Display *dpy = myDpy;
+
+        format = DISPLAYACCESS(dpy)->pixmap_format;
+        format += (__intVal(i)-1);
+        bitsPerPixelInfo = __MKSMALLINT(format->bits_per_pixel);
+        depthInfo = __MKSMALLINT(format->depth);
+        paddingInfo = __MKSMALLINT(format->scanline_pad);
 %}.
-	info := IdentityDictionary new.
-	info at:#depth put:depthInfo.
-	info at:#bitsPerPixel put:bitsPerPixelInfo.
-	info at:#padding put:paddingInfo.
-	formatArray at:index put:info.
+        info := IdentityDictionary new.
+        info at:#depth put:depthInfo.
+        info at:#bitsPerPixel put:bitsPerPixelInfo.
+        info at:#padding put:paddingInfo.
+        formatArray at:index put:info.
     ].
     ^ formatArray
 
@@ -1045,7 +1046,7 @@
 
     bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
     bitmapId isNil ifTrue:[
-	self primitiveFailed
+        self primitiveFailed
     ].
     ^ bitmapId
 !
@@ -1062,30 +1063,30 @@
     int status;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isString(aString) || __isSymbol(aString)) {
-	    filename = (char *)_stringVal(aString);
-
-	    BEGIN_INTERRUPTSBLOCKED
-	    status = XReadBitmapFile(dpy, RootWindow(dpy, screen),
-				     filename, &b_width, &b_height, &newBitmap,
-				     &b_x_hot, &b_y_hot);
-	    END_INTERRUPTSBLOCKED
-
-	    if ((status == BitmapSuccess)  && newBitmap) {
+        Display *dpy = myDpy;
+
+        if (__isString(aString) || __isSymbol(aString)) {
+            filename = (char *)_stringVal(aString);
+
+            BEGIN_INTERRUPTSBLOCKED
+            status = XReadBitmapFile(dpy, RootWindow(dpy, screen),
+                                     filename, &b_width, &b_height, &newBitmap,
+                                     &b_x_hot, &b_y_hot);
+            END_INTERRUPTSBLOCKED
+
+            if ((status == BitmapSuccess)  && newBitmap) {
 #ifdef COUNT_RESOURCES
-		__cnt_bitmap++;
+                __cnt_bitmap++;
 #endif
-		w = __MKSMALLINT(b_width);
-		h = __MKSMALLINT(b_height);
-		id = __MKOBJ(newBitmap);
-	    }
-	}
+                w = __MKSMALLINT(b_width);
+                h = __MKSMALLINT(b_height);
+                id = __MKOBJ(newBitmap);
+            }
+        }
     }
 %}.
     id notNil ifTrue:[
-	aForm setWidth:w height:h
+        aForm setWidth:w height:h
     ].
     ^ id
 !
@@ -1100,17 +1101,17 @@
     Pixmap newBitmap;
 
     if (__bothSmallInteger(w, h) && ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
-	newBitmap = XCreatePixmap(dpy, RootWindow(dpy, screen),
-				       __intVal(w), __intVal(h), 1);
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
+        newBitmap = XCreatePixmap(dpy, RootWindow(dpy, screen),
+                                       __intVal(w), __intVal(h), 1);
 #ifdef COUNT_RESOURCES
-	if (newBitmap)
-	    __cnt_bitmap++;
+        if (newBitmap)
+            __cnt_bitmap++;
 #endif
-	END_INTERRUPTSBLOCKED
-	RETURN ( (newBitmap != (Pixmap)0) ? __MKOBJ(newBitmap) : nil );
+        END_INTERRUPTSBLOCKED
+        RETURN ( (newBitmap != (Pixmap)0) ? __MKOBJ(newBitmap) : nil );
     }
 %}
 .
@@ -1128,17 +1129,17 @@
     Pixmap newBitmap;
 
     if (__bothSmallInteger(w, h) && ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
-	newBitmap = XCreatePixmap(dpy, RootWindow(dpy, screen),
-				       __intVal(w), __intVal(h), __intVal(d));
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
+        newBitmap = XCreatePixmap(dpy, RootWindow(dpy, screen),
+                                       __intVal(w), __intVal(h), __intVal(d));
 #ifdef COUNT_RESOURCES
-	if (newBitmap)
-	    __cnt_bitmap++;
+        if (newBitmap)
+            __cnt_bitmap++;
 #endif
-	END_INTERRUPTSBLOCKED
-	RETURN ( (newBitmap != (Pixmap)0) ? __MKOBJ(newBitmap) : nil );
+        END_INTERRUPTSBLOCKED
+        RETURN ( (newBitmap != (Pixmap)0) ? __MKOBJ(newBitmap) : nil );
     }
 %}
 .
@@ -1150,36 +1151,36 @@
     "will vanish - for compatibility with previous versions"
 
     ^ self 
-	  createWindowFor:aView 
-	  origin:(xpos @ ypos)
-	  extent:(wwidth @ wheight)
-	  minExtent:(aView minExtent)
-	  maxExtent:(aView maxExtent)
-	  borderWidth:(aView borderWidth)
-	  subViewOf:(aView superView)
-	  onTop:(aView isPopUpView)
-	  inputOnly:(aView isInputOnly)
-	  label:(aView label)
-	  cursor:(aView cursor)
-	  icon:(aView icon)
-	  iconView:(aView iconView)
+          createWindowFor:aView 
+          origin:(xpos @ ypos)
+          extent:(wwidth @ wheight)
+          minExtent:(aView minExtent)
+          maxExtent:(aView maxExtent)
+          borderWidth:(aView borderWidth)
+          subViewOf:(aView superView)
+          onTop:(aView isPopUpView)
+          inputOnly:(aView isInputOnly)
+          label:(aView label)
+          cursor:(aView cursor)
+          icon:(aView icon)
+          iconView:(aView iconView)
 
     "Modified: 1.6.1996 / 13:22:48 / cg"
 !
 
 createWindowFor:aView
-		 origin:origin
-		 extent:extent
-		 minExtent:minExt 
-		 maxExtent:maxExt
-		 borderWidth:bWidth
-		 subViewOf:wsuperView
-		 onTop:wisPopUpView
-		 inputOnly:winputOnly
-		 label:wlabel
-		 cursor:wcursor
-		 icon:wicon
-		 iconView:wiconView
+                 origin:origin
+                 extent:extent
+                 minExtent:minExt 
+                 maxExtent:maxExt
+                 borderWidth:bWidth
+                 subViewOf:wsuperView
+                 onTop:wisPopUpView
+                 inputOnly:winputOnly
+                 label:wlabel
+                 cursor:wcursor
+                 icon:wicon
+                 iconView:wiconView
 
     |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight 
      bColorId wsuperViewId wcursorId wiconId windowId
@@ -1187,45 +1188,45 @@
      vBgForm deepForm preferredVisual preferredDepth|
 
     displayId isNil ifTrue:[
-	self primitiveFailed.
-	^ nil
+        self primitiveFailed.
+        ^ nil
     ].
 
     origin notNil ifTrue:[
-	xpos := origin x.
-	ypos := origin y.
+        xpos := origin x.
+        ypos := origin y.
     ] ifFalse:[
-	xpos := ypos := 0.
+        xpos := ypos := 0.
     ].
     extent notNil ifTrue:[
-	wwidth := extent x.
-	wheight := extent y.
+        wwidth := extent x.
+        wheight := extent y.
     ] ifFalse:[
-	wwidth := wheight := 100.
+        wwidth := wheight := 100.
     ].
     minExt notNil ifTrue:[
-	minWidth := minExt x.
-	minHeight := minExt y
+        minWidth := minExt x.
+        minHeight := minExt y
     ].
     maxExt notNil ifTrue:[
-	maxWidth := maxExt x.
-	maxHeight := maxExt y
+        maxWidth := maxExt x.
+        maxHeight := maxExt y
     ].
 
     wsuperView notNil ifTrue:[
-	wsuperViewId := wsuperView id
+        wsuperViewId := wsuperView id
     ].
     wcursor isNil ifTrue:[
-	'XWorkstation [info]: cursor nil - defaulted' infoPrintCR
+        'XWorkstation [info]: cursor nil - defaulted' infoPrintCR
     ] ifFalse:[
-	wcursorId := wcursor id
+        wcursorId := wcursor id
     ].
 
     wicon notNil ifTrue:[
-	wiconId := wicon id
+        wiconId := wicon id
     ].
     wiconView notNil ifTrue:[
-	wiconViewId := wiconView id
+        wiconViewId := wiconView id
     ].
     weventMask := aView eventMask.
 
@@ -1259,119 +1260,119 @@
     sizehints.y = 0;
 
     if (__bothSmallInteger(wwidth, wheight)) {
-	sizehints.flags |= PSize;
-	sizehints.width = __intVal(wwidth);
-	sizehints.height = __intVal(wheight);
+        sizehints.flags |= PSize;
+        sizehints.width = __intVal(wwidth);
+        sizehints.height = __intVal(wheight);
     }
     if (__bothSmallInteger(xpos, ypos)) {
-	sizehints.flags |= PPosition;
-	sizehints.x = __intVal(xpos);
-	sizehints.y = __intVal(ypos);
+        sizehints.flags |= PPosition;
+        sizehints.x = __intVal(xpos);
+        sizehints.y = __intVal(ypos);
     }
     if (__bothSmallInteger(minWidth, minHeight)) {
-	sizehints.flags |= PMinSize;
-	sizehints.min_width = __intVal(minWidth);
-	sizehints.min_height = __intVal(minHeight);
+        sizehints.flags |= PMinSize;
+        sizehints.min_width = __intVal(minWidth);
+        sizehints.min_height = __intVal(minHeight);
     }
     if (__bothSmallInteger(maxWidth, maxHeight)) {
-	sizehints.flags |= PMaxSize;
-	sizehints.max_width = __intVal(maxWidth);
-	sizehints.max_height = __intVal(maxHeight);
+        sizehints.flags |= PMaxSize;
+        sizehints.max_width = __intVal(maxWidth);
+        sizehints.max_height = __intVal(maxHeight);
     }
 
     bg = WhitePixel(dpy, screen);
 
     if (__isSmallInteger(bWidth)) {
-	bw = __intVal(bWidth);
+        bw = __intVal(bWidth);
     } else {
-	bw = 0;
+        bw = 0;
     }
 
     bd = BlackPixel(dpy, screen);
 
     if (__isExternalAddress(wsuperViewId)) {
-	parentWindow = _WindowVal(wsuperViewId);
+        parentWindow = _WindowVal(wsuperViewId);
     } else {
-	parentWindow = RootWindow(dpy, screen);
-	isTopWindow = 1;
+        parentWindow = RootWindow(dpy, screen);
+        isTopWindow = 1;
     }
 
     if (wisPopUpView == true)
-	xswa.override_redirect = 1;
+        xswa.override_redirect = 1;
     else 
-	xswa.override_redirect = 0;
+        xswa.override_redirect = 0;
 
     if (winputOnly == true) 
-	ioClass = InputOnly;
+        ioClass = InputOnly;
     else 
-	ioClass = InputOutput;
+        ioClass = InputOutput;
 
     if (__isSmallInteger(weventMask)) {
-	xswa.event_mask = __intVal(weventMask);
+        xswa.event_mask = __intVal(weventMask);
     } else {
-	xswa.event_mask = 0;
+        xswa.event_mask = 0;
     }
 
     if (ioClass == InputOnly) {
-	bw = 0;
-	depth = 0;
-	flags |= CWEventMask;
+        bw = 0;
+        depth = 0;
+        flags |= CWEventMask;
     } else {
-	depth = DefaultDepth(dpy,screen);
-	flags |= CWEventMask | CWBorderPixel | CWOverrideRedirect;
-
-	if (backPixmap != (Pixmap)0) {
-	    xswa.background_pixmap = backPixmap;
-	    flags |= CWBackPixmap;
-	} else {
-	    xswa.background_pixel = bg;
-	    flags |= CWBackPixel;
-	}
-	xswa.border_pixel = bd;
+        depth = DefaultDepth(dpy,screen);
+        flags |= CWEventMask | CWBorderPixel | CWOverrideRedirect;
+
+        if (backPixmap != (Pixmap)0) {
+            xswa.background_pixmap = backPixmap;
+            flags |= CWBackPixmap;
+        } else {
+            xswa.background_pixel = bg;
+            flags |= CWBackPixel;
+        }
+        xswa.border_pixel = bd;
     }
 
     visual.visualid = CopyFromParent;
     if (__isSmallInteger(preferredDepth)) {
-	depth = __intVal(preferredDepth);
+        depth = __intVal(preferredDepth);
     }
 
     BEGIN_INTERRUPTSBLOCKED
     if (preferredVisual != nil) {
-	XVisualInfo vi;
-	int cls;
-
-	if (preferredVisual == @symbol(StaticGray))
-	    cls = StaticGray;
-	else if (preferredVisual == @symbol(GrayScale)) 
-	    cls = GrayScale;
-	else if (preferredVisual == @symbol(StaticColor)) 
-	    cls = StaticColor;
-	else if (preferredVisual == @symbol(PseudoColor)) 
-	    cls = PseudoColor;
-	else if (preferredVisual == @symbol(TrueColor)) 
-	    cls = TrueColor;
-	else if (preferredVisual == @symbol(DirectColor)) 
-	    cls = DirectColor;
-	else
-	    cls = PseudoColor;
-
-	if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
-	    visual.visualid = vi.visualid;
+        XVisualInfo vi;
+        int cls;
+
+        if (preferredVisual == @symbol(StaticGray))
+            cls = StaticGray;
+        else if (preferredVisual == @symbol(GrayScale)) 
+            cls = GrayScale;
+        else if (preferredVisual == @symbol(StaticColor)) 
+            cls = StaticColor;
+        else if (preferredVisual == @symbol(PseudoColor)) 
+            cls = PseudoColor;
+        else if (preferredVisual == @symbol(TrueColor)) 
+            cls = TrueColor;
+        else if (preferredVisual == @symbol(DirectColor)) 
+            cls = DirectColor;
+        else
+            cls = PseudoColor;
+
+        if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
+            visual.visualid = vi.visualid;
 /*
-	    printf("visualId=%x\n", vi.visualid);
+            printf("visualId=%x\n", vi.visualid);
 */
-	}
+        }
     }
 
     newWindow = XCreateWindow(dpy, parentWindow,
-			   sizehints.x, sizehints.y,
-			   sizehints.width, sizehints.height,
-			   bw, depth, ioClass, &visual,
-			   flags, &xswa);
+                           sizehints.x, sizehints.y,
+                           sizehints.width, sizehints.height,
+                           bw, depth, ioClass, &visual,
+                           flags, &xswa);
     END_INTERRUPTSBLOCKED
 
     if (! newWindow) {
-	RETURN ( nil );
+        RETURN ( nil );
     }
 
 #ifdef COUNT_RESOURCES
@@ -1383,7 +1384,7 @@
      * define its cursor
      */
     if (__isExternalAddress(wcursorId)) {
-	XDefineCursor(dpy, newWindow, _CursorVal(wcursorId));
+        XDefineCursor(dpy, newWindow, _CursorVal(wcursorId));
     }
 
     /*
@@ -1391,87 +1392,87 @@
      * (only makes sense for topWindows)
      */
     if (isTopWindow) {
-	if (__isExternalAddress(wiconId))
-	    iconBitmap = _PixmapVal(wiconId);
-	else
-	    iconBitmap = (Pixmap)0;
-
-	if (__isExternalAddress(wiconViewId))
-	    iconWindow = _WindowVal(wiconViewId);
-	else
-	    iconWindow = (Window)0;
-
-	if (__isString(wlabel) || __isSymbol(wlabel))
-	    windowName = (char *)_stringVal(wlabel);
-	else
-	    windowName = "";
-
-	if (iconBitmap || windowName) {
-	    XSetStandardProperties(dpy, newWindow,
-					windowName, windowName,
-					iconBitmap,
-					0, 0, &sizehints);
-
-	}
-
-	wmhints.flags = 0;
-	if (iconBitmap) {
-	    wmhints.flags |= IconPixmapHint;
-	    wmhints.icon_pixmap = iconBitmap;
-	}
-	if (iconWindow) {
-	    wmhints.flags |= IconWindowHint;
-	    wmhints.icon_window = iconWindow;
-	}
+        if (__isExternalAddress(wiconId))
+            iconBitmap = _PixmapVal(wiconId);
+        else
+            iconBitmap = (Pixmap)0;
+
+        if (__isExternalAddress(wiconViewId))
+            iconWindow = _WindowVal(wiconViewId);
+        else
+            iconWindow = (Window)0;
+
+        if (__isString(wlabel) || __isSymbol(wlabel))
+            windowName = (char *)_stringVal(wlabel);
+        else
+            windowName = "";
+
+        if (iconBitmap || windowName) {
+            XSetStandardProperties(dpy, newWindow,
+                                        windowName, windowName,
+                                        iconBitmap,
+                                        0, 0, &sizehints);
+
+        }
+
+        wmhints.flags = 0;
+        if (iconBitmap) {
+            wmhints.flags |= IconPixmapHint;
+            wmhints.icon_pixmap = iconBitmap;
+        }
+        if (iconWindow) {
+            wmhints.flags |= IconWindowHint;
+            wmhints.icon_window = iconWindow;
+        }
 /*
-	wmhints.flags |= InputHint;
-	wmhints.input = True;
+        wmhints.flags |= InputHint;
+        wmhints.input = True;
 */
-	XSetWMHints(dpy, newWindow, &wmhints);
-
-	/*
-	 * tell window manager to not kill us but send an event instead
-	 */
-	/*
-	 * get atoms first (if not already known)
-	 */
-	if (__INST(protocolsAtom) == nil) {
-	    WmProtocolsAtom = XInternAtom(dpy, "WM_PROTOCOLS", False);
-	    __INST(protocolsAtom) = __MKATOMOBJ(WmProtocolsAtom);
+        XSetWMHints(dpy, newWindow, &wmhints);
+
+        /*
+         * tell window manager to not kill us but send an event instead
+         */
+        /*
+         * get atoms first (if not already known)
+         */
+        if (__INST(protocolsAtom) == nil) {
+            WmProtocolsAtom = XInternAtom(dpy, "WM_PROTOCOLS", False);
+            __INST(protocolsAtom) = __MKATOMOBJ(WmProtocolsAtom);
 #ifdef USE_SAVEYOURSELF_ATOM
-	    WmSaveYourselfAtom = XInternAtom(dpy, "WM_SAVE_YOURSELF", False);
-	    __INST(saveYourselfAtom) = __MKATOMOBJ(WmSaveYourselfAtom);
+            WmSaveYourselfAtom = XInternAtom(dpy, "WM_SAVE_YOURSELF", False);
+            __INST(saveYourselfAtom) = __MKATOMOBJ(WmSaveYourselfAtom);
 #endif
 #ifdef USE_QUIT_APP_ATOM
-	    WmQuitAppAtom = XInternAtom(dpy, "_WM_QUIT_APP", False);
-	    __INST(quitAppAtom) = __MKATOMOBJ(WmQuitAppAtom);
+            WmQuitAppAtom = XInternAtom(dpy, "_WM_QUIT_APP", False);
+            __INST(quitAppAtom) = __MKATOMOBJ(WmQuitAppAtom);
 #endif
-	    WmDeleteWindowAtom = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
-	    __INST(deleteWindowAtom) = __MKATOMOBJ(WmDeleteWindowAtom);
-	} else {
+            WmDeleteWindowAtom = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+            __INST(deleteWindowAtom) = __MKATOMOBJ(WmDeleteWindowAtom);
+        } else {
 #ifdef USE_QUIT_APP_ATOM
-	    WmQuitAppAtom = _AtomVal(__INST(quitAppAtom));
+            WmQuitAppAtom = _AtomVal(__INST(quitAppAtom));
 #else
-	    WmQuitAppAtom = 0;
+            WmQuitAppAtom = 0;
 #endif
-	    WmProtocolsAtom = _AtomVal(__INST(protocolsAtom));
-	    WmDeleteWindowAtom = _AtomVal(__INST(deleteWindowAtom));
+            WmProtocolsAtom = _AtomVal(__INST(protocolsAtom));
+            WmDeleteWindowAtom = _AtomVal(__INST(deleteWindowAtom));
 #ifdef USE_SAVEYOURSELF_ATOM
-	    WmSaveYourselfAtom = _AtomVal(__INST(saveYourselfAtom));
+            WmSaveYourselfAtom = _AtomVal(__INST(saveYourselfAtom));
 #else
-	    WmSaveYourselfAtom = 0;
+            WmSaveYourselfAtom = 0;
 #endif
-	}
-
-	atoms[0] = WmDeleteWindowAtom; atomCount++;
+        }
+
+        atoms[0] = WmDeleteWindowAtom; atomCount++;
 #ifdef USE_SAVEYOURSELF_ATOM
-	atoms[atomCount] = WmSaveYourselfAtom; atomCount++;
+        atoms[atomCount] = WmSaveYourselfAtom; atomCount++;
 #endif
 #ifdef USE_QUIT_APP_ATOM
-	atoms[atomCount] = WmQuitAppAtom; atomCount++;
+        atoms[atomCount] = WmQuitAppAtom; atomCount++;
 #endif
-	XChangeProperty(dpy, newWindow, WmProtocolsAtom, XA_ATOM,
-			32, PropModeReplace, (unsigned char *)atoms, atomCount);
+        XChangeProperty(dpy, newWindow, WmProtocolsAtom, XA_ATOM,
+                        32, PropModeReplace, (unsigned char *)atoms, atomCount);
     }
 
     END_INTERRUPTSBLOCKED
@@ -1487,21 +1488,21 @@
 %{  /* NOCONTEXT */
 
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aGCId)) {
-	GC gc = _GCVal(aGCId);
-
-	if (gc) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XFreeGC(myDpy, gc);
+        GC gc = _GCVal(aGCId);
+
+        if (gc) {
+            BEGIN_INTERRUPTSBLOCKED
+            XFreeGC(myDpy, gc);
 #ifdef COUNT_RESOURCES
-	    __cnt_gc--;
+            __cnt_gc--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	}
-	RETURN ( self );
+            END_INTERRUPTSBLOCKED
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -1512,21 +1513,21 @@
 %{  /* NOCONTEXT */
 
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aDrawableId)) {
-	Pixmap pix = _PixmapVal(aDrawableId);
-
-	if (pix) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XFreePixmap(myDpy, pix);
+        Pixmap pix = _PixmapVal(aDrawableId);
+
+        if (pix) {
+            BEGIN_INTERRUPTSBLOCKED
+            XFreePixmap(myDpy, pix);
 #ifdef COUNT_RESOURCES
-	    __cnt_bitmap--;
+            __cnt_bitmap--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	}
-	RETURN ( self );
+            END_INTERRUPTSBLOCKED
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -1535,20 +1536,20 @@
 destroyView:aView withId:aWindowId
 %{
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aWindowId)) {
-	Window win = _WindowVal(aWindowId);
-
-	if (win) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XDestroyWindow(myDpy, win);
+        Window win = _WindowVal(aWindowId);
+
+        if (win) {
+            BEGIN_INTERRUPTSBLOCKED
+            XDestroyWindow(myDpy, win);
 #ifdef COUNT_RESOURCES
-	    __cnt_view--;
+            __cnt_view--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	}
+            END_INTERRUPTSBLOCKED
+        }
     }
 %}.
     self removeKnownView:aView
@@ -1565,15 +1566,15 @@
     if (__isExternalAddress(aDrawableId)
      && __isExternalAddress(aGCId)
      && ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	dps = XDPSCreateContext(myDpy, (Drawable)_WindowVal(aDrawableId),
-				       _GCVal(aGCId),
-				       0, height, 0, colormap, NULL, 0,
-				       XDPSDefaultTextBackstop,
-				       XDPSDefaultErrorProc,
-				       NULL);
-	END_INTERRUPTSBLOCKED
-	RETURN ( dps ? __MKOBJ(dps) : nil );
+        BEGIN_INTERRUPTSBLOCKED
+        dps = XDPSCreateContext(myDpy, (Drawable)_WindowVal(aDrawableId),
+                                       _GCVal(aGCId),
+                                       0, height, 0, colormap, NULL, 0,
+                                       XDPSDefaultTextBackstop,
+                                       XDPSDefaultErrorProc,
+                                       NULL);
+        END_INTERRUPTSBLOCKED
+        RETURN ( dps ? __MKOBJ(dps) : nil );
     }
 #endif
 %}
@@ -1589,17 +1590,17 @@
     GC gc;
 
     if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	gc = XCreateGC(myDpy, (Drawable)_WindowVal(aDrawableId),
-			      0L, (XGCValues *)0);
+        BEGIN_INTERRUPTSBLOCKED
+        gc = XCreateGC(myDpy, (Drawable)_WindowVal(aDrawableId),
+                              0L, (XGCValues *)0);
 
 #ifdef COUNT_RESOURCES
-	if (gc)
-	    __cnt_gc++;
+        if (gc)
+            __cnt_gc++;
 #endif
 
-	END_INTERRUPTSBLOCKED
-	RETURN ( gc ? __MKOBJ(gc) : nil );
+        END_INTERRUPTSBLOCKED
+        RETURN ( gc ? __MKOBJ(gc) : nil );
     }
 %}.
     self primitiveFailed.
@@ -1614,17 +1615,17 @@
     GC gc;
 
     if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	gc = XCreateGC(myDpy, (Drawable)_WindowVal(aDrawableId),
-			      0L, (XGCValues *)0);
+        BEGIN_INTERRUPTSBLOCKED
+        gc = XCreateGC(myDpy, (Drawable)_WindowVal(aDrawableId),
+                              0L, (XGCValues *)0);
 
 #ifdef COUNT_RESOURCES
-	if (gc)
-	    __cnt_gc++;
+        if (gc)
+            __cnt_gc++;
 #endif
 
-	END_INTERRUPTSBLOCKED
-	RETURN ( gc ? __MKOBJ(gc) : nil );
+        END_INTERRUPTSBLOCKED
+        RETURN ( gc ? __MKOBJ(gc) : nil );
     }
 %}.
     self primitiveFailed.
@@ -1653,75 +1654,75 @@
     int bytesPerRow;
 
     if (! ISCONNECTED) {
-	RETURN (nil);
+        RETURN (nil);
     }
 
     dpy = myDpy;
     if (firstCall) {
-	for (index=0; index < 256; index++) {
-	    reverseBitTable[index] = 0;
-	    if (index & 128) reverseBitTable[index] |=   1;
-	    if (index &  64) reverseBitTable[index] |=   2;
-	    if (index &  32) reverseBitTable[index] |=   4;
-	    if (index &  16) reverseBitTable[index] |=   8;
-	    if (index &   8) reverseBitTable[index] |=  16;
-	    if (index &   4) reverseBitTable[index] |=  32;
-	    if (index &   2) reverseBitTable[index] |=  64;
-	    if (index &   1) reverseBitTable[index] |= 128;
-	}
-	firstCall = 0;
+        for (index=0; index < 256; index++) {
+            reverseBitTable[index] = 0;
+            if (index & 128) reverseBitTable[index] |=   1;
+            if (index &  64) reverseBitTable[index] |=   2;
+            if (index &  32) reverseBitTable[index] |=   4;
+            if (index &  16) reverseBitTable[index] |=   8;
+            if (index &   8) reverseBitTable[index] |=  16;
+            if (index &   4) reverseBitTable[index] |=  32;
+            if (index &   2) reverseBitTable[index] |=  64;
+            if (index &   1) reverseBitTable[index] |= 128;
+        }
+        firstCall = 0;
     }
 
     if (__bothSmallInteger(w, h) && _isNonNilObject(anArray)) {
-	newBitmap = (Pixmap)0;
-	b_width = __intVal(w);
-	b_height = __intVal(h);
-	bytesPerRow = (b_width + 7) / 8;
-	nBytes = b_height * bytesPerRow;
-	if (nBytes < sizeof(fastBits)) {
-	    cp = b_bits = fastBits;
-	    allocatedBits = 0;
-	} else {
-	    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
-	    if (! cp) goto fail;
-	}
-
-	if (__qClass(anArray) == @global(Array)) {
-	    index = 1;
-	    op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
-	    for (row = b_height; row; row--) {
-		for (col = bytesPerRow; col; col--) {
-		    num = *op++;
-		    if (! __isSmallInteger(num)) goto fail;
-		    bits = __intVal(num);
-		    *cp++ = reverseBitTable[bits];
-		}
-	    }
-	} else {
-	    if (__qClass(anArray) == @global(ByteArray)) {
-		pBits = __ByteArrayInstPtr(anArray)->ba_element;
-		for (col = b_height*bytesPerRow; col; col--) {
-		    *cp++ = reverseBitTable[*pBits++];
-		}
-	    } else {
-		goto fail;
-	    }
-	}
-
-	BEGIN_INTERRUPTSBLOCKED
-	newBitmap = XCreateBitmapFromData(dpy, RootWindow(dpy, screen),
-					       (char *)b_bits, 
-					       b_width, b_height);
+        newBitmap = (Pixmap)0;
+        b_width = __intVal(w);
+        b_height = __intVal(h);
+        bytesPerRow = (b_width + 7) / 8;
+        nBytes = b_height * bytesPerRow;
+        if (nBytes < sizeof(fastBits)) {
+            cp = b_bits = fastBits;
+            allocatedBits = 0;
+        } else {
+            cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
+            if (! cp) goto fail;
+        }
+
+        if (__qClass(anArray) == @global(Array)) {
+            index = 1;
+            op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
+            for (row = b_height; row; row--) {
+                for (col = bytesPerRow; col; col--) {
+                    num = *op++;
+                    if (! __isSmallInteger(num)) goto fail;
+                    bits = __intVal(num);
+                    *cp++ = reverseBitTable[bits];
+                }
+            }
+        } else {
+            if (__qClass(anArray) == @global(ByteArray)) {
+                pBits = __ByteArrayInstPtr(anArray)->ba_element;
+                for (col = b_height*bytesPerRow; col; col--) {
+                    *cp++ = reverseBitTable[*pBits++];
+                }
+            } else {
+                goto fail;
+            }
+        }
+
+        BEGIN_INTERRUPTSBLOCKED
+        newBitmap = XCreateBitmapFromData(dpy, RootWindow(dpy, screen),
+                                               (char *)b_bits, 
+                                               b_width, b_height);
 #ifdef COUNT_RESOURCES
-	if (newBitmap)
-	    __cnt_bitmap++;
+        if (newBitmap)
+            __cnt_bitmap++;
 #endif
 
-	END_INTERRUPTSBLOCKED
+        END_INTERRUPTSBLOCKED
 fail: ;
-	if (allocatedBits)
-	    free(allocatedBits);
-	RETURN ( newBitmap ? __MKOBJ(newBitmap) : nil );
+        if (allocatedBits)
+            free(allocatedBits);
+        RETURN ( newBitmap ? __MKOBJ(newBitmap) : nil );
     }
 %}
 !
@@ -1751,17 +1752,17 @@
     OBJ id;
 
     if (__INST(rootId) != nil) {
-	RETURN (__INST(rootId));
+        RETURN (__INST(rootId));
     }
 
     if (ISCONNECTED) {
-	root = RootWindow(myDpy, screen);
-	if (! root) {
-	    id = nil;
-	} else {
-	    __INST(rootId) = id = __MKOBJ(root); __STORE(self, id);
-	}
-	RETURN (id);
+        root = RootWindow(myDpy, screen);
+        if (! root) {
+            id = nil;
+        } else {
+            __INST(rootId) = id = __MKOBJ(root); __STORE(self, id);
+        }
+        RETURN (id);
     }
 %}.
     self primitiveFailed
@@ -1788,66 +1789,66 @@
     OBJ id;
 
     if (__INST(virtualRootId) != nil) {
-	RETURN (__INST(virtualRootId));
+        RETURN (__INST(virtualRootId));
     }
 
     if (ISCONNECTED) {
-	vRootWin = rootWin = RootWindow(myDpy, screen);
+        vRootWin = rootWin = RootWindow(myDpy, screen);
 #ifndef IRIS
-	BEGIN_INTERRUPTSBLOCKED
-	/*
-	 * on IRIS, this creates a badwindow error - why ?
-	 * children contains a funny window (000034)
-	 */
-
-	/*
-	 * care for virtual root windows (tvtwm & friends)
-	 */
-	{
-	    Atom vRootAtom = None;
-	    int i;
-	    Window rootReturn, parentReturn;
-	    Window* children = (Window *)0;
-	    unsigned int numChildren;
-
-	    if (XQueryTree(myDpy, rootWin, 
-			   &rootReturn, &parentReturn, 
-			   &children, &numChildren)) {
-		vRootAtom = XInternAtom(myDpy, "__SWM_VROOT", True );
-		if (vRootAtom != None) {
-		    for (i=0; i < numChildren; i++) {
-			Atom actual_type;
-			int actual_format;
-			unsigned long nitems, bytesafter;
-			Window* newRoot = (Window*) 0;
-
-			if (children[i]) {
-			    if (XGetWindowProperty(myDpy, children[i], vRootAtom, 
-						     0L, 1L, False, XA_WINDOW,
-						     &actual_type, &actual_format, 
-						     &nitems, &bytesafter,
-						     (unsigned char**) &newRoot
-						   ) == Success && newRoot) {
-				vRootWin = *newRoot;
-				XFree(newRoot); /* XXX */
-				break;
-			    }
-			}
-		    }
-		}
-		if (children) XFree( children );
-	    }
-	}
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        /*
+         * on IRIS, this creates a badwindow error - why ?
+         * children contains a funny window (000034)
+         */
+
+        /*
+         * care for virtual root windows (tvtwm & friends)
+         */
+        {
+            Atom vRootAtom = None;
+            int i;
+            Window rootReturn, parentReturn;
+            Window* children = (Window *)0;
+            unsigned int numChildren;
+
+            if (XQueryTree(myDpy, rootWin, 
+                           &rootReturn, &parentReturn, 
+                           &children, &numChildren)) {
+                vRootAtom = XInternAtom(myDpy, "__SWM_VROOT", True );
+                if (vRootAtom != None) {
+                    for (i=0; i < numChildren; i++) {
+                        Atom actual_type;
+                        int actual_format;
+                        unsigned long nitems, bytesafter;
+                        Window* newRoot = (Window*) 0;
+
+                        if (children[i]) {
+                            if (XGetWindowProperty(myDpy, children[i], vRootAtom, 
+                                                     0L, 1L, False, XA_WINDOW,
+                                                     &actual_type, &actual_format, 
+                                                     &nitems, &bytesafter,
+                                                     (unsigned char**) &newRoot
+                                                   ) == Success && newRoot) {
+                                vRootWin = *newRoot;
+                                XFree(newRoot); /* XXX */
+                                break;
+                            }
+                        }
+                    }
+                }
+                if (children) XFree( children );
+            }
+        }
+        END_INTERRUPTSBLOCKED
 #endif
     }
 
     /* cannot happen */
     if (! vRootWin) {
-	vRootWin = rootWin;
-	if (! rootWin) {
-	    RETURN ( nil );
-	}
+        vRootWin = rootWin;
+        if (! rootWin) {
+            RETURN ( nil );
+        }
     }
     __INST(rootId) = id = __MKOBJ(rootWin); __STORE(self, id);
     __INST(virtualRootId) = id = __MKOBJ(vRootWin); __STORE(self, id);
@@ -1869,18 +1870,18 @@
     Status ok;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
-	ok = XAllocColorCells(dpy, DefaultColormap(dpy, screen), (Bool)0,
-				   &dummy, 0, &color.pixel, 1);
-	END_INTERRUPTSBLOCKED
-	if (ok) {
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
+        ok = XAllocColorCells(dpy, DefaultColormap(dpy, screen), (Bool)0,
+                                   &dummy, 0, &color.pixel, 1);
+        END_INTERRUPTSBLOCKED
+        if (ok) {
 #ifdef COUNT_RESOURCES
-	    __cnt_color++;
+            __cnt_color++;
 #endif
-	    RETURN ( __MKSMALLINT(color.pixel) );
-	}
+            RETURN ( __MKSMALLINT(color.pixel) );
+        }
     }
 %}.
     ^ nil
@@ -1899,33 +1900,33 @@
     Status ok;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isString(aString) || __isSymbol(aString)) {
-	    colorname = (char *)_stringVal(aString);
-
-	    BEGIN_INTERRUPTSBLOCKED
-	    ok = XParseColor(dpy, DefaultColormap(dpy, screen), colorname, &ecolor);
-	    if (ok) {
+        Display *dpy = myDpy;
+
+        if (__isString(aString) || __isSymbol(aString)) {
+            colorname = (char *)_stringVal(aString);
+
+            BEGIN_INTERRUPTSBLOCKED
+            ok = XParseColor(dpy, DefaultColormap(dpy, screen), colorname, &ecolor);
+            if (ok) {
 #ifdef QUICK_TRUE_COLORS
-		if (__INST(visualType) == @symbol(TrueColor)) {
-		    id = ((ecolor.red >> (16 - __intVal(__INST(bitsRed)))) << __intVal(__INST(redShift))) & __intVal(__INST(redMask));
-		    id += ((ecolor.green >> (16 - __intVal(__INST(bitsGreen)))) << __intVal(__INST(greenShift))) & __intVal(__INST(greenMask));
-		    id += ((ecolor.blue >> (16 - __intVal(__INST(bitsBlue)))) << __intVal(__INST(blueShift))) & __intVal(__INST(blueMask));
-		    RETURN ( __MKSMALLINT(id) );
-		}
+                if (__INST(visualType) == @symbol(TrueColor)) {
+                    id = ((ecolor.red >> (16 - __intVal(__INST(bitsRed)))) << __intVal(__INST(redShift))) & __intVal(__INST(redMask));
+                    id += ((ecolor.green >> (16 - __intVal(__INST(bitsGreen)))) << __intVal(__INST(greenShift))) & __intVal(__INST(greenMask));
+                    id += ((ecolor.blue >> (16 - __intVal(__INST(bitsBlue)))) << __intVal(__INST(blueShift))) & __intVal(__INST(blueMask));
+                    RETURN ( __MKSMALLINT(id) );
+                }
 #endif
-		ok = XAllocColor(dpy, DefaultColormap(dpy, screen), &ecolor);
-	    }
-	    END_INTERRUPTSBLOCKED
-	    if (! ok) {
-		RETURN ( nil );
-	    }
+                ok = XAllocColor(dpy, DefaultColormap(dpy, screen), &ecolor);
+            }
+            END_INTERRUPTSBLOCKED
+            if (! ok) {
+                RETURN ( nil );
+            }
 #ifdef COUNT_RESOURCES
-	    __cnt_color++;
+            __cnt_color++;
 #endif
-	    RETURN ( __MKSMALLINT(ecolor.pixel) );
-	}
+            RETURN ( __MKSMALLINT(ecolor.pixel) );
+        }
     }
 %}.
     self primitiveFailed.
@@ -1956,28 +1957,28 @@
     if (__bothSmallInteger(r, g) 
      && __isSmallInteger(b)
      && ISCONNECTED) {
-	ecolor.red = __intVal(r);
-	ecolor.green= __intVal(g);
-	ecolor.blue = __intVal(b);
+        ecolor.red = __intVal(r);
+        ecolor.green= __intVal(g);
+        ecolor.blue = __intVal(b);
 #ifdef QUICK_TRUE_COLORS
-	if (__INST(visualType) == @symbol(TrueColor)) {
-	    id = ((ecolor.red >> (16 - __intVal(__INST(bitsRed)))) << __intVal(__INST(redShift))) & __intVal(__INST(redMask));
-	    id += ((ecolor.green >> (16 - __intVal(__INST(bitsGreen)))) << __intVal(__INST(greenShift))) & __intVal(__INST(greenMask));
-	    id += ((ecolor.blue >> (16 - __intVal(__INST(bitsBlue)))) << __intVal(__INST(blueShift))) & __intVal(__INST(blueMask));
-	    RETURN ( __MKSMALLINT(id) );
-	}
+        if (__INST(visualType) == @symbol(TrueColor)) {
+            id = ((ecolor.red >> (16 - __intVal(__INST(bitsRed)))) << __intVal(__INST(redShift))) & __intVal(__INST(redMask));
+            id += ((ecolor.green >> (16 - __intVal(__INST(bitsGreen)))) << __intVal(__INST(greenShift))) & __intVal(__INST(greenMask));
+            id += ((ecolor.blue >> (16 - __intVal(__INST(bitsBlue)))) << __intVal(__INST(blueShift))) & __intVal(__INST(blueMask));
+            RETURN ( __MKSMALLINT(id) );
+        }
 #endif
-	dpy = myDpy;
-	BEGIN_INTERRUPTSBLOCKED
-	ok = XAllocColor(dpy, DefaultColormap(dpy, screen), &ecolor);
-	END_INTERRUPTSBLOCKED
-	if (! ok) {
-	    RETURN ( nil );
-	}
+        dpy = myDpy;
+        BEGIN_INTERRUPTSBLOCKED
+        ok = XAllocColor(dpy, DefaultColormap(dpy, screen), &ecolor);
+        END_INTERRUPTSBLOCKED
+        if (! ok) {
+            RETURN ( nil );
+        }
 #ifdef COUNT_RESOURCES
-	__cnt_color++;
+        __cnt_color++;
 #endif
-	RETURN ( __MKSMALLINT(ecolor.pixel) );
+        RETURN ( __MKSMALLINT(ecolor.pixel) );
     }
 %}.
     self primitiveFailed.
@@ -1995,25 +1996,25 @@
 
 #ifdef QUICK_TRUE_COLORS
     if (__INST(visualType) == @symbol(TrueColor)) {
-	/* no need to do anything on TrueColor displays ... */
-	RETURN (self);
+        /* no need to do anything on TrueColor displays ... */
+        RETURN (self);
     }
 #endif
 
     if (! ISCONNECTED) {
-	RETURN (self);
+        RETURN (self);
     }
 
     if (__isSmallInteger(colorIndex)) {
-	dpy = myDpy;
-	color = (long) __intVal(colorIndex);
-	BEGIN_INTERRUPTSBLOCKED
-	XFreeColors(dpy, DefaultColormap(dpy, screen), &color, 1, 0L);
+        dpy = myDpy;
+        color = (long) __intVal(colorIndex);
+        BEGIN_INTERRUPTSBLOCKED
+        XFreeColors(dpy, DefaultColormap(dpy, screen), &color, 1, 0L);
 #ifdef COUNT_RESOURCES
-	__cnt_color--;
+        __cnt_color--;
 #endif
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -2026,10 +2027,10 @@
     |val|
 
     self getScaledRGBFrom:index into:[:r :g :b |
-	val := aBlock 
-		value:(r * 100.0 / 16rFFFF)
-		value:(g * 100.0 / 16rFFFF)
-		value:(b * 100.0 / 16rFFFF)
+        val := aBlock 
+                value:(r * 100.0 / 16rFFFF)
+                value:(g * 100.0 / 16rFFFF)
+                value:(b * 100.0 / 16rFFFF)
     ].
     ^ val
 !
@@ -2040,13 +2041,13 @@
     |val|
 
     self getScaledRGBFromName:colorName into:[:r :g :b |
-	r isNil ifTrue:[
-	    ^ super getRGBFromName:colorName into:aBlock
-	].
-	val := aBlock 
-	    value:(r * 100.0 / 16rFFFF)
-	    value:(g * 100.0 / 16rFFFF)
-	    value:(b * 100.0 / 16rFFFF)
+        r isNil ifTrue:[
+            ^ super getRGBFromName:colorName into:aBlock
+        ].
+        val := aBlock 
+            value:(r * 100.0 / 16rFFFF)
+            value:(g * 100.0 / 16rFFFF)
+            value:(b * 100.0 / 16rFFFF)
     ].
     ^ val
 
@@ -2066,29 +2067,29 @@
 
     if (ISCONNECTED
      && __isSmallInteger(index)) {
-	Display *dpy = myDpy;
-
-	color.pixel = __intVal(index);
-	BEGIN_INTERRUPTSBLOCKED
-	XQueryColor(dpy, DefaultColormap(dpy, screen), &color);
-	END_INTERRUPTSBLOCKED
-
-	/* 
-	 * have to compensate for an error in X ?, which does not scale
-	 * colors correctly if lesser than 16bits are valid in a color,
-	 * (for example, color white on a 4bitsPerRGB server will return
-	 * (16rF000 16rF000 16rF000) instead of (16rFFFF 16rFFFF 16rFFFF)
-	 */
-	bits = __intVal(__INST(bitsPerRGB));
-	scale = (1<<bits) - 1;
-	shift = 16 - bits;
-
-	sr = ((double)(color.red>>shift) / scale) * 0xFFFF;
-	sg = ((double)(color.green>>shift) / scale) * 0xFFFF;
-	sb = ((double)(color.blue>>shift) / scale) * 0xFFFF;
-	r = __MKSMALLINT(sr);
-	g = __MKSMALLINT(sg);
-	b = __MKSMALLINT(sb);
+        Display *dpy = myDpy;
+
+        color.pixel = __intVal(index);
+        BEGIN_INTERRUPTSBLOCKED
+        XQueryColor(dpy, DefaultColormap(dpy, screen), &color);
+        END_INTERRUPTSBLOCKED
+
+        /* 
+         * have to compensate for an error in X ?, which does not scale
+         * colors correctly if lesser than 16bits are valid in a color,
+         * (for example, color white on a 4bitsPerRGB server will return
+         * (16rF000 16rF000 16rF000) instead of (16rFFFF 16rFFFF 16rFFFF)
+         */
+        bits = __intVal(__INST(bitsPerRGB));
+        scale = (1<<bits) - 1;
+        shift = 16 - bits;
+
+        sr = ((double)(color.red>>shift) / scale) * 0xFFFF;
+        sg = ((double)(color.green>>shift) / scale) * 0xFFFF;
+        sb = ((double)(color.blue>>shift) / scale) * 0xFFFF;
+        r = __MKSMALLINT(sr);
+        g = __MKSMALLINT(sg);
+        b = __MKSMALLINT(sb);
     }
 %}.
     ^ aBlock value:r value:g value:b
@@ -2101,8 +2102,8 @@
     |r g b|
 
     displayId isNil ifTrue:[
-	self pimitiveFailed.
-	^ nil
+        self pimitiveFailed.
+        ^ nil
     ].
 %{
     int screen = __intVal(__INST(screen));
@@ -2113,29 +2114,29 @@
 
     if (ISCONNECTED
      && __isString(colorName) || __isSymbol(colorName)) {
-	Display *dpy = myDpy;
+        Display *dpy = myDpy;
         
-	BEGIN_INTERRUPTSBLOCKED
-	if (XParseColor(dpy, DefaultColormap(dpy, screen), 
-			     (char *)_stringVal(colorName), &color)) {
-	    /* 
-	     * have to compensate for an error in X ?, which does not scale
-	     * colors correctly if lesser than 16bits are valid in a color,
-	     * (for example, color white on a 4bitsPerRGB server will return
-	     * (16rF000 16rF000 16rF000) instead of (16rFFFF 16rFFFF 16rFFFF)
-	     */
-	    bits = __intVal(__INST(bitsPerRGB));
-	    scale = (1<<bits) - 1;
-	    shift = 16 - bits;
-
-	    sr = ((double)(color.red>>shift) / scale) * 0xFFFF;
-	    sg = ((double)(color.green>>shift) / scale) * 0xFFFF;
-	    sb = ((double)(color.blue>>shift) / scale) * 0xFFFF;
-	    r = __MKSMALLINT(sr);
-	    g = __MKSMALLINT(sg);
-	    b = __MKSMALLINT(sb);
-	}
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        if (XParseColor(dpy, DefaultColormap(dpy, screen), 
+                             (char *)_stringVal(colorName), &color)) {
+            /* 
+             * have to compensate for an error in X ?, which does not scale
+             * colors correctly if lesser than 16bits are valid in a color,
+             * (for example, color white on a 4bitsPerRGB server will return
+             * (16rF000 16rF000 16rF000) instead of (16rFFFF 16rFFFF 16rFFFF)
+             */
+            bits = __intVal(__INST(bitsPerRGB));
+            scale = (1<<bits) - 1;
+            shift = 16 - bits;
+
+            sr = ((double)(color.red>>shift) / scale) * 0xFFFF;
+            sg = ((double)(color.green>>shift) / scale) * 0xFFFF;
+            sb = ((double)(color.blue>>shift) / scale) * 0xFFFF;
+            r = __MKSMALLINT(sr);
+            g = __MKSMALLINT(sg);
+            b = __MKSMALLINT(sb);
+        }
+        END_INTERRUPTSBLOCKED
     }
 %}.
     ^ aBlock value:r value:g value:b
@@ -2152,22 +2153,22 @@
     aStream isNil ifTrue:[^ nil].
     list := OrderedCollection new.
     [aStream atEnd] whileFalse:[
-	line := aStream nextLine.
-	line notNil ifTrue:[
-	    "skip the r/g/b numbers"
-	    index := 1.
-	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
-	    [(line at:index) isDigit] whileTrue:[index := index + 1].
-	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
-	    [(line at:index) isDigit] whileTrue:[index := index + 1].
-	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
-	    [(line at:index) isDigit] whileTrue:[index := index + 1].
-	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
-	    colorName := line copyFrom:index.
-	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
-		list add:colorName
-	    ]
-	]
+        line := aStream nextLine.
+        line notNil ifTrue:[
+            "skip the r/g/b numbers"
+            index := 1.
+            [(line at:index) isSeparator] whileTrue:[index := index + 1].
+            [(line at:index) isDigit] whileTrue:[index := index + 1].
+            [(line at:index) isSeparator] whileTrue:[index := index + 1].
+            [(line at:index) isDigit] whileTrue:[index := index + 1].
+            [(line at:index) isSeparator] whileTrue:[index := index + 1].
+            [(line at:index) isDigit] whileTrue:[index := index + 1].
+            [(line at:index) isSeparator] whileTrue:[index := index + 1].
+            colorName := line copyFrom:index.
+            ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
+                list add:colorName
+            ]
+        ]
     ].
     aStream close.
     ^ list sort
@@ -2186,10 +2187,10 @@
 %{  /* NOCONTEXT */
 
     if (__isSmallInteger(aPercentage)) {
-	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
+        RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
     }
     if (__isFloat(aPercentage)) {
-	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
+        RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
     }
 %}.
     ^ (16rFFFF * aPercentage / 100) rounded
@@ -2208,31 +2209,31 @@
     int ok = 1;
 
     if (__isSmallInteger(sred))
-	r = __intVal(sred);
+        r = __intVal(sred);
     else ok = 0;
 
     if (__isSmallInteger(sgreen))
-	g = __intVal(sgreen);
+        g = __intVal(sgreen);
     else ok = 0;
 
     if (__isSmallInteger(sblue))
-	b = __intVal(sblue);
+        b = __intVal(sblue);
     else ok = 0;
 
     if (ISCONNECTED
      && __isSmallInteger(index) && ok) {
-	Display *dpy = myDpy;
-
-	color.pixel = __intVal(index);
-	color.red = r;
-	color.green = g;
-	color.blue = b;
-	color.flags = DoRed | DoGreen | DoBlue;
-
-	BEGIN_INTERRUPTSBLOCKED
-	XStoreColor(dpy, DefaultColormap(dpy, screen), &color);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        Display *dpy = myDpy;
+
+        color.pixel = __intVal(index);
+        color.red = r;
+        color.green = g;
+        color.blue = b;
+        color.flags = DoRed | DoGreen | DoBlue;
+
+        BEGIN_INTERRUPTSBLOCKED
+        XStoreColor(dpy, DefaultColormap(dpy, screen), &color);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -2260,16 +2261,16 @@
      && __bothSmallInteger(bgR, bgG) 
      && __bothSmallInteger(bgB, fgR)) {
 
-	fgcolor.red = __intVal(fgR);
-	fgcolor.green= __intVal(fgG);
-	fgcolor.blue = __intVal(fgB);
-	bgcolor.red = __intVal(bgR);
-	bgcolor.green= __intVal(bgG);
-	bgcolor.blue = __intVal(bgB);
-	BEGIN_INTERRUPTSBLOCKED
-	XRecolorCursor(myDpy, _CursorVal(aCursorId), &fgcolor, &bgcolor);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        fgcolor.red = __intVal(fgR);
+        fgcolor.green= __intVal(fgG);
+        fgcolor.blue = __intVal(fgB);
+        bgcolor.red = __intVal(bgR);
+        bgcolor.green= __intVal(bgG);
+        bgcolor.blue = __intVal(bgB);
+        BEGIN_INTERRUPTSBLOCKED
+        XRecolorCursor(myDpy, _CursorVal(aCursorId), &fgcolor, &bgcolor);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -2283,8 +2284,8 @@
     |number id|
 
     displayId isNil ifTrue:[
-	self primitiveFailed.
-	^ nil
+        self primitiveFailed.
+        ^ nil
     ].
     number := self shapeNumberFromSymbol:aShape.
 %{
@@ -2292,16 +2293,16 @@
 
     if (ISCONNECTED
      && __isSmallInteger(number)) {
-	BEGIN_INTERRUPTSBLOCKED
-	newCursor = XCreateFontCursor(myDpy, __intVal(number));
+        BEGIN_INTERRUPTSBLOCKED
+        newCursor = XCreateFontCursor(myDpy, __intVal(number));
 #ifdef COUNT_RESOURCES
-	if (newCursor)
-	    __cnt_cursor++;
+        if (newCursor)
+            __cnt_cursor++;
 #endif
-	END_INTERRUPTSBLOCKED
-	if (newCursor != (Cursor)0) {
-	    id = __MKOBJ(newCursor);
-	}
+        END_INTERRUPTSBLOCKED
+        if (newCursor != (Cursor)0) {
+            id = __MKOBJ(newCursor);
+        }
     }
 %}.
     ^ id
@@ -2313,8 +2314,8 @@
     |id sourceId maskId|
 
     displayId isNil ifTrue:[
-	self primitiveFailed.
-	^ nil
+        self primitiveFailed.
+        ^ nil
     ].
     sourceId := sourceForm id.
     maskId := maskForm id.
@@ -2326,26 +2327,26 @@
      && __isExternalAddress(sourceId)
      && __isExternalAddress(maskId)
      && __bothSmallInteger(hx, hy)) {
-	fgColor.red = 0;        /* fg is black */
-	fgColor.green = 0;
-	fgColor.blue = 0;
-	bgColor.red = 0xFFFF;   /* bg is white */
-	bgColor.green = 0xFFFF;
-	bgColor.blue = 0xFFFF;
-
-	BEGIN_INTERRUPTSBLOCKED
-	newCursor = XCreatePixmapCursor(myDpy,
-				_PixmapVal(sourceId),
-				_PixmapVal(maskId),
-				&fgColor, &bgColor, __intVal(hx), __intVal(hy));
+        fgColor.red = 0;        /* fg is black */
+        fgColor.green = 0;
+        fgColor.blue = 0;
+        bgColor.red = 0xFFFF;   /* bg is white */
+        bgColor.green = 0xFFFF;
+        bgColor.blue = 0xFFFF;
+
+        BEGIN_INTERRUPTSBLOCKED
+        newCursor = XCreatePixmapCursor(myDpy,
+                                _PixmapVal(sourceId),
+                                _PixmapVal(maskId),
+                                &fgColor, &bgColor, __intVal(hx), __intVal(hy));
 #ifdef COUNT_RESOURCES
-	if (newCursor)
-	    __cnt_cursor++;
+        if (newCursor)
+            __cnt_cursor++;
 #endif
-	END_INTERRUPTSBLOCKED
-	if (newCursor != (Cursor)0) {
-	    id = __MKOBJ(newCursor);
-	}
+        END_INTERRUPTSBLOCKED
+        if (newCursor != (Cursor)0) {
+            id = __MKOBJ(newCursor);
+        }
     }
 %}.
     ^ id
@@ -2357,21 +2358,21 @@
 %{  /* NOCONTEXT */
 
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aCursorId)) {
-	Cursor curs = _CursorVal(aCursorId);
-
-	if (curs) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XFreeCursor(myDpy, curs);
+        Cursor curs = _CursorVal(aCursorId);
+
+        if (curs) {
+            BEGIN_INTERRUPTSBLOCKED
+            XFreeCursor(myDpy, curs);
 #ifdef COUNT_RESOURCES
-	    __cnt_cursor--;
+            __cnt_cursor--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	}
-	RETURN ( self );
+            END_INTERRUPTSBLOCKED
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -2436,14 +2437,14 @@
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(srcX, srcY)
      && __bothSmallInteger(dstX, dstY)) {
-	gc = _GCVal(dstGCId);
-	source = (Drawable) _WindowVal(sourceId);
-	dest = (Drawable) _WindowVal(destId);
-	XCopyArea(myDpy, source, dest, gc,
-				 __intVal(srcX), __intVal(srcY),
-				__intVal(w), __intVal(h),
-				__intVal(dstX), __intVal(dstY));
-	RETURN ( self );
+        gc = _GCVal(dstGCId);
+        source = (Drawable) _WindowVal(sourceId);
+        dest = (Drawable) _WindowVal(destId);
+        XCopyArea(myDpy, source, dest, gc,
+                                 __intVal(srcX), __intVal(srcY),
+                                __intVal(w), __intVal(h),
+                                __intVal(dstX), __intVal(dstY));
+        RETURN ( self );
     }
 %}.
     "badGC, bad sourceDrawableId or destDrawableID
@@ -2471,17 +2472,17 @@
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(srcX, srcY)
      && __bothSmallInteger(dstX, dstY)) {
-	Display *dpy = myDpy;
+        Display *dpy = myDpy;
 
         gc = _GCVal(dstGCId);
         source = (Drawable) _WindowVal(sourceId);
         dest = (Drawable) _WindowVal(destId);
-	XSetGraphicsExposures(dpy, gc, 0);
+        XSetGraphicsExposures(dpy, gc, 0);
         XCopyArea(dpy, source, dest, gc,
                                 __intVal(srcX), __intVal(srcY),
                                 __intVal(w), __intVal(h),
                                 __intVal(dstX), __intVal(dstY));
-	XSetGraphicsExposures(dpy, gc, 1);
+        XSetGraphicsExposures(dpy, gc, 1);
         RETURN ( self );
     }
 %}.
@@ -2510,14 +2511,14 @@
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(srcX, srcY)
      && __bothSmallInteger(dstX, dstY)) {
-	gc = _GCVal(dstGCId);
-	source = (Drawable) _WindowVal(sourceId);
-	dest = (Drawable) _WindowVal(destId);
-	XCopyPlane(myDpy, source, dest, gc,
-				 __intVal(srcX), __intVal(srcY),
-				 __intVal(w), __intVal(h),
-				 __intVal(dstX), __intVal(dstY), 1);
-	RETURN ( self );
+        gc = _GCVal(dstGCId);
+        source = (Drawable) _WindowVal(sourceId);
+        dest = (Drawable) _WindowVal(destId);
+        XCopyPlane(myDpy, source, dest, gc,
+                                 __intVal(srcX), __intVal(srcY),
+                                 __intVal(w), __intVal(h),
+                                 __intVal(dstX), __intVal(dstY), 1);
+        RETURN ( self );
     }
 %}.
     "badGC, bad sourceDrawableId or destDrawableID
@@ -2546,17 +2547,17 @@
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(srcX, srcY)
      && __bothSmallInteger(dstX, dstY)) {
-	Display *dpy = myDpy;
+        Display *dpy = myDpy;
 
         gc = _GCVal(dstGCId);
         source = (Drawable) _WindowVal(sourceId);
         dest = (Drawable) _WindowVal(destId);
-	XSetGraphicsExposures(dpy, gc, 0);
+        XSetGraphicsExposures(dpy, gc, 0);
         XCopyPlane(dpy, source, dest, gc,
                                  __intVal(srcX), __intVal(srcY),
                                  __intVal(w), __intVal(h),
                                  __intVal(dstX), __intVal(dstY), 1);
-	XSetGraphicsExposures(dpy, gc, 1);
+        XSetGraphicsExposures(dpy, gc, 1);
         RETURN ( self );
     }
 %}.
@@ -2578,34 +2579,34 @@
     double f;
 
     if (__isSmallInteger(startAngle))
-	angle1 = __intVal(startAngle) * 64;
+        angle1 = __intVal(startAngle) * 64;
     else if (__isFloat(startAngle)) {
-	f = __floatVal(startAngle);
-	angle1 = f * 64;
+        f = __floatVal(startAngle);
+        angle1 = f * 64;
     }
     if (__isSmallInteger(angle))
-	angle2 = __intVal(angle) * 64;
+        angle2 = __intVal(angle) * 64;
     else if (__isFloat(angle)) {
-	f = __floatVal(angle);
-	angle2 = f * 64;
+        f = __floatVal(angle);
+        angle2 = f * 64;
     }
     if (ISCONNECTED
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)
      && __bothSmallInteger(width, height)) {
-	win = _WindowVal(aDrawableId);
-	gc = _GCVal(aGCId);
-	w = __intVal(width);
-	h = __intVal(height);
-	/*
-	 * need this check here: some servers simply dump core with bad args
-	 */
-	if ((w >= 0) && (h >= 0) && (angle1 >= 0) && (angle2 >= 0)) {
-	    XDrawArc(myDpy, win, gc, __intVal(x), __intVal(y),
-				   w, h, angle1, angle2);
-	}
-	RETURN ( self );
+        win = _WindowVal(aDrawableId);
+        gc = _GCVal(aGCId);
+        w = __intVal(width);
+        h = __intVal(height);
+        /*
+         * need this check here: some servers simply dump core with bad args
+         */
+        if ((w >= 0) && (h >= 0) && (angle1 >= 0) && (angle2 >= 0)) {
+            XDrawArc(myDpy, win, gc, __intVal(x), __intVal(y),
+                                   w, h, angle1, angle2);
+        }
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -2625,11 +2626,11 @@
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x0, y0)
      && __bothSmallInteger(x1, y1)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	XDrawLine(myDpy, win, gc, __intVal(x0), __intVal(y0),
-				  __intVal(x1), __intVal(y1));
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        XDrawLine(myDpy, win, gc, __intVal(x0), __intVal(y0),
+                                  __intVal(x1), __intVal(y1));
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -2648,10 +2649,10 @@
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	XDrawPoint(myDpy, win, gc, __intVal(x), __intVal(y));
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        XDrawPoint(myDpy, win, gc, __intVal(x), __intVal(y));
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or x/y not integer"
@@ -2679,37 +2680,37 @@
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __isSmallInteger(numberOfPoints)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	num = __intVal(numberOfPoints);
-	/*
-	 * avoid a (slow) malloc, if the number of points is small
-	 */
-	if (num > 100) {
-	    points = (XPoint *)malloc(sizeof(XPoint) * num);
-	    if (! points) goto fail;
-	    mustFree = 1;
-	} else
-	    points = qPoints;
-
-	for (i=0; i<num; i++) {
-	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
-	    if (! __isPoint(point)) goto fail;
-	    x = _point_X(point);
-	    y = _point_Y(point);
-	    if (! __bothSmallInteger(x, y))
-		goto fail;
-	    points[i].x = __intVal(x);
-	    points[i].y = __intVal(y);
-	}
-	XDrawLines(myDpy, win, gc, points, num, CoordModeOrigin);
-	if (mustFree)
-	    free(points);
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        num = __intVal(numberOfPoints);
+        /*
+         * avoid a (slow) malloc, if the number of points is small
+         */
+        if (num > 100) {
+            points = (XPoint *)malloc(sizeof(XPoint) * num);
+            if (! points) goto fail;
+            mustFree = 1;
+        } else
+            points = qPoints;
+
+        for (i=0; i<num; i++) {
+            point = __AT_(aPolygon, __MKSMALLINT(i+1));
+            if (! __isPoint(point)) goto fail;
+            x = _point_X(point);
+            y = _point_Y(point);
+            if (! __bothSmallInteger(x, y))
+                goto fail;
+            points[i].x = __intVal(x);
+            points[i].y = __intVal(y);
+        }
+        XDrawLines(myDpy, win, gc, points, num, CoordModeOrigin);
+        if (mustFree)
+            free(points);
+        RETURN ( self );
     }
 fail: ;
     if (mustFree)
-	free(points);
+        free(points);
 %}.
     "badGC, badDrawable or coordinates not integer"
     self primitiveFailed
@@ -2729,17 +2730,17 @@
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)
      && __bothSmallInteger(width, height)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	w = __intVal(width);
-	h = __intVal(height);
-	/*
-	 * need this check here: some servers simply dump core with bad args
-	 */
-	if ((w >= 0) && (h >= 0)) {
-	    XDrawRectangle(myDpy, win, gc, __intVal(x), __intVal(y), w, h);
-	}
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        w = __intVal(width);
+        h = __intVal(height);
+        /*
+         * need this check here: some servers simply dump core with bad args
+         */
+        if ((w >= 0) && (h >= 0)) {
+            XDrawRectangle(myDpy, win, gc, __intVal(x), __intVal(y), w, h);
+        }
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -2768,100 +2769,100 @@
      && __isNonNilObject(aString)
      && __bothSmallInteger(index1, index2)
      && __bothSmallInteger(x, y)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	cls = __qClass(aString);
-
-	i1 = __intVal(index1) - 1;
-	if (i1 >= 0) {
-	    i2 = __intVal(index2) - 1;
-	    if (i2 < i1) {
-		RETURN (self);
-	    }
-
-	    cp = _stringVal(aString);
-	    l = i2 - i1 + 1;
-
-	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
-		n = _stringSize(aString);
-		if (i2 < n) {
-		    cp += i1;
-		    if (l > 1000) l = 1000;
-		    if (opaque == true)
-			XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
-		    else
-			XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
-		    RETURN ( self );
-		}
-	    }
-
-	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-	    cp += nInstBytes;
-
-	    if (__isBytes(aString)) {
-		n = __byteArraySize(aString) - nInstBytes - 1;
-
-		if (i2 < n) {
-		    cp += i1;
-		    if (l > 1000) l = 1000;
-		    if (opaque == true)
-			XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
-		    else
-			XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
-		    RETURN ( self );
-		}
-	    }
-
-	    /* TWOBYTESTRINGS */
-	    if (__isWords(aString)) {
-		n = (__byteArraySize(aString) - nInstBytes) / 2;
-
-		if (i2 < n) {
-		    union {
-			char b[2];
-			unsigned short s;
-		    } u;
-		    int i;
-		    XChar2b *cp2 = (XChar2b *)0;
-		    int mustFree = 0;
-
-		    cp += (i1 * 2);
-		    if (l > 1000) l = 1000;
-
-		    /*
-		     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
-		     * X expects them MSB first
-		     * convert as required
-		     */
-
-		    u.s = 0x1234;
-		    if (u.b[0] != 0x12) {
-			if (l <= NLOCALBUFFER) {
-			    cp2 = xlatebuffer;
-			} else {
-			    cp2 = (XChar2b *)(malloc(l * 2));
-			    mustFree = 1;
-			}
-			for (i=0; i<l; i++) {
-			    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
-			    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
-			}
-			cp = (char *) cp2;
-		    }
-
-		    if (opaque == true)
-			XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
-		    else
-			XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
-
-		    if (mustFree) {
-			free(cp2);
-		    }
-
-		    RETURN ( self );
-		}
-	    }
-	}
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        cls = __qClass(aString);
+
+        i1 = __intVal(index1) - 1;
+        if (i1 >= 0) {
+            i2 = __intVal(index2) - 1;
+            if (i2 < i1) {
+                RETURN (self);
+            }
+
+            cp = _stringVal(aString);
+            l = i2 - i1 + 1;
+
+            if ((cls == @global(String)) || (cls == @global(Symbol))) {
+                n = _stringSize(aString);
+                if (i2 < n) {
+                    cp += i1;
+                    if (l > 1000) l = 1000;
+                    if (opaque == true)
+                        XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
+                    else
+                        XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
+                    RETURN ( self );
+                }
+            }
+
+            nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+            cp += nInstBytes;
+
+            if (__isBytes(aString)) {
+                n = __byteArraySize(aString) - nInstBytes - 1;
+
+                if (i2 < n) {
+                    cp += i1;
+                    if (l > 1000) l = 1000;
+                    if (opaque == true)
+                        XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
+                    else
+                        XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
+                    RETURN ( self );
+                }
+            }
+
+            /* TWOBYTESTRINGS */
+            if (__isWords(aString)) {
+                n = (__byteArraySize(aString) - nInstBytes) / 2;
+
+                if (i2 < n) {
+                    union {
+                        char b[2];
+                        unsigned short s;
+                    } u;
+                    int i;
+                    XChar2b *cp2 = (XChar2b *)0;
+                    int mustFree = 0;
+
+                    cp += (i1 * 2);
+                    if (l > 1000) l = 1000;
+
+                    /*
+                     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
+                     * X expects them MSB first
+                     * convert as required
+                     */
+
+                    u.s = 0x1234;
+                    if (u.b[0] != 0x12) {
+                        if (l <= NLOCALBUFFER) {
+                            cp2 = xlatebuffer;
+                        } else {
+                            cp2 = (XChar2b *)(malloc(l * 2));
+                            mustFree = 1;
+                        }
+                        for (i=0; i<l; i++) {
+                            cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
+                            cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
+                        }
+                        cp = (char *) cp2;
+                    }
+
+                    if (opaque == true)
+                        XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
+                    else
+                        XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
+
+                    if (mustFree) {
+                        free(cp2);
+                    }
+
+                    RETURN ( self );
+                }
+            }
+        }
     }
 #undef NLOCALBUFFER
 %}.
@@ -2890,83 +2891,83 @@
      && __isExternalAddress(aDrawableId)
      && __isNonNilObject(aString)
      && __bothSmallInteger(x, y)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	cls = __qClass(aString);
-
-	cp = _stringVal(aString);
-
-	if ((cls == @global(String)) || (cls == @global(Symbol))) {
-	    n = _stringSize(aString);
-	    if (n > 1000) n = 1000;
-	    if (opaque == true)
-		XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
-	    else
-		XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
-	    RETURN ( self );
-	}
-
-	nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-	cp += nInstBytes;
-
-	if (__isBytes(aString)) {
-	    n = __byteArraySize(aString) - nInstBytes - 1;
-
-	    if (n > 1000) n = 1000;
-	    if (opaque == true)
-		XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
-	    else
-		XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
-	    RETURN ( self );
-	}
-
-	/* TWOBYTESTRINGS */
-	if (__isWords(aString)) {
-	    union {
-		char b[2];
-		unsigned short s;
-	    } u;
-	    int i;
-	    XChar2b *cp2;
-	    int mustFree = 0;
-
-	    n = (__byteArraySize(aString) - nInstBytes) / 2;
-	    if (n > 1000) n = 1000;
-
-	    /*
-	     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
-	     * X expects them MSB first
-	     * convert as required
-	     */
-
-	    u.s = 0x1234;
-	    if (u.b[0] != 0x12) {
-		if (n <= NLOCALBUFFER) {
-		    cp2 = xlatebuffer;
-		} else {
-		    cp2 = (XChar2b *)(malloc(n * 2));
-		    mustFree = 1;
-		}
-
-		for (i=0; i<n; i++) {
-		    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
-		    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
-		}
-		cp = (char *) cp2;
-	    }
-
-	    if (opaque == true)
-		XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, n);
-	    else
-		XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, n);
-
-
-	    if (mustFree) {
-		free(cp2);
-	    }
-
-	    RETURN ( self );
-	}
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        cls = __qClass(aString);
+
+        cp = _stringVal(aString);
+
+        if ((cls == @global(String)) || (cls == @global(Symbol))) {
+            n = _stringSize(aString);
+            if (n > 1000) n = 1000;
+            if (opaque == true)
+                XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
+            else
+                XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
+            RETURN ( self );
+        }
+
+        nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+        cp += nInstBytes;
+
+        if (__isBytes(aString)) {
+            n = __byteArraySize(aString) - nInstBytes - 1;
+
+            if (n > 1000) n = 1000;
+            if (opaque == true)
+                XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
+            else
+                XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
+            RETURN ( self );
+        }
+
+        /* TWOBYTESTRINGS */
+        if (__isWords(aString)) {
+            union {
+                char b[2];
+                unsigned short s;
+            } u;
+            int i;
+            XChar2b *cp2;
+            int mustFree = 0;
+
+            n = (__byteArraySize(aString) - nInstBytes) / 2;
+            if (n > 1000) n = 1000;
+
+            /*
+             * ST/X TwoByteStrings store the asciiValue in native byteOrder;
+             * X expects them MSB first
+             * convert as required
+             */
+
+            u.s = 0x1234;
+            if (u.b[0] != 0x12) {
+                if (n <= NLOCALBUFFER) {
+                    cp2 = xlatebuffer;
+                } else {
+                    cp2 = (XChar2b *)(malloc(n * 2));
+                    mustFree = 1;
+                }
+
+                for (i=0; i<n; i++) {
+                    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
+                    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
+                }
+                cp = (char *) cp2;
+            }
+
+            if (opaque == true)
+                XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, n);
+            else
+                XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, n);
+
+
+            if (mustFree) {
+                free(cp2);
+            }
+
+            RETURN ( self );
+        }
     }
 #undef NLOCALBUFFER
 %}.
@@ -2975,12 +2976,12 @@
 !
 
 drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth 
-			  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
 
     "draw a bitImage which has depth id, width iw and height ih into
      the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
@@ -2996,28 +2997,28 @@
      an unlimited stack, and thus cannot send primitiveFailed
     "
     (self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth 
-					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)
     ifFalse:[
-	"
-	 also happens, if a segmentation violation occurs in the 
-	 XPutImage ...
-	"
-	self primitiveFailed
+        "
+         also happens, if a segmentation violation occurs in the 
+         XPutImage ...
+        "
+        self primitiveFailed
     ].
 !
 
 drawBits:imageBits depth:imageDepth 
-		   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
 
     "draw a bitImage which has depth id, width iw and height ih into
      the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
@@ -3028,17 +3029,17 @@
      colors are allocated - otherwise the colors may be wrong."
 
     ^ self drawBits:imageBits bitsPerPixel:imageDepth depth:imageDepth 
-				     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
 
 !
 
 fillArcX:x y:y width:width height:height from:startAngle angle:angle
-	       in:aDrawableId with:aGCId
+               in:aDrawableId with:aGCId
     "fill an arc. If any coordinate is not integer, an error is triggered.
      The angles may be floats or integer - they are given in degrees."
 
@@ -3050,34 +3051,34 @@
     double f;
 
     if (__isSmallInteger(startAngle))
-	angle1 = __intVal(startAngle) * 64;
+        angle1 = __intVal(startAngle) * 64;
     else if (__isFloat(startAngle)) {
-	f = __floatVal(startAngle);
-	angle1 = f * 64;
+        f = __floatVal(startAngle);
+        angle1 = f * 64;
     }
     if (__isSmallInteger(angle))
-	angle2 = __intVal(angle) * 64;
+        angle2 = __intVal(angle) * 64;
     else if (__isFloat(angle)) {
-	f = __floatVal(angle);
-	angle2 = f * 64;
+        f = __floatVal(angle);
+        angle2 = f * 64;
     }
     if (ISCONNECTED
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)
      && __bothSmallInteger(width, height)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	w = __intVal(width);
-	h = __intVal(height);
-	/*
-	 * need this check here: some servers simply dump core with bad args
-	 */
-	if ((w >= 0) && (h >= 0) && (angle1 >= 0) && (angle2 >= 0)) {
-	    XFillArc(myDpy, win, gc, __intVal(x), __intVal(y),
-				   w, h, angle1, angle2);
-	}
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        w = __intVal(width);
+        h = __intVal(height);
+        /*
+         * need this check here: some servers simply dump core with bad args
+         */
+        if ((w >= 0) && (h >= 0) && (angle1 >= 0) && (angle2 >= 0)) {
+            XFillArc(myDpy, win, gc, __intVal(x), __intVal(y),
+                                   w, h, angle1, angle2);
+        }
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -3104,39 +3105,39 @@
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __isSmallInteger(numberOfPoints)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	num = __intVal(numberOfPoints);
-	if (num < 3) {
-	    RETURN ( self );
-	}
-	/*
-	 * avoid (slow) malloc, if not many points
-	 */
-	if (num > 100) {
-	    points = (XPoint *) malloc(sizeof(XPoint) * num);
-	    if (! points) goto fail;
-	    mustFree = 1;
-	} else
-	    points = qPoints;
-	for (i=0; i<num; i++) {
-	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
-	    if (! __isPoint(point)) goto fail;
-	    x = _point_X(point);
-	    y = _point_Y(point);
-	    if (! __bothSmallInteger(x, y))
-		goto fail;
-	    points[i].x = __intVal(x);
-	    points[i].y = __intVal(y);
-	}
-	XFillPolygon(myDpy, win, gc, points, num, Complex, CoordModeOrigin);
-	if (mustFree)
-	    free(points);
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        num = __intVal(numberOfPoints);
+        if (num < 3) {
+            RETURN ( self );
+        }
+        /*
+         * avoid (slow) malloc, if not many points
+         */
+        if (num > 100) {
+            points = (XPoint *) malloc(sizeof(XPoint) * num);
+            if (! points) goto fail;
+            mustFree = 1;
+        } else
+            points = qPoints;
+        for (i=0; i<num; i++) {
+            point = __AT_(aPolygon, __MKSMALLINT(i+1));
+            if (! __isPoint(point)) goto fail;
+            x = _point_X(point);
+            y = _point_Y(point);
+            if (! __bothSmallInteger(x, y))
+                goto fail;
+            points[i].x = __intVal(x);
+            points[i].y = __intVal(y);
+        }
+        XFillPolygon(myDpy, win, gc, points, num, Complex, CoordModeOrigin);
+        if (mustFree)
+            free(points);
+        RETURN ( self );
 
 fail: ;
-	if (mustFree)
-	    free(points);
+        if (mustFree)
+            free(points);
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -3155,17 +3156,17 @@
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)
      && __bothSmallInteger(width, height)) {
-	w = __intVal(width);
-	h = __intVal(height);
-	/*
-	 * need this check here: some servers simply dump core with bad args
-	 */
-	if ((w >= 0) && (h >= 0)) {
-	    XFillRectangle(myDpy,
-			   (Drawable)_WindowVal(aDrawableId), _GCVal(aGCId),
-			   __intVal(x), __intVal(y), w, h);
-	}
-	RETURN ( self );
+        w = __intVal(width);
+        h = __intVal(height);
+        /*
+         * need this check here: some servers simply dump core with bad args
+         */
+        if ((w >= 0) && (h >= 0)) {
+            XFillRectangle(myDpy,
+                           (Drawable)_WindowVal(aDrawableId), _GCVal(aGCId),
+                           __intVal(x), __intVal(y), w, h);
+        }
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -3173,12 +3174,12 @@
 !
 
 primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth 
-			      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
 
     "since XPutImage may allocate huge amount of stack space 
      (some implementations use alloca), this must run with unlimited stack."
@@ -3203,61 +3204,61 @@
      && __bothSmallInteger(imageWidth, imageHeight)
      && __bothSmallInteger(imageDepth, bitsPerPixel)
      && __isByteArray(imageBits)) {
-	Display *dpy = myDpy;
-
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	if (! gc || !win) 
-	    goto fail;
+        Display *dpy = myDpy;
+
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        if (! gc || !win) 
+            goto fail;
 #ifdef ARGDEBUG
-	printf("args ok\n");
+        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 = MSBFirst;
-	image.bitmap_unit = 8;
-	image.bitmap_bit_order = MSBFirst;
-	image.bitmap_pad = 8;
-	image.depth = __intVal(imageDepth);
-	image.bits_per_pixel = __intVal(bitsPerPixel);
-	switch (image.bits_per_pixel) {
-	    case 1:
-		image.bytes_per_line = (imgWdth + 7) / 8;
-		break;
-	    case 2:
-		image.bytes_per_line = (imgWdth*2 + 7) / 8;
-		break;
-	    case 4:
-		image.bytes_per_line = (imgWdth*4 + 7) / 8;
-		break;
-	    case 8:
-		image.bytes_per_line = imgWdth;
-		break;
-	    case 16:
-		image.bytes_per_line = imgWdth*2;
-		break;
-	    case 24:
-		image.bytes_per_line = imgWdth*3;
-		break;
-	    case 32:
-		image.bytes_per_line = imgWdth*4;
-		break;
-	    default:
+        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 = MSBFirst;
+        image.bitmap_unit = 8;
+        image.bitmap_bit_order = MSBFirst;
+        image.bitmap_pad = 8;
+        image.depth = __intVal(imageDepth);
+        image.bits_per_pixel = __intVal(bitsPerPixel);
+        switch (image.bits_per_pixel) {
+            case 1:
+                image.bytes_per_line = (imgWdth + 7) / 8;
+                break;
+            case 2:
+                image.bytes_per_line = (imgWdth*2 + 7) / 8;
+                break;
+            case 4:
+                image.bytes_per_line = (imgWdth*4 + 7) / 8;
+                break;
+            case 8:
+                image.bytes_per_line = imgWdth;
+                break;
+            case 16:
+                image.bytes_per_line = imgWdth*2;
+                break;
+            case 24:
+                image.bytes_per_line = imgWdth*3;
+                break;
+            case 32:
+                image.bytes_per_line = imgWdth*4;
+                break;
+            default:
 #ifdef ARGDEBUG
-		printf("bits_per_pixel=%d\n",image.bits_per_pixel);
+                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;
-	XPutImage(dpy, win, gc, &image, __intVal(srcx), __intVal(srcy),
-					__intVal(dstx), __intVal(dsty),
-					__intVal(w), __intVal(h));
-	RETURN ( true );
+                goto fail;
+        }
+        image.red_mask = 0xFFFF;
+        image.green_mask = 0xFFFF;
+        image.blue_mask = 0xFFFF;
+        XPutImage(dpy, win, gc, &image, __intVal(srcx), __intVal(srcy),
+                                        __intVal(dstx), __intVal(dsty),
+                                        __intVal(w), __intVal(h));
+        RETURN ( true );
     }
 #ifdef ARGDEBUG
     if (!! __isExternalAddress(aGCId)) printf("GC\n");
@@ -3302,6 +3303,11 @@
     "/ aView created
 !
 
+gravityNotifyView:aView
+    "ignored for now"
+
+    "/ aView gravityNotify
+!
 
 mapRequestView:aView
     "ignored for now"
@@ -3309,25 +3315,6 @@
     "/ aView mapRequest
 !
 
-
-reparentedView:aView
-    "ignored for now"
-
-    "/ aView reparented
-!
-
-gravityNotifyView:aView
-    "ignored for now"
-
-    "/ aView gravityNotify
-!
-
-resizeRequestView:aView
-    "ignored for now"
-
-    "/ aView resizeRequest
-!
-
 propertyChangeView:aView
     "sent when an X property changes.
      This is a very X-specific mechanism."
@@ -3335,33 +3322,135 @@
     aView propertyChange
 !
 
+reparentedView:aView
+    "ignored for now"
+
+    "/ aView reparented
+!
+
+resizeRequestView:aView
+    "ignored for now"
+
+    "/ aView resizeRequest
+!
+
 selectionClear:selectionID view:aView
     "sent when another X-client has created a selection.
      This is a very X-specific mechanism."
 
-    aView selectionClear:selectionID
+    "
+     workaround a bug in olvwm: it clears selections
+     on window raise. 
+     In this case, keep my last own selection.
+    "
+    self setLastCopyBuffer:(self getCopyBuffer).
+    self setCopyBuffer:nil
+
+    "/ noone is interrested in that ...
+"/    aView selectionClear:selectionID
+
+    "Modified: 12.2.1997 / 19:45:19 / cg"
 !
 
 selectionNotify:propertyID target:targetID selection:selectionID from:requestorID view:aView
     "sent when the server returns an answer from a request for a selection.
      This is a very X-specific mechanism."
 
-    aView
-	selectionNotify:propertyID 
-	target:targetID 
-	selection:selectionID 
-	from:requestorID
-!
-
-selectionRequest:propertyID target:targetID selection:selectionID from:requestorID view:aView
+    |s sensor|
+
+    propertyID == 0 ifTrue:[
+        "invalid olvwm behavior"
+        s := self getLastCopyBuffer
+    ] ifFalse:[
+        targetID == self atomIDOfSTRING ifTrue:[
+            "
+             a returned string
+            "
+            s := self getTextProperty:propertyID from:requestorID.
+            s notNil ifTrue:[
+                (s endsWith:Character cr) ifTrue:[
+                    s := s asStringCollection copyWith:''
+                ]
+            ]
+        ] ifFalse:[
+            "
+             a returned object
+            "
+            s := self getObjectProperty:propertyID from:requestorID.
+        ].
+    ].
+
+    s notNil ifTrue:[
+        (sensor := aView sensor) notNil ifTrue:[
+            sensor pasteFromClipBoard:s view:aView
+        ] ifFalse:[
+            "
+             if there is no sensor ...
+            "
+            aView pasteFromClipBoard:s
+        ]
+    ]
+
+    "Modified: 13.2.1997 / 13:38:42 / cg"
+!
+
+selectionRequest:propertyID target:targetID selection:selectionID from:windowID view:aView
     "sent by some other X-client to ask for the selection.
      This is a very X-specific mechanism."
 
-    aView
-	selectionRequest:propertyID
-	target:targetID
-	selection:selectionID
-	from:requestorID
+    |o s stream|
+
+    targetID == (self atomIDOfLENGTH) ifTrue:[
+        "/
+        "/ the other one wants to know the size of our selection ...
+        "/
+
+        s := self selectionAsString.
+        self
+            setLengthProperty:propertyID 
+            value:s size 
+            for:windowID.
+        self
+            sendSelectionNotifySelection:selectionID
+            property:propertyID
+            target:targetID
+            from:aView id
+            to:windowID.
+        ^ self
+    ].
+
+    (targetID == self atomIDOfSTRING or:[
+     targetID == (self atomIDOf:'COMPOUND_TEXT')]) ifTrue:[
+        "/
+        "/ the other view wants the selection as string
+        "/
+
+        s := self selectionAsString.
+        self
+            sendSelection:s 
+            property:propertyID 
+            target:targetID 
+            from:aView id 
+            to:windowID.
+        ^ self
+    ].
+
+    "/
+    "/ send the seletion in binaryStore format
+    "/ (assuming, that the other view knows how to handle it)
+    "/
+    o := self getCopyBuffer.
+    stream := WriteStream on:(ByteArray new:200).
+    o storeBinaryOn:stream.
+
+    self
+        sendSelection:(stream contents) 
+        property:propertyID 
+        target:(self atomIDOf:'ST_OBJECT' create:true) 
+        from:aView id 
+        to:windowID
+
+    "Modified: 13.2.1997 / 13:12:47 / cg"
 ! !
 
 !XWorkstation methodsFor:'event handling'!
@@ -3375,9 +3464,9 @@
      handled."
 
     (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
-	AbortSignal catch:[
-	    self dispatchLastEvent.
-	]
+        AbortSignal catch:[
+            self dispatchLastEvent.
+        ]
     ].
 !
 
@@ -3462,7 +3551,7 @@
     static struct inlineCache skrS = _ILC4;
 
     if (! ISCONNECTED) {
-	RETURN (false);
+        RETURN (false);
     }
 
     dpy = myDpy;
@@ -3470,17 +3559,17 @@
     eB = __INST(eventBuffer);
 
     if (__isByteArray(eB)) {
-	ev = (XEvent *)(__ByteArrayInstPtr(eB)->ba_element);
+        ev = (XEvent *)(__ByteArrayInstPtr(eB)->ba_element);
     } else {
-	printf("DISPLAY: no eventBuffer\n");
-	RETURN (false);
+        printf("DISPLAY: no eventBuffer\n");
+        RETURN (false);
     }
 
     windowID = __MKOBJ(ae->window);
     theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID);
 
     if ((theView == nil) && (ev->type != MappingNotify)) {
-	RETURN (nil);
+        RETURN (nil);
     }
 
     /*
@@ -3500,453 +3589,453 @@
     eventType = __MKSMALLINT(ev->type);
 #endif
     switch (ev->type) {
-	case KeyRelease:
-	    symS = @symbol(keyRelease:x:y:view:);
-	    ipS = &skrS;
-	    upDown = false;
-	    goto keyPressAndRelease;
-
-	case KeyPress:
-	    symS = @symbol(keyPress:x:y:view:);
-	    ipS = &skpS;
-	    upDown = true;
-	    /* FALL INTO */
-
-	keyPressAndRelease:
-	    __INST(eventRootX) = __MKSMALLINT(ke->x_root);
-	    __INST(eventRootY) = __MKSMALLINT(ke->y_root);
+        case KeyRelease:
+            symS = @symbol(keyRelease:x:y:view:);
+            ipS = &skrS;
+            upDown = false;
+            goto keyPressAndRelease;
+
+        case KeyPress:
+            symS = @symbol(keyPress:x:y:view:);
+            ipS = &skpS;
+            upDown = true;
+            /* FALL INTO */
+
+        keyPressAndRelease:
+            __INST(eventRootX) = __MKSMALLINT(ke->x_root);
+            __INST(eventRootY) = __MKSMALLINT(ke->y_root);
 #ifdef OLD
-	    __INST(altDown) = (ke->state & Mod2Mask) ? true : false;
-	    __INST(metaDown) = (ke->state & Mod1Mask) ? true : false;
+            __INST(altDown) = (ke->state & Mod2Mask) ? true : false;
+            __INST(metaDown) = (ke->state & Mod1Mask) ? true : false;
 #else
-	    __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
-	    __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
+            __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
+            __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
 #endif
-	    __INST(shiftDown) = (ke->state & ShiftMask) ? true : false;
-	    __INST(ctrlDown) = (ke->state & ControlMask) ? true : false;
-
-	    arg = nil;
-	    nchars = XLookupString(ke, (char *)buffer, sizeof(buffer), &keySym, NULL);
-	    if (nchars 
-	     && (((buffer[0] >= ' ') && (buffer[0] <= '~'))
-		 || (buffer[0] >= 0x80))) {
-		arg = _MKCHARACTER(buffer[0])/* *_CharacterTable[buffer[0]] */;
-		keySymString = NULL;
-	    } else {
+            __INST(shiftDown) = (ke->state & ShiftMask) ? true : false;
+            __INST(ctrlDown) = (ke->state & ControlMask) ? true : false;
+
+            arg = nil;
+            nchars = XLookupString(ke, (char *)buffer, sizeof(buffer), &keySym, NULL);
+            if (nchars 
+             && (((buffer[0] >= ' ') && (buffer[0] <= '~'))
+                 || (buffer[0] >= 0x80))) {
+                arg = _MKCHARACTER(buffer[0])/* *_CharacterTable[buffer[0]] */;
+                keySymString = NULL;
+            } else {
 #ifdef OLD
-		switch (keySym) {
-		    case XK_Control_L:
-		    case XK_Control_R:
-			__INST(ctrlDown) = upDown;
-			break;
-		    case XK_Shift_L:
-		    case XK_Shift_R:
-			__INST(shiftDown) = upDown;
-			break;
-		    case XK_Meta_L:
-		    case XK_Meta_R:
-			__INST(metaDown) = upDown;
-			break;
-		    case XK_Alt_L:
-		    case XK_Alt_R:
-			__INST(altDown) = upDown;
-			break;
-		}
+                switch (keySym) {
+                    case XK_Control_L:
+                    case XK_Control_R:
+                        __INST(ctrlDown) = upDown;
+                        break;
+                    case XK_Shift_L:
+                    case XK_Shift_R:
+                        __INST(shiftDown) = upDown;
+                        break;
+                    case XK_Meta_L:
+                    case XK_Meta_R:
+                        __INST(metaDown) = upDown;
+                        break;
+                    case XK_Alt_L:
+                    case XK_Alt_R:
+                        __INST(altDown) = upDown;
+                        break;
+                }
 #endif
 
-		keySymString = XKeysymToString(keySym);
-		if (keySymString) {
+                keySymString = XKeysymToString(keySym);
+                if (keySymString) {
 #ifdef OLD
-		    if (keySymString[0] == 'D') {
-			/*
-			 * remove underscore, dont want it in symbols
-			 */
-			if (strcmp(keySymString, "Delete_line") == 0) {
-			    keySymString = "DeleteLine";
-			} else if (strcmp(keySymString, "Delete_word") == 0) {
-			    keySymString = "DeleteWord";
-			}
-		    }
-		    /*
-		     * make names compatible
-		     */
-		    if (strcmp(keySymString, "Down") == 0) {
-			keySymString = "CursorDown";
-		    } else if (strcmp(keySymString, "Up") == 0) {
-			keySymString = "CursorUp";
-		    } else if (strcmp(keySymString, "Left") == 0) {
-			keySymString = "CursorLeft";
-		    } else if (strcmp(keySymString, "Right") == 0) {
-			keySymString = "CursorRight";
-		    }
-		    arg = __MKSYMBOL(keySymString, (OBJ *)0, __context);
+                    if (keySymString[0] == 'D') {
+                        /*
+                         * remove underscore, dont want it in symbols
+                         */
+                        if (strcmp(keySymString, "Delete_line") == 0) {
+                            keySymString = "DeleteLine";
+                        } else if (strcmp(keySymString, "Delete_word") == 0) {
+                            keySymString = "DeleteWord";
+                        }
+                    }
+                    /*
+                     * make names compatible
+                     */
+                    if (strcmp(keySymString, "Down") == 0) {
+                        keySymString = "CursorDown";
+                    } else if (strcmp(keySymString, "Up") == 0) {
+                        keySymString = "CursorUp";
+                    } else if (strcmp(keySymString, "Left") == 0) {
+                        keySymString = "CursorLeft";
+                    } else if (strcmp(keySymString, "Right") == 0) {
+                        keySymString = "CursorRight";
+                    }
+                    arg = __MKSYMBOL(keySymString, (OBJ *)0, __context);
 #else
-		    __PROTECT__(theView);
-		    arg = __MKSTRING(keySymString);
-		    __UNPROTECT__(theView);
+                    __PROTECT__(theView);
+                    arg = __MKSTRING(keySymString);
+                    __UNPROTECT__(theView);
 #endif
-		}
-	    }
-
-	    if (arg == nil) {
-		/* happens sometimes (alt-graph on sun has no keysym) */
-		break;
-	    }
-
-	    (*(*ipS).ilc_func)(self, symS, nil, ipS,
-			       arg, 
-			       __MKSMALLINT(ke->x), 
-			       __MKSMALLINT(ke->y),
-			       theView);
-	    break;
-
-	case ButtonPress:
-	    __INST(buttonsPressed) = __MKSMALLINT(__intVal(__INST(buttonsPressed)) | (1 << be->button));
-	    __INST(eventRootX) = __MKSMALLINT(be->x_root);
-	    __INST(eventRootY) = __MKSMALLINT(be->y_root);
-
-	    if (__isSmallInteger(__INST(multiClickTimeDelta)))
-		nextMultiClickTime = be->time + __intVal(__INST(multiClickTimeDelta));
-	    else
-		nextMultiClickTime = 0;
-
-	    if ((t = __INST(multiClickTime)) != nil) {
-		int _multiClickTime;
-
-		_multiClickTime = __longIntVal(t);
-		if (be->time < _multiClickTime) {
-		    __INST(multiClickTime) = t = __MKUINT(nextMultiClickTime); __STORE(self, t);
-
-		    ipS = &bmpS;
-		    symS = @symbol(buttonMultiPress:x:y:view:);
-		    goto sendButtonEvent;
-		    break;
-		}
-	    }
-	    __INST(multiClickTime) = t = __MKUINT(nextMultiClickTime); __STORE(self, t);
+                }
+            }
+
+            if (arg == nil) {
+                /* happens sometimes (alt-graph on sun has no keysym) */
+                break;
+            }
+
+            (*(*ipS).ilc_func)(self, symS, nil, ipS,
+                               arg, 
+                               __MKSMALLINT(ke->x), 
+                               __MKSMALLINT(ke->y),
+                               theView);
+            break;
+
+        case ButtonPress:
+            __INST(buttonsPressed) = __MKSMALLINT(__intVal(__INST(buttonsPressed)) | (1 << be->button));
+            __INST(eventRootX) = __MKSMALLINT(be->x_root);
+            __INST(eventRootY) = __MKSMALLINT(be->y_root);
+
+            if (__isSmallInteger(__INST(multiClickTimeDelta)))
+                nextMultiClickTime = be->time + __intVal(__INST(multiClickTimeDelta));
+            else
+                nextMultiClickTime = 0;
+
+            if ((t = __INST(multiClickTime)) != nil) {
+                int _multiClickTime;
+
+                _multiClickTime = __longIntVal(t);
+                if (be->time < _multiClickTime) {
+                    __INST(multiClickTime) = t = __MKUINT(nextMultiClickTime); __STORE(self, t);
+
+                    ipS = &bmpS;
+                    symS = @symbol(buttonMultiPress:x:y:view:);
+                    goto sendButtonEvent;
+                    break;
+                }
+            }
+            __INST(multiClickTime) = t = __MKUINT(nextMultiClickTime); __STORE(self, t);
 
 #ifdef NO_LONGER
-	    if (be->state & ShiftMask) {
-		ipS = &bspS;
-		symS = @symbol(buttonShiftPress:x:y:view:);
-		goto sendButtonEvent;
-	    }
+            if (be->state & ShiftMask) {
+                ipS = &bspS;
+                symS = @symbol(buttonShiftPress:x:y:view:);
+                goto sendButtonEvent;
+            }
 #endif
-	    ipS = &bpS;
-	    symS = @symbol(buttonPress:x:y:view:);
-	    goto sendButtonEvent;
-
-	    /* NOT REACHED */
-
-	case ButtonRelease:
-	    __INST(buttonsPressed) = __MKSMALLINT(__intVal(__INST(buttonsPressed)) & ~(1 << be->button));
-	    __INST(eventRootX) = __MKSMALLINT(be->x_root);
-	    __INST(eventRootY) = __MKSMALLINT(be->y_root);
-	    ipS = &brS;
-	    symS = @symbol(buttonRelease:x:y:view:);
-	    /* fall into */
-
-	sendButtonEvent:
-	    butt = __MKSMALLINT(be->button);
+            ipS = &bpS;
+            symS = @symbol(buttonPress:x:y:view:);
+            goto sendButtonEvent;
+
+            /* NOT REACHED */
+
+        case ButtonRelease:
+            __INST(buttonsPressed) = __MKSMALLINT(__intVal(__INST(buttonsPressed)) & ~(1 << be->button));
+            __INST(eventRootX) = __MKSMALLINT(be->x_root);
+            __INST(eventRootY) = __MKSMALLINT(be->y_root);
+            ipS = &brS;
+            symS = @symbol(buttonRelease:x:y:view:);
+            /* fall into */
+
+        sendButtonEvent:
+            butt = __MKSMALLINT(be->button);
 #ifdef NOTDEF
-	    /*
-	     * this allows operation with single button mouses: meta-click is always Button 2
-	     */
-	    if (__INST(metaDown) == true)
-		butt = __MKSMALLINT(2);
-	    else 
+            /*
+             * this allows operation with single button mouses: meta-click is always Button 2
+             */
+            if (__INST(metaDown) == true)
+                butt = __MKSMALLINT(2);
+            else 
 #endif
-		butt = __AT_(__INST(buttonTranslation), butt);
-
-
-	    (*(*ipS).ilc_func)(self, 
-			       symS, nil, ipS,
-			       butt, 
-			       __MKSMALLINT(ke->x), 
-			       __MKSMALLINT(ke->y),
-			       theView);
-	    break;
-
-	case MotionNotify:
-	    if (__INST(motionEventCompression) != false) {
-		while (XCheckWindowEvent(dpy, me->window, ANYBUTTON, ev)) ;;
-	    }
-
-	    __INST(eventRootX) = __MKSMALLINT(me->x_root);
-	    __INST(eventRootY) = __MKSMALLINT(me->y_root);
+                butt = __AT_(__INST(buttonTranslation), butt);
+
+
+            (*(*ipS).ilc_func)(self, 
+                               symS, nil, ipS,
+                               butt, 
+                               __MKSMALLINT(ke->x), 
+                               __MKSMALLINT(ke->y),
+                               theView);
+            break;
+
+        case MotionNotify:
+            if (__INST(motionEventCompression) != false) {
+                while (XCheckWindowEvent(dpy, me->window, ANYBUTTON, ev)) ;;
+            }
+
+            __INST(eventRootX) = __MKSMALLINT(me->x_root);
+            __INST(eventRootY) = __MKSMALLINT(me->y_root);
 
 #ifdef OLD
-	    __INST(altDown) = (me->state & Mod2Mask) ? true : false;
-	    __INST(metaDown) = (me->state & Mod1Mask) ? true : false;
+            __INST(altDown) = (me->state & Mod2Mask) ? true : false;
+            __INST(metaDown) = (me->state & Mod1Mask) ? true : false;
 #else
-	    __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
-	    __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
+            __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
+            __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
 #endif
-	    __INST(shiftDown) = (me->state & ShiftMask) ? true : false;
-	    __INST(ctrlDown) = (me->state & ControlMask) ? true : false;
-
-	    (*motS.ilc_func)(self, 
-			     @symbol(buttonMotion:x:y:view:), nil, &motS,
-			     __MKSMALLINT(me->state),
-			     __MKSMALLINT(me->x),
-			     __MKSMALLINT(me->y),
-			     theView);
-	    break;
-
-	case FocusIn:
-	    (*focInS.ilc_func)(self, 
-			       @symbol(focusInView:), nil, &focInS, 
-			       theView);
-	    break;
-
-	case FocusOut:
-	    (*focOutS.ilc_func)(self, 
-				@symbol(focusOutView:), nil, &focOutS, 
-				theView);
-	    break;
-
-	case EnterNotify:
+            __INST(shiftDown) = (me->state & ShiftMask) ? true : false;
+            __INST(ctrlDown) = (me->state & ControlMask) ? true : false;
+
+            (*motS.ilc_func)(self, 
+                             @symbol(buttonMotion:x:y:view:), nil, &motS,
+                             __MKSMALLINT(me->state),
+                             __MKSMALLINT(me->x),
+                             __MKSMALLINT(me->y),
+                             theView);
+            break;
+
+        case FocusIn:
+            (*focInS.ilc_func)(self, 
+                               @symbol(focusInView:), nil, &focInS, 
+                               theView);
+            break;
+
+        case FocusOut:
+            (*focOutS.ilc_func)(self, 
+                                @symbol(focusOutView:), nil, &focOutS, 
+                                theView);
+            break;
+
+        case EnterNotify:
 #ifdef OLD
-	    __INST(altDown) = (ewe->state & Mod2Mask) ? true : false;
-	    __INST(metaDown) = (ewe->state & Mod1Mask) ? true : false;
+            __INST(altDown) = (ewe->state & Mod2Mask) ? true : false;
+            __INST(metaDown) = (ewe->state & Mod1Mask) ? true : false;
 #else
-	    __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
-	    __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
+            __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
+            __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
 #endif
-	    __INST(shiftDown) = (ewe->state & ShiftMask) ? true : false;
-	    __INST(ctrlDown) = (ewe->state & ControlMask) ? true : false;
-
-	    (*peS.ilc_func)(self, 
-			    @symbol(pointerEnter:x:y:view:), nil, &peS,
-			    __MKSMALLINT(ewe->state),
-			    __MKSMALLINT(ewe->x), 
-			    __MKSMALLINT(ewe->y),
-			    theView);
-	    break;
-
-	case LeaveNotify:
-	    (*plS.ilc_func)(self, 
-			    @symbol(pointerLeave:view:), nil, &plS,
-			    __MKSMALLINT(lwe->state), 
-			    theView);
-	    break;
-
-	case GraphicsExpose:
-	    (*gexpS.ilc_func)(self, 
-			      @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
-			      __MKSMALLINT(ee->x),
-			      __MKSMALLINT(ee->y),
-			      __MKSMALLINT(ee->width),
-			      __MKSMALLINT(ee->height),
-			      ee->count == 0 ? true : false,
-			      theView);
-
-	    if (ee->count != 0) {
-		break;
-	    }
-	    /* fall into */
-
-	case NoExpose:
-	    (*nexpS.ilc_func)(self, 
-			      @symbol(noExposeView:), nil, &nexpS, 
-			      theView);
-	    break;
-
-	case Expose:
-	    (*expS.ilc_func)(self, 
-			     @symbol(exposeX:y:width:height:view:), nil, &expS,
-			     __MKSMALLINT(ee->x),
-			     __MKSMALLINT(ee->y),
-			     __MKSMALLINT(ee->width),
-			     __MKSMALLINT(ee->height),
-			     theView);
-	    break;
-
-	case ConfigureNotify:
-	    if (ce->above != None) {
-		siblingID = __MKOBJ(ce->above);
-		sibling = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, siblingID);
-	    }
-
-	    (*confS.ilc_func)(self, 
-			     @symbol(configureX:y:width:height:view:), nil, &confS,
-			     __MKSMALLINT(ce->x),
-			     __MKSMALLINT(ce->y),
-			     __MKSMALLINT(ce->width),
-			     __MKSMALLINT(ce->height),
-			     theView);
-	    if (sibling != nil) {
-		(*coveredS.ilc_func)(self,
-				    @symbol(coveredBy:view:), nil, &coveredS,
-				    theView,
-				    sibling);
-	    }
-	    break;
-
-	case ClientMessage:
-	    if (ev->xclient.message_type == (int) _AtomVal(__INST(protocolsAtom))) {
-		if ((ev->xclient.data.l[0] == (int) _AtomVal(__INST(quitAppAtom)))
-		 || (ev->xclient.data.l[0] == (int) _AtomVal(__INST(deleteWindowAtom)))) {
-		    (*termS.ilc_func)(self, 
-				      @symbol(terminateView:), nil, &termS, theView);
-		    break;
-		}
-		if (ev->xclient.data.l[0] == (int) _AtomVal(__INST(saveYourselfAtom))) {
-		    (*savtermS.ilc_func)(self, 
-					 @symbol(saveAndTerminateView:)
-					 , nil, &savtermS, theView);
-		    break;
-		}
-	    }
-	    break;
-
-	case DestroyNotify:
-	    (*destrS.ilc_func)(self, @symbol(destroyedView:)
-			       , nil, &destrS, theView);
-	    break;
-
-	case UnmapNotify:
-	    (*unmapS.ilc_func)(self, @symbol(unmappedView:) 
-			       , nil, &unmapS, theView);
-	    break;
-
-	case MapNotify:
-	    (*mapS.ilc_func)(self, 
-			     @symbol(mappedView:) 
-			     , nil, &mapS, theView);
-	    break;
-
-	case KeymapNotify:
-	    (*keymap.ilc_func)(theView, 
-			       @symbol(keyMapChange) 
-			       , nil, &keymap);
-	    break;
-
-	case VisibilityNotify:
-	    switch (ve->state) {
-		case VisibilityUnobscured:
-		    arg = @symbol(unobscured);
-		    break;
-		case VisibilityPartiallyObscured:
-		    arg = @symbol(partiallyObscured);
-		    break;
-		case VisibilityFullyObscured:
-		    arg = @symbol(fullyObscured);
-		    break;
-	    }
-	    (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
-	    break;
-
-	case CreateNotify:
-	    (*created.ilc_func)(self, @symbol(createdView:), nil, &created, theView);
-	    break;
-
-	case MapRequest:
-	    (*mapReq.ilc_func)(self, @symbol(mapRequestView:), nil, &mapReq, theView);
-	    break;
-
-	case ReparentNotify:
-	    (*repar.ilc_func)(self, @symbol(reparentedView:), nil, &repar, theView);
-	    break;
-
-	case ConfigureRequest:
-	    (*confReq.ilc_func)(self, @symbol(configureRequestView:), nil, &confReq, theView);
-	    break;
-
-	case GravityNotify:
-	    (*gravNotify.ilc_func)(self, @symbol(gravityNotifyView:), nil, &resReq, theView);
-	    break;
-
-	case ResizeRequest:
-	    (*resReq.ilc_func)(self, @symbol(resizeRequestView:), nil, &resReq, theView);
-	    break;
-
-	case CirculateNotify:
-	case CirculateRequest:
-	    break;
-
-	case PropertyNotify:
-	    (*prop.ilc_func)(self, 
-			     @symbol(propertyChangeView) 
-			     , nil, &prop,
-			     theView);
-	    break;
-
-	case SelectionClear:
-	    selectionID = __MKATOMOBJ(ev->xselectionclear.selection);
-	    (*selClear.ilc_func)(self, 
-				 @symbol(selectionClear:view:) 
-				 , nil, &selClear,
-				 selectionID,
-				 theView);
-	    break;
-
-	case SelectionNotify:
-	    /*
-	     * returned selection value (answer from SelectionRequest)
-	     */
-	    DPRINTF(("SelectionNotify prop=%x target=%x selection= %x requestor=%x\n", 
-			ev->xselection.property, ev->xselection.target,
-			ev->xselection.selection, ev->xselection.requestor));
-
-	    propertyID = __MKATOMOBJ(ev->xselection.property);
-	    targetID = __MKATOMOBJ(ev->xselection.target);
-	    selectionID = __MKATOMOBJ(ev->xselection.selection);
-	    requestorID = __MKOBJ(ev->xselection.requestor);
-	    (*selNotify.ilc_func)(self, 
-				  @symbol(selectionNotify:target:selection:from:view:) 
-				  , nil, &selNotify,
-				  propertyID, targetID, selectionID, requestorID,
-				  theView);
-	    break;
-
-	case SelectionRequest:
-	    /*
-	     * someone wants the selection
-	     */
-	    DPRINTF(("SelectionRequest prop=%x target=%x selection=%x requestor=%x\n", 
-			ev->xselectionrequest.property,
-			ev->xselectionrequest.target,
-			ev->xselectionrequest.selection,
-			ev->xselectionrequest.requestor));
-
-	    propertyID = __MKATOMOBJ(ev->xselectionrequest.property);
-	    targetID = __MKATOMOBJ(ev->xselectionrequest.target);
-	    selectionID = __MKATOMOBJ(ev->xselectionrequest.selection);
-	    requestorID = __MKOBJ(ev->xselectionrequest.requestor);
-	    (*selReq.ilc_func)(self, 
-			       @symbol(selectionRequest:target:selection:from:view:) 
-			       , nil, &selReq,
-			       propertyID, targetID, selectionID, requestorID,
-			       theView);
-	    break;
-
-	case ColormapNotify:
-	    (*colormap.ilc_func)(self, 
-				 @symbol(colorMapChangeView:) 
-				 , nil, &colormap,
-				 theView);
-	    break;
-
-	case MappingNotify:
-	    switch(mape->request) {
-		case MappingModifier:
-		    arg = @symbol(mappingModifier);
-		    break;
-		case MappingKeyboard:
-		    arg = @symbol(mappingKeyboard);
-		    break;
-		case MappingPointer:
-		    arg = @symbol(mappingPointer);
-		    break;
-		default:
-		    arg = nil;
-		    break;
-	    }
-	    (*mapping.ilc_func)(self, 
-				@symbol(mappingChanged:event:) 
-				, nil, &mapping, arg, eB);
-	    break;
+            __INST(shiftDown) = (ewe->state & ShiftMask) ? true : false;
+            __INST(ctrlDown) = (ewe->state & ControlMask) ? true : false;
+
+            (*peS.ilc_func)(self, 
+                            @symbol(pointerEnter:x:y:view:), nil, &peS,
+                            __MKSMALLINT(ewe->state),
+                            __MKSMALLINT(ewe->x), 
+                            __MKSMALLINT(ewe->y),
+                            theView);
+            break;
+
+        case LeaveNotify:
+            (*plS.ilc_func)(self, 
+                            @symbol(pointerLeave:view:), nil, &plS,
+                            __MKSMALLINT(lwe->state), 
+                            theView);
+            break;
+
+        case GraphicsExpose:
+            (*gexpS.ilc_func)(self, 
+                              @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
+                              __MKSMALLINT(ee->x),
+                              __MKSMALLINT(ee->y),
+                              __MKSMALLINT(ee->width),
+                              __MKSMALLINT(ee->height),
+                              ee->count == 0 ? true : false,
+                              theView);
+
+            if (ee->count != 0) {
+                break;
+            }
+            /* fall into */
+
+        case NoExpose:
+            (*nexpS.ilc_func)(self, 
+                              @symbol(noExposeView:), nil, &nexpS, 
+                              theView);
+            break;
+
+        case Expose:
+            (*expS.ilc_func)(self, 
+                             @symbol(exposeX:y:width:height:view:), nil, &expS,
+                             __MKSMALLINT(ee->x),
+                             __MKSMALLINT(ee->y),
+                             __MKSMALLINT(ee->width),
+                             __MKSMALLINT(ee->height),
+                             theView);
+            break;
+
+        case ConfigureNotify:
+            if (ce->above != None) {
+                siblingID = __MKOBJ(ce->above);
+                sibling = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, siblingID);
+            }
+
+            (*confS.ilc_func)(self, 
+                             @symbol(configureX:y:width:height:view:), nil, &confS,
+                             __MKSMALLINT(ce->x),
+                             __MKSMALLINT(ce->y),
+                             __MKSMALLINT(ce->width),
+                             __MKSMALLINT(ce->height),
+                             theView);
+            if (sibling != nil) {
+                (*coveredS.ilc_func)(self,
+                                    @symbol(coveredBy:view:), nil, &coveredS,
+                                    theView,
+                                    sibling);
+            }
+            break;
+
+        case ClientMessage:
+            if (ev->xclient.message_type == (int) _AtomVal(__INST(protocolsAtom))) {
+                if ((ev->xclient.data.l[0] == (int) _AtomVal(__INST(quitAppAtom)))
+                 || (ev->xclient.data.l[0] == (int) _AtomVal(__INST(deleteWindowAtom)))) {
+                    (*termS.ilc_func)(self, 
+                                      @symbol(terminateView:), nil, &termS, theView);
+                    break;
+                }
+                if (ev->xclient.data.l[0] == (int) _AtomVal(__INST(saveYourselfAtom))) {
+                    (*savtermS.ilc_func)(self, 
+                                         @symbol(saveAndTerminateView:)
+                                         , nil, &savtermS, theView);
+                    break;
+                }
+            }
+            break;
+
+        case DestroyNotify:
+            (*destrS.ilc_func)(self, @symbol(destroyedView:)
+                               , nil, &destrS, theView);
+            break;
+
+        case UnmapNotify:
+            (*unmapS.ilc_func)(self, @symbol(unmappedView:) 
+                               , nil, &unmapS, theView);
+            break;
+
+        case MapNotify:
+            (*mapS.ilc_func)(self, 
+                             @symbol(mappedView:) 
+                             , nil, &mapS, theView);
+            break;
+
+        case KeymapNotify:
+            (*keymap.ilc_func)(theView, 
+                               @symbol(keyMapChange) 
+                               , nil, &keymap);
+            break;
+
+        case VisibilityNotify:
+            switch (ve->state) {
+                case VisibilityUnobscured:
+                    arg = @symbol(unobscured);
+                    break;
+                case VisibilityPartiallyObscured:
+                    arg = @symbol(partiallyObscured);
+                    break;
+                case VisibilityFullyObscured:
+                    arg = @symbol(fullyObscured);
+                    break;
+            }
+            (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
+            break;
+
+        case CreateNotify:
+            (*created.ilc_func)(self, @symbol(createdView:), nil, &created, theView);
+            break;
+
+        case MapRequest:
+            (*mapReq.ilc_func)(self, @symbol(mapRequestView:), nil, &mapReq, theView);
+            break;
+
+        case ReparentNotify:
+            (*repar.ilc_func)(self, @symbol(reparentedView:), nil, &repar, theView);
+            break;
+
+        case ConfigureRequest:
+            (*confReq.ilc_func)(self, @symbol(configureRequestView:), nil, &confReq, theView);
+            break;
+
+        case GravityNotify:
+            (*gravNotify.ilc_func)(self, @symbol(gravityNotifyView:), nil, &resReq, theView);
+            break;
+
+        case ResizeRequest:
+            (*resReq.ilc_func)(self, @symbol(resizeRequestView:), nil, &resReq, theView);
+            break;
+
+        case CirculateNotify:
+        case CirculateRequest:
+            break;
+
+        case PropertyNotify:
+            (*prop.ilc_func)(self, 
+                             @symbol(propertyChangeView) 
+                             , nil, &prop,
+                             theView);
+            break;
+
+        case SelectionClear:
+            selectionID = __MKATOMOBJ(ev->xselectionclear.selection);
+            (*selClear.ilc_func)(self, 
+                                 @symbol(selectionClear:view:) 
+                                 , nil, &selClear,
+                                 selectionID,
+                                 theView);
+            break;
+
+        case SelectionNotify:
+            /*
+             * returned selection value (answer from SelectionRequest)
+             */
+            DPRINTF(("SelectionNotify prop=%x target=%x selection= %x requestor=%x\n", 
+                        ev->xselection.property, ev->xselection.target,
+                        ev->xselection.selection, ev->xselection.requestor));
+
+            propertyID = __MKATOMOBJ(ev->xselection.property);
+            targetID = __MKATOMOBJ(ev->xselection.target);
+            selectionID = __MKATOMOBJ(ev->xselection.selection);
+            requestorID = __MKOBJ(ev->xselection.requestor);
+            (*selNotify.ilc_func)(self, 
+                                  @symbol(selectionNotify:target:selection:from:view:) 
+                                  , nil, &selNotify,
+                                  propertyID, targetID, selectionID, requestorID,
+                                  theView);
+            break;
+
+        case SelectionRequest:
+            /*
+             * someone wants the selection
+             */
+            DPRINTF(("SelectionRequest prop=%x target=%x selection=%x requestor=%x\n", 
+                        ev->xselectionrequest.property,
+                        ev->xselectionrequest.target,
+                        ev->xselectionrequest.selection,
+                        ev->xselectionrequest.requestor));
+
+            propertyID = __MKATOMOBJ(ev->xselectionrequest.property);
+            targetID = __MKATOMOBJ(ev->xselectionrequest.target);
+            selectionID = __MKATOMOBJ(ev->xselectionrequest.selection);
+            requestorID = __MKOBJ(ev->xselectionrequest.requestor);
+            (*selReq.ilc_func)(self, 
+                               @symbol(selectionRequest:target:selection:from:view:) 
+                               , nil, &selReq,
+                               propertyID, targetID, selectionID, requestorID,
+                               theView);
+            break;
+
+        case ColormapNotify:
+            (*colormap.ilc_func)(self, 
+                                 @symbol(colorMapChangeView:) 
+                                 , nil, &colormap,
+                                 theView);
+            break;
+
+        case MappingNotify:
+            switch(mape->request) {
+                case MappingModifier:
+                    arg = @symbol(mappingModifier);
+                    break;
+                case MappingKeyboard:
+                    arg = @symbol(mappingKeyboard);
+                    break;
+                case MappingPointer:
+                    arg = @symbol(mappingPointer);
+                    break;
+                default:
+                    arg = nil;
+                    break;
+            }
+            (*mapping.ilc_func)(self, 
+                                @symbol(mappingChanged:event:) 
+                                , nil, &mapping, arg, eB);
+            break;
     }
 #undef ae
 #undef ee
@@ -3963,7 +4052,7 @@
     ^ true
 !
 
-dispatchPendingEvents
+patchPendingEvents
     "central event handling method for modal operation.
      (i.e. this is now only used in the modal debugger)
      This code is somewhat special, since X has a concept of graphic
@@ -3973,19 +4062,19 @@
 
     "interested in exposes only ?"
     dispatchingExpose notNil ifTrue:[
-	[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
-	    self dispatchExposeEventFor:dispatchingExpose
-	].
-	^ self
+        [self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
+            self dispatchExposeEventFor:dispatchingExpose
+        ].
+        ^ self
     ].
 
     "no, general dispatch"
     [self eventPendingWithSync:false] whileTrue:[
-	self dispatchEventFor:nil withMask:nil
+        self dispatchEventFor:nil withMask:nil
     ]
 !
 
-disposeEventsWithMask:aMask for:aWindowIdOrNil
+poseEventsWithMask:aMask for:aWindowIdOrNil
     "dispose (throw away) specific events. If aWindowId is nil,
      events matching the mask are thrown away regardless of which
      view they are for. Otherwise, only matching events for that 
@@ -3998,22 +4087,22 @@
 
     if (ISCONNECTED
      && __isSmallInteger(aMask)) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(aWindowIdOrNil)) {
-	    win = _WindowVal(aWindowIdOrNil);
-	    while (XCheckWindowEvent(dpy, win, __intVal(aMask), &ev)) ;;
-	} else {
-	    while (XCheckMaskEvent(dpy, __intVal(aMask), &ev)) ;;
-	}
-	RETURN ( self );
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(aWindowIdOrNil)) {
+            win = _WindowVal(aWindowIdOrNil);
+            while (XCheckWindowEvent(dpy, win, __intVal(aMask), &ev)) ;;
+        } else {
+            while (XCheckMaskEvent(dpy, __intVal(aMask), &ev)) ;;
+        }
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-eventMaskFor:anEventSymbol
+ntMaskFor:anEventSymbol
     "return the eventMask bit-constant corresponding to an event symbol"
 
 %{  /* NOCONTEXT */
@@ -4040,25 +4129,25 @@
 %}
 !
 
-eventPending
+ntPending
     "return true, if any event is pending. 
      This looks for both the internal queue and the display connection."
 
     ConservativeSyncing == true ifTrue:[self sync].
 
     dispatchingExpose notNil ifTrue:[
-	^ self exposeEventPendingFor:dispatchingExpose withSync:false
+        ^ self exposeEventPendingFor:dispatchingExpose withSync:false
     ].
     ^ self eventPendingWithSync:false
 !
 
-eventPending:anEventSymbol for:aWindowIdOrNil
+ntPending:anEventSymbol for:aWindowIdOrNil
     "return true, if a specific event is pending"
 
     ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
 !
 
-eventPendingWithSync:doSync
+ntPendingWithSync:doSync
     "return true, if any event is pending. 
      If doSync is true, do a sync output buffer (i.e. send all to the display and wait until its processed)
      before checking."
@@ -4066,31 +4155,31 @@
 %{  /* UNLIMITEDSTACK */
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (doSync == true) {
-	    XSync(dpy, 0);      /* make certain everything is flushed */
-	}
-	if (XPending(dpy)) {
-	    RETURN (true);
-	}
+        Display *dpy = myDpy;
+
+        if (doSync == true) {
+            XSync(dpy, 0);      /* make certain everything is flushed */
+        }
+        if (XPending(dpy)) {
+            RETURN (true);
+        }
     }
     RETURN ( false );
 %}
 !
 
-eventQueued
+ntQueued
     "return true, if any event is queued"
 
     dispatchingExpose notNil ifTrue:[
-	^ self exposeEventPendingFor:dispatchingExpose withSync:false
+        ^ self exposeEventPendingFor:dispatchingExpose withSync:false
     ].
     ^ self eventQueuedAlready
 
     "Created: 12.12.1995 / 21:43:00 / stefan"
 !
 
-eventQueuedAlready
+ntQueuedAlready
     "return true, if any event is queued internally.
      (i.e. in X's internal event queue, which is both filled by explicit
       nextEvent calls AND whenever drawing is done and events are pending on
@@ -4099,15 +4188,15 @@
 %{  /* UNLIMITEDSTACK */
 
     if (ISCONNECTED) {
-	if (XEventsQueued(myDpy, QueuedAlready)) {
-	    RETURN (true);
-	}
+        if (XEventsQueued(myDpy, QueuedAlready)) {
+            RETURN (true);
+        }
     }
     RETURN ( false );
 %}
 !
 
-eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
+ntsPending:anEventMask for:aWindowIdOrNil withSync:doSync
     "return true, if any of the masked events is pending"
 
 %{  /* UNLIMITEDSTACK */
@@ -4117,27 +4206,27 @@
     int thereIsOne;
 
     if (ISCONNECTED && __isSmallInteger(anEventMask)) {
-	Display *dpy = myDpy;
-
-	if (doSync == true) {
-	    XSync(dpy, 0);      /* make certain everything is flushed */
-	}
-	if (__isExternalAddress(aWindowIdOrNil)) {
-	    win = _WindowVal(aWindowIdOrNil);
-	    thereIsOne = XCheckWindowEvent(dpy, win, __intVal(anEventMask), &ev);
-	} else {
-	    thereIsOne = XCheckMaskEvent(dpy, __intVal(anEventMask), &ev);
-	}
-	if (thereIsOne) {
-	    XPutBackEvent(dpy, &ev);
-	    RETURN ( true );
-	}
+        Display *dpy = myDpy;
+
+        if (doSync == true) {
+            XSync(dpy, 0);      /* make certain everything is flushed */
+        }
+        if (__isExternalAddress(aWindowIdOrNil)) {
+            win = _WindowVal(aWindowIdOrNil);
+            thereIsOne = XCheckWindowEvent(dpy, win, __intVal(anEventMask), &ev);
+        } else {
+            thereIsOne = XCheckMaskEvent(dpy, __intVal(anEventMask), &ev);
+        }
+        if (thereIsOne) {
+            XPutBackEvent(dpy, &ev);
+            RETURN ( true );
+        }
     }
     RETURN ( false );
 %}
 !
 
-exposeEventPendingFor:aWindowIdOrNil withSync:doSync
+oseEventPendingFor:aWindowIdOrNil withSync:doSync
     "return true, if any expose event is pending for a specific view,
      or any view (if the arg is nil).
      This is an X specific, only required after a scroll operation."
@@ -4149,27 +4238,27 @@
     int thereIsOne;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (doSync == true) {
-	    XSync(dpy, 0);      /* make certain everything is flushed */
-	}
-	if (__isExternalAddress(aWindowIdOrNil)) {
-	    win = _WindowVal(aWindowIdOrNil);
-	    thereIsOne = XCheckWindowEvent(dpy, win, ExposureMask, &ev);
-	} else {
-	    thereIsOne = XCheckMaskEvent(dpy, ExposureMask, &ev);
-	}
-	if (thereIsOne) {
-	    XPutBackEvent(dpy, &ev);
-	    RETURN ( true );
-	}
+        Display *dpy = myDpy;
+
+        if (doSync == true) {
+            XSync(dpy, 0);      /* make certain everything is flushed */
+        }
+        if (__isExternalAddress(aWindowIdOrNil)) {
+            win = _WindowVal(aWindowIdOrNil);
+            thereIsOne = XCheckWindowEvent(dpy, win, ExposureMask, &ev);
+        } else {
+            thereIsOne = XCheckMaskEvent(dpy, ExposureMask, &ev);
+        }
+        if (thereIsOne) {
+            XPutBackEvent(dpy, &ev);
+            RETURN ( true );
+        }
     }
     RETURN ( false );
 %}
 !
 
-getEventFor:aViewIdOrNil withMask:eventMask
+EventFor:aViewIdOrNil withMask:eventMask
     "read next event - put into local eventBuffer. 
      If aViewIdOrNil is nil, events for any view are fetched; 
      otherwise only events for that specific view will be fetched.
@@ -4194,70 +4283,70 @@
     XEvent *ev;
 
     if (! ISCONNECTED) {
-	RETURN (false);
+        RETURN (false);
     }
 
     dpy = myDpy;
 
     eB = __INST(eventBuffer);
     if (__isByteArray(eB)) {
-	ev = (XEvent *)(__ByteArrayInstPtr(eB)->ba_element);
+        ev = (XEvent *)(__ByteArrayInstPtr(eB)->ba_element);
     } else {
-	printf("DISPLAY: no eventBuffer\n");
-	RETURN (false);
+        printf("DISPLAY: no eventBuffer\n");
+        RETURN (false);
     }
     ev->type = 0;
 
     if (__isSmallInteger(eventMask)) {
-	evMask = __intVal(eventMask);
+        evMask = __intVal(eventMask);
     } else {
-	evMask = ~0;
+        evMask = ~0;
     }
 
     if (__isExternalAddress(aViewIdOrNil)) {
-	wWanted = _WindowVal(aViewIdOrNil);
-	if (XCheckWindowEvent(dpy, wWanted, evMask, ev)) {
-	    RETURN ( true );
-	}
+        wWanted = _WindowVal(aViewIdOrNil);
+        if (XCheckWindowEvent(dpy, wWanted, evMask, ev)) {
+            RETURN ( true );
+        }
     } else {
-	if (evMask == ~0) {
-	    XNextEvent(dpy, ev);
-	    RETURN (true);
-	}
-	if (XCheckMaskEvent(dpy, evMask, ev)) {
-	   RETURN (true);
-	}
+        if (evMask == ~0) {
+            XNextEvent(dpy, ev);
+            RETURN (true);
+        }
+        if (XCheckMaskEvent(dpy, evMask, ev)) {
+           RETURN (true);
+        }
     }
 %}.
     ^ false
 !
 
-handleAllEvents
+dleAllEvents
     "from now on, handle any kind of event"
 
     dispatchingExpose := nil
 !
 
-handleExposeOnlyFor:aView
+dleExposeOnlyFor:aView
     "from now on, handle expose events only"
 
     dispatchingExpose := aView id
 !
 
-mappingChanged:what event:eB
+pingChanged:what event:eB
     "One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap.
      Tell xlib about the fact."
 
     (what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[
-	self refreshKeyboardMapping:eB.
-	"Maybe some of our modifiers have been changed"
-	self initializeModifierMappings.
+        self refreshKeyboardMapping:eB.
+        "Maybe some of our modifiers have been changed"
+        self initializeModifierMappings.
     ].
 
     "Created: 1.12.1995 / 16:28:23 / stefan"
 !
 
-setEventMask:aMask in:aWindowId
+EventMask:aMask in:aWindowId
     "tell X that we are only interested in events from aMask, which
      is the bitwise or of the eventMask bits (see 'eventMaskFor:')"
 
@@ -4268,25 +4357,25 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isSmallInteger(aMask)) {
-	mask = __intVal(aMask);
+        mask = __intVal(aMask);
 
 #ifdef OLD
-	/* these may not be disabled */
-	mask |= ExposureMask | StructureNotifyMask |
-		KeyPressMask | KeyReleaseMask |
-		EnterWindowMask | LeaveWindowMask |
-		ButtonPressMask | ButtonMotionMask | ButtonReleaseMask;
+        /* these may not be disabled */
+        mask |= ExposureMask | StructureNotifyMask |
+                KeyPressMask | KeyReleaseMask |
+                EnterWindowMask | LeaveWindowMask |
+                ButtonPressMask | ButtonMotionMask | ButtonReleaseMask;
 #endif
 
-	XSelectInput(myDpy, _WindowVal(aWindowId), mask);
-	RETURN ( self );
+        XSelectInput(myDpy, _WindowVal(aWindowId), mask);
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-startDispatch
+rtDispatch
     "redefined to clear dispatchingExpose, which is a special X feature"
 
     dispatching ifTrue:[^ self].
@@ -4296,7 +4385,7 @@
 
 !XWorkstation methodsFor:'event sending'!
 
-sendKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId
+dKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId
     "send a keyPress/Release or buttonPress/Release event to some (possibly alien) view.
      TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
      For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
@@ -4311,143 +4400,143 @@
     int state;
 
     if (__isSmallInteger(stateMask)) {
-	state = __intVal(stateMask);
+        state = __intVal(stateMask);
     } else {
-	state = 0;
+        state = 0;
     }
 
     if (ISCONNECTED
      && __isSmallInteger(xPos) && __isSmallInteger(yPos)
      && (__isSmallInteger(keySymCodeOrButtonNr) || __isSymbol(keySymCodeOrButtonNr) || __isString(keySymCodeOrButtonNr))
      && (__isExternalAddress(targetId) || __isInteger(targetId))) {
-	Display *dpy = myDpy;
-
-	XEvent ev;
-	Window target;
-	Status result;
-	KeySym keySym, *syms;
-	int screen = __intVal(__INST(screen));
-	char s[2];
-	int nSyms;
-
-	if ((typeSymbol == @symbol(keyPress))
-	 || (typeSymbol == @symbol(keyRelease))) {
-	    if (__isSymbol(keySymCodeOrButtonNr) || __isString(keySymCodeOrButtonNr)) {
-		keySym = XStringToKeysym(__stringVal(keySymCodeOrButtonNr));
-	    } else {
-		if (__isCharacter(keySymCodeOrButtonNr)) {
-		    s[0] = __intVal(__characterVal(keySymCodeOrButtonNr));
-		    s[1] = '\0';
-		    keySym = XStringToKeysym(s);
-		} else {
-		    keySym = (KeySym) __intVal(keySymCodeOrButtonNr);
-		}
-	    }
-	    ev.xkey.keycode = XKeysymToKeycode(dpy, keySym);
-
-	    if (stateMask == nil) {
-		/*
-		 * get the modifier from the keySym
-		 */
-		nSyms = 0;
-		syms = XGetKeyboardMapping(dpy, ev.xkey.keycode, 1, &nSyms);
-		if (syms) {
-		    int i;
-
-		    for (i=0; i<nSyms; i++) {
-			if (syms[i] == keySym) {
+        Display *dpy = myDpy;
+
+        XEvent ev;
+        Window target;
+        Status result;
+        KeySym keySym, *syms;
+        int screen = __intVal(__INST(screen));
+        char s[2];
+        int nSyms;
+
+        if ((typeSymbol == @symbol(keyPress))
+         || (typeSymbol == @symbol(keyRelease))) {
+            if (__isSymbol(keySymCodeOrButtonNr) || __isString(keySymCodeOrButtonNr)) {
+                keySym = XStringToKeysym(__stringVal(keySymCodeOrButtonNr));
+            } else {
+                if (__isCharacter(keySymCodeOrButtonNr)) {
+                    s[0] = __intVal(__characterVal(keySymCodeOrButtonNr));
+                    s[1] = '\0';
+                    keySym = XStringToKeysym(s);
+                } else {
+                    keySym = (KeySym) __intVal(keySymCodeOrButtonNr);
+                }
+            }
+            ev.xkey.keycode = XKeysymToKeycode(dpy, keySym);
+
+            if (stateMask == nil) {
+                /*
+                 * get the modifier from the keySym
+                 */
+                nSyms = 0;
+                syms = XGetKeyboardMapping(dpy, ev.xkey.keycode, 1, &nSyms);
+                if (syms) {
+                    int i;
+
+                    for (i=0; i<nSyms; i++) {
+                        if (syms[i] == keySym) {
 #ifdef MODIFIERDEBUG
-			    printf("modifier-index is %d\n", i);
+                            printf("modifier-index is %d\n", i);
 #endif
-			    if (i) state = (1 << (i-1));
-			    break;
-			}
-		    }
-		    XFree(syms);
-		}
-	    }
-	} else {
-	    if ((typeSymbol == @symbol(buttonPress))
-	     || (typeSymbol == @symbol(buttonRelease))) {
-		if (__isSmallInteger(keySymCodeOrButtonNr)) {
-		    ev.xbutton.button = __intVal(keySymCodeOrButtonNr);
-		} else {
-		    ev.xbutton.button = 1;
-		}
-	    } else {
-		DPRINTF(("invalid sendEvent typeSymbol\n"));
-		RETURN (false);
-	    }
-	}
-
-	if (typeSymbol == @symbol(keyPress))
-	    ev.xany.type = KeyPress;
-	else if (typeSymbol == @symbol(keyRelease))
-	    ev.xany.type = KeyRelease;
-	else if (typeSymbol == @symbol(buttonPress))
-	    ev.xany.type = ButtonPress;
-	else if (typeSymbol == @symbol(buttonRelease))
-	    ev.xany.type = ButtonRelease;
-
-	if (__isExternalAddress(targetId)) {
-	    target = _WindowVal(targetId);
-	} else {
-	    target = (Window) __longIntVal(targetId);
-	}
-	ev.xkey.window = target;
-	ev.xkey.same_screen = 1;
-	ev.xkey.subwindow = 0;
-	ev.xkey.root = RootWindow(myDpy, screen);
-	ev.xkey.x = __intVal(xPos);
-	ev.xkey.y = __intVal(yPos);
-	ev.xkey.state = state;
-	ev.xkey.time = CurrentTime;
-
-	result = XSendEvent(dpy, target, False, 0 , &ev);
-	if ((result == BadValue) || (result == BadWindow)) {
-	    DPRINTF(("bad status\n"));
-	    RETURN ( false )
-	}
-	RETURN (true)
+                            if (i) state = (1 << (i-1));
+                            break;
+                        }
+                    }
+                    XFree(syms);
+                }
+            }
+        } else {
+            if ((typeSymbol == @symbol(buttonPress))
+             || (typeSymbol == @symbol(buttonRelease))) {
+                if (__isSmallInteger(keySymCodeOrButtonNr)) {
+                    ev.xbutton.button = __intVal(keySymCodeOrButtonNr);
+                } else {
+                    ev.xbutton.button = 1;
+                }
+            } else {
+                DPRINTF(("invalid sendEvent typeSymbol\n"));
+                RETURN (false);
+            }
+        }
+
+        if (typeSymbol == @symbol(keyPress))
+            ev.xany.type = KeyPress;
+        else if (typeSymbol == @symbol(keyRelease))
+            ev.xany.type = KeyRelease;
+        else if (typeSymbol == @symbol(buttonPress))
+            ev.xany.type = ButtonPress;
+        else if (typeSymbol == @symbol(buttonRelease))
+            ev.xany.type = ButtonRelease;
+
+        if (__isExternalAddress(targetId)) {
+            target = _WindowVal(targetId);
+        } else {
+            target = (Window) __longIntVal(targetId);
+        }
+        ev.xkey.window = target;
+        ev.xkey.same_screen = 1;
+        ev.xkey.subwindow = 0;
+        ev.xkey.root = RootWindow(myDpy, screen);
+        ev.xkey.x = __intVal(xPos);
+        ev.xkey.y = __intVal(yPos);
+        ev.xkey.state = state;
+        ev.xkey.time = CurrentTime;
+
+        result = XSendEvent(dpy, target, False, 0 , &ev);
+        if ((result == BadValue) || (result == BadWindow)) {
+            DPRINTF(("bad status\n"));
+            RETURN ( false )
+        }
+        RETURN (true)
     }
 %}.
     self primitiveFailed.
     ^ false
 !
 
-simulateKeyboardInput:aCharacterOrString inViewId:viewId
+ulateKeyboardInput:aCharacterOrString inViewId:viewId
     "send input to some other view, by simulating keyPress/keyRelease
      events. 
      Only a few control characters are supported.
      Notice: not all alien views allow this kind of synthetic input;
-	     some simply ignore it."
+             some simply ignore it."
 
     |control code state|
 
     aCharacterOrString isString ifTrue:[
-	aCharacterOrString do:[:char |
-	    self simulateKeyboardInput:char inViewId:viewId
-	].
-	^ self
+        aCharacterOrString do:[:char |
+            self simulateKeyboardInput:char inViewId:viewId
+        ].
+        ^ self
     ].
 
     control := false.
     code := aCharacterOrString asciiValue.
 
     (aCharacterOrString == Character cr) ifTrue:[
-	code := #Return
+        code := #Return
     ] ifFalse:[
-	(aCharacterOrString == Character tab) ifTrue:[
-	    code := #Tab 
-	] ifFalse:[
-	    (aCharacterOrString == Character esc) ifTrue:[
-		code := #Escape 
-	    ]
-	]
+        (aCharacterOrString == Character tab) ifTrue:[
+            code := #Tab 
+        ] ifFalse:[
+            (aCharacterOrString == Character esc) ifTrue:[
+                code := #Escape 
+            ]
+        ]
     ].
 
     control ifTrue:[
-	state := self controlMask
+        state := self controlMask
     ].
 
 
@@ -4457,11 +4546,11 @@
     "/ Hopefully, this is correct ...
 
     code isNumber ifTrue:[
-	code >= $A asciiValue ifTrue:[
-	    code <= $Z asciiValue ifTrue:[
-		state := self shiftMask
-	    ]
-	]
+        code >= $A asciiValue ifTrue:[
+            code <= $Z asciiValue ifTrue:[
+                state := self shiftMask
+            ]
+        ]
     ].
 
     self sendKeyOrButtonEvent:#keyPress x:0 y:0 keyOrButton:code state:state toViewId:viewId.
@@ -4482,7 +4571,7 @@
 
 !XWorkstation methodsFor:'font stuff'!
 
-createFontFor:aFontName
+ateFontFor:aFontName
     "a basic method for X-font allocation; this method allows
      any font to be aquired (even those not conforming to
      standard naming conventions, such as cursor, fixed or k14)"
@@ -4493,22 +4582,22 @@
     XFontStruct *newFont;
 
     if (ISCONNECTED) {
-	if (__isString(aFontName) || __isSymbol(aFontName)) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    newFont = XLoadQueryFont(myDpy, (char *)__stringVal(aFontName));
+        if (__isString(aFontName) || __isSymbol(aFontName)) {
+            BEGIN_INTERRUPTSBLOCKED
+            newFont = XLoadQueryFont(myDpy, (char *)__stringVal(aFontName));
 #ifdef COUNT_RESOURCES
-	    if (newFont)
-		__cnt_font++;
+            if (newFont)
+                __cnt_font++;
 #endif
-	    END_INTERRUPTSBLOCKED
-	    RETURN ( newFont ? __MKOBJ(newFont) : nil );
-	}
+            END_INTERRUPTSBLOCKED
+            RETURN ( newFont ? __MKOBJ(newFont) : nil );
+        }
     }
 %}.
     ^ nil
 !
 
-decomposeXFontName:aString into:aBlock
+omposeXFontName:aString into:aBlock
     "extract family, face, style and size from an
      X-font name 
      (-brand-family-face-style-moreStyle--height-size-res-res-?-??-coding); 
@@ -4519,36 +4608,36 @@
 
     aString isNil ifTrue:[^ false].
     (aString startsWith:'-') ifFalse:[
-	"
-	 take care for ill-named fonts (i.e. pre Rel4 fonts)
-	"
-	('*-*-[0-9]*' match:aString) ifTrue:[
-	    end := aString indexOf:$- startingAt:1.
-	    family := aString copyFrom:1 to:(end - 1).
-	    start := end + 1.
-	    end := aString indexOf:$- startingAt:start.
-	    style := aString copyFrom:start to:(end - 1).
-	    start := end + 1.
-	    size := aString copyFrom:start.
-	    size := (Number readFromString:size onError:[^false]).
-	    aBlock value:family value:nil value:style value:size value:nil.
-	    ^ true.
-	].
-	('*-[0-9]*' match:aString) ifTrue:[
-	    "
-	     something like lucidasans-24
-	    "
-	    end := aString indexOf:$- startingAt:1.
-
-	    family := aString copyFrom:1 to:(end - 1).
-	    start := end + 1.
-	    size := aString copyFrom:start.
-	    size := (Number readFromString:size onError:[^false]).
-	    aBlock value:family value:nil value:nil value:size value:nil.
-	    ^ true.
-	].
-	aBlock value:aString value:nil value:nil value:nil value:nil.
-	^ true.
+        "
+         take care for ill-named fonts (i.e. pre Rel4 fonts)
+        "
+        ('*-*-[0-9]*' match:aString) ifTrue:[
+            end := aString indexOf:$- startingAt:1.
+            family := aString copyFrom:1 to:(end - 1).
+            start := end + 1.
+            end := aString indexOf:$- startingAt:start.
+            style := aString copyFrom:start to:(end - 1).
+            start := end + 1.
+            size := aString copyFrom:start.
+            size := (Number readFromString:size onError:[^false]).
+            aBlock value:family value:nil value:style value:size value:nil.
+            ^ true.
+        ].
+        ('*-[0-9]*' match:aString) ifTrue:[
+            "
+             something like lucidasans-24
+            "
+            end := aString indexOf:$- startingAt:1.
+
+            family := aString copyFrom:1 to:(end - 1).
+            start := end + 1.
+            size := aString copyFrom:start.
+            size := (Number readFromString:size onError:[^false]).
+            aBlock value:family value:nil value:nil value:size value:nil.
+            ^ true.
+        ].
+        aBlock value:aString value:nil value:nil value:nil value:nil.
+        ^ true.
     ].
 
     end := aString indexOf:$- startingAt:2.
@@ -4570,15 +4659,15 @@
     (end == 0) ifTrue:[^ false].
     style := aString copyFrom:start to:(end - 1).
     (style = 'o') ifTrue:[
-	style := 'oblique'
+        style := 'oblique'
     ] ifFalse:[
-	(style = 'i') ifTrue:[
-	    style := 'italic'
-	] ifFalse:[
-	    (style = 'r') ifTrue:[
-		style := 'roman'
-	    ]
-	]
+        (style = 'i') ifTrue:[
+            style := 'italic'
+        ] ifFalse:[
+            (style = 'r') ifTrue:[
+                style := 'roman'
+            ]
+        ]
     ].
 
     start := end + 1.
@@ -4628,7 +4717,7 @@
     coding := aString copyFrom:start to:(end - 1).
 
     (moreStyle ~= 'normal' and:[moreStyle ~= '']) ifTrue:[
-	style := style, '-', moreStyle.
+        style := style, '-', moreStyle.
     ].
 
     aBlock value:family value:face value:style value:size value:coding.
@@ -4637,7 +4726,7 @@
     "Modified: 4.7.1996 / 11:12:25 / stefan"
 !
 
-encodingOf:aFontId
+odingOf:aFontId
     "the fonts encoding - if the font does not provide that info,
      return nil (and assume #ascii, which is a subset of #iso8859)."
 
@@ -4651,116 +4740,116 @@
     Atom fontAtom, registryAtom, encodingAtom, charSetCollAtom;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	registryAtom = XInternAtom(dpy, "CHARSET_REGISTRY", True);
-	encodingAtom = XInternAtom(dpy, "CHARSET_ENCODING", True);
-	charSetCollAtom = XInternAtom(dpy, "CHARSET_COLLECTIONS", True);
-	fontAtom = XInternAtom(dpy, "FONT", True);
-
-	if (__isExternalAddress(aFontId)) {
+        Display *dpy = myDpy;
+
+        registryAtom = XInternAtom(dpy, "CHARSET_REGISTRY", True);
+        encodingAtom = XInternAtom(dpy, "CHARSET_ENCODING", True);
+        charSetCollAtom = XInternAtom(dpy, "CHARSET_COLLECTIONS", True);
+        fontAtom = XInternAtom(dpy, "FONT", True);
+
+        if (__isExternalAddress(aFontId)) {
         
-	    f = _FontVal(aFontId);
-	    if (f) {
-		n = f->n_properties;
-		prop = f->properties;
-		if (prop) {
-		    while (n--) {
+            f = _FontVal(aFontId);
+            if (f) {
+                n = f->n_properties;
+                prop = f->properties;
+                if (prop) {
+                    while (n--) {
 #ifdef SUPERDEBUG
-			cp = XGetAtomName(dpy, prop->name);
-			printf("%s (%d) -> %d\n", cp, prop->name, prop->card32);
-			XFree(cp);
+                        cp = XGetAtomName(dpy, prop->name);
+                        printf("%s (%d) -> %d\n", cp, prop->name, prop->card32);
+                        XFree(cp);
 #endif
-			if (prop->name == XA_FULL_NAME) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				fullName = __MKSTRING(cp);
+                        if (prop->name == XA_FULL_NAME) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                fullName = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   FULL_NAME -> %s\n", cp);
+                                printf("   FULL_NAME -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			} else if (prop->name == fontAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				fontName = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        } else if (prop->name == fontAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                fontName = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   FONT -> %s\n", cp);
+                                printf("   FONT -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			} else if (prop->name == encodingAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				encoding = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        } else if (prop->name == encodingAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                encoding = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   ENCODING -> %s\n", cp);
+                                printf("   ENCODING -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			} else if (prop->name == registryAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				registry = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        } else if (prop->name == registryAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                registry = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   REGISTRY -> %s\n", cp);
+                                printf("   REGISTRY -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			} else if (prop->name == charSetCollAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				charSetCollections = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        } else if (prop->name == charSetCollAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                charSetCollections = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   CHARSET_COLLECTIONS -> %s\n", cp);
+                                printf("   CHARSET_COLLECTIONS -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			}
-			prop++;
-		    }
-		}
-	    }
-	}
+                                XFree(cp);
+                            }
+                        }
+                        prop++;
+                    }
+                }
+            }
+        }
     }
 %}.
     ^ self
-	extractEncodingFromRegistry:registry 
-	encoding:encoding 
-	charSetCollections:charSetCollections
-!
-
-extractEncodingFromRegistry:registry encoding:encoding charSetCollections:charSetCollections
+        extractEncodingFromRegistry:registry 
+        encoding:encoding 
+        charSetCollections:charSetCollections
+!
+
+ractEncodingFromRegistry:registry encoding:encoding charSetCollections:charSetCollections
     "this is pure magic ..."
 
     |enc charSets|
 
     (registry notNil and:[registry notEmpty]) ifTrue:[
-	enc := registry asLowercase asSymbol.
+        enc := registry asLowercase asSymbol.
     ] ifFalse:[
-	(encoding notNil and:[encoding notEmpty]) ifTrue:[
-	    enc := encoding asLowercase asSymbol
-	] ifFalse:[
-	    charSets := charSetCollections.    
-	    (charSets notNil and:[charSets notEmpty]) ifTrue:[
-		charSets := charSets asUppercase asCollectionOfWords.
-		(charSets includes:'ISO8859-1') ifTrue:[
-		    enc := #iso8859
-		] ifFalse:[
-		    (charSets includes:'ISO8859') ifTrue:[
-			enc := #iso8859
-		    ] ifFalse:[
-			(charSets includes:'ASCII') ifTrue:[
-			    enc := #ascii
-			] ifFalse:[
-			    (charSets includes:'ADOBE-STANDARD') ifTrue:[
-				enc := #iso8859
-			    ]
-			]
-		    ]
-		]
-	    ] 
-	]
+        (encoding notNil and:[encoding notEmpty]) ifTrue:[
+            enc := encoding asLowercase asSymbol
+        ] ifFalse:[
+            charSets := charSetCollections.    
+            (charSets notNil and:[charSets notEmpty]) ifTrue:[
+                charSets := charSets asUppercase asCollectionOfWords.
+                (charSets includes:'ISO8859-1') ifTrue:[
+                    enc := #iso8859
+                ] ifFalse:[
+                    (charSets includes:'ISO8859') ifTrue:[
+                        enc := #iso8859
+                    ] ifFalse:[
+                        (charSets includes:'ASCII') ifTrue:[
+                            enc := #ascii
+                        ] ifFalse:[
+                            (charSets includes:'ADOBE-STANDARD') ifTrue:[
+                                enc := #iso8859
+                            ]
+                        ]
+                    ]
+                ]
+            ] 
+        ]
     ].
     ^  enc
 
@@ -4768,7 +4857,7 @@
     "Modified: 17.4.1996 / 17:22:35 / cg"
 !
 
-flushListOfAvailableFonts
+shListOfAvailableFonts
     "flush the cached list of all available fonts on this display.
      Required if new fonts have been added on the display server."
 
@@ -4783,7 +4872,7 @@
     "Created: 20.2.1996 / 22:55:52 / cg"
 !
 
-fontMetricsOf:fontId into:aBlock
+tMetricsOf:fontId into:aBlock
     "evaluate aBlock, passing a fonts metrics as arguments"
 
     |encoding avgAscent avgDescent
@@ -4795,56 +4884,56 @@
     int len;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(fontId)) {
-	    f = _FontVal(fontId);
-	    if (f) {
+        if (__isExternalAddress(fontId)) {
+            f = _FontVal(fontId);
+            if (f) {
 #ifdef NOTDEF
-		char *cp;
-		XFontProp *prop;
-
-		n = f->n_properties;
-		prop = f->properties;
-
-		if (prop) {
-		    while (n--) {
-			if (prop->name == RESOLUTION_X) {
-			    resX = __MKSMALLINT(prop->card32);
-			} else if (prop->name == RESOLUTION_Y) {
-			    resY = __MKSMALLINT(prop->card32);
-			} else if (prop->name == RESOLUTION) {
-			    res = __MKSMALLINT(prop->card32);
-			}
-			prop++;
-		    }
-		}
+                char *cp;
+                XFontProp *prop;
+
+                n = f->n_properties;
+                prop = f->properties;
+
+                if (prop) {
+                    while (n--) {
+                        if (prop->name == RESOLUTION_X) {
+                            resX = __MKSMALLINT(prop->card32);
+                        } else if (prop->name == RESOLUTION_Y) {
+                            resY = __MKSMALLINT(prop->card32);
+                        } else if (prop->name == RESOLUTION) {
+                            res = __MKSMALLINT(prop->card32);
+                        }
+                        prop++;
+                    }
+                }
 #endif
 
-		avgAscent = __MKSMALLINT(f->ascent);
-		avgDescent = __MKSMALLINT(f->descent);
-		maxAscent = __MKSMALLINT(f->max_bounds.ascent);
-		maxDescent = __MKSMALLINT(f->max_bounds.descent);
-		minWidth = __MKSMALLINT(f->min_bounds.width);
-		maxWidth = __MKSMALLINT(f->max_bounds.width);
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth(f, " ", 1);
-		END_INTERRUPTSBLOCKED
-		avgWidth = __MKSMALLINT( len );
-	    }
-	}
+                avgAscent = __MKSMALLINT(f->ascent);
+                avgDescent = __MKSMALLINT(f->descent);
+                maxAscent = __MKSMALLINT(f->max_bounds.ascent);
+                maxDescent = __MKSMALLINT(f->max_bounds.descent);
+                minWidth = __MKSMALLINT(f->min_bounds.width);
+                maxWidth = __MKSMALLINT(f->max_bounds.width);
+                BEGIN_INTERRUPTSBLOCKED
+                len = XTextWidth(f, " ", 1);
+                END_INTERRUPTSBLOCKED
+                avgWidth = __MKSMALLINT( len );
+            }
+        }
     }
 %}.
     encoding := self encodingOf:fontId.
     aBlock value:encoding
-	   value:avgAscent
-	   value:avgDescent
-	   value:maxAscent
-	   value:maxDescent
-	   value:minWidth
-	   value:maxWidth
-	   value:avgWidth
-!
-
-fontResolutionOf:fontId
+           value:avgAscent
+           value:avgDescent
+           value:maxAscent
+           value:maxDescent
+           value:minWidth
+           value:maxWidth
+           value:avgWidth
+!
+
+tResolutionOf:fontId
     "return the resolution (as dpiX @ dpiY) of the font - this is usually the displays resolution,
      but due to errors in some XServer installations, some use 75dpi fonts on higher
      resolution displays and vice/versa."
@@ -4855,48 +4944,48 @@
     XFontStruct *f;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(fontId)) {
-	    f = _FontVal(fontId);
-	    if (f) {
-		char *cp;
-		XFontProp *prop;
-		Atom resolutionXAtom, resolutionYAtom;
-		int n;
-
-		n = f->n_properties;
-		prop = f->properties;
-
-		if (prop) {
-		    resolutionXAtom = XInternAtom(dpy, "RESOLUTION_X", True);
-		    resolutionYAtom = XInternAtom(dpy, "RESOLUTION_Y", True);
-
-		    while (n--) {
-			if (prop->name == resolutionXAtom) {
-			    resX = __MKSMALLINT(prop->card32);
-			} else if (prop->name == resolutionYAtom) {
-			    resY = __MKSMALLINT(prop->card32);
-			} else if (prop->name == XA_RESOLUTION) {
-			    res = __MKSMALLINT(prop->card32);
-			}
-			prop++;
-		    }
-		}
-	    }
-	}
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(fontId)) {
+            f = _FontVal(fontId);
+            if (f) {
+                char *cp;
+                XFontProp *prop;
+                Atom resolutionXAtom, resolutionYAtom;
+                int n;
+
+                n = f->n_properties;
+                prop = f->properties;
+
+                if (prop) {
+                    resolutionXAtom = XInternAtom(dpy, "RESOLUTION_X", True);
+                    resolutionYAtom = XInternAtom(dpy, "RESOLUTION_Y", True);
+
+                    while (n--) {
+                        if (prop->name == resolutionXAtom) {
+                            resX = __MKSMALLINT(prop->card32);
+                        } else if (prop->name == resolutionYAtom) {
+                            resY = __MKSMALLINT(prop->card32);
+                        } else if (prop->name == XA_RESOLUTION) {
+                            res = __MKSMALLINT(prop->card32);
+                        }
+                        prop++;
+                    }
+                }
+            }
+        }
     }
 %}.
     (resX notNil and:[resY notNil]) ifTrue:[
-	^ resX @ resY
+        ^ resX @ resY
     ].
     res notNil ifTrue:[
-	^ res @ res
+        ^ res @ res
     ].
     ^ self resolution
 !
 
-fullNameOf:aFontId
+lNameOf:aFontId
     "the fonts fullName - this is very device specific and should only be
      used for user feed-back (for example: in the fontPanel).
      If the display/font do not provide that info, return nil."
@@ -4911,57 +5000,57 @@
     Atom fontAtom;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	fontAtom = XInternAtom(dpy, "FONT", True);
-
-	if (__isExternalAddress(aFontId)) {
+        Display *dpy = myDpy;
+
+        fontAtom = XInternAtom(dpy, "FONT", True);
+
+        if (__isExternalAddress(aFontId)) {
         
-	    f = _FontVal(aFontId);
-	    if (f) {
-		n = f->n_properties;
-		prop = f->properties;
-		if (prop) {
-		    while (n--) {
+            f = _FontVal(aFontId);
+            if (f) {
+                n = f->n_properties;
+                prop = f->properties;
+                if (prop) {
+                    while (n--) {
 #ifdef SUPERDEBUG
-			cp = XGetAtomName(dpy, prop->name);
-			printf("%s (%d) -> %d\n", cp, prop->name, prop->card32);
-			XFree(cp);
+                        cp = XGetAtomName(dpy, prop->name);
+                        printf("%s (%d) -> %d\n", cp, prop->name, prop->card32);
+                        XFree(cp);
 #endif
-			if (prop->name == XA_FULL_NAME) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				fullName = __MKSTRING(cp);
+                        if (prop->name == XA_FULL_NAME) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                fullName = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   FULL_NAME -> %s\n", cp);
+                                printf("   FULL_NAME -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			}
-			if (prop->name == fontAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				fontName = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        }
+                        if (prop->name == fontAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                fontName = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   FONT -> %s\n", cp);
+                                printf("   FONT -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			}
-			prop++;
-		    }
-		}
-	    }
-	}
+                                XFree(cp);
+                            }
+                        }
+                        prop++;
+                    }
+                }
+            }
+        }
     }
 %}.
     (fullName notNil and:[fullName notEmpty]) ifTrue:[
-	^ fullName
+        ^ fullName
     ].
     ^ fontName
 !
 
-getAvailableFontsMatching:pattern
+AvailableFontsMatching:pattern
     "return an Array filled with font names matching aPattern"
 
 %{  /* UNLIMITEDSTACK */
@@ -4973,49 +5062,49 @@
     int i;
 
     if (ISCONNECTED) {
-	if (__isString(pattern)) {
-	    for (;;) {
-		fonts = XListFonts(myDpy, __stringVal(pattern), nnames, &available);
-		if ((fonts == NULL) || (available < nnames)) break;
-		XFreeFontNames(fonts);
-		nnames = available * 2;
-	    }
-	    if (fonts == NULL) {
-		RETURN ( nil );
-	    }
-	    /*
-	     * now, that we know the number of font names,
-	     * create the array ...
-	     */
-	    arr = __ARRAY_NEW_INT(available);
-	    if (! arr) {
-		RETURN (nil);
-	    }
-	    /*
-	     * ... and fill it
-	     */
-	    for (i=0; i<available; i++) {
-		__PROTECT__(arr);
-		str = __MKSTRING(fonts[i]);
-		__UNPROTECT__(arr);
-		__ArrayInstPtr(arr)->a_element[i] = str; __STORE(arr, str);
-	    }
-	    RETURN (arr);
-	}
+        if (__isString(pattern)) {
+            for (;;) {
+                fonts = XListFonts(myDpy, __stringVal(pattern), nnames, &available);
+                if ((fonts == NULL) || (available < nnames)) break;
+                XFreeFontNames(fonts);
+                nnames = available * 2;
+            }
+            if (fonts == NULL) {
+                RETURN ( nil );
+            }
+            /*
+             * now, that we know the number of font names,
+             * create the array ...
+             */
+            arr = __ARRAY_NEW_INT(available);
+            if (! arr) {
+                RETURN (nil);
+            }
+            /*
+             * ... and fill it
+             */
+            for (i=0; i<available; i++) {
+                __PROTECT__(arr);
+                str = __MKSTRING(fonts[i]);
+                __UNPROTECT__(arr);
+                __ArrayInstPtr(arr)->a_element[i] = str; __STORE(arr, str);
+            }
+            RETURN (arr);
+        }
     }
 %}.
     ^ nil
 !
 
-getDefaultFont
+DefaultFont
     "return a default font id - used when class Font cannot
      find anything usable"
 
      ^ self createFontFor:'fixed'
 !
 
-getFontWithFamily:familyString face:faceString
-	    style:styleArgString size:sizeArg encoding:encodingSym
+FontWithFamily:familyString face:faceString
+            style:styleArgString size:sizeArg encoding:encodingSym
 
     "try to get the specified font, if not available, try next smaller
      font. Access to X-fonts by name is possible, by passing the X font name
@@ -5028,22 +5117,22 @@
 
     "special: if face is nil, allow access to X-fonts"
     faceString isNil ifTrue:[
-	sizeArg notNil ifTrue:[
-	    theName := familyString , '-' , sizeArg printString
-	] ifFalse:[
-	    theName := familyString
-	].
-	theName isNil ifTrue:[
-	    "
-	     mhmh - fall back to the default font
-	    "
-	    theName := 'fixed'
-	].
-	theId := self createFontFor:theName.
-	theId isNil ifTrue:[
-	    theId := self getDefaultFont
-	].
-	^ theId
+        sizeArg notNil ifTrue:[
+            theName := familyString , '-' , sizeArg printString
+        ] ifFalse:[
+            theName := familyString
+        ].
+        theName isNil ifTrue:[
+            "
+             mhmh - fall back to the default font
+            "
+            theName := 'fixed'
+        ].
+        theId := self createFontFor:theName.
+        theId isNil ifTrue:[
+            theId := self getDefaultFont
+        ].
+        ^ theId
     ].
 
     "/ spacing other than 'normal' is contained as last component
@@ -5051,58 +5140,58 @@
 
     ((styleString endsWith:'-narrow') 
      or:[styleString endsWith:'-semicondensed']) ifTrue:[
-	|i|
-	i := styleString lastIndexOf:$-.
-	spacing := styleString copyFrom:(i+1).
-	styleString := styleString copyTo:(i-1).
+        |i|
+        i := styleString lastIndexOf:$-.
+        spacing := styleString copyFrom:(i+1).
+        styleString := styleString copyTo:(i-1).
     ] ifFalse:[
-	spacing := 'normal'.
+        spacing := 'normal'.
     ].
 
     xlatedStyle := styleString.
     xlatedStyle notNil ifTrue:[
-	xlatedStyle := xlatedStyle first asString
+        xlatedStyle := xlatedStyle first asString
     ].
 
     id := self 
-	    getFontWithFoundry:'*'
-	    family:familyString asLowercase
-	    weight:faceString
-	    slant:xlatedStyle
-	    spacing:spacing
-	    pixelSize:nil
-	    size:sizeArg 
-	    registry:encodingSym
-	    encoding:'*'.
+            getFontWithFoundry:'*'
+            family:familyString asLowercase
+            weight:faceString
+            slant:xlatedStyle
+            spacing:spacing
+            pixelSize:nil
+            size:sizeArg 
+            registry:encodingSym
+            encoding:'*'.
 
     id isNil ifTrue:[
-	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
-	    "/ too stupid: encodings come in both cases
-	    "/ and X does not ignore case
-	    "/
-	    id := self 
-		    getFontWithFoundry:'*'
-		    family:familyString asLowercase
-		    weight:faceString
-		    slant:xlatedStyle
-		    spacing:spacing
-		    pixelSize:nil
-		    size:sizeArg 
-		    registry:encodingSym asUppercase
-		    encoding:'*'.
-	    id isNil ifTrue:[
-		id := self 
-			getFontWithFoundry:'*'
-			family:familyString asLowercase
-			weight:faceString
-			slant:xlatedStyle
-			spacing:spacing
-			pixelSize:nil
-			size:sizeArg 
-			registry:encodingSym asLowercase
-			encoding:'*'.
-	    ]
-	]
+        (encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
+            "/ too stupid: encodings come in both cases
+            "/ and X does not ignore case
+            "/
+            id := self 
+                    getFontWithFoundry:'*'
+                    family:familyString asLowercase
+                    weight:faceString
+                    slant:xlatedStyle
+                    spacing:spacing
+                    pixelSize:nil
+                    size:sizeArg 
+                    registry:encodingSym asUppercase
+                    encoding:'*'.
+            id isNil ifTrue:[
+                id := self 
+                        getFontWithFoundry:'*'
+                        family:familyString asLowercase
+                        weight:faceString
+                        slant:xlatedStyle
+                        spacing:spacing
+                        pixelSize:nil
+                        size:sizeArg 
+                        registry:encodingSym asLowercase
+                        encoding:'*'.
+            ]
+        ]
     ].
     ^ id
 
@@ -5110,9 +5199,9 @@
     "Modified: 4.7.1996 / 11:38:47 / stefan"
 !
 
-getFontWithFoundry:foundry family:family weight:weight
-	      slant:slant spacing:spc pixelSize:pSize size:size 
-	      registry:registry encoding:encoding
+FontWithFoundry:foundry family:family weight:weight
+              slant:slant spacing:spc pixelSize:pSize size:size 
+              registry:registry encoding:encoding
 
     "get the specified font, if not available, return nil.
      This is the new font creation method - all others will be changed to
@@ -5136,70 +5225,70 @@
 
     "this works only on 'Release >= 3' - X-servers"
     "name is:
-	-foundry-family    -weight -slant-
-	 sony    helvetica bold     r
-	 adobe   courier   medium   i
-	 msic    fixed              o
-	 ...     ...
+        -foundry-family    -weight -slant-
+         sony    helvetica bold     r
+         adobe   courier   medium   i
+         msic    fixed              o
+         ...     ...
     "
 
     size isNil ifTrue:[
-	sizeMatch := '*'
+        sizeMatch := '*'
     ] ifFalse:[
-	sizeMatch := size printString , '0'
+        sizeMatch := size printString , '0'
     ].
     foundry isNil ifTrue:[
-	foundryMatch := '*'
+        foundryMatch := '*'
     ] ifFalse:[
-	foundryMatch := foundry
+        foundryMatch := foundry
     ].
     family isNil ifTrue:[
-	familyMatch := '*'
+        familyMatch := '*'
     ] ifFalse:[
-	familyMatch := family
+        familyMatch := family
     ].
     weight isNil ifTrue:[
-	weightMatch := '*'
+        weightMatch := '*'
     ] ifFalse:[
-	weightMatch := weight
+        weightMatch := weight
     ].
     slant isNil ifTrue:[
-	slantMatch := '*'
+        slantMatch := '*'
     ] ifFalse:[
-	slantMatch := slant
+        slantMatch := slant
     ].
     spc isNil ifTrue:[
-	spcMatch := '*'
+        spcMatch := '*'
     ] ifFalse:[
-	spcMatch := spc
+        spcMatch := spc
     ].
     pSize isNil ifTrue:[
-	pSizeMatch := '*'
+        pSizeMatch := '*'
     ] ifFalse:[
-	pSizeMatch := pSize printString
+        pSizeMatch := pSize printString
     ].
     registry isNil ifTrue:[
-	registryMatch := '*'
+        registryMatch := '*'
     ] ifFalse:[
-	registryMatch := registry
+        registryMatch := registry
     ].
     encoding isNil ifTrue:[
-	encodingMatch := '*'
+        encodingMatch := '*'
     ] ifFalse:[
-	encodingMatch := encoding
+        encodingMatch := encoding
     ].
 
     theName := ('-' , foundryMatch,
-		'-' , familyMatch,
-		'-' , weightMatch ,
-		'-' , slantMatch , 
-		'-' , spcMatch ,
-		'-*' ,
-		'-' , pSizeMatch ,
-		'-' , sizeMatch ,
-		'-*-*-*-*' ,
-		'-' , registryMatch ,
-		'-' , encodingMatch).
+                '-' , familyMatch,
+                '-' , weightMatch ,
+                '-' , slantMatch , 
+                '-' , spcMatch ,
+                '-*' ,
+                '-' , pSizeMatch ,
+                '-' , sizeMatch ,
+                '-*-*-*-*' ,
+                '-' , registryMatch ,
+                '-' , encodingMatch).
 
 "/  Transcript showCR:theName; endEntry.
 
@@ -5208,20 +5297,20 @@
 
     "
      Display getFontWithFoundry:'*'
-			 family:'courier'
-			 weight:'medium'
-			  slant:'r'
-			spacing:nil
-		      pixelSize:nil
-			   size:13
-		       registry:'iso8859'
-		       encoding:'*'
+                         family:'courier'
+                         weight:'medium'
+                          slant:'r'
+                        spacing:nil
+                      pixelSize:nil
+                           size:13
+                       registry:'iso8859'
+                       encoding:'*'
     "
 
     "Modified: 24.2.1996 / 22:33:29 / cg"
 !
 
-listOfAvailableFonts
+tOfAvailableFonts
     "return a list with all available fonts on this display.
      Since this takes a long time, keep the result of the query for the
      next time. The elements of the returned collection are instances of
@@ -5261,40 +5350,40 @@
 "/          listOfXFonts sort:[:a :b | a family < b family].
 "/      ].
 
-	"/
-	"/ new code:
-	"/ use new primitive to get font names;
-	"/ this is much faster, and also works on systems where
-	"/      a) xlsfonts is broken (sco)
-	"/      b) xlsfonts is not available (aix)
-	"/
-	names := self getAvailableFontsMatching:'*'.
-	names isNil ifTrue:[
-	    "no names returned ..."
-	    ^ nil
-	].
-	listOfXFonts := names collect:[:aName |
-				    |fntDescr|
-
-				    (self decomposeXFontName:aName into:
-					[:family :face :style :size :coding |
-					   family notNil ifTrue:[
-					       fntDescr := FontDescription
-							       family:family
-							       face:face
-							       style:style
-							       size:size
-							       encoding:coding.
-					   ] ifFalse:[
-					       fntDescr := FontDescription
-							       name:aName
-					   ]
-					]
-				    ) ifFalse:[
-					fntDescr := FontDescription name:aName.
-				    ].  
-				    fntDescr
-			    ].
+        "/
+        "/ new code:
+        "/ use new primitive to get font names;
+        "/ this is much faster, and also works on systems where
+        "/      a) xlsfonts is broken (sco)
+        "/      b) xlsfonts is not available (aix)
+        "/
+        names := self getAvailableFontsMatching:'*'.
+        names isNil ifTrue:[
+            "no names returned ..."
+            ^ nil
+        ].
+        listOfXFonts := names collect:[:aName |
+                                    |fntDescr|
+
+                                    (self decomposeXFontName:aName into:
+                                        [:family :face :style :size :coding |
+                                           family notNil ifTrue:[
+                                               fntDescr := FontDescription
+                                                               family:family
+                                                               face:face
+                                                               style:style
+                                                               size:size
+                                                               encoding:coding.
+                                           ] ifFalse:[
+                                               fntDescr := FontDescription
+                                                               name:aName
+                                           ]
+                                        ]
+                                    ) ifFalse:[
+                                        fntDescr := FontDescription name:aName.
+                                    ].  
+                                    fntDescr
+                            ].
 
     ].
     ^ listOfXFonts
@@ -5309,33 +5398,33 @@
     "Modified: 17.4.1996 / 15:27:57 / cg"
 !
 
-releaseFont:aFontId
+easeFont:aFontId
 
 %{  /* NOCONTEXT */
 
     XFontStruct *f;
 
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	if (f) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XFreeFont(myDpy, f);
+        f = _FontVal(aFontId);
+        if (f) {
+            BEGIN_INTERRUPTSBLOCKED
+            XFreeFont(myDpy, f);
 #ifdef COUNT_RESOURCES
-	    __cnt_font--;
+            __cnt_font--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	    RETURN ( self );
-	}
+            END_INTERRUPTSBLOCKED
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
+esInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
     "return a set of all available font sizes in aFamily/aFace/aStyle
      on this display.
      Redefined to handle X's special case of 0-size (which stands for any)"
@@ -5344,10 +5433,10 @@
 
     sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
     (sizes notNil and:[sizes includes:0]) ifTrue:[
-	"special: in X11R5 and above, size 0 means:
-	 there are scaled versions in all sizes available"
-
-	^ #(4 5 6 7 8 9 10 11 12 14 16 18 20 22 24 28 32 48 64)
+        "special: in X11R5 and above, size 0 means:
+         there are scaled versions in all sizes available"
+
+        ^ #(4 5 6 7 8 9 10 11 12 14 16 18 20 22 24 28 32 48 64)
     ].
     ^ sizes
 
@@ -5358,7 +5447,7 @@
     "Created: 27.2.1996 / 01:38:15 / cg"
 !
 
-widthOf:aString from:index1 to:index2 inFont:aFontId
+thOf:aString from:index1 to:index2 inFont:aFontId
 
 %{  /* NOCONTEXT */
 
@@ -5371,98 +5460,98 @@
     int nInstBytes;
 
     if (ISCONNECTED) {
-	if (__bothSmallInteger(index1, index2)
-	 && __isExternalAddress(aFontId)
-	 && __isNonNilObject(aString)) {
-	    f = _FontVal(aFontId);
-	    if (! f) goto fail;
-
-	    i1 = __intVal(index1) - 1;
-	    cls = __qClass(aString);
-
-	    if (i1 >= 0) {
-		i2 = __intVal(index2) - 1;
-		if (i2 < i1) {
-		    RETURN (self);
-		}
-
-		cp = (char *) _stringVal(aString);
-		l = i2 - i1 + 1;
-
-		if ((cls == @global(String)) || (cls == @global(Symbol))) {
-		    n = _stringSize(aString);
-		    if (i2 < n) {
-			cp += i1;
-			BEGIN_INTERRUPTSBLOCKED
-			len = XTextWidth(f, cp, l);
-			END_INTERRUPTSBLOCKED
-			RETURN ( __MKSMALLINT(len) );
-		    }
-		}
-
-		nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-		cp += nInstBytes;
-
-		if (__isBytes(aString)) {
-		    n = __byteArraySize(aString) - nInstBytes;
-		    if (i2 < n) {
-			cp += i1;
-			BEGIN_INTERRUPTSBLOCKED
-			len = XTextWidth(f, cp, l);
-			END_INTERRUPTSBLOCKED
-			RETURN ( __MKSMALLINT(len) );
-		    }
-		}
-
-		/* TWOBYTESTRINGS */
-		if (__isWords(aString)) {
-		    n = (__byteArraySize(aString) - nInstBytes) / 2;
-
-		    if (i2 < n) {
-			union {
-			    char b[2];
-			    unsigned short s;
-			} u;
-			int i;
-			XChar2b *cp2 = (XChar2b *)0;
-			int mustFree = 0;
-
-			cp += (i1 * 2);
-			if (l > 1000) l = 1000;
-
-			/*
-			 * ST/X TwoByteStrings store the asciiValue in native byteOrder;
-			 * X expects them MSB first
-			 * convert as required
-			 */
-
-			u.s = 0x1234;
-			if (u.b[0] != 0x12) {
-			    if (l <= NLOCALBUFFER) {
-				cp2 = xlatebuffer;
-			    } else {
-				cp2 = (XChar2b *)(malloc(l * 2));
-				mustFree = 1;
-			    }
-			    for (i=0; i<l; i++) {
-				cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
-				cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
-			    }
-			    cp = (char *) cp2;
-			}
-			BEGIN_INTERRUPTSBLOCKED
-			len = XTextWidth16(f, (XChar2b *)cp, l);
-			END_INTERRUPTSBLOCKED
-
-			if (mustFree) {
-			    free(cp2);
-			}
-
-			RETURN ( __MKSMALLINT(len) );
-		    }
-		}
-	    }
-	}
+        if (__bothSmallInteger(index1, index2)
+         && __isExternalAddress(aFontId)
+         && __isNonNilObject(aString)) {
+            f = _FontVal(aFontId);
+            if (! f) goto fail;
+
+            i1 = __intVal(index1) - 1;
+            cls = __qClass(aString);
+
+            if (i1 >= 0) {
+                i2 = __intVal(index2) - 1;
+                if (i2 < i1) {
+                    RETURN (self);
+                }
+
+                cp = (char *) _stringVal(aString);
+                l = i2 - i1 + 1;
+
+                if ((cls == @global(String)) || (cls == @global(Symbol))) {
+                    n = _stringSize(aString);
+                    if (i2 < n) {
+                        cp += i1;
+                        BEGIN_INTERRUPTSBLOCKED
+                        len = XTextWidth(f, cp, l);
+                        END_INTERRUPTSBLOCKED
+                        RETURN ( __MKSMALLINT(len) );
+                    }
+                }
+
+                nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+                cp += nInstBytes;
+
+                if (__isBytes(aString)) {
+                    n = __byteArraySize(aString) - nInstBytes;
+                    if (i2 < n) {
+                        cp += i1;
+                        BEGIN_INTERRUPTSBLOCKED
+                        len = XTextWidth(f, cp, l);
+                        END_INTERRUPTSBLOCKED
+                        RETURN ( __MKSMALLINT(len) );
+                    }
+                }
+
+                /* TWOBYTESTRINGS */
+                if (__isWords(aString)) {
+                    n = (__byteArraySize(aString) - nInstBytes) / 2;
+
+                    if (i2 < n) {
+                        union {
+                            char b[2];
+                            unsigned short s;
+                        } u;
+                        int i;
+                        XChar2b *cp2 = (XChar2b *)0;
+                        int mustFree = 0;
+
+                        cp += (i1 * 2);
+                        if (l > 1000) l = 1000;
+
+                        /*
+                         * ST/X TwoByteStrings store the asciiValue in native byteOrder;
+                         * X expects them MSB first
+                         * convert as required
+                         */
+
+                        u.s = 0x1234;
+                        if (u.b[0] != 0x12) {
+                            if (l <= NLOCALBUFFER) {
+                                cp2 = xlatebuffer;
+                            } else {
+                                cp2 = (XChar2b *)(malloc(l * 2));
+                                mustFree = 1;
+                            }
+                            for (i=0; i<l; i++) {
+                                cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
+                                cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
+                            }
+                            cp = (char *) cp2;
+                        }
+                        BEGIN_INTERRUPTSBLOCKED
+                        len = XTextWidth16(f, (XChar2b *)cp, l);
+                        END_INTERRUPTSBLOCKED
+
+                        if (mustFree) {
+                            free(cp2);
+                        }
+
+                        RETURN ( __MKSMALLINT(len) );
+                    }
+                }
+            }
+        }
     }
 #undef NLOCALBUFFER
 fail: ;
@@ -5471,7 +5560,7 @@
     ^ nil
 !
 
-widthOf:aString inFont:aFontId
+thOf:aString inFont:aFontId
 
 %{  /* NOCONTEXT */
 
@@ -5484,81 +5573,81 @@
     int nInstBytes;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aFontId)
-	 && __isNonNilObject(aString)) {
-	    f = _FontVal(aFontId);
-	    if (! f) goto fail;
-
-	    cls = __qClass(aString);
-
-	    cp = (char *)_stringVal(aString);
-
-	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
-		n = _stringSize(aString);
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth(f, cp, n);
-		END_INTERRUPTSBLOCKED
-		RETURN ( __MKSMALLINT(len) );
-	    }
-
-	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-	    cp += nInstBytes;
-
-	    if (__isBytes(aString)) {
-		n = __byteArraySize(aString) - nInstBytes;
-
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth(f, cp, n);
-		END_INTERRUPTSBLOCKED
-		RETURN ( __MKSMALLINT(len) );
-	    }
-
-	    /* TWOBYTESTRINGS */
-	    if (__isWords(aString)) {
-		union {
-		    char b[2];
-		    unsigned short s;
-		} u;
-		int i;
-		XChar2b *cp2;
-		int mustFree = 0;
-
-		n = (__byteArraySize(aString) - nInstBytes) / 2;
-		if (n > 1000) n = 1000;
-
-		/*
-		 * ST/X TwoByteStrings store the asciiValue in native byteOrder;
-		 * X expects them MSB first
-		 * convert as required
-		 */
-
-		u.s = 0x1234;
-		if (u.b[0] != 0x12) {
-		    if (n <= NLOCALBUFFER) {
-			cp2 = xlatebuffer;
-		    } else {
-			cp2 = (XChar2b *)(malloc(n * 2));
-			mustFree = 1;
-		    }
-
-		    for (i=0; i<n; i++) {
-			cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
-			cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
-		    }
-		    cp = (char *) cp2;
-		}
-
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth16(f, (XChar2b *)cp, n);
-		END_INTERRUPTSBLOCKED
-
-		if (mustFree) {
-		    free(cp2);
-		}
-
-		RETURN ( __MKSMALLINT(len) );
-	    }
-	}
+        if (__isExternalAddress(aFontId)
+         && __isNonNilObject(aString)) {
+            f = _FontVal(aFontId);
+            if (! f) goto fail;
+
+            cls = __qClass(aString);
+
+            cp = (char *)_stringVal(aString);
+
+            if ((cls == @global(String)) || (cls == @global(Symbol))) {
+                n = _stringSize(aString);
+                BEGIN_INTERRUPTSBLOCKED
+                len = XTextWidth(f, cp, n);
+                END_INTERRUPTSBLOCKED
+                RETURN ( __MKSMALLINT(len) );
+            }
+
+            nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+            cp += nInstBytes;
+
+            if (__isBytes(aString)) {
+                n = __byteArraySize(aString) - nInstBytes;
+
+                BEGIN_INTERRUPTSBLOCKED
+                len = XTextWidth(f, cp, n);
+                END_INTERRUPTSBLOCKED
+                RETURN ( __MKSMALLINT(len) );
+            }
+
+            /* TWOBYTESTRINGS */
+            if (__isWords(aString)) {
+                union {
+                    char b[2];
+                    unsigned short s;
+                } u;
+                int i;
+                XChar2b *cp2;
+                int mustFree = 0;
+
+                n = (__byteArraySize(aString) - nInstBytes) / 2;
+                if (n > 1000) n = 1000;
+
+                /*
+                 * ST/X TwoByteStrings store the asciiValue in native byteOrder;
+                 * X expects them MSB first
+                 * convert as required
+                 */
+
+                u.s = 0x1234;
+                if (u.b[0] != 0x12) {
+                    if (n <= NLOCALBUFFER) {
+                        cp2 = xlatebuffer;
+                    } else {
+                        cp2 = (XChar2b *)(malloc(n * 2));
+                        mustFree = 1;
+                    }
+
+                    for (i=0; i<n; i++) {
+                        cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
+                        cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
+                    }
+                    cp = (char *) cp2;
+                }
+
+                BEGIN_INTERRUPTSBLOCKED
+                len = XTextWidth16(f, (XChar2b *)cp, n);
+                END_INTERRUPTSBLOCKED
+
+                if (mustFree) {
+                    free(cp2);
+                }
+
+                RETURN ( __MKSMALLINT(len) );
+            }
+        }
     }
 #undef NLOCALBUFFER
   fail: ;
@@ -5569,97 +5658,97 @@
 
 !XWorkstation methodsFor:'grabbing '!
 
-allowEvents:mode
+owEvents:mode
 %{  /* NOCONTEXT */
 
     int _mode, ok = 1;
 
     if (mode == @symbol(asyncPointer))
-	_mode = AsyncPointer;
+        _mode = AsyncPointer;
     else if (mode == @symbol(syncPointer))
-	_mode = SyncPointer;
+        _mode = SyncPointer;
     else if (mode == @symbol(asyncKeyboard))
-	_mode = AsyncKeyboard;
+        _mode = AsyncKeyboard;
     else if (mode == @symbol(syncKeyboard))
-	_mode = SyncKeyboard;
+        _mode = SyncKeyboard;
     else if (mode == @symbol(syncBoth))
-	_mode = SyncBoth;
+        _mode = SyncBoth;
     else if (mode == @symbol(asyncBoth))
-	_mode = AsyncBoth;
+        _mode = AsyncBoth;
     else if (mode == @symbol(replayPointer))
-	_mode = ReplayPointer;
+        _mode = ReplayPointer;
     else if (mode == @symbol(replayKeyboard))
-	_mode = ReplayKeyboard;
+        _mode = ReplayKeyboard;
     else
-	ok = 0;
+        ok = 0;
 
     if (ok) {
-	if (ISCONNECTED) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XAllowEvents(myDpy, _mode, CurrentTime);
-	    END_INTERRUPTSBLOCKED
-	    RETURN (self);
-	}
+        if (ISCONNECTED) {
+            BEGIN_INTERRUPTSBLOCKED
+            XAllowEvents(myDpy, _mode, CurrentTime);
+            END_INTERRUPTSBLOCKED
+            RETURN (self);
+        }
     }
 %}.
     self primitiveFailed
 !
 
-grabKeyboardIn:aWindowId
+bKeyboardIn:aWindowId
     "grab the keyboard"
 
 %{  /* NOCONTEXT */
     int result, ok;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    result = XGrabKeyboard(myDpy,
-				   _WindowVal(aWindowId),
-				   True /* False */,
-				   GrabModeAsync,
-				   GrabModeAsync,
-				   CurrentTime);
-	    END_INTERRUPTSBLOCKED
-	    ok = 0;
-	    switch(result) {
-		case AlreadyGrabbed: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab keyboard: AlreadyGrabbed\n");
-		    }
-		    break;
-		case GrabNotViewable: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab keyboard: GrabNotViewable\n");
-		    }
-		    break;
-		case GrabInvalidTime: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab keyboard: InvalidTime\n");
-		    }
-		    break;
-		case GrabFrozen: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab keyboard: Frozen\n");
-		    }
-		    break;
-		default:
-		    ok = 1;
-		    break;
-	    }
-	    if (! ok) {
-		XUngrabKeyboard(myDpy, CurrentTime);
-		RETURN (false);
-	    }
-
-	    RETURN ( true );
-	}
+        if (__isExternalAddress(aWindowId)) {
+            BEGIN_INTERRUPTSBLOCKED
+            result = XGrabKeyboard(myDpy,
+                                   _WindowVal(aWindowId),
+                                   True /* False */,
+                                   GrabModeAsync,
+                                   GrabModeAsync,
+                                   CurrentTime);
+            END_INTERRUPTSBLOCKED
+            ok = 0;
+            switch(result) {
+                case AlreadyGrabbed: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab keyboard: AlreadyGrabbed\n");
+                    }
+                    break;
+                case GrabNotViewable: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab keyboard: GrabNotViewable\n");
+                    }
+                    break;
+                case GrabInvalidTime: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab keyboard: InvalidTime\n");
+                    }
+                    break;
+                case GrabFrozen: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab keyboard: Frozen\n");
+                    }
+                    break;
+                default:
+                    ok = 1;
+                    break;
+            }
+            if (! ok) {
+                XUngrabKeyboard(myDpy, CurrentTime);
+                RETURN (false);
+            }
+
+            RETURN ( true );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
+bPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
     "grap the pointer - return true if ok"
 
 %{  /* NOCONTEXT */
@@ -5670,101 +5759,101 @@
     int pointer_mode, keyboard_mode;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)) {
-	    if (__isExternalAddress(confineId)) 
-		confineWin = _WindowVal(confineId);
-	    else
-		confineWin = (Window) None;
-
-	    if (__isExternalAddress(aCursorId)) 
-		curs = _CursorVal(aCursorId);
-	    else
-		curs = (Cursor) None;
-
-	    if (pMode == @symbol(sync))
-		pointer_mode = GrabModeSync;
-	    else
-		pointer_mode = GrabModeAsync;
-
-	    if (kMode == @symbol(sync))
-		keyboard_mode = GrabModeSync;
-	    else
-		keyboard_mode = GrabModeAsync;
-
-	    BEGIN_INTERRUPTSBLOCKED
-	    result = XGrabPointer(myDpy,
-				  _WindowVal(aWindowId), 
-				  False, 
-				  ButtonPressMask | ButtonMotionMask | ButtonReleaseMask,
-				  pointer_mode, keyboard_mode,
-				  confineWin,
-				  curs,
-				  CurrentTime);
-	    END_INTERRUPTSBLOCKED
-
-	    ok = 0;
-	    switch (result) {
-		case AlreadyGrabbed: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab pointer: AlreadyGrabbed\n");
-		    }
-		    break;
-		case GrabNotViewable: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab pointer: GrabNotViewable\n");
-		    }
-		    break;
-		case GrabInvalidTime: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab pointer: InvalidTime\n");
-		    }
-		    break;
-		case GrabFrozen: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab pointer: Frozen\n");
-		    }
-		    break;
-		default:
-		    ok = 1;
-		    break;
-	    }
-
-	    if (! ok) {
-		XUngrabPointer(myDpy, CurrentTime);
-		RETURN (false);
-	    }
-	    RETURN ( true );
-	}
+        if (__isExternalAddress(aWindowId)) {
+            if (__isExternalAddress(confineId)) 
+                confineWin = _WindowVal(confineId);
+            else
+                confineWin = (Window) None;
+
+            if (__isExternalAddress(aCursorId)) 
+                curs = _CursorVal(aCursorId);
+            else
+                curs = (Cursor) None;
+
+            if (pMode == @symbol(sync))
+                pointer_mode = GrabModeSync;
+            else
+                pointer_mode = GrabModeAsync;
+
+            if (kMode == @symbol(sync))
+                keyboard_mode = GrabModeSync;
+            else
+                keyboard_mode = GrabModeAsync;
+
+            BEGIN_INTERRUPTSBLOCKED
+            result = XGrabPointer(myDpy,
+                                  _WindowVal(aWindowId), 
+                                  False, 
+                                  ButtonPressMask | ButtonMotionMask | ButtonReleaseMask,
+                                  pointer_mode, keyboard_mode,
+                                  confineWin,
+                                  curs,
+                                  CurrentTime);
+            END_INTERRUPTSBLOCKED
+
+            ok = 0;
+            switch (result) {
+                case AlreadyGrabbed: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab pointer: AlreadyGrabbed\n");
+                    }
+                    break;
+                case GrabNotViewable: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab pointer: GrabNotViewable\n");
+                    }
+                    break;
+                case GrabInvalidTime: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab pointer: InvalidTime\n");
+                    }
+                    break;
+                case GrabFrozen: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab pointer: Frozen\n");
+                    }
+                    break;
+                default:
+                    ok = 1;
+                    break;
+            }
+
+            if (! ok) {
+                XUngrabPointer(myDpy, CurrentTime);
+                RETURN (false);
+            }
+            RETURN ( true );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-ungrabKeyboard
+rabKeyboard
     "release the keyboard"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XUngrabKeyboard(myDpy, CurrentTime);
-	XSync(myDpy, 0);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XUngrabKeyboard(myDpy, CurrentTime);
+        XSync(myDpy, 0);
+        END_INTERRUPTSBLOCKED
     }
 %}.
     activeKeyboardGrab := nil
 !
 
-ungrabPointer
+rabPointer
     "release the pointer"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XUngrabPointer(myDpy, CurrentTime);
-	XSync(myDpy, 0);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XUngrabPointer(myDpy, CurrentTime);
+        XSync(myDpy, 0);
+        END_INTERRUPTSBLOCKED
     }
 %}.
     activePointerGrab := nil
@@ -5772,7 +5861,7 @@
 
 !XWorkstation methodsFor:'graphic context stuff'!
 
-noClipIn:aGCId
+lipIn:aGCId
     "disable clipping rectangle"
 
 %{  /* NOCONTEXT */
@@ -5781,34 +5870,34 @@
     GC gc;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    gcv.clip_mask = None;
-	    XChangeGC(myDpy, gc, GCClipMask, &gcv);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            gcv.clip_mask = None;
+            XChangeGC(myDpy, gc, GCClipMask, &gcv);
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setBackground:bgColorIndex in:aGCId
+Background:bgColorIndex in:aGCId
     "set background color to be drawn with"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __isSmallInteger(bgColorIndex)) {
-	    XSetBackground(myDpy, _GCVal(aGCId), __intVal(bgColorIndex));
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __isSmallInteger(bgColorIndex)) {
+            XSetBackground(myDpy, _GCVal(aGCId), __intVal(bgColorIndex));
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setBitmapMask:aBitmapId in:aGCId
+BitmapMask:aBitmapId in:aGCId
     "set or clear the drawing mask - a bitmap mask using current fg/bg"
 
 %{  /* NOCONTEXT */
@@ -5817,27 +5906,27 @@
     Pixmap bitmap;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (__isExternalAddress(aBitmapId)) {
-		bitmap = _PixmapVal(aBitmapId);
-		XSetStipple(dpy, gc, bitmap);
-		XSetFillStyle(dpy, gc, FillOpaqueStippled);
-		RETURN ( self );
-	    }
-	    if (aBitmapId == nil) {
-		XSetFillStyle(dpy, gc, FillSolid);
-		RETURN ( self );
-	    }
-	}
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (__isExternalAddress(aBitmapId)) {
+                bitmap = _PixmapVal(aBitmapId);
+                XSetStipple(dpy, gc, bitmap);
+                XSetFillStyle(dpy, gc, FillOpaqueStippled);
+                RETURN ( self );
+            }
+            if (aBitmapId == nil) {
+                XSetFillStyle(dpy, gc, FillSolid);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setClipByChildren:aBool in:aGCId
+ClipByChildren:aBool in:aGCId
     "enable/disable drawing into child views"
 
 %{  /* NOCONTEXT */
@@ -5846,22 +5935,22 @@
     GC gc;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (aBool == true)
-		gcv.subwindow_mode = ClipByChildren;
-	    else
-		gcv.subwindow_mode = IncludeInferiors;
-
-	    XChangeGC(myDpy, gc, GCSubwindowMode, &gcv);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (aBool == true)
+                gcv.subwindow_mode = ClipByChildren;
+            else
+                gcv.subwindow_mode = IncludeInferiors;
+
+            XChangeGC(myDpy, gc, GCSubwindowMode, &gcv);
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setClipX:clipX y:clipY width:clipWidth height:clipHeight in:aGCId
+ClipX:clipX y:clipY width:clipWidth height:clipHeight in:aGCId
     "clip to a rectangle"
 
 %{  /* NOCONTEXT */
@@ -5869,36 +5958,36 @@
     XRectangle r;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __bothSmallInteger(clipX, clipY)
-	 && __bothSmallInteger(clipWidth, clipHeight)) {
-	    r.x = __intVal(clipX);
-	    r.y = __intVal(clipY);
-	    r.width = __intVal(clipWidth);
-	    r.height = __intVal(clipHeight);
-	    XSetClipRectangles(myDpy, _GCVal(aGCId), 0, 0, &r, 1, Unsorted);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __bothSmallInteger(clipX, clipY)
+         && __bothSmallInteger(clipWidth, clipHeight)) {
+            r.x = __intVal(clipX);
+            r.y = __intVal(clipY);
+            r.width = __intVal(clipWidth);
+            r.height = __intVal(clipHeight);
+            XSetClipRectangles(myDpy, _GCVal(aGCId), 0, 0, &r, 1, Unsorted);
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setDashes:dashList dashOffset:offset in:aGCId
+Dashes:dashList dashOffset:offset in:aGCId
     "set line attributes"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __isSmallInteger(offset)
-	 && __isByteArray(dashList)) {
-	    XSetDashes(myDpy, _GCVal(aGCId), 
-		       __intVal(offset),
-		       __ByteArrayInstPtr(dashList)->ba_element,
-		       __byteArraySize(dashList));
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __isSmallInteger(offset)
+         && __isByteArray(dashList)) {
+            XSetDashes(myDpy, _GCVal(aGCId), 
+                       __intVal(offset),
+                       __ByteArrayInstPtr(dashList)->ba_element,
+                       __byteArraySize(dashList));
+            RETURN ( self );
+        }
     }
 bad: ;
 %}.
@@ -5910,7 +5999,7 @@
     self primitiveFailed
 !
 
-setFont:aFontId in:aGCId
+Font:aFontId in:aGCId
     "set font to be drawn in"
 
 %{  /* NOCONTEXT */
@@ -5918,12 +6007,12 @@
     XFontStruct *f;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aFontId)
-	 && __isExternalAddress(aGCId)) {
-	    f = (XFontStruct *) _FontVal(aFontId);
-	    XSetFont(myDpy, _GCVal(aGCId), f->fid);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aFontId)
+         && __isExternalAddress(aGCId)) {
+            f = (XFontStruct *) _FontVal(aFontId);
+            XSetFont(myDpy, _GCVal(aGCId), f->fid);
+            RETURN ( self );
+        }
     }
 %}.
     "
@@ -5932,7 +6021,7 @@
     self primitiveFailed
 !
 
-setForeground:fgColorIndex background:bgColorIndex in:aGCId
+Foreground:fgColorIndex background:bgColorIndex in:aGCId
     "set foreground and background colors to be drawn with"
 
 %{  /* NOCONTEXT */
@@ -5940,21 +6029,21 @@
     GC gc;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-	if (__bothSmallInteger(fgColorIndex, bgColorIndex)
-	 && __isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-
-	    XSetForeground(dpy, gc, __intVal(fgColorIndex));
-	    XSetBackground(dpy, gc, __intVal(bgColorIndex));
-	    RETURN ( self );
-	}
+        Display *dpy = myDpy;
+        if (__bothSmallInteger(fgColorIndex, bgColorIndex)
+         && __isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+
+            XSetForeground(dpy, gc, __intVal(fgColorIndex));
+            XSetBackground(dpy, gc, __intVal(bgColorIndex));
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setForeground:fgColor background:bgColor mask:aBitmapId in:aGCId
+Foreground:fgColor background:bgColor mask:aBitmapId in:aGCId
     "set foreground and background colors to be drawn with using mask or
      solid (if aBitmapId is nil)"
 
@@ -5963,31 +6052,31 @@
     GC gc;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (__isSmallInteger(fgColor))
-		XSetForeground(dpy, gc, __intVal(fgColor));
-	    if (__isSmallInteger(bgColor))
-		XSetBackground(dpy, gc, __intVal(bgColor));
-
-	    if (__isExternalAddress(aBitmapId)) {
-		XSetStipple(dpy, gc, _PixmapVal(aBitmapId));
-		XSetFillStyle(dpy, gc, FillOpaqueStippled);
-		RETURN ( self );
-	    }
-	    if (aBitmapId == nil) {
-		XSetFillStyle(dpy, gc, FillSolid);
-		RETURN ( self );
-	    }
-	}
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (__isSmallInteger(fgColor))
+                XSetForeground(dpy, gc, __intVal(fgColor));
+            if (__isSmallInteger(bgColor))
+                XSetBackground(dpy, gc, __intVal(bgColor));
+
+            if (__isExternalAddress(aBitmapId)) {
+                XSetStipple(dpy, gc, _PixmapVal(aBitmapId));
+                XSetFillStyle(dpy, gc, FillOpaqueStippled);
+                RETURN ( self );
+            }
+            if (aBitmapId == nil) {
+                XSetFillStyle(dpy, gc, FillSolid);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setForeground:fgColor background:bgColor mask:aBitmapId lineWidth:lw in:aGCId
+Foreground:fgColor background:bgColor mask:aBitmapId lineWidth:lw in:aGCId
     "set foreground and background colors to be drawn with using mask or
      solid (if aBitmapId is nil); also set lineWidth"
 
@@ -5996,51 +6085,51 @@
     GC gc;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (__isSmallInteger(lw)) {
-		XSetLineAttributes(dpy, gc, __intVal(lw),
-					LineSolid, CapNotLast, JoinMiter);
-	    }
-	    if (__isSmallInteger(fgColor))
-		XSetForeground(dpy, gc, __intVal(fgColor));
-	    if (__isSmallInteger(bgColor))
-		XSetBackground(dpy, gc, __intVal(bgColor));
-
-	    if (__isExternalAddress(aBitmapId)) {
-		XSetStipple(dpy, gc, _PixmapVal(aBitmapId));
-		XSetFillStyle(dpy, gc, FillOpaqueStippled);
-		RETURN ( self );
-	    }
-	    if (aBitmapId == nil) {
-		XSetFillStyle(dpy, gc, FillSolid);
-		RETURN ( self );
-	    }
-	}
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (__isSmallInteger(lw)) {
+                XSetLineAttributes(dpy, gc, __intVal(lw),
+                                        LineSolid, CapNotLast, JoinMiter);
+            }
+            if (__isSmallInteger(fgColor))
+                XSetForeground(dpy, gc, __intVal(fgColor));
+            if (__isSmallInteger(bgColor))
+                XSetBackground(dpy, gc, __intVal(bgColor));
+
+            if (__isExternalAddress(aBitmapId)) {
+                XSetStipple(dpy, gc, _PixmapVal(aBitmapId));
+                XSetFillStyle(dpy, gc, FillOpaqueStippled);
+                RETURN ( self );
+            }
+            if (aBitmapId == nil) {
+                XSetFillStyle(dpy, gc, FillSolid);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setForeground:fgColorIndex in:aGCId
+Foreground:fgColorIndex in:aGCId
     "set foreground color to be drawn with"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __isSmallInteger(fgColorIndex)) {
-	    XSetForeground(myDpy, _GCVal(aGCId), __intVal(fgColorIndex));
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __isSmallInteger(fgColorIndex)) {
+            XSetForeground(myDpy, _GCVal(aGCId), __intVal(fgColorIndex));
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setFunction:aFunctionSymbol in:aGCId
+Function:aFunctionSymbol in:aGCId
     "set alu function to be drawn with"
 
 %{  /* NOCONTEXT */
@@ -6049,22 +6138,22 @@
     int fun = -1;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (aFunctionSymbol == @symbol(copy)) fun = GXcopy;
-	    else if (aFunctionSymbol == @symbol(copyInverted)) fun = GXcopyInverted;
-	    else if (aFunctionSymbol == @symbol(xor)) fun = GXxor;
-	    else if (aFunctionSymbol == @symbol(and)) fun = GXand;
-	    else if (aFunctionSymbol == @symbol(andReverse)) fun = GXandReverse;
-	    else if (aFunctionSymbol == @symbol(andInverted)) fun = GXandInverted;
-	    else if (aFunctionSymbol == @symbol(or)) fun = GXor;
-	    else if (aFunctionSymbol == @symbol(orReverse)) fun = GXorReverse;
-	    else if (aFunctionSymbol == @symbol(orInverted)) fun = GXorInverted;
-	    if (fun != -1) {
-		XSetFunction(myDpy, gc, fun);
-		RETURN ( self );
-	    }
-	}
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (aFunctionSymbol == @symbol(copy)) fun = GXcopy;
+            else if (aFunctionSymbol == @symbol(copyInverted)) fun = GXcopyInverted;
+            else if (aFunctionSymbol == @symbol(xor)) fun = GXxor;
+            else if (aFunctionSymbol == @symbol(and)) fun = GXand;
+            else if (aFunctionSymbol == @symbol(andReverse)) fun = GXandReverse;
+            else if (aFunctionSymbol == @symbol(andInverted)) fun = GXandInverted;
+            else if (aFunctionSymbol == @symbol(or)) fun = GXor;
+            else if (aFunctionSymbol == @symbol(orReverse)) fun = GXorReverse;
+            else if (aFunctionSymbol == @symbol(orInverted)) fun = GXorInverted;
+            if (fun != -1) {
+                XSetFunction(myDpy, gc, fun);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     "
@@ -6075,23 +6164,23 @@
     self primitiveFailed
 !
 
-setGraphicsExposures:aBoolean in:aGCId
+GraphicsExposures:aBoolean in:aGCId
     "set or clear the graphics exposures flag"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    XSetGraphicsExposures(myDpy, _GCVal(aGCId), (aBoolean==true)?1:0);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)) {
+            XSetGraphicsExposures(myDpy, _GCVal(aGCId), (aBoolean==true)?1:0);
+            RETURN ( self );
+        }
     }
 %}
 .
     self primitiveFailed
 !
 
-setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
+LineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
     "set line attributes"
 
 %{  /* NOCONTEXT */
@@ -6099,29 +6188,29 @@
     int x_style, x_cap, x_join;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __isSmallInteger(aNumber)) {
-	    if (lineStyle == @symbol(solid)) x_style = LineSolid;
-	    else if (lineStyle == @symbol(dashed)) x_style = LineOnOffDash;
-	    else if (lineStyle == @symbol(doubleDashed)) x_style = LineDoubleDash;
-	    else  goto bad;
-
-	    if (capStyle == @symbol(notLast)) x_cap = CapNotLast;
-	    else if (capStyle == @symbol(butt)) x_cap = CapButt;
-	    else if (capStyle == @symbol(round)) x_cap  = CapRound;
-	    else if (capStyle == @symbol(projecting)) x_cap  = CapProjecting;
-	    else  goto bad;
-
-	    if (joinStyle == @symbol(miter)) x_join = JoinMiter;
-	    else if (joinStyle == @symbol(bevel)) x_join = JoinBevel;
-	    else if (joinStyle == @symbol(round)) x_join  = JoinRound;
-	    else  goto bad;
-
-	    XSetLineAttributes(myDpy,
-			       _GCVal(aGCId), __intVal(aNumber),
-			       x_style, x_cap, x_join);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __isSmallInteger(aNumber)) {
+            if (lineStyle == @symbol(solid)) x_style = LineSolid;
+            else if (lineStyle == @symbol(dashed)) x_style = LineOnOffDash;
+            else if (lineStyle == @symbol(doubleDashed)) x_style = LineDoubleDash;
+            else  goto bad;
+
+            if (capStyle == @symbol(notLast)) x_cap = CapNotLast;
+            else if (capStyle == @symbol(butt)) x_cap = CapButt;
+            else if (capStyle == @symbol(round)) x_cap  = CapRound;
+            else if (capStyle == @symbol(projecting)) x_cap  = CapProjecting;
+            else  goto bad;
+
+            if (joinStyle == @symbol(miter)) x_join = JoinMiter;
+            else if (joinStyle == @symbol(bevel)) x_join = JoinBevel;
+            else if (joinStyle == @symbol(round)) x_join  = JoinRound;
+            else  goto bad;
+
+            XSetLineAttributes(myDpy,
+                               _GCVal(aGCId), __intVal(aNumber),
+                               x_style, x_cap, x_join);
+            RETURN ( self );
+        }
     }
 bad: ;
 %}.
@@ -6134,22 +6223,22 @@
     self primitiveFailed
 !
 
-setMaskOriginX:orgX y:orgY in:aGCid
+MaskOriginX:orgX y:orgY in:aGCid
     "set the mask origin"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__bothSmallInteger(orgX, orgY) && __isExternalAddress(aGCid)) {
-	    XSetTSOrigin(myDpy, _GCVal(aGCid), __intVal(orgX), __intVal(orgY));
-	    RETURN ( self );
-	}
+        if (__bothSmallInteger(orgX, orgY) && __isExternalAddress(aGCid)) {
+            XSetTSOrigin(myDpy, _GCVal(aGCid), __intVal(orgX), __intVal(orgY));
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setPixmapMask:aPixmapId in:aGCId
+PixmapMask:aPixmapId in:aGCId
     "set or clear the drawing mask - a pixmap mask providing full color"
 
 %{  /* NOCONTEXT */
@@ -6159,19 +6248,19 @@
     Pixmap pixmap;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (__isExternalAddress(aPixmapId)) {
-		pixmap = _PixmapVal(aPixmapId);
-		XSetTile(dpy, gc, pixmap);
-		XSetFillStyle(dpy, gc, FillTiled);
-		RETURN ( self );
-	    }
-	    if (aPixmapId == nil) {
-		XSetFillStyle(dpy, gc, FillSolid);
-		RETURN ( self );
-	    }
-	}
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (__isExternalAddress(aPixmapId)) {
+                pixmap = _PixmapVal(aPixmapId);
+                XSetTile(dpy, gc, pixmap);
+                XSetFillStyle(dpy, gc, FillTiled);
+                RETURN ( self );
+            }
+            if (aPixmapId == nil) {
+                XSetFillStyle(dpy, gc, FillSolid);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     self primitiveFailed
@@ -6179,41 +6268,41 @@
 
 !XWorkstation methodsFor:'initialize / release'!
 
-closeConnection
+seConnection
     "close down the connection to the X-server"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
-	__INST(displayId) = nil;
-	XCloseDisplay(dpy);
-	END_INTERRUPTSBLOCKED
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
+        __INST(displayId) = nil;
+        XCloseDisplay(dpy);
+        END_INTERRUPTSBLOCKED
     }
 %}
 !
 
-initializeDefaultValues
+tializeDefaultValues
     buttonTranslation := ButtonTranslation.
     multiClickTimeDelta := MultiClickTimeDelta.
 
     self initializeModifierMappings
 !
 
-initializeEventBuffer
+tializeEventBuffer
     |sz|
 
 %{
     sz = __MKSMALLINT(sizeof(XEvent) + 100);
 %}.
     eventBuffer isNil ifTrue:[
-	eventBuffer := ByteArray new:sz.
+        eventBuffer := ByteArray new:sz.
     ].
 !
 
-initializeFor:aDisplayName
+tializeFor:aDisplayName
     "initialize the receiver for a connection to an X-Server;
      the argument, aDisplayName may be nil (for the default server from
      DISPLAY-variable or command line argument) or the name of the server 
@@ -6223,13 +6312,13 @@
 
     dpyName := aDisplayName.
     dpyName isNil ifTrue:[
-	"look for a '-display xxx' argument"
-	(arguments := Smalltalk commandLineArguments) notNil ifTrue:[
-	    index := arguments indexOf:'-display'.
-	    (index between:1 and:(arguments size - 1)) ifTrue:[
-		dpyName := arguments at:index+1
-	    ]
-	]
+        "look for a '-display xxx' argument"
+        (arguments := Smalltalk commandLineArguments) notNil ifTrue:[
+            index := arguments indexOf:'-display'.
+            (index between:1 and:(arguments size - 1)) ifTrue:[
+                dpyName := arguments at:index+1
+            ]
+        ]
     ].
 %{
     int scr;
@@ -6246,38 +6335,38 @@
     OBJ dpyID;
 
     if (__INST(displayId) != nil) {
-	/*
-	 * already connected - you bad guy try to
-	 * trick me manually ?
-	 */
-	RETURN ( self );
+        /*
+         * already connected - you bad guy try to
+         * trick me manually ?
+         */
+        RETURN ( self );
     }
 
     BEGIN_INTERRUPTSBLOCKED
 
     if (__isString(dpyName))
-	nm = (char *)_stringVal(dpyName);
+        nm = (char *)_stringVal(dpyName);
     else {
-	dpyName = __MKSTRING((char *)getenv("DISPLAY"));
-	nm = NULL;
+        dpyName = __MKSTRING((char *)getenv("DISPLAY"));
+        nm = NULL;
     }
     dpy = XOpenDisplay(nm);
 
     if (dpy) {
-	__INST(displayId) = dpyID = __MKOBJ(dpy); __STORE(self, dpyID);
+        __INST(displayId) = dpyID = __MKOBJ(dpy); __STORE(self, dpyID);
 
 #ifdef SUPERDEBUG
-	XSynchronize(dpy, 1);
+        XSynchronize(dpy, 1);
 #endif
 
-	XSetErrorHandler(__XErrorHandler__);
+        XSetErrorHandler(__XErrorHandler__);
     }
 
     END_INTERRUPTSBLOCKED
 %}.
     displayId isNil ifTrue:[
-	'XWorkstation [warning]: cannot connect to Display.' errorPrintCR.
-	^ nil
+        'XWorkstation [warning]: cannot connect to Display.' errorPrintCR.
+        ^ nil
     ].
 
     dispatching := false.
@@ -6306,7 +6395,7 @@
     ObjectMemory registerErrorInterruptHandler:self class forID:#DisplayError.
 !
 
-initializeModifierMappings
+tializeModifierMappings
     |map mod|
 
 "/    altModifiers := #(Alt_L Alt_R).
@@ -6319,46 +6408,46 @@
 
     map := self modifierMapping.
     map isNil ifTrue:[
-	"/
-	"/ mhmh - a crippled Xlib which does not provide modifier mappings
-	"/ setup some reasonable default. If that is not sufficient,
-	"/ you have to change things from your display.rc file.
-	"/
-	altModifierMask := self modifier1Mask.
-	metaModifierMask := self modifier2Mask.
-
-	shiftModifiers := #(Shift_L Shift_R Shift).
-	ctrlModifiers := #(Control_L Control_R Control).
-	metaModifiers := #(Alt_L Meta_L Meta_R Meta).
-	altModifiers := #(Alt_R Alt).
+        "/
+        "/ mhmh - a crippled Xlib which does not provide modifier mappings
+        "/ setup some reasonable default. If that is not sufficient,
+        "/ you have to change things from your display.rc file.
+        "/
+        altModifierMask := self modifier1Mask.
+        metaModifierMask := self modifier2Mask.
+
+        shiftModifiers := #(Shift_L Shift_R Shift).
+        ctrlModifiers := #(Control_L Control_R Control).
+        metaModifiers := #(Alt_L Meta_L Meta_R Meta).
+        altModifiers := #(Alt_R Alt).
     ] ifFalse:[
-	altModifierMask := 0.
-	metaModifierMask := 0.
-
-	mod := map at:1.
-	mod notNil ifTrue:[
-	    shiftModifiers := mod collect:[ :key | self stringFromKeycode:key ].
-	].
-	mod := map at:3.
-	mod notNil ifTrue:[
-	    ctrlModifiers  := mod collect:[ :key | self stringFromKeycode:key ].
-	].
-	mod := map at:4.
-	mod notNil ifTrue:[
-	    metaModifiers  := mod collect:[ :key | self stringFromKeycode:key ].    
-	    metaModifierMask := 1 bitShift:(4-1).
-	].
-	mod := map at:5.
-	mod notNil ifTrue:[
-	    altModifiers   := mod collect:[ :key | self stringFromKeycode:key ].    
-	    altModifierMask := 1 bitShift:(5-1).
-	]
+        altModifierMask := 0.
+        metaModifierMask := 0.
+
+        mod := map at:1.
+        mod notNil ifTrue:[
+            shiftModifiers := mod collect:[ :key | self stringFromKeycode:key ].
+        ].
+        mod := map at:3.
+        mod notNil ifTrue:[
+            ctrlModifiers  := mod collect:[ :key | self stringFromKeycode:key ].
+        ].
+        mod := map at:4.
+        mod notNil ifTrue:[
+            metaModifiers  := mod collect:[ :key | self stringFromKeycode:key ].    
+            metaModifierMask := 1 bitShift:(4-1).
+        ].
+        mod := map at:5.
+        mod notNil ifTrue:[
+            altModifiers   := mod collect:[ :key | self stringFromKeycode:key ].    
+            altModifierMask := 1 bitShift:(5-1).
+        ]
     ].
 
     "Modified: 1.12.1995 / 23:44:40 / stefan"
 !
 
-initializeScreenProperties
+tializeScreenProperties
     super initializeScreenProperties.
 
 %{  /* NOCONTEXT */
@@ -6379,221 +6468,221 @@
     int mask, shift, nBits;
 
     if (ISCONNECTED) {
-	dpy = myDpy;
-
-	__INST(altModifierMask) = __MKSMALLINT(Mod2Mask);
-	__INST(metaModifierMask) = __MKSMALLINT(Mod1Mask);
-
-	BEGIN_INTERRUPTSBLOCKED
-
-	__INST(screen) = __MKSMALLINT(scr = DefaultScreen(dpy));
-	__INST(depth) = __MKSMALLINT(DisplayPlanes(dpy, scr));
-	__INST(ncells) = __MKSMALLINT(DisplayCells(dpy, scr));
-	__INST(width) = __MKSMALLINT(DisplayWidth(dpy, scr));
-	__INST(height) = __MKSMALLINT(DisplayHeight(dpy, scr));
-	__INST(widthMM) = __MKSMALLINT(DisplayWidthMM(dpy, scr));
-	__INST(heightMM) = __MKSMALLINT(DisplayHeightMM(dpy, scr));
-	__INST(blackpixel) = __MKSMALLINT(BlackPixel(dpy, scr));
-	__INST(whitepixel) = __MKSMALLINT(WhitePixel(dpy, scr));
+        dpy = myDpy;
+
+        __INST(altModifierMask) = __MKSMALLINT(Mod2Mask);
+        __INST(metaModifierMask) = __MKSMALLINT(Mod1Mask);
+
+        BEGIN_INTERRUPTSBLOCKED
+
+        __INST(screen) = __MKSMALLINT(scr = DefaultScreen(dpy));
+        __INST(depth) = __MKSMALLINT(DisplayPlanes(dpy, scr));
+        __INST(ncells) = __MKSMALLINT(DisplayCells(dpy, scr));
+        __INST(width) = __MKSMALLINT(DisplayWidth(dpy, scr));
+        __INST(height) = __MKSMALLINT(DisplayHeight(dpy, scr));
+        __INST(widthMM) = __MKSMALLINT(DisplayWidthMM(dpy, scr));
+        __INST(heightMM) = __MKSMALLINT(DisplayHeightMM(dpy, scr));
+        __INST(blackpixel) = __MKSMALLINT(BlackPixel(dpy, scr));
+        __INST(whitepixel) = __MKSMALLINT(WhitePixel(dpy, scr));
 
 #ifdef SHAPE
-	if (XShapeQueryExtension(dpy, &dummy, &dummy))
-	    __INST(hasShapeExtension) = true;
-	else
+        if (XShapeQueryExtension(dpy, &dummy, &dummy))
+            __INST(hasShapeExtension) = true;
+        else
 #endif
-	  __INST(hasShapeExtension) = false;
+          __INST(hasShapeExtension) = false;
 
 #ifdef SHM
-	if (XQueryExtension(dpy, "MIT_SHM", &dummy, &dummy, &dummy))
-	    __INST(hasShmExtension) = true;
-	else
+        if (XQueryExtension(dpy, "MIT_SHM", &dummy, &dummy, &dummy))
+            __INST(hasShmExtension) = true;
+        else
 #endif
-	  __INST(hasShmExtension) = false;
+          __INST(hasShmExtension) = false;
 
 #ifdef DPS
-	if (XQueryExtension(dpy, "DPSExtension", &dummy, &dummy, &dummy))
-	    __INST(hasDPSExtension) = true;
-	else
+        if (XQueryExtension(dpy, "DPSExtension", &dummy, &dummy, &dummy))
+            __INST(hasDPSExtension) = true;
+        else
 #endif
-	  __INST(hasDPSExtension) = false;
+          __INST(hasDPSExtension) = false;
 
 #ifdef XVIDEO
-	if (XQueryExtension(dpy, "XVideo", &dummy, &dummy, &dummy))
-	    __INST(hasXVideoExtension) = true;
-	else
+        if (XQueryExtension(dpy, "XVideo", &dummy, &dummy, &dummy))
+            __INST(hasXVideoExtension) = true;
+        else
 #endif
-	  __INST(hasXVideoExtension) = false;
+          __INST(hasXVideoExtension) = false;
 
 #ifdef MBUF
-	if (XQueryExtension(dpy, "Multi-Buffering", &dummy, &dummy, &dummy))
-	    __INST(hasMbufExtension) = true;
-	else
+        if (XQueryExtension(dpy, "Multi-Buffering", &dummy, &dummy, &dummy))
+            __INST(hasMbufExtension) = true;
+        else
 #endif
-	  __INST(hasMbufExtension) = false;
+          __INST(hasMbufExtension) = false;
 
 #ifdef PEX5
-	if (XQueryExtension(dpy, PEX_NAME_STRING, &dummy, &dummy, &dummy))
-	    __INST(hasPEXExtension) = true;
-	else
+        if (XQueryExtension(dpy, PEX_NAME_STRING, &dummy, &dummy, &dummy))
+            __INST(hasPEXExtension) = true;
+        else
 #endif
-	  __INST(hasPEXExtension) = false;
+          __INST(hasPEXExtension) = false;
 
 #ifdef XIE
-	if (XQueryExtension(dpy, xieExtName, &dummy, &dummy, &dummy))
-	    __INST(hasImageExtension) = true;
-	else
+        if (XQueryExtension(dpy, xieExtName, &dummy, &dummy, &dummy))
+            __INST(hasImageExtension) = true;
+        else
 #endif
-	  __INST(hasImageExtension) = false;
+          __INST(hasImageExtension) = false;
 
 #ifdef XI
-	if (XQueryExtension(dpy, "XInputExtension", &dummy, &dummy, &dummy))
-	    __INST(hasInputExtension) = true;
-	else
+        if (XQueryExtension(dpy, "XInputExtension", &dummy, &dummy, &dummy))
+            __INST(hasInputExtension) = true;
+        else
 #endif
-	  __INST(hasInputExtension) = false;
-
-	/*
-	 * look for RGB visual
-	 */
-	nvi = 0;
-	viproto.screen = scr;
-	vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
-	maxRGBDepth = 0;
-	for (i = 0; i < nvi; i++) {
-	    switch (vip[i].class) {
-		case TrueColor:
-		    if (vip[i].depth > maxRGBDepth) {
-			maxRGBDepth = vip[i].depth;
-			rgbRedMask = vip[i].red_mask;
-			rgbGreenMask = vip[i].green_mask;
-			rgbBlueMask = vip[i].blue_mask;
-			rgbVisualID = vip[i].visualid;
-		    }
-		    break;
-	    }
-	}
-	if (vip) XFree ((char *) vip);
-
-	if (maxRGBDepth) {
-	    __INST(rgbVisual) = __MKOBJ(rgbVisualID); __STORESELF(rgbVisual);
-	}
-
-	visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(dpy));
-	__INST(monitorType) = @symbol(unknown);
-	__INST(hasColors) = true;
-	__INST(hasGreyscales) = true;
-	switch (visual->class) {
-	    case StaticGray:
-		__INST(visualType) = @symbol(StaticGray);
-		__INST(hasColors) = false;
-		__INST(monitorType) = @symbol(monochrome);
-		break;
-	    case GrayScale:
-		__INST(visualType) = @symbol(GrayScale);
-		__INST(hasColors) = false;
-		__INST(monitorType) = @symbol(monochrome);
-		break;
-	    case StaticColor:
-		__INST(visualType) = @symbol(StaticColor);
-		break;
-	    case PseudoColor:
-		__INST(visualType) = @symbol(PseudoColor);
-		break;
-	    case TrueColor:
-		__INST(visualType) = @symbol(TrueColor);
-		break;
-	    case DirectColor:
-		__INST(visualType) = @symbol(DirectColor);
-		break;
-	}
-	if (DisplayCells(dpy, scr) == 2) {
-	    __INST(hasColors) = false;
-	    __INST(hasGreyscales) = false;
-	    __INST(monitorType) = @symbol(monochrome);
-	}
-	__INST(bitsPerRGB) = __MKSMALLINT(visual->bits_per_rgb);
-	__INST(redMask)   = __MKSMALLINT(visual->red_mask);
-	__INST(greenMask) = __MKSMALLINT(visual->green_mask);
-	__INST(blueMask)  = __MKSMALLINT(visual->blue_mask);
-	switch (visual->class) {
-	    case TrueColor:
-		/* extract number of bits and shift counts */
-		mask = visual->red_mask;
-		shift = 0;
-		while (mask && ((mask & 1) == 0)) {
-		    mask >>= 1;
-		    shift++;
-		}
-		__INST(redShift) = __MKSMALLINT(shift);
-		nBits = 0;
-		while (mask) {
-		    mask >>= 1;
-		    nBits++;
-		}
-		__INST(bitsRed) = __MKSMALLINT(nBits);
-
-		mask = visual->green_mask;
-		shift = 0;
-		while (mask && ((mask & 1) == 0)) {
-		    mask >>= 1;
-		    shift++;
-		}
-		__INST(greenShift) = __MKSMALLINT(shift);
-		nBits = 0;
-		while (mask) {
-		    mask >>= 1;
-		    nBits++;
-		}
-		__INST(bitsGreen) = __MKSMALLINT(nBits);
-
-		mask = visual->blue_mask;
-		shift = 0;
-		while (mask && ((mask & 1) == 0)) {
-		    mask >>= 1;
-		    shift++;
-		}
-		__INST(blueShift) = __MKSMALLINT(shift);
-		nBits = 0;
-		while (mask) {
-		    mask >>= 1;
-		    nBits++;
-		}
-		__INST(bitsBlue) = __MKSMALLINT(nBits);
-		break;
-	}
+          __INST(hasInputExtension) = false;
+
+        /*
+         * look for RGB visual
+         */
+        nvi = 0;
+        viproto.screen = scr;
+        vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
+        maxRGBDepth = 0;
+        for (i = 0; i < nvi; i++) {
+            switch (vip[i].class) {
+                case TrueColor:
+                    if (vip[i].depth > maxRGBDepth) {
+                        maxRGBDepth = vip[i].depth;
+                        rgbRedMask = vip[i].red_mask;
+                        rgbGreenMask = vip[i].green_mask;
+                        rgbBlueMask = vip[i].blue_mask;
+                        rgbVisualID = vip[i].visualid;
+                    }
+                    break;
+            }
+        }
+        if (vip) XFree ((char *) vip);
+
+        if (maxRGBDepth) {
+            __INST(rgbVisual) = __MKOBJ(rgbVisualID); __STORESELF(rgbVisual);
+        }
+
+        visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(dpy));
+        __INST(monitorType) = @symbol(unknown);
+        __INST(hasColors) = true;
+        __INST(hasGreyscales) = true;
+        switch (visual->class) {
+            case StaticGray:
+                __INST(visualType) = @symbol(StaticGray);
+                __INST(hasColors) = false;
+                __INST(monitorType) = @symbol(monochrome);
+                break;
+            case GrayScale:
+                __INST(visualType) = @symbol(GrayScale);
+                __INST(hasColors) = false;
+                __INST(monitorType) = @symbol(monochrome);
+                break;
+            case StaticColor:
+                __INST(visualType) = @symbol(StaticColor);
+                break;
+            case PseudoColor:
+                __INST(visualType) = @symbol(PseudoColor);
+                break;
+            case TrueColor:
+                __INST(visualType) = @symbol(TrueColor);
+                break;
+            case DirectColor:
+                __INST(visualType) = @symbol(DirectColor);
+                break;
+        }
+        if (DisplayCells(dpy, scr) == 2) {
+            __INST(hasColors) = false;
+            __INST(hasGreyscales) = false;
+            __INST(monitorType) = @symbol(monochrome);
+        }
+        __INST(bitsPerRGB) = __MKSMALLINT(visual->bits_per_rgb);
+        __INST(redMask)   = __MKSMALLINT(visual->red_mask);
+        __INST(greenMask) = __MKSMALLINT(visual->green_mask);
+        __INST(blueMask)  = __MKSMALLINT(visual->blue_mask);
+        switch (visual->class) {
+            case TrueColor:
+                /* extract number of bits and shift counts */
+                mask = visual->red_mask;
+                shift = 0;
+                while (mask && ((mask & 1) == 0)) {
+                    mask >>= 1;
+                    shift++;
+                }
+                __INST(redShift) = __MKSMALLINT(shift);
+                nBits = 0;
+                while (mask) {
+                    mask >>= 1;
+                    nBits++;
+                }
+                __INST(bitsRed) = __MKSMALLINT(nBits);
+
+                mask = visual->green_mask;
+                shift = 0;
+                while (mask && ((mask & 1) == 0)) {
+                    mask >>= 1;
+                    shift++;
+                }
+                __INST(greenShift) = __MKSMALLINT(shift);
+                nBits = 0;
+                while (mask) {
+                    mask >>= 1;
+                    nBits++;
+                }
+                __INST(bitsGreen) = __MKSMALLINT(nBits);
+
+                mask = visual->blue_mask;
+                shift = 0;
+                while (mask && ((mask & 1) == 0)) {
+                    mask >>= 1;
+                    shift++;
+                }
+                __INST(blueShift) = __MKSMALLINT(shift);
+                nBits = 0;
+                while (mask) {
+                    mask >>= 1;
+                    nBits++;
+                }
+                __INST(bitsBlue) = __MKSMALLINT(nBits);
+                break;
+        }
 
 #ifndef XA_PRIMARY
-	__INST(primaryAtom) = __MKATOMOBJ( XInternAtom(dpy, "PRIMARY", True) );
+        __INST(primaryAtom) = __MKATOMOBJ( XInternAtom(dpy, "PRIMARY", True) );
 #else
-	__INST(primaryAtom) = __MKATOMOBJ( XA_PRIMARY );
+        __INST(primaryAtom) = __MKATOMOBJ( XA_PRIMARY );
 #endif
 #ifndef XA_SECONDARY
-	__INST(secondaryAtom) = __MKATOMOBJ( XInternAtom(dpy, "SECONDARY", True) );
+        __INST(secondaryAtom) = __MKATOMOBJ( XInternAtom(dpy, "SECONDARY", True) );
 #else
-	__INST(secondaryAtom) = __MKATOMOBJ( XA_SECONDARY );
+        __INST(secondaryAtom) = __MKATOMOBJ( XA_SECONDARY );
 #endif
 #ifndef XA_CUT_BUFFER0
-	__INST(cutBuffer0Atom) = __MKATOMOBJ( XInternAtom(dpy, "CUT_BUFFER0", True) );
+        __INST(cutBuffer0Atom) = __MKATOMOBJ( XInternAtom(dpy, "CUT_BUFFER0", True) );
 #else
-	__INST(cutBuffer0Atom) = __MKATOMOBJ( XA_CUT_BUFFER0 );
+        __INST(cutBuffer0Atom) = __MKATOMOBJ( XA_CUT_BUFFER0 );
 #endif
 #ifndef XA_STRING
-	__INST(stringAtom) = __MKATOMOBJ( XInternAtom(dpy, "STRING", True) );
+        __INST(stringAtom) = __MKATOMOBJ( XInternAtom(dpy, "STRING", True) );
 #else
-	__INST(stringAtom) = __MKATOMOBJ( XA_STRING );
+        __INST(stringAtom) = __MKATOMOBJ( XA_STRING );
 #endif
 #ifndef XA_LENGTH
-	__INST(lengthAtom) = __MKATOMOBJ( XInternAtom(dpy, "LENGTH", True) );
+        __INST(lengthAtom) = __MKATOMOBJ( XInternAtom(dpy, "LENGTH", True) );
 #else
-	__INST(lengthAtom) = __MKATOMOBJ( XA_LENGTH );
+        __INST(lengthAtom) = __MKATOMOBJ( XA_LENGTH );
 #endif
 
-	END_INTERRUPTSBLOCKED
+        END_INTERRUPTSBLOCKED
     }
 %}.
 !
 
-initializeSpecialFlags
+tializeSpecialFlags
     "perform additional special server implementation flags"
 
     "/
@@ -6603,15 +6692,15 @@
     ignoreBackingStore := false.
 
     (self serverVendor = 'X11/NeWS') ifTrue:[
-	"/
-	"/ this is a kludge around a bug in the X11/NeWS server,
-	"/ which does not correctly handle saveUnder
-	"/
-	hasSaveUnder := false.
+        "/
+        "/ this is a kludge around a bug in the X11/NeWS server,
+        "/ which does not correctly handle saveUnder
+        "/
+        hasSaveUnder := false.
     ].
 !
 
-reinitialize
+nitialize
     virtualRootId := rootId := nil.
     super reinitialize.
     dispatchingExpose := nil
@@ -6619,7 +6708,7 @@
 
 !XWorkstation methodsFor:'keyboard mapping'!
 
-altModifierMask
+ModifierMask
     "return the mask (in motionEvents) for the alt-key modifier.
      Notice: ST/X may use the left ALT key as CMD/Meta key,
      therefore return a variable here, which can be changed during startup."
@@ -6630,19 +6719,19 @@
     "Modified: 23.3.1996 / 12:44:56 / cg"
 !
 
-altModifierMask:aSmallInteger
+ModifierMask:aSmallInteger
     "define which key takes the role of an alt-key.
      By default, this is X's modifier1, which is the ALT key on
      most keyboards. However, there may be exceptions to this,
      and the setting can be changed with:
-	Display altModifierMask:(Display modifier2Mask)
+        Display altModifierMask:(Display modifier2Mask)
      Setting the mask to 0 disables the ALT key (in ST/X) altogether.
     "
 
     altModifierMask := aSmallInteger
 !
 
-metaModifierMask
+aModifierMask
     "return the mask (in motionEvents) for the meta-key modifier.
      Notice: ST/X may use the left ALT key as CMD/Meta key,
      therefore return a variable here, which can be changed during startup."
@@ -6653,13 +6742,13 @@
     "Modified: 23.3.1996 / 12:45:09 / cg"
 !
 
-metaModifierMask:aSmallInteger
+aModifierMask:aSmallInteger
     "define which key takes the role of a meta key.
      By default, this is X's modifier2, which is the 2nd ALT key on
      most keyboards (if present at all).
      However, there may be exceptions to this, and the setting can
      be changed with:
-	Display metaModifierMask:(Display modifier1Mask)
+        Display metaModifierMask:(Display modifier1Mask)
      Setting the mask to 0 disables the META key (in ST/X) altogether.
      As reported, some Xservers place the Meta-key onto NumLock,
      and having NumLock enabled makes ST/X think, that meta is pressed
@@ -6670,7 +6759,7 @@
     metaModifierMask := aSmallInteger
 !
 
-modifier1Mask
+ifier1Mask
     "return the Xlib mask bit for the 1st modifier key.
      See comment in altModifierMask: / metaModifierMask: for what
      this could be used."
@@ -6680,7 +6769,7 @@
 %}
 !
 
-modifier2Mask
+ifier2Mask
     "return the Xlib mask bit for the 2nd modifier key.
      See comment in altModifierMask: / metaModifierMask: for what
      this could be used."
@@ -6690,7 +6779,7 @@
 %}
 !
 
-modifierMapping
+ifierMapping
     "Get the Modifier Mapping.
      We return an array of arrays of keycodes"
 
@@ -6701,18 +6790,18 @@
     OBJ __BYTEARRAY_UNINITIALIZED_NEW_INT();
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if ((modmap = XGetModifierMapping(myDpy)) != 0) {
-	   maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
-	   modifierKeyMap = __BYTEARRAY_UNINITIALIZED_NEW_INT(modmap->max_keypermod * 8);
-	   if (modifierKeyMap != nil) {
-		maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
-		memcpy((char *)__ByteArrayInstPtr(modifierKeyMap)->ba_element, 
-		       (char *)modmap->modifiermap, modmap->max_keypermod * 8);
-	   }
-	   XFreeModifiermap(modmap);
-	}
+        Display *dpy = myDpy;
+
+        if ((modmap = XGetModifierMapping(myDpy)) != 0) {
+           maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
+           modifierKeyMap = __BYTEARRAY_UNINITIALIZED_NEW_INT(modmap->max_keypermod * 8);
+           if (modifierKeyMap != nil) {
+                maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
+                memcpy((char *)__ByteArrayInstPtr(modifierKeyMap)->ba_element, 
+                       (char *)modmap->modifiermap, modmap->max_keypermod * 8);
+           }
+           XFreeModifiermap(modmap);
+        }
     }
 %}.
 
@@ -6721,28 +6810,28 @@
     ret := Array new:8.
     nextKey := 1.
     1 to:8 do:[ :i |
-	(modifierKeyMap at:nextKey) ~= 0 ifTrue:[
-	    |mod|
-
-	    mod := OrderedCollection new:maxKeyPerMod.
-	    modifierKeyMap from:nextKey to:(nextKey+maxKeyPerMod-1) do:[ :key |
-		key ~= 0 ifTrue:[
-		    mod add:key
-		].
-	    ].
-	    ret at:i put:mod.
-	].
-	nextKey := nextKey+maxKeyPerMod.
+        (modifierKeyMap at:nextKey) ~= 0 ifTrue:[
+            |mod|
+
+            mod := OrderedCollection new:maxKeyPerMod.
+            modifierKeyMap from:nextKey to:(nextKey+maxKeyPerMod-1) do:[ :key |
+                key ~= 0 ifTrue:[
+                    mod add:key
+                ].
+            ].
+            ret at:i put:mod.
+        ].
+        nextKey := nextKey+maxKeyPerMod.
     ].
 
     ^ ret
 
     "
-	Display modifierMapping
+        Display modifierMapping
     "
 !
 
-stringFromKeycode:code
+ingFromKeycode:code
     "Get a KeySymbol (a smalltalk symbol) from the keycode."
 
     |str|
@@ -6752,21 +6841,21 @@
     char *keystring;
 
     if (ISCONNECTED && __isSmallInteger(code)) {
-	Display *dpy = myDpy;
-
-	if ((keysym = XKeycodeToKeysym(myDpy, __intVal(code), 0)) != NoSymbol &&
-	    (keystring = XKeysymToString(keysym)) != 0) 
-	    str = __MKSTRING(keystring);
+        Display *dpy = myDpy;
+
+        if ((keysym = XKeycodeToKeysym(myDpy, __intVal(code), 0)) != NoSymbol &&
+            (keystring = XKeysymToString(keysym)) != 0) 
+            str = __MKSTRING(keystring);
     }
 %}.
     ^ str
 
     "
-	Display stringFromKeycode:28
+        Display stringFromKeycode:28
     "
 !
 
-translateKey:untranslatedKey
+nslateKey:untranslatedKey
     "Return the key translated via the translation table.
      Here, we preTranslate the key into a common ST/X symbolic name, 
      which gets further processed in the superclasses translation method."
@@ -6774,38 +6863,38 @@
     |key|
 
     (key := untranslatedKey) isString ifTrue:[
-	key := RawKeysymTranslation at:key ifAbsent:key.
-	key := key asSymbol.
+        key := RawKeysymTranslation at:key ifAbsent:key.
+        key := key asSymbol.
     ].
     ^ super translateKey:key 
 ! !
 
 !XWorkstation methodsFor:'misc'!
 
-beep
+p
     "output an audible beep or bell"
 
     self beep:50
 !
 
-beep:volumeInPercent
+p:volumeInPercent
     "output an audible beep"
 %{
     int volume;
 
     if (__isSmallInteger(volumeInPercent) && ISCONNECTED) {
-	/* stupid: X wants -100 .. 100 and calls this percent */
-	volume = __intVal(volumeInPercent) * 2 - 100;
-	if (volume < -100) volume = -100;
-	else if (volume > 100) volume = 100;
-	BEGIN_INTERRUPTSBLOCKED
-	XBell(myDpy, volume);
-	END_INTERRUPTSBLOCKED
+        /* stupid: X wants -100 .. 100 and calls this percent */
+        volume = __intVal(volumeInPercent) * 2 - 100;
+        if (volume < -100) volume = -100;
+        else if (volume > 100) volume = 100;
+        BEGIN_INTERRUPTSBLOCKED
+        XBell(myDpy, volume);
+        END_INTERRUPTSBLOCKED
     }
 %}
 !
 
-buffered
+fered
     "buffer drawing - do not send it immediately to the display.
      This is the default anyway.
      See #unBuffered for additional info."
@@ -6813,9 +6902,9 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XSynchronize(myDpy, 0);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XSynchronize(myDpy, 0);
+        END_INTERRUPTSBLOCKED
     }
 %}
     "
@@ -6823,7 +6912,7 @@
     "
 !
 
-flush
+sh
     "send all buffered drawing to the display.
      This may be required to make certain, that all previous operations
      are really sent to the display before continuing. For example,
@@ -6834,45 +6923,45 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XFlush(myDpy);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XFlush(myDpy);
+        END_INTERRUPTSBLOCKED
     }
 %}
 !
 
-flushDpsContext:aDPSContext
+shDpsContext:aDPSContext
 
 %{  /* NOCONTEXT */
 #ifdef DPS
     if (__isExternalAddress(aDPSContext)) {
-	BEGIN_INTERRUPTSBLOCKED
-	DPSFlushContext(MKDPSCONTEXT(aDPSContext));
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        BEGIN_INTERRUPTSBLOCKED
+        DPSFlushContext(MKDPSCONTEXT(aDPSContext));
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 #endif
 %}.
     self primitiveFailed
 !
 
-refreshKeyboardMapping:eB
+reshKeyboardMapping:eB
 %{
     XMappingEvent *ev;
 
     if (__isByteArray(eB)) {
-	ev = (XMappingEvent *)(__ByteArrayInstPtr(eB)->ba_element);
-	XRefreshKeyboardMapping(ev);
+        ev = (XMappingEvent *)(__ByteArrayInstPtr(eB)->ba_element);
+        XRefreshKeyboardMapping(ev);
     }
 %}
 !
 
-setInputFocusTo:aWindowId
+InputFocusTo:aWindowId
 "/    self setInputFocusTo:aWindowId revertTo:#parent
     self setInputFocusTo:aWindowId revertTo:#root
 !
 
-setInputFocusTo:aWindowId revertTo:revertSymbol
+InputFocusTo:aWindowId revertTo:revertSymbol
     "set the focus to the view as defined by aWindowId.
      Passing nil set the focus to no window and lets the display discard all
      input until a new focus is set.
@@ -6885,28 +6974,28 @@
     Window focusWindow;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)) {
-	    focusWindow = _WindowVal(aWindowId);
-	} else {
-	    focusWindow = None;
-	}
-	if (revertSymbol == @symbol(parent))
-	    arg = RevertToParent;
-	else if (revertSymbol == @symbol(root))
-	    arg = RevertToPointerRoot;
-	else 
-	    arg = RevertToNone;
-
-	BEGIN_INTERRUPTSBLOCKED
-	XSetInputFocus(myDpy, focusWindow, arg, CurrentTime);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        if (__isExternalAddress(aWindowId)) {
+            focusWindow = _WindowVal(aWindowId);
+        } else {
+            focusWindow = None;
+        }
+        if (revertSymbol == @symbol(parent))
+            arg = RevertToParent;
+        else if (revertSymbol == @symbol(root))
+            arg = RevertToPointerRoot;
+        else 
+            arg = RevertToNone;
+
+        BEGIN_INTERRUPTSBLOCKED
+        XSetInputFocus(myDpy, focusWindow, arg, CurrentTime);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-sync
+c
     "send all buffered drawing to the display AND wait until the display
      has finished drawing it.
      This is almost never needed, except if you are about to read previously
@@ -6916,14 +7005,14 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XSync(myDpy, 0);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XSync(myDpy, 0);
+        END_INTERRUPTSBLOCKED
     }
 %}
 !
 
-unBuffered
+uffered
     "make all drawing be sent immediately to the display.
      This makes all graphics synchronous and turns off any buffering
      (i.e. each individual draw-request is sent immediately without 
@@ -6936,9 +7025,9 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XSynchronize(myDpy, 1);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XSynchronize(myDpy, 1);
+        END_INTERRUPTSBLOCKED
     }
 %}
     "Display unbuffered"
@@ -6946,7 +7035,7 @@
 
 !XWorkstation methodsFor:'pointer queries '!
 
-anyButtonStateMask
+ButtonStateMask
     "return an integer for masking out any button from a
      buttonStates value."
 
@@ -6958,7 +7047,7 @@
     "Created: 23.3.1996 / 12:46:35 / cg"
 !
 
-buttonStates
+tonStates
     "return an integer representing the state of the pointer buttons;
      a one-bit in positions 0.. represent a pressed button.
      See the button1Mask/button2Mask/button3Mask,
@@ -6972,20 +7061,20 @@
     unsigned int mask;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
 #ifdef VIRTUAL_ROOT
-	w = getRootWindow(myDpy, screen);
+        w = getRootWindow(myDpy, screen);
 #else
-	w = RootWindow(dpy, screen);
+        w = RootWindow(dpy, screen);
 #endif
-	XQueryPointer(dpy, w, &rootRet, &childRet,
-			      &rootX, &rootY,
-			      &winX, &winY,
-			      &mask);
-	END_INTERRUPTSBLOCKED
-	RETURN (__MKSMALLINT(mask));
+        XQueryPointer(dpy, w, &rootRet, &childRet,
+                              &rootX, &rootY,
+                              &winX, &winY,
+                              &mask);
+        END_INTERRUPTSBLOCKED
+        RETURN (__MKSMALLINT(mask));
     }
 %}.
     self primitiveFailed
@@ -7006,7 +7095,7 @@
     "
 !
 
-leftButtonStateMask
+tButtonStateMask
     "return an integer for masking out the left button from a
      buttonStates value"
 
@@ -7017,7 +7106,7 @@
     "Modified: 23.3.1996 / 12:41:33 / cg"
 !
 
-middleButtonStateMask
+dleButtonStateMask
     "return an integer for masking out the middle button from a
      buttonStates value"
 
@@ -7028,7 +7117,7 @@
     "Modified: 23.3.1996 / 12:41:43 / cg"
 !
 
-pointerPosition
+nterPosition
     "return the current pointer position in root-window coordinates"
 
     |xpos ypos|
@@ -7041,28 +7130,28 @@
     unsigned int mask;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
 #ifdef VIRTUAL_ROOT
-	w = getRootWindow(myDpy, screen);
+        w = getRootWindow(myDpy, screen);
 #else
-	w = RootWindow(dpy, screen);
+        w = RootWindow(dpy, screen);
 #endif
-	XQueryPointer(dpy, w, &rootRet, &childRet,
-			      &rootX, &rootY,
-			      &winX, &winY,
-			      &mask);
-	xpos = __MKSMALLINT(rootX);
-	ypos = __MKSMALLINT(rootY);
-	END_INTERRUPTSBLOCKED
+        XQueryPointer(dpy, w, &rootRet, &childRet,
+                              &rootX, &rootY,
+                              &winX, &winY,
+                              &mask);
+        xpos = __MKSMALLINT(rootX);
+        ypos = __MKSMALLINT(rootY);
+        END_INTERRUPTSBLOCKED
     }
 %}
 .
     ^ xpos @ ypos
 !
 
-rightButtonStateMask
+htButtonStateMask
     "return an integer for masking out the right button from a
      buttonStates value"
 
@@ -7073,7 +7162,7 @@
     "Modified: 23.3.1996 / 12:41:52 / cg"
 !
 
-rootPositionOfLastEvent
+tPositionOfLastEvent
     "return the position in root-window coordinates
      of the last button, key or pointer event"
 
@@ -7082,7 +7171,7 @@
 
 !XWorkstation methodsFor:'resources'!
 
-atomIDOf:aStringOrSymbol
+mIDOf:aStringOrSymbol
     "return an Atoms ID; dont create if not already present.
      This is highly X specific and only for local use (with selections)."
 
@@ -7096,7 +7185,7 @@
     "Modified: 2.3.1996 / 15:09:29 / cg"
 !
 
-atomIDOf:aStringOrSymbol create:create
+mIDOf:aStringOrSymbol create:create
     "return an Atoms ID; if create is true, create it if not already present.
      This is highly X specific and only for local use (with selections)."
 
@@ -7104,15 +7193,15 @@
     Atom prop;
 
     if (ISCONNECTED) {
-	if (__isString(aStringOrSymbol)
-	 || __isSymbol(aStringOrSymbol)) {
-	    prop = XInternAtom(myDpy, _stringVal(aStringOrSymbol), 
-				      (create == true) ? False : True);
-	    if (prop == None) {
-		RETURN (nil);
-	    }
-	    RETURN ( __MKATOMOBJ(prop) );
-	}
+        if (__isString(aStringOrSymbol)
+         || __isSymbol(aStringOrSymbol)) {
+            prop = XInternAtom(myDpy, _stringVal(aStringOrSymbol), 
+                                      (create == true) ? False : True);
+            if (prop == None) {
+                RETURN (nil);
+            }
+            RETURN ( __MKATOMOBJ(prop) );
+        }
     }
 %}.
     self primitiveFailed.
@@ -7127,7 +7216,7 @@
     "
 !
 
-atomIDOfCUTBUFFER0
+mIDOfCUTBUFFER0
     "return the CUTBUFFER0 AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7136,7 +7225,7 @@
     "Modified: 2.3.1996 / 15:10:36 / cg"
 !
 
-atomIDOfLENGTH
+mIDOfLENGTH
     "return the LENGTH AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7145,7 +7234,7 @@
     "Modified: 2.3.1996 / 15:10:41 / cg"
 !
 
-atomIDOfPRIMARY
+mIDOfPRIMARY
     "return the PRIMARY AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7154,7 +7243,7 @@
     "Modified: 2.3.1996 / 15:10:49 / cg"
 !
 
-atomIDOfSECONDARY
+mIDOfSECONDARY
     "return the SECONDARY AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7163,7 +7252,7 @@
     "Modified: 2.3.1996 / 15:10:59 / cg"
 !
 
-atomIDOfSTRING
+mIDOfSTRING
     "return the STRING AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7172,7 +7261,7 @@
     "Modified: 2.3.1996 / 15:11:08 / cg"
 !
 
-atomName:anAtomID
+mName:anAtomID
     "given an AtomID, return its name.
      This is highly X specific and only for local use (with selections)."
 
@@ -7181,15 +7270,15 @@
     char *name;
 
     if (ISCONNECTED) {
-	if (__isAtomID(anAtomID)) {
-	    name = XGetAtomName(myDpy, _AtomVal(anAtomID));
-	    if (name == 0) {
-		RETURN (nil);
-	    }
-	    str = __MKSTRING(name);
-	    XFree(name);
-	    RETURN ( str );
-	}
+        if (__isAtomID(anAtomID)) {
+            name = XGetAtomName(myDpy, _AtomVal(anAtomID));
+            if (name == 0) {
+                RETURN (nil);
+            }
+            str = __MKSTRING(name);
+            XFree(name);
+            RETURN ( str );
+        }
     }
 %}.
     self primitiveFailed.
@@ -7207,17 +7296,17 @@
     "
 !
 
-getResource:name class:cls
+Resource:name class:cls
     "access the displays resource database for a default value
      of name in a resource class.
      This is highly X specific and  currently not used.
 
      Notice: 
-	we do not plan to use X's resources for ST/X's defaults,
-	styles or resources. This would make porting of applications
-	to different platforms much more difficult (Windows has no resource
-	database). If you stay within ST/X's resource files, these can be
-	easily transported to other platforms.
+        we do not plan to use X's resources for ST/X's defaults,
+        styles or resources. This would make porting of applications
+        to different platforms much more difficult (Windows has no resource
+        database). If you stay within ST/X's resource files, these can be
+        easily transported to other platforms.
 
      This method is provided for special applications which want to access
      existing X resources and are not planned to be ever ported to other
@@ -7229,34 +7318,34 @@
     if ((__isString(name) || __isSymbol(name))
      && (__isString(cls) || __isSymbol(cls))
      && ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	rslt = XGetDefault(myDpy, (char *)_stringVal(cls),
-				  (char *)_stringVal(name));
-	END_INTERRUPTSBLOCKED
-	RETURN (rslt ? __MKSTRING(rslt) : nil );
+        BEGIN_INTERRUPTSBLOCKED
+        rslt = XGetDefault(myDpy, (char *)_stringVal(cls),
+                                  (char *)_stringVal(name));
+        END_INTERRUPTSBLOCKED
+        RETURN (rslt ? __MKSTRING(rslt) : nil );
     }
 %}.
     self primitiveFailed.
     ^ nil
 
     "if your ~/.Xdefaults contains an entry such as:
-	OpenWindows.Beep:       notices
+        OpenWindows.Beep:       notices
      the following returns 'notices'.
 
-	 Display getResource:'Beep' class:'OpenWindows'   
+         Display getResource:'Beep' class:'OpenWindows'   
 
      if your ~/.Xdefaults contains an entry such as:
-	*.beNiceToColormap:       false
+        *.beNiceToColormap:       false
      the following return 'false'.
 
-	 Display getResource:'beNiceToColormap' class:'any'  
-	 Display getResource:'beNiceToColormap' class:''  
+         Display getResource:'beNiceToColormap' class:'any'  
+         Display getResource:'beNiceToColormap' class:''  
     "
 ! !
 
 !XWorkstation methodsFor:'retrieving pixels'!
 
-getBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits
+BitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits
     "get bits from a drawable into the imageBits. The storage for the bits
      must be big enough for the data to fit. If ok, returns an array with some
      info and the bits in imageBits. The info contains the depth, bitOrder and
@@ -7266,35 +7355,35 @@
     |rawInfo info|
 
     ((w <= 0) or:[h <= 0]) ifTrue:[
-	self primitiveFailed.
-	^ nil
+        self primitiveFailed.
+        ^ nil
     ].
 
     rawInfo := Array new:8.
-		  "1 -> bit order"
-		  "2 -> depth"
-		  "3 -> bytes_per_line"
-		  "4 -> byte_order"
-		  "5 -> format"
-		  "6 -> bitmap_unit"
-		  "7 -> bitmap_pad"
-		  "8 -> bits_per_pixel"
+                  "1 -> bit order"
+                  "2 -> depth"
+                  "3 -> bytes_per_line"
+                  "4 -> byte_order"
+                  "5 -> format"
+                  "6 -> bitmap_unit"
+                  "7 -> bitmap_pad"
+                  "8 -> bits_per_pixel"
 
     "/ had to extract the getPixel call into a separate method, to specify
     "/ unlimitedStack (some implementations use alloca and require huge amounts
     "/ of temporary stack space
 
     (self primGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[
-	info := IdentityDictionary new.
-	info at:#bitOrder put:(rawInfo at:1).
-	info at:#depth put:(rawInfo at:2).
-	info at:#bytesPerLine put:(rawInfo at:3).
-	info at:#byteOrder put:(rawInfo at:4).
-	info at:#format put:(rawInfo at:5).
-	info at:#bitmapUnit put:(rawInfo at:6).
-	info at:#bitmapPad put:(rawInfo at:7).
-	info at:#bitsPerPixel put:(rawInfo at:8).
-	^ info
+        info := IdentityDictionary new.
+        info at:#bitOrder put:(rawInfo at:1).
+        info at:#depth put:(rawInfo at:2).
+        info at:#bytesPerLine put:(rawInfo at:3).
+        info at:#byteOrder put:(rawInfo at:4).
+        info at:#format put:(rawInfo at:5).
+        info at:#bitmapUnit put:(rawInfo at:6).
+        info at:#bitmapPad put:(rawInfo at:7).
+        info at:#bitsPerPixel put:(rawInfo at:8).
+        ^ info
     ].
     "
      some error occured - either args are not smallintegers, imageBits is not a ByteArray
@@ -7303,7 +7392,7 @@
     ^ self primitiveFailed
 !
 
-getPixelX:x y:y from:aDrawableId
+PixelX:x y:y from:aDrawableId
     "return the pixel value at x/y; coordinates start at 0/0 for the upper left.
      Nil is returned for invalid coordinates or if any other problem arises."
 
@@ -7316,24 +7405,24 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aDrawableId) && __bothSmallInteger(x, y)) {
-	win = _WindowVal(aDrawableId);
-	xpos = __intVal(x);
-	ypos = __intVal(y);
-	if ((xpos < 0) || (ypos < 0)) {
-	    RETURN ( __MKSMALLINT(0) );
-	}
-	img = XGetImage(myDpy, win, xpos, ypos, 1, 1, (unsigned)~0, ZPixmap);
-	if (img != 0) {
-	    ret = XGetPixel(img, 0, 0);
-	    XDestroyImage(img);
-	    RETURN (  __MKSMALLINT(ret) );
-	}
+        win = _WindowVal(aDrawableId);
+        xpos = __intVal(x);
+        ypos = __intVal(y);
+        if ((xpos < 0) || (ypos < 0)) {
+            RETURN ( __MKSMALLINT(0) );
+        }
+        img = XGetImage(myDpy, win, xpos, ypos, 1, 1, (unsigned)~0, ZPixmap);
+        if (img != 0) {
+            ret = XGetPixel(img, 0, 0);
+            XDestroyImage(img);
+            RETURN (  __MKSMALLINT(ret) );
+        }
     }
 %}.
     ^ nil
 !
 
-primGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:info
+mGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:info
     "since XGetImage may allocate huge amount of stack space 
      (some implementations use alloca), this must run with unlimited stack."
 
@@ -7349,74 +7438,74 @@
      && __bothSmallInteger(w, h)
      && __isArray(info)
      && __isByteArray(imageBits)) {
-	Display *dpy = myDpy;
-
-	win = _WindowVal(aDrawableId);
-	image = XGetImage(dpy, win, __intVal(srcx), __intVal(srcy),
-				    __intVal(w), __intVal(h),
-				    (unsigned)AllPlanes, ZPixmap);
-
-	if (! image) {
-	    RETURN ( false );
-	}
-
-	pad = image->bitmap_pad;
+        Display *dpy = myDpy;
+
+        win = _WindowVal(aDrawableId);
+        image = XGetImage(dpy, win, __intVal(srcx), __intVal(srcy),
+                                    __intVal(w), __intVal(h),
+                                    (unsigned)AllPlanes, ZPixmap);
+
+        if (! image) {
+            RETURN ( false );
+        }
+
+        pad = image->bitmap_pad;
 #ifdef SUPERDEBUG
-	printf("pad:%d depth:%d\n", image->bitmap_pad, image->depth);
+        printf("pad:%d depth:%d\n", image->bitmap_pad, image->depth);
 #endif
-	switch (image->depth) {
-	    case 1:
-	    case 2:
-	    case 4:
-	    case 8:
-	    case 16:
-	    case 24:
-	    case 32:
-		numBytes = image->bytes_per_line * image->height;
-		break;
-	    default:
-		/* unsupported depth ? */
-		printf("possibly unsupported depth:%d in primGetBits\n", image->depth);
-		numBytes = image->bytes_per_line * image->height;
-		break;
-	}
+        switch (image->depth) {
+            case 1:
+            case 2:
+            case 4:
+            case 8:
+            case 16:
+            case 24:
+            case 32:
+                numBytes = image->bytes_per_line * image->height;
+                break;
+            default:
+                /* unsupported depth ? */
+                printf("possibly unsupported depth:%d in primGetBits\n", image->depth);
+                numBytes = image->bytes_per_line * image->height;
+                break;
+        }
 
 #ifdef SUPERDEBUG
-	printf("bytes need:%d bytes given:%d\n", numBytes, __byteArraySize(imageBits));
+        printf("bytes need:%d bytes given:%d\n", numBytes, __byteArraySize(imageBits));
 #endif
 
-	if (numBytes > __byteArraySize(imageBits)) {
-	    /* imageBits too small */
-	    printf("provided byteArray too small\n");
-	    goto fail;
-	}
-	if (image->bitmap_bit_order == MSBFirst)
-	    __ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
-	else
-	    __ArrayInstPtr(info)->a_element[0] = @symbol(lsbFirst);
-	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(image->depth);
-	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(image->bytes_per_line);
-	if (image->byte_order == MSBFirst)
-	    __ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
-	else
-	    __ArrayInstPtr(info)->a_element[3] = @symbol(lsbFirst);
-	if (image->format == XYBitmap)
-	    __ArrayInstPtr(info)->a_element[4] = @symbol(XYBitmap);
-	else if (image->format == XYPixmap)
-	    __ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
-	else if (image->format == ZPixmap)
-	    __ArrayInstPtr(info)->a_element[4] = @symbol(ZPixmap);
+        if (numBytes > __byteArraySize(imageBits)) {
+            /* imageBits too small */
+            printf("provided byteArray too small\n");
+            goto fail;
+        }
+        if (image->bitmap_bit_order == MSBFirst)
+            __ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
+        else
+            __ArrayInstPtr(info)->a_element[0] = @symbol(lsbFirst);
+        __ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(image->depth);
+        __ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(image->bytes_per_line);
+        if (image->byte_order == MSBFirst)
+            __ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
+        else
+            __ArrayInstPtr(info)->a_element[3] = @symbol(lsbFirst);
+        if (image->format == XYBitmap)
+            __ArrayInstPtr(info)->a_element[4] = @symbol(XYBitmap);
+        else if (image->format == XYPixmap)
+            __ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
+        else if (image->format == ZPixmap)
+            __ArrayInstPtr(info)->a_element[4] = @symbol(ZPixmap);
         
-	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(image->bitmap_unit);
-	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(image->bitmap_pad);
-	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(image->bits_per_pixel);
-	bcopy(image->data, __ByteArrayInstPtr(imageBits)->ba_element, numBytes);
-	XDestroyImage(image);
-	RETURN ( true );
+        __ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(image->bitmap_unit);
+        __ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(image->bitmap_pad);
+        __ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(image->bits_per_pixel);
+        bcopy(image->data, __ByteArrayInstPtr(imageBits)->ba_element, numBytes);
+        XDestroyImage(image);
+        RETURN ( true );
     }
 fail: 
     if (image) {
-	XDestroyImage(image);
+        XDestroyImage(image);
     }
 %}.
     ^ false
@@ -7424,21 +7513,21 @@
 
 !XWorkstation methodsFor:'selections'!
 
-getObjectProperty:propertyID from:aWindowID
+ObjectProperty:propertyID from:aWindowID
     "get an object property; return object or nil"
 
     self getProperty:propertyID from:aWindowID into:[:type :value |
-	type == stringAtom ifTrue:[
-	    ^ value
-	].
-	(value isMemberOf:ByteArray) ifTrue:[
-	    ^ (Object readBinaryFrom:(ReadStream on:value) onError:[nil])
-	]
+        type == stringAtom ifTrue:[
+            ^ value
+        ].
+        (value isMemberOf:ByteArray) ifTrue:[
+            ^ (Object readBinaryFrom:(ReadStream on:value) onError:[nil])
+        ]
     ].
     ^ nil
 !
 
-getProperty:propertyID from:aWindowID into:aTwoArgBlock
+Property:propertyID from:aWindowID into:aTwoArgBlock
     "get a property, evaluate aTwoArgBlock with typeID and value"
 
     |val typeID cls|
@@ -7456,92 +7545,92 @@
 #   define PROP_SIZE    2048
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isAtomID(propertyID)) {
-	    property = _AtomVal(propertyID);
-	    if (__isExternalAddress(aWindowID)) {
-		window = _WindowVal(aWindowID);
-	    } else {
-		window = DefaultRootWindow(dpy);
-	    }
-
-	    nread = 0;
-	    cp = 0;
+        Display *dpy = myDpy;
+
+        if (__isAtomID(propertyID)) {
+            property = _AtomVal(propertyID);
+            if (__isExternalAddress(aWindowID)) {
+                window = _WindowVal(aWindowID);
+            } else {
+                window = DefaultRootWindow(dpy);
+            }
+
+            nread = 0;
+            cp = 0;
 /*
-	    fprintf(stderr, "getProperty: ");
+            fprintf(stderr, "getProperty: ");
  */
-	    do {
-		if (XGetWindowProperty(dpy,window,property,nread/4,PROP_SIZE,False,
-				       AnyPropertyType,&actual_type,&actual_format,
-				       &nitems,&bytes_after,(unsigned char **)&data)
-		    != Success) {
-			ok = 0;
-			break;
-		}
-		typeID = __MKATOMOBJ(actual_type);
-		if (! cp) {
-		    cp = cp2 = (char *)malloc(nitems+1);
-		} else {
-		    cp = (char *)realloc(cp, nread + nitems + 1);
-		    cp2 = cp + nread;
-		}
-		if (! cp) {
-		    XFree(data);
-		    goto fail;
-		}
+            do {
+                if (XGetWindowProperty(dpy,window,property,nread/4,PROP_SIZE,False,
+                                       AnyPropertyType,&actual_type,&actual_format,
+                                       &nitems,&bytes_after,(unsigned char **)&data)
+                    != Success) {
+                        ok = 0;
+                        break;
+                }
+                typeID = __MKATOMOBJ(actual_type);
+                if (! cp) {
+                    cp = cp2 = (char *)malloc(nitems+1);
+                } else {
+                    cp = (char *)realloc(cp, nread + nitems + 1);
+                    cp2 = cp + nread;
+                }
+                if (! cp) {
+                    XFree(data);
+                    goto fail;
+                }
     
-		nread += nitems;
-		bcopy(data, cp2, nitems);
-		XFree(data);
+                nread += nitems;
+                bcopy(data, cp2, nitems);
+                XFree(data);
     /*
-		fprintf(stderr, "<nitems:%d bytes_after:%d>", nitems, bytes_after);
+                fprintf(stderr, "<nitems:%d bytes_after:%d>", nitems, bytes_after);
      */
-	    } while (bytes_after > 0);
+            } while (bytes_after > 0);
     /*
-	    fprintf(stderr, "\n");
+            fprintf(stderr, "\n");
      */
     
-	    if (ok) {
-		if (actual_type == XA_STRING) {
-		    cp[nread] = '\0';
-		    val = __MKSTRING_L(cp, nread);
-		} else {
-		    val = __new(nread + OHDR_SIZE);
-		    val->o_class = cls;
-		    bcopy(cp, __ByteArrayInstPtr(val)->ba_element, nread);
-		}
-	    }
-	    if (cp)
-		free(cp);
-	}
+            if (ok) {
+                if (actual_type == XA_STRING) {
+                    cp[nread] = '\0';
+                    val = __MKSTRING_L(cp, nread);
+                } else {
+                    val = __new(nread + OHDR_SIZE);
+                    val->o_class = cls;
+                    bcopy(cp, __ByteArrayInstPtr(val)->ba_element, nread);
+                }
+            }
+            if (cp)
+                free(cp);
+        }
     }
 fail: ;
 %}.
     typeID isNil ifTrue:[
-	^ false
+        ^ false
     ].
     aTwoArgBlock value:typeID value:val.
     ^ true
 !
 
-getSelectionFor:drawableId
+SelectionFor:drawableId
     "get the object selection -  either immediate, or asynchronous.
      Returns nil, if async request is on its way"
 
     |selProp sel|
 
     (self getSelectionOwnerOf:primaryAtom) isNil ifTrue:[
-	"no primary selection - use cut buffer"
-	sel := self getObjectProperty:cutBuffer0Atom from:nil.
-	^ sel
+        "no primary selection - use cut buffer"
+        sel := self getObjectProperty:cutBuffer0Atom from:nil.
+        ^ sel
     ].
     selProp := self atomIDOf:'ST_SELECTION' create:true.
     self requestObjectSelection:primaryAtom property:selProp for:drawableId.
     ^ nil
 !
 
-getSelectionOwnerOf:selectionAtomID
+SelectionOwnerOf:selectionAtomID
     "get the owner of a selection"
 
 %{  /* NOCONTEXT */
@@ -7549,54 +7638,54 @@
     Window window;
 
     if (__isAtomID(selectionAtomID) && ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	window = XGetSelectionOwner(dpy, _AtomVal(selectionAtomID));
-	RETURN ((window == None) ? nil : __MKOBJ(window));
+        Display *dpy = myDpy;
+
+        window = XGetSelectionOwner(dpy, _AtomVal(selectionAtomID));
+        RETURN ((window == None) ? nil : __MKOBJ(window));
     }
 %}.
      self primitiveFailed.
     ^ nil
 !
 
-getTextProperty:propertyID from:aWindowID
+TextProperty:propertyID from:aWindowID
     "get a text property; return string or nil"
 
     self getProperty:propertyID from:aWindowID into:[:type :value |
-	type == stringAtom ifTrue:[
-	    ^ value
-	]
+        type == stringAtom ifTrue:[
+            ^ value
+        ]
     ].
     ^ nil
 !
 
-getTextSelectionFor:drawableId
+TextSelectionFor:drawableId
     "get the text selection -  either immediate, or asynchronous.
      Returns nil, if async request is on its way"
 
     |selProp sel|
 
     (self getSelectionOwnerOf:primaryAtom) isNil ifTrue:[
-	"no primary selection - use cut buffer"
-	sel := self getTextProperty:cutBuffer0Atom from:nil.
-	^ sel
+        "no primary selection - use cut buffer"
+        sel := self getTextProperty:cutBuffer0Atom from:nil.
+        ^ sel
     ].
     selProp := self atomIDOf:'VT_SELECTION' create:true.
     self requestTextSelection:primaryAtom property:selProp for:drawableId.
     ^ nil
 !
 
-requestObjectSelection:selectionID property:propertyID for:aWindowId
+uestObjectSelection:selectionID property:propertyID for:aWindowId
     "ask the server to send us the selection - the view with ID aWindowID
      will later receive a SelectionNotify event for it."
 
     ^ self requestSelection:selectionID 
-		   property:propertyID 
-		   type:(self atomIDOf:'ST_OBJECT' create:true) 
-		   for:aWindowId
-!
-
-requestSelection:selectionID property:propertyID type:typeID for:aWindowId
+                   property:propertyID 
+                   type:(self atomIDOf:'ST_OBJECT' create:true) 
+                   for:aWindowId
+!
+
+uestSelection:selectionID property:propertyID type:typeID for:aWindowId
     "ask the server to send us the selection - the view with id aWindowID
      will later receive a SelectionNotify event for it (once the Xserver replies
      with the selections value)."
@@ -7609,20 +7698,20 @@
      && ISCONNECTED
      && __isSmallInteger(typeID)
      && __isAtomID(selectionID)) {
-	Display *dpy = myDpy;
-
-	if (XGetSelectionOwner(dpy, _AtomVal(selectionID)) == None) {
-	    /*
-	     * no owner of primary selection
-	     */
-	    RETURN (false);
-	}
-	/*
-	 * PRIMARY selection
-	 */
-	XConvertSelection(dpy, _AtomVal(selectionID), _AtomVal(typeID), 
-			       _AtomVal(propertyID), _WindowVal(aWindowId), CurrentTime);
-	RETURN (true);
+        Display *dpy = myDpy;
+
+        if (XGetSelectionOwner(dpy, _AtomVal(selectionID)) == None) {
+            /*
+             * no owner of primary selection
+             */
+            RETURN (false);
+        }
+        /*
+         * PRIMARY selection
+         */
+        XConvertSelection(dpy, _AtomVal(selectionID), _AtomVal(typeID), 
+                               _AtomVal(propertyID), _WindowVal(aWindowId), CurrentTime);
+        RETURN (true);
     }
 %}.
     self primitiveFailed.
@@ -7630,50 +7719,50 @@
 
     "
      Display requestSelection:(Display atomIDOf:'PRIMARY')
-		     property:(Display atomIDOf:'VT_SELECTION')
-			  for:0
+                     property:(Display atomIDOf:'VT_SELECTION')
+                          for:0
     "
 !
 
-requestTextSelection:selectionID property:propertyID for:aWindowId
+uestTextSelection:selectionID property:propertyID for:aWindowId
     "ask the server to send us the selection - the view with ID aWindowID
      will later receive a SelectionNotify event for it."
 
     ^ self requestSelection:selectionID 
-		   property:propertyID 
-		       type:stringAtom 
-			for:aWindowId
-!
-
-sendSelection:something property:propertyID target:targetID from:windowID to:requestorID
+                   property:propertyID 
+                       type:stringAtom 
+                        for:aWindowId
+!
+
+dSelection:something property:propertyID target:targetID from:windowID to:requestorID
     "send aString back from a SelectionRequest"
 
     self 
-	sendSelection:something 
-	selection:primaryAtom
-	property:propertyID 
-	target:targetID 
-	from:windowID 
-	to:requestorID
-!
-
-sendSelection:something selection:selectionID property:propertyID target:targetID from:windowID to:requestorID
+        sendSelection:something 
+        selection:primaryAtom
+        property:propertyID 
+        target:targetID 
+        from:windowID 
+        to:requestorID
+!
+
+dSelection:something selection:selectionID property:propertyID target:targetID from:windowID to:requestorID
     "send aString back from a SelectionRequest"
 
     self 
-	setProperty:propertyID 
-	type:targetID 
-	value:something 
-	for:requestorID.
+        setProperty:propertyID 
+        type:targetID 
+        value:something 
+        for:requestorID.
     self 
-	sendSelectionNotifySelection:selectionID 
-	property:propertyID 
-	target:targetID 
-	from:requestorID 
-	to:requestorID.
-!
-
-sendSelectionNotifySelection:selectionID property:propertyID target:targetID from:windowID to:requestorID
+        sendSelectionNotifySelection:selectionID 
+        property:propertyID 
+        target:targetID 
+        from:requestorID 
+        to:requestorID.
+!
+
+dSelectionNotifySelection:selectionID property:propertyID target:targetID from:windowID to:requestorID
     "send a selectionNotify back from a SelectionRequest"
 
 %{  /* NOCONTEXT */
@@ -7683,66 +7772,66 @@
      && ISCONNECTED
      && __isAtomID(targetID)
      && __isAtomID(selectionID)) {
-	Display *dpy = myDpy;
-	XEvent ev;
-	Window requestor = _WindowVal(requestorID);
-	Atom property = _AtomVal(propertyID);
-	Atom target = _AtomVal(targetID);
-	Atom selection = _AtomVal(selectionID);
-	Status result;
-
-	ev.xselection.type = SelectionNotify;
-	ev.xselection.selection = selection;
-	ev.xselection.target = target;
-	if (__isExternalAddress(windowID))
-	    ev.xselection.requestor = _WindowVal(windowID);
-	else
-	    ev.xselection.requestor = DefaultRootWindow(dpy);
-	ev.xselection.time = CurrentTime;
-	if (property == None)
-	    ev.xselection.property = target;
-	else
-	    ev.xselection.property = property;
-
-	DPRINTF(("sending SelectionNotify sel=%x prop=%x target=%x requestor=%x to %x\n",
-		ev.xselection.selection,
-		ev.xselection.property,
-		ev.xselection.target,
-		ev.xselection.requestor,
-		requestor));
-
-	result = XSendEvent(dpy, requestor, False, 0 , &ev);
-	if ((result == BadValue) || (result == BadWindow)) {
-	    DPRINTF(("bad status\n"));
-	    RETURN (false);
-	}
-	RETURN (true)
+        Display *dpy = myDpy;
+        XEvent ev;
+        Window requestor = _WindowVal(requestorID);
+        Atom property = _AtomVal(propertyID);
+        Atom target = _AtomVal(targetID);
+        Atom selection = _AtomVal(selectionID);
+        Status result;
+
+        ev.xselection.type = SelectionNotify;
+        ev.xselection.selection = selection;
+        ev.xselection.target = target;
+        if (__isExternalAddress(windowID))
+            ev.xselection.requestor = _WindowVal(windowID);
+        else
+            ev.xselection.requestor = DefaultRootWindow(dpy);
+        ev.xselection.time = CurrentTime;
+        if (property == None)
+            ev.xselection.property = target;
+        else
+            ev.xselection.property = property;
+
+        DPRINTF(("sending SelectionNotify sel=%x prop=%x target=%x requestor=%x to %x\n",
+                ev.xselection.selection,
+                ev.xselection.property,
+                ev.xselection.target,
+                ev.xselection.requestor,
+                requestor));
+
+        result = XSendEvent(dpy, requestor, False, 0 , &ev);
+        if ((result == BadValue) || (result == BadWindow)) {
+            DPRINTF(("bad status\n"));
+            RETURN (false);
+        }
+        RETURN (true)
     }
 %}.
     self primitiveFailed.
     ^ false
 !
 
-setLengthProperty:propertyID value:aNumber for:aWindowID
+LengthProperty:propertyID value:aNumber for:aWindowID
     ^ self setProperty:propertyID type:(self atomIDOfLENGTH) value:aNumber for:aWindowID
 !
 
-setObjectProperty:propertyID value:anObject for:aWindowID
+ObjectProperty:propertyID value:anObject for:aWindowID
     |s|
 
     (anObject isMemberOf:String) ifTrue:[
-	^ self setTextProperty:propertyID value:anObject for:aWindowID
+        ^ self setTextProperty:propertyID value:anObject for:aWindowID
     ].
     s := WriteStream on:(ByteArray new:200).
     anObject storeBinaryOn:s.
     ^ self 
-	setProperty:propertyID 
-	type:(self atomIDOf:'ST_OBJECT' create:true) 
-	value:(s contents) 
-	for:aWindowID
-!
-
-setProperty:propertyID type:typeID value:anObject for:aWindowID
+        setProperty:propertyID 
+        type:(self atomIDOf:'ST_OBJECT' create:true) 
+        value:(s contents) 
+        for:aWindowID
+!
+
+Property:propertyID type:typeID value:anObject for:aWindowID
 
 %{  /* UNLIMITEDSTACK */
 
@@ -7754,64 +7843,64 @@
      && __isAtomID(typeID) 
      && ISCONNECTED
      && (__isString(anObject) 
-	 || __isSmallInteger(anObject) 
-	 || __isSymbol(anObject) 
-	 || __isByteArray(anObject)
-	 || __isWords(anObject))) { 
-
-	Display *dpy = myDpy;
-
-	prop = _AtomVal(propertyID);
-	type = _AtomVal(typeID);
-	if (__isExternalAddress(aWindowID)) {
-	    window = _WindowVal(aWindowID);
-	} else {
-	    window = DefaultRootWindow(dpy);
-	}
-	if (__isSmallInteger(anObject)) {
-	    value = __intVal(anObject);
-	    XChangeProperty(dpy, window, prop, type, 32,
-			    PropModeReplace,
-			    (unsigned char *)(&value), sizeof(unsigned int));
-	} else {
-	    if (__isByteArray(anObject)) {
-		XChangeProperty(dpy, window, prop, type, 8,
-				PropModeReplace,
-				__ByteArrayInstPtr(anObject)->ba_element,
-				__byteArraySize(anObject));
-	    } else {
-		/* string or symbol or wordArray-like (16bit-string) object */
-		if (__isWords(__qClass(anObject))) {
-		    XChangeProperty(dpy, window, prop, XA_STRING, 16,
-				    PropModeReplace,
-				    __stringVal(anObject),
-				    __wordArraySize(anObject));
-		} else {
-		    XChangeProperty(dpy, window, prop, XA_STRING, 8,
-				    PropModeReplace,
-				    __stringVal(anObject),
-				    strlen(__stringVal(anObject)));
-		}
-	    }
-	}
-	RETURN (true);
+         || __isSmallInteger(anObject) 
+         || __isSymbol(anObject) 
+         || __isByteArray(anObject)
+         || __isWords(anObject))) { 
+
+        Display *dpy = myDpy;
+
+        prop = _AtomVal(propertyID);
+        type = _AtomVal(typeID);
+        if (__isExternalAddress(aWindowID)) {
+            window = _WindowVal(aWindowID);
+        } else {
+            window = DefaultRootWindow(dpy);
+        }
+        if (__isSmallInteger(anObject)) {
+            value = __intVal(anObject);
+            XChangeProperty(dpy, window, prop, type, 32,
+                            PropModeReplace,
+                            (unsigned char *)(&value), sizeof(unsigned int));
+        } else {
+            if (__isByteArray(anObject)) {
+                XChangeProperty(dpy, window, prop, type, 8,
+                                PropModeReplace,
+                                __ByteArrayInstPtr(anObject)->ba_element,
+                                __byteArraySize(anObject));
+            } else {
+                /* string or symbol or wordArray-like (16bit-string) object */
+                if (__isWords(__qClass(anObject))) {
+                    XChangeProperty(dpy, window, prop, XA_STRING, 16,
+                                    PropModeReplace,
+                                    __stringVal(anObject),
+                                    __wordArraySize(anObject));
+                } else {
+                    XChangeProperty(dpy, window, prop, XA_STRING, 8,
+                                    PropModeReplace,
+                                    __stringVal(anObject),
+                                    strlen(__stringVal(anObject)));
+                }
+            }
+        }
+        RETURN (true);
     }
 %}.
     ^ false
 !
 
-setSelection:anObject owner:aWindowId
+Selection:anObject owner:aWindowId
     "set the object selection, and make aWindowId be the owner.
      This can be used by other Smalltalk(X) applications only."
 
     (self setSelectionOwner:aWindowId of:primaryAtom) ifFalse:[
-	^ false
+        ^ false
     ].
 "/    ^ self setObjectProperty:cutBuffer0Atom value:anObject for:nil
     ^ true
 !
 
-setSelectionOwner:aWindowId of:selectionID
+SelectionOwner:aWindowId of:selectionID
     "set the owner of a selection; return false if failed"
 
 %{  /* NOCONTEXT */
@@ -7820,14 +7909,14 @@
     if (__isExternalAddress(aWindowId)
      && __isAtomID(selectionID)
      && ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	win = _WindowVal(aWindowId);
-	XSetSelectionOwner(dpy, _AtomVal(selectionID), win, CurrentTime);
-	if (XGetSelectionOwner(dpy, _AtomVal(selectionID)) != win) {
-	    RETURN (false);
-	}
-	RETURN (true);
+        Display *dpy = myDpy;
+
+        win = _WindowVal(aWindowId);
+        XSetSelectionOwner(dpy, _AtomVal(selectionID), win, CurrentTime);
+        if (XGetSelectionOwner(dpy, _AtomVal(selectionID)) != win) {
+            RETURN (false);
+        }
+        RETURN (true);
     }
 %}
 .
@@ -7835,16 +7924,16 @@
     ^ nil
 !
 
-setTextProperty:propertyID value:aString for:aWindowID
+TextProperty:propertyID value:aString for:aWindowID
     ^ self setProperty:propertyID type:(self atomIDOfSTRING) value:aString for:aWindowID
 !
 
-setTextSelection:aString owner:aWindowId
+TextSelection:aString owner:aWindowId
     "set the text selection, and make aWindowId be the owner.
      This can be used by any other X application."
 
     (self setSelectionOwner:aWindowId of:primaryAtom) ifFalse:[
-	'XWorkstation [warning]: selection ownerchange failed' errorPrintCR.
+        'XWorkstation [warning]: selection ownerchange failed' errorPrintCR.
     ].
     ^ self setTextProperty:cutBuffer0Atom value:aString for:nil
 
@@ -7853,7 +7942,7 @@
 
 !XWorkstation methodsFor:'window stuff'!
 
-clearRectangleX:x y:y width:width height:height in:aWindowId
+arRectangleX:x y:y width:width height:height in:aWindowId
     "clear a rectangular area to viewbackground"
 
 %{  /* NOCONTEXT */
@@ -7861,42 +7950,42 @@
     int w, h;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)
-	 && __bothSmallInteger(x, y)
-	 && __bothSmallInteger(width, height)) {
-	    w = __intVal(width);
-	    h = __intVal(height);
-	    /*
-	     * need this check here: some servers simply dump core with bad args
-	     */
-	    if ((w >= 0) && (h >= 0)) {
-		XClearArea(myDpy, _WindowVal(aWindowId), __intVal(x), __intVal(y), w, h, 0);
-	    }
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aWindowId)
+         && __bothSmallInteger(x, y)
+         && __bothSmallInteger(width, height)) {
+            w = __intVal(width);
+            h = __intVal(height);
+            /*
+             * need this check here: some servers simply dump core with bad args
+             */
+            if ((w >= 0) && (h >= 0)) {
+                XClearArea(myDpy, _WindowVal(aWindowId), __intVal(x), __intVal(y), w, h, 0);
+            }
+            RETURN ( self );
+        }
     }
 %}
 .
     self primitiveFailed
 !
 
-clearWindow:aWindowId
+arWindow:aWindowId
     "clear a window to viewbackground"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)) {
-	    XClearWindow(myDpy, _WindowVal(aWindowId));
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aWindowId)) {
+            XClearWindow(myDpy, _WindowVal(aWindowId));
+            RETURN ( self );
+        }
     }
 %}
 .
     self primitiveFailed
 !
 
-configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
+figureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
     "configure stacking operation of aWindowId w.r.t siblingId"
 
 %{  /* NOCONTEXT */
@@ -7905,27 +7994,27 @@
     int mask = CWSibling | CWStackMode;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)
-	 && __isExternalAddress(siblingId)) {
-	    if (modeSymbol == @symbol(above)) {
-		chg.stack_mode = Above;
-	    } else if (modeSymbol == @symbol(below)) {
-		chg.stack_mode = Below;
-	    } else if (modeSymbol == @symbol(topIf)) {
-		chg.stack_mode = TopIf;
-	    } else if (modeSymbol == @symbol(bottomIf)) {
-		chg.stack_mode = BottomIf;
-	    } else if (modeSymbol == @symbol(opposite)) {
-		chg.stack_mode = Opposite;
-	    } else {
-		mask = CWSibling;
-	    }
-
-	    chg.sibling = _WindowVal(siblingId);
-	    XConfigureWindow(myDpy, _WindowVal(aWindowId),
-				    mask, &chg);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aWindowId)
+         && __isExternalAddress(siblingId)) {
+            if (modeSymbol == @symbol(above)) {
+                chg.stack_mode = Above;
+            } else if (modeSymbol == @symbol(below)) {
+                chg.stack_mode = Below;
+            } else if (modeSymbol == @symbol(topIf)) {
+                chg.stack_mode = TopIf;
+            } else if (modeSymbol == @symbol(bottomIf)) {
+                chg.stack_mode = BottomIf;
+            } else if (modeSymbol == @symbol(opposite)) {
+                chg.stack_mode = Opposite;
+            } else {
+                mask = CWSibling;
+            }
+
+            chg.sibling = _WindowVal(siblingId);
+            XConfigureWindow(myDpy, _WindowVal(aWindowId),
+                                    mask, &chg);
+            RETURN ( self );
+        }
     }
 bad: ;
 %}
@@ -7933,36 +8022,36 @@
     self primitiveFailed
 !
 
-lowerWindow:aWindowId
+erWindow:aWindowId
     "bring a window to back"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	XLowerWindow(myDpy, _WindowVal(aWindowId));
-	RETURN ( self );
+        XLowerWindow(myDpy, _WindowVal(aWindowId));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos width:w height:h
+View:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos width:w height:h
     "make a window visible - either as icon or as a real view - needed for restart"
 
     |wicon wiconId wiconView wiconViewId wlabel|
 
     aBoolean ifTrue:[
-	wicon := aView icon.
-	wicon notNil ifTrue:[
-	    wiconId := wicon id
-	].
-	wiconView := aView iconView.
-	wiconView notNil ifTrue:[
-	    wiconViewId := wiconView id
-	].
-	wlabel := aView label.
+        wicon := aView icon.
+        wicon notNil ifTrue:[
+            wiconId := wicon id
+        ].
+        wiconView := aView iconView.
+        wiconView notNil ifTrue:[
+            wiconViewId := wiconView id
+        ].
+        wlabel := aView label.
     ].
 %{  
 
@@ -7972,92 +8061,92 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	Display *dpy = myDpy;
-
-	win = _WindowVal(aWindowId);
-
-	szhints.flags = 0;
-	if (__bothSmallInteger(xPos, yPos)) {
-	    szhints.x = __intVal(xPos);
-	    szhints.y = __intVal(yPos);
-	    szhints.flags |= USPosition;
-	}
-	if (__bothSmallInteger(w, h)) {
-	    szhints.width = __intVal(w);
-	    szhints.height = __intVal(h);
-	    szhints.flags |= USSize;
-	}
-
-	if (aBoolean == true) {
-	    char *windowName;
-	    Pixmap iconBitmap = (Pixmap)0;
-	    Window iconWindow;
-
-	    if (__isExternalAddress(wiconId))
-		iconBitmap = _PixmapVal(wiconId);
-	    else
-		iconBitmap = (Pixmap)0;
-
-	    if (__isExternalAddress(wiconViewId))
-		iconWindow = _WindowVal(wiconViewId);
-	    else
-		iconWindow = (Window)0;
-
-	    if (__isString(wlabel) || __isSymbol(wlabel))
-		windowName = (char *)_stringVal(wlabel);
-	    else
-		windowName = "";
-
-	    if (iconBitmap || windowName) {
-		XSetStandardProperties(dpy, win,
-					windowName, windowName,
-					iconBitmap,
-					0, 0, &szhints);
-	    }
-
-	    wmhints.flags = 0;
-	    if (iconBitmap) {
-		wmhints.flags |= IconPixmapHint;
-		wmhints.icon_pixmap = iconBitmap;
-	    }
-	    if (iconWindow) {
-		wmhints.flags |= IconWindowHint;
-		wmhints.icon_window = iconWindow;
-	    }
-
-	    wmhints.initial_state = IconicState;
-	    wmhints.flags |= StateHint;
-	    XSetWMHints(dpy, win, &wmhints);
-	}
-
-	if (szhints.flags) {
-	    XSetNormalHints(dpy, win, &szhints);
-	}
-
-	XMapWindow(dpy, win);
-	RETURN ( self );
+        Display *dpy = myDpy;
+
+        win = _WindowVal(aWindowId);
+
+        szhints.flags = 0;
+        if (__bothSmallInteger(xPos, yPos)) {
+            szhints.x = __intVal(xPos);
+            szhints.y = __intVal(yPos);
+            szhints.flags |= USPosition;
+        }
+        if (__bothSmallInteger(w, h)) {
+            szhints.width = __intVal(w);
+            szhints.height = __intVal(h);
+            szhints.flags |= USSize;
+        }
+
+        if (aBoolean == true) {
+            char *windowName;
+            Pixmap iconBitmap = (Pixmap)0;
+            Window iconWindow;
+
+            if (__isExternalAddress(wiconId))
+                iconBitmap = _PixmapVal(wiconId);
+            else
+                iconBitmap = (Pixmap)0;
+
+            if (__isExternalAddress(wiconViewId))
+                iconWindow = _WindowVal(wiconViewId);
+            else
+                iconWindow = (Window)0;
+
+            if (__isString(wlabel) || __isSymbol(wlabel))
+                windowName = (char *)_stringVal(wlabel);
+            else
+                windowName = "";
+
+            if (iconBitmap || windowName) {
+                XSetStandardProperties(dpy, win,
+                                        windowName, windowName,
+                                        iconBitmap,
+                                        0, 0, &szhints);
+            }
+
+            wmhints.flags = 0;
+            if (iconBitmap) {
+                wmhints.flags |= IconPixmapHint;
+                wmhints.icon_pixmap = iconBitmap;
+            }
+            if (iconWindow) {
+                wmhints.flags |= IconWindowHint;
+                wmhints.icon_window = iconWindow;
+            }
+
+            wmhints.initial_state = IconicState;
+            wmhints.flags |= StateHint;
+            XSetWMHints(dpy, win, &wmhints);
+        }
+
+        if (szhints.flags) {
+            XSetNormalHints(dpy, win, &szhints);
+        }
+
+        XMapWindow(dpy, win);
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-mapWindow:aWindowId
+Window:aWindowId
     "make a window visible"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	XMapWindow(myDpy, _WindowVal(aWindowId));
-	RETURN ( self );
+        XMapWindow(myDpy, _WindowVal(aWindowId));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-moveResizeWindow:aWindowId x:x y:y width:w height:h
+eResizeWindow:aWindowId x:x y:y width:w height:h
     "move and resize a window"
 
 %{  /* NOCONTEXT */
@@ -8068,51 +8157,51 @@
      && __isExternalAddress(aWindowId)
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(x, y)) {
-	newWidth = __intVal(w);
-	newHeight = __intVal(h);
-	if (newWidth < 1) newWidth = 1;
-	if (newHeight < 1) newHeight = 1;
-	XMoveResizeWindow(myDpy, _WindowVal(aWindowId),
-			      __intVal(x), __intVal(y),
-			      newWidth, newHeight);
-	RETURN ( self );
+        newWidth = __intVal(w);
+        newHeight = __intVal(h);
+        if (newWidth < 1) newWidth = 1;
+        if (newHeight < 1) newHeight = 1;
+        XMoveResizeWindow(myDpy, _WindowVal(aWindowId),
+                              __intVal(x), __intVal(y),
+                              newWidth, newHeight);
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-moveWindow:aWindowId x:x y:y
+eWindow:aWindowId x:x y:y
     "move a window"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId) && __bothSmallInteger(x, y)) {
-	XMoveWindow(myDpy, _WindowVal(aWindowId), __intVal(x), __intVal(y));
-	RETURN ( self );
+        XMoveWindow(myDpy, _WindowVal(aWindowId), __intVal(x), __intVal(y));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-raiseWindow:aWindowId
+seWindow:aWindowId
     "bring a window to front"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	XRaiseWindow(myDpy, _WindowVal(aWindowId));
-	RETURN ( self );
+        XRaiseWindow(myDpy, _WindowVal(aWindowId));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-resizeWindow:aWindowId width:w height:h
+izeWindow:aWindowId width:w height:h
     "resize a window"
 
 %{  /* NOCONTEXT */
@@ -8121,19 +8210,19 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId) && __bothSmallInteger(w, h)) {
-	newWidth = __intVal(w);
-	newHeight = __intVal(h);
-	if (newWidth < 1) newWidth = 1;
-	if (newHeight < 1) newHeight = 1;
-	XResizeWindow(myDpy, _WindowVal(aWindowId), newWidth, newHeight);
-	RETURN ( self );
+        newWidth = __intVal(w);
+        newHeight = __intVal(h);
+        if (newWidth < 1) newWidth = 1;
+        if (newHeight < 1) newHeight = 1;
+        XResizeWindow(myDpy, _WindowVal(aWindowId), newWidth, newHeight);
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-setBackingStore:how in:aWindowId
+BackingStore:how in:aWindowId
     "turn on/off backing-store for a window"
 
 %{  /* NOCONTEXT */
@@ -8142,22 +8231,22 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	if (__INST(ignoreBackingStore) != true) {
-	    if (how == @symbol(always)) wa.backing_store = Always;
-	    else if (how == @symbol(whenMapped)) wa.backing_store = WhenMapped;
-	    else if (how == true) wa.backing_store = Always;
-	    else wa.backing_store = 0;
-	    BEGIN_INTERRUPTSBLOCKED
-	    XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWBackingStore, &wa);
-	    END_INTERRUPTSBLOCKED
-	}
-	RETURN ( self );
+        if (__INST(ignoreBackingStore) != true) {
+            if (how == @symbol(always)) wa.backing_store = Always;
+            else if (how == @symbol(whenMapped)) wa.backing_store = WhenMapped;
+            else if (how == true) wa.backing_store = Always;
+            else wa.backing_store = 0;
+            BEGIN_INTERRUPTSBLOCKED
+            XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWBackingStore, &wa);
+            END_INTERRUPTSBLOCKED
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setBitGravity:how in:aWindowId
+BitGravity:how in:aWindowId
     "set bit gravity for a window"
 
 %{  /* NOCONTEXT */
@@ -8166,38 +8255,38 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	if (how == @symbol(NorthWest)) {
-	    wa.bit_gravity = NorthWestGravity;
-	} else if (how == @symbol(NorthEast)) {
-	    wa.bit_gravity = NorthEastGravity;
-	} else if (how == @symbol(SouthWest)) {
-	    wa.bit_gravity = SouthWestGravity;
-	} else if (how == @symbol(SouthEast)) {
-	    wa.bit_gravity = SouthEastGravity;
-	} else if (how == @symbol(Center)) {
-	    wa.bit_gravity = CenterGravity;
-	} else if (how == @symbol(North)) {
-	    wa.bit_gravity = NorthGravity;
-	} else if (how == @symbol(South)) {
-	    wa.bit_gravity = SouthGravity;
-	} else if (how == @symbol(West)) {
-	    wa.bit_gravity = WestGravity;
-	} else if (how == @symbol(East)) {
-	    wa.bit_gravity = EastGravity;
-	} else {
-	    wa.bit_gravity = NorthWestGravity;
-	}
-
-	BEGIN_INTERRUPTSBLOCKED
-	XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWBitGravity, &wa);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        if (how == @symbol(NorthWest)) {
+            wa.bit_gravity = NorthWestGravity;
+        } else if (how == @symbol(NorthEast)) {
+            wa.bit_gravity = NorthEastGravity;
+        } else if (how == @symbol(SouthWest)) {
+            wa.bit_gravity = SouthWestGravity;
+        } else if (how == @symbol(SouthEast)) {
+            wa.bit_gravity = SouthEastGravity;
+        } else if (how == @symbol(Center)) {
+            wa.bit_gravity = CenterGravity;
+        } else if (how == @symbol(North)) {
+            wa.bit_gravity = NorthGravity;
+        } else if (how == @symbol(South)) {
+            wa.bit_gravity = SouthGravity;
+        } else if (how == @symbol(West)) {
+            wa.bit_gravity = WestGravity;
+        } else if (how == @symbol(East)) {
+            wa.bit_gravity = EastGravity;
+        } else {
+            wa.bit_gravity = NorthWestGravity;
+        }
+
+        BEGIN_INTERRUPTSBLOCKED
+        XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWBitGravity, &wa);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setCursor:aCursorId in:aWindowId
+Cursor:aCursorId in:aWindowId
     "define a windows cursor"
 
 %{  /* NOCONTEXT */
@@ -8207,14 +8296,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aCursorId)) {
-	XDefineCursor(dpy, _WindowVal(aWindowId), _CursorVal(aCursorId));
-	RETURN ( self );
+        XDefineCursor(dpy, _WindowVal(aWindowId), _CursorVal(aCursorId));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setIconName:aString in:aWindowId
+IconName:aString in:aWindowId
     "define a windows iconname"
 
 %{  /* NOCONTEXT */
@@ -8222,14 +8311,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && (__isString(aString) || __isSymbol(aString))) {
-	XSetIconName(myDpy, _WindowVal(aWindowId), (char *)_stringVal(aString));
-	RETURN ( self );
+        XSetIconName(myDpy, _WindowVal(aWindowId), (char *)_stringVal(aString));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setSaveUnder:yesOrNo in:aWindowId
+SaveUnder:yesOrNo in:aWindowId
     "turn on/off save-under for a window"
 
 %{  /* NOCONTEXT */
@@ -8238,43 +8327,43 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	if (__INST(hasSaveUnder) == true) {
-	    wa.save_under = (yesOrNo == true) ? 1 : 0;
-	    XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWSaveUnder, &wa);
-	}
-	RETURN ( self );
+        if (__INST(hasSaveUnder) == true) {
+            wa.save_under = (yesOrNo == true) ? 1 : 0;
+            XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWSaveUnder, &wa);
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setTransient:aWindowId for:aMainWindowId
+Transient:aWindowId for:aMainWindowId
     "set aWindowId to be a transient of aMainWindow"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	Window w;
-
-	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
-	    w = (Window) 0;
-	} else {
-	    if (__isExternalAddress(aMainWindowId)) {
-		w = _WindowVal(aMainWindowId);
-	    } else {
-		goto getOutOfHere;
-	    }
-	}
-	XSetTransientForHint(myDpy, _WindowVal(aWindowId), w);
-	RETURN ( self );
+        Window w;
+
+        if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
+            w = (Window) 0;
+        } else {
+            if (__isExternalAddress(aMainWindowId)) {
+                w = _WindowVal(aMainWindowId);
+            } else {
+                goto getOutOfHere;
+            }
+        }
+        XSetTransientForHint(myDpy, _WindowVal(aWindowId), w);
+        RETURN ( self );
     }
  getOutOfHere: ;
 %}.
     self primitiveFailed
 !
 
-setWindowBackground:aColorIndex in:aWindowId
+WindowBackground:aColorIndex in:aWindowId
     "set the windows background color. This is the color with which
      the view is filled whenever exposed. Do not confuse this with
      the background drawing color, which is used with opaque drawing."
@@ -8284,14 +8373,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isSmallInteger(aColorIndex)) {
-	XSetWindowBackground(myDpy, _WindowVal(aWindowId), __intVal(aColorIndex));
-	RETURN ( self );
+        XSetWindowBackground(myDpy, _WindowVal(aWindowId), __intVal(aColorIndex));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowBackgroundPixmap:aPixmapId in:aWindowId
+WindowBackgroundPixmap:aPixmapId in:aWindowId
     "set the windows background pattern to be a form.
      This is the pattern with which the view is filled whenever exposed. 
      Do not confuse this with the background drawing color, which is used 
@@ -8302,14 +8391,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aPixmapId)) {
-	XSetWindowBackgroundPixmap(myDpy, _WindowVal(aWindowId), _PixmapVal(aPixmapId));
-	RETURN ( self );
+        XSetWindowBackgroundPixmap(myDpy, _WindowVal(aWindowId), _PixmapVal(aPixmapId));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowBorderColor:aColorIndex in:aWindowId
+WindowBorderColor:aColorIndex in:aWindowId
     "set the windows border color"
 
 %{  /* NOCONTEXT */
@@ -8317,14 +8406,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isSmallInteger(aColorIndex)) {
-	XSetWindowBorder(myDpy, _WindowVal(aWindowId), __intVal(aColorIndex));
-	RETURN ( self );
+        XSetWindowBorder(myDpy, _WindowVal(aWindowId), __intVal(aColorIndex));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowBorderPixmap:aPixmapId in:aWindowId
+WindowBorderPixmap:aPixmapId in:aWindowId
     "set the windows border pattern"
 
 %{  /* NOCONTEXT */
@@ -8332,15 +8421,15 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aPixmapId)) {
-	XSetWindowBorderPixmap(myDpy, _WindowVal(aWindowId), _PixmapVal(aPixmapId));
-	RETURN ( self );
+        XSetWindowBorderPixmap(myDpy, _WindowVal(aWindowId), _PixmapVal(aPixmapId));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-setWindowBorderShape:aPixmapId in:aWindowId
+WindowBorderShape:aPixmapId in:aWindowId
     "set the windows border shape"
 
     hasShapeExtension ifFalse:[^ self].
@@ -8351,16 +8440,16 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aPixmapId)) {
-	XShapeCombineMask(myDpy, _WindowVal(aWindowId), ShapeBounding,
-			  0, 0, _PixmapVal(aPixmapId), ShapeSet);
-	RETURN ( self );
+        XShapeCombineMask(myDpy, _WindowVal(aWindowId), ShapeBounding,
+                          0, 0, _PixmapVal(aPixmapId), ShapeSet);
+        RETURN ( self );
     }
 #endif
 %}.
     self primitiveFailed
 !
 
-setWindowBorderWidth:aNumber in:aWindowId
+WindowBorderWidth:aNumber in:aWindowId
     "set the windows border width"
 
 %{  /* NOCONTEXT */
@@ -8368,14 +8457,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isSmallInteger(aNumber)) {
-	XSetWindowBorderWidth(myDpy, _WindowVal(aWindowId), __intVal(aNumber));
-	RETURN ( self );
+        XSetWindowBorderWidth(myDpy, _WindowVal(aWindowId), __intVal(aNumber));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowClass:wClass name:wName in:aWindowId
+WindowClass:wClass name:wName in:aWindowId
     "define class and name of a window.
      This may be used by the window manager to
      select client specific resources."
@@ -8383,29 +8472,29 @@
 %{
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	XClassHint classhint;
-
-	classhint.res_class = classhint.res_name = 0;
-
-	if (__isString(wClass) || __isSymbol(wClass)) {
-	    classhint.res_class = (char *)_stringVal(wClass);
-	} else if (wClass != nil)
-	    goto error;
-
-	if (__isString(wName) || __isSymbol(wName)) {
-	    classhint.res_name = (char *)_stringVal(wName);
-	} else if (wName != nil)
-	    goto error;
-
-	XSetClassHint(myDpy, _WindowVal(aWindowId), &classhint);
-	RETURN ( self );
+        XClassHint classhint;
+
+        classhint.res_class = classhint.res_name = 0;
+
+        if (__isString(wClass) || __isSymbol(wClass)) {
+            classhint.res_class = (char *)_stringVal(wClass);
+        } else if (wClass != nil)
+            goto error;
+
+        if (__isString(wName) || __isSymbol(wName)) {
+            classhint.res_name = (char *)_stringVal(wName);
+        } else if (wName != nil)
+            goto error;
+
+        XSetClassHint(myDpy, _WindowVal(aWindowId), &classhint);
+        RETURN ( self );
 error:;
     }
 %}.
     self primitiveFailed
 !
 
-setWindowGravity:how in:aWindowId
+WindowGravity:how in:aWindowId
     "set window gravity for a window"
 
 %{  /* NOCONTEXT */
@@ -8414,84 +8503,84 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	if (how == @symbol(NorthWest)) {
-	    wa.win_gravity = NorthWestGravity;
-	} else if (how == @symbol(NorthEast)) {
-	    wa.win_gravity = NorthEastGravity;
-	} else if (how == @symbol(SouthWest)) {
-	    wa.win_gravity = SouthWestGravity;
-	} else if (how == @symbol(SouthEast)) {
-	    wa.win_gravity = SouthEastGravity;
-	} else if (how == @symbol(Center)) {
-	    wa.win_gravity = CenterGravity;
-	} else if (how == @symbol(North)) {
-	    wa.win_gravity = NorthGravity;
-	} else if (how == @symbol(South)) {
-	    wa.win_gravity = SouthGravity;
-	} else if (how == @symbol(West)) {
-	    wa.win_gravity = WestGravity;
-	} else if (how == @symbol(East)) {
-	    wa.win_gravity = EastGravity;
-	} else {
-	    wa.win_gravity = NorthWestGravity;
-	}
-
-	BEGIN_INTERRUPTSBLOCKED
-	XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWWinGravity, &wa);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        if (how == @symbol(NorthWest)) {
+            wa.win_gravity = NorthWestGravity;
+        } else if (how == @symbol(NorthEast)) {
+            wa.win_gravity = NorthEastGravity;
+        } else if (how == @symbol(SouthWest)) {
+            wa.win_gravity = SouthWestGravity;
+        } else if (how == @symbol(SouthEast)) {
+            wa.win_gravity = SouthEastGravity;
+        } else if (how == @symbol(Center)) {
+            wa.win_gravity = CenterGravity;
+        } else if (how == @symbol(North)) {
+            wa.win_gravity = NorthGravity;
+        } else if (how == @symbol(South)) {
+            wa.win_gravity = SouthGravity;
+        } else if (how == @symbol(West)) {
+            wa.win_gravity = WestGravity;
+        } else if (how == @symbol(East)) {
+            wa.win_gravity = EastGravity;
+        } else {
+            wa.win_gravity = NorthWestGravity;
+        }
+
+        BEGIN_INTERRUPTSBLOCKED
+        XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWWinGravity, &wa);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowIcon:aForm in:aWindowId
+WindowIcon:aForm in:aWindowId
     "define a bitmap to be used as icon"
 
     |iconId|
 
     aForm notNil ifTrue:[
-	iconId := aForm id
+        iconId := aForm id
     ].
 %{
     if (ISCONNECTED
      && __isExternalAddress(iconId)
      && __isExternalAddress(aWindowId)) {
-	XWMHints hints;
-
-	hints.icon_pixmap = _PixmapVal(iconId);
-	hints.flags = IconPixmapHint;
-	XSetWMHints(myDpy, _WindowVal(aWindowId), &hints);
-	RETURN ( self );
+        XWMHints hints;
+
+        hints.icon_pixmap = _PixmapVal(iconId);
+        hints.flags = IconPixmapHint;
+        XSetWMHints(myDpy, _WindowVal(aWindowId), &hints);
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowIconWindow:aView in:aWindowId
+WindowIconWindow:aView in:aWindowId
     "define a window to be used as icon"
 
     |iconWindowId|
 
     aView notNil ifTrue:[
-	iconWindowId := aView id
+        iconWindowId := aView id
     ].
 %{
     if (ISCONNECTED
      && __isExternalAddress(iconWindowId)
      && __isExternalAddress(aWindowId)) {
-	XWMHints wmhints;
-
-	wmhints.icon_window = _WindowVal(iconWindowId);
-	wmhints.flags = IconWindowHint;
-	XSetWMHints(myDpy, _WindowVal(aWindowId), &wmhints);
-	RETURN ( self );
+        XWMHints wmhints;
+
+        wmhints.icon_window = _WindowVal(iconWindowId);
+        wmhints.flags = IconWindowHint;
+        XSetWMHints(myDpy, _WindowVal(aWindowId), &wmhints);
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowName:aString in:aWindowId
+WindowName:aString in:aWindowId
     "define a windows name"
 
 %{  /* NOCONTEXT */
@@ -8499,14 +8588,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && (__isString(aString) || __isSymbol(aString))) {
-	XStoreName(myDpy, _WindowVal(aWindowId), (char *)_stringVal(aString));
-	RETURN ( self );
+        XStoreName(myDpy, _WindowVal(aWindowId), (char *)_stringVal(aString));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowShape:aPixmapId in:aWindowId
+WindowShape:aPixmapId in:aWindowId
     "set the windows shape"
 
     hasShapeExtension ifFalse:[^ self].
@@ -8517,28 +8606,28 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aPixmapId)) {
-	XShapeCombineMask(myDpy, _WindowVal(aWindowId), ShapeClip,
-			  0, 0,
-			  _PixmapVal(aPixmapId), ShapeSet);
-	RETURN ( self );
+        XShapeCombineMask(myDpy, _WindowVal(aWindowId), ShapeClip,
+                          0, 0,
+                          _PixmapVal(aPixmapId), ShapeSet);
+        RETURN ( self );
     }
 #endif
 %}.
     self primitiveFailed
 !
 
-unmapWindow:aWindowId
+apWindow:aWindowId
     "make a window invisible"
 
 %{  /* NOCONTEXT */
 
     if (!ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aWindowId)) {
-	XUnmapWindow(myDpy, _WindowVal(aWindowId));
-	RETURN ( self );
+        XUnmapWindow(myDpy, _WindowVal(aWindowId));
+        RETURN ( self );
     }
 %}
 .
@@ -8548,6 +8637,6 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.202 1997-02-13 12:21:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/XWorkstat.st,v 1.203 1997-02-13 12:44:40 cg Exp $'
 ! !
 XWorkstation initialize!
--- a/XWorkstation.st	Thu Feb 13 13:41:46 1997 +0100
+++ b/XWorkstation.st	Thu Feb 13 13:44:40 1997 +0100
@@ -1,6 +1,6 @@
 "
 COPYRIGHT (c) 1989 by Claus Gittinger
-	      All Rights Reserved
+              All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -11,17 +11,18 @@
 "
 
 DeviceWorkstation subclass:#XWorkstation
-	instanceVariableNames:'screen hasShapeExtension hasShmExtension hasDPSExtension
-		hasMbufExtension hasXVideoExtension hasSaveUnder hasPEXExtension
-		hasImageExtension hasInputExtension ignoreBackingStore blackpixel
-		whitepixel protocolsAtom deleteWindowAtom saveYourselfAtom
-		quitAppAtom primaryAtom secondaryAtom cutBuffer0Atom stringAtom
-		lengthAtom listOfXFonts buttonsPressed eventRootX eventRootY
-		displayName eventTrace dispatchingExpose rgbVisual virtualRootId
-		rootId eventBuffer altModifierMask metaModifierMask multiClickTime'
-	classVariableNames:'RawKeysymTranslation ConservativeSync'
-	poolDictionaries:''
-	category:'Interface-Graphics'
+        instanceVariableNames:'screen hasShapeExtension hasShmExtension hasDPSExtension
+                hasMbufExtension hasXVideoExtension hasSaveUnder hasPEXExtension
+                hasImageExtension hasInputExtension ignoreBackingStore blackpixel
+                whitepixel protocolsAtom deleteWindowAtom saveYourselfAtom
+                quitAppAtom primaryAtom secondaryAtom cutBuffer0Atom stringAtom
+                lengthAtom listOfXFonts buttonsPressed eventRootX eventRootY
+                displayName eventTrace dispatchingExpose rgbVisual virtualRootId
+                rootId eventBuffer altModifierMask metaModifierMask
+                multiClickTime'
+        classVariableNames:'RawKeysymTranslation ConservativeSync'
+        poolDictionaries:''
+        category:'Interface-Graphics'
 !
 
 !XWorkstation primitiveDefinitions!
@@ -180,23 +181,23 @@
 
 # define BEGIN_INTERRUPTSBLOCKED        \
     {                                   \
-	int needUnblock = 0;            \
-					\
-	__BEGIN_PROTECT_REGISTERS__     \
-	if (!__interruptsBlocked) {     \
-	    __BLOCKINTERRUPTS();        \
-	    needUnblock = 1;            \
-	}
+        int needUnblock = 0;            \
+                                        \
+        __BEGIN_PROTECT_REGISTERS__     \
+        if (!__interruptsBlocked) {     \
+            __BLOCKINTERRUPTS();        \
+            needUnblock = 1;            \
+        }
 
 # define END_INTERRUPTSBLOCKED_NOW      \
-	__END_PROTECT_REGISTERS__       \
-	if (needUnblock) {              \
-	    __UNBLOCKINTERRUPTS();      \
-	}                               \
+        __END_PROTECT_REGISTERS__       \
+        if (needUnblock) {              \
+            __UNBLOCKINTERRUPTS();      \
+        }                               \
     }
 
 # define END_INTERRUPTSBLOCKED          \
-	__END_PROTECT_REGISTERS__
+        __END_PROTECT_REGISTERS__
 
 #endif
 %}
@@ -226,18 +227,18 @@
 
 static
 dummyToForceLoading() {
-	XCreateSimpleWindow(0, 0, 0, 0, 0, 0, 0, 0, 0);
-	XCloseDisplay(0);
-	XCreateImage(0, 0, 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0);
-	XSetWindowColormap(0, 0, 0);
-	XQueryColors(0,0,0,0);
+        XCreateSimpleWindow(0, 0, 0, 0, 0, 0, 0, 0, 0);
+        XCloseDisplay(0);
+        XCreateImage(0, 0, 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0);
+        XSetWindowColormap(0, 0, 0);
+        XQueryColors(0,0,0,0);
 #ifdef SHM
-	XShmAttach(0, 0);
-	XShmCreateImage(0, 0, 0, 0, 0, 0, 0 ,0);
-	XShmDetach(0, 0);
-	XShmPutImage(0, 0, 0, 0 , 0,0,0,0,0,0,0);
-	shmctl(0,0,0);
-	fgetc(0);
+        XShmAttach(0, 0);
+        XShmCreateImage(0, 0, 0, 0, 0, 0, 0 ,0);
+        XShmDetach(0, 0);
+        XShmPutImage(0, 0, 0, 0 , 0,0,0,0,0,0,0);
+        shmctl(0,0,0);
+        fgetc(0);
 #endif
 }
 
@@ -258,25 +259,25 @@
     lastErrorMsg[79] = '\0';
 
     if (lastErrorMsg[0] == '\0') {
-	sprintf(lastErrorMsg, "code: %d", event->error_code);
+        sprintf(lastErrorMsg, "code: %d", event->error_code);
     }
     lastRequestCode = event->request_code;
     lastMinorCode = event->minor_code;
     lastResource = event->resourceid;
     if ((event->error_code == BadWindow) && (lastRequestCode == 4) && (lastMinorCode == 0)) {
-	/* 
-	 * this is a BadWindow error for X_DestroyWindow.
-	 * ignore it here, since it results from the GC freeing windows
-	 * in non bottom-up window order.
-	 */
-	return 0;
+        /* 
+         * this is a BadWindow error for X_DestroyWindow.
+         * ignore it here, since it results from the GC freeing windows
+         * in non bottom-up window order.
+         */
+        return 0;
     }
 
     if (@global(ErrorPrinting) == true) {
-	fprintf(stderr, "XWorkstation [error]: x-error cought maj=%d (0x%x) min=%d (0x%x) resource=%x\n",
-			event->request_code, event->request_code, 
-			event->minor_code, event->minor_code, event->resourceid);
-	fprintf(stderr, "XWorkstation [error]: x-error message is [%d] '%s'\n", event->error_code, lastErrorMsg);
+        fprintf(stderr, "XWorkstation [error]: x-error cought maj=%d (0x%x) min=%d (0x%x) resource=%x\n",
+                        event->request_code, event->request_code, 
+                        event->minor_code, event->minor_code, event->resourceid);
+        fprintf(stderr, "XWorkstation [error]: x-error message is [%d] '%s'\n", event->error_code, lastErrorMsg);
     }
 
     __errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy));
@@ -306,27 +307,27 @@
      */
 # if !defined(IRIS) || defined(IRIX5)
     if (XQueryTree(dpy, root, &rootReturn, &parentReturn, &children, &numChildren)) {
-	vRootAtom = XInternAtom(dpy, "__SWM_VROOT", True );
-	if (vRootAtom != None) {
-	    for (i=0; i < numChildren; i++) {
-		Atom actual_type;
-		int actual_format;
-		unsigned long nitems, bytesafter;
-		Window* newRoot = (Window*) 0;
-
-		if (children[i]) {
-		    if (XGetWindowProperty(dpy, children[i], vRootAtom,
-					   0L, 1L, False, XA_WINDOW,
-					   &actual_type, &actual_format, &nitems, &bytesafter,
-					   (unsigned char**) &newRoot) == Success && newRoot) {
-			root = *newRoot;
-			XFree(newRoot); /* XXX */
-			break;
-		    }
-		}
-	    }
-	}
-	if (children) XFree( children );
+        vRootAtom = XInternAtom(dpy, "__SWM_VROOT", True );
+        if (vRootAtom != None) {
+            for (i=0; i < numChildren; i++) {
+                Atom actual_type;
+                int actual_format;
+                unsigned long nitems, bytesafter;
+                Window* newRoot = (Window*) 0;
+
+                if (children[i]) {
+                    if (XGetWindowProperty(dpy, children[i], vRootAtom,
+                                           0L, 1L, False, XA_WINDOW,
+                                           &actual_type, &actual_format, &nitems, &bytesafter,
+                                           (unsigned char**) &newRoot) == Success && newRoot) {
+                        root = *newRoot;
+                        XFree(newRoot); /* XXX */
+                        break;
+                    }
+                }
+            }
+        }
+        if (children) XFree( children );
     }
 # endif
     return root;
@@ -340,7 +341,7 @@
 copyright
 "
 COPYRIGHT (c) 1989 by Claus Gittinger
-	      All Rights Reserved
+              All Rights Reserved
 
  This software is furnished under a license and may be used
  only in accordance with the terms of that license and with the
@@ -365,7 +366,7 @@
     See more documentation in my superclass, DeviceWorkstation.
 
     [author:]
-	Claus Gittinger
+        Claus Gittinger
 "
 ! !
 
@@ -377,17 +378,17 @@
     super initialize.
 
     RawKeysymTranslation isNil ifTrue:[
-	"/ the following table maps X-keyevents to ST/X
-	"/ device independed events. 
-	"/ It is NOT meant as a keyboardMap replacement.
-
-	RawKeysymTranslation := d := Dictionary new.
-	d at:'Delete_line' put:#DeleteLine.
-	d at:'Delete_word' put:#DeleteWord.
-	d at:'Down' put:#CursorDown.
-	d at:'Up' put:#CursorUp.
-	d at:'Left' put:#CursorLeft.
-	d at:'Right' put:#CursorRight.
+        "/ the following table maps X-keyevents to ST/X
+        "/ device independed events. 
+        "/ It is NOT meant as a keyboardMap replacement.
+
+        RawKeysymTranslation := d := Dictionary new.
+        d at:'Delete_line' put:#DeleteLine.
+        d at:'Delete_word' put:#DeleteWord.
+        d at:'Down' put:#CursorDown.
+        d at:'Up' put:#CursorUp.
+        d at:'Left' put:#CursorLeft.
+        d at:'Right' put:#CursorRight.
     ]
 ! !
 
@@ -404,8 +405,8 @@
 %{
 #ifdef COUNT_RESOURCES
     printf("colors %d bitmaps %d view %d gc %d cursor %d font %d\n",
-	    __cnt_color, __cnt_bitmap,
-	    __cnt_view, __cnt_gc, __cnt_cursor, __cnt_font);
+            __cnt_color, __cnt_bitmap,
+            __cnt_view, __cnt_gc, __cnt_cursor, __cnt_font);
 #endif
 %}
 !
@@ -431,12 +432,12 @@
     "
     s := '/usr/lib/X11/XErrorDB' asFilename readStream.
     s notNil ifTrue:[
-	match := 'XRequest.' , requestCode printString.
-	line := s peekForLineStartingWith:match.
-	line notNil ifTrue:[
-	    string := string , ' in ' , (line copyFrom:(line indexOf:$:)+1)
-	].
-	s close.
+        match := 'XRequest.' , requestCode printString.
+        line := s peekForLineStartingWith:match.
+        line notNil ifTrue:[
+            string := string , ' in ' , (line copyFrom:(line indexOf:$:)+1)
+        ].
+        s close.
     ].
     ^ string
 !
@@ -528,13 +529,13 @@
 
 %{  /* NOCONTEXT */
     if (aButton == __MKSMALLINT(1)) {
-	RETURN (__MKSMALLINT(Button1MotionMask));
+        RETURN (__MKSMALLINT(Button1MotionMask));
     }
     if (aButton == __MKSMALLINT(2)) {
-	RETURN (__MKSMALLINT(Button2MotionMask));
+        RETURN (__MKSMALLINT(Button2MotionMask));
     }
     if (aButton == __MKSMALLINT(3)) {
-	RETURN (__MKSMALLINT(Button3MotionMask));
+        RETURN (__MKSMALLINT(Button3MotionMask));
     }
 %}.
     ^ nil
@@ -553,9 +554,9 @@
 
 %{  /* NOCONTEXT */
     RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
-			 KeyPressMask | KeyReleaseMask |
-			 EnterWindowMask | LeaveWindowMask |
-			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
+                         KeyPressMask | KeyReleaseMask |
+                         EnterWindowMask | LeaveWindowMask |
+                         ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
 %}
 !
 
@@ -565,7 +566,7 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	RETURN ( __MKSMALLINT(ConnectionNumber(myDpy)) );
+        RETURN ( __MKSMALLINT(ConnectionNumber(myDpy)) );
     }
     RETURN (nil);
 %}
@@ -586,7 +587,7 @@
 
 %{  /* NOCONTEXT */
     if (ISCONNECTED) {
-	RETURN ( __MKSMALLINT(XProtocolVersion(myDpy)) );
+        RETURN ( __MKSMALLINT(XProtocolVersion(myDpy)) );
     }
     RETURN (nil);
 %}
@@ -602,7 +603,7 @@
      (to avoid bugs in certain implementations)"
 %{
     if (ISCONNECTED) {
-	RETURN ( __MKSTRING(XServerVendor(myDpy)) );
+        RETURN ( __MKSTRING(XServerVendor(myDpy)) );
     }
     RETURN (nil);
 %}
@@ -639,28 +640,28 @@
      && __isExternalAddress(windowId1)
      && __isExternalAddress(windowId2)
      && __bothSmallInteger(x1, y1)) {
-	Display *dpy = myDpy;
-
-	w1 = _WindowVal(windowId1);
-	w2 = _WindowVal(windowId2);
+        Display *dpy = myDpy;
+
+        w1 = _WindowVal(windowId1);
+        w2 = _WindowVal(windowId2);
 #ifdef VIRTUAL_ROOT
-	if ((w1 == RootWindow(dpy, screen))
-	 || (w2 == RootWindow(dpy, screen))) {
-	    if (w1 == RootWindow(dpy, screen)) {
-		w1 = getRootWindow(dpy, screen);
-	    }
-	    if (w2 == RootWindow(dpy, screen)) {
-		w2 = getRootWindow(dpy, screen);
-	    }
-	}
+        if ((w1 == RootWindow(dpy, screen))
+         || (w2 == RootWindow(dpy, screen))) {
+            if (w1 == RootWindow(dpy, screen)) {
+                w1 = getRootWindow(dpy, screen);
+            }
+            if (w2 == RootWindow(dpy, screen)) {
+                w2 = getRootWindow(dpy, screen);
+            }
+        }
 #endif
-	BEGIN_INTERRUPTSBLOCKED
-	XTranslateCoordinates(dpy, w1, w2,
-			      __intVal(x1), __intVal(y1), 
-			      &xpos, &ypos, &child_return);
-	END_INTERRUPTSBLOCKED
-	x2 = __MKSMALLINT(xpos);
-	y2 = __MKSMALLINT(ypos);
+        BEGIN_INTERRUPTSBLOCKED
+        XTranslateCoordinates(dpy, w1, w2,
+                              __intVal(x1), __intVal(y1), 
+                              &xpos, &ypos, &child_return);
+        END_INTERRUPTSBLOCKED
+        x2 = __MKSMALLINT(xpos);
+        y2 = __MKSMALLINT(ypos);
     }
 %}.
 
@@ -674,7 +675,7 @@
 
 %{  /* NOCONTEXT */
     if (ISCONNECTED) {
-	RETURN ( __MKSMALLINT(XVendorRelease(myDpy)) );
+        RETURN ( __MKSMALLINT(XVendorRelease(myDpy)) );
     }
     RETURN (nil);
 %}
@@ -700,29 +701,29 @@
     if (ISCONNECTED
      && __isExternalAddress(windowId)
      && __isPoint(aPoint)) {
-	Display *dpy = myDpy;
-
-	xp = _point_X(aPoint);
-	yp = _point_Y(aPoint);
-	if (__bothSmallInteger(xp, yp)) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XTranslateCoordinates(dpy,
-				  RootWindow(dpy, screen),
-				  _WindowVal(windowId),
-				  __intVal(xp), __intVal(yp), 
-				  &xpos, &ypos, &child_return);
-	    END_INTERRUPTSBLOCKED
-	    if (child_return) {
-		RETURN ( __MKOBJ(child_return) );
-	    }
-	    RETURN ( nil );
-	}
+        Display *dpy = myDpy;
+
+        xp = _point_X(aPoint);
+        yp = _point_Y(aPoint);
+        if (__bothSmallInteger(xp, yp)) {
+            BEGIN_INTERRUPTSBLOCKED
+            XTranslateCoordinates(dpy,
+                                  RootWindow(dpy, screen),
+                                  _WindowVal(windowId),
+                                  __intVal(xp), __intVal(yp), 
+                                  &xpos, &ypos, &child_return);
+            END_INTERRUPTSBLOCKED
+            if (child_return) {
+                RETURN ( __MKOBJ(child_return) );
+            }
+            RETURN ( nil );
+        }
     }
 %}.
     windowId notNil ifTrue:[
-	aPoint isPoint ifTrue:[
-	    ^ self viewIdFromPoint:aPoint asPoint truncated in:windowId
-	]
+        aPoint isPoint ifTrue:[
+            ^ self viewIdFromPoint:aPoint asPoint truncated in:windowId
+        ]
     ].
 
     ^ nil
@@ -738,17 +739,17 @@
     if (ISCONNECTED
      && (__INST(rootId) != __INST(virtualRootId)) 
      && __isExternalAddress(__INST(virtualRootId))) {
-	Window vRootWin;
-	Window root;
-	int x, y;
-	unsigned int width, height;
-	unsigned int dummy;
-
-	vRootWin = _WindowVal(__INST(virtualRootId));
-	if (XGetGeometry(myDpy, vRootWin, &root, &x, &y, &width, &height,
-					  &dummy, &dummy)) {
-	    RETURN ( __MKPOINT_INT(width, height) );
-	}
+        Window vRootWin;
+        Window root;
+        int x, y;
+        unsigned int width, height;
+        unsigned int dummy;
+
+        vRootWin = _WindowVal(__INST(virtualRootId));
+        if (XGetGeometry(myDpy, vRootWin, &root, &x, &y, &width, &height,
+                                          &dummy, &dummy)) {
+            RETURN ( __MKPOINT_INT(width, height) );
+        }
     }
 %}.
     ^ width @ height
@@ -784,9 +785,9 @@
     int dummy;
 
     if (__isString(extensionString) && ISCONNECTED) {
-	if (XQueryExtension(myDpy, __stringVal(extensionString), &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
+        if (XQueryExtension(myDpy, __stringVal(extensionString), &dummy, &dummy, &dummy)) {
+            RETURN ( true );
+        }
     }
 %}.
     ^ false
@@ -899,40 +900,40 @@
     int cnt;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (XGetIconSizes(myDpy, RootWindow(dpy, screen), &sizeList, &cnt) > 0) {
-	   xIconSizes = __MKEXTERNALBYTES(sizeList);
-	   count = __MKSMALLINT(cnt);
-	}
+        Display *dpy = myDpy;
+
+        if (XGetIconSizes(myDpy, RootWindow(dpy, screen), &sizeList, &cnt) > 0) {
+           xIconSizes = __MKEXTERNALBYTES(sizeList);
+           count = __MKSMALLINT(cnt);
+        }
     }
 %}.
     xIconSizes isNil ifTrue:[^ nil].
 
     ret := OrderedCollection new:count.
     1 to:count do:[ :i |
-	|minWidth minHeight maxWidth maxHeight widthStep heightStep d|
+        |minWidth minHeight maxWidth maxHeight widthStep heightStep d|
 
 %{
-	XIconSize *slp;
-
-	slp = &((XIconSize *)__externalBytesAddress(xIconSizes))[__intVal(i)-1];
-	minWidth = __MKSMALLINT(slp->min_width);
-	minHeight = __MKSMALLINT(slp->min_height);
-	maxWidth = __MKSMALLINT(slp->max_width);
-	maxHeight = __MKSMALLINT(slp->max_height);
-	widthStep = __MKSMALLINT(slp->width_inc);
-	heightStep = __MKSMALLINT(slp->height_inc);
+        XIconSize *slp;
+
+        slp = &((XIconSize *)__externalBytesAddress(xIconSizes))[__intVal(i)-1];
+        minWidth = __MKSMALLINT(slp->min_width);
+        minHeight = __MKSMALLINT(slp->min_height);
+        maxWidth = __MKSMALLINT(slp->max_width);
+        maxHeight = __MKSMALLINT(slp->max_height);
+        widthStep = __MKSMALLINT(slp->width_inc);
+        heightStep = __MKSMALLINT(slp->height_inc);
 %}.
-	d := IdentityDictionary new.
-	d at:#minWidth put:minWidth.
-	d at:#maxWidth put:maxWidth.
-	d at:#widthStep put:widthStep.
-	d at:#minHeight put:minHeight.
-	d at:#maxHeight put:maxHeight.
-	d at:#heightStep put:heightStep.
-
-	ret add:d
+        d := IdentityDictionary new.
+        d at:#minWidth put:minWidth.
+        d at:#maxWidth put:maxWidth.
+        d at:#widthStep put:widthStep.
+        d at:#minHeight put:minHeight.
+        d at:#maxHeight put:maxHeight.
+        d at:#heightStep put:heightStep.
+
+        ret add:d
     ].
 
     xIconSizes free.
@@ -956,7 +957,7 @@
      Redefined to return a special value on SGI servers."
 
     self serverVendor = 'Silicon Graphics' ifTrue:[
-	^ 86@68
+        ^ 86@68
     ].
     ^ super preferredIconSize
 
@@ -982,7 +983,7 @@
     Display *dpy;
 
     if (! ISCONNECTED) {
-	RETURN (nil);
+        RETURN (nil);
     }
 
     dpy = myDpy;
@@ -990,24 +991,24 @@
 %}.
     formatArray := Array new:nFormats.
     1 to:nFormats do:[:index |
-	|info bitsPerPixelInfo depthInfo paddingInfo i|
-
-	i := index.
+        |info bitsPerPixelInfo depthInfo paddingInfo i|
+
+        i := index.
 %{
-	ScreenFormat *format;
-	Display *dpy = myDpy;
-
-	format = DISPLAYACCESS(dpy)->pixmap_format;
-	format += (__intVal(i)-1);
-	bitsPerPixelInfo = __MKSMALLINT(format->bits_per_pixel);
-	depthInfo = __MKSMALLINT(format->depth);
-	paddingInfo = __MKSMALLINT(format->scanline_pad);
+        ScreenFormat *format;
+        Display *dpy = myDpy;
+
+        format = DISPLAYACCESS(dpy)->pixmap_format;
+        format += (__intVal(i)-1);
+        bitsPerPixelInfo = __MKSMALLINT(format->bits_per_pixel);
+        depthInfo = __MKSMALLINT(format->depth);
+        paddingInfo = __MKSMALLINT(format->scanline_pad);
 %}.
-	info := IdentityDictionary new.
-	info at:#depth put:depthInfo.
-	info at:#bitsPerPixel put:bitsPerPixelInfo.
-	info at:#padding put:paddingInfo.
-	formatArray at:index put:info.
+        info := IdentityDictionary new.
+        info at:#depth put:depthInfo.
+        info at:#bitsPerPixel put:bitsPerPixelInfo.
+        info at:#padding put:paddingInfo.
+        formatArray at:index put:info.
     ].
     ^ formatArray
 
@@ -1045,7 +1046,7 @@
 
     bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
     bitmapId isNil ifTrue:[
-	self primitiveFailed
+        self primitiveFailed
     ].
     ^ bitmapId
 !
@@ -1062,30 +1063,30 @@
     int status;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isString(aString) || __isSymbol(aString)) {
-	    filename = (char *)_stringVal(aString);
-
-	    BEGIN_INTERRUPTSBLOCKED
-	    status = XReadBitmapFile(dpy, RootWindow(dpy, screen),
-				     filename, &b_width, &b_height, &newBitmap,
-				     &b_x_hot, &b_y_hot);
-	    END_INTERRUPTSBLOCKED
-
-	    if ((status == BitmapSuccess)  && newBitmap) {
+        Display *dpy = myDpy;
+
+        if (__isString(aString) || __isSymbol(aString)) {
+            filename = (char *)_stringVal(aString);
+
+            BEGIN_INTERRUPTSBLOCKED
+            status = XReadBitmapFile(dpy, RootWindow(dpy, screen),
+                                     filename, &b_width, &b_height, &newBitmap,
+                                     &b_x_hot, &b_y_hot);
+            END_INTERRUPTSBLOCKED
+
+            if ((status == BitmapSuccess)  && newBitmap) {
 #ifdef COUNT_RESOURCES
-		__cnt_bitmap++;
+                __cnt_bitmap++;
 #endif
-		w = __MKSMALLINT(b_width);
-		h = __MKSMALLINT(b_height);
-		id = __MKOBJ(newBitmap);
-	    }
-	}
+                w = __MKSMALLINT(b_width);
+                h = __MKSMALLINT(b_height);
+                id = __MKOBJ(newBitmap);
+            }
+        }
     }
 %}.
     id notNil ifTrue:[
-	aForm setWidth:w height:h
+        aForm setWidth:w height:h
     ].
     ^ id
 !
@@ -1100,17 +1101,17 @@
     Pixmap newBitmap;
 
     if (__bothSmallInteger(w, h) && ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
-	newBitmap = XCreatePixmap(dpy, RootWindow(dpy, screen),
-				       __intVal(w), __intVal(h), 1);
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
+        newBitmap = XCreatePixmap(dpy, RootWindow(dpy, screen),
+                                       __intVal(w), __intVal(h), 1);
 #ifdef COUNT_RESOURCES
-	if (newBitmap)
-	    __cnt_bitmap++;
+        if (newBitmap)
+            __cnt_bitmap++;
 #endif
-	END_INTERRUPTSBLOCKED
-	RETURN ( (newBitmap != (Pixmap)0) ? __MKOBJ(newBitmap) : nil );
+        END_INTERRUPTSBLOCKED
+        RETURN ( (newBitmap != (Pixmap)0) ? __MKOBJ(newBitmap) : nil );
     }
 %}
 .
@@ -1128,17 +1129,17 @@
     Pixmap newBitmap;
 
     if (__bothSmallInteger(w, h) && ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
-	newBitmap = XCreatePixmap(dpy, RootWindow(dpy, screen),
-				       __intVal(w), __intVal(h), __intVal(d));
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
+        newBitmap = XCreatePixmap(dpy, RootWindow(dpy, screen),
+                                       __intVal(w), __intVal(h), __intVal(d));
 #ifdef COUNT_RESOURCES
-	if (newBitmap)
-	    __cnt_bitmap++;
+        if (newBitmap)
+            __cnt_bitmap++;
 #endif
-	END_INTERRUPTSBLOCKED
-	RETURN ( (newBitmap != (Pixmap)0) ? __MKOBJ(newBitmap) : nil );
+        END_INTERRUPTSBLOCKED
+        RETURN ( (newBitmap != (Pixmap)0) ? __MKOBJ(newBitmap) : nil );
     }
 %}
 .
@@ -1150,36 +1151,36 @@
     "will vanish - for compatibility with previous versions"
 
     ^ self 
-	  createWindowFor:aView 
-	  origin:(xpos @ ypos)
-	  extent:(wwidth @ wheight)
-	  minExtent:(aView minExtent)
-	  maxExtent:(aView maxExtent)
-	  borderWidth:(aView borderWidth)
-	  subViewOf:(aView superView)
-	  onTop:(aView isPopUpView)
-	  inputOnly:(aView isInputOnly)
-	  label:(aView label)
-	  cursor:(aView cursor)
-	  icon:(aView icon)
-	  iconView:(aView iconView)
+          createWindowFor:aView 
+          origin:(xpos @ ypos)
+          extent:(wwidth @ wheight)
+          minExtent:(aView minExtent)
+          maxExtent:(aView maxExtent)
+          borderWidth:(aView borderWidth)
+          subViewOf:(aView superView)
+          onTop:(aView isPopUpView)
+          inputOnly:(aView isInputOnly)
+          label:(aView label)
+          cursor:(aView cursor)
+          icon:(aView icon)
+          iconView:(aView iconView)
 
     "Modified: 1.6.1996 / 13:22:48 / cg"
 !
 
 createWindowFor:aView
-		 origin:origin
-		 extent:extent
-		 minExtent:minExt 
-		 maxExtent:maxExt
-		 borderWidth:bWidth
-		 subViewOf:wsuperView
-		 onTop:wisPopUpView
-		 inputOnly:winputOnly
-		 label:wlabel
-		 cursor:wcursor
-		 icon:wicon
-		 iconView:wiconView
+                 origin:origin
+                 extent:extent
+                 minExtent:minExt 
+                 maxExtent:maxExt
+                 borderWidth:bWidth
+                 subViewOf:wsuperView
+                 onTop:wisPopUpView
+                 inputOnly:winputOnly
+                 label:wlabel
+                 cursor:wcursor
+                 icon:wicon
+                 iconView:wiconView
 
     |xpos ypos wwidth wheight minWidth minHeight maxWidth maxHeight 
      bColorId wsuperViewId wcursorId wiconId windowId
@@ -1187,45 +1188,45 @@
      vBgForm deepForm preferredVisual preferredDepth|
 
     displayId isNil ifTrue:[
-	self primitiveFailed.
-	^ nil
+        self primitiveFailed.
+        ^ nil
     ].
 
     origin notNil ifTrue:[
-	xpos := origin x.
-	ypos := origin y.
+        xpos := origin x.
+        ypos := origin y.
     ] ifFalse:[
-	xpos := ypos := 0.
+        xpos := ypos := 0.
     ].
     extent notNil ifTrue:[
-	wwidth := extent x.
-	wheight := extent y.
+        wwidth := extent x.
+        wheight := extent y.
     ] ifFalse:[
-	wwidth := wheight := 100.
+        wwidth := wheight := 100.
     ].
     minExt notNil ifTrue:[
-	minWidth := minExt x.
-	minHeight := minExt y
+        minWidth := minExt x.
+        minHeight := minExt y
     ].
     maxExt notNil ifTrue:[
-	maxWidth := maxExt x.
-	maxHeight := maxExt y
+        maxWidth := maxExt x.
+        maxHeight := maxExt y
     ].
 
     wsuperView notNil ifTrue:[
-	wsuperViewId := wsuperView id
+        wsuperViewId := wsuperView id
     ].
     wcursor isNil ifTrue:[
-	'XWorkstation [info]: cursor nil - defaulted' infoPrintCR
+        'XWorkstation [info]: cursor nil - defaulted' infoPrintCR
     ] ifFalse:[
-	wcursorId := wcursor id
+        wcursorId := wcursor id
     ].
 
     wicon notNil ifTrue:[
-	wiconId := wicon id
+        wiconId := wicon id
     ].
     wiconView notNil ifTrue:[
-	wiconViewId := wiconView id
+        wiconViewId := wiconView id
     ].
     weventMask := aView eventMask.
 
@@ -1259,119 +1260,119 @@
     sizehints.y = 0;
 
     if (__bothSmallInteger(wwidth, wheight)) {
-	sizehints.flags |= PSize;
-	sizehints.width = __intVal(wwidth);
-	sizehints.height = __intVal(wheight);
+        sizehints.flags |= PSize;
+        sizehints.width = __intVal(wwidth);
+        sizehints.height = __intVal(wheight);
     }
     if (__bothSmallInteger(xpos, ypos)) {
-	sizehints.flags |= PPosition;
-	sizehints.x = __intVal(xpos);
-	sizehints.y = __intVal(ypos);
+        sizehints.flags |= PPosition;
+        sizehints.x = __intVal(xpos);
+        sizehints.y = __intVal(ypos);
     }
     if (__bothSmallInteger(minWidth, minHeight)) {
-	sizehints.flags |= PMinSize;
-	sizehints.min_width = __intVal(minWidth);
-	sizehints.min_height = __intVal(minHeight);
+        sizehints.flags |= PMinSize;
+        sizehints.min_width = __intVal(minWidth);
+        sizehints.min_height = __intVal(minHeight);
     }
     if (__bothSmallInteger(maxWidth, maxHeight)) {
-	sizehints.flags |= PMaxSize;
-	sizehints.max_width = __intVal(maxWidth);
-	sizehints.max_height = __intVal(maxHeight);
+        sizehints.flags |= PMaxSize;
+        sizehints.max_width = __intVal(maxWidth);
+        sizehints.max_height = __intVal(maxHeight);
     }
 
     bg = WhitePixel(dpy, screen);
 
     if (__isSmallInteger(bWidth)) {
-	bw = __intVal(bWidth);
+        bw = __intVal(bWidth);
     } else {
-	bw = 0;
+        bw = 0;
     }
 
     bd = BlackPixel(dpy, screen);
 
     if (__isExternalAddress(wsuperViewId)) {
-	parentWindow = _WindowVal(wsuperViewId);
+        parentWindow = _WindowVal(wsuperViewId);
     } else {
-	parentWindow = RootWindow(dpy, screen);
-	isTopWindow = 1;
+        parentWindow = RootWindow(dpy, screen);
+        isTopWindow = 1;
     }
 
     if (wisPopUpView == true)
-	xswa.override_redirect = 1;
+        xswa.override_redirect = 1;
     else 
-	xswa.override_redirect = 0;
+        xswa.override_redirect = 0;
 
     if (winputOnly == true) 
-	ioClass = InputOnly;
+        ioClass = InputOnly;
     else 
-	ioClass = InputOutput;
+        ioClass = InputOutput;
 
     if (__isSmallInteger(weventMask)) {
-	xswa.event_mask = __intVal(weventMask);
+        xswa.event_mask = __intVal(weventMask);
     } else {
-	xswa.event_mask = 0;
+        xswa.event_mask = 0;
     }
 
     if (ioClass == InputOnly) {
-	bw = 0;
-	depth = 0;
-	flags |= CWEventMask;
+        bw = 0;
+        depth = 0;
+        flags |= CWEventMask;
     } else {
-	depth = DefaultDepth(dpy,screen);
-	flags |= CWEventMask | CWBorderPixel | CWOverrideRedirect;
-
-	if (backPixmap != (Pixmap)0) {
-	    xswa.background_pixmap = backPixmap;
-	    flags |= CWBackPixmap;
-	} else {
-	    xswa.background_pixel = bg;
-	    flags |= CWBackPixel;
-	}
-	xswa.border_pixel = bd;
+        depth = DefaultDepth(dpy,screen);
+        flags |= CWEventMask | CWBorderPixel | CWOverrideRedirect;
+
+        if (backPixmap != (Pixmap)0) {
+            xswa.background_pixmap = backPixmap;
+            flags |= CWBackPixmap;
+        } else {
+            xswa.background_pixel = bg;
+            flags |= CWBackPixel;
+        }
+        xswa.border_pixel = bd;
     }
 
     visual.visualid = CopyFromParent;
     if (__isSmallInteger(preferredDepth)) {
-	depth = __intVal(preferredDepth);
+        depth = __intVal(preferredDepth);
     }
 
     BEGIN_INTERRUPTSBLOCKED
     if (preferredVisual != nil) {
-	XVisualInfo vi;
-	int cls;
-
-	if (preferredVisual == @symbol(StaticGray))
-	    cls = StaticGray;
-	else if (preferredVisual == @symbol(GrayScale)) 
-	    cls = GrayScale;
-	else if (preferredVisual == @symbol(StaticColor)) 
-	    cls = StaticColor;
-	else if (preferredVisual == @symbol(PseudoColor)) 
-	    cls = PseudoColor;
-	else if (preferredVisual == @symbol(TrueColor)) 
-	    cls = TrueColor;
-	else if (preferredVisual == @symbol(DirectColor)) 
-	    cls = DirectColor;
-	else
-	    cls = PseudoColor;
-
-	if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
-	    visual.visualid = vi.visualid;
+        XVisualInfo vi;
+        int cls;
+
+        if (preferredVisual == @symbol(StaticGray))
+            cls = StaticGray;
+        else if (preferredVisual == @symbol(GrayScale)) 
+            cls = GrayScale;
+        else if (preferredVisual == @symbol(StaticColor)) 
+            cls = StaticColor;
+        else if (preferredVisual == @symbol(PseudoColor)) 
+            cls = PseudoColor;
+        else if (preferredVisual == @symbol(TrueColor)) 
+            cls = TrueColor;
+        else if (preferredVisual == @symbol(DirectColor)) 
+            cls = DirectColor;
+        else
+            cls = PseudoColor;
+
+        if (XMatchVisualInfo(dpy, screen, depth, cls, &vi)) {
+            visual.visualid = vi.visualid;
 /*
-	    printf("visualId=%x\n", vi.visualid);
+            printf("visualId=%x\n", vi.visualid);
 */
-	}
+        }
     }
 
     newWindow = XCreateWindow(dpy, parentWindow,
-			   sizehints.x, sizehints.y,
-			   sizehints.width, sizehints.height,
-			   bw, depth, ioClass, &visual,
-			   flags, &xswa);
+                           sizehints.x, sizehints.y,
+                           sizehints.width, sizehints.height,
+                           bw, depth, ioClass, &visual,
+                           flags, &xswa);
     END_INTERRUPTSBLOCKED
 
     if (! newWindow) {
-	RETURN ( nil );
+        RETURN ( nil );
     }
 
 #ifdef COUNT_RESOURCES
@@ -1383,7 +1384,7 @@
      * define its cursor
      */
     if (__isExternalAddress(wcursorId)) {
-	XDefineCursor(dpy, newWindow, _CursorVal(wcursorId));
+        XDefineCursor(dpy, newWindow, _CursorVal(wcursorId));
     }
 
     /*
@@ -1391,87 +1392,87 @@
      * (only makes sense for topWindows)
      */
     if (isTopWindow) {
-	if (__isExternalAddress(wiconId))
-	    iconBitmap = _PixmapVal(wiconId);
-	else
-	    iconBitmap = (Pixmap)0;
-
-	if (__isExternalAddress(wiconViewId))
-	    iconWindow = _WindowVal(wiconViewId);
-	else
-	    iconWindow = (Window)0;
-
-	if (__isString(wlabel) || __isSymbol(wlabel))
-	    windowName = (char *)_stringVal(wlabel);
-	else
-	    windowName = "";
-
-	if (iconBitmap || windowName) {
-	    XSetStandardProperties(dpy, newWindow,
-					windowName, windowName,
-					iconBitmap,
-					0, 0, &sizehints);
-
-	}
-
-	wmhints.flags = 0;
-	if (iconBitmap) {
-	    wmhints.flags |= IconPixmapHint;
-	    wmhints.icon_pixmap = iconBitmap;
-	}
-	if (iconWindow) {
-	    wmhints.flags |= IconWindowHint;
-	    wmhints.icon_window = iconWindow;
-	}
+        if (__isExternalAddress(wiconId))
+            iconBitmap = _PixmapVal(wiconId);
+        else
+            iconBitmap = (Pixmap)0;
+
+        if (__isExternalAddress(wiconViewId))
+            iconWindow = _WindowVal(wiconViewId);
+        else
+            iconWindow = (Window)0;
+
+        if (__isString(wlabel) || __isSymbol(wlabel))
+            windowName = (char *)_stringVal(wlabel);
+        else
+            windowName = "";
+
+        if (iconBitmap || windowName) {
+            XSetStandardProperties(dpy, newWindow,
+                                        windowName, windowName,
+                                        iconBitmap,
+                                        0, 0, &sizehints);
+
+        }
+
+        wmhints.flags = 0;
+        if (iconBitmap) {
+            wmhints.flags |= IconPixmapHint;
+            wmhints.icon_pixmap = iconBitmap;
+        }
+        if (iconWindow) {
+            wmhints.flags |= IconWindowHint;
+            wmhints.icon_window = iconWindow;
+        }
 /*
-	wmhints.flags |= InputHint;
-	wmhints.input = True;
+        wmhints.flags |= InputHint;
+        wmhints.input = True;
 */
-	XSetWMHints(dpy, newWindow, &wmhints);
-
-	/*
-	 * tell window manager to not kill us but send an event instead
-	 */
-	/*
-	 * get atoms first (if not already known)
-	 */
-	if (__INST(protocolsAtom) == nil) {
-	    WmProtocolsAtom = XInternAtom(dpy, "WM_PROTOCOLS", False);
-	    __INST(protocolsAtom) = __MKATOMOBJ(WmProtocolsAtom);
+        XSetWMHints(dpy, newWindow, &wmhints);
+
+        /*
+         * tell window manager to not kill us but send an event instead
+         */
+        /*
+         * get atoms first (if not already known)
+         */
+        if (__INST(protocolsAtom) == nil) {
+            WmProtocolsAtom = XInternAtom(dpy, "WM_PROTOCOLS", False);
+            __INST(protocolsAtom) = __MKATOMOBJ(WmProtocolsAtom);
 #ifdef USE_SAVEYOURSELF_ATOM
-	    WmSaveYourselfAtom = XInternAtom(dpy, "WM_SAVE_YOURSELF", False);
-	    __INST(saveYourselfAtom) = __MKATOMOBJ(WmSaveYourselfAtom);
+            WmSaveYourselfAtom = XInternAtom(dpy, "WM_SAVE_YOURSELF", False);
+            __INST(saveYourselfAtom) = __MKATOMOBJ(WmSaveYourselfAtom);
 #endif
 #ifdef USE_QUIT_APP_ATOM
-	    WmQuitAppAtom = XInternAtom(dpy, "_WM_QUIT_APP", False);
-	    __INST(quitAppAtom) = __MKATOMOBJ(WmQuitAppAtom);
+            WmQuitAppAtom = XInternAtom(dpy, "_WM_QUIT_APP", False);
+            __INST(quitAppAtom) = __MKATOMOBJ(WmQuitAppAtom);
 #endif
-	    WmDeleteWindowAtom = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
-	    __INST(deleteWindowAtom) = __MKATOMOBJ(WmDeleteWindowAtom);
-	} else {
+            WmDeleteWindowAtom = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
+            __INST(deleteWindowAtom) = __MKATOMOBJ(WmDeleteWindowAtom);
+        } else {
 #ifdef USE_QUIT_APP_ATOM
-	    WmQuitAppAtom = _AtomVal(__INST(quitAppAtom));
+            WmQuitAppAtom = _AtomVal(__INST(quitAppAtom));
 #else
-	    WmQuitAppAtom = 0;
+            WmQuitAppAtom = 0;
 #endif
-	    WmProtocolsAtom = _AtomVal(__INST(protocolsAtom));
-	    WmDeleteWindowAtom = _AtomVal(__INST(deleteWindowAtom));
+            WmProtocolsAtom = _AtomVal(__INST(protocolsAtom));
+            WmDeleteWindowAtom = _AtomVal(__INST(deleteWindowAtom));
 #ifdef USE_SAVEYOURSELF_ATOM
-	    WmSaveYourselfAtom = _AtomVal(__INST(saveYourselfAtom));
+            WmSaveYourselfAtom = _AtomVal(__INST(saveYourselfAtom));
 #else
-	    WmSaveYourselfAtom = 0;
+            WmSaveYourselfAtom = 0;
 #endif
-	}
-
-	atoms[0] = WmDeleteWindowAtom; atomCount++;
+        }
+
+        atoms[0] = WmDeleteWindowAtom; atomCount++;
 #ifdef USE_SAVEYOURSELF_ATOM
-	atoms[atomCount] = WmSaveYourselfAtom; atomCount++;
+        atoms[atomCount] = WmSaveYourselfAtom; atomCount++;
 #endif
 #ifdef USE_QUIT_APP_ATOM
-	atoms[atomCount] = WmQuitAppAtom; atomCount++;
+        atoms[atomCount] = WmQuitAppAtom; atomCount++;
 #endif
-	XChangeProperty(dpy, newWindow, WmProtocolsAtom, XA_ATOM,
-			32, PropModeReplace, (unsigned char *)atoms, atomCount);
+        XChangeProperty(dpy, newWindow, WmProtocolsAtom, XA_ATOM,
+                        32, PropModeReplace, (unsigned char *)atoms, atomCount);
     }
 
     END_INTERRUPTSBLOCKED
@@ -1487,21 +1488,21 @@
 %{  /* NOCONTEXT */
 
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aGCId)) {
-	GC gc = _GCVal(aGCId);
-
-	if (gc) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XFreeGC(myDpy, gc);
+        GC gc = _GCVal(aGCId);
+
+        if (gc) {
+            BEGIN_INTERRUPTSBLOCKED
+            XFreeGC(myDpy, gc);
 #ifdef COUNT_RESOURCES
-	    __cnt_gc--;
+            __cnt_gc--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	}
-	RETURN ( self );
+            END_INTERRUPTSBLOCKED
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -1512,21 +1513,21 @@
 %{  /* NOCONTEXT */
 
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aDrawableId)) {
-	Pixmap pix = _PixmapVal(aDrawableId);
-
-	if (pix) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XFreePixmap(myDpy, pix);
+        Pixmap pix = _PixmapVal(aDrawableId);
+
+        if (pix) {
+            BEGIN_INTERRUPTSBLOCKED
+            XFreePixmap(myDpy, pix);
 #ifdef COUNT_RESOURCES
-	    __cnt_bitmap--;
+            __cnt_bitmap--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	}
-	RETURN ( self );
+            END_INTERRUPTSBLOCKED
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -1535,20 +1536,20 @@
 destroyView:aView withId:aWindowId
 %{
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aWindowId)) {
-	Window win = _WindowVal(aWindowId);
-
-	if (win) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XDestroyWindow(myDpy, win);
+        Window win = _WindowVal(aWindowId);
+
+        if (win) {
+            BEGIN_INTERRUPTSBLOCKED
+            XDestroyWindow(myDpy, win);
 #ifdef COUNT_RESOURCES
-	    __cnt_view--;
+            __cnt_view--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	}
+            END_INTERRUPTSBLOCKED
+        }
     }
 %}.
     self removeKnownView:aView
@@ -1565,15 +1566,15 @@
     if (__isExternalAddress(aDrawableId)
      && __isExternalAddress(aGCId)
      && ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	dps = XDPSCreateContext(myDpy, (Drawable)_WindowVal(aDrawableId),
-				       _GCVal(aGCId),
-				       0, height, 0, colormap, NULL, 0,
-				       XDPSDefaultTextBackstop,
-				       XDPSDefaultErrorProc,
-				       NULL);
-	END_INTERRUPTSBLOCKED
-	RETURN ( dps ? __MKOBJ(dps) : nil );
+        BEGIN_INTERRUPTSBLOCKED
+        dps = XDPSCreateContext(myDpy, (Drawable)_WindowVal(aDrawableId),
+                                       _GCVal(aGCId),
+                                       0, height, 0, colormap, NULL, 0,
+                                       XDPSDefaultTextBackstop,
+                                       XDPSDefaultErrorProc,
+                                       NULL);
+        END_INTERRUPTSBLOCKED
+        RETURN ( dps ? __MKOBJ(dps) : nil );
     }
 #endif
 %}
@@ -1589,17 +1590,17 @@
     GC gc;
 
     if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	gc = XCreateGC(myDpy, (Drawable)_WindowVal(aDrawableId),
-			      0L, (XGCValues *)0);
+        BEGIN_INTERRUPTSBLOCKED
+        gc = XCreateGC(myDpy, (Drawable)_WindowVal(aDrawableId),
+                              0L, (XGCValues *)0);
 
 #ifdef COUNT_RESOURCES
-	if (gc)
-	    __cnt_gc++;
+        if (gc)
+            __cnt_gc++;
 #endif
 
-	END_INTERRUPTSBLOCKED
-	RETURN ( gc ? __MKOBJ(gc) : nil );
+        END_INTERRUPTSBLOCKED
+        RETURN ( gc ? __MKOBJ(gc) : nil );
     }
 %}.
     self primitiveFailed.
@@ -1614,17 +1615,17 @@
     GC gc;
 
     if (__isExternalAddress(aDrawableId) && ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	gc = XCreateGC(myDpy, (Drawable)_WindowVal(aDrawableId),
-			      0L, (XGCValues *)0);
+        BEGIN_INTERRUPTSBLOCKED
+        gc = XCreateGC(myDpy, (Drawable)_WindowVal(aDrawableId),
+                              0L, (XGCValues *)0);
 
 #ifdef COUNT_RESOURCES
-	if (gc)
-	    __cnt_gc++;
+        if (gc)
+            __cnt_gc++;
 #endif
 
-	END_INTERRUPTSBLOCKED
-	RETURN ( gc ? __MKOBJ(gc) : nil );
+        END_INTERRUPTSBLOCKED
+        RETURN ( gc ? __MKOBJ(gc) : nil );
     }
 %}.
     self primitiveFailed.
@@ -1653,75 +1654,75 @@
     int bytesPerRow;
 
     if (! ISCONNECTED) {
-	RETURN (nil);
+        RETURN (nil);
     }
 
     dpy = myDpy;
     if (firstCall) {
-	for (index=0; index < 256; index++) {
-	    reverseBitTable[index] = 0;
-	    if (index & 128) reverseBitTable[index] |=   1;
-	    if (index &  64) reverseBitTable[index] |=   2;
-	    if (index &  32) reverseBitTable[index] |=   4;
-	    if (index &  16) reverseBitTable[index] |=   8;
-	    if (index &   8) reverseBitTable[index] |=  16;
-	    if (index &   4) reverseBitTable[index] |=  32;
-	    if (index &   2) reverseBitTable[index] |=  64;
-	    if (index &   1) reverseBitTable[index] |= 128;
-	}
-	firstCall = 0;
+        for (index=0; index < 256; index++) {
+            reverseBitTable[index] = 0;
+            if (index & 128) reverseBitTable[index] |=   1;
+            if (index &  64) reverseBitTable[index] |=   2;
+            if (index &  32) reverseBitTable[index] |=   4;
+            if (index &  16) reverseBitTable[index] |=   8;
+            if (index &   8) reverseBitTable[index] |=  16;
+            if (index &   4) reverseBitTable[index] |=  32;
+            if (index &   2) reverseBitTable[index] |=  64;
+            if (index &   1) reverseBitTable[index] |= 128;
+        }
+        firstCall = 0;
     }
 
     if (__bothSmallInteger(w, h) && _isNonNilObject(anArray)) {
-	newBitmap = (Pixmap)0;
-	b_width = __intVal(w);
-	b_height = __intVal(h);
-	bytesPerRow = (b_width + 7) / 8;
-	nBytes = b_height * bytesPerRow;
-	if (nBytes < sizeof(fastBits)) {
-	    cp = b_bits = fastBits;
-	    allocatedBits = 0;
-	} else {
-	    cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
-	    if (! cp) goto fail;
-	}
-
-	if (__qClass(anArray) == @global(Array)) {
-	    index = 1;
-	    op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
-	    for (row = b_height; row; row--) {
-		for (col = bytesPerRow; col; col--) {
-		    num = *op++;
-		    if (! __isSmallInteger(num)) goto fail;
-		    bits = __intVal(num);
-		    *cp++ = reverseBitTable[bits];
-		}
-	    }
-	} else {
-	    if (__qClass(anArray) == @global(ByteArray)) {
-		pBits = __ByteArrayInstPtr(anArray)->ba_element;
-		for (col = b_height*bytesPerRow; col; col--) {
-		    *cp++ = reverseBitTable[*pBits++];
-		}
-	    } else {
-		goto fail;
-	    }
-	}
-
-	BEGIN_INTERRUPTSBLOCKED
-	newBitmap = XCreateBitmapFromData(dpy, RootWindow(dpy, screen),
-					       (char *)b_bits, 
-					       b_width, b_height);
+        newBitmap = (Pixmap)0;
+        b_width = __intVal(w);
+        b_height = __intVal(h);
+        bytesPerRow = (b_width + 7) / 8;
+        nBytes = b_height * bytesPerRow;
+        if (nBytes < sizeof(fastBits)) {
+            cp = b_bits = fastBits;
+            allocatedBits = 0;
+        } else {
+            cp = b_bits = allocatedBits = (unsigned char *) malloc(nBytes);
+            if (! cp) goto fail;
+        }
+
+        if (__qClass(anArray) == @global(Array)) {
+            index = 1;
+            op = &(__ArrayInstPtr(anArray)->a_element[index - 1]);
+            for (row = b_height; row; row--) {
+                for (col = bytesPerRow; col; col--) {
+                    num = *op++;
+                    if (! __isSmallInteger(num)) goto fail;
+                    bits = __intVal(num);
+                    *cp++ = reverseBitTable[bits];
+                }
+            }
+        } else {
+            if (__qClass(anArray) == @global(ByteArray)) {
+                pBits = __ByteArrayInstPtr(anArray)->ba_element;
+                for (col = b_height*bytesPerRow; col; col--) {
+                    *cp++ = reverseBitTable[*pBits++];
+                }
+            } else {
+                goto fail;
+            }
+        }
+
+        BEGIN_INTERRUPTSBLOCKED
+        newBitmap = XCreateBitmapFromData(dpy, RootWindow(dpy, screen),
+                                               (char *)b_bits, 
+                                               b_width, b_height);
 #ifdef COUNT_RESOURCES
-	if (newBitmap)
-	    __cnt_bitmap++;
+        if (newBitmap)
+            __cnt_bitmap++;
 #endif
 
-	END_INTERRUPTSBLOCKED
+        END_INTERRUPTSBLOCKED
 fail: ;
-	if (allocatedBits)
-	    free(allocatedBits);
-	RETURN ( newBitmap ? __MKOBJ(newBitmap) : nil );
+        if (allocatedBits)
+            free(allocatedBits);
+        RETURN ( newBitmap ? __MKOBJ(newBitmap) : nil );
     }
 %}
 !
@@ -1751,17 +1752,17 @@
     OBJ id;
 
     if (__INST(rootId) != nil) {
-	RETURN (__INST(rootId));
+        RETURN (__INST(rootId));
     }
 
     if (ISCONNECTED) {
-	root = RootWindow(myDpy, screen);
-	if (! root) {
-	    id = nil;
-	} else {
-	    __INST(rootId) = id = __MKOBJ(root); __STORE(self, id);
-	}
-	RETURN (id);
+        root = RootWindow(myDpy, screen);
+        if (! root) {
+            id = nil;
+        } else {
+            __INST(rootId) = id = __MKOBJ(root); __STORE(self, id);
+        }
+        RETURN (id);
     }
 %}.
     self primitiveFailed
@@ -1788,66 +1789,66 @@
     OBJ id;
 
     if (__INST(virtualRootId) != nil) {
-	RETURN (__INST(virtualRootId));
+        RETURN (__INST(virtualRootId));
     }
 
     if (ISCONNECTED) {
-	vRootWin = rootWin = RootWindow(myDpy, screen);
+        vRootWin = rootWin = RootWindow(myDpy, screen);
 #ifndef IRIS
-	BEGIN_INTERRUPTSBLOCKED
-	/*
-	 * on IRIS, this creates a badwindow error - why ?
-	 * children contains a funny window (000034)
-	 */
-
-	/*
-	 * care for virtual root windows (tvtwm & friends)
-	 */
-	{
-	    Atom vRootAtom = None;
-	    int i;
-	    Window rootReturn, parentReturn;
-	    Window* children = (Window *)0;
-	    unsigned int numChildren;
-
-	    if (XQueryTree(myDpy, rootWin, 
-			   &rootReturn, &parentReturn, 
-			   &children, &numChildren)) {
-		vRootAtom = XInternAtom(myDpy, "__SWM_VROOT", True );
-		if (vRootAtom != None) {
-		    for (i=0; i < numChildren; i++) {
-			Atom actual_type;
-			int actual_format;
-			unsigned long nitems, bytesafter;
-			Window* newRoot = (Window*) 0;
-
-			if (children[i]) {
-			    if (XGetWindowProperty(myDpy, children[i], vRootAtom, 
-						     0L, 1L, False, XA_WINDOW,
-						     &actual_type, &actual_format, 
-						     &nitems, &bytesafter,
-						     (unsigned char**) &newRoot
-						   ) == Success && newRoot) {
-				vRootWin = *newRoot;
-				XFree(newRoot); /* XXX */
-				break;
-			    }
-			}
-		    }
-		}
-		if (children) XFree( children );
-	    }
-	}
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        /*
+         * on IRIS, this creates a badwindow error - why ?
+         * children contains a funny window (000034)
+         */
+
+        /*
+         * care for virtual root windows (tvtwm & friends)
+         */
+        {
+            Atom vRootAtom = None;
+            int i;
+            Window rootReturn, parentReturn;
+            Window* children = (Window *)0;
+            unsigned int numChildren;
+
+            if (XQueryTree(myDpy, rootWin, 
+                           &rootReturn, &parentReturn, 
+                           &children, &numChildren)) {
+                vRootAtom = XInternAtom(myDpy, "__SWM_VROOT", True );
+                if (vRootAtom != None) {
+                    for (i=0; i < numChildren; i++) {
+                        Atom actual_type;
+                        int actual_format;
+                        unsigned long nitems, bytesafter;
+                        Window* newRoot = (Window*) 0;
+
+                        if (children[i]) {
+                            if (XGetWindowProperty(myDpy, children[i], vRootAtom, 
+                                                     0L, 1L, False, XA_WINDOW,
+                                                     &actual_type, &actual_format, 
+                                                     &nitems, &bytesafter,
+                                                     (unsigned char**) &newRoot
+                                                   ) == Success && newRoot) {
+                                vRootWin = *newRoot;
+                                XFree(newRoot); /* XXX */
+                                break;
+                            }
+                        }
+                    }
+                }
+                if (children) XFree( children );
+            }
+        }
+        END_INTERRUPTSBLOCKED
 #endif
     }
 
     /* cannot happen */
     if (! vRootWin) {
-	vRootWin = rootWin;
-	if (! rootWin) {
-	    RETURN ( nil );
-	}
+        vRootWin = rootWin;
+        if (! rootWin) {
+            RETURN ( nil );
+        }
     }
     __INST(rootId) = id = __MKOBJ(rootWin); __STORE(self, id);
     __INST(virtualRootId) = id = __MKOBJ(vRootWin); __STORE(self, id);
@@ -1869,18 +1870,18 @@
     Status ok;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
-	ok = XAllocColorCells(dpy, DefaultColormap(dpy, screen), (Bool)0,
-				   &dummy, 0, &color.pixel, 1);
-	END_INTERRUPTSBLOCKED
-	if (ok) {
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
+        ok = XAllocColorCells(dpy, DefaultColormap(dpy, screen), (Bool)0,
+                                   &dummy, 0, &color.pixel, 1);
+        END_INTERRUPTSBLOCKED
+        if (ok) {
 #ifdef COUNT_RESOURCES
-	    __cnt_color++;
+            __cnt_color++;
 #endif
-	    RETURN ( __MKSMALLINT(color.pixel) );
-	}
+            RETURN ( __MKSMALLINT(color.pixel) );
+        }
     }
 %}.
     ^ nil
@@ -1899,33 +1900,33 @@
     Status ok;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isString(aString) || __isSymbol(aString)) {
-	    colorname = (char *)_stringVal(aString);
-
-	    BEGIN_INTERRUPTSBLOCKED
-	    ok = XParseColor(dpy, DefaultColormap(dpy, screen), colorname, &ecolor);
-	    if (ok) {
+        Display *dpy = myDpy;
+
+        if (__isString(aString) || __isSymbol(aString)) {
+            colorname = (char *)_stringVal(aString);
+
+            BEGIN_INTERRUPTSBLOCKED
+            ok = XParseColor(dpy, DefaultColormap(dpy, screen), colorname, &ecolor);
+            if (ok) {
 #ifdef QUICK_TRUE_COLORS
-		if (__INST(visualType) == @symbol(TrueColor)) {
-		    id = ((ecolor.red >> (16 - __intVal(__INST(bitsRed)))) << __intVal(__INST(redShift))) & __intVal(__INST(redMask));
-		    id += ((ecolor.green >> (16 - __intVal(__INST(bitsGreen)))) << __intVal(__INST(greenShift))) & __intVal(__INST(greenMask));
-		    id += ((ecolor.blue >> (16 - __intVal(__INST(bitsBlue)))) << __intVal(__INST(blueShift))) & __intVal(__INST(blueMask));
-		    RETURN ( __MKSMALLINT(id) );
-		}
+                if (__INST(visualType) == @symbol(TrueColor)) {
+                    id = ((ecolor.red >> (16 - __intVal(__INST(bitsRed)))) << __intVal(__INST(redShift))) & __intVal(__INST(redMask));
+                    id += ((ecolor.green >> (16 - __intVal(__INST(bitsGreen)))) << __intVal(__INST(greenShift))) & __intVal(__INST(greenMask));
+                    id += ((ecolor.blue >> (16 - __intVal(__INST(bitsBlue)))) << __intVal(__INST(blueShift))) & __intVal(__INST(blueMask));
+                    RETURN ( __MKSMALLINT(id) );
+                }
 #endif
-		ok = XAllocColor(dpy, DefaultColormap(dpy, screen), &ecolor);
-	    }
-	    END_INTERRUPTSBLOCKED
-	    if (! ok) {
-		RETURN ( nil );
-	    }
+                ok = XAllocColor(dpy, DefaultColormap(dpy, screen), &ecolor);
+            }
+            END_INTERRUPTSBLOCKED
+            if (! ok) {
+                RETURN ( nil );
+            }
 #ifdef COUNT_RESOURCES
-	    __cnt_color++;
+            __cnt_color++;
 #endif
-	    RETURN ( __MKSMALLINT(ecolor.pixel) );
-	}
+            RETURN ( __MKSMALLINT(ecolor.pixel) );
+        }
     }
 %}.
     self primitiveFailed.
@@ -1956,28 +1957,28 @@
     if (__bothSmallInteger(r, g) 
      && __isSmallInteger(b)
      && ISCONNECTED) {
-	ecolor.red = __intVal(r);
-	ecolor.green= __intVal(g);
-	ecolor.blue = __intVal(b);
+        ecolor.red = __intVal(r);
+        ecolor.green= __intVal(g);
+        ecolor.blue = __intVal(b);
 #ifdef QUICK_TRUE_COLORS
-	if (__INST(visualType) == @symbol(TrueColor)) {
-	    id = ((ecolor.red >> (16 - __intVal(__INST(bitsRed)))) << __intVal(__INST(redShift))) & __intVal(__INST(redMask));
-	    id += ((ecolor.green >> (16 - __intVal(__INST(bitsGreen)))) << __intVal(__INST(greenShift))) & __intVal(__INST(greenMask));
-	    id += ((ecolor.blue >> (16 - __intVal(__INST(bitsBlue)))) << __intVal(__INST(blueShift))) & __intVal(__INST(blueMask));
-	    RETURN ( __MKSMALLINT(id) );
-	}
+        if (__INST(visualType) == @symbol(TrueColor)) {
+            id = ((ecolor.red >> (16 - __intVal(__INST(bitsRed)))) << __intVal(__INST(redShift))) & __intVal(__INST(redMask));
+            id += ((ecolor.green >> (16 - __intVal(__INST(bitsGreen)))) << __intVal(__INST(greenShift))) & __intVal(__INST(greenMask));
+            id += ((ecolor.blue >> (16 - __intVal(__INST(bitsBlue)))) << __intVal(__INST(blueShift))) & __intVal(__INST(blueMask));
+            RETURN ( __MKSMALLINT(id) );
+        }
 #endif
-	dpy = myDpy;
-	BEGIN_INTERRUPTSBLOCKED
-	ok = XAllocColor(dpy, DefaultColormap(dpy, screen), &ecolor);
-	END_INTERRUPTSBLOCKED
-	if (! ok) {
-	    RETURN ( nil );
-	}
+        dpy = myDpy;
+        BEGIN_INTERRUPTSBLOCKED
+        ok = XAllocColor(dpy, DefaultColormap(dpy, screen), &ecolor);
+        END_INTERRUPTSBLOCKED
+        if (! ok) {
+            RETURN ( nil );
+        }
 #ifdef COUNT_RESOURCES
-	__cnt_color++;
+        __cnt_color++;
 #endif
-	RETURN ( __MKSMALLINT(ecolor.pixel) );
+        RETURN ( __MKSMALLINT(ecolor.pixel) );
     }
 %}.
     self primitiveFailed.
@@ -1995,25 +1996,25 @@
 
 #ifdef QUICK_TRUE_COLORS
     if (__INST(visualType) == @symbol(TrueColor)) {
-	/* no need to do anything on TrueColor displays ... */
-	RETURN (self);
+        /* no need to do anything on TrueColor displays ... */
+        RETURN (self);
     }
 #endif
 
     if (! ISCONNECTED) {
-	RETURN (self);
+        RETURN (self);
     }
 
     if (__isSmallInteger(colorIndex)) {
-	dpy = myDpy;
-	color = (long) __intVal(colorIndex);
-	BEGIN_INTERRUPTSBLOCKED
-	XFreeColors(dpy, DefaultColormap(dpy, screen), &color, 1, 0L);
+        dpy = myDpy;
+        color = (long) __intVal(colorIndex);
+        BEGIN_INTERRUPTSBLOCKED
+        XFreeColors(dpy, DefaultColormap(dpy, screen), &color, 1, 0L);
 #ifdef COUNT_RESOURCES
-	__cnt_color--;
+        __cnt_color--;
 #endif
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -2026,10 +2027,10 @@
     |val|
 
     self getScaledRGBFrom:index into:[:r :g :b |
-	val := aBlock 
-		value:(r * 100.0 / 16rFFFF)
-		value:(g * 100.0 / 16rFFFF)
-		value:(b * 100.0 / 16rFFFF)
+        val := aBlock 
+                value:(r * 100.0 / 16rFFFF)
+                value:(g * 100.0 / 16rFFFF)
+                value:(b * 100.0 / 16rFFFF)
     ].
     ^ val
 !
@@ -2040,13 +2041,13 @@
     |val|
 
     self getScaledRGBFromName:colorName into:[:r :g :b |
-	r isNil ifTrue:[
-	    ^ super getRGBFromName:colorName into:aBlock
-	].
-	val := aBlock 
-	    value:(r * 100.0 / 16rFFFF)
-	    value:(g * 100.0 / 16rFFFF)
-	    value:(b * 100.0 / 16rFFFF)
+        r isNil ifTrue:[
+            ^ super getRGBFromName:colorName into:aBlock
+        ].
+        val := aBlock 
+            value:(r * 100.0 / 16rFFFF)
+            value:(g * 100.0 / 16rFFFF)
+            value:(b * 100.0 / 16rFFFF)
     ].
     ^ val
 
@@ -2066,29 +2067,29 @@
 
     if (ISCONNECTED
      && __isSmallInteger(index)) {
-	Display *dpy = myDpy;
-
-	color.pixel = __intVal(index);
-	BEGIN_INTERRUPTSBLOCKED
-	XQueryColor(dpy, DefaultColormap(dpy, screen), &color);
-	END_INTERRUPTSBLOCKED
-
-	/* 
-	 * have to compensate for an error in X ?, which does not scale
-	 * colors correctly if lesser than 16bits are valid in a color,
-	 * (for example, color white on a 4bitsPerRGB server will return
-	 * (16rF000 16rF000 16rF000) instead of (16rFFFF 16rFFFF 16rFFFF)
-	 */
-	bits = __intVal(__INST(bitsPerRGB));
-	scale = (1<<bits) - 1;
-	shift = 16 - bits;
-
-	sr = ((double)(color.red>>shift) / scale) * 0xFFFF;
-	sg = ((double)(color.green>>shift) / scale) * 0xFFFF;
-	sb = ((double)(color.blue>>shift) / scale) * 0xFFFF;
-	r = __MKSMALLINT(sr);
-	g = __MKSMALLINT(sg);
-	b = __MKSMALLINT(sb);
+        Display *dpy = myDpy;
+
+        color.pixel = __intVal(index);
+        BEGIN_INTERRUPTSBLOCKED
+        XQueryColor(dpy, DefaultColormap(dpy, screen), &color);
+        END_INTERRUPTSBLOCKED
+
+        /* 
+         * have to compensate for an error in X ?, which does not scale
+         * colors correctly if lesser than 16bits are valid in a color,
+         * (for example, color white on a 4bitsPerRGB server will return
+         * (16rF000 16rF000 16rF000) instead of (16rFFFF 16rFFFF 16rFFFF)
+         */
+        bits = __intVal(__INST(bitsPerRGB));
+        scale = (1<<bits) - 1;
+        shift = 16 - bits;
+
+        sr = ((double)(color.red>>shift) / scale) * 0xFFFF;
+        sg = ((double)(color.green>>shift) / scale) * 0xFFFF;
+        sb = ((double)(color.blue>>shift) / scale) * 0xFFFF;
+        r = __MKSMALLINT(sr);
+        g = __MKSMALLINT(sg);
+        b = __MKSMALLINT(sb);
     }
 %}.
     ^ aBlock value:r value:g value:b
@@ -2101,8 +2102,8 @@
     |r g b|
 
     displayId isNil ifTrue:[
-	self pimitiveFailed.
-	^ nil
+        self pimitiveFailed.
+        ^ nil
     ].
 %{
     int screen = __intVal(__INST(screen));
@@ -2113,29 +2114,29 @@
 
     if (ISCONNECTED
      && __isString(colorName) || __isSymbol(colorName)) {
-	Display *dpy = myDpy;
+        Display *dpy = myDpy;
         
-	BEGIN_INTERRUPTSBLOCKED
-	if (XParseColor(dpy, DefaultColormap(dpy, screen), 
-			     (char *)_stringVal(colorName), &color)) {
-	    /* 
-	     * have to compensate for an error in X ?, which does not scale
-	     * colors correctly if lesser than 16bits are valid in a color,
-	     * (for example, color white on a 4bitsPerRGB server will return
-	     * (16rF000 16rF000 16rF000) instead of (16rFFFF 16rFFFF 16rFFFF)
-	     */
-	    bits = __intVal(__INST(bitsPerRGB));
-	    scale = (1<<bits) - 1;
-	    shift = 16 - bits;
-
-	    sr = ((double)(color.red>>shift) / scale) * 0xFFFF;
-	    sg = ((double)(color.green>>shift) / scale) * 0xFFFF;
-	    sb = ((double)(color.blue>>shift) / scale) * 0xFFFF;
-	    r = __MKSMALLINT(sr);
-	    g = __MKSMALLINT(sg);
-	    b = __MKSMALLINT(sb);
-	}
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        if (XParseColor(dpy, DefaultColormap(dpy, screen), 
+                             (char *)_stringVal(colorName), &color)) {
+            /* 
+             * have to compensate for an error in X ?, which does not scale
+             * colors correctly if lesser than 16bits are valid in a color,
+             * (for example, color white on a 4bitsPerRGB server will return
+             * (16rF000 16rF000 16rF000) instead of (16rFFFF 16rFFFF 16rFFFF)
+             */
+            bits = __intVal(__INST(bitsPerRGB));
+            scale = (1<<bits) - 1;
+            shift = 16 - bits;
+
+            sr = ((double)(color.red>>shift) / scale) * 0xFFFF;
+            sg = ((double)(color.green>>shift) / scale) * 0xFFFF;
+            sb = ((double)(color.blue>>shift) / scale) * 0xFFFF;
+            r = __MKSMALLINT(sr);
+            g = __MKSMALLINT(sg);
+            b = __MKSMALLINT(sb);
+        }
+        END_INTERRUPTSBLOCKED
     }
 %}.
     ^ aBlock value:r value:g value:b
@@ -2152,22 +2153,22 @@
     aStream isNil ifTrue:[^ nil].
     list := OrderedCollection new.
     [aStream atEnd] whileFalse:[
-	line := aStream nextLine.
-	line notNil ifTrue:[
-	    "skip the r/g/b numbers"
-	    index := 1.
-	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
-	    [(line at:index) isDigit] whileTrue:[index := index + 1].
-	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
-	    [(line at:index) isDigit] whileTrue:[index := index + 1].
-	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
-	    [(line at:index) isDigit] whileTrue:[index := index + 1].
-	    [(line at:index) isSeparator] whileTrue:[index := index + 1].
-	    colorName := line copyFrom:index.
-	    ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
-		list add:colorName
-	    ]
-	]
+        line := aStream nextLine.
+        line notNil ifTrue:[
+            "skip the r/g/b numbers"
+            index := 1.
+            [(line at:index) isSeparator] whileTrue:[index := index + 1].
+            [(line at:index) isDigit] whileTrue:[index := index + 1].
+            [(line at:index) isSeparator] whileTrue:[index := index + 1].
+            [(line at:index) isDigit] whileTrue:[index := index + 1].
+            [(line at:index) isSeparator] whileTrue:[index := index + 1].
+            [(line at:index) isDigit] whileTrue:[index := index + 1].
+            [(line at:index) isSeparator] whileTrue:[index := index + 1].
+            colorName := line copyFrom:index.
+            ((colorName occurrencesOf:(Character space)) == 0) ifTrue:[
+                list add:colorName
+            ]
+        ]
     ].
     aStream close.
     ^ list sort
@@ -2186,10 +2187,10 @@
 %{  /* NOCONTEXT */
 
     if (__isSmallInteger(aPercentage)) {
-	RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
+        RETURN ( __MKSMALLINT(0xFFFF * __intVal(aPercentage) / 100) );
     }
     if (__isFloat(aPercentage)) {
-	RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
+        RETURN ( __MKSMALLINT(0xFFFF * (int)(__floatVal(aPercentage)) / 100) );
     }
 %}.
     ^ (16rFFFF * aPercentage / 100) rounded
@@ -2208,31 +2209,31 @@
     int ok = 1;
 
     if (__isSmallInteger(sred))
-	r = __intVal(sred);
+        r = __intVal(sred);
     else ok = 0;
 
     if (__isSmallInteger(sgreen))
-	g = __intVal(sgreen);
+        g = __intVal(sgreen);
     else ok = 0;
 
     if (__isSmallInteger(sblue))
-	b = __intVal(sblue);
+        b = __intVal(sblue);
     else ok = 0;
 
     if (ISCONNECTED
      && __isSmallInteger(index) && ok) {
-	Display *dpy = myDpy;
-
-	color.pixel = __intVal(index);
-	color.red = r;
-	color.green = g;
-	color.blue = b;
-	color.flags = DoRed | DoGreen | DoBlue;
-
-	BEGIN_INTERRUPTSBLOCKED
-	XStoreColor(dpy, DefaultColormap(dpy, screen), &color);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        Display *dpy = myDpy;
+
+        color.pixel = __intVal(index);
+        color.red = r;
+        color.green = g;
+        color.blue = b;
+        color.flags = DoRed | DoGreen | DoBlue;
+
+        BEGIN_INTERRUPTSBLOCKED
+        XStoreColor(dpy, DefaultColormap(dpy, screen), &color);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -2260,16 +2261,16 @@
      && __bothSmallInteger(bgR, bgG) 
      && __bothSmallInteger(bgB, fgR)) {
 
-	fgcolor.red = __intVal(fgR);
-	fgcolor.green= __intVal(fgG);
-	fgcolor.blue = __intVal(fgB);
-	bgcolor.red = __intVal(bgR);
-	bgcolor.green= __intVal(bgG);
-	bgcolor.blue = __intVal(bgB);
-	BEGIN_INTERRUPTSBLOCKED
-	XRecolorCursor(myDpy, _CursorVal(aCursorId), &fgcolor, &bgcolor);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        fgcolor.red = __intVal(fgR);
+        fgcolor.green= __intVal(fgG);
+        fgcolor.blue = __intVal(fgB);
+        bgcolor.red = __intVal(bgR);
+        bgcolor.green= __intVal(bgG);
+        bgcolor.blue = __intVal(bgB);
+        BEGIN_INTERRUPTSBLOCKED
+        XRecolorCursor(myDpy, _CursorVal(aCursorId), &fgcolor, &bgcolor);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -2283,8 +2284,8 @@
     |number id|
 
     displayId isNil ifTrue:[
-	self primitiveFailed.
-	^ nil
+        self primitiveFailed.
+        ^ nil
     ].
     number := self shapeNumberFromSymbol:aShape.
 %{
@@ -2292,16 +2293,16 @@
 
     if (ISCONNECTED
      && __isSmallInteger(number)) {
-	BEGIN_INTERRUPTSBLOCKED
-	newCursor = XCreateFontCursor(myDpy, __intVal(number));
+        BEGIN_INTERRUPTSBLOCKED
+        newCursor = XCreateFontCursor(myDpy, __intVal(number));
 #ifdef COUNT_RESOURCES
-	if (newCursor)
-	    __cnt_cursor++;
+        if (newCursor)
+            __cnt_cursor++;
 #endif
-	END_INTERRUPTSBLOCKED
-	if (newCursor != (Cursor)0) {
-	    id = __MKOBJ(newCursor);
-	}
+        END_INTERRUPTSBLOCKED
+        if (newCursor != (Cursor)0) {
+            id = __MKOBJ(newCursor);
+        }
     }
 %}.
     ^ id
@@ -2313,8 +2314,8 @@
     |id sourceId maskId|
 
     displayId isNil ifTrue:[
-	self primitiveFailed.
-	^ nil
+        self primitiveFailed.
+        ^ nil
     ].
     sourceId := sourceForm id.
     maskId := maskForm id.
@@ -2326,26 +2327,26 @@
      && __isExternalAddress(sourceId)
      && __isExternalAddress(maskId)
      && __bothSmallInteger(hx, hy)) {
-	fgColor.red = 0;        /* fg is black */
-	fgColor.green = 0;
-	fgColor.blue = 0;
-	bgColor.red = 0xFFFF;   /* bg is white */
-	bgColor.green = 0xFFFF;
-	bgColor.blue = 0xFFFF;
-
-	BEGIN_INTERRUPTSBLOCKED
-	newCursor = XCreatePixmapCursor(myDpy,
-				_PixmapVal(sourceId),
-				_PixmapVal(maskId),
-				&fgColor, &bgColor, __intVal(hx), __intVal(hy));
+        fgColor.red = 0;        /* fg is black */
+        fgColor.green = 0;
+        fgColor.blue = 0;
+        bgColor.red = 0xFFFF;   /* bg is white */
+        bgColor.green = 0xFFFF;
+        bgColor.blue = 0xFFFF;
+
+        BEGIN_INTERRUPTSBLOCKED
+        newCursor = XCreatePixmapCursor(myDpy,
+                                _PixmapVal(sourceId),
+                                _PixmapVal(maskId),
+                                &fgColor, &bgColor, __intVal(hx), __intVal(hy));
 #ifdef COUNT_RESOURCES
-	if (newCursor)
-	    __cnt_cursor++;
+        if (newCursor)
+            __cnt_cursor++;
 #endif
-	END_INTERRUPTSBLOCKED
-	if (newCursor != (Cursor)0) {
-	    id = __MKOBJ(newCursor);
-	}
+        END_INTERRUPTSBLOCKED
+        if (newCursor != (Cursor)0) {
+            id = __MKOBJ(newCursor);
+        }
     }
 %}.
     ^ id
@@ -2357,21 +2358,21 @@
 %{  /* NOCONTEXT */
 
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aCursorId)) {
-	Cursor curs = _CursorVal(aCursorId);
-
-	if (curs) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XFreeCursor(myDpy, curs);
+        Cursor curs = _CursorVal(aCursorId);
+
+        if (curs) {
+            BEGIN_INTERRUPTSBLOCKED
+            XFreeCursor(myDpy, curs);
 #ifdef COUNT_RESOURCES
-	    __cnt_cursor--;
+            __cnt_cursor--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	}
-	RETURN ( self );
+            END_INTERRUPTSBLOCKED
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
@@ -2436,14 +2437,14 @@
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(srcX, srcY)
      && __bothSmallInteger(dstX, dstY)) {
-	gc = _GCVal(dstGCId);
-	source = (Drawable) _WindowVal(sourceId);
-	dest = (Drawable) _WindowVal(destId);
-	XCopyArea(myDpy, source, dest, gc,
-				 __intVal(srcX), __intVal(srcY),
-				__intVal(w), __intVal(h),
-				__intVal(dstX), __intVal(dstY));
-	RETURN ( self );
+        gc = _GCVal(dstGCId);
+        source = (Drawable) _WindowVal(sourceId);
+        dest = (Drawable) _WindowVal(destId);
+        XCopyArea(myDpy, source, dest, gc,
+                                 __intVal(srcX), __intVal(srcY),
+                                __intVal(w), __intVal(h),
+                                __intVal(dstX), __intVal(dstY));
+        RETURN ( self );
     }
 %}.
     "badGC, bad sourceDrawableId or destDrawableID
@@ -2471,17 +2472,17 @@
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(srcX, srcY)
      && __bothSmallInteger(dstX, dstY)) {
-	Display *dpy = myDpy;
+        Display *dpy = myDpy;
 
         gc = _GCVal(dstGCId);
         source = (Drawable) _WindowVal(sourceId);
         dest = (Drawable) _WindowVal(destId);
-	XSetGraphicsExposures(dpy, gc, 0);
+        XSetGraphicsExposures(dpy, gc, 0);
         XCopyArea(dpy, source, dest, gc,
                                 __intVal(srcX), __intVal(srcY),
                                 __intVal(w), __intVal(h),
                                 __intVal(dstX), __intVal(dstY));
-	XSetGraphicsExposures(dpy, gc, 1);
+        XSetGraphicsExposures(dpy, gc, 1);
         RETURN ( self );
     }
 %}.
@@ -2510,14 +2511,14 @@
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(srcX, srcY)
      && __bothSmallInteger(dstX, dstY)) {
-	gc = _GCVal(dstGCId);
-	source = (Drawable) _WindowVal(sourceId);
-	dest = (Drawable) _WindowVal(destId);
-	XCopyPlane(myDpy, source, dest, gc,
-				 __intVal(srcX), __intVal(srcY),
-				 __intVal(w), __intVal(h),
-				 __intVal(dstX), __intVal(dstY), 1);
-	RETURN ( self );
+        gc = _GCVal(dstGCId);
+        source = (Drawable) _WindowVal(sourceId);
+        dest = (Drawable) _WindowVal(destId);
+        XCopyPlane(myDpy, source, dest, gc,
+                                 __intVal(srcX), __intVal(srcY),
+                                 __intVal(w), __intVal(h),
+                                 __intVal(dstX), __intVal(dstY), 1);
+        RETURN ( self );
     }
 %}.
     "badGC, bad sourceDrawableId or destDrawableID
@@ -2546,17 +2547,17 @@
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(srcX, srcY)
      && __bothSmallInteger(dstX, dstY)) {
-	Display *dpy = myDpy;
+        Display *dpy = myDpy;
 
         gc = _GCVal(dstGCId);
         source = (Drawable) _WindowVal(sourceId);
         dest = (Drawable) _WindowVal(destId);
-	XSetGraphicsExposures(dpy, gc, 0);
+        XSetGraphicsExposures(dpy, gc, 0);
         XCopyPlane(dpy, source, dest, gc,
                                  __intVal(srcX), __intVal(srcY),
                                  __intVal(w), __intVal(h),
                                  __intVal(dstX), __intVal(dstY), 1);
-	XSetGraphicsExposures(dpy, gc, 1);
+        XSetGraphicsExposures(dpy, gc, 1);
         RETURN ( self );
     }
 %}.
@@ -2578,34 +2579,34 @@
     double f;
 
     if (__isSmallInteger(startAngle))
-	angle1 = __intVal(startAngle) * 64;
+        angle1 = __intVal(startAngle) * 64;
     else if (__isFloat(startAngle)) {
-	f = __floatVal(startAngle);
-	angle1 = f * 64;
+        f = __floatVal(startAngle);
+        angle1 = f * 64;
     }
     if (__isSmallInteger(angle))
-	angle2 = __intVal(angle) * 64;
+        angle2 = __intVal(angle) * 64;
     else if (__isFloat(angle)) {
-	f = __floatVal(angle);
-	angle2 = f * 64;
+        f = __floatVal(angle);
+        angle2 = f * 64;
     }
     if (ISCONNECTED
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)
      && __bothSmallInteger(width, height)) {
-	win = _WindowVal(aDrawableId);
-	gc = _GCVal(aGCId);
-	w = __intVal(width);
-	h = __intVal(height);
-	/*
-	 * need this check here: some servers simply dump core with bad args
-	 */
-	if ((w >= 0) && (h >= 0) && (angle1 >= 0) && (angle2 >= 0)) {
-	    XDrawArc(myDpy, win, gc, __intVal(x), __intVal(y),
-				   w, h, angle1, angle2);
-	}
-	RETURN ( self );
+        win = _WindowVal(aDrawableId);
+        gc = _GCVal(aGCId);
+        w = __intVal(width);
+        h = __intVal(height);
+        /*
+         * need this check here: some servers simply dump core with bad args
+         */
+        if ((w >= 0) && (h >= 0) && (angle1 >= 0) && (angle2 >= 0)) {
+            XDrawArc(myDpy, win, gc, __intVal(x), __intVal(y),
+                                   w, h, angle1, angle2);
+        }
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -2625,11 +2626,11 @@
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x0, y0)
      && __bothSmallInteger(x1, y1)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	XDrawLine(myDpy, win, gc, __intVal(x0), __intVal(y0),
-				  __intVal(x1), __intVal(y1));
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        XDrawLine(myDpy, win, gc, __intVal(x0), __intVal(y0),
+                                  __intVal(x1), __intVal(y1));
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -2648,10 +2649,10 @@
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	XDrawPoint(myDpy, win, gc, __intVal(x), __intVal(y));
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        XDrawPoint(myDpy, win, gc, __intVal(x), __intVal(y));
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or x/y not integer"
@@ -2679,37 +2680,37 @@
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __isSmallInteger(numberOfPoints)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	num = __intVal(numberOfPoints);
-	/*
-	 * avoid a (slow) malloc, if the number of points is small
-	 */
-	if (num > 100) {
-	    points = (XPoint *)malloc(sizeof(XPoint) * num);
-	    if (! points) goto fail;
-	    mustFree = 1;
-	} else
-	    points = qPoints;
-
-	for (i=0; i<num; i++) {
-	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
-	    if (! __isPoint(point)) goto fail;
-	    x = _point_X(point);
-	    y = _point_Y(point);
-	    if (! __bothSmallInteger(x, y))
-		goto fail;
-	    points[i].x = __intVal(x);
-	    points[i].y = __intVal(y);
-	}
-	XDrawLines(myDpy, win, gc, points, num, CoordModeOrigin);
-	if (mustFree)
-	    free(points);
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        num = __intVal(numberOfPoints);
+        /*
+         * avoid a (slow) malloc, if the number of points is small
+         */
+        if (num > 100) {
+            points = (XPoint *)malloc(sizeof(XPoint) * num);
+            if (! points) goto fail;
+            mustFree = 1;
+        } else
+            points = qPoints;
+
+        for (i=0; i<num; i++) {
+            point = __AT_(aPolygon, __MKSMALLINT(i+1));
+            if (! __isPoint(point)) goto fail;
+            x = _point_X(point);
+            y = _point_Y(point);
+            if (! __bothSmallInteger(x, y))
+                goto fail;
+            points[i].x = __intVal(x);
+            points[i].y = __intVal(y);
+        }
+        XDrawLines(myDpy, win, gc, points, num, CoordModeOrigin);
+        if (mustFree)
+            free(points);
+        RETURN ( self );
     }
 fail: ;
     if (mustFree)
-	free(points);
+        free(points);
 %}.
     "badGC, badDrawable or coordinates not integer"
     self primitiveFailed
@@ -2729,17 +2730,17 @@
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)
      && __bothSmallInteger(width, height)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	w = __intVal(width);
-	h = __intVal(height);
-	/*
-	 * need this check here: some servers simply dump core with bad args
-	 */
-	if ((w >= 0) && (h >= 0)) {
-	    XDrawRectangle(myDpy, win, gc, __intVal(x), __intVal(y), w, h);
-	}
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        w = __intVal(width);
+        h = __intVal(height);
+        /*
+         * need this check here: some servers simply dump core with bad args
+         */
+        if ((w >= 0) && (h >= 0)) {
+            XDrawRectangle(myDpy, win, gc, __intVal(x), __intVal(y), w, h);
+        }
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -2768,100 +2769,100 @@
      && __isNonNilObject(aString)
      && __bothSmallInteger(index1, index2)
      && __bothSmallInteger(x, y)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	cls = __qClass(aString);
-
-	i1 = __intVal(index1) - 1;
-	if (i1 >= 0) {
-	    i2 = __intVal(index2) - 1;
-	    if (i2 < i1) {
-		RETURN (self);
-	    }
-
-	    cp = _stringVal(aString);
-	    l = i2 - i1 + 1;
-
-	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
-		n = _stringSize(aString);
-		if (i2 < n) {
-		    cp += i1;
-		    if (l > 1000) l = 1000;
-		    if (opaque == true)
-			XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
-		    else
-			XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
-		    RETURN ( self );
-		}
-	    }
-
-	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-	    cp += nInstBytes;
-
-	    if (__isBytes(aString)) {
-		n = __byteArraySize(aString) - nInstBytes - 1;
-
-		if (i2 < n) {
-		    cp += i1;
-		    if (l > 1000) l = 1000;
-		    if (opaque == true)
-			XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
-		    else
-			XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
-		    RETURN ( self );
-		}
-	    }
-
-	    /* TWOBYTESTRINGS */
-	    if (__isWords(aString)) {
-		n = (__byteArraySize(aString) - nInstBytes) / 2;
-
-		if (i2 < n) {
-		    union {
-			char b[2];
-			unsigned short s;
-		    } u;
-		    int i;
-		    XChar2b *cp2 = (XChar2b *)0;
-		    int mustFree = 0;
-
-		    cp += (i1 * 2);
-		    if (l > 1000) l = 1000;
-
-		    /*
-		     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
-		     * X expects them MSB first
-		     * convert as required
-		     */
-
-		    u.s = 0x1234;
-		    if (u.b[0] != 0x12) {
-			if (l <= NLOCALBUFFER) {
-			    cp2 = xlatebuffer;
-			} else {
-			    cp2 = (XChar2b *)(malloc(l * 2));
-			    mustFree = 1;
-			}
-			for (i=0; i<l; i++) {
-			    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
-			    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
-			}
-			cp = (char *) cp2;
-		    }
-
-		    if (opaque == true)
-			XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
-		    else
-			XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
-
-		    if (mustFree) {
-			free(cp2);
-		    }
-
-		    RETURN ( self );
-		}
-	    }
-	}
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        cls = __qClass(aString);
+
+        i1 = __intVal(index1) - 1;
+        if (i1 >= 0) {
+            i2 = __intVal(index2) - 1;
+            if (i2 < i1) {
+                RETURN (self);
+            }
+
+            cp = _stringVal(aString);
+            l = i2 - i1 + 1;
+
+            if ((cls == @global(String)) || (cls == @global(Symbol))) {
+                n = _stringSize(aString);
+                if (i2 < n) {
+                    cp += i1;
+                    if (l > 1000) l = 1000;
+                    if (opaque == true)
+                        XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
+                    else
+                        XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
+                    RETURN ( self );
+                }
+            }
+
+            nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+            cp += nInstBytes;
+
+            if (__isBytes(aString)) {
+                n = __byteArraySize(aString) - nInstBytes - 1;
+
+                if (i2 < n) {
+                    cp += i1;
+                    if (l > 1000) l = 1000;
+                    if (opaque == true)
+                        XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
+                    else
+                        XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, l);
+                    RETURN ( self );
+                }
+            }
+
+            /* TWOBYTESTRINGS */
+            if (__isWords(aString)) {
+                n = (__byteArraySize(aString) - nInstBytes) / 2;
+
+                if (i2 < n) {
+                    union {
+                        char b[2];
+                        unsigned short s;
+                    } u;
+                    int i;
+                    XChar2b *cp2 = (XChar2b *)0;
+                    int mustFree = 0;
+
+                    cp += (i1 * 2);
+                    if (l > 1000) l = 1000;
+
+                    /*
+                     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
+                     * X expects them MSB first
+                     * convert as required
+                     */
+
+                    u.s = 0x1234;
+                    if (u.b[0] != 0x12) {
+                        if (l <= NLOCALBUFFER) {
+                            cp2 = xlatebuffer;
+                        } else {
+                            cp2 = (XChar2b *)(malloc(l * 2));
+                            mustFree = 1;
+                        }
+                        for (i=0; i<l; i++) {
+                            cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
+                            cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
+                        }
+                        cp = (char *) cp2;
+                    }
+
+                    if (opaque == true)
+                        XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
+                    else
+                        XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, l);
+
+                    if (mustFree) {
+                        free(cp2);
+                    }
+
+                    RETURN ( self );
+                }
+            }
+        }
     }
 #undef NLOCALBUFFER
 %}.
@@ -2890,83 +2891,83 @@
      && __isExternalAddress(aDrawableId)
      && __isNonNilObject(aString)
      && __bothSmallInteger(x, y)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	cls = __qClass(aString);
-
-	cp = _stringVal(aString);
-
-	if ((cls == @global(String)) || (cls == @global(Symbol))) {
-	    n = _stringSize(aString);
-	    if (n > 1000) n = 1000;
-	    if (opaque == true)
-		XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
-	    else
-		XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
-	    RETURN ( self );
-	}
-
-	nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-	cp += nInstBytes;
-
-	if (__isBytes(aString)) {
-	    n = __byteArraySize(aString) - nInstBytes - 1;
-
-	    if (n > 1000) n = 1000;
-	    if (opaque == true)
-		XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
-	    else
-		XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
-	    RETURN ( self );
-	}
-
-	/* TWOBYTESTRINGS */
-	if (__isWords(aString)) {
-	    union {
-		char b[2];
-		unsigned short s;
-	    } u;
-	    int i;
-	    XChar2b *cp2;
-	    int mustFree = 0;
-
-	    n = (__byteArraySize(aString) - nInstBytes) / 2;
-	    if (n > 1000) n = 1000;
-
-	    /*
-	     * ST/X TwoByteStrings store the asciiValue in native byteOrder;
-	     * X expects them MSB first
-	     * convert as required
-	     */
-
-	    u.s = 0x1234;
-	    if (u.b[0] != 0x12) {
-		if (n <= NLOCALBUFFER) {
-		    cp2 = xlatebuffer;
-		} else {
-		    cp2 = (XChar2b *)(malloc(n * 2));
-		    mustFree = 1;
-		}
-
-		for (i=0; i<n; i++) {
-		    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
-		    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
-		}
-		cp = (char *) cp2;
-	    }
-
-	    if (opaque == true)
-		XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, n);
-	    else
-		XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, n);
-
-
-	    if (mustFree) {
-		free(cp2);
-	    }
-
-	    RETURN ( self );
-	}
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        cls = __qClass(aString);
+
+        cp = _stringVal(aString);
+
+        if ((cls == @global(String)) || (cls == @global(Symbol))) {
+            n = _stringSize(aString);
+            if (n > 1000) n = 1000;
+            if (opaque == true)
+                XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
+            else
+                XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
+            RETURN ( self );
+        }
+
+        nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+        cp += nInstBytes;
+
+        if (__isBytes(aString)) {
+            n = __byteArraySize(aString) - nInstBytes - 1;
+
+            if (n > 1000) n = 1000;
+            if (opaque == true)
+                XDrawImageString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
+            else
+                XDrawString(myDpy, win, gc, __intVal(x), __intVal(y), (char *)cp, n);
+            RETURN ( self );
+        }
+
+        /* TWOBYTESTRINGS */
+        if (__isWords(aString)) {
+            union {
+                char b[2];
+                unsigned short s;
+            } u;
+            int i;
+            XChar2b *cp2;
+            int mustFree = 0;
+
+            n = (__byteArraySize(aString) - nInstBytes) / 2;
+            if (n > 1000) n = 1000;
+
+            /*
+             * ST/X TwoByteStrings store the asciiValue in native byteOrder;
+             * X expects them MSB first
+             * convert as required
+             */
+
+            u.s = 0x1234;
+            if (u.b[0] != 0x12) {
+                if (n <= NLOCALBUFFER) {
+                    cp2 = xlatebuffer;
+                } else {
+                    cp2 = (XChar2b *)(malloc(n * 2));
+                    mustFree = 1;
+                }
+
+                for (i=0; i<n; i++) {
+                    cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
+                    cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
+                }
+                cp = (char *) cp2;
+            }
+
+            if (opaque == true)
+                XDrawImageString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, n);
+            else
+                XDrawString16(myDpy, win, gc, __intVal(x), __intVal(y), (XChar2b *)cp, n);
+
+
+            if (mustFree) {
+                free(cp2);
+            }
+
+            RETURN ( self );
+        }
     }
 #undef NLOCALBUFFER
 %}.
@@ -2975,12 +2976,12 @@
 !
 
 drawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth 
-			  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
 
     "draw a bitImage which has depth id, width iw and height ih into
      the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
@@ -2996,28 +2997,28 @@
      an unlimited stack, and thus cannot send primitiveFailed
     "
     (self primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth 
-					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)
     ifFalse:[
-	"
-	 also happens, if a segmentation violation occurs in the 
-	 XPutImage ...
-	"
-	self primitiveFailed
+        "
+         also happens, if a segmentation violation occurs in the 
+         XPutImage ...
+        "
+        self primitiveFailed
     ].
 !
 
 drawBits:imageBits depth:imageDepth 
-		   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
 
     "draw a bitImage which has depth id, width iw and height ih into
      the drawable. draw a region of w/h pixels from srcx/srcy to dstx/dsty.
@@ -3028,17 +3029,17 @@
      colors are allocated - otherwise the colors may be wrong."
 
     ^ self drawBits:imageBits bitsPerPixel:imageDepth depth:imageDepth 
-				     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
 
 !
 
 fillArcX:x y:y width:width height:height from:startAngle angle:angle
-	       in:aDrawableId with:aGCId
+               in:aDrawableId with:aGCId
     "fill an arc. If any coordinate is not integer, an error is triggered.
      The angles may be floats or integer - they are given in degrees."
 
@@ -3050,34 +3051,34 @@
     double f;
 
     if (__isSmallInteger(startAngle))
-	angle1 = __intVal(startAngle) * 64;
+        angle1 = __intVal(startAngle) * 64;
     else if (__isFloat(startAngle)) {
-	f = __floatVal(startAngle);
-	angle1 = f * 64;
+        f = __floatVal(startAngle);
+        angle1 = f * 64;
     }
     if (__isSmallInteger(angle))
-	angle2 = __intVal(angle) * 64;
+        angle2 = __intVal(angle) * 64;
     else if (__isFloat(angle)) {
-	f = __floatVal(angle);
-	angle2 = f * 64;
+        f = __floatVal(angle);
+        angle2 = f * 64;
     }
     if (ISCONNECTED
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)
      && __bothSmallInteger(width, height)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	w = __intVal(width);
-	h = __intVal(height);
-	/*
-	 * need this check here: some servers simply dump core with bad args
-	 */
-	if ((w >= 0) && (h >= 0) && (angle1 >= 0) && (angle2 >= 0)) {
-	    XFillArc(myDpy, win, gc, __intVal(x), __intVal(y),
-				   w, h, angle1, angle2);
-	}
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        w = __intVal(width);
+        h = __intVal(height);
+        /*
+         * need this check here: some servers simply dump core with bad args
+         */
+        if ((w >= 0) && (h >= 0) && (angle1 >= 0) && (angle2 >= 0)) {
+            XFillArc(myDpy, win, gc, __intVal(x), __intVal(y),
+                                   w, h, angle1, angle2);
+        }
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -3104,39 +3105,39 @@
      && __isExternalAddress(aGCId)
      && __isExternalAddress(aDrawableId)
      && __isSmallInteger(numberOfPoints)) {
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	num = __intVal(numberOfPoints);
-	if (num < 3) {
-	    RETURN ( self );
-	}
-	/*
-	 * avoid (slow) malloc, if not many points
-	 */
-	if (num > 100) {
-	    points = (XPoint *) malloc(sizeof(XPoint) * num);
-	    if (! points) goto fail;
-	    mustFree = 1;
-	} else
-	    points = qPoints;
-	for (i=0; i<num; i++) {
-	    point = __AT_(aPolygon, __MKSMALLINT(i+1));
-	    if (! __isPoint(point)) goto fail;
-	    x = _point_X(point);
-	    y = _point_Y(point);
-	    if (! __bothSmallInteger(x, y))
-		goto fail;
-	    points[i].x = __intVal(x);
-	    points[i].y = __intVal(y);
-	}
-	XFillPolygon(myDpy, win, gc, points, num, Complex, CoordModeOrigin);
-	if (mustFree)
-	    free(points);
-	RETURN ( self );
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        num = __intVal(numberOfPoints);
+        if (num < 3) {
+            RETURN ( self );
+        }
+        /*
+         * avoid (slow) malloc, if not many points
+         */
+        if (num > 100) {
+            points = (XPoint *) malloc(sizeof(XPoint) * num);
+            if (! points) goto fail;
+            mustFree = 1;
+        } else
+            points = qPoints;
+        for (i=0; i<num; i++) {
+            point = __AT_(aPolygon, __MKSMALLINT(i+1));
+            if (! __isPoint(point)) goto fail;
+            x = _point_X(point);
+            y = _point_Y(point);
+            if (! __bothSmallInteger(x, y))
+                goto fail;
+            points[i].x = __intVal(x);
+            points[i].y = __intVal(y);
+        }
+        XFillPolygon(myDpy, win, gc, points, num, Complex, CoordModeOrigin);
+        if (mustFree)
+            free(points);
+        RETURN ( self );
 
 fail: ;
-	if (mustFree)
-	    free(points);
+        if (mustFree)
+            free(points);
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -3155,17 +3156,17 @@
      && __isExternalAddress(aDrawableId)
      && __bothSmallInteger(x, y)
      && __bothSmallInteger(width, height)) {
-	w = __intVal(width);
-	h = __intVal(height);
-	/*
-	 * need this check here: some servers simply dump core with bad args
-	 */
-	if ((w >= 0) && (h >= 0)) {
-	    XFillRectangle(myDpy,
-			   (Drawable)_WindowVal(aDrawableId), _GCVal(aGCId),
-			   __intVal(x), __intVal(y), w, h);
-	}
-	RETURN ( self );
+        w = __intVal(width);
+        h = __intVal(height);
+        /*
+         * need this check here: some servers simply dump core with bad args
+         */
+        if ((w >= 0) && (h >= 0)) {
+            XFillRectangle(myDpy,
+                           (Drawable)_WindowVal(aDrawableId), _GCVal(aGCId),
+                           __intVal(x), __intVal(y), w, h);
+        }
+        RETURN ( self );
     }
 %}.
     "badGC, badDrawable or coordinates not integer"
@@ -3173,12 +3174,12 @@
 !
 
 primDrawBits:imageBits bitsPerPixel:bitsPerPixel depth:imageDepth 
-			      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
 
     "since XPutImage may allocate huge amount of stack space 
      (some implementations use alloca), this must run with unlimited stack."
@@ -3203,61 +3204,61 @@
      && __bothSmallInteger(imageWidth, imageHeight)
      && __bothSmallInteger(imageDepth, bitsPerPixel)
      && __isByteArray(imageBits)) {
-	Display *dpy = myDpy;
-
-	gc = _GCVal(aGCId);
-	win = _WindowVal(aDrawableId);
-	if (! gc || !win) 
-	    goto fail;
+        Display *dpy = myDpy;
+
+        gc = _GCVal(aGCId);
+        win = _WindowVal(aDrawableId);
+        if (! gc || !win) 
+            goto fail;
 #ifdef ARGDEBUG
-	printf("args ok\n");
+        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 = MSBFirst;
-	image.bitmap_unit = 8;
-	image.bitmap_bit_order = MSBFirst;
-	image.bitmap_pad = 8;
-	image.depth = __intVal(imageDepth);
-	image.bits_per_pixel = __intVal(bitsPerPixel);
-	switch (image.bits_per_pixel) {
-	    case 1:
-		image.bytes_per_line = (imgWdth + 7) / 8;
-		break;
-	    case 2:
-		image.bytes_per_line = (imgWdth*2 + 7) / 8;
-		break;
-	    case 4:
-		image.bytes_per_line = (imgWdth*4 + 7) / 8;
-		break;
-	    case 8:
-		image.bytes_per_line = imgWdth;
-		break;
-	    case 16:
-		image.bytes_per_line = imgWdth*2;
-		break;
-	    case 24:
-		image.bytes_per_line = imgWdth*3;
-		break;
-	    case 32:
-		image.bytes_per_line = imgWdth*4;
-		break;
-	    default:
+        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 = MSBFirst;
+        image.bitmap_unit = 8;
+        image.bitmap_bit_order = MSBFirst;
+        image.bitmap_pad = 8;
+        image.depth = __intVal(imageDepth);
+        image.bits_per_pixel = __intVal(bitsPerPixel);
+        switch (image.bits_per_pixel) {
+            case 1:
+                image.bytes_per_line = (imgWdth + 7) / 8;
+                break;
+            case 2:
+                image.bytes_per_line = (imgWdth*2 + 7) / 8;
+                break;
+            case 4:
+                image.bytes_per_line = (imgWdth*4 + 7) / 8;
+                break;
+            case 8:
+                image.bytes_per_line = imgWdth;
+                break;
+            case 16:
+                image.bytes_per_line = imgWdth*2;
+                break;
+            case 24:
+                image.bytes_per_line = imgWdth*3;
+                break;
+            case 32:
+                image.bytes_per_line = imgWdth*4;
+                break;
+            default:
 #ifdef ARGDEBUG
-		printf("bits_per_pixel=%d\n",image.bits_per_pixel);
+                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;
-	XPutImage(dpy, win, gc, &image, __intVal(srcx), __intVal(srcy),
-					__intVal(dstx), __intVal(dsty),
-					__intVal(w), __intVal(h));
-	RETURN ( true );
+                goto fail;
+        }
+        image.red_mask = 0xFFFF;
+        image.green_mask = 0xFFFF;
+        image.blue_mask = 0xFFFF;
+        XPutImage(dpy, win, gc, &image, __intVal(srcx), __intVal(srcy),
+                                        __intVal(dstx), __intVal(dsty),
+                                        __intVal(w), __intVal(h));
+        RETURN ( true );
     }
 #ifdef ARGDEBUG
     if (!! __isExternalAddress(aGCId)) printf("GC\n");
@@ -3302,6 +3303,11 @@
     "/ aView created
 !
 
+gravityNotifyView:aView
+    "ignored for now"
+
+    "/ aView gravityNotify
+!
 
 mapRequestView:aView
     "ignored for now"
@@ -3309,25 +3315,6 @@
     "/ aView mapRequest
 !
 
-
-reparentedView:aView
-    "ignored for now"
-
-    "/ aView reparented
-!
-
-gravityNotifyView:aView
-    "ignored for now"
-
-    "/ aView gravityNotify
-!
-
-resizeRequestView:aView
-    "ignored for now"
-
-    "/ aView resizeRequest
-!
-
 propertyChangeView:aView
     "sent when an X property changes.
      This is a very X-specific mechanism."
@@ -3335,33 +3322,135 @@
     aView propertyChange
 !
 
+reparentedView:aView
+    "ignored for now"
+
+    "/ aView reparented
+!
+
+resizeRequestView:aView
+    "ignored for now"
+
+    "/ aView resizeRequest
+!
+
 selectionClear:selectionID view:aView
     "sent when another X-client has created a selection.
      This is a very X-specific mechanism."
 
-    aView selectionClear:selectionID
+    "
+     workaround a bug in olvwm: it clears selections
+     on window raise. 
+     In this case, keep my last own selection.
+    "
+    self setLastCopyBuffer:(self getCopyBuffer).
+    self setCopyBuffer:nil
+
+    "/ noone is interrested in that ...
+"/    aView selectionClear:selectionID
+
+    "Modified: 12.2.1997 / 19:45:19 / cg"
 !
 
 selectionNotify:propertyID target:targetID selection:selectionID from:requestorID view:aView
     "sent when the server returns an answer from a request for a selection.
      This is a very X-specific mechanism."
 
-    aView
-	selectionNotify:propertyID 
-	target:targetID 
-	selection:selectionID 
-	from:requestorID
-!
-
-selectionRequest:propertyID target:targetID selection:selectionID from:requestorID view:aView
+    |s sensor|
+
+    propertyID == 0 ifTrue:[
+        "invalid olvwm behavior"
+        s := self getLastCopyBuffer
+    ] ifFalse:[
+        targetID == self atomIDOfSTRING ifTrue:[
+            "
+             a returned string
+            "
+            s := self getTextProperty:propertyID from:requestorID.
+            s notNil ifTrue:[
+                (s endsWith:Character cr) ifTrue:[
+                    s := s asStringCollection copyWith:''
+                ]
+            ]
+        ] ifFalse:[
+            "
+             a returned object
+            "
+            s := self getObjectProperty:propertyID from:requestorID.
+        ].
+    ].
+
+    s notNil ifTrue:[
+        (sensor := aView sensor) notNil ifTrue:[
+            sensor pasteFromClipBoard:s view:aView
+        ] ifFalse:[
+            "
+             if there is no sensor ...
+            "
+            aView pasteFromClipBoard:s
+        ]
+    ]
+
+    "Modified: 13.2.1997 / 13:38:42 / cg"
+!
+
+selectionRequest:propertyID target:targetID selection:selectionID from:windowID view:aView
     "sent by some other X-client to ask for the selection.
      This is a very X-specific mechanism."
 
-    aView
-	selectionRequest:propertyID
-	target:targetID
-	selection:selectionID
-	from:requestorID
+    |o s stream|
+
+    targetID == (self atomIDOfLENGTH) ifTrue:[
+        "/
+        "/ the other one wants to know the size of our selection ...
+        "/
+
+        s := self selectionAsString.
+        self
+            setLengthProperty:propertyID 
+            value:s size 
+            for:windowID.
+        self
+            sendSelectionNotifySelection:selectionID
+            property:propertyID
+            target:targetID
+            from:aView id
+            to:windowID.
+        ^ self
+    ].
+
+    (targetID == self atomIDOfSTRING or:[
+     targetID == (self atomIDOf:'COMPOUND_TEXT')]) ifTrue:[
+        "/
+        "/ the other view wants the selection as string
+        "/
+
+        s := self selectionAsString.
+        self
+            sendSelection:s 
+            property:propertyID 
+            target:targetID 
+            from:aView id 
+            to:windowID.
+        ^ self
+    ].
+
+    "/
+    "/ send the seletion in binaryStore format
+    "/ (assuming, that the other view knows how to handle it)
+    "/
+    o := self getCopyBuffer.
+    stream := WriteStream on:(ByteArray new:200).
+    o storeBinaryOn:stream.
+
+    self
+        sendSelection:(stream contents) 
+        property:propertyID 
+        target:(self atomIDOf:'ST_OBJECT' create:true) 
+        from:aView id 
+        to:windowID
+
+    "Modified: 13.2.1997 / 13:12:47 / cg"
 ! !
 
 !XWorkstation methodsFor:'event handling'!
@@ -3375,9 +3464,9 @@
      handled."
 
     (self getEventFor:aViewIdOrNil withMask:eventMask) ifTrue:[
-	AbortSignal catch:[
-	    self dispatchLastEvent.
-	]
+        AbortSignal catch:[
+            self dispatchLastEvent.
+        ]
     ].
 !
 
@@ -3462,7 +3551,7 @@
     static struct inlineCache skrS = _ILC4;
 
     if (! ISCONNECTED) {
-	RETURN (false);
+        RETURN (false);
     }
 
     dpy = myDpy;
@@ -3470,17 +3559,17 @@
     eB = __INST(eventBuffer);
 
     if (__isByteArray(eB)) {
-	ev = (XEvent *)(__ByteArrayInstPtr(eB)->ba_element);
+        ev = (XEvent *)(__ByteArrayInstPtr(eB)->ba_element);
     } else {
-	printf("DISPLAY: no eventBuffer\n");
-	RETURN (false);
+        printf("DISPLAY: no eventBuffer\n");
+        RETURN (false);
     }
 
     windowID = __MKOBJ(ae->window);
     theView = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, windowID);
 
     if ((theView == nil) && (ev->type != MappingNotify)) {
-	RETURN (nil);
+        RETURN (nil);
     }
 
     /*
@@ -3500,453 +3589,453 @@
     eventType = __MKSMALLINT(ev->type);
 #endif
     switch (ev->type) {
-	case KeyRelease:
-	    symS = @symbol(keyRelease:x:y:view:);
-	    ipS = &skrS;
-	    upDown = false;
-	    goto keyPressAndRelease;
-
-	case KeyPress:
-	    symS = @symbol(keyPress:x:y:view:);
-	    ipS = &skpS;
-	    upDown = true;
-	    /* FALL INTO */
-
-	keyPressAndRelease:
-	    __INST(eventRootX) = __MKSMALLINT(ke->x_root);
-	    __INST(eventRootY) = __MKSMALLINT(ke->y_root);
+        case KeyRelease:
+            symS = @symbol(keyRelease:x:y:view:);
+            ipS = &skrS;
+            upDown = false;
+            goto keyPressAndRelease;
+
+        case KeyPress:
+            symS = @symbol(keyPress:x:y:view:);
+            ipS = &skpS;
+            upDown = true;
+            /* FALL INTO */
+
+        keyPressAndRelease:
+            __INST(eventRootX) = __MKSMALLINT(ke->x_root);
+            __INST(eventRootY) = __MKSMALLINT(ke->y_root);
 #ifdef OLD
-	    __INST(altDown) = (ke->state & Mod2Mask) ? true : false;
-	    __INST(metaDown) = (ke->state & Mod1Mask) ? true : false;
+            __INST(altDown) = (ke->state & Mod2Mask) ? true : false;
+            __INST(metaDown) = (ke->state & Mod1Mask) ? true : false;
 #else
-	    __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
-	    __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
+            __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
+            __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
 #endif
-	    __INST(shiftDown) = (ke->state & ShiftMask) ? true : false;
-	    __INST(ctrlDown) = (ke->state & ControlMask) ? true : false;
-
-	    arg = nil;
-	    nchars = XLookupString(ke, (char *)buffer, sizeof(buffer), &keySym, NULL);
-	    if (nchars 
-	     && (((buffer[0] >= ' ') && (buffer[0] <= '~'))
-		 || (buffer[0] >= 0x80))) {
-		arg = _MKCHARACTER(buffer[0])/* *_CharacterTable[buffer[0]] */;
-		keySymString = NULL;
-	    } else {
+            __INST(shiftDown) = (ke->state & ShiftMask) ? true : false;
+            __INST(ctrlDown) = (ke->state & ControlMask) ? true : false;
+
+            arg = nil;
+            nchars = XLookupString(ke, (char *)buffer, sizeof(buffer), &keySym, NULL);
+            if (nchars 
+             && (((buffer[0] >= ' ') && (buffer[0] <= '~'))
+                 || (buffer[0] >= 0x80))) {
+                arg = _MKCHARACTER(buffer[0])/* *_CharacterTable[buffer[0]] */;
+                keySymString = NULL;
+            } else {
 #ifdef OLD
-		switch (keySym) {
-		    case XK_Control_L:
-		    case XK_Control_R:
-			__INST(ctrlDown) = upDown;
-			break;
-		    case XK_Shift_L:
-		    case XK_Shift_R:
-			__INST(shiftDown) = upDown;
-			break;
-		    case XK_Meta_L:
-		    case XK_Meta_R:
-			__INST(metaDown) = upDown;
-			break;
-		    case XK_Alt_L:
-		    case XK_Alt_R:
-			__INST(altDown) = upDown;
-			break;
-		}
+                switch (keySym) {
+                    case XK_Control_L:
+                    case XK_Control_R:
+                        __INST(ctrlDown) = upDown;
+                        break;
+                    case XK_Shift_L:
+                    case XK_Shift_R:
+                        __INST(shiftDown) = upDown;
+                        break;
+                    case XK_Meta_L:
+                    case XK_Meta_R:
+                        __INST(metaDown) = upDown;
+                        break;
+                    case XK_Alt_L:
+                    case XK_Alt_R:
+                        __INST(altDown) = upDown;
+                        break;
+                }
 #endif
 
-		keySymString = XKeysymToString(keySym);
-		if (keySymString) {
+                keySymString = XKeysymToString(keySym);
+                if (keySymString) {
 #ifdef OLD
-		    if (keySymString[0] == 'D') {
-			/*
-			 * remove underscore, dont want it in symbols
-			 */
-			if (strcmp(keySymString, "Delete_line") == 0) {
-			    keySymString = "DeleteLine";
-			} else if (strcmp(keySymString, "Delete_word") == 0) {
-			    keySymString = "DeleteWord";
-			}
-		    }
-		    /*
-		     * make names compatible
-		     */
-		    if (strcmp(keySymString, "Down") == 0) {
-			keySymString = "CursorDown";
-		    } else if (strcmp(keySymString, "Up") == 0) {
-			keySymString = "CursorUp";
-		    } else if (strcmp(keySymString, "Left") == 0) {
-			keySymString = "CursorLeft";
-		    } else if (strcmp(keySymString, "Right") == 0) {
-			keySymString = "CursorRight";
-		    }
-		    arg = __MKSYMBOL(keySymString, (OBJ *)0, __context);
+                    if (keySymString[0] == 'D') {
+                        /*
+                         * remove underscore, dont want it in symbols
+                         */
+                        if (strcmp(keySymString, "Delete_line") == 0) {
+                            keySymString = "DeleteLine";
+                        } else if (strcmp(keySymString, "Delete_word") == 0) {
+                            keySymString = "DeleteWord";
+                        }
+                    }
+                    /*
+                     * make names compatible
+                     */
+                    if (strcmp(keySymString, "Down") == 0) {
+                        keySymString = "CursorDown";
+                    } else if (strcmp(keySymString, "Up") == 0) {
+                        keySymString = "CursorUp";
+                    } else if (strcmp(keySymString, "Left") == 0) {
+                        keySymString = "CursorLeft";
+                    } else if (strcmp(keySymString, "Right") == 0) {
+                        keySymString = "CursorRight";
+                    }
+                    arg = __MKSYMBOL(keySymString, (OBJ *)0, __context);
 #else
-		    __PROTECT__(theView);
-		    arg = __MKSTRING(keySymString);
-		    __UNPROTECT__(theView);
+                    __PROTECT__(theView);
+                    arg = __MKSTRING(keySymString);
+                    __UNPROTECT__(theView);
 #endif
-		}
-	    }
-
-	    if (arg == nil) {
-		/* happens sometimes (alt-graph on sun has no keysym) */
-		break;
-	    }
-
-	    (*(*ipS).ilc_func)(self, symS, nil, ipS,
-			       arg, 
-			       __MKSMALLINT(ke->x), 
-			       __MKSMALLINT(ke->y),
-			       theView);
-	    break;
-
-	case ButtonPress:
-	    __INST(buttonsPressed) = __MKSMALLINT(__intVal(__INST(buttonsPressed)) | (1 << be->button));
-	    __INST(eventRootX) = __MKSMALLINT(be->x_root);
-	    __INST(eventRootY) = __MKSMALLINT(be->y_root);
-
-	    if (__isSmallInteger(__INST(multiClickTimeDelta)))
-		nextMultiClickTime = be->time + __intVal(__INST(multiClickTimeDelta));
-	    else
-		nextMultiClickTime = 0;
-
-	    if ((t = __INST(multiClickTime)) != nil) {
-		int _multiClickTime;
-
-		_multiClickTime = __longIntVal(t);
-		if (be->time < _multiClickTime) {
-		    __INST(multiClickTime) = t = __MKUINT(nextMultiClickTime); __STORE(self, t);
-
-		    ipS = &bmpS;
-		    symS = @symbol(buttonMultiPress:x:y:view:);
-		    goto sendButtonEvent;
-		    break;
-		}
-	    }
-	    __INST(multiClickTime) = t = __MKUINT(nextMultiClickTime); __STORE(self, t);
+                }
+            }
+
+            if (arg == nil) {
+                /* happens sometimes (alt-graph on sun has no keysym) */
+                break;
+            }
+
+            (*(*ipS).ilc_func)(self, symS, nil, ipS,
+                               arg, 
+                               __MKSMALLINT(ke->x), 
+                               __MKSMALLINT(ke->y),
+                               theView);
+            break;
+
+        case ButtonPress:
+            __INST(buttonsPressed) = __MKSMALLINT(__intVal(__INST(buttonsPressed)) | (1 << be->button));
+            __INST(eventRootX) = __MKSMALLINT(be->x_root);
+            __INST(eventRootY) = __MKSMALLINT(be->y_root);
+
+            if (__isSmallInteger(__INST(multiClickTimeDelta)))
+                nextMultiClickTime = be->time + __intVal(__INST(multiClickTimeDelta));
+            else
+                nextMultiClickTime = 0;
+
+            if ((t = __INST(multiClickTime)) != nil) {
+                int _multiClickTime;
+
+                _multiClickTime = __longIntVal(t);
+                if (be->time < _multiClickTime) {
+                    __INST(multiClickTime) = t = __MKUINT(nextMultiClickTime); __STORE(self, t);
+
+                    ipS = &bmpS;
+                    symS = @symbol(buttonMultiPress:x:y:view:);
+                    goto sendButtonEvent;
+                    break;
+                }
+            }
+            __INST(multiClickTime) = t = __MKUINT(nextMultiClickTime); __STORE(self, t);
 
 #ifdef NO_LONGER
-	    if (be->state & ShiftMask) {
-		ipS = &bspS;
-		symS = @symbol(buttonShiftPress:x:y:view:);
-		goto sendButtonEvent;
-	    }
+            if (be->state & ShiftMask) {
+                ipS = &bspS;
+                symS = @symbol(buttonShiftPress:x:y:view:);
+                goto sendButtonEvent;
+            }
 #endif
-	    ipS = &bpS;
-	    symS = @symbol(buttonPress:x:y:view:);
-	    goto sendButtonEvent;
-
-	    /* NOT REACHED */
-
-	case ButtonRelease:
-	    __INST(buttonsPressed) = __MKSMALLINT(__intVal(__INST(buttonsPressed)) & ~(1 << be->button));
-	    __INST(eventRootX) = __MKSMALLINT(be->x_root);
-	    __INST(eventRootY) = __MKSMALLINT(be->y_root);
-	    ipS = &brS;
-	    symS = @symbol(buttonRelease:x:y:view:);
-	    /* fall into */
-
-	sendButtonEvent:
-	    butt = __MKSMALLINT(be->button);
+            ipS = &bpS;
+            symS = @symbol(buttonPress:x:y:view:);
+            goto sendButtonEvent;
+
+            /* NOT REACHED */
+
+        case ButtonRelease:
+            __INST(buttonsPressed) = __MKSMALLINT(__intVal(__INST(buttonsPressed)) & ~(1 << be->button));
+            __INST(eventRootX) = __MKSMALLINT(be->x_root);
+            __INST(eventRootY) = __MKSMALLINT(be->y_root);
+            ipS = &brS;
+            symS = @symbol(buttonRelease:x:y:view:);
+            /* fall into */
+
+        sendButtonEvent:
+            butt = __MKSMALLINT(be->button);
 #ifdef NOTDEF
-	    /*
-	     * this allows operation with single button mouses: meta-click is always Button 2
-	     */
-	    if (__INST(metaDown) == true)
-		butt = __MKSMALLINT(2);
-	    else 
+            /*
+             * this allows operation with single button mouses: meta-click is always Button 2
+             */
+            if (__INST(metaDown) == true)
+                butt = __MKSMALLINT(2);
+            else 
 #endif
-		butt = __AT_(__INST(buttonTranslation), butt);
-
-
-	    (*(*ipS).ilc_func)(self, 
-			       symS, nil, ipS,
-			       butt, 
-			       __MKSMALLINT(ke->x), 
-			       __MKSMALLINT(ke->y),
-			       theView);
-	    break;
-
-	case MotionNotify:
-	    if (__INST(motionEventCompression) != false) {
-		while (XCheckWindowEvent(dpy, me->window, ANYBUTTON, ev)) ;;
-	    }
-
-	    __INST(eventRootX) = __MKSMALLINT(me->x_root);
-	    __INST(eventRootY) = __MKSMALLINT(me->y_root);
+                butt = __AT_(__INST(buttonTranslation), butt);
+
+
+            (*(*ipS).ilc_func)(self, 
+                               symS, nil, ipS,
+                               butt, 
+                               __MKSMALLINT(ke->x), 
+                               __MKSMALLINT(ke->y),
+                               theView);
+            break;
+
+        case MotionNotify:
+            if (__INST(motionEventCompression) != false) {
+                while (XCheckWindowEvent(dpy, me->window, ANYBUTTON, ev)) ;;
+            }
+
+            __INST(eventRootX) = __MKSMALLINT(me->x_root);
+            __INST(eventRootY) = __MKSMALLINT(me->y_root);
 
 #ifdef OLD
-	    __INST(altDown) = (me->state & Mod2Mask) ? true : false;
-	    __INST(metaDown) = (me->state & Mod1Mask) ? true : false;
+            __INST(altDown) = (me->state & Mod2Mask) ? true : false;
+            __INST(metaDown) = (me->state & Mod1Mask) ? true : false;
 #else
-	    __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
-	    __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
+            __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
+            __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
 #endif
-	    __INST(shiftDown) = (me->state & ShiftMask) ? true : false;
-	    __INST(ctrlDown) = (me->state & ControlMask) ? true : false;
-
-	    (*motS.ilc_func)(self, 
-			     @symbol(buttonMotion:x:y:view:), nil, &motS,
-			     __MKSMALLINT(me->state),
-			     __MKSMALLINT(me->x),
-			     __MKSMALLINT(me->y),
-			     theView);
-	    break;
-
-	case FocusIn:
-	    (*focInS.ilc_func)(self, 
-			       @symbol(focusInView:), nil, &focInS, 
-			       theView);
-	    break;
-
-	case FocusOut:
-	    (*focOutS.ilc_func)(self, 
-				@symbol(focusOutView:), nil, &focOutS, 
-				theView);
-	    break;
-
-	case EnterNotify:
+            __INST(shiftDown) = (me->state & ShiftMask) ? true : false;
+            __INST(ctrlDown) = (me->state & ControlMask) ? true : false;
+
+            (*motS.ilc_func)(self, 
+                             @symbol(buttonMotion:x:y:view:), nil, &motS,
+                             __MKSMALLINT(me->state),
+                             __MKSMALLINT(me->x),
+                             __MKSMALLINT(me->y),
+                             theView);
+            break;
+
+        case FocusIn:
+            (*focInS.ilc_func)(self, 
+                               @symbol(focusInView:), nil, &focInS, 
+                               theView);
+            break;
+
+        case FocusOut:
+            (*focOutS.ilc_func)(self, 
+                                @symbol(focusOutView:), nil, &focOutS, 
+                                theView);
+            break;
+
+        case EnterNotify:
 #ifdef OLD
-	    __INST(altDown) = (ewe->state & Mod2Mask) ? true : false;
-	    __INST(metaDown) = (ewe->state & Mod1Mask) ? true : false;
+            __INST(altDown) = (ewe->state & Mod2Mask) ? true : false;
+            __INST(metaDown) = (ewe->state & Mod1Mask) ? true : false;
 #else
-	    __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
-	    __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
+            __INST(altDown) = (ke->state & __intVal(__INST(altModifierMask))) ? true : false;
+            __INST(metaDown) = (ke->state & __intVal(__INST(metaModifierMask))) ? true : false;
 #endif
-	    __INST(shiftDown) = (ewe->state & ShiftMask) ? true : false;
-	    __INST(ctrlDown) = (ewe->state & ControlMask) ? true : false;
-
-	    (*peS.ilc_func)(self, 
-			    @symbol(pointerEnter:x:y:view:), nil, &peS,
-			    __MKSMALLINT(ewe->state),
-			    __MKSMALLINT(ewe->x), 
-			    __MKSMALLINT(ewe->y),
-			    theView);
-	    break;
-
-	case LeaveNotify:
-	    (*plS.ilc_func)(self, 
-			    @symbol(pointerLeave:view:), nil, &plS,
-			    __MKSMALLINT(lwe->state), 
-			    theView);
-	    break;
-
-	case GraphicsExpose:
-	    (*gexpS.ilc_func)(self, 
-			      @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
-			      __MKSMALLINT(ee->x),
-			      __MKSMALLINT(ee->y),
-			      __MKSMALLINT(ee->width),
-			      __MKSMALLINT(ee->height),
-			      ee->count == 0 ? true : false,
-			      theView);
-
-	    if (ee->count != 0) {
-		break;
-	    }
-	    /* fall into */
-
-	case NoExpose:
-	    (*nexpS.ilc_func)(self, 
-			      @symbol(noExposeView:), nil, &nexpS, 
-			      theView);
-	    break;
-
-	case Expose:
-	    (*expS.ilc_func)(self, 
-			     @symbol(exposeX:y:width:height:view:), nil, &expS,
-			     __MKSMALLINT(ee->x),
-			     __MKSMALLINT(ee->y),
-			     __MKSMALLINT(ee->width),
-			     __MKSMALLINT(ee->height),
-			     theView);
-	    break;
-
-	case ConfigureNotify:
-	    if (ce->above != None) {
-		siblingID = __MKOBJ(ce->above);
-		sibling = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, siblingID);
-	    }
-
-	    (*confS.ilc_func)(self, 
-			     @symbol(configureX:y:width:height:view:), nil, &confS,
-			     __MKSMALLINT(ce->x),
-			     __MKSMALLINT(ce->y),
-			     __MKSMALLINT(ce->width),
-			     __MKSMALLINT(ce->height),
-			     theView);
-	    if (sibling != nil) {
-		(*coveredS.ilc_func)(self,
-				    @symbol(coveredBy:view:), nil, &coveredS,
-				    theView,
-				    sibling);
-	    }
-	    break;
-
-	case ClientMessage:
-	    if (ev->xclient.message_type == (int) _AtomVal(__INST(protocolsAtom))) {
-		if ((ev->xclient.data.l[0] == (int) _AtomVal(__INST(quitAppAtom)))
-		 || (ev->xclient.data.l[0] == (int) _AtomVal(__INST(deleteWindowAtom)))) {
-		    (*termS.ilc_func)(self, 
-				      @symbol(terminateView:), nil, &termS, theView);
-		    break;
-		}
-		if (ev->xclient.data.l[0] == (int) _AtomVal(__INST(saveYourselfAtom))) {
-		    (*savtermS.ilc_func)(self, 
-					 @symbol(saveAndTerminateView:)
-					 , nil, &savtermS, theView);
-		    break;
-		}
-	    }
-	    break;
-
-	case DestroyNotify:
-	    (*destrS.ilc_func)(self, @symbol(destroyedView:)
-			       , nil, &destrS, theView);
-	    break;
-
-	case UnmapNotify:
-	    (*unmapS.ilc_func)(self, @symbol(unmappedView:) 
-			       , nil, &unmapS, theView);
-	    break;
-
-	case MapNotify:
-	    (*mapS.ilc_func)(self, 
-			     @symbol(mappedView:) 
-			     , nil, &mapS, theView);
-	    break;
-
-	case KeymapNotify:
-	    (*keymap.ilc_func)(theView, 
-			       @symbol(keyMapChange) 
-			       , nil, &keymap);
-	    break;
-
-	case VisibilityNotify:
-	    switch (ve->state) {
-		case VisibilityUnobscured:
-		    arg = @symbol(unobscured);
-		    break;
-		case VisibilityPartiallyObscured:
-		    arg = @symbol(partiallyObscured);
-		    break;
-		case VisibilityFullyObscured:
-		    arg = @symbol(fullyObscured);
-		    break;
-	    }
-	    (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
-	    break;
-
-	case CreateNotify:
-	    (*created.ilc_func)(self, @symbol(createdView:), nil, &created, theView);
-	    break;
-
-	case MapRequest:
-	    (*mapReq.ilc_func)(self, @symbol(mapRequestView:), nil, &mapReq, theView);
-	    break;
-
-	case ReparentNotify:
-	    (*repar.ilc_func)(self, @symbol(reparentedView:), nil, &repar, theView);
-	    break;
-
-	case ConfigureRequest:
-	    (*confReq.ilc_func)(self, @symbol(configureRequestView:), nil, &confReq, theView);
-	    break;
-
-	case GravityNotify:
-	    (*gravNotify.ilc_func)(self, @symbol(gravityNotifyView:), nil, &resReq, theView);
-	    break;
-
-	case ResizeRequest:
-	    (*resReq.ilc_func)(self, @symbol(resizeRequestView:), nil, &resReq, theView);
-	    break;
-
-	case CirculateNotify:
-	case CirculateRequest:
-	    break;
-
-	case PropertyNotify:
-	    (*prop.ilc_func)(self, 
-			     @symbol(propertyChangeView) 
-			     , nil, &prop,
-			     theView);
-	    break;
-
-	case SelectionClear:
-	    selectionID = __MKATOMOBJ(ev->xselectionclear.selection);
-	    (*selClear.ilc_func)(self, 
-				 @symbol(selectionClear:view:) 
-				 , nil, &selClear,
-				 selectionID,
-				 theView);
-	    break;
-
-	case SelectionNotify:
-	    /*
-	     * returned selection value (answer from SelectionRequest)
-	     */
-	    DPRINTF(("SelectionNotify prop=%x target=%x selection= %x requestor=%x\n", 
-			ev->xselection.property, ev->xselection.target,
-			ev->xselection.selection, ev->xselection.requestor));
-
-	    propertyID = __MKATOMOBJ(ev->xselection.property);
-	    targetID = __MKATOMOBJ(ev->xselection.target);
-	    selectionID = __MKATOMOBJ(ev->xselection.selection);
-	    requestorID = __MKOBJ(ev->xselection.requestor);
-	    (*selNotify.ilc_func)(self, 
-				  @symbol(selectionNotify:target:selection:from:view:) 
-				  , nil, &selNotify,
-				  propertyID, targetID, selectionID, requestorID,
-				  theView);
-	    break;
-
-	case SelectionRequest:
-	    /*
-	     * someone wants the selection
-	     */
-	    DPRINTF(("SelectionRequest prop=%x target=%x selection=%x requestor=%x\n", 
-			ev->xselectionrequest.property,
-			ev->xselectionrequest.target,
-			ev->xselectionrequest.selection,
-			ev->xselectionrequest.requestor));
-
-	    propertyID = __MKATOMOBJ(ev->xselectionrequest.property);
-	    targetID = __MKATOMOBJ(ev->xselectionrequest.target);
-	    selectionID = __MKATOMOBJ(ev->xselectionrequest.selection);
-	    requestorID = __MKOBJ(ev->xselectionrequest.requestor);
-	    (*selReq.ilc_func)(self, 
-			       @symbol(selectionRequest:target:selection:from:view:) 
-			       , nil, &selReq,
-			       propertyID, targetID, selectionID, requestorID,
-			       theView);
-	    break;
-
-	case ColormapNotify:
-	    (*colormap.ilc_func)(self, 
-				 @symbol(colorMapChangeView:) 
-				 , nil, &colormap,
-				 theView);
-	    break;
-
-	case MappingNotify:
-	    switch(mape->request) {
-		case MappingModifier:
-		    arg = @symbol(mappingModifier);
-		    break;
-		case MappingKeyboard:
-		    arg = @symbol(mappingKeyboard);
-		    break;
-		case MappingPointer:
-		    arg = @symbol(mappingPointer);
-		    break;
-		default:
-		    arg = nil;
-		    break;
-	    }
-	    (*mapping.ilc_func)(self, 
-				@symbol(mappingChanged:event:) 
-				, nil, &mapping, arg, eB);
-	    break;
+            __INST(shiftDown) = (ewe->state & ShiftMask) ? true : false;
+            __INST(ctrlDown) = (ewe->state & ControlMask) ? true : false;
+
+            (*peS.ilc_func)(self, 
+                            @symbol(pointerEnter:x:y:view:), nil, &peS,
+                            __MKSMALLINT(ewe->state),
+                            __MKSMALLINT(ewe->x), 
+                            __MKSMALLINT(ewe->y),
+                            theView);
+            break;
+
+        case LeaveNotify:
+            (*plS.ilc_func)(self, 
+                            @symbol(pointerLeave:view:), nil, &plS,
+                            __MKSMALLINT(lwe->state), 
+                            theView);
+            break;
+
+        case GraphicsExpose:
+            (*gexpS.ilc_func)(self, 
+                              @symbol(graphicsExposeX:y:width:height:final:view:), nil, &gexpS,
+                              __MKSMALLINT(ee->x),
+                              __MKSMALLINT(ee->y),
+                              __MKSMALLINT(ee->width),
+                              __MKSMALLINT(ee->height),
+                              ee->count == 0 ? true : false,
+                              theView);
+
+            if (ee->count != 0) {
+                break;
+            }
+            /* fall into */
+
+        case NoExpose:
+            (*nexpS.ilc_func)(self, 
+                              @symbol(noExposeView:), nil, &nexpS, 
+                              theView);
+            break;
+
+        case Expose:
+            (*expS.ilc_func)(self, 
+                             @symbol(exposeX:y:width:height:view:), nil, &expS,
+                             __MKSMALLINT(ee->x),
+                             __MKSMALLINT(ee->y),
+                             __MKSMALLINT(ee->width),
+                             __MKSMALLINT(ee->height),
+                             theView);
+            break;
+
+        case ConfigureNotify:
+            if (ce->above != None) {
+                siblingID = __MKOBJ(ce->above);
+                sibling = (*vid.ilc_func)(self, @symbol(viewFromId:), nil, &vid, siblingID);
+            }
+
+            (*confS.ilc_func)(self, 
+                             @symbol(configureX:y:width:height:view:), nil, &confS,
+                             __MKSMALLINT(ce->x),
+                             __MKSMALLINT(ce->y),
+                             __MKSMALLINT(ce->width),
+                             __MKSMALLINT(ce->height),
+                             theView);
+            if (sibling != nil) {
+                (*coveredS.ilc_func)(self,
+                                    @symbol(coveredBy:view:), nil, &coveredS,
+                                    theView,
+                                    sibling);
+            }
+            break;
+
+        case ClientMessage:
+            if (ev->xclient.message_type == (int) _AtomVal(__INST(protocolsAtom))) {
+                if ((ev->xclient.data.l[0] == (int) _AtomVal(__INST(quitAppAtom)))
+                 || (ev->xclient.data.l[0] == (int) _AtomVal(__INST(deleteWindowAtom)))) {
+                    (*termS.ilc_func)(self, 
+                                      @symbol(terminateView:), nil, &termS, theView);
+                    break;
+                }
+                if (ev->xclient.data.l[0] == (int) _AtomVal(__INST(saveYourselfAtom))) {
+                    (*savtermS.ilc_func)(self, 
+                                         @symbol(saveAndTerminateView:)
+                                         , nil, &savtermS, theView);
+                    break;
+                }
+            }
+            break;
+
+        case DestroyNotify:
+            (*destrS.ilc_func)(self, @symbol(destroyedView:)
+                               , nil, &destrS, theView);
+            break;
+
+        case UnmapNotify:
+            (*unmapS.ilc_func)(self, @symbol(unmappedView:) 
+                               , nil, &unmapS, theView);
+            break;
+
+        case MapNotify:
+            (*mapS.ilc_func)(self, 
+                             @symbol(mappedView:) 
+                             , nil, &mapS, theView);
+            break;
+
+        case KeymapNotify:
+            (*keymap.ilc_func)(theView, 
+                               @symbol(keyMapChange) 
+                               , nil, &keymap);
+            break;
+
+        case VisibilityNotify:
+            switch (ve->state) {
+                case VisibilityUnobscured:
+                    arg = @symbol(unobscured);
+                    break;
+                case VisibilityPartiallyObscured:
+                    arg = @symbol(partiallyObscured);
+                    break;
+                case VisibilityFullyObscured:
+                    arg = @symbol(fullyObscured);
+                    break;
+            }
+            (*vis.ilc_func)(theView, @symbol(visibilityChange:), nil, &vis, arg);
+            break;
+
+        case CreateNotify:
+            (*created.ilc_func)(self, @symbol(createdView:), nil, &created, theView);
+            break;
+
+        case MapRequest:
+            (*mapReq.ilc_func)(self, @symbol(mapRequestView:), nil, &mapReq, theView);
+            break;
+
+        case ReparentNotify:
+            (*repar.ilc_func)(self, @symbol(reparentedView:), nil, &repar, theView);
+            break;
+
+        case ConfigureRequest:
+            (*confReq.ilc_func)(self, @symbol(configureRequestView:), nil, &confReq, theView);
+            break;
+
+        case GravityNotify:
+            (*gravNotify.ilc_func)(self, @symbol(gravityNotifyView:), nil, &resReq, theView);
+            break;
+
+        case ResizeRequest:
+            (*resReq.ilc_func)(self, @symbol(resizeRequestView:), nil, &resReq, theView);
+            break;
+
+        case CirculateNotify:
+        case CirculateRequest:
+            break;
+
+        case PropertyNotify:
+            (*prop.ilc_func)(self, 
+                             @symbol(propertyChangeView) 
+                             , nil, &prop,
+                             theView);
+            break;
+
+        case SelectionClear:
+            selectionID = __MKATOMOBJ(ev->xselectionclear.selection);
+            (*selClear.ilc_func)(self, 
+                                 @symbol(selectionClear:view:) 
+                                 , nil, &selClear,
+                                 selectionID,
+                                 theView);
+            break;
+
+        case SelectionNotify:
+            /*
+             * returned selection value (answer from SelectionRequest)
+             */
+            DPRINTF(("SelectionNotify prop=%x target=%x selection= %x requestor=%x\n", 
+                        ev->xselection.property, ev->xselection.target,
+                        ev->xselection.selection, ev->xselection.requestor));
+
+            propertyID = __MKATOMOBJ(ev->xselection.property);
+            targetID = __MKATOMOBJ(ev->xselection.target);
+            selectionID = __MKATOMOBJ(ev->xselection.selection);
+            requestorID = __MKOBJ(ev->xselection.requestor);
+            (*selNotify.ilc_func)(self, 
+                                  @symbol(selectionNotify:target:selection:from:view:) 
+                                  , nil, &selNotify,
+                                  propertyID, targetID, selectionID, requestorID,
+                                  theView);
+            break;
+
+        case SelectionRequest:
+            /*
+             * someone wants the selection
+             */
+            DPRINTF(("SelectionRequest prop=%x target=%x selection=%x requestor=%x\n", 
+                        ev->xselectionrequest.property,
+                        ev->xselectionrequest.target,
+                        ev->xselectionrequest.selection,
+                        ev->xselectionrequest.requestor));
+
+            propertyID = __MKATOMOBJ(ev->xselectionrequest.property);
+            targetID = __MKATOMOBJ(ev->xselectionrequest.target);
+            selectionID = __MKATOMOBJ(ev->xselectionrequest.selection);
+            requestorID = __MKOBJ(ev->xselectionrequest.requestor);
+            (*selReq.ilc_func)(self, 
+                               @symbol(selectionRequest:target:selection:from:view:) 
+                               , nil, &selReq,
+                               propertyID, targetID, selectionID, requestorID,
+                               theView);
+            break;
+
+        case ColormapNotify:
+            (*colormap.ilc_func)(self, 
+                                 @symbol(colorMapChangeView:) 
+                                 , nil, &colormap,
+                                 theView);
+            break;
+
+        case MappingNotify:
+            switch(mape->request) {
+                case MappingModifier:
+                    arg = @symbol(mappingModifier);
+                    break;
+                case MappingKeyboard:
+                    arg = @symbol(mappingKeyboard);
+                    break;
+                case MappingPointer:
+                    arg = @symbol(mappingPointer);
+                    break;
+                default:
+                    arg = nil;
+                    break;
+            }
+            (*mapping.ilc_func)(self, 
+                                @symbol(mappingChanged:event:) 
+                                , nil, &mapping, arg, eB);
+            break;
     }
 #undef ae
 #undef ee
@@ -3963,7 +4052,7 @@
     ^ true
 !
 
-dispatchPendingEvents
+patchPendingEvents
     "central event handling method for modal operation.
      (i.e. this is now only used in the modal debugger)
      This code is somewhat special, since X has a concept of graphic
@@ -3973,19 +4062,19 @@
 
     "interested in exposes only ?"
     dispatchingExpose notNil ifTrue:[
-	[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
-	    self dispatchExposeEventFor:dispatchingExpose
-	].
-	^ self
+        [self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
+            self dispatchExposeEventFor:dispatchingExpose
+        ].
+        ^ self
     ].
 
     "no, general dispatch"
     [self eventPendingWithSync:false] whileTrue:[
-	self dispatchEventFor:nil withMask:nil
+        self dispatchEventFor:nil withMask:nil
     ]
 !
 
-disposeEventsWithMask:aMask for:aWindowIdOrNil
+poseEventsWithMask:aMask for:aWindowIdOrNil
     "dispose (throw away) specific events. If aWindowId is nil,
      events matching the mask are thrown away regardless of which
      view they are for. Otherwise, only matching events for that 
@@ -3998,22 +4087,22 @@
 
     if (ISCONNECTED
      && __isSmallInteger(aMask)) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(aWindowIdOrNil)) {
-	    win = _WindowVal(aWindowIdOrNil);
-	    while (XCheckWindowEvent(dpy, win, __intVal(aMask), &ev)) ;;
-	} else {
-	    while (XCheckMaskEvent(dpy, __intVal(aMask), &ev)) ;;
-	}
-	RETURN ( self );
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(aWindowIdOrNil)) {
+            win = _WindowVal(aWindowIdOrNil);
+            while (XCheckWindowEvent(dpy, win, __intVal(aMask), &ev)) ;;
+        } else {
+            while (XCheckMaskEvent(dpy, __intVal(aMask), &ev)) ;;
+        }
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-eventMaskFor:anEventSymbol
+ntMaskFor:anEventSymbol
     "return the eventMask bit-constant corresponding to an event symbol"
 
 %{  /* NOCONTEXT */
@@ -4040,25 +4129,25 @@
 %}
 !
 
-eventPending
+ntPending
     "return true, if any event is pending. 
      This looks for both the internal queue and the display connection."
 
     ConservativeSyncing == true ifTrue:[self sync].
 
     dispatchingExpose notNil ifTrue:[
-	^ self exposeEventPendingFor:dispatchingExpose withSync:false
+        ^ self exposeEventPendingFor:dispatchingExpose withSync:false
     ].
     ^ self eventPendingWithSync:false
 !
 
-eventPending:anEventSymbol for:aWindowIdOrNil
+ntPending:anEventSymbol for:aWindowIdOrNil
     "return true, if a specific event is pending"
 
     ^ self eventsPending:(self eventMaskFor:anEventSymbol) for:aWindowIdOrNil withSync:false
 !
 
-eventPendingWithSync:doSync
+ntPendingWithSync:doSync
     "return true, if any event is pending. 
      If doSync is true, do a sync output buffer (i.e. send all to the display and wait until its processed)
      before checking."
@@ -4066,31 +4155,31 @@
 %{  /* UNLIMITEDSTACK */
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (doSync == true) {
-	    XSync(dpy, 0);      /* make certain everything is flushed */
-	}
-	if (XPending(dpy)) {
-	    RETURN (true);
-	}
+        Display *dpy = myDpy;
+
+        if (doSync == true) {
+            XSync(dpy, 0);      /* make certain everything is flushed */
+        }
+        if (XPending(dpy)) {
+            RETURN (true);
+        }
     }
     RETURN ( false );
 %}
 !
 
-eventQueued
+ntQueued
     "return true, if any event is queued"
 
     dispatchingExpose notNil ifTrue:[
-	^ self exposeEventPendingFor:dispatchingExpose withSync:false
+        ^ self exposeEventPendingFor:dispatchingExpose withSync:false
     ].
     ^ self eventQueuedAlready
 
     "Created: 12.12.1995 / 21:43:00 / stefan"
 !
 
-eventQueuedAlready
+ntQueuedAlready
     "return true, if any event is queued internally.
      (i.e. in X's internal event queue, which is both filled by explicit
       nextEvent calls AND whenever drawing is done and events are pending on
@@ -4099,15 +4188,15 @@
 %{  /* UNLIMITEDSTACK */
 
     if (ISCONNECTED) {
-	if (XEventsQueued(myDpy, QueuedAlready)) {
-	    RETURN (true);
-	}
+        if (XEventsQueued(myDpy, QueuedAlready)) {
+            RETURN (true);
+        }
     }
     RETURN ( false );
 %}
 !
 
-eventsPending:anEventMask for:aWindowIdOrNil withSync:doSync
+ntsPending:anEventMask for:aWindowIdOrNil withSync:doSync
     "return true, if any of the masked events is pending"
 
 %{  /* UNLIMITEDSTACK */
@@ -4117,27 +4206,27 @@
     int thereIsOne;
 
     if (ISCONNECTED && __isSmallInteger(anEventMask)) {
-	Display *dpy = myDpy;
-
-	if (doSync == true) {
-	    XSync(dpy, 0);      /* make certain everything is flushed */
-	}
-	if (__isExternalAddress(aWindowIdOrNil)) {
-	    win = _WindowVal(aWindowIdOrNil);
-	    thereIsOne = XCheckWindowEvent(dpy, win, __intVal(anEventMask), &ev);
-	} else {
-	    thereIsOne = XCheckMaskEvent(dpy, __intVal(anEventMask), &ev);
-	}
-	if (thereIsOne) {
-	    XPutBackEvent(dpy, &ev);
-	    RETURN ( true );
-	}
+        Display *dpy = myDpy;
+
+        if (doSync == true) {
+            XSync(dpy, 0);      /* make certain everything is flushed */
+        }
+        if (__isExternalAddress(aWindowIdOrNil)) {
+            win = _WindowVal(aWindowIdOrNil);
+            thereIsOne = XCheckWindowEvent(dpy, win, __intVal(anEventMask), &ev);
+        } else {
+            thereIsOne = XCheckMaskEvent(dpy, __intVal(anEventMask), &ev);
+        }
+        if (thereIsOne) {
+            XPutBackEvent(dpy, &ev);
+            RETURN ( true );
+        }
     }
     RETURN ( false );
 %}
 !
 
-exposeEventPendingFor:aWindowIdOrNil withSync:doSync
+oseEventPendingFor:aWindowIdOrNil withSync:doSync
     "return true, if any expose event is pending for a specific view,
      or any view (if the arg is nil).
      This is an X specific, only required after a scroll operation."
@@ -4149,27 +4238,27 @@
     int thereIsOne;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (doSync == true) {
-	    XSync(dpy, 0);      /* make certain everything is flushed */
-	}
-	if (__isExternalAddress(aWindowIdOrNil)) {
-	    win = _WindowVal(aWindowIdOrNil);
-	    thereIsOne = XCheckWindowEvent(dpy, win, ExposureMask, &ev);
-	} else {
-	    thereIsOne = XCheckMaskEvent(dpy, ExposureMask, &ev);
-	}
-	if (thereIsOne) {
-	    XPutBackEvent(dpy, &ev);
-	    RETURN ( true );
-	}
+        Display *dpy = myDpy;
+
+        if (doSync == true) {
+            XSync(dpy, 0);      /* make certain everything is flushed */
+        }
+        if (__isExternalAddress(aWindowIdOrNil)) {
+            win = _WindowVal(aWindowIdOrNil);
+            thereIsOne = XCheckWindowEvent(dpy, win, ExposureMask, &ev);
+        } else {
+            thereIsOne = XCheckMaskEvent(dpy, ExposureMask, &ev);
+        }
+        if (thereIsOne) {
+            XPutBackEvent(dpy, &ev);
+            RETURN ( true );
+        }
     }
     RETURN ( false );
 %}
 !
 
-getEventFor:aViewIdOrNil withMask:eventMask
+EventFor:aViewIdOrNil withMask:eventMask
     "read next event - put into local eventBuffer. 
      If aViewIdOrNil is nil, events for any view are fetched; 
      otherwise only events for that specific view will be fetched.
@@ -4194,70 +4283,70 @@
     XEvent *ev;
 
     if (! ISCONNECTED) {
-	RETURN (false);
+        RETURN (false);
     }
 
     dpy = myDpy;
 
     eB = __INST(eventBuffer);
     if (__isByteArray(eB)) {
-	ev = (XEvent *)(__ByteArrayInstPtr(eB)->ba_element);
+        ev = (XEvent *)(__ByteArrayInstPtr(eB)->ba_element);
     } else {
-	printf("DISPLAY: no eventBuffer\n");
-	RETURN (false);
+        printf("DISPLAY: no eventBuffer\n");
+        RETURN (false);
     }
     ev->type = 0;
 
     if (__isSmallInteger(eventMask)) {
-	evMask = __intVal(eventMask);
+        evMask = __intVal(eventMask);
     } else {
-	evMask = ~0;
+        evMask = ~0;
     }
 
     if (__isExternalAddress(aViewIdOrNil)) {
-	wWanted = _WindowVal(aViewIdOrNil);
-	if (XCheckWindowEvent(dpy, wWanted, evMask, ev)) {
-	    RETURN ( true );
-	}
+        wWanted = _WindowVal(aViewIdOrNil);
+        if (XCheckWindowEvent(dpy, wWanted, evMask, ev)) {
+            RETURN ( true );
+        }
     } else {
-	if (evMask == ~0) {
-	    XNextEvent(dpy, ev);
-	    RETURN (true);
-	}
-	if (XCheckMaskEvent(dpy, evMask, ev)) {
-	   RETURN (true);
-	}
+        if (evMask == ~0) {
+            XNextEvent(dpy, ev);
+            RETURN (true);
+        }
+        if (XCheckMaskEvent(dpy, evMask, ev)) {
+           RETURN (true);
+        }
     }
 %}.
     ^ false
 !
 
-handleAllEvents
+dleAllEvents
     "from now on, handle any kind of event"
 
     dispatchingExpose := nil
 !
 
-handleExposeOnlyFor:aView
+dleExposeOnlyFor:aView
     "from now on, handle expose events only"
 
     dispatchingExpose := aView id
 !
 
-mappingChanged:what event:eB
+pingChanged:what event:eB
     "One of Keyboard-, Modifier- or PointerMap has change, probably by xmodmap.
      Tell xlib about the fact."
 
     (what == #mappingKeyboard or:[what == #mappingModifier]) ifTrue:[
-	self refreshKeyboardMapping:eB.
-	"Maybe some of our modifiers have been changed"
-	self initializeModifierMappings.
+        self refreshKeyboardMapping:eB.
+        "Maybe some of our modifiers have been changed"
+        self initializeModifierMappings.
     ].
 
     "Created: 1.12.1995 / 16:28:23 / stefan"
 !
 
-setEventMask:aMask in:aWindowId
+EventMask:aMask in:aWindowId
     "tell X that we are only interested in events from aMask, which
      is the bitwise or of the eventMask bits (see 'eventMaskFor:')"
 
@@ -4268,25 +4357,25 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isSmallInteger(aMask)) {
-	mask = __intVal(aMask);
+        mask = __intVal(aMask);
 
 #ifdef OLD
-	/* these may not be disabled */
-	mask |= ExposureMask | StructureNotifyMask |
-		KeyPressMask | KeyReleaseMask |
-		EnterWindowMask | LeaveWindowMask |
-		ButtonPressMask | ButtonMotionMask | ButtonReleaseMask;
+        /* these may not be disabled */
+        mask |= ExposureMask | StructureNotifyMask |
+                KeyPressMask | KeyReleaseMask |
+                EnterWindowMask | LeaveWindowMask |
+                ButtonPressMask | ButtonMotionMask | ButtonReleaseMask;
 #endif
 
-	XSelectInput(myDpy, _WindowVal(aWindowId), mask);
-	RETURN ( self );
+        XSelectInput(myDpy, _WindowVal(aWindowId), mask);
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-startDispatch
+rtDispatch
     "redefined to clear dispatchingExpose, which is a special X feature"
 
     dispatching ifTrue:[^ self].
@@ -4296,7 +4385,7 @@
 
 !XWorkstation methodsFor:'event sending'!
 
-sendKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId
+dKeyOrButtonEvent:typeSymbol x:xPos y:yPos keyOrButton:keySymCodeOrButtonNr state:stateMask toViewId:targetId
     "send a keyPress/Release or buttonPress/Release event to some (possibly alien) view.
      TypeSymbol must be one of: #keyPress, #keyRelease, #buttonPress , #buttonRelease.
      For buttonEvents, the keySymCodeOrButtonNr must be the buttons number (1, 2 ...);
@@ -4311,143 +4400,143 @@
     int state;
 
     if (__isSmallInteger(stateMask)) {
-	state = __intVal(stateMask);
+        state = __intVal(stateMask);
     } else {
-	state = 0;
+        state = 0;
     }
 
     if (ISCONNECTED
      && __isSmallInteger(xPos) && __isSmallInteger(yPos)
      && (__isSmallInteger(keySymCodeOrButtonNr) || __isSymbol(keySymCodeOrButtonNr) || __isString(keySymCodeOrButtonNr))
      && (__isExternalAddress(targetId) || __isInteger(targetId))) {
-	Display *dpy = myDpy;
-
-	XEvent ev;
-	Window target;
-	Status result;
-	KeySym keySym, *syms;
-	int screen = __intVal(__INST(screen));
-	char s[2];
-	int nSyms;
-
-	if ((typeSymbol == @symbol(keyPress))
-	 || (typeSymbol == @symbol(keyRelease))) {
-	    if (__isSymbol(keySymCodeOrButtonNr) || __isString(keySymCodeOrButtonNr)) {
-		keySym = XStringToKeysym(__stringVal(keySymCodeOrButtonNr));
-	    } else {
-		if (__isCharacter(keySymCodeOrButtonNr)) {
-		    s[0] = __intVal(__characterVal(keySymCodeOrButtonNr));
-		    s[1] = '\0';
-		    keySym = XStringToKeysym(s);
-		} else {
-		    keySym = (KeySym) __intVal(keySymCodeOrButtonNr);
-		}
-	    }
-	    ev.xkey.keycode = XKeysymToKeycode(dpy, keySym);
-
-	    if (stateMask == nil) {
-		/*
-		 * get the modifier from the keySym
-		 */
-		nSyms = 0;
-		syms = XGetKeyboardMapping(dpy, ev.xkey.keycode, 1, &nSyms);
-		if (syms) {
-		    int i;
-
-		    for (i=0; i<nSyms; i++) {
-			if (syms[i] == keySym) {
+        Display *dpy = myDpy;
+
+        XEvent ev;
+        Window target;
+        Status result;
+        KeySym keySym, *syms;
+        int screen = __intVal(__INST(screen));
+        char s[2];
+        int nSyms;
+
+        if ((typeSymbol == @symbol(keyPress))
+         || (typeSymbol == @symbol(keyRelease))) {
+            if (__isSymbol(keySymCodeOrButtonNr) || __isString(keySymCodeOrButtonNr)) {
+                keySym = XStringToKeysym(__stringVal(keySymCodeOrButtonNr));
+            } else {
+                if (__isCharacter(keySymCodeOrButtonNr)) {
+                    s[0] = __intVal(__characterVal(keySymCodeOrButtonNr));
+                    s[1] = '\0';
+                    keySym = XStringToKeysym(s);
+                } else {
+                    keySym = (KeySym) __intVal(keySymCodeOrButtonNr);
+                }
+            }
+            ev.xkey.keycode = XKeysymToKeycode(dpy, keySym);
+
+            if (stateMask == nil) {
+                /*
+                 * get the modifier from the keySym
+                 */
+                nSyms = 0;
+                syms = XGetKeyboardMapping(dpy, ev.xkey.keycode, 1, &nSyms);
+                if (syms) {
+                    int i;
+
+                    for (i=0; i<nSyms; i++) {
+                        if (syms[i] == keySym) {
 #ifdef MODIFIERDEBUG
-			    printf("modifier-index is %d\n", i);
+                            printf("modifier-index is %d\n", i);
 #endif
-			    if (i) state = (1 << (i-1));
-			    break;
-			}
-		    }
-		    XFree(syms);
-		}
-	    }
-	} else {
-	    if ((typeSymbol == @symbol(buttonPress))
-	     || (typeSymbol == @symbol(buttonRelease))) {
-		if (__isSmallInteger(keySymCodeOrButtonNr)) {
-		    ev.xbutton.button = __intVal(keySymCodeOrButtonNr);
-		} else {
-		    ev.xbutton.button = 1;
-		}
-	    } else {
-		DPRINTF(("invalid sendEvent typeSymbol\n"));
-		RETURN (false);
-	    }
-	}
-
-	if (typeSymbol == @symbol(keyPress))
-	    ev.xany.type = KeyPress;
-	else if (typeSymbol == @symbol(keyRelease))
-	    ev.xany.type = KeyRelease;
-	else if (typeSymbol == @symbol(buttonPress))
-	    ev.xany.type = ButtonPress;
-	else if (typeSymbol == @symbol(buttonRelease))
-	    ev.xany.type = ButtonRelease;
-
-	if (__isExternalAddress(targetId)) {
-	    target = _WindowVal(targetId);
-	} else {
-	    target = (Window) __longIntVal(targetId);
-	}
-	ev.xkey.window = target;
-	ev.xkey.same_screen = 1;
-	ev.xkey.subwindow = 0;
-	ev.xkey.root = RootWindow(myDpy, screen);
-	ev.xkey.x = __intVal(xPos);
-	ev.xkey.y = __intVal(yPos);
-	ev.xkey.state = state;
-	ev.xkey.time = CurrentTime;
-
-	result = XSendEvent(dpy, target, False, 0 , &ev);
-	if ((result == BadValue) || (result == BadWindow)) {
-	    DPRINTF(("bad status\n"));
-	    RETURN ( false )
-	}
-	RETURN (true)
+                            if (i) state = (1 << (i-1));
+                            break;
+                        }
+                    }
+                    XFree(syms);
+                }
+            }
+        } else {
+            if ((typeSymbol == @symbol(buttonPress))
+             || (typeSymbol == @symbol(buttonRelease))) {
+                if (__isSmallInteger(keySymCodeOrButtonNr)) {
+                    ev.xbutton.button = __intVal(keySymCodeOrButtonNr);
+                } else {
+                    ev.xbutton.button = 1;
+                }
+            } else {
+                DPRINTF(("invalid sendEvent typeSymbol\n"));
+                RETURN (false);
+            }
+        }
+
+        if (typeSymbol == @symbol(keyPress))
+            ev.xany.type = KeyPress;
+        else if (typeSymbol == @symbol(keyRelease))
+            ev.xany.type = KeyRelease;
+        else if (typeSymbol == @symbol(buttonPress))
+            ev.xany.type = ButtonPress;
+        else if (typeSymbol == @symbol(buttonRelease))
+            ev.xany.type = ButtonRelease;
+
+        if (__isExternalAddress(targetId)) {
+            target = _WindowVal(targetId);
+        } else {
+            target = (Window) __longIntVal(targetId);
+        }
+        ev.xkey.window = target;
+        ev.xkey.same_screen = 1;
+        ev.xkey.subwindow = 0;
+        ev.xkey.root = RootWindow(myDpy, screen);
+        ev.xkey.x = __intVal(xPos);
+        ev.xkey.y = __intVal(yPos);
+        ev.xkey.state = state;
+        ev.xkey.time = CurrentTime;
+
+        result = XSendEvent(dpy, target, False, 0 , &ev);
+        if ((result == BadValue) || (result == BadWindow)) {
+            DPRINTF(("bad status\n"));
+            RETURN ( false )
+        }
+        RETURN (true)
     }
 %}.
     self primitiveFailed.
     ^ false
 !
 
-simulateKeyboardInput:aCharacterOrString inViewId:viewId
+ulateKeyboardInput:aCharacterOrString inViewId:viewId
     "send input to some other view, by simulating keyPress/keyRelease
      events. 
      Only a few control characters are supported.
      Notice: not all alien views allow this kind of synthetic input;
-	     some simply ignore it."
+             some simply ignore it."
 
     |control code state|
 
     aCharacterOrString isString ifTrue:[
-	aCharacterOrString do:[:char |
-	    self simulateKeyboardInput:char inViewId:viewId
-	].
-	^ self
+        aCharacterOrString do:[:char |
+            self simulateKeyboardInput:char inViewId:viewId
+        ].
+        ^ self
     ].
 
     control := false.
     code := aCharacterOrString asciiValue.
 
     (aCharacterOrString == Character cr) ifTrue:[
-	code := #Return
+        code := #Return
     ] ifFalse:[
-	(aCharacterOrString == Character tab) ifTrue:[
-	    code := #Tab 
-	] ifFalse:[
-	    (aCharacterOrString == Character esc) ifTrue:[
-		code := #Escape 
-	    ]
-	]
+        (aCharacterOrString == Character tab) ifTrue:[
+            code := #Tab 
+        ] ifFalse:[
+            (aCharacterOrString == Character esc) ifTrue:[
+                code := #Escape 
+            ]
+        ]
     ].
 
     control ifTrue:[
-	state := self controlMask
+        state := self controlMask
     ].
 
 
@@ -4457,11 +4546,11 @@
     "/ Hopefully, this is correct ...
 
     code isNumber ifTrue:[
-	code >= $A asciiValue ifTrue:[
-	    code <= $Z asciiValue ifTrue:[
-		state := self shiftMask
-	    ]
-	]
+        code >= $A asciiValue ifTrue:[
+            code <= $Z asciiValue ifTrue:[
+                state := self shiftMask
+            ]
+        ]
     ].
 
     self sendKeyOrButtonEvent:#keyPress x:0 y:0 keyOrButton:code state:state toViewId:viewId.
@@ -4482,7 +4571,7 @@
 
 !XWorkstation methodsFor:'font stuff'!
 
-createFontFor:aFontName
+ateFontFor:aFontName
     "a basic method for X-font allocation; this method allows
      any font to be aquired (even those not conforming to
      standard naming conventions, such as cursor, fixed or k14)"
@@ -4493,22 +4582,22 @@
     XFontStruct *newFont;
 
     if (ISCONNECTED) {
-	if (__isString(aFontName) || __isSymbol(aFontName)) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    newFont = XLoadQueryFont(myDpy, (char *)__stringVal(aFontName));
+        if (__isString(aFontName) || __isSymbol(aFontName)) {
+            BEGIN_INTERRUPTSBLOCKED
+            newFont = XLoadQueryFont(myDpy, (char *)__stringVal(aFontName));
 #ifdef COUNT_RESOURCES
-	    if (newFont)
-		__cnt_font++;
+            if (newFont)
+                __cnt_font++;
 #endif
-	    END_INTERRUPTSBLOCKED
-	    RETURN ( newFont ? __MKOBJ(newFont) : nil );
-	}
+            END_INTERRUPTSBLOCKED
+            RETURN ( newFont ? __MKOBJ(newFont) : nil );
+        }
     }
 %}.
     ^ nil
 !
 
-decomposeXFontName:aString into:aBlock
+omposeXFontName:aString into:aBlock
     "extract family, face, style and size from an
      X-font name 
      (-brand-family-face-style-moreStyle--height-size-res-res-?-??-coding); 
@@ -4519,36 +4608,36 @@
 
     aString isNil ifTrue:[^ false].
     (aString startsWith:'-') ifFalse:[
-	"
-	 take care for ill-named fonts (i.e. pre Rel4 fonts)
-	"
-	('*-*-[0-9]*' match:aString) ifTrue:[
-	    end := aString indexOf:$- startingAt:1.
-	    family := aString copyFrom:1 to:(end - 1).
-	    start := end + 1.
-	    end := aString indexOf:$- startingAt:start.
-	    style := aString copyFrom:start to:(end - 1).
-	    start := end + 1.
-	    size := aString copyFrom:start.
-	    size := (Number readFromString:size onError:[^false]).
-	    aBlock value:family value:nil value:style value:size value:nil.
-	    ^ true.
-	].
-	('*-[0-9]*' match:aString) ifTrue:[
-	    "
-	     something like lucidasans-24
-	    "
-	    end := aString indexOf:$- startingAt:1.
-
-	    family := aString copyFrom:1 to:(end - 1).
-	    start := end + 1.
-	    size := aString copyFrom:start.
-	    size := (Number readFromString:size onError:[^false]).
-	    aBlock value:family value:nil value:nil value:size value:nil.
-	    ^ true.
-	].
-	aBlock value:aString value:nil value:nil value:nil value:nil.
-	^ true.
+        "
+         take care for ill-named fonts (i.e. pre Rel4 fonts)
+        "
+        ('*-*-[0-9]*' match:aString) ifTrue:[
+            end := aString indexOf:$- startingAt:1.
+            family := aString copyFrom:1 to:(end - 1).
+            start := end + 1.
+            end := aString indexOf:$- startingAt:start.
+            style := aString copyFrom:start to:(end - 1).
+            start := end + 1.
+            size := aString copyFrom:start.
+            size := (Number readFromString:size onError:[^false]).
+            aBlock value:family value:nil value:style value:size value:nil.
+            ^ true.
+        ].
+        ('*-[0-9]*' match:aString) ifTrue:[
+            "
+             something like lucidasans-24
+            "
+            end := aString indexOf:$- startingAt:1.
+
+            family := aString copyFrom:1 to:(end - 1).
+            start := end + 1.
+            size := aString copyFrom:start.
+            size := (Number readFromString:size onError:[^false]).
+            aBlock value:family value:nil value:nil value:size value:nil.
+            ^ true.
+        ].
+        aBlock value:aString value:nil value:nil value:nil value:nil.
+        ^ true.
     ].
 
     end := aString indexOf:$- startingAt:2.
@@ -4570,15 +4659,15 @@
     (end == 0) ifTrue:[^ false].
     style := aString copyFrom:start to:(end - 1).
     (style = 'o') ifTrue:[
-	style := 'oblique'
+        style := 'oblique'
     ] ifFalse:[
-	(style = 'i') ifTrue:[
-	    style := 'italic'
-	] ifFalse:[
-	    (style = 'r') ifTrue:[
-		style := 'roman'
-	    ]
-	]
+        (style = 'i') ifTrue:[
+            style := 'italic'
+        ] ifFalse:[
+            (style = 'r') ifTrue:[
+                style := 'roman'
+            ]
+        ]
     ].
 
     start := end + 1.
@@ -4628,7 +4717,7 @@
     coding := aString copyFrom:start to:(end - 1).
 
     (moreStyle ~= 'normal' and:[moreStyle ~= '']) ifTrue:[
-	style := style, '-', moreStyle.
+        style := style, '-', moreStyle.
     ].
 
     aBlock value:family value:face value:style value:size value:coding.
@@ -4637,7 +4726,7 @@
     "Modified: 4.7.1996 / 11:12:25 / stefan"
 !
 
-encodingOf:aFontId
+odingOf:aFontId
     "the fonts encoding - if the font does not provide that info,
      return nil (and assume #ascii, which is a subset of #iso8859)."
 
@@ -4651,116 +4740,116 @@
     Atom fontAtom, registryAtom, encodingAtom, charSetCollAtom;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	registryAtom = XInternAtom(dpy, "CHARSET_REGISTRY", True);
-	encodingAtom = XInternAtom(dpy, "CHARSET_ENCODING", True);
-	charSetCollAtom = XInternAtom(dpy, "CHARSET_COLLECTIONS", True);
-	fontAtom = XInternAtom(dpy, "FONT", True);
-
-	if (__isExternalAddress(aFontId)) {
+        Display *dpy = myDpy;
+
+        registryAtom = XInternAtom(dpy, "CHARSET_REGISTRY", True);
+        encodingAtom = XInternAtom(dpy, "CHARSET_ENCODING", True);
+        charSetCollAtom = XInternAtom(dpy, "CHARSET_COLLECTIONS", True);
+        fontAtom = XInternAtom(dpy, "FONT", True);
+
+        if (__isExternalAddress(aFontId)) {
         
-	    f = _FontVal(aFontId);
-	    if (f) {
-		n = f->n_properties;
-		prop = f->properties;
-		if (prop) {
-		    while (n--) {
+            f = _FontVal(aFontId);
+            if (f) {
+                n = f->n_properties;
+                prop = f->properties;
+                if (prop) {
+                    while (n--) {
 #ifdef SUPERDEBUG
-			cp = XGetAtomName(dpy, prop->name);
-			printf("%s (%d) -> %d\n", cp, prop->name, prop->card32);
-			XFree(cp);
+                        cp = XGetAtomName(dpy, prop->name);
+                        printf("%s (%d) -> %d\n", cp, prop->name, prop->card32);
+                        XFree(cp);
 #endif
-			if (prop->name == XA_FULL_NAME) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				fullName = __MKSTRING(cp);
+                        if (prop->name == XA_FULL_NAME) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                fullName = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   FULL_NAME -> %s\n", cp);
+                                printf("   FULL_NAME -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			} else if (prop->name == fontAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				fontName = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        } else if (prop->name == fontAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                fontName = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   FONT -> %s\n", cp);
+                                printf("   FONT -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			} else if (prop->name == encodingAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				encoding = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        } else if (prop->name == encodingAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                encoding = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   ENCODING -> %s\n", cp);
+                                printf("   ENCODING -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			} else if (prop->name == registryAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				registry = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        } else if (prop->name == registryAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                registry = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   REGISTRY -> %s\n", cp);
+                                printf("   REGISTRY -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			} else if (prop->name == charSetCollAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				charSetCollections = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        } else if (prop->name == charSetCollAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                charSetCollections = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   CHARSET_COLLECTIONS -> %s\n", cp);
+                                printf("   CHARSET_COLLECTIONS -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			}
-			prop++;
-		    }
-		}
-	    }
-	}
+                                XFree(cp);
+                            }
+                        }
+                        prop++;
+                    }
+                }
+            }
+        }
     }
 %}.
     ^ self
-	extractEncodingFromRegistry:registry 
-	encoding:encoding 
-	charSetCollections:charSetCollections
-!
-
-extractEncodingFromRegistry:registry encoding:encoding charSetCollections:charSetCollections
+        extractEncodingFromRegistry:registry 
+        encoding:encoding 
+        charSetCollections:charSetCollections
+!
+
+ractEncodingFromRegistry:registry encoding:encoding charSetCollections:charSetCollections
     "this is pure magic ..."
 
     |enc charSets|
 
     (registry notNil and:[registry notEmpty]) ifTrue:[
-	enc := registry asLowercase asSymbol.
+        enc := registry asLowercase asSymbol.
     ] ifFalse:[
-	(encoding notNil and:[encoding notEmpty]) ifTrue:[
-	    enc := encoding asLowercase asSymbol
-	] ifFalse:[
-	    charSets := charSetCollections.    
-	    (charSets notNil and:[charSets notEmpty]) ifTrue:[
-		charSets := charSets asUppercase asCollectionOfWords.
-		(charSets includes:'ISO8859-1') ifTrue:[
-		    enc := #iso8859
-		] ifFalse:[
-		    (charSets includes:'ISO8859') ifTrue:[
-			enc := #iso8859
-		    ] ifFalse:[
-			(charSets includes:'ASCII') ifTrue:[
-			    enc := #ascii
-			] ifFalse:[
-			    (charSets includes:'ADOBE-STANDARD') ifTrue:[
-				enc := #iso8859
-			    ]
-			]
-		    ]
-		]
-	    ] 
-	]
+        (encoding notNil and:[encoding notEmpty]) ifTrue:[
+            enc := encoding asLowercase asSymbol
+        ] ifFalse:[
+            charSets := charSetCollections.    
+            (charSets notNil and:[charSets notEmpty]) ifTrue:[
+                charSets := charSets asUppercase asCollectionOfWords.
+                (charSets includes:'ISO8859-1') ifTrue:[
+                    enc := #iso8859
+                ] ifFalse:[
+                    (charSets includes:'ISO8859') ifTrue:[
+                        enc := #iso8859
+                    ] ifFalse:[
+                        (charSets includes:'ASCII') ifTrue:[
+                            enc := #ascii
+                        ] ifFalse:[
+                            (charSets includes:'ADOBE-STANDARD') ifTrue:[
+                                enc := #iso8859
+                            ]
+                        ]
+                    ]
+                ]
+            ] 
+        ]
     ].
     ^  enc
 
@@ -4768,7 +4857,7 @@
     "Modified: 17.4.1996 / 17:22:35 / cg"
 !
 
-flushListOfAvailableFonts
+shListOfAvailableFonts
     "flush the cached list of all available fonts on this display.
      Required if new fonts have been added on the display server."
 
@@ -4783,7 +4872,7 @@
     "Created: 20.2.1996 / 22:55:52 / cg"
 !
 
-fontMetricsOf:fontId into:aBlock
+tMetricsOf:fontId into:aBlock
     "evaluate aBlock, passing a fonts metrics as arguments"
 
     |encoding avgAscent avgDescent
@@ -4795,56 +4884,56 @@
     int len;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(fontId)) {
-	    f = _FontVal(fontId);
-	    if (f) {
+        if (__isExternalAddress(fontId)) {
+            f = _FontVal(fontId);
+            if (f) {
 #ifdef NOTDEF
-		char *cp;
-		XFontProp *prop;
-
-		n = f->n_properties;
-		prop = f->properties;
-
-		if (prop) {
-		    while (n--) {
-			if (prop->name == RESOLUTION_X) {
-			    resX = __MKSMALLINT(prop->card32);
-			} else if (prop->name == RESOLUTION_Y) {
-			    resY = __MKSMALLINT(prop->card32);
-			} else if (prop->name == RESOLUTION) {
-			    res = __MKSMALLINT(prop->card32);
-			}
-			prop++;
-		    }
-		}
+                char *cp;
+                XFontProp *prop;
+
+                n = f->n_properties;
+                prop = f->properties;
+
+                if (prop) {
+                    while (n--) {
+                        if (prop->name == RESOLUTION_X) {
+                            resX = __MKSMALLINT(prop->card32);
+                        } else if (prop->name == RESOLUTION_Y) {
+                            resY = __MKSMALLINT(prop->card32);
+                        } else if (prop->name == RESOLUTION) {
+                            res = __MKSMALLINT(prop->card32);
+                        }
+                        prop++;
+                    }
+                }
 #endif
 
-		avgAscent = __MKSMALLINT(f->ascent);
-		avgDescent = __MKSMALLINT(f->descent);
-		maxAscent = __MKSMALLINT(f->max_bounds.ascent);
-		maxDescent = __MKSMALLINT(f->max_bounds.descent);
-		minWidth = __MKSMALLINT(f->min_bounds.width);
-		maxWidth = __MKSMALLINT(f->max_bounds.width);
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth(f, " ", 1);
-		END_INTERRUPTSBLOCKED
-		avgWidth = __MKSMALLINT( len );
-	    }
-	}
+                avgAscent = __MKSMALLINT(f->ascent);
+                avgDescent = __MKSMALLINT(f->descent);
+                maxAscent = __MKSMALLINT(f->max_bounds.ascent);
+                maxDescent = __MKSMALLINT(f->max_bounds.descent);
+                minWidth = __MKSMALLINT(f->min_bounds.width);
+                maxWidth = __MKSMALLINT(f->max_bounds.width);
+                BEGIN_INTERRUPTSBLOCKED
+                len = XTextWidth(f, " ", 1);
+                END_INTERRUPTSBLOCKED
+                avgWidth = __MKSMALLINT( len );
+            }
+        }
     }
 %}.
     encoding := self encodingOf:fontId.
     aBlock value:encoding
-	   value:avgAscent
-	   value:avgDescent
-	   value:maxAscent
-	   value:maxDescent
-	   value:minWidth
-	   value:maxWidth
-	   value:avgWidth
-!
-
-fontResolutionOf:fontId
+           value:avgAscent
+           value:avgDescent
+           value:maxAscent
+           value:maxDescent
+           value:minWidth
+           value:maxWidth
+           value:avgWidth
+!
+
+tResolutionOf:fontId
     "return the resolution (as dpiX @ dpiY) of the font - this is usually the displays resolution,
      but due to errors in some XServer installations, some use 75dpi fonts on higher
      resolution displays and vice/versa."
@@ -4855,48 +4944,48 @@
     XFontStruct *f;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(fontId)) {
-	    f = _FontVal(fontId);
-	    if (f) {
-		char *cp;
-		XFontProp *prop;
-		Atom resolutionXAtom, resolutionYAtom;
-		int n;
-
-		n = f->n_properties;
-		prop = f->properties;
-
-		if (prop) {
-		    resolutionXAtom = XInternAtom(dpy, "RESOLUTION_X", True);
-		    resolutionYAtom = XInternAtom(dpy, "RESOLUTION_Y", True);
-
-		    while (n--) {
-			if (prop->name == resolutionXAtom) {
-			    resX = __MKSMALLINT(prop->card32);
-			} else if (prop->name == resolutionYAtom) {
-			    resY = __MKSMALLINT(prop->card32);
-			} else if (prop->name == XA_RESOLUTION) {
-			    res = __MKSMALLINT(prop->card32);
-			}
-			prop++;
-		    }
-		}
-	    }
-	}
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(fontId)) {
+            f = _FontVal(fontId);
+            if (f) {
+                char *cp;
+                XFontProp *prop;
+                Atom resolutionXAtom, resolutionYAtom;
+                int n;
+
+                n = f->n_properties;
+                prop = f->properties;
+
+                if (prop) {
+                    resolutionXAtom = XInternAtom(dpy, "RESOLUTION_X", True);
+                    resolutionYAtom = XInternAtom(dpy, "RESOLUTION_Y", True);
+
+                    while (n--) {
+                        if (prop->name == resolutionXAtom) {
+                            resX = __MKSMALLINT(prop->card32);
+                        } else if (prop->name == resolutionYAtom) {
+                            resY = __MKSMALLINT(prop->card32);
+                        } else if (prop->name == XA_RESOLUTION) {
+                            res = __MKSMALLINT(prop->card32);
+                        }
+                        prop++;
+                    }
+                }
+            }
+        }
     }
 %}.
     (resX notNil and:[resY notNil]) ifTrue:[
-	^ resX @ resY
+        ^ resX @ resY
     ].
     res notNil ifTrue:[
-	^ res @ res
+        ^ res @ res
     ].
     ^ self resolution
 !
 
-fullNameOf:aFontId
+lNameOf:aFontId
     "the fonts fullName - this is very device specific and should only be
      used for user feed-back (for example: in the fontPanel).
      If the display/font do not provide that info, return nil."
@@ -4911,57 +5000,57 @@
     Atom fontAtom;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	fontAtom = XInternAtom(dpy, "FONT", True);
-
-	if (__isExternalAddress(aFontId)) {
+        Display *dpy = myDpy;
+
+        fontAtom = XInternAtom(dpy, "FONT", True);
+
+        if (__isExternalAddress(aFontId)) {
         
-	    f = _FontVal(aFontId);
-	    if (f) {
-		n = f->n_properties;
-		prop = f->properties;
-		if (prop) {
-		    while (n--) {
+            f = _FontVal(aFontId);
+            if (f) {
+                n = f->n_properties;
+                prop = f->properties;
+                if (prop) {
+                    while (n--) {
 #ifdef SUPERDEBUG
-			cp = XGetAtomName(dpy, prop->name);
-			printf("%s (%d) -> %d\n", cp, prop->name, prop->card32);
-			XFree(cp);
+                        cp = XGetAtomName(dpy, prop->name);
+                        printf("%s (%d) -> %d\n", cp, prop->name, prop->card32);
+                        XFree(cp);
 #endif
-			if (prop->name == XA_FULL_NAME) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				fullName = __MKSTRING(cp);
+                        if (prop->name == XA_FULL_NAME) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                fullName = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   FULL_NAME -> %s\n", cp);
+                                printf("   FULL_NAME -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			}
-			if (prop->name == fontAtom) {
-			    cp = XGetAtomName(dpy, prop->card32);
-			    if (cp) {
-				fontName = __MKSTRING(cp);
+                                XFree(cp);
+                            }
+                        }
+                        if (prop->name == fontAtom) {
+                            cp = XGetAtomName(dpy, prop->card32);
+                            if (cp) {
+                                fontName = __MKSTRING(cp);
 #ifdef SUPERDEBUG
-				printf("   FONT -> %s\n", cp);
+                                printf("   FONT -> %s\n", cp);
 #endif
-				XFree(cp);
-			    }
-			}
-			prop++;
-		    }
-		}
-	    }
-	}
+                                XFree(cp);
+                            }
+                        }
+                        prop++;
+                    }
+                }
+            }
+        }
     }
 %}.
     (fullName notNil and:[fullName notEmpty]) ifTrue:[
-	^ fullName
+        ^ fullName
     ].
     ^ fontName
 !
 
-getAvailableFontsMatching:pattern
+AvailableFontsMatching:pattern
     "return an Array filled with font names matching aPattern"
 
 %{  /* UNLIMITEDSTACK */
@@ -4973,49 +5062,49 @@
     int i;
 
     if (ISCONNECTED) {
-	if (__isString(pattern)) {
-	    for (;;) {
-		fonts = XListFonts(myDpy, __stringVal(pattern), nnames, &available);
-		if ((fonts == NULL) || (available < nnames)) break;
-		XFreeFontNames(fonts);
-		nnames = available * 2;
-	    }
-	    if (fonts == NULL) {
-		RETURN ( nil );
-	    }
-	    /*
-	     * now, that we know the number of font names,
-	     * create the array ...
-	     */
-	    arr = __ARRAY_NEW_INT(available);
-	    if (! arr) {
-		RETURN (nil);
-	    }
-	    /*
-	     * ... and fill it
-	     */
-	    for (i=0; i<available; i++) {
-		__PROTECT__(arr);
-		str = __MKSTRING(fonts[i]);
-		__UNPROTECT__(arr);
-		__ArrayInstPtr(arr)->a_element[i] = str; __STORE(arr, str);
-	    }
-	    RETURN (arr);
-	}
+        if (__isString(pattern)) {
+            for (;;) {
+                fonts = XListFonts(myDpy, __stringVal(pattern), nnames, &available);
+                if ((fonts == NULL) || (available < nnames)) break;
+                XFreeFontNames(fonts);
+                nnames = available * 2;
+            }
+            if (fonts == NULL) {
+                RETURN ( nil );
+            }
+            /*
+             * now, that we know the number of font names,
+             * create the array ...
+             */
+            arr = __ARRAY_NEW_INT(available);
+            if (! arr) {
+                RETURN (nil);
+            }
+            /*
+             * ... and fill it
+             */
+            for (i=0; i<available; i++) {
+                __PROTECT__(arr);
+                str = __MKSTRING(fonts[i]);
+                __UNPROTECT__(arr);
+                __ArrayInstPtr(arr)->a_element[i] = str; __STORE(arr, str);
+            }
+            RETURN (arr);
+        }
     }
 %}.
     ^ nil
 !
 
-getDefaultFont
+DefaultFont
     "return a default font id - used when class Font cannot
      find anything usable"
 
      ^ self createFontFor:'fixed'
 !
 
-getFontWithFamily:familyString face:faceString
-	    style:styleArgString size:sizeArg encoding:encodingSym
+FontWithFamily:familyString face:faceString
+            style:styleArgString size:sizeArg encoding:encodingSym
 
     "try to get the specified font, if not available, try next smaller
      font. Access to X-fonts by name is possible, by passing the X font name
@@ -5028,22 +5117,22 @@
 
     "special: if face is nil, allow access to X-fonts"
     faceString isNil ifTrue:[
-	sizeArg notNil ifTrue:[
-	    theName := familyString , '-' , sizeArg printString
-	] ifFalse:[
-	    theName := familyString
-	].
-	theName isNil ifTrue:[
-	    "
-	     mhmh - fall back to the default font
-	    "
-	    theName := 'fixed'
-	].
-	theId := self createFontFor:theName.
-	theId isNil ifTrue:[
-	    theId := self getDefaultFont
-	].
-	^ theId
+        sizeArg notNil ifTrue:[
+            theName := familyString , '-' , sizeArg printString
+        ] ifFalse:[
+            theName := familyString
+        ].
+        theName isNil ifTrue:[
+            "
+             mhmh - fall back to the default font
+            "
+            theName := 'fixed'
+        ].
+        theId := self createFontFor:theName.
+        theId isNil ifTrue:[
+            theId := self getDefaultFont
+        ].
+        ^ theId
     ].
 
     "/ spacing other than 'normal' is contained as last component
@@ -5051,58 +5140,58 @@
 
     ((styleString endsWith:'-narrow') 
      or:[styleString endsWith:'-semicondensed']) ifTrue:[
-	|i|
-	i := styleString lastIndexOf:$-.
-	spacing := styleString copyFrom:(i+1).
-	styleString := styleString copyTo:(i-1).
+        |i|
+        i := styleString lastIndexOf:$-.
+        spacing := styleString copyFrom:(i+1).
+        styleString := styleString copyTo:(i-1).
     ] ifFalse:[
-	spacing := 'normal'.
+        spacing := 'normal'.
     ].
 
     xlatedStyle := styleString.
     xlatedStyle notNil ifTrue:[
-	xlatedStyle := xlatedStyle first asString
+        xlatedStyle := xlatedStyle first asString
     ].
 
     id := self 
-	    getFontWithFoundry:'*'
-	    family:familyString asLowercase
-	    weight:faceString
-	    slant:xlatedStyle
-	    spacing:spacing
-	    pixelSize:nil
-	    size:sizeArg 
-	    registry:encodingSym
-	    encoding:'*'.
+            getFontWithFoundry:'*'
+            family:familyString asLowercase
+            weight:faceString
+            slant:xlatedStyle
+            spacing:spacing
+            pixelSize:nil
+            size:sizeArg 
+            registry:encodingSym
+            encoding:'*'.
 
     id isNil ifTrue:[
-	(encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
-	    "/ too stupid: encodings come in both cases
-	    "/ and X does not ignore case
-	    "/
-	    id := self 
-		    getFontWithFoundry:'*'
-		    family:familyString asLowercase
-		    weight:faceString
-		    slant:xlatedStyle
-		    spacing:spacing
-		    pixelSize:nil
-		    size:sizeArg 
-		    registry:encodingSym asUppercase
-		    encoding:'*'.
-	    id isNil ifTrue:[
-		id := self 
-			getFontWithFoundry:'*'
-			family:familyString asLowercase
-			weight:faceString
-			slant:xlatedStyle
-			spacing:spacing
-			pixelSize:nil
-			size:sizeArg 
-			registry:encodingSym asLowercase
-			encoding:'*'.
-	    ]
-	]
+        (encodingSym notNil and:[encodingSym ~= '*']) ifTrue:[
+            "/ too stupid: encodings come in both cases
+            "/ and X does not ignore case
+            "/
+            id := self 
+                    getFontWithFoundry:'*'
+                    family:familyString asLowercase
+                    weight:faceString
+                    slant:xlatedStyle
+                    spacing:spacing
+                    pixelSize:nil
+                    size:sizeArg 
+                    registry:encodingSym asUppercase
+                    encoding:'*'.
+            id isNil ifTrue:[
+                id := self 
+                        getFontWithFoundry:'*'
+                        family:familyString asLowercase
+                        weight:faceString
+                        slant:xlatedStyle
+                        spacing:spacing
+                        pixelSize:nil
+                        size:sizeArg 
+                        registry:encodingSym asLowercase
+                        encoding:'*'.
+            ]
+        ]
     ].
     ^ id
 
@@ -5110,9 +5199,9 @@
     "Modified: 4.7.1996 / 11:38:47 / stefan"
 !
 
-getFontWithFoundry:foundry family:family weight:weight
-	      slant:slant spacing:spc pixelSize:pSize size:size 
-	      registry:registry encoding:encoding
+FontWithFoundry:foundry family:family weight:weight
+              slant:slant spacing:spc pixelSize:pSize size:size 
+              registry:registry encoding:encoding
 
     "get the specified font, if not available, return nil.
      This is the new font creation method - all others will be changed to
@@ -5136,70 +5225,70 @@
 
     "this works only on 'Release >= 3' - X-servers"
     "name is:
-	-foundry-family    -weight -slant-
-	 sony    helvetica bold     r
-	 adobe   courier   medium   i
-	 msic    fixed              o
-	 ...     ...
+        -foundry-family    -weight -slant-
+         sony    helvetica bold     r
+         adobe   courier   medium   i
+         msic    fixed              o
+         ...     ...
     "
 
     size isNil ifTrue:[
-	sizeMatch := '*'
+        sizeMatch := '*'
     ] ifFalse:[
-	sizeMatch := size printString , '0'
+        sizeMatch := size printString , '0'
     ].
     foundry isNil ifTrue:[
-	foundryMatch := '*'
+        foundryMatch := '*'
     ] ifFalse:[
-	foundryMatch := foundry
+        foundryMatch := foundry
     ].
     family isNil ifTrue:[
-	familyMatch := '*'
+        familyMatch := '*'
     ] ifFalse:[
-	familyMatch := family
+        familyMatch := family
     ].
     weight isNil ifTrue:[
-	weightMatch := '*'
+        weightMatch := '*'
     ] ifFalse:[
-	weightMatch := weight
+        weightMatch := weight
     ].
     slant isNil ifTrue:[
-	slantMatch := '*'
+        slantMatch := '*'
     ] ifFalse:[
-	slantMatch := slant
+        slantMatch := slant
     ].
     spc isNil ifTrue:[
-	spcMatch := '*'
+        spcMatch := '*'
     ] ifFalse:[
-	spcMatch := spc
+        spcMatch := spc
     ].
     pSize isNil ifTrue:[
-	pSizeMatch := '*'
+        pSizeMatch := '*'
     ] ifFalse:[
-	pSizeMatch := pSize printString
+        pSizeMatch := pSize printString
     ].
     registry isNil ifTrue:[
-	registryMatch := '*'
+        registryMatch := '*'
     ] ifFalse:[
-	registryMatch := registry
+        registryMatch := registry
     ].
     encoding isNil ifTrue:[
-	encodingMatch := '*'
+        encodingMatch := '*'
     ] ifFalse:[
-	encodingMatch := encoding
+        encodingMatch := encoding
     ].
 
     theName := ('-' , foundryMatch,
-		'-' , familyMatch,
-		'-' , weightMatch ,
-		'-' , slantMatch , 
-		'-' , spcMatch ,
-		'-*' ,
-		'-' , pSizeMatch ,
-		'-' , sizeMatch ,
-		'-*-*-*-*' ,
-		'-' , registryMatch ,
-		'-' , encodingMatch).
+                '-' , familyMatch,
+                '-' , weightMatch ,
+                '-' , slantMatch , 
+                '-' , spcMatch ,
+                '-*' ,
+                '-' , pSizeMatch ,
+                '-' , sizeMatch ,
+                '-*-*-*-*' ,
+                '-' , registryMatch ,
+                '-' , encodingMatch).
 
 "/  Transcript showCR:theName; endEntry.
 
@@ -5208,20 +5297,20 @@
 
     "
      Display getFontWithFoundry:'*'
-			 family:'courier'
-			 weight:'medium'
-			  slant:'r'
-			spacing:nil
-		      pixelSize:nil
-			   size:13
-		       registry:'iso8859'
-		       encoding:'*'
+                         family:'courier'
+                         weight:'medium'
+                          slant:'r'
+                        spacing:nil
+                      pixelSize:nil
+                           size:13
+                       registry:'iso8859'
+                       encoding:'*'
     "
 
     "Modified: 24.2.1996 / 22:33:29 / cg"
 !
 
-listOfAvailableFonts
+tOfAvailableFonts
     "return a list with all available fonts on this display.
      Since this takes a long time, keep the result of the query for the
      next time. The elements of the returned collection are instances of
@@ -5261,40 +5350,40 @@
 "/          listOfXFonts sort:[:a :b | a family < b family].
 "/      ].
 
-	"/
-	"/ new code:
-	"/ use new primitive to get font names;
-	"/ this is much faster, and also works on systems where
-	"/      a) xlsfonts is broken (sco)
-	"/      b) xlsfonts is not available (aix)
-	"/
-	names := self getAvailableFontsMatching:'*'.
-	names isNil ifTrue:[
-	    "no names returned ..."
-	    ^ nil
-	].
-	listOfXFonts := names collect:[:aName |
-				    |fntDescr|
-
-				    (self decomposeXFontName:aName into:
-					[:family :face :style :size :coding |
-					   family notNil ifTrue:[
-					       fntDescr := FontDescription
-							       family:family
-							       face:face
-							       style:style
-							       size:size
-							       encoding:coding.
-					   ] ifFalse:[
-					       fntDescr := FontDescription
-							       name:aName
-					   ]
-					]
-				    ) ifFalse:[
-					fntDescr := FontDescription name:aName.
-				    ].  
-				    fntDescr
-			    ].
+        "/
+        "/ new code:
+        "/ use new primitive to get font names;
+        "/ this is much faster, and also works on systems where
+        "/      a) xlsfonts is broken (sco)
+        "/      b) xlsfonts is not available (aix)
+        "/
+        names := self getAvailableFontsMatching:'*'.
+        names isNil ifTrue:[
+            "no names returned ..."
+            ^ nil
+        ].
+        listOfXFonts := names collect:[:aName |
+                                    |fntDescr|
+
+                                    (self decomposeXFontName:aName into:
+                                        [:family :face :style :size :coding |
+                                           family notNil ifTrue:[
+                                               fntDescr := FontDescription
+                                                               family:family
+                                                               face:face
+                                                               style:style
+                                                               size:size
+                                                               encoding:coding.
+                                           ] ifFalse:[
+                                               fntDescr := FontDescription
+                                                               name:aName
+                                           ]
+                                        ]
+                                    ) ifFalse:[
+                                        fntDescr := FontDescription name:aName.
+                                    ].  
+                                    fntDescr
+                            ].
 
     ].
     ^ listOfXFonts
@@ -5309,33 +5398,33 @@
     "Modified: 17.4.1996 / 15:27:57 / cg"
 !
 
-releaseFont:aFontId
+easeFont:aFontId
 
 %{  /* NOCONTEXT */
 
     XFontStruct *f;
 
     if (! ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	if (f) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XFreeFont(myDpy, f);
+        f = _FontVal(aFontId);
+        if (f) {
+            BEGIN_INTERRUPTSBLOCKED
+            XFreeFont(myDpy, f);
 #ifdef COUNT_RESOURCES
-	    __cnt_font--;
+            __cnt_font--;
 #endif
-	    END_INTERRUPTSBLOCKED
-	    RETURN ( self );
-	}
+            END_INTERRUPTSBLOCKED
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
+esInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter
     "return a set of all available font sizes in aFamily/aFace/aStyle
      on this display.
      Redefined to handle X's special case of 0-size (which stands for any)"
@@ -5344,10 +5433,10 @@
 
     sizes := super sizesInFamily:aFamilyName face:aFaceName style:aStyleName filtering:filter.
     (sizes notNil and:[sizes includes:0]) ifTrue:[
-	"special: in X11R5 and above, size 0 means:
-	 there are scaled versions in all sizes available"
-
-	^ #(4 5 6 7 8 9 10 11 12 14 16 18 20 22 24 28 32 48 64)
+        "special: in X11R5 and above, size 0 means:
+         there are scaled versions in all sizes available"
+
+        ^ #(4 5 6 7 8 9 10 11 12 14 16 18 20 22 24 28 32 48 64)
     ].
     ^ sizes
 
@@ -5358,7 +5447,7 @@
     "Created: 27.2.1996 / 01:38:15 / cg"
 !
 
-widthOf:aString from:index1 to:index2 inFont:aFontId
+thOf:aString from:index1 to:index2 inFont:aFontId
 
 %{  /* NOCONTEXT */
 
@@ -5371,98 +5460,98 @@
     int nInstBytes;
 
     if (ISCONNECTED) {
-	if (__bothSmallInteger(index1, index2)
-	 && __isExternalAddress(aFontId)
-	 && __isNonNilObject(aString)) {
-	    f = _FontVal(aFontId);
-	    if (! f) goto fail;
-
-	    i1 = __intVal(index1) - 1;
-	    cls = __qClass(aString);
-
-	    if (i1 >= 0) {
-		i2 = __intVal(index2) - 1;
-		if (i2 < i1) {
-		    RETURN (self);
-		}
-
-		cp = (char *) _stringVal(aString);
-		l = i2 - i1 + 1;
-
-		if ((cls == @global(String)) || (cls == @global(Symbol))) {
-		    n = _stringSize(aString);
-		    if (i2 < n) {
-			cp += i1;
-			BEGIN_INTERRUPTSBLOCKED
-			len = XTextWidth(f, cp, l);
-			END_INTERRUPTSBLOCKED
-			RETURN ( __MKSMALLINT(len) );
-		    }
-		}
-
-		nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-		cp += nInstBytes;
-
-		if (__isBytes(aString)) {
-		    n = __byteArraySize(aString) - nInstBytes;
-		    if (i2 < n) {
-			cp += i1;
-			BEGIN_INTERRUPTSBLOCKED
-			len = XTextWidth(f, cp, l);
-			END_INTERRUPTSBLOCKED
-			RETURN ( __MKSMALLINT(len) );
-		    }
-		}
-
-		/* TWOBYTESTRINGS */
-		if (__isWords(aString)) {
-		    n = (__byteArraySize(aString) - nInstBytes) / 2;
-
-		    if (i2 < n) {
-			union {
-			    char b[2];
-			    unsigned short s;
-			} u;
-			int i;
-			XChar2b *cp2 = (XChar2b *)0;
-			int mustFree = 0;
-
-			cp += (i1 * 2);
-			if (l > 1000) l = 1000;
-
-			/*
-			 * ST/X TwoByteStrings store the asciiValue in native byteOrder;
-			 * X expects them MSB first
-			 * convert as required
-			 */
-
-			u.s = 0x1234;
-			if (u.b[0] != 0x12) {
-			    if (l <= NLOCALBUFFER) {
-				cp2 = xlatebuffer;
-			    } else {
-				cp2 = (XChar2b *)(malloc(l * 2));
-				mustFree = 1;
-			    }
-			    for (i=0; i<l; i++) {
-				cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
-				cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
-			    }
-			    cp = (char *) cp2;
-			}
-			BEGIN_INTERRUPTSBLOCKED
-			len = XTextWidth16(f, (XChar2b *)cp, l);
-			END_INTERRUPTSBLOCKED
-
-			if (mustFree) {
-			    free(cp2);
-			}
-
-			RETURN ( __MKSMALLINT(len) );
-		    }
-		}
-	    }
-	}
+        if (__bothSmallInteger(index1, index2)
+         && __isExternalAddress(aFontId)
+         && __isNonNilObject(aString)) {
+            f = _FontVal(aFontId);
+            if (! f) goto fail;
+
+            i1 = __intVal(index1) - 1;
+            cls = __qClass(aString);
+
+            if (i1 >= 0) {
+                i2 = __intVal(index2) - 1;
+                if (i2 < i1) {
+                    RETURN (self);
+                }
+
+                cp = (char *) _stringVal(aString);
+                l = i2 - i1 + 1;
+
+                if ((cls == @global(String)) || (cls == @global(Symbol))) {
+                    n = _stringSize(aString);
+                    if (i2 < n) {
+                        cp += i1;
+                        BEGIN_INTERRUPTSBLOCKED
+                        len = XTextWidth(f, cp, l);
+                        END_INTERRUPTSBLOCKED
+                        RETURN ( __MKSMALLINT(len) );
+                    }
+                }
+
+                nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+                cp += nInstBytes;
+
+                if (__isBytes(aString)) {
+                    n = __byteArraySize(aString) - nInstBytes;
+                    if (i2 < n) {
+                        cp += i1;
+                        BEGIN_INTERRUPTSBLOCKED
+                        len = XTextWidth(f, cp, l);
+                        END_INTERRUPTSBLOCKED
+                        RETURN ( __MKSMALLINT(len) );
+                    }
+                }
+
+                /* TWOBYTESTRINGS */
+                if (__isWords(aString)) {
+                    n = (__byteArraySize(aString) - nInstBytes) / 2;
+
+                    if (i2 < n) {
+                        union {
+                            char b[2];
+                            unsigned short s;
+                        } u;
+                        int i;
+                        XChar2b *cp2 = (XChar2b *)0;
+                        int mustFree = 0;
+
+                        cp += (i1 * 2);
+                        if (l > 1000) l = 1000;
+
+                        /*
+                         * ST/X TwoByteStrings store the asciiValue in native byteOrder;
+                         * X expects them MSB first
+                         * convert as required
+                         */
+
+                        u.s = 0x1234;
+                        if (u.b[0] != 0x12) {
+                            if (l <= NLOCALBUFFER) {
+                                cp2 = xlatebuffer;
+                            } else {
+                                cp2 = (XChar2b *)(malloc(l * 2));
+                                mustFree = 1;
+                            }
+                            for (i=0; i<l; i++) {
+                                cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
+                                cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
+                            }
+                            cp = (char *) cp2;
+                        }
+                        BEGIN_INTERRUPTSBLOCKED
+                        len = XTextWidth16(f, (XChar2b *)cp, l);
+                        END_INTERRUPTSBLOCKED
+
+                        if (mustFree) {
+                            free(cp2);
+                        }
+
+                        RETURN ( __MKSMALLINT(len) );
+                    }
+                }
+            }
+        }
     }
 #undef NLOCALBUFFER
 fail: ;
@@ -5471,7 +5560,7 @@
     ^ nil
 !
 
-widthOf:aString inFont:aFontId
+thOf:aString inFont:aFontId
 
 %{  /* NOCONTEXT */
 
@@ -5484,81 +5573,81 @@
     int nInstBytes;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aFontId)
-	 && __isNonNilObject(aString)) {
-	    f = _FontVal(aFontId);
-	    if (! f) goto fail;
-
-	    cls = __qClass(aString);
-
-	    cp = (char *)_stringVal(aString);
-
-	    if ((cls == @global(String)) || (cls == @global(Symbol))) {
-		n = _stringSize(aString);
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth(f, cp, n);
-		END_INTERRUPTSBLOCKED
-		RETURN ( __MKSMALLINT(len) );
-	    }
-
-	    nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
-	    cp += nInstBytes;
-
-	    if (__isBytes(aString)) {
-		n = __byteArraySize(aString) - nInstBytes;
-
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth(f, cp, n);
-		END_INTERRUPTSBLOCKED
-		RETURN ( __MKSMALLINT(len) );
-	    }
-
-	    /* TWOBYTESTRINGS */
-	    if (__isWords(aString)) {
-		union {
-		    char b[2];
-		    unsigned short s;
-		} u;
-		int i;
-		XChar2b *cp2;
-		int mustFree = 0;
-
-		n = (__byteArraySize(aString) - nInstBytes) / 2;
-		if (n > 1000) n = 1000;
-
-		/*
-		 * ST/X TwoByteStrings store the asciiValue in native byteOrder;
-		 * X expects them MSB first
-		 * convert as required
-		 */
-
-		u.s = 0x1234;
-		if (u.b[0] != 0x12) {
-		    if (n <= NLOCALBUFFER) {
-			cp2 = xlatebuffer;
-		    } else {
-			cp2 = (XChar2b *)(malloc(n * 2));
-			mustFree = 1;
-		    }
-
-		    for (i=0; i<n; i++) {
-			cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
-			cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
-		    }
-		    cp = (char *) cp2;
-		}
-
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth16(f, (XChar2b *)cp, n);
-		END_INTERRUPTSBLOCKED
-
-		if (mustFree) {
-		    free(cp2);
-		}
-
-		RETURN ( __MKSMALLINT(len) );
-	    }
-	}
+        if (__isExternalAddress(aFontId)
+         && __isNonNilObject(aString)) {
+            f = _FontVal(aFontId);
+            if (! f) goto fail;
+
+            cls = __qClass(aString);
+
+            cp = (char *)_stringVal(aString);
+
+            if ((cls == @global(String)) || (cls == @global(Symbol))) {
+                n = _stringSize(aString);
+                BEGIN_INTERRUPTSBLOCKED
+                len = XTextWidth(f, cp, n);
+                END_INTERRUPTSBLOCKED
+                RETURN ( __MKSMALLINT(len) );
+            }
+
+            nInstBytes = __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars));
+            cp += nInstBytes;
+
+            if (__isBytes(aString)) {
+                n = __byteArraySize(aString) - nInstBytes;
+
+                BEGIN_INTERRUPTSBLOCKED
+                len = XTextWidth(f, cp, n);
+                END_INTERRUPTSBLOCKED
+                RETURN ( __MKSMALLINT(len) );
+            }
+
+            /* TWOBYTESTRINGS */
+            if (__isWords(aString)) {
+                union {
+                    char b[2];
+                    unsigned short s;
+                } u;
+                int i;
+                XChar2b *cp2;
+                int mustFree = 0;
+
+                n = (__byteArraySize(aString) - nInstBytes) / 2;
+                if (n > 1000) n = 1000;
+
+                /*
+                 * ST/X TwoByteStrings store the asciiValue in native byteOrder;
+                 * X expects them MSB first
+                 * convert as required
+                 */
+
+                u.s = 0x1234;
+                if (u.b[0] != 0x12) {
+                    if (n <= NLOCALBUFFER) {
+                        cp2 = xlatebuffer;
+                    } else {
+                        cp2 = (XChar2b *)(malloc(n * 2));
+                        mustFree = 1;
+                    }
+
+                    for (i=0; i<n; i++) {
+                        cp2[i].byte1 = (((XChar2b *)cp)[i]).byte2;
+                        cp2[i].byte2 = (((XChar2b *)cp)[i]).byte1;
+                    }
+                    cp = (char *) cp2;
+                }
+
+                BEGIN_INTERRUPTSBLOCKED
+                len = XTextWidth16(f, (XChar2b *)cp, n);
+                END_INTERRUPTSBLOCKED
+
+                if (mustFree) {
+                    free(cp2);
+                }
+
+                RETURN ( __MKSMALLINT(len) );
+            }
+        }
     }
 #undef NLOCALBUFFER
   fail: ;
@@ -5569,97 +5658,97 @@
 
 !XWorkstation methodsFor:'grabbing '!
 
-allowEvents:mode
+owEvents:mode
 %{  /* NOCONTEXT */
 
     int _mode, ok = 1;
 
     if (mode == @symbol(asyncPointer))
-	_mode = AsyncPointer;
+        _mode = AsyncPointer;
     else if (mode == @symbol(syncPointer))
-	_mode = SyncPointer;
+        _mode = SyncPointer;
     else if (mode == @symbol(asyncKeyboard))
-	_mode = AsyncKeyboard;
+        _mode = AsyncKeyboard;
     else if (mode == @symbol(syncKeyboard))
-	_mode = SyncKeyboard;
+        _mode = SyncKeyboard;
     else if (mode == @symbol(syncBoth))
-	_mode = SyncBoth;
+        _mode = SyncBoth;
     else if (mode == @symbol(asyncBoth))
-	_mode = AsyncBoth;
+        _mode = AsyncBoth;
     else if (mode == @symbol(replayPointer))
-	_mode = ReplayPointer;
+        _mode = ReplayPointer;
     else if (mode == @symbol(replayKeyboard))
-	_mode = ReplayKeyboard;
+        _mode = ReplayKeyboard;
     else
-	ok = 0;
+        ok = 0;
 
     if (ok) {
-	if (ISCONNECTED) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    XAllowEvents(myDpy, _mode, CurrentTime);
-	    END_INTERRUPTSBLOCKED
-	    RETURN (self);
-	}
+        if (ISCONNECTED) {
+            BEGIN_INTERRUPTSBLOCKED
+            XAllowEvents(myDpy, _mode, CurrentTime);
+            END_INTERRUPTSBLOCKED
+            RETURN (self);
+        }
     }
 %}.
     self primitiveFailed
 !
 
-grabKeyboardIn:aWindowId
+bKeyboardIn:aWindowId
     "grab the keyboard"
 
 %{  /* NOCONTEXT */
     int result, ok;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)) {
-	    BEGIN_INTERRUPTSBLOCKED
-	    result = XGrabKeyboard(myDpy,
-				   _WindowVal(aWindowId),
-				   True /* False */,
-				   GrabModeAsync,
-				   GrabModeAsync,
-				   CurrentTime);
-	    END_INTERRUPTSBLOCKED
-	    ok = 0;
-	    switch(result) {
-		case AlreadyGrabbed: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab keyboard: AlreadyGrabbed\n");
-		    }
-		    break;
-		case GrabNotViewable: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab keyboard: GrabNotViewable\n");
-		    }
-		    break;
-		case GrabInvalidTime: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab keyboard: InvalidTime\n");
-		    }
-		    break;
-		case GrabFrozen: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab keyboard: Frozen\n");
-		    }
-		    break;
-		default:
-		    ok = 1;
-		    break;
-	    }
-	    if (! ok) {
-		XUngrabKeyboard(myDpy, CurrentTime);
-		RETURN (false);
-	    }
-
-	    RETURN ( true );
-	}
+        if (__isExternalAddress(aWindowId)) {
+            BEGIN_INTERRUPTSBLOCKED
+            result = XGrabKeyboard(myDpy,
+                                   _WindowVal(aWindowId),
+                                   True /* False */,
+                                   GrabModeAsync,
+                                   GrabModeAsync,
+                                   CurrentTime);
+            END_INTERRUPTSBLOCKED
+            ok = 0;
+            switch(result) {
+                case AlreadyGrabbed: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab keyboard: AlreadyGrabbed\n");
+                    }
+                    break;
+                case GrabNotViewable: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab keyboard: GrabNotViewable\n");
+                    }
+                    break;
+                case GrabInvalidTime: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab keyboard: InvalidTime\n");
+                    }
+                    break;
+                case GrabFrozen: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab keyboard: Frozen\n");
+                    }
+                    break;
+                default:
+                    ok = 1;
+                    break;
+            }
+            if (! ok) {
+                XUngrabKeyboard(myDpy, CurrentTime);
+                RETURN (false);
+            }
+
+            RETURN ( true );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-grabPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
+bPointerIn:aWindowId withCursor:aCursorId pointerMode:pMode keyboardMode:kMode confineTo:confineId
     "grap the pointer - return true if ok"
 
 %{  /* NOCONTEXT */
@@ -5670,101 +5759,101 @@
     int pointer_mode, keyboard_mode;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)) {
-	    if (__isExternalAddress(confineId)) 
-		confineWin = _WindowVal(confineId);
-	    else
-		confineWin = (Window) None;
-
-	    if (__isExternalAddress(aCursorId)) 
-		curs = _CursorVal(aCursorId);
-	    else
-		curs = (Cursor) None;
-
-	    if (pMode == @symbol(sync))
-		pointer_mode = GrabModeSync;
-	    else
-		pointer_mode = GrabModeAsync;
-
-	    if (kMode == @symbol(sync))
-		keyboard_mode = GrabModeSync;
-	    else
-		keyboard_mode = GrabModeAsync;
-
-	    BEGIN_INTERRUPTSBLOCKED
-	    result = XGrabPointer(myDpy,
-				  _WindowVal(aWindowId), 
-				  False, 
-				  ButtonPressMask | ButtonMotionMask | ButtonReleaseMask,
-				  pointer_mode, keyboard_mode,
-				  confineWin,
-				  curs,
-				  CurrentTime);
-	    END_INTERRUPTSBLOCKED
-
-	    ok = 0;
-	    switch (result) {
-		case AlreadyGrabbed: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab pointer: AlreadyGrabbed\n");
-		    }
-		    break;
-		case GrabNotViewable: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab pointer: GrabNotViewable\n");
-		    }
-		    break;
-		case GrabInvalidTime: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab pointer: InvalidTime\n");
-		    }
-		    break;
-		case GrabFrozen: 
-		    if (@global(ErrorPrinting) == true) {
-			fprintf(stderr, "XWorkstation [warning]: grab pointer: Frozen\n");
-		    }
-		    break;
-		default:
-		    ok = 1;
-		    break;
-	    }
-
-	    if (! ok) {
-		XUngrabPointer(myDpy, CurrentTime);
-		RETURN (false);
-	    }
-	    RETURN ( true );
-	}
+        if (__isExternalAddress(aWindowId)) {
+            if (__isExternalAddress(confineId)) 
+                confineWin = _WindowVal(confineId);
+            else
+                confineWin = (Window) None;
+
+            if (__isExternalAddress(aCursorId)) 
+                curs = _CursorVal(aCursorId);
+            else
+                curs = (Cursor) None;
+
+            if (pMode == @symbol(sync))
+                pointer_mode = GrabModeSync;
+            else
+                pointer_mode = GrabModeAsync;
+
+            if (kMode == @symbol(sync))
+                keyboard_mode = GrabModeSync;
+            else
+                keyboard_mode = GrabModeAsync;
+
+            BEGIN_INTERRUPTSBLOCKED
+            result = XGrabPointer(myDpy,
+                                  _WindowVal(aWindowId), 
+                                  False, 
+                                  ButtonPressMask | ButtonMotionMask | ButtonReleaseMask,
+                                  pointer_mode, keyboard_mode,
+                                  confineWin,
+                                  curs,
+                                  CurrentTime);
+            END_INTERRUPTSBLOCKED
+
+            ok = 0;
+            switch (result) {
+                case AlreadyGrabbed: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab pointer: AlreadyGrabbed\n");
+                    }
+                    break;
+                case GrabNotViewable: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab pointer: GrabNotViewable\n");
+                    }
+                    break;
+                case GrabInvalidTime: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab pointer: InvalidTime\n");
+                    }
+                    break;
+                case GrabFrozen: 
+                    if (@global(ErrorPrinting) == true) {
+                        fprintf(stderr, "XWorkstation [warning]: grab pointer: Frozen\n");
+                    }
+                    break;
+                default:
+                    ok = 1;
+                    break;
+            }
+
+            if (! ok) {
+                XUngrabPointer(myDpy, CurrentTime);
+                RETURN (false);
+            }
+            RETURN ( true );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-ungrabKeyboard
+rabKeyboard
     "release the keyboard"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XUngrabKeyboard(myDpy, CurrentTime);
-	XSync(myDpy, 0);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XUngrabKeyboard(myDpy, CurrentTime);
+        XSync(myDpy, 0);
+        END_INTERRUPTSBLOCKED
     }
 %}.
     activeKeyboardGrab := nil
 !
 
-ungrabPointer
+rabPointer
     "release the pointer"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XUngrabPointer(myDpy, CurrentTime);
-	XSync(myDpy, 0);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XUngrabPointer(myDpy, CurrentTime);
+        XSync(myDpy, 0);
+        END_INTERRUPTSBLOCKED
     }
 %}.
     activePointerGrab := nil
@@ -5772,7 +5861,7 @@
 
 !XWorkstation methodsFor:'graphic context stuff'!
 
-noClipIn:aGCId
+lipIn:aGCId
     "disable clipping rectangle"
 
 %{  /* NOCONTEXT */
@@ -5781,34 +5870,34 @@
     GC gc;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    gcv.clip_mask = None;
-	    XChangeGC(myDpy, gc, GCClipMask, &gcv);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            gcv.clip_mask = None;
+            XChangeGC(myDpy, gc, GCClipMask, &gcv);
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setBackground:bgColorIndex in:aGCId
+Background:bgColorIndex in:aGCId
     "set background color to be drawn with"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __isSmallInteger(bgColorIndex)) {
-	    XSetBackground(myDpy, _GCVal(aGCId), __intVal(bgColorIndex));
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __isSmallInteger(bgColorIndex)) {
+            XSetBackground(myDpy, _GCVal(aGCId), __intVal(bgColorIndex));
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setBitmapMask:aBitmapId in:aGCId
+BitmapMask:aBitmapId in:aGCId
     "set or clear the drawing mask - a bitmap mask using current fg/bg"
 
 %{  /* NOCONTEXT */
@@ -5817,27 +5906,27 @@
     Pixmap bitmap;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (__isExternalAddress(aBitmapId)) {
-		bitmap = _PixmapVal(aBitmapId);
-		XSetStipple(dpy, gc, bitmap);
-		XSetFillStyle(dpy, gc, FillOpaqueStippled);
-		RETURN ( self );
-	    }
-	    if (aBitmapId == nil) {
-		XSetFillStyle(dpy, gc, FillSolid);
-		RETURN ( self );
-	    }
-	}
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (__isExternalAddress(aBitmapId)) {
+                bitmap = _PixmapVal(aBitmapId);
+                XSetStipple(dpy, gc, bitmap);
+                XSetFillStyle(dpy, gc, FillOpaqueStippled);
+                RETURN ( self );
+            }
+            if (aBitmapId == nil) {
+                XSetFillStyle(dpy, gc, FillSolid);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setClipByChildren:aBool in:aGCId
+ClipByChildren:aBool in:aGCId
     "enable/disable drawing into child views"
 
 %{  /* NOCONTEXT */
@@ -5846,22 +5935,22 @@
     GC gc;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (aBool == true)
-		gcv.subwindow_mode = ClipByChildren;
-	    else
-		gcv.subwindow_mode = IncludeInferiors;
-
-	    XChangeGC(myDpy, gc, GCSubwindowMode, &gcv);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (aBool == true)
+                gcv.subwindow_mode = ClipByChildren;
+            else
+                gcv.subwindow_mode = IncludeInferiors;
+
+            XChangeGC(myDpy, gc, GCSubwindowMode, &gcv);
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setClipX:clipX y:clipY width:clipWidth height:clipHeight in:aGCId
+ClipX:clipX y:clipY width:clipWidth height:clipHeight in:aGCId
     "clip to a rectangle"
 
 %{  /* NOCONTEXT */
@@ -5869,36 +5958,36 @@
     XRectangle r;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __bothSmallInteger(clipX, clipY)
-	 && __bothSmallInteger(clipWidth, clipHeight)) {
-	    r.x = __intVal(clipX);
-	    r.y = __intVal(clipY);
-	    r.width = __intVal(clipWidth);
-	    r.height = __intVal(clipHeight);
-	    XSetClipRectangles(myDpy, _GCVal(aGCId), 0, 0, &r, 1, Unsorted);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __bothSmallInteger(clipX, clipY)
+         && __bothSmallInteger(clipWidth, clipHeight)) {
+            r.x = __intVal(clipX);
+            r.y = __intVal(clipY);
+            r.width = __intVal(clipWidth);
+            r.height = __intVal(clipHeight);
+            XSetClipRectangles(myDpy, _GCVal(aGCId), 0, 0, &r, 1, Unsorted);
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setDashes:dashList dashOffset:offset in:aGCId
+Dashes:dashList dashOffset:offset in:aGCId
     "set line attributes"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __isSmallInteger(offset)
-	 && __isByteArray(dashList)) {
-	    XSetDashes(myDpy, _GCVal(aGCId), 
-		       __intVal(offset),
-		       __ByteArrayInstPtr(dashList)->ba_element,
-		       __byteArraySize(dashList));
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __isSmallInteger(offset)
+         && __isByteArray(dashList)) {
+            XSetDashes(myDpy, _GCVal(aGCId), 
+                       __intVal(offset),
+                       __ByteArrayInstPtr(dashList)->ba_element,
+                       __byteArraySize(dashList));
+            RETURN ( self );
+        }
     }
 bad: ;
 %}.
@@ -5910,7 +5999,7 @@
     self primitiveFailed
 !
 
-setFont:aFontId in:aGCId
+Font:aFontId in:aGCId
     "set font to be drawn in"
 
 %{  /* NOCONTEXT */
@@ -5918,12 +6007,12 @@
     XFontStruct *f;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aFontId)
-	 && __isExternalAddress(aGCId)) {
-	    f = (XFontStruct *) _FontVal(aFontId);
-	    XSetFont(myDpy, _GCVal(aGCId), f->fid);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aFontId)
+         && __isExternalAddress(aGCId)) {
+            f = (XFontStruct *) _FontVal(aFontId);
+            XSetFont(myDpy, _GCVal(aGCId), f->fid);
+            RETURN ( self );
+        }
     }
 %}.
     "
@@ -5932,7 +6021,7 @@
     self primitiveFailed
 !
 
-setForeground:fgColorIndex background:bgColorIndex in:aGCId
+Foreground:fgColorIndex background:bgColorIndex in:aGCId
     "set foreground and background colors to be drawn with"
 
 %{  /* NOCONTEXT */
@@ -5940,21 +6029,21 @@
     GC gc;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-	if (__bothSmallInteger(fgColorIndex, bgColorIndex)
-	 && __isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-
-	    XSetForeground(dpy, gc, __intVal(fgColorIndex));
-	    XSetBackground(dpy, gc, __intVal(bgColorIndex));
-	    RETURN ( self );
-	}
+        Display *dpy = myDpy;
+        if (__bothSmallInteger(fgColorIndex, bgColorIndex)
+         && __isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+
+            XSetForeground(dpy, gc, __intVal(fgColorIndex));
+            XSetBackground(dpy, gc, __intVal(bgColorIndex));
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setForeground:fgColor background:bgColor mask:aBitmapId in:aGCId
+Foreground:fgColor background:bgColor mask:aBitmapId in:aGCId
     "set foreground and background colors to be drawn with using mask or
      solid (if aBitmapId is nil)"
 
@@ -5963,31 +6052,31 @@
     GC gc;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (__isSmallInteger(fgColor))
-		XSetForeground(dpy, gc, __intVal(fgColor));
-	    if (__isSmallInteger(bgColor))
-		XSetBackground(dpy, gc, __intVal(bgColor));
-
-	    if (__isExternalAddress(aBitmapId)) {
-		XSetStipple(dpy, gc, _PixmapVal(aBitmapId));
-		XSetFillStyle(dpy, gc, FillOpaqueStippled);
-		RETURN ( self );
-	    }
-	    if (aBitmapId == nil) {
-		XSetFillStyle(dpy, gc, FillSolid);
-		RETURN ( self );
-	    }
-	}
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (__isSmallInteger(fgColor))
+                XSetForeground(dpy, gc, __intVal(fgColor));
+            if (__isSmallInteger(bgColor))
+                XSetBackground(dpy, gc, __intVal(bgColor));
+
+            if (__isExternalAddress(aBitmapId)) {
+                XSetStipple(dpy, gc, _PixmapVal(aBitmapId));
+                XSetFillStyle(dpy, gc, FillOpaqueStippled);
+                RETURN ( self );
+            }
+            if (aBitmapId == nil) {
+                XSetFillStyle(dpy, gc, FillSolid);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setForeground:fgColor background:bgColor mask:aBitmapId lineWidth:lw in:aGCId
+Foreground:fgColor background:bgColor mask:aBitmapId lineWidth:lw in:aGCId
     "set foreground and background colors to be drawn with using mask or
      solid (if aBitmapId is nil); also set lineWidth"
 
@@ -5996,51 +6085,51 @@
     GC gc;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (__isSmallInteger(lw)) {
-		XSetLineAttributes(dpy, gc, __intVal(lw),
-					LineSolid, CapNotLast, JoinMiter);
-	    }
-	    if (__isSmallInteger(fgColor))
-		XSetForeground(dpy, gc, __intVal(fgColor));
-	    if (__isSmallInteger(bgColor))
-		XSetBackground(dpy, gc, __intVal(bgColor));
-
-	    if (__isExternalAddress(aBitmapId)) {
-		XSetStipple(dpy, gc, _PixmapVal(aBitmapId));
-		XSetFillStyle(dpy, gc, FillOpaqueStippled);
-		RETURN ( self );
-	    }
-	    if (aBitmapId == nil) {
-		XSetFillStyle(dpy, gc, FillSolid);
-		RETURN ( self );
-	    }
-	}
+        Display *dpy = myDpy;
+
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (__isSmallInteger(lw)) {
+                XSetLineAttributes(dpy, gc, __intVal(lw),
+                                        LineSolid, CapNotLast, JoinMiter);
+            }
+            if (__isSmallInteger(fgColor))
+                XSetForeground(dpy, gc, __intVal(fgColor));
+            if (__isSmallInteger(bgColor))
+                XSetBackground(dpy, gc, __intVal(bgColor));
+
+            if (__isExternalAddress(aBitmapId)) {
+                XSetStipple(dpy, gc, _PixmapVal(aBitmapId));
+                XSetFillStyle(dpy, gc, FillOpaqueStippled);
+                RETURN ( self );
+            }
+            if (aBitmapId == nil) {
+                XSetFillStyle(dpy, gc, FillSolid);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setForeground:fgColorIndex in:aGCId
+Foreground:fgColorIndex in:aGCId
     "set foreground color to be drawn with"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __isSmallInteger(fgColorIndex)) {
-	    XSetForeground(myDpy, _GCVal(aGCId), __intVal(fgColorIndex));
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __isSmallInteger(fgColorIndex)) {
+            XSetForeground(myDpy, _GCVal(aGCId), __intVal(fgColorIndex));
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setFunction:aFunctionSymbol in:aGCId
+Function:aFunctionSymbol in:aGCId
     "set alu function to be drawn with"
 
 %{  /* NOCONTEXT */
@@ -6049,22 +6138,22 @@
     int fun = -1;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (aFunctionSymbol == @symbol(copy)) fun = GXcopy;
-	    else if (aFunctionSymbol == @symbol(copyInverted)) fun = GXcopyInverted;
-	    else if (aFunctionSymbol == @symbol(xor)) fun = GXxor;
-	    else if (aFunctionSymbol == @symbol(and)) fun = GXand;
-	    else if (aFunctionSymbol == @symbol(andReverse)) fun = GXandReverse;
-	    else if (aFunctionSymbol == @symbol(andInverted)) fun = GXandInverted;
-	    else if (aFunctionSymbol == @symbol(or)) fun = GXor;
-	    else if (aFunctionSymbol == @symbol(orReverse)) fun = GXorReverse;
-	    else if (aFunctionSymbol == @symbol(orInverted)) fun = GXorInverted;
-	    if (fun != -1) {
-		XSetFunction(myDpy, gc, fun);
-		RETURN ( self );
-	    }
-	}
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (aFunctionSymbol == @symbol(copy)) fun = GXcopy;
+            else if (aFunctionSymbol == @symbol(copyInverted)) fun = GXcopyInverted;
+            else if (aFunctionSymbol == @symbol(xor)) fun = GXxor;
+            else if (aFunctionSymbol == @symbol(and)) fun = GXand;
+            else if (aFunctionSymbol == @symbol(andReverse)) fun = GXandReverse;
+            else if (aFunctionSymbol == @symbol(andInverted)) fun = GXandInverted;
+            else if (aFunctionSymbol == @symbol(or)) fun = GXor;
+            else if (aFunctionSymbol == @symbol(orReverse)) fun = GXorReverse;
+            else if (aFunctionSymbol == @symbol(orInverted)) fun = GXorInverted;
+            if (fun != -1) {
+                XSetFunction(myDpy, gc, fun);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     "
@@ -6075,23 +6164,23 @@
     self primitiveFailed
 !
 
-setGraphicsExposures:aBoolean in:aGCId
+GraphicsExposures:aBoolean in:aGCId
     "set or clear the graphics exposures flag"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    XSetGraphicsExposures(myDpy, _GCVal(aGCId), (aBoolean==true)?1:0);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)) {
+            XSetGraphicsExposures(myDpy, _GCVal(aGCId), (aBoolean==true)?1:0);
+            RETURN ( self );
+        }
     }
 %}
 .
     self primitiveFailed
 !
 
-setLineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
+LineWidth:aNumber style:lineStyle cap:capStyle join:joinStyle in:aGCId
     "set line attributes"
 
 %{  /* NOCONTEXT */
@@ -6099,29 +6188,29 @@
     int x_style, x_cap, x_join;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)
-	 && __isSmallInteger(aNumber)) {
-	    if (lineStyle == @symbol(solid)) x_style = LineSolid;
-	    else if (lineStyle == @symbol(dashed)) x_style = LineOnOffDash;
-	    else if (lineStyle == @symbol(doubleDashed)) x_style = LineDoubleDash;
-	    else  goto bad;
-
-	    if (capStyle == @symbol(notLast)) x_cap = CapNotLast;
-	    else if (capStyle == @symbol(butt)) x_cap = CapButt;
-	    else if (capStyle == @symbol(round)) x_cap  = CapRound;
-	    else if (capStyle == @symbol(projecting)) x_cap  = CapProjecting;
-	    else  goto bad;
-
-	    if (joinStyle == @symbol(miter)) x_join = JoinMiter;
-	    else if (joinStyle == @symbol(bevel)) x_join = JoinBevel;
-	    else if (joinStyle == @symbol(round)) x_join  = JoinRound;
-	    else  goto bad;
-
-	    XSetLineAttributes(myDpy,
-			       _GCVal(aGCId), __intVal(aNumber),
-			       x_style, x_cap, x_join);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aGCId)
+         && __isSmallInteger(aNumber)) {
+            if (lineStyle == @symbol(solid)) x_style = LineSolid;
+            else if (lineStyle == @symbol(dashed)) x_style = LineOnOffDash;
+            else if (lineStyle == @symbol(doubleDashed)) x_style = LineDoubleDash;
+            else  goto bad;
+
+            if (capStyle == @symbol(notLast)) x_cap = CapNotLast;
+            else if (capStyle == @symbol(butt)) x_cap = CapButt;
+            else if (capStyle == @symbol(round)) x_cap  = CapRound;
+            else if (capStyle == @symbol(projecting)) x_cap  = CapProjecting;
+            else  goto bad;
+
+            if (joinStyle == @symbol(miter)) x_join = JoinMiter;
+            else if (joinStyle == @symbol(bevel)) x_join = JoinBevel;
+            else if (joinStyle == @symbol(round)) x_join  = JoinRound;
+            else  goto bad;
+
+            XSetLineAttributes(myDpy,
+                               _GCVal(aGCId), __intVal(aNumber),
+                               x_style, x_cap, x_join);
+            RETURN ( self );
+        }
     }
 bad: ;
 %}.
@@ -6134,22 +6223,22 @@
     self primitiveFailed
 !
 
-setMaskOriginX:orgX y:orgY in:aGCid
+MaskOriginX:orgX y:orgY in:aGCid
     "set the mask origin"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__bothSmallInteger(orgX, orgY) && __isExternalAddress(aGCid)) {
-	    XSetTSOrigin(myDpy, _GCVal(aGCid), __intVal(orgX), __intVal(orgY));
-	    RETURN ( self );
-	}
+        if (__bothSmallInteger(orgX, orgY) && __isExternalAddress(aGCid)) {
+            XSetTSOrigin(myDpy, _GCVal(aGCid), __intVal(orgX), __intVal(orgY));
+            RETURN ( self );
+        }
     }
 %}.
     self primitiveFailed
 !
 
-setPixmapMask:aPixmapId in:aGCId
+PixmapMask:aPixmapId in:aGCId
     "set or clear the drawing mask - a pixmap mask providing full color"
 
 %{  /* NOCONTEXT */
@@ -6159,19 +6248,19 @@
     Pixmap pixmap;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aGCId)) {
-	    gc = _GCVal(aGCId);
-	    if (__isExternalAddress(aPixmapId)) {
-		pixmap = _PixmapVal(aPixmapId);
-		XSetTile(dpy, gc, pixmap);
-		XSetFillStyle(dpy, gc, FillTiled);
-		RETURN ( self );
-	    }
-	    if (aPixmapId == nil) {
-		XSetFillStyle(dpy, gc, FillSolid);
-		RETURN ( self );
-	    }
-	}
+        if (__isExternalAddress(aGCId)) {
+            gc = _GCVal(aGCId);
+            if (__isExternalAddress(aPixmapId)) {
+                pixmap = _PixmapVal(aPixmapId);
+                XSetTile(dpy, gc, pixmap);
+                XSetFillStyle(dpy, gc, FillTiled);
+                RETURN ( self );
+            }
+            if (aPixmapId == nil) {
+                XSetFillStyle(dpy, gc, FillSolid);
+                RETURN ( self );
+            }
+        }
     }
 %}.
     self primitiveFailed
@@ -6179,41 +6268,41 @@
 
 !XWorkstation methodsFor:'initialize / release'!
 
-closeConnection
+seConnection
     "close down the connection to the X-server"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
-	__INST(displayId) = nil;
-	XCloseDisplay(dpy);
-	END_INTERRUPTSBLOCKED
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
+        __INST(displayId) = nil;
+        XCloseDisplay(dpy);
+        END_INTERRUPTSBLOCKED
     }
 %}
 !
 
-initializeDefaultValues
+tializeDefaultValues
     buttonTranslation := ButtonTranslation.
     multiClickTimeDelta := MultiClickTimeDelta.
 
     self initializeModifierMappings
 !
 
-initializeEventBuffer
+tializeEventBuffer
     |sz|
 
 %{
     sz = __MKSMALLINT(sizeof(XEvent) + 100);
 %}.
     eventBuffer isNil ifTrue:[
-	eventBuffer := ByteArray new:sz.
+        eventBuffer := ByteArray new:sz.
     ].
 !
 
-initializeFor:aDisplayName
+tializeFor:aDisplayName
     "initialize the receiver for a connection to an X-Server;
      the argument, aDisplayName may be nil (for the default server from
      DISPLAY-variable or command line argument) or the name of the server 
@@ -6223,13 +6312,13 @@
 
     dpyName := aDisplayName.
     dpyName isNil ifTrue:[
-	"look for a '-display xxx' argument"
-	(arguments := Smalltalk commandLineArguments) notNil ifTrue:[
-	    index := arguments indexOf:'-display'.
-	    (index between:1 and:(arguments size - 1)) ifTrue:[
-		dpyName := arguments at:index+1
-	    ]
-	]
+        "look for a '-display xxx' argument"
+        (arguments := Smalltalk commandLineArguments) notNil ifTrue:[
+            index := arguments indexOf:'-display'.
+            (index between:1 and:(arguments size - 1)) ifTrue:[
+                dpyName := arguments at:index+1
+            ]
+        ]
     ].
 %{
     int scr;
@@ -6246,38 +6335,38 @@
     OBJ dpyID;
 
     if (__INST(displayId) != nil) {
-	/*
-	 * already connected - you bad guy try to
-	 * trick me manually ?
-	 */
-	RETURN ( self );
+        /*
+         * already connected - you bad guy try to
+         * trick me manually ?
+         */
+        RETURN ( self );
     }
 
     BEGIN_INTERRUPTSBLOCKED
 
     if (__isString(dpyName))
-	nm = (char *)_stringVal(dpyName);
+        nm = (char *)_stringVal(dpyName);
     else {
-	dpyName = __MKSTRING((char *)getenv("DISPLAY"));
-	nm = NULL;
+        dpyName = __MKSTRING((char *)getenv("DISPLAY"));
+        nm = NULL;
     }
     dpy = XOpenDisplay(nm);
 
     if (dpy) {
-	__INST(displayId) = dpyID = __MKOBJ(dpy); __STORE(self, dpyID);
+        __INST(displayId) = dpyID = __MKOBJ(dpy); __STORE(self, dpyID);
 
 #ifdef SUPERDEBUG
-	XSynchronize(dpy, 1);
+        XSynchronize(dpy, 1);
 #endif
 
-	XSetErrorHandler(__XErrorHandler__);
+        XSetErrorHandler(__XErrorHandler__);
     }
 
     END_INTERRUPTSBLOCKED
 %}.
     displayId isNil ifTrue:[
-	'XWorkstation [warning]: cannot connect to Display.' errorPrintCR.
-	^ nil
+        'XWorkstation [warning]: cannot connect to Display.' errorPrintCR.
+        ^ nil
     ].
 
     dispatching := false.
@@ -6306,7 +6395,7 @@
     ObjectMemory registerErrorInterruptHandler:self class forID:#DisplayError.
 !
 
-initializeModifierMappings
+tializeModifierMappings
     |map mod|
 
 "/    altModifiers := #(Alt_L Alt_R).
@@ -6319,46 +6408,46 @@
 
     map := self modifierMapping.
     map isNil ifTrue:[
-	"/
-	"/ mhmh - a crippled Xlib which does not provide modifier mappings
-	"/ setup some reasonable default. If that is not sufficient,
-	"/ you have to change things from your display.rc file.
-	"/
-	altModifierMask := self modifier1Mask.
-	metaModifierMask := self modifier2Mask.
-
-	shiftModifiers := #(Shift_L Shift_R Shift).
-	ctrlModifiers := #(Control_L Control_R Control).
-	metaModifiers := #(Alt_L Meta_L Meta_R Meta).
-	altModifiers := #(Alt_R Alt).
+        "/
+        "/ mhmh - a crippled Xlib which does not provide modifier mappings
+        "/ setup some reasonable default. If that is not sufficient,
+        "/ you have to change things from your display.rc file.
+        "/
+        altModifierMask := self modifier1Mask.
+        metaModifierMask := self modifier2Mask.
+
+        shiftModifiers := #(Shift_L Shift_R Shift).
+        ctrlModifiers := #(Control_L Control_R Control).
+        metaModifiers := #(Alt_L Meta_L Meta_R Meta).
+        altModifiers := #(Alt_R Alt).
     ] ifFalse:[
-	altModifierMask := 0.
-	metaModifierMask := 0.
-
-	mod := map at:1.
-	mod notNil ifTrue:[
-	    shiftModifiers := mod collect:[ :key | self stringFromKeycode:key ].
-	].
-	mod := map at:3.
-	mod notNil ifTrue:[
-	    ctrlModifiers  := mod collect:[ :key | self stringFromKeycode:key ].
-	].
-	mod := map at:4.
-	mod notNil ifTrue:[
-	    metaModifiers  := mod collect:[ :key | self stringFromKeycode:key ].    
-	    metaModifierMask := 1 bitShift:(4-1).
-	].
-	mod := map at:5.
-	mod notNil ifTrue:[
-	    altModifiers   := mod collect:[ :key | self stringFromKeycode:key ].    
-	    altModifierMask := 1 bitShift:(5-1).
-	]
+        altModifierMask := 0.
+        metaModifierMask := 0.
+
+        mod := map at:1.
+        mod notNil ifTrue:[
+            shiftModifiers := mod collect:[ :key | self stringFromKeycode:key ].
+        ].
+        mod := map at:3.
+        mod notNil ifTrue:[
+            ctrlModifiers  := mod collect:[ :key | self stringFromKeycode:key ].
+        ].
+        mod := map at:4.
+        mod notNil ifTrue:[
+            metaModifiers  := mod collect:[ :key | self stringFromKeycode:key ].    
+            metaModifierMask := 1 bitShift:(4-1).
+        ].
+        mod := map at:5.
+        mod notNil ifTrue:[
+            altModifiers   := mod collect:[ :key | self stringFromKeycode:key ].    
+            altModifierMask := 1 bitShift:(5-1).
+        ]
     ].
 
     "Modified: 1.12.1995 / 23:44:40 / stefan"
 !
 
-initializeScreenProperties
+tializeScreenProperties
     super initializeScreenProperties.
 
 %{  /* NOCONTEXT */
@@ -6379,221 +6468,221 @@
     int mask, shift, nBits;
 
     if (ISCONNECTED) {
-	dpy = myDpy;
-
-	__INST(altModifierMask) = __MKSMALLINT(Mod2Mask);
-	__INST(metaModifierMask) = __MKSMALLINT(Mod1Mask);
-
-	BEGIN_INTERRUPTSBLOCKED
-
-	__INST(screen) = __MKSMALLINT(scr = DefaultScreen(dpy));
-	__INST(depth) = __MKSMALLINT(DisplayPlanes(dpy, scr));
-	__INST(ncells) = __MKSMALLINT(DisplayCells(dpy, scr));
-	__INST(width) = __MKSMALLINT(DisplayWidth(dpy, scr));
-	__INST(height) = __MKSMALLINT(DisplayHeight(dpy, scr));
-	__INST(widthMM) = __MKSMALLINT(DisplayWidthMM(dpy, scr));
-	__INST(heightMM) = __MKSMALLINT(DisplayHeightMM(dpy, scr));
-	__INST(blackpixel) = __MKSMALLINT(BlackPixel(dpy, scr));
-	__INST(whitepixel) = __MKSMALLINT(WhitePixel(dpy, scr));
+        dpy = myDpy;
+
+        __INST(altModifierMask) = __MKSMALLINT(Mod2Mask);
+        __INST(metaModifierMask) = __MKSMALLINT(Mod1Mask);
+
+        BEGIN_INTERRUPTSBLOCKED
+
+        __INST(screen) = __MKSMALLINT(scr = DefaultScreen(dpy));
+        __INST(depth) = __MKSMALLINT(DisplayPlanes(dpy, scr));
+        __INST(ncells) = __MKSMALLINT(DisplayCells(dpy, scr));
+        __INST(width) = __MKSMALLINT(DisplayWidth(dpy, scr));
+        __INST(height) = __MKSMALLINT(DisplayHeight(dpy, scr));
+        __INST(widthMM) = __MKSMALLINT(DisplayWidthMM(dpy, scr));
+        __INST(heightMM) = __MKSMALLINT(DisplayHeightMM(dpy, scr));
+        __INST(blackpixel) = __MKSMALLINT(BlackPixel(dpy, scr));
+        __INST(whitepixel) = __MKSMALLINT(WhitePixel(dpy, scr));
 
 #ifdef SHAPE
-	if (XShapeQueryExtension(dpy, &dummy, &dummy))
-	    __INST(hasShapeExtension) = true;
-	else
+        if (XShapeQueryExtension(dpy, &dummy, &dummy))
+            __INST(hasShapeExtension) = true;
+        else
 #endif
-	  __INST(hasShapeExtension) = false;
+          __INST(hasShapeExtension) = false;
 
 #ifdef SHM
-	if (XQueryExtension(dpy, "MIT_SHM", &dummy, &dummy, &dummy))
-	    __INST(hasShmExtension) = true;
-	else
+        if (XQueryExtension(dpy, "MIT_SHM", &dummy, &dummy, &dummy))
+            __INST(hasShmExtension) = true;
+        else
 #endif
-	  __INST(hasShmExtension) = false;
+          __INST(hasShmExtension) = false;
 
 #ifdef DPS
-	if (XQueryExtension(dpy, "DPSExtension", &dummy, &dummy, &dummy))
-	    __INST(hasDPSExtension) = true;
-	else
+        if (XQueryExtension(dpy, "DPSExtension", &dummy, &dummy, &dummy))
+            __INST(hasDPSExtension) = true;
+        else
 #endif
-	  __INST(hasDPSExtension) = false;
+          __INST(hasDPSExtension) = false;
 
 #ifdef XVIDEO
-	if (XQueryExtension(dpy, "XVideo", &dummy, &dummy, &dummy))
-	    __INST(hasXVideoExtension) = true;
-	else
+        if (XQueryExtension(dpy, "XVideo", &dummy, &dummy, &dummy))
+            __INST(hasXVideoExtension) = true;
+        else
 #endif
-	  __INST(hasXVideoExtension) = false;
+          __INST(hasXVideoExtension) = false;
 
 #ifdef MBUF
-	if (XQueryExtension(dpy, "Multi-Buffering", &dummy, &dummy, &dummy))
-	    __INST(hasMbufExtension) = true;
-	else
+        if (XQueryExtension(dpy, "Multi-Buffering", &dummy, &dummy, &dummy))
+            __INST(hasMbufExtension) = true;
+        else
 #endif
-	  __INST(hasMbufExtension) = false;
+          __INST(hasMbufExtension) = false;
 
 #ifdef PEX5
-	if (XQueryExtension(dpy, PEX_NAME_STRING, &dummy, &dummy, &dummy))
-	    __INST(hasPEXExtension) = true;
-	else
+        if (XQueryExtension(dpy, PEX_NAME_STRING, &dummy, &dummy, &dummy))
+            __INST(hasPEXExtension) = true;
+        else
 #endif
-	  __INST(hasPEXExtension) = false;
+          __INST(hasPEXExtension) = false;
 
 #ifdef XIE
-	if (XQueryExtension(dpy, xieExtName, &dummy, &dummy, &dummy))
-	    __INST(hasImageExtension) = true;
-	else
+        if (XQueryExtension(dpy, xieExtName, &dummy, &dummy, &dummy))
+            __INST(hasImageExtension) = true;
+        else
 #endif
-	  __INST(hasImageExtension) = false;
+          __INST(hasImageExtension) = false;
 
 #ifdef XI
-	if (XQueryExtension(dpy, "XInputExtension", &dummy, &dummy, &dummy))
-	    __INST(hasInputExtension) = true;
-	else
+        if (XQueryExtension(dpy, "XInputExtension", &dummy, &dummy, &dummy))
+            __INST(hasInputExtension) = true;
+        else
 #endif
-	  __INST(hasInputExtension) = false;
-
-	/*
-	 * look for RGB visual
-	 */
-	nvi = 0;
-	viproto.screen = scr;
-	vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
-	maxRGBDepth = 0;
-	for (i = 0; i < nvi; i++) {
-	    switch (vip[i].class) {
-		case TrueColor:
-		    if (vip[i].depth > maxRGBDepth) {
-			maxRGBDepth = vip[i].depth;
-			rgbRedMask = vip[i].red_mask;
-			rgbGreenMask = vip[i].green_mask;
-			rgbBlueMask = vip[i].blue_mask;
-			rgbVisualID = vip[i].visualid;
-		    }
-		    break;
-	    }
-	}
-	if (vip) XFree ((char *) vip);
-
-	if (maxRGBDepth) {
-	    __INST(rgbVisual) = __MKOBJ(rgbVisualID); __STORESELF(rgbVisual);
-	}
-
-	visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(dpy));
-	__INST(monitorType) = @symbol(unknown);
-	__INST(hasColors) = true;
-	__INST(hasGreyscales) = true;
-	switch (visual->class) {
-	    case StaticGray:
-		__INST(visualType) = @symbol(StaticGray);
-		__INST(hasColors) = false;
-		__INST(monitorType) = @symbol(monochrome);
-		break;
-	    case GrayScale:
-		__INST(visualType) = @symbol(GrayScale);
-		__INST(hasColors) = false;
-		__INST(monitorType) = @symbol(monochrome);
-		break;
-	    case StaticColor:
-		__INST(visualType) = @symbol(StaticColor);
-		break;
-	    case PseudoColor:
-		__INST(visualType) = @symbol(PseudoColor);
-		break;
-	    case TrueColor:
-		__INST(visualType) = @symbol(TrueColor);
-		break;
-	    case DirectColor:
-		__INST(visualType) = @symbol(DirectColor);
-		break;
-	}
-	if (DisplayCells(dpy, scr) == 2) {
-	    __INST(hasColors) = false;
-	    __INST(hasGreyscales) = false;
-	    __INST(monitorType) = @symbol(monochrome);
-	}
-	__INST(bitsPerRGB) = __MKSMALLINT(visual->bits_per_rgb);
-	__INST(redMask)   = __MKSMALLINT(visual->red_mask);
-	__INST(greenMask) = __MKSMALLINT(visual->green_mask);
-	__INST(blueMask)  = __MKSMALLINT(visual->blue_mask);
-	switch (visual->class) {
-	    case TrueColor:
-		/* extract number of bits and shift counts */
-		mask = visual->red_mask;
-		shift = 0;
-		while (mask && ((mask & 1) == 0)) {
-		    mask >>= 1;
-		    shift++;
-		}
-		__INST(redShift) = __MKSMALLINT(shift);
-		nBits = 0;
-		while (mask) {
-		    mask >>= 1;
-		    nBits++;
-		}
-		__INST(bitsRed) = __MKSMALLINT(nBits);
-
-		mask = visual->green_mask;
-		shift = 0;
-		while (mask && ((mask & 1) == 0)) {
-		    mask >>= 1;
-		    shift++;
-		}
-		__INST(greenShift) = __MKSMALLINT(shift);
-		nBits = 0;
-		while (mask) {
-		    mask >>= 1;
-		    nBits++;
-		}
-		__INST(bitsGreen) = __MKSMALLINT(nBits);
-
-		mask = visual->blue_mask;
-		shift = 0;
-		while (mask && ((mask & 1) == 0)) {
-		    mask >>= 1;
-		    shift++;
-		}
-		__INST(blueShift) = __MKSMALLINT(shift);
-		nBits = 0;
-		while (mask) {
-		    mask >>= 1;
-		    nBits++;
-		}
-		__INST(bitsBlue) = __MKSMALLINT(nBits);
-		break;
-	}
+          __INST(hasInputExtension) = false;
+
+        /*
+         * look for RGB visual
+         */
+        nvi = 0;
+        viproto.screen = scr;
+        vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
+        maxRGBDepth = 0;
+        for (i = 0; i < nvi; i++) {
+            switch (vip[i].class) {
+                case TrueColor:
+                    if (vip[i].depth > maxRGBDepth) {
+                        maxRGBDepth = vip[i].depth;
+                        rgbRedMask = vip[i].red_mask;
+                        rgbGreenMask = vip[i].green_mask;
+                        rgbBlueMask = vip[i].blue_mask;
+                        rgbVisualID = vip[i].visualid;
+                    }
+                    break;
+            }
+        }
+        if (vip) XFree ((char *) vip);
+
+        if (maxRGBDepth) {
+            __INST(rgbVisual) = __MKOBJ(rgbVisualID); __STORESELF(rgbVisual);
+        }
+
+        visual = DefaultVisualOfScreen(DefaultScreenOfDisplay(dpy));
+        __INST(monitorType) = @symbol(unknown);
+        __INST(hasColors) = true;
+        __INST(hasGreyscales) = true;
+        switch (visual->class) {
+            case StaticGray:
+                __INST(visualType) = @symbol(StaticGray);
+                __INST(hasColors) = false;
+                __INST(monitorType) = @symbol(monochrome);
+                break;
+            case GrayScale:
+                __INST(visualType) = @symbol(GrayScale);
+                __INST(hasColors) = false;
+                __INST(monitorType) = @symbol(monochrome);
+                break;
+            case StaticColor:
+                __INST(visualType) = @symbol(StaticColor);
+                break;
+            case PseudoColor:
+                __INST(visualType) = @symbol(PseudoColor);
+                break;
+            case TrueColor:
+                __INST(visualType) = @symbol(TrueColor);
+                break;
+            case DirectColor:
+                __INST(visualType) = @symbol(DirectColor);
+                break;
+        }
+        if (DisplayCells(dpy, scr) == 2) {
+            __INST(hasColors) = false;
+            __INST(hasGreyscales) = false;
+            __INST(monitorType) = @symbol(monochrome);
+        }
+        __INST(bitsPerRGB) = __MKSMALLINT(visual->bits_per_rgb);
+        __INST(redMask)   = __MKSMALLINT(visual->red_mask);
+        __INST(greenMask) = __MKSMALLINT(visual->green_mask);
+        __INST(blueMask)  = __MKSMALLINT(visual->blue_mask);
+        switch (visual->class) {
+            case TrueColor:
+                /* extract number of bits and shift counts */
+                mask = visual->red_mask;
+                shift = 0;
+                while (mask && ((mask & 1) == 0)) {
+                    mask >>= 1;
+                    shift++;
+                }
+                __INST(redShift) = __MKSMALLINT(shift);
+                nBits = 0;
+                while (mask) {
+                    mask >>= 1;
+                    nBits++;
+                }
+                __INST(bitsRed) = __MKSMALLINT(nBits);
+
+                mask = visual->green_mask;
+                shift = 0;
+                while (mask && ((mask & 1) == 0)) {
+                    mask >>= 1;
+                    shift++;
+                }
+                __INST(greenShift) = __MKSMALLINT(shift);
+                nBits = 0;
+                while (mask) {
+                    mask >>= 1;
+                    nBits++;
+                }
+                __INST(bitsGreen) = __MKSMALLINT(nBits);
+
+                mask = visual->blue_mask;
+                shift = 0;
+                while (mask && ((mask & 1) == 0)) {
+                    mask >>= 1;
+                    shift++;
+                }
+                __INST(blueShift) = __MKSMALLINT(shift);
+                nBits = 0;
+                while (mask) {
+                    mask >>= 1;
+                    nBits++;
+                }
+                __INST(bitsBlue) = __MKSMALLINT(nBits);
+                break;
+        }
 
 #ifndef XA_PRIMARY
-	__INST(primaryAtom) = __MKATOMOBJ( XInternAtom(dpy, "PRIMARY", True) );
+        __INST(primaryAtom) = __MKATOMOBJ( XInternAtom(dpy, "PRIMARY", True) );
 #else
-	__INST(primaryAtom) = __MKATOMOBJ( XA_PRIMARY );
+        __INST(primaryAtom) = __MKATOMOBJ( XA_PRIMARY );
 #endif
 #ifndef XA_SECONDARY
-	__INST(secondaryAtom) = __MKATOMOBJ( XInternAtom(dpy, "SECONDARY", True) );
+        __INST(secondaryAtom) = __MKATOMOBJ( XInternAtom(dpy, "SECONDARY", True) );
 #else
-	__INST(secondaryAtom) = __MKATOMOBJ( XA_SECONDARY );
+        __INST(secondaryAtom) = __MKATOMOBJ( XA_SECONDARY );
 #endif
 #ifndef XA_CUT_BUFFER0
-	__INST(cutBuffer0Atom) = __MKATOMOBJ( XInternAtom(dpy, "CUT_BUFFER0", True) );
+        __INST(cutBuffer0Atom) = __MKATOMOBJ( XInternAtom(dpy, "CUT_BUFFER0", True) );
 #else
-	__INST(cutBuffer0Atom) = __MKATOMOBJ( XA_CUT_BUFFER0 );
+        __INST(cutBuffer0Atom) = __MKATOMOBJ( XA_CUT_BUFFER0 );
 #endif
 #ifndef XA_STRING
-	__INST(stringAtom) = __MKATOMOBJ( XInternAtom(dpy, "STRING", True) );
+        __INST(stringAtom) = __MKATOMOBJ( XInternAtom(dpy, "STRING", True) );
 #else
-	__INST(stringAtom) = __MKATOMOBJ( XA_STRING );
+        __INST(stringAtom) = __MKATOMOBJ( XA_STRING );
 #endif
 #ifndef XA_LENGTH
-	__INST(lengthAtom) = __MKATOMOBJ( XInternAtom(dpy, "LENGTH", True) );
+        __INST(lengthAtom) = __MKATOMOBJ( XInternAtom(dpy, "LENGTH", True) );
 #else
-	__INST(lengthAtom) = __MKATOMOBJ( XA_LENGTH );
+        __INST(lengthAtom) = __MKATOMOBJ( XA_LENGTH );
 #endif
 
-	END_INTERRUPTSBLOCKED
+        END_INTERRUPTSBLOCKED
     }
 %}.
 !
 
-initializeSpecialFlags
+tializeSpecialFlags
     "perform additional special server implementation flags"
 
     "/
@@ -6603,15 +6692,15 @@
     ignoreBackingStore := false.
 
     (self serverVendor = 'X11/NeWS') ifTrue:[
-	"/
-	"/ this is a kludge around a bug in the X11/NeWS server,
-	"/ which does not correctly handle saveUnder
-	"/
-	hasSaveUnder := false.
+        "/
+        "/ this is a kludge around a bug in the X11/NeWS server,
+        "/ which does not correctly handle saveUnder
+        "/
+        hasSaveUnder := false.
     ].
 !
 
-reinitialize
+nitialize
     virtualRootId := rootId := nil.
     super reinitialize.
     dispatchingExpose := nil
@@ -6619,7 +6708,7 @@
 
 !XWorkstation methodsFor:'keyboard mapping'!
 
-altModifierMask
+ModifierMask
     "return the mask (in motionEvents) for the alt-key modifier.
      Notice: ST/X may use the left ALT key as CMD/Meta key,
      therefore return a variable here, which can be changed during startup."
@@ -6630,19 +6719,19 @@
     "Modified: 23.3.1996 / 12:44:56 / cg"
 !
 
-altModifierMask:aSmallInteger
+ModifierMask:aSmallInteger
     "define which key takes the role of an alt-key.
      By default, this is X's modifier1, which is the ALT key on
      most keyboards. However, there may be exceptions to this,
      and the setting can be changed with:
-	Display altModifierMask:(Display modifier2Mask)
+        Display altModifierMask:(Display modifier2Mask)
      Setting the mask to 0 disables the ALT key (in ST/X) altogether.
     "
 
     altModifierMask := aSmallInteger
 !
 
-metaModifierMask
+aModifierMask
     "return the mask (in motionEvents) for the meta-key modifier.
      Notice: ST/X may use the left ALT key as CMD/Meta key,
      therefore return a variable here, which can be changed during startup."
@@ -6653,13 +6742,13 @@
     "Modified: 23.3.1996 / 12:45:09 / cg"
 !
 
-metaModifierMask:aSmallInteger
+aModifierMask:aSmallInteger
     "define which key takes the role of a meta key.
      By default, this is X's modifier2, which is the 2nd ALT key on
      most keyboards (if present at all).
      However, there may be exceptions to this, and the setting can
      be changed with:
-	Display metaModifierMask:(Display modifier1Mask)
+        Display metaModifierMask:(Display modifier1Mask)
      Setting the mask to 0 disables the META key (in ST/X) altogether.
      As reported, some Xservers place the Meta-key onto NumLock,
      and having NumLock enabled makes ST/X think, that meta is pressed
@@ -6670,7 +6759,7 @@
     metaModifierMask := aSmallInteger
 !
 
-modifier1Mask
+ifier1Mask
     "return the Xlib mask bit for the 1st modifier key.
      See comment in altModifierMask: / metaModifierMask: for what
      this could be used."
@@ -6680,7 +6769,7 @@
 %}
 !
 
-modifier2Mask
+ifier2Mask
     "return the Xlib mask bit for the 2nd modifier key.
      See comment in altModifierMask: / metaModifierMask: for what
      this could be used."
@@ -6690,7 +6779,7 @@
 %}
 !
 
-modifierMapping
+ifierMapping
     "Get the Modifier Mapping.
      We return an array of arrays of keycodes"
 
@@ -6701,18 +6790,18 @@
     OBJ __BYTEARRAY_UNINITIALIZED_NEW_INT();
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if ((modmap = XGetModifierMapping(myDpy)) != 0) {
-	   maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
-	   modifierKeyMap = __BYTEARRAY_UNINITIALIZED_NEW_INT(modmap->max_keypermod * 8);
-	   if (modifierKeyMap != nil) {
-		maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
-		memcpy((char *)__ByteArrayInstPtr(modifierKeyMap)->ba_element, 
-		       (char *)modmap->modifiermap, modmap->max_keypermod * 8);
-	   }
-	   XFreeModifiermap(modmap);
-	}
+        Display *dpy = myDpy;
+
+        if ((modmap = XGetModifierMapping(myDpy)) != 0) {
+           maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
+           modifierKeyMap = __BYTEARRAY_UNINITIALIZED_NEW_INT(modmap->max_keypermod * 8);
+           if (modifierKeyMap != nil) {
+                maxKeyPerMod = __MKSMALLINT(modmap->max_keypermod);
+                memcpy((char *)__ByteArrayInstPtr(modifierKeyMap)->ba_element, 
+                       (char *)modmap->modifiermap, modmap->max_keypermod * 8);
+           }
+           XFreeModifiermap(modmap);
+        }
     }
 %}.
 
@@ -6721,28 +6810,28 @@
     ret := Array new:8.
     nextKey := 1.
     1 to:8 do:[ :i |
-	(modifierKeyMap at:nextKey) ~= 0 ifTrue:[
-	    |mod|
-
-	    mod := OrderedCollection new:maxKeyPerMod.
-	    modifierKeyMap from:nextKey to:(nextKey+maxKeyPerMod-1) do:[ :key |
-		key ~= 0 ifTrue:[
-		    mod add:key
-		].
-	    ].
-	    ret at:i put:mod.
-	].
-	nextKey := nextKey+maxKeyPerMod.
+        (modifierKeyMap at:nextKey) ~= 0 ifTrue:[
+            |mod|
+
+            mod := OrderedCollection new:maxKeyPerMod.
+            modifierKeyMap from:nextKey to:(nextKey+maxKeyPerMod-1) do:[ :key |
+                key ~= 0 ifTrue:[
+                    mod add:key
+                ].
+            ].
+            ret at:i put:mod.
+        ].
+        nextKey := nextKey+maxKeyPerMod.
     ].
 
     ^ ret
 
     "
-	Display modifierMapping
+        Display modifierMapping
     "
 !
 
-stringFromKeycode:code
+ingFromKeycode:code
     "Get a KeySymbol (a smalltalk symbol) from the keycode."
 
     |str|
@@ -6752,21 +6841,21 @@
     char *keystring;
 
     if (ISCONNECTED && __isSmallInteger(code)) {
-	Display *dpy = myDpy;
-
-	if ((keysym = XKeycodeToKeysym(myDpy, __intVal(code), 0)) != NoSymbol &&
-	    (keystring = XKeysymToString(keysym)) != 0) 
-	    str = __MKSTRING(keystring);
+        Display *dpy = myDpy;
+
+        if ((keysym = XKeycodeToKeysym(myDpy, __intVal(code), 0)) != NoSymbol &&
+            (keystring = XKeysymToString(keysym)) != 0) 
+            str = __MKSTRING(keystring);
     }
 %}.
     ^ str
 
     "
-	Display stringFromKeycode:28
+        Display stringFromKeycode:28
     "
 !
 
-translateKey:untranslatedKey
+nslateKey:untranslatedKey
     "Return the key translated via the translation table.
      Here, we preTranslate the key into a common ST/X symbolic name, 
      which gets further processed in the superclasses translation method."
@@ -6774,38 +6863,38 @@
     |key|
 
     (key := untranslatedKey) isString ifTrue:[
-	key := RawKeysymTranslation at:key ifAbsent:key.
-	key := key asSymbol.
+        key := RawKeysymTranslation at:key ifAbsent:key.
+        key := key asSymbol.
     ].
     ^ super translateKey:key 
 ! !
 
 !XWorkstation methodsFor:'misc'!
 
-beep
+p
     "output an audible beep or bell"
 
     self beep:50
 !
 
-beep:volumeInPercent
+p:volumeInPercent
     "output an audible beep"
 %{
     int volume;
 
     if (__isSmallInteger(volumeInPercent) && ISCONNECTED) {
-	/* stupid: X wants -100 .. 100 and calls this percent */
-	volume = __intVal(volumeInPercent) * 2 - 100;
-	if (volume < -100) volume = -100;
-	else if (volume > 100) volume = 100;
-	BEGIN_INTERRUPTSBLOCKED
-	XBell(myDpy, volume);
-	END_INTERRUPTSBLOCKED
+        /* stupid: X wants -100 .. 100 and calls this percent */
+        volume = __intVal(volumeInPercent) * 2 - 100;
+        if (volume < -100) volume = -100;
+        else if (volume > 100) volume = 100;
+        BEGIN_INTERRUPTSBLOCKED
+        XBell(myDpy, volume);
+        END_INTERRUPTSBLOCKED
     }
 %}
 !
 
-buffered
+fered
     "buffer drawing - do not send it immediately to the display.
      This is the default anyway.
      See #unBuffered for additional info."
@@ -6813,9 +6902,9 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XSynchronize(myDpy, 0);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XSynchronize(myDpy, 0);
+        END_INTERRUPTSBLOCKED
     }
 %}
     "
@@ -6823,7 +6912,7 @@
     "
 !
 
-flush
+sh
     "send all buffered drawing to the display.
      This may be required to make certain, that all previous operations
      are really sent to the display before continuing. For example,
@@ -6834,45 +6923,45 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XFlush(myDpy);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XFlush(myDpy);
+        END_INTERRUPTSBLOCKED
     }
 %}
 !
 
-flushDpsContext:aDPSContext
+shDpsContext:aDPSContext
 
 %{  /* NOCONTEXT */
 #ifdef DPS
     if (__isExternalAddress(aDPSContext)) {
-	BEGIN_INTERRUPTSBLOCKED
-	DPSFlushContext(MKDPSCONTEXT(aDPSContext));
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        BEGIN_INTERRUPTSBLOCKED
+        DPSFlushContext(MKDPSCONTEXT(aDPSContext));
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 #endif
 %}.
     self primitiveFailed
 !
 
-refreshKeyboardMapping:eB
+reshKeyboardMapping:eB
 %{
     XMappingEvent *ev;
 
     if (__isByteArray(eB)) {
-	ev = (XMappingEvent *)(__ByteArrayInstPtr(eB)->ba_element);
-	XRefreshKeyboardMapping(ev);
+        ev = (XMappingEvent *)(__ByteArrayInstPtr(eB)->ba_element);
+        XRefreshKeyboardMapping(ev);
     }
 %}
 !
 
-setInputFocusTo:aWindowId
+InputFocusTo:aWindowId
 "/    self setInputFocusTo:aWindowId revertTo:#parent
     self setInputFocusTo:aWindowId revertTo:#root
 !
 
-setInputFocusTo:aWindowId revertTo:revertSymbol
+InputFocusTo:aWindowId revertTo:revertSymbol
     "set the focus to the view as defined by aWindowId.
      Passing nil set the focus to no window and lets the display discard all
      input until a new focus is set.
@@ -6885,28 +6974,28 @@
     Window focusWindow;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)) {
-	    focusWindow = _WindowVal(aWindowId);
-	} else {
-	    focusWindow = None;
-	}
-	if (revertSymbol == @symbol(parent))
-	    arg = RevertToParent;
-	else if (revertSymbol == @symbol(root))
-	    arg = RevertToPointerRoot;
-	else 
-	    arg = RevertToNone;
-
-	BEGIN_INTERRUPTSBLOCKED
-	XSetInputFocus(myDpy, focusWindow, arg, CurrentTime);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        if (__isExternalAddress(aWindowId)) {
+            focusWindow = _WindowVal(aWindowId);
+        } else {
+            focusWindow = None;
+        }
+        if (revertSymbol == @symbol(parent))
+            arg = RevertToParent;
+        else if (revertSymbol == @symbol(root))
+            arg = RevertToPointerRoot;
+        else 
+            arg = RevertToNone;
+
+        BEGIN_INTERRUPTSBLOCKED
+        XSetInputFocus(myDpy, focusWindow, arg, CurrentTime);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-sync
+c
     "send all buffered drawing to the display AND wait until the display
      has finished drawing it.
      This is almost never needed, except if you are about to read previously
@@ -6916,14 +7005,14 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XSync(myDpy, 0);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XSync(myDpy, 0);
+        END_INTERRUPTSBLOCKED
     }
 %}
 !
 
-unBuffered
+uffered
     "make all drawing be sent immediately to the display.
      This makes all graphics synchronous and turns off any buffering
      (i.e. each individual draw-request is sent immediately without 
@@ -6936,9 +7025,9 @@
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	XSynchronize(myDpy, 1);
-	END_INTERRUPTSBLOCKED
+        BEGIN_INTERRUPTSBLOCKED
+        XSynchronize(myDpy, 1);
+        END_INTERRUPTSBLOCKED
     }
 %}
     "Display unbuffered"
@@ -6946,7 +7035,7 @@
 
 !XWorkstation methodsFor:'pointer queries '!
 
-anyButtonStateMask
+ButtonStateMask
     "return an integer for masking out any button from a
      buttonStates value."
 
@@ -6958,7 +7047,7 @@
     "Created: 23.3.1996 / 12:46:35 / cg"
 !
 
-buttonStates
+tonStates
     "return an integer representing the state of the pointer buttons;
      a one-bit in positions 0.. represent a pressed button.
      See the button1Mask/button2Mask/button3Mask,
@@ -6972,20 +7061,20 @@
     unsigned int mask;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
 #ifdef VIRTUAL_ROOT
-	w = getRootWindow(myDpy, screen);
+        w = getRootWindow(myDpy, screen);
 #else
-	w = RootWindow(dpy, screen);
+        w = RootWindow(dpy, screen);
 #endif
-	XQueryPointer(dpy, w, &rootRet, &childRet,
-			      &rootX, &rootY,
-			      &winX, &winY,
-			      &mask);
-	END_INTERRUPTSBLOCKED
-	RETURN (__MKSMALLINT(mask));
+        XQueryPointer(dpy, w, &rootRet, &childRet,
+                              &rootX, &rootY,
+                              &winX, &winY,
+                              &mask);
+        END_INTERRUPTSBLOCKED
+        RETURN (__MKSMALLINT(mask));
     }
 %}.
     self primitiveFailed
@@ -7006,7 +7095,7 @@
     "
 !
 
-leftButtonStateMask
+tButtonStateMask
     "return an integer for masking out the left button from a
      buttonStates value"
 
@@ -7017,7 +7106,7 @@
     "Modified: 23.3.1996 / 12:41:33 / cg"
 !
 
-middleButtonStateMask
+dleButtonStateMask
     "return an integer for masking out the middle button from a
      buttonStates value"
 
@@ -7028,7 +7117,7 @@
     "Modified: 23.3.1996 / 12:41:43 / cg"
 !
 
-pointerPosition
+nterPosition
     "return the current pointer position in root-window coordinates"
 
     |xpos ypos|
@@ -7041,28 +7130,28 @@
     unsigned int mask;
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	BEGIN_INTERRUPTSBLOCKED
+        Display *dpy = myDpy;
+
+        BEGIN_INTERRUPTSBLOCKED
 #ifdef VIRTUAL_ROOT
-	w = getRootWindow(myDpy, screen);
+        w = getRootWindow(myDpy, screen);
 #else
-	w = RootWindow(dpy, screen);
+        w = RootWindow(dpy, screen);
 #endif
-	XQueryPointer(dpy, w, &rootRet, &childRet,
-			      &rootX, &rootY,
-			      &winX, &winY,
-			      &mask);
-	xpos = __MKSMALLINT(rootX);
-	ypos = __MKSMALLINT(rootY);
-	END_INTERRUPTSBLOCKED
+        XQueryPointer(dpy, w, &rootRet, &childRet,
+                              &rootX, &rootY,
+                              &winX, &winY,
+                              &mask);
+        xpos = __MKSMALLINT(rootX);
+        ypos = __MKSMALLINT(rootY);
+        END_INTERRUPTSBLOCKED
     }
 %}
 .
     ^ xpos @ ypos
 !
 
-rightButtonStateMask
+htButtonStateMask
     "return an integer for masking out the right button from a
      buttonStates value"
 
@@ -7073,7 +7162,7 @@
     "Modified: 23.3.1996 / 12:41:52 / cg"
 !
 
-rootPositionOfLastEvent
+tPositionOfLastEvent
     "return the position in root-window coordinates
      of the last button, key or pointer event"
 
@@ -7082,7 +7171,7 @@
 
 !XWorkstation methodsFor:'resources'!
 
-atomIDOf:aStringOrSymbol
+mIDOf:aStringOrSymbol
     "return an Atoms ID; dont create if not already present.
      This is highly X specific and only for local use (with selections)."
 
@@ -7096,7 +7185,7 @@
     "Modified: 2.3.1996 / 15:09:29 / cg"
 !
 
-atomIDOf:aStringOrSymbol create:create
+mIDOf:aStringOrSymbol create:create
     "return an Atoms ID; if create is true, create it if not already present.
      This is highly X specific and only for local use (with selections)."
 
@@ -7104,15 +7193,15 @@
     Atom prop;
 
     if (ISCONNECTED) {
-	if (__isString(aStringOrSymbol)
-	 || __isSymbol(aStringOrSymbol)) {
-	    prop = XInternAtom(myDpy, _stringVal(aStringOrSymbol), 
-				      (create == true) ? False : True);
-	    if (prop == None) {
-		RETURN (nil);
-	    }
-	    RETURN ( __MKATOMOBJ(prop) );
-	}
+        if (__isString(aStringOrSymbol)
+         || __isSymbol(aStringOrSymbol)) {
+            prop = XInternAtom(myDpy, _stringVal(aStringOrSymbol), 
+                                      (create == true) ? False : True);
+            if (prop == None) {
+                RETURN (nil);
+            }
+            RETURN ( __MKATOMOBJ(prop) );
+        }
     }
 %}.
     self primitiveFailed.
@@ -7127,7 +7216,7 @@
     "
 !
 
-atomIDOfCUTBUFFER0
+mIDOfCUTBUFFER0
     "return the CUTBUFFER0 AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7136,7 +7225,7 @@
     "Modified: 2.3.1996 / 15:10:36 / cg"
 !
 
-atomIDOfLENGTH
+mIDOfLENGTH
     "return the LENGTH AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7145,7 +7234,7 @@
     "Modified: 2.3.1996 / 15:10:41 / cg"
 !
 
-atomIDOfPRIMARY
+mIDOfPRIMARY
     "return the PRIMARY AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7154,7 +7243,7 @@
     "Modified: 2.3.1996 / 15:10:49 / cg"
 !
 
-atomIDOfSECONDARY
+mIDOfSECONDARY
     "return the SECONDARY AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7163,7 +7252,7 @@
     "Modified: 2.3.1996 / 15:10:59 / cg"
 !
 
-atomIDOfSTRING
+mIDOfSTRING
     "return the STRING AtomID.
      This is highly X specific and only for local use (with selections)."
 
@@ -7172,7 +7261,7 @@
     "Modified: 2.3.1996 / 15:11:08 / cg"
 !
 
-atomName:anAtomID
+mName:anAtomID
     "given an AtomID, return its name.
      This is highly X specific and only for local use (with selections)."
 
@@ -7181,15 +7270,15 @@
     char *name;
 
     if (ISCONNECTED) {
-	if (__isAtomID(anAtomID)) {
-	    name = XGetAtomName(myDpy, _AtomVal(anAtomID));
-	    if (name == 0) {
-		RETURN (nil);
-	    }
-	    str = __MKSTRING(name);
-	    XFree(name);
-	    RETURN ( str );
-	}
+        if (__isAtomID(anAtomID)) {
+            name = XGetAtomName(myDpy, _AtomVal(anAtomID));
+            if (name == 0) {
+                RETURN (nil);
+            }
+            str = __MKSTRING(name);
+            XFree(name);
+            RETURN ( str );
+        }
     }
 %}.
     self primitiveFailed.
@@ -7207,17 +7296,17 @@
     "
 !
 
-getResource:name class:cls
+Resource:name class:cls
     "access the displays resource database for a default value
      of name in a resource class.
      This is highly X specific and  currently not used.
 
      Notice: 
-	we do not plan to use X's resources for ST/X's defaults,
-	styles or resources. This would make porting of applications
-	to different platforms much more difficult (Windows has no resource
-	database). If you stay within ST/X's resource files, these can be
-	easily transported to other platforms.
+        we do not plan to use X's resources for ST/X's defaults,
+        styles or resources. This would make porting of applications
+        to different platforms much more difficult (Windows has no resource
+        database). If you stay within ST/X's resource files, these can be
+        easily transported to other platforms.
 
      This method is provided for special applications which want to access
      existing X resources and are not planned to be ever ported to other
@@ -7229,34 +7318,34 @@
     if ((__isString(name) || __isSymbol(name))
      && (__isString(cls) || __isSymbol(cls))
      && ISCONNECTED) {
-	BEGIN_INTERRUPTSBLOCKED
-	rslt = XGetDefault(myDpy, (char *)_stringVal(cls),
-				  (char *)_stringVal(name));
-	END_INTERRUPTSBLOCKED
-	RETURN (rslt ? __MKSTRING(rslt) : nil );
+        BEGIN_INTERRUPTSBLOCKED
+        rslt = XGetDefault(myDpy, (char *)_stringVal(cls),
+                                  (char *)_stringVal(name));
+        END_INTERRUPTSBLOCKED
+        RETURN (rslt ? __MKSTRING(rslt) : nil );
     }
 %}.
     self primitiveFailed.
     ^ nil
 
     "if your ~/.Xdefaults contains an entry such as:
-	OpenWindows.Beep:       notices
+        OpenWindows.Beep:       notices
      the following returns 'notices'.
 
-	 Display getResource:'Beep' class:'OpenWindows'   
+         Display getResource:'Beep' class:'OpenWindows'   
 
      if your ~/.Xdefaults contains an entry such as:
-	*.beNiceToColormap:       false
+        *.beNiceToColormap:       false
      the following return 'false'.
 
-	 Display getResource:'beNiceToColormap' class:'any'  
-	 Display getResource:'beNiceToColormap' class:''  
+         Display getResource:'beNiceToColormap' class:'any'  
+         Display getResource:'beNiceToColormap' class:''  
     "
 ! !
 
 !XWorkstation methodsFor:'retrieving pixels'!
 
-getBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits
+BitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits
     "get bits from a drawable into the imageBits. The storage for the bits
      must be big enough for the data to fit. If ok, returns an array with some
      info and the bits in imageBits. The info contains the depth, bitOrder and
@@ -7266,35 +7355,35 @@
     |rawInfo info|
 
     ((w <= 0) or:[h <= 0]) ifTrue:[
-	self primitiveFailed.
-	^ nil
+        self primitiveFailed.
+        ^ nil
     ].
 
     rawInfo := Array new:8.
-		  "1 -> bit order"
-		  "2 -> depth"
-		  "3 -> bytes_per_line"
-		  "4 -> byte_order"
-		  "5 -> format"
-		  "6 -> bitmap_unit"
-		  "7 -> bitmap_pad"
-		  "8 -> bits_per_pixel"
+                  "1 -> bit order"
+                  "2 -> depth"
+                  "3 -> bytes_per_line"
+                  "4 -> byte_order"
+                  "5 -> format"
+                  "6 -> bitmap_unit"
+                  "7 -> bitmap_pad"
+                  "8 -> bits_per_pixel"
 
     "/ had to extract the getPixel call into a separate method, to specify
     "/ unlimitedStack (some implementations use alloca and require huge amounts
     "/ of temporary stack space
 
     (self primGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:rawInfo) ifTrue:[
-	info := IdentityDictionary new.
-	info at:#bitOrder put:(rawInfo at:1).
-	info at:#depth put:(rawInfo at:2).
-	info at:#bytesPerLine put:(rawInfo at:3).
-	info at:#byteOrder put:(rawInfo at:4).
-	info at:#format put:(rawInfo at:5).
-	info at:#bitmapUnit put:(rawInfo at:6).
-	info at:#bitmapPad put:(rawInfo at:7).
-	info at:#bitsPerPixel put:(rawInfo at:8).
-	^ info
+        info := IdentityDictionary new.
+        info at:#bitOrder put:(rawInfo at:1).
+        info at:#depth put:(rawInfo at:2).
+        info at:#bytesPerLine put:(rawInfo at:3).
+        info at:#byteOrder put:(rawInfo at:4).
+        info at:#format put:(rawInfo at:5).
+        info at:#bitmapUnit put:(rawInfo at:6).
+        info at:#bitmapPad put:(rawInfo at:7).
+        info at:#bitsPerPixel put:(rawInfo at:8).
+        ^ info
     ].
     "
      some error occured - either args are not smallintegers, imageBits is not a ByteArray
@@ -7303,7 +7392,7 @@
     ^ self primitiveFailed
 !
 
-getPixelX:x y:y from:aDrawableId
+PixelX:x y:y from:aDrawableId
     "return the pixel value at x/y; coordinates start at 0/0 for the upper left.
      Nil is returned for invalid coordinates or if any other problem arises."
 
@@ -7316,24 +7405,24 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aDrawableId) && __bothSmallInteger(x, y)) {
-	win = _WindowVal(aDrawableId);
-	xpos = __intVal(x);
-	ypos = __intVal(y);
-	if ((xpos < 0) || (ypos < 0)) {
-	    RETURN ( __MKSMALLINT(0) );
-	}
-	img = XGetImage(myDpy, win, xpos, ypos, 1, 1, (unsigned)~0, ZPixmap);
-	if (img != 0) {
-	    ret = XGetPixel(img, 0, 0);
-	    XDestroyImage(img);
-	    RETURN (  __MKSMALLINT(ret) );
-	}
+        win = _WindowVal(aDrawableId);
+        xpos = __intVal(x);
+        ypos = __intVal(y);
+        if ((xpos < 0) || (ypos < 0)) {
+            RETURN ( __MKSMALLINT(0) );
+        }
+        img = XGetImage(myDpy, win, xpos, ypos, 1, 1, (unsigned)~0, ZPixmap);
+        if (img != 0) {
+            ret = XGetPixel(img, 0, 0);
+            XDestroyImage(img);
+            RETURN (  __MKSMALLINT(ret) );
+        }
     }
 %}.
     ^ nil
 !
 
-primGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:info
+mGetBitsFrom:aDrawableId x:srcx y:srcy width:w height:h into:imageBits infoInto:info
     "since XGetImage may allocate huge amount of stack space 
      (some implementations use alloca), this must run with unlimited stack."
 
@@ -7349,74 +7438,74 @@
      && __bothSmallInteger(w, h)
      && __isArray(info)
      && __isByteArray(imageBits)) {
-	Display *dpy = myDpy;
-
-	win = _WindowVal(aDrawableId);
-	image = XGetImage(dpy, win, __intVal(srcx), __intVal(srcy),
-				    __intVal(w), __intVal(h),
-				    (unsigned)AllPlanes, ZPixmap);
-
-	if (! image) {
-	    RETURN ( false );
-	}
-
-	pad = image->bitmap_pad;
+        Display *dpy = myDpy;
+
+        win = _WindowVal(aDrawableId);
+        image = XGetImage(dpy, win, __intVal(srcx), __intVal(srcy),
+                                    __intVal(w), __intVal(h),
+                                    (unsigned)AllPlanes, ZPixmap);
+
+        if (! image) {
+            RETURN ( false );
+        }
+
+        pad = image->bitmap_pad;
 #ifdef SUPERDEBUG
-	printf("pad:%d depth:%d\n", image->bitmap_pad, image->depth);
+        printf("pad:%d depth:%d\n", image->bitmap_pad, image->depth);
 #endif
-	switch (image->depth) {
-	    case 1:
-	    case 2:
-	    case 4:
-	    case 8:
-	    case 16:
-	    case 24:
-	    case 32:
-		numBytes = image->bytes_per_line * image->height;
-		break;
-	    default:
-		/* unsupported depth ? */
-		printf("possibly unsupported depth:%d in primGetBits\n", image->depth);
-		numBytes = image->bytes_per_line * image->height;
-		break;
-	}
+        switch (image->depth) {
+            case 1:
+            case 2:
+            case 4:
+            case 8:
+            case 16:
+            case 24:
+            case 32:
+                numBytes = image->bytes_per_line * image->height;
+                break;
+            default:
+                /* unsupported depth ? */
+                printf("possibly unsupported depth:%d in primGetBits\n", image->depth);
+                numBytes = image->bytes_per_line * image->height;
+                break;
+        }
 
 #ifdef SUPERDEBUG
-	printf("bytes need:%d bytes given:%d\n", numBytes, __byteArraySize(imageBits));
+        printf("bytes need:%d bytes given:%d\n", numBytes, __byteArraySize(imageBits));
 #endif
 
-	if (numBytes > __byteArraySize(imageBits)) {
-	    /* imageBits too small */
-	    printf("provided byteArray too small\n");
-	    goto fail;
-	}
-	if (image->bitmap_bit_order == MSBFirst)
-	    __ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
-	else
-	    __ArrayInstPtr(info)->a_element[0] = @symbol(lsbFirst);
-	__ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(image->depth);
-	__ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(image->bytes_per_line);
-	if (image->byte_order == MSBFirst)
-	    __ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
-	else
-	    __ArrayInstPtr(info)->a_element[3] = @symbol(lsbFirst);
-	if (image->format == XYBitmap)
-	    __ArrayInstPtr(info)->a_element[4] = @symbol(XYBitmap);
-	else if (image->format == XYPixmap)
-	    __ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
-	else if (image->format == ZPixmap)
-	    __ArrayInstPtr(info)->a_element[4] = @symbol(ZPixmap);
+        if (numBytes > __byteArraySize(imageBits)) {
+            /* imageBits too small */
+            printf("provided byteArray too small\n");
+            goto fail;
+        }
+        if (image->bitmap_bit_order == MSBFirst)
+            __ArrayInstPtr(info)->a_element[0] = @symbol(msbFirst);
+        else
+            __ArrayInstPtr(info)->a_element[0] = @symbol(lsbFirst);
+        __ArrayInstPtr(info)->a_element[1] = __MKSMALLINT(image->depth);
+        __ArrayInstPtr(info)->a_element[2] = __MKSMALLINT(image->bytes_per_line);
+        if (image->byte_order == MSBFirst)
+            __ArrayInstPtr(info)->a_element[3] = @symbol(msbFirst);
+        else
+            __ArrayInstPtr(info)->a_element[3] = @symbol(lsbFirst);
+        if (image->format == XYBitmap)
+            __ArrayInstPtr(info)->a_element[4] = @symbol(XYBitmap);
+        else if (image->format == XYPixmap)
+            __ArrayInstPtr(info)->a_element[4] = @symbol(XYPixmap);
+        else if (image->format == ZPixmap)
+            __ArrayInstPtr(info)->a_element[4] = @symbol(ZPixmap);
         
-	__ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(image->bitmap_unit);
-	__ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(image->bitmap_pad);
-	__ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(image->bits_per_pixel);
-	bcopy(image->data, __ByteArrayInstPtr(imageBits)->ba_element, numBytes);
-	XDestroyImage(image);
-	RETURN ( true );
+        __ArrayInstPtr(info)->a_element[5] = __MKSMALLINT(image->bitmap_unit);
+        __ArrayInstPtr(info)->a_element[6] = __MKSMALLINT(image->bitmap_pad);
+        __ArrayInstPtr(info)->a_element[7] = __MKSMALLINT(image->bits_per_pixel);
+        bcopy(image->data, __ByteArrayInstPtr(imageBits)->ba_element, numBytes);
+        XDestroyImage(image);
+        RETURN ( true );
     }
 fail: 
     if (image) {
-	XDestroyImage(image);
+        XDestroyImage(image);
     }
 %}.
     ^ false
@@ -7424,21 +7513,21 @@
 
 !XWorkstation methodsFor:'selections'!
 
-getObjectProperty:propertyID from:aWindowID
+ObjectProperty:propertyID from:aWindowID
     "get an object property; return object or nil"
 
     self getProperty:propertyID from:aWindowID into:[:type :value |
-	type == stringAtom ifTrue:[
-	    ^ value
-	].
-	(value isMemberOf:ByteArray) ifTrue:[
-	    ^ (Object readBinaryFrom:(ReadStream on:value) onError:[nil])
-	]
+        type == stringAtom ifTrue:[
+            ^ value
+        ].
+        (value isMemberOf:ByteArray) ifTrue:[
+            ^ (Object readBinaryFrom:(ReadStream on:value) onError:[nil])
+        ]
     ].
     ^ nil
 !
 
-getProperty:propertyID from:aWindowID into:aTwoArgBlock
+Property:propertyID from:aWindowID into:aTwoArgBlock
     "get a property, evaluate aTwoArgBlock with typeID and value"
 
     |val typeID cls|
@@ -7456,92 +7545,92 @@
 #   define PROP_SIZE    2048
 
     if (ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	if (__isAtomID(propertyID)) {
-	    property = _AtomVal(propertyID);
-	    if (__isExternalAddress(aWindowID)) {
-		window = _WindowVal(aWindowID);
-	    } else {
-		window = DefaultRootWindow(dpy);
-	    }
-
-	    nread = 0;
-	    cp = 0;
+        Display *dpy = myDpy;
+
+        if (__isAtomID(propertyID)) {
+            property = _AtomVal(propertyID);
+            if (__isExternalAddress(aWindowID)) {
+                window = _WindowVal(aWindowID);
+            } else {
+                window = DefaultRootWindow(dpy);
+            }
+
+            nread = 0;
+            cp = 0;
 /*
-	    fprintf(stderr, "getProperty: ");
+            fprintf(stderr, "getProperty: ");
  */
-	    do {
-		if (XGetWindowProperty(dpy,window,property,nread/4,PROP_SIZE,False,
-				       AnyPropertyType,&actual_type,&actual_format,
-				       &nitems,&bytes_after,(unsigned char **)&data)
-		    != Success) {
-			ok = 0;
-			break;
-		}
-		typeID = __MKATOMOBJ(actual_type);
-		if (! cp) {
-		    cp = cp2 = (char *)malloc(nitems+1);
-		} else {
-		    cp = (char *)realloc(cp, nread + nitems + 1);
-		    cp2 = cp + nread;
-		}
-		if (! cp) {
-		    XFree(data);
-		    goto fail;
-		}
+            do {
+                if (XGetWindowProperty(dpy,window,property,nread/4,PROP_SIZE,False,
+                                       AnyPropertyType,&actual_type,&actual_format,
+                                       &nitems,&bytes_after,(unsigned char **)&data)
+                    != Success) {
+                        ok = 0;
+                        break;
+                }
+                typeID = __MKATOMOBJ(actual_type);
+                if (! cp) {
+                    cp = cp2 = (char *)malloc(nitems+1);
+                } else {
+                    cp = (char *)realloc(cp, nread + nitems + 1);
+                    cp2 = cp + nread;
+                }
+                if (! cp) {
+                    XFree(data);
+                    goto fail;
+                }
     
-		nread += nitems;
-		bcopy(data, cp2, nitems);
-		XFree(data);
+                nread += nitems;
+                bcopy(data, cp2, nitems);
+                XFree(data);
     /*
-		fprintf(stderr, "<nitems:%d bytes_after:%d>", nitems, bytes_after);
+                fprintf(stderr, "<nitems:%d bytes_after:%d>", nitems, bytes_after);
      */
-	    } while (bytes_after > 0);
+            } while (bytes_after > 0);
     /*
-	    fprintf(stderr, "\n");
+            fprintf(stderr, "\n");
      */
     
-	    if (ok) {
-		if (actual_type == XA_STRING) {
-		    cp[nread] = '\0';
-		    val = __MKSTRING_L(cp, nread);
-		} else {
-		    val = __new(nread + OHDR_SIZE);
-		    val->o_class = cls;
-		    bcopy(cp, __ByteArrayInstPtr(val)->ba_element, nread);
-		}
-	    }
-	    if (cp)
-		free(cp);
-	}
+            if (ok) {
+                if (actual_type == XA_STRING) {
+                    cp[nread] = '\0';
+                    val = __MKSTRING_L(cp, nread);
+                } else {
+                    val = __new(nread + OHDR_SIZE);
+                    val->o_class = cls;
+                    bcopy(cp, __ByteArrayInstPtr(val)->ba_element, nread);
+                }
+            }
+            if (cp)
+                free(cp);
+        }
     }
 fail: ;
 %}.
     typeID isNil ifTrue:[
-	^ false
+        ^ false
     ].
     aTwoArgBlock value:typeID value:val.
     ^ true
 !
 
-getSelectionFor:drawableId
+SelectionFor:drawableId
     "get the object selection -  either immediate, or asynchronous.
      Returns nil, if async request is on its way"
 
     |selProp sel|
 
     (self getSelectionOwnerOf:primaryAtom) isNil ifTrue:[
-	"no primary selection - use cut buffer"
-	sel := self getObjectProperty:cutBuffer0Atom from:nil.
-	^ sel
+        "no primary selection - use cut buffer"
+        sel := self getObjectProperty:cutBuffer0Atom from:nil.
+        ^ sel
     ].
     selProp := self atomIDOf:'ST_SELECTION' create:true.
     self requestObjectSelection:primaryAtom property:selProp for:drawableId.
     ^ nil
 !
 
-getSelectionOwnerOf:selectionAtomID
+SelectionOwnerOf:selectionAtomID
     "get the owner of a selection"
 
 %{  /* NOCONTEXT */
@@ -7549,54 +7638,54 @@
     Window window;
 
     if (__isAtomID(selectionAtomID) && ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	window = XGetSelectionOwner(dpy, _AtomVal(selectionAtomID));
-	RETURN ((window == None) ? nil : __MKOBJ(window));
+        Display *dpy = myDpy;
+
+        window = XGetSelectionOwner(dpy, _AtomVal(selectionAtomID));
+        RETURN ((window == None) ? nil : __MKOBJ(window));
     }
 %}.
      self primitiveFailed.
     ^ nil
 !
 
-getTextProperty:propertyID from:aWindowID
+TextProperty:propertyID from:aWindowID
     "get a text property; return string or nil"
 
     self getProperty:propertyID from:aWindowID into:[:type :value |
-	type == stringAtom ifTrue:[
-	    ^ value
-	]
+        type == stringAtom ifTrue:[
+            ^ value
+        ]
     ].
     ^ nil
 !
 
-getTextSelectionFor:drawableId
+TextSelectionFor:drawableId
     "get the text selection -  either immediate, or asynchronous.
      Returns nil, if async request is on its way"
 
     |selProp sel|
 
     (self getSelectionOwnerOf:primaryAtom) isNil ifTrue:[
-	"no primary selection - use cut buffer"
-	sel := self getTextProperty:cutBuffer0Atom from:nil.
-	^ sel
+        "no primary selection - use cut buffer"
+        sel := self getTextProperty:cutBuffer0Atom from:nil.
+        ^ sel
     ].
     selProp := self atomIDOf:'VT_SELECTION' create:true.
     self requestTextSelection:primaryAtom property:selProp for:drawableId.
     ^ nil
 !
 
-requestObjectSelection:selectionID property:propertyID for:aWindowId
+uestObjectSelection:selectionID property:propertyID for:aWindowId
     "ask the server to send us the selection - the view with ID aWindowID
      will later receive a SelectionNotify event for it."
 
     ^ self requestSelection:selectionID 
-		   property:propertyID 
-		   type:(self atomIDOf:'ST_OBJECT' create:true) 
-		   for:aWindowId
-!
-
-requestSelection:selectionID property:propertyID type:typeID for:aWindowId
+                   property:propertyID 
+                   type:(self atomIDOf:'ST_OBJECT' create:true) 
+                   for:aWindowId
+!
+
+uestSelection:selectionID property:propertyID type:typeID for:aWindowId
     "ask the server to send us the selection - the view with id aWindowID
      will later receive a SelectionNotify event for it (once the Xserver replies
      with the selections value)."
@@ -7609,20 +7698,20 @@
      && ISCONNECTED
      && __isSmallInteger(typeID)
      && __isAtomID(selectionID)) {
-	Display *dpy = myDpy;
-
-	if (XGetSelectionOwner(dpy, _AtomVal(selectionID)) == None) {
-	    /*
-	     * no owner of primary selection
-	     */
-	    RETURN (false);
-	}
-	/*
-	 * PRIMARY selection
-	 */
-	XConvertSelection(dpy, _AtomVal(selectionID), _AtomVal(typeID), 
-			       _AtomVal(propertyID), _WindowVal(aWindowId), CurrentTime);
-	RETURN (true);
+        Display *dpy = myDpy;
+
+        if (XGetSelectionOwner(dpy, _AtomVal(selectionID)) == None) {
+            /*
+             * no owner of primary selection
+             */
+            RETURN (false);
+        }
+        /*
+         * PRIMARY selection
+         */
+        XConvertSelection(dpy, _AtomVal(selectionID), _AtomVal(typeID), 
+                               _AtomVal(propertyID), _WindowVal(aWindowId), CurrentTime);
+        RETURN (true);
     }
 %}.
     self primitiveFailed.
@@ -7630,50 +7719,50 @@
 
     "
      Display requestSelection:(Display atomIDOf:'PRIMARY')
-		     property:(Display atomIDOf:'VT_SELECTION')
-			  for:0
+                     property:(Display atomIDOf:'VT_SELECTION')
+                          for:0
     "
 !
 
-requestTextSelection:selectionID property:propertyID for:aWindowId
+uestTextSelection:selectionID property:propertyID for:aWindowId
     "ask the server to send us the selection - the view with ID aWindowID
      will later receive a SelectionNotify event for it."
 
     ^ self requestSelection:selectionID 
-		   property:propertyID 
-		       type:stringAtom 
-			for:aWindowId
-!
-
-sendSelection:something property:propertyID target:targetID from:windowID to:requestorID
+                   property:propertyID 
+                       type:stringAtom 
+                        for:aWindowId
+!
+
+dSelection:something property:propertyID target:targetID from:windowID to:requestorID
     "send aString back from a SelectionRequest"
 
     self 
-	sendSelection:something 
-	selection:primaryAtom
-	property:propertyID 
-	target:targetID 
-	from:windowID 
-	to:requestorID
-!
-
-sendSelection:something selection:selectionID property:propertyID target:targetID from:windowID to:requestorID
+        sendSelection:something 
+        selection:primaryAtom
+        property:propertyID 
+        target:targetID 
+        from:windowID 
+        to:requestorID
+!
+
+dSelection:something selection:selectionID property:propertyID target:targetID from:windowID to:requestorID
     "send aString back from a SelectionRequest"
 
     self 
-	setProperty:propertyID 
-	type:targetID 
-	value:something 
-	for:requestorID.
+        setProperty:propertyID 
+        type:targetID 
+        value:something 
+        for:requestorID.
     self 
-	sendSelectionNotifySelection:selectionID 
-	property:propertyID 
-	target:targetID 
-	from:requestorID 
-	to:requestorID.
-!
-
-sendSelectionNotifySelection:selectionID property:propertyID target:targetID from:windowID to:requestorID
+        sendSelectionNotifySelection:selectionID 
+        property:propertyID 
+        target:targetID 
+        from:requestorID 
+        to:requestorID.
+!
+
+dSelectionNotifySelection:selectionID property:propertyID target:targetID from:windowID to:requestorID
     "send a selectionNotify back from a SelectionRequest"
 
 %{  /* NOCONTEXT */
@@ -7683,66 +7772,66 @@
      && ISCONNECTED
      && __isAtomID(targetID)
      && __isAtomID(selectionID)) {
-	Display *dpy = myDpy;
-	XEvent ev;
-	Window requestor = _WindowVal(requestorID);
-	Atom property = _AtomVal(propertyID);
-	Atom target = _AtomVal(targetID);
-	Atom selection = _AtomVal(selectionID);
-	Status result;
-
-	ev.xselection.type = SelectionNotify;
-	ev.xselection.selection = selection;
-	ev.xselection.target = target;
-	if (__isExternalAddress(windowID))
-	    ev.xselection.requestor = _WindowVal(windowID);
-	else
-	    ev.xselection.requestor = DefaultRootWindow(dpy);
-	ev.xselection.time = CurrentTime;
-	if (property == None)
-	    ev.xselection.property = target;
-	else
-	    ev.xselection.property = property;
-
-	DPRINTF(("sending SelectionNotify sel=%x prop=%x target=%x requestor=%x to %x\n",
-		ev.xselection.selection,
-		ev.xselection.property,
-		ev.xselection.target,
-		ev.xselection.requestor,
-		requestor));
-
-	result = XSendEvent(dpy, requestor, False, 0 , &ev);
-	if ((result == BadValue) || (result == BadWindow)) {
-	    DPRINTF(("bad status\n"));
-	    RETURN (false);
-	}
-	RETURN (true)
+        Display *dpy = myDpy;
+        XEvent ev;
+        Window requestor = _WindowVal(requestorID);
+        Atom property = _AtomVal(propertyID);
+        Atom target = _AtomVal(targetID);
+        Atom selection = _AtomVal(selectionID);
+        Status result;
+
+        ev.xselection.type = SelectionNotify;
+        ev.xselection.selection = selection;
+        ev.xselection.target = target;
+        if (__isExternalAddress(windowID))
+            ev.xselection.requestor = _WindowVal(windowID);
+        else
+            ev.xselection.requestor = DefaultRootWindow(dpy);
+        ev.xselection.time = CurrentTime;
+        if (property == None)
+            ev.xselection.property = target;
+        else
+            ev.xselection.property = property;
+
+        DPRINTF(("sending SelectionNotify sel=%x prop=%x target=%x requestor=%x to %x\n",
+                ev.xselection.selection,
+                ev.xselection.property,
+                ev.xselection.target,
+                ev.xselection.requestor,
+                requestor));
+
+        result = XSendEvent(dpy, requestor, False, 0 , &ev);
+        if ((result == BadValue) || (result == BadWindow)) {
+            DPRINTF(("bad status\n"));
+            RETURN (false);
+        }
+        RETURN (true)
     }
 %}.
     self primitiveFailed.
     ^ false
 !
 
-setLengthProperty:propertyID value:aNumber for:aWindowID
+LengthProperty:propertyID value:aNumber for:aWindowID
     ^ self setProperty:propertyID type:(self atomIDOfLENGTH) value:aNumber for:aWindowID
 !
 
-setObjectProperty:propertyID value:anObject for:aWindowID
+ObjectProperty:propertyID value:anObject for:aWindowID
     |s|
 
     (anObject isMemberOf:String) ifTrue:[
-	^ self setTextProperty:propertyID value:anObject for:aWindowID
+        ^ self setTextProperty:propertyID value:anObject for:aWindowID
     ].
     s := WriteStream on:(ByteArray new:200).
     anObject storeBinaryOn:s.
     ^ self 
-	setProperty:propertyID 
-	type:(self atomIDOf:'ST_OBJECT' create:true) 
-	value:(s contents) 
-	for:aWindowID
-!
-
-setProperty:propertyID type:typeID value:anObject for:aWindowID
+        setProperty:propertyID 
+        type:(self atomIDOf:'ST_OBJECT' create:true) 
+        value:(s contents) 
+        for:aWindowID
+!
+
+Property:propertyID type:typeID value:anObject for:aWindowID
 
 %{  /* UNLIMITEDSTACK */
 
@@ -7754,64 +7843,64 @@
      && __isAtomID(typeID) 
      && ISCONNECTED
      && (__isString(anObject) 
-	 || __isSmallInteger(anObject) 
-	 || __isSymbol(anObject) 
-	 || __isByteArray(anObject)
-	 || __isWords(anObject))) { 
-
-	Display *dpy = myDpy;
-
-	prop = _AtomVal(propertyID);
-	type = _AtomVal(typeID);
-	if (__isExternalAddress(aWindowID)) {
-	    window = _WindowVal(aWindowID);
-	} else {
-	    window = DefaultRootWindow(dpy);
-	}
-	if (__isSmallInteger(anObject)) {
-	    value = __intVal(anObject);
-	    XChangeProperty(dpy, window, prop, type, 32,
-			    PropModeReplace,
-			    (unsigned char *)(&value), sizeof(unsigned int));
-	} else {
-	    if (__isByteArray(anObject)) {
-		XChangeProperty(dpy, window, prop, type, 8,
-				PropModeReplace,
-				__ByteArrayInstPtr(anObject)->ba_element,
-				__byteArraySize(anObject));
-	    } else {
-		/* string or symbol or wordArray-like (16bit-string) object */
-		if (__isWords(__qClass(anObject))) {
-		    XChangeProperty(dpy, window, prop, XA_STRING, 16,
-				    PropModeReplace,
-				    __stringVal(anObject),
-				    __wordArraySize(anObject));
-		} else {
-		    XChangeProperty(dpy, window, prop, XA_STRING, 8,
-				    PropModeReplace,
-				    __stringVal(anObject),
-				    strlen(__stringVal(anObject)));
-		}
-	    }
-	}
-	RETURN (true);
+         || __isSmallInteger(anObject) 
+         || __isSymbol(anObject) 
+         || __isByteArray(anObject)
+         || __isWords(anObject))) { 
+
+        Display *dpy = myDpy;
+
+        prop = _AtomVal(propertyID);
+        type = _AtomVal(typeID);
+        if (__isExternalAddress(aWindowID)) {
+            window = _WindowVal(aWindowID);
+        } else {
+            window = DefaultRootWindow(dpy);
+        }
+        if (__isSmallInteger(anObject)) {
+            value = __intVal(anObject);
+            XChangeProperty(dpy, window, prop, type, 32,
+                            PropModeReplace,
+                            (unsigned char *)(&value), sizeof(unsigned int));
+        } else {
+            if (__isByteArray(anObject)) {
+                XChangeProperty(dpy, window, prop, type, 8,
+                                PropModeReplace,
+                                __ByteArrayInstPtr(anObject)->ba_element,
+                                __byteArraySize(anObject));
+            } else {
+                /* string or symbol or wordArray-like (16bit-string) object */
+                if (__isWords(__qClass(anObject))) {
+                    XChangeProperty(dpy, window, prop, XA_STRING, 16,
+                                    PropModeReplace,
+                                    __stringVal(anObject),
+                                    __wordArraySize(anObject));
+                } else {
+                    XChangeProperty(dpy, window, prop, XA_STRING, 8,
+                                    PropModeReplace,
+                                    __stringVal(anObject),
+                                    strlen(__stringVal(anObject)));
+                }
+            }
+        }
+        RETURN (true);
     }
 %}.
     ^ false
 !
 
-setSelection:anObject owner:aWindowId
+Selection:anObject owner:aWindowId
     "set the object selection, and make aWindowId be the owner.
      This can be used by other Smalltalk(X) applications only."
 
     (self setSelectionOwner:aWindowId of:primaryAtom) ifFalse:[
-	^ false
+        ^ false
     ].
 "/    ^ self setObjectProperty:cutBuffer0Atom value:anObject for:nil
     ^ true
 !
 
-setSelectionOwner:aWindowId of:selectionID
+SelectionOwner:aWindowId of:selectionID
     "set the owner of a selection; return false if failed"
 
 %{  /* NOCONTEXT */
@@ -7820,14 +7909,14 @@
     if (__isExternalAddress(aWindowId)
      && __isAtomID(selectionID)
      && ISCONNECTED) {
-	Display *dpy = myDpy;
-
-	win = _WindowVal(aWindowId);
-	XSetSelectionOwner(dpy, _AtomVal(selectionID), win, CurrentTime);
-	if (XGetSelectionOwner(dpy, _AtomVal(selectionID)) != win) {
-	    RETURN (false);
-	}
-	RETURN (true);
+        Display *dpy = myDpy;
+
+        win = _WindowVal(aWindowId);
+        XSetSelectionOwner(dpy, _AtomVal(selectionID), win, CurrentTime);
+        if (XGetSelectionOwner(dpy, _AtomVal(selectionID)) != win) {
+            RETURN (false);
+        }
+        RETURN (true);
     }
 %}
 .
@@ -7835,16 +7924,16 @@
     ^ nil
 !
 
-setTextProperty:propertyID value:aString for:aWindowID
+TextProperty:propertyID value:aString for:aWindowID
     ^ self setProperty:propertyID type:(self atomIDOfSTRING) value:aString for:aWindowID
 !
 
-setTextSelection:aString owner:aWindowId
+TextSelection:aString owner:aWindowId
     "set the text selection, and make aWindowId be the owner.
      This can be used by any other X application."
 
     (self setSelectionOwner:aWindowId of:primaryAtom) ifFalse:[
-	'XWorkstation [warning]: selection ownerchange failed' errorPrintCR.
+        'XWorkstation [warning]: selection ownerchange failed' errorPrintCR.
     ].
     ^ self setTextProperty:cutBuffer0Atom value:aString for:nil
 
@@ -7853,7 +7942,7 @@
 
 !XWorkstation methodsFor:'window stuff'!
 
-clearRectangleX:x y:y width:width height:height in:aWindowId
+arRectangleX:x y:y width:width height:height in:aWindowId
     "clear a rectangular area to viewbackground"
 
 %{  /* NOCONTEXT */
@@ -7861,42 +7950,42 @@
     int w, h;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)
-	 && __bothSmallInteger(x, y)
-	 && __bothSmallInteger(width, height)) {
-	    w = __intVal(width);
-	    h = __intVal(height);
-	    /*
-	     * need this check here: some servers simply dump core with bad args
-	     */
-	    if ((w >= 0) && (h >= 0)) {
-		XClearArea(myDpy, _WindowVal(aWindowId), __intVal(x), __intVal(y), w, h, 0);
-	    }
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aWindowId)
+         && __bothSmallInteger(x, y)
+         && __bothSmallInteger(width, height)) {
+            w = __intVal(width);
+            h = __intVal(height);
+            /*
+             * need this check here: some servers simply dump core with bad args
+             */
+            if ((w >= 0) && (h >= 0)) {
+                XClearArea(myDpy, _WindowVal(aWindowId), __intVal(x), __intVal(y), w, h, 0);
+            }
+            RETURN ( self );
+        }
     }
 %}
 .
     self primitiveFailed
 !
 
-clearWindow:aWindowId
+arWindow:aWindowId
     "clear a window to viewbackground"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)) {
-	    XClearWindow(myDpy, _WindowVal(aWindowId));
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aWindowId)) {
+            XClearWindow(myDpy, _WindowVal(aWindowId));
+            RETURN ( self );
+        }
     }
 %}
 .
     self primitiveFailed
 !
 
-configureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
+figureWindow:aWindowId sibling:siblingId stackMode:modeSymbol
     "configure stacking operation of aWindowId w.r.t siblingId"
 
 %{  /* NOCONTEXT */
@@ -7905,27 +7994,27 @@
     int mask = CWSibling | CWStackMode;
 
     if (ISCONNECTED) {
-	if (__isExternalAddress(aWindowId)
-	 && __isExternalAddress(siblingId)) {
-	    if (modeSymbol == @symbol(above)) {
-		chg.stack_mode = Above;
-	    } else if (modeSymbol == @symbol(below)) {
-		chg.stack_mode = Below;
-	    } else if (modeSymbol == @symbol(topIf)) {
-		chg.stack_mode = TopIf;
-	    } else if (modeSymbol == @symbol(bottomIf)) {
-		chg.stack_mode = BottomIf;
-	    } else if (modeSymbol == @symbol(opposite)) {
-		chg.stack_mode = Opposite;
-	    } else {
-		mask = CWSibling;
-	    }
-
-	    chg.sibling = _WindowVal(siblingId);
-	    XConfigureWindow(myDpy, _WindowVal(aWindowId),
-				    mask, &chg);
-	    RETURN ( self );
-	}
+        if (__isExternalAddress(aWindowId)
+         && __isExternalAddress(siblingId)) {
+            if (modeSymbol == @symbol(above)) {
+                chg.stack_mode = Above;
+            } else if (modeSymbol == @symbol(below)) {
+                chg.stack_mode = Below;
+            } else if (modeSymbol == @symbol(topIf)) {
+                chg.stack_mode = TopIf;
+            } else if (modeSymbol == @symbol(bottomIf)) {
+                chg.stack_mode = BottomIf;
+            } else if (modeSymbol == @symbol(opposite)) {
+                chg.stack_mode = Opposite;
+            } else {
+                mask = CWSibling;
+            }
+
+            chg.sibling = _WindowVal(siblingId);
+            XConfigureWindow(myDpy, _WindowVal(aWindowId),
+                                    mask, &chg);
+            RETURN ( self );
+        }
     }
 bad: ;
 %}
@@ -7933,36 +8022,36 @@
     self primitiveFailed
 !
 
-lowerWindow:aWindowId
+erWindow:aWindowId
     "bring a window to back"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	XLowerWindow(myDpy, _WindowVal(aWindowId));
-	RETURN ( self );
+        XLowerWindow(myDpy, _WindowVal(aWindowId));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-mapView:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos width:w height:h
+View:aView id:aWindowId iconified:aBoolean atX:xPos y:yPos width:w height:h
     "make a window visible - either as icon or as a real view - needed for restart"
 
     |wicon wiconId wiconView wiconViewId wlabel|
 
     aBoolean ifTrue:[
-	wicon := aView icon.
-	wicon notNil ifTrue:[
-	    wiconId := wicon id
-	].
-	wiconView := aView iconView.
-	wiconView notNil ifTrue:[
-	    wiconViewId := wiconView id
-	].
-	wlabel := aView label.
+        wicon := aView icon.
+        wicon notNil ifTrue:[
+            wiconId := wicon id
+        ].
+        wiconView := aView iconView.
+        wiconView notNil ifTrue:[
+            wiconViewId := wiconView id
+        ].
+        wlabel := aView label.
     ].
 %{  
 
@@ -7972,92 +8061,92 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	Display *dpy = myDpy;
-
-	win = _WindowVal(aWindowId);
-
-	szhints.flags = 0;
-	if (__bothSmallInteger(xPos, yPos)) {
-	    szhints.x = __intVal(xPos);
-	    szhints.y = __intVal(yPos);
-	    szhints.flags |= USPosition;
-	}
-	if (__bothSmallInteger(w, h)) {
-	    szhints.width = __intVal(w);
-	    szhints.height = __intVal(h);
-	    szhints.flags |= USSize;
-	}
-
-	if (aBoolean == true) {
-	    char *windowName;
-	    Pixmap iconBitmap = (Pixmap)0;
-	    Window iconWindow;
-
-	    if (__isExternalAddress(wiconId))
-		iconBitmap = _PixmapVal(wiconId);
-	    else
-		iconBitmap = (Pixmap)0;
-
-	    if (__isExternalAddress(wiconViewId))
-		iconWindow = _WindowVal(wiconViewId);
-	    else
-		iconWindow = (Window)0;
-
-	    if (__isString(wlabel) || __isSymbol(wlabel))
-		windowName = (char *)_stringVal(wlabel);
-	    else
-		windowName = "";
-
-	    if (iconBitmap || windowName) {
-		XSetStandardProperties(dpy, win,
-					windowName, windowName,
-					iconBitmap,
-					0, 0, &szhints);
-	    }
-
-	    wmhints.flags = 0;
-	    if (iconBitmap) {
-		wmhints.flags |= IconPixmapHint;
-		wmhints.icon_pixmap = iconBitmap;
-	    }
-	    if (iconWindow) {
-		wmhints.flags |= IconWindowHint;
-		wmhints.icon_window = iconWindow;
-	    }
-
-	    wmhints.initial_state = IconicState;
-	    wmhints.flags |= StateHint;
-	    XSetWMHints(dpy, win, &wmhints);
-	}
-
-	if (szhints.flags) {
-	    XSetNormalHints(dpy, win, &szhints);
-	}
-
-	XMapWindow(dpy, win);
-	RETURN ( self );
+        Display *dpy = myDpy;
+
+        win = _WindowVal(aWindowId);
+
+        szhints.flags = 0;
+        if (__bothSmallInteger(xPos, yPos)) {
+            szhints.x = __intVal(xPos);
+            szhints.y = __intVal(yPos);
+            szhints.flags |= USPosition;
+        }
+        if (__bothSmallInteger(w, h)) {
+            szhints.width = __intVal(w);
+            szhints.height = __intVal(h);
+            szhints.flags |= USSize;
+        }
+
+        if (aBoolean == true) {
+            char *windowName;
+            Pixmap iconBitmap = (Pixmap)0;
+            Window iconWindow;
+
+            if (__isExternalAddress(wiconId))
+                iconBitmap = _PixmapVal(wiconId);
+            else
+                iconBitmap = (Pixmap)0;
+
+            if (__isExternalAddress(wiconViewId))
+                iconWindow = _WindowVal(wiconViewId);
+            else
+                iconWindow = (Window)0;
+
+            if (__isString(wlabel) || __isSymbol(wlabel))
+                windowName = (char *)_stringVal(wlabel);
+            else
+                windowName = "";
+
+            if (iconBitmap || windowName) {
+                XSetStandardProperties(dpy, win,
+                                        windowName, windowName,
+                                        iconBitmap,
+                                        0, 0, &szhints);
+            }
+
+            wmhints.flags = 0;
+            if (iconBitmap) {
+                wmhints.flags |= IconPixmapHint;
+                wmhints.icon_pixmap = iconBitmap;
+            }
+            if (iconWindow) {
+                wmhints.flags |= IconWindowHint;
+                wmhints.icon_window = iconWindow;
+            }
+
+            wmhints.initial_state = IconicState;
+            wmhints.flags |= StateHint;
+            XSetWMHints(dpy, win, &wmhints);
+        }
+
+        if (szhints.flags) {
+            XSetNormalHints(dpy, win, &szhints);
+        }
+
+        XMapWindow(dpy, win);
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-mapWindow:aWindowId
+Window:aWindowId
     "make a window visible"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	XMapWindow(myDpy, _WindowVal(aWindowId));
-	RETURN ( self );
+        XMapWindow(myDpy, _WindowVal(aWindowId));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-moveResizeWindow:aWindowId x:x y:y width:w height:h
+eResizeWindow:aWindowId x:x y:y width:w height:h
     "move and resize a window"
 
 %{  /* NOCONTEXT */
@@ -8068,51 +8157,51 @@
      && __isExternalAddress(aWindowId)
      && __bothSmallInteger(w, h)
      && __bothSmallInteger(x, y)) {
-	newWidth = __intVal(w);
-	newHeight = __intVal(h);
-	if (newWidth < 1) newWidth = 1;
-	if (newHeight < 1) newHeight = 1;
-	XMoveResizeWindow(myDpy, _WindowVal(aWindowId),
-			      __intVal(x), __intVal(y),
-			      newWidth, newHeight);
-	RETURN ( self );
+        newWidth = __intVal(w);
+        newHeight = __intVal(h);
+        if (newWidth < 1) newWidth = 1;
+        if (newHeight < 1) newHeight = 1;
+        XMoveResizeWindow(myDpy, _WindowVal(aWindowId),
+                              __intVal(x), __intVal(y),
+                              newWidth, newHeight);
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-moveWindow:aWindowId x:x y:y
+eWindow:aWindowId x:x y:y
     "move a window"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId) && __bothSmallInteger(x, y)) {
-	XMoveWindow(myDpy, _WindowVal(aWindowId), __intVal(x), __intVal(y));
-	RETURN ( self );
+        XMoveWindow(myDpy, _WindowVal(aWindowId), __intVal(x), __intVal(y));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-raiseWindow:aWindowId
+seWindow:aWindowId
     "bring a window to front"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	XRaiseWindow(myDpy, _WindowVal(aWindowId));
-	RETURN ( self );
+        XRaiseWindow(myDpy, _WindowVal(aWindowId));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-resizeWindow:aWindowId width:w height:h
+izeWindow:aWindowId width:w height:h
     "resize a window"
 
 %{  /* NOCONTEXT */
@@ -8121,19 +8210,19 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId) && __bothSmallInteger(w, h)) {
-	newWidth = __intVal(w);
-	newHeight = __intVal(h);
-	if (newWidth < 1) newWidth = 1;
-	if (newHeight < 1) newHeight = 1;
-	XResizeWindow(myDpy, _WindowVal(aWindowId), newWidth, newHeight);
-	RETURN ( self );
+        newWidth = __intVal(w);
+        newHeight = __intVal(h);
+        if (newWidth < 1) newWidth = 1;
+        if (newHeight < 1) newHeight = 1;
+        XResizeWindow(myDpy, _WindowVal(aWindowId), newWidth, newHeight);
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-setBackingStore:how in:aWindowId
+BackingStore:how in:aWindowId
     "turn on/off backing-store for a window"
 
 %{  /* NOCONTEXT */
@@ -8142,22 +8231,22 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	if (__INST(ignoreBackingStore) != true) {
-	    if (how == @symbol(always)) wa.backing_store = Always;
-	    else if (how == @symbol(whenMapped)) wa.backing_store = WhenMapped;
-	    else if (how == true) wa.backing_store = Always;
-	    else wa.backing_store = 0;
-	    BEGIN_INTERRUPTSBLOCKED
-	    XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWBackingStore, &wa);
-	    END_INTERRUPTSBLOCKED
-	}
-	RETURN ( self );
+        if (__INST(ignoreBackingStore) != true) {
+            if (how == @symbol(always)) wa.backing_store = Always;
+            else if (how == @symbol(whenMapped)) wa.backing_store = WhenMapped;
+            else if (how == true) wa.backing_store = Always;
+            else wa.backing_store = 0;
+            BEGIN_INTERRUPTSBLOCKED
+            XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWBackingStore, &wa);
+            END_INTERRUPTSBLOCKED
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setBitGravity:how in:aWindowId
+BitGravity:how in:aWindowId
     "set bit gravity for a window"
 
 %{  /* NOCONTEXT */
@@ -8166,38 +8255,38 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	if (how == @symbol(NorthWest)) {
-	    wa.bit_gravity = NorthWestGravity;
-	} else if (how == @symbol(NorthEast)) {
-	    wa.bit_gravity = NorthEastGravity;
-	} else if (how == @symbol(SouthWest)) {
-	    wa.bit_gravity = SouthWestGravity;
-	} else if (how == @symbol(SouthEast)) {
-	    wa.bit_gravity = SouthEastGravity;
-	} else if (how == @symbol(Center)) {
-	    wa.bit_gravity = CenterGravity;
-	} else if (how == @symbol(North)) {
-	    wa.bit_gravity = NorthGravity;
-	} else if (how == @symbol(South)) {
-	    wa.bit_gravity = SouthGravity;
-	} else if (how == @symbol(West)) {
-	    wa.bit_gravity = WestGravity;
-	} else if (how == @symbol(East)) {
-	    wa.bit_gravity = EastGravity;
-	} else {
-	    wa.bit_gravity = NorthWestGravity;
-	}
-
-	BEGIN_INTERRUPTSBLOCKED
-	XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWBitGravity, &wa);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        if (how == @symbol(NorthWest)) {
+            wa.bit_gravity = NorthWestGravity;
+        } else if (how == @symbol(NorthEast)) {
+            wa.bit_gravity = NorthEastGravity;
+        } else if (how == @symbol(SouthWest)) {
+            wa.bit_gravity = SouthWestGravity;
+        } else if (how == @symbol(SouthEast)) {
+            wa.bit_gravity = SouthEastGravity;
+        } else if (how == @symbol(Center)) {
+            wa.bit_gravity = CenterGravity;
+        } else if (how == @symbol(North)) {
+            wa.bit_gravity = NorthGravity;
+        } else if (how == @symbol(South)) {
+            wa.bit_gravity = SouthGravity;
+        } else if (how == @symbol(West)) {
+            wa.bit_gravity = WestGravity;
+        } else if (how == @symbol(East)) {
+            wa.bit_gravity = EastGravity;
+        } else {
+            wa.bit_gravity = NorthWestGravity;
+        }
+
+        BEGIN_INTERRUPTSBLOCKED
+        XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWBitGravity, &wa);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setCursor:aCursorId in:aWindowId
+Cursor:aCursorId in:aWindowId
     "define a windows cursor"
 
 %{  /* NOCONTEXT */
@@ -8207,14 +8296,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aCursorId)) {
-	XDefineCursor(dpy, _WindowVal(aWindowId), _CursorVal(aCursorId));
-	RETURN ( self );
+        XDefineCursor(dpy, _WindowVal(aWindowId), _CursorVal(aCursorId));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setIconName:aString in:aWindowId
+IconName:aString in:aWindowId
     "define a windows iconname"
 
 %{  /* NOCONTEXT */
@@ -8222,14 +8311,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && (__isString(aString) || __isSymbol(aString))) {
-	XSetIconName(myDpy, _WindowVal(aWindowId), (char *)_stringVal(aString));
-	RETURN ( self );
+        XSetIconName(myDpy, _WindowVal(aWindowId), (char *)_stringVal(aString));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setSaveUnder:yesOrNo in:aWindowId
+SaveUnder:yesOrNo in:aWindowId
     "turn on/off save-under for a window"
 
 %{  /* NOCONTEXT */
@@ -8238,43 +8327,43 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	if (__INST(hasSaveUnder) == true) {
-	    wa.save_under = (yesOrNo == true) ? 1 : 0;
-	    XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWSaveUnder, &wa);
-	}
-	RETURN ( self );
+        if (__INST(hasSaveUnder) == true) {
+            wa.save_under = (yesOrNo == true) ? 1 : 0;
+            XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWSaveUnder, &wa);
+        }
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setTransient:aWindowId for:aMainWindowId
+Transient:aWindowId for:aMainWindowId
     "set aWindowId to be a transient of aMainWindow"
 
 %{  /* NOCONTEXT */
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	Window w;
-
-	if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
-	    w = (Window) 0;
-	} else {
-	    if (__isExternalAddress(aMainWindowId)) {
-		w = _WindowVal(aMainWindowId);
-	    } else {
-		goto getOutOfHere;
-	    }
-	}
-	XSetTransientForHint(myDpy, _WindowVal(aWindowId), w);
-	RETURN ( self );
+        Window w;
+
+        if ((aMainWindowId == nil) || (aMainWindowId == __MKSMALLINT(0))) {
+            w = (Window) 0;
+        } else {
+            if (__isExternalAddress(aMainWindowId)) {
+                w = _WindowVal(aMainWindowId);
+            } else {
+                goto getOutOfHere;
+            }
+        }
+        XSetTransientForHint(myDpy, _WindowVal(aWindowId), w);
+        RETURN ( self );
     }
  getOutOfHere: ;
 %}.
     self primitiveFailed
 !
 
-setWindowBackground:aColorIndex in:aWindowId
+WindowBackground:aColorIndex in:aWindowId
     "set the windows background color. This is the color with which
      the view is filled whenever exposed. Do not confuse this with
      the background drawing color, which is used with opaque drawing."
@@ -8284,14 +8373,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isSmallInteger(aColorIndex)) {
-	XSetWindowBackground(myDpy, _WindowVal(aWindowId), __intVal(aColorIndex));
-	RETURN ( self );
+        XSetWindowBackground(myDpy, _WindowVal(aWindowId), __intVal(aColorIndex));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowBackgroundPixmap:aPixmapId in:aWindowId
+WindowBackgroundPixmap:aPixmapId in:aWindowId
     "set the windows background pattern to be a form.
      This is the pattern with which the view is filled whenever exposed. 
      Do not confuse this with the background drawing color, which is used 
@@ -8302,14 +8391,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aPixmapId)) {
-	XSetWindowBackgroundPixmap(myDpy, _WindowVal(aWindowId), _PixmapVal(aPixmapId));
-	RETURN ( self );
+        XSetWindowBackgroundPixmap(myDpy, _WindowVal(aWindowId), _PixmapVal(aPixmapId));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowBorderColor:aColorIndex in:aWindowId
+WindowBorderColor:aColorIndex in:aWindowId
     "set the windows border color"
 
 %{  /* NOCONTEXT */
@@ -8317,14 +8406,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isSmallInteger(aColorIndex)) {
-	XSetWindowBorder(myDpy, _WindowVal(aWindowId), __intVal(aColorIndex));
-	RETURN ( self );
+        XSetWindowBorder(myDpy, _WindowVal(aWindowId), __intVal(aColorIndex));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowBorderPixmap:aPixmapId in:aWindowId
+WindowBorderPixmap:aPixmapId in:aWindowId
     "set the windows border pattern"
 
 %{  /* NOCONTEXT */
@@ -8332,15 +8421,15 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aPixmapId)) {
-	XSetWindowBorderPixmap(myDpy, _WindowVal(aWindowId), _PixmapVal(aPixmapId));
-	RETURN ( self );
+        XSetWindowBorderPixmap(myDpy, _WindowVal(aWindowId), _PixmapVal(aPixmapId));
+        RETURN ( self );
     }
 %}
 .
     self primitiveFailed
 !
 
-setWindowBorderShape:aPixmapId in:aWindowId
+WindowBorderShape:aPixmapId in:aWindowId
     "set the windows border shape"
 
     hasShapeExtension ifFalse:[^ self].
@@ -8351,16 +8440,16 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aPixmapId)) {
-	XShapeCombineMask(myDpy, _WindowVal(aWindowId), ShapeBounding,
-			  0, 0, _PixmapVal(aPixmapId), ShapeSet);
-	RETURN ( self );
+        XShapeCombineMask(myDpy, _WindowVal(aWindowId), ShapeBounding,
+                          0, 0, _PixmapVal(aPixmapId), ShapeSet);
+        RETURN ( self );
     }
 #endif
 %}.
     self primitiveFailed
 !
 
-setWindowBorderWidth:aNumber in:aWindowId
+WindowBorderWidth:aNumber in:aWindowId
     "set the windows border width"
 
 %{  /* NOCONTEXT */
@@ -8368,14 +8457,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isSmallInteger(aNumber)) {
-	XSetWindowBorderWidth(myDpy, _WindowVal(aWindowId), __intVal(aNumber));
-	RETURN ( self );
+        XSetWindowBorderWidth(myDpy, _WindowVal(aWindowId), __intVal(aNumber));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowClass:wClass name:wName in:aWindowId
+WindowClass:wClass name:wName in:aWindowId
     "define class and name of a window.
      This may be used by the window manager to
      select client specific resources."
@@ -8383,29 +8472,29 @@
 %{
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	XClassHint classhint;
-
-	classhint.res_class = classhint.res_name = 0;
-
-	if (__isString(wClass) || __isSymbol(wClass)) {
-	    classhint.res_class = (char *)_stringVal(wClass);
-	} else if (wClass != nil)
-	    goto error;
-
-	if (__isString(wName) || __isSymbol(wName)) {
-	    classhint.res_name = (char *)_stringVal(wName);
-	} else if (wName != nil)
-	    goto error;
-
-	XSetClassHint(myDpy, _WindowVal(aWindowId), &classhint);
-	RETURN ( self );
+        XClassHint classhint;
+
+        classhint.res_class = classhint.res_name = 0;
+
+        if (__isString(wClass) || __isSymbol(wClass)) {
+            classhint.res_class = (char *)_stringVal(wClass);
+        } else if (wClass != nil)
+            goto error;
+
+        if (__isString(wName) || __isSymbol(wName)) {
+            classhint.res_name = (char *)_stringVal(wName);
+        } else if (wName != nil)
+            goto error;
+
+        XSetClassHint(myDpy, _WindowVal(aWindowId), &classhint);
+        RETURN ( self );
 error:;
     }
 %}.
     self primitiveFailed
 !
 
-setWindowGravity:how in:aWindowId
+WindowGravity:how in:aWindowId
     "set window gravity for a window"
 
 %{  /* NOCONTEXT */
@@ -8414,84 +8503,84 @@
 
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)) {
-	if (how == @symbol(NorthWest)) {
-	    wa.win_gravity = NorthWestGravity;
-	} else if (how == @symbol(NorthEast)) {
-	    wa.win_gravity = NorthEastGravity;
-	} else if (how == @symbol(SouthWest)) {
-	    wa.win_gravity = SouthWestGravity;
-	} else if (how == @symbol(SouthEast)) {
-	    wa.win_gravity = SouthEastGravity;
-	} else if (how == @symbol(Center)) {
-	    wa.win_gravity = CenterGravity;
-	} else if (how == @symbol(North)) {
-	    wa.win_gravity = NorthGravity;
-	} else if (how == @symbol(South)) {
-	    wa.win_gravity = SouthGravity;
-	} else if (how == @symbol(West)) {
-	    wa.win_gravity = WestGravity;
-	} else if (how == @symbol(East)) {
-	    wa.win_gravity = EastGravity;
-	} else {
-	    wa.win_gravity = NorthWestGravity;
-	}
-
-	BEGIN_INTERRUPTSBLOCKED
-	XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWWinGravity, &wa);
-	END_INTERRUPTSBLOCKED
-	RETURN ( self );
+        if (how == @symbol(NorthWest)) {
+            wa.win_gravity = NorthWestGravity;
+        } else if (how == @symbol(NorthEast)) {
+            wa.win_gravity = NorthEastGravity;
+        } else if (how == @symbol(SouthWest)) {
+            wa.win_gravity = SouthWestGravity;
+        } else if (how == @symbol(SouthEast)) {
+            wa.win_gravity = SouthEastGravity;
+        } else if (how == @symbol(Center)) {
+            wa.win_gravity = CenterGravity;
+        } else if (how == @symbol(North)) {
+            wa.win_gravity = NorthGravity;
+        } else if (how == @symbol(South)) {
+            wa.win_gravity = SouthGravity;
+        } else if (how == @symbol(West)) {
+            wa.win_gravity = WestGravity;
+        } else if (how == @symbol(East)) {
+            wa.win_gravity = EastGravity;
+        } else {
+            wa.win_gravity = NorthWestGravity;
+        }
+
+        BEGIN_INTERRUPTSBLOCKED
+        XChangeWindowAttributes(myDpy, _WindowVal(aWindowId), CWWinGravity, &wa);
+        END_INTERRUPTSBLOCKED
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowIcon:aForm in:aWindowId
+WindowIcon:aForm in:aWindowId
     "define a bitmap to be used as icon"
 
     |iconId|
 
     aForm notNil ifTrue:[
-	iconId := aForm id
+        iconId := aForm id
     ].
 %{
     if (ISCONNECTED
      && __isExternalAddress(iconId)
      && __isExternalAddress(aWindowId)) {
-	XWMHints hints;
-
-	hints.icon_pixmap = _PixmapVal(iconId);
-	hints.flags = IconPixmapHint;
-	XSetWMHints(myDpy, _WindowVal(aWindowId), &hints);
-	RETURN ( self );
+        XWMHints hints;
+
+        hints.icon_pixmap = _PixmapVal(iconId);
+        hints.flags = IconPixmapHint;
+        XSetWMHints(myDpy, _WindowVal(aWindowId), &hints);
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowIconWindow:aView in:aWindowId
+WindowIconWindow:aView in:aWindowId
     "define a window to be used as icon"
 
     |iconWindowId|
 
     aView notNil ifTrue:[
-	iconWindowId := aView id
+        iconWindowId := aView id
     ].
 %{
     if (ISCONNECTED
      && __isExternalAddress(iconWindowId)
      && __isExternalAddress(aWindowId)) {
-	XWMHints wmhints;
-
-	wmhints.icon_window = _WindowVal(iconWindowId);
-	wmhints.flags = IconWindowHint;
-	XSetWMHints(myDpy, _WindowVal(aWindowId), &wmhints);
-	RETURN ( self );
+        XWMHints wmhints;
+
+        wmhints.icon_window = _WindowVal(iconWindowId);
+        wmhints.flags = IconWindowHint;
+        XSetWMHints(myDpy, _WindowVal(aWindowId), &wmhints);
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowName:aString in:aWindowId
+WindowName:aString in:aWindowId
     "define a windows name"
 
 %{  /* NOCONTEXT */
@@ -8499,14 +8588,14 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && (__isString(aString) || __isSymbol(aString))) {
-	XStoreName(myDpy, _WindowVal(aWindowId), (char *)_stringVal(aString));
-	RETURN ( self );
+        XStoreName(myDpy, _WindowVal(aWindowId), (char *)_stringVal(aString));
+        RETURN ( self );
     }
 %}.
     self primitiveFailed
 !
 
-setWindowShape:aPixmapId in:aWindowId
+WindowShape:aPixmapId in:aWindowId
     "set the windows shape"
 
     hasShapeExtension ifFalse:[^ self].
@@ -8517,28 +8606,28 @@
     if (ISCONNECTED
      && __isExternalAddress(aWindowId)
      && __isExternalAddress(aPixmapId)) {
-	XShapeCombineMask(myDpy, _WindowVal(aWindowId), ShapeClip,
-			  0, 0,
-			  _PixmapVal(aPixmapId), ShapeSet);
-	RETURN ( self );
+        XShapeCombineMask(myDpy, _WindowVal(aWindowId), ShapeClip,
+                          0, 0,
+                          _PixmapVal(aPixmapId), ShapeSet);
+        RETURN ( self );
     }
 #endif
 %}.
     self primitiveFailed
 !
 
-unmapWindow:aWindowId
+apWindow:aWindowId
     "make a window invisible"
 
 %{  /* NOCONTEXT */
 
     if (!ISCONNECTED) {
-	RETURN ( self );
+        RETURN ( self );
     }
 
     if (__isExternalAddress(aWindowId)) {
-	XUnmapWindow(myDpy, _WindowVal(aWindowId));
-	RETURN ( self );
+        XUnmapWindow(myDpy, _WindowVal(aWindowId));
+        RETURN ( self );
     }
 %}
 .
@@ -8548,6 +8637,6 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.202 1997-02-13 12:21:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.203 1997-02-13 12:44:40 cg Exp $'
 ! !
 XWorkstation initialize!