XWorkstation.st
changeset 402 f5a53e2a868d
parent 397 094b8604ea72
child 404 0db38d8283a4
--- a/XWorkstation.st	Mon Feb 05 01:48:12 1996 +0100
+++ b/XWorkstation.st	Mon Feb 05 22:51:10 1996 +0100
@@ -3966,12 +3966,13 @@
 
     XFontStruct *f;
 
-    if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	RETURN ( __MKSMALLINT(f->ascent) );
-    }
-%}
-.
+    if (ISCONNECTED) {
+        if (__isExternalAddress(aFontId)) {
+	    f = _FontVal(aFontId);
+	    RETURN ( __MKSMALLINT(f->ascent) );
+        }
+    }
+%}.
     self primitiveFailed.
     ^ nil
 !
@@ -4130,12 +4131,13 @@
 
     XFontStruct *f;
 
-    if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	RETURN ( __MKSMALLINT(f->descent) );
-    }
-%}
-.
+    if (ISCONNECTED) {
+        if (__isExternalAddress(aFontId)) {
+	    f = _FontVal(aFontId);
+	    RETURN ( __MKSMALLINT(f->descent) );
+        }
+    }
+%}.
     self primitiveFailed.
     ^ nil
 !
@@ -4447,12 +4449,13 @@
 
     XFontStruct *f;
 
-    if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	RETURN ( __MKSMALLINT(f->max_bounds.ascent) );
-    }
-%}
-.
+    if (ISCONNECTED) {
+        if (__isExternalAddress(aFontId)) {
+	    f = _FontVal(aFontId);
+	    RETURN ( __MKSMALLINT(f->max_bounds.ascent) );
+        }
+    }
+%}.
     self primitiveFailed.
     ^ nil
 !
@@ -4464,12 +4467,13 @@
 
     XFontStruct *f;
 
-    if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	RETURN ( __MKSMALLINT(f->max_bounds.descent) );
-    }
-%}
-.
+    if (ISCONNECTED) {
+        if (__isExternalAddress(aFontId)) {
+	    f = _FontVal(aFontId);
+	    RETURN ( __MKSMALLINT(f->max_bounds.descent) );
+        }
+    }
+%}.
     self primitiveFailed.
     ^ nil
 !
@@ -4481,12 +4485,13 @@
 
     XFontStruct *f;
 
-    if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	RETURN ( __MKSMALLINT(f->max_bounds.width) );
-    }
-%}
-.
+    if (ISCONNECTED) {
+        if (__isExternalAddress(aFontId)) {
+	    f = _FontVal(aFontId);
+	    RETURN ( __MKSMALLINT(f->max_bounds.width) );
+        }
+    }
+%}.
     self primitiveFailed.
     ^ nil
 !
@@ -4497,12 +4502,13 @@
 
     XFontStruct *f;
 
-    if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	RETURN ( __MKSMALLINT(f->min_bounds.width) );
-    }
-%}
-.
+    if (ISCONNECTED) {
+        if (__isExternalAddress(aFontId)) {
+	    f = _FontVal(aFontId);
+	    RETURN ( __MKSMALLINT(f->min_bounds.width) );
+        }
+    }
+%}.
     self primitiveFailed.
     ^ nil
 !
@@ -4522,8 +4528,7 @@
 	    RETURN ( self );
 	}
     }
-%}
-.
+%}.
     self primitiveFailed
 !
 
@@ -4556,38 +4561,39 @@
     char *cp;
     int len, n, i1, i2;
 
