Eliot Miranda uploaded a new version of MorphicExtras to project The Trunk:
http://source.squeak.org/trunk/MorphicExtras-eem.343.mcz
==================== Summary ====================
Name: MorphicExtras-eem.343
Author: eem
Time: 13 February 2023, 12:30:26.859976 pm
UUID: 572c9471-4900-43d9-8ad4-b4f97aca5c4e
Ancestors: MorphicExtras-mt.342
Add a couple of primitives to the CameraInterface. One answers which of the two frame buffers that can be set via camera:setFrameBufferA:B: contains the freshest image. The other allows putting a camera in mirror mode; much more efficient than doing it in Smalltalk because the frame grabber inside the plugin typically runs in its own thread.
=============== Diff against MorphicExtras-mt.342 ===============
Item was changed:
----- Method: CameraInterface class>>camera:getParam: (in category 'camera ops') -----
camera: cameraNum getParam: paramNum
+ "Answer the requested parameter value of the given camera.
- "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
+ param 3 is whether the image is being mirrored or not"
- param 2 is the size of the bitmap in bytes required for an image"
<primitive: 'primGetParam' module: 'CameraPlugin' error: ec>
+ self primitiveFailed!
- ^nil
- !
Item was added:
+ ----- Method: CameraInterface class>>camera:setParam:to: (in category 'camera ops') -----
+ camera: cameraNum setParam: paramNum to: anIntegerOrBoolean
+ "Set the requested parameter value of the given camera, and answer its previous value.
+ param 1 cannot be set; it is the frame count, the number of frames grabbed since the last send of getFrameForCamera:into:
+ param 2 cannot be set; it is the size of the bitmap in bytes required for an image
+ param 3 is whether the image is being mirrored or not"
+
+ <primitive: 'primSetParam' module: 'CameraPlugin' error: ec>
+ self primitiveFailed!
Item was added:
+ ----- Method: CameraInterface class>>cameraGetLatestBufferIndex: (in category 'camera ops') -----
+ cameraGetLatestBufferIndex: cameraIndex
+ "If double-buffering is in effect (set via primSetCameraBuffers) answer
+ which buffer contains the freshest data, either A (1) or B (2). If no buffer
+ has been filled yet, answer nil. Otherwise fail with an appropriate error code."
+ <primitive: 'primGetLatestBufferIndex' module: 'CameraPlugin' error: ec>
+ ^self primitiveFailed
+
+ "CameraInterface cameraGetLatestBufferIndex: 1"!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1390.mcz
==================== Summary ====================
Name: System-eem.1390
Author: eem
Time: 12 February 2023, 2:01:18.44292 pm
UUID: c87dbc8d-0b1c-4462-9fb4-539efc4d328b
Ancestors: System-eem.1389
Update SystemNavigation>>allUnboundMethods to cope with the full block/sistav1 regime.
=============== Diff against System-eem.1389 ===============
Item was changed:
----- Method: SystemNavigation>>allUnboundMethods (in category 'query') -----
allUnboundMethods
+ "Answer all CompiledMethods that are not in the class hierarchy"
- "Answer all CompiledMehtods that are not in the class hierarchy"
"self systemNavigation allUnboundMethods"
+ ^CompiledCode allSubInstances select:
+ [:m| | homeMethod |
+ homeMethod := m homeMethod.
+ homeMethod methodClass
- ^CompiledMethod allSubInstances select:
- [:m|
- m methodClass
ifNil: [true]
ifNotNil:
[:mc|
+ (mc compiledMethodAt: homeMethod selector ifAbsent: []) ~~ homeMethod]]!
- (mc compiledMethodAt: m selector ifAbsent: []) ~~ m]]!
Eliot Miranda uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-eem.1389.mcz
==================== Summary ====================
Name: System-eem.1389
Author: eem
Time: 12 February 2023, 1:32:45.417157 pm
UUID: ccf5e3ec-c446-404a-88f4-ac3f8bb3ed29
Ancestors: System-mt.1388
Fix SystemNavigation>>#unusedBlocks to be bytecode set agnoistic.
=============== Diff against System-mt.1388 ===============
Item was changed:
----- Method: SystemNavigation>>unusedBlocks (in category 'query') -----
unusedBlocks
"Answer all methods that contain a block that is not used (not
sent a message, returned, passed as an argument, or assigned)."
"SystemNavigation new unusedBlocks"
"SystemNavigation new
browseMessageList: SystemNavigation new unusedBlocks
name: 'unused blocks'"
^self allMethodsSelect:
+ [:m|
+ (InstructionStream on: m)
+ scanForInstructionSequence:
+ [:a :b|
+ (#(pushClosureCopyNumCopiedValues:numArgs:blockSize: pushFullClosure:numCopied:) includes: a selector)
+ and: [b selector == #doPop]]]!
- [:m| | is |
- is := InstructionStream on: m.
- is scanFor: [:b| b = 143 and: [(m at: is thirdByte * 256 + is fourthByte + is pc + 4) = 135]]]!
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1498.mcz
==================== Summary ====================
Name: Kernel-eem.1498
Author: eem
Time: 12 February 2023, 1:30:55.883243 pm
UUID: e8b69d4d-8a07-4cf8-8ee7-d764b47f1981
Ancestors: Kernel-tpr.1497
In implementing BlockClosure>>hasMethodReturn, don't assume the byutecode set.
Implement Context>>#home so that it will code with clean blocks.
=============== Diff against Kernel-tpr.1497 ===============
Item was changed:
----- Method: BlockClosure>>hasMethodReturn (in category 'testing') -----
hasMethodReturn
"Answer whether the receiver has a method-return ('^') in its code."
| scanner endpc |
+ scanner := InstructionStream new method: self method pc: startpcOrMethod.
- scanner := InstructionStream new method: outerContext method pc: startpcOrMethod.
endpc := self endPC.
+ scanner scanFor:
+ [:byte |
+ scanner willReturn ifTrue:
+ [scanner willBlockReturn ifFalse:
+ [^true]].
+ scanner pc >= endpc].
+ ^false!
- scanner scanFor: [:byte | (byte between: 120 and: 124) or: [scanner pc > endpc]].
- ^scanner pc <= endpc!
Item was changed:
----- Method: Context>>home (in category 'accessing') -----
home
+ "Answer the outermost context (along the static chain) for the receiver.
+ This is the outermost lexical scope in which the receiver's method is defined."
- "Answer the context in which the receiver was defined."
+ ^closureOrNil
+ ifNil: [self] "normal method activation"
+ ifNotNil: "block activation"
+ [:closure|
+ closure outerContext
+ ifNil: [self] "clean block"
+ ifNotNil: [:outerContext| outerContext home]] "normal block"!
- closureOrNil == nil ifTrue:
- [^self].
- ^closureOrNil outerContext home!
Marcel Taeumel uploaded a new version of ToolBuilder-Morphic to project The Trunk:
http://source.squeak.org/trunk/ToolBuilder-Morphic-mt.334.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-mt.334
Author: mt
Time: 1 February 2023, 1:44:55.134056 pm
UUID: c792ffe3-3a9e-3944-90f1-4cc30bcbaa5d
Ancestors: ToolBuilder-Morphic-mt.333
In tree widgets, for now, really collapse all items in the list we are currently filtering to avoid inadvertent walk-down while typing (and updating) the filter.
We might want to be able to save-and-restore expanded-state after removing the filter again.
Yes, by current design, the tree filter (and search) *does not* care for the current expanded-state of any node in the view.
=============== Diff against ToolBuilder-Morphic-mt.333 ===============
Item was changed:
----- Method: PluggableTreeMorph>>filterTreeNow (in category 'filtering') -----
filterTreeNow
| any |
self hasFilter ifFalse: [^ self removeFilter].
"Show all current items again before filtering them out."
scroller submorphsDo: [:m | m removeFilter].
"Filter the children of the current parent. Do not filter the parent."
any := false.
self selectedParentMorph
ifNil: [self roots do: [:each |
+ each collapse. "Avoid inadvertent walk-down. See #treeFilterAppend:."
(each applyFilter: lastKeystrokes column: filterColumnIndex) ifTrue: [any := true]]]
ifNotNil: [:pm | pm childrenDo: [:each |
+ each collapse. "Avoid inadvertent walk-down. See #treeFilterAppend:."
(each applyFilter: lastKeystrokes column: filterColumnIndex) ifTrue: [any := true]]].
any ifFalse: [
"Remove the last character and try filtering again."
lastKeystrokes := lastKeystrokes allButLast: 1.
^ self filterTreeNow].
self adjustSubmorphPositions!
Marcel Taeumel uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-mt.1388.mcz
==================== Summary ====================
Name: System-mt.1388
Author: mt
Time: 1 February 2023, 11:43:21.869959 am
UUID: 5efd03cc-8603-8540-8313-cd8b7292549c
Ancestors: System-mt.1387
Fix file-out type-id for CompiledBlock. Thanks to Stéphane (spfa)!
=============== Diff against System-mt.1387 ===============
Item was changed:
----- Method: DataStream class>>initialize (in category 'class initialization') -----
initialize
"TypeMap maps Smalltalk classes to type ID numbers which identify the data stream primitive formats. nextPut: writes these IDs to the data stream. NOTE: Changing these type ID numbers will invalidate all extant data stream files. Adding new ones is OK.
Classes named here have special formats in the file. If such a class has a subclass, it will use type 9 and write correctly. It will just be slow. (Later write the class name in the special format, then subclasses can use the type also.)
See nextPut:, next, typeIDFor:, & ReferenceStream>>isAReferenceType:"
"DataStream initialize"
| refTypes t |
refTypes := OrderedCollection new.
t := TypeMap := WeakIdentityKeyDictionary new. "It has to be weak, because some classes may go away, leaving obsolete versions in this dictionary which may make it corrupt."
t at: UndefinedObject put: 1. refTypes add: 0.
t at: True put: 2. refTypes add: 0.
t at: False put: 3. refTypes add: 0.
t at: SmallInteger put: 4. refTypes add: 0.
t at: ByteString put: 5. refTypes add: 1.
t at: ByteSymbol put: 6. refTypes add: 1.
t at: ByteArray put: 7. refTypes add: 1.
t at: Array put: 8. refTypes add: 1.
"(type ID 9 is for arbitrary instances of any class, cf. typeIDFor:)"
refTypes add: 1.
"(type ID 10 is for references, cf. ReferenceStream>>tryToPutReference:)"
refTypes add: 0.
t at: Bitmap put: 11. refTypes add: 1.
t at: Metaclass put: 12. refTypes add: 0.
"Type ID 13 is used for HyperSqueak User classes that must be reconstructed."
refTypes add: 1.
t at: Float put: 14. refTypes add: 1.
t at: Rectangle put: 15. refTypes add: 1. "Allow compact Rects."
"type ID 16 is an instance with short header. See beginInstance:size:"
refTypes add: 1.
self flag: #ByteArray.
t at: ByteString put: 17. refTypes add: 1. "new String format, 1 or 4 bytes of length"
t at: WordArray put: 18. refTypes add: 1. "bitmap-like"
t at: WordArrayForSegment put: 19. refTypes add: 1. "bitmap-like"
t at: SoundBuffer put: 20. refTypes add: 1. "And all other word arrays, both
16-bit and 32-bit. See methods in ArrayedCollection. Overridden in SoundBuffer."
t at: CompiledMethod put: 21. refTypes add: 1. "special creation method"
+ t at: CompiledBlock put: 21. refTypes add: 1. "special creation method"
"t at: put: 22. refTypes add: 0."
ReferenceStream refTypes: refTypes. "save it"
"For all classes that are like WordArrays, store them the way ColorArray is stored. As bits, and able to change endianness."
Smalltalk globals do: [:cls |
(cls isInMemory and: [
cls isBehavior and: [
cls isObsolete not and: [
cls isPointers not and: [
cls isVariable and: [
cls isWords and: [
(t includesKey: cls) not ] ] ] ] ] ])
ifTrue: [ t at: cls put: 20 ] ]!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2087.mcz
==================== Summary ====================
Name: Morphic-mt.2087
Author: mt
Time: 1 February 2023, 10:28:20.602309 am
UUID: cce09371-2b26-b54b-b6e3-dc09e11cc469
Ancestors: Morphic-mt.2086
Harmonize filter-background color between multi-column lists and tree widgets.
=============== Diff against Morphic-mt.2086 ===============
Item was changed:
----- Method: IndentingListItemMorph class>>applyUserInterfaceTheme (in category 'preferences') -----
applyUserInterfaceTheme
+ FilterBackgroundColor := PluggableMultiColumnListMorph filterColumnColor.!
- FilterBackgroundColor := (UserInterfaceTheme current get: #hoverSelectionModifier for: #PluggableListMorph)
- ifNil: [ Color white darker alpha: 0.3 ]
- ifNotNil: [:modifier | modifier value: ((UserInterfaceTheme current get: #color for: #ScrollPane)
- ifNil: [ Color white ]) ].!
Item was changed:
----- Method: IndentingListItemMorph class>>themePriority (in category 'preferences') -----
themePriority
+ ^ PluggableMultiColumnListMorph themePriority - 1!
- ^ 65!
Item was changed:
----- Method: IndentingListItemMorph class>>themeProperties (in category 'preferences') -----
themeProperties
^ {
+ { #filterBackgroundColor. 'Styling'. 'Background color for filter matches.' }.
- { #backgroundFilterColor. 'Styling'. 'Background color for filter matches.' }.
}!
Item was changed:
----- Method: IndentingListItemMorph>>applyUserInterfaceTheme (in category 'updating') -----
applyUserInterfaceTheme
+ filterOffsets := nil.
+ backgroundColor ifNotNil: [backgroundColor := FilterBackgroundColor].!
- filterOffsets := nil.!
Item was changed:
PluggableListMorph subclass: #PluggableMultiColumnListMorph
instanceVariableNames: 'listMorphs'
+ classVariableNames: 'FilterColumnColor'
- classVariableNames: ''
poolDictionaries: ''
category: 'Morphic-Pluggable Widgets'!
!PluggableMultiColumnListMorph commentStamp: '<historical>' prior: 0!
This morph can be used to show a list having multiple columns, The columns are self width sized to make the largest entry in each list fit. In some cases the pane may then be too narrow.
Use it like a regular PluggableListMorph except pass in an array of lists instead of a single list.
There are base assumptions made here that each list in the array of lists is the same size.
Also, the highlight color for the selection is easy to modify in the #highlightSelection method. I used blue
when testing just to see it work.!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph class>>applyUserInterfaceTheme (in category 'preferences') -----
+ applyUserInterfaceTheme
+
+ FilterColumnColor := nil.!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph class>>filterColumnColor (in category 'defaults') -----
+ filterColumnColor
+
+ ^ FilterColumnColor ifNil: [FilterColumnColor := (self userInterfaceTheme get: #hoverSelectionModifier for: self)
+ ifNil: [ (Color gray: 0.85) alpha: 0.5 ]
+ ifNotNil: [:modifier | modifier value: ((self userInterfaceTheme get: #color for: self)
+ ifNil: [ Color white ])]]!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph class>>themePriority (in category 'defaults') -----
+ themePriority
+
+ ^ 65!
Item was added:
+ ----- Method: PluggableMultiColumnListMorph class>>themeProperties (in category 'preferences') -----
+ themeProperties
+
+ ^ super themeProperties, {
+ { #filterColumnColor. 'Styling'. 'Background color for filtered columns.' }.
+ }!
Item was changed:
----- Method: PluggableMultiColumnListMorph>>filterColumnColor (in category 'filtering') -----
filterColumnColor
+ ^ self class filterColumnColor!
- ^ (Color gray: 0.85) alpha: 0.4!
Item was changed:
----- Method: PluggableMultiColumnListMorph>>setListParameters (in category 'initialization') -----
setListParameters
listMorphs ifEmpty: [^ super setListParameters].
+ listMorphs do: [:lm |
+ lm showFilter ifTrue: [lm backgroundColor: self filterColumnColor].
+ listMorph := lm. super setListParameters].
- listMorphs do: [:lm | listMorph := lm. super setListParameters].
listMorph := listMorphs first.!
Marcel Taeumel uploaded a new version of Morphic to project The Trunk:
http://source.squeak.org/trunk/Morphic-mt.2086.mcz
==================== Summary ====================
Name: Morphic-mt.2086
Author: mt
Time: 1 February 2023, 9:22:07.208309 am
UUID: e88c200d-3b9f-1b48-ad27-1ac0669b74a2
Ancestors: Morphic-mt.2085
Fix filter-background color in tree widgets.
=============== Diff against Morphic-mt.2085 ===============
Item was changed:
+ (PackageInfo named: 'Morphic') postscript: 'IndentingListItemMorph applyUserInterfaceTheme. "Filter background color"'!
- (PackageInfo named: 'Morphic') postscript: 'UserInterfaceTheme cleanUpAndReset.'!