Merge jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Mon, 19 Sep 2016 13:38:17 +0100
branchjv
changeset 7575 151c445c946c
parent 7557 373ae194f1d6 (current diff)
parent 7571 ba05e480c941 (diff)
child 7576 799e0846f5b0
Merge
DeviceGraphicsContext.st
FontDescription.st
GraphicsMedium.st
Image.st
SimpleView.st
StandardSystemView.st
XftFontDescription.st
--- a/Color.st	Mon Sep 12 06:58:02 2016 +0200
+++ b/Color.st	Mon Sep 19 13:38:17 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1992 by Claus Gittinger
 	      All Rights Reserved
@@ -996,14 +994,14 @@
 
 hue:h light:l saturation:s
     "return a color from hue, light and saturation values.
-     Hue is in degrees (0..360); light and sturation are
+     Hue is in degrees (0..360); light and saturation are
      in percent (0..100)"
 
     self withRGBFromHue:h light:l saturation:s do:[:r :g :b |
-	^ self
-	    redPercent:(r clampBetween:0 and:100)
-	    greenPercent:(g clampBetween:0 and:100)
-	    bluePercent:(b clampBetween:0 and:100)
+        ^ self
+            redPercent:(r clampBetween:0 and:100)
+            greenPercent:(g clampBetween:0 and:100)
+            bluePercent:(b clampBetween:0 and:100)
     ]
 
     "
--- a/DeviceWorkstation.st	Mon Sep 12 06:58:02 2016 +0200
+++ b/DeviceWorkstation.st	Mon Sep 19 13:38:17 2016 +0100
@@ -4734,27 +4734,24 @@
     dispatching ifFalse:[^ self].
 
     self == Display ifTrue:[
-	ExitOnLastClose == true ifFalse:[^ self].
+        ExitOnLastClose == true ifFalse:[^ self].
     ].
     exitOnLastClose == true ifFalse:[^ self].
 
     knownViews notNil ifTrue:[
-	"/ if there is no non-popup topview, stop dispatching
-	(knownViews contains:[:slot |
-		slot notNil
-		and:[(self viewIsRelevantInCheckForEndOfDispatch:slot)
-		and:[true "slot isModal not"
-		"and:[slot realized]"]]]
-	 ) ifFalse:[
-	    "/ my last view was closed
-	    dispatching := false.
-	    Logger info:'finished dispatch (last view closed): %1' with:self.
-	    LastActiveScreen == self ifTrue:[
-		LastActiveScreen := nil.
-		LastActiveProcess := nil.
-	    ].
-	    eventSema notNil ifTrue:[eventSema signal].  "/ get dispatchLoop out of its wait...
-	]
+        "/ if there is no non-popup topview, stop dispatching
+        (knownViews contains:[:slot |
+                slot notNil
+                and:[(self viewIsRelevantInCheckForEndOfDispatch:slot)
+                and:[true "slot isModal not"
+                "and:[slot realized]"]]]
+         ) ifFalse:[
+            "/ my last view was closed
+            dispatching := false.
+            Logger info:'finished dispatch (last view closed): %1' with:self.
+            self releaseDeviceResources.
+            eventSema notNil ifTrue:[eventSema signal].  "/ get dispatchLoop out of its wait...
+        ]
     ].
 
     "Modified: 19.9.1995 / 11:31:54 / claus"
@@ -6288,22 +6285,25 @@
      (i.e. be prepared to not be able to release resources regularily)"
 
     LastActiveScreen == self ifTrue:[
-	LastActiveScreen := nil.
-	LastActiveProcess := nil.
+        LastActiveScreen := nil.
+        LastActiveProcess := nil.
     ].
 
     Image releaseResourcesOnDevice:self.
+    Icon notNil ifTrue:[
+        Icon releaseCachedIconsFromDevice:self.
+    ].
 
     "This unregisters all the finalization handles"
     self releaseGraphicsContexts.
 
     blackColor notNil ifTrue:[
-	blackColor releaseFromDevice.
-	blackColor := nil.
+        blackColor releaseFromDevice.
+        blackColor := nil.
     ].
     whiteColor notNil ifTrue:[
-	whiteColor releaseFromDevice.
-	whiteColor := nil.
+        whiteColor releaseFromDevice.
+        whiteColor := nil.
     ].
     self releaseDeviceColors.
     self releaseDeviceCursors.
