Nicolas Cellier uploaded a new version of Squeak-Version to project The Trunk:
http://source.squeak.org/trunk/Squeak-Version-nice.4730.mcz
==================== Summary ====================
Name: Squeak-Version-nice.4730
Author: nice
Time: 8 April 2017, 8:17:12.852754 pm
UUID: 315565ef-844e-45b0-8397-057caca5875a
Ancestors: Squeak-Version-nice.4729
Make the MethodContext -> Context transition hack more robust post removal of ContextPart.
=============== Diff against Squeak-Version-nice.4729 ===============
Item was changed:
(PackageInfo named: 'Squeak-Version') preamble: '"This is a hack to finalize #MethodContext -> Context renaming.
The #bootstrapContext left two problems:
1) there is a binding #MethodContext => Context.
2) ContextPart still think it has Context as subclass, though this one changed its superclass.
We must make sure that the removal of these class won''t destroy Context."
Smalltalk globals unbind: #MethodContext.
[Undeclared at: #MethodContext put: Context copy] on: AttemptToWriteReadOnlyGlobal do: [:exc | exc resume: true].
+ ContextPart ifNil: [^self].
+ ContextPart isBehavior ifFalse: [^self].
ContextPart instVarAt: 6 put: (ContextPart subclasses select: [:e | e superclass = ContextPart])
'!
Nicolas Cellier uploaded a new version of Squeak-Version to project The Trunk:
http://source.squeak.org/trunk/Squeak-Version-nice.4729.mcz
==================== Summary ====================
Name: Squeak-Version-nice.4729
Author: nice
Time: 8 April 2017, 5:51:06.804061 pm
UUID: 9bfa711b-9085-4017-bf05-9472a75394a9
Ancestors: Squeak-Version-nice.4728
Renew the hack for restoring updateStream again (see preamble script). This time move #MethodContext binding in Undeclared.
=============== Diff against Squeak-Version-nice.4728 ===============
Item was changed:
(PackageInfo named: 'Squeak-Version') preamble: '"This is a hack to finalize #MethodContext -> Context renaming.
The #bootstrapContext left two problems:
1) there is a binding #MethodContext => Context.
2) ContextPart still think it has Context as subclass, though this one changed its superclass.
We must make sure that the removal of these class won''t destroy Context."
+ Smalltalk globals unbind: #MethodContext.
+ [Undeclared at: #MethodContext put: Context copy] on: AttemptToWriteReadOnlyGlobal do: [:exc | exc resume: true].
- [Smalltalk globals at: #MethodContext put: Context copy] on: AttemptToWriteReadOnlyGlobal do: [:exc | exc resume: true].
ContextPart instVarAt: 6 put: (ContextPart subclasses select: [:e | e superclass = ContextPart])
'!
Nicolas Cellier uploaded a new version of Squeak-Version to project The Trunk:
http://source.squeak.org/trunk/Squeak-Version-nice.4728.mcz
==================== Summary ====================
Name: Squeak-Version-nice.4728
Author: nice
Time: 8 April 2017, 4:45:37.353368 pm
UUID: 4a448a44-03bd-43c3-9a5e-752ab51ae8f9
Ancestors: Squeak-Version-nice.4727
Renew the hack for restoring the update process.
=============== Diff against Squeak-Version-nice.4727 ===============
Item was changed:
+ (PackageInfo named: 'Squeak-Version') preamble: '"This is a hack to finalize #MethodContext -> Context renaming.
+ The #bootstrapContext left two problems:
+ 1) there is a binding #MethodContext => Context.
+ 2) ContextPart still think it has Context as subclass, though this one changed its superclass.
+ We must make sure that the removal of these class won''t destroy Context."
- (PackageInfo named: 'Squeak-Version') preamble: '"This is a hack to make sure that #MethodContext keys vanished from Undeclared before loading Kernel-eem.1078.
- Otherwise, the Undeclared binding points to Context after the rename that occured in bootstrapContext, and Context will be removed when attempting to remove MethodContext."
+ [Smalltalk globals at: #MethodContext put: Context copy] on: AttemptToWriteReadOnlyGlobal do: [:exc | exc resume: true].
+
+ ContextPart instVarAt: 6 put: (ContextPart subclasses select: [:e | e superclass = ContextPart])
- Smalltalk garbageCollect.
- Smalltalk garbageCollect.
'!
As part of the never ending Weather station project I’m making a rotary dial morph that can be used to display things such as barometers, speedometers, vu meters, clocks, compasses etc - pretty much anything where a needle thing rotates about a pivot in order to point to a value on a scale.
Clearly one can be ultra simplistic and use a LineMorph over a CircleMorph but that isn't terribly pretty. Right now I have things set up to simply add submorphs to build whatever background and borders and tick marks are wanted, plus the needle. With an ImageMorph (or should it be a SketchMorph?) providing a picture of the dial/scale/frame it can look quite nice.
However, the needle is a problem. A simple Line or PolygonMorph can be used and then it is possible to set the rotationCenter such that subsequent #rotationDegrees: make it turn about that centre. So far, so good. I’d prefer to allow arbitrary morphs for the needle - again, an image would be good in a lot of cases - but I cannot for the life of me find how to make general morphs rotate about a set point. I can use #rotationCenter: and the value is stuck in the extension as expected. If I use the halo rotate after doing that the new center point is clearly shown in the right place BUT it still rotates about the center of the bounds. I can’t find any illuminating usages of #rotationCenter to show how the new center point is used and certainly nothing that makes it look like it is ever treated as the pivot.
I’ve dug into using asFlexShell and friends with no improvement. I’ve searched through the swiki. I’ve compared a 5.0 image with the 6alpha image. To cause further concern pretty much all the rotate related code I can find seems to be in the EToys package, which may mean it would go away when we make a more typical release image. Isn’t rotating morphs a relatively basic part of using them?
What have I missed, or looked at without actually seeing?
tim
--
tim Rowledge; tim(a)rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: LTT: Lose Timing Track
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-mva.1334.mcz
==================== Summary ====================
Name: Morphic-mva.1334
Author: mva
Time: 7 April 2017, 6:05:52.930071 pm
UUID: cf00184d-16fc-470f-bda7-3464f82b28f0
Ancestors: Morphic-cmm.1333
A quick hack - proof of concept - as a reaction to "I'd like to see system windows collapse when dropped in the menu bar".
http://lists.squeakfoundation.org/pipermail/squeak-dev/2017-April/194079.ht…
Drag a system window to the menu bar - it will collapse.
Drag it out to the world - it will expand.
Caveats.
When you drag a window in world - it will expand when you drop it.
When you collapse a window in world - it will will stay up. You can send it back with the 'send to back' menu option in the triangle menu on the right.
The windows you have put into the menu bar have an unnerving tendency to jump to the left of the menu bar putting themselves before the menu.
=============== Diff against Morphic-cmm.1333 ===============
Item was changed:
----- Method: SystemWindow>>collapseOrExpand (in category 'resize/collapse') -----
collapseOrExpand
"Collapse or expand the window, depending on existing state"
| cf |
isCollapsed
ifTrue:
["Expand -- restore panes to morphics structure"
isCollapsed := false.
self beKeyWindow. "Bring to frint first"
Preferences collapseWindowsInPlace
ifTrue:
[fullFrame := fullFrame align: fullFrame topLeft with: self getBoundsWithFlex topLeft]
ifFalse:
[collapsedFrame := self getBoundsWithFlex].
collapseBox ifNotNil: [collapseBox setBalloonText: 'collapse this window' translated].
self setBoundsWithFlex: fullFrame.
paneMorphs reverseDo:
[:m | self addMorph: m unlock.
self world startSteppingSubmorphsOf: m].
self addPaneSplitters.
(self hasProperty: #applyTheme) ifTrue: [
self removeProperty: #applyTheme.
self userInterfaceTheme applyTo: self allMorphs]]
ifFalse:
["Collapse -- remove panes from morphics structure"
isCollapsed := true.
fullFrame := self getBoundsWithFlex.
"First save latest fullFrame"
paneMorphs do: [:m | m delete; releaseCachedState].
self removePaneSplitters.
self removeCornerGrips.
model modelSleep.
cf := self getCollapsedFrame.
(collapsedFrame isNil and: [Preferences collapseWindowsInPlace not]) ifTrue:
[collapsedFrame := cf].
self setBoundsWithFlex: cf.
collapseBox ifNotNil: [collapseBox setBalloonText: 'expand this window' translated ].
expandBox ifNotNil: [expandBox setBalloonText: 'expand this window' translated ].
+ ].
- self sendToBack].
self layoutChanged!
Item was changed:
----- Method: SystemWindow>>justDroppedInto:event: (in category 'geometry') -----
justDroppedInto: aMorph event: anEvent
+ (aMorph isKindOf: DockingBarMorph) ifTrue: [ self collapse ].
+ (aMorph isWorldMorph) ifTrue: [ self expand ].
isCollapsed
ifTrue: [self position: ((self position max: 0@0) grid: 8@8).
collapsedFrame := self bounds]
ifFalse: [fullFrame := self bounds].
self beKeyWindow.
self hasDropShadow: Preferences menuAppearance3d. "See #startDragFromLabel:."
aMorph == self world ifTrue: [self assureLabelAreaVisible].
(Project uiManager openToolsAttachedToMouseCursor and: (self hasProperty: #initialDrop))
ifTrue: [
self removeProperty: #initialDrop.
(self submorphs detect: [:m | m isKindOf: BottomRightGripMorph] ifNone: [])
ifNotNil: [:grip |
grip
referencePoint: anEvent position;
setProperty: #targetHadDropShadow toValue: true "See MorphicToolBuilder >> #open:".
self hasDropShadow: false.
anEvent hand newMouseFocus: grip]].
^super justDroppedInto: aMorph event: anEvent!
Hi All,
anyone out there who can give me admin privileges to source.squeak.org
(or explain how to login as admin, cuz my normal login doesn't convey admin
privileges).
_,,,^..^,,,_
best, Eliot
I just found out that I can drop morphs on the main docking bar. When I show the docking bar’s context menu, the „accept drops“ checkbox is not clicked, though. Is this a bug or a feature?
Bernhard
Eliot Miranda uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-eem.376.mcz
==================== Summary ====================
Name: Tests-eem.376
Author: eem
Time: 6 April 2017, 4:06:35.872493 pm
UUID: cf795993-c2d9-4443-b1ae-ac421928a96a
Ancestors: Tests-eem.375
Make the decompilation tests use the same bytecode set for recompilation as the original method.
Make the testMaxLiterals test use the preferred bytecode set's literal limit.
=============== Diff against Tests-eem.375 ===============
Item was changed:
----- Method: CompilerTest>>testMaxLiterals (in category 'limits') -----
testMaxLiterals
"Document the maximum number of literals in a compiled method"
| maxLiterals stringThatCanBeCompiled stringWithOneTooManyLiterals |
"Why 6? It's rather implementation dependent. But the {... construct is compiled as
(Array braceStream: size)
nextPut: expr;
...;
braceArray
where nextPut: is a special selector. So one each for Array binding, #braceStream, #braceArray and the size,
one for the selector and one for the methodClass makes 6."
+ maxLiterals := CompiledCode preferredBytecodeSetEncoderClass new maxNumLiterals - 6.
- maxLiterals := thisContext method encoderClass new maxNumLiterals - 6.
stringThatCanBeCompiled := '{ ', (String streamContents: [:strm |
1 to: maxLiterals do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
stringWithOneTooManyLiterals := '{ ', (String streamContents: [:strm |
1 to: maxLiterals + 1 do: [:e | strm nextPutAll: '''', e asString, '''', ' . ']]), '}'.
self assert: ((1 to: maxLiterals) collect: #printString) equals: (Compiler evaluate: stringThatCanBeCompiled).
"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.
!
Item was changed:
----- Method: DecompilerTests>>checkDecompileMethod: (in category 'utilities') -----
checkDecompileMethod: oldMethod
| cls selector oldMethodNode methodNode newMethod oldCodeString newCodeString |
cls := oldMethod methodClass.
selector := oldMethod selector.
oldMethodNode := (cls decompilerClass new withTempNames: oldMethod methodNode schematicTempNamesString)
decompile: selector
in: cls
method: oldMethod methodForDecompile.
[oldMethodNode properties includesKey: #warning] whileTrue:
[oldMethodNode properties removeKey: #warning].
oldCodeString := oldMethodNode decompileString.
+ methodNode := [| compiler |
+ compiler := cls newCompiler.
+ compiler parser encoderClass: oldMethod encoderClass.
+ compiler
- methodNode := [cls newCompiler
compile: oldCodeString
in: cls
notifying: nil
ifFail: []]
on: SyntaxErrorNotification
do: [:ex|
ex errorMessage = 'Cannot store into' ifTrue:
[ex return: #badStore].
ex pass].
"Ignore cannot store into block arg errors; they're not our issue."
methodNode ~~ #badStore ifTrue:
[newMethod := methodNode generate.
newCodeString := ((cls decompilerClass new withTempNames: methodNode schematicTempNamesString)
decompile: selector
in: cls
method: newMethod methodForDecompile) decompileString.
"(StringHolder new textContents:
(TextDiffBuilder buildDisplayPatchFrom: oldCodeString to: newCodeString))
openLabel: 'Decompilation Differences for ', cls name,'>>',selector"
"(StringHolder new textContents:
(TextDiffBuilder buildDisplayPatchFrom: oldMethod abstractSymbolic to: newMethod abstractSymbolic))
openLabel: 'Bytecode Differences for ', cls name,'>>',selector"
self assert: (oldCodeString = newCodeString
or: [(Scanner new scanTokens: oldCodeString) = (Scanner new scanTokens: newCodeString)])
description: cls name asString, ' ', selector asString
resumable: true]!