[Pkg] The Trunk: Kernel-tpr.979.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jan 14 01:07:46 UTC 2016


tim Rowledge uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-tpr.979.mcz

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

Name: Kernel-tpr.979
Author: tpr
Time: 14 January 2016, 5:07:09.653455 pm
UUID: 066512f9-4f6d-4079-bfbf-92fe82801f6a
Ancestors: Kernel-tpr.978

{Authorisation error: let's try again. Sigh}
Add Time class>eventMillisecondClock (which gets its value from the same api as the vm event creation prim) and use it instead of the new 64bit based clock - this allows d-click code to work.

=============== Diff against Kernel-ul.977 ===============

Item was changed:
  ----- Method: EventSensor>>createMouseEvent (in category 'mouse') -----
  createMouseEvent
  	"create and return a new mouse event from the current mouse 
  	position; this is useful for restarting normal event queue 
  	processing after manual polling"
  
  	| buttons modifiers pos mapped eventBuffer |
  	eventBuffer := Array new: 8.
  	buttons := self primMouseButtons.
  	pos := self primMousePt.
  	modifiers := buttons bitShift: -3.
  	buttons := buttons bitAnd: 7.
  	mapped := self mapButtons: buttons modifiers: modifiers.
  	eventBuffer
  		at: 1
  		put: EventTypeMouse;
+ 		 at: 2 put: Time eventMillisecondClock;
- 		 at: 2 put: Time millisecondClockValue;
  		 at: 3 put: pos x;
  		 at: 4 put: pos y;
  		 at: 5 put: mapped;
  		 at: 6 put: modifiers.
  	^ eventBuffer!

Item was changed:
  ----- Method: EventSensor>>nextEventSynthesized (in category 'private') -----
  nextEventSynthesized
  	"Return a synthesized event. This method is called if an event driven client wants to receive events but the primary user interface is not event-driven (e.g., the receiver does not have an event queue but only updates its state). This can, for instance, happen if a Morphic World is run in an MVC window. To simplify the clients work this method will always return all available keyboard events first, and then (repeatedly) the mouse events. Since mouse events come last, the client can assume that after one mouse event has been received there are no more to come. Note that it is impossible for EventSensor to determine if a mouse event has been issued before so the client must be aware of the possible problem of getting repeatedly the same mouse events. See HandMorph>>processEvents for an example on how to deal with this."
  	| kbd array buttons pos modifiers mapped |
  	"First check for keyboard"
  	array := Array new: 8.
  	kbd := self primKbdNext.
  	kbd ifNotNil:
  		["simulate keyboard event"
  		array at: 1 put: EventTypeKeyboard. "evt type"
+ 		array at: 2 put: Time eventMillisecondClock. "time stamp"
- 		array at: 2 put: Time millisecondClockValue. "time stamp"
  		array at: 3 put: (kbd bitAnd: 255). "char code"
  		array at: 4 put: EventKeyChar. "key press/release"
  		array at: 5 put: (kbd bitShift: -8). "modifier keys"
  		^ array].
  
  	"Then check for mouse"
  	pos := self primMousePt.
  	buttons := mouseButtons.
  	modifiers := buttons bitShift: -3.
  	buttons := buttons bitAnd: 7.
  	mapped := self mapButtons: buttons modifiers: modifiers.
  	array 
  		at: 1 put: EventTypeMouse;
+ 		at: 2 put: Time eventMillisecondClock;
- 		at: 2 put: Time millisecondClockValue;
  		at: 3 put: pos x;
  		at: 4 put: pos y;
  		at: 5 put: mapped;
  		at: 6 put: modifiers.
  	^ array
  
  !

Item was changed:
  ----- Method: EventSensor>>primGetNextEvent: (in category 'private-I/O') -----
  primGetNextEvent: array
  	"Store the next OS event available into the provided array.
  	Essential. If the VM is not event driven the ST code will fall
  	back to the old-style mechanism and use the state based
  	primitives instead."
  	| kbd buttons modifiers pos mapped |
  	<primitive: 94>
  	"Simulate the events"
  	array at: 1 put: EventTypeNone. "assume no more events"
  
  	"First check for keyboard"
  	kbd := super primKbdNext.
  	kbd = nil ifFalse:[
  		"simulate keyboard event"
  		array at: 1 put: EventTypeKeyboard. "evt type"
+ 		array at: 2 put: Time eventMillisecondClock. "time stamp"
- 		array at: 2 put: Time millisecondClockValue. "time stamp"
  		array at: 3 put: (kbd bitAnd: 255). "char code"
  		array at: 4 put: EventKeyChar. "key press/release"
  		array at: 5 put: (kbd bitShift: -8). "modifier keys"
  		^self].
  
  	"Then check for mouse"
  	buttons := super primMouseButtons.
  	pos := super primMousePt.
  	modifiers := buttons bitShift: -3.
  	buttons := buttons bitAnd: 7.
  	mapped := self mapButtons: buttons modifiers: modifiers.
  	(pos = mousePosition and:[(mapped bitOr: (modifiers bitShift: 3)) = mouseButtons])
  		ifTrue:[^self].
  	array 
  		at: 1 put: EventTypeMouse;
+ 		at: 2 put: Time eventMillisecondClock;
- 		at: 2 put: Time millisecondClockValue;
  		at: 3 put: pos x;
  		at: 4 put: pos y;
  		at: 5 put: mapped;
  		at: 6 put: modifiers.
  !

Item was added:
+ ----- Method: Time class>>eventMillisecondClock (in category 'clock') -----
+ eventMillisecondClock
+ 	"In order to make certain event handling code work (cf MouseEvent>asMouseMove) we need access
+ 	to the tick kept by ioMSecs() "
+ 	"Time eventMillisecondClock"
+ 	<primitive: 135>
+ 	^0!



More information about the Packages mailing list