XWorkstation.st
branchjv
changeset 6905 ebeee068a422
parent 6874 353ea2fc65d0
parent 6904 eff65cefac62
child 6913 12bc34f97b84
--- a/XWorkstation.st	Sun Aug 09 06:38:43 2015 +0200
+++ b/XWorkstation.st	Sat Aug 15 06:40:00 2015 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
 COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -1267,6 +1269,18 @@
     "
 !
 
+hasXVideo
+    "return true, if this workstation supports the XVideo extension.
+     Both the server must support it, and the feature must have been
+     enabled in the smalltalk system, for true to be returned."
+
+    ^ hasXVideoExtension
+
+    "
+     Display hasXVideo
+    "
+!
+
 hasXftLibrary
 %{
 #ifdef XFT
@@ -1280,18 +1294,6 @@
     "
 !
 
-hasXVideo
-    "return true, if this workstation supports the XVideo extension.
-     Both the server must support it, and the feature must have been
-     enabled in the smalltalk system, for true to be returned."
-
-    ^ hasXVideoExtension
-
-    "
-     Display hasXVideo
-    "
-!
-
 iconSizes
     "Get the preferred/supported icon sizes. These are set by the window manager.
      We return nil (if not set) or an OrderedCollection of iconSize specs."
@@ -7130,7 +7132,7 @@
     "Answer an array with selected property values of a font.
      This is X11-Specific.
      PropertyNames is an array with property names (symbols or strings).
-     Nonexistant properties are returned as nil"
+     Nonexistent properties are returned as nil"
 
     |props|
 
@@ -7139,8 +7141,8 @@
 
     "
      Screen current
-	fontProperties:#(#'PIXEL_SIZE' #'POINT_SIZE' RESOLUTION notExistant)
-	of:(Screen current getDefaultFontWithEncoding:#'iso10646-1')
+        fontProperties:#(#'PIXEL_SIZE' #'POINT_SIZE' RESOLUTION notExistent)
+        of:(Screen current getDefaultFontWithEncoding:#'iso10646-1')
     "
 !
 
@@ -13248,47 +13250,47 @@
     |selection|
 
     buffer isNil ifTrue:[
-	^ nil.
+        ^ nil.
     ].
 
     targetID == (display atomIDOf:#STRING) ifTrue:[
-	display clipboardEncoding notNil ifTrue:[
-	    selection := buffer decodeFrom:display clipboardEncoding
-	].
-	selection := buffer.
+        display clipboardEncoding notNil ifTrue:[
+            selection := buffer decodeFrom:display clipboardEncoding
+        ].
+        selection := buffer.
     ] ifFalse:[targetID == (display atomIDOf:#'UTF8_STRING') ifTrue:[
 "/ Transcript show:'UTF8: '; showCR:buffer storeString.
-	selection := CharacterArray fromUTF8Bytes:buffer
+        selection := buffer utf8Decoded.
     ] ifFalse:[targetID == (display atomIDOf:#TEXT) ifTrue:[
 "/ Transcript show:'TEXT: '; showCR:buffer storeString.
-	selection := buffer asString
+        selection := buffer asString
     ] ifFalse:[targetID == (display atomIDOf:#'COMPOUND_TEXT') ifTrue:[
 "/ Transcript show:'COMPOUND_TEXT: '; showCR:buffer storeString.
-	selection := buffer asString
+        selection := buffer asString
     ]]]].
 
     selection notNil ifTrue:[
-	(selection endsWith:Character cr) ifTrue:[
-	    selection := selection asStringCollection copyWith:''
-	].
-	^ selection.
+        (selection endsWith:Character cr) ifTrue:[
+            selection := selection asStringCollection copyWith:''
+        ].
+        ^ selection.
     ].
 
     targetID == (display atomIDOf:#'TARGETS') ifTrue:[
-	^ buffer
+        ^ buffer
     ].
     targetID == (display atomIDOf:#'ST_OBJECT') ifTrue:[
-	"require libboss to be loaded"
-	(Smalltalk isClassLibraryLoaded:'libstx_libboss') ifFalse:[
-	    'SelectionFetch: cannot decode object (libboss library missing)' errorPrintCR.
-	    ^ nil
-	].
-	^ (Object
-	    readBinaryFrom:(ReadStream on:buffer)
-	    onError:[:ex |
-		('SelectionFetch: error while decoding binary object: ',ex description) errorPrintCR.
-		nil
-	    ])
+        "require libboss to be loaded"
+        (Smalltalk isClassLibraryLoaded:'libstx_libboss') ifFalse:[
+            'SelectionFetch: cannot decode object (libboss library missing)' errorPrintCR.
+            ^ nil
+        ].
+        ^ (Object
+            readBinaryFrom:(ReadStream on:buffer)
+            onError:[:ex |
+                ('SelectionFetch: error while decoding binary object: ',ex description) errorPrintCR.
+                nil
+            ])
     ].
 
     'XWorkstation: unimplemented property targetID: ' infoPrint. (display atomName:targetID) infoPrint.
@@ -13616,11 +13618,11 @@
 !XWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.605 2015-05-26 00:35:47 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libview/XWorkstation.st,v 1.605 2015-05-26 00:35:47 cg Exp $'
+    ^ '$Header$'
 !
 
 version_SVN