Smalltalk.st
author Claus Gittinger <cg@exept.de>
Wed, 21 Dec 2005 14:39:49 +0100
changeset 9029 09b858d6135d
parent 9028 b7d7b7b0ca4d
child 9030 ebfba7803a10
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     1
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1988 by Claus Gittinger
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
     3
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
5363
0070ef95a033 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
    13
"{ Package: 'stx:libbasic' }"
0070ef95a033 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
    14
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    15
Object subclass:#Smalltalk
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    16
	instanceVariableNames:''
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
    17
	classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
    18
		NumberOfClassesHint SystemPath StartupClass StartupSelector
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
    19
		StartupArguments CommandLine CommandName CommandLineArguments
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
    20
		CachedAbbreviations SilentLoading Initializing StandAlone
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
    21
		HeadlessOperation IsPlugin DebuggingStandAlone LogDoits
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
    22
		LoadBinaries RealSystemPath ResourcePath SourcePath BitmapPath
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
    23
		BinaryPath FileInPath PackagePath BinaryDirName ResourceDirName
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
    24
		SourceDirName BitmapDirName PackageDirName FileInDirName
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
    25
		ChangeFileName ImageStartTime ImageRestartTime DemoMode
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
    26
		SaveEmergencyImage SpecialObjectArray CallbackSignal
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
    27
		KnownPackages ClassesFailedToInitialize'
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    28
	poolDictionaries:''
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    29
	category:'System-Support'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    30
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    31
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
    32
Smalltalk comment:'declared from: ..\..\..\stx\libbasic\abbrev.stc'
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
    33
!
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
    34
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
    35
!Smalltalk class methodsFor:'documentation'!
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    36
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    37
copyright
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    38
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    39
 COPYRIGHT (c) 1988 by Claus Gittinger
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    40
	      All Rights Reserved
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    41
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    42
 This software is furnished under a license and may be used
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    43
 only in accordance with the terms of that license and with the
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    44
 inclusion of the above copyright notice.   This software may not
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    45
 be provided or otherwise made available to, or used by, any
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    46
 other person.  No title to or ownership of the software is
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    47
 hereby transferred.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    48
"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    49
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    50
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    51
documentation
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    52
"
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    53
    This is one of the central classes in the system;
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    54
    it provides all system-startup, shutdown and maintenance support.
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    55
    Also global variables are (conceptionally) kept here.
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    56
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    57
    As you will notice, this is NOT a Dictionary
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    58
    - my implementation of globals is totally different
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    59
      due to the need to be able to access globals from c-code as well,
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    60
      I do not use associations for globals, but instead keep the
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    61
      name<->value relations in the VM and access globals via utility
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    62
      functions found there.
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    63
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    64
    However, it provides the known enumeration protocol.
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    65
    It may change to become a subclass of collection at some time,
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    66
    to inherit more collection stuff ...
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    67
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    68
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    69
    [Instance variables:]
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    70
					none - all handling is done in the VM
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    71
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    72
    [Class variables:]
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    73
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    74
	StartBlocks     <Collection>    blocks to be executed in a separate process after
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    75
					everything has been initialized. These blocks will
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    76
					be deleted after execution and therefore not be
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    77
					executed after an image restart. Initial processes
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    78
					(such as the Launcher) are usually started here.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    79
					These blocks are added by smalltalk.rc/private.rc etc.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    80
					via #addStartBlock during early initialization.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    81
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    82
	ImageStartBlocks 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    83
			<Collection>    blocks to be executed in a separate process after
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    84
					everything has been initialized. These blocks will be
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    85
					executed after an image restart.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    86
					These blocks are usually added by smalltalk_r.rc etc.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    87
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    88
	ExitBlocks      <Collection>    blocks to evaluate before system is
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    89
					left. Not currently used (GNU-ST compatibility).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    90
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    91
	SystemPath      <Collection>    path to search for system files (sources, bitmaps etc)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    92
					Set to a default here, but typically changed from some
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    93
					startup.rc file
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    94
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    95
	PackagePath     <Collection>    path to search for package.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    96
					This is going to replace the above systemPath, and a classes
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    97
					resources will eventually searched in its package directory.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    98
					This list defines the path, where packages are searched for,
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
    99
					initially this is something like /opt/smalltalk/packages.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   100
					Set to a default here, but typically changed from some
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   101
					startup.rc file
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   102
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   103
	StartupClass    <Class>         class and selector, where the system starts up
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   104
	StartupSelector <Symbol>        (right after VM initialization)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   105
	StartupArguments <Array>        If an image is saved while those being nonNil, 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   106
					the image will come up there.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   107
					Allows for customized images to be generated from a standard ST/X.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   108
					StandAlone programs also set those during initialization.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   109
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   110
	CommandLine          <String>   Unix (OS-) command line
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   111
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   112
	CommandName          <String>   the command (i.e. argv[0])
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   113
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   114
	CommandLineArguments <Array>    Unix (OS-) command line arguments broken into words
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   115
					CommandName has been stripped off.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   116
					(initially set by the VM)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   117
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   118
	SilentLoading   <Boolean>       suppresses messages during fileIn and in compiler
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   119
					(can be set to true from a customized main.c)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   120
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   121
	Initializing    <Boolean>       true while (re-)initializing
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   122
					Controls the behavior of certain error
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   123
					reporters (for example: suppress dialogBoxes)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   124
					while the system is not yet fit for full operation.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   125
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   126
	StandAlone      <Boolean>       true, if this is a standalone app;
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   127
					if true the process scheduler watches for
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   128
					which processes are still running, and 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   129
					exits ST/X, when the last non-background
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   130
					and non-system process exits.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   131
					Can be set in an application-specific startup script,
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   132
					or, for standAlone programs, by C-code during initialization.
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   133
                                        
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   134
	HeadlessOperation               if true, a non-existing Display connection
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   135
			<Boolean>       will NOT lead to an error-exit during startup.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   136
					Default is false.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   137
					Can be set in an application-specific startup script,
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   138
					or, for standAlone programs, by C-code during initialization.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   139
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   140
	LogDoits        <Boolean>       if true, doits are also logged in the changes
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   141
					file. Default is false, since the changes file
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   142
					may become huge if every tiny doIt is saved there ...
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   143
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   144
	LoadBinaries    <Boolean>       if true, we attempt to load classes rom a binary
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   145
					file, if present. If false, this is always suppressed.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   146
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   147
	SaveEmergencyImage <Boolean>    if true (the default), an emergency image
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   148
					is saved, if the main Display looses its
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   149
					connection. This is useful if you have a
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   150
					flaky display connection (serial line)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   151
					and want to have your stuff saved automatically
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   152
					in case of a broken connection.
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
   153
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   154
    strictly private classVariables (helpers):
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   155
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   156
	CachedClasses   <Collection>    known classes (cached for faster class enumeration)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   157
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   158
	CachedAbbreviations
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   159
			<Dictionary>    className to filename mappings
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   160
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   161
	RealSystemPath  <Collection>    cached collection of directories along the path
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   162
					which really exist. Caching avoids long checks
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   163
					for existing directories on broken NFS volumes.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   164
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   165
	SourcePath      <Collection>    cached names of really existing directories
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   166
	BitmapPath                      These are remembered, since in NFS systems,
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   167
	ResourcePath                    the time to lookup files may become long
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   168
	BinaryPath                      (especially, if some directories are on machines
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   169
	FileInPath                      which are not up ...). 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   170
					Therefore, the set of really
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   171
					existing directories is cached when the SystemPath
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   172
					is walked the first time.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   173
					A consequence is that you have to invoke
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   174
					flushSystemPath, when you create any of those
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   175
					directories while running
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   176
					(and want the running ST/X to look there)
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   177
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
   178
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
   179
    [author:]
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   180
	Claus Gittinger
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   181
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   182
    [see also:]
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   183
	ObjectMemory
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
   184
"
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   185
!
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   186
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   187
readme_resources
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   188
"
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   189
    What is a resource file:
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   190
        resource files contain language transformation and sometimes    
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   191
        UI-look specifics such as icons etc.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   192
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   193
    Where are resources stored in the image:
9014
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   194
        Resource files are only read on demand (i.e. when needed) and only read once 
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   195
        i.e. they are cached in the image).
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   196
        The cached data is held in a per-class class-instVar named 'ClassResources'.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   197
        With only a few exceptions, the only classes which need resources are the GUI
9014
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   198
        classes under the SimpleView hierarchy.
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   199
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   200
    How does the system find resources:
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   201
        The idea is that the system-provided resource files can be overwritten
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   202
        by the user or an application configuration.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   203
        This works via a hierarchy of directories where resources are searched for,
9014
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   204
        with the systems standard resource-files being at the end of that chain.
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   205
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   206
        When searching for a resource file for class X, the following files are searched 
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   207
        in order:
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   208
                {ResourcePath} / resources / X.rs       
9014
f4df89a42724 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9012
diff changeset
   209
                {SystemPath} / (CLASSES-PACKAGE-PATH) / X.rs       
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   210
                {ResourcePath} / (CLASSES-PACKAGE-PATH) / X.rs       
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   211
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   212
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   213
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   214
!Smalltalk class methodsFor:'initialization'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   215
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   216
initGlobalsFromEnvironment
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   217
    "setup globals from the shell-environment"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   218
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   219
    |envString i langString terrString|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   220
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   221
    StandAlone isNil ifTrue:[
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   222
        StandAlone := false.
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   223
    ].
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
   224
    HeadlessOperation isNil ifTrue:[
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   225
        HeadlessOperation := false.
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
   226
    ].
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   227
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   228
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   229
     extract Language and LanguageTerritory from LANG variable.
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   230
     valid are for example:
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   231
                            en_en / en
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   232
                            en_us
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   233
                            en_gb
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   234
                            de_de / de
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   235
                            de_at       (for Austria)
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   236
    "
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   237
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   238
    Language := #en.
994
6163ae7aaf9b territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   239
    LanguageTerritory := #us.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   240
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   241
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   242
    "Format of LANG is: language[_territory][.codeset][@modifier]
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   243
        language        ISO-639  Language code
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   244
        territory       ISO-3166 Contry code"
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   245
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   246
    envString := OperatingSystem getLanguage.
3991
7b53bc45bf91 (isNil or:[isEmpty ]) -> (size == 0)
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   247
    envString size > 0 ifTrue:[
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   248
        i := envString indexOf:$@.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   249
        (i ~~ 0) ifTrue:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   250
            envString := envString copyTo:(i - 1).
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   251
            LanguageModifier := (envString copyFrom:(i + 1)) asLowercase asSymbol.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   252
        ] ifFalse:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   253
            LanguageModifier := nil.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   254
        ].
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   255
        i := envString indexOf:$..
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   256
        (i ~~ 0) ifTrue:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   257
            envString := envString copyTo:(i - 1).
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   258
            LanguageCodeset := (envString copyFrom:(i + 1)) asLowercase asSymbol
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   259
        ] ifFalse:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   260
            LanguageCodeset := #'iso8859-1'.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   261
        ].
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   262
        i := envString indexOf:$_.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   263
        (i == 0) ifTrue:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   264
            langString := envString.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   265
            terrString := envString
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   266
        ] ifFalse:[
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   267
            langString := envString copyTo:(i - 1).
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   268
            terrString := envString copyFrom:(i + 1)
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   269
        ].
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   270
        Language := langString asLowercase asSymbol.
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   271
        LanguageTerritory := terrString asLowercase asSymbol
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   272
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   273
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   274
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   275
     Smalltalk initGlobalsFromEnvironment
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   276
    "
994
6163ae7aaf9b territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   277
6163ae7aaf9b territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   278
    "Modified: 22.2.1996 / 16:59:12 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   279
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   280
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   281
initInterrupts
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   282
    "initialize interrupts"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   283
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   284
    OperatingSystem enableUserInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   285
    OperatingSystem enableHardSignalInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   286
    OperatingSystem enableCrashSignalInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   287
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   288
    ObjectMemory userInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   289
    ObjectMemory signalInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   290
    ObjectMemory recursionInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   291
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   292
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   293
     Smalltalk initInterrupts
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   294
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   295
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   296
    "Modified: 20.8.1997 / 09:35:49 / stefan"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   297
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   298
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   299
initStandardStreams
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   300
    "initialize some well-known streams"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   301
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   302
    Stdout := NonPositionableExternalStream forStdout.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   303
    Stderr := NonPositionableExternalStream forStderr.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   304
    Stdin := NonPositionableExternalStream forStdin.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   305
    Printer := PrinterStream.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   306
    Transcript := Stderr
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   307
963
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   308
    "
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   309
     Smalltalk initStandardStreams
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   310
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   311
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   312
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   313
initStandardTools
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   314
    "predefine some tools which we will need later
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   315
     - if the view-classes exist,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   316
       they will redefine Inspector and Debugger for graphical interfaces"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   317
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   318
    "redefine debug-tools, if view-classes exist"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   319
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   320
    Display notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   321
	InspectorView notNil ifTrue:[
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   322
	    Inspector := InspectorView
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   323
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   324
	DebugView notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   325
	    Debugger := DebugView
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   326
	].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   327
	Display initialize
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   328
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   329
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   330
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   331
     Smalltalk initStandardTools
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   332
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   333
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   334
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   335
initSystemPath
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   336
    "setup path where system files are searched for.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   337
     the default path is set to:
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   338
            .
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   339
            <directory of exe>       (WIN32 only)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   340
            $HOME                    (if defined)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   341
            $HOME/.smalltalk         (if defined & existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   342
            $SMALLTALK_LIBDIR        (if defined & existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   343
            $STX_LIBDIR              (if defined & existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   344
            $STX_TOPDIR              (if defined & existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   345
            REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\<CurrentVersion>\LibDir') (WIN32 only)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   346
            REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\LibDir')                  (WIN32 only)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   347
            <standard places>
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   348
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   349
     standard places (unix):
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   350
            /opt/smalltalk/<release> (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   351
            /opt/smalltalk           (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   352
            /usr/local/lib/smalltalk (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   353
            /usr/lib/smalltalk       (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   354
            /lib/smalltalk           (if existing)
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   355
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   356
     win32:
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   357
            \programs\exept\smalltalk (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   358
            \programs\smalltalk       (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   359
            \smalltalk                (if existing)
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   360
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   361
     vms:
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   362
            $stx:lib                 (if existing)
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   363
            $stx:root                (if existing)
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   364
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   365
     of course, it is possible to add entries from the 'smalltalk.rc'
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   366
     startup file; add expressions such as:
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   367
            Smalltalk systemPath addFirst:'/foo/bar/baz'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   368
        or: 
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   369
            Smalltalk systemPath addLast:'/fee/foe/foo'.
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   370
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   371
     However, smalltalk.rc itself must be found along the above path.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   372
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   373
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   374
    ChangeFileName := 'changes'.
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   375
    OperatingSystem isVMSlike ifTrue:[
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   376
        BitmapDirName := 'bitmaps.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   377
        BinaryDirName := 'binary.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   378
        SourceDirName := 'source.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   379
        ResourceDirName := 'resources.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   380
        FileInDirName := 'filein.dir'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   381
        PackageDirName := 'packages.dir'.
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   382
    ] ifFalse:[
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   383
        BitmapDirName := 'bitmaps'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   384
        BinaryDirName := 'binary'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   385
        SourceDirName := 'source'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   386
        ResourceDirName := 'resources'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   387
        FileInDirName := 'fileIn'.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   388
        PackageDirName := 'packages'.
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   389
    ].
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   390
680
6f5794a26d2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   391
    SystemPath isNil ifTrue:[
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   392
        SystemPath := OperatingSystem defaultSystemPath.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   393
        self flushPathCaches
5139
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   394
    ].
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   395
5144
607e6fe053b5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   396
    PackagePath isNil ifTrue:[
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   397
        PackagePath := OperatingSystem defaultPackagePath.
5144
607e6fe053b5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   398
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   399
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   400
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   401
     Smalltalk initSystemPath
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   402
     Smalltalk systemPath
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   403
    "
5139
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   404
5145
23bca61caa40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5144
diff changeset
   405
    "Modified: / 24.12.1999 / 00:23:35 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   406
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   407
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   408
initUserPreferences
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   409
    "setup other stuff"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   410
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   411
    LogDoits := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   412
    LoadBinaries := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   413
    SaveEmergencyImage := (StandAlone ~~ true).
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   414
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   415
    "Modified: / 24.10.1997 / 18:22:47 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   416
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   417
7526
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   418
initializeClass:aClass
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   419
    "sent from VM via #initializeModules"
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   420
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   421
    Error handle:[:ex |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   422
	ClassesFailedToInitialize isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   423
	    ClassesFailedToInitialize := IdentitySet new.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   424
	].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   425
	ClassesFailedToInitialize add:aClass.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   426
	('Smalltalk [warning]: error during initialize of ' , aClass name,': ', ex description printString) errorPrintCR.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   427
	(Smalltalk commandLineArguments includes:'--debug') ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   428
	    ex reject
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   429
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   430
    ] do:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   431
	aClass initialize
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   432
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   433
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   434
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   435
initializeModules
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   436
    "perform module specific initialization and
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   437
     send #initialize to all classes.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   438
     Notice: this is not called when an image is restarted"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   439
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   440
    self initializeModulesOnce.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   441
    ClassesFailedToInitialize size > 0 ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   442
	('Smalltalk [info]: retry initialization of failed class(es)...') infoPrintCR.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   443
	ClassesFailedToInitialize := nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   444
	self initializeModulesOnce.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   445
	ClassesFailedToInitialize size > 0 ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   446
	    ('Smalltalk [error]: class(es) persist to fail during initialize') errorPrintCR.
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   447
	]
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   448
    ].
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   449
!
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   450
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   451
initializeModulesOnce
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   452
    "perform module specific initialization and
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   453
     send #initialize to all classes.
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   454
     Notice: this is not called when an image is restarted"
4963
308de981ea7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
   455
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   456
%{
1688
8a42db1eea60 removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents: 1682
diff changeset
   457
    __init_registered_modules__(3);
4963
308de981ea7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
   458
1481
90a28fd060bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   459
    @global(DemoMode) = __getDemoMode() ? true : false;
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   460
    RETURN (self);
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   461
%}.
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   462
    ^ self primitiveFailed
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   463
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   464
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   465
initializeSystem
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   466
    "initialize all other classes; setup dispatcher processes etc.
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   467
     This one is the very first entry into the smalltalk world,
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   468
     right after startup, ususally immediately followed by Smalltalk>>start.
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   469
     Notice: 
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   470
        this is not called when an image is restarted; in this
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   471
        case the show starts in Smalltalk>>restart."
211
58bb873aa83c *** empty log message ***
claus
parents: 202
diff changeset
   472
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   473
    |idx|
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   474
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
   475
    NumberOfClassesHint := 4500.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
   476
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   477
    Initializing := true.
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   478
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   479
    AbstractOperatingSystem initializeConcreteClass.
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   480
5400
af8fdc4d3e02 kludge (for rel5)
Claus Gittinger <cg@exept.de>
parents: 5373
diff changeset
   481
    CommandLineArguments isNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   482
        CommandLineArguments := #('stx').
5400
af8fdc4d3e02 kludge (for rel5)
Claus Gittinger <cg@exept.de>
parents: 5373
diff changeset
   483
    ].
4006
c7ad38c52eb9 must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
   484
    CommandLine := CommandLineArguments copy.
c7ad38c52eb9 must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
   485
    CommandLineArguments := CommandLineArguments asOrderedCollection.
6842
a5110421e4ab more for standAlone start
Claus Gittinger <cg@exept.de>
parents: 6841
diff changeset
   486
    CommandName := CommandLineArguments removeFirst. "/ the command
4006
c7ad38c52eb9 must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
   487
4028
b46539f16af5 added --silentStartup argument
Claus Gittinger <cg@exept.de>
parents: 4026
diff changeset
   488
    SilentLoading := (CommandLineArguments includes:'--silentStartup').
348
claus
parents: 345
diff changeset
   489
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   490
    DebuggingStandAlone := false.
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   491
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   492
    StandAlone ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   493
        InfoPrinting := false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   494
        ObjectMemory infoPrinting:false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   495
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   496
        idx := CommandLineArguments indexOf:'--debug'.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   497
        idx ~~ 0 ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   498
            DebuggingStandAlone := true.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   499
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   500
        DebuggingStandAlone ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   501
            Inspector := MiniInspector.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   502
            Debugger := MiniDebugger.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   503
        ].
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   504
    ] ifFalse:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   505
        "/
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   506
        "/ define low-level debugging tools - graphical classes are not prepared yet
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   507
        "/ to handle things. 
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   508
        "/ This will bring us into the MiniDebugger when an error occurs during startup.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   509
        "/
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   510
        Inspector := MiniInspector.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   511
        Debugger := MiniDebugger.
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   512
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   513
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   514
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   515
    "/ start catching SIGSEGV and SIGBUS
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   516
    "/
713
32540afb8ffc setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   517
    OperatingSystem enableHardSignalInterrupts.
32540afb8ffc setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents: 706
diff changeset
   518
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   519
    self initGlobalsFromEnvironment.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   520
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   521
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   522
    "/ sorry - there are some, which MUST be initialized before ..
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   523
    "/ reason: if any error happens during init, we need Signals, Stdout etc. to be there
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   524
    "/
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   525
    Object initialize.
7704
a193fbc5eb52 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7696
diff changeset
   526
    Stream initialize.
a193fbc5eb52 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7696
diff changeset
   527
    PositionableStream initialize.
2907
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
   528
    Filename initialize.
326
d2902942491d *** empty log message ***
claus
parents: 325
diff changeset
   529
    ObjectMemory initialize.
2504
ece15ffbcb69 Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents: 2485
diff changeset
   530
    OperatingSystem initialize.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   531
    ExternalStream initialize.
211
58bb873aa83c *** empty log message ***
claus
parents: 202
diff changeset
   532
58bb873aa83c *** empty log message ***
claus
parents: 202
diff changeset
   533
    self initStandardStreams.    "/ setup Stdin, Stdout etc.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   534
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   535
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   536
    "/ sorry, path must be set before ...
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   537
    "/ reason: some classes need it during initialize (they might need resources, bitmaps etc)
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   538
    "/
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   539
    self initSystemPath.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   540
a27a279701f8 Initial revision
claus
parents:
diff changeset
   541
    Compiler := ByteCodeCompiler.
a27a279701f8 Initial revision
claus
parents:
diff changeset
   542
    Compiler isNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   543
        "
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   544
         ByteCodeCompiler is not in the system (i.e. has not been linked in)
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   545
         this allows at least immediate evaluations for runtime systems without compiler
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   546
         NOTICE: a parser is always needed, otherwise we cannot read resource files etc.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   547
        "
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   548
        Compiler := Parser
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   549
    ].
a27a279701f8 Initial revision
claus
parents:
diff changeset
   550
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   551
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   552
    "/ another one, to be initialized before others
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   553
    "/
2077
6b5dc412dd15 must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
   554
    ProcessorScheduler initialize.
6b5dc412dd15 must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents: 2076
diff changeset
   555
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   556
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   557
    "/ now, finally, initialize all other classes
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   558
    "/
325
claus
parents: 324
diff changeset
   559
    self initializeModules.
claus
parents: 324
diff changeset
   560
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
   561
    ImageStartTime := Timestamp now.
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   562
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
   563
    self initInterrupts.
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   564
    self initUserPreferences.
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   565
2090
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   566
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   567
    "/ give classes a chance to perform 2nd-level initialization
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   568
    "/ now, we are certain, that all other classes have been initialized
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   569
    "/ (especially: streams and signals can now be used)
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   570
    "/
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   571
    ObjectMemory changed:#initialized.
42653edf4cc5 added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents: 2089
diff changeset
   572
2504
ece15ffbcb69 Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents: 2485
diff changeset
   573
    "Modified: 8.1.1997 / 19:58:12 / stefan"
2907
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
   574
    "Modified: 7.9.1997 / 23:34:44 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   575
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   576
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   577
isInitialized
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   578
    "this returns true, if the system is properly initialized;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   579
     i.e. false during startup. Especially, the whole viewing stuff is
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   580
     not working correctly until initialized."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   581
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   582
    ^ Initializing not
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   583
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   584
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   585
reinitStandardStreams
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   586
    "reinitialize some well-known streams.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   587
     Tis must be done very early during startup, to allow for
477
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   588
     debug and trace messages to be output
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   589
     (otherwise, the file-descriptors are invalid)"
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   590
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   591
    Stdout reOpen. Stderr reOpen. Stdin reOpen.
161
ed36169f354d *** empty log message ***
claus
parents: 159
diff changeset
   592
! !
ed36169f354d *** empty log message ***
claus
parents: 159
diff changeset
   593
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   594
!Smalltalk class methodsFor:'Compatibility-Squeak'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   595
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   596
beep
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   597
    Screen current beep
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   598
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   599
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   600
garbageCollect
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   601
   ObjectMemory garbageCollect
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   602
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   603
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   604
garbageCollectMost
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   605
    "collect recently created garbage; return the amount of freeSpace.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   606
     In ST/X, only the newSpace is collected here, and the sum of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   607
     newSpace + freeListSpace is returned."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   608
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   609
    ObjectMemory scavenge.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   610
    ^ ObjectMemory freeSpace 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   611
      + (ObjectMemory newSpaceSize - ObjectMemory newSpaceUsed)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   612
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   613
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   614
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   615
isMorphic
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   616
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   617
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   618
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   619
registerExternalObject: anObject
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   620
    "Register the given object in the external objects array and return its index.
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   621
     If it is already there, just return its index.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   622
     ExternalObjects are protected from GC and can be accessed easily from
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   623
     primitive code (via the global Smalltalk:SpecialObjectArray)"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   624
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   625
    | objects firstEmptyIndex obj sz newObjects |
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   626
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   627
    objects := SpecialObjectArray.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   628
    objects isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   629
	objects := Array new:5.
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   630
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   631
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   632
    "find the first empty slot and look if already registered"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   633
    firstEmptyIndex := 0.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   634
    1 to: objects size do: [:i |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   635
	obj := objects at: i.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   636
	obj == anObject ifTrue: [^ i].  "object already there, just return its index"
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   637
	(obj == nil and: [firstEmptyIndex = 0]) ifTrue: [
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   638
	    firstEmptyIndex := i
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   639
	]
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   640
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   641
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   642
    "if no empty slots, expand the array"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   643
    firstEmptyIndex = 0 ifTrue: [
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   644
	sz := objects size.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   645
	newObjects := objects species new: sz + 20.  "grow linearly"
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   646
	newObjects replaceFrom: 1 to: sz with: objects startingAt: 1.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   647
	firstEmptyIndex := sz + 1.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   648
	SpecialObjectArray := newObjects.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   649
	objects := newObjects
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   650
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   651
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   652
    objects at: firstEmptyIndex put: anObject.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   653
    ^ firstEmptyIndex
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   654
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   655
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   656
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   657
renameClassNamed:oldName as:newName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   658
    self renameClass:(self at:oldName) to:newName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   659
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   660
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   661
unregisterExternalObject: anObject
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   662
    "Unregister the given object in the external objects array. 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   663
     Do nothing if it isn't registered."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   664
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   665
    |objects|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   666
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   667
    anObject isNil ifTrue:[^ self].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   668
    objects := SpecialObjectArray.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   669
    1 to: objects size do: [:i |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   670
	(objects at: i) == anObject ifTrue: [
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   671
	    objects at: i put: nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   672
	]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   673
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   674
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   675
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   676
!Smalltalk class methodsFor:'Compatibility-V''Age'!
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   677
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   678
allClassesImplementing:aSelector
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   679
    ^ self allClasses select:[:cls | cls implements:aSelector].
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   680
! !
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   681
7295
9ddb9543e369 category
Claus Gittinger <cg@exept.de>
parents: 7290
diff changeset
   682
!Smalltalk class methodsFor:'Compatibility-VW5.4'!
6094
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   683
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   684
defineClass:nameSymbol superclass:superclass indexedType:indexed private:private instanceVariableNames:instVars classInstanceVariableNames:classInstVars imports:imports category:category attributes:annotations
6094
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   685
    |newClass|
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   686
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   687
    indexed == #none ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   688
	newClass := superclass 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   689
	    subclass:nameSymbol 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   690
	    instanceVariableNames:instVars
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   691
	    classVariableNames:'' 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   692
	    poolDictionaries:'' 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   693
	    category:category 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   694
	    inEnvironment:self.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   695
	classInstVars size > 0 ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   696
	    newClass class instanceVariableNames:classInstVars.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   697
	].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   698
	^ newClass
6851
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   699
    ].
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   700
    self shouldImplement.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   701
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   702
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   703
!Smalltalk class methodsFor:'accessing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   704
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   705
associationAt:aKey
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   706
    "return a key-value association for aKey.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   707
     Since ST/X's Smalltalk as no real dictionary, this is
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   708
     simulated here."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   709
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   710
    |val|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   711
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   712
    val := self at:aKey ifAbsent:nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   713
    val isNil ifTrue:[^ nil].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   714
    ^ Association key:aKey value:val
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   715
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   716
    "Created: / 1.11.1997 / 13:27:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   717
!
3083
451912c492ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3062
diff changeset
   718
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   719
associationAt:aKey ifAbsent:exceptionBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   720
    "return a key-value association for aKey, or the value
3610
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   721
     from exceptionBlock, if no such key is present.
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   722
     Since ST/X's Smalltalk as no real dictionary, this is
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   723
     simulated here."
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   724
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   725
    |val|
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   726
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   727
    val := self at:aKey ifAbsent:nil.
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   728
    val isNil ifTrue:[^ exceptionBlock value].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   729
    ^ Association key:aKey value:val
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   730
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   731
    "Created: / 18.6.1998 / 17:05:24 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   732
!
3610
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   733
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   734
at:aKey
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   735
    "retrieve the value stored under aKey, a symbol. 
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   736
     Return nil if not present 
1956
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   737
     (this will be changed to trigger an error - better use #at:ifAbsent:)"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   738
6851
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   739
    aKey class == String ifTrue:[self error:'expected symbol'].
6080
15ea3cbf6003 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   740
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   741
%{  /* NOCONTEXT */
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   742
    RETURN ( __GLOBAL_GET(aKey) );
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   743
%}.
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   744
    ^ self primitiveFailed
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   745
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   746
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   747
at:aKey ifAbsent:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   748
    "retrieve the value stored at aKey.
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
   749
     If there is nothing stored under this key, return the value of
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
   750
     the evaluation of aBlock."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   751
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   752
    (self includesKey:aKey) ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   753
	^ self at:aKey
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   754
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   755
    ^ aBlock value
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   756
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   757
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   758
     Smalltalk at:#fooBar                       <- returns nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   759
     Smalltalk at:#fooBar ifAbsent:['sorry']    <- no error
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   760
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   761
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   762
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   763
at:aKey ifPresent:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   764
    "try to retrieve the value stored at aKey.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   765
     If there is nothing stored under this key, do nothing.
4870
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   766
     Otherwise, evaluate aBlock, passing the retrieved value as argument."
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   767
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   768
    (self includesKey:aKey) ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   769
	^ aBlock value:(self at:aKey)
4870
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   770
    ].
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   771
    ^ nil
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   772
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   773
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   774
     Smalltalk at:#fooBar ifPresent:[:what | Transcript showCR:what].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   775
     Smalltalk at:#Object ifPresent:[:what | Transcript showCR:what].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   776
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   777
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   778
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   779
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   780
at:aKey put:aValue
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   781
    "store the argument aValue under aKey, a symbol.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   782
     Return aValue (sigh)."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   783
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   784
    |oldValue|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   785
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   786
%{
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   787
    oldValue = __GLOBAL_SET(aKey, aValue, (OBJ *)0);
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   788
%}.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   789
    CachedClasses notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   790
	oldValue isBehavior ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   791
	    oldValue name == aKey ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   792
		CachedClasses remove:oldValue ifAbsent:[]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   793
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   794
	].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   795
	aValue isBehavior ifTrue:[
1956
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   796
"/            aValue isMeta ifTrue:[
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   797
"/                "/ this should not happen
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   798
"/                ('SMALLTALK: store a Metaclass: ' , aValue name , ' as ' , aKey) infoPrintCR.
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   799
"/            ].
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   800
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   801
	    aValue name == aKey ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   802
		CachedClasses add:aValue
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   803
	    ] ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   804
		CachedClasses := nil
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   805
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   806
	].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   807
    ].
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   808
    ^ aValue.
1955
276d4ce9b40e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   809
"/
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   810
"/%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   811
"/    (void) __GLOBAL_SET(aKey, aValue, (OBJ *)0);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   812
"/%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   813
"/    CachedClasses := nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   814
"/    ^ aValue
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   815
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   816
    "Modified: 19.4.1996 / 11:31:49 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   817
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   818
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   819
includesKey:aKey
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   820
    "return true, if the key is known"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   821
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   822
    "/ for debugging - this is a common mistake,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   823
    "/ to try to access a class by nameString, instead
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   824
    "/ of by symbol.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   825
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   826
    "/ aKey class == String ifTrue:[self halt].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   827
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   828
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   829
    RETURN ( __GLOBAL_KEYKNOWN(aKey) );
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   830
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   831
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   832
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   833
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   834
keyAtValue:anObject
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   835
    "return the symbol under which anObject is stored - or nil"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   836
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   837
    self keysDo:[:aKey |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   838
	(self at:aKey) == anObject ifTrue:[^ aKey]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   839
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   840
    ^ nil
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   841
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   842
    "Smalltalk keyAtValue:Object"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   843
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   844
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   845
keys
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   846
    "return a collection with all keys in the Smalltalk dictionary"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   847
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   848
    |keys|
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   849
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   850
    keys := IdentitySet new.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   851
    self keysDo:[:k | keys add:k].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   852
    ^ keys
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   853
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   854
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   855
removeKey:aKey
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   856
    "remove the association stored under the key-argument from the globals dictionary.
878
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
   857
     WARNING: 
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   858
	this is somewhat dangerous: conceptionally, the association is removed,
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   859
	to which machine & byte compiled code refers if it accesses a global.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   860
	If there are still global accesses in some literalArray or from machine-compiled code,
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   861
	it continues to reference the globals value via that obsolete association and gets a nil
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   862
	value.  (which is correct)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   863
	However, if that global is later reintroduced, a new association will be created and
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   864
	the new global now referenced via the new association.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   865
	The old accesses will still see nil, although the globals value is actually non-nil
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   866
	(this is questionable).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   867
	To avoid this problem, the #removeClass: method never removed the key."
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   868
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   869
    CachedClasses := nil.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   870
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   871
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   872
    RETURN ( __GLOBAL_REMOVE(aKey) );
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   873
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   874
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   875
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   876
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   877
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   878
values
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   879
    "return a collection with all values in the Smalltalk dictionary"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   880
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   881
    |values|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   882
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   883
    values := OrderedCollection new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   884
    self do:[:v | values add:v].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   885
    ^ values
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   886
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   887
    "Created: 20.6.1997 / 16:58:28 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   888
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   889
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   890
!Smalltalk class methodsFor:'binary storage'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   891
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   892
addGlobalsForBinaryStorageTo:globalDictionary
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   893
    |pools|
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   894
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   895
    pools := Set new.
2465
1dfcacbbd376 ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
   896
879
add0438a73b0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 878
diff changeset
   897
    self keysAndValuesDo:[:key :value |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   898
	(key includes:$:) ifFalse:[       "/ skip classVars
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   899
	    (value ~~ self 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   900
	    and:[value notNil]) ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   901
		value isClass ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   902
		    value addGlobalsForBinaryStorageTo:globalDictionary.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   903
		    pools addAll:value sharedPools
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   904
		] ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   905
		    globalDictionary at:(key->value) put:self
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   906
		].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   907
		value notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   908
		    globalDictionary at:value put:self
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   909
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   910
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   911
	]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   912
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   913
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   914
    pools do:[:poolDictionary|
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   915
	poolDictionary addGlobalsForBinaryStorageTo:globalDictionary
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   916
    ]
2465
1dfcacbbd376 ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
   917
1dfcacbbd376 ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
   918
    "Modified: 19.3.1997 / 18:15:25 / cg"
2476
50a974f6386d renamed addGlobals.
Claus Gittinger <cg@exept.de>
parents: 2465
diff changeset
   919
    "Created: 21.3.1997 / 15:40:31 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   920
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   921
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   922
storeBinaryDefinitionOf:anObject on:stream manager:manager
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   923
    |string|
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   924
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   925
    anObject class == Association ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   926
	string := 'Smalltalk associationAt: ', anObject key storeString
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   927
    ] ifFalse: [
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
   928
	string := 'Smalltalk at: ', (self keyAtValue: anObject) storeString
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   929
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   930
    stream nextNumber:2 put:string size.
2465
1dfcacbbd376 ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
   931
    stream nextPutBytes:(string size) from:string startingAt:1.
1dfcacbbd376 ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
   932
"/    string do:[:char | stream nextPut:char asciiValue]
1dfcacbbd376 ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
   933
1dfcacbbd376 ignore nil values when adding globals (binary storage)
Claus Gittinger <cg@exept.de>
parents: 2418
diff changeset
   934
    "Modified: 19.3.1997 / 18:49:14 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   935
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   936
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   937
!Smalltalk class methodsFor:'browsing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   938
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   939
browseAllCallsOn:aSelectorSymbol
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   940
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   941
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   942
    "startup a browser for all methods sending a particular message"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   943
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   944
    UserPreferences systemBrowserClass browseAllCallsOn:aSelectorSymbol
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   945
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   946
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   947
     Smalltalk browseAllCallsOn:#at:put: 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   948
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   949
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   950
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   951
browseAllSelect:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   952
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   953
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   954
    "startup a browser for all methods for which aBlock returns true"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   955
6020
555c690e6616 UserPreference access
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
   956
    UserPreferences systemBrowserClass browseAllSelect:aBlock
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   957
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   958
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   959
     Smalltalk browseAllSelect:[:m | m literals isNil]
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   960
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   961
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   962
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   963
browseChanges
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   964
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   965
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   966
    "startup a changes browser"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   967
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   968
    ChangesBrowser notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   969
	ChangesBrowser open
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   970
    ] ifFalse:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   971
	self warn:'no ChangesBrowser built in'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   972
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   973
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   974
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   975
     Smalltalk browseChanges
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   976
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   977
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   978
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   979
browseClass:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   980
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   981
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   982
    "startup a browser on aClass"
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   983
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   984
    UserPreferences systemBrowserClass browseClass:aClass
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   985
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   986
    "
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   987
     Smalltalk browseClass:Array 
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   988
    "
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   989
!
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
   990
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   991
browseImplementorsMatching:aSelectorSymbolOrMatchPattern
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   992
    "{ Pragma: +optSpace }"
6819
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
   993
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
   994
    "startup a browser for all methods implementing a message matching"
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
   995
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   996
    UserPreferences systemBrowserClass browseImplementorsMatching:aSelectorSymbolOrMatchPattern
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   997
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   998
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   999
     Smalltalk browseImplementorsOf:#'at:put:' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1000
     Smalltalk browseImplementorsMatching:#'at:*' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1001
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1002
!
6819
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
  1003
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1004
browseImplementorsOf:aSelectorSymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1005
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1006
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1007
    "startup a browser for all methods implementing a particular message"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1008
6020
555c690e6616 UserPreference access
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  1009
    UserPreferences systemBrowserClass browseImplementorsOf:aSelectorSymbol
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1010
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1011
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1012
     Smalltalk browseImplementorsOf:#at:put: 
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1013
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1014
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1015
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1016
browseInClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1017
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1018
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1019
    "startup a full browser showing aClass"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1020
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1021
    UserPreferences systemBrowserClass openInClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1022
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1023
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1024
     Smalltalk browseInClass:Array 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1025
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1026
!
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1027
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1028
browseInClass:aClass selector:selector
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1029
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1030
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1031
    "startup a full browser showing aClass>>selector"
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1032
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1033
    UserPreferences systemBrowserClass openInClass:aClass selector:selector
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1034
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1035
    "
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1036
     Smalltalk browseInClass:Array selector:#at:
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1037
    "
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1038
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1039
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1040
!Smalltalk class methodsFor:'class management'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1041
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1042
changeCategoryOf:aClass to:newCategory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1043
    "change a classes category, add a change record,
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1044
     send change notifications"
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1045
8405
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1046
    |ns oldCategory|
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1047
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1048
    oldCategory := aClass category.
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1049
    oldCategory ~= newCategory ifTrue:[
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1050
        aClass category:(newCategory withoutSeparators asSymbol). 
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1051
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1052
        "notify change of category"
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1053
        ns := aClass environment ? self.
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1054
        ns changed:#organization with:(aClass -> oldCategory).
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1055
        ns ~~ self ifTrue:[
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1056
            self changed:#organization with:(aClass -> oldCategory).
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1057
        ]
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1058
    ].
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1059
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1060
    "
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1061
     Smalltalk changeCategoryOf:NewApplication to:#myApplications
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1062
    "
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1063
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1064
    "Modified: / 11.2.2000 / 11:36:27 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1065
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1066
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1067
defineNameSpace: name private: private imports: imports category: category attributes: annotations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1068
    NameSpace name:name
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1069
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1070
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1071
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1072
flushCachedClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1073
    CachedClasses notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1074
	CachedClasses remove:aClass ifAbsent:[]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1075
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1076
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1077
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1078
flushCachedClasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1079
    CachedClasses := nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1080
    Class flushSubclassInfo.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1081
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1082
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1083
     Smalltalk flushCachedClasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1084
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1085
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1086
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1087
removeClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1088
    "remove the argument, aClass from the smalltalk dictionary;
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1089
     we have to flush the caches since these methods are now void.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1090
     Also, class variables of aClass are removed."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1091
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1092
    |sym cSym names oldName oldNameSym actualName wrongName ns ons|
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1093
4099
f6984fc5cb6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4096
diff changeset
  1094
    aClass isNil ifTrue:[^ self].
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1095
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1096
    oldName := aClass name.
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1097
    sym := oldNameSym := oldName asSymbol.
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1098
    ((self at:oldNameSym) == aClass) ifFalse:[
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1099
	"check other name ..."
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1100
	(self includes:aClass) ifFalse:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1101
	    'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1102
	    ^ self
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1103
	].
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1104
	"
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1105
	 the class has changed its name - without telling me ...
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1106
	 what should be done in this case ?
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1107
	"
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1108
	'Smalltalk [warning]: class ' errorPrint. oldName errorPrint.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1109
	' has changed its name' errorPrintCR.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1110
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1111
	"/
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1112
	"/ might be an alias (i.e. removing a compatibility name)
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1113
	"/
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1114
	actualName := self keyAtValue:aClass.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1115
	('Smalltalk [info]: ' , oldName , ' is actually stored as ' , actualName , '.') infoPrintCR.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1116
	sym := actualName asSymbol.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1117
	oldName := actualName asString.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1118
	wrongName := true.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1119
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1120
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1121
    ns := aClass nameSpace.
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1122
    aClass topOwningClass notNil ifTrue:[
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1123
	ons := aClass topOwningClass nameSpace
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1124
    ].
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1125
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1126
    self at:sym put:nil.    "nil it out for compiled accesses"
878
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1127
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1128
    "/
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1129
    "/ see comment in removeKey: on why we dont remove it here
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1130
    "/
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1131
    "/ self removeKey:sym.     "/ remove key - this actually fails, if there are
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1132
			       "/ still compiled code references."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1133
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1134
    "remove private classes"
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1135
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1136
    aClass privateClassesSorted do:[:somePrivateClass |
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1137
	aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil.
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1138
    ].
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1139
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1140
    "remove class variables"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1141
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1142
    names := aClass classVariableString asCollectionOfWords.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1143
    names do:[:name |
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1144
	cSym := (sym , ':' , name) asSymbol.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1145
	self at:cSym asSymbol put:nil.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1146
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1147
	"/
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1148
	"/ see comment in removeKey: on why we dont remove it here
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1149
	"/
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1150
	"/ self removeKey:cSym
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1151
    ].
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1152
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1153
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1154
"/    actually could get along with less flushing
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1155
"/    (entries for aClass and subclasses only)
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1156
"/    but we have to delay this, until we have the set of subclasses
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1157
"/    at hand - for now, searching for all subclasses is way more
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1158
"/    expensive then cache flushing.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1159
"/
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1160
"/    aClass allSubclassesDo:[:aSubclass |
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1161
"/        ObjectMemory flushInlineCachesForClass:aSubclass.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1162
"/        ObjectMemory flushMethodCacheFor:aSubclass
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1163
"/    ].
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1164
"/    ObjectMemory flushInlineCachesForClass:aClass.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1165
"/    ObjectMemory flushMethodCacheFor:aClass
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1166
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1167
    ObjectMemory flushInlineCaches.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1168
    ObjectMemory flushMethodCache.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1169
7181
7382117bf3fa james' package changes
james
parents: 7126
diff changeset
  1170
    aClass addChangeRecordForClassRemove.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1171
    self changed:#classRemove with:aClass.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1172
7581
6912a7336e15 class category: sends a change notification;
Claus Gittinger <cg@exept.de>
parents: 7572
diff changeset
  1173
    aClass setCategory:#'* removed *'.
1655
fb6ee1b55ec4 use *-categories
Claus Gittinger <cg@exept.de>
parents: 1650
diff changeset
  1174
5326
8950253bef78 flush subclass info when removing classes
ca
parents: 5322
diff changeset
  1175
    self flushCachedClasses.
8950253bef78 flush subclass info when removing classes
ca
parents: 5322
diff changeset
  1176
    Class flushSubclassInfo.
8950253bef78 flush subclass info when removing classes
ca
parents: 5322
diff changeset
  1177
3627
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1178
    wrongName == true ifTrue:[
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1179
	"/
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1180
	"/ an alias (i.e. removing a compatibility name)
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1181
	"/
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1182
	"/ check if there are more refs to it ...
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1183
	[self includes:aClass] whileTrue:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1184
	    actualName := self keyAtValue:aClass.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1185
	    ('Smalltalk [info]: ' , aClass name , ' is also registered under the name ' , actualName
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1186
			  , ' - remove that binding too.') infoPrintCR.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1187
	    self at:actualName put:nil.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1188
	].
4724
44793fe70787 recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents: 4723
diff changeset
  1189
    ].
