patches
author Claus Gittinger <cg@exept.de>
Wed, 22 Oct 1997 15:57:55 +0200
changeset 255 ccb6df643f77
parent 253 96cf37d23471
child 256 e603bb9e0469
permissions -rw-r--r--
*** empty log message ***

"/
"/ $Header$
"/
"/ This file is processed at initial startup 
"/ - not when resuming an image.
"/

"/
"/ install uncompiled classes as autoload
"/ classes ... (if not already present)
"/ Autoloaded classes will be automatically filed-in
"/ when first accessed. This allows a smaller executable,
"/ but creates a short delay, when the class is loaded on
"/ first access.
"/
"/ You can add more classes to these lists -
"/ i.e. all your classes you like to have around,
"/ but which are not needed often enough to justify
"/ machine code for them ...

|requiredClasses|

'patches [info]: initial startup (snapshot image restart is faster) ...' infoPrintCR.

ObjectMemory justInTimeCompilation:false.

"/ GLXWorkstation forceGL:true.
"/ OperatingSystem disableSignal:14.

ObjectMemory infoPrinting:false.
"/ Smalltalk loadBinaries:true.
Compiler allowUnderscoreInIdentifier:true. 
Compiler warnUnderscoreInIdentifier:false. 
Compiler warnSTXSpecials:false.

Project notNil ifTrue:[
    Project setDefaultProject.
    Project current packageName:#'autoloaded'.
].

"/
"/ when filing in, keep source as reference to file
"/ (instead of keeping a string locally in the image)
"/
"/ I disable this - its dangerous if you fileIn
"/ classes from other directories and fileOut later clobbers those files
"/
"/ ClassCategoryReader sourceMode:#reference.

"/
"/ the following are required (either compiled or interpreted) ...
"/
requiredClasses := #( 
     ObsoleteObject
     BinaryIOManager BinaryInputManager BinaryOutputManager BinaryObjectStorage
     StringCollection
).

requiredClasses do:[:s |
    (Smalltalk at:s) isNil ifTrue:[
	('patches [info]: loading ' , s , ' ...') infoPrintCR.
	Smalltalk fileInClass:s initialize:true lazy:false silent:true
    ]
].
!

|optionalViews|

(Smalltalk at:#View) isNil ifTrue:[
    'patches [info]: installing required autoloaded classes ...' infoPrintCR.

    optionalViews := #(
			DeviceWorkstation
			Workstation
			XWorkstation
			DisplayRootView
			SimpleView
			TopView
			StandardSystemView
			ModalBox
			View
			PseudoView
			DeviceDrawable
			DisplayMedium
			GraphicsContext
			Image
			ViewStyle
			KeyboardMap
			KeyboardForwarder
			TextCollector
			SynchronousWindowSensor
			WindowSensor
			WindowGroup
			WindowEvent
			WindowingTransformation
			FontDescription
			Font
			Form
			Cursor
			Color
			Depth1Image
			Depth8Image
			ResourcePack
			Model
			Controller
			ApplicationModel
			WindowBuilder
			PopUpView
			ShadowView
			Colormap
			DeviceHandle
			DisplayObject
		     ).
    optionalViews do:[:s |
	"install if not already compiled-in"
	(Smalltalk at:s) isNil ifTrue:[
	    Autoload subclass:s
		 instanceVariableNames:''
		 classVariableNames:''
		 poolDictionaries:''
		 category:'autoloaded-Views'
	]
    ].
    (Smalltalk at:#DeviceWorkstation) autoload.
    (Smalltalk at:#XWorkstation) autoload.
    (Smalltalk at:#Workstation) autoload.
    (Smalltalk at:#DeviceHandle) autoload.
].
!

"/
"/ read the abbrev.stc file, extract class names
"/ and install all nonExisting classes as autoloaded
"/
|needToReactivate|

HistoryManager notNil ifTrue:[
    needToReactivate := HistoryManager isActive.
    HistoryManager deactivate.
] ifFalse:[
    needToReactivate := false
].

Class withoutUpdatingChangesDo:[   
   'patches [info]: installing autoloaded classes ...' infoPrintCR.
   Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc'.
].
needToReactivate ifTrue:[HistoryManager activate].
!

"/
"/ a kludge: we might have added new ImageReaders above - let Image know about it
"/
|imageClass cls|

imageClass := Smalltalk at:#Image ifAbsent:nil.
imageClass notNil ifTrue:[
    imageClass isBehavior ifTrue:[
	imageClass initializeFileFormatTable.
    ]
].

"/
"/ some ST80 name aliases
"/ (actually, much more is needed - this is just a start ...)
"/
(cls := Smalltalk at:#StandardSystemView) notNil ifTrue:[
    Smalltalk at:#ScheduledWindow put:cls
].
(cls := Smalltalk at:#Socket) notNil ifTrue:[
    Smalltalk at:#UnixSocketAccessor put:cls.
    Smalltalk at:#SocketAccessor put:cls.
].
Smalltalk at:#BlockClosure put:Block.
(cls := Smalltalk at:#DialogBox) notNil ifTrue:[
    Smalltalk at:#Dialog     put:cls.
    Smalltalk at:#DialogView put:cls.
].
Smalltalk at:#ByteString put:String.
Smalltalk at:#ByteEncodedString put:String.
Smalltalk at:#Console put:Stderr.

"/ FileDirectory notNil ifTrue:[
"/     Smalltalk at:#Disk put:(Filename rootDirectory)
"/ ].

Display notNil ifTrue:[
    Smalltalk at:#Window put:(Display class).
    Smalltalk at:#Screen put:(Display class).
    Smalltalk at:#Sensor put:Display.
].

"/
"/ ST/X has (currently) no Double, but Float is what ST-80's Double is ...
"/
Smalltalk at:#Double put:Float.

"/
"/ Temporary backward comatibility (will be removed)
"/
"/ Smalltalk at:#NewLauncher put:Launcher.

Project notNil ifTrue:[
    Project setDefaultProject.
    Project current packageName:#'patches'.
].

'patches [info]: installing patches ...' infoPrintCR.
!

"/
"/ the following patches where added by the changesBrowsers 'make change a patch'
"/ function ...
"/
!