Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1167.mcz
==================== Summary ====================
Name: System-mt.1167
Author: mt
Time: 21 July 2020, 9:04:24.515795 am
UUID: 962f538f-4a49-4832-8488-4337395436fc
Ancestors: System-mt.1166
In code holders, avoid label contraction in dialogs' buttons that pop up when having to choose a symbol for browsing senders/implementors.
=============== Diff against System-mt.1166 ===============
Item was changed:
----- Method: SystemNavigation>>showMenuOf:withFirstItem:ifChosenDo:withCaption: (in category 'ui') -----
showMenuOf: selectorCollection withFirstItem: firstItem ifChosenDo: choiceBlock withCaption: aCaption
+ "Show a sorted menu of the given selectors, preceded by firstItem. Use aCaption as the menu title, if it is not nil. Evaluate choiceBlock if a message is chosen."
- "Show a sorted menu of the given selectors, preceded by firstItem, and all abbreviated to 40 characters. Use aCaption as the menu title, if it is not nil. Evaluate choiceBlock if a message is chosen."
| index menuLabels sortedList |
sortedList := selectorCollection sorted.
menuLabels := Array streamContents:
+ [:strm | strm nextPut: firstItem.
+ sortedList do: [:sel | strm nextPut: sel]].
- [:strm | strm nextPut: (firstItem contractTo: 40).
- sortedList do: [:sel | strm nextPut: (sel contractTo: 40)]].
index := UIManager default chooseFrom: menuLabels lines: #(1).
index = 1 ifTrue: [choiceBlock value: firstItem].
index > 1 ifTrue: [choiceBlock value: (sortedList at: index - 1)]!
Eliot Miranda uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-eem.399.mcz
==================== Summary ====================
Name: EToys-eem.399
Author: eem
Time: 17 July 2020, 4:51:05.430052 pm
UUID: dfb4916e-d9f3-40e7-8da2-2badb5372778
Ancestors: EToys-mt.398
Fix the WebCamMorph so that more than one camera can be used at the same time.
e,g, if you have a laptop with a secondary display attached with a camera (such as the Apple Cinema Display) you can do this:
WebCamMorph new cameraNumber: 2; openInWorld.
WebCamMorph new cameraNumber: 1; openInWorld.
WebCamMorph new cameraNumber: 2; openInWorld.
WebCamMorph new cameraNumber: 1; openInWorld.
position them around the display, change their size, and even give them rotation. But interestingly adding rotation invokes the garbage collector since the warp form is not cached.
e.g.
GCs 5,066 (582.7 ms between GCs 314.9 ms runtime between GCs)
full 245 totalling 221,724 ms (13.9% runtime), avg 905 ms
marking 128,554 ms (58%) avg 524.7 ms,
compacting 93,170 ms (42%) avg 380.3 ms
scavenges 4,821 totalling 24,912 ms (1.56% runtime), avg 5.2 ms
tenures 232,261 (avg 48 tenures per scavenge)
=============== Diff against EToys-mt.398 ===============
Item was added:
+ ----- Method: WebCamMorph>>cameraIsOn (in category 'accessing') -----
+ cameraIsOn
+ ^camIsOn!
Item was added:
+ ----- Method: WebCamMorph>>cameraNumber (in category 'accessing') -----
+ cameraNumber
+ ^camNum!
Item was added:
+ ----- Method: WebCamMorph>>cameraNumber: (in category 'accessing') -----
+ cameraNumber: anInteger
+ camNum ~= anInteger ifTrue:
+ [camNum := anInteger.
+ self initializeDisplayForm]!
Item was changed:
----- Method: WebCamMorph>>delete (in category 'submorphs-add/remove') -----
delete
+ self off.
+ super delete!
- self class instanceCount > 1
- ifFalse: [self off]
- ifTrue: [
- self stopStepping.
- camIsOn := false].
- super delete.!
Item was changed:
----- Method: WebCamMorph>>drawOn: (in category 'drawing') -----
drawOn: aCanvas
+ camIsOn ifFalse:
+ [self initializeDisplayForm.
+ self on].
+ camIsOn ifTrue:
+ [(CameraInterface frameExtent: camNum) ~= displayForm extent ifTrue:
+ [self initializeDisplayForm]].
+ displayForm ifNil:
+ [self initializeDisplayForm].
-
useFrameSize ifTrue: [self extent: frameExtent].
self drawCameraImageOn: aCanvas.
self drawFPSOn: aCanvas.
+ self drawOverlayTextOn: aCanvas!
- self drawOverlayTextOn: aCanvas.
- !
Item was changed:
----- Method: WebCamMorph>>initialize (in category 'initialization') -----
initialize
super initialize.
camNum := 1.
camIsOn := false.
showFPS := false.
captureDelayMs := 16. "stepTime"
fps := 60. "guess."
lastDisplayTime := 0.
framesSinceLastDisplay := 0.
useFrameSize := false.
resolution := #medium.
orientation := #natural.
+ frameExtent := self class resolutionFor: resolution!
- frameExtent := self class resolutionFor: resolution.
- self initializeDisplayForm.
- self extent: frameExtent.
- self on.
-
- !
Item was changed:
----- Method: WebCamMorph>>off (in category 'accessing') -----
off
self stopStepping.
camIsOn := false.
+ "Be careful not to close the camera if any other morphs are using the same camera."
+ (self class allInstances anySatisfy: [:wcm| wcm cameraNumber = camNum and: [wcm cameraIsOn]]) ifFalse:
+ [CameraInterface closeCamera: camNum].
+ self changed
- self updateDisplay.
- CameraInterface closeCamera: camNum.
+ "self allInstances select: [:wcm| wcm cameraNumber = 1 and: [wcm cameraIsOn]]"!
-
-
- !
Item was changed:
----- Method: WebCamMorph>>on (in category 'accessing') -----
on
+ camIsOn ifTrue: [^true].
+ (CameraInterface cameraIsOpen: camNum) ifFalse:
+ [(CameraInterface openCamera: camNum width: frameExtent x height: frameExtent y) ifNil:
+ [^false]].
+ "The plugin/camera subsystem may end up choosing a different width and height.
+ So use the width and height it has selected; it may not be what was asked for."
-
- (CameraInterface cameraIsOpen: camNum)
- ifTrue: [ ^camIsOn := true.].
- (CameraInterface openCamera: camNum width: frameExtent x height: frameExtent y)
- ifNil: [^false].
- CameraInterface waitForCameraStart: camNum.
self initializeDisplayForm.
+ CameraInterface waitForCameraStart: camNum.
- self extent: frameExtent.
camIsOn := true.
+ self startStepping!
- self startStepping.
- !
Eliot Miranda uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-eem.384.mcz
==================== Summary ====================
Name: KernelTests-eem.384
Author: eem
Time: 16 July 2020, 3:13:09.314392 pm
UUID: da087b71-cc6c-42d5-b8e7-fe03fca763c2
Ancestors: KernelTests-tpr.383
Revert KernelTests-tpr.383's setFreeSpaceLimitOf:around: now that the VM correctly accepts large integers for vm parameter #57.
=============== Diff against KernelTests-tpr.383 ===============
Item was changed:
----- Method: AllocationTest>>setFreeSpaceLimitOf:around: (in category 'support') -----
setFreeSpaceLimitOf: bytes around: aBlock
"Attempt to evaluate aBlock with a limit of the requested ammount
of free old space, restoring the extant limit after the evaluation."
| extantLimit |
extantLimit := Smalltalk vmParameterAt: 67.
+ Smalltalk vmParameterAt: 67 put: (Smalltalk vmParameterAt: 1) + bytes asInteger.
- Smalltalk vmParameterAt: 67 put: ((Smalltalk vmParameterAt: 1) + bytes asInteger min: SmallInteger maxVal).
^aBlock ensure: [Smalltalk vmParameterAt: 67 put: extantLimit]!