Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.990.mcz
==================== Summary ====================
Name: Tools-mt.990
Author: mt
Time: 29 September 2020, 10:20:33.276444 am
UUID: e7da396b-a8ec-7a44-8f15-5ba7d0d30b37
Ancestors: Tools-mt.989
In debuggers, forward model-wake-up call to update inspectors. This fixes the bug where a 'nil' receiver had no fields in the receiver inspector. For example, try debug-it on any expression in the workspace to trigger that bug.
Note that the underlying challenge is that the inspectors in debuggers are not stepping. Field updates are triggered manually via #updateInspectors. An inspector's initial object is 'nil'. So, "changing" that to 'nil' will not update the field list in inspectors bc. it is considered redundant and will be ignored there. While stepping is not required to produce the initial field list, the model-wake-up call will usually trigger that initial update in a stand-alone inspector.
That's why I think that it is not necessary to change anything in the inspector code but only here in the debugger.
=============== Diff against Tools-mt.989 ===============
Item was added:
+ ----- Method: Debugger>>modelWakeUpIn: (in category 'user interface') -----
+ modelWakeUpIn: aWindow
+
+ super modelWakeUpIn: aWindow.
+ self updateInspectors.!
Eliot Miranda uploaded a new version of EToys to project The Trunk:
http://source.squeak.org/trunk/EToys-eem.402.mcz
==================== Summary ====================
Name: EToys-eem.402
Author: eem
Time: 27 September 2020, 5:43:02.068038 pm
UUID: bbda2475-d7bb-4381-b306-0eab22b9ddad
Ancestors: EToys-eem.401
CameraInterface: document camera:getParam:. Provide a utility for evaluating a block with grabbed frames.
=============== Diff against EToys-eem.401 ===============
Item was added:
+ ----- Method: CameraInterface class>>camera:framesDo:while: (in category 'utilities') -----
+ camera: cameraNum framesDo: aBlock while: whileBlock
+ "Evaluate aBlock every time a frame becomes available. Answer a tuple of frames per second and number of 16ms delays per second.
+ Be destructive; use only one bitmap, overwriting its contents with each successive frame.
+ It is the sender's responsibility to open and close the camera."
+ | form bitmap delay start duration frameCount delayCount |
+ form := Form
+ extent: (self frameExtent: cameraNum)
+ depth: 32.
+ bitmap := form bits.
+ delay := Delay forMilliseconds: (1000 / 60) asInteger. "60 fps is fast"
+ start := Time utcMicrosecondClock.
+ frameCount := delayCount := 0.
+ [[(self camera: cameraNum getParam: 1) <= 0] whileTrue:
+ [delay wait. delayCount := delayCount + 1].
+ self getFrameForCamera: cameraNum into: bitmap.
+ frameCount := frameCount + 1.
+ aBlock value: form.
+ whileBlock value] whileTrue.
+ ^{ frameCount * 1.0e6 / (duration := Time utcMicrosecondClock - start).
+ delayCount * 1.0e6 / duration }
+
+ "| cameraNum |
+ self openCamera: (cameraNum := 1) width: 640 height: 480.
+ self waitForCameraStart: cameraNum.
+ [self camera: cameraNum framesDo: [:bitmap| bitmap display] while: [Sensor noButtonPressed]] ensure:
+ [self closeCamera: cameraNum]"!
Item was changed:
----- Method: CameraInterface class>>camera:getParam: (in category 'camera ops') -----
camera: cameraNum getParam: paramNum
+ "Answer the given parameter for the given camera.
+ param 1 is the frame count, the number of frames grabbed since the last send of getFrameForCamera:into:
+ param 2 is the size of the bitmap in bytes required for an image"
- "Answer the given parameter for the given camera."
+ <primitive: 'primGetParam' module: 'CameraPlugin' error: ec>
+ ^nil
- <primitive: 'primGetParam' module: 'CameraPlugin'>
- ^ nil
!
Eliot Miranda uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-eem.1686.mcz
==================== Summary ====================
Name: Morphic-eem.1686
Author: eem
Time: 25 September 2020, 7:14:07.295188 pm
UUID: 203a1355-2c2d-4600-a378-868b5c5fff82
Ancestors: Morphic-eem.1685
Make TextEditor>>starteArray[Put:] robust when used on uninitialized or stale instances.
=============== Diff against Morphic-eem.1685 ===============
Item was changed:
----- Method: TextEditor>>stateArray (in category 'initialize-release') -----
stateArray
+ ^[ {ChangeText.
- ^ {ChangeText.
FindText.
history ifNil: [TextEditorCommandHistory new]. "Convert old instances"
self markIndex to: self pointIndex - 1.
self startOfTyping.
emphasisHere.
+ lastParenLocation}]
+ on: MessageNotUnderstood
+ do: [:ex| ex resume: nil]!
- lastParenLocation}!
Item was changed:
----- Method: TextEditor>>stateArrayPut: (in category 'initialize-release') -----
stateArrayPut: stateArray
- | sel |
ChangeText := stateArray at: 1.
FindText := stateArray at: 2.
history := stateArray at: 3.
+ (stateArray at: 4) ifNotNil: [:sel| self selectFrom: sel first to: sel last].
- sel := stateArray at: 4.
- self selectFrom: sel first to: sel last.
beginTypeInIndex := stateArray at: 5.
emphasisHere := stateArray at: 6.
lastParenLocation := stateArray at: 7!
Eliot Miranda uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-eem.242.mcz
==================== Summary ====================
Name: Network-eem.242
Author: eem
Time: 25 September 2020, 1:16:43.056168 pm
UUID: 555fce79-4be7-49f4-a0d6-b976a406942e
Ancestors: Network-eem.241
Sockets:
Add an inst var to Socket to remember the address family (INET4 vs INET6) for a new-style socket.
Add family-specific lookup facilities to NetNameResolver.
=============== Diff against Network-eem.241 ===============
Item was added:
+ ----- Method: NetNameResolver class>>addressForName:family: (in category 'lookups') -----
+ addressForName: hostName family: addressFamily
+ "NetNameResolver addressForName: 'squeak.org' family: SocketAddressInformation addressFamilyINET4"
+ "NetNameResolver addressForName: 'localhost' family: SocketAddressInformation addressFamilyINET6"
+ "NetNameResolver addressForName: '127.0.0.1' family: SocketAddressInformation addressFamilyINET6"
+ | addresses |
+ self useOldNetwork ifTrue:
+ [^self oldAddressForName: hostName].
+ addresses := self addressesForName: hostName family: addressFamily.
+ ^addresses
+ ifEmpty: [nil]
+ ifNotEmpty: [addresses first socketAddress]!
Item was changed:
----- Method: NetNameResolver class>>addressesForName: (in category 'lookup') -----
addressesForName: hostName
"NetNameResolver addressesForName: 'impara.de' "
+ ^SocketAddressInformation
- | addresses |
- addresses := SocketAddressInformation
forHost: hostName
service: ''
flags: 0
addressFamily: 0
socketType: SocketAddressInformation socketTypeStream
+ protocol: SocketAddressInformation protocolTCP!
- protocol: SocketAddressInformation protocolTCP.
- ^addresses!
Item was added:
+ ----- Method: NetNameResolver class>>addressesForName:family: (in category 'lookup') -----
+ addressesForName: hostName family: addressFamily
+ "NetNameResolver
+ addressesForName: 'squeak.org'
+ family: SocketAddressInformation addressFamilyINET4"
+ "NetNameResolver
+ addressesForName: 'impara.de'
+ family: SocketAddressInformation addressFamilyINET6"
+
+ ^SocketAddressInformation
+ forHost: hostName
+ service: ''
+ flags: 0
+ addressFamily: addressFamily
+ socketType: SocketAddressInformation socketTypeStream
+ protocol: SocketAddressInformation protocolTCP!
Item was changed:
Object subclass: #Socket
+ instanceVariableNames: 'semaphore socketHandle readSemaphore writeSemaphore family'
- instanceVariableNames: 'semaphore socketHandle readSemaphore writeSemaphore'
classVariableNames: 'Connected DeadServer DefaultReceiveBufferSize DefaultSendBufferSize InvalidSocket MaximumReadSemaphoreWaitTimeout OtherEndClosed Registry TCPSocketType ThisEndClosed UDPSocketType Unconnected WaitingForConnection'
poolDictionaries: ''
category: 'Network-Kernel'!
!Socket commentStamp: 'gk 12/13/2005 00:43' prior: 0!
A Socket represents a network connection point. Current sockets are designed to support the TCP/IP and UDP protocols. Sockets are the lowest level of networking object in Squeak and are not normally used directly. SocketStream is a higher level object wrapping a Socket in a stream like protocol.
ProtocolClient and subclasses are in turn wrappers around a SocketStream to provide support for specific network protocols such as POP, NNTP, HTTP, and FTP.!
Item was added:
+ ----- Method: Socket>>addressFamily (in category 'accessing') -----
+ addressFamily
+ ^family!
Item was changed:
----- Method: Socket>>initialize:family: (in category 'initialize-destroy') -----
+ initialize: socketType family: addressFamily
- initialize: socketType family: family
"Initialize a new socket handle. If socket creation fails, socketHandle will be set to nil."
+ family := addressFamily.
NetNameResolver useOldNetwork ifTrue: [ ^self initialize: socketType ].
self initializeSocketHandleUsing: [ :semaIndex :readSemaIndex :writeSemaIndex |
self primSocketCreateNetwork: family
type: socketType
receiveBufferSize: DefaultReceiveBufferSize
sendBufSize: DefaultSendBufferSize
semaIndex: semaIndex
readSemaIndex: readSemaIndex
writeSemaIndex: writeSemaIndex ]!
Item was changed:
----- Method: Socket>>waitForDataIfClosed: (in category 'waiting') -----
waitForDataIfClosed: closedBlock
"Wait indefinitely for data to arrive. This method will block until
data is available or the socket is closed."
+ [socketHandle ifNil: [^closedBlock value ].
+ (self primSocketReceiveDataAvailable: socketHandle) ifTrue: [ ^self ].
+ self isConnected ifFalse: [ ^closedBlock value ].
+ "ul 8/13/2014 21:16
+ Providing a maximum for the time for waiting is a workaround for a VM bug which
+ causes sockets waiting for data forever in some rare cases, because the semaphore
+ doesn't get signaled. Replace the ""waitTimeoutMSecs: self class maximumReadSemaphoreWaitTimeout""
+ part with ""wait"" when the bug is fixed."
+ readSemaphore waitTimeoutMSecs: self class maximumReadSemaphoreWaitTimeout ] repeat!
- socketHandle ifNil: [ ^closedBlock value ].
- [
- (self primSocketReceiveDataAvailable: socketHandle) ifTrue: [ ^self ].
- self isConnected ifFalse: [ ^closedBlock value ].
- "ul 8/13/2014 21:16
- Providing a maximum for the time for waiting is a workaround for a VM bug which
- causes sockets waiting for data forever in some rare cases, because the semaphore
- doesn't get signaled. Replace the ""waitTimeoutMSecs: self class maximumReadSemaphoreWaitTimeout""
- part with ""wait"" when the bug is fixed."
- readSemaphore waitTimeoutMSecs: self class maximumReadSemaphoreWaitTimeout ] repeat!
Patrick Rein uploaded a new version of Graphics to project The Trunk:
http://source.squeak.org/trunk/Graphics-pre.439.mcz
==================== Summary ====================
Name: Graphics-pre.439
Author: pre
Time: 25 September 2020, 9:48:35.481674 am
UUID: e6d3328b-645a-e846-a3a9-c3c61b479c23
Ancestors: Graphics-tonyg.438
Adds code to handle the case in which a text anchor attribute is used on more than the SoH character AND another SoH character is within the range where the text anchor was applied. Without this, the first morph would be put at the location of the second SoH character.
=============== Diff against Graphics-tonyg.438 ===============
Item was changed:
----- Method: CharacterScanner>>embeddedObject (in category 'stop conditions') -----
embeddedObject
+ | previousAttributes newAttributes |
pendingKernX := 0.
+ "If a text anchor was already at the previous index, it was already dealt with"
+ previousAttributes := lastIndex > 1 ifTrue: [text attributesAt: lastIndex - 1] ifFalse: [#()].
+ newAttributes := (text attributesAt: lastIndex) copyWithoutAll: previousAttributes.
+ (newAttributes reject: [:each | each anchoredMorph isNil])
- ((text attributesAt: lastIndex) reject: [:each | each anchoredMorph isNil])
ifNotEmpty: [:attributes | (self placeEmbeddedObjectsFrom: attributes) ifTrue: [^ true]].
self setFont.
"Note: if ever several objects are embedded on same character, only indent lastIndex once"
lastIndex := lastIndex + 1.
+ ^ false!
- ^false!
Patrick Rein uploaded a new version of MorphicTests to project The Trunk:
http://source.squeak.org/trunk/MorphicTests-pre.66.mcz
==================== Summary ====================
Name: MorphicTests-pre.66
Author: pre
Time: 25 September 2020, 9:44:57.768674 am
UUID: 4785ae25-ad3c-ad4b-8341-0f3f4a4f3f1d
Ancestors: MorphicTests-mt.65
Adds a test case for layouting morphs in text in case the TextAnchor attribute is applied to more than the SoH character (which is unusual but valid).
=============== Diff against MorphicTests-mt.65 ===============
Item was added:
+ ----- Method: TextAnchorTest>>testTwoTextAnchorsOneWithNestedInterval (in category 'tests') -----
+ testTwoTextAnchorsOneWithNestedInterval
+
+ | anchorAttribute2 anchoredMorph2 |
+ anchoredMorph2 := RectangleMorph new.
+ anchoredMorph height: 40.
+ anchoredMorph2 height: 40.
+ anchorAttribute2 := TextAnchor new anchoredMorph: anchoredMorph2.
+ text := Text streamContents: [:stream |
+ stream
+ nextPutAll: 'contrived ';
+ nextPutAll: Character startOfHeader asString asText;
+ nextPutAll: ' whose morph is in the center.';
+ nextPutAll: Character startOfHeader asString asText;
+ nextPutAll: 'and some more text!!'].
+ text addAttribute: anchorAttribute from: 11 to: 61.
+ text addAttribute: anchorAttribute2 from: 42 to: 48.
+ textMorph hResizing: #shrinkWrap.
+ self prepareTextMorph.
+
+ self assert: textMorph paragraph lines first lineHeight < 50.
+ self assert: anchoredMorph right < anchoredMorph2 left!