[squeak-dev] The Trunk: Kernel-bf.663.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Jan 5 17:42:05 UTC 2012


Bert Freudenberg uploaded a new version of Kernel to project The Trunk:
http://source.squeak.org/trunk/Kernel-bf.663.mcz

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

Name: Kernel-bf.663
Author: bf
Time: 5 January 2012, 6:41:16.427 pm
UUID: 30a6e9d4-3733-4160-8b28-78a6482c1de0
Ancestors: Kernel-ul.662

- dispatch events to HostWindowProxy
- add EventSensorConstants for window events and touch events

=============== Diff against Kernel-ul.662 ===============

Item was changed:
  ----- Method: EventSensor>>processEvent: (in category 'private-I/O') -----
  processEvent: evt 
  	"Process a single event. This method is run at high priority."
+ 	| type buttons window |
- 	| type buttons |
  	type := evt at: 1.
+ 
+ 	"Only process main window events, forward others to host window proxies"
+ 	window := evt at: 8.
+ 	(window isNil or: [window isZero]) ifTrue: 
+ 		[window := 1. 
+ 		evt at: 8 put: window].
+ 	window = 1 ifFalse: [
+ 		^Smalltalk at: #HostWindowProxy ifPresent: [:w | w processEvent: evt]].
+ 
  	"Tackle mouse events first"
  	type = EventTypeMouse
  		ifTrue: [buttons := (ButtonDecodeTable at: (evt at: 5) + 1). 
  				evt at: 5 put: (Smalltalk platformName = 'Mac OS'
  							ifTrue: [ buttons ]
  							ifFalse: [ self mapButtons: buttons modifiers: (evt at: 6) ]).
  				self queueEvent: evt.
  				self processMouseEvent: evt . 
  				^self].
  	
  	
  	"Store the event in the queue if there's any"
  	type = EventTypeKeyboard
  		ifTrue: [ "Check if the event is a user interrupt"
  			((evt at: 4) = 0
  				and: [((evt at: 3)
  						bitOr: (((evt at: 5)
  							bitAnd: 8)
  							bitShift: 8))
  							= interruptKey])
  					ifTrue: ["interrupt key is meta - not reported as event"
  							^ interruptSemaphore signal].
  			"Else swap ctrl/alt keys if neeeded.
  			Look at the Unicode char first, then ascii."
  			KeyDecodeTable
  				at: {evt at: 6. evt at: 5}
  				ifPresent: [:a | evt at: 6 put: a first;
  						 at: 5 put: a second]. 
  			KeyDecodeTable
  				at: {evt at: 3. evt at: 5}
  				ifPresent: [:a | evt at: 3 put: a first;
  						 at: 5 put: a second]. 
  			self queueEvent: evt. 
  			self processKeyboardEvent: evt . 
  			^self ].
  				
  	"Handle all events other than Keyborad or Mouse."
  	self queueEvent: evt.
  	!

Item was changed:
  SharedPool subclass: #EventSensorConstants
  	instanceVariableNames: ''
+ 	classVariableNames: 'BlueButtonBit CommandKeyBit CtrlKeyBit EventKeyChar EventKeyDown EventKeyUp EventTouchCancelled EventTouchDown EventTouchMoved EventTouchStationary EventTouchUp EventTypeComplex EventTypeDragDropFiles EventTypeKeyboard EventTypeMenu EventTypeMouse EventTypeNone EventTypeWindow OptionKeyBit RedButtonBit ShiftKeyBit TouchPhaseBegan TouchPhaseCancelled TouchPhaseEnded TouchPhaseMoved TouchPhaseStationary WindowEventActivated WindowEventClose WindowEventIconise WindowEventMetricChange WindowEventPaint WindowEventStinks YellowButtonBit'
- 	classVariableNames: 'BlueButtonBit CommandKeyBit CtrlKeyBit EventKeyChar EventKeyDown EventKeyUp EventTypeDragDropFiles EventTypeKeyboard EventTypeMenu EventTypeMouse EventTypeNone EventTypeWindow OptionKeyBit RedButtonBit ShiftKeyBit YellowButtonBit'
  	poolDictionaries: ''
  	category: 'Kernel-Processes'!

Item was changed:
  ----- Method: EventSensorConstants class>>initialize (in category 'pool initialization') -----
  initialize
  	"EventSensorConstants initialize"
  	RedButtonBit := 4.
  	BlueButtonBit := 2.
  	YellowButtonBit := 1.
  
  	ShiftKeyBit := 1.
  	CtrlKeyBit := 2.
  	OptionKeyBit := 4.
  	CommandKeyBit := 8.
  
  	"Types of events"
  	EventTypeNone := 0.
  	EventTypeMouse := 1.
  	EventTypeKeyboard := 2.
  	EventTypeDragDropFiles := 3.
  	EventTypeMenu := 4.
  	EventTypeWindow := 5.
+ 	EventTypeComplex := 6.
  
  	"Press codes for keyboard events"
  	EventKeyChar := 0.
  	EventKeyDown := 1.
  	EventKeyUp := 2.
+ 
+ 	"Host window events"
+ 	WindowEventMetricChange := 1.
+ 	WindowEventClose := 2.
+ 	WindowEventIconise := 3. 
+ 	WindowEventActivated	:= 4. 
+ 	WindowEventPaint := 5.
+ 	WindowEventStinks := 6.
+ 
+ 	"types for touch events"
+ 	EventTouchDown := 1.
+ 	EventTouchUp := 2.
+ 	EventTouchMoved := 3.
+ 	EventTouchStationary := 4.
+ 	EventTouchCancelled := 5.
+ 
+ 	"iOS touch phase constants"
+ 	TouchPhaseBegan := 0.
+ 	TouchPhaseMoved := 1.
+ 	TouchPhaseStationary := 2.
+ 	TouchPhaseEnded := 3.
+ 	TouchPhaseCancelled := 4.
  !




More information about the Squeak-dev mailing list