*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Fri, 29 Oct 1999 18:42:33 +0200
changeset 3016 326429127f47
parent 3015 401637ae1c72
child 3017 806f5d65a74b
*** empty log message ***
XWorkstation.st
--- a/XWorkstation.st	Fri Oct 29 17:42:30 1999 +0200
+++ b/XWorkstation.st	Fri Oct 29 18:42:33 1999 +0200
@@ -179,6 +179,10 @@
 #define myDpy                _DisplayVal(__INST(displayId))
 #define ISCONNECTED          (__INST(displayId) != nil)
 
+/*
+ * THISCONTEXT_IN_REGISTER does not work yet - so its never
+ * defined.
+ */
 #ifndef THISCONTEXT_IN_REGISTER
 
 # define BEGIN_INTERRUPTSBLOCKED /* */
@@ -564,6 +568,18 @@
 
     RETURN ( __MKEXTERNALADDRESS(lastResource) );
 %}
+!
+
+getConnectionTimeOut
+%{
+    RETURN (__MKSMALLINT(__xlibTimeout__ / 50));
+%}
+!
+
+setConnectionTimeOut:seconds
+%{
+    __xlibTimeout__ = __intVal(seconds) * 50;
+%}
 ! !
 
 !XWorkstation class methodsFor:'queries'!
@@ -1233,7 +1249,7 @@
 
     bitmapId := self primCreateBitmapFromArray:anArray width:w height:h.
     bitmapId isNil ifTrue:[
-        self primitiveFailed
+	self primitiveFailed
     ].
     ^ bitmapId
 !
@@ -4275,10 +4291,10 @@
 
 %{  /* NOCONTEXT */
     RETURN (__MKSMALLINT( ExposureMask | StructureNotifyMask |
-                         KeyPressMask | KeyReleaseMask |
-                         PointerMotionMask |
-                         EnterWindowMask | LeaveWindowMask |
-                         ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
+			 KeyPressMask | KeyReleaseMask |
+			 PointerMotionMask |
+			 EnterWindowMask | LeaveWindowMask |
+			 ButtonPressMask | ButtonMotionMask | ButtonReleaseMask ));
 %}
 !
 
@@ -5142,12 +5158,12 @@
     OBJ rslt = false;
 
     if (ISCONNECTED) {
-        /* ENTER ... LEAVE not needed; XEventsQueued will not block */
-        /* ENTER_XLIB(); */
-        if (XEventsQueued(myDpy, QueuedAlready)) {
-            rslt = true;
-        }
-        /* LEAVE_XLIB(); */
+	/* ENTER ... LEAVE not needed; XEventsQueued will not block */
+	/* ENTER_XLIB(); */
+	if (XEventsQueued(myDpy, QueuedAlready)) {
+	    rslt = true;
+	}
+	/* LEAVE_XLIB(); */
     }
     RETURN ( rslt );
 %}
@@ -6462,10 +6478,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 72 96)
+	"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 72 96)
     ].
     ^ sizes
 
@@ -7374,8 +7390,8 @@
 
 %{ 
     if (ISCONNECTED) {
-        close(ConnectionNumber(myDpy));
-        __INST(displayId) = nil;
+	close(ConnectionNumber(myDpy));
+	__INST(displayId) = nil;
     }
 %}
 !
@@ -7416,33 +7432,33 @@
     |dpyName index arguments|
 
     displayId notNil ifTrue:[
-        "/ already connected - you bad guy try to trick me manually ?
-        ^ self
+	"/ already connected - you bad guy try to trick me manually ?
+	^ self
     ].
 
     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
+	    ]
+	]
     ].
 
     self openConnectionTo:dpyName.
 
     displayId isNil ifTrue:[
-        "/ could not connect.
-        "/ only output a message, if running under X
-
-        ((OperatingSystem isMSWINDOWSlike not) or:[WinWorkstation isNil]) ifTrue:[
-            'XWorkstation [warning]: cannot connect to Display (' infoPrint.
-            (dpyName ? ((OperatingSystem getEnvironment:'Display') ? 'default')) infoPrint.
+	"/ could not connect.
+	"/ only output a message, if running under X
+
+	((OperatingSystem isMSWINDOWSlike not) or:[WinWorkstation isNil]) ifTrue:[
+	    'XWorkstation [warning]: cannot connect to Display (' infoPrint.
+	    (dpyName ? ((OperatingSystem getEnvironment:'Display') ? 'default')) infoPrint.
 	    ')' infoPrintCR.
-        ].
-        ^ nil
+	].
+	^ nil
     ].
 
     dispatching := false.
@@ -7486,35 +7502,35 @@
 
     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.
+	"/
+	"/ 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.
     ] 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"
@@ -10182,6 +10198,6 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.335 1999-10-29 15:42:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.336 1999-10-29 16:42:33 cg Exp $'
 ! !
 XWorkstation initialize!