Smalltalk.st
author Claus Gittinger <cg@exept.de>
Wed, 21 Dec 2005 19:42:17 +0100
changeset 9043 e6106f500263
parent 9036 79a16291d7f2
child 9047 7bd12cc7b471
permissions -rw-r--r--
do not use numeric process prios
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
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2435
browserWindowStartup
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2436
    |windowIDString numericWindowID windowID params idx process|
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2437
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2438
    idx := CommandLineArguments indexOf:'--browserWindow:'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2439
    windowIDString := CommandLineArguments at:idx+1.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2440
    numericWindowID := Integer fromString:windowIDString.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2441
    windowID := ExternalAddress newAddress:numericWindowID.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2442
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2443
    idx := CommandLineArguments indexOf:'--browserParameters:'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2444
    idx ~~ 0 ifTrue:[
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2445
        params := CommandLineArguments copyFrom:idx+1
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2446
    ].
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2447
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2448
    'browserWindow is: ' errorPrint. windowID errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2449
    'browserParameters are: ' errorPrint. params errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2450
    'Display is: ' errorPrint. Display errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2451
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2452
    process := [
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2453
        PluginSupport
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2454
            startInBrowserWithWindowID:windowID 
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2455
            parameters:params.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2456
    ] newProcess.
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  2457
    process priority:(Processor userSchedulingPriority).
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2458
    process name:'browser start handler'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2459
    process beGroupLeader.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2460
    process resume.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2461
    process := nil.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2462
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2463
    Processor dispatchLoop.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2464
    Smalltalk exit.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2465
!
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  2466
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2467
displayInitializationDone
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2468
    "inform the restart, that the display has been initialized"
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2469
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2470
    CallbackSignal raiseRequest.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2471
!
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2472
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2473
mainStartup:graphicalMode
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2474
    "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
  2475
     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
  2476
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2477
    |process imageName thisIsARestart idx|
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2478
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2479
    imageName := ObjectMemory imageName.
2249
cdb6c87f0707 send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents: 2212
diff changeset
  2480
    thisIsARestart := imageName notNil.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2481
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2482
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2483
     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
  2484
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2485
    Display notNil ifTrue:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2486
        Display deviceIOTimeoutErrorSignal handlerBlock:[:ex |
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2487
            SaveEmergencyImage == true ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2488
                '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
  2489
                ObjectMemory primSnapShotOn:'crash.img'.
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
            '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
  2492
            self exit.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2493
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2494
        Display startDispatch.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2495
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2496
9016
2979527dbdf4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9015
diff changeset
  2497
    idx := CommandLineArguments indexOf:'--browserWindow:'.
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  2498
    IsPlugin := (idx ~~ 0).
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  2499
    IsPlugin ifTrue:[
9018
c01e83209ccf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9017
diff changeset
  2500
        self browserWindowStartup.
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
  2501
        "/ not reached
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2502
    ].
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2503
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2504
    Initializing := false.
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2505
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2506
    "/ 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
  2507
    "/ 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
  2508
    "/ 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
  2509
    "/ 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
  2510
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2511
    process := [
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2512
        StartBlocks notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2513
            StartBlocks do:[:aBlock|
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2514
                aBlock value
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
            StartBlocks := nil.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2517
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2518
        ImageStartBlocks notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2519
            ImageStartBlocks do:[:aBlock|
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2520
                aBlock value
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
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2523
        StandAlone ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2524
            (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
  2525
                thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2526
                    Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2527
                    Transcript showCR:('Smalltalk restarted from:'
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2528
                                        , imageName
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2529
                                        , ' (saved '
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2530
                                        , ObjectMemory imageSaveTime printString
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2531
                                        , ')' ).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2532
                ] ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2533
                    Transcript showCR:(self hello).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2534
                    Transcript showCR:(self copyrightString).
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2535
                    Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2536
                ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2537
                Transcript cr.
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
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2540
            DemoMode==true ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2541
                Transcript showCR:'*** Restricted use:                              ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2542
                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
  2543
                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
  2544
                Transcript showCR:'*** for more details.                            ***'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2545
                Transcript cr.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2546
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2547
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2548
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2549
        thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2550
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2551
            "/ 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
  2552
            "/ views, forms etc. have been recreated.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2553
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2554
            ObjectMemory changed:#returnFromSnapshot.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2555
        ]
7039
6f1c02381145 Do not keep reference to start block handler process.
Stefan Vogel <sv@exept.de>
parents: 7000
diff changeset
  2556
7040
d24ef75bc6c3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7039
diff changeset
  2557
    ] newProcess.
d24ef75bc6c3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7039
diff changeset
  2558
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  2559
    process priority:(Processor userSchedulingPriority).
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2560
    process name:'start block handler'.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2561
    process beGroupLeader.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2562
    process resume.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2563
    process := nil.
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  2564
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  2565
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2566
    "/ 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
  2567
    "/ message.
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  2568
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2569
    (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
  2570
        "
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2571
         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
  2572
        "
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2573
        thisIsARestart ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2574
            (imageName asFilename hasSuffix:'img') ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2575
                imageName := imageName copyWithoutLast:4
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2576
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2577
            self fileIn:(imageName , '.rc')
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2578
        ].
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2579
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2580
"/        Display notNil ifTrue:[
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2581
"/            Display exitOnLastClose:true.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2582
"/        ].
2086
4a9d8b5cada7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
  2583
"/        Processor exitWhenNoMoreUserProcesses:true.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2584
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2585
        process := [
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2586
            StandAlone ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2587
                AbortOperationRequest handle:[:ex |
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2588
                    'Smalltalk [info]: aborted - exit.' infoPrintCR.
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2589
                    OperatingSystem exit:1
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2590
                ] do:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2591
                    StartupClass perform:StartupSelector withArguments:StartupArguments.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2592
                ]
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2593
            ] ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2594
                StartupClass perform:StartupSelector withArguments:StartupArguments.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2595
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2596
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2597
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2598
            "/ 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
  2599
            "/ 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
  2600
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2601
            Display isNil ifTrue:[
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2602
                '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
  2603
                Smalltalk exit.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2604
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2605
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2606
            "/ 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
  2607
            "/
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2608
            Display exitOnLastClose:true.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2609
            Processor exitWhenNoMoreUserProcesses:true.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2610
        ] newProcess.
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  2611
        process priority:(Processor userSchedulingPriority).
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2612
        process name:'main'.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2613
        process beGroupLeader.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2614
        process resume.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2615
        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
  2616
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2617
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2618
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2619
     if view-classes exist, start dispatching;
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2620
     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
  2621
    "
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  2622
    ((Display notNil and:[graphicalMode]) 
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  2623
     or:[process notNil
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2624
     or:[HeadlessOperation]]) ifTrue:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2625
        Processor dispatchLoop.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2626
    ] ifFalse:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2627
        StandAlone ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2628
            self readEvalPrint
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2629
        ]
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2630
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2631
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2632
    "done - the last process finished"
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2633
8786
e5abcc22f841 info messages
penk
parents: 8760
diff changeset
  2634
    '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
  2635
    self exit
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2636
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  2637
    "Created: / 18.7.1996 / 21:07:39 / cg"
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  2638
    "Modified: / 9.9.1996 / 17:42:50 / stefan"
3483
029aabc7f3c2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3475
diff changeset
  2639
    "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
  2640
!
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2641
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2642
readEvalPrint
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2643
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2644
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2645
    "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
  2646
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2647
    |text|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2648
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2649
    'ST- ' print.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2650
    Stdin skipSeparators.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2651
    Stdin atEnd ifFalse:[
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2652
        text := Stdin nextChunk.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2653
        [text notNil] whileTrue:[
8675
ceef81bb2d0c AbortOperationRequest is now a subclass (and child-Exception) of.
Stefan Vogel <sv@exept.de>
parents: 8665
diff changeset
  2654
            AbortAllOperationRequest handle:[:ex |
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2655
                'evaluation aborted' printCR
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2656
            ] do:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2657
                Compiler isNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2658
                    '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
  2659
                    ^ self
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2660
                ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2661
                (Compiler evaluate:text) printCR.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2662
            ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2663
            'ST- ' print.
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2664
            text := Stdin nextChunk
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2665
        ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2666
    ].
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  2667
    '' printCR
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2668
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2669
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2670
restart
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2671
    "startup after an image has been loaded;
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2672
     there are three change-notifications made to dependents of ObjectMemory,
10
claus
parents: 8
diff changeset
  2673
     which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot.
335
claus
parents: 329
diff changeset
  2674
3096
881660d6e997 added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 3092
diff changeset
  2675
     #earlySystemInstallation is sent for ST80 compatibility
881660d6e997 added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents: 3092
diff changeset
  2676
10
claus
parents: 8
diff changeset
  2677
     #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
  2678
                   (should be used to flush all device dependent entries)
335
claus
parents: 329
diff changeset
  2679
10
claus
parents: 8
diff changeset
  2680
     #restarted is send right after.
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2681
                   (should be used to recreate external resources (fds, bitmaps etc)
335
claus
parents: 329
diff changeset
  2682
10
claus
parents: 8
diff changeset
  2683
     #returnFromSnapshot is sent last
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2684
                   (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
  2685
                    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
  2686
                   (Notice that positionable fileStreams are already reopened and repositioned)
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2687
     "
10
claus
parents: 8
diff changeset
  2688
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2689
    |deb insp transcript idx|
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2690
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2691
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2692
    "/ when we arrive here, all objects from our previous life
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2693
    "/ 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
  2694
    "/ handles, display information etc.
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2695
    "/ also, dynamically loaded modules have not yet been reloaded yet.
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2696
    "/ and the concrete OS, concrete FileName etc. are still refering to
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2697
    "/ 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
  2698
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2699
    Initializing := true.
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
  2700
    AbstractOperatingSystem initializeConcreteClass.
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
  2701
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2702
    ImageRestartTime := Timestamp now.
335
claus
parents: 329
diff changeset
  2703
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2704
    CommandLine := CommandLineArguments copy.
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2705
    CommandLineArguments := CommandLineArguments asOrderedCollection.
6842
a5110421e4ab more for standAlone start
Claus Gittinger <cg@exept.de>
parents: 6841
diff changeset
  2706
    CommandName := CommandLineArguments removeFirst. "/ the command
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2707
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2708
    idx := CommandLineArguments indexOf:'-q'.
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2709
    idx == 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2710
        idx := CommandLineArguments indexOf:'--silent'.
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2711
    ].
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2712
    idx ~~ 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2713
        Object infoPrinting:false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2714
        ObjectMemory infoPrinting:false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2715
        CommandLineArguments removeAtIndex:idx.
1582
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2716
    ].
0823160f6b38 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1581
diff changeset
  2717
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2718
    "/
3971
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2719
    "/ start catching SIGSEGV and SIGBUS
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2720
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2721
    OperatingSystem enableHardSignalInterrupts.
aad506cdc5d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3952
diff changeset
  2722
2907
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2723
    "/ reinit Filename
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2724
    Filename reinitialize.
1666bf27f351 VMS changes
Claus Gittinger <cg@exept.de>
parents: 2896
diff changeset
  2725
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2726
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2727
    "/ 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
  2728
329
claus
parents: 326
diff changeset
  2729
    self flushPathCaches.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2730
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2731
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2732
    "/ 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
  2733
    "/ 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
  2734
477
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
  2735
    self reinitStandardStreams.
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
  2736
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2737
    "/
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2738
    "/ redirect Transcript to Stderr during startup    
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2739
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2740
    transcript := Transcript.    
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2741
    Transcript := Stderr.
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2742
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2743
    "/
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2744
    "/ temporary switch back to dumb interface - 
4503
99718971ba26 Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents: 4490
diff changeset
  2745
    "/ to handle errors while view-stuff is not yet reinitialized
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2746
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2747
    insp := Inspector.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2748
    deb := Debugger.
684
3e0b5a8ec381 invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2749
    deb notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2750
        deb reinitialize
684
3e0b5a8ec381 invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents: 680
diff changeset
  2751
    ].
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2752
    Inspector := MiniInspector.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2753
    Debugger := MiniDebugger.
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2754
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2755
    "/ 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
  2756
    "/ 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
  2757
    "/ 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
  2758
    "/ this code.
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2759
    "/ 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
  2760
    "/ ObjectFileLoader; therefore, must reload before doing any notifications.
335
claus
parents: 329
diff changeset
  2761
1100
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2762
    ObjectFileLoader notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2763
        ObjectFileLoader reloadAllRememberedObjectFiles.
1100
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2764
    ].
eebf3ed54b23 reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents: 1097
diff changeset
  2765
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2766
    "/
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2767
    "/ invalidate all display connections.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2768
    "/ This is required to avoid trouble if someone accesses
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2769
    "/ a display during early startup.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2770
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2771
    Screen notNil ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2772
        Screen allScreens do:[:aDisplay |
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2773
            aDisplay invalidateConnection
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2774
        ].
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2775
    ].
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2776
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2777
    ObjectMemory changed:#earlySystemInstallation.
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  2778
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2779
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2780
    "/ reinitialize the Processor - restartable processes
4109
3e536657cff6 comment only
Claus Gittinger <cg@exept.de>
parents: 4099
diff changeset
  2781
    "/ 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
  2782
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2783
    Processor reinitialize.
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2784
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2785
    "/
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2786
    "/ 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
  2787
    "/ (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
  2788
3022
1b6800d56d62 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3021
diff changeset
  2789
    ObjectMemory
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2790
        changed:#earlyRestart; changed:#restarted.
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2791
1455
970b79688f56 reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents: 1451
diff changeset
  2792
    "/
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2793
    "/ start catching SIGINT and SIGQUIT
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2794
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2795
    OperatingSystem enableUserInterrupts.
6390
41d5c47c33f0 Catch sigPWR and sigHUP on restart
Stefan Vogel <sv@exept.de>
parents: 6366
diff changeset
  2796
    OperatingSystem enableCrashSignalInterrupts.
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2797
8958
6cb2a9cd649c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8957
diff changeset
  2798
    "/ 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
  2799
    "/ 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
  2800
6881
14a7a3c779b8 command line args
Claus Gittinger <cg@exept.de>
parents: 6863
diff changeset
  2801
    idx := CommandLineArguments indexOf:'--faststart'.
8957
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2802
    idx == 0 ifTrue:[
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2803
        idx := CommandLineArguments indexOf:'--fastStart'.
10f69cc116aa *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8953
diff changeset
  2804
    ].
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2805
    idx ~~ 0 ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2806
        CommandLineArguments removeAtIndex:idx.
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  2807
    ] ifFalse:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2808
        CallbackSignal := QuerySignal new.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2809
        [
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2810
            Class withoutUpdatingChangesDo:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2811
                (self fileIn:(self commandName , '_r.rc')) ifFalse:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2812
                    "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
  2813
                    self fileIn:'smalltalk_r.rc'
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
        ] on:CallbackSignal do:[:ex|
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2817
            "/ now, display and view-stuff works;
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2818
            "/ back to the previous debugging interface
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2819
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2820
            Inspector := insp.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2821
            Debugger := deb.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2822
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2823
            "/ reinstall Transcript, if not changed during restart.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2824
            "/ 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
  2825
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2826
            (transcript notNil and:[Transcript == Stderr]) ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2827
                Transcript := transcript.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2828
            ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2829
            Initializing := false.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2830
            ex proceed.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2831
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2832
        CallbackSignal := nil.
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2833
    ].
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2834
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2835
    "/ reinitialization (restart) of Display is normally performed
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2836
    "/ 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
  2837
    "/ do in now.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  2838
    Initializing ifTrue:[
8251
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2839
        Display notNil ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2840
            [
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2841
                Display reinitializeFor:Screen defaultDisplayName.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2842
            ] on:Screen deviceOpenErrorSignal do:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2843
                'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2844
                Screen defaultDisplayName errorPrintCR.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2845
                OperatingSystem exit:1.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2846
            ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2847
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2848
        "/ now, display and view-stuff works;
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2849
        "/ back to the previous debugging interface
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2850
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2851
        Inspector := insp.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2852
        Debugger := deb.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2853
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2854
        "/ reinstall Transcript, if not changed during restart.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2855
        "/ 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
  2856
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2857
        (transcript notNil and:[Transcript == Stderr]) ifTrue:[
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2858
            Transcript := transcript.
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2859
        ].
97520a99bcc6 Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents: 8115
diff changeset
  2860
        Initializing := false.
7
bf6f603119df final release before Dispatcher
claus
parents: 5
diff changeset
  2861
    ].
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2862
    Screen notNil ifTrue:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2863
        "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
  2864
         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
  2865
        Screen allScreens copy do:[:eachDisplay |
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2866
            eachDisplay isOpen ifFalse:[
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2867
                '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
  2868
                eachDisplay errorPrintCR.
8524
ad922805e66d Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents: 8522
diff changeset
  2869
                eachDisplay cleanupAfterDispatch; brokenConnection.
8522
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2870
            ]
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2871
        ].
09b3ac13da48 release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents: 8473
diff changeset
  2872
    ].
7
bf6f603119df final release before Dispatcher
claus
parents: 5
diff changeset
  2873
8524
ad922805e66d Avoid dangling references in context
Stefan Vogel <sv@exept.de>
parents: 8522
diff changeset
  2874
    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
  2875
    self mainStartup:true
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  2876
3526
78245608c0b8 no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents: 3523
diff changeset
  2877
    "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
  2878
    "Modified: / 3.8.1999 / 09:42:21 / stefan"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2879
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2880
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2881
start
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2882
    "main startup, if there is a Display, initialize it
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2883
     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
  2884
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  2885
    |idx graphicalMode arg didReadRCFile|
960
e3b75f50d0cd changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
  2886
