--- a/XWorkstation.st Sun May 06 17:46:59 2018 +0200
+++ b/XWorkstation.st Mon May 07 15:55:29 2018 +0200
@@ -62,7 +62,7 @@
privateIn:XWorkstation
!
-DeviceGraphicsContext subclass:#X11GraphicsContext
+DeviceGraphicsContext subclass:#xX11GraphicsContext
instanceVariableNames:'depth xftDrawId'
classVariableNames:''
poolDictionaries:''
@@ -13504,47 +13504,51 @@
|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 := buffer utf8Decoded.
+ "/ Transcript show:'UTF8: '; showCR:buffer storeString.
+ [
+ selection := buffer utf8Decoded.
+ ] on:Error do:[
+ selection := buffer asString
+ ]
] ifFalse:[targetID == (display atomIDOf:#TEXT) ifTrue:[
- "/ Transcript show:'TEXT: '; showCR:buffer storeString.
- selection := buffer asString
+ "/ Transcript show:'TEXT: '; showCR:buffer storeString.
+ selection := buffer asString
] ifFalse:[targetID == (display atomIDOf:#'COMPOUND_TEXT') ifTrue:[
- "/ Transcript show:'COMPOUND_TEXT: '; showCR:buffer storeString.
- selection := buffer asString
+ "/ Transcript show:'COMPOUND_TEXT: '; showCR:buffer storeString.
+ 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.
@@ -13744,7 +13748,7 @@
^ true
! !
-!XWorkstation::X11GraphicsContext methodsFor:'accessing'!
+!XWorkstation::xX11GraphicsContext methodsFor:'accessing'!
depth
^ depth
@@ -13754,7 +13758,7 @@
^ xftDrawId
! !
-!XWorkstation::X11GraphicsContext methodsFor:'destroying'!
+!XWorkstation::xX11GraphicsContext methodsFor:'destroying'!
destroy
xftDrawId notNil ifTrue:[
@@ -13781,7 +13785,7 @@
%}.
! !
-!XWorkstation::X11GraphicsContext methodsFor:'displaying'!
+!XWorkstation::xX11GraphicsContext methodsFor:'displaying'!
displayDeviceString:aString from:index1 to:index2 x:x y:y opaque:opaque
"draw a sub-string - if opaque is false, draw foreground only; otherwise, draw both
@@ -14196,7 +14200,7 @@
].
! !
-!XWorkstation::X11GraphicsContext methodsFor:'drawing'!
+!XWorkstation::xX11GraphicsContext methodsFor:'drawing'!
XXclearDeviceRectangleX:x y:y width:width height:height
device clearRectangleX:x y:y width:width height:height in:drawableId with:gcId
@@ -14245,7 +14249,7 @@
in:drawableId with:gcId
! !
-!XWorkstation::X11GraphicsContext methodsFor:'view creation'!
+!XWorkstation::xX11GraphicsContext methodsFor:'view creation'!
createBitmapFromArray:data width:width height:height
depth := 1.