GLXWorkstation.st
changeset 4251 ae0f46130d9f
parent 4169 35c1ee146ffb
child 4711 1d1cfd1951e1
--- a/GLXWorkstation.st	Wed Sep 15 00:51:48 2004 +0200
+++ b/GLXWorkstation.st	Wed Sep 15 01:03:38 2004 +0200
@@ -387,13 +387,13 @@
 #ifdef DYNAMICALLY_LOADABLE
 /*
  * catch X-errors and forward as errorInterrupt:#DisplayError,
- * (which itself invokes my handler and optionally raises an exceptionSignal)
+ * (which itself invokes my handler and optionally raises an exception)
  * the implementation below is somewhat wrong: it will
  * report all errors for Display, even though there could be
  * more than one display connection. (being fixed, new errorInterrupt mechanism
  * allows passing an additional argument, which is the displayID ...)
  *
- * this dublicates the functionality as found in XWorkstation;
+ * this duplicates the functionality as found in XWorkstation;
  * the reason is to allow dynamic loading systems to load this module
  * before XWorkstation (which was not possible otherwise, due to unresolved
  * external references while loading this one)
@@ -405,25 +405,25 @@
 {
     XGetErrorText(dpy, event->error_code, lastErrorMsg, 80);
     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, "GLXWORKSTAT: x-error caught 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, "GLXWORKSTAT: x-error message is [%d] '%s'\n", event->error_code, lastErrorMsg);
+        fprintf(stderr, "GLXWORKSTAT: x-error caught 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, "GLXWORKSTAT: x-error message is [%d] '%s'\n", event->error_code, lastErrorMsg);
     }
 
     __errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy));
@@ -550,26 +550,26 @@
 #endif
 
     if (setjmp(errorReturn)) {
-	fprintf(stderr, "hard error in GL - return\n");
+        fprintf(stderr, "hard error in GL - return\n");
 #ifdef HAS_SIGACTION
-	sigaction(SIGSEGV, &oldSig, 0);
-#else
-	signal(SIGSEGV, oldSig);
+        sigaction(SIGSEGV, &oldSig, 0);
+#else
+        signal(SIGSEGV, oldSig);
 #endif
 #if !defined(OPENGL)
-	__catchExit(0);
-#endif
-	return 0;
+        __catchExit(0);
+#endif
+        return 0;
     }
     __CONT__
 
     if (w <= 0) {
-	fprintf(stderr, "GL: bad width: %d\n", w);
-	w = 1;
+        fprintf(stderr, "GL: bad width: %d\n", w);
+        w = 1;
     }
     if (h <= 0) {
-	fprintf(stderr, "GL: bad height: %d\n", h);
-	h = 1;
+        fprintf(stderr, "GL: bad height: %d\n", h);
+        h = 1;
     }
 
 #if !defined(OPENGL)
@@ -580,22 +580,22 @@
     switch (type) {
       case GLXcolorIndexSingleBuffer:
       case GLXcolorIndexDoubleBuffer:
-	break;
+        break;
 
       case GLXrgbSingleBuffer:
       case GLXrgbDoubleBuffer:
-	fprintf(stderr, "Sorry, VGL can't support %s type of windows\n", typeToName[type]);
-	__catchExit(0);
-	return 0;
+        fprintf(stderr, "Sorry, VGL can't support %s type of windows\n", typeToName[type]);
+        __catchExit(0);
+        return 0;
     }
 
     scr = DefaultScreen(dpy);
     visual.visualid = CopyFromParent;
     cwa.border_pixel = 0;  /* Even if we don't use it, it must be something */
     win = XCreateWindow(dpy, parent, x, y, w, h,
-			     borderWidth, DisplayPlanes(dpy, scr), 
-			     InputOutput, &visual,
-			     CWBorderPixel, &cwa);
+                             borderWidth, DisplayPlanes(dpy, scr), 
+                             InputOutput, &visual,
+                             CWBorderPixel, &cwa);
 
     /*
      * on some, seg-violations occur in the GL, if too many
@@ -618,9 +618,9 @@
 #  endif
 
     if (i < 0) {
-	fprintf(stderr, "GLXlink returned %d\n", i);
-	__catchExit(0);
-	return 0;
+        fprintf(stderr, "GLXlink returned %d\n", i);
+        __catchExit(0);
+        return 0;
     }
 
 # else /* not VGL */