e3b75f50d0cd changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
  2887
    graphicalMode := true.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2888
    Initializing := true.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2889
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2890
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2891
     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
  2892
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2893
    Class withoutUpdatingChangesDo:[
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2894
        |myName defaultRC prevCatchSetting|
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2895
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2896
        "/
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2897
        "/ 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
  2898
        "/ and handle them;
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2899
        "/ read startup and patches file
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2900
        "/
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2901
        idx := CommandLineArguments indexOf:'-q'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2902
        idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2903
            idx := CommandLineArguments indexOf:'--silent'.
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
        idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2906
            Object infoPrinting:false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2907
            ObjectMemory infoPrinting:false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2908
            CommandLineArguments removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2909
        ].
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
        StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2912
            "/ 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
  2913
            "/ 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
  2914
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2915
            idx := CommandLineArguments indexOf:'-e'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2916
            idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2917
                idx := CommandLineArguments indexOf:'--execute'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2918
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2919
            idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2920
                arg := CommandLineArguments at:idx + 1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2921
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2922
                CommandLineArguments
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2923
                    removeAtIndex:idx+1; removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2924
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2925
                arg = '-' ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2926
                    self fileInStream:Stdin
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2927
                           lazy:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2928
                           silent:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2929
                           logged:false
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2930
                           addPath:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2931
                ] ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2932
                    self fileIn:arg.
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
                self exit
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2935
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2936
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2937
            "/ 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
  2938
            "/ 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
  2939
            idx := CommandLineArguments indexOf:'-E'.
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:'--eval'.
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
                arg := CommandLineArguments at:idx + 1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2945
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2946
                CommandLineArguments
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2947
                    removeAtIndex:idx+1; removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2948
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2949
                self 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2950
                    fileInStream:arg readStream
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2951
                    lazy:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2952
                    silent:nil
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2953
                    logged:false
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2954
                    addPath:nil.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2955
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2956
                self exit
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
        ].
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
        "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
  2961
         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
  2962
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2963
         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
  2964
         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
  2965
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2966
        (CommandLineArguments size == 1 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2967
         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
  2968
            myName := CommandLineArguments removeFirst.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2969
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2970
        myName isNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2971
            idx := CommandLineArguments indexOf:'-f'.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2972
            idx == 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2973
                idx := CommandLineArguments indexOf:'--file'.
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
            idx ~~ 0 ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2976
                myName := CommandLineArguments removeAtIndex:idx+1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2977
                CommandLineArguments removeAtIndex:idx.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2978
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2979
        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2980
        myName notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2981
            CommandName := myName.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2982
            (self secureFileIn:myName) ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2983
                ('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
  2984
                OperatingSystem exit:1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2985
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2986
        ] ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2987
            "/ look for <command>.rc
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2988
            "/ 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
  2989
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2990
            didReadRCFile := false.
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
            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
  2993
            (didReadRCFile := self secureFileIn:myName) ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2994
                StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2995
                    defaultRC := 'smalltalk.rc'
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2996
                ] ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2997
                    defaultRC := 'stxapp.rc'
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  2998
                ].
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
                didReadRCFile := self secureFileIn:defaultRC.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3001
                didReadRCFile ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3002
                    StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3003
                        '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
  3004
                        graphicalMode := false.
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
            "/ ('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
  3010
            "/ ('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
  3011
            "/ ('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
  3012
            "/ ('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
  3013
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3014
            didReadRCFile ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3015
                StandAlone ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3016
                    "/ 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
  3017
                    '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
  3018
                    graphicalMode := false.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3019
                ] ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3020
                    "/ its an application - try harder
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3021
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3022
                    Screen notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3023
                        [
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3024
                            Screen openDefaultDisplay:nil.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3025
                        ] on:Screen deviceOpenErrorSignal do:[:ex|
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3026
                            ('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
  3027
                            '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
  3028
                            '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
  3029
                            HeadlessOperation == true ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3030
                                OperatingSystem exit:1.
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3031
                            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3032
                        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3033
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3034
                        Display notNil ifTrue:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3035
                            (self secureFileIn:'display.rc') ifFalse:[
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3036
                                '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
  3037
                            ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3038
                        ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3039
                    ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3040
                ]
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3041
            ].
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3042
        ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3043
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3044
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
  3045
    StandAlone ifFalse:[
8985
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3046
        "
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3047
         enable the graphical debugger/inspector 
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3048
         (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
  3049
        "
25b8d97917d1 Treat a single command file argument like '-f filename'
Stefan Vogel <sv@exept.de>
parents: 8964
diff changeset
  3050
        self initStandardTools.
963
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
  3051
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3052
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3053
    (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
  3054
        graphicalMode := false.
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3055
    ].
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3056
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3057
    self mainStartup:graphicalMode
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3058
5146
bfe5096a2d06 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5145
diff changeset
  3059
    "Modified: / 24.12.1999 / 00:26:54 / cg"
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3060
! !
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3061
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3062
!Smalltalk class methodsFor:'startup queries'!
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3063
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3064
commandLine
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3065
    "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
  3066
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3067
    ^ CommandLine
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3068
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3069
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3070
     Smalltalk commandLine   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3071
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3072
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3073
    "Created: 19.7.1996 / 11:09:06 / cg"
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3074
!
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3075
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3076
commandLineArgumentNamed:aString
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3077
    "extract a named argument from the command line arguments."
6806
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3078
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3079
    |args index|
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3080
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3081
    args := self commandLineArguments.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3082
    index := args indexOf:aString.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3083
    (index between:1 and:(args size - 1)) ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3084
	^ args at:index+1
6806
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3085
    ].
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3086
    ^ nil.
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3087
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3088
    "
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3089
     self commandLineArgumentNamed:'-display'
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3090
    "
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3091
!
8f0267c644bc Command line argument fetching
Stefan Vogel <sv@exept.de>
parents: 6782
diff changeset
  3092
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3093
commandLineArguments
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3094
    "return the user command line arguments;
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3095
     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
  3096
     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
  3097
     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
  3098
     the commandLineArguments will be #('foo' 'bar' 'baz').
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3099
     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
  3100
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3101
    ^ CommandLineArguments
1580
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3102
fa0156475cc2 remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents: 1578
diff changeset
  3103
    "Modified: 19.7.1996 / 11:11:03 / cg"
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3104
!
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  3105
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3106
commandName
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3107
    "return the excutables name - this is normally 'stx', 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3108
     but can be something else for standAlone apps."
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3109
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3110
    ^ CommandName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3111
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3112
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3113
     Smalltalk commandName
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3114
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3115
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3116
    "Modified: 19.7.1996 / 11:11:16 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3117
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3118
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3119
isHeadless
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3120
    "return true, if this is a headless application
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3121
     i.e. no default Display connection is required/used"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3122
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3123
    ^ HeadlessOperation ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3124
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3125
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3126
     Smalltalk isHeadless   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3127
    "
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
isPlugin
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3131
    "return true, if this is a plugin application
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3132
     i.e. running in a browserWindow"
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3133
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3134
    ^ IsPlugin ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3135
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3136
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3137
     Smalltalk isPlugin   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3138
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3139
!
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  3140
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3141
isStandAloneApp
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3142
    "return true, if this is a standAlone application
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3143
     i.e. a stripped & linked application (such as the webServer)
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3144
     in contrast to a full smalltalk (development) system."
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3145
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3146
    ^ StandAlone ? false
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3147
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3148
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3149
     Smalltalk isStandAloneApp   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3150
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3151
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3152
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3153
startupArguments
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3154
    "return the arguments passed to StartupClass when stx gets started.
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3155
     Usually these are nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3156
     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
  3157
     a simple way to configure and create stand-alone applications"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3158
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3159
    ^ StartupArguments
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3160
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3161
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3162
     Smalltalk startupArguments   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3163
    "
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3164
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3165
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3166
startupClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3167
    "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
  3168
     starts and its non-nil. Usually this is nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3169
     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
  3170
     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
  3171
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3172
    ^ StartupClass
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3173
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3174
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3175
     Smalltalk startupClass   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3176
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3177
!
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  3178
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3179
startupClass:aClass selector:aSymbol arguments:anArrayOrNil
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3180
    "{ Pragma: +optSpace }"
1119
956d62a5656c compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents: 1114
diff changeset
  3181
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3182
    "set the class, selector and arguments to be performed when smalltalk
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3183
     starts. Setting those before saving a snapshot, will make the saved
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3184
     image come up executing your application (instead of the normal mainloop)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3185
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3186
    StartupClass := aClass.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3187
    StartupSelector := aSymbol.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3188
    StartupArguments := anArrayOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3189
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3190
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3191
startupSelector
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3192
    "return the selector, that will be sent to StartupClass.
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3193
     Usually this is nil, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3194
     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
  3195
     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
  3196
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3197
    ^ StartupSelector
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3198
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3199
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3200
     Smalltalk startupSelector   
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3201
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3202
!
7811
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3203
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3204
wasStartedFromImage
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3205
    "return true, if this smalltalk was started from an image, 
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3206
     as opposed to a fresh and clean startup"
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3207
7819
9908e6e36175 wasStartedFromImage fixed
ca
parents: 7811
diff changeset
  3208
    ^ ImageRestartTime notNil
7811
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3209
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3210
    "
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3211
     Smalltalk wasStartedFromImage
22e5323b414c +wasStartedFromImage query
Claus Gittinger <cg@exept.de>
parents: 7779
diff changeset
  3212
    "
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3213
! !
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3214
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3215
!Smalltalk class methodsFor:'system environment'!
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3216
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3217
language
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3218
    "return the language setting"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3219
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3220
    ^ Language
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3221
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3222
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3223
     Smalltalk language
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3224
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3225
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3226
    "Modified: 26.4.1996 / 17:10:05 / cg"
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3227
!
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3228
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3229
language:aLanguageSymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3230
    "set the language"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3231
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3232
    Language := aLanguageSymbol.
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3233
    self changed:#Language
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3234
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3235
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3236
     Smalltalk language:#de
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3237
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3238
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3239
    "Modified: 26.4.1996 / 17:13:34 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3240
!
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3241
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3242
languageTerritory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3243
    "return the language territory setting"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3244
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3245
    ^ LanguageTerritory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3246
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3247
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3248
languageTerritory:aTerritorySymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3249
    "set the language territory"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3250
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3251
    LanguageTerritory := aTerritorySymbol.
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3252
    self changed:#LanguageTerritory
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3253
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3254
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3255
     Time now
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3256
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3257
     Smalltalk languageTerritory:#us.
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3258
     Time now
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3259
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3260
     Smalltalk languageTerritory:#de.
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3261
     Time now    
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3262
    "
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3263
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  3264
    "Modified: 26.4.1996 / 17:12:39 / cg"
7992
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3265
!
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3266
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3267
setLanguage:aLanguageSymbol
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3268
    "set the language withotu change notifications"
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3269
fbf6f1080ba2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7981
diff changeset
  3270
    Language := aLanguageSymbol.
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3271
! !
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  3272
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  3273
!Smalltalk class methodsFor:'system management'!
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  3274
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3275
compressSources
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3276
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3277
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3278
    "compress the sources file, and remove all method source strings
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3279
     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
  3280
     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
  3281
     since we use per-class sourcefiles for the compiled classes,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3282
     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
  3283
     incremental compiled methods.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3284
     Therefore, only those sources which are not coming from compiled
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3285
     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
  3286
     This is being automated - so dont care for now."
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3287
7105
44c02807ca41 More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents: 7085
diff changeset
  3288
    |newStream table source pos fileName|
44c02807ca41 More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents: 7085
diff changeset
  3289
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3290
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3291
     first, find all methods which contain either a string-ref
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3292
     or an external string in the 'st.src' file
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3293
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3294
    newStream := 'src.tmp' asFilename writeStream.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3295
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3296
    table := IdentityDictionary new:100.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3297
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3298
    Method allSubInstancesDo:[:aMethod |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3299
        source := nil.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3300
        aMethod sourcePosition notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3301
            aMethod sourceFilename = 'st.src' ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3302
                source := aMethod source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3303
            ]
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3304
        ] ifFalse:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3305
            source := aMethod source
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3306
        ].
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3307
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3308
        source notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3309
            pos := newStream position1Based.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3310
            newStream nextChunkPut:source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3311
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3312
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3313
             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
  3314
             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
  3315
             untouched.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3316
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3317
            table at:aMethod put:pos
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3318
        ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3319
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3320
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3321
    newStream close.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3322
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3323
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3324
     now, rename the new source file,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3325
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3326
    fileName := (ObjectMemory nameForSources).