--- a/FontDescription.st	Mon Sep 12 06:58:02 2016 +0200
+++ b/FontDescription.st	Mon Sep 19 13:38:17 2016 +0100
@@ -9,8 +9,6 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-'From Smalltalk/X, Version:7.1.0.0 on 20-07-2016 at 15:21:49'                   !
-
 "{ Package: 'stx:libview' }"
 
 "{ NameSpace: Smalltalk }"
@@ -930,15 +928,17 @@
     "two fonts are considered equal, if the font-name components are;
      independent of the device, the font is on"
 
-    (aFont species == self species) ifFalse:[^ false].
-    (size == aFont size) ifFalse:[^ false].  
-    (family = aFont family) ifFalse:[^ false].  
-    (face = aFont face) ifFalse:[^ false].  
-    (style = aFont style) ifFalse:[^ false].  
-    (encoding == aFont encoding) ifFalse:[^ false].  
-    (sizeUnit == aFont sizeUnit) ifFalse:[^ false].
+    (aFont species ~~ self species) ifTrue:[^ false].
+    (size ~~ aFont size) ifTrue:[^ false].  
+    (family ~= aFont family) ifTrue:[^ false].  
+    (face ~= aFont face) ifTrue:[^ false].  
+    (style ~= aFont style) ifTrue:[^ false].  
+    (encoding ~~ aFont encoding) ifTrue:[^ false].  
+    (sizeUnit ~~ aFont sizeUnit) ifTrue:[^ false].
     sizeUnit == #px ifTrue:[
-        (pixelSize == aFont pixelSize) ifFalse:[^ false].  
+        (pixelSize ~~ aFont pixelSize) ifTrue:[^ false].  
+    ] ifFalse:[
+        (size ~~ aFont size) ifTrue:[^ false].  
     ].
     ^ true
 
@@ -958,7 +958,7 @@
 !
 
 sameDeviceFontAs:aFont
-    aFont species == self species ifFalse:[^ false].
+    aFont species ~~ self species ifTrue:[^ false].
 
     ^ self sameFamily: aFont family 
                  face: aFont face
@@ -969,7 +969,8 @@
              encoding: aFont encoding
 
     "Modified: / 29-02-2016 / 08:30:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
-!
+ 
+!    
 
 sameFamily: otherFamily face: otherFace style: otherStyle size: otherSize unit: otherSizeUnit pixelSize: otherPixelSize encoding: otherEncoding
     (family = otherFamily) ifFalse:[ ^ false ].
