Merge jv
authorHG Automerge
Thu, 05 Jan 2017 21:04:46 +0000
branchjv
changeset 7770 193c0243d6d2
parent 7769 0e2d4df1926b (current diff)
parent 7763 a78c16c0feaf (diff)
child 7771 3e74422a72dd
Merge
--- a/Color.st	Fri Dec 30 23:11:06 2016 +0000
+++ b/Color.st	Thu Jan 05 21:04:46 2017 +0000
@@ -3840,11 +3840,11 @@
 
     frac1 := proportion asFloat min: 1.0 max: 0.0.
     frac2 := 1.0 - frac1.
-    ^ Color
-	r: ((red * frac1) + (aColor scaledRed * frac2)) / MaxValue
-	g: ((green * frac1) + (aColor scaledGreen * frac2)) / MaxValue
-	b: ((blue * frac1) + (aColor scaledBlue * frac2)) / MaxValue
-	alpha: (self alpha * frac1) + (aColor alpha * frac2)
+    ^ self class
+        r: ((red * frac1) + (aColor scaledRed * frac2)) / MaxValue
+        g: ((green * frac1) + (aColor scaledGreen * frac2)) / MaxValue
+        b: ((blue * frac1) + (aColor scaledBlue * frac2)) / MaxValue
+        alpha: (self alpha * frac1) + (aColor alpha * frac2)
 
     "
      (Color r:1 g:0 b:0 alpha:1) alphaMixed:0.5 with:(Color r:1 g:0 b:0 alpha:1)
@@ -3999,9 +3999,9 @@
     hue := self hue.
     step := 360.0 / thisMany.
     ^ (1 to: thisMany) collect: [:num |
-	    c := Color h: hue s: sat v: bri.  "hue is taken mod 360"
-	    hue := hue + step.
-	    c].
+            c := self class h: hue s: sat v: bri.  "hue is taken mod 360"
+            hue := hue + step.
+            c].
 ! !
 
 !Color methodsFor:'accessing'!
@@ -4542,9 +4542,9 @@
     encoding size == 2 ifTrue:[
         nameOrRGB := encoding at:2.
         nameOrRGB isSymbol ifTrue:[
-            clr := Color perform:nameOrRGB
+            clr := self class perform:nameOrRGB
         ] ifFalse:[
-            clr := Color rgbValue:nameOrRGB.
+            clr := self class rgbValue:nameOrRGB.
         ].
         red := clr scaledRed.
         green := clr scaledGreen.
@@ -4632,7 +4632,7 @@
     b := blue.
 
     "first look if not already there"
-    newColor := Color existingColorScaledRed:r scaledGreen:g scaledBlue:b on:aDevice.
+    newColor := self class existingColorScaledRed:r scaledGreen:g scaledBlue:b on:aDevice.
     (newColor notNil and:[newColor ditherForm isNil]) ifTrue:[^ newColor].
 
     r := (r bitAnd:16rFF00) bitOr:(r bitShift:-8).
@@ -4719,46 +4719,44 @@
     (device == aDevice) ifTrue:[^ self].
 
     "first look if not already there"
-    newColor := Color nearestColorScaledRed:red scaledGreen:green scaledBlue:blue on:aDevice.
+    newColor := self class nearestColorScaledRed:red scaledGreen:green scaledBlue:blue on:aDevice.
     newColor notNil ifTrue:[^ newColor].
 
     "ask that device for the color"
     id := aDevice colorScaledRed:red scaledGreen:green scaledBlue:blue.
     id isNil ifTrue:[
-	"this is a kludge:
-	    scavenge to possuby free unused colors and try again ...
-	    this is a compromise: actually a full GC is required here,
-	    but that is too expensive.
-	"
-" "
-	ObjectMemory scavenge; finalize.
-	id := aDevice colorScaledRed:red scaledGreen:green scaledBlue:blue
-" "
+        "this is a kludge:
+            scavenge to possuby free unused colors and try again ...
+            this is a compromise: actually a full GC is required here,
+            but that is too expensive.
+        "
+        ObjectMemory scavenge; finalize.
+        id := aDevice colorScaledRed:red scaledGreen:green scaledBlue:blue
     ].
     id isNil ifTrue:[
-	"no color - fail"
-
-	^ nil
+        "no color - fail"
+
+        ^ nil
     ].
 
     "receiver was not associated - do it now"
     device isNil ifTrue:[
-	device := aDevice.
-	colorId := id.
-
-	aDevice visualType ~~ #TrueColor ifTrue:[
-	    "/ Lobby register:self.
-	    aDevice registerColor:self.
-	].
-	^ self
+        device := aDevice.
+        colorId := id.
+
+        aDevice visualType ~~ #TrueColor ifTrue:[
+            "/ Lobby register:self.
+            aDevice registerColor:self.
+        ].
+        ^ self
     ].
 
     "receiver was already associated to another device - need a new color"
-    newColor := (self class basicNew) setScaledRed:red scaledGreen:green sclaedBlue:blue device:aDevice.
+    newColor := self class basicNew setScaledRed:red scaledGreen:green scaledBlue:blue device:aDevice.
     newColor setColorId:id.
     aDevice visualType ~~ #TrueColor ifTrue:[