1693
1dbf6a20c15e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1688
diff changeset
  3327
    'src.tmp' asFilename renameTo:fileName.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3328
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3329
    "good - now go over all changed methods, and change their
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3330
     source reference"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3331
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3332
    table keysAndValuesDo:[:aMethod :pos |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3333
        aMethod localSourceFilename:fileName position:pos.
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  3334
"/        aMethod printCR.
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
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3338
     Smalltalk compressSources
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3339
    "
1693
1dbf6a20c15e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1688
diff changeset
  3340
2176
1a24b0cef25a when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents: 2170
diff changeset
  3341
    "Modified: 16.1.1997 / 01:25:58 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3342
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3343
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3344
generateSingleSourceFile
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3345
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3346
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3347
    "generate the sources file, and remove all method source strings
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3348
     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
  3349
     This makes the image independent from the per-class source files
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3350
     and makes transportation of endUser applications easier, since
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3351
     only 3 files (executable, image and sourceFile) need to be 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3352
     transported."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3353
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3354
    |newStream table source pos fileName|
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3355
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3356
    newStream := 'src.tmp' asFilename writeStream.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3357
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3358
    table := IdentityDictionary new:100.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3359
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3360
    Method allSubInstancesDo:[:aMethod |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3361
        source := aMethod source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3362
        source notNil ifTrue:[
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3363
            pos := newStream position1Based.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3364
            newStream nextChunkPut:source.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3365
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3366
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3367
             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
  3368
             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
  3369
             untouched.
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3370
            "
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3371
            table at:aMethod put:pos
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3372
        ]
3044
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
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3375
    newStream close.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3376
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3377
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3378
     now, rename the new source file,
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3379
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3380
    fileName := (ObjectMemory nameForSources).
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3381
    'src.tmp' asFilename renameTo:fileName.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3382
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3383
    "good - now go over all changed methods, and change their
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3384
     source reference"
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3385
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3386
    table keysAndValuesDo:[:aMethod :pos |
8760
36b8199be82b #checkNilFilestream no longer needed, since #readStream or #writeStream
Stefan Vogel <sv@exept.de>
parents: 8736
diff changeset
  3387
        aMethod localSourceFilename:fileName position:pos.
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3388
"/        aMethod printCR.
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
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3392
     Smalltalk generateSingleSourceFile
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
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3395
    "Modified: 16.1.1997 / 01:25:58 / cg"
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3396
    "Created: 17.10.1997 / 13:00:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3397
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3398
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3399
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3400
    "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
  3401
     to be loaded from package.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3402
     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
  3403
     (otherwise, the newest revision will be loaded"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3404
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3405
    ^ self 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3406
        installAutoloadedClassNamed:clsName
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3407
        category:cat
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3408
        package:package
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3409
        revision:revisionOrNil
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3410
        numClassInstVars:nil.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3411
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3412
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3413
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil numClassInstVars:numClassInstVarsOrNil
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3414
    "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
  3415
     to be loaded from package.
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3416
     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
  3417
     (otherwise, the newest revision will be loaded"
e32e63ee0d79 extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents: 3866
diff changeset
  3418
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3419
    |clsSym cls|
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3420
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3421
    clsSym := clsName asSymbol.
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3422
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3423
    "/ install if not already compiled-in
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3424
    (cls := self at:clsSym) isNil ifTrue:[
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3425
        Autoload subclass:clsSym
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3426
            instanceVariableNames:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3427
            classVariableNames:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3428
            poolDictionaries:''
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3429
            category:cat
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3430
            inEnvironment:Smalltalk.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3431
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3432
        cls := self at:clsSym.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3433
        cls isNil ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3434
            ('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
  3435
        ] ifFalse:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3436
            cls package:package asSymbol.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3437
            revisionOrNil notNil ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3438
                cls setBinaryRevision:revisionOrNil
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3439
            ]
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3440
        ]    
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3441
    ] ifFalse:[
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3442
        "/ 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
  3443
        package ~= cls package ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3444
            cls package:package asSymbol.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3445
        ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3446
        cat ~= cls category ifTrue:[
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3447
            cls category:cat.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3448
        ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3449
    ].
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3450
    ^ cls.
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3451
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
  3452
    "Created: / 5.11.1998 / 15:10:25 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3453
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3454
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3455
installAutoloadedClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3456
    "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
  3457
     autoloaded. This takes some time ..."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3458
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3459
    |dirsConsulted p|
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3460
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3461
    "/ new scheme: look for a directory called 'packages'
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3462
    "/ and enumerate its abbrev.stc files...
5067
335c866e150c walk packagePath when reading abbrevs & autoloaded classes.
Claus Gittinger <cg@exept.de>
parents: 5065
diff changeset
  3463
    dirsConsulted := Set new.
5162
f7a14d1e17ce checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5160
diff changeset
  3464
f7a14d1e17ce checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5160
diff changeset
  3465
    "/ along the package-path
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3466
    (p := self packagePath) do:[:aPath |
8950
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3467
        (dirsConsulted includes:aPath) ifFalse:[
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3468
            ('Smalltalk [info]: installing autoloaded classes found under ''' , aPath ,'''') infoPrintCR.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3469
            self 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3470
                recursiveInstallAutoloadedClassesFrom:aPath 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3471
                rememberIn:dirsConsulted 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3472
                maxLevels:15 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3473
                noAutoload:false
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3474
                packageTop:aPath.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3475
        ]
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3476
    ].
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3477
    p size == 0 ifTrue:[
8950
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3478
        '../../../stx' asFilename exists ifTrue:[
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3479
            ('Smalltalk [info]: installing autoloaded classes found under ''../../..''') infoPrintCR.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3480
            self 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3481
                recursiveInstallAutoloadedClassesFrom:'../../..' 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3482
                rememberIn:dirsConsulted 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3483
                maxLevels:15 
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3484
                noAutoload:false
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3485
                packageTop:'../../..'.
3d5ecf6e2fc3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8945
diff changeset
  3486
        ].
5788
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3487
    ].
db9dcc37532c care for empty packagePath
Claus Gittinger <cg@exept.de>
parents: 5787
diff changeset
  3488
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3489
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3490
     Smalltalk installAutoloadedClasses
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3491
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3492
5096
9a513c6d8f63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5095
diff changeset
  3493
    "Created: / 14.2.1997 / 17:32:57 / cg"
9a513c6d8f63 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5095
diff changeset
  3494
    "Modified: / 13.12.1999 / 11:56:50 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3495
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3496
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3497
installAutoloadedClassesFrom:anAbbrevFilePath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3498
    "read the given abbreviation file; install all classes found there as
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3499
     autoloaded. This takes some time ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3500
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3501
    |f s|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3502
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3503
    f := self getSystemFileName:anAbbrevFilePath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3504
    f isNil ifTrue:[f := self getPackageFileName:anAbbrevFilePath].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3505
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3506
    f notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3507
	f := f asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3508
	f isDirectory ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3509
	    f := f construct:'abbrev.stc'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3510
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3511
	[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3512
	    s := f readStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3513
	    self installAutoloadedClassesFromStream:s.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3514
	    s close.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3515
	] on:FileStream openErrorSignal do:[:ex| "do nothing"].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3516
    ]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3517
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3518
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3519
     Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3520
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3521
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3522
    "Modified: / 5.11.1998 / 15:10:51 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3523
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3524
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3525
installAutoloadedClassesFromStream:anAbbrevFileStream
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3526
    "read the given abbreviation file; 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3527
     install all classes found there as autoloaded, and also update the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3528
     abbreviation (className-to-fileName mapping) table.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3529
     This takes some time ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3530
8846
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3531
    |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
  3532
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3533
    anAbbrevFileStream isFileStream ifTrue:[
8846
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3534
        abbrevFileName := anAbbrevFileStream pathName.
331baeca30f1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8845
diff changeset
  3535
        info := 'declared from: ', abbrevFileName.
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3536
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3537
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3538
    KnownPackages isNil ifTrue:[
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3539
        KnownPackages := Set new.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3540
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3541
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3542
    "/ yes, create any required nameSpace, without asking user.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3543
    Class createNameSpaceQuerySignal answer:true do:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3544
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3545
        [anAbbrevFileStream atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3546
            l := anAbbrevFileStream nextLine withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3547
            l notEmpty ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3548
                "/ must do it manually, caring for quoted strings.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3549
"/                words := line asCollectionOfWords.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3550
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3551
                words := OrderedCollection new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3552
                s2 := l readStream.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3553
                [s2 atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3554
                    s2 skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3555
                    s2 peek == $' ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3556
                        s2 next.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3557
                        w := s2 upTo:$'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3558
                        s2 skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3559
                    ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3560
                        w := s2 upToSeparator
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3561
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3562
                    words add:w
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3563
                ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3564
                words size < 3 ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3565
                    'Smalltalk [warning]: bad abbrev entry' errorPrint.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3566
                    anAbbrevFileStream isFileStream ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3567
                        ' (in ''' errorPrint. 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3568
                        anAbbrevFileStream pathName errorPrint.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3569
                        ''')' errorPrint
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3570
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3571
                    ': ' errorPrint. l errorPrintCR
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3572
                ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3573
                    clsName := (words at:1) asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3574
                    abbrev := (words at:2).
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3575
                    package := (words at:3) asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3576
                    cat := words at:4 ifAbsent:nil.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3577
                    numClassInstVars := words at:5 ifAbsent:'0'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3578
                    numClassInstVars := Integer readFrom:numClassInstVars onError:[0].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3579
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3580
"/                KnownPackages add:package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3581
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3582
                    (cat size == 0) ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3583
                        cat := 'autoloaded'
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3584
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3585
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3586
                    "/ on the fly, update the abbreviations
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3587
                    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
  3588
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3589
                    "/ '  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
  3590
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3591
                    cls := self 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3592
                        installAutoloadedClassNamed:clsName 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3593
                        category:cat 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3594
                        package:package 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3595
                        revision:nil 
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3596
                        numClassInstVars:numClassInstVars.
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
  3597
8847
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3598
"/                    info notNil ifTrue:[
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3599
"/                        cls setComment:info.
e071c54161d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8846
diff changeset
  3600
"/                    ].
8470
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
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  3603
        ]
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3604
    ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3605
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3606
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3607
loadBinaries
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3608
    "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
  3609
     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
  3610
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3611
    ^ LoadBinaries
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3612
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3613
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3614
loadBinaries:aBoolean
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3615
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3616
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3617
    "turn on/off loading of binary objects"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3618
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3619
    aBoolean ifTrue:[
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3620
	(ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3621
	    LoadBinaries := true.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3622
	    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3623
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3624
	'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
  3625
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3626
    LoadBinaries := false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3627
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3628
    "Modified: 10.1.1997 / 15:11:00 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3629
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3630
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3631
logDoits
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3632
    "return true if doits should go into the changes file
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3633
     as well as changes - by default, this is off, since
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3634
     it can blow up the changes file enormously ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3635
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3636
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3637
    ^ LogDoits
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3638
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3639
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3640
     LogDoits := false
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3641
     LogDoits := true
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3642
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3643
!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3644
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3645
logDoits:aBoolean
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3646
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3647
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3648
    "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
  3649
     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
  3650
     changes file enormously ...
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3651
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3652
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3653
    LogDoits := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3654
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3655
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3656
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3657
makeBytecodeMethods
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3658
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3659
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3660
    "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
  3661
     iff it does not contain primitive C code.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3662
     Experimental and not yet used."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3663
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3664
    Method allSubInstancesDo:[:aMethod |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3665
	|newMethod|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3666
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3667
	aMethod hasPrimitiveCode ifFalse:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3668
	    newMethod := aMethod asByteCodeMethod.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3669
	    newMethod ~~ aMethod ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3670
		aMethod becomeSameAs:newMethod
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
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3674
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
     Smalltalk makeBytecodeMethods
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3677
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3678
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3679
    "Modified: 16.1.1997 / 01:25:58 / cg"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3680
    "Created: 17.10.1997 / 13:52:19 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3681
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3682
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3683
recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3684
    "read all abbrev.stc files from and under aDirectory
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3685
     and install autoloaded classes.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3686
     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
  3687
     (however, the directories are searched for packages)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3688
     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
  3689
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3690
    |abbrevStream dir noAutoloadHere dirName pkgName directoryContents|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3691
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3692
    maxLevels == 0 ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3693
"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3694
	^ self
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3695
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3696
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3697
    dir := aDirectory asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3698
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3699
    (dirsConsulted includes:dir pathName) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3700
	^ self
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3701
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3702
    dirsConsulted add:dir pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3703
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3704
    (dir construct:'NOPACKAGES') exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3705
	^ self.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3706
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3707
    (dir construct:'NOSUBAUTOLOAD') exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3708
	^ self.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3709
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3710
    noAutoloadHere := noAutoloadIn.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3711
    noAutoloadHere ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3712
	(dir construct:'NOAUTOLOAD') exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3713
	    noAutoloadHere := true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3714
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3715
    ] ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3716
	(dir construct:'AUTOLOAD') exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3717
	    noAutoloadHere := false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3718
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3719
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3720
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3721
    ((dir construct:'loadAll') exists
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3722
    or:[(dir construct:'abbrev.stc') exists
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3723
    or:[(dir construct:(dir baseName , '.prj')) exists]]) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3724
	KnownPackages isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3725
	    KnownPackages := Set new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3726
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3727
	dirName := dir pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3728
	pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3729
	KnownPackages add:pkgName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3730
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3731
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3732
    "/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3733
    "/ suppress installation as autoloaded in this and everything
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3734
    "/ below; however, still traverse the directories to find packages ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3735
    "/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3736
    noAutoloadHere ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3737
	[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3738
	    abbrevStream := (dir construct:'abbrev.stc') asFilename readStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3739
	    self installAutoloadedClassesFromStream:abbrevStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3740
	    abbrevStream close.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3741
	] 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
  3742
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3743
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3744
    [
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3745
	directoryContents := dir directoryContents.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3746
    ] on:FileStream openErrorSignal do:[:ex|
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3747
	"non-accessable directory: we are done"
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3748
	^ self
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3749
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3750
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  3751
    directoryContents do:[:aFilename |
7694
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3752
	|f|
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3753
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3754
	(#(
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3755
	    'doc'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3756
	    'CVS'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3757
	    'bitmaps'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3758
	    'resources'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3759
	    'source'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3760
	) includes:aFilename) ifFalse:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3761
	    ((dir baseName ~= 'stx')
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3762
	    or:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3763
		(#(
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3764
		    'configurations'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3765
		    'include'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3766
		    'rules'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3767
		    'stc'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3768
		    'support'
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3769
		) includes:aFilename) not]) 
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3770
	    ifTrue:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3771
		f := dir construct:aFilename.
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3772
		f isDirectory ifTrue:[
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3773
		     self 
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3774
			recursiveInstallAutoloadedClassesFrom:f 
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3775
			rememberIn:dirsConsulted    
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3776
			maxLevels:maxLevels-1
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3777
			noAutoload:noAutoloadHere
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3778
			packageTop:packageTopPath.
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
	    ]
a154c7582eca fileNameForClass no longer uses abbreviations
Claus Gittinger <cg@exept.de>
parents: 7670
diff changeset
  3781
	].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3782
    ].
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3783
5117
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  3784
    "
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  3785
     Smalltalk installAutoloadedClasses
af187fd23a8a checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5113
diff changeset
  3786
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3787
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3788
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3789
replaceReferencesTo:anObject with:newRef
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3790
    |toAdd|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3791
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3792
    toAdd := OrderedCollection new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3793
    self keysAndValuesDo:[:key :val |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3794
	(key == anObject) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3795
	    self shouldImplement.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3796
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3797
	(val == anObject ) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3798
	    toAdd add:(key -> newRef)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3799
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3800
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3801
    toAdd do:[:each |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3802
	self at:(each key) put:(each value)
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
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3806
saveEmergencyImage:aBoolean
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3807
    "set/clear the flag which controls if ST/X should save an
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3808
     emergency image in case of a broken display connection.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3809
     The default is true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3810
     This may be useful, if you work with an unsecure display
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3811
     (serial line), and want to have a chance of proceeding after
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3812
     a crash. In multiheaded applications, this only affects 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3813
     crashes of the master Display connection (the initial connection);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3814
     errors on other displays are reported to the views and treated
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3815
     like window destroy from the windowManager."
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  3816
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  3817
    SaveEmergencyImage := aBoolean
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  3818
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
  3819
    "Modified: / 24.10.1997 / 18:22:26 / cg"
8583
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
systemOrganization
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3823
    "for partial ST80 compatibility;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3824
     In ST80, Smalltalk organization returns a systemOrganizer, which
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3825
     keeps track of class-categories, while all classes return a classOrganizer
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3826
     from #organization, which keeps track of method categories of that class.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3827
     Since in ST/X, Smalltalk is a class, there is now a conflict.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3828
     To make a workaround possible, use #systemOrganization when porting
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3829
     VW apps to ST/X to get the class-categories.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3830
     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
  3831
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  3832
    ^ SystemOrganizer for:nil
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  3833
5a69787e857c added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents: 3624
diff changeset
  3834
    "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
  3835
    "Modified: / 20.6.1998 / 12:41:34 / 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
!Smalltalk class methodsFor:'system management-fileIn'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3839
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3840
fileIn:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3841
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3842
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3843
     This method can load almost anything which makes sense:
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3844
	.st    - source files
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3845
	.cls   - binary smalltalk bytecode files
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3846
	.so    - binary compiled machine code class libraries
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3847
	[.class - java bytecode -- soon to come]"
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3848
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3849
    ^ self fileIn:aFileName lazy:nil silent:nil logged:false 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3850
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3851
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3852
     Smalltalk fileIn:'source/TicTacToe.st'
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  3853
     Smalltalk fileIn:'binary/TicTacToe.cls'
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  3854
     Smalltalk fileIn:'binary/TicTacToe.so'
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3855
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3856
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3857
    "Created: 28.10.1995 / 17:06:28 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3858
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3859
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3860
fileIn:aFileName inPackage:aPackageID
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3861
    "read in the named file in a packages directory."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3862
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3863
    |dir|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3864
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3865
    dir := self getPackageDirectoryForPackage:aPackageID.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3866
    dir isNil ifTrue:[^ false].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3867
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3868
    dir := dir asFilename.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3869
    ^ (self fileIn:(dir construct:aFileName))
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3870
      or:[ self fileIn:((dir construct:'source') construct:aFileName) ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3871
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3872
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3873
fileIn:aFileName lazy:lazy
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3874
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3875
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3876
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3877
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3878
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3879
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3880
     code which is known to be syntactically correct."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3881
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3882
    ^ self fileIn:aFileName lazy:lazy silent:nil logged:false 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3883
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3884
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3885
     Smalltalk fileIn:'source/TicTacToe.st' lazy:true
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3886
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3887
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3888
    "Created: 28.10.1995 / 17:06:36 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3889
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3890
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3891
fileIn:aFileName lazy:lazy silent:silent
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3892
    "read in the named file - look for it in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3893
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3894
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3895
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3896
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3897
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3898
     code which is known to be syntactically correct.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3899
     If silent is true, no compiler messages are output to the transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3900
     Giving nil for silent/lazy will use the current settings."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3901
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3902
    ^ self fileIn:aFileName lazy:lazy silent:silent logged:false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3903
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3904
    "Created: 28.10.1995 / 17:06:41 / 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:aFileNameOrString lazy:lazy silent:silent logged:logged
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
     This method can load almost anything which makes sense:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3918
	.st    - source files
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3919
	.cls   - binary smalltalk bytecode files
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3920
	.so    - binary compiled machine code class libraries
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3921
	[.class - java bytecode -- soon to come]"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3922
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3923
    |fileNameString aStream path morePath bos|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3924
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3925
    fileNameString := aFileNameOrString asString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3926
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3927
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3928
     an object or shared object ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3929
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3930
    (ObjectFileLoader notNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3931
    and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3932
	"/ LoadBinaries ifFalse:[^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3933
	path := self getBinaryFileName:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3934
	path isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3935
	    path := self getSystemFileName:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3936
	].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3937
	path isNil ifTrue:[^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3938
	^ (ObjectFileLoader loadObjectFile:path) notNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3939
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3940
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3941
    (fileNameString asFilename hasSuffix:'cls') ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3942
	BinaryObjectStorage notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3943
	    aStream := self systemFileStreamFor:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3944
"/            path := self getBinaryFileName:fileNameString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3945
"/            path isNil ifTrue:[^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3946
"/            aStream := path asFilename readStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3947
	    aStream notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3948
		aStream binary.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3949
		bos := BinaryObjectStorage onOld:aStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3950
		bos next.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3951
		bos close.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3952
		^ true
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3953
	    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3954
	    ^ false
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
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3958
    (fileNameString startsWith:'source/') ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3959
	aStream := self sourceFileStreamFor:(fileNameString copyFrom:8)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3960
    ] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3961
	(fileNameString startsWith:'fileIn/') ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3962
	    aStream := self fileInFileStreamFor:(fileNameString copyFrom:8)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3963
	] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  3964
	    aStream := self systemFileStreamFor:fileNameString.
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3965
	    aStream isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3966
		OperatingSystem isUNIXlike ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3967
		    (fileNameString startsWith:'/') ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3968
			aStream := self systemFileStreamFor:('lib/' , fileNameString).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3969
		    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3970
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3971
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3972
	    (aStream notNil and:[fileNameString includes:$/]) ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3973
		"/ temporarily prepend the files directory
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3974
		"/ to the searchPath.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3975
		"/ This allows fileIn-driver files to refer to local
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3976
		"/ files via a relative path, and drivers to fileIn other
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3977
		"/ drivers ...
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3978
		morePath := aStream pathName asFilename directoryName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3979
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  3980
	]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3981
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3982
    aStream isNil ifTrue:[^ false].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3983
    ^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3984
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3985
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3986
     Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3987
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  3988
3952
05c36f8e87b4 fixed fileIn of byteCode (.cls) files
Claus Gittinger <cg@exept.de>
parents: 3915
diff changeset
  3989
    "Modified: / 16.2.1999 / 10:03:26 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3990
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3991
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3992
fileIn:aFileName logged:logged
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3993
    "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
  3994
     return true if ok, false if failed.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3995
     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
  3996
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3997
    ^ self fileIn:aFileName lazy:nil silent:nil logged:logged 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3998
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3999
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4000
     Smalltalk fileIn:'source/TicTacToe.st' logged:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4001
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4002
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4003
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4004
fileInChanges
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4005
    "read in the last changes file - bringing the system to the state it
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4006
     had when left the last time.
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4007
     WARNING: this method is rubbish: it should only read things after the
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4008
	      last '**snapshot**' - entry 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4009
	      (instead of the complete changes file)."
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  4010
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4011
    "
400
claus
parents: 396
diff changeset
  4012
     do NOT update the changes file now ...
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4013
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4014
    self fileIn:ChangeFileName logged:false
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
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4017
     Smalltalk fileInChanges 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4018
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4019
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  4020
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4021
fileInClass:aClassName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4022
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4023
     search is in some standard places trying driver-file (.ld), object-file (.o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4024
     finally source file (.st) in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4025
     The file is first searched for using the class name, then the abbreviated name."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4026
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4027
    ^ self 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4028
	fileInClass:aClassName 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4029
	package:nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4030
	initialize:true 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4031
	lazy:false 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4032
	silent:nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4033
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4034
    "Modified: / 9.1.1998 / 14:41:46 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4035
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4036
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4037
fileInClass:aClassName fromObject:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4038
    "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
  4039
     - look for it in some standard places.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4040
     Only install the named class from this object file.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4041
     Return true if ok, false if failed."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4042
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4043
    |path ok|
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4045
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4046
     check if the dynamic loader class is in
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4047
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4048
    (LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4049
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4050
    (path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4051
    ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil.
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4052
    ok ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4053
	SilentLoading ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4054
	    Transcript show:'  loaded ' , aClassName , ' from ' ; showCR:aFileName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4055
	]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4056
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4057
    ^ ok
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
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4060
     Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4061
     Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4062
    "
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
    "Modified: 10.9.1996 / 20:43:52 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4065
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4066
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4067
fileInClass:aClassName initialize:doInit
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4068
    "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
  4069
     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
  4070
     finally source file (.st) in that order.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4071
     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
  4072
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4073
    ^ self 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4074
	fileInClass:aClassName 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4075
	package:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4076
	initialize:doInit 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4077
	lazy:false 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4078
	silent:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4079
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4080
    "Modified: / 9.1.1998 / 14:42:02 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4081
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4082
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4083
fileInClass:aClassName initialize:doInit lazy:loadLazy
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4084
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4085
     search is in some standard places trying driver-file (.ld), object-file (.o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4086
     finally source file (.st) in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4087
     The file is first searched for using the class name, then the abbreviated name."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4088
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4089
     ^ self 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4090
	fileInClass:aClassName 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4091
	package:nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4092
	initialize:doInit 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4093
	lazy:loadLazy 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4094
	silent:nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4095
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4096
    "Modified: / 9.1.1998 / 14:42:19 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4097
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4098
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4099
fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent 
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4100
    "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
  4101
     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
  4102
     finally source file (.st), in that order.
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4103
     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
  4104
     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
  4105
     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
  4106
     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
  4107
     nil uses the value from SilentLoading."
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4108
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4109
    ^ self
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4110
	fileInClass:aClassName 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4111
	package:nil
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4112
	initialize:doInit 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4113
	lazy:loadLazy 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4114
	silent:beSilent
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4115
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4116
    "Modified: / 9.1.1998 / 14:42:28 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4117
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4118
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4119
fileInClass:aClassName package:package initialize:doInit lazy:loadLazy silent:beSilent 
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4120
    "find a source/object file for aClassName and -if found - load it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4121
     This is the workhorse for autoloading.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4122
     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4123
     finally source file (.st), in that order.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4124
     The file is first searched for using the class name, then the abbreviated name.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4125
     The argument doInit controlls if the class should be sent a #initialize after the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4126
     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4127
     should not send notes to the transcript; it can be true, false or nil, where
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4128
     nil uses the value from SilentLoading."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4129
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4130
    |classFileName alternativeClassFileName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr 
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4131
     fn packageDir packageFile bos|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4132
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4133
    wasLazy := Compiler compileLazy:loadLazy.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4134
    beSilent notNil ifTrue:[
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4135
        wasSilent := self silentLoading:beSilent.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4136
    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4137
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4138
    classFileName := Smalltalk fileNameForClass:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4139
    (classFileName = aClassName) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4140
        "/ no abbrev.stc translation for className 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4141
        (aClassName includes:$:) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4142
            "/ a nameSpace name
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4143
            alternativeClassFileName := classFileName copyFrom:(classFileName lastIndexOf:$:)+1
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4144
        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4145
    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4146
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4147
    classFileName := classFileName copyReplaceAll:$: with:$_.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4148
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4149
    [
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4150
        Class withoutUpdatingChangesDo:
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4151
        [
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4152
            |zarFn zar entry|
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
            ok := false.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4155
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4156
            package notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4157
                packageDir := package asString.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4158
                packageDir := packageDir copyReplaceAll:$: with:$/.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4159
            ].
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
            Class packageQuerySignal answer:package
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4162
            do:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4163
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4164
                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4165
                 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
  4166
                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4167
                (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
  4168
                ifFalse:[
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
                     try abbreviated driver-file (in fileIn/xxx.ld)
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
                    alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4173
                        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
  4174
                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4175
                    ok ifFalse:[
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
                         then, if dynamic linking is available, 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4178
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4179
                        (LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4180
                            sharedLibExtension := ObjectFileLoader sharedLibraryExtension.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4181
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
                             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
  4184
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4185
                            libName := self libraryFileNameOfClass:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4186
                            libName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4187
                                (ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4188
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4189
                                    sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4190
                                        ok := self fileInClass:aClassName fromObject:(libName, '.o')
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4191
                                    ]
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
                            ].
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
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4196
                             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
  4197
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4198
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4199
                                (ok := self fileInClass:aClassName fromObject:(classFileName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4200
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4201
                                    sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4202
                                        ok := self fileInClass:aClassName fromObject:(classFileName, '.o')
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4203
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4204
                                    ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4205
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4206
                                            (ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, sharedLibExtension))
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4207
                                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4208
                                                sharedLibExtension ~= '.o' ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4209
                                                    ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, '.o')
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
                                        ].
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
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4215
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4216
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4217
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4218
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4219
                         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
  4220
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4221
                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4222
                            (ok := self fileIn:(classFileName , '.cls') lazy:loadLazy silent:beSilent)
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
                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4225
                                    ok := self fileIn:(alternativeClassFileName , '.cls') lazy:loadLazy silent:beSilent
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
                         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
  4231
                         look for an st-cls file 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4232
                         in a package subdir of the source-directory ...
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
                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4235
                            (packageDir notNil and:[BinaryObjectStorage notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4236
                                packageFile := self getPackageFileName:(packageDir , '/classes/' , classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4237
                                packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4238
                                    packageFile := (packageDir , '/classes/' , classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4239
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4240
                                (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4241
                                ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4242
                                    alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4243
                                        packageFile := self getPackageFileName:(packageDir , '/classes/' , alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4244
                                        packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4245
                                            packageFile := (packageDir , '/classes/' , alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4246
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4247
                                        ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4248
                                    ]
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
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4251
                                zarFn := self getPackageFileName:(packageDir , '/classes.zip').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4252
                                zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4253
                                    zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4254
                                    zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4255
                                        entry := zar extract:(classFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4256
                                        (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4257
                                            entry := zar extract:(alternativeClassFileName , '.cls').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4258
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4259
                                        entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4260
                                            bos := BinaryObjectStorage onOld:(entry asByteArray readStream).
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4261
                                            bos next.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4262
                                            bos close.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4263
                                            ok := true
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
                            ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4268
                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4269
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4270
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4271
                         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
  4272
                        "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4273
                        ok ifFalse:[                   
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4274
                            fn := classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4275
                            (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4276
                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4277
                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4278
                                    fn := alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4279
                                    ok := self fileIn:fn lazy:loadLazy silent:beSilent
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
                                ok ifFalse:[
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
                                     ... and in the standard source-directory
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
                                    fn := 'source/' , classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4286
                                    (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4287
                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4288
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4289
                                            fn := 'source/' , alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4290
                                            ok := self fileIn:fn lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4291
                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4292
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4293
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4294
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4295
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4296
                             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
  4297
                             look for an st-source file 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4298
                             in a package subdir of the source-directory ...
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4299
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4300
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4301
                                packageDir notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4302
                                    packageFile := self getPackageFileName:(packageDir , '/source/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4303
                                    packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4304
                                        packageFile := (packageDir , '/source/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4305
                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4306
                                    fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4307
                                    (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4308
                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4309
                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4310
                                            packageFile := self getPackageFileName:(packageDir , '/source/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4311
                                            packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4312
                                                packageFile := (packageDir , '/source/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4313
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4314
                                            fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4315
                                            ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4316
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4317
                                        ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4318
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4319
                                            packageFile := self getPackageFileName:(packageDir , '/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4320
                                            packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4321
                                                packageFile := (packageDir , '/' , classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4322
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4323
                                            fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4324
                                            (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4325
                                            ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4326
                                                alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4327
                                                    packageFile := self getPackageFileName:(packageDir , '/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4328
                                                    packageFile isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4329
                                                        packageFile := (packageDir , '/' , alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4330
                                                    ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4331
                                                    fn := packageFile.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4332
                                                    ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4333
                                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4334
                                                ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4335
                                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4336
                                                     ... and in the standard source-directory
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4337
                                                    "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4338
                                                    fn := 'source/' , packageDir , '/' , classFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4339
                                                    (ok := self fileIn:fn lazy:loadLazy silent:beSilent)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4340
                                                    ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4341
                                                        alternativeClassFileName notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4342
                                                            fn := 'source/' , packageDir , '/' , alternativeClassFileName , '.st'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4343
                                                            ok := self fileIn:fn lazy:loadLazy silent:beSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4344
                                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4345
                                                    ]
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
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4348
                                        ].
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
                                ]
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
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4353
                             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
  4354
                             look for a zipArchive containing a class entry.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4355
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4356
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4357
                                packageDir notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4358
                                    zarFn := self getPackageFileName:(packageDir , '/source.zip').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4359
                                    zarFn isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4360
                                        zarFn := packageDir asFilename withSuffix:'zip'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4361
                                        zarFn := self getSourceFileName:zarFn.
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
                                    zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4364
                                        zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4365
                                        zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4366
                                            entry := zar extract:(classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4367
                                            (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4368
                                                entry := zar extract:(alternativeClassFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4369
                                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4370
                                            entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4371
                                                fn := zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4372
                                                ok := self 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4373
                                                        fileInStream:(entry asString readStream)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4374
                                                        lazy:loadLazy 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4375
                                                        silent:beSilent 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4376
                                                        logged:false
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4377
                                                        addPath:nil
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
                                        ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4380
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4381
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4382
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4383
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4384
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4385
                             if that did not work, 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4386
                             look for a zipArchive containing a class entry.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4387
                            "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4388
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4389
                                zarFn := self getSourceFileName:'source.zip'.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4390
                                zarFn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4391
                                    zar := ZipArchive oldFileNamed:zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4392
                                    zar notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4393
                                        entry := zar extract:(zarFn := classFileName , '.st').
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4394
                                        (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4395
                                            entry := zar extract:(zarFn := alternativeClassFileName , '.st').
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
                                        entry notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4398
                                            fn := zarFn.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4399
                                            ok := self 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4400
                                                    fileInStream:(entry asString readStream)
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4401
                                                    lazy:loadLazy 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4402
                                                    silent:beSilent 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4403
                                                    logged:false
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4404
                                                    addPath:nil
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4405
                                        ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4406
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4407
                                ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4408
                            ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4409
                            ok ifFalse:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4410
                                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4411
                                 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
  4412
                                "
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4413
                                (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4414
                                    inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4415
                                    inStream notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4416
                                        fn := nil.
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4417
                                        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
  4418
                                    ]
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4419
                                ].
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4420
                            ].
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
        ].
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
        ok ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4428
            newClass := self at:(aClassName asSymbol).
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4429
            newClass notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4430
                fn notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4431
                    newClass classFilename isNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4432
                        newClass setClassFilename:fn
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4433
                    ].
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
                doInit ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4437
                    newClass initialize
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
        ].
6421
58dca33cf0fc #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 6403
diff changeset
  4441
    ] ensure:[
7763
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4442
        Compiler compileLazy:wasLazy. 
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4443
        wasSilent notNil ifTrue:[
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4444
            self silentLoading:wasSilent
57ce55fe7a30 fixed fileIn of namespace-classes for which there is
penk
parents: 7759
diff changeset
  4445
        ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4446
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4447
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4448
    ^ newClass
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4449
3155
35befc38f4f1 added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents: 3096
diff changeset
  4450
    "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
  4451
    "Modified: / 5.6.1999 / 14:53:01 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4452
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4453
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4454
fileInClassLibrary:aClassLibraryName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4455
    "find an object file containing a binary class library in some standard places
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4456
     and load it. This install all of its contained classes.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4457
     Return true if ok, false if not.
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4458
     Notice: the argument may not have an extension (by purpose);
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4459
	     the sharedLib extension (.dll / .so / .sl) is added here, to
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4460
	     make the caller independent of the underlying operatingSystem."
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4461
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4462
    |path fn|
3044
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
    ObjectFileLoader isNil ifTrue:[^ false].
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4465
6837
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4466
    fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
6836
11fd536a8e02 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6819
diff changeset
  4467
    fn := fn pathName.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4468
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4469
    path := self getBinaryFileName:fn.
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4470
    path isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4471
	path := self getSystemFileName:fn.
4712
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4472
    ].
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4473
    path isNil ifTrue:[^ false].
68ef0760af79 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4691
diff changeset
  4474
4714
5da464c01bfd Fix #fileInClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 4712
diff changeset
  4475
    ^ (ObjectFileLoader loadObjectFile:path) notNil
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4476
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4477
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4478
     Smalltalk fileInClassLibrary:'libtable'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4479
     Smalltalk fileInClassLibrary:'binary/libwidg3'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4480
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4481
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4482
    "Modified: 8.1.1997 / 17:58:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4483
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4484
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4485
fileInClassLibrary:aClassLibraryName inPackage:packageID
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4486
    "find an object file containing a binary class library in some standard places
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4487
     and load it. This install all of its contained classes.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4488
     Return true if ok, false if not.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4489
     Notice: the argument may not have an extension (by purpose);
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4490
	     the sharedLib extension (.dll / .so / .sl) is added here, to
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4491
	     make the caller independent of the underlying operatingSystem."
6025
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4492
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4493
    |path fn|
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4494
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4495
    ObjectFileLoader isNil ifTrue:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4496
6837
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4497
    fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
505a9c83c1a0 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6836
diff changeset
  4498
    fn := fn pathName.
6025
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4499
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4500
    path := self getPackageDirectoryForPackage:packageID.
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4501
    path isNil ifTrue:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4502
    path := path asFilename construct:fn.
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4503
    path exists ifFalse:[^ false].
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4504
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4505
    ^ (ObjectFileLoader loadObjectFile:path pathName) notNil
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4506
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4507
    "
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4508
     Smalltalk fileInClassLibrary:'libtable'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4509
     Smalltalk fileInClassLibrary:'binary/libwidg3'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4510
     Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser'
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4511
    "
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4512
b5822854231c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 6020
diff changeset
  4513
    "Modified: 8.1.1997 / 17:58:56 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4514
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4515
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4516
fileInStream:streamArg
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4517
    ^ 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
  4518
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4519
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4520
fileInStream:streamArg lazy:lazy silent:silent logged:logged addPath:morePath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4521
    "read sourceCode from aStream;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4522
     return true if ok, false if failed.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4523
     If lazy is true, no code is generated for methods, instead stubs
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4524
     are created which compile themself when first executed. This allows
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4525
     for much faster fileIn (but slows down the first execution later).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4526
     Since no syntax checks are done when doing lazy fileIn, use this only for
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4527
     code which is known to be syntactically correct.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4528
     If silent is true, no compiler messages are output to the transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4529
     Giving nil for silent/lazy will use the current settings.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4530
     If morePath is nonNil, it is prepended to the systemPath temporarily during the
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4531
     fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4532
     using a relative path."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4533
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4534
    |inStream decoder wasLazy wasSilent oldSystemPath oldRealPath encoding|
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4535
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4536
    inStream := streamArg.
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4537
    inStream isNil ifTrue:[^ false].
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4538
8711
c5f28b4c719d guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents: 8695
diff changeset
  4539
    encoding := CharacterEncoder guessEncodingOfStream:inStream.
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4540
    encoding notNil ifTrue:[
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4541
        decoder := CharacterEncoder encoderFor:encoding.
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4542
        inStream := EncodedStream stream:inStream encoder:decoder.
8712
bcef3a0c0a1d skipEncodingCHunk now in EncodedStream
Claus Gittinger <cg@exept.de>
parents: 8711
diff changeset
  4543
        inStream skipEncodingChunk.
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4544
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4545
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4546
    lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4547
    silent notNil ifTrue:[wasSilent := self silentLoading:silent].
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4548
    morePath notNil ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4549
        oldSystemPath := SystemPath copy.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4550
        SystemPath addFirst:morePath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4551
        oldRealPath := RealSystemPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4552
        RealSystemPath := nil.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4553
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4554
    [
8695
8240c22db37b Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 8675
diff changeset
  4555
        (Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[
8240c22db37b Use SignalSets instead of nested handlers.
Stefan Vogel <sv@exept.de>
parents: 8675
diff changeset
  4556
            inStream fileIn.
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4557
        ]
6421
58dca33cf0fc #valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents: 6403
diff changeset
  4558
    ] ensure:[
8317
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4559
        morePath notNil ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4560
            "take care, someone could have changed SystemPath during fileIn!!"
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4561
            (SystemPath copyFrom:2) = oldSystemPath ifTrue:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4562
                SystemPath := oldSystemPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4563
                RealSystemPath := oldRealPath.
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4564
            ] ifFalse:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4565
                (oldSystemPath includes:morePath) ifFalse:[
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4566
                    SystemPath remove:morePath ifAbsent:[].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4567
                ].
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
            ].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4570
        ].
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4571
        lazy notNil ifTrue:[Compiler compileLazy:wasLazy]. 
af17d81a91f5 Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents: 8278
diff changeset
  4572
        silent notNil ifTrue:[self silentLoading:wasSilent].
8445
b6c4e1aa13af care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents: 8405
diff changeset
  4573
        inStream close
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4574
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4575
    ^ true
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4576
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4577
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4578
     Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4579
    "
1896
71760df55ce5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  4580
71760df55ce5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1850
diff changeset
  4581
    "Modified: 5.11.1996 / 20:03:35 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4582
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4584
isClassLibraryLoaded:name
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4585
    "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
  4586
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4587
    ObjectMemory 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4588
	binaryModuleInfo 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4589
	    do:[:entry | 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4590
		   entry type == #classLibrary ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4591
		       entry libraryName = name ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4592
			  ^ true        "/ already loaded
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4593
		       ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4594
		   ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4595
	       ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4596
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4597
    ^ false
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
     Smalltalk isClassLibraryLoaded:'libbasic'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4601
     Smalltalk isClassLibraryLoaded:'libwidg3'
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
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4604
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4605
loadClassLibraryIfAbsent:name
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4606
    "dynamically load a classLibrary, if not already loaded
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4607
     and the system supports dynamic loading.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4608
     Return true, if the library is loaded, false if not.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4609
     This entry is called without system specific filename
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4610
     extensions - it is portable among different architectures
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4611
     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
  4612
     are be present ..."
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4613
5881
81a349eab73c added #isClassLibraryLoaded:
Claus Gittinger <cg@exept.de>
parents: 5878
diff changeset
  4614
    (self isClassLibraryLoaded:name) ifTrue:[ ^ true ].  "/ already loaded
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4615
    ^ self fileInClassLibrary:name
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4616
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4617
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4618
     Smalltalk loadClassLibraryIfAbsent:'libbasic'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4619
     Smalltalk loadClassLibraryIfAbsent:'libwidg3'
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4620
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4621
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4622
    "Modified: 31.10.1996 / 16:57:24 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4623
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4624
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4625
secureFileIn:aFileName 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4626
    "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
  4627
     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
  4628
    
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4629
    |retVal|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4630
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4631
    retVal := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4632
    (SignalSet with:AbortOperationRequest with:TerminateProcessRequest) 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4633
        handle:[:ex | ex return ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4634
        do:[ retVal := self fileIn:aFileName ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4635
    ^ retVal
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4636
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4637
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4638
silentFileIn:aFilename
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4639
    "same as fileIn:, but do not output 'compiled...'-messages on Transcript.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4640
     Main use is during startup."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4641
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4642
    |wasSilent|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4643
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4644
    wasSilent := self silentLoading:true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4645
    [
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4646
	self fileIn:aFilename
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4647
    ] ensure:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4648
	self silentLoading:wasSilent
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4649
    ]
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4650
! !
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4651
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4652
!Smalltalk class methodsFor:'system management-files'!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4653
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4654
bitmapFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4655
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4656
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4657
     Searches in subdirectories named 'bitmaps' in the SystemPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4658
     Notice: this does not look in the package-specific bitmaps directories."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4659
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4660
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4661
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4662
    aString := self getBitmapFileName:aFileName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4663
    aString notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4664
	^ aString asFilename readStreamOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4665
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4666
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4667
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4668
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4669
bitmapFromFileNamed:aFileName forClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4670
    "search aFileName in some standard places:
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4671
     first in the redefinable bitmaps path, 
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4672
     then in the classes own package directory if existing.
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4673
     Return an image or nil."
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4674
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  4675
    ^ self imageFromFileNamed:aFileName inPackage:(aClass package)
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4676
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4677
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4678
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' forClass:View
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4679
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4680
!
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  4681
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4682
bitmapFromFileNamed:aFileName inPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4683
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4684
     first in the redefinable bitmaps path, 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4685
     then in the package directory if existing.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4686
     Return an image or nil."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4687
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4688
    ^ self imageFromFileNamed:aFileName inPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4689
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4690
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4691
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4692
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4693
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4694
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4695
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4696
classNameForFile:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4697
    "return the className which corresponds to an abbreviated fileName,
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4698
     or nil if no special translation applies. The given filename arg may
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4699
     include a '.st' suffix (but no other)."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4700
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4701
    |fn|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4702
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4703
    (aFileName asFilename hasSuffix:'st') ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4704
	fn := aFileName copyWithoutLast:3
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4705
    ] ifFalse:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4706
	fn := aFileName
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4707
    ].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4708
    ^ self filenameAbbreviations keyAtEqualValue:fn ifAbsent:[fn].
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4709
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4710
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4711
     Smalltalk classNameForFile:'DrawObj'  
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4712
     Smalltalk classNameForFile:'DrawObj.st' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4713
     Smalltalk classNameForFile:'ArrColl.st' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4714
     Smalltalk classNameForFile:'ArrColl.chg' 
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4715
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4716
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  4717
    "Modified: 11.12.1995 / 14:51:10 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4718
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4719
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4720
constructPathFor:aDirectoryName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4721
    "search for aDirectory in SystemPath; 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4722
     return a collection of pathes which include that directory."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4723
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4724
    ^ self realSystemPath select:[:dirName |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4725
	|fullPath|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4726
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4727
	fullPath := dirName asFilename construct:aDirectoryName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4728
	"/ fullPath exists and:[fullPath isDirectory and:[fullPath isReadable]]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4729
	fullPath isDirectory and:[fullPath isReadable]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4730
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4731
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4732
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4733
fileInFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4734
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4735
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4736
     Searches in subdirectories named 'fileIn' in SystemPath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4737
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4738
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4739
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4740
    aString := self getFileInFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4741
    aString notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4742
	^ aString asFilename readStreamOrNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4743
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4744
    ^ nil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4745
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4746
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4747
fileNameForClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4748
    "return a filename for aClassOrClassName"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4749
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4750
    |cls nm1 nm2|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4751
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4752
    aClassOrClassName isBehavior ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4753
        nm1 := aClassOrClassName theNonMetaclass name.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4754
        nm2 := aClassOrClassName theNonMetaclass nameWithoutPrefix.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4755
    ] ifFalse:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4756
        cls := Smalltalk classNamed:aClassOrClassName.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4757
        cls notNil ifTrue:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4758
            nm1 := cls theNonMetaclass name.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4759
            nm2 := cls theNonMetaclass nameWithoutPrefix.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4760
        ] ifFalse:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4761
            nm1 := aClassOrClassName.
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4762
            nm2 := (aClassOrClassName copyFrom:(aClassOrClassName lastIndexOf:$:)+1).
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4763
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4764
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4765
    nm1 := nm1 asSymbol.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4766
    nm2 := nm2 asSymbol.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4767
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4768
    CachedAbbreviations notNil ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4769
        (CachedAbbreviations includesKey:nm1) ifTrue:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4770
            ^ CachedAbbreviations at:nm1
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4771
        ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4772
        (CachedAbbreviations includesKey:nm2) ifTrue:[
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4773
            ^ CachedAbbreviations at:nm2
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4774
        ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4775
    ].
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4776
    ^ nm1 copyReplaceAll:$: with:$_
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  4777
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4778
    "
7723
ed4ce2184b37 Fix #filenameForClass: handling of abbreviations
Stefan Vogel <sv@exept.de>
parents: 7704
diff changeset
  4779
     Smalltalk fileNameForClass:#Complex    
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4780
     Smalltalk fileNameForClass:'SmallInteger'    
3678
606bf9fca8f2 infoPrint.
Claus Gittinger <cg@exept.de>
parents: 3627
diff changeset
  4781
     Smalltalk fileNameForClass:'UnixOperatingSystem' 
4746
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  4782
     Smalltalk fileNameForClass:'Launcher'        
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4783
     Smalltalk fileNameForClass:'SomeUnknownClass' 
4746
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  4784
     Smalltalk fileNameForClass:OSI::FTAMOperation 
062aa9dc0f3d fixed fileName guessing
Claus Gittinger <cg@exept.de>
parents: 4741
diff changeset
  4785
     Smalltalk fileNameForClass:'OSI::Foobar' 
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4786
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4787
6151
e36a9b339582 isMeta/soleInstance -> theMetaclass / theNonMetaclass
Claus Gittinger <cg@exept.de>
parents: 6121
diff changeset
  4788
    "Modified: / 5.11.2001 / 16:49:17 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4789
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4790
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4791
filenameAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4792
    "return a dictionary containing the classname-to-filename
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4793
     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
  4794
     to 14 chars)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4795
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4796
    CachedAbbreviations isNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4797
	self readAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4798
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4799
    ^ CachedAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4800
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4801
    "flush with:
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4802
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4803
     CachedAbbreviations := nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4804
    "
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
     Smalltalk filenameAbbreviations
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4807
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4808
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4809
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4810
flushPathCaches
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4811
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4812
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4813
    "forget pathCaches - these are collections containing valid directory names,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4814
     where system files (resource, bitmaps etc.) are found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4815
     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
  4816
     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
  4817
     (for example, if you created a private resource directory)"
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
    RealSystemPath := ResourcePath := SourcePath := 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4820
    BitmapPath := BinaryPath := FileInPath := nil
2378
e76870d427ee commentary
ca
parents: 2374
diff changeset
  4821
e76870d427ee commentary
ca
parents: 2374
diff changeset
  4822
    "
e76870d427ee commentary
ca
parents: 2374
diff changeset
  4823
     Smalltalk flushPathCaches
e76870d427ee commentary
ca
parents: 2374
diff changeset
  4824
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4825
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4826
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4827
getBinaryFileName:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4828
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4829
     (subdirectories named 'binary' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4830
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4831
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4832
    BinaryPath isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4833
	BinaryPath := self constructPathFor:BinaryDirName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4834
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4835
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
  4836
    ^ 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
  4837
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4838
    "Modified: 18.7.1996 / 15:53:49 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  4839
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  4840
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4841
getBitmapFileName:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4842
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4843
     (subdirectories named 'bitmaps' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4844
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4845
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4846
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4847
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4848
    BitmapPath isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4849
	BitmapPath := self constructPathFor:BitmapDirName
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
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4852
    "/ first, try a bitmaps subdir along the path.
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4853
    f := self searchPath:BitmapPath for:aFileName in:BitmapDirName.
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4854
    f isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4855
	"/ then, try it itself along the path.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4856
	f := self searchPath:self realSystemPath for:aFileName in:nil
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4857
    ].
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4858
    ^ f
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4859
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4860
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4861
     Smalltalk getBitmapFileName:'SBrowser.xbm'
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4862
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4863
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4864
    "Modified: 18.7.1996 / 15:53:55 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4865
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4866
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4867
getFileInFileName:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4868
    "search aFileName in some standard places 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4869
     (subdirectories named 'fileIn' in SystemPath);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4870
     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
  4871
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4872
    FileInPath isNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4873
	FileInPath := self constructPathFor:FileInDirName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4874
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4875
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4876
    ^ self searchPath:FileInPath for:aFileName in:FileInDirName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4877
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4878
    "Modified: 18.7.1996 / 15:53:59 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4879
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4880
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4881
getPackageDirectoryForPackage:aPackageID
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4882
    "search for a particular package; return its directory, or nil"
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4883
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4884
    |packageDir|
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4885
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4886
    packageDir := aPackageID copyReplaceAll:$: with:$/.
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4887
    self packagePath do:[:aPath |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4888
	|dir|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4889
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4890
	dir := aPath asFilename construct:packageDir.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4891
	(dir exists and:[dir isDirectory]) ifTrue:[^ dir].
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4892
    ].
5785
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  4893
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  4894
    "/ 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
  4895
    (aPackageID upTo:$:) = 'stx' ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4896
	packageDir :=  aPackageID copyFrom:(aPackageID indexOf:$:) + 1.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4897
	packageDir := '../../' ,  packageDir.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4898
	packageDir := packageDir asFilename.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4899
	(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
  4900
    ].
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4901
    ^ nil
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4902
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4903
    "
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4904
     Smalltalk getPackageDirectoryForPackage:(Array package)
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4905
     Smalltalk getPackageDirectoryForPackage:'stx:goodies/bitmaps'
5785
872483483444 oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents: 5781
diff changeset
  4906
     Smalltalk getPackageDirectoryForPackage:'stx:libview'
5550
01ad51c71b0e added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents: 5518
diff changeset
  4907
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4908
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4909
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4910
getPackageFileName:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4911
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4912
     (packagePath and subdirectories named 'packages' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4913
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4914
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4915
    |f|
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4916
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4917
    "/ search along packagePath ...
5052
31a76937dec2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5051
diff changeset
  4918
    f := self searchPath:self packagePath for:aFileName in:nil.
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4919
    f isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4920
	"/ search under packages-directory along systemPath ...
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4921
	f := self searchPath:self realSystemPath for:aFileName in:PackageDirName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4922
	"/ kludge - allow for stx-directory to be named differently
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4923
	f isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4924
	    (aFileName startsWith:'stx') ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4925
		(aFileName startsWith:'stx' , Filename separator) ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4926
		    f := '../..' asFilename construct:(aFileName copyFrom:5).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4927
		    f exists ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4928
			^ f pathName
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4929
		    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4930
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4931
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4932
	].
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4933
    ].
5878
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  4934
    (f notNil and:[(f := f asFilename) exists]) ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  4935
	^ f pathName
5878
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  4936
    ].
b89d789e1705 always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents: 5860
diff changeset
  4937
    ^ nil
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4938
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4939
    "
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4940
     Smalltalk getPackageFileName:'stx/libview/resources/normal.style'  
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  4941
     Smalltalk getPackageFileName:'stx/libview/source.zip'    
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4942
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4943
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4944
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4945
getResourceFileName:aFileName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4946
    "search aFileName in some standard places 
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  4947
     (subdirectories named 'resources' in SystemPath);
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4948
     return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4949
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4950
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4951
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4952
    ResourcePath isNil ifTrue:[
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  4953
        ResourcePath := self constructPathFor:ResourceDirName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4954
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4955
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4956
    "/ first, try a resource subdir along the path.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4957
    f := self searchPath:ResourcePath for:aFileName in:ResourceDirName.
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4958
    f isNil ifTrue:[
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  4959
        "/ then, try it itself along the path.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  4960
        f := self searchPath:self realSystemPath for:aFileName in:nil
2974
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4961
    ].
7e7c19f4d6d2 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2967
diff changeset
  4962
    ^ f
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4963
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4964
    "
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  4965
     Smalltalk getResourceFileName:'SystemBrowser.rs'
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4966
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4967
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  4968
    "Modified: 18.7.1996 / 15:54:03 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4969
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4970
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4971
getResourceFileName:aFileName forClass:aClassOrNil
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  4972
    "search aFileName in some standard places 
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4973
     (subdirectories named 'resource' in SystemPath);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4974
     and in aClasses package directory.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4975
     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
  4976
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4977
    |pkgOrNil|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4978
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4979
    aClassOrNil notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4980
	pkgOrNil := aClassOrNil package.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4981
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4982
    ^ self getResourceFileName:aFileName forPackage:pkgOrNil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4983
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4984
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4985
     Smalltalk getResourceFileName:'SystemBrowser.rs' forClass:SystemBrowser
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
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4988
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4989
getResourceFileName:aFileName forPackage:aPackageIDOrNil
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4990
    "search aFileName in some standard places 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4991
     (subdirectories named 'resource' in SystemPath);
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4992
     and in a packages directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4993
     Return the absolute filename or nil if none is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4994
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4995
    |f dir packageDir|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4996
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4997
    f := self getResourceFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4998
    f notNil ifTrue:[^ f].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  4999
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5000
    aPackageIDOrNil isNil ifTrue:[ ^ nil].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5001
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5002
    packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5003
    self packagePath do:[:aPath |
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5004
        |pD|
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5005
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5006
        pD := aPath asFilename construct:packageDir.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5007
        pD exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5008
            f := pD construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5009
            f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5010
                ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5011
            ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5012
            f := (pD construct:'resources') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5013
            f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5014
                ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5015
            ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5016
        ].
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
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5019
    dir := Smalltalk getPackageDirectoryForPackage:(aPackageIDOrNil ? 'stx:libview').
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5020
    dir notNil ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5021
        f := (dir asFilename construct:'resources') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5022
        f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5023
            ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5024
        ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5025
        f := (dir asFilename construct:'styles') construct:aFileName.
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5026
        f exists ifTrue:[
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5027
            ^ f pathName
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5028
        ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5029
    ].
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5030
8951
7cabfee1b791 resource file search
Claus Gittinger <cg@exept.de>
parents: 8950
diff changeset
  5031
    ^ self searchPath:ResourcePath for:aFileName in:('resources/',packageDir).
5043
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5032
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5033
    "
5065
a7ae2d968496 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5064
diff changeset
  5034
     Smalltalk getResourceFileName:'SystemBrowser.rs' forPackage:'stx:libtool'
5080
b600259b45b1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5079
diff changeset
  5035
     Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
  5036
     Smalltalk getResourceFileName:'Foo.rs' forPackage:'stx:libview'
5043
d1c0070f9412 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5042
diff changeset
  5037
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5038
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5039
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5040
getSourceFileName:aFileName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  5041
    "search aFileName in some standard places 
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  5042
     (subdirectories named 'source' in SystemPath);
736
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5043
     return the absolute filename or nil if none is found.
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5044
     This is used to find a sourceFile for a methods source,
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5045
     if no sourceCodeManager is available."
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5046
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5047
    |f|
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5048
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5049
    SourcePath isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5050
	SourcePath := self constructPathFor:SourceDirName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5051
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5052
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5053
    "/ first, try a source subdir along the path.
4770
9a6dcf673683 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4761
diff changeset
  5054
    SourcePath notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5055
	f := self searchPath:SourcePath for:aFileName in:SourceDirName.
4770
9a6dcf673683 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4761
diff changeset
  5056
    ].
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5057
    f isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5058
	"/ then, try it itself along the path.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5059
	f := self searchPath:self realSystemPath for:aFileName in:nil
2959
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5060
    ].
ef8cc5a5a19f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2933
diff changeset
  5061
    ^ f
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5062
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5063
    "
736
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5064
     Smalltalk getSourceFileName:'Smalltalk.st'  
9129846af5ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 732
diff changeset
  5065
     Smalltalk getSourceFileName:'ArrColl.st' 
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5066
    "
1562
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5067
850a88ecff97 searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents: 1553
diff changeset
  5068
    "Modified: 18.7.1996 / 15:54:07 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5069
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5070
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5071
getSystemFileName:aFileNameOrString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5072
    "search aFileNameOrString in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5073
     return the absolute filename or nil if none is found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5074
     see comment in Smalltalk>>initSystemPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5075
     This should be used to access resources such as bitmaps, doc-files,
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5076
     and other help files.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5077
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5078
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5079
    "credits for this method go to Markus ...."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5080
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5081
    |fn nameString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5082
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5083
    fn := aFileNameOrString asFilename.
2933
8b65cb642d91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2928
diff changeset
  5084
    nameString := fn name.
2896
be30640b9012 VMS stuff
Claus Gittinger <cg@exept.de>
parents: 2894
diff changeset
  5085
    fn isAbsolute ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5086
	"dont use path for absolute file names"
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5087
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5088
	^ nameString
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5089
    ].
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5090
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5091
    self realSystemPath do:[:dirName |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5092
	|realName|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5093
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5094
	realName := dirName asFilename construct:nameString.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5095
	"/
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5096
	"/ here, we also return true if its a directory
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5097
	"/ (Even if unreadable). 
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5098
	"/ It could be that the file itself is still readable.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5099
	"/
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5100
	(realName isDirectory or:[realName isReadable]) ifTrue: [
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5101
	    ^ realName name
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5102
	]
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5103
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5104
    ^ nil
4150
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5105
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5106
    "
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5107
     Smalltalk getSystemFileName:'doc/online/english/TOP.html'
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5108
     Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm'
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5109
     Smalltalk getSystemFileName:'bitmaps/foo'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5110
     Smalltalk getSystemFileName:'resources/View.rs'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5111
     Smalltalk getSystemFileName:'resources/iris.style'  
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5112
    "
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5113
11b33d68bac0 comment
Claus Gittinger <cg@exept.de>
parents: 4129
diff changeset
  5114
    "Modified: / 6.5.1999 / 10:40:37 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5115
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5116
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5117
imageFromFileNamed:aFileName forClass:aClass
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5118
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5119
     first in the redefinable bitmaps path, then in the classes
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5120
     own package directory if existing.
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5121
     Return an image or nil."
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5122
5113
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5123
    |package nm img|
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5124
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5125
    package := aClass package.
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5126
    img := self imageFromFileNamed:aFileName inPackage:package.
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5127
    img isNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5128
	package ~= 'stx:goodies' ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5129
	    "/ try under the goodies package ...
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5130
	    img := Smalltalk imageFromFileNamed:aFileName inPackage:'stx:goodies'.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5131
	].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5132
	img isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5133
	    (aFileName startsWith:'bitmaps') ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5134
		nm := 'bitmaps/' , aFileName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5135
		img := Smalltalk imageFromFileNamed:nm forClass:self.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5136
		img isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5137
		    img := Smalltalk imageFromFileNamed:nm inPackage:'stx:goodies'.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5138
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5139
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5140
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5141
	    img isNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5142
		img := Smalltalk imageFromFileNamed:aFileName inPackage:'stx:goodies'.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5143
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5144
	]
5113
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5145
    ].
b3d3be7d95b9 icon search
Claus Gittinger <cg@exept.de>
parents: 5112
diff changeset
  5146
    ^ img
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5147
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5148
    "
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5149
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' forClass:View
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5150
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5151
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5152
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5153
imageFromFileNamed:aFileName inPackage:aPackage
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5154
    "search aFileName in some standard places:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5155
     first in the redefinable bitmaps path, then in the 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5156
     package directory if existing.
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5157
     Return an image or nil."
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5158
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5159
    |i f dir|
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5160
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5161
    i := Image fromFile:aFileName resolution:100.
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5162
    i notNil ifTrue:[^ i].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5163
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5164
    f := self getBitmapFileName:aFileName.
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5165
    f notNil ifTrue:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5166
	i := Image fromFile:f.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5167
	i notNil ifTrue:[^ i].
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5168
    ].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5169
    dir := self projectDirectoryForPackage:aPackage.
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5170
    dir isNil ifTrue:[^ nil].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5171
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5172
    ((f := aFileName) startsWith:'bitmaps/') ifFalse:[
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5173
	i := Image fromFile:(dir asFilename construct:f).
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5174
	i notNil ifTrue:[^ i].
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5175
    
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5176
	f := 'bitmaps/' , aFileName.
5860
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5177
    ].
5bd2ece3d750 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5857
diff changeset
  5178
    ^ Image fromFile:(dir asFilename construct:f).
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5179
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5180
    "
5587
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5181
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview' 
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5182
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool' 
4c4d67ad0e51 avoid obsoleteMessage warning (Filename ,)
Claus Gittinger <cg@exept.de>
parents: 5580
diff changeset
  5183
     Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies' 
5089
558b86f2d9b9 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5080
diff changeset
  5184
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5185
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5186
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5187
libraryFileNameOfClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5188
    "for a given class, return the name of a classLibrary which contains
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5189
     binary code for it.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5190
     Read the libinfo file 'liblist.stc' (which is created during the compilation process)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5191
     for an entry for aClassOrClassName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5192
     Search for the className in the first col, and return the value found in
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5193
     the 2nd col.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5194
     Return nil if no entry is found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5195
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5196
     A nil returns means that this class is either built-in or not present
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5197
     in a package-class library (i.e. either as separate .o or separate .st file).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5198
     Otherwise, the returned name is the classLibrary object of that class.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5199
     The classes code can be loaded from that file if binary loading is supported."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5200
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5201
    |aStream line words n aClassName|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5202
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5203
    aClassOrClassName isBehavior ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5204
	aClassName := aClassOrClassName name
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5205
    ] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5206
	aClassName := aClassOrClassName
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5207
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5208
    aClassName := aClassName asString.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5209
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5210
    #('include/liblist.stc')    "/ filenames
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5211
    with:#(2)                   "/ column
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5212
    do:[:fileName :col |
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5213
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5214
	aStream := self systemFileStreamFor:fileName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5215
	aStream notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5216
	    [aStream atEnd] whileFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5217
		line := aStream nextLine.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5218
		line notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5219
		    (line startsWith:'#') ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5220
			words := line asCollectionOfWords.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5221
			(n := words size) > 1 ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5222
			    (words at:1) = aClassName ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5223
				n >= col ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5224
				    aStream close.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5225
				    ^ (words at:col) withoutSeparators
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5226
				]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5227
			    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5228
			]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5229
		    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5230
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5231
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5232
	    aStream close
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5233
	].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5234
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5235
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5236
    ^ nil
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5237
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5238
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5239
     Smalltalk libraryFileNameOfClass:'ClockView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5240
     Smalltalk libraryFileNameOfClass:'Bag' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5241
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5242
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5243
    "Modified: 6.11.1995 / 15:41:39 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5244
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5245
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5246
packagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5247
    "return a collection of additional directorynames, where smalltalk
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5248
     looks for package directories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5249
     Notice, that directories named 'packages' under the systemPath are
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5250
     always consulted - even if not in the packagePath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5251
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5252
    ^ PackagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5253
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5254
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5255
     Smalltalk packagePath
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5256
     Smalltalk packagePath addLast:'/opt/smalltalk'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5257
     Smalltalk packagePath addFirst:'/usr/local/otherPackages'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5258
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5259
!
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  5260
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5261
packagePath:aPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5262
    "set the packagePath;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5263
     a collection of additional directorynames, where smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5264
     looks for package directories.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5265
     Notice, that directories named 'packages' under the systemPath are
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5266
     always consulted - even if not in the packagePath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5267
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5268
    PackagePath := aPath asOrderedCollection
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5269
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5270
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5271
     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
  5272
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5273
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5274
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5275
projectDirectoryForClass:aClass
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5276
    "given a class, return the path to its package directory;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5277
     nil if not found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5278
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5279
    |pkg|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5280
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5281
    pkg := aClass package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5282
    pkg isNil ifTrue:[^ nil].
5038
d74e7c71ae75 added package directory handling
Claus Gittinger <cg@exept.de>
parents: 5037
diff changeset
  5283
5040
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5284
    ^ self projectDirectoryForPackage:pkg.
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5285
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5286
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5287
     Smalltalk projectDirectoryForClass:Array 
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5288
     Smalltalk projectDirectoryForClass:View
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5289
    "
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5290
!
5c1b0d236cb1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5039
diff changeset
  5291
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5292
projectDirectoryForPackage:aPackage
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5293
    "given a packageID, return the path to its package directory;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5294
     nil if not found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5295
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5296
    |prj prjDir|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5297
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5298
    "/ there might be a package specific resource directory ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5299
    "/ in the directory, from which the project was loaded
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5300
    prj := Project projectWithId:aPackage.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5301
    prj notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5302
	prjDir := prj directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5303
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5304
    (prjDir notNil and:[prjDir asFilename exists]) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5305
	prjDir := Smalltalk getPackageFileName:(aPackage copyReplaceAll:$: with:$/).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5306
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5307
    ^ prjDir
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5308
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5309
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5310
     Smalltalk projectDirectoryForPackage:'stx:libbasic'   
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5311
     Smalltalk projectDirectoryForPackage:'exept:smartcard'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5312
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5313
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5314
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5315
readAbbreviations
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5316
    "read classname to filename mappings from include/abbrev.stc.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5317
     sigh - all for those poor sys5.3 or MSDOS people with short filenames ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5318
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5319
    "since installAutoloadedClasses also reads all abbreviations, use it"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5320
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5321
    CachedAbbreviations := IdentityDictionary new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5322
    self installAutoloadedClasses.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5323
    ^ CachedAbbreviations.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5324
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5325
"/    |aStream f dirsConsulted|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5326
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5327
"/    CachedAbbreviations := IdentityDictionary new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5328
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5329
"/    "/ new scheme: look for a directory called 'packages'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5330
"/    "/ and enumerate its abbrev.stc files...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5331
"/    dirsConsulted := Set new.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5332
"/    f := Smalltalk getSystemFileName:'packages'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5333
"/    f notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5334
"/        f := f asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5335
"/        f isDirectory ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5336
"/            ('Smalltalk [info]: reading all class abbreviations found under ''' , f pathName ,'''') infoPrintCR.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5337
"/            self recursiveReadAllAbbreviationsFrom:f.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5338
"/            dirsConsulted add:f pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5339
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5340
"/    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5341
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5342
"/    "/ and along the package-path
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5343
"/    self packagePath do:[:aPath |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5344
"/        (dirsConsulted includes:aPath) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5345
"/            ('Smalltalk [info]: reading all class abbreviations found under ''' , aPath ,'''') infoPrintCR.
7613
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5346
"/            self recursiveReadAllAbbreviationsFrom:aPath.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5347
"/            dirsConsulted add:aPath
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5348
"/        ]
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5349
"/    ].
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5350
"/
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5351
"/    "/ 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
  5352
"/    "/ include directory. This will vanish.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5353
"/
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5354
"/    aStream := self systemFileStreamFor:'include/abbrev.stc'.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5355
"/    aStream notNil ifTrue:[
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5356
"/        ('Smalltalk [info]: reading additional abbreviations from ''' , aStream pathName ,'''') infoPrintCR.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5357
"/        self readAbbreviationsFromStream:aStream.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5358
"/        aStream close.
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5359
"/"/    ] ifFalse:[
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5360
"/"/        ('Smalltalk [warning]: no global''include/abbrev.stc'' file found') infoPrintCR
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5361
"/    ].
2d40237e4251 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7612
diff changeset
  5362
"/    ^ CachedAbbreviations
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5363
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5364
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5365
     Smalltalk readAbbreviations
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5366
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5367
5091
a145df1cd0e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5089
diff changeset
  5368
    "Modified: / 10.12.1999 / 17:48:53 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5369
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5370
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5371
readAbbreviationsFromStream:aStream
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5372
    "read classname to filename mappings from aStream.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5373
     sigh - all for those poor sys5.3 or MSDOS people with short filenames ..."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5374
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5375
    |line words nm abbrev pkg s w|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5376
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5377
    [aStream atEnd] whileFalse:[
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5378
        line := aStream nextLine.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5379
        line notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5380
            (line startsWith:'#') ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5381
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5382
                "/ must do it manually, caring for quoted strings.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5383
"/                words := line asCollectionOfWords.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5384
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5385
                words := OrderedCollection new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5386
                s := line readStream.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5387
                [s atEnd] whileFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5388
                    s skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5389
                    s peek == $' ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5390
                        s next.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5391
                        w := s upTo:$'.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5392
                        s skipSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5393
                    ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5394
                        w := s upToSeparator
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5395
                    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5396
                    words add:w
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
                words size >= 3 ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5399
                    nm := (words at:1) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5400
                    abbrev := (words at:2) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5401
                    pkg := (words at:3) withoutSeparators.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5402
                    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
  5403
                ] ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5404
                    ('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
  5405
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5406
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5407
        ]
4420
beac992b86d1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4391
diff changeset
  5408
    ].
5091
a145df1cd0e6 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5089
diff changeset
  5409
5095
9bbf3cf594e5 no warning for same-abbrev, if packages differ.
Claus Gittinger <cg@exept.de>
parents: 5093
diff changeset
  5410
    "Modified: / 13.12.1999 / 11:54:17 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5411
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5412
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5413
realSystemPath
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5414
    "return the realSystemPath - thats the directorynames from
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5415
     SystemPath which exist and are readable"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5416
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5417
    |nP|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5418
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5419
    RealSystemPath isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5420
	OperatingSystem isVMSlike ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5421
	    "/ temporary kludge: since we cannot currently
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5422
	    "/ check for existance of a name like 'volume:',
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5423
	    "/ leave those in the Path without a check.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5424
	    RealSystemPath := SystemPath select:[:dirName |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5425
		|f|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5426
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5427
		f := dirName asFilename.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5428
		f isVolumeOnly ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5429
		    true
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5430
		] ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5431
		    (f isDirectory) and:[f isReadable]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5432
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5433
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5434
	] ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5435
	    RealSystemPath := SystemPath select:[:dirName |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5436
		|f|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5437
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5438
		f := dirName asFilename.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5439
		(f isDirectory) and:[f isReadable]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5440
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5441
	    RealSystemPath := RealSystemPath collect:[:dirName |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5442
		    |f|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5443
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5444
		    f := dirName asFilename pathName.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5445
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5446
	    "/ remove duplicates (but keep order)
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5447
	    nP := OrderedCollection new.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5448
	    RealSystemPath do:[:p |
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5449
		(nP includes:p) ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5450
		    nP add:p
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5451
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5452
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5453
	    RealSystemPath := nP.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5454
	].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5455
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5456
    ^ RealSystemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5457
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5458
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5459
recursiveReadAllAbbreviationsFrom:aDirectory
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5460
    self recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:15
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5461
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5462
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5463
recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:maxLevels
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5464
    "read all abbreviations from and under aDirectory."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5465
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5466
    |abbrevStream dir directoryContents|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5467
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5468
    maxLevels == 0 ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5469
"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5470
	^ self
5075
c9e585ae97d4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5074
diff changeset
  5471
    ].
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  5472
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5473
    dir := aDirectory asFilename.
5057
390bbf7d37bf care for empty directories
Claus Gittinger <cg@exept.de>
parents: 5053
diff changeset
  5474
    dir exists ifFalse:[^ self].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5475
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5476
    [
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5477
	abbrevStream := (dir construct:'abbrev.stc') asFilename readStream.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5478
	self readAbbreviationsFromStream:abbrevStream.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5479
	abbrevStream close.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5480
    ] 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
  5481
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5482
    [
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5483
	directoryContents := dir directoryContents.
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5484
    ] on:FileStream openErrorSignal do:[:ex|
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5485
	"non-accessable directory: we are done"
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5486
	^ self
7085
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5487
    ].
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5488
71d0e451114d Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents: 7054
diff changeset
  5489
    directoryContents do:[:aFilename |
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5490
	|f|
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5491
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5492
	(#(
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5493
	    'doc'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5494
	    'CVS'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5495
	    'bitmaps'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5496
	    'resources'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5497
	    'source'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5498
	) includes:aFilename) ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5499
	    f := dir construct:aFilename.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5500
	    f isDirectory ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5501
		self recursiveReadAllAbbreviationsFrom:f maxLevels:maxLevels-1
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5502
	    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5503
	].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5504
    ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5505
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5506
8952
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5507
resourceDirectoryForPackage:aPackage
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5508
    "given a packageID, return the path to its resource directory;
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5509
     nil if not found."
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5510
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5511
    |prjDir rsrcDir|
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5512
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5513
    prjDir := self projectDirectoryForPackage:aPackage.
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5514
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5515
    (prjDir notNil
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5516
    and:[(prjDir := prjDir asFilename) exists
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5517
    and:[(rsrcDir := prjDir construct:'resources') exists]]) ifTrue:[
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5518
        ^ rsrcDir
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5519
    ].
8953
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5520
    rsrcDir := self getSystemFileName:('resources/' , (aPackage copyReplaceAll:$: with:$/)).
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5521
    rsrcDir notNil ifTrue:[
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5522
        ^ rsrcDir asFilename
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5523
    ].
a1ce1a171f76 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8952
diff changeset
  5524
    ^ nil 
8952
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5525
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
     Smalltalk resourceDirectoryForPackage:'stx:libbasic'   
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5528
     Smalltalk resourceDirectoryForPackage:'exept:expecco'   
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5529
     Smalltalk resourceDirectoryForPackage:'exept:smartcard'
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
!
89f4b04094f7 resourceDirectory access
Claus Gittinger <cg@exept.de>
parents: 8951
diff changeset
  5532
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5533
resourceFileStreamFor:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5534
    "search aFileName in some standard places;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5535
     return a readonly fileStream or nil if not found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5536
     Searches in subdirectories named 'resource' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5537
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5538
    ^ self resourceFileStreamFor:aFileName forClass:nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5539
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5540
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5541
resourceFileStreamFor:aFileName forClass:aClassOrNil
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5542
    "search aFileName in some standard places and in the classes
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5543
     package-resource directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5544
     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
  5545
     Searches in subdirectories named 'resource' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5546
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5547
    |aString|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5548
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5549
    aString := self getResourceFileName:aFileName forClass:aClassOrNil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5550
    aString notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5551
	^ aString asFilename readStreamOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5552
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5553
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5554
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5555
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5556
searchPath:aPath for:aFileName in:aDirName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5557
    "search aPath for a subdirectory named aDirectory with a file
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5558
     named aFileName"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5559
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5560
    |f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5561
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5562
    ((f := aFileName asFilename) isAbsolute 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5563
    or:[f isExplicitRelative]) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5564
	"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5565
	"/ dont use path for absolute or explicit .-relative file names
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5566
	"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5567
	^ aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5568
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5569
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5570
    aPath notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5571
	aPath do:[:dirName |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5572
	    |realName dir|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5573
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5574
	    dir := dirName asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5575
	    aDirName notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5576
		realName := (dir construct:aDirName) construct:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5577
	    ] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5578
		realName := dir construct:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5579
	    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5580
	    (realName isReadable) ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5581
		^ realName name
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5582
	    ]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5583
	].
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
    ^ nil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5587
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5588
    "Modified: / 29.4.1999 / 15:06:43 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5589
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5590
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5591
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
  5592
    |classNameSymbol oldAbbrev cls abbrevs|
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5593
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5594
    CachedAbbreviations isNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5595
        CachedAbbreviations := IdentityDictionary new.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5596
    ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5597
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5598
    abbrevs := CachedAbbreviations.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5599
    aClassNameString ~= aFileNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5600
        classNameSymbol := aClassNameString asSymbol.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5601
        oldAbbrev := abbrevs at:classNameSymbol ifAbsent:nil.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5602
        oldAbbrev notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5603
            oldAbbrev ~= aFileNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5604
                StandAlone ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5605
                    ('Smalltalk [warning]: conflict for: ' , aClassNameString , 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5606
                        ' in package ' , aPackageNameString) infoPrintCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5607
                    ('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
  5608
                        infoPrintCR
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
            ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5611
            "overwrite old abbreviation with new one, 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5612
             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
  5613
        ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5614
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5615
        cls := self classNamed:aFileNameString.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5616
        cls notNil ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5617
            cls name ~= aClassNameString ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5618
                "/ 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
  5619
                "/ 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
  5620
                "/ abbreviation (or the same).
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5621
                (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
  5622
                    cls isNameSpace ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5623
                        aPackageNameString = cls package ifTrue:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5624
                            StandAlone ifFalse:[
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5625
                                ('Smalltalk [warning]: conflict for: ' , cls name , 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5626
                                    ' in package ' , aPackageNameString) infoPrintCR.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5627
                                ('Smalltalk [warning]: (' , aClassNameString , ' -> ' , aFileNameString 
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5628
                                    , ')') infoPrintCR
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
                    ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5632
                ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5633
            ]
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5634
        ].
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5635
        abbrevs at:classNameSymbol put:aFileNameString.
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  5636
    ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5637
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5638
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5639
sourceDirectoryNameOfClass:aClassOrClassName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5640
    "for a given class, return the pathname relative to TOP of the classes source code.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5641
     Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5642
     for an entry for aClassOrClassName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5643
     Search for the className in the first col, and return the value found in
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5644
     the 3rd col.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5645
     Return nil if no entry is found."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5646
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5647
    |aStream line words n aClassName|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5648
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5649
    aClassOrClassName isBehavior ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5650
	aClassName := aClassOrClassName name
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5651
    ] ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5652
	aClassName := aClassOrClassName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5653
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5654
    aClassName := aClassName asString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5655
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5656
    #('include/abbrev.stc' 'include/liblist.stc')    "/ filenames
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5657
    with:#(3 2)                   "/ column
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5658
    do:[:fileName :col |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5659
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5660
	aStream := self systemFileStreamFor:fileName.
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5661
	aStream notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5662
	    [aStream atEnd] whileFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5663
		line := aStream nextLine.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5664
		line notNil ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5665
		    (line startsWith:'#') ifFalse:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5666
			words := line asCollectionOfWords.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5667
			(n := words size) > 1 ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5668
			    (words at:1) = aClassName ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5669
				n >= col ifTrue:[
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5670
				    aStream close.
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5671
				    ^ (words at:col) withoutSeparators
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5672
				]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5673
			    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5674
			]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5675
		    ]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5676
		]
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5677
	    ].
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5678
	    aStream close
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5679
	].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5680
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5681
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5682
    ^ nil
191
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5683
38d331e1e6b1 added compressSOurces
claus
parents: 162
diff changeset
  5684
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5685
     Smalltalk sourceDirectoryNameOfClass:'ClockView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5686
     Smalltalk sourceDirectoryNameOfClass:'Bag' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5687
     Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5688
     Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass' 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5689
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5690
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5691
    "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
  5692
    "Modified: 9.12.1995 / 23:54:14 / cg"
2033
c94698170f36 Close unused streams.
Stefan Vogel <sv@exept.de>
parents: 2029
diff changeset
  5693
    "Modified: 3.1.1997 / 11:26:44 / stefan"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5694
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5695
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5696
sourceFileStreamFor:aFileName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5697
    "search aFileName in some standard places;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5698
     return a readonly fileStream or nil if not found.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5699
     Searches in subdirectories named 'source' in SystemPath"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5700
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5701
    |aString|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5702
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5703
    aString := self getSourceFileName:aFileName.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5704
    aString notNil ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5705
	^ aString asFilename readStreamOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5706
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5707
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5708
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5709
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5710
systemFileStreamFor:aFileName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5711
    "search aFileName in some standard places;
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5712
     return a readonly fileStream or nil if not found.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5713
     see comment in Smalltalk>>initSystemPath"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5714
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5715
    |aString|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5716
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5717
    aString := self getSystemFileName:aFileName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5718
    aString notNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5719
	^ aString asFilename readStreamOrNil
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5720
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5721
    ^ nil
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5722
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5723
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5724
systemPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5725
    "return a collection of directorynames, where smalltalk
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  5726
     looks for system files 
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5727
     (usually in subdirs such as resources, bitmaps, source etc.)
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5728
     see comment in Smalltalk>>initSystemPath."
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5729
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5730
    ^ SystemPath
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5731
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5732
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5733
     Smalltalk systemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5734
     Smalltalk systemPath addLast:'someOtherDirectoryPath'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5735
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5736
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  5737
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5738
systemPath:aPath
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5739
    "set the collection of directorynames, where smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5740
     looks for system files 
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5741
     (usually in subdirs such as resources, bitmaps, source etc.)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5742
     see comment in Smalltalk>>initSystemPath."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5743
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5744
    SystemPath := aPath.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5745
    self flushPathCaches
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5746
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5747
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5748
     Smalltalk systemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5749
     Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath')
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5750
    "
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
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5753
!Smalltalk class methodsFor:'system management-packages'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5754
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5755
knownPackages
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5756
    ^ KnownPackages ? #()
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5757
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5759
loadExtensionsForPackage:aPackageId
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5760
    |packageDirName|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5761
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5762
    packageDirName := aPackageId copyReplaceAll:$: with:$/.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5763
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5764
    packageDirName := self getPackageFileName:packageDirName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5765
    packageDirName isNil ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5766
	^ false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5767
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5768
    ^ self loadExtensionsFromDirectory:packageDirName
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5769
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5770
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5771
loadExtensionsFromDirectory:packageDirOrString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5772
    |packageDir f|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5773
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5774
    packageDir := packageDirOrString asFilename.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5775
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5776
    f := packageDir construct:'extensions.st'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5777
    f exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5778
	f fileIn.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5779
	SilentLoading ifFalse:[
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5780
	    Transcript showCR:('loaded extensions: ' , f pathName).
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5781
	].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5782
	^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5783
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5784
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5785
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5786
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5787
loadPackage:aPackageIdOrPackage
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5788
    "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
  5789
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5790
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5791
    (aPackageIdOrPackage isSymbol 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5792
    or:[aPackageIdOrPackage isString]) ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5793
	^ self loadPackageWithId:aPackageIdOrPackage asAutoloaded:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5794
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5795
    self shouldImplement.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5796
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
     Smalltalk loadPackage:'stx:libbasic'  
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5799
     Smalltalk loadPackage:'stx:goodies/persistency'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5800
     Smalltalk loadPackage:'cg:cparser'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5801
     Smalltalk loadPackage:'cg:rose'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5802
    "
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5803
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5804
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5805
loadPackage:packageId fromAllSourceFilesInDirectory:aDirectory
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5806
    "load all source files found in aDirectory and treat them like
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5807
     a package. Allows for initial import of alien ST-code as a new package.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5808
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5809
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5810
    |p t new anyFail repeatCount|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5811
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5812
    "/ problem: dependencies.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5813
    "/ solution: repeat twice, so that superclasses are present the second time
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5814
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5815
    Class packageQuerySignal answer:packageId asSymbol do:[
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5816
        |any|
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5817
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5818
        repeatCount := 0.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5819
        [
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5820
            repeatCount := repeatCount + 1.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5821
            anyFail := false.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5822
            aDirectory directoryContents do:[:file |
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5823
                |fn|
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5824
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5825
                fn := aDirectory construct:file.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5826
                (fn hasSuffix:'st') ifTrue:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5827
                    Metaclass confirmationQuerySignal answer:false      
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5828
                    do:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5829
                        Error 
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5830
                            handle:[:ex |
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5831
                                anyFail := true
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5832
                            ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5833
                            do:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5834
                                (self fileIn:fn) ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5835
                                    anyFail := true
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5836
                                ] ifTrue:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5837
                                    any := true.
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5838
                                ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5839
                            ]
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
                ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5842
            ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5843
            any ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5844
                ^ false "/ no file found
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5845
            ]
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  5846
        ] doWhile:[anyFail and:[repeatCount<2]].
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5847
    ].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5848
                
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5849
    new := (p := Project projectWithId:packageId) isNil.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5850
    new ifTrue:[ p := Project new].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5851
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5852
    p name:packageId.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5853
    p directory:aDirectory.
4726
5c5e1c7f8933 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4724
diff changeset
  5854
    p package:packageId.
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5855
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5856
    p repositoryModule:(t first).
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5857
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5858
    p isLoaded:true.
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5859
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5860
    new ifTrue:[Project addLoadedProject:p].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  5861
    ^ anyFail not
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5862
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5863
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5864
loadPackage:packageId fromClassLibrary:aFilename
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5865
    "load a package from a compiled classLib.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5866
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5867
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5868
    |p t new|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5869
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5870
    (self fileIn:aFilename) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5871
	(self fileInClassLibrary:aFilename) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5872
	    self warn:'Failed to load the package ', packageId printString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5873
	    ^ false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5874
	]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5875
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5876
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5877
    new := (p := Project projectWithId:packageId) isNil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5878
    new ifTrue:[ p := Project new].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5879
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5880
    p name:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5881
    p directory:aFilename directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5882
    p package:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5883
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5884
    p repositoryModule:(t first).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5885
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5886
    p isLoaded:true.
4723
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  5887
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  5888
    new ifTrue:[Project addLoadedProject:p].
2d9252c2733c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4722
diff changeset
  5889
    ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5890
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5891
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5892
loadPackage:packageId fromLoadAllFile:aFilename
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5893
    "load a package from a loadAll - loader script.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5894
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5895
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5896
    |p t new|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5897
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5898
    Metaclass confirmationQuerySignal answer:false
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5899
    do:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5900
	(self fileIn:aFilename) ifFalse:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5901
	    self warn:'Failed to load the package ', packageId printString.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5902
	    ^ false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5903
	]
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5904
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5905
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5906
    new := (p := Project projectWithId:packageId) isNil.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5907
    new ifTrue:[ p := Project new].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5908
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5909
    p name:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5910
    p directory:aFilename directory.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5911
    p package:packageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5912
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5913
    p repositoryModule:(t first).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5914
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5915
    p isLoaded:true.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5916
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5917
    new ifTrue:[Project addLoadedProject:p].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5918
    ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5919
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5920
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5921
loadPackage:aPackageId fromProjectFile:f asAutoloaded:doLoadAsAutoloaded
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5922
    "load a package from a .prj spec.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5923
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5924
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5925
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5926
    "/ not yet implemented ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5927
    ^ false.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5928
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5929
"/    |prj fn|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5930
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5931
"/        prj := Project new loadFromProjectFile:f asFilename pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5932
"/    "/ no - also allow for applications to be loaded this way
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5933
"/    "/    prj type == #library ifFalse:[ ^ false].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5934
"/    self halt.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5935
"/        "/ load all prerequisites ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5936
"/        prj prerequisites do:[:aRequiredPackage |
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5937
"/            self halt.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5938
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5939
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5940
"/        "/ see if there is a class library ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5941
"/        fn := prj directory asFilename construct:(prj name , ObjectFileLoader sharedLibraryExtension).
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5942
"/        fn exists ifTrue:[
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5943
"/            "/ load that classLibrary ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5944
"/            self fileIn:fn pathName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5945
"/        ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5946
"/
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  5947
"/        "/ now, for all other classes, file-them in
5601
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5948
"/        "/ or declare as autoloaded ...
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5949
"/
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5950
"/        prj classes do:[:aClassOrName | |ns|
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5951
"/            aClassOrName isBehavior ifFalse:[
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5952
"/                ((self includesKey:aClassOrName) not  
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5953
"/                and:[(ns := prj defaultNameSpace) isNil
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5954
"/                    or:[ns == self
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5955
"/                    or:[(ns includesKey:aClassOrName) not]]]) 
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5956
"/                ifTrue:[
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5957
"/                    "/ must load a corresponding source or cls-file
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5958
"/    self halt.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5959
"/                ]
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5960
"/            ]
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5961
"/        ].
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5962
"/        prj isLoaded:true.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5963
"/        prj directory:f asFilename directoryName.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5964
"/        Project addLoadedProject:prj.
c101570d9daa checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5593
diff changeset
  5965
"/        ^ true
4756
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5966
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5967
"
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5968
 Smalltalk loadPackage:'exept:osi/asn1'
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5969
 Smalltalk 
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5970
	loadPackage:'exept:osi/asn1'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5971
	fromProjectFile:'../../../exept/osi/asn1/asn1.prj'
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  5972
	asAutoloaded:false
4756
76982048a91a first try to load package from prj file.
Claus Gittinger <cg@exept.de>
parents: 4748
diff changeset
  5973
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5974
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5975
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5976
loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5977
    "load a package from a .zip delivery file.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5978
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5979
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5980
    "/ not yet implemented ...
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5981
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5982
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5983
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5984
loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5985
    |abbrevFile packageDir|
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5986
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5987
    packageDir := self packageDirectoryForPackageId:aPackageId.
8380
ec3e8dfc46a9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8379
diff changeset
  5988
    packageDir isNil ifTrue:[^ false].
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5989
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5990
    "/ abbrev.stc ?
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5991
    abbrevFile := packageDir construct:'abbrev.stc'.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5992
    abbrevFile exists ifFalse:[^ false].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5993
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5994
    Smalltalk installAutoloadedClassesFrom:abbrevFile pathName.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5995
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5996
    doLoadAsAutoloaded ifFalse:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5997
        "/ force autoloading...
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  5998
        Smalltalk allClassesDo:[:eachClass |
8381
213f154fb374 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8380
diff changeset
  5999
            eachClass package = aPackageId ifTrue:[ eachClass autoload].
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6000
        ].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6001
    ].
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
    self loadExtensionsFromDirectory:packageDir.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6004
    SilentLoading ifFalse:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6005
        Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName).
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6006
    ].
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6007
    ^ true
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6008
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6009
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6010
loadPackageWithId:aPackageId
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6011
    "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
  6012
     Experimental."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6013
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6014
    ^ self loadPackageWithId:aPackageId asAutoloaded:false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6015
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6016
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6017
     Smalltalk loadPackageWithId:'stx:libbasic'  
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6018
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6019
     Smalltalk loadPackageWithId:'cg:cparser'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6020
     Smalltalk loadPackageWithId:'cg:rose'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6021
     Smalltalk loadPackageWithId:'detemobil:smc'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6022
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6023
!
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
loadPackageWithId:aPackageId asAutoloaded:doLoadAsAutoloaded
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6026
    "make certain, that some particular package is loaded into the system.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6027
     Experimental."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6028
8379
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6029
    |pkg packageDir|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6030
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6031
    pkg := Project projectWithId:aPackageId.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6032
    (pkg notNil and:[pkg isLoaded]) ifTrue:[ 
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6033
        "/ ('Smalltalk [info]: Package ' , aPackageId , ' already loaded.') infoPrintCR.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6034
        (doLoadAsAutoloaded 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6035
        or:[pkg areAllClassesLoaded]) ifTrue:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6036
            ^ true
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6037
        ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6038
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6039
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6040
    "/ ok; not yet loaded.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6041
    "/ try to locate the package; try the following:
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6042
    "/    $(packagePath)/<packageDir>/...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6043
    "/    $(SYSPATH)/packages/<packageDir>
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6044
    packageDir := self packageDirectoryForPackageId:aPackageId.
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6045
    packageDir isNil ifTrue:[
9028
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6046
        (aPackageId includes:$:) ifFalse:[
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6047
            "/ assume stx
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6048
            packageDir := self packageDirectoryForPackageId:('stx:',aPackageId).
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6049
        ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6050
    ].
b7d7b7b0ca4d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9022
diff changeset
  6051
    packageDir isNil ifTrue:[
8379
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6052
        ('Smalltalk [warning]: cannot find packageDirectory: ' , packageDir name) errorPrintCR.
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6053
        ^ false
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6054
    ].
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6055
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6056
    ^ self
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6057
        loadPackageWithId:aPackageId 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6058
        fromDirectory:packageDir 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6059
        asAutoloaded:doLoadAsAutoloaded
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6060
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6061
    "
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6062
     Smalltalk loadPackageWithId:'stx:libbasic'  
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6063
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6064
     Smalltalk loadPackageWithId:'exept:ctypes'
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6065
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6066
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6067
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6068
loadPackageWithId:aPackageId fromDirectory:packageDirOrString asAutoloaded:doLoadAsAutoloaded
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6069
    |f packageDir packageName shLibName|
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6070
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6071
    packageDir := packageDirOrString asFilename.
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6072
    packageName := packageDir baseName.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6073
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6074
    "/ .prj ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6075
    f := (packageDir construct:packageName) withSuffix:'prj'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6076
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6077
        (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
  6078
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6079
                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
  6080
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6081
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6082
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6083
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6084
    "/ loadAll ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6085
    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
  6086
    f exists ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6087
        f := packageDir construct:'loadall'.
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6088
    ].
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6089
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6090
        (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
  6091
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6092
                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
  6093
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6094
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6095
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6096
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6097
    "/ .zip ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6098
    f := (packageDir construct:packageName) withSuffix:'zip'.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6099
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6100
        (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
  6101
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6102
                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
  6103
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6104
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6105
        ]
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6106
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6107
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6108
    shLibName := packageName , ObjectFileLoader sharedLibraryExtension.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6109
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6110
    "/ .so ?
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6111
    f := packageDir construct:shLibName.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6112
    f exists ifTrue:[
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6113
        (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
  6114
            SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6115
                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
  6116
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6117
            doLoadAsAutoloaded ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6118
                "/ force autoloading...
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6119
                Smalltalk allClassesDo:[:eachClass |
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6120
                    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
  6121
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6122
            ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6123
            ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6124
        ]              
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6125
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6126
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6127
    "/ abbrev.stc ?
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6128
    (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
  6129
        ^ true
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6130
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6131
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6132
    "/ any .so ?  -> load the first one found (maybe not a good idea)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6133
    packageDir directoryContentsAsFilenamesDo:[:aFilename |
8370
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6134
        (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
  6135
            (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
  6136
                SilentLoading ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6137
                    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
  6138
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6139
                doLoadAsAutoloaded ifFalse:[
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6140
                    "/ force autoloading...
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6141
                    Smalltalk allClassesDo:[:eachClass |
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6142
                        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
  6143
                    ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6144
                ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6145
                ^ true
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6146
            ]
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6147
        ]
5175
c3e71ead8e06 when loading a package, and a .so file could not be found
Claus Gittinger <cg@exept.de>
parents: 5168
diff changeset
  6148
    ].
5807
019d25b669e5 in loadPackage, if there is no loadAll file and no
Claus Gittinger <cg@exept.de>
parents: 5789
diff changeset
  6149
5051
81d5b5985154 package search fixed/improved
Claus Gittinger <cg@exept.de>
parents: 5047
diff changeset
  6150
    "/ source files
4737
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6151
    (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
  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 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
  6154
        ].
27cf91058821 look for both loadAll- and loadall-files when loading apackage
Claus Gittinger <cg@exept.de>
parents: 8358
diff changeset
  6155
        ^ true
4737
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6156
    ].
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6157
    ^ false
7f66c4dc7c17 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4726
diff changeset
  6158
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6159
    "
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6160
     Smalltalk loadPackageWithId:'stx:libbasic'  
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6161
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
4722
854b7a5427b0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4720
diff changeset
  6162
     Smalltalk loadPackageWithId:'exept:ctypes'
4718
a2d639dcef88 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4714
diff changeset
  6163
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6164
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6165
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6166
packageDirectoryForPackageId:aPackageId
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6167
    |packageDirName packageDir|
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6168
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6169
    packageDirName := aPackageId copyReplaceAll:$: with:$/.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6170
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6171
    packageDir := self getPackageFileName:packageDirName.
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6172
    packageDir isNil ifTrue:[
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6173
        "/ for convenience: try ../../.. as well 
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6174
        "/ (when executing in thedevelopment environment)
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6175
        packageDir := '../../..' asFilename construct:packageDirName.
8379
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6176
        packageDir exists ifFalse:[ ^ nil].
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6177
    ].
26a300955fe7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8378
diff changeset
  6178
    ^ packageDir asFilename
8378
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6179
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6180
    "
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6181
     Smalltalk packageDirectoryForPackageId:'stx:libbasic'  
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6182
     Smalltalk packageDirectoryForPackageId:'stx:goodies/persistency'
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6183
     Smalltalk packageDirectoryForPackageId:'exept:ctypes'
b1da8fb54637 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8370
diff changeset
  6184
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6185
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6186
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6187
!Smalltalk class methodsFor:'system management-undeclared variables'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6188
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6189
clearUndeclaredVariables
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6190
    "remove all undeclared variables"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6191
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6192
    (Smalltalk at:#Undeclared) do:[:eachKey |
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6193
	Smalltalk removeKey:(self undeclaredPrefix , eachKey) asSymbol.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6194
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6195
    (Smalltalk at:#Undeclared) removeAll.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6196
    Smalltalk removeKey:#Undeclared.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6197
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6198
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6199
undeclaredPrefix
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6200
    "the prefix used for undeclared variables"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6201
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6202
    ^ 'Undeclared:::'
6711
ae28c469a063 undeclared variable handling
penk
parents: 6649
diff changeset
  6203
ae28c469a063 undeclared variable handling
penk
parents: 6649
diff changeset
  6204
    "Created: / 31.10.1997 / 01:13:10 / cg"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6205
! !
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6206
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6207
!Smalltalk class methodsFor:'time-versions'!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6208
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6209
configuration
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6210
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6211
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6212
    "for developers only: return the configuration, with which
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6213
     this smalltalk was compiled."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6214
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6215
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6216
    extern char *__getConfigurationString();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6217
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6218
    RETURN (__MKSTRING(__getConfigurationString() COMMA_SND));
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6219
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6220
    ^ 'unknownOS/unknownCONF:unknownPACK'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6221
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6222
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6223
     Smalltalk configuration 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6224
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6225
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6226
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6227
copyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6228
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6229
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6230
    "return a copyright string"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6231
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6232
%{  /* NOCONTEXT */
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6233
#ifndef __getCopyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6234
    extern OBJ __getCopyrightString();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6235
#endif
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6236
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6237
    RETURN (__getCopyrightString());
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6238
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6239
    ^ self primitiveFailed
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6240
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6241
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6242
     Smalltalk copyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6243
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6244
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6245
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6246
distributorString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6247
    "{ Pragma: +optSpace }"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6248
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6249
    "return a string describing the distributor of this software"
567
da2f1b829453 added distributor string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  6250
da2f1b829453 added distributor string
Claus Gittinger <cg@exept.de>
parents: 544
diff changeset
  6251
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6252
#ifndef __getDistributorString
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6253
    extern OBJ __getDistributorString();
568
f5754db15abf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
  6254
#endif
f5754db15abf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 567
diff changeset
  6255
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 822
diff changeset
  6256
    RETURN (__getDistributorString());
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6257
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6258
    ^ 'eXept Software AG, Germany'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6259
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6260
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6261
     Smalltalk distributorString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6262
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6263
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6264
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6265
expirationTime
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6266
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6267
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6268
    "for developers only: return the time when the system will expire.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6269
     after this time it will not run any longer.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6270
     It returns nil, if no expiration time has been set (system runs forever :-))"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6271
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6272
    |exp|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6273
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6274
%{  
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6275
    extern unsigned int __getExpirationTime();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6276
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6277
    exp = __MKUINT(__getExpirationTime());
8583
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
    exp == 0 ifTrue:[
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6280
        ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6281
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6282
    ^ 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
  6283
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6284
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6285
     Smalltalk expirationTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6286
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6287
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6288
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6289
fullVersionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6290
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6291
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6292
    "return a full version string"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6293
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6294
    ^ 'Smalltalk/X release ' , self versionString , ' of ' , self versionDate 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6295
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6296
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6297
     Smalltalk fullVersionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6298
    "
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
    "Created: / 27.10.1997 / 17:03:09 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6301
    "Modified: / 27.10.1997 / 17:04:02 / cg"
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
hello
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6305
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6306
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6307
    "return a greeting string"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6308
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6309
    "stupid: this should come from a resource file ...
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6310
     but I dont use it here, to allow mini-systems without
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6311
     Resource-stuff."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6312
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6313
    |proto lang|
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6314
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6315
    lang := Language.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6316
    (lang == #de) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6317
        proto := 'Willkommen bei %1 (Version %2 von %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6318
    ] ifFalse:[ (lang == #fr) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6319
        proto := 'Salut, Bienvenue à %1 (version %2 de %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6320
    ] ifFalse:[ (lang == #it) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6321
        proto := 'Ciao, benvenuto al %1 (versione %2 di %3)'
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6322
    ] ifFalse:[ (lang == #es) ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  6323
"/        proto := 'Hola, bienvenida a %1 (versión %2 de %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6324
    ] ifFalse:[ (lang == #es) ifTrue:[
8084
88bccdc5943d fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents: 7999
diff changeset
  6325
"/        proto := 'Oi, benvindo a %1 (versão %2 de %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6326
    ] ifFalse:[ (lang == #no) ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6327
        proto := 'Hei, verdenmottakelse til %1 (versjon %2 av %3)'
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6328
    ]]]]]].
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6329
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6330
    "/ ... more needed here ...
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6331
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6332
    proto isNil ifTrue:[
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6333
        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
  6334
    ].
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6335
6187
d4788adb7a8e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6186
diff changeset
  6336
    ^ proto bindWith:('SmallTalk/X' allBold)
8880
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6337
                with:(self versionString) 
9d5c12f1c75f German hello string
Stefan Vogel <sv@exept.de>
parents: 8847
diff changeset
  6338
                with:(self versionDate)
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6339
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6340
    "
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6341
     Smalltalk language:#us.   
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6342
     Smalltalk hello     
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6343
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6344
     Smalltalk language:#de.   
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6345
     Smalltalk hello  
1412
7c0326f67a03 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  6346
5641
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6347
     Smalltalk language:#no.   
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6348
     Smalltalk hello  
02c5bdd3a982 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5613
diff changeset
  6349
1422
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  6350
     Transcript showCR:(Smalltalk hello)
9a0b792f2953 showCr: -> showCR:
Claus Gittinger <cg@exept.de>
parents: 1419
diff changeset
  6351
     Stdout showCR:(Smalltalk hello)
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6352
    "
1307
cefe1b5d7cc1 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1299
diff changeset
  6353
1412
7c0326f67a03 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1410
diff changeset
  6354
    "Modified: 18.5.1996 / 14:25:13 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6355
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6356
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6357
imageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6358
    "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
  6359
     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
  6360
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6361
    ^ ImageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6362
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6363
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6364
     Smalltalk imageStartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6365
     Smalltalk imageRestartTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6366
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6367
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6368
    "Created: 13.12.1995 / 17:44:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6369
    "Modified: 6.3.1996 / 11:56:35 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6370
!
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
imageSaveTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6373
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6374
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6375
    "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
  6376
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6377
    ^ ObjectMemory imageSaveTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6378
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6379
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6380
imageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6381
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6382
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6383
    "return a timestamp for the moment when this system started the first time
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6384
     (i.e. the first initial start without an image)"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6385
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6386
    ^ ImageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6387
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6388
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6389
     Smalltalk imageStartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6390
     Smalltalk imageRestartTime
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6391
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6392
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6393
    "Created: 13.12.1995 / 17:44:14 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6394
    "Modified: 13.12.1995 / 17:45:47 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6395
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6396
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6397
majorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6398
    "{ Pragma: +optSpace }"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6399
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6400
    "return the major version number.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6401
     This is only incremented for very fundamental changes,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6402
     which make old object files totally incompatible
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6403
     (for example, if the layout/representation of fundamental
3382
0f4a79609ee1 bumped rev.
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  6404
      classes changes).
0f4a79609ee1 bumped rev.
Claus Gittinger <cg@exept.de>
parents: 3366
diff changeset
  6405
3988
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6406
     ST/X revision Naming is:
7616
dfb5eb27749d classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 7613
diff changeset
  6407
	<major>.<minor>.<revision>.<release>"
7362
1af5f648cdb2 major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents: 7348
diff changeset
  6408
1af5f648cdb2 major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents: 7348
diff changeset
  6409
    ^ 5
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6410
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6411
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6412
     Smalltalk majorVersionNr
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6413
    "
1941
51332fe23542 bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents: 1917
diff changeset
  6414
51332fe23542 bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents: 1917
diff changeset
  6415
    "Modified: 8.11.1996 / 19:59:21 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6416
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6417
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6418
minorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6419
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6420
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6421
    "return the minor version number.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6422
     This is incremented for changes which make some old object
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6423
     files incompatible, or the protocol changes such that some
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6424
     classes need rework.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6425
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6426
     ST/X revision Naming is:
7981
2051e60ee804 release change
Claus Gittinger <cg@exept.de>
parents: 7962
diff changeset
  6427
        <major>.<minor>.<revision>.<release>"
2051e60ee804 release change
Claus Gittinger <cg@exept.de>
parents: 7962
diff changeset
  6428
8665
3b3b937cfba5 *** empty log message ***
penk
parents: 8664
diff changeset
  6429
    ^ 2
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6430
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6431
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6432
     Smalltalk minorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6433
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6434
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6435
    "Modified: / 3.11.1997 / 14:49:48 / cg"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6436
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6437
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6438
releaseIdentification
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6439
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6440
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6441
    "for developers only: return the release 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6442
     (to further identify the version in case of errors)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6443
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6444
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6445
    extern OBJ __getRel();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6446
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6447
    RETURN (__getRel());
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6448
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6449
    ^ 'ST/X_experimental'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6450
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6451
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6452
     Smalltalk releaseIdentification
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6453
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6454
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6455
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6456
releaseNr
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6457
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6458
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  6459
    "return the revision number.
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6460
     Incremented for releases which fix bugs/add features but did not find
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6461
     their way to the outside world.
3988
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6462
1794a51fcb6e bumped version
Claus Gittinger <cg@exept.de>
parents: 3976
diff changeset
  6463
     ST/X revision Naming is:
8663
eb3d89d29121 bumped version
penk
parents: 8584
diff changeset
  6464
        <major>.<minor>.<revision>.<release>"
eb3d89d29121 bumped version
penk
parents: 8584
diff changeset
  6465
8960
01a030e0ca74 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8959
diff changeset
  6466
    ^ 1
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6467
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6468
    " 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6469
     Smalltalk releaseNr 
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6470
    "
732
29a49feab799 release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
  6471
29a49feab799 release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents: 728
diff changeset
  6472
    "Created: 10.12.1995 / 01:42:19 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6473
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6474
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6475
revisionNr
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6476
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6477
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6478
    "return the revision number.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6479
     Incremented for releases which fix bugs/add features
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6480
     and represent a stable workable version which got published
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6481
     to the outside world.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6482
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6483
     ST/X revision Naming is:
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6484
        <major>.<minor>.<revision>.<release>"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6485
8959
802b6ebdf56a revision bump
Claus Gittinger <cg@exept.de>
parents: 8958
diff changeset
  6486
    ^ 7
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6487
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6488
    " 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6489
     Smalltalk revisionNr
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6490
     Smalltalk hello        
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6491
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6492
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6493
    "Modified: / 19.6.1998 / 04:29:10 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6494
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  6495
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6496
timeStamp
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6497
    "return a string useful for timestamping a file.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6498
     The returned string is padded with spaces for a constant
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6499
     length (to avoid changing a files size in fileOut with unchanged
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6500
     class)."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6501
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6502
    ^ ('''' , self timeStampString , '''') paddedTo:80 with:(Character space)
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6503
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6504
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6505
timeStamp:aStream
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6506
    "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
  6507
     ST80 compatibility"
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
    aStream nextPutAll:(self timeStamp).
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6510
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6511
    "Created: / 18.6.1998 / 17:22:58 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6512
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6513
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6514
timeStampString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6515
    "return a string useful for timestamping a file."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6516
7962
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6517
    |dateString|
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6518
8115
338205d54c48 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8084
diff changeset
  6519
    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
  6520
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6521
    ^ ('From Smalltalk/X, Version:' , (Smalltalk versionString) , ' on '
7962
5edb6eac1ea7 timestamp in english
Claus Gittinger <cg@exept.de>
parents: 7854
diff changeset
  6522
       , dateString , ' at ' , Time now printString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6523
       )
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6524
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6525
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6526
versionDate
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6527
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6528
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6529
    "return the executables build date - thats the date when the smalltalk
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6530
     executable was built"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6531
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6532
%{  /* NOCONTEXT */
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6533
    extern char *__getBuildDateString();
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6534
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6535
    RETURN (__MKSTRING(__getBuildDateString() COMMA_SND) );
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6536
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6537
    ^ 'today'
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6538
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6539
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6540
     Smalltalk versionDate 
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6541
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6542
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6543
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6544
versionString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6545
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6546
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6547
    "return the version string"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6548
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6549
    ^ (self majorVersionNr printString ,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6550
       '.',
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6551
       self minorVersionNr printString ,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6552
       '.',
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6553
       self revisionNr printString)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6554
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6555
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6556
     Smalltalk versionString
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
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6559
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6560
vmMajorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6561
    "{ Pragma: +optSpace }"
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6562
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6563
    "return the VMs major version number."
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6564
%{
8913
b9498d27a554 64bit; mkSmallInteger
Claus Gittinger <cg@exept.de>
parents: 8880
diff changeset
  6565
    RETURN (__mkSmallInteger(4));
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6566
%}.
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6567
    ^ 4
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6568
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6569
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6570
     Smalltalk vmMajorVersionNr
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6571
    "
2
claus
parents: 1
diff changeset
  6572
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  6573
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  6574
!Smalltalk class methodsFor:'documentation'!
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 617
diff changeset
  6575
1568
2ed24cca3dac oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents: 1567
diff changeset
  6576
version
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  6577
    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.702 2005-12-21 18:42:17 cg Exp $'
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 617
diff changeset
  6578
! !