smalltalk.rc
author claus
Wed, 16 Aug 1995 17:38:28 +0200
changeset 25 463dd2575719
parent 24 1b6ff7a7839e
child 26 398bad70619c
permissions -rw-r--r--
.

"/
"/ $Header$
"/ startup configuration for smalltalk
"/
"/ - everything in here are plain smalltalk expressions;
"/ - statements with in a group are separated by a period.
"/ - Each group of statements has to be delimited by an exclamation
"/   character.
"/ - avoid exclas in comments (or double them)
"/ - nested comments are not allowed - take care.
"/
"/ remember: this is fileOut-format
"/
"/ comments can be either:
"/ - standard smalltalk comments (i.e. from dquote to dquote)
"/ - ST/X end of line comments (i.e. dquote followed by /)
"/
"/    "this is a comment"
"/    "/ another comment
"/
"/***************************************************************
"/ PLEASE: only add things here, if they are of general interrest
"/         and NEITHER site specific NOT display specific.
"/
"/ site specific things are to be added to "h_<hostname>.rc"
"/ display specifics to "d_<displayName>.rc"
"/ and private user stuff in "private.rc"
"/***************************************************************

"/
"/ map Language variable setting to known and handled
"/ values:
Language == #De ifTrue:[
	Language := #german
].
!

"/
"/ just a quick check, if this ST/X installation seems to
"/ be halfway complete (it happened to some people, that
"/ their source/resource directories where not installed)
"/ - better to warn early ... 
"/
|anyWrong missing|
anyWrong := false.
missing := ''.
(Smalltalk getSystemFileName:'resources/SBrowser.rs') isNil ifTrue:[
    '***********************************************************************' errorPrintNL.
    '***** ATTENTION: please check installation of your resource files' errorPrintNL.
    anyWrong := true.
    missing := '''resources'' '.
].
(Smalltalk getSystemFileName:'source/Object.st') isNil ifTrue:[
    '***********************************************************************' errorPrintNL.
    '***** ATTENTION: please check installation of your source files' errorPrintNL.
    '***** ' errorPrintNL.
    '***** the browser/debugger may not be able to show sourcecode.' errorPrintNL.
    anyWrong := true.
    missing := missing , '''source'' '.
].
(Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm') isNil ifTrue:[
    '***********************************************************************' errorPrintNL.
    '***** ATTENTION: please check installation of your bitmap files' errorPrintNL.
    anyWrong := true.
    missing := missing , '''bitmaps'' '.
].
(Smalltalk getSystemFileName:'resources/normal.style') isNil ifTrue:[
    '***********************************************************************' errorPrintNL.
    '***** ATTENTION: please check installation of your style files' errorPrintNL.
    anyWrong := true.
    missing := missing , '''resources'' '.
].

anyWrong ifTrue:[
    '*****' errorPrintNL.
    '***** directory(s) named: ' errorPrint. missing errorPrint. 'incomplete/not existing' errorPrintNL.
    '***** your path is: ' errorPrint.
    Smalltalk systemPath asArray storeString errorPrintNL.

    '*****' errorPrintNL.
    '***** Try: "make source bitmaps resources styles"' errorPrintNL.
    '*****  or: "make symlinks" to fix this.' errorPrintNL.
    '***********************************************************************' errorPrintNL.
]
!

"/
"/ check for display-classes being compiled into the system;
"/ (and if display connection can be established)
"/ if not, enter a simple read-eval-print loop
"/
Display isNil ifTrue:[
    DeviceWorkstation notNil ifTrue:[
	'cannot connect to display' errorPrintNewline
    ] ifFalse:[
	'oops - no display' errorPrintNewline.
    ].
    Smalltalk readEvalPrint.
    Smalltalk exit
].

"/
"/ this makes X-errors be handled immediately (so you see,
"/ where it occured) but slows down the system soooo muuuucccchhh ..
"/ if commented out, errors will be reported asynchronously.
"/ (I enable this, when things go bad during startup)
"/
"/ Display unBuffered.