44793fe70787 recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents: 4723
diff changeset
  1190
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1191
    ns ~~ Smalltalk ifTrue:[
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1192
	ons notNil ifTrue:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1193
	    ClassBuilder
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1194
		recompileGlobalAccessorsTo:oldNameSym
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1195
		in:ons
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1196
		except:nil
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1197
	].
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1198
	(ns notNil and:[ns ~~ ons]) ifTrue:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1199
	    ClassBuilder
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1200
		recompileGlobalAccessorsTo:oldNameSym
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1201
		in:ns
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1202
		except:nil
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  1203
	].
3627
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1204
    ].
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1205
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1206
    "Modified: / 20.6.1998 / 13:26:10 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1207
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1208
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1209
renameClass:aClass to:newName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1210
    "rename aClass to newName. Most of the work is in
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1211
     renaming the classVariables (create & copy over values)
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1212
     and patching the classes methods to access the new variables."
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1213
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1214
    |oldName oldSym newSym names oldCVSym newCVSym value oldNameToNewName
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1215
     oldNameSpace newNameSpace oldBaseName newBaseName privateClasses
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1216
     oldBaseNameWithoutPrefix newBaseNameWithoutPrefix i1 i2 nm ns subns
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1217
     oldMetaclass newMetaclass newCategory|
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1218
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1219
    "/ check for all intermediate namespaces / owning classes
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1220
    i1 := 1.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1221
    i2 := 1.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1222
    ns := self.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1223
    [i2 ~~ 0] whileTrue:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1224
        i2 := newName indexOfSubCollection:'::' startingAt:i1.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1225
        i2 ~~ 0 ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1226
            nm := newName copyFrom:i1 to:i2-1.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1227
            ns isNameSpace ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1228
                subns := ns at:nm asSymbol ifAbsent:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1229
                subns isNil ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1230
                    self error:'Nonexisting namespace: ',nm.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1231
                    ^ nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1232
                ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1233
            ] ifFalse:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1234
                subns := ns privateClassesAt:nm asSymbol.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1235
                subns isNil ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1236
                    self error:'Cannot create a namespace below a class'
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1237
                ]
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1238
            ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1239
            ns := subns.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1240
            i1 := i2 + 2.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1241
        ].
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1242
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1243
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1244
    oldName := aClass name.
6734
dd9fa2d81cb9 use #topNameSpace
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
  1245
    oldNameSpace := aClass topNameSpace.
2319
640bb389f90a recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1246
    oldBaseName := aClass nameWithoutNameSpacePrefix.
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1247
    oldBaseNameWithoutPrefix := aClass nameWithoutPrefix.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1248
    oldSym := oldName asSymbol.
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1249
    privateClasses := aClass privateClassesSorted.
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1250
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1251
    ((self at:oldSym) ~~ aClass) ifTrue:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1252
        'Smalltalk [warning]: rename failed - name is different from key' errorPrintCR.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1253
        ^ self
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1254
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1255
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1256
    "/ rename the class
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1257
1847
6e567214b167 care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  1258
    newSym := newName asSymbol.
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1259
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1260
    "/ change the owning class
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1261
    ns isNameSpace ifFalse:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1262
        aClass isPrivate ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1263
            aClass class setOwningClass:ns.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1264
        ] ifFalse:[
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1265
            "/ sigh - must make a PrivateMetaclass from Metaclass
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1266
            oldMetaclass := aClass class.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1267
            newMetaclass := PrivateMetaclass new.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1268
            newMetaclass flags:(oldMetaclass flags).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1269
            newMetaclass setSuperclass:(oldMetaclass superclass).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1270
            newMetaclass instSize:(oldMetaclass instSize).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1271
            newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1272
            newMetaclass setMethodDictionary:(oldMetaclass methodDictionary).
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1273
            newMetaclass setSoleInstance:aClass.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1274
            newMetaclass setOwningClass:ns.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1275
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1276
            aClass changeClassTo:newMetaclass.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1277
            ObjectMemory flushCaches.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1278
        ]
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1279
    ] ifTrue:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1280
        aClass isPrivate ifTrue:[
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1281
            newCategory := aClass topOwningClass category.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1282
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1283
            "/ sigh - must make a Metaclass from PrivateMetaclass
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1284
            oldMetaclass := aClass class.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1285
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1286
            newMetaclass := Metaclass new.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1287
            newMetaclass flags:(oldMetaclass flags).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1288
            newMetaclass setSuperclass:(oldMetaclass superclass).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1289
            newMetaclass instSize:(oldMetaclass instSize).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1290
            newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1291
            newMetaclass setMethodDictionary:(oldMetaclass methodDictionary).
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1292
            newMetaclass setSoleInstance:aClass.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1293
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1294
            aClass category:newCategory.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1295
            aClass changeClassTo:newMetaclass.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1296
            ObjectMemory flushCaches.
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1297
        ]        
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1298
    ].
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1299
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1300
    aClass setName:newSym.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1301
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1302
    "/ store it in Smalltalk
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1303
    self at:oldSym put:nil.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1304
878
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1305
    "/
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1306
    "/ see comment in #removeKey: on why we dont remove it it here