@@ -632,21 +632,21 @@
     next = params;
     switch (type) {
       case GLXcolorIndexSingleBuffer:
-	set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE);
-	set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE);
-	break;
+        set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE);
+        set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE);
+        break;
       case GLXcolorIndexDoubleBuffer:
-	set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE);
-	set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE);
-	break;
+        set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE);
+        set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE);
+        break;
       case GLXrgbSingleBuffer:
-	set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE);
-	set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE);
-	break;
+        set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE);
+        set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE);
+        break;
       case GLXrgbDoubleBuffer:
-	set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE);
-	set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE);
-	break;
+        set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE);
+        set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE);
+        break;
     }
     set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */
 
@@ -658,9 +658,9 @@
     XGetWindowAttributes(dpy, parent, &pwa);
     retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params);
     if (retconfig == 0) {
-	fprintf(stderr, "Sorry, can't support %s type of windows\n", typeToName[type]);
-	__catchExit(0);
-	return 0;
+        fprintf(stderr, "Sorry, can't support %s type of windows\n", typeToName[type]);
+        __catchExit(0);
+        return 0;
     }
 
     /*
@@ -668,24 +668,24 @@
      * that supports the rendering mode.
      */
     for (next = retconfig; next->buffer; next++) {
-	unsigned long buffer = next->buffer;
-	unsigned long mode = next->mode;
-	unsigned long value = next->arg;
-	switch (mode) {
-	  case GLX_COLORMAP:
-	    if (buffer == GLX_NORMAL) {
-		cmap = value;
-	    }
-	    break;
-	  case GLX_VISUAL:
-	    if (buffer == GLX_NORMAL) {
-		template.visualid = value;
-		template.screen = DefaultScreen(dpy);
-		vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask,
-					  &template, &nret);
-	    }
-	    break;
-	}
+        unsigned long buffer = next->buffer;
+        unsigned long mode = next->mode;
+        unsigned long value = next->arg;
+        switch (mode) {
+          case GLX_COLORMAP:
+            if (buffer == GLX_NORMAL) {
+                cmap = value;
+            }
+            break;
+          case GLX_VISUAL:
+            if (buffer == GLX_NORMAL) {
+                template.visualid = value;
+                template.screen = DefaultScreen(dpy);
+                vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask,
+                                          &template, &nret);
+            }
+            break;
+        }
     }
 
     /*
@@ -694,18 +694,18 @@
     cwa.colormap = cmap;
     cwa.border_pixel = 0;  /* Even if we don't use it, it must be something */
     win = XCreateWindow(dpy, parent, x, y, w, h,
-			     borderWidth, vis->depth, InputOutput, vis->visual,
-			     CWColormap|CWBorderPixel, &cwa);
+                             borderWidth, vis->depth, InputOutput, vis->visual,
+                             CWColormap|CWBorderPixel, &cwa);
 
     /*
      * Rescan configuration info and find window slot that getconfig
      * provided.  Fill it in with the window we just created.
      */
     for (next = retconfig; next->buffer; next++) {
-	if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) {
-	    next->arg = win;
-	    break;
-	}
+        if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) {
+            next->arg = win;
+            break;
+        }
     }
 
     /*
@@ -732,9 +732,9 @@
 #  endif
 
     if (i < 0) {
-	fprintf(stderr, "GLXlink returned %d\n", i);
-	__catchExit(0);
-	return 0;
+        fprintf(stderr, "GLXlink returned %d\n", i);
+        __catchExit(0);
+        return 0;
     }
 
     /*
@@ -750,9 +750,9 @@
     visual.visualid = CopyFromParent;
     cwa.border_pixel = 0;  /* Even if we don't use it, it must be something */
     win = XCreateWindow(dpy, parent, x, y, w, h,
-			     borderWidth, DisplayPlanes(dpy, scr), 
-			     InputOutput, &visual,
-			     CWBorderPixel, &cwa);
+                             borderWidth, DisplayPlanes(dpy, scr), 
+                             InputOutput, &visual,
+                             CWBorderPixel, &cwa);
 
     vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret);
     fprintf(stderr, "vis is %x\n", vis);
