XWorkstation.st
changeset 4469 19d67853c6d4
parent 4466 e6a5ea77c511
child 4478 fb57ec7d7cc4
--- a/XWorkstation.st	Thu Jan 19 13:19:34 2006 +0100
+++ b/XWorkstation.st	Mon Jan 23 19:39:21 2006 +0100
@@ -2092,15 +2092,18 @@
     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;
+	    int t = 0;
+
+	    if (index & 128) t |=   1;
+	    if (index &  64) t |=   2;
+	    if (index &  32) t |=   4;
+	    if (index &  16) t |=   8;
+	    if (index &   8) t |=  16;
+	    if (index &   4) t |=  32;
+	    if (index &   2) t |=  64;
+	    if (index &   1) t |= 128;
+
+	    reverseBitTable[index] = t;
 	}
 	firstCall = 0;
     }
@@ -4462,9 +4465,9 @@
     dropType := (self dndDropTypes) at:dropType+1 ifAbsent:#DndNotDnd.
 
     property := self
-        getProperty:(self atomIDOf:#DndSelection)
-        from:rootId
-        delete:false.
+	getProperty:(self atomIDOf:#DndSelection)
+	from:rootId
+	delete:false.
 
     propertyType := property key.
     dropValue := property value.
@@ -4478,72 +4481,72 @@
     "/ in the default dropMessage handling of SimpleView.
 
     dropType == #DndFiles ifTrue:[
-        "/ actually, a list of fileNames
-        propertyType ~~ stringAtom ifTrue:[
-            'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
-            ^ self
-        ].
-
-        names := OrderedCollection new.
-        i1 := 1.
-        [i1 ~~ 0] whileTrue:[
-            i2 := dropValue indexOf:(Character value:0) startingAt:i1.
-            i2 ~~ 0 ifTrue:[
-                names add:(dropValue copyFrom:i1 to:(i2-1)).
-                i1 := i2 + 1.
-            ] ifFalse:[
-                i1 := i2
-            ].
-        ].
-        dropValue := names.
-        dropValue := dropValue collect:[:nm | nm asFilename].
-        dropType := #files.
+	"/ actually, a list of fileNames
+	propertyType ~~ stringAtom ifTrue:[
+	    'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+	    ^ self
+	].
+
+	names := OrderedCollection new.
+	i1 := 1.
+	[i1 ~~ 0] whileTrue:[
+	    i2 := dropValue indexOf:(Character value:0) startingAt:i1.
+	    i2 ~~ 0 ifTrue:[
+		names add:(dropValue copyFrom:i1 to:(i2-1)).
+		i1 := i2 + 1.
+	    ] ifFalse:[
+		i1 := i2
+	    ].
+	].
+	dropValue := names.
+	dropValue := dropValue collect:[:nm | nm asFilename].
+	dropType := #files.
     ] ifFalse:[ (dropType == #DndFile) ifTrue:[
-        propertyType ~~ stringAtom ifTrue:[
-            'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
-            ^ self
-        ].
-        dropValue := dropValue asFilename.
-        dropType := #file.
+	propertyType ~~ stringAtom ifTrue:[
+	    'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+	    ^ self
+	].
+	dropValue := dropValue asFilename.
+	dropType := #file.
     ] ifFalse:[ (dropType == #DndDir) ifTrue:[
-        propertyType ~~ stringAtom ifTrue:[
-            'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
-            ^ self
-        ].
-        dropValue := dropValue asFilename.
-        dropType := #directory.
+	propertyType ~~ stringAtom ifTrue:[
+	    'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+	    ^ self
+	].
+	dropValue := dropValue asFilename.
+	dropType := #directory.
     ] ifFalse:[ (dropType == #DndText) ifTrue:[
-        propertyType ~~ stringAtom ifTrue:[
-            'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
-            ^ self
-        ].
-        dropType := #text.
+	propertyType ~~ stringAtom ifTrue:[
+	    'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+	    ^ self
+	].
+	dropType := #text.
     ] ifFalse:[ (dropType == #DndExe) ifTrue:[
-        propertyType ~~ stringAtom ifTrue:[
-            'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
-            ^ self
-        ].
-        dropType := #executable.
+	propertyType ~~ stringAtom ifTrue:[
+	    'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+	    ^ self
+	].
+	dropType := #executable.
     ] ifFalse:[ (dropType == #DndLink) ifTrue:[
-        propertyType ~~ stringAtom ifTrue:[
-            'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
-            ^ self
-        ].
-        dropType := #link.
+	propertyType ~~ stringAtom ifTrue:[
+	    'XWorkstation [info]: expected a string propertyValue in drop' infoPrintCR.
+	    ^ self
+	].
+	dropType := #link.
     ] ifFalse:[ (dropType == #DndRawData) ifTrue:[
-        dropType := #rawData.
+	dropType := #rawData.
     ] ifFalse:[
-        'XWorkstation [info]: unsupported dropType: ' infoPrint. dropType infoPrintCR.
-        'XWorkstation [info]: data: ' infoPrint. dropValue infoPrintCR.
-        dropType := #unknown.
+	'XWorkstation [info]: unsupported dropType: ' infoPrint. dropType infoPrintCR.
+	'XWorkstation [info]: data: ' infoPrint. dropValue infoPrintCR.
+	dropType := #unknown.
     ]]]]]]].
 
     (sensor := targetView sensor) notNil ifTrue:[
-        sensor dropMessage:dropType data:dropValue view:targetView position:nil dropHandle:nil
+	sensor dropMessage:dropType data:dropValue view:targetView position:nil dropHandle:nil
     ] ifFalse:[
-        "
-         not posted, if there is no sensor ...
-        "
+	"
+	 not posted, if there is no sensor ...
+	"
     ]
 
     "Created: 4.4.1997 / 17:59:37 / cg"
@@ -4941,24 +4944,24 @@
     |eventArray|
 
     dispatchingExpose notNil ifTrue:[
-        [self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
-            self dispatchExposeEventFor:dispatchingExpose
-        ].
-        ^ self
+	[self exposeEventPendingFor:dispatchingExpose withSync:false] whileTrue:[
+	    self dispatchExposeEventFor:dispatchingExpose
+	].
+	^ self
     ].
 
     eventArray := Array new:13.
     [self eventPendingWithSync:false] whileTrue:[
-        (self getEventFor:nil withMask:nil into:eventArray) ifTrue:[
-            AbortOperationRequest handle:[:ex |
-                ex return
-            ] do:[
-                self dispatchEvent:eventArray.
-                "/ multi-screen config: give others a chance 
-                "/ (needed because we run at high (non-timesliced) prio)
-                Processor yield. 
-            ]
-        ].
+	(self getEventFor:nil withMask:nil into:eventArray) ifTrue:[
+	    AbortOperationRequest handle:[:ex |
+		ex return
+	    ] do:[
+		self dispatchEvent:eventArray.
+		"/ multi-screen config: give others a chance
+		"/ (needed because we run at high (non-timesliced) prio)
+		Processor yield.
+	    ]
+	].
     ]
 
     "Modified: 19.8.1997 / 17:11:18 / cg"
@@ -6089,35 +6092,35 @@
     |enc charSets|
 
     (registry size ~~ 0) ifTrue:[
-        enc := registry asLowercase.
-        encoding size ~~ 0 ifTrue:[
-           enc := enc, '-', encoding asLowercase.
-        ].
-        enc := enc asSymbol.
+	enc := registry asLowercase.
+	encoding size ~~ 0 ifTrue:[
+	   enc := enc, '-', encoding asLowercase.
+	].
+	enc := enc asSymbol.
     ] ifFalse:[
-        (encoding size ~~ 0) ifTrue:[
-            enc := encoding asLowercase asSymbol
-        ] ifFalse:[
-            charSets := charSetCollections.
-            (charSets notEmptyOrNil) ifTrue:[
-                charSets := charSets asUppercase asCollectionOfWords.
-                (charSets includes:'ISO8859-1') ifTrue:[
-                    enc := #'iso8859-1'
-                ] ifFalse:[
-                    (charSets includes:'ISO8859') ifTrue:[
-                        enc := #iso8859
-                    ] ifFalse:[
-                        (charSets includes:'ASCII') ifTrue:[
-                            enc := #ascii
-                        ] ifFalse:[
-                            (charSets includes:'ADOBE-STANDARD') ifTrue:[
-                                enc := #iso8859
-                            ]
-                        ]
-                    ]
-                ]
-            ]
-        ]
+	(encoding size ~~ 0) ifTrue:[
+	    enc := encoding asLowercase asSymbol
+	] ifFalse:[
+	    charSets := charSetCollections.
+	    (charSets notEmptyOrNil) ifTrue:[
+		charSets := charSets asUppercase asCollectionOfWords.
+		(charSets includes:'ISO8859-1') ifTrue:[
+		    enc := #'iso8859-1'
+		] ifFalse:[
+		    (charSets includes:'ISO8859') ifTrue:[
+			enc := #iso8859
+		    ] ifFalse:[
+			(charSets includes:'ASCII') ifTrue:[
+			    enc := #ascii
+			] ifFalse:[
+			    (charSets includes:'ADOBE-STANDARD') ifTrue:[
+				enc := #iso8859
+			    ]
+			]
+		    ]
+		]
+	    ]
+	]
     ].
     ^  enc
 
@@ -10330,10 +10333,10 @@
     allChildIDs := OrderedCollection new.
     childIDs := self childIdsOf:aWindowId.
     childIDs notNil ifTrue:[
-        allChildIDs addAll:childIDs.
-        childIDs do:[:eachChildId |
-            allChildIDs addAll:(self allChildIdsOf:eachChildId).
-        ].
+	allChildIDs addAll:childIDs.
+	childIDs do:[:eachChildId |
+	    allChildIDs addAll:(self allChildIdsOf:eachChildId).
+	].
     ].
     ^ allChildIDs
 
@@ -10347,20 +10350,20 @@
      deviceIDAtom := (Display atomIDOf:#'STX_DEVICE_ID').
      uuidAtom     := (Display atomIDOf:#'UUID').
      (Display allChildIdsOf:(Display rootWindowId))
-        select:[:id |
-            |uuid|
-
-            Display
-                getProperty:deviceIDAtom
-                from:id
-                delete:false
-                into:[:type :value |
-                    type == uuidAtom ifTrue:[
-                        uuid := UUID fromBytes:value.
-                    ].
-                ].
-            uuid notNil.
-        ]
+	select:[:id |
+	    |uuid|
+
+	    Display
+		getProperty:deviceIDAtom
+		from:id
+		delete:false
+		into:[:type :value |
+		    type == uuidAtom ifTrue:[
+			uuid := UUID fromBytes:value.
+		    ].
+		].
+	    uuid notNil.
+	]
     "
 !
 
@@ -11915,7 +11918,7 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.481 2006-01-17 12:12:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.482 2006-01-23 18:39:21 cg Exp $'
 ! !
 
 XWorkstation initialize!