878
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1307
    "/
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1308
    "/ self removeKey:oldSym.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1309
    self at:newSym put:aClass.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1310
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1311
    "/ create new class variables and copy over values
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1312
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1313
    oldNameToNewName := IdentityDictionary new.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1314
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1315
    names := aClass classVariableString asCollectionOfWords.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1316
    names do:[:name |
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1317
        oldCVSym := (oldSym , ':' , name) asSymbol.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1318
        value := self at:oldCVSym.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1319
        self at:oldCVSym put:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1320
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1321
        "/
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1322
        "/ see comment in #removeKey: on why we dont remove it it here
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1323
        "/
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1324
        "/ self removeKey:cSym.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1325
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1326
        newCVSym := (newSym , ':' , name) asSymbol.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1327
        self at:newCVSym put:value.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1328
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1329
        oldNameToNewName at:oldCVSym put:newCVSym.
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1330
    ].
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1331
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1332
    "/ patch methods literal arrays from oldCVname to newCVname
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1333
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1334
    oldNameToNewName keysAndValuesDo:[:oldNameSym :newNameSym |
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1335
        aClass withAllSubclasses do:[:aSubClass |
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1336
            Transcript showCR:'changing global accesses from ''' , oldNameSym , ''' into ''' , newNameSym , ''' in class: ''' , aSubClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1337
            aSubClass instAndClassSelectorsAndMethodsDo:[:sel :aMethod |
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1338
                aMethod changeLiteral:oldNameSym to:newNameSym
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1339
            ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1340
        ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1341
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1342
        "/ and also in privateClasses ? ...
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1343
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1344
"/        privateClasses size > 0 ifTrue:[
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1345
"/            privateClasses do:[:aPrivateClass |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1346
"/                aPrivateClass withAllSubclasses do:[:aSubClass |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1347
"/                    aSubClass class methodDictionary do:[:aMethod |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1348
"/                        aMethod changeLiteral:oldNameSym to:newNameSym
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1349
"/                    ].
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1350
"/                    aSubClass methodDictionary do:[:aMethod |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1351
"/                        aMethod changeLiteral:oldNameSym to:newNameSym
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1352
"/                    ]
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1353
"/                ].
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1354
"/            ]
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1355
"/        ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1356
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1357
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1358
    aClass addChangeRecordForClassRename:oldSym to:newSym.
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1359
5333
d80386e06d21 rename into other namespace did not work
Claus Gittinger <cg@exept.de>
parents: 5328
diff changeset
  1360
    "/ clear the namespace (for namespace query to work)
d80386e06d21 rename into other namespace did not work
Claus Gittinger <cg@exept.de>
parents: 5328
diff changeset
  1361
    aClass setEnvironment:nil.
6734
dd9fa2d81cb9 use #topNameSpace
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
  1362
    newNameSpace := aClass topNameSpace.
2405
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1363
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1364
    privateClasses size > 0 ifTrue:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1365
        "/ must rename privateClasses as well
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1366
        Class withoutUpdatingChangesDo:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1367
            privateClasses do:[:aPrivateClass |
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1368
                self renameClass:aPrivateClass
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1369
                     to:(newSym , '::' , aPrivateClass nameWithoutPrefix).
5916
4364f9ae4254 when renaming a class, no changeRecrd for its private-class renames
Claus Gittinger <cg@exept.de>
parents: 5913
diff changeset
  1370
            
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1371
                Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldName , '::' , aPrivateClass nameWithoutPrefix , ''' ...'.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1372
                ClassBuilder
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1373
                    recompileGlobalAccessorsTo:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1374
                    in:newNameSpace 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1375
                    except:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1376
            ]
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1377
        ]
2405
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1378
    ].
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1379
2319
640bb389f90a recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1380
    oldNameSpace ~~ newNameSpace ifTrue:[
5246
2ca7b20c4108 create namespaces as requried, when renaming a class
Claus Gittinger <cg@exept.de>
parents: 5214
diff changeset
  1381
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1382
        "/ all those referencing the class from the old nameSpace
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1383
        "/ must be recompiled ...
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1384
        "/ (to now access the global from smalltalk)
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1385
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1386
        oldNameSpace ~~ Smalltalk ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1387
            Transcript showCR:'recompiling methods in ''' , oldNameSpace name , ''' accessing ''' , oldName , ''' ...'.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1388
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1389
            ClassBuilder
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1390
                recompileGlobalAccessorsTo:oldName asSymbol 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1391
                in:oldNameSpace 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1392
                except:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1393
        ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1394
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1395
        "/ all referencing the class in the new namespace
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1396
        "/ as well; to now access the new class.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1397
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1398
        (newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1399
            Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldBaseName , ''' ...'.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1400
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1401
            ClassBuilder
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1402
                recompileGlobalAccessorsTo:oldBaseName asSymbol 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1403
                in:newNameSpace 
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1404
                except:nil.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1405
        ].
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1406
    ] ifFalse:[
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1407
        "/ all references to a global with my new name in my owning class
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1408
        "/ must now be redirected to myself.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1409
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1410
        aClass isPrivate ifTrue:[
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1411
            newBaseName := aClass nameWithoutNameSpacePrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1412
            newBaseNameWithoutPrefix := aClass nameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1413
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1414
            Transcript showCR:'recompiling methods accessing ''' , oldBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1415
            aClass owningClass recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1416
            aClass owningClass class recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1417
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1418
            Transcript showCR:'recompiling methods accessing ''' , oldBaseName , ''' in: ''' , aClass owningClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1419
            aClass owningClass recompileMethodsAccessingGlobal:oldBaseName.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1420
            aClass owningClass class recompileMethodsAccessingGlobal:oldBaseName.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1421
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1422
            Transcript showCR:'recompiling methods accessing ''' , newBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1423
            aClass owningClass recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1424
            aClass owningClass class recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1425
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1426
            Transcript showCR:'recompiling methods accessing ''' , newBaseName , ''' in: ''' , aClass owningClass name , ''' ...'.        
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1427
            aClass owningClass recompileMethodsAccessingGlobal:newBaseName.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1428
            aClass owningClass class recompileMethodsAccessingGlobal:newBaseName.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1429
        ]
4040
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1430
    ].
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1431
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1432
    aClass changed:#definition.
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1433
    "/ because of the change of my superclasses name ...
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1434
    aClass allSubclassesDo:[:subClass |
7996
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1435
        subClass changed:#definition.
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1436
    ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1437
    "/ because of the change of my superclasses name ...
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1438
    aClass subclassesDo:[:subClass |
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1439
        subClass addChangeRecordForClass:subClass.
4040
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1440
    ].
5613
b534e427f028 change message when renaming a class
Claus Gittinger <cg@exept.de>
parents: 5611
diff changeset
  1441
    self changed:#definition.
b534e427f028 change message when renaming a class
Claus Gittinger <cg@exept.de>
parents: 5611
diff changeset
  1442
    Smalltalk changed:#classRename with:(Array with:aClass with:oldName).
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1443
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1444
    "Created: / 29.10.1995 / 19:58:32 / cg"
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1445
    "Modified: / 18.6.1996 / 14:20:50 / stefan"
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1446
    "Modified: / 11.2.2000 / 01:12:38 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1447
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1448
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1449
!Smalltalk class methodsFor:'copying'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1450
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1451
deepCopy
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1452
    "redefined to return self - there is only one Smalltalk dictionary"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1453
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1454
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1455
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1456
    "Modified: 18.5.1996 / 12:13:33 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1457
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1458
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1459
deepCopyUsing:aDictionary
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1460
    "return a deep copy of the receiver.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1461
     Redefined to return the receiver - there is only one Smalltalk dictionary"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1462
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1463
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1464
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1465
    "Modified: 18.5.1996 / 12:13:36 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1466
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1467
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1468
shallowCopy
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1469
    "redefined to return self - there is only one Smalltalk dictionary"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1470
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1471
    ^ self
1410
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1472
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1473
    "Modified: 18.5.1996 / 12:13:39 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1474
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1475
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1476
simpleDeepCopy
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1477
    "redefined to return self - there is only one Smalltalk dictionary"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1478
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1479
    ^ self
1410
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1480
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1481
    "Modified: 18.5.1996 / 12:13:42 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1482
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1483
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1484
!Smalltalk class methodsFor:'debugging ST/X'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1485
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1486
compileTrace:aBoolean
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1487
    "dump generated inline code (NOOP if VM was compiled without the trace-debug option)"
7325
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1488
%{
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1489
    extern char __compileTrace__;
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1490
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1491
    __compileTrace__ = (aBoolean == true) ? 1 : 0;
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1492
%}
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1493
    "
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1494
     Smalltalk compileTrace:true
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1495
     Smalltalk compileTrace:false
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1496
    "
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1497
!
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1498
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1499
debugBreakPoint
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1500
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1501
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1502
    "call the dummy debug function, on which a breakpoint
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1503
     can be put in adb, sdb, dbx or gdb.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1504
     WARNING: this method is for debugging only
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1505
	      it will be removed without notice."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1506
%{
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1507
    __PATCHUPCONTEXTS(__context);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1508
    __debugBreakPoint__();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1509
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1510
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1511
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1512
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1513
exitWithCoreDump
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1514
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1515
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1516
    "abort program and dump core"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1517
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1518
    OperatingSystem exitWithCoreDump
4096
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1519
    "/ never returns
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1520
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1521
    "Be careful evaluating this
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1522
     Smalltalk exitWithCoreDump
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1523
    "
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1524
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1525
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1526
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1527
fatalAbort
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1528
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1529
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1530
    "report a fatal-error, print a stack backtrace and exit with core dump.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1531
     (You may turn off the stack print with debugPrinting:false)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1532
%{
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1533
    __fatal0(__context, "fatalAbort");
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1534
    /* NEVER RETURNS */
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1535
%}.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1536
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1537
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1538
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1539
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1540
fatalAbort:aMessage
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1541
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1542
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1543
    "report a fatal-error; print a stack backtrace and exit with core dump
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1544
     (You may turn off the stack print with debugPrinting:false)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1545
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1546
%{
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1547
    char *msg;
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1548
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1549
    if (__isString(aMessage))
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1550
	msg = (char *) __stringVal(aMessage);
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1551
    else
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1552
	msg = "fatalAbort";
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1553
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1554
    __fatal0(__context, msg);
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1555
    /* NEVER RETURNS */
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1556
%}.
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1557
    ^ self primitiveFailed
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1558
5441
e88302747bbd rel5 migration
Claus Gittinger <cg@exept.de>
parents: 5427
diff changeset
  1559
!
e88302747bbd rel5 migration
Claus Gittinger <cg@exept.de>
parents: 5427
diff changeset
  1560
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1561
vmInstructionTrace:aBoolean
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1562
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1564
! !
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1565
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1566
!Smalltalk class methodsFor:'enumerating'!
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1567
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1568
allBehaviorsDo:aBlock
5580
374e843aa424 allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents: 5579
diff changeset
  1569
    "evaluate the argument, aBlock for all classes and metaclasses in the system"
374e843aa424 allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents: 5579
diff changeset
  1570
374e843aa424 allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents: 5579
diff changeset
  1571
    self allClassesAndMetaclassesDo:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1572
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1573
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1574
     Smalltalk allBehaviorsDo:[:aClass | aClass name printCR]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1575
    "
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1576
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1577
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1578
allClassCategories
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1579
    "return a set of all class categories in the system"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1580
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1581
    |allCategories|
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1582
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1583
    allCategories := Set new.
7124
da253fd03ba1 Do not sort categories in #allClassCategories.
Stefan Vogel <sv@exept.de>
parents: 7105
diff changeset
  1584
    Smalltalk allClassesDo:[:cls | |category|
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1585
	category := cls category.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1586
	category notNil ifTrue:[    
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1587
	    allCategories add:category.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1588
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1589
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1590
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1591
    ^ allCategories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1592
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1593
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1594
     Smalltalk allClassCategories
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1595
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1596
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1597
    "Created: / 17.11.2001 / 12:13:09 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1598
!
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1599
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1600
allClassesAndMetaclassesDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1601
    "evaluate the argument, aBlock for all classes and metaclasses in the system."
5579
26af506d271e added #allClassesAndMetaclasses
Claus Gittinger <cg@exept.de>
parents: 5550
diff changeset
  1602
5940
804fb27727a6 oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents: 5916
diff changeset
  1603
    |already|
804fb27727a6 oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents: 5916
diff changeset
  1604
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1605
    already := IdentitySet new:NumberOfClassesHint*2.
5940
804fb27727a6 oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents: 5916
diff changeset
  1606
    self allClassesDo:[:eachClass | |cls|
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1607
        cls := eachClass theNonMetaclass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1608
        (already includes:cls) ifFalse:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1609
            aBlock value:cls.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1610
            already add:cls.    
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1611
        ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1612
        cls := cls class.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1613
        (already includes:cls) ifFalse:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1614
            aBlock value:cls.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1615
            already add:cls.    
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1616
        ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1617
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1618
!
5579
26af506d271e added #allClassesAndMetaclasses
Claus Gittinger <cg@exept.de>
parents: 5550
diff changeset
  1619
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1620
allClassesDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1621
    "evaluate the argument, aBlock for all classes in the system."
5580
374e843aa424 allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents: 5579
diff changeset
  1622
5765
152a485288d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5760
diff changeset
  1623
    self allClasses do:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1624
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1625
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1626
     Smalltalk allClassesDo:[:aClass | aClass name printCR]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1627
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1628
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1629
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1630
allClassesInCategory:aCategory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1631
    "return a collection of for all classes in aCategory;
1299
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1632
     The order of the classes is not defined."
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1633
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1634
    |coll|
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1635
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1636
    coll := OrderedCollection new.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1637
    self allClassesInCategory:aCategory do:[:aClass |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1638
	coll add:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1639
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1640
    ^ coll
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1641
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1642
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1643
     Smalltalk allClassesInCategory:'Views-Basic'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1644
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1645
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1646
    "Modified: 25.4.1996 / 18:06:13 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1647
!
1299
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1648
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1649
allClassesInCategory:aCategory do:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1650
    "evaluate the argument, aBlock for all classes in the aCategory;
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1651
     The order of the classes is not defined."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1652
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1653
    aCategory notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1654
	self allClassesDo:[:aClass |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1655
	    aClass isMeta ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1656
		(aClass category = aCategory) ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1657
		    aBlock value:aClass
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1658
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1659
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1660
	]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1661
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1662
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1663
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1664
     Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | aClass name printCR]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1665
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1666
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1667
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1668
allClassesInCategory:aCategory inOrderDo:aBlock
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1669
    "evaluate the argument, aBlock for all classes in aCategory;
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1670
     superclasses come first - then subclasses"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1671
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1672
    |classes|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1673
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1674
    aCategory notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1675
	classes := OrderedCollection new.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1676
	self allClassesInCategory:aCategory do:[:aClass |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1677
	    classes add:aClass
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1678
	].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1679
	classes topologicalSort:[:a :b | b isSubclassOf:a].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1680
	classes do:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1681
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1682
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1683
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1684
     Smalltalk allClassesInCategory:'Views-Basic' inOrderDo:[:aClass | aClass name printCR]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1685
    "
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1686
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1687
    "Modified: / 17.11.2001 / 12:18:15 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1688
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1689
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1690
allClassesInOrderDo:aBlock
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1691
    "evaluate the argument, aBlock for all classes in the system;
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1692
     Evaluation order is by inheritance: superclasses come first."
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1693
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1694
    |already|
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1695
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1696
    already := IdentitySet new:NumberOfClassesHint.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1697
    self allClassesDo:[:eachClass |
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1698
        (already includes:eachClass) ifFalse:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1699
            eachClass allSuperclasses reverseDo:[:eachSuperClass |
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1700
                (already includes:eachSuperClass) ifFalse:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1701
                    already add:eachSuperClass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1702
                    aBlock value:eachSuperClass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1703
                ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1704
            ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1705
            already add:eachClass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1706
            aBlock value:eachClass.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1707
        ]
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1708
    ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1709
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1710
    "
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1711
     Smalltalk allClassesInOrderDo:[:aClass | Transcript showCR:aClass name]
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1712
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1713
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1714
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1715
allKeysDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1716
    "evaluate the argument, aBlock for all keys in the Smalltalk dictionary"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1717
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1718
    ^ self keysDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1719
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1720
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1721
allMethodCategories
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1722
    "return a set of all method categories in the system"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1723
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1724
    |allCategories|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1725
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1726
    allCategories := Set new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1727
    Smalltalk allClassesDo:[:cls |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1728
	allCategories addAll:cls categories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1729
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1730
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1731
    ^ allCategories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1732
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1733
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1734
     Smalltalk allMethodCategories
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1735
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1736
!
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
  1737
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1738
associationsDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1739
    "evaluate the argument, aBlock for all key/value pairs 
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1740
     in the Smalltalk dictionary"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1741
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1742
    self keysDo:[:aKey |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1743
	aBlock value:(aKey -> (self at:aKey))
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1744
    ]
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1745
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1746
    "Smalltalk associationsDo:[:assoc | assoc printCR]"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1747
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1748
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1749
basicKeys
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1750
    "for rel > 5 only"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1751
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1752
    self primitiveFailed
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1753
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1754
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1755
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1756
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1757
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1758
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1759
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1760
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1761
do:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1762
    "evaluate the argument, aBlock for all values in the Smalltalk dictionary"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1763
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1764
    |work|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1765
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1766
%{  /* NOREGISTER - work may not be placed into a register here */
1688
8a42db1eea60 removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents: 1682
diff changeset
  1767
    __GLOBALS_DO(&aBlock, &work);
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1768
    RETURN (self);
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1769
%}.
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1770
    self keysDo:[:aKey |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1771
	aBlock value:(self at:aKey)
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1772
    ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1773
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1774
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1775
keysAndValuesDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1776
    "evaluate the two-arg block, aBlock for all keys and values"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1777
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1778
    self keysDo:[:aKey |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1779
	aBlock value:aKey value:(self at:aKey)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1780
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1781
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1782
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1783
keysDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1784
    "evaluate the argument, aBlock for all keys in the Smalltalk dictionary"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1785
    |work|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1786
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1787
%{  /* NOREGISTER - work may not be placed into a register here */
1688
8a42db1eea60 removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents: 1682
diff changeset
  1788
    __GLOBALKEYS_DO(&aBlock, &work);
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1789
    RETURN (self);
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1790
%}.
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1791
    self basicKeys do:[:aKey |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1792
	aBlock value:aKey
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1793
    ]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1794
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1795
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1796
!Smalltalk class methodsFor:'inspecting'!
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1797
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1798
inspectorClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1799
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1800
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1801
    "redefined to launch a DictionaryInspector
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1802
     (instead of the default Inspector)."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1803
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1804
    ^ DictionaryInspectorView
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1805
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1806
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1807
!Smalltalk class methodsFor:'message control'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1808
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1809
silentLoading
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1810
    "returns the Silentloading class variable."
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1811
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1812
     ^ SilentLoading
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1813
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1814
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1815
silentLoading:aBoolean
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1816
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1817
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1818
    "allows access to the Silentloading class variable, which controls
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1819
     messages from all kinds of system onto the transcript.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1820
     You can save a snapshot with this flag set to true, which makes
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1821
     the image come up silent. Can also be set, to read in files unlogged."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1822
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1823
    |prev|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1824
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1825
    prev := SilentLoading.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1826
    SilentLoading := aBoolean.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1827
    ^ prev
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1828
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1829
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1830
!Smalltalk class methodsFor:'misc accessing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1831
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1832
beHeadless:aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1833
    "set/clear the headlessOperation flag."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1834
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1835
    HeadlessOperation := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1836
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1837
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1838
standAloneApp:aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1839
    "set/clear the StandAlone flag."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1840
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1841
    StandAlone := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1842
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1843
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1844
!Smalltalk class methodsFor:'misc stuff'!
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1845
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1846
addExitBlock:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1847
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1848
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1849
    "add a block to be executed when Smalltalk finishes.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1850
     This feature is currently not used anywhere - but could be useful for
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1851
     cleanup in stand alone applications."
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1852
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1853
    ExitBlocks isNil ifTrue:[
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1854
	ExitBlocks := OrderedCollection with:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1855
    ] ifFalse:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1856
	ExitBlocks add:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1857
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1858
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1859
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1860
addImageStartBlock:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1861
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1862
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1863
    "add a blocks to be executed in a separate process after
2681
0de96fb520ac commentary
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1864
     everything has been initialized. 
0de96fb520ac commentary
Claus Gittinger <cg@exept.de>
parents: 2677
diff changeset
  1865
     These blocks will be executed after an image restart."
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  1866
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  1867
    ImageStartBlocks isNil ifTrue:[
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1868
	ImageStartBlocks := OrderedCollection with:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1869
    ] ifFalse:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1870
	ImageStartBlocks add:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1871
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1872
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1873
    "Created: 9.9.1996 / 16:48:20 / stefan"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1874
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1875
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1876
addStartBlock:aBlock
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1877
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1878
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1879
    "add a blocks to be executed in a separate process after
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1880
     everything has been initialized. These blocks will
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1881
     be deleted after execution and therefore not be
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1882
     executed after an image restart. 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1883
     Initial processes are usually started here (see smalltalk.rc / private.rc)."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1884
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1885
    StartBlocks isNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1886
	StartBlocks := OrderedCollection with:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1887
    ] ifFalse:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1888
	StartBlocks add:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1889
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1890
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1891
    "Created: 9.9.1996 / 16:46:53 / stefan"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1892
!
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  1893
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1894
exit
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1895
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1896
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1897
    "finish the Smalltalk system"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1898
8803
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1899
    self exit:0
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1900
    "not reached"
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1901
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1902
    "Be careful evaluating this
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1903
     Smalltalk exit
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1904
    "
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1905
!
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1906
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1907
exit:statusInteger
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1908
    "{ Pragma: +optSpace }"
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1909
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1910
    "finish the Smalltalk system"
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1911
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1912
    ObjectMemory changed:#aboutToExit.  "/ for ST/X backward compatibility
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1913
    ObjectMemory changed:#aboutToQuit.  "/ for ST-80 compatibility
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1914
    ExitBlocks notNil ifTrue:[
8803
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1915
        ExitBlocks do:[:aBlock |
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1916
            aBlock value
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1917
        ]
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1918
    ].
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1919
    OperatingSystem exit:statusInteger
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1920
    "not reached"
4096
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1921
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1922
    "Be careful evaluating this
8803
0eea3a9fb67c New: #exit:
Stefan Vogel <sv@exept.de>
parents: 8793
diff changeset
  1923
     Smalltalk exit:1
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1924
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1925
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1926
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1927
!Smalltalk class methodsFor:'queries'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1928
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1929
allClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1930
    "return an unordered collection of all classes in the system.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1931
     Only globally anchored classes are returned 
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1932
     (i.e. anonymous ones have to be aquired by Behavior allSubInstances)"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1933
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1934
    |classes|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1935
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1936
    "/ you may wonder, what this while is for, here ...
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1937
    "/ the reason is that if we modify the class hierarchy in
4067
732848627915 comment
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
  1938
    "/ another view (background fileIn), while building up the
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1939
    "/ cachedClasses set, this may be flushed (invalidated) by the
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1940
    "/ other process in the meanwhile.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1941
    "/ If that happens, we restart the set-building here
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1942
    "/
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1943
    [(classes := CachedClasses) isNil] whileTrue:[
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1944
        CachedClasses := classes := IdentitySet new:NumberOfClassesHint. 
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1945
        self keysAndValuesDo:[:eachName :eachGlobal |
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1946
            (eachGlobal notNil and:[eachGlobal isBehavior]) ifTrue:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1947
                "/ sigh - would like to skip over aliases
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1948
                "/ but this cannot be done simply by comparing
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1949
                "/ the classes name against the store-key
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1950
                "/ i.e. cannot do:
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1951
                "/      anObject name == sym ifTrue:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1952
                "/          classes add:anObject
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1953
                "/      ]
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1954
                "/ because that would lead to ignore all java
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1955
                "/ classes, which are stored under a different
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1956
                "/ key.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1957
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1958
                (eachGlobal name == eachName
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1959
                 or:[eachGlobal isJavaClass]) ifTrue:[
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1960
                    classes add:eachGlobal
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1961
                ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1962
            ]
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1963
        ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1964
        NumberOfClassesHint := classes size.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1965
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1966
    ^ classes
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1967
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1968
    "
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1969
     CachedClasses := nil.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1970
     Smalltalk allClasses
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1971
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1972
    to get the list sorted by name:
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1973
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1974
     Smalltalk allClasses asSortedCollection:[:a :b | a name < b name]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1975
    "
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  1976
5278
ae041ee44fd1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5269
diff changeset
  1977
    "Modified: / 23.2.2000 / 10:49:46 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1978
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1979
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1980
allClassesAndMetaclasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1981
    "return an unordered collection of all classes with their metaclasses in the system."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1982
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1983
    |classes|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1984
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1985
    classes := IdentitySet new:NumberOfClassesHint*2.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1986
    self allClassesDo:[:eachClass |
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1987
        classes add:(eachClass theNonMetaclass).
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1988
        classes add:(eachClass theMetaclass).
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1989
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1990
    ^ classes
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1991
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1992
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1993
allClassesWithAllPrivateClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1994
    "return an unordered collection of all classes in the Smalltalk namespace.
4642
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  1995
     Only globally anchored classes are returned 
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  1996
     (i.e. anonymous ones have to be aquired by Behavior allSubInstances)"
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  1997
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  1998
    ^ self allClasses select:[:aClass | 
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  1999
	    |owner|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2000
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2001
	    (aClass isNameSpace not      
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2002
	    or:[aClass == Smalltalk])
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2003
	    and:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2004
		owner := aClass topOwningClass.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2005
		(owner ? aClass) nameSpace == Smalltalk
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2006
	    ]
4642
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2007
      ]
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2008
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2009
    "
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2010
     Smalltalk allClassesWithAllPrivateClasses
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2011
    "
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2012
!
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2013
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2014
cellAt:aName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2015
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2016
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2017
    "return the address of a global cell
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2018
     - used internally for compiler only"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2019
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2020
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2021
    RETURN ( __GLOBAL_GETCELL(aName) );
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2022
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2023
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2024
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2025
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2026
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2027
classCategoryCompletion:aPartialCategory
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2028
    "given a partial class category name, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2029
     2 entries: 1st: the best (longest) match
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2030
                2nd: collection consisting of matching categories"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2031
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2032
    ^ DoWhatIMeanSupport classCategoryCompletion:aPartialCategory in:self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2033
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2034
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2035
     Smalltalk classCategoryCompletion:'Sys'            
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2036
     Smalltalk classCategoryCompletion:'System'              
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2037
     Smalltalk classCategoryCompletion:'System-BinaryStorage' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2038
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2039
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2040
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2041
classNamed:aString
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2042
    "return the class with name aString, or nil if absent.
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2043
     To get to the metaClass, append ' class' to the string.
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2044
     To get a nameSpace or private class, prefix the name as required."
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2045
7520
03cbfda8cf8b allow for namespace::name in #classNamed.
Claus Gittinger <cg@exept.de>
parents: 7432
diff changeset
  2046
    |cls sym nonMeta idx ns nm|
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2047
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2048
    "be careful, to not invent new symbols ..."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2049
    sym := aString asSymbolIfInterned.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2050
    sym notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2051
	cls := self at:sym ifAbsent:nil.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2052
	cls isBehavior ifTrue:[^ cls].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2053
	cls isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2054
	    idx := sym indexOfSubCollection:'::'.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2055
	    idx ~~ 0 ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2056
		ns := sym copyTo:idx-1.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2057
		nm := sym copyFrom:idx+2.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2058
		ns := Smalltalk at:ns asSymbol.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2059
		ns notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2060
		    ns isNameSpace ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2061
			cls := ns at:(nm asSymbol).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2062
		    ] ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2063
			ns isBehavior ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2064
			    cls := ns privateClassesAt:(nm asSymbol).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2065
			]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2066
		    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2067
		].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2068
		cls isBehavior ifTrue:[^ cls].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2069
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2070
	].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2071
    ].
1480
df0bea6285f8 Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  2072
    (aString endsWith:' class') ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2073
	nonMeta := self classNamed:(aString copyWithoutLast:6).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2074
	nonMeta notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2075
	    ^ nonMeta theMetaclass
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2076
	].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2077
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2078
    ^ nil
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2079
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2080
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2081
     Smalltalk classNamed:'Object'    
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2082
     Smalltalk classNamed:'fooBar' 
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2083
     Smalltalk classNamed:'true'    
1480
df0bea6285f8 Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  2084
     Smalltalk classNamed:'Object class'    
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2085
     Smalltalk classNamed:'Metaclass'    
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2086
     Smalltalk classNamed:'Array'    
1480
df0bea6285f8 Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  2087
     Smalltalk classNamed:'Array class'    
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2088
    "
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2089
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2090
    "Created: 24.11.1995 / 17:30:22 / cg"
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2091
    "Modified: 24.11.1995 / 17:31:29 / cg"
1480
df0bea6285f8 Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  2092
    "Modified: 19.6.1996 / 14:22:21 / stefan"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2093
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2094
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2095
classNames
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2096
    "return a collection of all classNames in the system"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2097
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2098
    ^ self allClasses collect:[:aClass | aClass name]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2099
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2100
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2101
     Smalltalk classNames
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2102
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2103
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2104
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2105
classnameCompletion:aPartialClassName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2106
    "given a partial classname, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2107
     2 entries: 1st: the best (longest) match
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2108
                2nd: collection consisting of matching names"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2109
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2110
    ^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2111
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2112
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2113
classnameCompletion:aPartialClassName inEnvironment:anEnvironment
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2114
    "given a partial classname, return an array consisting of
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2115
     2 entries: 1st: the best (longest) match
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2116
                2nd: collection consisting of matching names"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2117
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2118
    ^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:anEnvironment
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2119
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2120
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2121
     Smalltalk classnameCompletion:'Arr'     
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2122
     Smalltalk classnameCompletion:'Arra' 
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2123
     Smalltalk classnameCompletion:'arra' 
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2124
     Smalltalk classnameCompletion:'*rray' 
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2125
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2126
     Smalltalk classnameCompletion:'Arr cl'     
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2127
     Smalltalk classnameCompletion:'*rray cl' 
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2128
    "
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2129
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  2130
    "Created: 24.11.1995 / 17:24:45 / cg"
2523
04db1fd74e0d try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
  2131
    "Modified: 3.4.1997 / 18:25:01 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2132
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2133
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2134
defaultNameSpace
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2135
    "return the default namespace, where new classes are installed,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2136
     if NO special nameSpace handler is present"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2137
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2138
    |p|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2139
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2140
    (Project notNil and:[(p := Project current) notNil]) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2141
	^ p defaultNameSpace
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2142
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2143
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2144
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2145
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2146
    "Created: 19.12.1996 / 23:49:25 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2147
    "Modified: 2.1.1997 / 20:01:31 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2148
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2149
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2150
globalNameCompletion:aPartialGlobalName
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2151
    "given a partial globalName, return an array consisting of
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2152
     2 entries: 1st: the best (longest) match
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2153
                2nd: collection consisting of matching names"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2154
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2155
    ^ DoWhatIMeanSupport globalNameCompletion:aPartialGlobalName in:self
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2156
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2157
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2158
     Smalltalk globalnameCompletion:'Arr'  
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2159
     Smalltalk globalnameCompletion:'Arra' 
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2160
     Smalltalk globalnameCompletion:'arra' 
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2161
     Smalltalk globalnameCompletion:'*rray' 
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2162
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2163
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2164
    "Created: 24.11.1995 / 17:24:45 / cg"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2165
    "Modified: 3.4.1997 / 18:25:01 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2166
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2167
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2168
globalnameCompletion:aPartialGlobalName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2169
    "given a partial globalName, return an array consisting of
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2170
     2 entries: 1st: the best (longest) match
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2171
                2nd: collection consisting of matching names"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2172
8358
0afa3ee38c37 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 8317
diff changeset
  2173
    <resource:#obsolete>
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2174
    self obsoleteMethodWarning:'use #globalNameCompletion:'.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2175
    ^ DoWhatIMeanSupport globalNameCompletion:aPartialGlobalName in:self
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2176
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2177
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2178
     Smalltalk globalnameCompletion:'Arr'  
5736
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2179
     Smalltalk globalnameCompletion:'Arra' 
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2180
     Smalltalk globalnameCompletion:'arra' 
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2181
     Smalltalk globalnameCompletion:'*rray' 
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2182
    "
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2183
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2184
    "Created: 24.11.1995 / 17:24:45 / cg"
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  2185
    "Modified: 3.4.1997 / 18:25:01 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2186
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2187
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2188
hasNamespaces
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2189
    "can be redefined by dummy namespaces/environments, to suppress
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2190
     the namespace display in a browser (PocketSmalltalk)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2191
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2192
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2193
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2194
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2195
includes:something
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2196
    "this should come from Collection.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2197
     will change the inheritance - Smalltalk is actually a collection"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2198
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2199
    self do:[:element | element = something ifTrue:[^ true]].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2200
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2201
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2202
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2203
isNameSpace
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2204
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2205
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2206
    "Created: 11.10.1996 / 18:10:43 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2207
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2208
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2209
isTopLevelNameSpace
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2210
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2211
!
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2212
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2213
isTopLevelNamespace
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2214
    "obsolete - use isTopLevelNameSpace"
5365
95c615a40176 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
  2215
7432
155245708ca3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7430
diff changeset
  2216
    <resource:#obsolete>
155245708ca3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7430
diff changeset
  2217
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2218
    self obsoleteMethodWarning:'use #isTopLevelNameSpace'.
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2219
    ^ true
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2220
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2221
    "Created: 11.10.1996 / 18:10:43 / cg"
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2222
!
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  2223
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2224
methodProtocolCompletion:aPartialProtocolName
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2225
    "given a partial method protocol name, return an array consisting of
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2226
     2 entries: 1st: the best (longest) match 
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2227
                2nd: collection consisting of matching protocols"
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  2228
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2229
    ^ DoWhatIMeanSupport methodProtocolCompletion:aPartialProtocolName in:self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2230
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2231
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2232
     Smalltalk methodProtocolCompletion:'doc'  
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2233
     Smalltalk methodProtocolCompletion:'docu' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2234
     Smalltalk methodProtocolCompletion:'documenta' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2235
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2236
!
5505
e99e8e9cbfef added #methodProtocolCompletion:
Claus Gittinger <cg@exept.de>
parents: 5504
diff changeset
  2237
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2238
numberOfGlobals
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2239
    "return the number of global variables in the system"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2240
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2241
    |tally "{ Class: SmallInteger }" |
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2242
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2243
    tally := 0.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2244
    self do:[:obj | tally := tally + 1].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2245
    ^ tally
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2246
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2247
    "Smalltalk numberOfGlobals"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2248
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2249
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2250
referencesAny:aCollection
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2251
    "redefined, since the references are only kept in the VM's symbol table"
3260
10e5199831ee added #referencesAny:
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  2252
10e5199831ee added #referencesAny:
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  2253
    self keysAndValuesDo:[:key :val |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2254
	aCollection do:[:anObject |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2255
	    (key == anObject) ifTrue:[^ true].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2256
	    (val == anObject ) ifTrue:[^ true].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2257
	]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2258
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2259
    ^ super referencesAny:aCollection
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2260
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2261
    "Created: / 2.2.1998 / 16:01:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2262
!
3260
10e5199831ee added #referencesAny:
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  2263
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2264
referencesDerivedInstanceOf:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2265
    "redefined, since the references are only kept in the VM's symbol table"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2266
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2267
    self keysAndValuesDo:[:key :val |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2268
	(key isKindOf:aClass) ifTrue:[^ true].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2269
	(val isKindOf:aClass) ifTrue:[^ true].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2270
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2271
    ^ super referencesDerivedInstanceOf:aClass
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2272
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2273
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2274
referencesInstanceOf:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2275
    "redefined, since the references are only kept in the VM's symbol table"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2276
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2277
    self keysAndValuesDo:[:key :val |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2278
	(key isMemberOf:aClass) ifTrue:[^ true].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2279
	(val isMemberOf:aClass) ifTrue:[^ true].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2280
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2281
    ^ super referencesInstanceOf:aClass
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2282
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2283
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2284
referencesObject:anObject
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2285
    "redefined, since the references are only kept in the VM's symbol table"
6074
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2286
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2287
    self keysAndValuesDo:[:key :val |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2288
	(key == anObject) ifTrue:[^ true].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2289
	(val == anObject ) ifTrue:[^ true].
6074
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2290
    ].
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2291
    ^ super referencesObject:anObject
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  2292
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2293
    "Modified: / 3.2.1998 / 14:22:46 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2294
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2295
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2296
resolveName:nameIn inClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2297
    "resolve aName as if compiled within aClass;
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2298
     i.e. if it has a private class with this name, return it;
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2299
     if aName is known within the classes namespace, return that.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2300
     Otherwise, return a global with that name.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2301
     This should be used whereever Smalltalk>>at: used to be used,
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2302
     to resolve a global by name."
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2303
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2304
    |aName sym cls ns|
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2305
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2306
    nameIn isNil ifTrue:[^ nil].
4356
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  2307
    nameIn isBehavior ifTrue:[^ nameIn].       "/ already resolved
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2308
    aName := nameIn.
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2309
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2310
    (aName startsWith:'Smalltalk::') ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2311
	aName := aName copyFrom:12.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2312
	^ self at:(aName asSymbol) ifAbsent:nil.
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  2313
    ].
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2314
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2315
    sym := aName asSymbol.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2316
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2317
    cls := aClass privateClassesAt:sym.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2318
    cls notNil ifTrue:[^ cls].
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2319
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2320
    ns := aClass nameSpace.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2321
    (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2322
	ns isNameSpace ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2323
	    cls := ns at:sym ifAbsent:nil.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2324
	] ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2325
	    cls := ns privateClassesAt:sym
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2326
	].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  2327
	cls notNil ifTrue:[^ cls].
3025
53b114d5be3e added #resolveClassNamed:
ca
parents: 3022
diff changeset
  2328
    ].
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  2329
    ^ self at:sym ifAbsent:nil.
4356
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  2330
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  2331
    "Modified: / 9.7.1999 / 01:18:07 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2332
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2333
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2334
selectorCompletion:aPartialSymbolName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2335
    "given a partial selector, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2336
     2 entries: 1st: the longest match
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2337
                2nd: collection consisting of matching implemented selectors"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2338
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2339
    ^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2340
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2341
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2342
selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2343
    "given a partial selector, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2344
     2 entries: 1st: the longest match
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2345
                2nd: collection consisting of matching implemented selectors"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2346
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2347
    ^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2348
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2349
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2350
     Smalltalk selectorCompletion:'at:p'  
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2351
     Smalltalk selectorCompletion:'nextP' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2352
     Smalltalk selectorCompletion:'nextp' 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2353
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2354
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2355
    "Modified: / 7.6.1996 / 08:44:33 / stefan"
3565
966a108e3765 also do caseless selectorCompletion
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
  2356
    "Modified: / 14.6.1998 / 15:54:03 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2357
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2358
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2359
!Smalltalk class methodsFor:'queries-system'!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2360
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2361
dialectName
8736
e6e8a6754506 #dialectName answers a symbol
Stefan Vogel <sv@exept.de>
parents: 8712
diff changeset
  2362
    ^ #SmalltalkX
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2363
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2364
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2365
     Smalltalk dialectName
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2366
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2367
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2368
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2369
dialectReleaseVersion
7348
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  2370
    ^ self versionString
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  2371
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  2372
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2373
     Smalltalk dialectReleaseVersion
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2374
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2375
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2376
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2377
isDolphinSmalltalk
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2378
    "return false here - this may be useful to write portable
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2379
     applications - add #isDolphinSmalltalk to your dolphin,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2380
     returning true there."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2381
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2382
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2383
!
4970
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2384
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2385
isSmalltalkMT
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2386
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2387
     applications - add #isSmalltalkMT to your smalltalk-MT,
4970
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2388
     returning true there."
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2389
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2390
    ^ false
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2391
!
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  2392
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2393
isSmalltalkV
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2394
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2395
     applications - add #isSmalltalkV to your smalltalkV,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2396
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2397
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2398
    ^ false
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2399
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2400
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2401
isSmalltalkX
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2402
    "return true here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2403
     applications - add #isSmalltalkX to your other smalltalks,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2404
     returning false there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2405
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2406
    ^ true
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2407
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2408
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2409
isSqueak
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2410
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2411
     applications - add #isSqueak to your squeak,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2412
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2413
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2414
    ^ false
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2415
!
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2416
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2417
isVisualAge
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2418
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2419
     applications - add #isVisualAge to your visualAge,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2420
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2421
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2422
    ^ false
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2423
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  2424
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2425
isVisualWorks
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2426
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2427
     applications - add #isVisualWorks to your visualWorks,
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2428
     returning true there."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2429
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2430
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2431
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2432
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2433
!Smalltalk class methodsFor:'startup'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2434
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2435
displayInitializationDone
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2436
    "inform the restart, that the display has been initialized"
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2437
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2438
    CallbackSignal raiseRequest.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2439
!
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2440
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2441
mainStartup:graphicalMode
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2442
    "common start/restart action, if there is a Display, initialize it
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2443
     and start dispatching; otherwise go into a read-eval-print loop."
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2444
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2445
    |process imageName thisIsARestart idx|
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2446
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2447
    imageName := ObjectMemory imageName.
2249
cdb6c87f0707 send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents: 2212
diff changeset
  2448
    thisIsARestart := imageName notNil.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2449
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2450
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2451
     if there is a display, start its event dispatcher 
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2452
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2453
    Display notNil ifTrue:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2454
        Display deviceIOTimeoutErrorSignal handlerBlock:[:ex |
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2455
            SaveEmergencyImage == true ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2456
                'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2457
                ObjectMemory primSnapShotOn:'crash.img'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2458
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2459
            'Display [warning]: broken display connection - exit.' infoPrintCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2460
            self exit.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2461
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2462
        Display startDispatch.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2463
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2464
9016
2979527dbdf4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9015
diff changeset
  2465
    idx := CommandLineArguments indexOf:'--browserWindow:'.
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  2466
    IsPlugin := (idx ~~ 0).
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  2467
    IsPlugin ifTrue:[
9018
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  2468
        self browserWindowStartup.
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
  2469
        "/ not reached
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2470
    ].
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2471
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2472
    Initializing := false.
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2473
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2474
    "/ start a process, which evaluates all StartBlocks
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2475
    "/ this used to be done right here (in this system-process),
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2476
    "/ but lead to trouble, when it suspended.
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2477
    "/ Therefore, it is now done by an extra user-process.
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2478
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2479
    process := [
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2480
        StartBlocks notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2481
            StartBlocks do:[:aBlock|
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2482
                aBlock value
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2483
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2484
            StartBlocks := nil.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2485
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2486
        ImageStartBlocks notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2487
            ImageStartBlocks do:[:aBlock|
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2488
                aBlock value
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2489
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2490
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2491
        StandAlone ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2492
            (SilentLoading == true) ifFalse:[   "i.e. undefined counts as false" 
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2493
                thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2494
                    Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2495
                    Transcript showCR:('Smalltalk restarted from:'
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2496
                                        , imageName
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2497
                                        , ' (saved '
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2498
                                        , ObjectMemory imageSaveTime printString
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2499
                                        , ')' ).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2500
                ] ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2501
                    Transcript showCR:(self hello).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2502
                    Transcript showCR:(self copyrightString).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2503
                    Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2504
                ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2505
                Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2506
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2507
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2508
            DemoMode==true ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2509
                Transcript showCR:'*** Restricted use:                              ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2510
                Transcript showCR:'*** This program may be used for education only. ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2511
                Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE  ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2512
                Transcript showCR:'*** for more details.                            ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2513
                Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2514
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2515
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2516
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2517
        thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2518
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2519
            "/ the final late notification - users can now assume that
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2520
            "/ views, forms etc. have been recreated.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2521
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2522
            ObjectMemory changed:#returnFromSnapshot.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2523
        ]
7039
6f1c02381145 Do not keep reference to start block handler process.
Stefan Vogel <sv@exept.de>
parents: 7000
diff changeset
  2524
7040
d24ef75bc6c3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7039
diff changeset
  2525
    ] newProcess.
d24ef75bc6c3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7039
diff changeset
  2526
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2527
    process priority:8.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2528
    process name:'start block handler'.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2529
    process beGroupLeader.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2530
    process resume.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2531
    process := nil.
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  2532
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  2533
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2534
    "/ start a process, which evaluates the startupClass>>startupSelector
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2535
    "/ message.
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2536
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2537
    (StartupClass notNil and:[StartupSelector notNil]) ifTrue:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2538
        "
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2539
         allow more customization by reading an image specific rc-file
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2540
        "
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2541
        thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2542
            (imageName asFilename hasSuffix:'img') ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2543
                imageName := imageName copyWithoutLast:4
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2544
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2545
            self fileIn:(imageName , '.rc')
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2546
        ].
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2547
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2548
"/        Display notNil ifTrue:[
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2549
"/            Display exitOnLastClose:true.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2550
"/        ].
2086
4a9d8b5cada7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
  2551
"/        Processor exitWhenNoMoreUserProcesses:true.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2552
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2553
        process := [
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2554
            StandAlone ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2555
                AbortOperationRequest handle:[:ex |
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2556
                    'Smalltalk [info]: aborted - exit.' infoPrintCR.
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2557
                    OperatingSystem exit:1
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2558
                ] do:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2559
                    StartupClass perform:StartupSelector withArguments:StartupArguments.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2560
                ]
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2561
            ] ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2562
                StartupClass perform:StartupSelector withArguments:StartupArguments.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2563
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2564
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2565
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2566
            "/ non-GUI apps exit after the startup;
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2567
            "/ assume that GUI apps have created & opened some view ...
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2568
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2569
            Display isNil ifTrue:[
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2570
                'Smalltalk [info]: no Display - exit.' infoPrintCR.
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2571
                Smalltalk exit.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2572
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2573
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2574
            "/ GUI apps exit after the last user process has finished
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2575
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2576
            Display exitOnLastClose:true.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2577
            Processor exitWhenNoMoreUserProcesses:true.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2578
        ] newProcess.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2579
        process priority:8.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2580
        process name:'main'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2581
        process beGroupLeader.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2582
        process resume.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2583
        process := true.    "do not refer to process"
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2584
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2585
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2586
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2587
     if view-classes exist, start dispatching;
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2588
     otherwise go into a read-eval-print loop
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2589
    "
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  2590
    ((Display notNil and:[graphicalMode]) 
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2591
     or:[process notNil
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2592
     or:[HeadlessOperation]]) ifTrue:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2593
        Processor dispatchLoop.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2594
    ] ifFalse:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2595
        StandAlone ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2596
            self readEvalPrint
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2597
        ]
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2598
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2599
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2600
    "done - the last process finished"
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2601
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2602
    'Smalltalk [info]: last process finished - exit.' infoPrintCR.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2603
    self exit
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2604
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  2605
    "Created: / 18.7.1996 / 21:07:39 / cg"
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  2606
    "Modified: / 9.9.1996 / 17:42:50 / stefan"
3483
029aabc7f3c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3475
diff changeset
  2607
    "Modified: / 25.5.1998 / 15:02:57 / cg"
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2608
!
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2609
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2610
readEvalPrint
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2611
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2612
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2613
    "simple read-eval-print loop for non-graphical Minitalk"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2614
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2615
    |text|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2616
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2617
    'ST- ' print.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2618
    Stdin skipSeparators.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2619
    Stdin atEnd ifFalse:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2620
        text := Stdin nextChunk.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2621
        [text notNil] whileTrue:[
8675
ceef81bb2d0c AbortOperationRequest is now a subclass (and child-Exception) of.
Stefan Vogel <sv@exept.de>
parents: 8665
diff changeset
  2622
            AbortAllOperationRequest handle:[:ex |
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2623
                'evaluation aborted' printCR
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2624
            ] do:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2625
                Compiler isNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2626
                    'No evaluator class available (Compiler == nil)' printCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2627
                    ^ self
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2628
                ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2629
                (Compiler evaluate:text) printCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2630
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2631
            'ST- ' print.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2632
            text := Stdin nextChunk
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2633
        ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2634
    ].
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  2635
    '' printCR
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2636
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2637
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2638
restart
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2639
    "startup after an image has been loaded;
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2640
     there are three change-notifications made to dependents of ObjectMemory,
10
claus
parents: 8
diff changeset
  2641
     which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot.
335
claus
parents: 329
diff changeset
  2642
3096
881660d6e997 added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 3092
diff changeset
  2643
     #earlySystemInstallation is sent for ST80 compatibility
881660d6e997 added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 3092
diff changeset
  2644
10
claus
parents: 8
diff changeset
  2645
     #earlyRestart is send first, nothing has been setup yet.
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2646
                   (should be used to flush all device dependent entries)
335
claus
parents: 329
diff changeset
  2647
10
claus
parents: 8
diff changeset
  2648
     #restarted is send right after.
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2649
                   (should be used to recreate external resources (fds, bitmaps etc)
335
claus
parents: 329
diff changeset
  2650
10
claus
parents: 8
diff changeset
  2651
     #returnFromSnapshot is sent last
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2652
                   (should be used to restart processes, reOpen Streams which cannot
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2653
                    be automatically be reopened (i.e. Sockets, Pipes) and so on.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2654
                   (Notice that positionable fileStreams are already reopened and repositioned)
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2655
     "
10
claus
parents: 8
diff changeset
  2656
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2657
    |deb insp transcript idx|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2658
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2659
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2660
    "/ when we arrive here, all objects from our previous life
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2661
    "/ have been reloaded - however, some may still contain invalid device
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2662
    "/ handles, display information etc.
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2663
    "/ also, dynamically loaded modules have not yet been reloaded yet.
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2664
    "/ and the concrete OS, concrete FileName etc. are still refering to
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2665
    "/ the previous classes.
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2666
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2667
    Initializing := true.
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
  2668
    AbstractOperatingSystem initializeConcreteClass.
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
  2669
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2670
    ImageRestartTime := Timestamp now.
335
claus
parents: 329
diff changeset
  2671
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2672
    CommandLine := CommandLineArguments copy.
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2673
    CommandLineArguments := CommandLineArguments asOrderedCollection.
6842
a5110421e4ab more for standAlone start
Claus Gittinger <cg@exept.de>
parents: 6841
diff changeset
  2674
    CommandName := CommandLineArguments removeFirst. "/ the command
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2675
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2676
    idx := CommandLineArguments indexOf:'-q'.
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2677
    idx == 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2678
        idx := CommandLineArguments indexOf:'--silent'.
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2679
    ].
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2680
    idx ~~ 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2681
        Object infoPrinting:false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2682
        ObjectMemory infoPrinting:false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2683
        CommandLineArguments removeAtIndex:idx.
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2684
    ].
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2685
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2686
    "/
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2687
    "/ start catching SIGSEGV and SIGBUS
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2688
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2689
    OperatingSystem enableHardSignalInterrupts.
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2690
2907
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2691
    "/ reinit Filename
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2692
    Filename reinitialize.
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2693
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2694
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2695
    "/ flush cached path directories (may have changed in the meanwhile)
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2696
329
claus
parents: 326
diff changeset
  2697
    self flushPathCaches.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2698
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2699
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2700
    "/ reinit the default streams: Stdin, Stdout and Stderr
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2701
    "/ after that, we can write to stderr.
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2702
477
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
  2703
    self reinitStandardStreams.
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
  2704
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2705
    "/
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2706
    "/ redirect Transcript to Stderr during startup    
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2707
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2708
    transcript := Transcript.    
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2709
    Transcript := Stderr.
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2710
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2711
    "/
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2712
    "/ temporary switch back to dumb interface - 
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2713
    "/ to handle errors while view-stuff is not yet reinitialized
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2714
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2715
    insp := Inspector.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2716
    deb := Debugger.
684
3e0b5a8ec381 invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2717
    deb notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2718
        deb reinitialize
684
3e0b5a8ec381 invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2719
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2720
    Inspector := MiniInspector.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2721
    Debugger := MiniDebugger.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2722
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2723
    "/ reload any dynamically loaded objects.
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2724
    "/ this must be done before doing anything else below,
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2725
    "/ because the Processor may restart processes which use
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2726
    "/ this code.
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2727
    "/ Also, a dynamic object might be registered as dependent of
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2728
    "/ ObjectFileLoader; therefore, must reload before doing any notifications.
335
claus
parents: 329
diff changeset
  2729
1100
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2730
    ObjectFileLoader notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2731
        ObjectFileLoader reloadAllRememberedObjectFiles.
1100
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2732
    ].
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2733
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2734
    "/
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2735
    "/ invalidate all display connections.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2736
    "/ This is required to avoid trouble if someone accesses
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2737
    "/ a display during early startup.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2738
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2739
    Screen notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2740
        Screen allScreens do:[:aDisplay |
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2741
            aDisplay invalidateConnection
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2742
        ].
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2743
    ].
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2744
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2745
    ObjectMemory changed:#earlySystemInstallation.
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2746
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2747
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2748
    "/ reinitialize the Processor - restartable processes
4109
3e536657cff6 comment only
Claus Gittinger <cg@exept.de>
parents: 4099
diff changeset
  2749
    "/ are now restarted here (but not yet scheduled).
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2750
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2751
    Processor reinitialize.
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2752
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2753
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2754
    "/ flush device handles & recreate OS resources (if possible)
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2755
    "/ (mostly view/GC/color & font stuff)
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2756
3022
1b6800d56d62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3021
diff changeset
  2757
    ObjectMemory
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2758
        changed:#earlyRestart; changed:#restarted.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2759
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2760
    "/
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2761
    "/ start catching SIGINT and SIGQUIT
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2762
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2763
    OperatingSystem enableUserInterrupts.
6390
41d5c47c33f0 Catch sigPWR and sigHUP on restart
Stefan Vogel <sv@exept.de>
parents: 6366
diff changeset
  2764
    OperatingSystem enableCrashSignalInterrupts.
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2765
8958
6cb2a9cd649c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8957
diff changeset
  2766
    "/ give user a chance to re-customize things in smalltalk_r.rc.
8957
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2767
    "/ reading if smalltalk_r.rc may be suppressed by the --faststart argument.
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2768
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2769
    idx := CommandLineArguments indexOf:'--faststart'.
8957
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2770
    idx == 0 ifTrue:[
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2771
        idx := CommandLineArguments indexOf:'--fastStart'.
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2772
    ].
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2773
    idx ~~ 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2774
        CommandLineArguments removeAtIndex:idx.
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2775
    ] ifFalse:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2776
        CallbackSignal := QuerySignal new.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2777
        [
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2778
            Class withoutUpdatingChangesDo:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2779
                (self fileIn:(self commandName , '_r.rc')) ifFalse:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2780
                    "no _r.rc file where executable is; try default smalltalk_r.rc"
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2781
                    self fileIn:'smalltalk_r.rc'
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2782
                ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2783
            ]
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2784
        ] on:CallbackSignal do:[:ex|
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2785
            "/ now, display and view-stuff works;
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2786
            "/ back to the previous debugging interface
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2787
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2788
            Inspector := insp.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2789
            Debugger := deb.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2790
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2791
            "/ reinstall Transcript, if not changed during restart.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2792
            "/ if there was no Transcript, go to stderr
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2793
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2794
            (transcript notNil and:[Transcript == Stderr]) ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2795
                Transcript := transcript.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2796
            ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2797
            Initializing := false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2798
            ex proceed.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2799
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2800
        CallbackSignal := nil.
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2801
    ].
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2802
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2803
    "/ reinitialization (restart) of Display is normally performed
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2804
    "/ in the restart script. If this has not been run for some reason,
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2805
    "/ do in now.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2806
    Initializing ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2807
        Display notNil ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2808
            [
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2809
                Display reinitializeFor:Screen defaultDisplayName.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2810
            ] on:Screen deviceOpenErrorSignal do:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2811
                'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2812
                Screen defaultDisplayName errorPrintCR.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2813
                OperatingSystem exit:1.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2814
            ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2815
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2816
        "/ now, display and view-stuff works;
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2817
        "/ back to the previous debugging interface
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2818
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2819
        Inspector := insp.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2820
        Debugger := deb.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2821
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2822
        "/ reinstall Transcript, if not changed during restart.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2823
        "/ if there was no Transcript, go to stderr
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2824
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2825
        (transcript notNil and:[Transcript == Stderr]) ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2826
            Transcript := transcript.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2827
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2828
        Initializing := false.
7
bf6f603119df final release before Dispatcher
claus
parents: 5
diff changeset
  2829
    ].
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2830
    Screen notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2831
        "clean up leftover screens (and views) that haven't been reopened.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2832
         Operate on a copy, since brokenConnection removes us from AllScreens"
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2833
        Screen allScreens copy do:[:eachDisplay |
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2834
            eachDisplay isOpen ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2835
                'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2836
                eachDisplay errorPrintCR.
8524
ad922805e66d Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents: 8522
diff changeset
  2837
                eachDisplay cleanupAfterDispatch; brokenConnection.
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2838
            ]
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2839
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2840
    ].
7
bf6f603119df final release before Dispatcher
claus
parents: 5
diff changeset
  2841
8524
ad922805e66d Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents: 8522
diff changeset
  2842
    deb := insp := transcript := nil.   "avoid dangling refs"   
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2843
    self mainStartup:true
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2844
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2845
    "Modified: / 7.6.1998 / 02:48:00 / cg"
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2846
    "Modified: / 3.8.1999 / 09:42:21 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2847
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2848
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2849
start
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2850
    "main startup, if there is a Display, initialize it
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2851
     and start dispatching; otherwise go into a read-eval-print loop."
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2852
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2853
    |idx graphicalMode arg didReadRCFile|
960
e3b75f50d0cd changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
  2854
e3b75f50d0cd changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
  2855
    graphicalMode := true.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2856
    Initializing := true.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2857
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2858
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2859
     while reading patches- and rc-file, do not add things into change-file
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2860
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2861
    Class withoutUpdatingChangesDo:[
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2862
        |myName defaultRC prevCatchSetting|
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2863
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2864
        "/
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2865
        "/ look for any '-q', '-e' or '-f' command line arguments
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2866
        "/ and handle them;
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2867
        "/ read startup and patches file
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2868
        "/
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2869
        idx := CommandLineArguments indexOf:'-q'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2870
        idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2871
            idx := CommandLineArguments indexOf:'--silent'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2872
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2873
        idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2874
            Object infoPrinting:false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2875
            ObjectMemory infoPrinting:false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2876
            CommandLineArguments removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2877
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2878
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2879
        StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2880
            "/ look for a '-e filename' or '--execute filename' argument 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2881
            "/ this will force fileIn of filename only, no standard startup.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2882
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2883
            idx := CommandLineArguments indexOf:'-e'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2884
            idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2885
                idx := CommandLineArguments indexOf:'--execute'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2886
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2887
            idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2888
                arg := CommandLineArguments at:idx + 1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2889
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2890
                CommandLineArguments
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2891
                    removeAtIndex:idx+1; removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2892
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2893
                arg = '-' ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2894
                    self fileInStream:Stdin
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2895
                           lazy:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2896
                           silent:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2897
                           logged:false
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2898
                           addPath:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2899
                ] ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2900
                    self fileIn:arg.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2901
                ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2902
                self exit
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2903
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2904
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2905
            "/ look for a '-E expr' or '--eval expr' argument 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2906
            "/ this will force evaluation of expr only, no standard startup
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2907
            idx := CommandLineArguments indexOf:'-E'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2908
            idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2909
                idx := CommandLineArguments indexOf:'--eval'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2910
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2911
            idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2912
                arg := CommandLineArguments at:idx + 1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2913
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2914
                CommandLineArguments
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2915
                    removeAtIndex:idx+1; removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2916
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2917
                self 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2918
                    fileInStream:arg readStream
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2919
                    lazy:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2920
                    silent:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2921
                    logged:false
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2922
                    addPath:nil.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2923
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2924
                self exit
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2925
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2926
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2927
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2928
        "look for a '-f filename' or '--file filename' argument 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2929
         this will force evaluation of filename instead of smalltalk.rc
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2930
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2931
         If there is only one argument, which does not start with a '-',
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2932
         this is the same as -f filename"
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2933
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2934
        (CommandLineArguments size == 1 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2935
         and:[(CommandLineArguments first startsWith:$-) not]) ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2936
            myName := CommandLineArguments removeFirst.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2937
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2938
        myName isNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2939
            idx := CommandLineArguments indexOf:'-f'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2940
            idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2941
                idx := CommandLineArguments indexOf:'--file'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2942
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2943
            idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2944
                myName := CommandLineArguments removeAtIndex:idx+1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2945
                CommandLineArguments removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2946
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2947
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2948
        myName notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2949
            CommandName := myName.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2950
            (self secureFileIn:myName) ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2951
                ('Smalltalk [error]: startup file ', myName, ' not found.') errorPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2952
                OperatingSystem exit:1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2953
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2954
        ] ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2955
            "/ look for <command>.rc
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2956
            "/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation)
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2957
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2958
            didReadRCFile := false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2959
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2960
            myName := self commandName asFilename withSuffix:'rc'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2961
            (didReadRCFile := self secureFileIn:myName) ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2962
                StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2963
                    defaultRC := 'smalltalk.rc'
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2964
                ] ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2965
                    defaultRC := 'stxapp.rc'
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2966
                ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2967
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2968
                didReadRCFile := self secureFileIn:defaultRC.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2969
                didReadRCFile ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2970
                    StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2971
                        'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2972
                        graphicalMode := false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2973
                    ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2974
                ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2975
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2976
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2977
            "/ ('StandAlone is %1' bindWith:StandAlone) printCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2978
            "/ ('Headless is %1' bindWith:HeadlessOperation) printCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2979
            "/ ('Display is %1' bindWith:Display) printCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2980
            "/ ('Screen is %1' bindWith:Screen) printCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2981
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2982
            didReadRCFile ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2983
                StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2984
                    "/ its a smalltalk - proceed in interpreter.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2985
                    'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2986
                    graphicalMode := false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2987
                ] ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2988
                    "/ its an application - try harder
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2989
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2990
                    Screen notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2991
                        [
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2992
                            Screen openDefaultDisplay:nil.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2993
                        ] on:Screen deviceOpenErrorSignal do:[:ex|
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2994
                            ('Smalltalk [error]: No Display connection to: ', ex parameter printString) errorPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2995
                            'Smalltalk [info]: Either set the DISPLAY environment variable,' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2996
                            'Smalltalk [info]: or start smalltalk with a -display argument.' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2997
                            HeadlessOperation == true ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2998
                                OperatingSystem exit:1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2999
                            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3000
                        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3001
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3002
                        Display notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3003
                            (self secureFileIn:'display.rc') ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3004
                                'Smalltalk [warning]: no display.rc found; screen setting might be wrong.' infoPrintCR.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3005
                            ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3006
                        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3007
                    ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3008
                ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3009
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3010
        ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3011
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3012
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
  3013
    StandAlone ifFalse:[
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3014
        "
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3015
         enable the graphical debugger/inspector 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3016
         (they could have been (re)defined as autoloaded in the patches file)
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3017
        "
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3018
        self initStandardTools.
963
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
  3019
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3020
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3021
    (Display isNil or:[HeadlessOperation]) ifTrue:[
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3022
        graphicalMode := false.
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3023
    ].
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3024
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3025
    self mainStartup:graphicalMode
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3026
5146
bfe5096a2d06 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5145
diff changeset
  3027
    "Modified: / 24.12.1999 / 00:26:54 / cg"
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3028
! !
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3029
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3030
!Smalltalk class methodsFor:'startup queries'!
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3031
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3032
commandLine
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3033
    "return the full command line arguments (with which ST/X was started)"
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3034
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3035
    ^ CommandLine
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3036
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3037
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3038
     Smalltalk commandLine   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3039
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3040
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3041
    "Created: 19.7.1996 / 11:09:06 / cg"
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3042
!
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3043
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3044
commandLineArgumentNamed:aString
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3045
    "extract a named argument from the command line arguments."
6806
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3046
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3047
    |args index|
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3048
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3049
    args := self commandLineArguments.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3050
    index := args indexOf:aString.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3051
    (index between:1 and:(args size - 1)) ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3052
	^ args at:index+1
6806
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3053
    ].
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3054
    ^ nil.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3055
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3056
    "
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3057
     self commandLineArgumentNamed:'-display'
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3058
    "
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3059
!
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3060
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3061
commandLineArguments
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3062
    "return the user command line arguments;
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3063
     This is a collection of strings (separated command line words),
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3064
     from which the internal startup arguments have already been removed.
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3065
     I.e. if started with: 'smalltalk -I -f xxx foo bar baz',
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3066
     the commandLineArguments will be #('foo' 'bar' 'baz').
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3067
     In contrast, the value returned by #commandLine will be the full set of words."
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3068
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3069
    ^ CommandLineArguments
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3070
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3071
    "Modified: 19.7.1996 / 11:11:03 / cg"
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3072
!
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3073
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3074
commandName
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3075
    "return the excutables name - this is normally 'stx', 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3076
     but can be something else for standAlone apps."
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3077
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3078
    ^ CommandName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3079
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3080
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3081
     Smalltalk commandName
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3082
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3083
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3084
    "Modified: 19.7.1996 / 11:11:16 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3085
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3086
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3087
isHeadless
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3088
    "return true, if this is a headless application
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3089
     i.e. no default Display connection is required/used"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3090
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3091
    ^ HeadlessOperation ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3092
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3093
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3094
     Smalltalk isHeadless   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3095
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3096
!
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3097
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3098
isPlugin
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3099
    "return true, if this is a plugin application
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3100
     i.e. running in a browserWindow"
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3101
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3102
    ^ IsPlugin ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3103
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3104
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3105
     Smalltalk isPlugin   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3106
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3107
!
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  3108
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3109
isStandAloneApp
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3110
    "return true, if this is a standAlone application
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3111
     i.e. a stripped & linked application (such as the webServer)
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3112
     in contrast to a full smalltalk (development) system."
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3113
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3114
    ^ StandAlone ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3115
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3116
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3117
     Smalltalk isStandAloneApp   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3118
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3119
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3120
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3121
startupArguments
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3122
    "return the arguments passed to StartupClass when stx gets started.
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3123
     Usually these are nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3124
     but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3125
     a simple way to configure and create stand-alone applications"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3126
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3127
    ^ StartupArguments
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3128
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3129
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3130
     Smalltalk startupArguments   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3131
    "
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3132
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3133
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3134
startupClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3135
    "return the class, that will get the start message when smalltalk
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3136
     starts and its non-nil. Usually this is nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3137
     but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3138
     a simple way to configure and create stand-alone applications"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3139
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3140
    ^ StartupClass
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3141
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3142
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3143
     Smalltalk startupClass   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3144
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3145
!
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  3146
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3147
startupClass:aClass selector:aSymbol arguments:anArrayOrNil
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3148
    "{ Pragma: +optSpace }"
1119
956d62a5656c compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
  3149
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3150
    "set the class, selector and arguments to be performed when smalltalk
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3151
     starts. Setting those before saving a snapshot, will make the saved
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3152
     image come up executing your application (instead of the normal mainloop)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3153
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3154
    StartupClass := aClass.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3155
    StartupSelector := aSymbol.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3156
    StartupArguments := anArrayOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3157
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3158
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3159
startupSelector
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3160
    "return the selector, that will be sent to StartupClass.
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3161
     Usually this is nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3162
     but saving an image with a non-nil StartupClass/StartupSelector allows for
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3163
     a simple way to configure and create stand-alone applications"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3164
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3165
    ^ StartupSelector
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3166
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3167
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3168
     Smalltalk startupSelector   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3169
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3170
!
7811
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3171
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3172
wasStartedFromImage
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3173
    "return true, if this smalltalk was started from an image, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3174
     as opposed to a fresh and clean startup"
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3175
7819
9908e6e36175 wasStartedFromImage fixed
ca
parents: 7811
diff changeset
  3176
    ^ ImageRestartTime notNil
7811
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3177
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3178
    "
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3179
     Smalltalk wasStartedFromImage
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3180
    "
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3181
! !
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3182
9018
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3183
!Smalltalk class methodsFor:'startup-in-browser'!
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3184
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3185
browserWindowStartup
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3186
    |windowIDString numericWindowID windowID params idx process|
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3187
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3188
    idx := CommandLineArguments indexOf:'--browserWindow:'.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3189
    windowIDString := CommandLineArguments at:idx+1.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3190
    numericWindowID := Integer fromString:windowIDString.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3191
    windowID := ExternalAddress newAddress:numericWindowID.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3192
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3193
    idx := CommandLineArguments indexOf:'--browserParameters:'.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3194
    idx ~~ 0 ifTrue:[
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3195
        params := CommandLineArguments copyFrom:idx+1
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3196
    ].
9022
ea24b1b80259 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9021
diff changeset
  3197
9018
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3198
    'browserWindow is: ' errorPrint. windowID errorPrintCR.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3199
    'browserParameters are: ' errorPrint. params errorPrintCR.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3200
    'Display is: ' errorPrint. Display errorPrintCR.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3201
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3202
    process := [
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3203
        self
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3204
            startInBrowserWithWindowID:windowID 
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3205
            parameters:params.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3206
    ] newProcess.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3207
    process priority:8.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3208
    process name:'browser start handler'.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3209
    process beGroupLeader.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3210
    process resume.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3211
    process := nil.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3212
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
  3213
"/    Processor dispatchLoop.
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
  3214
"/    Smalltalk exit.
9018
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3215
!
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3216
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3217
startInBrowserWithWindowID:windowID parameters:parameters
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3218
    |v browserTopView|
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3219
9020
def99f8a54fd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9018
diff changeset
  3220
    browserTopView := ExternalTopView newWithID:windowID.
9022
ea24b1b80259 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9021
diff changeset
  3221
    browserTopView viewBackground:(Color red).
ea24b1b80259 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9021
diff changeset
  3222
    browserTopView clear.
9018
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3223
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3224
    v := Workspace new.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3225
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3226
    browserTopView becomeParentOf:v.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3227
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3228
    Semaphore new wait.
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3229
! !
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  3230
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3231
!Smalltalk class methodsFor:'system environment'!
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3232
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3233
language
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3234
    "return the language setting"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3235
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3236
    ^ Language
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3237
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3238
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3239
     Smalltalk language
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3240
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3241
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3242
    "Modified: 26.4.1996 / 17:10:05 / cg"
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3243
!
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3244
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3245
language:aLanguageSymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3246
    "set the language"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3247
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3248
    Language := aLanguageSymbol.
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3249
    self changed:#Language
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3250
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3251
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3252
     Smalltalk language:#de
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3253
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3254
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3255
    "Modified: 26.4.1996 / 17:13:34 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3256
!
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3257
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3258
languageTerritory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3259
    "return the language territory setting"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3260
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3261
    ^ LanguageTerritory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3262
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3263
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3264
languageTerritory:aTerritorySymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3265
    "set the language territory"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3266
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3267
    LanguageTerritory := aTerritorySymbol.
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3268
    self changed:#LanguageTerritory
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3269
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3270
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3271
     Time now
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3272
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3273
     Smalltalk languageTerritory:#us.
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3274
     Time now
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3275
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3276
     Smalltalk languageTerritory:#de.
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3277
     Time now    
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3278
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3279
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3280
    "Modified: 26.4.1996 / 17:12:39 / cg"
7992
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3281
!
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3282
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3283
setLanguage:aLanguageSymbol
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3284
    "set the language withotu change notifications"
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3285
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3286
    Language := aLanguageSymbol.
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3287
! !
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3288
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3289
!Smalltalk class methodsFor:'system management'!
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3290
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3291
compressSources
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3292
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3293
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3294
    "compress the sources file, and remove all method source strings
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3295
     from the system and replace them by refs to a string in the source file.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3296
     This is a bit different in ST/X than in other smalltalks,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3297
     since we use per-class sourcefiles for the compiled classes,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3298
     and a mix of in-memory strings and one-for-all sourceFile for
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3299
     incremental compiled methods.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3300
     Therefore, only those sources which are not coming from compiled
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3301
     methods are put into the 'st.src' file - all others are untouched.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3302
     This is being automated - so dont care for now."
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3303
7105
44c02807ca41 More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents: 7085
diff changeset
  3304
    |newStream table source pos fileName|
44c02807ca41 More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents: 7085
diff changeset
  3305
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3306
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3307
     first, find all methods which contain either a string-ref
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3308
     or an external string in the 'st.src' file
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3309
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3310
    newStream := 'src.tmp' asFilename writeStream.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3311
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3312
    table := IdentityDictionary new:100.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3313
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3314
    Method allSubInstancesDo:[:aMethod |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3315
        source := nil.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3316
        aMethod sourcePosition notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3317
            aMethod sourceFilename = 'st.src' ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3318
                source := aMethod source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3319
            ]
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3320
        ] ifFalse:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3321
            source := aMethod source
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3322
        ].
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3323
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3324
        source notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3325
            pos := newStream position1Based.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3326
            newStream nextChunkPut:source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3327
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3328
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3329
             dont change the methods info - maybe some write error
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3330
             occurs later, in that case we abort and leave everything
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3331
             untouched.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3332
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3333
            table at:aMethod put:pos
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3334
        ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3335
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3336
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3337
    newStream close.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3338
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3339
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3340
     now, rename the new source file,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3341
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3342
    fileName := (ObjectMemory nameForSources).
1693
1dbf6a20c15e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1688
diff changeset
  3343
    'src.tmp' asFilename renameTo:fileName.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3344
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3345
    "good - now go over all changed methods, and change their
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3346
     source reference"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3347
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3348
    table keysAndValuesDo:[:aMethod :pos |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3349
        aMethod localSourceFilename:fileName position:pos.
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  3350
"/        aMethod printCR.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3351
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3352
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3353
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3354
     Smalltalk compressSources
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3355
    "
1693
1dbf6a20c15e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1688
diff changeset
  3356
2176
1a24b0cef25a when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  3357
    "Modified: 16.1.1997 / 01:25:58 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3358
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3359
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3360
generateSingleSourceFile
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3361
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3362
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3363
    "generate the sources file, and remove all method source strings
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3364
     from the system and replace them by refs to a string in the source file.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3365
     This makes the image independent from the per-class source files
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3366
     and makes transportation of endUser applications easier, since
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3367
     only 3 files (executable, image and sourceFile) need to be 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3368
     transported."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3369
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3370
    |newStream table source pos fileName|
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3371
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3372
    newStream := 'src.tmp' asFilename writeStream.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3373
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3374
    table := IdentityDictionary new:100.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3375
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3376
    Method allSubInstancesDo:[:aMethod |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3377
        source := aMethod source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3378
        source notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3379
            pos := newStream position1Based.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3380
            newStream nextChunkPut:source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3381
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3382
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3383
             dont change the methods info - maybe some write error
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3384
             occurs later, in that case we abort and leave everything
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3385
             untouched.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3386
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3387
            table at:aMethod put:pos
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3388
        ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3389
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3390
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3391
    newStream close.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3392
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3393
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3394
     now, rename the new source file,
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3395
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3396
    fileName := (ObjectMemory nameForSources).
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3397
    'src.tmp' asFilename renameTo:fileName.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3398
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3399
    "good - now go over all changed methods, and change their
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3400
     source reference"
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3401
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3402
    table keysAndValuesDo:[:aMethod :pos |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3403
        aMethod localSourceFilename:fileName position:pos.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3404
"/        aMethod printCR.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3405
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3406
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3407
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3408
     Smalltalk generateSingleSourceFile
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3409
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3410
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3411
    "Modified: 16.1.1997 / 01:25:58 / cg"
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3412
    "Created: 17.10.1997 / 13:00:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3413
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3414
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3415
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3416
    "create & install an autoload stub for a class named: clsName,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3417
     to be loaded from package.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3418
     If revisionOrNil is non-nil, set it up to load exactly that revision
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3419
     (otherwise, the newest revision will be loaded"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3420
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3421
    ^ self 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3422
        installAutoloadedClassNamed:clsName
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3423
        category:cat
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3424
        package:package
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3425
        revision:revisionOrNil
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3426
        numClassInstVars:nil.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3427
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3428
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3429
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil numClassInstVars:numClassInstVarsOrNil
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3430
    "create & install an autoload stub for a class named: clsName,
3915
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3431
     to be loaded from package.
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3432
     If revisionOrNil is non-nil, set it up to load exactly that revision
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3433
     (otherwise, the newest revision will be loaded"
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3434
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3435
    |clsSym cls|
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3436
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3437
    clsSym := clsName asSymbol.
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3438
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3439
    "/ install if not already compiled-in
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3440
    (cls := self at:clsSym) isNil ifTrue:[
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3441
        Autoload subclass:clsSym
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3442
            instanceVariableNames:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3443
            classVariableNames:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3444
            poolDictionaries:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3445
            category:cat
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3446
            inEnvironment:Smalltalk.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3447
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3448
        cls := self at:clsSym.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3449
        cls isNil ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3450
            ('Smalltalk [warning]: failed to install ' , clsName , ' as autoloaded.') infoPrintCR.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3451
        ] ifFalse:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3452
            cls package:package asSymbol.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3453
            revisionOrNil notNil ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3454
                cls setBinaryRevision:revisionOrNil
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3455
            ]
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3456
        ]    
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3457
    ] ifFalse:[
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3458
        "/ class already present - however, check for category/package change
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3459
        package ~= cls package ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3460
            cls package:package asSymbol.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3461
        ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3462
        cat ~= cls category ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3463
            cls category:cat.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3464
        ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3465
    ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3466
    ^ cls.
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3467
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3468
    "Created: / 5.11.1998 / 15:10:25 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3469
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3470
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3471
installAutoloadedClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3472
    "read the standard abbreviation file; install all classes found there as
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3473
     autoloaded. This takes some time ..."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3474
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3475
    |dirsConsulted p|
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3476
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3477
    "/ new scheme: look for a directory called 'packages'
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3478
    "/ and enumerate its abbrev.stc files...
5067
335c866e150c walk packagePath when reading abbrevs & autoloaded classes.
Claus Gittinger <cg@exept.de>
parents: 5065
diff changeset
  3479
    dirsConsulted := Set new.
5162
f7a14d1e17ce checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5160
diff changeset
  3480
f7a14d1e17ce checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5160
diff changeset
  3481
    "/ along the package-path
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3482
    (p := self packagePath) do:[:aPath |
8950
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3483
        (dirsConsulted includes:aPath) ifFalse:[
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3484
            ('Smalltalk [info]: installing autoloaded classes found under ''' , aPath ,'''') infoPrintCR.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3485
            self 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3486
                recursiveInstallAutoloadedClassesFrom:aPath 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3487
                rememberIn:dirsConsulted 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3488
                maxLevels:15 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3489
                noAutoload:false
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3490
                packageTop:aPath.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3491
        ]
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3492
    ].
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3493
    p size == 0 ifTrue:[
8950
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3494
        '../../../stx' asFilename exists ifTrue:[
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3495
            ('Smalltalk [info]: installing autoloaded classes found under ''../../..''') infoPrintCR.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3496
            self 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3497
                recursiveInstallAutoloadedClassesFrom:'../../..' 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3498
                rememberIn:dirsConsulted 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3499
                maxLevels:15 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3500
                noAutoload:false
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3501
                packageTop:'../../..'.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3502
        ].
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3503
    ].
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3504
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3505
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3506
     Smalltalk installAutoloadedClasses
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3507
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3508
5096
9a513c6d8f63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5095
diff changeset
  3509
    "Created: / 14.2.1997 / 17:32:57 / cg"
9a513c6d8f63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5095
diff changeset
  3510
    "Modified: / 13.12.1999 / 11:56:50 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3511
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3512
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3513
installAutoloadedClassesFrom:anAbbrevFilePath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3514
    "read the given abbreviation file; install all classes found there as
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3515
     autoloaded. This takes some time ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3516
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3517
    |f s|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3518
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3519
    f := self getSystemFileName:anAbbrevFilePath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3520
    f isNil ifTrue:[f := self getPackageFileName:anAbbrevFilePath].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3521
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3522
    f notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3523
	f := f asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3524
	f isDirectory ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3525
	    f := f construct:'abbrev.stc'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3526
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3527
	[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3528
	    s := f readStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3529
	    self installAutoloadedClassesFromStream:s.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3530
	    s close.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3531
	] on:FileStream openErrorSignal do:[:ex| "do nothing"].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3532
    ]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3533
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3534
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3535
     Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3536
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3537
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3538
    "Modified: / 5.11.1998 / 15:10:51 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3539
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3540
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3541
installAutoloadedClassesFromStream:anAbbrevFileStream
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3542
    "read the given abbreviation file; 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3543
     install all classes found there as autoloaded, and also update the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3544
     abbreviation (className-to-fileName mapping) table.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3545
     This takes some time ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3546