"/
"/ this starts the incremental GC earlier
"/ (default is 500000)
"/ the number given is the number of bytes which have to be allocated
"/ since the last GC, to start the incremental GC running.
"/ (see ObjectMemory>>documentation)
"/ Claus: I moved this to the private.rc file
"/
"/ ObjectMemory incrementalGCLimit:100000. 

"/
"/ this starts the incremental GC when freeSpace drops below a limit
"/ (default is nil - i.e. dont look at freeSpace)
"/ (see ObjectMemory>>documentation)
"/ Claus: I moved this to the private.rc file
"/
"/ ObjectMemory freeSpaceGCLimit:300000. 

"/
"/ lazy loading
"/ (faster fileIn) - this is EXPERIMENTAL.
"/ If there are any problems with lazy methods, disable the following
"/ and let me (cg@ssw.de) know what happened.
"/
Autoload compileLazy:true.

"/
"/ define the language (you can also set the LANG-shell variable)
"/ (currently only #english and #german are supported)
"/ setting it here will override the LANG variable setting,
"/ if neither set here nor in LANG, #english is the default.
"/ (currently, strings are not available for other than english
"/  and german; french will follow next - see resource files)
"/ Claus: supposed to be done in private.rc or via LANG variable
"/
"/ Smalltalk language:#german.
"/ Smalltalk language:#english. 

"/
"/ this handles all variant display stuff
"/ (i.e. things which might change, when DISPLAY is set different)
"/
Smalltalk fileIn:'display.rc'.

"/
"/ this defines stuff relating to the host we are running on
"/
Smalltalk fileIn:'host.rc'.

"/
"/ set the package to some useful default
"/
Project notNil ifTrue:[
    Project setDefaultProject.
    Project current packageName:#'private'.
].

"/
"/ you can add your very private things here - if its put into HOME/.smalltalk,
"/ each user can add his/her private things even when everything else is
"/ shared
"/
Transcript showCr:'reading private.rc ...'.
Smalltalk fileIn:'private.rc'.

View defaultStyle isNil ifTrue:[
    Transcript showCr:'no style set in rc files - using default'.
    View defaultStyle:#motif.
].

"/
"/ start some views ...
"/ you can add all stuff you'd like to come up by default
"/ the first time.
"/ NOTICE: you should do that in your 'private.rc'-file
"/

NewLauncher notNil ifTrue:[
    'starting main-menu ...' errorPrintNL.
    NewLauncher open
] ifFalse:[
    "*
     * start a Transcript (if linked-in)
     *"
    TextCollector notNil ifTrue:[
	'starting Transcript ...' errorPrintNL.
	TextCollector newTranscript.
"/      Transcript lineLimit:2000.
    ].

    "*
     * start the Launcher (if linked-in)
     *"
    Launcher notNil ifTrue:[
	'starting main-menu ...' errorPrintNL.
	Launcher open
    ].
].

"/
"/ start a SystemBrowser
"/ - I dont want one (using Launcher)
"/
"/ SystemBrowser open.

"/
"/ start a FileBrowser
"/ - I dont want one (using Launcher)
"/
"/ FileBrowser open.

"/
"/ start a Workspace 
"/ - I dont want one (using Launcher)
"/
"/ Workspace open.

"/
"/ if things go very badly, turn on message tracing ...
"/ but be prepared for lots of output
"/
"/ Smalltalk debugOn.

"/
"/ if error occurs, and debugger has problems coming up
"/
"/ Debugger := MiniDebugger.

"/
"/ remember the type of display we started on, to check for
"/ a need to change things when we are restarted on another display.
"/ see smalltalk_r.rc for what this is for ...
"/
Smalltalk at:#'_ImageDisplayDepth' put:Display depth.
Smalltalk at:#'_ImageDisplayHasColors' put:Display hasColors.
Smalltalk at:#'_ImageDisplayHasGreyscales' put:Display hasGreyscales.

"/ Processor activeProcess vmTrace:true.
!