[squeak-dev] The Trunk: Morphic-dtl.668.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Jul 13 19:48:46 UTC 2013

David T. Lewis uploaded a new version of Morphic to project The Trunk:

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

Name: Morphic-dtl.668
Author: dtl
Time: 13 July 2013, 3:46:37.042 pm
UUID: b5f77258-d06d-4daa-b5d0-69899ab79585
Ancestors: Morphic-fbs.667

Provide class comments for MorphicProject and MVCProject.

UIProcess is maintained as a global in Project, but is meaningful only in Morphic. Make it an instance variable in MorphicProject.

Changes affect packages: System, Morphic, ST80.

Follow up required: remove the global after converting existing MorphicProject instances.

=============== Diff against Morphic-fbs.667 ===============

Item was changed:
  Project subclass: #MorphicProject
+ 	instanceVariableNames: 'uiProcess'
- 	instanceVariableNames: ''
  	classVariableNames: 'DefaultFill'
  	poolDictionaries: ''
  	category: 'Morphic-Support'!
+ !MorphicProject commentStamp: 'dtl 7/13/2013 15:40' prior: 0!
+ An MorphicProject is a project with a Morphic user interface. Its world is a PasteUpMorph, and its UI manager is a MorphicUIManager. It uses a MorphicToolBuilder to create the views for various tools. It has a single uiProcess for its world, and Morph updates and user interaction occur in the context of that UI process.
+ !
- !MorphicProject commentStamp: 'ar 9/18/2009 21:38' prior: 0!
- Holds Morphic Projects. Very much in transition.!

Item was changed:
  ----- Method: MorphicProject class>>initialize (in category 'class initialization') -----
  initialize	"MorphicProject initialize"
  	"Initialize the default Morphic Project background"
  	self defaultFill: (InfiniteForm with: self defaultBackgroundForm).
  	self convertOldProjects.
  	Project current isMorphic ifTrue:[
  		"Set the default background in the current world"
  		Project current world color: self defaultFill.
+ 	].
+ 	"update the uiProcess instance variable in all Morphic projects"
+ 	self allSubInstances do: [:p | p uiProcess].!
- 	].!

Item was changed:
  ----- Method: MorphicProject>>interruptName:preemptedProcess: (in category 'utilities') -----
  interruptName: labelString preemptedProcess: theInterruptedProcess
  	"Create a Notifier on the active scheduling process with the given label."
  	| preemptedProcess projectProcess |
  	ActiveHand ifNotNil:[ActiveHand interrupted].
  	ActiveWorld := World. "reinstall active globals"
  	ActiveHand := World primaryHand.
  	ActiveHand interrupted. "make sure this one's interrupted too"
  	ActiveEvent := nil.
+ 	projectProcess := self uiProcess.	"we still need the accessor for a while"
- 	projectProcess := UIProcess.	"we still need the accessor for a while"
  	preemptedProcess := theInterruptedProcess ifNil: [Processor preemptedProcess].
  	"Only debug preempted process if its priority is >= projectProcess' priority"
  	preemptedProcess priority < projectProcess priority 
  		ifTrue:[preemptedProcess := projectProcess].
  	preemptedProcess suspend.
  	Debugger openInterrupt: labelString onProcess: preemptedProcess

Item was changed:
  ----- Method: MorphicProject>>spawnNewProcess (in category 'active process') -----
+ 	uiProcess := [
- 	UIProcess := [
  		[World doOneCycle.  Processor yield ] repeat.
  	] newProcess priority: Processor userSchedulingPriority.
+ 	uiProcess resume!
- 	UIProcess resume!

Item was changed:
  ----- Method: MorphicProject>>spawnNewProcessIfThisIsUI: (in category 'active process') -----
  spawnNewProcessIfThisIsUI: suspendedProcess
  	"Initialize a UI process if needed. Answer true if suspendedProcess was interrupted
  	from a UI process."
+ 	self uiProcess == suspendedProcess ifTrue: [
- 	UIProcess == suspendedProcess ifTrue: [
  		self spawnNewProcess.
  	^false		"no new process was created"

Item was added:
+ ----- Method: MorphicProject>>uiProcess (in category 'active process') -----
+ uiProcess
+ 	^uiProcess ifNil: [uiProcess := UIProcess]!

Item was added:
+ ----- Method: MorphicProject>>uiProcess: (in category 'active process') -----
+ uiProcess: newUIProcess
+ 	^uiProcess := newUIProcess!

More information about the Squeak-dev mailing list