@@ -981,9 +982,9 @@
     (encoding isNil or:[encoding = otherEncoding]) ifFalse:[ ^ false ].
     (sizeUnit ? #pt) = otherSizeUnit ifFalse:[ ^ false ].
     (sizeUnit ? #pt) == #pt ifTrue:[
-        (size = otherSize) ifFalse:[ ^ false ].
+        (size ~= otherSize) ifTrue:[ ^ false ].
     ] ifFalse:[
-        (pixelSize = otherPixelSize) ifFalse:[ ^ false ].
+        (pixelSize ~= otherPixelSize) ifTrue:[ ^ false ].
     ].
     ^ true
 
@@ -1248,6 +1249,27 @@
    "Created: 28.3.1997 / 16:09:30 / cg"
 !
 
+scaled:factor 
+    "return another font corresponding to the receiver's family, face and style but
+     with another pixel size"
+    
+    |newFont|
+
+    family isNil ifTrue:[
+        "CompoundFonts do not have a family"
+        ^ self
+    ].
+    newFont := self class 
+            family:family
+            face:face
+            style:style
+            size:(size * factor) rounded
+            sizeUnit:sizeUnit
+            encoding:encoding.
+    newFont isGenericFont:self isGenericFont.
+    ^ newFont onDevice:self graphicsDevice.
+!
+
 size:anotherSize
     <resource: #obsolete>
  
--- a/GraphicsMedium.st	Mon Sep 12 06:58:02 2016 +0200
+++ b/GraphicsMedium.st	Mon Sep 19 13:38:17 2016 +0100
@@ -531,7 +531,7 @@
      This is a low level entry, which is not to be redefined
      (i.e. it must not imply a redraw operation)"
 
-    gc basicFont:aFont
+    gc font:aFont
 !
 
 blackColor
@@ -822,7 +822,7 @@
      This should be redefined in some widget to perform an automatic
      redraw. See also: #basicFont:"
 
-    gc basicFont:aFont.
+    gc font:aFont.
     self changed:#font.
 !
 
--- a/Image.st	Mon Sep 12 06:58:02 2016 +0200
+++ b/Image.st	Mon Sep 19 13:38:17 2016 +0100
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1991 by Claus Gittinger
               All Rights Reserved
@@ -1650,7 +1652,7 @@
      to release all cached Images from that device"
 
     Lobby
-        unregisterAllForWhich:[:eachImage |
+        unregisterAllForWhichHandle:[:eachImage |
             |ok|
 
             ok := eachImage graphicsDevice == aDevice.
--- a/SimpleView.st	Mon Sep 12 06:58:02 2016 +0200
+++ b/SimpleView.st	Mon Sep 19 13:38:17 2016 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1989 by Claus Gittinger
 	      All Rights Reserved
@@ -2732,6 +2730,7 @@
 	    self extentChangedFlag:true
 	]
     ] ifFalse:[
+        extentRule := nil.
 	w := extent x.
 	h := extent y.
 	w isNil ifTrue:[w := width].
@@ -8651,7 +8650,7 @@
 
                 oldPaint := nil.
                 newWidth > width ifTrue:[
-                    self clippingRectangle:nil.
+                    self clippingBounds:nil.
                     oldPaint := self paint.
                     self paint:viewBackground.
                     self fillDeviceRectangleX:(width - margin)
@@ -8661,7 +8660,7 @@
                     mustRepaintRight := true.
                 ].
                 newHeight > height ifTrue:[
-                    self clippingRectangle:nil.
+                    self clippingBounds:nil.
                     oldPaint := self paint.
                     self paint:viewBackground.
                     self fillDeviceRectangleX:0
@@ -8717,7 +8716,7 @@
                         self invalidateDeviceRectangle:(((width - margin) @ 0) extent:margin@height) repairNow:false.
                     ].
                 ] ifFalse:[
-                    self deviceClippingRectangle:nil.
+                    self deviceClippingBounds:nil.
                     oldPaint := self paint.
                     mustRedrawBottomEdge ifTrue:[
                         self drawBottomEdge
@@ -8726,7 +8725,7 @@
                         self drawRightEdge
                     ].
                     self paint:oldPaint.
-                    self deviceClippingRectangle:innerClipRect
+                    self deviceClippingBounds:innerClipRect
                 ]
             ].
         ].
@@ -8758,7 +8757,7 @@
             self originChangedFlag:true.
         ].
         self extentChangedFlag:true.
-        subViews size > 0 ifTrue:[
+        subViews notEmptyOrNil ifTrue:[
             self extentChangedBeforeCreatedFlag:true.
         ].
     ].
--- a/StandardSystemView.st	Mon Sep 12 06:58:02 2016 +0200
+++ b/StandardSystemView.st	Mon Sep 19 13:38:17 2016 +0100
@@ -9,8 +9,6 @@
  other person.  No title to or ownership of the software is
  hereby transferred.
 "
-'From Smalltalk/X, Version:6.2.3.0 on 19-03-2014 at 15:29:39'                   !
-
 "{ Package: 'stx:libview' }"
 
 "{ NameSpace: Smalltalk }"
@@ -1217,7 +1215,7 @@
 !
 
 reinitialize
-    "reopen the receiver if if was visible before.
+    "reopen the receiver if it was visible before.
      This is called right after snapIn; Notice, that all instance variables
      (such as shown, realized etc.) are left-overs from the time the snapout
      was done. Remap the receiver, if it was mapped at snapout time"
@@ -1226,7 +1224,7 @@
 
     "if I have already been reinited - return"
     self drawableId notNil ifTrue:[
-	^ self
+        ^ self
     ].
 
     "have to kludge with the controller
@@ -1240,13 +1238,13 @@
 
     "if I was iconified (not realized), remap iconified"
     device
-	mapView:self id:self drawableId iconified:(realized "shown" not)
-	atX:left y:top width:width height:height
-	minExtent:minExtent maxExtent:maxExtent.
+        mapView:self id:self drawableId iconified:(realized "shown" not)
+        atX:left y:top width:width height:height
+        minExtent:minExtent maxExtent:maxExtent.
 
     "and restart the window-group process"
     windowGroup notNil ifTrue:[
-	windowGroup restart
+        windowGroup restart
     ].
 
     "restore controller"