8846
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3547
    |s2 l abbrevFileName info clsName cls abbrev package cat numClassInstVars words w|
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3548
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3549
    anAbbrevFileStream isFileStream ifTrue:[
8846
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3550
        abbrevFileName := anAbbrevFileStream pathName.
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3551
        info := 'declared from: ', abbrevFileName.
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3552
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3553
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3554
    KnownPackages isNil ifTrue:[
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3555
        KnownPackages := Set new.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3556
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3557
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3558
    "/ yes, create any required nameSpace, without asking user.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3559
    Class createNameSpaceQuerySignal answer:true do:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3560
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3561
        [anAbbrevFileStream atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3562
            l := anAbbrevFileStream nextLine withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3563
            l notEmpty ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3564
                "/ must do it manually, caring for quoted strings.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3565
"/                words := line asCollectionOfWords.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3566
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3567
                words := OrderedCollection new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3568
                s2 := l readStream.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3569
                [s2 atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3570
                    s2 skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3571
                    s2 peek == $' ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3572
                        s2 next.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3573
                        w := s2 upTo:$'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3574
                        s2 skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3575
                    ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3576
                        w := s2 upToSeparator
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3577
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3578
                    words add:w
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3579
                ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3580
                words size < 3 ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3581
                    'Smalltalk [warning]: bad abbrev entry' errorPrint.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3582
                    anAbbrevFileStream isFileStream ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3583
                        ' (in ''' errorPrint. 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3584
                        anAbbrevFileStream pathName errorPrint.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3585
                        ''')' errorPrint
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3586
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3587
                    ': ' errorPrint. l errorPrintCR
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3588
                ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3589
                    clsName := (words at:1) asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3590
                    abbrev := (words at:2).
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3591
                    package := (words at:3) asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3592
                    cat := words at:4 ifAbsent:nil.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3593
                    numClassInstVars := words at:5 ifAbsent:'0'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3594
                    numClassInstVars := Integer readFrom:numClassInstVars onError:[0].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3595
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3596
"/                KnownPackages add:package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3597
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3598
                    (cat size == 0) ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3599
                        cat := 'autoloaded'
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3600
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3601
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3602
                    "/ on the fly, update the abbreviations
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3603
                    self setFilename:abbrev forClass:clsName package:package. 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3604
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3605
                    "/ '  autoloaded: ' print. clsName print. ' in ' print. cat printCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3606
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3607
                    cls := self 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3608
                        installAutoloadedClassNamed:clsName 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3609
                        category:cat 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3610
                        package:package 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3611
                        revision:nil 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3612
                        numClassInstVars:numClassInstVars.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3613
8847
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3614
"/                    info notNil ifTrue:[
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3615
"/                        cls setComment:info.
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3616
"/                    ].
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3617
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3618
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3619
        ]
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3620
    ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3621
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3622
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3623
loadBinaries
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3624
    "return true, if binaries should be loaded into the system,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3625
     false if this should be suppressed. The default is false (for now)."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3626
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3627
    ^ LoadBinaries
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3628
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3629
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3630
loadBinaries:aBoolean
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3631
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3632
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3633
    "turn on/off loading of binary objects"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3634
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3635
    aBoolean ifTrue:[
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3636
	(ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3637
	    LoadBinaries := true.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3638
	    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3639
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3640
	'Smalltalk [info]: this system does not support binary loading' infoPrintCR.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3641
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3642
    LoadBinaries := false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3643
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3644
    "Modified: 10.1.1997 / 15:11:00 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3645
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3646
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3647
logDoits
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3648
    "return true if doits should go into the changes file
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3649
     as well as changes - by default, this is off, since
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3650
     it can blow up the changes file enormously ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3651
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3652
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3653
    ^ LogDoits
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3654
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3655
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3656
     LogDoits := false
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3657
     LogDoits := true
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3658
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3659
!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3660
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3661
logDoits:aBoolean
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3662
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3663
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3664
    "turn on/off logging of doits in the changes file.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3665
     By default, this is off, since it can blow up the 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3666
     changes file enormously ...
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3667
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3668
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3669
    LogDoits := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3670
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3671
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3672
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3673
makeBytecodeMethods
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3674
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3675
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3676
    "walk over all methods and make each a bytecode method
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3677
     iff it does not contain primitive C code.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3678
     Experimental and not yet used."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3679
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3680
    Method allSubInstancesDo:[:aMethod |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3681
	|newMethod|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3682
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3683
	aMethod hasPrimitiveCode ifFalse:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3684
	    newMethod := aMethod asByteCodeMethod.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3685
	    newMethod ~~ aMethod ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3686
		aMethod becomeSameAs:newMethod
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3687
	    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3688
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3689
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3690
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3691
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3692
     Smalltalk makeBytecodeMethods
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3693
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3694
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3695
    "Modified: 16.1.1997 / 01:25:58 / cg"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3696
    "Created: 17.10.1997 / 13:52:19 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3697
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3698
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3699
recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3700
    "read all abbrev.stc files from and under aDirectory
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3701
     and install autoloaded classes.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3702
     If a file called NOAUTOLOAD is found, no classes there and below are installed as autoloaded
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3703
     (however, the directories are searched for packages)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3704
     If a file called NOPACKAGES is found, no further searching is done in that directory or below."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3705
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3706
    |abbrevStream dir noAutoloadHere dirName pkgName directoryContents|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3707
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3708
    maxLevels == 0 ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3709
"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3710
	^ self
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3711
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3712
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3713
    dir := aDirectory asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3714
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3715
    (dirsConsulted includes:dir pathName) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3716
	^ self
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3717
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3718
    dirsConsulted add:dir pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3719
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3720
    (dir construct:'NOPACKAGES') exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3721
	^ self.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3722
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3723
    (dir construct:'NOSUBAUTOLOAD') exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3724
	^ self.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3725
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3726
    noAutoloadHere := noAutoloadIn.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3727
    noAutoloadHere ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3728
	(dir construct:'NOAUTOLOAD') exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3729
	    noAutoloadHere := true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3730
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3731
    ] ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3732
	(dir construct:'AUTOLOAD') exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3733
	    noAutoloadHere := false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3734
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3735
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3736
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3737
    ((dir construct:'loadAll') exists
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3738
    or:[(dir construct:'abbrev.stc') exists
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3739
    or:[(dir construct:(dir baseName , '.prj')) exists]]) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3740
	KnownPackages isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3741
	    KnownPackages := Set new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3742
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3743
	dirName := dir pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3744
	pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3745
	KnownPackages add:pkgName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3746
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3747
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3748
    "/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3749
    "/ suppress installation as autoloaded in this and everything
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3750
    "/ below; however, still traverse the directories to find packages ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3751
    "/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3752
    noAutoloadHere ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3753
	[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3754
	    abbrevStream := (dir construct:'abbrev.stc') asFilename readStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3755
	    self installAutoloadedClassesFromStream:abbrevStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3756
	    abbrevStream close.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3757
	] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3758
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3759
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3760
    [
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3761
	directoryContents := dir directoryContents.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3762
    ] on:FileStream openErrorSignal do:[:ex|
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3763
	"non-accessable directory: we are done"
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3764
	^ self
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3765
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3766
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3767
    directoryContents do:[:aFilename |
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3768
	|f|
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3769
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3770
	(#(
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3771
	    'doc'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3772
	    'CVS'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3773
	    'bitmaps'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3774
	    'resources'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3775
	    'source'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3776
	) includes:aFilename) ifFalse:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3777
	    ((dir baseName ~= 'stx')
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3778
	    or:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3779
		(#(
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3780
		    'configurations'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3781
		    'include'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3782
		    'rules'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3783
		    'stc'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3784
		    'support'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3785
		) includes:aFilename) not]) 
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3786
	    ifTrue:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3787
		f := dir construct:aFilename.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3788
		f isDirectory ifTrue:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3789
		     self 
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3790
			recursiveInstallAutoloadedClassesFrom:f 
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3791
			rememberIn:dirsConsulted    
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3792
			maxLevels:maxLevels-1
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3793
			noAutoload:noAutoloadHere
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3794
			packageTop:packageTopPath.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3795
		]
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3796
	    ]
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3797
	].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3798
    ].
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3799
5117
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  3800
    "
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  3801
     Smalltalk installAutoloadedClasses
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  3802
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3803
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3804
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3805
replaceReferencesTo:anObject with:newRef
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3806
    |toAdd|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3807
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3808
    toAdd := OrderedCollection new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3809
    self keysAndValuesDo:[:key :val |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3810
	(key == anObject) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3811
	    self shouldImplement.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3812
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3813
	(val == anObject ) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3814
	    toAdd add:(key -> newRef)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3815
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3816
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3817
    toAdd do:[:each |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3818
	self at:(each key) put:(each value)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3819
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3820
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3821
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3822
saveEmergencyImage:aBoolean
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3823
    "set/clear the flag which controls if ST/X should save an
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3824
     emergency image in case of a broken display connection.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3825
     The default is true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3826
     This may be useful, if you work with an unsecure display
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3827
     (serial line), and want to have a chance of proceeding after
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3828
     a crash. In multiheaded applications, this only affects 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3829
     crashes of the master Display connection (the initial connection);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3830
     errors on other displays are reported to the views and treated
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3831
     like window destroy from the windowManager."
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  3832
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  3833
    SaveEmergencyImage := aBoolean
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  3834
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  3835
    "Modified: / 24.10.1997 / 18:22:26 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3836
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3837
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3838
systemOrganization
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3839
    "for partial ST80 compatibility;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3840
     In ST80, Smalltalk organization returns a systemOrganizer, which
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3841
     keeps track of class-categories, while all classes return a classOrganizer
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3842
     from #organization, which keeps track of method categories of that class.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3843
     Since in ST/X, Smalltalk is a class, there is now a conflict.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3844
     To make a workaround possible, use #systemOrganization when porting
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3845
     VW apps to ST/X to get the class-categories.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3846
     Read the documentation in SystemOrganizer for more info."
3626
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  3847
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  3848
    ^ SystemOrganizer for:nil
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  3849
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  3850
    "Created: / 20.6.1998 / 12:24:02 / cg"
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  3851
    "Modified: / 20.6.1998 / 12:41:34 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3852
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3853
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3854
!Smalltalk class methodsFor:'system management-fileIn'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3855
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3856
fileIn:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3857
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3858
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3859
     This method can load almost anything which makes sense:
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3860
	.st    - source files
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3861
	.cls   - binary smalltalk bytecode files
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3862
	.so    - binary compiled machine code class libraries
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3863
	[.class - java bytecode -- soon to come]"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3864
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3865
    ^ self fileIn:aFileName lazy:nil silent:nil logged:false 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3866
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3867
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3868
     Smalltalk fileIn:'source/TicTacToe.st'
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  3869
     Smalltalk fileIn:'binary/TicTacToe.cls'
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  3870
     Smalltalk fileIn:'binary/TicTacToe.so'
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3871
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3872
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3873
    "Created: 28.10.1995 / 17:06:28 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3874
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3875
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3876
fileIn:aFileName inPackage:aPackageID
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3877
    "read in the named file in a packages directory."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3878
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3879
    |dir|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3880
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3881
    dir := self getPackageDirectoryForPackage:aPackageID.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3882
    dir isNil ifTrue:[^ false].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3883
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3884
    dir := dir asFilename.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3885
    ^ (self fileIn:(dir construct:aFileName))
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3886
      or:[ self fileIn:((dir construct:'source') construct:aFileName) ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3887
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3888
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3889
fileIn:aFileName lazy:lazy
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3890
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3891
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3892
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3893
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3894
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3895
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3896
     code which is known to be syntactically correct."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3897
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3898
    ^ self fileIn:aFileName lazy:lazy silent:nil logged:false 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3899
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3900
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3901
     Smalltalk fileIn:'source/TicTacToe.st' lazy:true
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3902
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3903
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3904
    "Created: 28.10.1995 / 17:06:36 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3905
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3906
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3907
fileIn:aFileName lazy:lazy silent:silent
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3908
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3909
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3910
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3911
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3912
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3913
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3914
     code which is known to be syntactically correct.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3915
     If silent is true, no compiler messages are output to the transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3916
     Giving nil for silent/lazy will use the current settings."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3917
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3918
    ^ self fileIn:aFileName lazy:lazy silent:silent logged:false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3919
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3920
    "Created: 28.10.1995 / 17:06:41 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3921
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3922
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3923
fileIn:aFileNameOrString lazy:lazy silent:silent logged:logged
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3924
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3925
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3926
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3927
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3928
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3929
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3930
     code which is known to be syntactically correct.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3931
     If silent is true, no compiler messages are output to the transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3932
     Giving nil for silent/lazy will use the current settings.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3933
     This method can load almost anything which makes sense:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3934
	.st    - source files
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3935
	.cls   - binary smalltalk bytecode files
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3936
	.so    - binary compiled machine code class libraries
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3937
	[.class - java bytecode -- soon to come]"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3938
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3939
    |fileNameString aStream path morePath bos|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3940
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3941
    fileNameString := aFileNameOrString asString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3942
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3943
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3944
     an object or shared object ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3945
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3946
    (ObjectFileLoader notNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3947
    and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3948
	"/ LoadBinaries ifFalse:[^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3949
	path := self getBinaryFileName:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3950
	path isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3951
	    path := self getSystemFileName:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3952
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3953
	path isNil ifTrue:[^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3954
	^ (ObjectFileLoader loadObjectFile:path) notNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3955
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3956
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3957
    (fileNameString asFilename hasSuffix:'cls') ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3958
	BinaryObjectStorage notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3959
	    aStream := self systemFileStreamFor:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3960
"/            path := self getBinaryFileName:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3961
"/            path isNil ifTrue:[^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3962
"/            aStream := path asFilename readStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3963
	    aStream notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3964
		aStream binary.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3965
		bos := BinaryObjectStorage onOld:aStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3966
		bos next.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3967
		bos close.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3968
		^ true
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3969
	    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3970
	    ^ false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3971
	]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3972
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3973
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3974
    (fileNameString startsWith:'source/') ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3975
	aStream := self sourceFileStreamFor:(fileNameString copyFrom:8)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3976
    ] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3977
	(fileNameString startsWith:'fileIn/') ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3978
	    aStream := self fileInFileStreamFor:(fileNameString copyFrom:8)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3979
	] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3980
	    aStream := self systemFileStreamFor:fileNameString.
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3981
	    aStream isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3982
		OperatingSystem isUNIXlike ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3983
		    (fileNameString startsWith:'/') ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3984
			aStream := self systemFileStreamFor:('lib/' , fileNameString).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3985
		    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3986
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3987
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3988
	    (aStream notNil and:[fileNameString includes:$/]) ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3989
		"/ temporarily prepend the files directory
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3990
		"/ to the searchPath.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3991
		"/ This allows fileIn-driver files to refer to local
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3992
		"/ files via a relative path, and drivers to fileIn other
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3993
		"/ drivers ...
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3994
		morePath := aStream pathName asFilename directoryName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3995
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3996
	]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3997
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3998
    aStream isNil ifTrue:[^ false].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3999
    ^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4000
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4001
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4002
     Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4003
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4004
3952
05c36f8e87b4 fixed fileIn of byteCode (.cls) files
Claus Gittinger <cg@exept.de>
parents: 3915
diff changeset
  4005
    "Modified: / 16.2.1999 / 10:03:26 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4006
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4007
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4008
fileIn:aFileName logged:logged
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4009
    "read in the named file - look for it in some standard places;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4010
     return true if ok, false if failed.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4011
     The argument logged controls, if the changefile is to be updated."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4012
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4013
    ^ self fileIn:aFileName lazy:nil silent:nil logged:logged 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4014
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4015
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4016
     Smalltalk fileIn:'source/TicTacToe.st' logged:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4017
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4018
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4019
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4020
fileInChanges
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4021
    "read in the last changes file - bringing the system to the state it
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4022
     had when left the last time.
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4023
     WARNING: this method is rubbish: it should only read things after the
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4024
	      last '**snapshot**' - entry 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4025
	      (instead of the complete changes file)."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  4026
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4027
    "
400
claus
parents: 396
diff changeset
  4028
     do NOT update the changes file now ...
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4029
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4030
    self fileIn:ChangeFileName logged:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4031
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4032
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4033
     Smalltalk fileInChanges 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4034
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4035
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  4036
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4037
fileInClass:aClassName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4038
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4039
     search is in some standard places trying driver-file (.ld), object-file (.o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4040
     finally source file (.st) in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4041
     The file is first searched for using the class name, then the abbreviated name."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4042
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4043
    ^ self 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4044
	fileInClass:aClassName 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4045
	package:nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4046
	initialize:true 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4047
	lazy:false 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4048
	silent:nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4049
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4050
    "Modified: / 9.1.1998 / 14:41:46 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4051
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4052
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4053
fileInClass:aClassName fromObject:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4054
    "read in the named object file and dynamic-link it into the system
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4055
     - look for it in some standard places.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4056
     Only install the named class from this object file.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4057
     Return true if ok, false if failed."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4058
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4059
    |path ok|
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4060
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4061
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4062
     check if the dynamic loader class is in
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4063
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4064
    (LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4065
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4066
    (path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4067
    ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4068
    ok ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4069
	SilentLoading ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4070
	    Transcript show:'  loaded ' , aClassName , ' from ' ; showCR:aFileName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4071
	]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4072
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4073
    ^ ok
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4074
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4075
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4076
     Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4077
     Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4078
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4079
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4080
    "Modified: 10.9.1996 / 20:43:52 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4081
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4082
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4083
fileInClass:aClassName initialize:doInit
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4084
    "find a source/object file for aClassName and -if found - load it.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4085
     search is in some standard places trying driver-file (.ld), object-file (.o) and 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4086
     finally source file (.st) in that order.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4087
     The file is first searched for using the class name, then the abbreviated name."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4088
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4089
    ^ self 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4090
	fileInClass:aClassName 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4091
	package:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4092
	initialize:doInit 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4093
	lazy:false 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4094
	silent:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4095
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4096
    "Modified: / 9.1.1998 / 14:42:02 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4097
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4098
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4099
fileInClass:aClassName initialize:doInit lazy:loadLazy
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4100
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4101
     search is in some standard places trying driver-file (.ld), object-file (.o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4102
     finally source file (.st) in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4103
     The file is first searched for using the class name, then the abbreviated name."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4104
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4105
     ^ self 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4106
	fileInClass:aClassName 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4107
	package:nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4108
	initialize:doInit 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4109
	lazy:loadLazy 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4110
	silent:nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4111
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4112
    "Modified: / 9.1.1998 / 14:42:19 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4113
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4114
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4115
fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent 
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4116
    "find a source/object file for aClassName and -if found - load it.
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4117
     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and 
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4118
     finally source file (.st), in that order.
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4119
     The file is first searched for using the class name, then the abbreviated name.
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4120
     The argument doInit controlls if the class should be sent a #initialize after the
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4121
     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4122
     should not send notes to the transcript; it can be true, false or nil, where
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4123
     nil uses the value from SilentLoading."
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4124
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4125
    ^ self
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4126
	fileInClass:aClassName 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4127
	package:nil
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4128
	initialize:doInit 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4129
	lazy:loadLazy 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4130
	silent:beSilent
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4131
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4132
    "Modified: / 9.1.1998 / 14:42:28 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4133
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4134
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4135
fileInClass:aClassName package:package initialize:doInit lazy:loadLazy silent:beSilent 
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4136
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4137
     This is the workhorse for autoloading.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4138
     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4139
     finally source file (.st), in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4140
     The file is first searched for using the class name, then the abbreviated name.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4141
     The argument doInit controlls if the class should be sent a #initialize after the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4142
     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4143
     should not send notes to the transcript; it can be true, false or nil, where
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4144
     nil uses the value from SilentLoading."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4145
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4146
    |classFileName alternativeClassFileName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr 
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4147
     fn packageDir packageFile bos|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4148
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4149
    wasLazy := Compiler compileLazy:loadLazy.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4150
    beSilent notNil ifTrue:[
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4151
        wasSilent := self silentLoading:beSilent.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4152
    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4153
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4154
    classFileName := Smalltalk fileNameForClass:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4155
    (classFileName = aClassName) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4156
        "/ no abbrev.stc translation for className 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4157
        (aClassName includes:$:) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4158
            "/ a nameSpace name
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4159
            alternativeClassFileName := classFileName copyFrom:(classFileName lastIndexOf:$:)+1
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4160
        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4161
    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4162
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4163
    classFileName := classFileName copyReplaceAll:$: with:$_.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4164
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4165
    [
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4166
        Class withoutUpdatingChangesDo:
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4167
        [
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4168
            |zarFn zar entry|
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4169
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4170
            ok := false.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4171
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4172
            package notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4173
                packageDir := package asString.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4174
                packageDir := packageDir copyReplaceAll:$: with:$/.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4175
            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4176
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4177
            Class packageQuerySignal answer:package
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4178
            do:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4179
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4180
                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4181
                 first, look for a loader-driver file (in fileIn/xxx.ld)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4182
                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4183
                (ok := self fileIn:('fileIn/' , classFileName , '.ld') lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4184
                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4185
                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4186
                     try abbreviated driver-file (in fileIn/xxx.ld)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4187
                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4188
                    alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4189
                        ok := self fileIn:('fileIn/' , alternativeClassFileName , '.ld') lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4190
                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4191
                    ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4192
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4193
                         then, if dynamic linking is available, 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4194
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4195
                        (LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4196
                            sharedLibExtension := ObjectFileLoader sharedLibraryExtension.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4197
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4198
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4199
                             first look for a class packages shared binary in binary/xxx.o
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4200
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4201
                            libName := self libraryFileNameOfClass:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4202
                            libName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4203
                                (ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4204
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4205
                                    sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4206
                                        ok := self fileInClass:aClassName fromObject:(libName, '.o')
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4207
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4208
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4209
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4210
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4211
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4212
                             then, look for a shared binary in binary/xxx.o
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4213
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4214
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4215
                                (ok := self fileInClass:aClassName fromObject:(classFileName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4216
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4217
                                    sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4218
                                        ok := self fileInClass:aClassName fromObject:(classFileName, '.o')
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4219
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4220
                                    ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4221
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4222
                                            (ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4223
                                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4224
                                                sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4225
                                                    ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, '.o')
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4226
                                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4227
                                            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4228
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4229
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4230
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4231
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4232
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4233
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4234
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4235
                         if that did not work, look for a compiled-bytecode file ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4236
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4237
                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4238
                            (ok := self fileIn:(classFileName , '.cls') lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4239
                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4240
                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4241
                                    ok := self fileIn:(alternativeClassFileName , '.cls') lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4242
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4243
                            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4244
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4245
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4246
                         if that did not work, and the classes package is known,
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4247
                         look for an st-cls file 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4248
                         in a package subdir of the source-directory ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4249
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4250
                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4251
                            (packageDir notNil and:[BinaryObjectStorage notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4252
                                packageFile := self getPackageFileName:(packageDir , '/classes/' , classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4253
                                packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4254
                                    packageFile := (packageDir , '/classes/' , classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4255
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4256
                                (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4257
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4258
                                    alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4259
                                        packageFile := self getPackageFileName:(packageDir , '/classes/' , alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4260
                                        packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4261
                                            packageFile := (packageDir , '/classes/' , alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4262
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4263
                                        ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4264
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4265
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4266
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4267
                                zarFn := self getPackageFileName:(packageDir , '/classes.zip').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4268
                                zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4269
                                    zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4270
                                    zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4271
                                        entry := zar extract:(classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4272
                                        (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4273
                                            entry := zar extract:(alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4274
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4275
                                        entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4276
                                            bos := BinaryObjectStorage onOld:(entry asByteArray readStream).
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4277
                                            bos next.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4278
                                            bos close.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4279
                                            ok := true
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4280
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4281
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4282
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4283
                            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4284
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4285
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4286
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4287
                         if that did not work, look for an st-source file ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4288
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4289
                        ok ifFalse:[                   
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4290
                            fn := classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4291
                            (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4292
                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4293
                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4294
                                    fn := alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4295
                                    ok := self fileIn:fn lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4296
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4297
                                ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4298
                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4299
                                     ... and in the standard source-directory
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4300
                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4301
                                    fn := 'source/' , classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4302
                                    (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4303
                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4304
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4305
                                            fn := 'source/' , alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4306
                                            ok := self fileIn:fn lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4307
                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4308
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4309
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4310
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4311
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4312
                             if that did not work, and the classes package is known,
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4313
                             look for an st-source file 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4314
                             in a package subdir of the source-directory ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4315
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4316
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4317
                                packageDir notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4318
                                    packageFile := self getPackageFileName:(packageDir , '/source/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4319
                                    packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4320
                                        packageFile := (packageDir , '/source/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4321
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4322
                                    fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4323
                                    (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4324
                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4325
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4326
                                            packageFile := self getPackageFileName:(packageDir , '/source/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4327
                                            packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4328
                                                packageFile := (packageDir , '/source/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4329
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4330
                                            fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4331
                                            ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4332
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4333
                                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4334
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4335
                                            packageFile := self getPackageFileName:(packageDir , '/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4336
                                            packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4337
                                                packageFile := (packageDir , '/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4338
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4339
                                            fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4340
                                            (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4341
                                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4342
                                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4343
                                                    packageFile := self getPackageFileName:(packageDir , '/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4344
                                                    packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4345
                                                        packageFile := (packageDir , '/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4346
                                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4347
                                                    fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4348
                                                    ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4349
                                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4350
                                                ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4351
                                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4352
                                                     ... and in the standard source-directory
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4353
                                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4354
                                                    fn := 'source/' , packageDir , '/' , classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4355
                                                    (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4356
                                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4357
                                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4358
                                                            fn := 'source/' , packageDir , '/' , alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4359
                                                            ok := self fileIn:fn lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4360
                                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4361
                                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4362
                                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4363
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4364
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4365
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4366
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4367
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4368
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4369
                             if that did not work, and the classes package is known,
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4370
                             look for a zipArchive containing a class entry.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4371
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4372
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4373
                                packageDir notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4374
                                    zarFn := self getPackageFileName:(packageDir , '/source.zip').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4375
                                    zarFn isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4376
                                        zarFn := packageDir asFilename withSuffix:'zip'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4377
                                        zarFn := self getSourceFileName:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4378
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4379
                                    zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4380
                                        zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4381
                                        zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4382
                                            entry := zar extract:(classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4383
                                            (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4384
                                                entry := zar extract:(alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4385
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4386
                                            entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4387
                                                fn := zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4388
                                                ok := self 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4389
                                                        fileInStream:(entry asString readStream)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4390
                                                        lazy:loadLazy 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4391
                                                        silent:beSilent 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4392
                                                        logged:false
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4393
                                                        addPath:nil
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4394
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4395
                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4396
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4397
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4398
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4399
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4400
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4401
                             if that did not work, 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4402
                             look for a zipArchive containing a class entry.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4403
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4404
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4405
                                zarFn := self getSourceFileName:'source.zip'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4406
                                zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4407
                                    zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4408
                                    zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4409
                                        entry := zar extract:(zarFn := classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4410
                                        (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4411
                                            entry := zar extract:(zarFn := alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4412
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4413
                                        entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4414
                                            fn := zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4415
                                            ok := self 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4416
                                                    fileInStream:(entry asString readStream)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4417
                                                    lazy:loadLazy 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4418
                                                    silent:beSilent 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4419
                                                    logged:false
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4420
                                                    addPath:nil
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4421
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4422
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4423
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4424
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4425
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4426
                                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4427
                                 new: if there is a sourceCodeManager, ask it for the classes sourceCode
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4428
                                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4429
                                (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4430
                                    inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4431
                                    inStream notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4432
                                        fn := nil.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4433
                                        ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil. 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4434
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4435
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4436
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4437
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4438
                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4439
                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4440
            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4441
        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4442
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4443
        ok ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4444
            newClass := self at:(aClassName asSymbol).
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4445
            newClass notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4446
                fn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4447
                    newClass classFilename isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4448
                        newClass setClassFilename:fn
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4449
                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4450
                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4451
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4452
                doInit ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4453
                    newClass initialize
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4454
                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4455
            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4456
        ].
6421
58dca33cf0fc #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 6403
diff changeset
  4457
    ] ensure:[
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4458
        Compiler compileLazy:wasLazy. 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4459
        wasSilent notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4460
            self silentLoading:wasSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4461
        ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4462
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4463
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4464
    ^ newClass
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4465
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4466
    "Created: / 9.1.1998 / 14:40:32 / cg"
4277
74196836e8df oops - care for module-prefix when filing in
Claus Gittinger <cg@exept.de>
parents: 4150
diff changeset
  4467
    "Modified: / 5.6.1999 / 14:53:01 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4468
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4469
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4470
fileInClassLibrary:aClassLibraryName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4471
    "find an object file containing a binary class library in some standard places
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4472
     and load it. This install all of its contained classes.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4473
     Return true if ok, false if not.
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4474
     Notice: the argument may not have an extension (by purpose);
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4475
	     the sharedLib extension (.dll / .so / .sl) is added here, to
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4476
	     make the caller independent of the underlying operatingSystem."
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4477
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4478
    |path fn|
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4479
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4480
    ObjectFileLoader isNil ifTrue:[^ false].
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4481
6837
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4482
    fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
6836
11fd536a8e02 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6819
diff changeset
  4483
    fn := fn pathName.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4484
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4485
    path := self getBinaryFileName:fn.
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4486
    path isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4487
	path := self getSystemFileName:fn.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4488
    ].
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4489
    path isNil ifTrue:[^ false].
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4490
4714
5da464c01bfd Fix #fileInClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 4712
diff changeset
  4491
    ^ (ObjectFileLoader loadObjectFile:path) notNil
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4492
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4493
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4494
     Smalltalk fileInClassLibrary:'libtable'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4495
     Smalltalk fileInClassLibrary:'binary/libwidg3'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4496
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4497
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4498
    "Modified: 8.1.1997 / 17:58:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4499
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4500
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4501
fileInClassLibrary:aClassLibraryName inPackage:packageID
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4502
    "find an object file containing a binary class library in some standard places
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4503
     and load it. This install all of its contained classes.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4504
     Return true if ok, false if not.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4505
     Notice: the argument may not have an extension (by purpose);
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4506
	     the sharedLib extension (.dll / .so / .sl) is added here, to
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4507
	     make the caller independent of the underlying operatingSystem."
6025
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4508
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4509
    |path fn|
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4510
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4511
    ObjectFileLoader isNil ifTrue:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4512
6837
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4513
    fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4514
    fn := fn pathName.
6025
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4515
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4516
    path := self getPackageDirectoryForPackage:packageID.
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4517
    path isNil ifTrue:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4518
    path := path asFilename construct:fn.
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4519
    path exists ifFalse:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4520
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4521
    ^ (ObjectFileLoader loadObjectFile:path pathName) notNil
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4522
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4523
    "
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4524
     Smalltalk fileInClassLibrary:'libtable'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4525
     Smalltalk fileInClassLibrary:'binary/libwidg3'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4526
     Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4527
    "
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4528
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4529
    "Modified: 8.1.1997 / 17:58:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4530
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4531
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4532
fileInStream:streamArg
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4533
    ^ self fileInStream:streamArg lazy:nil silent:nil logged:false addPath:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4534
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4535
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4536
fileInStream:streamArg lazy:lazy silent:silent logged:logged addPath:morePath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4537
    "read sourceCode from aStream;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4538
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4539
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4540
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4541
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4542
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4543
     code which is known to be syntactically correct.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4544
     If silent is true, no compiler messages are output to the transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4545
     Giving nil for silent/lazy will use the current settings.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4546
     If morePath is nonNil, it is prepended to the systemPath temporarily during the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4547
     fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4548
     using a relative path."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4549
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4550
    |inStream decoder wasLazy wasSilent oldSystemPath oldRealPath encoding|
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4551
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4552
    inStream := streamArg.
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4553
    inStream isNil ifTrue:[^ false].
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4554
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8695
diff changeset
  4555
    encoding := CharacterEncoder guessEncodingOfStream:inStream.
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4556
    encoding notNil ifTrue:[
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4557
        decoder := CharacterEncoder encoderFor:encoding.
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4558
        inStream := EncodedStream stream:inStream encoder:decoder.
8712
bcef3a0c0a1d skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  4559
        inStream skipEncodingChunk.
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4560
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4561
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4562
    lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4563
    silent notNil ifTrue:[wasSilent := self silentLoading:silent].
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4564
    morePath notNil ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4565
        oldSystemPath := SystemPath copy.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4566
        SystemPath addFirst:morePath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4567
        oldRealPath := RealSystemPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4568
        RealSystemPath := nil.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4569
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4570
    [
8695
8240c22db37b Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 8675
diff changeset
  4571
        (Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[
8240c22db37b Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 8675
diff changeset
  4572
            inStream fileIn.
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4573
        ]
6421
58dca33cf0fc #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 6403
diff changeset
  4574
    ] ensure:[
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4575
        morePath notNil ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4576
            "take care, someone could have changed SystemPath during fileIn!!"
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4577
            (SystemPath copyFrom:2) = oldSystemPath ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4578
                SystemPath := oldSystemPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4579
                RealSystemPath := oldRealPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4580
            ] ifFalse:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4581
                (oldSystemPath includes:morePath) ifFalse:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4582
                    SystemPath remove:morePath ifAbsent:[].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4583
                ].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4584
                RealSystemPath := nil.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4585
            ].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4586
        ].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4587
        lazy notNil ifTrue:[Compiler compileLazy:wasLazy]. 
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4588
        silent notNil ifTrue:[self silentLoading:wasSilent].
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4589
        inStream close
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4590
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4591
    ^ true
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4592
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4593
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4594
     Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4595
    "
1896
71760df55ce5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  4596
71760df55ce5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  4597
    "Modified: 5.11.1996 / 20:03:35 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4598
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4599
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4600
isClassLibraryLoaded:name
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4601
    "return true, if a particular class library is already loaded"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4602
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4603
    ObjectMemory 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4604
	binaryModuleInfo 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4605
	    do:[:entry | 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4606
		   entry type == #classLibrary ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4607
		       entry libraryName = name ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4608
			  ^ true        "/ already loaded
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4609
		       ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4610
		   ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4611
	       ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4612
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4613
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4614
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4615
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4616
     Smalltalk isClassLibraryLoaded:'libbasic'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4617
     Smalltalk isClassLibraryLoaded:'libwidg3'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4618
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4619
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4620
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4621
loadClassLibraryIfAbsent:name
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4622
    "dynamically load a classLibrary, if not already loaded
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4623
     and the system supports dynamic loading.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4624
     Return true, if the library is loaded, false if not.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4625
     This entry is called without system specific filename
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4626
     extensions - it is portable among different architectures
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4627
     as long as corresponding files (x.so / x.dll / x.sl / x.o) 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4628
     are be present ..."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4629
5881
81a349eab73c added #isClassLibraryLoaded:
Claus Gittinger <cg@exept.de>
parents: 5878
diff changeset
  4630
    (self isClassLibraryLoaded:name) ifTrue:[ ^ true ].  "/ already loaded
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4631
    ^ self fileInClassLibrary:name
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4632
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4633
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4634
     Smalltalk loadClassLibraryIfAbsent:'libbasic'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4635
     Smalltalk loadClassLibraryIfAbsent:'libwidg3'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4636
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4637
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4638
    "Modified: 31.10.1996 / 16:57:24 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4639
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4640
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4641
secureFileIn:aFileName 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4642
    "read in the named file, looking for it at standard places.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4643
     Catch any error during fileIn. Return true if ok, false if failed"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4644
    
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4645
    |retVal|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4646
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4647
    retVal := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4648
    (SignalSet with:AbortOperationRequest with:TerminateProcessRequest) 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4649
        handle:[:ex | ex return ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4650
        do:[ retVal := self fileIn:aFileName ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4651
    ^ retVal
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4652
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4653
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4654
silentFileIn:aFilename
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4655
    "same as fileIn:, but do not output 'compiled...'-messages on Transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4656
     Main use is during startup."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4657
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4658
    |wasSilent|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4659
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4660
    wasSilent := self silentLoading:true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4661
    [
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4662
	self fileIn:aFilename
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4663
    ] ensure:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4664
	self silentLoading:wasSilent
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4665
    ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4666
! !
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4667
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4668
!Smalltalk class methodsFor:'system management-files'!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4669
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4670
bitmapFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4671
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4672
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4673
     Searches in subdirectories named 'bitmaps' in the SystemPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4674
     Notice: this does not look in the package-specific bitmaps directories."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4675
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4676
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4677
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4678
    aString := self getBitmapFileName:aFileName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4679
    aString notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4680
	^ aString asFilename readStreamOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4681
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4682
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4683
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4684
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4685
bitmapFromFileNamed:aFileName forClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4686
    "search aFileName in some standard places:
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4687
     first in the redefinable bitmaps path, 
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4688
     then in the classes own package directory if existing.
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4689
     Return an image or nil."
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4690
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4691
    ^ self imageFromFileNamed:aFileName inPackage:(aClass package)
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4692
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4693
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4694
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' forClass:View
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4695
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4696
!
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4697
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4698
bitmapFromFileNamed:aFileName inPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4699
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4700
     first in the redefinable bitmaps path, 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4701
     then in the package directory if existing.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4702
     Return an image or nil."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4703
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4704
    ^ self imageFromFileNamed:aFileName inPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4705
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4706
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4707
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4708
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4709
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4710
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4711
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4712
classNameForFile:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4713
    "return the className which corresponds to an abbreviated fileName,
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4714
     or nil if no special translation applies. The given filename arg may
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4715
     include a '.st' suffix (but no other)."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4716
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4717
    |fn|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4718
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4719
    (aFileName asFilename hasSuffix:'st') ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4720
	fn := aFileName copyWithoutLast:3
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4721
    ] ifFalse:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4722
	fn := aFileName
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4723
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4724
    ^ self filenameAbbreviations keyAtEqualValue:fn ifAbsent:[fn].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4725
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4726
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4727
     Smalltalk classNameForFile:'DrawObj'  
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4728
     Smalltalk classNameForFile:'DrawObj.st' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4729
     Smalltalk classNameForFile:'ArrColl.st' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4730
     Smalltalk classNameForFile:'ArrColl.chg' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4731
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4732
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4733
    "Modified: 11.12.1995 / 14:51:10 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4734
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4735
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4736
constructPathFor:aDirectoryName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4737
    "search for aDirectory in SystemPath; 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4738
     return a collection of pathes which include that directory."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4739
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4740
    ^ self realSystemPath select:[:dirName |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4741
	|fullPath|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4742
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4743
	fullPath := dirName asFilename construct:aDirectoryName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4744
	"/ fullPath exists and:[fullPath isDirectory and:[fullPath isReadable]]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4745
	fullPath isDirectory and:[fullPath isReadable]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4746
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4747
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4748
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4749
fileInFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4750
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4751
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4752
     Searches in subdirectories named 'fileIn' in SystemPath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4753
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4754
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4755
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4756
    aString := self getFileInFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4757
    aString notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4758
	^ aString asFilename readStreamOrNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4759
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4760
    ^ nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4761
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4762
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4763
fileNameForClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4764
    "return a filename for aClassOrClassName"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4765
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4766
    |cls nm1 nm2|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4767
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4768
    aClassOrClassName isBehavior ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4769
        nm1 := aClassOrClassName theNonMetaclass name.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4770
        nm2 := aClassOrClassName theNonMetaclass nameWithoutPrefix.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4771
    ] ifFalse:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4772
        cls := Smalltalk classNamed:aClassOrClassName.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4773
        cls notNil ifTrue:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4774
            nm1 := cls theNonMetaclass name.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4775
            nm2 := cls theNonMetaclass nameWithoutPrefix.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4776
        ] ifFalse:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4777
            nm1 := aClassOrClassName.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4778
            nm2 := (aClassOrClassName copyFrom:(aClassOrClassName lastIndexOf:$:)+1).
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4779
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4780
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4781
    nm1 := nm1 asSymbol.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4782
    nm2 := nm2 asSymbol.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4783
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4784
    CachedAbbreviations notNil ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4785
        (CachedAbbreviations includesKey:nm1) ifTrue:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4786
            ^ CachedAbbreviations at:nm1
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4787
        ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4788
        (CachedAbbreviations includesKey:nm2) ifTrue:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4789
            ^ CachedAbbreviations at:nm2
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4790
        ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4791
    ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4792
    ^ nm1 copyReplaceAll:$: with:$_
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4793
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4794
    "
7723
ed4ce2184b37 Fix #filenameForClass: handling of abbreviations
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  4795
     Smalltalk fileNameForClass:#Complex    
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4796
     Smalltalk fileNameForClass:'SmallInteger'    
3678
606bf9fca8f2 infoPrint.
Claus Gittinger <cg@exept.de>
parents: 3627
diff changeset
  4797
     Smalltalk fileNameForClass:'UnixOperatingSystem' 
4746
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  4798
     Smalltalk fileNameForClass:'Launcher'        
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4799
     Smalltalk fileNameForClass:'SomeUnknownClass' 
4746
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  4800
     Smalltalk fileNameForClass:OSI::FTAMOperation 
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  4801
     Smalltalk fileNameForClass:'OSI::Foobar' 
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4802
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4803
6151
e36a9b339582 isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6121
diff changeset
  4804
    "Modified: / 5.11.2001 / 16:49:17 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4805
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4806
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4807
filenameAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4808
    "return a dictionary containing the classname-to-filename
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4809
     mappings. (needed for sys5.3 users, where filenames are limited
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4810
     to 14 chars)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4811
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4812
    CachedAbbreviations isNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4813
	self readAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4814
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4815
    ^ CachedAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4816
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4817
    "flush with:
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4818
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4819
     CachedAbbreviations := nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4820
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4821
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4822
     Smalltalk filenameAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4823
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4824
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4825
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4826
flushPathCaches
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4827
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4828
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4829
    "forget pathCaches - these are collections containing valid directory names,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4830
     where system files (resource, bitmaps etc.) are found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4831
     A flush is only required, if a new system directory has been created while
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4832
     the system is active, and those files should override the others
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4833
     (for example, if you created a private resource directory)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4834
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4835
    RealSystemPath := ResourcePath := SourcePath := 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4836
    BitmapPath := BinaryPath := FileInPath := nil
2378
e76870d427ee commentary
ca
parents: 2374
diff changeset
  4837
e76870d427ee commentary
ca
parents: 2374
diff changeset
  4838
    "
e76870d427ee commentary
ca
parents: 2374
diff changeset
  4839
     Smalltalk flushPathCaches
e76870d427ee commentary
ca
parents: 2374
diff changeset
  4840
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4841
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4842
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4843
getBinaryFileName:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4844
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4845
     (subdirectories named 'binary' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4846
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4847
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4848
    BinaryPath isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4849
	BinaryPath := self constructPathFor:BinaryDirName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4850
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4851
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
  4852
    ^ self searchPath:BinaryPath for:aFileName in:BinaryDirName
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4853
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4854
    "Modified: 18.7.1996 / 15:53:49 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  4855
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  4856
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4857
getBitmapFileName:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4858
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4859
     (subdirectories named 'bitmaps' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4860
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4861
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4862
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4863
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4864
    BitmapPath isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4865
	BitmapPath := self constructPathFor:BitmapDirName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4866
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4867
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4868
    "/ first, try a bitmaps subdir along the path.
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4869
    f := self searchPath:BitmapPath for:aFileName in:BitmapDirName.
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4870
    f isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4871
	"/ then, try it itself along the path.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4872
	f := self searchPath:self realSystemPath for:aFileName in:nil
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4873
    ].
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4874
    ^ f
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4875
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4876
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4877
     Smalltalk getBitmapFileName:'SBrowser.xbm'
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4878
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4879
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4880
    "Modified: 18.7.1996 / 15:53:55 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4881
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4882
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4883
getFileInFileName:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4884
    "search aFileName in some standard places 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4885
     (subdirectories named 'fileIn' in SystemPath);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4886
     return the absolute filename or nil if none is found."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4887
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4888
    FileInPath isNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4889
	FileInPath := self constructPathFor:FileInDirName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4890
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4891
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4892
    ^ self searchPath:FileInPath for:aFileName in:FileInDirName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4893
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4894
    "Modified: 18.7.1996 / 15:53:59 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4895
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4896
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4897
getPackageDirectoryForPackage:aPackageID
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4898
    "search for a particular package; return its directory, or nil"
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4899
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4900
    |packageDir|
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4901
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4902
    packageDir := aPackageID copyReplaceAll:$: with:$/.
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4903
    self packagePath do:[:aPath |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4904
	|dir|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4905
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4906
	dir := aPath asFilename construct:packageDir.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4907
	(dir exists and:[dir isDirectory]) ifTrue:[^ dir].
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4908
    ].
5785
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  4909
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  4910
    "/ not found - special case for the stx package ...
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  4911
    (aPackageID upTo:$:) = 'stx' ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4912
	packageDir :=  aPackageID copyFrom:(aPackageID indexOf:$:) + 1.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4913
	packageDir := '../../' ,  packageDir.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4914
	packageDir := packageDir asFilename.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4915
	(packageDir exists and:[packageDir isDirectory]) ifTrue:[^ packageDir].
5785
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  4916
    ].
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4917
    ^ nil
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4918
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4919
    "
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4920
     Smalltalk getPackageDirectoryForPackage:(Array package)
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4921
     Smalltalk getPackageDirectoryForPackage:'stx:goodies/bitmaps'
5785
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  4922
     Smalltalk getPackageDirectoryForPackage:'stx:libview'
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4923
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4924
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4925
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4926
getPackageFileName:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4927
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4928
     (packagePath and subdirectories named 'packages' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4929
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4930
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4931
    |f|
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4932
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4933
    "/ search along packagePath ...
5052
31a76937dec2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5051
diff changeset
  4934
    f := self searchPath:self packagePath for:aFileName in:nil.
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4935
    f isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4936
	"/ search under packages-directory along systemPath ...
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4937
	f := self searchPath:self realSystemPath for:aFileName in:PackageDirName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4938
	"/ kludge - allow for stx-directory to be named differently
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4939
	f isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4940
	    (aFileName startsWith:'stx') ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4941
		(aFileName startsWith:'stx' , Filename separator) ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4942
		    f := '../..' asFilename construct:(aFileName copyFrom:5).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4943
		    f exists ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4944
			^ f pathName
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4945
		    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4946
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4947
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4948
	].
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4949
    ].
5878
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  4950
    (f notNil and:[(f := f asFilename) exists]) ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4951
	^ f pathName
5878
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  4952
    ].
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  4953
    ^ nil
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4954
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4955
    "
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4956
     Smalltalk getPackageFileName:'stx/libview/resources/normal.style'  
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4957
     Smalltalk getPackageFileName:'stx/libview/source.zip'    
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4958
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4959
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4960
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4961
getResourceFileName:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4962
    "search aFileName in some standard places 
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  4963
     (subdirectories named 'resources' in SystemPath);
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4964
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4965
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4966
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4967
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4968
    ResourcePath isNil ifTrue:[
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  4969
        ResourcePath := self constructPathFor:ResourceDirName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4970
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4971
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4972
    "/ first, try a resource subdir along the path.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4973
    f := self searchPath:ResourcePath for:aFileName in:ResourceDirName.
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4974
    f isNil ifTrue:[
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  4975
        "/ then, try it itself along the path.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  4976
        f := self searchPath:self realSystemPath for:aFileName in:nil
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4977
    ].
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4978
    ^ f
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4979
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4980
    "
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4981
     Smalltalk getResourceFileName:'SystemBrowser.rs'
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4982
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4983
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4984
    "Modified: 18.7.1996 / 15:54:03 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4985
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4986
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4987
getResourceFileName:aFileName forClass:aClassOrNil
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  4988
    "search aFileName in some standard places 
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4989
     (subdirectories named 'resource' in SystemPath);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4990
     and in aClasses package directory.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4991
     Return the absolute filename or nil if none is found."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4992
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4993
    |pkgOrNil|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4994
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4995
    aClassOrNil notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4996
	pkgOrNil := aClassOrNil package.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4997
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4998
    ^ self getResourceFileName:aFileName forPackage:pkgOrNil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4999
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5000
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5001
     Smalltalk getResourceFileName:'SystemBrowser.rs' forClass:SystemBrowser
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5002
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5003
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5004
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5005
getResourceFileName:aFileName forPackage:aPackageIDOrNil
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5006
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5007
     (subdirectories named 'resource' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5008
     and in a packages directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5009
     Return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5010
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5011
    |f dir packageDir|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5012
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5013
    f := self getResourceFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5014
    f notNil ifTrue:[^ f].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5015
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5016
    aPackageIDOrNil isNil ifTrue:[ ^ nil].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5017
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5018
    packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5019
    self packagePath do:[:aPath |
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5020
        |pD|
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5021
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5022
        pD := aPath asFilename construct:packageDir.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5023
        pD exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5024
            f := pD construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5025
            f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5026
                ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5027
            ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5028
            f := (pD construct:'resources') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5029
            f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5030
                ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5031
            ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5032
        ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5033
    ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5034
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5035
    dir := Smalltalk getPackageDirectoryForPackage:(aPackageIDOrNil ? 'stx:libview').
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5036
    dir notNil ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5037
        f := (dir asFilename construct:'resources') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5038
        f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5039
            ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5040
        ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5041
        f := (dir asFilename construct:'styles') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5042
        f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5043
            ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5044
        ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5045
    ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5046
8951
7cabfee1b791 resource file search
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
  5047
    ^ self searchPath:ResourcePath for:aFileName in:('resources/',packageDir).
5043
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5048
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5049
    "
5065
a7ae2d968496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5064
diff changeset
  5050
     Smalltalk getResourceFileName:'SystemBrowser.rs' forPackage:'stx:libtool'
5080
b600259b45b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
  5051
     Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5052
     Smalltalk getResourceFileName:'Foo.rs' forPackage:'stx:libview'
5043
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5053
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5054
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5055
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5056
getSourceFileName:aFileName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  5057
    "search aFileName in some standard places 
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  5058
     (subdirectories named 'source' in SystemPath);
736
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5059
     return the absolute filename or nil if none is found.
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5060
     This is used to find a sourceFile for a methods source,
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5061
     if no sourceCodeManager is available."
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5062
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5063
    |f|
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5064
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5065
    SourcePath isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5066
	SourcePath := self constructPathFor:SourceDirName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5067
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5068
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5069
    "/ first, try a source subdir along the path.
4770
9a6dcf673683 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4761
diff changeset
  5070
    SourcePath notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5071
	f := self searchPath:SourcePath for:aFileName in:SourceDirName.
4770
9a6dcf673683 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4761
diff changeset
  5072
    ].
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5073
    f isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5074
	"/ then, try it itself along the path.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5075
	f := self searchPath:self realSystemPath for:aFileName in:nil
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5076
    ].
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5077
    ^ f
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5078
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5079
    "
736
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5080
     Smalltalk getSourceFileName:'Smalltalk.st'  
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5081
     Smalltalk getSourceFileName:'ArrColl.st' 
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5082
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5083
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5084
    "Modified: 18.7.1996 / 15:54:07 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5085
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5086
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5087
getSystemFileName:aFileNameOrString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5088
    "search aFileNameOrString in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5089
     return the absolute filename or nil if none is found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5090
     see comment in Smalltalk>>initSystemPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5091
     This should be used to access resources such as bitmaps, doc-files,
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5092
     and other help files.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5093
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5094
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5095
    "credits for this method go to Markus ...."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5096
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5097
    |fn nameString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5098
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5099
    fn := aFileNameOrString asFilename.
2933
8b65cb642d91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2928
diff changeset
  5100
    nameString := fn name.
2896
be30640b9012 VMS stuff
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  5101
    fn isAbsolute ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5102
	"dont use path for absolute file names"
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5103
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5104
	^ nameString
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5105
    ].
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5106
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5107
    self realSystemPath do:[:dirName |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5108
	|realName|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5109
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5110
	realName := dirName asFilename construct:nameString.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5111
	"/
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5112
	"/ here, we also return true if its a directory
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5113
	"/ (Even if unreadable). 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5114
	"/ It could be that the file itself is still readable.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5115
	"/
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5116
	(realName isDirectory or:[realName isReadable]) ifTrue: [
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5117
	    ^ realName name
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5118
	]
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5119
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5120
    ^ nil
4150
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5121
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5122
    "
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5123
     Smalltalk getSystemFileName:'doc/online/english/TOP.html'
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5124
     Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm'
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5125
     Smalltalk getSystemFileName:'bitmaps/foo'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5126
     Smalltalk getSystemFileName:'resources/View.rs'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5127
     Smalltalk getSystemFileName:'resources/iris.style'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5128
    "
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5129
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5130
    "Modified: / 6.5.1999 / 10:40:37 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5131
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5132
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5133
imageFromFileNamed:aFileName forClass:aClass
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5134
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5135
     first in the redefinable bitmaps path, then in the classes
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5136
     own package directory if existing.
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5137
     Return an image or nil."
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5138
5113
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5139
    |package nm img|
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5140
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5141
    package := aClass package.
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5142
    img := self imageFromFileNamed:aFileName inPackage:package.
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5143
    img isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5144
	package ~= 'stx:goodies' ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5145
	    "/ try under the goodies package ...
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5146
	    img := Smalltalk imageFromFileNamed:aFileName inPackage:'stx:goodies'.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5147
	].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5148
	img isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5149
	    (aFileName startsWith:'bitmaps') ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5150
		nm := 'bitmaps/' , aFileName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5151
		img := Smalltalk imageFromFileNamed:nm forClass:self.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5152
		img isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5153
		    img := Smalltalk imageFromFileNamed:nm inPackage:'stx:goodies'.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5154
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5155
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5156
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5157
	    img isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5158
		img := Smalltalk imageFromFileNamed:aFileName inPackage:'stx:goodies'.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5159
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5160
	]
5113
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5161
    ].
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5162
    ^ img
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5163
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5164
    "
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5165
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' forClass:View
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5166
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5167
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5168
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5169
imageFromFileNamed:aFileName inPackage:aPackage
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5170
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5171
     first in the redefinable bitmaps path, then in the 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5172
     package directory if existing.
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5173
     Return an image or nil."
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5174
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5175
    |i f dir|
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5176
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5177
    i := Image fromFile:aFileName resolution:100.
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5178
    i notNil ifTrue:[^ i].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5179
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5180
    f := self getBitmapFileName:aFileName.
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5181
    f notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5182
	i := Image fromFile:f.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5183
	i notNil ifTrue:[^ i].
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5184
    ].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5185
    dir := self projectDirectoryForPackage:aPackage.
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5186
    dir isNil ifTrue:[^ nil].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5187
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5188
    ((f := aFileName) startsWith:'bitmaps/') ifFalse:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5189
	i := Image fromFile:(dir asFilename construct:f).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5190
	i notNil ifTrue:[^ i].
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5191
    
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5192
	f := 'bitmaps/' , aFileName.
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5193
    ].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5194
    ^ Image fromFile:(dir asFilename construct:f).
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5195
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5196
    "
5587
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5197
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview' 
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5198
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool' 
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5199
     Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies' 
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5200
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5201
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5202
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5203
libraryFileNameOfClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5204
    "for a given class, return the name of a classLibrary which contains
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5205
     binary code for it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5206
     Read the libinfo file 'liblist.stc' (which is created during the compilation process)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5207
     for an entry for aClassOrClassName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5208
     Search for the className in the first col, and return the value found in
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5209
     the 2nd col.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5210
     Return nil if no entry is found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5211
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5212
     A nil returns means that this class is either built-in or not present
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5213
     in a package-class library (i.e. either as separate .o or separate .st file).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5214
     Otherwise, the returned name is the classLibrary object of that class.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5215
     The classes code can be loaded from that file if binary loading is supported."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5216
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5217
    |aStream line words n aClassName|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5218
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5219
    aClassOrClassName isBehavior ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5220
	aClassName := aClassOrClassName name
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5221
    ] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5222
	aClassName := aClassOrClassName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5223
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5224
    aClassName := aClassName asString.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5225
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5226
    #('include/liblist.stc')    "/ filenames
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5227
    with:#(2)                   "/ column
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5228
    do:[:fileName :col |
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5229
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5230
	aStream := self systemFileStreamFor:fileName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5231
	aStream notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5232
	    [aStream atEnd] whileFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5233
		line := aStream nextLine.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5234
		line notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5235
		    (line startsWith:'#') ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5236
			words := line asCollectionOfWords.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5237
			(n := words size) > 1 ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5238
			    (words at:1) = aClassName ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5239
				n >= col ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5240
				    aStream close.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5241
				    ^ (words at:col) withoutSeparators
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5242
				]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5243
			    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5244
			]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5245
		    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5246
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5247
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5248
	    aStream close
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5249
	].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5250
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5251
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5252
    ^ nil
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5253
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5254
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5255
     Smalltalk libraryFileNameOfClass:'ClockView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5256
     Smalltalk libraryFileNameOfClass:'Bag' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5257
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5258
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5259
    "Modified: 6.11.1995 / 15:41:39 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5260
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5261
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5262
packagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5263
    "return a collection of additional directorynames, where smalltalk
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5264
     looks for package directories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5265
     Notice, that directories named 'packages' under the systemPath are
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5266
     always consulted - even if not in the packagePath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5267
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5268
    ^ PackagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5269
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5270
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5271
     Smalltalk packagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5272
     Smalltalk packagePath addLast:'/opt/smalltalk'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5273
     Smalltalk packagePath addFirst:'/usr/local/otherPackages'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5274
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5275
!
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  5276
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5277
packagePath:aPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5278
    "set the packagePath;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5279
     a collection of additional directorynames, where smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5280
     looks for package directories.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5281
     Notice, that directories named 'packages' under the systemPath are
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5282
     always consulted - even if not in the packagePath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5283
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5284
    PackagePath := aPath asOrderedCollection
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5285
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5286
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5287
     Smalltalk packagePath:#( '.' '/opt/stx' '/opt/smalltalk' '/usr/local/otherPackages')
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5288
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5289
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5290
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5291
projectDirectoryForClass:aClass
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5292
    "given a class, return the path to its package directory;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5293
     nil if not found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5294
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5295
    |pkg|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5296
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5297
    pkg := aClass package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5298
    pkg isNil ifTrue:[^ nil].
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  5299
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5300
    ^ self projectDirectoryForPackage:pkg.
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5301
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5302
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5303
     Smalltalk projectDirectoryForClass:Array 
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5304
     Smalltalk projectDirectoryForClass:View
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5305
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5306
!
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5307
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5308
projectDirectoryForPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5309
    "given a packageID, return the path to its package directory;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5310
     nil if not found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5311
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5312
    |prj prjDir|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5313
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5314
    "/ there might be a package specific resource directory ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5315
    "/ in the directory, from which the project was loaded
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5316
    prj := Project projectWithId:aPackage.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5317
    prj notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5318
	prjDir := prj directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5319
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5320
    (prjDir notNil and:[prjDir asFilename exists]) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5321
	prjDir := Smalltalk getPackageFileName:(aPackage copyReplaceAll:$: with:$/).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5322
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5323
    ^ prjDir
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5324
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5325
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5326
     Smalltalk projectDirectoryForPackage:'stx:libbasic'   
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5327
     Smalltalk projectDirectoryForPackage:'exept:smartcard'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5328
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5329
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5330
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5331
readAbbreviations
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5332
    "read classname to filename mappings from include/abbrev.stc.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5333
     sigh - all for those poor sys5.3 or MSDOS people with short filenames ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5334
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5335
    "since installAutoloadedClasses also reads all abbreviations, use it"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5336
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5337
    CachedAbbreviations := IdentityDictionary new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5338
    self installAutoloadedClasses.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5339
    ^ CachedAbbreviations.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5340
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5341
"/    |aStream f dirsConsulted|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5342
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5343
"/    CachedAbbreviations := IdentityDictionary new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5344
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5345
"/    "/ new scheme: look for a directory called 'packages'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5346
"/    "/ and enumerate its abbrev.stc files...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5347
"/    dirsConsulted := Set new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5348
"/    f := Smalltalk getSystemFileName:'packages'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5349
"/    f notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5350
"/        f := f asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5351
"/        f isDirectory ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5352
"/            ('Smalltalk [info]: reading all class abbreviations found under ''' , f pathName ,'''') infoPrintCR.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5353
"/            self recursiveReadAllAbbreviationsFrom:f.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5354
"/            dirsConsulted add:f pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5355
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5356
"/    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5357
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5358
"/    "/ and along the package-path
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5359
"/    self packagePath do:[:aPath |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5360
"/        (dirsConsulted includes:aPath) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5361
"/            ('Smalltalk [info]: reading all class abbreviations found under ''' , aPath ,'''') infoPrintCR.
7613
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5362
"/            self recursiveReadAllAbbreviationsFrom:aPath.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5363
"/            dirsConsulted add:aPath
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5364
"/        ]
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5365
"/    ].
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5366
"/
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5367
"/    "/ old scheme: look for a single file called 'abbrev.stc' in the
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5368
"/    "/ include directory. This will vanish.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5369
"/
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5370
"/    aStream := self systemFileStreamFor:'include/abbrev.stc'.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5371
"/    aStream notNil ifTrue:[
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5372
"/        ('Smalltalk [info]: reading additional abbreviations from ''' , aStream pathName ,'''') infoPrintCR.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5373
"/        self readAbbreviationsFromStream:aStream.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5374
"/        aStream close.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5375
"/"/    ] ifFalse:[
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5376
"/"/        ('Smalltalk [warning]: no global''include/abbrev.stc'' file found') infoPrintCR
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5377
"/    ].
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5378
"/    ^ CachedAbbreviations
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5379
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5380
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5381
     Smalltalk readAbbreviations
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5382
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5383
5091
a145df1cd0e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5089
diff changeset
  5384
    "Modified: / 10.12.1999 / 17:48:53 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5385
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5386
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5387
readAbbreviationsFromStream:aStream
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5388
    "read classname to filename mappings from aStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5389
     sigh - all for those poor sys5.3 or MSDOS people with short filenames ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5390
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5391
    |line words nm abbrev pkg s w|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5392
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5393
    [aStream atEnd] whileFalse:[
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5394
        line := aStream nextLine.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5395
        line notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5396
            (line startsWith:'#') ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5397
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5398
                "/ must do it manually, caring for quoted strings.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5399
"/                words := line asCollectionOfWords.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5400
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5401
                words := OrderedCollection new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5402
                s := line readStream.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5403
                [s atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5404
                    s skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5405
                    s peek == $' ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5406
                        s next.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5407
                        w := s upTo:$'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5408
                        s skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5409
                    ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5410
                        w := s upToSeparator
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5411
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5412
                    words add:w
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5413
                ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5414
                words size >= 3 ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5415
                    nm := (words at:1) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5416
                    abbrev := (words at:2) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5417
                    pkg := (words at:3) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5418
                    self setFilename:abbrev forClass:nm package:pkg. 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5419
                ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5420
                    ('Smalltalk [warning]: malformed line in ' , (aStream pathName)) infoPrintCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5421
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5422
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5423
        ]
4420
beac992b86d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4391
diff changeset
  5424
    ].
5091
a145df1cd0e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5089
diff changeset
  5425
5095
9bbf3cf594e5 no warning for same-abbrev, if packages differ.
Claus Gittinger <cg@exept.de>
parents: 5093
diff changeset
  5426
    "Modified: / 13.12.1999 / 11:54:17 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5427
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5428
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5429
realSystemPath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5430
    "return the realSystemPath - thats the directorynames from
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5431
     SystemPath which exist and are readable"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5432
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5433
    |nP|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5434
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5435
    RealSystemPath isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5436
	OperatingSystem isVMSlike ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5437
	    "/ temporary kludge: since we cannot currently
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5438
	    "/ check for existance of a name like 'volume:',
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5439
	    "/ leave those in the Path without a check.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5440
	    RealSystemPath := SystemPath select:[:dirName |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5441
		|f|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5442
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5443
		f := dirName asFilename.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5444
		f isVolumeOnly ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5445
		    true
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5446
		] ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5447
		    (f isDirectory) and:[f isReadable]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5448
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5449
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5450
	] ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5451
	    RealSystemPath := SystemPath select:[:dirName |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5452
		|f|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5453
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5454
		f := dirName asFilename.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5455
		(f isDirectory) and:[f isReadable]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5456
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5457
	    RealSystemPath := RealSystemPath collect:[:dirName |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5458
		    |f|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5459
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5460
		    f := dirName asFilename pathName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5461
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5462
	    "/ remove duplicates (but keep order)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5463
	    nP := OrderedCollection new.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5464
	    RealSystemPath do:[:p |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5465
		(nP includes:p) ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5466
		    nP add:p
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5467
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5468
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5469
	    RealSystemPath := nP.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5470
	].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5471
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5472
    ^ RealSystemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5473
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5474
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5475
recursiveReadAllAbbreviationsFrom:aDirectory
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5476
    self recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:15
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5477
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5478
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5479
recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:maxLevels
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5480
    "read all abbreviations from and under aDirectory."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5481
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5482
    |abbrevStream dir directoryContents|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5483
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5484
    maxLevels == 0 ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5485
"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5486
	^ self
5075
c9e585ae97d4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5074
diff changeset
  5487
    ].
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  5488
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5489
    dir := aDirectory asFilename.
5057
390bbf7d37bf care for empty directories
Claus Gittinger <cg@exept.de>
parents: 5053
diff changeset
  5490
    dir exists ifFalse:[^ self].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5491
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5492
    [
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5493
	abbrevStream := (dir construct:'abbrev.stc') asFilename readStream.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5494
	self readAbbreviationsFromStream:abbrevStream.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5495
	abbrevStream close.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5496
    ] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5497
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5498
    [
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5499
	directoryContents := dir directoryContents.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5500
    ] on:FileStream openErrorSignal do:[:ex|
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5501
	"non-accessable directory: we are done"
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5502
	^ self
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5503
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5504
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5505
    directoryContents do:[:aFilename |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5506
	|f|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5507
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5508
	(#(
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5509
	    'doc'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5510
	    'CVS'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5511
	    'bitmaps'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5512
	    'resources'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5513
	    'source'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5514
	) includes:aFilename) ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5515
	    f := dir construct:aFilename.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5516
	    f isDirectory ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5517
		self recursiveReadAllAbbreviationsFrom:f maxLevels:maxLevels-1
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5518
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5519
	].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5520
    ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5521
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5522
8952
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5523
resourceDirectoryForPackage:aPackage
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5524
    "given a packageID, return the path to its resource directory;
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5525
     nil if not found."
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5526
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5527
    |prjDir rsrcDir|
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5528
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5529
    prjDir := self projectDirectoryForPackage:aPackage.
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5530
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5531
    (prjDir notNil
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5532
    and:[(prjDir := prjDir asFilename) exists
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5533
    and:[(rsrcDir := prjDir construct:'resources') exists]]) ifTrue:[
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5534
        ^ rsrcDir
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5535
    ].
8953
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5536
    rsrcDir := self getSystemFileName:('resources/' , (aPackage copyReplaceAll:$: with:$/)).
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5537
    rsrcDir notNil ifTrue:[
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5538
        ^ rsrcDir asFilename
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5539
    ].
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5540
    ^ nil 
8952
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5541
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5542
    "
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5543
     Smalltalk resourceDirectoryForPackage:'stx:libbasic'   
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5544
     Smalltalk resourceDirectoryForPackage:'exept:expecco'   
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5545
     Smalltalk resourceDirectoryForPackage:'exept:smartcard'
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5546
    "
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5547
!
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5548
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5549
resourceFileStreamFor:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5550
    "search aFileName in some standard places;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5551
     return a readonly fileStream or nil if not found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5552
     Searches in subdirectories named 'resource' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5553
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5554
    ^ self resourceFileStreamFor:aFileName forClass:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5555
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5556
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5557
resourceFileStreamFor:aFileName forClass:aClassOrNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5558
    "search aFileName in some standard places and in the classes
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5559
     package-resource directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5560
     Return a readonly fileStream or nil if not found.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5561
     Searches in subdirectories named 'resource' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5562
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5563
    |aString|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5564
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5565
    aString := self getResourceFileName:aFileName forClass:aClassOrNil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5566
    aString notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5567
	^ aString asFilename readStreamOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5568
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5569
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5570
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5571
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5572
searchPath:aPath for:aFileName in:aDirName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5573
    "search aPath for a subdirectory named aDirectory with a file
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5574
     named aFileName"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5575
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5576
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5577
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5578
    ((f := aFileName asFilename) isAbsolute 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5579
    or:[f isExplicitRelative]) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5580
	"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5581
	"/ dont use path for absolute or explicit .-relative file names
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5582
	"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5583
	^ aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5584
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5585
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5586
    aPath notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5587
	aPath do:[:dirName |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5588
	    |realName dir|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5589
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5590
	    dir := dirName asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5591
	    aDirName notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5592
		realName := (dir construct:aDirName) construct:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5593
	    ] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5594
		realName := dir construct:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5595
	    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5596
	    (realName isReadable) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5597
		^ realName name
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5598
	    ]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5599
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5600
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5601
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5602
    ^ nil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5603
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5604
    "Modified: / 29.4.1999 / 15:06:43 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5605
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5606
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5607
setFilename:aFileNameString forClass:aClassNameString package:aPackageNameString 
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5608
    |classNameSymbol oldAbbrev cls abbrevs|
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5609
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5610
    CachedAbbreviations isNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5611
        CachedAbbreviations := IdentityDictionary new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5612
    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5613
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5614
    abbrevs := CachedAbbreviations.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5615
    aClassNameString ~= aFileNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5616
        classNameSymbol := aClassNameString asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5617
        oldAbbrev := abbrevs at:classNameSymbol ifAbsent:nil.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5618
        oldAbbrev notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5619
            oldAbbrev ~= aFileNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5620
                StandAlone ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5621
                    ('Smalltalk [warning]: conflict for: ' , aClassNameString , 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5622
                        ' in package ' , aPackageNameString) infoPrintCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5623
                    ('Smalltalk [warning] overwriting with new: (' , oldAbbrev , ' <-> ' , aFileNameString , ')') 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5624
                        infoPrintCR
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5625
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5626
            ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5627
            "overwrite old abbreviation with new one, 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5628
             to allow fixing of bad abbrev files"
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5629
        ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5630
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5631
        cls := self classNamed:aFileNameString.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5632
        cls notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5633
            cls name ~= aClassNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5634
                "/ ok, there is a class named after this abbrev ...
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5635
                "/ this is only a conflict, if the other class has no
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5636
                "/ abbreviation (or the same).
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5637
                (abbrevs at:(cls name asSymbol) ifAbsent:cls name) = aFileNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5638
                    cls isNameSpace ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5639
                        aPackageNameString = cls package ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5640
                            StandAlone ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5641
                                ('Smalltalk [warning]: conflict for: ' , cls name , 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5642
                                    ' in package ' , aPackageNameString) infoPrintCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5643
                                ('Smalltalk [warning]: (' , aClassNameString , ' -> ' , aFileNameString 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5644
                                    , ')') infoPrintCR
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5645
                            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5646
                        ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5647
                    ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5648
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5649
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5650
        ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5651
        abbrevs at:classNameSymbol put:aFileNameString.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5652
    ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5653
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5654
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5655
sourceDirectoryNameOfClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5656
    "for a given class, return the pathname relative to TOP of the classes source code.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5657
     Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5658
     for an entry for aClassOrClassName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5659
     Search for the className in the first col, and return the value found in
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5660
     the 3rd col.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5661
     Return nil if no entry is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5662
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5663
    |aStream line words n aClassName|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5664
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5665
    aClassOrClassName isBehavior ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5666
	aClassName := aClassOrClassName name
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5667
    ] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5668
	aClassName := aClassOrClassName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5669
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5670
    aClassName := aClassName asString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5671
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5672
    #('include/abbrev.stc' 'include/liblist.stc')    "/ filenames
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5673
    with:#(3 2)                   "/ column
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5674
    do:[:fileName :col |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5675
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5676
	aStream := self systemFileStreamFor:fileName.
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5677
	aStream notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5678
	    [aStream atEnd] whileFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5679
		line := aStream nextLine.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5680
		line notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5681
		    (line startsWith:'#') ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5682
			words := line asCollectionOfWords.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5683
			(n := words size) > 1 ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5684
			    (words at:1) = aClassName ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5685
				n >= col ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5686
				    aStream close.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5687
				    ^ (words at:col) withoutSeparators
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5688
				]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5689
			    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5690
			]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5691
		    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5692
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5693
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5694
	    aStream close
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5695
	].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5696
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5697
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5698
    ^ nil
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5699
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5700
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5701
     Smalltalk sourceDirectoryNameOfClass:'ClockView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5702
     Smalltalk sourceDirectoryNameOfClass:'Bag' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5703
     Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5704
     Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5705
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5706
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5707
    "Created: 6.11.1995 / 15:43:30 / cg"
728
50cf1c907c28 again search liblist for a classes source directory
Claus Gittinger <cg@exept.de>
parents: 713
diff changeset
  5708
    "Modified: 9.12.1995 / 23:54:14 / cg"
2033
c94698170f36 Close unused streams.
Stefan Vogel <sv@exept.de>
parents: 2029
diff changeset
  5709
    "Modified: 3.1.1997 / 11:26:44 / stefan"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5710
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5711
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5712
sourceFileStreamFor:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5713
    "search aFileName in some standard places;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5714
     return a readonly fileStream or nil if not found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5715
     Searches in subdirectories named 'source' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5716
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5717
    |aString|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5718
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5719
    aString := self getSourceFileName:aFileName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5720
    aString notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5721
	^ aString asFilename readStreamOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5722
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5723
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5724
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5725
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5726
systemFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5727
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5728
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5729
     see comment in Smalltalk>>initSystemPath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5730
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5731
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5732
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5733
    aString := self getSystemFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5734
    aString notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5735
	^ aString asFilename readStreamOrNil
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5736
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5737
    ^ nil
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5738
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5739
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5740
systemPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5741
    "return a collection of directorynames, where smalltalk
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  5742
     looks for system files 
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5743
     (usually in subdirs such as resources, bitmaps, source etc.)
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5744
     see comment in Smalltalk>>initSystemPath."
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5745
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5746
    ^ SystemPath
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5747
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5748
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5749
     Smalltalk systemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5750
     Smalltalk systemPath addLast:'someOtherDirectoryPath'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5751
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5752
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5753
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5754
systemPath:aPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5755
    "set the collection of directorynames, where smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5756
     looks for system files 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5757
     (usually in subdirs such as resources, bitmaps, source etc.)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5758
     see comment in Smalltalk>>initSystemPath."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5759
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5760
    SystemPath := aPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5761
    self flushPathCaches
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5762
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5763
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5764
     Smalltalk systemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5765
     Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath')
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5766
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5767
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5768
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5769
!Smalltalk class methodsFor:'system management-packages'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5770
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5771
knownPackages
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5772
    ^ KnownPackages ? #()
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5773
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5774
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5775
loadExtensionsForPackage:aPackageId
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5776
    |packageDirName|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5777
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5778
    packageDirName := aPackageId copyReplaceAll:$: with:$/.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5779
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5780
    packageDirName := self getPackageFileName:packageDirName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5781
    packageDirName isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5782
	^ false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5783
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5784
    ^ self loadExtensionsFromDirectory:packageDirName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5785
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5786
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5787
loadExtensionsFromDirectory:packageDirOrString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5788
    |packageDir f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5789
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5790
    packageDir := packageDirOrString asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5791
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5792
    f := packageDir construct:'extensions.st'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5793
    f exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5794
	f fileIn.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5795
	SilentLoading ifFalse:[
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5796
	    Transcript showCR:('loaded extensions: ' , f pathName).
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5797
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5798
	^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5799
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5800
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5801
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5802
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5803
loadPackage:aPackageIdOrPackage
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5804
    "make certain, that some particular package is loaded into the system.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5805
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5806
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5807
    (aPackageIdOrPackage isSymbol 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5808
    or:[aPackageIdOrPackage isString]) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5809
	^ self loadPackageWithId:aPackageIdOrPackage asAutoloaded:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5810
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5811
    self shouldImplement.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5812
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5813
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5814
     Smalltalk loadPackage:'stx:libbasic'  
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5815
     Smalltalk loadPackage:'stx:goodies/persistency'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5816
     Smalltalk loadPackage:'cg:cparser'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5817
     Smalltalk loadPackage:'cg:rose'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5818
    "
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5819
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5820
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5821
loadPackage:packageId fromAllSourceFilesInDirectory:aDirectory
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5822
    "load all source files found in aDirectory and treat them like
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5823
     a package. Allows for initial import of alien ST-code as a new package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5824
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5825
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5826
    |p t new anyFail repeatCount|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5827
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5828
    "/ problem: dependencies.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5829
    "/ solution: repeat twice, so that superclasses are present the second time
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5830
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5831
    Class packageQuerySignal answer:packageId asSymbol do:[
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5832
        |any|
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5833
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5834
        repeatCount := 0.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5835
        [
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5836
            repeatCount := repeatCount + 1.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5837
            anyFail := false.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5838
            aDirectory directoryContents do:[:file |
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5839
                |fn|
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5840
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5841
                fn := aDirectory construct:file.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5842
                (fn hasSuffix:'st') ifTrue:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5843
                    Metaclass confirmationQuerySignal answer:false      
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5844
                    do:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5845
                        Error 
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5846
                            handle:[:ex |
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5847
                                anyFail := true
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5848
                            ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5849
                            do:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5850
                                (self fileIn:fn) ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5851
                                    anyFail := true
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5852
                                ] ifTrue:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5853
                                    any := true.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5854
                                ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5855
                            ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5856
                    ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5857
                ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5858
            ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5859
            any ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5860
                ^ false "/ no file found
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5861
            ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5862
        ] doWhile:[anyFail and:[repeatCount<2]].
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5863
    ].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5864
                
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5865
    new := (p := Project projectWithId:packageId) isNil.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5866
    new ifTrue:[ p := Project new].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5867
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5868
    p name:packageId.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5869
    p directory:aDirectory.
4726
5c5e1c7f8933 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4724
diff changeset
  5870
    p package:packageId.
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5871
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5872
    p repositoryModule:(t first).
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5873
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5874
    p isLoaded:true.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5875
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5876
    new ifTrue:[Project addLoadedProject:p].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5877
    ^ anyFail not
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5878
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5879
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5880
loadPackage:packageId fromClassLibrary:aFilename
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5881
    "load a package from a compiled classLib.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5882
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5883
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5884
    |p t new|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5885
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5886
    (self fileIn:aFilename) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5887
	(self fileInClassLibrary:aFilename) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5888
	    self warn:'Failed to load the package ', packageId printString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5889
	    ^ false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5890
	]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5891
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5892
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5893
    new := (p := Project projectWithId:packageId) isNil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5894
    new ifTrue:[ p := Project new].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5895
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5896
    p name:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5897
    p directory:aFilename directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5898
    p package:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5899
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5900
    p repositoryModule:(t first).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5901
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5902
    p isLoaded:true.
4723
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  5903
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  5904
    new ifTrue:[Project addLoadedProject:p].
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  5905
    ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5906
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5907
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5908
loadPackage:packageId fromLoadAllFile:aFilename
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5909
    "load a package from a loadAll - loader script.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5910
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5911
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5912
    |p t new|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5913
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5914
    Metaclass confirmationQuerySignal answer:false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5915
    do:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5916
	(self fileIn:aFilename) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5917
	    self warn:'Failed to load the package ', packageId printString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5918
	    ^ false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5919
	]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5920
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5921
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5922
    new := (p := Project projectWithId:packageId) isNil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5923
    new ifTrue:[ p := Project new].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5924
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5925
    p name:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5926
    p directory:aFilename directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5927
    p package:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5928
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5929
    p repositoryModule:(t first).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5930
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5931
    p isLoaded:true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5932
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5933
    new ifTrue:[Project addLoadedProject:p].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5934
    ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5935
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5936
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5937
loadPackage:aPackageId fromProjectFile:f asAutoloaded:doLoadAsAutoloaded
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5938
    "load a package from a .prj spec.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5939
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5940
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5941
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5942
    "/ not yet implemented ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5943
    ^ false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5944
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5945
"/    |prj fn|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5946
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5947
"/        prj := Project new loadFromProjectFile:f asFilename pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5948
"/    "/ no - also allow for applications to be loaded this way
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5949
"/    "/    prj type == #library ifFalse:[ ^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5950
"/    self halt.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5951
"/        "/ load all prerequisites ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5952
"/        prj prerequisites do:[:aRequiredPackage |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5953
"/            self halt.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5954
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5955
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5956
"/        "/ see if there is a class library ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5957
"/        fn := prj directory asFilename construct:(prj name , ObjectFileLoader sharedLibraryExtension).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5958
"/        fn exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5959
"/            "/ load that classLibrary ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5960
"/            self fileIn:fn pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5961
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5962
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5963
"/        "/ now, for all other classes, file-them in
5601
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5964
"/        "/ or declare as autoloaded ...
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5965
"/
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5966
"/        prj classes do:[:aClassOrName | |ns|
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5967
"/            aClassOrName isBehavior ifFalse:[
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5968
"/                ((self includesKey:aClassOrName) not  
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5969
"/                and:[(ns := prj defaultNameSpace) isNil
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5970
"/                    or:[ns == self
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5971
"/                    or:[(ns includesKey:aClassOrName) not]]]) 
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5972
"/                ifTrue:[
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5973
"/                    "/ must load a corresponding source or cls-file
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5974
"/    self halt.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5975
"/                ]
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5976
"/            ]
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5977
"/        ].
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5978
"/        prj isLoaded:true.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5979
"/        prj directory:f asFilename directoryName.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5980
"/        Project addLoadedProject:prj.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5981
"/        ^ true
4756
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5982
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5983
"
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5984
 Smalltalk loadPackage:'exept:osi/asn1'
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5985
 Smalltalk 
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5986
	loadPackage:'exept:osi/asn1'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5987
	fromProjectFile:'../../../exept/osi/asn1/asn1.prj'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5988
	asAutoloaded:false
4756
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5989
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5990
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5991
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5992
loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5993
    "load a package from a .zip delivery file.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5994
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5995
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5996
    "/ not yet implemented ...
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5997
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5998
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5999
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6000
loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6001
    |abbrevFile packageDir|
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6002
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6003
    packageDir := self packageDirectoryForPackageId:aPackageId.
8380
ec3e8dfc46a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8379
diff changeset
  6004
    packageDir isNil ifTrue:[^ false].
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6005
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6006
    "/ abbrev.stc ?
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6007
    abbrevFile := packageDir construct:'abbrev.stc'.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6008
    abbrevFile exists ifFalse:[^ false].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6009
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6010
    Smalltalk installAutoloadedClassesFrom:abbrevFile pathName.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6011
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6012
    doLoadAsAutoloaded ifFalse:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6013
        "/ force autoloading...
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6014
        Smalltalk allClassesDo:[:eachClass |
8381
213f154fb374 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8380
diff changeset
  6015
            eachClass package = aPackageId ifTrue:[ eachClass autoload].
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6016
        ].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6017
    ].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6018
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6019
    self loadExtensionsFromDirectory:packageDir.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6020
    SilentLoading ifFalse:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6021
        Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName).
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6022
    ].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6023
    ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6024
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6025
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6026
loadPackageWithId:aPackageId
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6027
    "make certain, that some particular package is loaded into the system.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6028
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6029
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6030
    ^ self loadPackageWithId:aPackageId asAutoloaded:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6031
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6032
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6033
     Smalltalk loadPackageWithId:'stx:libbasic'  
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6034
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6035
     Smalltalk loadPackageWithId:'cg:cparser'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6036
     Smalltalk loadPackageWithId:'cg:rose'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6037
     Smalltalk loadPackageWithId:'detemobil:smc'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6038
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6039
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6040
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6041
loadPackageWithId:aPackageId asAutoloaded:doLoadAsAutoloaded
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6042
    "make certain, that some particular package is loaded into the system.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6043
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6044
8379
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6045
    |pkg packageDir|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6046
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6047
    pkg := Project projectWithId:aPackageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6048
    (pkg notNil and:[pkg isLoaded]) ifTrue:[ 
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6049
        "/ ('Smalltalk [info]: Package ' , aPackageId , ' already loaded.') infoPrintCR.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6050
        (doLoadAsAutoloaded 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6051
        or:[pkg areAllClassesLoaded]) ifTrue:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6052
            ^ true
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6053
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6054
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6055
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6056
    "/ ok; not yet loaded.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6057
    "/ try to locate the package; try the following:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6058
    "/    $(packagePath)/<packageDir>/...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6059
    "/    $(SYSPATH)/packages/<packageDir>
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6060
    packageDir := self packageDirectoryForPackageId:aPackageId.
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6061
    packageDir isNil ifTrue:[
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6062
        (aPackageId includes:$:) ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6063
            "/ assume stx
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6064
            packageDir := self packageDirectoryForPackageId:('stx:',aPackageId).
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6065
        ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6066
    ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6067
    packageDir isNil ifTrue:[
8379
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6068
        ('Smalltalk [warning]: cannot find packageDirectory: ' , packageDir name) errorPrintCR.
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6069
        ^ false
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6070
    ].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6071
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6072
    ^ self
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6073
        loadPackageWithId:aPackageId 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6074
        fromDirectory:packageDir 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6075
        asAutoloaded:doLoadAsAutoloaded
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6076
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6077
    "
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6078
     Smalltalk loadPackageWithId:'stx:libbasic'  
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6079
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6080
     Smalltalk loadPackageWithId:'exept:ctypes'
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6081
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6082
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6083
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6084
loadPackageWithId:aPackageId fromDirectory:packageDirOrString asAutoloaded:doLoadAsAutoloaded
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6085
    |f packageDir packageName shLibName|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6086
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6087
    packageDir := packageDirOrString asFilename.
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6088
    packageName := packageDir baseName.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6089
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6090
    "/ .prj ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6091
    f := (packageDir construct:packageName) withSuffix:'prj'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6092
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6093
        (self loadPackage:aPackageId fromProjectFile:f asAutoloaded:doLoadAsAutoloaded) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6094
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6095
                Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageId , ' from project file: ' , f pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6096
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6097
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6098
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6099
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6100
    "/ loadAll ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6101
    f := packageDir construct:'loadAll'.
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6102
    f exists ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6103
        f := packageDir construct:'loadall'.
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6104
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6105
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6106
        (self loadPackage:aPackageId fromLoadAllFile:f) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6107
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6108
                Transcript showCR:('loaded package: ' , aPackageId , ' from loadAll file: ' , f pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6109
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6110
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6111
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6112
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6113
    "/ .zip ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6114
    f := (packageDir construct:packageName) withSuffix:'zip'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6115
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6116
        (self loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6117
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6118
                Transcript showCR:('loaded package: ' , aPackageId , ' from zip file: ' , f pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6119
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6120
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6121
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6122
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6123
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6124
    shLibName := packageName , ObjectFileLoader sharedLibraryExtension.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6125
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6126
    "/ .so ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6127
    f := packageDir construct:shLibName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6128
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6129
        (self loadPackage:aPackageId fromClassLibrary:f) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6130
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6131
                Transcript showCR:('loaded package: ' , aPackageId , ' from binary classLib file: ' , f pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6132
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6133
            doLoadAsAutoloaded ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6134
                "/ force autoloading...
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6135
                Smalltalk allClassesDo:[:eachClass |
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6136
                    eachClass package == aPackageId ifTrue:[ eachClass autoload].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6137
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6138
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6139
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6140
        ]              
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6141
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6142
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6143
    "/ abbrev.stc ?
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6144
    (self loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded) ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6145
        ^ true
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6146
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6147
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6148
    "/ any .so ?  -> load the first one found (maybe not a good idea)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6149
    packageDir directoryContentsAsFilenamesDo:[:aFilename |
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6150
        (aFilename hasSuffix:ObjectFileLoader sharedLibrarySuffix) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6151
            (self loadPackage:aPackageId fromClassLibrary:aFilename) ifTrue:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6152
                SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6153
                    Transcript showCR:('loaded package: ' , aPackageId , ' from binary classLib file: ' , aFilename pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6154
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6155
                doLoadAsAutoloaded ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6156
                    "/ force autoloading...
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6157
                    Smalltalk allClassesDo:[:eachClass |
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6158
                        eachClass package == aPackageId ifTrue:[ eachClass autoload].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6159
                    ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6160
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6161
                ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6162
            ]
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6163
        ]
5175
c3e71ead8e06 when loading a package, and a .so file could not be found
Claus Gittinger <cg@exept.de>
parents: 5168
diff changeset
  6164
    ].
5807
019d25b669e5 in loadPackage, if there is no loadAll file and no
Claus Gittinger <cg@exept.de>
parents: 5789
diff changeset
  6165
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6166
    "/ source files
4737
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6167
    (self loadPackage:aPackageId fromAllSourceFilesInDirectory:packageDir) ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6168
        SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6169
            Transcript showCR:('loaded package: ' , aPackageId , ' from source files in:' , packageDir pathName).
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6170
        ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6171
        ^ true
4737
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6172
    ].
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6173
    ^ false
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6174
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6175
    "
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6176
     Smalltalk loadPackageWithId:'stx:libbasic'  
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6177
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
4722
854b7a5427b0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4720
diff changeset
  6178
     Smalltalk loadPackageWithId:'exept:ctypes'
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6179
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6180
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6181
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6182
packageDirectoryForPackageId:aPackageId
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6183
    |packageDirName packageDir|
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6184
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6185
    packageDirName := aPackageId copyReplaceAll:$: with:$/.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6186
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6187
    packageDir := self getPackageFileName:packageDirName.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6188
    packageDir isNil ifTrue:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6189
        "/ for convenience: try ../../.. as well 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6190
        "/ (when executing in thedevelopment environment)
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6191
        packageDir := '../../..' asFilename construct:packageDirName.
8379
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6192
        packageDir exists ifFalse:[ ^ nil].
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6193
    ].
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6194
    ^ packageDir asFilename
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6195
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6196
    "
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6197
     Smalltalk packageDirectoryForPackageId:'stx:libbasic'  
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6198
     Smalltalk packageDirectoryForPackageId:'stx:goodies/persistency'
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6199
     Smalltalk packageDirectoryForPackageId:'exept:ctypes'
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6200
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6201
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6202
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6203
!Smalltalk class methodsFor:'system management-undeclared variables'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6204
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6205
clearUndeclaredVariables
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6206
    "remove all undeclared variables"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6207
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6208
    (Smalltalk at:#Undeclared) do:[:eachKey |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6209
	Smalltalk removeKey:(self undeclaredPrefix , eachKey) asSymbol.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6210
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6211
    (Smalltalk at:#Undeclared) removeAll.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6212
    Smalltalk removeKey:#Undeclared.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6213
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6214
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6215
undeclaredPrefix
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6216
    "the prefix used for undeclared variables"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6217
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6218
    ^ 'Undeclared:::'
6711
ae28c469a063 undeclared variable handling
penk
parents: 6649
diff changeset
  6219
ae28c469a063 undeclared variable handling
penk
parents: 6649
diff changeset
  6220
    "Created: / 31.10.1997 / 01:13:10 / cg"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6221
! !
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6222
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6223
!Smalltalk class methodsFor:'time-versions'!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6224
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6225
configuration
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6226
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6227
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6228
    "for developers only: return the configuration, with which
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6229
     this smalltalk was compiled."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6230
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6231
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6232
    extern char *__getConfigurationString();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6233
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6234
    RETURN (__MKSTRING(__getConfigurationString() COMMA_SND));
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6235
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6236
    ^ 'unknownOS/unknownCONF:unknownPACK'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6237
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6238
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6239
     Smalltalk configuration 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6240
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6241
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6242
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6243
copyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6244
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6245
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6246
    "return a copyright string"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6247
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6248
%{  /* NOCONTEXT */
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6249
#ifndef __getCopyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6250
    extern OBJ __getCopyrightString();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6251
#endif
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6252
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6253
    RETURN (__getCopyrightString());
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6254
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6255
    ^ self primitiveFailed
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6256
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6257
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6258
     Smalltalk copyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6259
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6260
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6261
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6262
distributorString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6263
    "{ Pragma: +optSpace }"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6264
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6265
    "return a string describing the distributor of this software"
567
da2f1b829453 added distributor string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  6266
da2f1b829453 added distributor string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  6267
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6268
#ifndef __getDistributorString
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6269
    extern OBJ __getDistributorString();
568
f5754db15abf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
  6270
#endif
f5754db15abf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
  6271
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6272
    RETURN (__getDistributorString());
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6273
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6274
    ^ 'eXept Software AG, Germany'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6275
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6276
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6277
     Smalltalk distributorString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6278
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6279
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6280
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6281
expirationTime
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6282
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6283
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6284
    "for developers only: return the time when the system will expire.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6285
     after this time it will not run any longer.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6286
     It returns nil, if no expiration time has been set (system runs forever :-))"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6287
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6288
    |exp|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6289
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6290
%{  
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6291
    extern unsigned int __getExpirationTime();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6292
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6293
    exp = __MKUINT(__getExpirationTime());
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6294
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6295
    exp == 0 ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6296
        ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6297
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6298
    ^ Timestamp new fromOSTime:(exp * 1000). "OSTime is ms since 1970"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6299
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6300
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6301
     Smalltalk expirationTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6302
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6303
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6304
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6305
fullVersionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6306
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6307
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6308
    "return a full version string"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6309
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6310
    ^ 'Smalltalk/X release ' , self versionString , ' of ' , self versionDate 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6311
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6312
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6313
     Smalltalk fullVersionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6314
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6315
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6316
    "Created: / 27.10.1997 / 17:03:09 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6317
    "Modified: / 27.10.1997 / 17:04:02 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6318
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6319
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6320
hello
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6321
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6322
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6323
    "return a greeting string"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6324
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6325
    "stupid: this should come from a resource file ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6326
     but I dont use it here, to allow mini-systems without
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6327
     Resource-stuff."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6328
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6329
    |proto lang|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6330
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6331
    lang := Language.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6332
    (lang == #de) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6333
        proto := 'Willkommen bei %1 (Version %2 von %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6334
    ] ifFalse:[ (lang == #fr) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6335
        proto := 'Salut, Bienvenue à %1 (version %2 de %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6336
    ] ifFalse:[ (lang == #it) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6337
        proto := 'Ciao, benvenuto al %1 (versione %2 di %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6338
    ] ifFalse:[ (lang == #es) ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  6339
"/        proto := 'Hola, bienvenida a %1 (versión %2 de %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6340
    ] ifFalse:[ (lang == #es) ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  6341
"/        proto := 'Oi, benvindo a %1 (versão %2 de %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6342
    ] ifFalse:[ (lang == #no) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6343
        proto := 'Hei, verdenmottakelse til %1 (versjon %2 av %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6344
    ]]]]]].
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6345
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6346
    "/ ... more needed here ...
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6347
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6348
    proto isNil ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6349
        proto := 'Hello World - here is %1 version %2 of %3'.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6350
    ].
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6351
6187
d4788adb7a8e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6186
diff changeset
  6352
    ^ proto bindWith:('SmallTalk/X' allBold)
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6353
                with:(self versionString) 
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6354
                with:(self versionDate)
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6355
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6356
    "
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6357
     Smalltalk language:#us.   
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6358
     Smalltalk hello     
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6359
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6360
     Smalltalk language:#de.   
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6361
     Smalltalk hello  
1412
7c0326f67a03 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  6362
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6363
     Smalltalk language:#no.   
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6364
     Smalltalk hello  
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6365
1422
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  6366
     Transcript showCR:(Smalltalk hello)
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  6367
     Stdout showCR:(Smalltalk hello)
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6368
    "
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6369
1412
7c0326f67a03 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  6370
    "Modified: 18.5.1996 / 14:25:13 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6371
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6372
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6373
imageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6374
    "return a timestamp for the moment when this image was restarted.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6375
     If we do not execute from an image (i.e. fresh start), return nil."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6376
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6377
    ^ ImageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6378
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6379
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6380
     Smalltalk imageStartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6381
     Smalltalk imageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6382
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6383
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6384
    "Created: 13.12.1995 / 17:44:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6385
    "Modified: 6.3.1996 / 11:56:35 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6386
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6387
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6388
imageSaveTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6389
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6390
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6391
    "return a timestamp for the moment when this image was saved"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6392
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6393
    ^ ObjectMemory imageSaveTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6394
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6395
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6396
imageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6397
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6398
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6399
    "return a timestamp for the moment when this system started the first time
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6400
     (i.e. the first initial start without an image)"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6401
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6402
    ^ ImageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6403
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6404
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6405
     Smalltalk imageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6406
     Smalltalk imageRestartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6407
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6408
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6409
    "Created: 13.12.1995 / 17:44:14 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6410
    "Modified: 13.12.1995 / 17:45:47 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6411
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6412
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6413
majorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6414
    "{ Pragma: +optSpace }"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6415
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6416
    "return the major version number.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6417
     This is only incremented for very fundamental changes,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6418
     which make old object files totally incompatible
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6419
     (for example, if the layout/representation of fundamental
3382
0f4a79609ee1 bumped rev.
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  6420
      classes changes).
0f4a79609ee1 bumped rev.
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  6421
3988
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6422
     ST/X revision Naming is:
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  6423
	<major>.<minor>.<revision>.<release>"
7362
1af5f648cdb2 major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents: 7348
diff changeset
  6424
1af5f648cdb2 major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents: 7348
diff changeset
  6425
    ^ 5
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6426
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6427
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6428
     Smalltalk majorVersionNr
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6429
    "
1941
51332fe23542 bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents: 1917
diff changeset
  6430
51332fe23542 bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents: 1917
diff changeset
  6431
    "Modified: 8.11.1996 / 19:59:21 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6432
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6433
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6434
minorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6435
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6436
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6437
    "return the minor version number.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6438
     This is incremented for changes which make some old object
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6439
     files incompatible, or the protocol changes such that some
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6440
     classes need rework.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6441
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6442
     ST/X revision Naming is:
7981
2051e60ee804 release change
Claus Gittinger <cg@exept.de>
parents: 7962
diff changeset
  6443
        <major>.<minor>.<revision>.<release>"
2051e60ee804 release change
Claus Gittinger <cg@exept.de>
parents: 7962
diff changeset
  6444
8665
3b3b937cfba5 *** empty log message ***
penk
parents: 8664
diff changeset
  6445
    ^ 2
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6446
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6447
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6448
     Smalltalk minorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6449
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6450
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6451
    "Modified: / 3.11.1997 / 14:49:48 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6452
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6453
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6454
releaseIdentification
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6455
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6456
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6457
    "for developers only: return the release 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6458
     (to further identify the version in case of errors)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6459
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6460
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6461
    extern OBJ __getRel();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6462
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6463
    RETURN (__getRel());
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6464
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6465
    ^ 'ST/X_experimental'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6466
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6467
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6468
     Smalltalk releaseIdentification
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6469
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6470
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6471
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6472
releaseNr
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6473
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6474
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6475
    "return the revision number.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6476
     Incremented for releases which fix bugs/add features but did not find
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6477
     their way to the outside world.
3988
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6478
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6479
     ST/X revision Naming is:
8663
eb3d89d29121 bumped version
penk
parents: 8584
diff changeset
  6480
        <major>.<minor>.<revision>.<release>"
eb3d89d29121 bumped version
penk
parents: 8584
diff changeset
  6481
8960
01a030e0ca74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8959
diff changeset
  6482
    ^ 1
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6483
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6484
    " 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6485
     Smalltalk releaseNr 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6486
    "
732
29a49feab799 release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
  6487
29a49feab799 release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
  6488
    "Created: 10.12.1995 / 01:42:19 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6489
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6490
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6491
revisionNr
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6492
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6493
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6494
    "return the revision number.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6495
     Incremented for releases which fix bugs/add features
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6496
     and represent a stable workable version which got published
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6497
     to the outside world.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6498
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6499
     ST/X revision Naming is:
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6500
        <major>.<minor>.<revision>.<release>"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6501
8959
802b6ebdf56a revision bump
Claus Gittinger <cg@exept.de>
parents: 8958
diff changeset
  6502
    ^ 7
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6503
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6504
    " 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6505
     Smalltalk revisionNr
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6506
     Smalltalk hello        
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6507
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6508
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6509
    "Modified: / 19.6.1998 / 04:29:10 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6510
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6511
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6512
timeStamp
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6513
    "return a string useful for timestamping a file.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6514
     The returned string is padded with spaces for a constant
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6515
     length (to avoid changing a files size in fileOut with unchanged
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6516
     class)."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6517
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6518
    ^ ('''' , self timeStampString , '''') paddedTo:80 with:(Character space)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6519
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6520
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6521
timeStamp:aStream
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6522
    "write a string useful for timestamping a file onto aStream.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6523
     ST80 compatibility"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6524
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6525
    aStream nextPutAll:(self timeStamp).
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6526
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6527
    "Created: / 18.6.1998 / 17:22:58 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6528
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6529
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6530
timeStampString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6531
    "return a string useful for timestamping a file."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6532
7962
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6533
    |dateString|
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6534
8115
338205d54c48 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8084
diff changeset
  6535
    dateString := String streamContents:[:s | Date today printOn:s language:#en].  "/ MUST be english !!!!
7962
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6536
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6537
    ^ ('From Smalltalk/X, Version:' , (Smalltalk versionString) , ' on '
7962
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6538
       , dateString , ' at ' , Time now printString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6539
       )
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6540
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6541
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6542
versionDate
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6543
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6544
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6545
    "return the executables build date - thats the date when the smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6546
     executable was built"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6547
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6548
%{  /* NOCONTEXT */
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6549
    extern char *__getBuildDateString();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6550
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6551
    RETURN (__MKSTRING(__getBuildDateString() COMMA_SND) );
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6552
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6553
    ^ 'today'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6554
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6555
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6556
     Smalltalk versionDate 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6557
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6558
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6559
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6560
versionString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6561
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6562
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6563
    "return the version string"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6564
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6565
    ^ (self majorVersionNr printString ,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6566
       '.',
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6567
       self minorVersionNr printString ,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6568
       '.',
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6569
       self revisionNr printString)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6570
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6571
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6572
     Smalltalk versionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6573
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6574
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6575
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6576
vmMajorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6577
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6578
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6579
    "return the VMs major version number."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6580
%{
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8880
diff changeset
  6581
    RETURN (__mkSmallInteger(4));
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6582
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6583
    ^ 4
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6584
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6585
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6586
     Smalltalk vmMajorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6587
    "
2
claus
parents: 1
diff changeset
  6588
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6589
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  6590
!Smalltalk class methodsFor:'documentation'!
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 617
diff changeset
  6591
1568
2ed24cca3dac oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents: 1567
diff changeset
  6592
version
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  6593
    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.698 2005-12-21 13:39:49 cg Exp $'
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 617
diff changeset
  6594
! !