@@ -784,40 +784,40 @@
     float f_angle;
 
     if (__isFloat(angle)) {
-	f_angle = (float)(_floatVal(angle));
-	if (f_angle != 0.0) {
-#ifdef OPENGL
-#else
-	    rot(f_angle, axis);
-#endif
-	}
-	return (true);
+        f_angle = (float)(_floatVal(angle));
+        if (f_angle != 0.0) {
+#ifdef OPENGL
+#else
+            rot(f_angle, axis);
+#endif
+        }
+        return (true);
     }
     if (__isFraction(angle)
      && __isSmallInteger(_FractionInstPtr(angle)->f_numerator)
      && __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) {
-	float n, d;
-
-	n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator));
-	d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator));
-	f_angle = n / d;
-	if (f_angle != 0.0) {
-#ifdef OPENGL
-#else
-	    rot(f_angle, axis);
-#endif
-	}
-	return (true);
+        float n, d;
+
+        n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator));
+        d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator));
+        f_angle = n / d;
+        if (f_angle != 0.0) {
+#ifdef OPENGL
+#else
+            rot(f_angle, axis);
+#endif
+        }
+        return (true);
     }
     if (__isSmallInteger(angle)) {
-	f_angle = (float)(__intVal(angle));
-	if (f_angle != 0.0) {
-#ifdef OPENGL
-#else
-	    rot(f_angle, axis);
-#endif
-	}
-	return (true);
+        f_angle = (float)(__intVal(angle));
+        if (f_angle != 0.0) {
+#ifdef OPENGL
+#else
+            rot(f_angle, axis);
+#endif
+        }
+        return (true);
     }
     return false;
 }
@@ -842,10 +842,10 @@
     pElem = (char *)(_InstPtr(obj)) + nInstBytes;
     if (nByte < (count * sizeof(OBJ))) return (long *)NULL;
     for (i=0; i<count; i++) {
-	o = *(OBJ *)pElem;
-	if (! __isSmallInteger(o)) return (long *)NULL;
-	vec[i] = (long)__intVal(o);
-	pElem += sizeof(OBJ);
+        o = *(OBJ *)pElem;
+        if (! __isSmallInteger(o)) return (long *)NULL;
+        vec[i] = (long)__intVal(o);
+        pElem += sizeof(OBJ);
     }
     return vec;
 }
@@ -870,10 +870,10 @@
     pElem = (char *)(_InstPtr(obj)) + nInstBytes;
     if (nByte < (count * sizeof(OBJ))) return (short *)NULL;
     for (i=0; i<count; i++) {
-	o = *(OBJ *)pElem;
-	if (! __isSmallInteger(o)) return (short *)NULL;
-	vec[i] = (short)__intVal(o);
-	pElem += sizeof(OBJ);
+        o = *(OBJ *)pElem;
+        if (! __isSmallInteger(o)) return (short *)NULL;
+        vec[i] = (short)__intVal(o);
+        pElem += sizeof(OBJ);
     }
     return vec;
 }
