Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2031.mcz
==================== Summary ====================
Name: Morphic-ct.2031
Author: ct
Time: 24 August 2022, 12:13:26.793424 pm
UUID: c66506c8-e4ae-984d-8c5e-166fc9239dc9
Ancestors: Morphic-ct.2030
Adds missing #cleanUp on SystemProgressMorph.
=============== Diff against Morphic-ct.2030 ===============
Item was added:
+ ----- Method: SystemProgressMorph class>>applyUserInterfaceTheme (in category 'preferences') -----
+ applyUserInterfaceTheme
+
+ self initialize.
+ "no reset here - unique instance is updated on instance side"!
Item was added:
+ ----- Method: SystemProgressMorph class>>cleanUp (in category 'class initialization') -----
+ cleanUp
+
+ self initialize; reset.!
Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.1617.mcz
==================== Summary ====================
Name: Morphic-ct.1617
Author: ct
Time: 12 January 2020, 3:34:20.453555 am
UUID: d75dd5ad-8420-c443-9314-c01d96409fae
Ancestors: Morphic-tpr.1616
Fixes #applyUserInterfaceTheme on SystemProgressMorph really!
Explanation: Resetting the ProgressMorph from the class side is definively bad, because it deletes the progress morph if currently visible. The current instance-side implementation was not reliable either, because if the UniqueInstance is not in world, it cannot apply the new UI theme. Thus we need to override #canApplyUserInterfaceTheme from Morph.
This commit replaces Morphic-ct.1615. See also: http://forum.world.st/SystemProgressMorph-applyUserInterfaceTheme-td5108129…
=============== Diff against Morphic-tpr.1616 ===============
Item was removed:
- ----- Method: SystemProgressMorph class>>applyUserInterfaceTheme (in category 'preferences') -----
- applyUserInterfaceTheme
-
- self reset.!
Item was added:
+ ----- Method: SystemProgressMorph>>canApplyUserInterfaceTheme (in category 'updating') -----
+ canApplyUserInterfaceTheme
+
+ ^ true!
Christoph Thiede uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-ct.2029.mcz
==================== Summary ====================
Name: Morphic-ct.2029
Author: ct
Time: 23 August 2022, 1:44:06.758308 pm
UUID: 929c72ba-79de-ca41-bfad-4182ac5f0d3f
Ancestors: Morphic-ct.2028
Adds public #updateThumbnail: on ProjectViewMorph.
=============== Diff against Morphic-ct.2028 ===============
Item was changed:
----- Method: ProjectViewMorph>>on: (in category 'events') -----
on: aProject
project := aProject.
self addProjectNameMorphFiller.
+ self updateThumbnail: false.!
- lastProjectThumbnail := nil.
- project viewSize ifNil: [project viewSize: self extent].
- project thumbnail: project previewImageForm.
- self extent: project thumbnail extent.!
Item was added:
+ ----- Method: ProjectViewMorph>>updateThumbnail: (in category 'accessing') -----
+ updateThumbnail: forceExtent
+ "Update the thumbnail of the receiver. If forceExtent is false, keep the extent of the previous thumbnail, if any. After scaling up the receiver, this message should be sent with forceExtent = true."
+
+ lastProjectThumbnail := nil.
+ (forceExtent or: [project viewSize isNil]) ifTrue: [
+ project viewSize: self extent].
+ project thumbnail: project previewImageForm.
+ self extent: project thumbnail extent.!
Nicolas Cellier uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-nice.536.mcz
==================== Summary ====================
Name: Graphics-nice.536
Author: nice
Time: 21 August 2022, 5:36:40.736262 pm
UUID: a4930d0f-a408-724e-b9e0-4eb4841607e3
Ancestors: Graphics-nice.535
Further accelerate Color creation from 8 bits components.
For this we pre-multiply the constants by the destination shift - 8, so as to omit the right shift >> 8 followed by the left shift << Red/GreenShift.
- RedShift = 20 bits, 16r403 >> (20-8) = 16r403000
- GreenShift = 10 bits, 16r403 >> (10-8) = 16r100C
=============== Diff against Graphics-nice.535 ===============
Item was changed:
----- Method: Color>>setRed8:green8:blue8: (in category 'private') -----
setRed8: r green8: g blue8: b
"Initialize this color's r, g, and b components to the given values in the range [0..255].
Use an optimized operation rather than a slow division"
"
self assert: ((0 to: 255) allSatisfy: [:e | (e*1023/255) rounded = (e * 16r403 + 16r81 >> 8)]).
"
ComponentMax = 1023 ifFalse: [^self setRed: r / 255 green: g / 255 blue: b / 255].
rgb == nil ifFalse: [self attemptToMutateError].
+ rgb := (r* 16r403000 + 16r81000 bitAnd: 16r3FF00000 "ComponentMask << RedShift" )
+ + (g* 16r100C + 16r204 bitAnd: 16rFFC00 "ComponentMask << GreenShift" )
+ + (b* 16r403 + 16r81 >> 8).
- rgb := ((r* 16r403 + 16r81 >> 8) bitShift: RedShift)
- + ((g* 16r403 + 16r81 >> 8) bitShift: GreenShift)
- + ((b* 16r403 + 16r81 >> 8)).
cachedDepth := nil.
cachedBitPattern := nil.!
Item was changed:
----- Method: Color>>setRed:green:blue:range: (in category 'private') -----
setRed: r green: g blue: b range: range
"Initialize this color's r, g, and b components to the given values in the range [0..r]."
+ range = ComponentMax ifTrue: [^self setPrivateRed: r green: g blue: b].
range = 255 ifTrue: [^self setRed8: r green8: g blue8: b].
^ self setRed: r / range green: g / range blue: b / range!
Item was changed:
DisplayMedium subclass: #Form
instanceVariableNames: 'bits width height depth offset'
classVariableNames: 'CompressOnSnapshot'
poolDictionaries: ''
category: 'Graphics-Display Objects'!
+ !Form commentStamp: 'nice 5/3/2020 18:04' prior: 0!
- !Form commentStamp: 'cbc 5/5/2017 10:07' prior: 0!
A rectangular array of pixels, used for holding images. All pictures, including character images are Forms. The depth of a Form is how many bits are used to specify the color at each pixel. The actual bits are held in a Bitmap, whose internal structure is different at each depth. Class Color allows you to deal with colors without knowing how they are actually encoded inside a Bitmap.
The supported depths (in bits) are 1, 2, 4, 8, 16, and 32. The number of actual colors at these depths are: 2, 4, 16, 256, 32768, and 16 million.
Forms are indexed starting at 0 instead of 1; thus, the top-left pixel of a Form has coordinates 0@0.
Forms are combined using BitBlt. See the comment in class BitBlt. Forms that repeat many times to fill a large destination are InfiniteForms.
colorAt: x@y Returns the abstract Color at this location
displayAt: x@y shows this form on the screen
displayOn: aMedium at: x@y shows this form in a Window, a Form, or other DisplayMedium
fillColor: aColor Set all the pixels to the color.
edit launch an editor to change the bits of this form.
pixelValueAt: x@y The encoded color. The encoding depends on the depth.
+ Details about internal format for Bitmap:
+ Pixels are organised left to right, top to bottom, that is as a contiguous serie of lines.
+ Each pixel is made of a fixed quantity of bits (depth).
+ Thus a Bitmap can be viewed as a rectangular area of size (width*depth x height) in bits.
+ However, the beginning of each line in the bitmap must fall on a 32-bit word boundary.
+ Thus the actual bitSize of a line is rounded up to next multiple of 32.
+ The Bitmap may somehow have unsued bits near the end of each line.
+
+ Note: If you want to hook up other external forms/displayScreens, please look at the (successful) Graphics-External package in http://www.squeaksource.com/Balloon3D.
+
+ !
- Note: If you want to hook up other external forms/displayScreens, please look at the (successful) Graphics-External package in http://www.squeaksource.com/Balloon3D.!
Nicolas Cellier uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-nice.1021.mcz
==================== Summary ====================
Name: Collections-nice.1021
Author: nice
Time: 17 August 2022, 3:55:41.813169 pm
UUID: cae7a6c2-091f-6f4a-a1f6-6acc3e5fa59c
Ancestors: Collections-cmm.1020
Align WeakIdentityDictionary comment with current implementation.
Since Collections-ul.897, the slots corresponding to reclaimed associations (those nilled out) are no longer recycled when scanning for a key.
They are recycled only when the dictionary grows, or possibly when we fix some collision after an explicit removal of a key (via removeKey:).
=============== Diff against Collections-cmm.1020 ===============
Item was changed:
IdentityDictionary subclass: #WeakIdentityDictionary
instanceVariableNames: 'vacuum'
classVariableNames: ''
poolDictionaries: ''
category: 'Collections-Weak'!
+ !WeakIdentityDictionary commentStamp: 'nice 8/17/2022 15:45' prior: 0!
- !WeakIdentityDictionary commentStamp: 'nice 10/27/2016 20:00' prior: 0!
I am a WeakIdentityDictionary, that is a dictionary pointing weakly to its associations of key->value pairs.
I am especially usefull for handling undeclared bindings that will be naturally garbage collected without having to scan all the CompiledMethods.
Instance variables:
vacuum <Object> a unique object used for marking empty slots
Due to usage of WeakArray for my own storage, reclaimed slots will be nilled out.
+ I cannot consider a nil slot as empty because garbage collection does not fix collisions.
- I cannot consider a nil slot as empty because of garbage collection does not fix collisions.
Thus I need to differentiate empty slots (vacuum) from garbaged collected slots (nil).
If I did not reclaim the nil slots and make them vacuum again, then my capacity would grow indefinitely.
+ I skip those nil slots when growing in order to avoid such unbounded growth (see #growTo:).
- My strategy to avoid such growth is to randomly cleanup the garbage collected slot encountered when scanning for a key.
- It should mitigate the growth since this method is used when adding a new entry.
+ Due to those not yet cleaned-up nil slots I might over-estimate my size. See #slowSize to get a more relevant but slower answer.!
- Due to those not yet cleaned-up nil slots I might over-estimate my size. Don't take it too literally.!