Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.229.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.229
Author: mt
Time: 9 July 2019, 2:08:54.585973 pm
UUID: eb513b5e-2448-442a-b8c0-1e5f313610df
Ancestors: ToolBuilder-Morphic-mt.228
Addition to ShoutCore-mt.64. Reverts Shout's background-styling callback to the older, much simpler version. SHTextStyler handles UI-process synchronization of callback (again).
=============== Diff against ToolBuilder-Morphic-mt.228 ===============
Item was changed:
----- Method: PluggableTextMorphPlus>>stylerStyledInBackground: (in category 'styling') -----
stylerStyledInBackground: styledCopyOfText
"Sent after the styler completed styling of the text"
"It is possible that the text string has changed since the styling began. Disregard the styles if styledCopyOfText's string differs with the current textMorph contents string"
+ textMorph contents string = styledCopyOfText string
+ ifTrue: [self stylerStyled: styledCopyOfText]!
- Project current addDeferredUIMessage: [
- textMorph contents string = styledCopyOfText string
- ifTrue: [self stylerStyled: styledCopyOfText]].!
Marcel Taeumel uploaded a new version of ShoutCore to project The Trunk:
http://source.squeak.org/trunk/ShoutCore-mt.64.mcz
==================== Summary ====================
Name: ShoutCore-mt.64
Author: mt
Time: 9 July 2019, 2:07:39.898973 pm
UUID: 4a783083-891a-4556-a362-2a401660f5bf
Ancestors: ShoutCore-nice.63
Removes the semaphore from Shout's background styling. It is not needed because we can synchronize with the current project's UI process using #addDeferredUIMessage:.
=============== Diff against ShoutCore-nice.63 ===============
Item was changed:
Object subclass: #SHTextStyler
+ instanceVariableNames: 'backgroundProcess text monitor view stylingEnabled'
- instanceVariableNames: 'sem backgroundProcess text monitor view stylingEnabled'
classVariableNames: ''
poolDictionaries: ''
category: 'ShoutCore-Styling'!
!SHTextStyler commentStamp: 'tween 8/27/2004 10:54' prior: 0!
I am an Abstract class.
Subclasses of me can create formatted, coloured, and styled copies of Text that is given to them.
They may perform their styling asynchronously, in a background process which I create and manage.
My public interface is...
view: aViewOrMorph - set the view that will receive notifications when styling has completed.
format: aText - modifies aText's string
style: aText - modifies the TextAttributes of aText, but does not change the string, then sends #stylerStyled: to the view.
styleInBackgroundProcess: aText - performs style: in a background process, then sends #stylerStylednBackground: to the view.
styledTextFor: aText - answers a formatted and styled copy of aText
unstyledTextFrom: aText - answers a copy of aText with all TextAttributes removed
Subclasses of me should re-implement...
privateFormat: aText - answer a formatted version of aText; the String may be changed
privateStyle: aText - modify the TextAttributes of aText; but do not change the String
!
Item was changed:
----- Method: SHTextStyler>>styleInBackgroundProcess: (in category 'styling') -----
styleInBackgroundProcess: aText
self terminateBackgroundStylingProcess.
+
+ stylingEnabled ifTrue: [
- stylingEnabled ifTrue:[
text := aText copy.
self monitor critical: [
+ backgroundProcess := [
+ self privateStyle: text.
+ view ifNotNil: [:v | Project current addDeferredUIMessage: [v stylerStyledInBackground: text]].
+ ] forkAt: Processor userBackgroundPriority] ]
- sem := Semaphore new.
- [sem notNil
- ifTrue: [
- sem wait.
- view ifNotNil:[view stylerStyledInBackground: text]]
- ] forkAt: Processor activePriority.
- backgroundProcess :=
- [self privateStyle: text.
- sem signal]
- forkAt: Processor userBackgroundPriority] ]
!
Item was changed:
----- Method: SHTextStyler>>terminateBackgroundStylingProcess (in category 'private') -----
terminateBackgroundStylingProcess
+
self monitor critical: [
backgroundProcess
ifNotNil: [
backgroundProcess terminate.
+ backgroundProcess := nil]].!
- backgroundProcess := nil].
- sem
- ifNotNil:[
- sem terminateProcess.
- sem := nil].
- ] !
Item was changed:
----- Method: SHTextStyler>>veryDeepInner: (in category 'copying') -----
veryDeepInner: aDeepCopier
super veryDeepInner: aDeepCopier.
+ backgroundProcess := monitor := nil.
- sem := backgroundProcess := monitor := nil.
text := text veryDeepCopyWith: aDeepCopier.
view := view veryDeepCopyWith: aDeepCopier!
David T. Lewis uploaded a new version of Chronology-Core to project The Trunk:
http://source.squeak.org/trunk/Chronology-Core-dtl.48.mcz
==================== Summary ====================
Name: Chronology-Core-dtl.48
Author: dtl
Time: 5 July 2019, 1:08:16.059032 pm
UUID: 7f33ce2e-ae95-48ef-a526-63da7ddfd885
Ancestors: Chronology-Core-cmm.47
Fix fallback code for primPosixMicrosecondClockWithOffset: to not allow DateAndTime class>>now to create an instance with nil instance variables. Previous fallback code was a cut and paste error, never worked as intended.
Rationale for the fallback handling: Corrupt DateAndTime can quickly lead to a broken image. A default value of the Posix epoch is easily recognized as un uninitialized DateAndTime.
To test, evaluate "Time clockPolicy: #acceptPlatformTime" and comment out the primitive call in Time class>>primPosixMicrosecondClockWithOffset: to simulate the case of a VM that does not provide primitiveUtcWithOffset. In this case, DateAndTime now produces 1970-01-01T00:00:00+00:00. After testing, do Time initialze to restore clock policy.
=============== Diff against Chronology-Core-cmm.47 ===============
Item was changed:
----- Method: Time class>>posixMicrosecondClockWithOffset: (in category 'clock') -----
posixMicrosecondClockWithOffset: aDateAndTime
"Initialize aDateAndTime initialized with local microseconds since the Posix
epoch and the current seconds offset from GMT in the local time zone."
| utcValue |
self primPosixMicrosecondClockWithOffset: aDateAndTime.
- aDateAndTime utcMicroseconds ifNil: [ ^aDateAndTime]. "primitive failed"
ClockPolicy caseOf: {
[#acceptPlatformTime] -> [^ aDateAndTime] .
[#monotonicAllowDuplicates] -> [
utcValue := aDateAndTime utcMicroseconds.
utcValue > LastClockTick
ifTrue: [LastClockTick := utcValue]
ifFalse: [aDateAndTime utcMicroseconds: LastClockTick]] .
[#monotonicForceMicrosecondIncrement] -> [
utcValue := aDateAndTime utcMicroseconds.
utcValue > LastClockTick
ifTrue: [LastClockTick := utcValue]
ifFalse: [LastClockTick := LastClockTick + 1. "add one microsecond"
aDateAndTime utcMicroseconds: LastClockTick]] .
[#monotonicForceNanosecondIncrement] -> [
utcValue := aDateAndTime utcMicroseconds.
utcValue > LastClockTick
ifTrue: [LastClockTick := utcValue]
ifFalse: [LastClockTick := LastClockTick + (1 / 1000). "add one nanosecond"
aDateAndTime utcMicroseconds: LastClockTick]]
} otherwise: [].
^aDateAndTime
!
Item was changed:
----- Method: Time class>>primPosixMicrosecondClockWithOffset: (in category 'private') -----
primPosixMicrosecondClockWithOffset: arrayOrObjectWithTwoSlots
"Answer an array with UTC microseconds since the Posix epoch and the
current seconds offset from GMT in the local time zone. If the primitive is
not available, then answer the time and offset of Posix epoch GMT. This enables
the image to continue running in the absence of #primitiveUtcWithOffset, thus
avoiding the need to fallback code based on the earlier local microsecond clock
mechanism.
The parameter may be a two element array, or an object whose first two instance
variables are expected to be UTC microseconds and seconds offset from GMT."
<primitive: 'primitiveUtcWithOffset'>
+
+ (arrayOrObjectWithTwoSlots instVarAt: 1)
+ ifNil: [arrayOrObjectWithTwoSlots instVarAt: 1 put: 0].
+ (arrayOrObjectWithTwoSlots instVarAt: 2)
+ ifNil: [arrayOrObjectWithTwoSlots instVarAt: 2 put: 0]!
- ^{0. 0}!
David T. Lewis uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-cmfcmf.1490.mcz
==================== Summary ====================
Name: Morphic-cmfcmf.1490
Author: cmfcmf
Time: 30 June 2019, 12:04:13.370226 pm
UUID: ab2320d7-f8f4-df46-a786-ec28230e912c
Ancestors: Morphic-pre.1489
When wrapping a Morph into a flex shell, first add the flex shell to the Morph's owner (and thus to the Morph's world) before making the Morph a submorph of the flex shell.
This avoids unnecessarily sending outOfWorld: to the Morph when adding it to the new flex shell (which doesn't have a world after creation) and intoWorld: when adding the flex shell to the Morph's owner right thereafter.
=============== Diff against Morphic-pre.1489 ===============
Item was changed:
----- Method: Morph>>addFlexShell (in category 'rotate scale and flex') -----
addFlexShell
"Wrap a rotating and scaling shell around this morph."
| oldHalo myWorld flexMorph anIndex |
-
oldHalo:= self halo.
myWorld := self world.
self owner
ifNil: [flexMorph := self newTransformationMorph asFlexOf: self]
ifNotNil: [:myOwner |
anIndex := myOwner submorphIndexOf: self.
+ "Avoid triggering outOfWorld: on self by first adding flexMorph to myOwner and only then making myself a submorph of flexMorph via asFlexOf:"
+ flexMorph := self newTransformationMorph.
- flexMorph := self newTransformationMorph asFlexOf: self.
myOwner addMorph: flexMorph asElementNumber: anIndex.
+ flexMorph asFlexOf: self.
myWorld ifNotNil: [myWorld startSteppingSubmorphsOf: flexMorph]].
self transferStateToRenderer: flexMorph.
oldHalo ifNotNil: [oldHalo setTarget: flexMorph].
^ flexMorph!
Marcel Taeumel uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-mt.412.mcz
==================== Summary ====================
Name: Tests-mt.412
Author: mt
Time: 5 July 2019, 4:19:48.095927 pm
UUID: 2c15b9f3-d33e-42b6-b9f5-bab98e2f6d03
Ancestors: Tests-pre.411
Fixes max-literals test for EncoderV3* (i.e., pre-SistaV1).
=============== Diff against Tests-pre.411 ===============
Item was changed:
----- Method: CompilerTest>>testMaxLiteralsWithClassReferenceInClosure (in category 'limits') -----
testMaxLiteralsWithClassReferenceInClosure
"Document the maximum number of literals in a compiled method. A class
reference in a closure reduces the maximum literals."
| bytecodeSetEncoder maxLiterals stringThatCanBeCompiled stringWithOneTooManyLiterals |
bytecodeSetEncoder := CompiledMethod preferredBytecodeSetEncoderClass new.
maxLiterals := bytecodeSetEncoder maxNumLiterals
- 2 "for selector & methodClass"
+ - (bytecodeSetEncoder supportsFullBlocks ifTrue: [1] ifFalse: [5 "For this example. See below"])
- - (bytecodeSetEncoder supportsFullBlocks ifTrue: [1] ifFalse: [0])
- 4 "for the implicit stream processing into which the brace construct is compiled: (Array braceStream: size) braceArray".
stringThatCanBeCompiled := '[ DateAndTime now. Date today. Time ]. { ',
(String streamContents: [:strm |
1 to: maxLiterals do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
stringWithOneTooManyLiterals := '[ DateAndTime now. Date today. Time ]. { ',
(String streamContents: [:strm |
1 to: maxLiterals + 1 do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
self assert: maxLiterals equals: (Compiler evaluate: stringThatCanBeCompiled) size.
"If the following test fails, it means that the limit has been raised or eliminated,
and this test should be updated to reflect the improvement."
self should: [Compiler evaluate: stringWithOneTooManyLiterals] raise: Error.
!