@@ -904,50 +904,50 @@
 
     switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) {
       case FLOATARRAY:
-	/*
-	 * best speed for float array
-	 * - the data is already as we want it
-	 */
-	if (nByte < (count * sizeof(float))) return (float *)0;
-	return (float *)pElem;
+        /*
+         * best speed for float array
+         * - the data is already as we want it
+         */
+        if (nByte < (count * sizeof(float))) return (float *)0;
+        return (float *)pElem;
 
       case DOUBLEARRAY:
-	/*
-	 * for double array, have to copy-and-cast
-	 */
-	if (nByte < (count * sizeof(double))) return (float *)0;
-	for (i=0; i<count; i++) {
-	    vec[i] = *((double *)pElem);
-	    pElem += sizeof(double);
-	}
-	return vec;
+        /*
+         * for double array, have to copy-and-cast
+         */
+        if (nByte < (count * sizeof(double))) return (float *)0;
+        for (i=0; i<count; i++) {
+            vec[i] = *((double *)pElem);
+            pElem += sizeof(double);
+        }
+        return vec;
 
       case POINTERARRAY:
-	/*
-	 * for other array, have to fetch, check and store
-	 * the elements can be floats, smallintegers or fractions
-	 */
-	if (nByte < (count * sizeof(OBJ))) return (float *)0;
-	/* get elements one-by-one */
-	for (i=0; i<count; i++) {
-	    o = *(OBJ *)pElem;
-	    if (__isFloat(o)) {
-		vec[i] = _floatVal(o);
-	    } else if (__isSmallInteger(o)) {
-		vec[i] = (float)(__intVal(o));
-	    } else if (__isFraction(o)
-		    && __isSmallInteger(_FractionInstPtr(o)->f_numerator)
-		    && __isSmallInteger(_FractionInstPtr(o)->f_denominator)) {
-		float n, d;
-
-		n = (float)(__intVal(_FractionInstPtr(o)->f_numerator));
-		d = (float)(__intVal(_FractionInstPtr(o)->f_denominator));
-		vec[i] = n / d;
-	    } else
-		return 0;
-	    pElem += sizeof(OBJ);
-	}
-	return vec;
+        /*
+         * for other array, have to fetch, check and store
+         * the elements can be floats, smallintegers or fractions
+         */
+        if (nByte < (count * sizeof(OBJ))) return (float *)0;
+        /* get elements one-by-one */
+        for (i=0; i<count; i++) {
+            o = *(OBJ *)pElem;
+            if (__isFloat(o)) {
+                vec[i] = _floatVal(o);
+            } else if (__isSmallInteger(o)) {
+                vec[i] = (float)(__intVal(o));
+            } else if (__isFraction(o)
+                    && __isSmallInteger(_FractionInstPtr(o)->f_numerator)
+                    && __isSmallInteger(_FractionInstPtr(o)->f_denominator)) {
+                float n, d;
+
+                n = (float)(__intVal(_FractionInstPtr(o)->f_numerator));
+                d = (float)(__intVal(_FractionInstPtr(o)->f_denominator));
+                vec[i] = n / d;
+            } else
+                return 0;
+            pElem += sizeof(OBJ);
+        }
+        return vec;
     }
     return (float *)0;
 }
@@ -975,41 +975,41 @@
 
     switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) {
       case DOUBLEARRAY:
-	/* best speed for double array - the data is already as we want it */
-	if (nByte < (count * sizeof(double))) return (double *)0;
-	return (double *)pElem;
+        /* best speed for double array - the data is already as we want it */
+        if (nByte < (count * sizeof(double))) return (double *)0;
+        return (double *)pElem;
 
       case FLOATARRAY:
-	if (nByte < (count * sizeof(float))) return (double *)0;
-	for (i=0; i<count; i++) {
-	    vec[i] = *((float *)pElem);
-	    pElem += sizeof(float);
-	}
-	return vec;
+        if (nByte < (count * sizeof(float))) return (double *)0;
+        for (i=0; i<count; i++) {
+            vec[i] = *((float *)pElem);
+            pElem += sizeof(float);
+        }
+        return vec;
 
       case POINTERARRAY:
-	if (nByte < (count * sizeof(OBJ))) return (double *)0;
-	/* get elements one-by-one */
-	for (i=0; i<count; i++) {
-	    o = *(OBJ *)pElem;
-	    if (__isFloat(o)) 
-		vec[i] = _floatVal(o);
-	    else if (__isSmallInteger(o)) 
-		vec[i] = (double)(__intVal(o));
-	    else if (__isFraction(o)
-		     && __isSmallInteger(_FractionInstPtr(o)->f_numerator)
-		     && __isSmallInteger(_FractionInstPtr(o)->f_denominator)) {
-		double n, d;
-
-		n = (double)(__intVal(_FractionInstPtr(o)->f_numerator));
-		d = (double)(__intVal(_FractionInstPtr(o)->f_denominator));
-		vec[i] = n / d;
-
-	    } else 
-		return 0;
-	    pElem += sizeof(OBJ);
-	}
-	return vec;
+        if (nByte < (count * sizeof(OBJ))) return (double *)0;
+        /* get elements one-by-one */
+        for (i=0; i<count; i++) {
+            o = *(OBJ *)pElem;
+            if (__isFloat(o)) 
+                vec[i] = _floatVal(o);
+            else if (__isSmallInteger(o)) 
+                vec[i] = (double)(__intVal(o));
+            else if (__isFraction(o)
+                     && __isSmallInteger(_FractionInstPtr(o)->f_numerator)
+                     && __isSmallInteger(_FractionInstPtr(o)->f_denominator)) {
+                double n, d;
+
+                n = (double)(__intVal(_FractionInstPtr(o)->f_numerator));
+                d = (double)(__intVal(_FractionInstPtr(o)->f_denominator));
+                vec[i] = n / d;
+
+            } else 
+                return 0;
+            pElem += sizeof(OBJ);
+        }
+        return vec;
     }
     return (double *)0;
 }