-    if (__bothSmallInteger(index1, index2)
-     && __isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	i1 = _intVal(index1) - 1;
-	i2 = _intVal(index2) - 1;
-	if (__isString(aString) || __isSymbol(aString)) {
-	    cp = (char *) _stringVal(aString);
-	    n = _stringSize(aString);
-	    if ((i1 >= 0) && (i2 >= i1) && (i2 < n)) {
-		cp += i1;
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth(f, cp, i2 - i1 + 1);
-		END_INTERRUPTSBLOCKED
-		RETURN ( __MKSMALLINT(len) );
+    if (ISCONNECTED) {
+        if (__bothSmallInteger(index1, index2)
+         && __isExternalAddress(aFontId)) {
+	    f = _FontVal(aFontId);
+	    i1 = _intVal(index1) - 1;
+	    i2 = _intVal(index2) - 1;
+	    if (__isString(aString) || __isSymbol(aString)) {
+	        cp = (char *) _stringVal(aString);
+	        n = _stringSize(aString);
+	        if ((i1 >= 0) && (i2 >= i1) && (i2 < n)) {
+		    cp += i1;
+		    BEGIN_INTERRUPTSBLOCKED
+		    len = XTextWidth(f, cp, i2 - i1 + 1);
+		    END_INTERRUPTSBLOCKED
+		    RETURN ( __MKSMALLINT(len) );
+	        }
 	    }
-	}
 #ifdef TWOBYTESTRINGS
-	if (__Class(aString) == @global(TwoByteString)) {
-	    cp = (char *) _stringVal(aString);
-	    n = _byteArraySize(aString) / 2;
-	    if ((i1 >= 0) && (i2 >= i1) && (i2 < n)) {
-		cp += (i1 * 2);
-		BEGIN_INTERRUPTSBLOCKED
-		len = XTextWidth16(f, (XChar2b *)cp, i2 - i1 + 1);
-		END_INTERRUPTSBLOCKED
-		RETURN ( __MKSMALLINT(len) );
+	    if (__Class(aString) == @global(TwoByteString)) {
+	        cp = (char *) _stringVal(aString);
+	        n = _byteArraySize(aString) / 2;
+	        if ((i1 >= 0) && (i2 >= i1) && (i2 < n)) {
+		    cp += (i1 * 2);
+		    BEGIN_INTERRUPTSBLOCKED
+		    len = XTextWidth16(f, (XChar2b *)cp, i2 - i1 + 1);
+		    END_INTERRUPTSBLOCKED
+		    RETURN ( __MKSMALLINT(len) );
+	        }
 	    }
-	}
 #endif
-    }
-%}
-.
+        }
+    }
+%}.
     self primitiveFailed.
     ^ nil
 !
@@ -4600,29 +4606,30 @@
     char *cp;
     int len, n;
 
-    if (__isExternalAddress(aFontId)) {
-	f = _FontVal(aFontId);
-	if (__isString(aString) || __isSymbol(aString)) {
-	    n = _stringSize(aString);
-	    cp = (char *)_stringVal(aString);
-	    BEGIN_INTERRUPTSBLOCKED
-	    len = XTextWidth(f, cp, n);
-	    END_INTERRUPTSBLOCKED
-	    RETURN ( __MKSMALLINT(len) );
-	}
+    if (ISCONNECTED) {
+        if (__isExternalAddress(aFontId)) {
+	    f = _FontVal(aFontId);
+	    if (__isString(aString) || __isSymbol(aString)) {
+	        n = _stringSize(aString);
+	        cp = (char *)_stringVal(aString);
+	        BEGIN_INTERRUPTSBLOCKED
+	        len = XTextWidth(f, cp, n);
+	        END_INTERRUPTSBLOCKED
+	        RETURN ( __MKSMALLINT(len) );
+	    }
 #ifdef TWOBYTESTRINGS
-	if (__Class(aString) == @global(TwoByteString)) {
-	    n = _byteArraySize(aString) / 2;
-	    cp = (char *) _stringVal(aString);
-	    BEGIN_INTERRUPTSBLOCKED
-	    len = XTextWidth16(f, (XChar2b *)cp, n);
-	    END_INTERRUPTSBLOCKED
-	    RETURN ( __MKSMALLINT(len) );
-	}
+	    if (__Class(aString) == @global(TwoByteString)) {
+	        n = _byteArraySize(aString) / 2;
+	        cp = (char *) _stringVal(aString);
+	        BEGIN_INTERRUPTSBLOCKED
+	        len = XTextWidth16(f, (XChar2b *)cp, n);
+	        END_INTERRUPTSBLOCKED
+	        RETURN ( __MKSMALLINT(len) );
+	    }
 #endif
-    }
-%}
-.
+        }
+    }
+%}.
     self primitiveFailed.
     ^ nil
 ! !
@@ -7298,6 +7305,6 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.107 1996-02-04 17:11:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.108 1996-02-05 21:51:10 cg Exp $'
 ! !
 XWorkstation initialize!