The Trunk: System-fbs.629.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-fbs.629.mcz

commits-2
Frank Shearar uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-fbs.629.mcz

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

Name: System-fbs.629
Author: fbs
Time: 29 November 2013, 8:28:59.973 am
UUID: dd74c513-6ba6-9b48-a6be-8d26309f824b
Ancestors: System-nice.628

In order to break the Graphics -> System dependency a bit more, change FontSubstitution to MissingFont to indicate what when wrong, not when it went wrong, and move the notification to Graphics.

=============== Diff against System-nice.628 ===============

Item was removed:
- Notification subclass: #FontSubstitutionDuringLoading
- instanceVariableNames: 'familyName pixelSize'
- classVariableNames: ''
- poolDictionaries: ''
- category: 'System-Support'!
-
- !FontSubstitutionDuringLoading commentStamp: '<historical>' prior: 0!
- signaled by font loading code when reading a DiskProxy that calls for a missing font.!

Item was removed:
- ----- Method: FontSubstitutionDuringLoading class>>forFamilyName:pixelSize: (in category 'instance creation') -----
- forFamilyName: aName pixelSize: aSize
- ^(self new)
- familyName: aName;
- pixelSize: aSize;
- yourself.!

Item was removed:
- ----- Method: FontSubstitutionDuringLoading>>defaultAction (in category 'handling') -----
- defaultAction
- familyName ifNil: [ familyName := 'NoName' ].
- pixelSize ifNil: [ pixelSize := 12 ].
-
- ^((familyName beginsWith: 'Comic')
- ifTrue: [ TextStyle named: (Preferences standardEToysFont familyName) ]
- ifFalse: [ TextStyle default ]) fontOfSize: pixelSize.!

Item was removed:
- ----- Method: FontSubstitutionDuringLoading>>familyName (in category 'accessing') -----
- familyName
- "Answer the value of familyName"
-
- ^ familyName!

Item was removed:
- ----- Method: FontSubstitutionDuringLoading>>familyName: (in category 'accessing') -----
- familyName: anObject
- "Set the value of familyName"
-
- familyName := anObject!

Item was removed:
- ----- Method: FontSubstitutionDuringLoading>>pixelSize (in category 'accessing') -----
- pixelSize
- "Answer the value of pixelSize"
-
- ^ pixelSize!

Item was removed:
- ----- Method: FontSubstitutionDuringLoading>>pixelSize: (in category 'accessing') -----
- pixelSize: anObject
- "Set the value of pixelSize"
-
- pixelSize := anObject!

Item was removed:
- ----- Method: FontSubstitutionDuringLoading>>printOn: (in category 'printing') -----
- printOn: aStream
- super printOn: aStream.
- aStream nextPut: $(;
- nextPutAll: familyName;
- nextPut: $-;
- print: pixelSize;
- nextPut: $).!