@@ -1038,20 +1038,20 @@
 
     switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) {
       case FLOATARRAY:
-	if (nByte < (count * sizeof(float))) return 0;
-	for (i=0; i<count; i++) {
-	    *(float *)pElem = vec[i];
-	    pElem += sizeof(float);
-	}
-	return 1;
+        if (nByte < (count * sizeof(float))) return 0;
+        for (i=0; i<count; i++) {
+            *(float *)pElem = vec[i];
+            pElem += sizeof(float);
+        }
+        return 1;
 
       case DOUBLEARRAY:
-	if (nByte < (count * sizeof(float))) return 0;
-	for (i=0; i<count; i++) {
-	    *(double *)pElem = vec[i];
-	    pElem += sizeof(double);
-	}
-	return 1;
+        if (nByte < (count * sizeof(float))) return 0;
+        for (i=0; i<count; i++) {
+            *(double *)pElem = vec[i];
+            pElem += sizeof(double);
+        }
+        return 1;
     }
     /* not implemented for others */
 
@@ -1082,52 +1082,52 @@
     pElem = (char *)(_InstPtr(obj)) + nInstBytes;
 
     switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) {
-	case FLOATARRAY:
-	    /*
-	     * very easy for FLOATARRAY objects - no copying needed
-	     */
-	    if (nByte < (16 * sizeof(float))) return (Matrix *)0;
-	    return (Matrix *) _FloatArrayInstPtr(obj)->f_element;
+        case FLOATARRAY:
+            /*
+             * very easy for FLOATARRAY objects - no copying needed
+             */
+            if (nByte < (16 * sizeof(float))) return (Matrix *)0;
+            return (Matrix *) _FloatArrayInstPtr(obj)->f_element;
     
-	case DOUBLEARRAY:
-	    /*
-	     * for DOUBLEARRAY objects copy and cast
-	     */
-	    if (nByte < (16 * sizeof(double))) return (Matrix *)0;
-	    for (i=0; i<4; i++) {
-		for (j=0; j<4; j++) {
-		    (*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x];
-		    x++;
-		}
-	    }
-	    return mp;
-
-	case POINTERARRAY:
-	    if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0;
-	    /* 
-	     * get elements one-by-one 
-	     */
-	    for (i=0; i<4; i++) {
-		for (j=0; j<4; j++) {
-		    o = _ArrayInstPtr(obj)->a_element[x];
-		    if (__isFloat(o)) {
-			(*mp)[i][j] = _floatVal(o);
-		    } else if (__isSmallInteger(o)) {
-			(*mp)[i][j] = (double)__intVal(o);
-		    } else if (__isFraction(o)
-			&& __isSmallInteger(_FractionInstPtr(o)->f_numerator)
-			&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) {
-			double n, d;
-
-			n = (double)(__intVal(_FractionInstPtr(o)->f_numerator));
-			d = (double)(__intVal(_FractionInstPtr(o)->f_denominator));
-			(*mp)[i][j] = n / d;
-		    } else
-			return (Matrix *)0;
-		    x++;
-		}
-	    }
-	    return mp;
+        case DOUBLEARRAY:
+            /*
+             * for DOUBLEARRAY objects copy and cast
+             */
+            if (nByte < (16 * sizeof(double))) return (Matrix *)0;
+            for (i=0; i<4; i++) {
+                for (j=0; j<4; j++) {
+                    (*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x];
+                    x++;
+                }
+            }
+            return mp;
+
+        case POINTERARRAY:
+            if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0;
+            /* 
+             * get elements one-by-one 
+             */
+            for (i=0; i<4; i++) {
+                for (j=0; j<4; j++) {
+                    o = _ArrayInstPtr(obj)->a_element[x];
+                    if (__isFloat(o)) {
+                        (*mp)[i][j] = _floatVal(o);
+                    } else if (__isSmallInteger(o)) {
+                        (*mp)[i][j] = (double)__intVal(o);
+                    } else if (__isFraction(o)
+                        && __isSmallInteger(_FractionInstPtr(o)->f_numerator)
+                        && __isSmallInteger(_FractionInstPtr(o)->f_denominator)) {
+                        double n, d;
+
+                        n = (double)(__intVal(_FractionInstPtr(o)->f_numerator));
+                        d = (double)(__intVal(_FractionInstPtr(o)->f_denominator));
+                        (*mp)[i][j] = n / d;
+                    } else
+                        return (Matrix *)0;
+                    x++;
+                }
+            }
+            return mp;
     }
     return (Matrix *)0;
 }
