DeviceWorkstation.st
changeset 7630 a7b5e6c4f52f
parent 7592 e50263f9750d
child 7643 173a9c62ebcc
--- a/DeviceWorkstation.st	Tue Oct 18 11:10:38 2016 +0200
+++ b/DeviceWorkstation.st	Tue Oct 18 11:11:10 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
 COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -1574,22 +1576,22 @@
     w2 := window2 ? self rootView.
 
     (w1 device ~~ self or:[w2 device ~~ self]) ifTrue:[
-	self error:'Huh - Cross device translation' mayProceed:true.
-	^ aPoint
+        self error:'Huh - Cross device translation' mayProceed:true.
+        ^ aPoint
     ].
     w1 isView ifTrue:[
-	offset1 := 0
+        offset1 := 0
     ] ifFalse:[
-	offset1 := w1 origin.
-	w1 := w1 container.
+        offset1 := w1 origin.
+        w1 := w1 container.
     ].
     w2 isView ifTrue:[
-	offset2 := 0
+        offset2 := 0
     ] ifFalse:[
-	offset2 := w2 origin.
-	w2 := w2 container.
-    ].
-    devicePoint := self translatePoint:aPoint from:(w1 id) to:(w2 id).
+        offset2 := w2 origin.
+        w2 := w2 container.
+    ].
+    devicePoint := self translatePoint:aPoint from:(w1 drawableId) to:(w2 drawableId).
     devicePoint isNil ifTrue:[ ^ aPoint].
     ^ devicePoint + offset1 - offset2
 
@@ -3373,9 +3375,9 @@
     self rememberCopyBuffer.
     self setCopyBuffer:something.
 
-    viewID := aView id.
+    viewID := aView drawableId.
     viewID notNil ifTrue:[ "/ if the view is not already closed
-	self setClipboardObject:something owner:viewID.
+        self setClipboardObject:something owner:viewID.
     ]
 !
 
@@ -3401,16 +3403,16 @@
 
     s := aString ? ''.
     s isString ifFalse:[
-	s := s asStringWithCRsFrom:1 to:(s size) compressTabs:false withCR:false
-    ].
-
-    viewID := aView id.
+        s := s asStringWithCRsFrom:1 to:(s size) compressTabs:false withCR:false
+    ].
+
+    viewID := aView drawableId.
     viewID notNil ifTrue:[ "/ if the view is not already closed
-	"/ TODO: should add support to pass emphasis information too
-	s := s string.
-	self setClipboardText:s owner:viewID.
+        "/ TODO: should add support to pass emphasis information too
+        s := s string.
+        self setClipboardText:s owner:viewID.
     ] ifFalse:[
-	Transcript showCR:'DeviceWorkstation [warning]: setClipboardText - view has no id; selection only kept locally'
+        Transcript showCR:'DeviceWorkstation [warning]: setClipboardText - view has no id; selection only kept locally'
     ].
 !
 
@@ -5658,12 +5660,12 @@
      Return true if ok, false if it failed for some reason."
 
     activeKeyboardGrab notNil ifTrue:[
-	self ungrabKeyboard.
-	activeKeyboardGrab := nil
-    ].
-    (self grabKeyboardIn:(aView id)) ifTrue:[
-	activeKeyboardGrab := aView.
-	^ true
+        self ungrabKeyboard.
+        activeKeyboardGrab := nil
+    ].
+    (self grabKeyboardIn:(aView drawableId)) ifTrue:[
+        activeKeyboardGrab := aView.
+        ^ true
     ].
     ^ false
 !
@@ -5704,20 +5706,20 @@
     |cId vId ok|
 
     activePointerGrab notNil ifTrue:[
-	self ungrabPointer.
-	activePointerGrab := nil
-    ].
-    vId := aView id.
+        self ungrabPointer.
+        activePointerGrab := nil
+    ].
+    vId := aView drawableId.
     aCursorOrNil notNil ifTrue:[
-	cId := aCursorOrNil id.
-	ok := self grabPointerIn:vId withCursorId:cId.
+        cId := aCursorOrNil id.
+        ok := self grabPointerIn:vId withCursorId:cId.
     ] ifFalse:[
-	ok := self grabPointerIn:vId.
+        ok := self grabPointerIn:vId.
     ].
 
     ok ifTrue:[
-	activePointerGrab := aView.
-	^ true
+        activePointerGrab := aView.
+        ^ true
     ].
     ^ false
 !
@@ -6358,42 +6360,42 @@
     root foreground:blackColor background:whiteColor.
 
     root xoring:[
-	|left right top bottom newOrigin newCorner p|
-
-	rect := origin extent:extent.
-	root displayRectangle:rect.
-
-	prevGrab := activePointerGrab.
-	self grabPointerInView:root withCursor:curs.
-
-	[self leftButtonPressed] whileTrue:[
-	    newOrigin := self pointerPosition.
-
-	    (newOrigin ~= origin) ifTrue:[
-		root displayRectangle:rect.
-
-		self
-		    grabPointerIn:root id
-		    withCursor:curs id
-		    pointerMode:#async
-		    keyboardMode:#sync
-		    confineTo:nil.
-
-		rect := newOrigin extent:extent.
-		root displayRectangle:rect.
-		self disposeButtonEventsFor:nil.
-		self flush.
-		origin := newOrigin.
-	    ] ifFalse:[
-		Delay waitForSeconds:0.05
-	    ]
-	].
-	root displayRectangle:rect.
+        |left right top bottom newOrigin newCorner p|
+
+        rect := origin extent:extent.
+        root displayRectangle:rect.
+
+        prevGrab := activePointerGrab.
+        self grabPointerInView:root withCursor:curs.
+
+        [self leftButtonPressed] whileTrue:[
+            newOrigin := self pointerPosition.
+
+            (newOrigin ~= origin) ifTrue:[
+                root displayRectangle:rect.
+
+                self
+                    grabPointerIn:root drawableId
+                    withCursor:curs id
+                    pointerMode:#async
+                    keyboardMode:#sync
+                    confineTo:nil.
+
+                rect := newOrigin extent:extent.
+                root displayRectangle:rect.
+                self disposeButtonEventsFor:nil.
+                self flush.
+                origin := newOrigin.
+            ] ifFalse:[
+                Delay waitForSeconds:0.05
+            ]
+        ].
+        root displayRectangle:rect.
     ].
 
     self ungrabPointer.
     prevGrab notNil ifTrue:[
-	self grabPointerInView:prevGrab.
+        self grabPointerInView:prevGrab.
     ].
 
     "flush all events pending on my display"
@@ -7430,7 +7432,7 @@
 setPointerPosition:newPosition
     "change the pointer position in root-window coordinates."
 
-    self setPointerPosition:newPosition in:(self rootView id)
+    self setPointerPosition:newPosition in:(self rootView drawableId)
 
     "
      Display setPointerPosition:10@30
@@ -7846,14 +7848,14 @@
      This undoes the effect of #setCursors:"
 
     self allViewsDo:[:aView |
-	|c vid cid|
-
-	(vid := aView id) notNil ifTrue:[
-	    c := aView cursor.
-	    (c notNil and:[(cid := c id) notNil]) ifTrue:[
-		self setCursor:cid in:vid
-	    ]
-	]
+        |c vid cid|
+
+        (vid := aView drawableId) notNil ifTrue:[
+            c := aView cursor.
+            (c notNil and:[(cid := c id) notNil]) ifTrue:[
+                self setCursor:cid in:vid
+            ]
+        ]
     ].
     self flush.