XWorkstation.st
changeset 7591 bce664b396f0
parent 7509 d18f375ac80d
child 7599 84f6853ec60d
child 7662 b603d95107c2
--- a/XWorkstation.st	Wed Sep 28 13:20:07 2016 +0200
+++ b/XWorkstation.st	Thu Sep 29 12:20:16 2016 +0200
@@ -1897,9 +1897,7 @@
      and the display we are connected to must support it,
      to return true here."
 
-     ^ XftFontDescription notNil
-	and:[self class hasXftLibrary
-	and:[self hasRenderExtension]]
+     ^ XftFontDescription notNil and:[hasXftLibrary].
 
     "
      Display supportsXftFonts
@@ -9337,17 +9335,17 @@
 
     super initializeScreenProperties.
 
-    hasShapeExtension := self queryShapeExtension.
-    hasShmExtension := self querySHMExtension.
-    hasDPSExtension := self queryDPSExtension.
-    hasXVideoExtension := self queryXVideoExtension.
-    hasMbufExtension := self queryMBUFExtension.
-    hasPEXExtension := self queryPEXExtension.
-    hasImageExtension := self queryXIEExtension.
-    hasInputExtension := self queryXIExtension.
-    hasXineramaExtension := self queryXineramaExtension.
-    hasRenderExtension := self queryRenderExtension.
-    hasXftLibrary := self queryXftLibrary.
+    hasShapeExtension := self hasExtension:#SHAPE.
+    hasShmExtension := self hasExtension:#MIT_SHM.
+    hasDPSExtension := self hasExtension:#DPS.
+    hasXVideoExtension := self hasExtension:#XVideo.
+    hasMbufExtension := self hasExtension:#'Multi-Buffering'.
+    hasPEXExtension := self hasExtension:#'X3D-PEX'.
+    hasImageExtension := self hasExtension:#XIE.
+    hasInputExtension := self hasExtension:#XInputExtension.
+    hasXineramaExtension := self hasExtension:#XINERAMA.
+    hasRenderExtension := self hasExtension:#RENDER.
+    hasXftLibrary := hasRenderExtension and:[self class hasXftLibrary].
 
     primaryAtom := self atomIDOf:#PRIMARY.
     stringAtom := self atomIDOf:#STRING.
@@ -9371,12 +9369,12 @@
     hasColors := hasGreyscales := true.
     (visualType == #StaticGray
      or:[ visualType == #GrayScale]) ifTrue:[
-	hasColors := false.
-	monitorType := #monochrome.
+        hasColors := false.
+        monitorType := #monochrome.
     ].
 
     ncells == 2 ifTrue:[
-	hasColors := hasGreyscales := false.
+        hasColors := hasGreyscales := false.
     ].
 
     masks := self queryRGBMasks.
@@ -9386,13 +9384,13 @@
     bitsPerRGB := masks at:4.
 
     visualType == #TrueColor ifTrue:[
-	redShift := redMask lowBit - 1.
-	greenShift := greenMask lowBit - 1.
-	blueShift := blueMask lowBit - 1.
-
-	bitsRed := redMask highBit - redMask lowBit + 1.
-	bitsGreen := greenMask highBit - greenMask lowBit + 1.
-	bitsBlue := blueMask highBit - blueMask lowBit + 1.
+        redShift := redMask lowBit - 1.
+        greenShift := greenMask lowBit - 1.
+        blueShift := blueMask lowBit - 1.
+
+        bitsRed := redMask highBit - redMask lowBit + 1.
+        bitsGreen := greenMask highBit - greenMask lowBit + 1.
+        bitsBlue := blueMask highBit - blueMask lowBit + 1.
     ].
 
 %{
@@ -9411,52 +9409,52 @@
     int dummy;
 
     if (ISCONNECTED) {
-	dpy = myDpy;
-
-	/*
-	 * look for RGB visual with the highest depth
-	 */
-	nvi = 0;
-	viproto.screen = scr;
-	vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
-	maxRGBDepth = maxRGBADepth = 0;
-	for (i = 0; i < nvi; i++) {
-	    int thisDepth = vip[i].depth;
-
-	    switch (vip[i].class) {
-		case TrueColor:
-		    if (thisDepth > maxRGBDepth) {
-			if (thisDepth <= 24) {
-			    maxRGBDepth = thisDepth;
-			    rgbRedMask = vip[i].red_mask;
-			    rgbGreenMask = vip[i].green_mask;
-			    rgbBlueMask = vip[i].blue_mask;
-			    rgbVisualID = vip[i].visualid;
-			} else {
-			    if (thisDepth > maxRGBADepth) {
-				// printf("found rgba visual!\n");
-				maxRGBADepth = thisDepth;
-				rgbaRedMask = vip[i].red_mask;
-				rgbaGreenMask = vip[i].green_mask;
-				rgbaBlueMask = vip[i].blue_mask;
-				rgbaVisualID = vip[i].visualid;
-			    }
-			}
-		    }
-		    break;
-	    }
-	}
-	if (vip) XFree ((char *) vip);
-
-	if (maxRGBDepth) {
-	    __INST(rgbVisual) = __MKEXTERNALADDRESS(rgbVisualID); __STORESELF(rgbVisual);
-	}
-	if (maxRGBADepth) {
-	    __INST(rgbaVisual) = __MKEXTERNALADDRESS(rgbaVisualID); __STORESELF(rgbaVisual);
-	    if (!maxRGBDepth) {
-		__INST(rgbVisual) = __INST(rgbaVisual); __STORESELF(rgbVisual);
-	    }
-	}
+        dpy = myDpy;
+
+        /*
+         * look for RGB visual with the highest depth
+         */
+        nvi = 0;
+        viproto.screen = scr;
+        vip = XGetVisualInfo (dpy, VisualScreenMask, &viproto, &nvi);
+        maxRGBDepth = maxRGBADepth = 0;
+        for (i = 0; i < nvi; i++) {
+            int thisDepth = vip[i].depth;
+
+            switch (vip[i].class) {
+                case TrueColor:
+                    if (thisDepth > maxRGBDepth) {
+                        if (thisDepth <= 24) {
+                            maxRGBDepth = thisDepth;
+                            rgbRedMask = vip[i].red_mask;
+                            rgbGreenMask = vip[i].green_mask;
+                            rgbBlueMask = vip[i].blue_mask;
+                            rgbVisualID = vip[i].visualid;
+                        } else {
+                            if (thisDepth > maxRGBADepth) {
+                                // printf("found rgba visual!\n");
+                                maxRGBADepth = thisDepth;
+                                rgbaRedMask = vip[i].red_mask;
+                                rgbaGreenMask = vip[i].green_mask;
+                                rgbaBlueMask = vip[i].blue_mask;
+                                rgbaVisualID = vip[i].visualid;
+                            }
+                        }
+                    }
+                    break;
+            }
+        }
+        if (vip) XFree ((char *) vip);
+
+        if (maxRGBDepth) {
+            __INST(rgbVisual) = __MKEXTERNALADDRESS(rgbVisualID); __STORESELF(rgbVisual);
+        }
+        if (maxRGBADepth) {
+            __INST(rgbaVisual) = __MKEXTERNALADDRESS(rgbaVisualID); __STORESELF(rgbaVisual);
+            if (!maxRGBDepth) {
+                __INST(rgbVisual) = __INST(rgbaVisual); __STORESELF(rgbVisual);
+            }
+        }
     }
 %}.
 !
