[squeak-dev] The Trunk: Kernel-eem.1407.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Mon Jul 12 10:56:24 UTC 2021


> Eliminate cases handled by otherwise clause in installVirtualKeyTable. 

Okay. Yet, this was deliberate documentation that the VM knows about those window managers. Maybe it's not worth supporting it. :-)

Best,
Marcel
Am 09.07.2021 23:46:32 schrieb commits at source.squeak.org <commits at source.squeak.org>:
Eliot Miranda uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-eem.1407.mcz

==================== Summary ====================

Name: Kernel-eem.1407
Author: eem
Time: 9 July 2021, 2:46:18.688883 pm
UUID: 48a520fa-d6a2-44fa-8508-3405e7e0b8b9
Ancestors: Kernel-mt.1406

Have scanForInstructionSequence: descend into full blocks. Eliminate cases handled by otherwise clause in installVirtualKeyTable. Add error code to resue primitive invocation.

=============== Diff against Kernel-mt.1406 ===============

Item was changed:
----- Method: EventSensor class>>installVirtualKeyTable (in category 'class initialization') -----
installVirtualKeyTable

VirtualKeyTable := Smalltalk windowSystemName
caseOf: {
['Windows'] -> [self virtualKeysOnWindows].
['Win32' "older VMs"] -> [self virtualKeysOnWindows].
['Aqua'] -> [self virtualKeysOnMacOS].
['X11'] -> [self virtualKeysOnX11].
- ['RiscOS'] -> [Dictionary new].
- ['Quartz'] -> [Dictionary new].
} otherwise: [Dictionary new].

"Shift 8 bits to not overwrite virtual-key mappings from above."
self mapControlKeysToCommandKeys ifTrue: [
VirtualKeyTable
at: (2r0010 "ctrl" bitShift: 8)
put: (2r1010 "cmd+ctrl").
VirtualKeyTable
at: (2r0011 "ctrl+shift" bitShift: 8)
put: (2r1011 "cmd+ctrl+shift")].

self mapAltKeysToOptionKeys ifTrue: [
VirtualKeyTable
at: (2r1000 "cmd/alt" bitShift: 8)
put: (2r1100 "cmd/alt+opt").
VirtualKeyTable
at: (2r1001 "cmd/alt+shift" bitShift: 8)
put: (2r1101 "cmd/alt+opt+shift")].!

Item was changed:
----- Method: InstructionStream>>scanForInstructionSequence: (in category 'scanning') -----
scanForInstructionSequence: naryBlock
"naryBlock is a block taking one or more arguments.
Evaluate it for each sequence of instructions of length
n in the receiver until naryBlock evaluates to true.
Answer if naryBlock evaluated to true."
| instructions |
instructions := OrderedCollection withAll: ((1 to: naryBlock numArgs) collect:
[:ign|
+ self atEnd ifFalse:
+ [self nextInstruction]]).
+ instructions last ifNil: "not enough instructions, so no match in this method, but must check for blocks"
+ [instructions do:
+ [:instOrNil|
+ instOrNil ifNil: [^false].
+ (instOrNil selector == #pushFullClosure:numCopied:
+ and: [(self class on: instOrNil argument) scanForInstructionSequence: naryBlock]) ifTrue:
+ [^true]]].
- self atEnd ifTrue: [^false].
- self nextInstruction]).
[(naryBlock valueWithArguments: instructions asArray) ifTrue:
[^true].
+ (instructions first selector == #pushFullClosure:numCopied:
+ and: [(self class on: instructions first argument) scanForInstructionSequence: naryBlock]) ifTrue:
+ [^true].
self atEnd] whileFalse:
[instructions removeFirst; addLast: self nextInstruction].
^false!

Item was changed:
----- Method: Process>>resume (in category 'changing process state') -----
resume
"Primitive. Allow the process that the receiver represents to continue. Put
the receiver in line to become the activeProcess. Fail if the receiver is
already waiting in a queue (in a Semaphore or ProcessScheduler). Fail if
the receiver's suspendedContext is not a context.
Essential. See Object documentation whatIsAPrimitive."

+
-
self primitiveFailed!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210712/4b2470e6/attachment.html>


More information about the Squeak-dev mailing list