-	"/ Lobby register:newColor.
-	aDevice registerColor:newColor.
+        "/ Lobby register:newColor.
+        aDevice registerColor:newColor.
     ].
     ^ newColor
 
@@ -4845,7 +4843,7 @@
                     device := aDevice.
                     ^ self
                 ].
-                newColor := (self class basicNew)
+                newColor := self class basicNew
                                     setScaledRed:red
                                     scaledGreen:green
                                     scaledBlue:blue
@@ -4892,7 +4890,7 @@
 "/        ^ self
 "/    ].
 
-    newColor := Color existingColorScaledRed:rV scaledGreen:gV scaledBlue:bV on:aDevice.
+    newColor := self class existingColorScaledRed:rV scaledGreen:gV scaledBlue:bV on:aDevice.
     newColor notNil ifTrue:[
         (newColor scaledRed ~~ red
         or:[newColor scaledGreen ~~ green
@@ -4912,7 +4910,7 @@
             device := aDevice.
             newColor := self.
         ] ifFalse:[
-            newColor := (self class basicNew)
+            newColor := self class basicNew
                                 setScaledRed:red
                                 scaledGreen:green
                                 scaledBlue:blue
@@ -5051,7 +5049,7 @@
     "/ receiver was already associated to another device
     "/ - need a new color and return it
 
-    newColor := (self class basicNew)
+    newColor := self class basicNew
                         setScaledRed:red
                         scaledGreen:green
                         scaledBlue:blue
--- a/Cursor.st	Fri Dec 30 23:11:06 2016 +0000
+++ b/Cursor.st	Thu Jan 05 21:04:46 2017 +0000
@@ -420,7 +420,7 @@
     ].
 
     HandCursor :=   
-            (Cursor
+            (self
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000011
@@ -460,7 +460,7 @@
     HandCursor setShape:#upRightHand.
 
     FolderCursor :=   
-            (Cursor
+            (self
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000000
@@ -499,7 +499,7 @@
                     offset: 0@ -3).
 
     DocumentCursor :=   
-            (Cursor
+            (self
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000000
@@ -578,7 +578,7 @@
 "/    OriginCursor setShape:#origin.
 
     OriginCursor :=   
-            (Cursor
+            (self
                     extent: 16@16
                     sourceArray: #(
                         2r1111111111111110
@@ -618,7 +618,7 @@
     OriginCursor setShape:#origin.
 
 "/    TopRightCornerCursor :=   
-"/            (Cursor
+"/            (self
 "/                    extent: 16@16
 "/                    sourceArray: #(
 "/                        2r0000000000000000
@@ -658,7 +658,7 @@
 "/    TopRightCornerCursor setShape:#topRightCorner.
 
     TopRightCornerCursor :=   
-            (Cursor
+            (self
                     extent: 16@16
                     sourceArray: #(
                         2r0111111111111111
@@ -698,7 +698,7 @@
     TopRightCornerCursor setShape:#topRightCorner.
 
 "/    CornerCursor := 
-"/            (Cursor 
+"/            (self 
 "/                    extent: 16@16
 "/                    sourceArray: #(
 "/                        2r0000000000000110
@@ -738,7 +738,7 @@
 "/    CornerCursor setShape:#corner.
 
     CornerCursor := 
-            (Cursor 
+            (self 
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000000
@@ -818,7 +818,7 @@
 "/    BottomLeftCornerCursor setShape:#bottomLeftCorner.
 
     BottomLeftCornerCursor :=   
-            (Cursor
+            (self
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000000
@@ -936,7 +936,7 @@
     WriteCursor setShape:#write.
 
     WaitCursor := 
-              (Cursor
+              (self
                     extent: 16@16
                     sourceArray: #(
                         2r1111111111111111
@@ -976,7 +976,7 @@
     WaitCursor setShape:#wait.
 
     BlankCursor := 
-            (Cursor
+            (self
                     extent: 16@16
                     fromArray: #(
             2r0000000000000000
@@ -999,7 +999,7 @@
     BlankCursor setShape:#blank.
 
     XeqCursor := 
-            (Cursor
+            (self
                     extent: 16@16
                     sourceArray: #(
             2r1000000000010000
@@ -1039,7 +1039,7 @@
     XeqCursor setShape:#execute.
 
     SquareCursor := 
-            (Cursor
+            (self
                     extent: 16@16
                     fromArray: #(
             2r0000000000000000
@@ -1062,7 +1062,7 @@
     SquareCursor setShape:#square.
 
     NormalCursor :=   
-            (Cursor
+            (self
                     extent: 16@16
                     sourceArray: #(
             2r1000000000000000
@@ -1102,7 +1102,7 @@
     NormalCursor setShape:#upLeftArrow.
 
     UpDownArrowCursor :=   
-            (Cursor
+            (self
                  extent: 16@16
                  sourceArray: #(
             2r0000000110000000
@@ -1144,7 +1144,7 @@
     UpDownArrowCursor setShape:#upDownArrow.
 
     LeftRightArrowCursor :=   
-            (Cursor
+            (self
                  extent: 16@16
                  sourceArray: #(
             2r0000000000000000
@@ -1185,7 +1185,7 @@
 
 
     CrossHairCursor :=   
-            (Cursor
+            (self
                  extent: 16@16
                  sourceArray: #(
             2r0000000100000000
@@ -1225,7 +1225,7 @@
     CrossHairCursor setShape:#crossHair.
 
     CrossCursor :=   
-            (Cursor
+            (self
                  extent: 16@16
                  sourceArray: #(
             2r0000000000000000
@@ -1265,7 +1265,7 @@
     CrossCursor setShape:#cross.
 
     RightLimitCursor := 
-            Cursor
+            self
                     extent: 16@16
                     sourceArray: #(
                 2r0000000000000110
@@ -1305,7 +1305,7 @@
     RightLimitCursor setShape:#rightLimitArrow.
 
     LeftLimitCursor := 
-            Cursor
+            self
                     extent: 16@16
                     sourceArray: #(
                 2r0110000000000000 
@@ -1347,7 +1347,7 @@
     LeftLimitCursor setShape:#leftLimitArrow.
 
     UpLimitCursor := 
-            Cursor
+            self
                     extent: 16@16
                     sourceArray: #(
                 2r0000000000000000
@@ -1389,7 +1389,7 @@
     UpLimitCursor setShape:#upLimitArrow.
 
     DownLimitCursor := 
-            Cursor
+            self
                     extent: 16@16
                     sourceArray: #(
                 2r0000000000000000
@@ -1429,7 +1429,7 @@
     DownLimitCursor setShape:#downLimitArrow.
 
     LeftRightArrowCursor := 
-            Cursor
+            self
                     extent: 16@16
                     sourceArray: #(
                 2r0000000000000000
@@ -1509,7 +1509,7 @@
     ].
 
     MarkerCursor := 
-            Cursor
+            self
                     extent: 16@16
                     sourceArray:bits
                     maskArray: #(
@@ -1573,7 +1573,7 @@
     ].
 
     UpCursor := 
-            Cursor 
+            self
                     extent: 16@16
                     sourceArray:bits
                     maskArray: #(
@@ -1637,7 +1637,7 @@
     ].
 
     DownCursor :=
-             Cursor 
+             self
                     extent: 16@16
                     sourceArray:bits
                     maskArray: #(
@@ -1701,7 +1701,7 @@
     ].
 
     LeftCursor := 
-            Cursor 
+            self
                     extent: 16@16
                     sourceArray:bits
                     maskArray: #(
@@ -1765,7 +1765,7 @@
     ].
 
     RightCursor :=
-             Cursor 
+             self
                     extent: 16@16
                     sourceArray: bits
                     maskArray: #(
@@ -1829,7 +1829,7 @@
     ].
 
     XMarkerCursor := 
-            Cursor
+            self
                     extent: 16@16
                     sourceArray: bits
                     maskArray: #(
@@ -1853,7 +1853,7 @@
     RightCursor setShape:#xMarker.
 
     FourWayCursor := 
-            Cursor
+            self
                     extent: 16@16
                     sourceArray: #(
             2r0000000100000000
@@ -1892,7 +1892,7 @@
                     offset: -7@ -7.
     FourWayCursor setShape:#fourWay.
 
-    ThumbsUpCursor := (Cursor
+    ThumbsUpCursor := (self
                       extent: 16@16
                       sourceArray: #(
                           2r0000000000100000
@@ -1931,7 +1931,7 @@
                       offset: -8@ 0).
     ThumbsUpCursor setShape:#thumbsUp.
 
-    CaretCursor := (Cursor
+    CaretCursor := (self
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000000
@@ -1970,7 +1970,7 @@
                     offset: -8@0).
     CaretCursor setShape:#caret.
 
-    ThumbsDownCursor := (Cursor
+    ThumbsDownCursor := (self
                       extent: 16@16
                       sourceArray: #(
                           2r0001111111100000
@@ -2010,7 +2010,7 @@
                       offset: -8@ -15 "-16").
     ThumbsDownCursor setShape:#thumbsDown.
 
-    StopCursor := (Cursor
+    StopCursor := (self
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000000
@@ -2051,7 +2051,7 @@
                     offset: -8 @ -8).
     StopCursor setShape:#stop.
 
-    EyeCursor := (Cursor
+    EyeCursor := (self
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000000
@@ -2092,7 +2092,7 @@
                     offset: -8 @ -8).
     EyeCursor setShape:#eye.
 
-    ClosedEyeCursor := (Cursor
+    ClosedEyeCursor := (self
                     extent: 16@16
                     sourceArray: #(
                         2r0000000000000000
@@ -2174,7 +2174,7 @@
                   2r0000001111000000).
     ].
 
-    QuestionMarkCursor := (Cursor
+    QuestionMarkCursor := (self
                     extent: 16@16
                     sourceArray:bits 
                     maskArray:mask 
@@ -2230,7 +2230,7 @@
 
     "
      HandCursor := nil.   
-     Cursor initializeNewCursors.
+     self initializeNewCursors.
     "
 
     "Modified: / 13.12.1999 / 12:25:48 / cg"