@@ -9563,29 +9561,6 @@
     "
 !
 
-queryDPSExtension
-%{  /* NOCONTEXT */
-
-#ifdef DPS
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XQueryExtension(dpy, "DPSExtension", &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryDPSExtension
-    "
-!
-
 queryDefaultScreen
 %{  /* NOCONTEXT */
 
@@ -9713,52 +9688,6 @@
     "
 !
 
-queryMBUFExtension
-%{  /* NOCONTEXT */
-
-#ifdef MBUF
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XQueryExtension(dpy, "Multi-Buffering", &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryMBUFExtension
-    "
-!
-
-queryPEXExtension
-%{  /* NOCONTEXT */
-
-#ifdef PEX5
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XQueryExtension(dpy, PEX_NAME_STRING, &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryPEXExtension
-    "
-!
-
 queryRGBMasks
 %{  /* NOCONTEXT */
 
@@ -9783,75 +9712,6 @@
     "
 !
 
-queryRenderExtension
-%{  /* NOCONTEXT */
-
-#ifdef XRENDER
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XRenderQueryExtension (dpy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryRenderExtension
-    "
-!
-
-querySHMExtension
-%{  /* NOCONTEXT */
-
-#ifdef xxSHM
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XQueryExtension(dpy, "MIT_SHM", &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display querySHMExtension
-    "
-!
-
-queryShapeExtension
-%{  /* NOCONTEXT */
-
-#ifdef SHAPE
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XShapeQueryExtension(dpy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryShapeExtension
-    "
-!
-
 queryWhitePixel
 %{  /* NOCONTEXT */
 
@@ -9909,107 +9769,6 @@
     "
 !
 
-queryXIEExtension
-%{  /* NOCONTEXT */
-
-#ifdef XIE
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XQueryExtension(dpy, xieExtName, &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryXIEExtension
-    "
-!
-
-queryXIExtension
-%{  /* NOCONTEXT */
-
-#ifdef XI
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XQueryExtension(dpy, "XInputExtension", &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryXIExtension
-    "
-!
-
-queryXVideoExtension
-%{  /* NOCONTEXT */
-
-#ifdef XVIDEO
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XQueryExtension(dpy, "XVideo", &dummy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryXVideoExtension
-    "
-!
-
-queryXftLibrary
-%{
-#ifndef XFT
-    RETURN (false);
-#endif
-%}.
-    ^ self queryRenderExtension
-!
-
-queryXineramaExtension
-%{  /* NOCONTEXT */
-
-#ifdef XINERAMA
-    if (ISCONNECTED) {
-	Display *dpy;
-	int dummy;
-
-	dpy = myDpy;
-
-	if (XineramaQueryExtension (dpy, &dummy, &dummy)) {
-	    RETURN ( true );
-	}
-    }
-#endif
-%}.
-    ^ false
-
-    "
-     Display queryXineramaExtension
-    "
-!
-
 reinitialize
     preWaitAction notNil ifTrue:[
 	Processor removePreWaitAction:preWaitAction.