Cursor.st
changeset 2844 4cdd25ab106e
parent 2841 d6894d63291f
child 2845 0794fef6db4a
--- a/Cursor.st	Wed Aug 18 19:24:00 1999 +0200
+++ b/Cursor.st	Wed Aug 18 19:48:05 1999 +0200
@@ -384,8 +384,8 @@
 initializeNewCursors
     "Create additional cursors as bitmap cursors,
      if not available as native cursors on the device.
-     This is rubbish - we must keep that info on a per-device
-     basis ...
+     This is invoked via the startup script (display.rc)
+     (This is rubbish - we should keep that info on a per-device basis ...)
             Cursor blank
             Cursor down
             Cursor execute
@@ -910,6 +910,7 @@
 
     (builtIn includes:#scrollMarkerH) ifFalse:[
         isWindows ifTrue:[
+            "/ want it white-with black boundary
             bits := #(
                     2r1111111111111111
                     2r1111111111111111
@@ -928,6 +929,7 @@
                     2r1111111111111111
                     2r1111111111111111).
         ] ifFalse:[
+            "/ want it black-with white boundary
             bits := #(
                     2r0000000000000000
                     2r0000000000000000
@@ -973,6 +975,7 @@
 
     (builtIn includes:#scrollUp) ifFalse:[
         isWindows ifTrue:[
+            "/ want it white-with black boundary
             bits := #(
                     2r1111111111111111
                     2r1011111111111111
@@ -991,6 +994,7 @@
                     2r1001111111111111
                     2r1111111111111111).
         ] ifFalse:[
+            "/ want it black-with white boundary
             bits := #(
                     2r0000000000000000
                     2r0100000000000000
@@ -1035,6 +1039,7 @@
 
     (builtIn includes:#scrollDown) ifFalse:[
         isWindows ifTrue:[
+            "/ want it white-with black boundary
             bits := #(
                     2r1111111111111111
                     2r1111100111111111
@@ -1053,6 +1058,7 @@
                     2r1111110111111111
                     2r1111111111111111).
         ] ifFalse:[
+            "/ want it black-with white boundary
             bits := #(
                     2r0000000000000000
                     2r0000011000000000
@@ -1098,6 +1104,7 @@
 
     (builtIn includes:#scrollLeft) ifFalse:[
         isWindows ifTrue:[
+            "/ want it white-with black boundary
             bits := #(
                     2r1111111111111111
                     2r1000000000000001
@@ -1116,6 +1123,7 @@
                     2r1111111111111111
                     2r1111111111111111).
         ] ifFalse:[
+            "/ want it black-with white boundary
             bits := #(
                     2r0000000000000000
                     2r0111111111111110
@@ -1161,6 +1169,7 @@
 
     (builtIn includes:#scrollRight) ifFalse:[
         isWindows ifTrue:[
+            "/ want it white-with black boundary
             bits := #(
                     2r1111111111111111
                     2r1111111110111111
@@ -1179,6 +1188,7 @@
                     2r1111111111111111
                     2r1111111111111111).
         ] ifFalse:[
+            "/ want it black-with white boundary
             bits := #(
                     2r0000000000000000
                     2r0000000001000000
@@ -1224,6 +1234,7 @@
 
     (builtIn includes:#scrollMarkerV) ifFalse:[
         isWindows ifTrue:[
+            "/ want it white-with black boundary
             bits := #(
                     2r1111111111111111
                     2r1111111011111111
@@ -1242,6 +1253,7 @@
                     2r1111110001111111
                     2r1111111111111111).
         ] ifFalse:[
+            "/ want it black-with white boundary
             bits := #(
                     2r0000000000000000
                     2r0000000100000000
@@ -1845,7 +1857,7 @@
         ]
     ].
 
-    ^ (self basicNew setShape:aShape) onDevice:aDevice
+    ^ (self basicNew setShape:aShape) allocateOnDevice:aDevice
 !
 
 sourceForm:aForm
@@ -2693,6 +2705,7 @@
 
     "if I am already assigned to that device ..."
     (device == aDevice) ifTrue:[^ self].
+
     aDevice isNil ifTrue:[
         "this may not happen"
         self error:'nil device'
@@ -2718,10 +2731,11 @@
     ].
 
     device isNil ifTrue:[
-        ^ self allocateOnDevice:aDevice
+        newCursor := self
+    ] ifFalse:[
+        newCursor := self shallowCopy.
+        newCursor setDevice:nil id:nil.
     ].
-    newCursor := self shallowCopy.
-    newCursor setDevice:nil id:nil.
     ^ newCursor allocateOnDevice:aDevice
 
     "Modified: 5.7.1996 / 17:58:00 / cg"
@@ -2733,15 +2747,17 @@
 disposed
     "some Cursor has been collected - tell it to the display"
 
-    |id|
+    |id dev|
 
     (id := cursorId) notNil ifTrue:[
-	cursorId := nil.
-	device destroyCursor:id.
+        (dev := device) notNil ifTrue:[
+            cursorId := device := nil.
+            dev destroyCursor:id.
+        ]
     ]
 !
 
-shallowCopyForFinalization
+executor
     "redefined to return a lightweight copy 
      - all we need is the device handle"
 
@@ -2753,8 +2769,7 @@
 !Cursor methodsFor:'private'!
 
 allocateOnDevice:aDevice
-    "create a new Cursor representing the same cursor as
-     myself on aDevice. Dont search the lobby."
+    "allocate a device-cursor-resource for me on aDevice"
 
     |newCursor id sF mF w h deviceSf deviceMf|
 
@@ -2881,6 +2896,6 @@
 !Cursor class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.72 1999-08-18 17:22:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.73 1999-08-18 17:48:05 cg Exp $'
 ! !
 Cursor initialize!