Marcel Taeumel uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-mt.492.mcz
==================== Summary ====================
Name: EToys-mt.492
Author: mt
Time: 24 January 2023, 11:39:23.84421 am
UUID: 07268a15-2318-9a43-ade1-18637bfcb6d5
Ancestors: EToys-mt.491
Move Etoys-specific class to Etoys package.
=============== Diff against EToys-mt.491 ===============
Item was added:
+ MenuMorph subclass: #DumberMenuMorph
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Etoys-Outliner'!
+
+ !DumberMenuMorph commentStamp: '<historical>' prior: 0!
+ Contributed by Bob Arning as part of the ObjectExplorer package.
+ !
Item was added:
+ ----- Method: DumberMenuMorph>>setInvokingView: (in category 'menu') -----
+ setInvokingView: invokingView
+ "I'd rather not, if that's OK"!
Marcel Taeumel uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-mt.342.mcz
==================== Summary ====================
Name: MorphicExtras-mt.342
Author: mt
Time: 23 January 2023, 5:18:09.430818 pm
UUID: c6f60f1a-0aee-0e4f-8f0f-1d22dec75adf
Ancestors: MorphicExtras-mt.341
Complement Morphic-mt.2071
=============== Diff against MorphicExtras-mt.341 ===============
Item was changed:
----- Method: ProjectNavigationMorph>>doNewPainting (in category 'the actions') -----
doNewPainting
| w f |
w := self world.
w assureNotPaintingElse: [^ self].
(f := self owner flapTab) ifNotNil: [f hideFlap].
+ w makeNewDrawing: (self primaryHand lastEvent translatedTo: w center)
- w makeNewDrawing: (self primaryHand lastEvent copy setPosition: w center)
!
Item was changed:
----- Method: RemoteHandMorph>>getNextRemoteEvent (in category 'private') -----
getNextRemoteEvent
"Return the next remote event, or nil if the receive buffer does not contain a full event record. An event record is the storeString for a MorphicEvent terminated by a <CR> character."
| i s evt |
self receiveData.
receiveBuffer isEmpty ifTrue: [^ nil].
i := receiveBuffer indexOf: Character cr ifAbsent: [^ nil].
s := receiveBuffer copyFrom: 1 to: i - 1.
receiveBuffer := receiveBuffer copyFrom: i + 1 to: receiveBuffer size.
evt := (MorphicEvent readFromString: s).
evt ifNil:[^nil].
evt setHand: self.
+ evt isKeyboard ifTrue:[evt translateTo: self position].
- evt isKeyboard ifTrue:[evt setPosition: self position].
^evt resetHandlerFields!
Marcel Taeumel uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-mt.491.mcz
==================== Summary ====================
Name: EToys-mt.491
Author: mt
Time: 23 January 2023, 5:17:39.932818 pm
UUID: f06418bf-35d8-dc4a-af6b-abd9703ceddb
Ancestors: EToys-tpr.490
Complement Morphic-mt.2071
=============== Diff against EToys-tpr.490 ===============
Item was changed:
----- Method: EventRecordingSpaceNavigator>>doNewPainting (in category 'the actions') -----
doNewPainting
"Make a new painting"
| worldlet |
self currentWorld assureNotPaintingElse: [^ self].
worldlet := self ownerThatIsA: Worldlet.
worldlet closeNavigatorFlap.
+ worldlet makeNewDrawing: (self currentEvent translatedTo: worldlet center).!
- worldlet makeNewDrawing: (self currentEvent copy setPosition: worldlet center).!
Item was changed:
----- Method: InteriorSugarNavBar>>doNewPainting (in category 'buttons') -----
doNewPainting
"Make a new painting"
| worldlet aRect |
self currentWorld assureNotPaintingElse: [^ self].
worldlet := self ownerThatIsA: Worldlet.
aRect := (worldlet topLeft + (0 @ self height)) corner: worldlet bottomRight.
+ worldlet makeNewDrawing: (self currentEvent translatedTo: aRect center).!
- worldlet makeNewDrawing: (self currentEvent copy setPosition: aRect center).!
Item was removed:
- ----- Method: KeyboardEvent>>keyValue: (in category '*Etoys-Squeakland-initialize') -----
- keyValue: aValue
- "Directly set the keyValue. Used by event-recording mechanisms."
-
- keyValue := aValue!
Item was changed:
----- Method: KeyboardEventMorph>>changeCharacter (in category 'menu commands') -----
changeCharacter
"Allow the user to select a new character for the receiver."
| result |
result := FillInTheBlank request: 'New character? ' translated initialAnswer: character asString.
result isEmptyOrNil ifTrue: [^ self].
result = character asString ifTrue: [^ self].
+ event setKeyValue: result first asciiValue.
- event keyValue: result first asciiValue.
self eventRoll ifNotNil: [:r | r pushChangesBackToEventTheatre]!
Item was changed:
----- Method: MentoringEventRecorder>>nextEventToPlay (in category 'event handling') -----
nextEventToPlay
"Return the next event when it is time to be replayed.
If it is not yet time, then return an interpolated mouseMove.
Return nil if nothing has happened.
Return an EOF event if there are no more events to be played."
| nextEvent now nextTime lastP delta |
(tapeStream isNil or:[tapeStream atEnd])
ifTrue:[^MorphicUnknownEvent new setType: #EOF argument: nil].
now := Time millisecondClockValue.
nextEvent := tapeStream next shallowCopy. "always copied"
areaOffset ifNotNil: [nextEvent isMouse ifTrue:
+ [nextEvent translateBy: areaOffset]].
+ nextEvent isKeyboard ifTrue: [ nextEvent translateTo: areaBounds center].
- [nextEvent position: nextEvent position + areaOffset]].
- nextEvent isKeyboard ifTrue: [ nextEvent setPosition: areaBounds center].
nextEvent type == #noCondense ifTrue: [^nil]. "ignore in playback"
deltaTime ifNil:[deltaTime := now - nextEvent timeStamp].
nextTime := nextEvent timeStamp + deltaTime.
now < time ifTrue:["clock rollover"
time := now.
deltaTime := nil.
^nil "continue it on next cycle"].
time := now.
(now >= nextTime) ifTrue:[
nextEvent setTimeStamp: nextTime.
nextEvent isMouse ifTrue:[lastEvent := nextEvent] ifFalse:[lastEvent := nil].
^nextEvent].
tapeStream skip: -1.
"Not time for the next event yet, but interpolate the mouse.
This allows tapes to be compressed when velocity is fairly constant."
lastEvent ifNil: [^ nil].
now - lastInterpolation < 20 "WorldState minCycleLapse" ifTrue: [^ nil].
lastP := lastEvent position.
delta := (nextEvent position - lastP) * (now - lastEvent timeStamp) // (nextTime - lastEvent timeStamp).
(delta dist: lastDelta) < 3 ifTrue: [^ nil]. "Almost no movement"
lastDelta := delta.
lastInterpolation := now.
^ MouseMoveEvent new
setType: #mouseMove
startPoint: lastEvent position endPoint: lastP + delta
trail: nil buttons: lastEvent buttons hand: nil stamp: now.!
Item was removed:
- ----- Method: MorphicEvent>>position: (in category '*Etoys-Squeakland-accessing') -----
- position: aPoint
- "Set my position, if it makes sense for me."!
Item was removed:
- ----- Method: MorphicEvent>>translateBy: (in category '*Etoys-Squeakland-transforming') -----
- translateBy: delta
- "Reposition the receiver by delta. For non-UI events, this is meaningless"!
Item was changed:
----- Method: SugarNavigatorBar>>doNewPainting (in category 'button actions') -----
doNewPainting
| w |
w := self world.
w assureNotPaintingElse: [^ self].
+ w makeNewDrawing: (self primaryHand lastEvent translatedTo: w center)
- w makeNewDrawing: (self primaryHand lastEvent copy setPosition: w center)
!
Item was removed:
- ----- Method: UserInputEvent>>position: (in category '*Etoys-Squeakland-accessing') -----
- position: aPoint
- "normally immutable, except in event recorder"
- position := aPoint!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2071.mcz
==================== Summary ====================
Name: Morphic-mt.2071
Author: mt
Time: 23 January 2023, 5:16:38.044818 pm
UUID: 0369b0e1-d46a-ee4e-aa19-bb86a3584bad
Ancestors: Morphic-mt.2070
Some clean-up in input-event protocol.
=============== Diff against Morphic-mt.2070 ===============
Item was removed:
- ----- Method: DropEvent>>transformedBy: (in category 'transforming') -----
- transformedBy: aMorphicTransform
- "Return the receiver transformed by the given transform into a local coordinate system."
- ^self shallowCopy transformBy: aMorphicTransform!
Item was added:
+ ----- Method: DropEvent>>translateBy: (in category 'transforming') -----
+ translateBy: delta
+ "add delta to cursorPoint, and return the new event"
+ position := position + delta.!
Item was added:
+ ----- Method: KeyboardEvent>>setKeyValue: (in category 'private') -----
+ setKeyValue: aValue
+
+ keyValue := aValue.!
Item was changed:
----- Method: LegacyShortcutsFilter class>>filterEvent:for: (in category 'event filter') -----
filterEvent: aKeyboardEvent for: textMorph
aKeyboardEvent isKeystroke ifFalse: [^ aKeyboardEvent].
aKeyboardEvent commandKeyPressed ifFalse: [^ aKeyboardEvent].
Preferences cmdKeysInText ifFalse: [^ aKeyboardEvent].
(Smalltalk platformName = 'Mac OS' and: [aKeyboardEvent shiftPressed])
ifTrue: ["Work around an issue in the VM where SHIFT is not honored
in the KeyChar event's character. This should only be the case for
KeyDown events to encode virtual-key presses. The VM should not
do this for KeyChar events. Works for U.S. keyboard layout only."
+ aKeyboardEvent setKeyValue: (
- aKeyboardEvent keyValue: (
aKeyboardEvent keyCharacter caseOf: {
[$9] -> [$(]. [$0] -> [$)].
[$,] -> [$<]. [$.] -> [$>].
[$[] -> [${]. [$]] -> [$}].
[$'] -> [$"] }
otherwise: [aKeyboardEvent keyCharacter]) asInteger].
('()[]{}|''"<>' includes: aKeyboardEvent keyCharacter)
ifTrue: [textMorph
handleInteraction: [(textMorph editor enclose: aKeyboardEvent toggleOnly: true)
ifTrue: [aKeyboardEvent ignore]]
fromEvent: aKeyboardEvent].
^ aKeyboardEvent
"
Preferences cmdKeysInText
Preferences cmdGesturesEnabled
Preferences honorDesktopCmdKeys
PasteUpMorph globalCommandKeysEnabled.
"!
Item was added:
+ ----- Method: MorphicEvent>>transformBy: (in category 'transforming') -----
+ transformBy: aMorphicTransform
+ !
Item was changed:
----- Method: MorphicEvent>>transformedBy: (in category 'transforming') -----
transformedBy: aMorphicTransform
"Return the receiver transformed by the given transform into a local coordinate system."
+
+ ^self shallowCopy transformBy: aMorphicTransform!
- !
Item was added:
+ ----- Method: MorphicEvent>>translateBy: (in category 'transforming') -----
+ translateBy: delta
+ "Reposition the receiver by delta. For non-UI events, this is meaningless"!
Item was added:
+ ----- Method: MorphicEvent>>translatedBy: (in category 'transforming') -----
+ translatedBy: delta
+ "Add delta to cursorPoint, and return the new event."
+
+ ^ self shallowCopy translateBy: delta!
Item was added:
+ ----- Method: MorphicEvent>>translatedTo: (in category 'transforming') -----
+ translatedTo: aPoint
+ "Answer the receiver translated to aPoint."
+
+ ^ self shallowCopy translateTo: aPoint!
Item was changed:
----- Method: MouseEvent>>asMouseEnter (in category 'converting') -----
asMouseEnter
+ ^ MouseEvent new setType: #mouseEnter position: position buttons: buttons hand: source!
- ^self shallowCopy setType: #mouseEnter!
Item was changed:
----- Method: MouseEvent>>asMouseLeave (in category 'converting') -----
asMouseLeave
+ ^ MouseEvent new setType: #mouseLeave position: position buttons: buttons hand: source!
- ^self shallowCopy setType: #mouseLeave!
Item was added:
+ ----- Method: MouseMoveEvent>>translateTo: (in category 'transforming') -----
+ translateTo: newEndPoint
+
+ startPoint := newEndPoint - (position - startPoint) "delta".
+ position := newEndPoint.
+ !
Item was removed:
- ----- Method: UserInputEvent>>transformedBy: (in category 'transforming') -----
- transformedBy: aMorphicTransform
- "Return the receiver transformed by the given transform into a local coordinate system."
- ^self shallowCopy transformBy: aMorphicTransform!
Item was changed:
----- Method: UserInputEvent>>translateTo: (in category 'transforming') -----
+ translateTo: aPoint
+ "Translate the receiver to aPoint."
+
+ position := aPoint.!
- translateTo: point
-
- position := point.!
Item was removed:
- ----- Method: UserInputEvent>>translatedBy: (in category 'transforming') -----
- translatedBy: delta
- "add delta to cursorPoint, and return the new event"
- ^self shallowCopy translateBy: delta!
Marcel Taeumel uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-mt.538.mcz
==================== Summary ====================
Name: Graphics-mt.538
Author: mt
Time: 23 January 2023, 1:21:45.37588 pm
UUID: 0d6f4808-2e2e-494c-9b2c-92f7d0c7a0eb
Ancestors: Graphics-mt.537
Fix issue of leaking file handles in our new GIFReadWriter. I will backport this to 6.0.
Document the misnomer that should not be changed at this point. I think.
=============== Diff against Graphics-mt.537 ===============
Item was changed:
----- Method: GIFReadWriter class>>formsFromFileNamed: (in category 'image reading/writing') -----
+ formsFromFileNamed: aFilePath
+
+ ^ self formsFromStream: (FileStream readOnlyFileNamed: aFilePath)!
- formsFromFileNamed: aFile
- ^ (self on: aFile asDirectoryEntry readStream binary)
- readHeader;
- readBody;
- yourself!
Item was changed:
----- Method: GIFReadWriter class>>formsFromStream: (in category 'image reading/writing') -----
formsFromStream: aBinaryStream
+
+ | result |
+ self flag: #misnomer. "mt: This message does NOT return a collection of forms."
+ result := (self on: aBinaryStream)
- ^ (self on: aBinaryStream)
readHeader;
readBody;
+ yourself.
+
+ self flag: #workaround. "mt: Avoid leaking open file handles."
+ result close.
+
+ ^ result!
- yourself!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1186.mcz
==================== Summary ====================
Name: Tools-mt.1186
Author: mt
Time: 20 January 2023, 6:50:26.795382 pm
UUID: 19c7a120-92c1-fd49-a0fd-96a76f3285c1
Ancestors: Tools-mt.1185
Complements System-mt.1385
=============== Diff against Tools-mt.1185 ===============
Item was added:
+ ----- Method: Debugger>>initialExtentKey (in category 'initialize-release') -----
+ initialExtentKey
+
+ ^ { self class name . self isNotifier }!
Item was changed:
----- Method: Debugger>>openFullFromNotifier: (in category 'initialize-release') -----
openFullFromNotifier: topView
"Create a full debugger to replace the given view."
+ RealEstateAgent rememberExtentFor: self.
self initializeFull.
topView model: nil. "so close won't release me."
self breakDependents.
^ ToolBuilder default
close: topView;
open: self label: topView label "Keep the label."!
Item was changed:
----- Method: Inspector>>replaceInspectorWithExplorer (in category 'toolbuilder') -----
replaceInspectorWithExplorer
"Switch to an explorer tool. If there are custom fields, the user can choose to not discard them, which will just spawn a new explorer tool besides this inspector."
| window currentBounds |
self flag: #todo. "ct: In the long term, we should try to communicate specific selectors (here: #expression) along the observer pattern for requests such as #acceptChanges or #wantToChange instead of exploiting contentsTyped etc."
(self okToDiscardCustomFields and: [contentsTyped notNil ==> [self confirm:
'Changes have not been saved.
Is it OK to cancel those changes?' translated orCancel: [^ self]]])
ifFalse: [^ self object explore].
self customFields removeAll.
self changed: #contents. "Reset value pane contents before accepting all contents"
self changed: #acceptChanges. "We copy the current state anyway. See below."
+ RealEstateAgent rememberExtentFor: self.
currentBounds := ToolBuilder default class getBoundsForWindow: self containingWindow.
"Close first because MVC fiddles around with processes."
self changed: #close.
window := ToolSet explore: self object.
"---- In MVC, the lines after this will not be executed ---"
window model setExpression: self expression.
ToolBuilder default class setBoundsForWindow: window to: currentBounds.!
Item was added:
+ ----- Method: MessageSet>>initialExtentKey (in category 'initialize-release') -----
+ initialExtentKey
+
+ ^ { self class name . windowLabel hash}!
Item was changed:
----- Method: ObjectExplorer>>inspectObject (in category 'toolbuilder') -----
inspectObject
"Switch to an inspector tool."
| window currentBounds |
+ RealEstateAgent rememberExtentFor: self.
currentBounds := ToolBuilder findDefault getBoundsForWindow: self containingWindow.
"Close first because MVC fiddles around with processes."
self changed: #close.
window := ToolSet inspect: self rootObject.
"---- In MVC, the lines after this will not be executed ---"
window model setExpression: self expression.
ToolBuilder findDefault setBoundsForWindow: window to: currentBounds.!
Marcel Taeumel uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-mt.289.mcz
==================== Summary ====================
Name: ST80-mt.289
Author: mt
Time: 20 January 2023, 6:49:19.776382 pm
UUID: 9be26961-243c-2649-bb65-e850b7ce8afc
Ancestors: ST80-mt.288
Complements System-mt.1385
=============== Diff against ST80-mt.288 ===============
Item was added:
+ ----- Method: StandardSystemView>>extent (in category 'framing compatibility') -----
+ extent
+
+ ^ self viewport extent!
Item was changed:
+ ----- Method: StandardSystemView>>initialExtent (in category 'framing compatibility') -----
- ----- Method: StandardSystemView>>initialExtent (in category 'framing') -----
initialExtent
"Answer the desired extent for the receiver when it is first opened on the screen. "
^ model initialExtent min: maximumSize max: minimumSize!
Item was changed:
----- Method: StandardSystemView>>release (in category 'initialize-release') -----
release
+ RealEstateAgent rememberExtentFor: model.
model windowIsClosing; release.
self isCollapsed ifTrue: [savedSubViews do: [:v | v release]].
super release.
!