Item was changed:
  ----- Method: ProjectLoading class>>openName:stream:fromDirectory:withProjectView: (in category 'loading') -----
  openName: aFileName stream: preStream fromDirectory: aDirectoryOrNil
  withProjectView: existingView
  "Reconstitute a Morph from the selected file, presumed to be
  represent a Morph saved via the SmartRefStream mechanism, and open it
  in an appropriate Morphic world."
 
      | morphOrList proj trusted localDir projStream archive mgr
  projectsToBeDeleted baseChangeSet enterRestricted substituteFont
  numberOfFontSubstitutes exceptions |
  (preStream isNil or: [preStream size = 0]) ifTrue: [
  ProgressNotification  signal: '9999 about to enter
  project'. "the hard part is over"
  ^self inform:
  'It looks like a problem occurred while
  getting this project. It may be temporary,
  so you may want to try again,' translated
  ].
  ProgressNotification signal: '2:fileSizeDetermined
  ',preStream size printString.
  preStream isZipArchive
  ifTrue:[ archive := ZipArchive new readFrom: preStream.
  projStream := self
  projectStreamFromArchive: archive]
  ifFalse:[projStream := preStream].
  trusted := SecurityManager default positionToSecureContentsOf:
  projStream.
  trusted ifFalse:
  [enterRestricted := (preStream isTypeHTTP or:
  [aFileName isNil])
  ifTrue: [Preferences securityChecksEnabled]
  ifFalse: [Preferences standaloneSecurityChecksEnabled].
  enterRestricted
  ifTrue: [SecurityManager default enterRestrictedMode
  ifFalse:
  [preStream close.
  ^ self]]].
 
  localDir := Project squeakletDirectory.
  aFileName ifNotNil: [
  (aDirectoryOrNil isNil or: [aDirectoryOrNil pathName
  ~= localDir pathName]) ifTrue: [
  localDir deleteFileNamed: aFileName.
  (localDir fileNamed: aFileName) binary
  nextPutAll: preStream contents;
  close.
  ].
  ].
  morphOrList := projStream asUnZippedStream.
  preStream sleep. "if ftp, let the connection close"
  ProgressNotification  signal: '3:unzipped'.
  ResourceCollector current: ResourceCollector new.
  baseChangeSet := ChangeSet current.
  self useTempChangeSet. "named zzTemp"
  "The actual reading happens here"
  substituteFont := Preferences standardEToysFont copy.
  numberOfFontSubstitutes := 0.
  exceptions := Set new.
  [[morphOrList := morphOrList fileInObjectAndCodeForProject]
+ on: MissingFont do: [ :ex |
- on: FontSubstitutionDuringLoading do: [ :ex |
  exceptions add: ex.
  numberOfFontSubstitutes :=
  numberOfFontSubstitutes + 1.
  ex resume: substituteFont ]]
  ensure: [ ChangeSet  newChanges: baseChangeSet].
  mgr := ResourceManager new initializeFrom: ResourceCollector current.
  mgr fixJISX0208Resource.
  mgr registerUnloadedResources.
  archive ifNotNil:[mgr preLoadFromArchive: archive cacheName:
  aFileName].
  (preStream respondsTo: #close) ifTrue:[preStream close].
  ResourceCollector current: nil.
  ProgressNotification  signal: '4:filedIn'.
  ProgressNotification  signal: '9999 about to enter project'.
  "the hard part is over"
  (morphOrList isKindOf: ImageSegment) ifTrue: [
  proj := morphOrList arrayOfRoots
  detect: [:mm | mm isKindOf: Project]
  ifNone: [^self inform: 'No project found in
  this file'].
  proj projectParameters at: #substitutedFont put: (
  numberOfFontSubstitutes > 0
  ifTrue: [substituteFont]
  ifFalse: [#none]).
  proj projectParameters at: #MultiSymbolInWrongPlace put: false.
  "Yoshiki did not put MultiSymbols into
  outPointers in older images!!"
  morphOrList arrayOfRoots do: [:obj |
  obj fixUponLoad: proj seg: morphOrList "imageSegment"].
  (proj projectParameters at: #MultiSymbolInWrongPlace) ifTrue: [
  morphOrList arrayOfRoots do: [:obj | (obj
  isKindOf: HashedCollection) ifTrue: [obj rehash]]].
 
  proj resourceManager: mgr.
  "proj versionFrom: preStream."
  proj lastDirectory: aDirectoryOrNil.
  proj setParent: Project current.
  projectsToBeDeleted := OrderedCollection new.
  existingView ifNil: [
  ChangeSet allChangeSets add: proj changeSet.
  Project current openProject: proj.
  "Note: in MVC we get no further than the above"
  ] ifNotNil: [
  (existingView project isKindOf: DiskProxy) ifFalse: [
  existingView project changeSet name:
  ChangeSet defaultName.
  projectsToBeDeleted add: existingView project.
  ].
  (existingView owner isSystemWindow) ifTrue: [
  existingView owner model: proj
  ].
  existingView project: proj.
  ].
  ChangeSet allChangeSets add: proj changeSet.
  Project current projectParameters
  at: #deleteWhenEnteringNewProject
  ifPresent: [ :ignored |
  projectsToBeDeleted add: Project current.
  Project current removeParameter:
  #deleteWhenEnteringNewProject.
  ].
  projectsToBeDeleted isEmpty ifFalse: [
  proj projectParameters
  at: #projectsToBeDeleted
  put: projectsToBeDeleted.
  ].
  ^ ProjectEntryNotification signal: proj
  ].
  Project current openViewAndEnter: morphOrList
  !