keep registry of cursors here - no longer use a Cursor Lobby
authorClaus Gittinger <cg@exept.de>
Wed, 18 Aug 1999 19:24:00 +0200
changeset 2843 e13e0c53924a
parent 2842 dcb1f8eb648f
child 2844 4cdd25ab106e
keep registry of cursors here - no longer use a Cursor Lobby
DevWorkst.st
DeviceWorkstation.st
HostGraphicsDevice.st
--- a/DevWorkst.st	Wed Aug 18 19:23:07 1999 +0200
+++ b/DevWorkst.st	Wed Aug 18 19:24:00 1999 +0200
@@ -2736,6 +2736,10 @@
 !
 
 needDeviceFormsForCursor
+    "return true, if this device requires device-forms as opposed
+     to a simple bitmap-byteArray for creation.
+     Redefined in X- and Win- Workstation classes."
+
     ^ self subclassResponsibility
 !
 
@@ -4735,7 +4739,7 @@
 
     Image releaseResourcesOnDevice:self.
     self releaseDeviceColors.
-    Cursor releaseResourcesOnDevice:self.
+    self releaseDeviceCursors.
     Font releaseResourcesOnDevice:self.
     DeviceGraphicsContext releaseResourcesOnDevice:self.
 
@@ -6455,6 +6459,6 @@
 !DeviceWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.311 1999-08-18 16:42:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/Attic/DevWorkst.st,v 1.312 1999-08-18 17:23:52 cg Exp $'
 ! !
 DeviceWorkstation initialize!
--- a/DeviceWorkstation.st	Wed Aug 18 19:23:07 1999 +0200
+++ b/DeviceWorkstation.st	Wed Aug 18 19:24:00 1999 +0200
@@ -2736,6 +2736,10 @@
 !
 
 needDeviceFormsForCursor
+    "return true, if this device requires device-forms as opposed
+     to a simple bitmap-byteArray for creation.
+     Redefined in X- and Win- Workstation classes."
+
     ^ self subclassResponsibility
 !
 
@@ -4735,7 +4739,7 @@
 
     Image releaseResourcesOnDevice:self.
     self releaseDeviceColors.
-    Cursor releaseResourcesOnDevice:self.
+    self releaseDeviceCursors.
     Font releaseResourcesOnDevice:self.
     DeviceGraphicsContext releaseResourcesOnDevice:self.
 
@@ -6455,6 +6459,6 @@
 !DeviceWorkstation class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.311 1999-08-18 16:42:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/DeviceWorkstation.st,v 1.312 1999-08-18 17:23:52 cg Exp $'
 ! !
 DeviceWorkstation initialize!
--- a/HostGraphicsDevice.st	Wed Aug 18 19:23:07 1999 +0200
+++ b/HostGraphicsDevice.st	Wed Aug 18 19:24:00 1999 +0200
@@ -66,6 +66,15 @@
     "Created: 24.2.1997 / 18:01:41 / cg"
 !
 
+deviceCursors
+    "return the registry keeping track of cursors which were allocated
+     on this device."
+
+    ^ deviceCursors
+
+    "Created: 24.2.1997 / 18:01:41 / cg"
+!
+
 deviceFonts
     "return the registry keeping track of fonts which were allocated
      on this device."
@@ -101,6 +110,20 @@
     "Created: 24.2.1997 / 18:29:14 / cg"
 ! !
 
+!HostGraphicsDevice methodsFor:'cursor stuff'!
+
+registerCursor:aCursor
+    deviceCursors register:aCursor.
+
+    "Created: 24.2.1997 / 18:29:10 / cg"
+!
+
+unregisterCursor:aCursor
+    deviceCursors unregister:aCursor.
+
+    "Created: 24.2.1997 / 18:29:14 / cg"
+! !
+
 !HostGraphicsDevice methodsFor:'font stuff'!
 
 registerFont:aFont
@@ -121,6 +144,7 @@
     deviceViews := Registry new.
     deviceForms := Registry new.
     deviceColors := Registry new.
+    deviceCursors := Registry new.
     deviceFonts := CachingRegistry new cacheSize:10.
 
     "Created: 24.2.1997 / 18:29:53 / cg"
@@ -136,6 +160,16 @@
 
 !
 
+releaseDeviceCursors
+    deviceCursors do:[:aCursor |
+        aCursor setDevice:nil id:nil
+    ].
+    deviceCursors := Registry new.
+
+    "Created: 24.2.1997 / 18:07:49 / cg"
+
+!
+
 releaseDeviceFonts
     deviceFonts := CachingRegistry new cacheSize:10.
 ! !
@@ -143,5 +177,5 @@
 !HostGraphicsDevice class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libview/HostGraphicsDevice.st,v 1.9 1999-08-18 16:44:12 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libview/HostGraphicsDevice.st,v 1.10 1999-08-18 17:24:00 cg Exp $'
 ! !