@@ -1145,11 +1145,11 @@
     if (! _isNonNilObject(obj)) return (float *)0;
     cls = __qClass(obj);
     if (cls == @global(FloatArray))
-	return _FloatArrayInstPtr(obj)->f_element;
+        return _FloatArrayInstPtr(obj)->f_element;
 
     if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) {
-	ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars);
-	return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]);
+        ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars);
+        return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]);
     }
 
     /*
@@ -1237,45 +1237,54 @@
 
 errorStringOfLastError
 %{
+#ifdef DYNAMICALLY_LOADABLE
     RETURN ( __MKSTRING(lastErrorMsg) );
-%}
-!
+#endif
+%}.
+
+    ^ super errorStringOfLastError.
+!
+
+minorCodeOfLastError
+%{  /* NOCONTEXT */
+#ifdef DYNAMICALLY_LOADABLE
+    RETURN ( __MKSMALLINT(lastMinorCode) );
+#endif
+%}.
+
+    ^ super minorCodeOfLastError.
+!
+
+requestCodeOfLastError
+%{  /* NOCONTEXT */
+#ifdef DYNAMICALLY_LOADABLE
+    RETURN ( __MKSMALLINT(lastRequestCode) );
+#endif
+%}.
+
+    ^ super requestCodeOfLastError.
+!
+
+resourceIdOfLastError
+%{  /* NOCONTEXT */
+#ifdef DYNAMICALLY_LOADABLE
+    if (lastResource != 0) {
+       RETURN ( __MKEXTERNALADDRESS(lastResource) );
+    }
+    RETURN ( nil );
+#endif
+%}.
+
+    ^ super resourceIdOfLastError.
+! !
+
+!GLXWorkstation class methodsFor:'misc'!
 
 forceGL:aBoolean
     ForceGL := aBoolean.
     AllScreens notNil ifTrue:[
 	AllScreens do:[:screen | screen initializeScreenProperties]
     ].
-!
-
-minorCodeOfLastError
-%{  /* NOCONTEXT */
-
-    RETURN ( __MKSMALLINT(lastMinorCode) );
-%}
-!
-
-requestCodeOfLastError
-%{  /* NOCONTEXT */
-
-    RETURN ( __MKSMALLINT(lastRequestCode) );
-%}
-!
-
-resourceIdOfLastError
-    %{  /* NOCONTEXT */
-
-        if (lastResource != 0) {
-            RETURN ( __MKEXTERNALADDRESS(lastResource) );
-        }
-    %}.
-
-    ^ nil
-
-
-    "
-        Screen resourceIdOfLastError
-    "
 ! !
 
 !GLXWorkstation methodsFor:'arcs and circles'!
@@ -8774,5 +8783,5 @@
 !GLXWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.81 2004-05-11 08:00:54 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.82 2004-09-14 23:03:38 stefan Exp $'
 ! !