author | Claus Gittinger <cg@exept.de> |
Wed, 21 Mar 2007 22:05:40 +0100 | |
changeset 10471 | f39a4d69ef0f |
parent 10451 | cb5c7b091764 |
child 10538 | 7db2e140567f |
permissions | -rw-r--r-- |
1 | 1 |
" |
5 | 2 |
COPYRIGHT (c) 1988 by Claus Gittinger |
10071 | 3 |
All Rights Reserved |
1 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5363 | 12 |
"{ Package: 'stx:libbasic' }" |
13 |
||
1 | 14 |
Object subclass:#Smalltalk |
10054 | 15 |
instanceVariableNames:'' |
16 |
classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses |
|
17 |
NumberOfClassesHint SystemPath StartupClass StartupSelector |
|
18 |
StartupArguments CommandLine CommandName CommandLineArguments |
|
19 |
CachedAbbreviations SilentLoading Initializing StandAlone |
|
10231 | 20 |
HeadlessOperation IsPlugin IsSharedLibraryComponent IsSTScript |
10054 | 21 |
DebuggingStandAlone LogDoits LoadBinaries RealSystemPath |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
22 |
ResourcePath SourcePath BinaryPath FileInPath PackagePath |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
23 |
BinaryDirName ResourceDirName SourceDirName BitmapDirName |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
24 |
PackageDirName FileInDirName ChangeFileName ImageStartTime |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
25 |
ImageRestartTime DemoMode SaveEmergencyImage SpecialObjectArray |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
26 |
CallbackSignal KnownPackages ClassesFailedToInitialize |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
27 |
HasNoConsole' |
10054 | 28 |
poolDictionaries:'' |
29 |
category:'System-Support' |
|
1 | 30 |
! |
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 | 36 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
37 |
copyright |
617 | 38 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
39 |
COPYRIGHT (c) 1988 by Claus Gittinger |
10071 | 40 |
All Rights Reserved |
8583
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 | 52 |
" |
53 |
This is one of the central classes in the system; |
|
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 | 56 |
|
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 | 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 | 67 |
|
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
68 |
|
1286 | 69 |
[Instance variables:] |
10071 | 70 |
none - all handling is done in the VM |
1286 | 71 |
|
72 |
[Class variables:] |
|
73 |
||
10071 | 74 |
StartBlocks <Collection> blocks to be executed in a separate process after |
75 |
everything has been initialized. These blocks will |
|
76 |
be deleted after execution and therefore not be |
|
77 |
executed after an image restart. Initial processes |
|
78 |
(such as the Launcher) are usually started here. |
|
79 |
These blocks are added by smalltalk.rc/private.rc etc. |
|
80 |
via #addStartBlock during early initialization. |
|
81 |
||
82 |
ImageStartBlocks |
|
83 |
<Collection> blocks to be executed in a separate process after |
|
84 |
everything has been initialized. These blocks will be |
|
85 |
executed after an image restart. |
|
86 |
These blocks are usually added by smalltalk_r.rc etc. |
|
87 |
||
88 |
ExitBlocks <Collection> blocks to evaluate before system is |
|
89 |
left. Not currently used (GNU-ST compatibility). |
|
90 |
||
91 |
SystemPath <Collection> path to search for system files (sources, bitmaps etc) |
|
92 |
Set to a default here, but typically changed from some |
|
93 |
startup.rc file |
|
94 |
||
95 |
PackagePath <Collection> path to search for package. |
|
96 |
This is going to replace the above systemPath, and a classes |
|
97 |
resources will eventually searched in its package directory. |
|
98 |
This list defines the path, where packages are searched for, |
|
99 |
initially this is something like /opt/smalltalk/packages. |
|
100 |
Set to a default here, but typically changed from some |
|
101 |
startup.rc file |
|
102 |
||
103 |
StartupClass <Class> class and selector, where the system starts up |
|
104 |
StartupSelector <Symbol> (right after VM initialization) |
|
105 |
StartupArguments <Array> If an image is saved while those being nonNil, |
|
106 |
the image will come up there. |
|
107 |
Allows for customized images to be generated from a standard ST/X. |
|
108 |
StandAlone programs also set those during initialization. |
|
109 |
||
110 |
CommandLine <String> Unix (OS-) command line |
|
111 |
||
112 |
CommandName <String> the command (i.e. argv[0]) |
|
113 |
||
114 |
CommandLineArguments <Array> Unix (OS-) command line arguments broken into words |
|
115 |
CommandName has been stripped off. |
|
116 |
(initially set by the VM) |
|
117 |
||
118 |
SilentLoading <Boolean> suppresses messages during fileIn and in compiler |
|
119 |
(can be set to true from a customized main.c) |
|
120 |
||
121 |
Initializing <Boolean> true while (re-)initializing |
|
122 |
Controls the behavior of certain error |
|
123 |
reporters (for example: suppress dialogBoxes) |
|
124 |
while the system is not yet fit for full operation. |
|
125 |
||
126 |
StandAlone <Boolean> true, if this is a standalone app; |
|
127 |
if true the process scheduler watches for |
|
128 |
which processes are still running, and |
|
129 |
exits ST/X, when the last non-background |
|
130 |
and non-system process exits. |
|
131 |
Can be set in an application-specific startup script, |
|
132 |
or, for standAlone programs, by C-code during initialization. |
|
133 |
||
134 |
HeadlessOperation if true, a non-existing Display connection |
|
135 |
<Boolean> will NOT lead to an error-exit during startup. |
|
136 |
Default is false. |
|
137 |
Can be set in an application-specific startup script, |
|
138 |
or, for standAlone programs, by C-code during initialization. |
|
139 |
||
140 |
LogDoits <Boolean> if true, doits are also logged in the changes |
|
141 |
file. Default is false, since the changes file |
|
142 |
may become huge if every tiny doIt is saved there ... |
|
143 |
||
144 |
LoadBinaries <Boolean> if true, we attempt to load classes rom a binary |
|
145 |
file, if present. If false, this is always suppressed. |
|
146 |
||
147 |
SaveEmergencyImage <Boolean> if true (the default), an emergency image |
|
148 |
is saved, if the main Display looses its |
|
149 |
connection. This is useful if you have a |
|
150 |
flaky display connection (serial line) |
|
151 |
and want to have your stuff saved automatically |
|
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 |
|
10071 | 156 |
CachedClasses <Collection> known classes (cached for faster class enumeration) |
157 |
||
158 |
CachedAbbreviations |
|
159 |
<Dictionary> className to filename mappings |
|
160 |
||
161 |
RealSystemPath <Collection> cached collection of directories along the path |
|
162 |
which really exist. Caching avoids long checks |
|
163 |
for existing directories on broken NFS volumes. |
|
164 |
||
165 |
SourcePath <Collection> cached names of really existing directories |
|
166 |
These are remembered, as in NFS systems, |
|
167 |
ResourcePath the time to lookup files may become long |
|
168 |
BinaryPath (especially, if some directories are on machines |
|
169 |
FileInPath which are not up ...). |
|
170 |
Therefore, the set of really |
|
171 |
existing directories is cached when the SystemPath |
|
172 |
is walked the first time. |
|
173 |
A consequence is that you have to invoke |
|
174 |
flushSystemPath, when you create any of those |
|
175 |
directories while running |
|
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 | 178 |
|
179 |
[author:] |
|
10071 | 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:] |
10071 | 183 |
ObjectMemory |
70 | 184 |
" |
8945 | 185 |
! |
186 |
||
187 |
readme_resources |
|
188 |
" |
|
189 |
What is a resource file: |
|
10071 | 190 |
resource files contain language transformation and sometimes |
191 |
UI-look specifics such as icons etc. |
|
8945 | 192 |
|
193 |
Where are resources stored in the image: |
|
10071 | 194 |
Resource files are only read on demand (i.e. when needed) and only read once |
195 |
i.e. they are cached in the image). |
|
196 |
The cached data is held in a per-class class-instVar named 'ClassResources'. |
|
197 |
With only a few exceptions, the only classes which need resources are the GUI |
|
198 |
classes under the SimpleView hierarchy. |
|
8945 | 199 |
|
200 |
How does the system find resources: |
|
10071 | 201 |
The idea is that the system-provided resource files can be overwritten |
202 |
by the user or an application configuration. |
|
203 |
This works via a hierarchy of directories where resources are searched for, |
|
204 |
with the systems standard resource-files being at the end of that chain. |
|
205 |
||
206 |
When searching for a resource file for class X, the following files are searched |
|
207 |
in order: |
|
208 |
{ResourcePath} / resources / X.rs |
|
209 |
{SystemPath} / (CLASSES-PACKAGE-PATH) / X.rs |
|
210 |
{ResourcePath} / (CLASSES-PACKAGE-PATH) / X.rs |
|
8945 | 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 | 217 |
"setup globals from the shell-environment" |
218 |
||
219 |
|envString i langString terrString| |
|
220 |
||
5406 | 221 |
StandAlone isNil ifTrue:[ |
10071 | 222 |
StandAlone := false. |
5406 | 223 |
]. |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
224 |
HeadlessOperation isNil ifTrue:[ |
10071 | 225 |
HeadlessOperation := false. |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
226 |
]. |
5406 | 227 |
|
617 | 228 |
" |
229 |
extract Language and LanguageTerritory from LANG variable. |
|
5846 | 230 |
valid are for example: |
10071 | 231 |
en_en / en |
232 |
en_us |
|
233 |
en_gb |
|
234 |
de_de / de |
|
235 |
de_at (for Austria) |
|
5846 | 236 |
" |
237 |
||
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 | 240 |
|
5846 | 241 |
|
242 |
"Format of LANG is: language[_territory][.codeset][@modifier] |
|
10071 | 243 |
language ISO-639 Language code |
244 |
territory ISO-3166 Contry code" |
|
7779
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:[ |
10071 | 248 |
i := envString indexOf:$@. |
249 |
(i ~~ 0) ifTrue:[ |
|
250 |
envString := envString copyTo:(i - 1). |
|
251 |
LanguageModifier := (envString copyFrom:(i + 1)) asLowercase asSymbol. |
|
252 |
] ifFalse:[ |
|
253 |
LanguageModifier := nil. |
|
254 |
]. |
|
255 |
i := envString indexOf:$.. |
|
256 |
(i ~~ 0) ifTrue:[ |
|
257 |
envString := envString copyTo:(i - 1). |
|
258 |
LanguageCodeset := (envString copyFrom:(i + 1)) asLowercase asSymbol |
|
259 |
] ifFalse:[ |
|
260 |
LanguageCodeset := #'iso8859-1'. |
|
261 |
]. |
|
262 |
i := envString indexOf:$_. |
|
263 |
(i == 0) ifTrue:[ |
|
264 |
langString := envString. |
|
265 |
terrString := envString |
|
266 |
] ifFalse:[ |
|
267 |
langString := envString copyTo:(i - 1). |
|
268 |
terrString := envString copyFrom:(i + 1) |
|
269 |
]. |
|
270 |
Language := langString asLowercase asSymbol. |
|
271 |
LanguageTerritory := terrString asLowercase asSymbol |
|
617 | 272 |
]. |
273 |
||
274 |
" |
|
275 |
Smalltalk initGlobalsFromEnvironment |
|
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 | 298 |
|
299 |
initStandardStreams |
|
300 |
"initialize some well-known streams" |
|
301 |
||
302 |
Stdout := NonPositionableExternalStream forStdout. |
|
303 |
Stderr := NonPositionableExternalStream forStderr. |
|
304 |
Stdin := NonPositionableExternalStream forStdin. |
|
10145
cca90547778e
allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents:
10143
diff
changeset
|
305 |
PrinterStream notNil ifTrue:[ |
cca90547778e
allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents:
10143
diff
changeset
|
306 |
Printer := PrinterStream defaultPrinter. |
cca90547778e
allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents:
10143
diff
changeset
|
307 |
]. |
617 | 308 |
Transcript := Stderr |
309 |
||
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
310 |
" |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
311 |
Smalltalk initStandardStreams |
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
312 |
" |
10145
cca90547778e
allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents:
10143
diff
changeset
|
313 |
|
cca90547778e
allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents:
10143
diff
changeset
|
314 |
"Modified: / 25-10-2006 / 17:36:46 / cg" |
617 | 315 |
! |
316 |
||
317 |
initStandardTools |
|
318 |
"predefine some tools which we will need later |
|
319 |
- if the view-classes exist, |
|
320 |
they will redefine Inspector and Debugger for graphical interfaces" |
|
321 |
||
322 |
"redefine debug-tools, if view-classes exist" |
|
323 |
||
324 |
Display notNil ifTrue:[ |
|
10071 | 325 |
InspectorView notNil ifTrue:[ |
326 |
Inspector := InspectorView |
|
327 |
]. |
|
328 |
DebugView notNil ifTrue:[ |
|
329 |
Debugger := DebugView |
|
330 |
]. |
|
331 |
Display initialize |
|
8583
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 |
Smalltalk initStandardTools |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
336 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
337 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
338 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
339 |
initSystemPath |
617 | 340 |
"setup path where system files are searched for. |
341 |
the default path is set to: |
|
10071 | 342 |
. |
343 |
<directory of exe> (WIN32 only) |
|
344 |
$HOME (if defined) |
|
345 |
$HOME/.smalltalk (if defined & existing) |
|
346 |
$SMALLTALK_LIBDIR (if defined & existing) |
|
347 |
$STX_LIBDIR (if defined & existing) |
|
348 |
$STX_TOPDIR (if defined & existing) |
|
349 |
REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\<CurrentVersion>\LibDir') (WIN32 only) |
|
350 |
REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\LibDir') (WIN32 only) |
|
351 |
<standard places> |
|
9021 | 352 |
|
353 |
standard places (unix): |
|
10071 | 354 |
/opt/smalltalk/<release> (if existing) |
355 |
/opt/smalltalk (if existing) |
|
356 |
/usr/local/lib/smalltalk (if existing) |
|
357 |
/usr/lib/smalltalk (if existing) |
|
358 |
/lib/smalltalk (if existing) |
|
4001
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
359 |
|
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
360 |
win32: |
10071 | 361 |
\programs\exept\smalltalk (if existing) |
362 |
\programs\smalltalk (if existing) |
|
363 |
\smalltalk (if existing) |
|
4001
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
364 |
|
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
365 |
vms: |
10071 | 366 |
$stx:lib (if existing) |
367 |
$stx:root (if existing) |
|
617 | 368 |
|
369 |
of course, it is possible to add entries from the 'smalltalk.rc' |
|
370 |
startup file; add expressions such as: |
|
10071 | 371 |
Smalltalk systemPath addFirst:'/foo/bar/baz'. |
372 |
or: |
|
373 |
Smalltalk systemPath addLast:'/fee/foe/foo'. |
|
4001
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
374 |
|
fa75465bd263
made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents:
3991
diff
changeset
|
375 |
However, smalltalk.rc itself must be found along the above path. |
617 | 376 |
" |
377 |
||
2928 | 378 |
ChangeFileName := 'changes'. |
379 |
OperatingSystem isVMSlike ifTrue:[ |
|
10071 | 380 |
BitmapDirName := 'bitmaps.dir'. |
381 |
BinaryDirName := 'binary.dir'. |
|
382 |
SourceDirName := 'source.dir'. |
|
383 |
ResourceDirName := 'resources.dir'. |
|
384 |
FileInDirName := 'filein.dir'. |
|
385 |
PackageDirName := 'packages.dir'. |
|
2928 | 386 |
] ifFalse:[ |
10071 | 387 |
BitmapDirName := 'bitmaps'. |
388 |
BinaryDirName := 'binary'. |
|
389 |
SourceDirName := 'source'. |
|
390 |
ResourceDirName := 'resources'. |
|
391 |
FileInDirName := 'fileIn'. |
|
392 |
PackageDirName := 'packages'. |
|
2928 | 393 |
]. |
394 |
||
680 | 395 |
SystemPath isNil ifTrue:[ |
10071 | 396 |
SystemPath := OperatingSystem defaultSystemPath. |
397 |
self flushPathCaches |
|
5139 | 398 |
]. |
399 |
||
5144 | 400 |
PackagePath isNil ifTrue:[ |
10071 | 401 |
PackagePath := OperatingSystem defaultPackagePath. |
5144 | 402 |
]. |
617 | 403 |
|
404 |
" |
|
405 |
Smalltalk initSystemPath |
|
406 |
Smalltalk systemPath |
|
407 |
" |
|
5139 | 408 |
|
5145 | 409 |
"Modified: / 24.12.1999 / 00:23:35 / cg" |
8583
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 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
412 |
initUserPreferences |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
413 |
"setup other stuff" |
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 |
LogDoits := false. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
416 |
LoadBinaries := false. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
417 |
SaveEmergencyImage := (StandAlone ~~ true). |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
418 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
419 |
"Modified: / 24.10.1997 / 18:22:47 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
420 |
! |
617 | 421 |
|
7526 | 422 |
initializeClass:aClass |
423 |
"sent from VM via #initializeModules" |
|
424 |
||
7527 | 425 |
Error handle:[:ex | |
10118 | 426 |
ClassesFailedToInitialize isNil ifTrue:[ |
427 |
ClassesFailedToInitialize := IdentitySet new. |
|
428 |
]. |
|
429 |
ClassesFailedToInitialize add:aClass. |
|
430 |
('Smalltalk [warning]: error during initialize of ' , aClass name,': ', ex description printString) errorPrintCR. |
|
431 |
ex suspendedContext fullPrintAll. |
|
432 |
(Smalltalk commandLineArguments includes:'--debug') ifTrue:[ |
|
433 |
ex reject |
|
434 |
]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
435 |
] do:[ |
10118 | 436 |
aClass initialize |
437 |
]. |
|
438 |
||
439 |
"Modified: / 23-10-2006 / 16:29:19 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
440 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
441 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
442 |
initializeModules |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
443 |
"perform module specific initialization and |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
444 |
send #initialize to all classes. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
445 |
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
|
446 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
447 |
self initializeModulesOnce. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
448 |
ClassesFailedToInitialize size > 0 ifTrue:[ |
10122 | 449 |
('Smalltalk [info]: retry initialization of failed class(es)...') infoPrintCR. |
450 |
ClassesFailedToInitialize := nil. |
|
451 |
self initializeModulesOnce. |
|
452 |
ClassesFailedToInitialize size > 0 ifTrue:[ |
|
453 |
('Smalltalk [error]: class(es) persist to fail during initialize') errorPrintCR. |
|
454 |
] |
|
455 |
]. |
|
456 |
||
457 |
ProjectDefinition initializeAllProjectDefinitions. |
|
458 |
||
459 |
"Modified: / 23-10-2006 / 16:40:39 / cg" |
|
7527 | 460 |
! |
461 |
||
7563 | 462 |
initializeModulesOnce |
463 |
"perform module specific initialization and |
|
464 |
send #initialize to all classes. |
|
7527 | 465 |
Notice: this is not called when an image is restarted" |
4963 | 466 |
|
617 | 467 |
%{ |
1688
8a42db1eea60
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
1682
diff
changeset
|
468 |
__init_registered_modules__(3); |
4963 | 469 |
|
1481 | 470 |
@global(DemoMode) = __getDemoMode() ? true : false; |
5410 | 471 |
RETURN (self); |
472 |
%}. |
|
473 |
^ self primitiveFailed |
|
617 | 474 |
! |
475 |
||
7563 | 476 |
initializeSystem |
477 |
"initialize all other classes; setup dispatcher processes etc. |
|
3499 | 478 |
This one is the very first entry into the smalltalk world, |
479 |
right after startup, ususally immediately followed by Smalltalk>>start. |
|
10071 | 480 |
Notice: |
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
481 |
this is not called when an image is restarted; in this |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
482 |
case the show starts in Smalltalk>>restart." |
211 | 483 |
|
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
484 |
|idx| |
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
485 |
|
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
486 |
NumberOfClassesHint := 4500. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
487 |
|
3499 | 488 |
Initializing := true. |
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
489 |
|
3499 | 490 |
AbstractOperatingSystem initializeConcreteClass. |
491 |
||
5400 | 492 |
CommandLineArguments isNil ifTrue:[ |
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
493 |
CommandLineArguments := #('stx'). |
5400 | 494 |
]. |
4006
c7ad38c52eb9
must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents:
4001
diff
changeset
|
495 |
CommandLine := CommandLineArguments copy. |
c7ad38c52eb9
must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents:
4001
diff
changeset
|
496 |
CommandLineArguments := CommandLineArguments asOrderedCollection. |
6842 | 497 |
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
|
498 |
|
4028
b46539f16af5
added --silentStartup argument
Claus Gittinger <cg@exept.de>
parents:
4026
diff
changeset
|
499 |
SilentLoading := (CommandLineArguments includes:'--silentStartup'). |
348 | 500 |
|
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
501 |
DebuggingStandAlone := false. |
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
502 |
|
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
503 |
StandAlone ifTrue:[ |
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
504 |
InfoPrinting := false. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
505 |
ObjectMemory infoPrinting:false. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
506 |
|
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
507 |
idx := CommandLineArguments indexOf:'--debug'. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
508 |
idx ~~ 0 ifTrue:[ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
509 |
DebuggingStandAlone := true. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
510 |
]. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
511 |
DebuggingStandAlone ifTrue:[ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
512 |
Inspector := MiniInspector. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
513 |
Debugger := MiniDebugger. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
514 |
]. |
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
515 |
] ifFalse:[ |
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
516 |
"/ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
517 |
"/ define low-level debugging tools - graphical classes are not prepared yet |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
518 |
"/ to handle things. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
519 |
"/ This will bring us into the MiniDebugger when an error occurs during startup. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
520 |
"/ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
521 |
Inspector := MiniInspector. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
522 |
Debugger := MiniDebugger. |
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
523 |
]. |
1 | 524 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
525 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
526 |
"/ start catching SIGSEGV and SIGBUS |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
527 |
"/ |
713
32540afb8ffc
setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents:
706
diff
changeset
|
528 |
OperatingSystem enableHardSignalInterrupts. |
32540afb8ffc
setup SIGSEGV/SIGBUS handling early - to catch those during startup
Claus Gittinger <cg@exept.de>
parents:
706
diff
changeset
|
529 |
|
1 | 530 |
self initGlobalsFromEnvironment. |
531 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
532 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
533 |
"/ 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
|
534 |
"/ 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
|
535 |
"/ |
1 | 536 |
Object initialize. |
7704 | 537 |
Stream initialize. |
538 |
PositionableStream initialize. |
|
2907 | 539 |
Filename initialize. |
326 | 540 |
ObjectMemory initialize. |
2504
ece15ffbcb69
Initialize OperatingSystem early (needed for some signals).
Stefan Vogel <sv@exept.de>
parents:
2485
diff
changeset
|
541 |
OperatingSystem initialize. |
1 | 542 |
ExternalStream initialize. |
211 | 543 |
|
544 |
self initStandardStreams. "/ setup Stdin, Stdout etc. |
|
1 | 545 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
546 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
547 |
"/ sorry, path must be set before ... |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
548 |
"/ 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
|
549 |
"/ |
1 | 550 |
self initSystemPath. |
551 |
||
552 |
Compiler := ByteCodeCompiler. |
|
553 |
Compiler isNil ifTrue:[ |
|
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
554 |
" |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
555 |
ByteCodeCompiler is not in the system (i.e. has not been linked in) |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
556 |
this allows at least immediate evaluations for runtime systems without compiler |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
557 |
NOTICE: a parser is always needed, otherwise we cannot read resource files etc. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
558 |
" |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
559 |
Compiler := Parser |
1 | 560 |
]. |
561 |
||
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
562 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
563 |
"/ another one, to be initialized before others |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
564 |
"/ |
2077
6b5dc412dd15
must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
565 |
ProcessorScheduler initialize. |
6b5dc412dd15
must initialize Processor before doing modulInits
Claus Gittinger <cg@exept.de>
parents:
2076
diff
changeset
|
566 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
567 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
568 |
"/ now, finally, initialize all other classes |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
569 |
"/ |
325 | 570 |
self initializeModules. |
571 |
||
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
572 |
ImageStartTime := Timestamp now. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
573 |
|
70 | 574 |
self initInterrupts. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
575 |
self initUserPreferences. |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
576 |
|
2090
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
577 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
578 |
"/ 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
|
579 |
"/ 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
|
580 |
"/ (especially: streams and signals can now be used) |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
581 |
"/ |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
582 |
ObjectMemory changed:#initialized. |
42653edf4cc5
added hook for 2nd stage initialization
Claus Gittinger <cg@exept.de>
parents:
2089
diff
changeset
|
583 |
|
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
584 |
"Modified: / 08-01-1997 / 19:58:12 / stefan" |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
585 |
"Modified: / 05-12-2006 / 21:48:58 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
586 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
587 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
588 |
isInitialized |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
589 |
"this returns true, if the system is properly initialized; |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
590 |
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
|
591 |
not working correctly until initialized." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
592 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
593 |
^ Initializing not |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
594 |
! |
1 | 595 |
|
7563 | 596 |
reinitStandardStreams |
597 |
"reinitialize some well-known streams. |
|
598 |
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
|
599 |
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
|
600 |
(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
|
601 |
|
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
602 |
Stdout reOpen. Stderr reOpen. Stdin reOpen. |
161 | 603 |
! ! |
604 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
605 |
!Smalltalk class methodsFor:'Compatibility-Squeak'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
606 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
607 |
beep |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
608 |
Screen current beep |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
609 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
610 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
611 |
garbageCollect |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
612 |
ObjectMemory garbageCollect |
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 |
garbageCollectMost |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
616 |
"collect recently created garbage; return the amount of freeSpace. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
617 |
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
|
618 |
newSpace + freeListSpace is returned." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
619 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
620 |
ObjectMemory scavenge. |
10071 | 621 |
^ ObjectMemory freeSpace |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
622 |
+ (ObjectMemory newSpaceSize - ObjectMemory newSpaceUsed) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
623 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
624 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
625 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
626 |
isMorphic |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
627 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
628 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
629 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
630 |
registerExternalObject: anObject |
7563 | 631 |
"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
|
632 |
If it is already there, just return its index. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
633 |
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
|
634 |
primitive code (via the global Smalltalk:SpecialObjectArray)" |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
635 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
636 |
| objects firstEmptyIndex obj sz newObjects | |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
637 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
638 |
objects := SpecialObjectArray. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
639 |
objects isNil ifTrue:[ |
10071 | 640 |
objects := Array new:5. |
4584
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 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
643 |
"find the first empty slot and look if already registered" |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
644 |
firstEmptyIndex := 0. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
645 |
1 to: objects size do: [:i | |
10071 | 646 |
obj := objects at: i. |
647 |
obj == anObject ifTrue: [^ i]. "object already there, just return its index" |
|
648 |
(obj == nil and: [firstEmptyIndex = 0]) ifTrue: [ |
|
649 |
firstEmptyIndex := i |
|
650 |
] |
|
4584
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 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
653 |
"if no empty slots, expand the array" |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
654 |
firstEmptyIndex = 0 ifTrue: [ |
10071 | 655 |
sz := objects size. |
656 |
newObjects := objects species new: sz + 20. "grow linearly" |
|
657 |
newObjects replaceFrom: 1 to: sz with: objects startingAt: 1. |
|
658 |
firstEmptyIndex := sz + 1. |
|
659 |
SpecialObjectArray := newObjects. |
|
660 |
objects := newObjects |
|
4584
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
661 |
]. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
662 |
|
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
663 |
objects at: firstEmptyIndex put: anObject. |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
664 |
^ firstEmptyIndex |
789c83e8cae0
some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents:
4524
diff
changeset
|
665 |
|
8583
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 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
668 |
renameClassNamed:oldName as:newName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
669 |
self renameClass:(self at:oldName) to:newName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
670 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
671 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
672 |
unregisterExternalObject: anObject |
10071 | 673 |
"Unregister the given object in the external objects array. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
674 |
Do nothing if it isn't registered." |
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 |
|objects| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
677 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
678 |
anObject isNil ifTrue:[^ self]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
679 |
objects := SpecialObjectArray. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
680 |
1 to: objects size do: [:i | |
10071 | 681 |
(objects at: i) == anObject ifTrue: [ |
682 |
objects at: i put: nil |
|
683 |
] |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
684 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
685 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
686 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
687 |
!Smalltalk class methodsFor:'Compatibility-V''Age'! |
6722
8388292bc41d
allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
688 |
|
7563 | 689 |
allClassesImplementing:aSelector |
9506 | 690 |
^ self allClassesForWhich:[:cls | cls implements:aSelector]. |
691 |
||
692 |
"Modified: / 10-08-2006 / 12:12:17 / cg" |
|
9090 | 693 |
! |
694 |
||
695 |
declareConstant:constantName poolName:poolName value:value |
|
696 |
|pool| |
|
697 |
||
698 |
pool := self classNamed:poolName. |
|
699 |
pool declareConstant:constantName value:value |
|
700 |
! |
|
701 |
||
702 |
declarePoolDictionary:poolDictionaryName |
|
703 |
SharedPool subclass:(poolDictionaryName asSymbol) |
|
10071 | 704 |
instanceVariableNames:'' |
705 |
classVariableNames:'' |
|
706 |
poolDictionaries:'' |
|
707 |
category:nil |
|
6722
8388292bc41d
allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
708 |
! ! |
8388292bc41d
allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
709 |
|
7295 | 710 |
!Smalltalk class methodsFor:'Compatibility-VW5.4'! |
6094
79ebf84b51bd
first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents:
6080
diff
changeset
|
711 |
|
7563 | 712 |
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
|
713 |
|newClass| |
79ebf84b51bd
first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents:
6080
diff
changeset
|
714 |
|
79ebf84b51bd
first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents:
6080
diff
changeset
|
715 |
indexed == #none ifTrue:[ |
10071 | 716 |
newClass := superclass |
717 |
subclass:nameSymbol |
|
718 |
instanceVariableNames:instVars |
|
719 |
classVariableNames:'' |
|
720 |
poolDictionaries:'' |
|
721 |
category:category |
|
722 |
inEnvironment:self. |
|
723 |
classInstVars size > 0 ifTrue:[ |
|
724 |
newClass class instanceVariableNames:classInstVars. |
|
725 |
]. |
|
726 |
^ newClass |
|
6851 | 727 |
]. |
728 |
self shouldImplement. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
729 |
! ! |
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 |
!Smalltalk class methodsFor:'accessing'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
732 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
733 |
associationAt:aKey |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
734 |
"return a key-value association for aKey. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
735 |
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
|
736 |
simulated here." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
737 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
738 |
|val| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
739 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
740 |
val := self at:aKey ifAbsent:nil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
741 |
val isNil ifTrue:[^ nil]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
742 |
^ Association key:aKey value:val |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
743 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
744 |
"Created: / 1.11.1997 / 13:27:20 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
745 |
! |
3083 | 746 |
|
7563 | 747 |
associationAt:aKey ifAbsent:exceptionBlock |
748 |
"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
|
749 |
from exceptionBlock, if no such key is present. |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
750 |
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
|
751 |
simulated here." |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
752 |
|
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
753 |
|val| |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
754 |
|
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
755 |
val := self at:aKey ifAbsent:nil. |
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
756 |
val isNil ifTrue:[^ exceptionBlock value]. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
757 |
^ Association key:aKey value:val |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
758 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
759 |
"Created: / 18.6.1998 / 17:05:24 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
760 |
! |
3610
12f32c1fe72b
added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents:
3565
diff
changeset
|
761 |
|
7563 | 762 |
at:aKey |
10071 | 763 |
"retrieve the value stored under aKey, a symbol. |
764 |
Return nil if not present |
|
1956 | 765 |
(this will be changed to trigger an error - better use #at:ifAbsent:)" |
453 | 766 |
|
6851 | 767 |
aKey class == String ifTrue:[self error:'expected symbol']. |
6080
15ea3cbf6003
renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents:
6074
diff
changeset
|
768 |
|
453 | 769 |
%{ /* NOCONTEXT */ |
770 |
RETURN ( __GLOBAL_GET(aKey) ); |
|
5406 | 771 |
%}. |
5410 | 772 |
^ self primitiveFailed |
453 | 773 |
! |
774 |
||
7563 | 775 |
at:aKey ifAbsent:aBlock |
776 |
"retrieve the value stored at aKey. |
|
7565 | 777 |
If there is nothing stored under this key, return the value of |
778 |
the evaluation of aBlock." |
|
453 | 779 |
|
780 |
(self includesKey:aKey) ifTrue:[ |
|
10071 | 781 |
^ self at:aKey |
453 | 782 |
]. |
783 |
^ aBlock value |
|
784 |
||
785 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
786 |
Smalltalk at:#fooBar <- returns nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
787 |
Smalltalk at:#fooBar ifAbsent:['sorry'] <- no error |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
788 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
789 |
! |
453 | 790 |
|
7563 | 791 |
at:aKey ifPresent:aBlock |
792 |
"try to retrieve the value stored at aKey. |
|
793 |
If there is nothing stored under this key, do nothing. |
|
4870 | 794 |
Otherwise, evaluate aBlock, passing the retrieved value as argument." |
795 |
||
796 |
(self includesKey:aKey) ifTrue:[ |
|
10071 | 797 |
^ aBlock value:(self at:aKey) |
4870 | 798 |
]. |
799 |
^ nil |
|
800 |
||
801 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
802 |
Smalltalk at:#fooBar ifPresent:[:what | Transcript showCR:what]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
803 |
Smalltalk at:#Object ifPresent:[:what | Transcript showCR:what]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
804 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
805 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
806 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
807 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
808 |
at:aKey put:aValue |
7563 | 809 |
"store the argument aValue under aKey, a symbol. |
810 |
Return aValue (sigh)." |
|
453 | 811 |
|
812 |
|oldValue| |
|
813 |
||
814 |
%{ |
|
815 |
oldValue = __GLOBAL_SET(aKey, aValue, (OBJ *)0); |
|
816 |
%}. |
|
817 |
CachedClasses notNil ifTrue:[ |
|
10071 | 818 |
oldValue isBehavior ifTrue:[ |
819 |
oldValue name == aKey ifTrue:[ |
|
820 |
CachedClasses remove:oldValue ifAbsent:[] |
|
821 |
] |
|
822 |
]. |
|
823 |
aValue isBehavior ifTrue:[ |
|
1956 | 824 |
"/ aValue isMeta ifTrue:[ |
825 |
"/ "/ this should not happen |
|
826 |
"/ ('SMALLTALK: store a Metaclass: ' , aValue name , ' as ' , aKey) infoPrintCR. |
|
827 |
"/ ]. |
|
828 |
||
10071 | 829 |
aValue name == aKey ifTrue:[ |
830 |
CachedClasses add:aValue |
|
831 |
] ifFalse:[ |
|
832 |
CachedClasses := nil |
|
833 |
] |
|
834 |
]. |
|
453 | 835 |
]. |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
836 |
^ aValue. |
1955 | 837 |
"/ |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
838 |
"/%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
839 |
"/ (void) __GLOBAL_SET(aKey, aValue, (OBJ *)0); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
840 |
"/%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
841 |
"/ CachedClasses := nil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
842 |
"/ ^ aValue |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
843 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
844 |
"Modified: 19.4.1996 / 11:31:49 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
845 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
846 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
847 |
includesKey:aKey |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
848 |
"return true, if the key is known" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
849 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
850 |
"/ for debugging - this is a common mistake, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
851 |
"/ to try to access a class by nameString, instead |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
852 |
"/ of by symbol. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
853 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
854 |
"/ aKey class == String ifTrue:[self halt]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
855 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
856 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
857 |
RETURN ( __GLOBAL_KEYKNOWN(aKey) ); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
858 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
859 |
^ self primitiveFailed |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
860 |
! |
453 | 861 |
|
7563 | 862 |
keyAtValue:anObject |
863 |
"return the symbol under which anObject is stored - or nil" |
|
453 | 864 |
|
865 |
self keysDo:[:aKey | |
|
10071 | 866 |
(self at:aKey) == anObject ifTrue:[^ aKey] |
453 | 867 |
]. |
868 |
^ nil |
|
869 |
||
870 |
"Smalltalk keyAtValue:Object" |
|
871 |
! |
|
872 |
||
7563 | 873 |
keys |
874 |
"return a collection with all keys in the Smalltalk dictionary" |
|
875 |
||
876 |
|keys| |
|
453 | 877 |
|
878 |
keys := IdentitySet new. |
|
879 |
self keysDo:[:k | keys add:k]. |
|
880 |
^ keys |
|
617 | 881 |
! |
882 |
||
7563 | 883 |
removeKey:aKey |
884 |
"remove the association stored under the key-argument from the globals dictionary. |
|
10071 | 885 |
WARNING: |
886 |
this is somewhat dangerous: conceptionally, the association is removed, |
|
887 |
to which machine & byte compiled code refers if it accesses a global. |
|
888 |
If there are still global accesses in some literalArray or from machine-compiled code, |
|
889 |
it continues to reference the globals value via that obsolete association and gets a nil |
|
890 |
value. (which is correct) |
|
891 |
However, if that global is later reintroduced, a new association will be created and |
|
892 |
the new global now referenced via the new association. |
|
893 |
The old accesses will still see nil, although the globals value is actually non-nil |
|
894 |
(this is questionable). |
|
895 |
To avoid this problem, the #removeClass: method never removed the key." |
|
617 | 896 |
|
897 |
CachedClasses := nil. |
|
898 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
899 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
900 |
RETURN ( __GLOBAL_REMOVE(aKey) ); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
901 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
902 |
^ self primitiveFailed |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
903 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
904 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
905 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
906 |
values |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
907 |
"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
|
908 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
909 |
|values| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
910 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
911 |
values := OrderedCollection new. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
912 |
self do:[:v | values add:v]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
913 |
^ values |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
914 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
915 |
"Created: 20.6.1997 / 16:58:28 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
916 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
917 |
|
10169 | 918 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
919 |
!Smalltalk class methodsFor:'browsing'! |
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 |
browseAllCallsOn:aSelectorSymbol |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
922 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
923 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
924 |
"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
|
925 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
926 |
UserPreferences systemBrowserClass browseAllCallsOn:aSelectorSymbol |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
927 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
928 |
" |
10071 | 929 |
Smalltalk browseAllCallsOn:#at:put: |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
930 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
931 |
! |
617 | 932 |
|
7563 | 933 |
browseAllSelect:aBlock |
934 |
"{ Pragma: +optSpace }" |
|
935 |
||
936 |
"startup a browser for all methods for which aBlock returns true" |
|
617 | 937 |
|
6020 | 938 |
UserPreferences systemBrowserClass browseAllSelect:aBlock |
617 | 939 |
|
940 |
" |
|
941 |
Smalltalk browseAllSelect:[:m | m literals isNil] |
|
942 |
" |
|
943 |
! |
|
944 |
||
7563 | 945 |
browseChanges |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
946 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
947 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
948 |
"startup a changes browser" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
949 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
950 |
ChangesBrowser notNil ifTrue:[ |
10071 | 951 |
ChangesBrowser open |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
952 |
] ifFalse:[ |
10071 | 953 |
self warn:'no ChangesBrowser built in' |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
954 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
955 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
956 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
957 |
Smalltalk browseChanges |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
958 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
959 |
! |
453 | 960 |
|
7563 | 961 |
browseClass:aClass |
962 |
"{ Pragma: +optSpace }" |
|
963 |
||
964 |
"startup a browser on aClass" |
|
6970 | 965 |
|
966 |
UserPreferences systemBrowserClass browseClass:aClass |
|
967 |
||
968 |
" |
|
10071 | 969 |
Smalltalk browseClass:Array |
6970 | 970 |
" |
971 |
! |
|
972 |
||
7563 | 973 |
browseImplementorsMatching:aSelectorSymbolOrMatchPattern |
974 |
"{ Pragma: +optSpace }" |
|
6819 | 975 |
|
976 |
"startup a browser for all methods implementing a message matching" |
|
977 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
978 |
UserPreferences systemBrowserClass browseImplementorsMatching:aSelectorSymbolOrMatchPattern |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
979 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
980 |
" |
10071 | 981 |
Smalltalk browseImplementorsOf:#'at:put:' |
982 |
Smalltalk browseImplementorsMatching:#'at:*' |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
983 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
984 |
! |
6819 | 985 |
|
7563 | 986 |
browseImplementorsOf:aSelectorSymbol |
987 |
"{ Pragma: +optSpace }" |
|
988 |
||
989 |
"startup a browser for all methods implementing a particular message" |
|
453 | 990 |
|
6020 | 991 |
UserPreferences systemBrowserClass browseImplementorsOf:aSelectorSymbol |
453 | 992 |
|
993 |
" |
|
10071 | 994 |
Smalltalk browseImplementorsOf:#at:put: |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
995 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
996 |
! |
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 |
browseInClass:aClass |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
999 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1000 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1001 |
"startup a full browser showing aClass" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1002 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1003 |
UserPreferences systemBrowserClass openInClass:aClass |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1004 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1005 |
" |
10071 | 1006 |
Smalltalk browseInClass:Array |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1007 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1008 |
! |
6970 | 1009 |
|
7563 | 1010 |
browseInClass:aClass selector:selector |
1011 |
"{ Pragma: +optSpace }" |
|
1012 |
||
1013 |
"startup a full browser showing aClass>>selector" |
|
6970 | 1014 |
|
1015 |
UserPreferences systemBrowserClass openInClass:aClass selector:selector |
|
1016 |
||
1017 |
" |
|
1018 |
Smalltalk browseInClass:Array selector:#at: |
|
1019 |
" |
|
453 | 1020 |
! ! |
1021 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1022 |
!Smalltalk class methodsFor:'class management'! |
453 | 1023 |
|
7563 | 1024 |
changeCategoryOf:aClass to:newCategory |
1025 |
"change a classes category, add a change record, |
|
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1026 |
send change notifications" |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1027 |
|
8405 | 1028 |
|ns oldCategory| |
1029 |
||
1030 |
oldCategory := aClass category. |
|
1031 |
oldCategory ~= newCategory ifTrue:[ |
|
10071 | 1032 |
aClass category:(newCategory withoutSeparators asSymbol). |
1033 |
||
1034 |
"notify change of category" |
|
1035 |
ns := aClass environment ? self. |
|
1036 |
ns changed:#organization with:(aClass -> oldCategory). |
|
1037 |
ns ~~ self ifTrue:[ |
|
1038 |
self changed:#organization with:(aClass -> oldCategory). |
|
1039 |
] |
|
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1040 |
]. |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1041 |
|
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1042 |
" |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1043 |
Smalltalk changeCategoryOf:NewApplication to:#myApplications |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1044 |
" |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1045 |
|
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1046 |
"Modified: / 11.2.2000 / 11:36:27 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1047 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1048 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1049 |
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
|
1050 |
NameSpace name:name |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1051 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1052 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1053 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1054 |
flushCachedClass:aClass |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1055 |
CachedClasses notNil ifTrue:[ |
10071 | 1056 |
CachedClasses remove:aClass ifAbsent:[] |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1057 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1058 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1059 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1060 |
flushCachedClasses |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1061 |
CachedClasses := nil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1062 |
Class flushSubclassInfo. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1063 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1064 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1065 |
Smalltalk flushCachedClasses |
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 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1068 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1069 |
removeClass:aClass |
7563 | 1070 |
"remove the argument, aClass from the smalltalk dictionary; |
453 | 1071 |
we have to flush the caches since these methods are now void. |
1072 |
Also, class variables of aClass are removed." |
|
1073 |
||
4781 | 1074 |
|sym cSym names oldName oldNameSym actualName wrongName ns ons| |
453 | 1075 |
|
4099 | 1076 |
aClass isNil ifTrue:[^ self]. |
4781 | 1077 |
|
453 | 1078 |
oldName := aClass name. |
4781 | 1079 |
sym := oldNameSym := oldName asSymbol. |
1080 |
((self at:oldNameSym) == aClass) ifFalse:[ |
|
10182 | 1081 |
"check other name ..." |
1082 |
(self includes:aClass) ifFalse:[ |
|
1083 |
'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR. |
|
1084 |
^ self |
|
1085 |
]. |
|
1086 |
" |
|
1087 |
the class has changed its name - without telling me ... |
|
1088 |
what should be done in this case ? |
|
1089 |
" |
|
1090 |
'Smalltalk [warning]: class ' errorPrint. oldName errorPrint. |
|
1091 |
' has changed its name' errorPrintCR. |
|
1092 |
||
1093 |
"/ |
|
1094 |
"/ might be an alias (i.e. removing a compatibility name) |
|
1095 |
"/ |
|
1096 |
actualName := self keyAtValue:aClass. |
|
1097 |
('Smalltalk [info]: ' , oldName , ' is actually stored as ' , actualName , '.') infoPrintCR. |
|
1098 |
sym := actualName asSymbol. |
|
1099 |
oldName := actualName asString. |
|
1100 |
wrongName := true. |
|
453 | 1101 |
]. |
1102 |
||
4781 | 1103 |
ns := aClass nameSpace. |
1104 |
aClass topOwningClass notNil ifTrue:[ |
|
10182 | 1105 |
ons := aClass topOwningClass nameSpace |
4781 | 1106 |
]. |
1107 |
||
453 | 1108 |
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
|
1109 |
|
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1110 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1111 |
"/ 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
|
1112 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1113 |
"/ self removeKey:sym. "/ remove key - this actually fails, if there are |
10182 | 1114 |
"/ still compiled code references." |
453 | 1115 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1116 |
"remove private classes" |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1117 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1118 |
aClass privateClassesSorted do:[:somePrivateClass | |
10182 | 1119 |
aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil. |
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1120 |
]. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1121 |
|
453 | 1122 |
"remove class variables" |
1123 |
||
1124 |
names := aClass classVariableString asCollectionOfWords. |
|
1125 |
names do:[:name | |
|
10182 | 1126 |
cSym := aClass globalKeyForClassVar:name. |
1127 |
self at:cSym asSymbol put:nil. |
|
1128 |
||
1129 |
"/ |
|
1130 |
"/ see comment in removeKey: on why we dont remove it here |
|
1131 |
"/ |
|
1132 |
"/ self removeKey:cSym |
|
453 | 1133 |
]. |
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1134 |
|
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1135 |
|
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1136 |
"/ actually could get along with less flushing |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1137 |
"/ (entries for aClass and subclasses only) |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1138 |
"/ 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
|
1139 |
"/ 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
|
1140 |
"/ expensive then cache flushing. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1141 |
"/ |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1142 |
"/ aClass allSubclassesDo:[:aSubclass | |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1143 |
"/ ObjectMemory flushInlineCachesForClass:aSubclass. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1144 |
"/ ObjectMemory flushMethodCacheFor:aSubclass |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1145 |
"/ ]. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1146 |
"/ ObjectMemory flushInlineCachesForClass:aClass. |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1147 |
"/ ObjectMemory flushMethodCacheFor:aClass |
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1148 |
|
453 | 1149 |
ObjectMemory flushInlineCaches. |
1150 |
ObjectMemory flushMethodCache. |
|
1151 |
||
7181 | 1152 |
aClass addChangeRecordForClassRemove. |
453 | 1153 |
self changed:#classRemove with:aClass. |
1154 |
||
7581
6912a7336e15
class category: sends a change notification;
Claus Gittinger <cg@exept.de>
parents:
7572
diff
changeset
|
1155 |
aClass setCategory:#'* removed *'. |
1655 | 1156 |
|
5326 | 1157 |
self flushCachedClasses. |
1158 |
Class flushSubclassInfo. |
|
1159 |
||
3627
452f2e1ff1b4
removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents:
3626
diff
changeset
|
1160 |
wrongName == true ifTrue:[ |
10182 | 1161 |
"/ |
1162 |
"/ an alias (i.e. removing a compatibility name) |
|
1163 |
"/ |
|
1164 |
"/ check if there are more refs to it ... |
|
1165 |
[self includes:aClass] whileTrue:[ |
|
1166 |
actualName := self keyAtValue:aClass. |
|
1167 |
('Smalltalk [info]: ' , aClass name , ' is also registered under the name ' , actualName |
|
1168 |
, ' - remove that binding too.') infoPrintCR. |
|
1169 |
self at:actualName put:nil. |
|
1170 |
]. |
|
4724
44793fe70787
recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents:
4723
diff
changeset
|
1171 |
]. |
44793fe70787
recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents:
4723
diff
changeset
|
1172 |
|
4781 | 1173 |
ns ~~ Smalltalk ifTrue:[ |
10182 | 1174 |
ons notNil ifTrue:[ |
1175 |
ClassBuilder |
|
1176 |
recompileGlobalAccessorsTo:oldNameSym |
|
1177 |
in:ons |
|
1178 |
except:nil |
|
1179 |
]. |
|
1180 |
(ns notNil and:[ns ~~ ons]) ifTrue:[ |
|
1181 |
ClassBuilder |
|
1182 |
recompileGlobalAccessorsTo:oldNameSym |
|
1183 |
in:ns |
|
1184 |
except:nil |
|
1185 |
]. |
|
1186 |
]. |
|
1187 |
||
1188 |
"Modified: / 18-11-2006 / 17:16:31 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1189 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1190 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1191 |
renameClass:aClass to:newName |
7563 | 1192 |
"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
|
1193 |
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
|
1194 |
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
|
1195 |
|
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1196 |
|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
|
1197 |
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
|
1198 |
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
|
1199 |
oldMetaclass newMetaclass newCategory| |
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1200 |
|
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1201 |
"/ check for all intermediate namespaces / owning classes |
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1202 |
i1 := 1. |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1203 |
i2 := 1. |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1204 |
ns := self. |
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1205 |
[i2 ~~ 0] whileTrue:[ |
10071 | 1206 |
i2 := newName indexOfSubCollection:'::' startingAt:i1. |
1207 |
i2 ~~ 0 ifTrue:[ |
|
1208 |
nm := newName copyFrom:i1 to:i2-1. |
|
1209 |
ns isNameSpace ifTrue:[ |
|
1210 |
subns := ns at:nm asSymbol ifAbsent:nil. |
|
1211 |
subns isNil ifTrue:[ |
|
1212 |
self error:'Nonexisting namespace: ',nm. |
|
1213 |
^ nil. |
|
1214 |
]. |
|
1215 |
] ifFalse:[ |
|
1216 |
subns := ns privateClassesAt:nm asSymbol. |
|
1217 |
subns isNil ifTrue:[ |
|
1218 |
self error:'Cannot create a namespace below a class' |
|
1219 |
] |
|
1220 |
]. |
|
1221 |
ns := subns. |
|
1222 |
i1 := i2 + 2. |
|
1223 |
]. |
|
5253
c6b2933882fe
rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents:
5247
diff
changeset
|
1224 |
]. |
617 | 1225 |
|
1226 |
oldName := aClass name. |
|
6734 | 1227 |
oldNameSpace := aClass topNameSpace. |
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
1228 |
oldBaseName := aClass nameWithoutNameSpacePrefix. |
3698
8bce45214d24
fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
1229 |
oldBaseNameWithoutPrefix := aClass nameWithoutPrefix. |
617 | 1230 |
oldSym := oldName asSymbol. |
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1231 |
privateClasses := aClass privateClassesSorted. |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1232 |
|
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1233 |
((self at:oldSym) ~~ aClass) ifTrue:[ |
10071 | 1234 |
'Smalltalk [warning]: rename failed - name is different from key' errorPrintCR. |
1235 |
^ self |
|
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1236 |
]. |
617 | 1237 |
|
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1238 |
"/ rename the class |
617 | 1239 |
|
1847
6e567214b167
care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents:
1758
diff
changeset
|
1240 |
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
|
1241 |
|
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1242 |
"/ change the owning class |
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1243 |
ns isNameSpace ifFalse:[ |
10071 | 1244 |
aClass isPrivate ifTrue:[ |
1245 |
aClass class setOwningClass:ns. |
|
1246 |
] ifFalse:[ |
|
1247 |
"/ sigh - must make a PrivateMetaclass from Metaclass |
|
1248 |
oldMetaclass := aClass class. |
|
1249 |
newMetaclass := PrivateMetaclass new. |
|
1250 |
newMetaclass flags:(oldMetaclass flags). |
|
1251 |
newMetaclass setSuperclass:(oldMetaclass superclass). |
|
1252 |
newMetaclass instSize:(oldMetaclass instSize). |
|
1253 |
newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString). |
|
1254 |
newMetaclass setMethodDictionary:(oldMetaclass methodDictionary). |
|
1255 |
newMetaclass setSoleInstance:aClass. |
|
1256 |
newMetaclass setOwningClass:ns. |
|
1257 |
||
1258 |
aClass changeClassTo:newMetaclass. |
|
1259 |
ObjectMemory flushCaches. |
|
1260 |
] |
|
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1261 |
] ifTrue:[ |
10071 | 1262 |
aClass isPrivate ifTrue:[ |
1263 |
newCategory := aClass topOwningClass category. |
|
1264 |
||
1265 |
"/ sigh - must make a Metaclass from PrivateMetaclass |
|
1266 |
oldMetaclass := aClass class. |
|
1267 |
||
1268 |
newMetaclass := Metaclass new. |
|
1269 |
newMetaclass flags:(oldMetaclass flags). |
|
1270 |
newMetaclass setSuperclass:(oldMetaclass superclass). |
|
1271 |
newMetaclass instSize:(oldMetaclass instSize). |
|
1272 |
newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString). |
|
1273 |
newMetaclass setMethodDictionary:(oldMetaclass methodDictionary). |
|
1274 |
newMetaclass setSoleInstance:aClass. |
|
1275 |
||
1276 |
aClass category:newCategory. |
|
1277 |
aClass changeClassTo:newMetaclass. |
|
1278 |
ObjectMemory flushCaches. |
|
1279 |
] |
|
5610
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1280 |
]. |
af0d91fe32fc
rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents:
5601
diff
changeset
|
1281 |
|
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1282 |
aClass setName:newSym. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1283 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1284 |
"/ store it in Smalltalk |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1285 |
self at:oldSym put:nil. |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
1286 |
|
878
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1287 |
"/ |
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1288 |
"/ 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
|
1289 |
"/ |
c09b016c6674
do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents:
857
diff
changeset
|
1290 |
"/ self removeKey:oldSym. |
617 | 1291 |
self at:newSym put:aClass. |
1292 |
||
1525
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1293 |
"/ 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
|
1294 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1295 |
oldNameToNewName := IdentityDictionary new. |
617 | 1296 |
|
1297 |
names := aClass classVariableString asCollectionOfWords. |
|
1298 |
names do:[:name | |
|
10071 | 1299 |
oldCVSym := (oldSym , ':' , name) asSymbol. |
1300 |
value := self at:oldCVSym. |
|
1301 |
self at:oldCVSym put:nil. |
|
1302 |
||
1303 |
"/ |
|
1304 |
"/ see comment in #removeKey: on why we dont remove it it here |
|
1305 |
"/ |
|
1306 |
"/ self removeKey:cSym. |
|
1307 |
||
1308 |
newCVSym := (newSym , ':' , name) asSymbol. |
|
1309 |
self at:newCVSym put:value. |
|
1310 |
||
1311 |
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
|
1312 |
]. |
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1313 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1314 |
"/ 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
|
1315 |
|
935b12ecf8ff
in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents:
1481
diff
changeset
|
1316 |
oldNameToNewName keysAndValuesDo:[:oldNameSym :newNameSym | |
10071 | 1317 |
aClass withAllSubclasses do:[:aSubClass | |
1318 |
Transcript showCR:'changing global accesses from ''' , oldNameSym , ''' into ''' , newNameSym , ''' in class: ''' , aSubClass name , ''' ...'. |
|
1319 |
aSubClass instAndClassSelectorsAndMethodsDo:[:sel :aMethod | |
|
1320 |
aMethod changeLiteral:oldNameSym to:newNameSym |
|
1321 |
]. |
|
1322 |
]. |
|
1323 |
||
1324 |
"/ and also in privateClasses ? ... |
|
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1325 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1326 |
"/ privateClasses size > 0 ifTrue:[ |
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1327 |
"/ privateClasses do:[:aPrivateClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1328 |
"/ aPrivateClass withAllSubclasses do:[:aSubClass | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1329 |
"/ aSubClass class methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1330 |
"/ aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1331 |
"/ ]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1332 |
"/ aSubClass methodDictionary do:[:aMethod | |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1333 |
"/ aMethod changeLiteral:oldNameSym to:newNameSym |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1334 |
"/ ] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1335 |
"/ ]. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1336 |
"/ ] |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1337 |
"/ ] |
617 | 1338 |
]. |
1339 |
||
2270
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1340 |
aClass addChangeRecordForClassRename:oldSym to:newSym. |
76c239686353
when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents:
2249
diff
changeset
|
1341 |
|
5333
d80386e06d21
rename into other namespace did not work
Claus Gittinger <cg@exept.de>
parents:
5328
diff
changeset
|
1342 |
"/ 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
|
1343 |
aClass setEnvironment:nil. |
6734 | 1344 |
newNameSpace := aClass topNameSpace. |
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
1345 |
|
2485
9f4a11a4521f
new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents:
2476
diff
changeset
|
1346 |
privateClasses size > 0 ifTrue:[ |
10071 | 1347 |
"/ must rename privateClasses as well |
1348 |
Class withoutUpdatingChangesDo:[ |
|
1349 |
privateClasses do:[:aPrivateClass | |
|
1350 |
self renameClass:aPrivateClass |
|
1351 |
to:(newSym , '::' , aPrivateClass nameWithoutPrefix). |
|
1352 |
||
1353 |
Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldName , '::' , aPrivateClass nameWithoutPrefix , ''' ...'. |
|
1354 |
aClass theNonMetaclass recompileMethodsAccessingGlobal:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol. |
|
1355 |
aClass theMetaclass recompileMethodsAccessingGlobal:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol. |
|
1356 |
aClass theNonMetaclass recompileMethodsAccessingGlobal:(aPrivateClass nameWithoutPrefix) asSymbol. |
|
1357 |
aClass theMetaclass recompileMethodsAccessingGlobal:(aPrivateClass nameWithoutPrefix) asSymbol. |
|
9822
38acd1c5eeab
recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
9819
diff
changeset
|
1358 |
"/ ClassBuilder |
10071 | 1359 |
"/ recompileGlobalAccessorsTo:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol |
1360 |
"/ in:newNameSpace |
|
9822
38acd1c5eeab
recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
9819
diff
changeset
|
1361 |
"/ except:nil. |
10071 | 1362 |
] |
1363 |
] |
|
2405
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
1364 |
]. |
939f4e751ef3
dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents:
2379
diff
changeset
|
1365 |
|
2319
640bb389f90a
recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents:
2317
diff
changeset
|
1366 |
oldNameSpace ~~ newNameSpace ifTrue:[ |
5246
2ca7b20c4108
create namespaces as requried, when renaming a class
Claus Gittinger <cg@exept.de>
parents:
5214
diff
changeset
|
1367 |
|
10071 | 1368 |
"/ all those referencing the class from the old nameSpace |
1369 |
"/ must be recompiled ... |
|
1370 |
"/ (to now access the global from smalltalk) |
|
1371 |
||
1372 |
oldNameSpace ~~ Smalltalk ifTrue:[ |
|
1373 |
Transcript showCR:'recompiling methods in ''' , oldNameSpace name , ''' accessing ''' , oldName , ''' ...'. |
|
1374 |
||
1375 |
ClassBuilder |
|
1376 |
recompileGlobalAccessorsTo:oldName asSymbol |
|
1377 |
in:oldNameSpace |
|
1378 |
except:nil. |
|
1379 |
]. |
|
1380 |
||
1381 |
"/ all referencing the class in the new namespace |
|
1382 |
"/ as well; to now access the new class. |
|
1383 |
||
1384 |
(newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[ |
|
1385 |
Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldBaseName , ''' ...'. |
|
1386 |
||
1387 |
ClassBuilder |
|
1388 |
recompileGlobalAccessorsTo:oldBaseName asSymbol |
|
1389 |
in:newNameSpace |
|
1390 |
except:nil. |
|
1391 |
]. |
|
3698
8bce45214d24
fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents:
3678
diff
changeset
|
1392 |
] ifFalse:[ |
10071 | 1393 |
"/ all references to a global with my new name in my owning class |
1394 |
"/ must now be redirected to myself. |
|
1395 |
||
1396 |
aClass isPrivate ifTrue:[ |
|
1397 |
newBaseName := aClass nameWithoutNameSpacePrefix. |
|
1398 |
newBaseNameWithoutPrefix := aClass nameWithoutPrefix. |
|
1399 |
||
1400 |
Transcript showCR:'recompiling methods accessing ''' , oldBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'. |
|
1401 |
aClass owningClass recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix. |
|
1402 |
aClass owningClass class recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix. |
|
1403 |
||
1404 |
Transcript showCR:'recompiling methods accessing ''' , oldBaseName , ''' in: ''' , aClass owningClass name , ''' ...'. |
|
1405 |
aClass owningClass recompileMethodsAccessingGlobal:oldBaseName. |
|
1406 |
aClass owningClass class recompileMethodsAccessingGlobal:oldBaseName. |
|
1407 |
||
1408 |
Transcript showCR:'recompiling methods accessing ''' , newBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'. |
|
1409 |
aClass owningClass recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix. |
|
1410 |
aClass owningClass class recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix. |
|
1411 |
||
1412 |
Transcript showCR:'recompiling methods accessing ''' , newBaseName , ''' in: ''' , aClass owningClass name , ''' ...'. |
|
1413 |
aClass owningClass recompileMethodsAccessingGlobal:newBaseName. |
|
1414 |
aClass owningClass class recompileMethodsAccessingGlobal:newBaseName. |
|
1415 |
] |
|
4040
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1416 |
]. |
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1417 |
|
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1418 |
aClass changed:#definition. |
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1419 |
"/ 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
|
1420 |
aClass allSubclassesDo:[:subClass | |
10071 | 1421 |
subClass changed:#definition. |
7996
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1422 |
]. |
facae0a118da
when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents:
7992
diff
changeset
|
1423 |
"/ 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
|
1424 |
aClass subclassesDo:[:subClass | |
10071 | 1425 |
subClass addChangeRecordForClass:subClass. |
4040
b27f87d9772d
must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
4028
diff
changeset
|
1426 |
]. |
5613
b534e427f028
change message when renaming a class
Claus Gittinger <cg@exept.de>
parents:
5611
diff
changeset
|
1427 |
self changed:#definition. |
b534e427f028
change message when renaming a class
Claus Gittinger <cg@exept.de>
parents:
5611
diff
changeset
|
1428 |
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
|
1429 |
|
9822
38acd1c5eeab
recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
9819
diff
changeset
|
1430 |
"Created: / 29-10-1995 / 19:58:32 / cg" |
38acd1c5eeab
recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
9819
diff
changeset
|
1431 |
"Modified: / 18-06-1996 / 14:20:50 / stefan" |
38acd1c5eeab
recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents:
9819
diff
changeset
|
1432 |
"Modified: / 05-09-2006 / 12:52:25 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1433 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1434 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1435 |
!Smalltalk class methodsFor:'copying'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1436 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1437 |
deepCopy |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1438 |
"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
|
1439 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1440 |
^ self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1441 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1442 |
"Modified: 18.5.1996 / 12:13:33 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1443 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1444 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1445 |
deepCopyUsing:aDictionary |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1446 |
"return a deep copy of the receiver. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1447 |
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
|
1448 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1449 |
^ self |
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 |
"Modified: 18.5.1996 / 12:13:36 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1452 |
! |
453 | 1453 |
|
7563 | 1454 |
shallowCopy |
1455 |
"redefined to return self - there is only one Smalltalk dictionary" |
|
617 | 1456 |
|
1457 |
^ self |
|
1410 | 1458 |
|
1459 |
"Modified: 18.5.1996 / 12:13:39 / cg" |
|
617 | 1460 |
! |
1461 |
||
7563 | 1462 |
simpleDeepCopy |
1463 |
"redefined to return self - there is only one Smalltalk dictionary" |
|
453 | 1464 |
|
1465 |
^ self |
|
1410 | 1466 |
|
1467 |
"Modified: 18.5.1996 / 12:13:42 / cg" |
|
453 | 1468 |
! ! |
1469 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
1470 |
!Smalltalk class methodsFor:'debugging ST/X'! |
453 | 1471 |
|
7563 | 1472 |
compileTrace:aBoolean |
1473 |
"dump generated inline code (NOOP if VM was compiled without the trace-debug option)" |
|
7325 | 1474 |
%{ |
1475 |
extern char __compileTrace__; |
|
1476 |
||
1477 |
__compileTrace__ = (aBoolean == true) ? 1 : 0; |
|
1478 |
%} |
|
1479 |
" |
|
1480 |
Smalltalk compileTrace:true |
|
1481 |
Smalltalk compileTrace:false |
|
1482 |
" |
|
1483 |
! |
|
1484 |
||
7563 | 1485 |
debugBreakPoint |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1486 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1487 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1488 |
"call the dummy debug function, on which a breakpoint |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1489 |
can be put in adb, sdb, dbx or gdb. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1490 |
WARNING: this method is for debugging only |
10071 | 1491 |
it will be removed without notice." |
453 | 1492 |
%{ |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1493 |
__PATCHUPCONTEXTS(__context); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1494 |
__debugBreakPoint__(); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1495 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1496 |
^ self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1497 |
! |
453 | 1498 |
|
7563 | 1499 |
exitWithCoreDump |
1500 |
"{ Pragma: +optSpace }" |
|
1501 |
||
1502 |
"abort program and dump core" |
|
1503 |
||
1504 |
OperatingSystem exitWithCoreDump |
|
4096
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1505 |
"/ never returns |
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1506 |
|
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1507 |
"Be careful evaluating this |
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1508 |
Smalltalk exitWithCoreDump |
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1509 |
" |
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1510 |
|
617 | 1511 |
! |
1512 |
||
7563 | 1513 |
fatalAbort |
1514 |
"{ Pragma: +optSpace }" |
|
1515 |
||
1516 |
"report a fatal-error, print a stack backtrace and exit with core dump. |
|
617 | 1517 |
(You may turn off the stack print with debugPrinting:false)" |
1518 |
%{ |
|
1519 |
__fatal0(__context, "fatalAbort"); |
|
1520 |
/* NEVER RETURNS */ |
|
5410 | 1521 |
%}. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1522 |
^ self primitiveFailed |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1523 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1524 |
! |
617 | 1525 |
|
7563 | 1526 |
fatalAbort:aMessage |
1527 |
"{ Pragma: +optSpace }" |
|
1528 |
||
1529 |
"report a fatal-error; print a stack backtrace and exit with core dump |
|
617 | 1530 |
(You may turn off the stack print with debugPrinting:false)" |
1531 |
||
1532 |
%{ |
|
1533 |
char *msg; |
|
1534 |
||
1535 |
if (__isString(aMessage)) |
|
10071 | 1536 |
msg = (char *) __stringVal(aMessage); |
617 | 1537 |
else |
10071 | 1538 |
msg = "fatalAbort"; |
617 | 1539 |
|
1540 |
__fatal0(__context, msg); |
|
1541 |
/* NEVER RETURNS */ |
|
5410 | 1542 |
%}. |
1543 |
^ self primitiveFailed |
|
1544 |
||
5441 | 1545 |
! |
1546 |
||
7563 | 1547 |
vmInstructionTrace:aBoolean |
1548 |
||
1549 |
||
1550 |
! ! |
|
1551 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1552 |
!Smalltalk class methodsFor:'enumerating'! |
7563 | 1553 |
|
453 | 1554 |
allBehaviorsDo:aBlock |
5580
374e843aa424
allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents:
5579
diff
changeset
|
1555 |
"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
|
1556 |
|
374e843aa424
allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents:
5579
diff
changeset
|
1557 |
self allClassesAndMetaclassesDo:aBlock |
453 | 1558 |
|
1559 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1560 |
Smalltalk allBehaviorsDo:[:aClass | aClass name printCR] |
453 | 1561 |
" |
7563 | 1562 |
! |
1563 |
||
1564 |
allClassCategories |
|
1565 |
"return a set of all class categories in the system" |
|
1566 |
||
1567 |
|allCategories| |
|
6217
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1568 |
|
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1569 |
allCategories := Set new. |
7124
da253fd03ba1
Do not sort categories in #allClassCategories.
Stefan Vogel <sv@exept.de>
parents:
7105
diff
changeset
|
1570 |
Smalltalk allClassesDo:[:cls | |category| |
10071 | 1571 |
category := cls category. |
1572 |
category notNil ifTrue:[ |
|
1573 |
allCategories add:category. |
|
1574 |
]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1575 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1576 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1577 |
^ allCategories. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1578 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1579 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1580 |
Smalltalk allClassCategories |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1581 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1582 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1583 |
"Created: / 17.11.2001 / 12:13:09 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1584 |
! |
6217
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1585 |
|
7563 | 1586 |
allClassesAndMetaclassesDo:aBlock |
1587 |
"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
|
1588 |
|
5940
804fb27727a6
oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents:
5916
diff
changeset
|
1589 |
|already| |
804fb27727a6
oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents:
5916
diff
changeset
|
1590 |
|
9259 | 1591 |
already := IdentitySet new:NumberOfClassesHint*3. |
5940
804fb27727a6
oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents:
5916
diff
changeset
|
1592 |
self allClassesDo:[:eachClass | |cls| |
10071 | 1593 |
cls := eachClass theNonMetaclass. |
1594 |
(already includes:cls) ifFalse:[ |
|
1595 |
aBlock value:cls. |
|
1596 |
already add:cls. |
|
1597 |
]. |
|
1598 |
cls := cls class. |
|
1599 |
(already includes:cls) ifFalse:[ |
|
1600 |
aBlock value:cls. |
|
1601 |
already add:cls. |
|
1602 |
]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1603 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1604 |
! |
5579
26af506d271e
added #allClassesAndMetaclasses
Claus Gittinger <cg@exept.de>
parents:
5550
diff
changeset
|
1605 |
|
7563 | 1606 |
allClassesDo:aBlock |
1607 |
"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
|
1608 |
|
5765 | 1609 |
self allClasses do:aBlock |
453 | 1610 |
|
1611 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1612 |
Smalltalk allClassesDo:[:aClass | aClass name printCR] |
453 | 1613 |
" |
1614 |
! |
|
1615 |
||
9506 | 1616 |
allClassesForWhich:filter |
10071 | 1617 |
"return a collection with all classes in the system, |
9506 | 1618 |
for which filter evaluates to true." |
1619 |
||
1620 |
|collectedClasses| |
|
1621 |
||
1622 |
collectedClasses := OrderedCollection new. |
|
1623 |
self allClassesForWhich:filter do:[:cls | |
|
10071 | 1624 |
collectedClasses add:cls |
9506 | 1625 |
]. |
1626 |
^ collectedClasses |
|
1627 |
||
1628 |
" |
|
10071 | 1629 |
Smalltalk |
1630 |
allClassesForWhich:[:cls | cls name startsWith:'Po'] |
|
9506 | 1631 |
" |
1632 |
||
1633 |
"Created: / 10-08-2006 / 12:11:31 / cg" |
|
1634 |
! |
|
1635 |
||
9292 | 1636 |
allClassesForWhich:filter do:aBlock |
1637 |
"evaluate the argument, aBlock for all classes in the system, for which filter evaluates to true." |
|
1638 |
||
1639 |
self allClassesDo:[:cls | |
|
10071 | 1640 |
(filter value:cls) ifTrue:[ aBlock value:cls ]. |
1641 |
]. |
|
1642 |
||
1643 |
" |
|
1644 |
Smalltalk |
|
1645 |
allClassesForWhich:[:cls | cls name startsWith:'Po'] |
|
1646 |
do:[:aClass | Transcript showCR:aClass name] |
|
9292 | 1647 |
" |
1648 |
! |
|
1649 |
||
7563 | 1650 |
allClassesInCategory:aCategory |
1651 |
"return a collection of for all classes in aCategory; |
|
1299 | 1652 |
The order of the classes is not defined." |
1653 |
||
9506 | 1654 |
^ self allClassesForWhich:[:cls | cls category = aCategory] |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1655 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1656 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1657 |
Smalltalk allClassesInCategory:'Views-Basic' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1658 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1659 |
|
9506 | 1660 |
"Modified: / 10-08-2006 / 12:13:32 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1661 |
! |
1299 | 1662 |
|
7563 | 1663 |
allClassesInCategory:aCategory do:aBlock |
1664 |
"evaluate the argument, aBlock for all classes in the aCategory; |
|
453 | 1665 |
The order of the classes is not defined." |
1666 |
||
1667 |
aCategory notNil ifTrue:[ |
|
10071 | 1668 |
self allClassesForWhich:[:cls | cls category = aCategory] do:aBlock |
453 | 1669 |
] |
1670 |
||
1671 |
" |
|
9490 | 1672 |
Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | Transcript showCR:aClass] |
1673 |
" |
|
1674 |
||
1675 |
"Modified: / 09-08-2006 / 17:18:50 / fm" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1676 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1677 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1678 |
allClassesInCategory:aCategory inOrderDo:aBlock |
7563 | 1679 |
"evaluate the argument, aBlock for all classes in aCategory; |
453 | 1680 |
superclasses come first - then subclasses" |
1681 |
||
1682 |
|classes| |
|
1683 |
||
1684 |
aCategory notNil ifTrue:[ |
|
10071 | 1685 |
classes := OrderedCollection new. |
1686 |
self allClassesInCategory:aCategory do:[:aClass | |
|
1687 |
classes add:aClass |
|
1688 |
]. |
|
1689 |
classes topologicalSort:[:a :b | b isSubclassOf:a]. |
|
1690 |
classes do:aBlock |
|
453 | 1691 |
] |
1692 |
||
1693 |
" |
|
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1694 |
Smalltalk allClassesInCategory:'Views-Basic' inOrderDo:[:aClass | aClass name printCR] |
453 | 1695 |
" |
6217
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1696 |
|
e0f4f3959c49
reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents:
6188
diff
changeset
|
1697 |
"Modified: / 17.11.2001 / 12:18:15 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1698 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1699 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1700 |
allClassesInOrderDo:aBlock |
7563 | 1701 |
"evaluate the argument, aBlock for all classes in the system; |
5406 | 1702 |
Evaluation order is by inheritance: superclasses come first." |
1703 |
||
1704 |
|already| |
|
1705 |
||
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1706 |
already := IdentitySet new:NumberOfClassesHint. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1707 |
self allClassesDo:[:eachClass | |
10071 | 1708 |
(already includes:eachClass) ifFalse:[ |
1709 |
eachClass allSuperclasses reverseDo:[:eachSuperClass | |
|
1710 |
(already includes:eachSuperClass) ifFalse:[ |
|
1711 |
already add:eachSuperClass. |
|
1712 |
aBlock value:eachSuperClass. |
|
1713 |
]. |
|
1714 |
]. |
|
1715 |
already add:eachClass. |
|
1716 |
aBlock value:eachClass. |
|
1717 |
] |
|
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1718 |
]. |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1719 |
|
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1720 |
" |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
1721 |
Smalltalk allClassesInOrderDo:[:aClass | Transcript showCR:aClass name] |
5406 | 1722 |
" |
8583
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 |
|
9506 | 1725 |
allClassesInPackage:aPackageID |
1726 |
"evaluate the argument, aBlock for all classes a package; |
|
10087 | 1727 |
The order of the classes is not defined. |
1728 |
The returned collection may include private classes" |
|
9506 | 1729 |
|
1730 |
^ self allClassesForWhich:[:cls | cls package = aPackageID] |
|
1731 |
||
1732 |
" |
|
10071 | 1733 |
Smalltalk allClassesInPackage:'bosch:dapasx' |
9506 | 1734 |
" |
1735 |
||
1736 |
"Created: / 10-08-2006 / 12:14:10 / cg" |
|
10087 | 1737 |
"Modified: / 12-10-2006 / 23:48:43 / cg" |
9506 | 1738 |
! |
1739 |
||
9490 | 1740 |
allClassesInPackage:aPackageID do:aBlock |
1741 |
"evaluate the argument, aBlock for all classes a package; |
|
1742 |
The order of the classes is not defined." |
|
1743 |
||
1744 |
^ self allClassesForWhich:[:cls | cls package = aPackageID] do:aBlock |
|
1745 |
||
1746 |
" |
|
10071 | 1747 |
Smalltalk allClassesInPackage:'bosch:dapasx' do:[:aClass | Transcript showCR:aClass] |
9490 | 1748 |
" |
1749 |
||
1750 |
"Created: / 09-08-2006 / 17:14:17 / fm" |
|
1751 |
! |
|
1752 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1753 |
allKeysDo:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1754 |
"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
|
1755 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1756 |
^ self keysDo:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1757 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1758 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1759 |
allMethodCategories |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1760 |
"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
|
1761 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1762 |
|allCategories| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1763 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1764 |
allCategories := Set new. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1765 |
Smalltalk allClassesDo:[:cls | |
10071 | 1766 |
allCategories addAll:cls categories. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1767 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1768 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1769 |
^ allCategories. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1770 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1771 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1772 |
Smalltalk allMethodCategories |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1773 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1774 |
! |
6722
8388292bc41d
allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
1775 |
|
9259 | 1776 |
allMethodsDo:aBlock |
1777 |
Smalltalk allClassesDo:[:eachClass | |
|
10071 | 1778 |
eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
1779 |
aBlock value:mthd |
|
1780 |
] |
|
9259 | 1781 |
]. |
1782 |
! |
|
1783 |
||
7563 | 1784 |
associationsDo:aBlock |
10071 | 1785 |
"evaluate the argument, aBlock for all key/value pairs |
617 | 1786 |
in the Smalltalk dictionary" |
1787 |
||
1788 |
self keysDo:[:aKey | |
|
10071 | 1789 |
aBlock value:(aKey -> (self at:aKey)) |
617 | 1790 |
] |
1791 |
||
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
1792 |
"Smalltalk associationsDo:[:assoc | assoc printCR]" |
617 | 1793 |
! |
1794 |
||
7563 | 1795 |
basicKeys |
1796 |
"for rel > 5 only" |
|
1797 |
||
1798 |
self primitiveFailed |
|
1799 |
||
1800 |
||
1801 |
||
1802 |
||
1803 |
||
1804 |
||
1805 |
! |
|
1806 |
||
1807 |
do:aBlock |
|
1808 |
"evaluate the argument, aBlock for all values in the Smalltalk dictionary" |
|
617 | 1809 |
|
1810 |
|work| |
|
1811 |
||
1812 |
%{ /* 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
|
1813 |
__GLOBALS_DO(&aBlock, &work); |
5406 | 1814 |
RETURN (self); |
1815 |
%}. |
|
1816 |
self keysDo:[:aKey | |
|
10071 | 1817 |
aBlock value:(self at:aKey) |
5406 | 1818 |
] |
617 | 1819 |
! |
1820 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1821 |
keysAndValuesDo:aBlock |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1822 |
"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
|
1823 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1824 |
self keysDo:[:aKey | |
10071 | 1825 |
aBlock value:aKey value:(self at:aKey) |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1826 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1827 |
! |
617 | 1828 |
|
9077
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1829 |
keysAndValuesSelect:selectBlockWith2Args thenCollect:collectBlockWith2Args |
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1830 |
|collected| |
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1831 |
|
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1832 |
collected := OrderedCollection new. |
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1833 |
self keysAndValuesDo:[:eachKey :eachValue | |
10071 | 1834 |
(selectBlockWith2Args value:eachKey value:eachValue) ifTrue:[ |
1835 |
collected add:(collectBlockWith2Args value:eachKey value:eachValue) |
|
1836 |
]. |
|
9077
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1837 |
]. |
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1838 |
^ collected |
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1839 |
|
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1840 |
" |
10071 | 1841 |
Smalltalk |
1842 |
keysAndValuesSelect:[:nm :val | (nm startsWith:'Ab') and:[val notNil]] |
|
1843 |
thenCollect:[:nm :val | nm] |
|
9077
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1844 |
" |
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1845 |
! |
327b64542a83
+keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents:
9054
diff
changeset
|
1846 |
|
7563 | 1847 |
keysDo:aBlock |
1848 |
"evaluate the argument, aBlock for all keys in the Smalltalk dictionary" |
|
617 | 1849 |
|work| |
1850 |
||
1851 |
%{ /* 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
|
1852 |
__GLOBALKEYS_DO(&aBlock, &work); |
5406 | 1853 |
RETURN (self); |
1854 |
%}. |
|
1855 |
self basicKeys do:[:aKey | |
|
10071 | 1856 |
aBlock value:aKey |
5406 | 1857 |
] |
453 | 1858 |
! ! |
1859 |
||
10169 | 1860 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1861 |
!Smalltalk class methodsFor:'message control'! |
453 | 1862 |
|
7563 | 1863 |
silentLoading |
1864 |
"returns the Silentloading class variable." |
|
1865 |
||
10355
b1cb807fd03c
Make sure, that #silentLoading does not return nil
Stefan Vogel <sv@exept.de>
parents:
10329
diff
changeset
|
1866 |
^ SilentLoading ? false |
7563 | 1867 |
! |
1868 |
||
1869 |
silentLoading:aBoolean |
|
1870 |
"{ Pragma: +optSpace }" |
|
1871 |
||
1872 |
"allows access to the Silentloading class variable, which controls |
|
453 | 1873 |
messages from all kinds of system onto the transcript. |
1874 |
You can save a snapshot with this flag set to true, which makes |
|
1875 |
the image come up silent. Can also be set, to read in files unlogged." |
|
1876 |
||
1877 |
|prev| |
|
1878 |
||
1879 |
prev := SilentLoading. |
|
1880 |
SilentLoading := aBoolean. |
|
1881 |
^ prev |
|
1882 |
! ! |
|
1883 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1884 |
!Smalltalk class methodsFor:'misc accessing'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1885 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1886 |
beHeadless:aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1887 |
"set/clear the headlessOperation flag." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1888 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1889 |
HeadlessOperation := aBoolean |
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 |
|
10231 | 1892 |
beSTScript:aBoolean |
1893 |
"set/clear the isSTScript flag." |
|
1894 |
||
1895 |
IsSTScript := aBoolean |
|
1896 |
||
1897 |
"Created: / 06-12-2006 / 16:43:36 / cg" |
|
1898 |
! |
|
1899 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1900 |
standAloneApp:aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1901 |
"set/clear the StandAlone flag." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1902 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1903 |
StandAlone := aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1904 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1905 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1906 |
!Smalltalk class methodsFor:'misc stuff'! |
7563 | 1907 |
|
1908 |
addExitBlock:aBlock |
|
1909 |
"{ Pragma: +optSpace }" |
|
1910 |
||
1911 |
"add a block to be executed when Smalltalk finishes. |
|
617 | 1912 |
This feature is currently not used anywhere - but could be useful for |
1913 |
cleanup in stand alone applications." |
|
1914 |
||
1915 |
ExitBlocks isNil ifTrue:[ |
|
10071 | 1916 |
ExitBlocks := OrderedCollection with:aBlock |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1917 |
] ifFalse:[ |
10071 | 1918 |
ExitBlocks add:aBlock |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1919 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1920 |
! |
617 | 1921 |
|
7563 | 1922 |
addImageStartBlock:aBlock |
1923 |
"{ Pragma: +optSpace }" |
|
1924 |
||
1925 |
"add a blocks to be executed in a separate process after |
|
10071 | 1926 |
everything has been initialized. |
2681 | 1927 |
These blocks will be executed after an image restart." |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1928 |
|
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1929 |
ImageStartBlocks isNil ifTrue:[ |
10071 | 1930 |
ImageStartBlocks := OrderedCollection with:aBlock |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1931 |
] ifFalse:[ |
10071 | 1932 |
ImageStartBlocks add:aBlock |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1933 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1934 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1935 |
"Created: 9.9.1996 / 16:48:20 / stefan" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1936 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1937 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1938 |
addStartBlock:aBlock |
7563 | 1939 |
"{ Pragma: +optSpace }" |
1940 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1941 |
"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
|
1942 |
everything has been initialized. These blocks will |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1943 |
be deleted after execution and therefore not be |
10071 | 1944 |
executed after an image restart. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1945 |
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
|
1946 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1947 |
StartBlocks isNil ifTrue:[ |
10071 | 1948 |
StartBlocks := OrderedCollection with:aBlock |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1949 |
] ifFalse:[ |
10071 | 1950 |
StartBlocks add:aBlock |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1951 |
] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1952 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1953 |
"Created: 9.9.1996 / 16:46:53 / stefan" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1954 |
! |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
1955 |
|
7563 | 1956 |
exit |
1957 |
"{ Pragma: +optSpace }" |
|
1958 |
||
1959 |
"finish the Smalltalk system" |
|
1960 |
||
8803 | 1961 |
self exit:0 |
1962 |
"not reached" |
|
1963 |
||
1964 |
"Be careful evaluating this |
|
1965 |
Smalltalk exit |
|
1966 |
" |
|
1967 |
! |
|
1968 |
||
1969 |
exit:statusInteger |
|
1970 |
"{ Pragma: +optSpace }" |
|
1971 |
||
1972 |
"finish the Smalltalk system" |
|
1973 |
||
7563 | 1974 |
ObjectMemory changed:#aboutToExit. "/ for ST/X backward compatibility |
453 | 1975 |
ObjectMemory changed:#aboutToQuit. "/ for ST-80 compatibility |
1976 |
ExitBlocks notNil ifTrue:[ |
|
10071 | 1977 |
ExitBlocks do:[:aBlock | |
1978 |
aBlock value |
|
1979 |
] |
|
8803 | 1980 |
]. |
1981 |
OperatingSystem exit:statusInteger |
|
1982 |
"not reached" |
|
4096
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1983 |
|
d292495070db
exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents:
4067
diff
changeset
|
1984 |
"Be careful evaluating this |
8803 | 1985 |
Smalltalk exit:1 |
453 | 1986 |
" |
1987 |
! ! |
|
1988 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1989 |
!Smalltalk class methodsFor:'queries'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1990 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
1991 |
allClasses |
7563 | 1992 |
"return an unordered collection of all classes in the system. |
10071 | 1993 |
Only globally anchored classes are returned |
453 | 1994 |
(i.e. anonymous ones have to be aquired by Behavior allSubInstances)" |
1995 |
||
1996 |
|classes| |
|
1997 |
||
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
1998 |
"/ you may wonder, what this while is for, here ... |
453 | 1999 |
"/ the reason is that if we modify the class hierarchy in |
4067 | 2000 |
"/ another view (background fileIn), while building up the |
453 | 2001 |
"/ cachedClasses set, this may be flushed (invalidated) by the |
2002 |
"/ other process in the meanwhile. |
|
2003 |
"/ If that happens, we restart the set-building here |
|
2004 |
"/ |
|
2005 |
[(classes := CachedClasses) isNil] whileTrue:[ |
|
10071 | 2006 |
CachedClasses := classes := IdentitySet new:NumberOfClassesHint. |
2007 |
self keysAndValuesDo:[:eachName :eachGlobal | |
|
2008 |
(eachGlobal notNil and:[eachGlobal isBehavior]) ifTrue:[ |
|
2009 |
"/ sigh - would like to skip over aliases |
|
2010 |
"/ but this cannot be done simply by comparing |
|
2011 |
"/ the classes name against the store-key |
|
2012 |
"/ i.e. cannot do: |
|
2013 |
"/ anObject name == sym ifTrue:[ |
|
2014 |
"/ classes add:anObject |
|
2015 |
"/ ] |
|
2016 |
"/ because that would lead to ignore all java |
|
2017 |
"/ classes, which are stored under a different |
|
2018 |
"/ key. |
|
2019 |
||
2020 |
(eachGlobal name == eachName |
|
2021 |
or:[eachGlobal isJavaClass]) ifTrue:[ |
|
2022 |
classes add:eachGlobal |
|
2023 |
]. |
|
2024 |
] |
|
2025 |
]. |
|
2026 |
NumberOfClassesHint := classes size. |
|
453 | 2027 |
]. |
2028 |
^ classes |
|
2029 |
||
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
2030 |
" |
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
2031 |
CachedClasses := nil. |
453 | 2032 |
Smalltalk allClasses |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
2033 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
2034 |
to get the list sorted by name: |
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
2035 |
|
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
2036 |
Smalltalk allClasses asSortedCollection:[:a :b | a name < b name] |
453 | 2037 |
" |
745
d16f199a1551
added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents:
736
diff
changeset
|
2038 |
|
5278 | 2039 |
"Modified: / 23.2.2000 / 10:49:46 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2040 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2041 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2042 |
allClassesAndMetaclasses |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2043 |
"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
|
2044 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2045 |
|classes| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2046 |
|
8964
91b012315d91
Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents:
8960
diff
changeset
|
2047 |
classes := IdentitySet new:NumberOfClassesHint*2. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2048 |
self allClassesDo:[:eachClass | |
10071 | 2049 |
classes add:(eachClass theNonMetaclass). |
2050 |
classes add:(eachClass theMetaclass). |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2051 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2052 |
^ classes |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2053 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2054 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2055 |
allClassesWithAllPrivateClasses |
7563 | 2056 |
"return an unordered collection of all classes in the Smalltalk namespace. |
10173
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2057 |
Only globally anchored classes are returned; Namespaces are not included. |
4642 | 2058 |
(i.e. anonymous ones have to be aquired by Behavior allSubInstances)" |
2059 |
||
10071 | 2060 |
^ self allClasses select:[:aClass | |
10173
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2061 |
|owner| |
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2062 |
|
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2063 |
(aClass isRealNameSpace not) |
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2064 |
and:[ |
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2065 |
owner := aClass topOwningClass. |
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2066 |
(owner ? aClass) nameSpace == Smalltalk |
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2067 |
] |
4642 | 2068 |
] |
2069 |
||
2070 |
" |
|
2071 |
Smalltalk allClassesWithAllPrivateClasses |
|
2072 |
" |
|
10173
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2073 |
|
765b385fd1b8
changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents:
10169
diff
changeset
|
2074 |
"Modified: / 10-11-2006 / 17:24:00 / cg" |
4642 | 2075 |
! |
2076 |
||
9227 | 2077 |
allImplementorsOf:aSelector |
2078 |
|implementors| |
|
2079 |
||
2080 |
implementors := OrderedCollection new. |
|
2081 |
self allClassesDo:[:cls | |
|
10071 | 2082 |
(cls includesSelector:aSelector) ifTrue:[ |
2083 |
implementors add:cls. |
|
2084 |
]. |
|
2085 |
(cls class includesSelector:aSelector) ifTrue:[ |
|
2086 |
implementors add:cls class. |
|
2087 |
]. |
|
9227 | 2088 |
]. |
2089 |
^ implementors |
|
2090 |
||
2091 |
" |
|
10071 | 2092 |
Smalltalk allImplementorsOf:#isNil |
2093 |
(Smalltalk allImplementorsOf:#add:) size |
|
9227 | 2094 |
" |
2095 |
! |
|
2096 |
||
9254 | 2097 |
allProjectIDs |
2098 |
|allProjects| |
|
2099 |
||
2100 |
allProjects := Set new. |
|
2101 |
self allClassesDo:[:eachClass | |
|
10071 | 2102 |
|cls pkg| |
2103 |
||
2104 |
cls := eachClass theNonMetaclass. |
|
2105 |
||
2106 |
pkg := cls package. |
|
2107 |
pkg "withoutSeparators" size > 0 ifTrue:[ |
|
2108 |
allProjects add:pkg. |
|
2109 |
] ifFalse:[ |
|
2110 |
"/ for now, nameSpaces are not in any package; |
|
2111 |
"/ this might change. Then, 0-sized packages are |
|
2112 |
"/ illegal, and the following should be enabled. |
|
2113 |
"/ self halt |
|
2114 |
]. |
|
2115 |
cls isJavaClass ifFalse:[ |
|
2116 |
cls instAndClassSelectorsAndMethodsDo:[:sel :mthd | |
|
2117 |
allProjects add:mthd package asSymbol. |
|
2118 |
]. |
|
2119 |
]. |
|
9254 | 2120 |
]. |
2121 |
allProjects := allProjects asOrderedCollection sort. |
|
2122 |
^ allProjects |
|
2123 |
||
2124 |
" |
|
2125 |
Smalltalk allProjectIDs |
|
2126 |
" |
|
2127 |
! |
|
2128 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2129 |
cellAt:aName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2130 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2131 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2132 |
"return the address of a global cell |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2133 |
- used internally for compiler only" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2134 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2135 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2136 |
RETURN ( __GLOBAL_GETCELL(aName) ); |
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 |
^ self primitiveFailed |
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 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2141 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2142 |
classCategoryCompletion:aPartialCategory |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2143 |
"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
|
2144 |
2 entries: 1st: the best (longest) match |
10071 | 2145 |
2nd: collection consisting of matching categories" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2146 |
|
9508 | 2147 |
^ DoWhatIMeanSupport classCategoryCompletion:aPartialCategory inEnvironment:self |
8583
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 |
" |
10071 | 2150 |
Smalltalk classCategoryCompletion:'Sys' |
2151 |
Smalltalk classCategoryCompletion:'System' |
|
2152 |
Smalltalk classCategoryCompletion:'System-BinaryStorage' |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2153 |
" |
9508 | 2154 |
|
2155 |
"Modified: / 10-08-2006 / 13:06:34 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2156 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2157 |
|
8570 | 2158 |
classNamed:aString |
2159 |
"return the class with name aString, or nil if absent. |
|
2160 |
To get to the metaClass, append ' class' to the string. |
|
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2161 |
To get a nameSpace or private class, prefix the name as required. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2162 |
If a private class of an autoloaded class is referenced, the owning class |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2163 |
will be loaded." |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2164 |
|
10127 | 2165 |
|cls sym nonMeta idx prefix rest namespace nsNameSymbol| |
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2166 |
|
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2167 |
"Quick try - if everything is loaded, this will succeed. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2168 |
But be careful, to not invent new symbols ..." |
453 | 2169 |
sym := aString asSymbolIfInterned. |
2170 |
sym notNil ifTrue:[ |
|
10127 | 2171 |
cls := self at:sym ifAbsent:nil. |
2172 |
cls isBehavior ifTrue:[^ cls]. |
|
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2173 |
]. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2174 |
|
1480
df0bea6285f8
Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents:
1461
diff
changeset
|
2175 |
(aString endsWith:' class') ifTrue:[ |
10127 | 2176 |
nonMeta := self classNamed:(aString copyWithoutLast:6). |
2177 |
nonMeta notNil ifTrue:[ |
|
2178 |
^ nonMeta theMetaclass |
|
2179 |
]. |
|
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2180 |
]. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2181 |
|
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2182 |
"no success yet. Try if this is a private classes of an autoloaded class" |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2183 |
cls isNil ifTrue:[ |
10127 | 2184 |
idx := aString indexOfSubCollection:'::'. |
2185 |
idx ~~ 0 ifTrue:[ |
|
2186 |
prefix := aString copyTo:idx-1. |
|
2187 |
nsNameSymbol := prefix asSymbolIfInterned. |
|
2188 |
nsNameSymbol notNil ifTrue:[ |
|
2189 |
rest := aString copyFrom:idx+2. |
|
2190 |
namespace := self at:prefix asSymbolIfInterned ifAbsent:nil. |
|
2191 |
"namespace may be the owner of a private class. |
|
2192 |
NameSpaces and Behaviors have the same protocol" |
|
2193 |
[namespace isBehavior] whileTrue:[ |
|
2194 |
idx := rest indexOfSubCollection:'::'. |
|
2195 |
idx ~~ 0 ifTrue:[ |
|
2196 |
prefix := rest copyTo:idx-1. |
|
2197 |
rest := rest copyFrom:idx+2. |
|
2198 |
"this does an implicit autoload if required" |
|
2199 |
namespace := namespace privateClassesAt:prefix. |
|
2200 |
] ifFalse:[ |
|
2201 |
namespace isLoaded ifTrue:[ |
|
2202 |
cls := namespace privateClassesAt:rest. |
|
2203 |
cls isBehavior ifTrue:[^ cls]. |
|
2204 |
]. |
|
2205 |
namespace := nil. "force exit of loop" |
|
2206 |
]. |
|
2207 |
]. |
|
2208 |
]. |
|
2209 |
]. |
|
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2210 |
]. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2211 |
|
453 | 2212 |
^ nil |
2213 |
||
2214 |
" |
|
10071 | 2215 |
Smalltalk classNamed:'Object' |
2216 |
Smalltalk classNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData' |
|
2217 |
Smalltalk classNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData class' |
|
2218 |
Smalltalk classNamed:'Authentication::BasicAuthenticator' |
|
2219 |
Smalltalk classNamed:'fooBar' |
|
2220 |
Smalltalk classNamed:'true' |
|
2221 |
Smalltalk classNamed:'Object class' |
|
2222 |
Smalltalk classNamed:'Metaclass' |
|
2223 |
Smalltalk classNamed:'Array' |
|
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2224 |
Smalltalk classNamed:'Array class' |
453 | 2225 |
" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2226 |
|
9468 | 2227 |
"Created: / 24-11-1995 / 17:30:22 / cg" |
2228 |
"Modified: / 19-06-1996 / 14:22:21 / stefan" |
|
10127 | 2229 |
"Modified: / 23-10-2006 / 18:06:53 / cg" |
8583
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 |
classNames |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2233 |
"return a collection of all classNames in the system" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2234 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2235 |
^ self allClasses collect:[:aClass | aClass name] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2236 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2237 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2238 |
Smalltalk classNames |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2239 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2240 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2241 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2242 |
classnameCompletion:aPartialClassName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2243 |
"given a partial classname, return an array consisting of |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2244 |
2 entries: 1st: the best (longest) match |
10071 | 2245 |
2nd: collection consisting of matching names" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2246 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2247 |
^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2248 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2249 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2250 |
classnameCompletion:aPartialClassName inEnvironment:anEnvironment |
7563 | 2251 |
"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
|
2252 |
2 entries: 1st: the best (longest) match |
10071 | 2253 |
2nd: collection consisting of matching names" |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2254 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2255 |
^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:anEnvironment |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2256 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2257 |
" |
10071 | 2258 |
Smalltalk classnameCompletion:'Arr' |
2259 |
Smalltalk classnameCompletion:'Arra' |
|
2260 |
Smalltalk classnameCompletion:'arra' |
|
2261 |
Smalltalk classnameCompletion:'*rray' |
|
2262 |
||
2263 |
Smalltalk classnameCompletion:'Arr cl' |
|
2264 |
Smalltalk classnameCompletion:'*rray cl' |
|
453 | 2265 |
" |
644
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2266 |
|
9363244ef25d
classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
630
diff
changeset
|
2267 |
"Created: 24.11.1995 / 17:24:45 / cg" |
2523
04db1fd74e0d
try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents:
2514
diff
changeset
|
2268 |
"Modified: 3.4.1997 / 18:25:01 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2269 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2270 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2271 |
defaultNameSpace |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2272 |
"return the default namespace, where new classes are installed, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2273 |
if NO special nameSpace handler is present" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2274 |
|
9562
7d36dbb02bb3
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9550
diff
changeset
|
2275 |
^ Project defaultNameSpace. |
7d36dbb02bb3
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9550
diff
changeset
|
2276 |
|
7d36dbb02bb3
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9550
diff
changeset
|
2277 |
"Created: / 19-12-1996 / 23:49:25 / cg" |
7d36dbb02bb3
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
9550
diff
changeset
|
2278 |
"Modified: / 17-08-2006 / 14:01:22 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2279 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2280 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2281 |
globalNameCompletion:aPartialGlobalName |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2282 |
"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
|
2283 |
2 entries: 1st: the best (longest) match |
10071 | 2284 |
2nd: collection consisting of matching names" |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2285 |
|
9508 | 2286 |
^ DoWhatIMeanSupport globalNameCompletion:aPartialGlobalName inEnvironment:self |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2287 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2288 |
" |
10071 | 2289 |
Smalltalk globalnameCompletion:'Arr' |
2290 |
Smalltalk globalnameCompletion:'Arra' |
|
2291 |
Smalltalk globalnameCompletion:'arra' |
|
2292 |
Smalltalk globalnameCompletion:'*rray' |
|
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2293 |
" |
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2294 |
|
9508 | 2295 |
"Created: / 24-11-1995 / 17:24:45 / cg" |
2296 |
"Modified: / 10-08-2006 / 13:05:39 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2297 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2298 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2299 |
globalnameCompletion:aPartialGlobalName |
7563 | 2300 |
"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
|
2301 |
2 entries: 1st: the best (longest) match |
10071 | 2302 |
2nd: collection consisting of matching names" |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2303 |
|
8358 | 2304 |
<resource:#obsolete> |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2305 |
self obsoleteMethodWarning:'use #globalNameCompletion:'. |
9508 | 2306 |
^ DoWhatIMeanSupport globalNameCompletion:aPartialGlobalName inEnvironment:self |
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2307 |
|
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2308 |
" |
10071 | 2309 |
Smalltalk globalnameCompletion:'Arr' |
2310 |
Smalltalk globalnameCompletion:'Arra' |
|
2311 |
Smalltalk globalnameCompletion:'arra' |
|
2312 |
Smalltalk globalnameCompletion:'*rray' |
|
5736 | 2313 |
" |
2314 |
||
9508 | 2315 |
"Created: / 24-11-1995 / 17:24:45 / cg" |
2316 |
"Modified: / 10-08-2006 / 13:05:48 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2317 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2318 |
|
9290 | 2319 |
hasNameSpaces |
2320 |
"can be redefined by dummy namespaces/environments, to suppress |
|
2321 |
the namespace display in a browser (PocketSmalltalk)" |
|
2322 |
||
2323 |
^ true |
|
2324 |
! |
|
2325 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2326 |
hasNamespaces |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2327 |
"can be redefined by dummy namespaces/environments, to suppress |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2328 |
the namespace display in a browser (PocketSmalltalk)" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2329 |
|
9290 | 2330 |
<resource:#obsolete> |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2331 |
^ true |
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 |
|
10432
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2334 |
hasSelectorNameSpaces |
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2335 |
"for now return false |
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2336 |
Selector namespaces are being implemented and supported by the VM, |
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2337 |
but not yet fully supported by all tools... |
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2338 |
Therefore, for now, do not generate code which uses this feature." |
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2339 |
|
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2340 |
^ false |
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2341 |
|
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2342 |
"Created: / 05-03-2007 / 13:26:28 / cg" |
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2343 |
! |
9d0a4de5e69c
preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents:
10429
diff
changeset
|
2344 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2345 |
includes:something |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2346 |
"this should come from Collection. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2347 |
will change the inheritance - Smalltalk is actually a collection" |
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 |
self do:[:element | element = something ifTrue:[^ true]]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2350 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2351 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2352 |
|
10041
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
2353 |
isBrowserStartable |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
2354 |
^ false. |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
2355 |
|
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
2356 |
"Created: / 06-10-2006 / 11:46:52 / cg" |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
2357 |
! |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
2358 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2359 |
isNameSpace |
9227 | 2360 |
"return true, if the receiver is a nameSpace." |
2361 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2362 |
^ true |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2363 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2364 |
"Created: 11.10.1996 / 18:10:43 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2365 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2366 |
|
10169 | 2367 |
isRealNameSpace |
2368 |
"return true, if the receiver is a nameSpace, but not Smalltalk (which is also a class)." |
|
2369 |
||
2370 |
^ false |
|
2371 |
||
2372 |
"Created: / 10-11-2006 / 17:02:19 / cg" |
|
2373 |
! |
|
2374 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2375 |
isTopLevelNameSpace |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2376 |
^ true |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2377 |
! |
7563 | 2378 |
|
2379 |
isTopLevelNamespace |
|
2380 |
"obsolete - use isTopLevelNameSpace" |
|
5365 | 2381 |
|
7432 | 2382 |
<resource:#obsolete> |
2383 |
||
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2384 |
self obsoleteMethodWarning:'use #isTopLevelNameSpace'. |
4458 | 2385 |
^ true |
2386 |
||
2387 |
"Created: 11.10.1996 / 18:10:43 / cg" |
|
2388 |
! |
|
2389 |
||
9081 | 2390 |
keyIsClassVariableNameKey:aKey |
2391 |
|i| |
|
2392 |
||
2393 |
i := aKey lastIndexOf:$:. |
|
2394 |
i ~~ 0 ifTrue:[ |
|
10071 | 2395 |
i > 1 ifTrue:[ |
2396 |
(aKey at:(i-1)) == $: ifFalse:[ |
|
2397 |
^ true. |
|
2398 |
]. |
|
2399 |
]. |
|
9081 | 2400 |
]. |
2401 |
^ false. |
|
2402 |
||
2403 |
" |
|
10071 | 2404 |
self keyIsClassVariableNameKey:'foo::bar' |
2405 |
self keyIsClassVariableNameKey:'foo:bar' |
|
2406 |
self keyIsClassVariableNameKey:':bar' |
|
2407 |
self keyIsClassVariableNameKey:'::bar' |
|
9081 | 2408 |
" |
2409 |
! |
|
2410 |
||
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2411 |
loadedClassNamed:aString |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2412 |
"Same as #classNamed, |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2413 |
but a private class of an autoloaded class will not be found." |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2414 |
|
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2415 |
|cls sym nonMeta| |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2416 |
|
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2417 |
"Quick try - if everything is loaded, this will succeed. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2418 |
But be careful, to not invent new symbols ..." |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2419 |
sym := aString asSymbolIfInterned. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2420 |
sym notNil ifTrue:[ |
10071 | 2421 |
cls := self at:sym ifAbsent:nil. |
2422 |
cls isBehavior ifTrue:[^ cls]. |
|
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2423 |
]. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2424 |
|
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2425 |
(aString endsWith:' class') ifTrue:[ |
10071 | 2426 |
nonMeta := self loadedClassNamed:(aString copyWithoutLast:6). |
2427 |
nonMeta notNil ifTrue:[ |
|
2428 |
^ nonMeta theMetaclass |
|
2429 |
]. |
|
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2430 |
]. |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2431 |
^ nil |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2432 |
|
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2433 |
" |
10071 | 2434 |
Smalltalk loadedClassNamed:'Object' |
2435 |
Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData' |
|
2436 |
Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData class' |
|
2437 |
Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator' |
|
2438 |
Smalltalk loadedClassNamed:'fooBar' |
|
2439 |
Smalltalk loadedClassNamed:'true' |
|
2440 |
Smalltalk loadedClassNamed:'Object class' |
|
2441 |
Smalltalk loadedClassNamed:'Metaclass' |
|
2442 |
Smalltalk loadedClassNamed:'Array' |
|
9374
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2443 |
Smalltalk loadedClassNamed:'Array class' |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2444 |
" |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2445 |
! |
8198d65aadd3
#classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents:
9292
diff
changeset
|
2446 |
|
7563 | 2447 |
methodProtocolCompletion:aPartialProtocolName |
2448 |
"given a partial method protocol name, return an array consisting of |
|
10071 | 2449 |
2 entries: 1st: the best (longest) match |
2450 |
2nd: collection consisting of matching protocols" |
|
7999
475bba3ead9a
moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents:
7996
diff
changeset
|
2451 |
|
9508 | 2452 |
^ DoWhatIMeanSupport methodProtocolCompletion:aPartialProtocolName inEnvironment:self |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2453 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2454 |
" |
10071 | 2455 |
Smalltalk methodProtocolCompletion:'doc' |
2456 |
Smalltalk methodProtocolCompletion:'docu' |
|
2457 |
Smalltalk methodProtocolCompletion:'documenta' |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2458 |
" |
9508 | 2459 |
|
2460 |
"Modified: / 10-08-2006 / 13:05:20 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2461 |
! |
5505
e99e8e9cbfef
added #methodProtocolCompletion:
Claus Gittinger <cg@exept.de>
parents:
5504
diff
changeset
|
2462 |
|
7563 | 2463 |
numberOfGlobals |
2464 |
"return the number of global variables in the system" |
|
2465 |
||
2466 |
|tally "{ Class: SmallInteger }" | |
|
617 | 2467 |
|
2468 |
tally := 0. |
|
2469 |
self do:[:obj | tally := tally + 1]. |
|
2470 |
^ tally |
|
2471 |
||
2472 |
"Smalltalk numberOfGlobals" |
|
2473 |
! |
|
2474 |
||
7563 | 2475 |
referencesAny:aCollection |
2476 |
"redefined, since the references are only kept in the VM's symbol table" |
|
3260 | 2477 |
|
2478 |
self keysAndValuesDo:[:key :val | |
|
10071 | 2479 |
aCollection do:[:anObject | |
2480 |
(key == anObject) ifTrue:[^ true]. |
|
2481 |
(val == anObject ) ifTrue:[^ true]. |
|
2482 |
] |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2483 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2484 |
^ super referencesAny:aCollection |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2485 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2486 |
"Created: / 2.2.1998 / 16:01:20 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2487 |
! |
3260 | 2488 |
|
7563 | 2489 |
referencesDerivedInstanceOf:aClass |
2490 |
"redefined, since the references are only kept in the VM's symbol table" |
|
617 | 2491 |
|
2492 |
self keysAndValuesDo:[:key :val | |
|
10071 | 2493 |
(key isKindOf:aClass) ifTrue:[^ true]. |
2494 |
(val isKindOf:aClass) ifTrue:[^ true]. |
|
617 | 2495 |
]. |
2496 |
^ super referencesDerivedInstanceOf:aClass |
|
2497 |
! |
|
2498 |
||
7563 | 2499 |
referencesInstanceOf:aClass |
2500 |
"redefined, since the references are only kept in the VM's symbol table" |
|
617 | 2501 |
|
2502 |
self keysAndValuesDo:[:key :val | |
|
10071 | 2503 |
(key isMemberOf:aClass) ifTrue:[^ true]. |
2504 |
(val isMemberOf:aClass) ifTrue:[^ true]. |
|
617 | 2505 |
]. |
2506 |
^ super referencesInstanceOf:aClass |
|
2507 |
! |
|
2508 |
||
7563 | 2509 |
referencesObject:anObject |
2510 |
"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
|
2511 |
|
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2512 |
self keysAndValuesDo:[:key :val | |
10071 | 2513 |
(key == anObject) ifTrue:[^ true]. |
2514 |
(val == anObject ) ifTrue:[^ true]. |
|
6074
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2515 |
]. |
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2516 |
^ super referencesObject:anObject |
d91c99700e3b
renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents:
6033
diff
changeset
|
2517 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2518 |
"Modified: / 3.2.1998 / 14:22:46 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2519 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2520 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2521 |
resolveName:nameIn inClass:aClass |
7563 | 2522 |
"resolve aName as if compiled within aClass; |
3026 | 2523 |
i.e. if it has a private class with this name, return it; |
2524 |
if aName is known within the classes namespace, return that. |
|
2525 |
Otherwise, return a global with that name. |
|
2526 |
This should be used whereever Smalltalk>>at: used to be used, |
|
2527 |
to resolve a global by name." |
|
2528 |
||
4354
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2529 |
|aName sym cls ns| |
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2530 |
|
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2531 |
nameIn isNil ifTrue:[^ nil]. |
4356 | 2532 |
nameIn isBehavior ifTrue:[^ nameIn]. "/ already resolved |
4354
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2533 |
aName := nameIn. |
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2534 |
|
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2535 |
(aName startsWith:'Smalltalk::') ifTrue:[ |
10071 | 2536 |
aName := aName copyFrom:12. |
2537 |
^ self at:(aName asSymbol) ifAbsent:nil. |
|
4354
8e265dcb2536
fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents:
4334
diff
changeset
|
2538 |
]. |
3026 | 2539 |
|
2540 |
sym := aName asSymbol. |
|
2541 |
||
2542 |
cls := aClass privateClassesAt:sym. |
|
2543 |
cls notNil ifTrue:[^ cls]. |
|
2544 |
||
2545 |
ns := aClass nameSpace. |
|
2546 |
(ns notNil and:[ns ~~ Smalltalk]) ifTrue:[ |
|
10071 | 2547 |
ns isNameSpace ifTrue:[ |
2548 |
cls := ns at:sym ifAbsent:nil. |
|
2549 |
] ifFalse:[ |
|
2550 |
cls := ns privateClassesAt:sym |
|
2551 |
]. |
|
2552 |
cls notNil ifTrue:[^ cls]. |
|
3025 | 2553 |
]. |
3026 | 2554 |
^ self at:sym ifAbsent:nil. |
4356 | 2555 |
|
2556 |
"Modified: / 9.7.1999 / 01:18:07 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2557 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2558 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2559 |
selectorCompletion:aPartialSymbolName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2560 |
"given a partial selector, return an array consisting of |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2561 |
2 entries: 1st: the longest match |
10071 | 2562 |
2nd: collection consisting of matching implemented selectors" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2563 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2564 |
^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:self |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2565 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2566 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2567 |
selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2568 |
"given a partial selector, return an array consisting of |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2569 |
2 entries: 1st: the longest match |
10071 | 2570 |
2nd: collection consisting of matching implemented selectors" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2571 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2572 |
^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2573 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2574 |
" |
10071 | 2575 |
Smalltalk selectorCompletion:'at:p' |
2576 |
Smalltalk selectorCompletion:'nextP' |
|
2577 |
Smalltalk selectorCompletion:'nextp' |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2578 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2579 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2580 |
"Modified: / 7.6.1996 / 08:44:33 / stefan" |
3565
966a108e3765
also do caseless selectorCompletion
Claus Gittinger <cg@exept.de>
parents:
3560
diff
changeset
|
2581 |
"Modified: / 14.6.1998 / 15:54:03 / cg" |
453 | 2582 |
! ! |
2583 |
||
4431 | 2584 |
!Smalltalk class methodsFor:'queries-system'! |
2585 |
||
7563 | 2586 |
dialectName |
8736 | 2587 |
^ #SmalltalkX |
7563 | 2588 |
|
2589 |
" |
|
2590 |
Smalltalk dialectName |
|
2591 |
" |
|
2592 |
! |
|
2593 |
||
2594 |
dialectReleaseVersion |
|
7348 | 2595 |
^ self versionString |
2596 |
||
2597 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2598 |
Smalltalk dialectReleaseVersion |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2599 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2600 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2601 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2602 |
isDolphinSmalltalk |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2603 |
"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
|
2604 |
applications - add #isDolphinSmalltalk to your dolphin, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2605 |
returning true there." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2606 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2607 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2608 |
! |
4970 | 2609 |
|
7563 | 2610 |
isSmalltalkMT |
2611 |
"return false here - this may be useful to write portable |
|
2612 |
applications - add #isSmalltalkMT to your smalltalk-MT, |
|
4970 | 2613 |
returning true there." |
2614 |
||
2615 |
^ false |
|
2616 |
! |
|
2617 |
||
7563 | 2618 |
isSmalltalkV |
2619 |
"return false here - this may be useful to write portable |
|
2620 |
applications - add #isSmalltalkV to your smalltalkV, |
|
4431 | 2621 |
returning true there." |
2622 |
||
2623 |
^ false |
|
2624 |
! |
|
2625 |
||
7563 | 2626 |
isSmalltalkX |
2627 |
"return true here - this may be useful to write portable |
|
2628 |
applications - add #isSmalltalkX to your other smalltalks, |
|
4431 | 2629 |
returning false there." |
2630 |
||
2631 |
^ true |
|
2632 |
! |
|
2633 |
||
7563 | 2634 |
isSqueak |
2635 |
"return false here - this may be useful to write portable |
|
2636 |
applications - add #isSqueak to your squeak, |
|
4431 | 2637 |
returning true there." |
2638 |
||
2639 |
^ false |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2640 |
! |
4431 | 2641 |
|
7563 | 2642 |
isVisualAge |
2643 |
"return false here - this may be useful to write portable |
|
2644 |
applications - add #isVisualAge to your visualAge, |
|
4431 | 2645 |
returning true there." |
2646 |
||
2647 |
^ false |
|
2648 |
! |
|
2649 |
||
7563 | 2650 |
isVisualWorks |
2651 |
"return false here - this may be useful to write portable |
|
2652 |
applications - add #isVisualWorks to your visualWorks, |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2653 |
returning true there." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2654 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2655 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2656 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2657 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
2658 |
!Smalltalk class methodsFor:'startup'! |
1 | 2659 |
|
9032 | 2660 |
browserWindowStartup |
2661 |
|windowIDString numericWindowID windowID params idx process| |
|
2662 |
||
2663 |
idx := CommandLineArguments indexOf:'--browserWindow:'. |
|
2664 |
windowIDString := CommandLineArguments at:idx+1. |
|
2665 |
numericWindowID := Integer fromString:windowIDString. |
|
2666 |
windowID := ExternalAddress newAddress:numericWindowID. |
|
2667 |
||
2668 |
idx := CommandLineArguments indexOf:'--browserParameters:'. |
|
2669 |
idx ~~ 0 ifTrue:[ |
|
10071 | 2670 |
params := Dictionary new. |
2671 |
(CommandLineArguments copyFrom:idx+1) pairWiseDo:[:key :value | |
|
2672 |
params at:key put:value. |
|
2673 |
]. |
|
9032 | 2674 |
]. |
2675 |
||
2676 |
'browserWindow is: ' errorPrint. windowID errorPrintCR. |
|
2677 |
'browserParameters are: ' errorPrint. params errorPrintCR. |
|
2678 |
'Display is: ' errorPrint. Display errorPrintCR. |
|
2679 |
||
2680 |
process := [ |
|
10071 | 2681 |
PluginSupport |
2682 |
startInBrowserWithWindowID:windowID |
|
2683 |
parameters:params. |
|
9032 | 2684 |
] newProcess. |
9043
e6106f500263
do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents:
9036
diff
changeset
|
2685 |
process priority:(Processor userSchedulingPriority). |
9032 | 2686 |
process name:'browser start handler'. |
2687 |
process beGroupLeader. |
|
2688 |
process resume. |
|
2689 |
process := nil. |
|
2690 |
||
2691 |
Processor dispatchLoop. |
|
2692 |
Smalltalk exit. |
|
2693 |
! |
|
2694 |
||
7563 | 2695 |
displayInitializationDone |
2696 |
"inform the restart, that the display has been initialized" |
|
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2697 |
|
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2698 |
CallbackSignal raiseRequest. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2699 |
! |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2700 |
|
7563 | 2701 |
mainStartup:graphicalMode |
2702 |
"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
|
2703 |
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
|
2704 |
|
9012 | 2705 |
|process imageName thisIsARestart idx| |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2706 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2707 |
imageName := ObjectMemory imageName. |
2249
cdb6c87f0707
send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents:
2212
diff
changeset
|
2708 |
thisIsARestart := imageName notNil. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2709 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2710 |
" |
10071 | 2711 |
if there is a display, start its event dispatcher |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2712 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2713 |
Display notNil ifTrue:[ |
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2714 |
Display deviceIOTimeoutErrorSignal handlerBlock:[:ex | |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2715 |
SaveEmergencyImage == true ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2716 |
'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2717 |
ObjectMemory primSnapShotOn:'crash.img'. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2718 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2719 |
'Display [warning]: broken display connection - exit.' infoPrintCR. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2720 |
self exit. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2721 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2722 |
Display startDispatch. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2723 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2724 |
|
9016 | 2725 |
idx := CommandLineArguments indexOf:'--browserWindow:'. |
9029 | 2726 |
IsPlugin := (idx ~~ 0). |
2727 |
IsPlugin ifTrue:[ |
|
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2728 |
self browserWindowStartup. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2729 |
"/ not reached |
9012 | 2730 |
]. |
2731 |
||
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2732 |
Initializing := false. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2733 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2734 |
"/ 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
|
2735 |
"/ 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
|
2736 |
"/ 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
|
2737 |
"/ 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
|
2738 |
|
7043
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2739 |
process := [ |
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2740 |
StartBlocks notNil ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2741 |
StartBlocks do:[:aBlock| |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2742 |
aBlock value |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2743 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2744 |
StartBlocks := nil. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2745 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2746 |
ImageStartBlocks notNil ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2747 |
ImageStartBlocks do:[:aBlock| |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2748 |
aBlock value |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2749 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2750 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2751 |
StandAlone ifFalse:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2752 |
(SilentLoading == true) ifFalse:[ "i.e. undefined counts as false" |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2753 |
thisIsARestart ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2754 |
Transcript cr. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2755 |
Transcript showCR:('Smalltalk restarted from:' |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2756 |
, imageName |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2757 |
, ' (saved ' |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2758 |
, ObjectMemory imageSaveTime printString |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2759 |
, ')' ). |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2760 |
] ifFalse:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2761 |
Transcript showCR:(self hello). |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2762 |
Transcript showCR:(self copyrightString). |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2763 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2764 |
Transcript cr. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2765 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2766 |
|
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2767 |
DemoMode==true ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2768 |
Transcript showCR:'*** Restricted use: ***'. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2769 |
Transcript showCR:'*** This program may be used for education only. ***'. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2770 |
Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE ***'. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2771 |
Transcript showCR:'*** for more details. ***'. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2772 |
Transcript cr. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2773 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2774 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2775 |
|
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2776 |
thisIsARestart ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2777 |
"/ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2778 |
"/ the final late notification - users can now assume that |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2779 |
"/ views, forms etc. have been recreated. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2780 |
|
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2781 |
ObjectMemory changed:#returnFromSnapshot. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2782 |
] |
7039
6f1c02381145
Do not keep reference to start block handler process.
Stefan Vogel <sv@exept.de>
parents:
7000
diff
changeset
|
2783 |
|
7040 | 2784 |
] newProcess. |
2785 |
||
9043
e6106f500263
do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents:
9036
diff
changeset
|
2786 |
process priority:(Processor userSchedulingPriority). |
7043
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2787 |
process name:'start block handler'. |
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2788 |
process beGroupLeader. |
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2789 |
process resume. |
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2790 |
process := nil. |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
2791 |
|
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2792 |
ObjectMemory startBackgroundCollectorAt:5. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2793 |
ObjectMemory startBackgroundFinalizationAt:5. |
1650
b4b36961d1bc
Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents:
1647
diff
changeset
|
2794 |
|
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2795 |
"/ 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
|
2796 |
"/ message. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
2797 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2798 |
(StartupClass notNil and:[StartupSelector notNil]) ifTrue:[ |
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2799 |
" |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2800 |
allow more customization by reading an image specific rc-file |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2801 |
" |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2802 |
thisIsARestart ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2803 |
(imageName asFilename hasSuffix:'img') ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2804 |
imageName := imageName copyWithoutLast:4 |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2805 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2806 |
self fileIn:(imageName , '.rc') |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2807 |
]. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2808 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2809 |
"/ Display notNil ifTrue:[ |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2810 |
"/ Display exitOnLastClose:true. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2811 |
"/ ]. |
2086 | 2812 |
"/ Processor exitWhenNoMoreUserProcesses:true. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2813 |
|
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2814 |
process := [ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2815 |
StandAlone ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2816 |
AbortOperationRequest handle:[:ex | |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2817 |
'Smalltalk [info]: aborted - exit.' infoPrintCR. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2818 |
OperatingSystem exit:1 |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2819 |
] do:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2820 |
StartupClass perform:StartupSelector withArguments:StartupArguments. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2821 |
] |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2822 |
] ifFalse:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2823 |
StartupClass perform:StartupSelector withArguments:StartupArguments. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2824 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2825 |
|
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2826 |
"/ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2827 |
"/ non-GUI apps exit after the startup; |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2828 |
"/ assume that GUI apps have created & opened some view ... |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2829 |
"/ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2830 |
Display isNil ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2831 |
'Smalltalk [info]: no Display - exit.' infoPrintCR. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2832 |
Smalltalk exit. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2833 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2834 |
"/ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2835 |
"/ GUI apps exit after the last user process has finished |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2836 |
"/ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2837 |
Display exitOnLastClose:true. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2838 |
Processor exitWhenNoMoreUserProcesses:true. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2839 |
] newProcess. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2840 |
process priority:(Processor userSchedulingPriority). |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2841 |
process name:'main'. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2842 |
process beGroupLeader. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2843 |
process resume. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2844 |
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
|
2845 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2846 |
|
9201 | 2847 |
StandAlone ifTrue:[ |
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2848 |
Display notNil ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2849 |
FlyByHelp notNil ifTrue:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2850 |
FlyByHelp start |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2851 |
]. |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2852 |
]. |
9201 | 2853 |
]. |
2854 |
||
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2855 |
" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2856 |
if view-classes exist, start dispatching; |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2857 |
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
|
2858 |
" |
10071 | 2859 |
((Display notNil and:[graphicalMode]) |
7043
d88be9c553d2
Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents:
7040
diff
changeset
|
2860 |
or:[process notNil |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
2861 |
or:[HeadlessOperation]]) ifTrue:[ |
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2862 |
Processor dispatchLoop. |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2863 |
] ifFalse:[ |
10139
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2864 |
StandAlone ifFalse:[ |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2865 |
self readEvalPrint |
a3f6265978ad
Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents:
10131
diff
changeset
|
2866 |
] |
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2867 |
]. |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2868 |
|
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2869 |
"done - the last process finished" |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2870 |
|
8786 | 2871 |
'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
|
2872 |
self exit |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2873 |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2874 |
"Created: / 18.7.1996 / 21:07:39 / cg" |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
2875 |
"Modified: / 9.9.1996 / 17:42:50 / stefan" |
3483 | 2876 |
"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
|
2877 |
! |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
2878 |
|
10227
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2879 |
openDisplay |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2880 |
"try to open a display connection. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2881 |
If so, also read display- and keyboard.rc" |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2882 |
|
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2883 |
Display isNil ifTrue:[ |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2884 |
Screen notNil ifTrue:[ |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2885 |
[ |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2886 |
Screen openDefaultDisplay:nil. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2887 |
] on:Screen deviceOpenErrorSignal do:[:ex| |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2888 |
('Smalltalk [error]: No Display connection to: ', ex parameter printString) errorPrintCR. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2889 |
'Smalltalk [info]: Either set the DISPLAY environment variable,' infoPrintCR. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2890 |
'Smalltalk [info]: or start smalltalk with a -display argument.' infoPrintCR. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2891 |
HeadlessOperation == true ifFalse:[ |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2892 |
OperatingSystem exit:1. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2893 |
]. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2894 |
]. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2895 |
|
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2896 |
Display notNil ifTrue:[ |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2897 |
(self secureFileIn:'display.rc') ifFalse:[ |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2898 |
"/ 'Smalltalk [warning]: no display.rc found; screen setting might be wrong.' errorPrintCR. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2899 |
(self secureFileIn:'keyboard.rc') ifFalse:[ |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2900 |
"/ 'Smalltalk [warning]: no keyboard.rc found; shortkey setting might be wrong.' errorPrintCR. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2901 |
] |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2902 |
] |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2903 |
]. |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2904 |
] |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2905 |
] |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2906 |
|
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2907 |
"Created: / 06-12-2006 / 15:38:17 / cg" |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2908 |
! |
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
2909 |
|
7563 | 2910 |
readEvalPrint |
2911 |
"{ Pragma: +optSpace }" |
|
2912 |
||
10250 | 2913 |
(ReadEvalPrintLoop new prompt:'ST> ') readEvalPrintLoop |
2914 |
||
2915 |
"Modified: / 07-12-2006 / 17:35:19 / cg" |
|
453 | 2916 |
! |
2917 |
||
7563 | 2918 |
restart |
2919 |
"startup after an image has been loaded; |
|
2920 |
there are three change-notifications made to dependents of ObjectMemory, |
|
10 | 2921 |
which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot. |
335 | 2922 |
|
3096
881660d6e997
added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3092
diff
changeset
|
2923 |
#earlySystemInstallation is sent for ST80 compatibility |
881660d6e997
added #earlySystemInitialization change message (ST80 compat)
Claus Gittinger <cg@exept.de>
parents:
3092
diff
changeset
|
2924 |
|
10 | 2925 |
#earlyRestart is send first, nothing has been setup yet. |
10071 | 2926 |
(should be used to flush all device dependent entries) |
335 | 2927 |
|
10 | 2928 |
#restarted is send right after. |
10071 | 2929 |
(should be used to recreate external resources (fds, bitmaps etc) |
335 | 2930 |
|
10 | 2931 |
#returnFromSnapshot is sent last |
10071 | 2932 |
(should be used to restart processes, reOpen Streams which cannot |
2933 |
be automatically be reopened (i.e. Sockets, Pipes) and so on. |
|
2934 |
(Notice that positionable fileStreams are already reopened and repositioned) |
|
1 | 2935 |
" |
10 | 2936 |
|
4503
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2937 |
|deb insp transcript idx| |
1 | 2938 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2939 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2940 |
"/ when we arrive here, all objects from our previous life |
3971 | 2941 |
"/ 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
|
2942 |
"/ handles, display information etc. |
3971 | 2943 |
"/ also, dynamically loaded modules have not yet been reloaded yet. |
2944 |
"/ and the concrete OS, concrete FileName etc. are still refering to |
|
2945 |
"/ 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
|
2946 |
|
1 | 2947 |
Initializing := true. |
3499 | 2948 |
AbstractOperatingSystem initializeConcreteClass. |
2949 |
||
8251
97520a99bcc6
Use Timestamp/#asTimestamp instead of AbsoluteTime/#asAbsoluteTime
Stefan Vogel <sv@exept.de>
parents:
8115
diff
changeset
|
2950 |
ImageRestartTime := Timestamp now. |
335 | 2951 |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2952 |
CommandLine := CommandLineArguments copy. |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2953 |
CommandLineArguments := CommandLineArguments asOrderedCollection. |
6842 | 2954 |
CommandName := CommandLineArguments removeFirst. "/ the command |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
2955 |
|
1582 | 2956 |
idx := CommandLineArguments indexOf:'-q'. |
6881 | 2957 |
idx == 0 ifTrue:[ |
10071 | 2958 |
idx := CommandLineArguments indexOf:'--silent'. |
6881 | 2959 |
]. |
1582 | 2960 |
idx ~~ 0 ifTrue:[ |
10071 | 2961 |
Object infoPrinting:false. |
2962 |
ObjectMemory infoPrinting:false. |
|
2963 |
CommandLineArguments removeAtIndex:idx. |
|
1582 | 2964 |
]. |
2965 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2966 |
"/ |
3971 | 2967 |
"/ start catching SIGSEGV and SIGBUS |
2968 |
||
2969 |
OperatingSystem enableHardSignalInterrupts. |
|
2970 |
||
2907 | 2971 |
"/ reinit Filename |
2972 |
Filename reinitialize. |
|
2973 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2974 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2975 |
"/ 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
|
2976 |
|
329 | 2977 |
self flushPathCaches. |
1 | 2978 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2979 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2980 |
"/ 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
|
2981 |
"/ 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
|
2982 |
|
477
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
2983 |
self reinitStandardStreams. |
8710aba7876b
oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents:
457
diff
changeset
|
2984 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
2985 |
"/ |
10071 | 2986 |
"/ redirect Transcript to Stderr during startup |
2987 |
||
2988 |
transcript := Transcript. |
|
4503
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2989 |
Transcript := Stderr. |
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2990 |
|
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2991 |
"/ |
10071 | 2992 |
"/ temporary switch back to dumb interface - |
4503
99718971ba26
Redirect Transcript to Stderr during restart-initialization.
Stefan Vogel <sv@exept.de>
parents:
4490
diff
changeset
|
2993 |
"/ to handle errors while view-stuff is not yet reinitialized |
1 | 2994 |
|
2995 |
insp := Inspector. |
|
2996 |
deb := Debugger. |
|
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
2997 |
deb notNil ifTrue:[ |
10071 | 2998 |
deb reinitialize |
684
3e0b5a8ec381
invalidate display connection during early startup
Claus Gittinger <cg@exept.de>
parents:
680
diff
changeset
|
2999 |
]. |
1 | 3000 |
Inspector := MiniInspector. |
3001 |
Debugger := MiniDebugger. |
|
3002 |
||
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
3003 |
"/ 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
|
3004 |
"/ 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
|
3005 |
"/ 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
|
3006 |
"/ this code. |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3007 |
"/ 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
|
3008 |
"/ ObjectFileLoader; therefore, must reload before doing any notifications. |
335 | 3009 |
|
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3010 |
ObjectFileLoader notNil ifTrue:[ |
10071 | 3011 |
ObjectFileLoader reloadAllRememberedObjectFiles. |
1100
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3012 |
]. |
eebf3ed54b23
reloadAllObjectFiles now called explicit (its too late via ObjMem changed)
Claus Gittinger <cg@exept.de>
parents:
1097
diff
changeset
|
3013 |
|
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3014 |
"/ |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3015 |
"/ invalidate all display connections. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3016 |
"/ This is required to avoid trouble if someone accesses |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3017 |
"/ a display during early startup. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3018 |
|
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3019 |
Screen notNil ifTrue:[ |
10071 | 3020 |
Screen allScreens do:[:aDisplay | |
3021 |
aDisplay invalidateConnection |
|
3022 |
]. |
|
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3023 |
]. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3024 |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3025 |
ObjectMemory changed:#earlySystemInstallation. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
3026 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
3027 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
3028 |
"/ reinitialize the Processor - restartable processes |
4109 | 3029 |
"/ 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
|
3030 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
3031 |
Processor reinitialize. |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
3032 |
|
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
3033 |
"/ |
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
3034 |
"/ 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
|
3035 |
"/ (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
|
3036 |
|
3022 | 3037 |
ObjectMemory |
10071 | 3038 |
changed:#earlyRestart; changed:#restarted. |
1 | 3039 |
|
1455
970b79688f56
reload object modules earlier - some comments what is going on in #restart
Claus Gittinger <cg@exept.de>
parents:
1451
diff
changeset
|
3040 |
"/ |
3526
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
3041 |
"/ start catching SIGINT and SIGQUIT |
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
3042 |
|
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
3043 |
OperatingSystem enableUserInterrupts. |
6390
41d5c47c33f0
Catch sigPWR and sigHUP on restart
Stefan Vogel <sv@exept.de>
parents:
6366
diff
changeset
|
3044 |
OperatingSystem enableCrashSignalInterrupts. |
3526
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
3045 |
|
8958 | 3046 |
"/ give user a chance to re-customize things in smalltalk_r.rc. |
8957 | 3047 |
"/ 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
|
3048 |
|
6881 | 3049 |
idx := CommandLineArguments indexOf:'--faststart'. |
8957 | 3050 |
idx == 0 ifTrue:[ |
10071 | 3051 |
idx := CommandLineArguments indexOf:'--fastStart'. |
8957 | 3052 |
]. |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3053 |
idx ~~ 0 ifTrue:[ |
10071 | 3054 |
CommandLineArguments removeAtIndex:idx. |
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3055 |
] ifFalse:[ |
10071 | 3056 |
CallbackSignal := QuerySignal new. |
3057 |
[ |
|
3058 |
Class withoutUpdatingChangesDo:[ |
|
3059 |
(self fileIn:(self commandName , '_r.rc')) ifFalse:[ |
|
3060 |
"no _r.rc file where executable is; try default smalltalk_r.rc" |
|
3061 |
self fileIn:'smalltalk_r.rc' |
|
3062 |
]. |
|
3063 |
] |
|
3064 |
] on:CallbackSignal do:[:ex| |
|
3065 |
"/ now, display and view-stuff works; |
|
3066 |
"/ back to the previous debugging interface |
|
3067 |
||
3068 |
Inspector := insp. |
|
3069 |
Debugger := deb. |
|
3070 |
||
3071 |
"/ reinstall Transcript, if not changed during restart. |
|
3072 |
"/ if there was no Transcript, go to stderr |
|
3073 |
||
3074 |
(transcript notNil and:[Transcript == Stderr]) ifTrue:[ |
|
3075 |
Transcript := transcript. |
|
3076 |
]. |
|
3077 |
Initializing := false. |
|
3078 |
ex proceed. |
|
3079 |
]. |
|
3080 |
CallbackSignal := nil. |
|
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3081 |
]. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3082 |
|
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3083 |
"/ reinitialization (restart) of Display is normally performed |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3084 |
"/ 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
|
3085 |
"/ do in now. |
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3086 |
Initializing ifTrue:[ |
10071 | 3087 |
Display notNil ifTrue:[ |
3088 |
[ |
|
3089 |
Display reinitializeFor:Screen defaultDisplayName. |
|
3090 |
] on:Screen deviceOpenErrorSignal do:[ |
|
3091 |
'Smalltalk [error]: Cannot restart connection to: ' errorPrint. |
|
3092 |
Screen defaultDisplayName errorPrintCR. |
|
3093 |
OperatingSystem exit:1. |
|
3094 |
]. |
|
3095 |
]. |
|
3096 |
"/ now, display and view-stuff works; |
|
3097 |
"/ back to the previous debugging interface |
|
3098 |
||
3099 |
Inspector := insp. |
|
3100 |
Debugger := deb. |
|
3101 |
||
3102 |
"/ reinstall Transcript, if not changed during restart. |
|
3103 |
"/ if there was no Transcript, go to stderr |
|
3104 |
||
3105 |
(transcript notNil and:[Transcript == Stderr]) ifTrue:[ |
|
3106 |
Transcript := transcript. |
|
3107 |
]. |
|
3108 |
Initializing := false. |
|
7 | 3109 |
]. |
8522
09b3ac13da48
release resources of secondary displays on snapshot restart
Stefan Vogel <sv@exept.de>
parents:
8473
diff
changeset
|
3110 |
Screen notNil ifTrue:[ |
10071 | 3111 |
"clean up leftover screens (and views) that haven't been reopened. |
3112 |
Operate on a copy, since brokenConnection removes us from AllScreens" |
|
3113 |
Screen allScreens copy do:[:eachDisplay | |
|
3114 |
eachDisplay isOpen ifFalse:[ |
|
3115 |
'Smalltalk [info]: cannot reopen secondary display: ' errorPrint. |
|
3116 |
eachDisplay errorPrintCR. |
|
3117 |
eachDisplay cleanupAfterDispatch; brokenConnection. |
|
3118 |
] |
|
3119 |
]. |
|
3120 |
]. |
|
3121 |
||
3122 |
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
|
3123 |
self mainStartup:true |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
3124 |
|
3526
78245608c0b8
no need for last change (restarting processes).
Claus Gittinger <cg@exept.de>
parents:
3523
diff
changeset
|
3125 |
"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
|
3126 |
"Modified: / 3.8.1999 / 09:42:21 / stefan" |
1 | 3127 |
! |
3128 |
||
7563 | 3129 |
start |
3130 |
"main startup, if there is a Display, initialize it |
|
3131 |
and start dispatching; otherwise go into a read-eval-print loop." |
|
617 | 3132 |
|
9012 | 3133 |
|idx graphicalMode arg didReadRCFile| |
960
e3b75f50d0cd
changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
3134 |
|
e3b75f50d0cd
changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents:
948
diff
changeset
|
3135 |
graphicalMode := true. |
617 | 3136 |
Initializing := true. |
3137 |
||
3138 |
" |
|
3139 |
while reading patches- and rc-file, do not add things into change-file |
|
3140 |
" |
|
3141 |
Class withoutUpdatingChangesDo:[ |
|
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3142 |
|commandFile defaultRC prevCatchSetting| |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3143 |
|
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3144 |
didReadRCFile := false. |
10218 | 3145 |
|
3146 |
StandAlone ifFalse:[ |
|
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3147 |
"/ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3148 |
"/ look for any '-q', '-e' or '-f' command line arguments |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3149 |
"/ and handle them; |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3150 |
"/ read startup and patches file |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3151 |
"/ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3152 |
idx := CommandLineArguments indexOf:'-q'. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3153 |
idx == 0 ifTrue:[ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3154 |
idx := CommandLineArguments indexOf:'--silent'. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3155 |
]. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3156 |
idx ~~ 0 ifTrue:[ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3157 |
Object infoPrinting:false. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3158 |
ObjectMemory infoPrinting:false. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3159 |
CommandLineArguments removeAtIndex:idx. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3160 |
]. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3161 |
|
10218 | 3162 |
"/ look for a '-e filename' or '--execute filename' argument |
3163 |
"/ this will force fileIn of filename only, no standard startup. |
|
3164 |
||
3165 |
idx := CommandLineArguments indexOf:'-e'. |
|
3166 |
idx == 0 ifTrue:[ |
|
3167 |
idx := CommandLineArguments indexOf:'--execute'. |
|
3168 |
]. |
|
3169 |
idx ~~ 0 ifTrue:[ |
|
3170 |
arg := CommandLineArguments at:idx + 1. |
|
3171 |
||
3172 |
CommandLineArguments |
|
3173 |
removeAtIndex:idx+1; removeAtIndex:idx. |
|
3174 |
||
3175 |
arg = '-' ifTrue:[ |
|
3176 |
self fileInStream:Stdin |
|
3177 |
lazy:nil |
|
3178 |
silent:nil |
|
3179 |
logged:false |
|
3180 |
addPath:nil |
|
3181 |
] ifFalse:[ |
|
3182 |
self fileIn:arg. |
|
3183 |
]. |
|
3184 |
self exit |
|
3185 |
]. |
|
3186 |
||
3187 |
"/ look for a '-E expr' or '--eval expr' argument |
|
3188 |
"/ this will force evaluation of expr only, no standard startup |
|
3189 |
idx := CommandLineArguments indexOf:'-E'. |
|
3190 |
idx == 0 ifTrue:[ |
|
3191 |
idx := CommandLineArguments indexOf:'--eval'. |
|
3192 |
]. |
|
3193 |
idx ~~ 0 ifTrue:[ |
|
3194 |
arg := CommandLineArguments at:idx + 1. |
|
3195 |
||
3196 |
CommandLineArguments |
|
3197 |
removeAtIndex:idx+1; removeAtIndex:idx. |
|
3198 |
||
3199 |
self |
|
3200 |
fileInStream:arg readStream |
|
3201 |
lazy:nil |
|
3202 |
silent:nil |
|
3203 |
logged:false |
|
3204 |
addPath:nil. |
|
3205 |
||
3206 |
self exit |
|
3207 |
]. |
|
3208 |
||
3209 |
"look for a '-f filename' or '--file filename' argument |
|
3210 |
this will force evaluation of filename instead of smalltalk.rc" |
|
3211 |
||
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3212 |
idx := CommandLineArguments indexOf:'-f'. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3213 |
idx == 0 ifTrue:[ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3214 |
idx := CommandLineArguments indexOf:'--file'. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3215 |
]. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3216 |
idx ~~ 0 ifTrue:[ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3217 |
commandFile := CommandLineArguments at:idx+1. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3218 |
CommandLineArguments removeAtIndex:idx+1; removeAtIndex:idx. |
10218 | 3219 |
]. |
3220 |
]. |
|
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3221 |
|
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3222 |
commandFile notNil ifTrue:[ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3223 |
(self secureFileIn:commandFile) ifFalse:[ |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3224 |
('Smalltalk [error]: startup file "', commandFile, '" not found.') errorPrintCR. |
10218 | 3225 |
OperatingSystem exit:1. |
3226 |
]. |
|
3227 |
] ifFalse:[ |
|
3228 |
"/ look for <command>.rc |
|
3229 |
"/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation) |
|
3230 |
||
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3231 |
commandFile := self commandName asFilename withSuffix:'rc'. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
3232 |
(didReadRCFile := self secureFileIn:commandFile) ifFalse:[ |
10218 | 3233 |
StandAlone ifFalse:[ |
3234 |
defaultRC := 'smalltalk.rc' |
|
3235 |
] ifTrue:[ |
|
3236 |
defaultRC := 'stxapp.rc' |
|
3237 |
]. |
|
3238 |
||
3239 |
didReadRCFile := self secureFileIn:defaultRC. |
|
3240 |
didReadRCFile ifFalse:[ |
|
3241 |
StandAlone ifFalse:[ |
|
3242 |
'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR. |
|
3243 |
graphicalMode := false. |
|
3244 |
] |
|
3245 |
] |
|
3246 |
]. |
|
3247 |
||
3248 |
"/ ('StandAlone is %1' bindWith:StandAlone) printCR. |
|
3249 |
"/ ('Headless is %1' bindWith:HeadlessOperation) printCR. |
|
3250 |
"/ ('Display is %1' bindWith:Display) printCR. |
|
3251 |
"/ ('Screen is %1' bindWith:Screen) printCR. |
|
3252 |
||
3253 |
didReadRCFile ifFalse:[ |
|
3254 |
"/ |
|
3255 |
"/ No RC file found; |
|
3256 |
"/ Setup more default stuff |
|
3257 |
"/ |
|
3258 |
StandAlone ifFalse:[ |
|
3259 |
"/ its a smalltalk - proceed in interpreter. |
|
3260 |
'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR. |
|
3261 |
graphicalMode := false. |
|
3262 |
] ifTrue:[ |
|
3263 |
"/ its an application - try harder |
|
10227
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
3264 |
self openDisplay. |
10218 | 3265 |
]. |
3266 |
||
3267 |
"/ setup more defaults... |
|
3268 |
ObjectMemory startBackgroundCollectorAt:5. |
|
3269 |
ObjectMemory startBackgroundFinalizationAt:5. |
|
3270 |
self addStartBlock:[ |
|
3271 |
Processor startTimeSlicing. |
|
3272 |
Processor supportDynamicPriorities:true. |
|
3273 |
ObjectMemory backgroundCollectProcess priorityRange:(4 to:9). |
|
3274 |
ObjectMemory backgroundFinalizationProcess priorityRange:(4 to:9). |
|
3275 |
]. |
|
3276 |
]. |
|
3277 |
]. |
|
617 | 3278 |
]. |
3279 |
||
6841
37bc69fc9240
set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents:
6837
diff
changeset
|
3280 |
StandAlone ifFalse:[ |
10218 | 3281 |
" |
3282 |
enable the graphical debugger/inspector |
|
3283 |
(they could have been (re)defined as autoloaded in the patches file) |
|
3284 |
" |
|
3285 |
self initStandardTools. |
|
963
fef0f2ed2709
more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents:
962
diff
changeset
|
3286 |
]. |
617 | 3287 |
|
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3288 |
(Display isNil or:[HeadlessOperation]) ifTrue:[ |
10218 | 3289 |
graphicalMode := false. |
2074
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
3290 |
]. |
01f7e1396c18
fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents:
2050
diff
changeset
|
3291 |
|
1578
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
3292 |
self mainStartup:graphicalMode |
9df8cc1ec5c4
start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents:
1573
diff
changeset
|
3293 |
|
10227
df5a8aa203c5
openDisplay extracted as public method.
Claus Gittinger <cg@exept.de>
parents:
10221
diff
changeset
|
3294 |
"Modified: / 06-12-2006 / 15:39:17 / cg" |
1097 | 3295 |
! ! |
3296 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3297 |
!Smalltalk class methodsFor:'startup queries'! |
1097 | 3298 |
|
7563 | 3299 |
commandLine |
3300 |
"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
|
3301 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3302 |
^ CommandLine |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3303 |
|
9029 | 3304 |
" |
10071 | 3305 |
Smalltalk commandLine |
9029 | 3306 |
" |
3307 |
||
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3308 |
"Created: 19.7.1996 / 11:09:06 / cg" |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3309 |
! |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3310 |
|
7563 | 3311 |
commandLineArgumentNamed:aString |
3312 |
"extract a named argument from the command line arguments." |
|
6806 | 3313 |
|
3314 |
|args index| |
|
3315 |
||
3316 |
args := self commandLineArguments. |
|
3317 |
index := args indexOf:aString. |
|
3318 |
(index between:1 and:(args size - 1)) ifTrue:[ |
|
10071 | 3319 |
^ args at:index+1 |
6806 | 3320 |
]. |
3321 |
^ nil. |
|
3322 |
||
3323 |
" |
|
3324 |
self commandLineArgumentNamed:'-display' |
|
3325 |
" |
|
3326 |
! |
|
3327 |
||
7563 | 3328 |
commandLineArguments |
3329 |
"return the user command line arguments; |
|
3330 |
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
|
3331 |
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
|
3332 |
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
|
3333 |
the commandLineArguments will be #('foo' 'bar' 'baz'). |
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3334 |
In contrast, the value returned by #commandLine will be the full set of words." |
1097 | 3335 |
|
3336 |
^ CommandLineArguments |
|
1580
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3337 |
|
fa0156475cc2
remove internal args from the CommandLineArguments.
Claus Gittinger <cg@exept.de>
parents:
1578
diff
changeset
|
3338 |
"Modified: 19.7.1996 / 11:11:03 / cg" |
1097 | 3339 |
! |
3340 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3341 |
commandName |
10071 | 3342 |
"return the excutables name - this is normally 'stx', |
9029 | 3343 |
but can be something else for standAlone apps." |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3344 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3345 |
^ CommandName. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3346 |
|
9029 | 3347 |
" |
3348 |
Smalltalk commandName |
|
3349 |
" |
|
3350 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3351 |
"Modified: 19.7.1996 / 11:11:16 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3352 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3353 |
|
9054 | 3354 |
hasNoConsole |
3355 |
"return true, if this is a console-less application (i.e. I am winstx) |
|
3356 |
i.e. there should be no writing to stdout/stderr" |
|
3357 |
||
3358 |
^ HasNoConsole ? false |
|
3359 |
||
3360 |
" |
|
10071 | 3361 |
Smalltalk hasNoConsole |
9054 | 3362 |
" |
3363 |
! |
|
3364 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3365 |
isHeadless |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3366 |
"return true, if this is a headless application |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3367 |
i.e. no default Display connection is required/used" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3368 |
|
9029 | 3369 |
^ HeadlessOperation ? false |
3370 |
||
3371 |
" |
|
10071 | 3372 |
Smalltalk isHeadless |
9029 | 3373 |
" |
3374 |
! |
|
3375 |
||
3376 |
isPlugin |
|
3377 |
"return true, if this is a plugin application |
|
3378 |
i.e. running in a browserWindow" |
|
3379 |
||
3380 |
^ IsPlugin ? false |
|
3381 |
||
3382 |
" |
|
10071 | 3383 |
Smalltalk isPlugin |
9029 | 3384 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3385 |
! |
4957 | 3386 |
|
10231 | 3387 |
isSTScript |
3388 |
"return true, if this is stscript. i.e. the stx scripting engine." |
|
3389 |
||
3390 |
^ IsSTScript ? false |
|
3391 |
||
3392 |
" |
|
3393 |
Smalltalk isSTScript |
|
3394 |
" |
|
3395 |
||
3396 |
"Created: / 06-12-2006 / 16:41:21 / cg" |
|
3397 |
! |
|
3398 |
||
9510 | 3399 |
isSharedLibraryComponent |
3400 |
"return true, if this is a shared library component of another application |
|
3401 |
i.e. a dll within another app." |
|
3402 |
||
3403 |
^ IsSharedLibraryComponent ? false |
|
3404 |
||
3405 |
" |
|
10071 | 3406 |
Smalltalk isSharedLibraryComponent |
9510 | 3407 |
" |
3408 |
||
3409 |
"Created: / 10-08-2006 / 13:09:34 / cg" |
|
3410 |
! |
|
3411 |
||
3412 |
isSmalltalkDevelopmentSystem |
|
3413 |
"return true, if this is a real smalltalk system |
|
10231 | 3414 |
i.e. NOT a stripped or a linked application (such as the webServer) |
9510 | 3415 |
and NOT a plugIn (i.e. running in a browser) |
10231 | 3416 |
and NOT a sharedLibrary component (i.e. a dll in another app). |
3417 |
This is used to determine, wether debugging is possible or not." |
|
3418 |
||
3419 |
self isPlugin ifTrue:[^ false]. "/ I am a browser-plugin |
|
3420 |
self isSharedLibraryComponent ifTrue:[^ false]. "/ I am a COM-ponent |
|
3421 |
self isSTScript ifTrue:[^ true ]. "/ I am stScript |
|
3422 |
^ self isStandAloneApp not. |
|
9510 | 3423 |
|
3424 |
" |
|
10071 | 3425 |
Smalltalk isSmalltalkDevelopmentSystem |
9510 | 3426 |
" |
3427 |
||
3428 |
"Created: / 10-08-2006 / 13:12:49 / cg" |
|
10231 | 3429 |
"Modified: / 06-12-2006 / 16:42:56 / cg" |
9510 | 3430 |
! |
3431 |
||
7563 | 3432 |
isStandAloneApp |
3433 |
"return true, if this is a standAlone application |
|
9029 | 3434 |
i.e. a stripped & linked application (such as the webServer) |
3435 |
in contrast to a full smalltalk (development) system." |
|
3436 |
||
3437 |
^ StandAlone ? false |
|
3438 |
||
3439 |
" |
|
10071 | 3440 |
Smalltalk isStandAloneApp |
9029 | 3441 |
" |
617 | 3442 |
! |
3443 |
||
7563 | 3444 |
startupArguments |
9029 | 3445 |
"return the arguments passed to StartupClass when stx gets started. |
10071 | 3446 |
Usually these are nil, |
9029 | 3447 |
but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for |
3448 |
a simple way to configure and create stand-alone applications" |
|
7563 | 3449 |
|
3450 |
^ StartupArguments |
|
9029 | 3451 |
|
3452 |
" |
|
10071 | 3453 |
Smalltalk startupArguments |
9029 | 3454 |
" |
7563 | 3455 |
! |
3456 |
||
3457 |
startupClass |
|
3458 |
"return the class, that will get the start message when smalltalk |
|
10071 | 3459 |
starts and its non-nil. Usually this is nil, |
9029 | 3460 |
but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for |
3461 |
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
|
3462 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3463 |
^ StartupClass |
9029 | 3464 |
|
3465 |
" |
|
10071 | 3466 |
Smalltalk startupClass |
9029 | 3467 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3468 |
! |
8570 | 3469 |
|
7563 | 3470 |
startupClass:aClass selector:aSymbol arguments:anArrayOrNil |
3471 |
"{ Pragma: +optSpace }" |
|
1119
956d62a5656c
compile seldom used methods with optSpace (is this a good idea ?)
Claus Gittinger <cg@exept.de>
parents:
1114
diff
changeset
|
3472 |
|
617 | 3473 |
"set the class, selector and arguments to be performed when smalltalk |
3474 |
starts. Setting those before saving a snapshot, will make the saved |
|
3475 |
image come up executing your application (instead of the normal mainloop)" |
|
3476 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3477 |
StartupClass := aClass. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3478 |
StartupSelector := aSymbol. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3479 |
StartupArguments := anArrayOrNil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3480 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3481 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3482 |
startupSelector |
9029 | 3483 |
"return the selector, that will be sent to StartupClass. |
10071 | 3484 |
Usually this is nil, |
9029 | 3485 |
but saving an image with a non-nil StartupClass/StartupSelector allows for |
3486 |
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
|
3487 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3488 |
^ StartupSelector |
9029 | 3489 |
|
3490 |
" |
|
10071 | 3491 |
Smalltalk startupSelector |
9029 | 3492 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3493 |
! |
7811 | 3494 |
|
3495 |
wasStartedFromImage |
|
10071 | 3496 |
"return true, if this smalltalk was started from an image, |
9029 | 3497 |
as opposed to a fresh and clean startup" |
3498 |
||
7819 | 3499 |
^ ImageRestartTime notNil |
7811 | 3500 |
|
3501 |
" |
|
3502 |
Smalltalk wasStartedFromImage |
|
3503 |
" |
|
70 | 3504 |
! ! |
3505 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3506 |
!Smalltalk class methodsFor:'system environment'! |
1069 | 3507 |
|
7563 | 3508 |
language |
3509 |
"return the language setting" |
|
3510 |
||
3511 |
^ Language |
|
3512 |
||
3513 |
" |
|
3514 |
Smalltalk language |
|
1307 | 3515 |
" |
3516 |
||
3517 |
"Modified: 26.4.1996 / 17:10:05 / cg" |
|
3518 |
! |
|
3519 |
||
7563 | 3520 |
language:aLanguageSymbol |
3521 |
"set the language" |
|
3522 |
||
10101
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3523 |
Language := aLanguageSymbol asSymbol. |
1307 | 3524 |
self changed:#Language |
3525 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3526 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3527 |
Smalltalk language:#de |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3528 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3529 |
|
10101
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3530 |
"Modified: / 19-10-2006 / 23:17:29 / cg" |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3531 |
! |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3532 |
|
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3533 |
language:aLanguageSymbol territory:aTerritorySymbol |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3534 |
"set the language & territory" |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3535 |
|
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3536 |
Language := aLanguageSymbol asSymbol. |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3537 |
LanguageTerritory := aTerritorySymbol asSymbol. |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3538 |
self changed:#Language |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3539 |
|
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3540 |
" |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3541 |
Smalltalk language:#de territory:#de |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3542 |
" |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3543 |
|
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3544 |
"Created: / 19-10-2006 / 22:16:22 / cg" |
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3545 |
"Modified: / 19-10-2006 / 23:17:36 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3546 |
! |
1069 | 3547 |
|
7563 | 3548 |
languageTerritory |
3549 |
"return the language territory setting" |
|
3550 |
||
3551 |
^ LanguageTerritory |
|
3552 |
! |
|
3553 |
||
3554 |
languageTerritory:aTerritorySymbol |
|
3555 |
"set the language territory" |
|
3556 |
||
10101
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3557 |
LanguageTerritory := aTerritorySymbol asSymbol. |
1307 | 3558 |
self changed:#LanguageTerritory |
3559 |
||
3560 |
" |
|
3561 |
Time now |
|
3562 |
||
3563 |
Smalltalk languageTerritory:#us. |
|
3564 |
Time now |
|
3565 |
||
3566 |
Smalltalk languageTerritory:#de. |
|
10071 | 3567 |
Time now |
1307 | 3568 |
" |
3569 |
||
10101
26bac1a0b23f
language and territory must be symbols
Claus Gittinger <cg@exept.de>
parents:
10087
diff
changeset
|
3570 |
"Modified: / 19-10-2006 / 23:17:40 / cg" |
7992 | 3571 |
! |
3572 |
||
3573 |
setLanguage:aLanguageSymbol |
|
3574 |
"set the language withotu change notifications" |
|
3575 |
||
3576 |
Language := aLanguageSymbol. |
|
1069 | 3577 |
! ! |
3578 |
||
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
3579 |
!Smalltalk class methodsFor:'system management'! |
70 | 3580 |
|
7563 | 3581 |
compressSources |
3582 |
"{ Pragma: +optSpace }" |
|
3583 |
||
3584 |
"compress the sources file, and remove all method source strings |
|
617 | 3585 |
from the system and replace them by refs to a string in the source file. |
3586 |
This is a bit different in ST/X than in other smalltalks, |
|
3587 |
since we use per-class sourcefiles for the compiled classes, |
|
3588 |
and a mix of in-memory strings and one-for-all sourceFile for |
|
3589 |
incremental compiled methods. |
|
3590 |
Therefore, only those sources which are not coming from compiled |
|
3591 |
methods are put into the 'st.src' file - all others are untouched. |
|
3592 |
This is being automated - so dont care for now." |
|
3593 |
||
7105
44c02807ca41
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
7085
diff
changeset
|
3594 |
|newStream table source pos fileName| |
44c02807ca41
More openErrorSignal change preparations
Stefan Vogel <sv@exept.de>
parents:
7085
diff
changeset
|
3595 |
|
617 | 3596 |
" |
3597 |
first, find all methods which contain either a string-ref |
|
3598 |
or an external string in the 'st.src' file |
|
3599 |
" |
|
3600 |
newStream := 'src.tmp' asFilename writeStream. |
|
3601 |
||
3602 |
table := IdentityDictionary new:100. |
|
3603 |
||
3604 |
Method allSubInstancesDo:[:aMethod | |
|
10071 | 3605 |
source := nil. |
3606 |
aMethod sourcePosition notNil ifTrue:[ |
|
3607 |
aMethod sourceFilename = 'st.src' ifTrue:[ |
|
3608 |
source := aMethod source. |
|
3609 |
] |
|
3610 |
] ifFalse:[ |
|
3611 |
source := aMethod source |
|
3612 |
]. |
|
3613 |
||
3614 |
source notNil ifTrue:[ |
|
3615 |
pos := newStream position1Based. |
|
3616 |
newStream nextChunkPut:source. |
|
3617 |
||
3618 |
" |
|
3619 |
dont change the methods info - maybe some write error |
|
3620 |
occurs later, in that case we abort and leave everything |
|
3621 |
untouched. |
|
3622 |
" |
|
3623 |
table at:aMethod put:pos |
|
3624 |
] |
|
617 | 3625 |
]. |
3626 |
||
3627 |
newStream close. |
|
3628 |
||
3629 |
" |
|
3630 |
now, rename the new source file, |
|
3631 |
" |
|
3632 |
fileName := (ObjectMemory nameForSources). |
|
1693 | 3633 |
'src.tmp' asFilename renameTo:fileName. |
617 | 3634 |
|
3635 |
"good - now go over all changed methods, and change their |
|
3636 |
source reference" |
|
3637 |
||
3638 |
table keysAndValuesDo:[:aMethod :pos | |
|
10071 | 3639 |
aMethod localSourceFilename:fileName position:pos. |
2588
090cf1da8036
handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents:
2572
diff
changeset
|
3640 |
"/ aMethod printCR. |
617 | 3641 |
]. |
3642 |
||
3643 |
" |
|
3644 |
Smalltalk compressSources |
|
3645 |
" |
|
1693 | 3646 |
|
2176
1a24b0cef25a
when compressing sources, make certain to avoid later
Claus Gittinger <cg@exept.de>
parents:
2170
diff
changeset
|
3647 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3648 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3649 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3650 |
generateSingleSourceFile |
7563 | 3651 |
"{ Pragma: +optSpace }" |
3652 |
||
3653 |
"generate the sources file, and remove all method source strings |
|
3044 | 3654 |
from the system and replace them by refs to a string in the source file. |
3655 |
This makes the image independent from the per-class source files |
|
3656 |
and makes transportation of endUser applications easier, since |
|
10071 | 3657 |
only 3 files (executable, image and sourceFile) need to be |
3044 | 3658 |
transported." |
3659 |
||
3660 |
|newStream table source pos fileName| |
|
3661 |
||
3662 |
newStream := 'src.tmp' asFilename writeStream. |
|
3663 |
||
3664 |
table := IdentityDictionary new:100. |
|
3665 |
||
3666 |
Method allSubInstancesDo:[:aMethod | |
|
10071 | 3667 |
source := aMethod source. |
3668 |
source notNil ifTrue:[ |
|
3669 |
pos := newStream position1Based. |
|
3670 |
newStream nextChunkPut:source. |
|
3671 |
||
3672 |
" |
|
3673 |
dont change the methods info - maybe some write error |
|
3674 |
occurs later, in that case we abort and leave everything |
|
3675 |
untouched. |
|
3676 |
" |
|
3677 |
table at:aMethod put:pos |
|
3678 |
] |
|
3044 | 3679 |
]. |
3680 |
||
3681 |
newStream close. |
|
3682 |
||
3683 |
" |
|
3684 |
now, rename the new source file, |
|
3685 |
" |
|
3686 |
fileName := (ObjectMemory nameForSources). |
|
3687 |
'src.tmp' asFilename renameTo:fileName. |
|
3688 |
||
3689 |
"good - now go over all changed methods, and change their |
|
3690 |
source reference" |
|
3691 |
||
3692 |
table keysAndValuesDo:[:aMethod :pos | |
|
10071 | 3693 |
aMethod localSourceFilename:fileName position:pos. |
3044 | 3694 |
"/ aMethod printCR. |
3695 |
]. |
|
3696 |
||
3697 |
" |
|
3698 |
Smalltalk generateSingleSourceFile |
|
3699 |
" |
|
3700 |
||
3701 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
|
3702 |
"Created: 17.10.1997 / 13:00:56 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3703 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3704 |
|
10071 | 3705 |
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3706 |
"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
|
3707 |
to be loaded from package. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3708 |
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
|
3709 |
(otherwise, the newest revision will be loaded" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3710 |
|
10071 | 3711 |
^ self |
3712 |
installAutoloadedClassNamed:clsName |
|
3713 |
category:cat |
|
3714 |
package:package |
|
3715 |
revision:revisionOrNil |
|
3716 |
numClassInstVars:nil. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3717 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3718 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3719 |
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil numClassInstVars:numClassInstVarsOrNil |
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3720 |
"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
|
3721 |
to be loaded from package. |
e32e63ee0d79
extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents:
3866
diff
changeset
|
3722 |
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
|
3723 |
(otherwise, the newest revision will be loaded" |
e32e63ee0d79
extracted autoload-class generation into extra method
Claus Gittinger <cg@exept.de>
parents:
3866
diff
changeset
|
3724 |
|
7565 | 3725 |
|clsSym cls| |
3726 |
||
3727 |
clsSym := clsName asSymbol. |
|
3728 |
||
3729 |
"/ install if not already compiled-in |
|
3730 |
(cls := self at:clsSym) isNil ifTrue:[ |
|
10329
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3731 |
Autoload subclass:clsSym |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3732 |
instanceVariableNames:'' |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3733 |
classVariableNames:'' |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3734 |
poolDictionaries:'' |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3735 |
category:cat |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3736 |
inEnvironment:Smalltalk. |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3737 |
|
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3738 |
cls := self at:clsSym. |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3739 |
cls isNil ifTrue:[ |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3740 |
('Smalltalk [warning]: failed to install ' , clsName , ' as autoloaded.') infoPrintCR. |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3741 |
] ifFalse:[ |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3742 |
cls package:package asSymbol. |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3743 |
revisionOrNil notNil ifTrue:[ |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3744 |
cls setBinaryRevision:revisionOrNil |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3745 |
] |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3746 |
] |
7565 | 3747 |
] ifFalse:[ |
10329
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3748 |
"/ class already present - however, if unloaded, check for category/package change |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3749 |
cls isLoaded ifFalse:[ |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3750 |
package ~= cls package ifTrue:[ |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3751 |
cls package:package asSymbol. |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3752 |
]. |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3753 |
cat ~= cls category ifTrue:[ |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3754 |
cls category:cat. |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3755 |
]. |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3756 |
] |
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3757 |
]. |
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3758 |
^ cls. |
7565 | 3759 |
|
10329
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3760 |
"Created: / 05-11-1998 / 15:10:25 / cg" |
d63adab0e11e
don't overwrite package/category for loaded classes from abbrev.stc.
Claus Gittinger <cg@exept.de>
parents:
10295
diff
changeset
|
3761 |
"Modified: / 16-01-2007 / 12:56:18 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3762 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3763 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3764 |
installAutoloadedClasses |
7563 | 3765 |
"read the standard abbreviation file; install all classes found there as |
3044 | 3766 |
autoloaded. This takes some time ..." |
3767 |
||
6559
2ec6d0d1b821
Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents:
6539
diff
changeset
|
3768 |
|dirsConsulted p| |
4458 | 3769 |
|
3770 |
"/ new scheme: look for a directory called 'packages' |
|
3771 |
"/ and enumerate its abbrev.stc files... |
|
5067
335c866e150c
walk packagePath when reading abbrevs & autoloaded classes.
Claus Gittinger <cg@exept.de>
parents:
5065
diff
changeset
|
3772 |
dirsConsulted := Set new. |
5162 | 3773 |
|
3774 |
"/ along the package-path |
|
5788 | 3775 |
(p := self packagePath) do:[:aPath | |
10071 | 3776 |
(dirsConsulted includes:aPath) ifFalse:[ |
3777 |
('Smalltalk [info]: installing autoloaded classes found under ''' , aPath ,'''') infoPrintCR. |
|
3778 |
self |
|
3779 |
recursiveInstallAutoloadedClassesFrom:aPath |
|
3780 |
rememberIn:dirsConsulted |
|
3781 |
maxLevels:15 |
|
3782 |
noAutoload:false |
|
3783 |
packageTop:aPath. |
|
3784 |
] |
|
5788 | 3785 |
]. |
3786 |
p size == 0 ifTrue:[ |
|
10071 | 3787 |
'../../../stx' asFilename exists ifTrue:[ |
3788 |
('Smalltalk [info]: installing autoloaded classes found under ''../../..''') infoPrintCR. |
|
3789 |
self |
|
3790 |
recursiveInstallAutoloadedClassesFrom:'../../..' |
|
3791 |
rememberIn:dirsConsulted |
|
3792 |
maxLevels:15 |
|
3793 |
noAutoload:false |
|
3794 |
packageTop:'../../..'. |
|
3795 |
]. |
|
5788 | 3796 |
]. |
3797 |
||
3044 | 3798 |
" |
3799 |
Smalltalk installAutoloadedClasses |
|
3800 |
" |
|
3801 |
||
5096 | 3802 |
"Created: / 14.2.1997 / 17:32:57 / cg" |
3803 |
"Modified: / 13.12.1999 / 11:56:50 / cg" |
|
8583
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 |
installAutoloadedClassesFrom:anAbbrevFilePath |
7758 | 3807 |
"read the given abbreviation file; install all classes found there as |
3808 |
autoloaded. This takes some time ..." |
|
3809 |
||
3810 |
|f s| |
|
3811 |
||
3812 |
f := self getSystemFileName:anAbbrevFilePath. |
|
3813 |
f isNil ifTrue:[f := self getPackageFileName:anAbbrevFilePath]. |
|
3814 |
||
3815 |
f notNil ifTrue:[ |
|
10071 | 3816 |
f := f asFilename. |
3817 |
f isDirectory ifTrue:[ |
|
3818 |
f := f construct:'abbrev.stc' |
|
3819 |
]. |
|
3820 |
[ |
|
3821 |
s := f readStream. |
|
3822 |
self installAutoloadedClassesFromStream:s. |
|
3823 |
s close. |
|
3824 |
] on:FileStream openErrorSignal do:[:ex| "do nothing"]. |
|
7758 | 3825 |
] |
3826 |
||
3827 |
" |
|
3828 |
Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc' |
|
3829 |
" |
|
3830 |
||
3831 |
"Modified: / 5.11.1998 / 15:10:51 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3832 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3833 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3834 |
installAutoloadedClassesFromStream:anAbbrevFileStream |
10071 | 3835 |
"read the given abbreviation file; |
7758 | 3836 |
install all classes found there as autoloaded, and also update the |
3837 |
abbreviation (className-to-fileName mapping) table. |
|
3838 |
This takes some time ..." |
|
3839 |
||
8846 | 3840 |
|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
|
3841 |
|
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3842 |
anAbbrevFileStream isFileStream ifTrue:[ |
10071 | 3843 |
abbrevFileName := anAbbrevFileStream pathName. |
3844 |
info := 'declared from: ', abbrevFileName. |
|
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3845 |
]. |
7758 | 3846 |
|
3847 |
KnownPackages isNil ifTrue:[ |
|
10071 | 3848 |
KnownPackages := Set new. |
7758 | 3849 |
]. |
3850 |
||
3851 |
"/ yes, create any required nameSpace, without asking user. |
|
3852 |
Class createNameSpaceQuerySignal answer:true do:[ |
|
3853 |
||
10071 | 3854 |
[anAbbrevFileStream atEnd] whileFalse:[ |
3855 |
l := anAbbrevFileStream nextLine withoutSeparators. |
|
3856 |
l notEmpty ifTrue:[ |
|
3857 |
"/ must do it manually, caring for quoted strings. |
|
7758 | 3858 |
"/ words := line asCollectionOfWords. |
3859 |
||
10071 | 3860 |
words := OrderedCollection new. |
3861 |
s2 := l readStream. |
|
3862 |
[s2 atEnd] whileFalse:[ |
|
3863 |
s2 skipSeparators. |
|
3864 |
s2 peek == $' ifTrue:[ |
|
3865 |
s2 next. |
|
3866 |
w := s2 upTo:$'. |
|
3867 |
s2 skipSeparators. |
|
3868 |
] ifFalse:[ |
|
3869 |
w := s2 upToSeparator |
|
3870 |
]. |
|
3871 |
words add:w |
|
3872 |
]. |
|
3873 |
words size < 3 ifTrue:[ |
|
3874 |
'Smalltalk [warning]: bad abbrev entry' errorPrint. |
|
3875 |
anAbbrevFileStream isFileStream ifTrue:[ |
|
3876 |
' (in ''' errorPrint. |
|
3877 |
anAbbrevFileStream pathName errorPrint. |
|
3878 |
''')' errorPrint |
|
3879 |
]. |
|
3880 |
': ' errorPrint. l errorPrintCR |
|
3881 |
] ifFalse:[ |
|
3882 |
clsName := (words at:1) asSymbol. |
|
3883 |
abbrev := (words at:2). |
|
3884 |
package := (words at:3) asSymbol. |
|
3885 |
cat := words at:4 ifAbsent:nil. |
|
3886 |
numClassInstVars := words at:5 ifAbsent:'0'. |
|
3887 |
numClassInstVars := Integer readFrom:numClassInstVars onError:[0]. |
|
7758 | 3888 |
|
3889 |
"/ KnownPackages add:package. |
|
3890 |
||
10071 | 3891 |
(cat size == 0) ifTrue:[ |
3892 |
cat := 'autoloaded' |
|
3893 |
]. |
|
3894 |
||
3895 |
"/ on the fly, update the abbreviations |
|
3896 |
self setFilename:abbrev forClass:clsName package:package. |
|
3897 |
||
3898 |
"/ ' autoloaded: ' print. clsName print. ' in ' print. cat printCR. |
|
3899 |
||
3900 |
cls := self |
|
3901 |
installAutoloadedClassNamed:clsName |
|
3902 |
category:cat |
|
3903 |
package:package |
|
3904 |
revision:nil |
|
3905 |
numClassInstVars:numClassInstVars. |
|
8845
17288e4e99eb
remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents:
8821
diff
changeset
|
3906 |
|
8847 | 3907 |
"/ info notNil ifTrue:[ |
3908 |
"/ cls setComment:info. |
|
3909 |
"/ ]. |
|
10071 | 3910 |
] |
3911 |
] |
|
3912 |
] |
|
4458 | 3913 |
] |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3914 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3915 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3916 |
loadBinaries |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3917 |
"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
|
3918 |
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
|
3919 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3920 |
^ LoadBinaries |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3921 |
! |
3044 | 3922 |
|
7758 | 3923 |
loadBinaries:aBoolean |
3924 |
"{ Pragma: +optSpace }" |
|
3925 |
||
3926 |
"turn on/off loading of binary objects" |
|
3044 | 3927 |
|
3928 |
aBoolean ifTrue:[ |
|
10071 | 3929 |
(ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifTrue:[ |
3930 |
LoadBinaries := true. |
|
3931 |
^ self |
|
3932 |
]. |
|
3933 |
'Smalltalk [info]: this system does not support binary loading' infoPrintCR. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3934 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3935 |
LoadBinaries := false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3936 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3937 |
"Modified: 10.1.1997 / 15:11:00 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3938 |
! |
3044 | 3939 |
|
7758 | 3940 |
logDoits |
3941 |
"return true if doits should go into the changes file |
|
3942 |
as well as changes - by default, this is off, since |
|
3943 |
it can blow up the changes file enormously ... |
|
3944 |
" |
|
3945 |
||
3946 |
^ LogDoits |
|
3947 |
||
3948 |
" |
|
3949 |
LogDoits := false |
|
3044 | 3950 |
LogDoits := true |
3951 |
" |
|
3952 |
! |
|
3953 |
||
7758 | 3954 |
logDoits:aBoolean |
3955 |
"{ Pragma: +optSpace }" |
|
3956 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3957 |
"turn on/off logging of doits in the changes file. |
10071 | 3958 |
By default, this is off, since it can blow up the |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3959 |
changes file enormously ... |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3960 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3961 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3962 |
LogDoits := aBoolean |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3963 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3964 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3965 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3966 |
makeBytecodeMethods |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3967 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3968 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3969 |
"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
|
3970 |
iff it does not contain primitive C code. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3971 |
Experimental and not yet used." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3972 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3973 |
Method allSubInstancesDo:[:aMethod | |
10071 | 3974 |
|newMethod| |
3975 |
||
3976 |
aMethod hasPrimitiveCode ifFalse:[ |
|
3977 |
newMethod := aMethod asByteCodeMethod. |
|
3978 |
newMethod ~~ aMethod ifTrue:[ |
|
3979 |
aMethod becomeSameAs:newMethod |
|
3980 |
] |
|
3981 |
]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3982 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3983 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3984 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3985 |
Smalltalk makeBytecodeMethods |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3986 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3987 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
3988 |
"Modified: 16.1.1997 / 01:25:58 / cg" |
7758 | 3989 |
"Created: 17.10.1997 / 13:52:19 / cg" |
3990 |
! |
|
3991 |
||
3992 |
recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath |
|
3993 |
"read all abbrev.stc files from and under aDirectory |
|
3994 |
and install autoloaded classes. |
|
3995 |
If a file called NOAUTOLOAD is found, no classes there and below are installed as autoloaded |
|
3996 |
(however, the directories are searched for packages) |
|
3997 |
If a file called NOPACKAGES is found, no further searching is done in that directory or below." |
|
3998 |
||
3999 |
|abbrevStream dir noAutoloadHere dirName pkgName directoryContents| |
|
4000 |
||
4001 |
maxLevels == 0 ifTrue:[ |
|
4002 |
"/ 'Smalltalk [warning]: max directory nesting reached.' infoPrintCR. |
|
10071 | 4003 |
^ self |
7758 | 4004 |
]. |
4005 |
||
4006 |
dir := aDirectory asFilename. |
|
4007 |
||
4008 |
(dirsConsulted includes:dir pathName) ifTrue:[ |
|
10071 | 4009 |
^ self |
7758 | 4010 |
]. |
4011 |
dirsConsulted add:dir pathName. |
|
4012 |
||
4013 |
(dir construct:'NOPACKAGES') exists ifTrue:[ |
|
10071 | 4014 |
^ self. |
7758 | 4015 |
]. |
4016 |
(dir construct:'NOSUBAUTOLOAD') exists ifTrue:[ |
|
10071 | 4017 |
^ self. |
7758 | 4018 |
]. |
4019 |
noAutoloadHere := noAutoloadIn. |
|
4020 |
noAutoloadHere ifFalse:[ |
|
10071 | 4021 |
(dir construct:'NOAUTOLOAD') exists ifTrue:[ |
4022 |
noAutoloadHere := true. |
|
4023 |
]. |
|
7758 | 4024 |
] ifTrue:[ |
10071 | 4025 |
(dir construct:'AUTOLOAD') exists ifTrue:[ |
4026 |
noAutoloadHere := false. |
|
4027 |
]. |
|
7758 | 4028 |
]. |
4029 |
||
4030 |
((dir construct:'loadAll') exists |
|
4031 |
or:[(dir construct:'abbrev.stc') exists |
|
4032 |
or:[(dir construct:(dir baseName , '.prj')) exists]]) ifTrue:[ |
|
10071 | 4033 |
KnownPackages isNil ifTrue:[ |
4034 |
KnownPackages := Set new. |
|
4035 |
]. |
|
4036 |
dirName := dir pathName. |
|
4037 |
pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1. |
|
4038 |
KnownPackages add:pkgName |
|
7758 | 4039 |
]. |
4040 |
||
4041 |
"/ |
|
4042 |
"/ suppress installation as autoloaded in this and everything |
|
4043 |
"/ below; however, still traverse the directories to find packages ... |
|
4044 |
"/ |
|
4045 |
noAutoloadHere ifFalse:[ |
|
10071 | 4046 |
[ |
4047 |
abbrevStream := (dir construct:'abbrev.stc') asFilename readStream. |
|
4048 |
self installAutoloadedClassesFromStream:abbrevStream. |
|
4049 |
abbrevStream close. |
|
4050 |
] 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
|
4051 |
]. |
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
4052 |
|
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
4053 |
[ |
10071 | 4054 |
directoryContents := dir directoryContents. |
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
4055 |
] on:FileStream openErrorSignal do:[:ex| |
10071 | 4056 |
"non-accessable directory: we are done" |
4057 |
^ self |
|
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
4058 |
]. |
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
4059 |
|
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
4060 |
directoryContents do:[:aFilename | |
10071 | 4061 |
|f| |
4062 |
||
4063 |
(#( |
|
4064 |
'objbc' |
|
4065 |
'doc' |
|
4066 |
'CVS' |
|
4067 |
'bitmaps' |
|
4068 |
'resources' |
|
4069 |
'source' |
|
4070 |
'not_delivered' |
|
4071 |
'not_ported' |
|
4072 |
) includes:aFilename) ifFalse:[ |
|
4073 |
((dir baseName ~= 'stx') |
|
4074 |
or:[ |
|
4075 |
(#( |
|
4076 |
'configurations' |
|
4077 |
'include' |
|
4078 |
'rules' |
|
4079 |
'stc' |
|
4080 |
'support' |
|
4081 |
) includes:aFilename) not]) |
|
4082 |
ifTrue:[ |
|
4083 |
f := dir construct:aFilename. |
|
4084 |
f isDirectory ifTrue:[ |
|
4085 |
self |
|
4086 |
recursiveInstallAutoloadedClassesFrom:f |
|
4087 |
rememberIn:dirsConsulted |
|
4088 |
maxLevels:maxLevels-1 |
|
4089 |
noAutoload:noAutoloadHere |
|
4090 |
packageTop:packageTopPath. |
|
4091 |
] |
|
4092 |
] |
|
4093 |
]. |
|
4458 | 4094 |
]. |
4095 |
||
5117 | 4096 |
" |
4097 |
Smalltalk installAutoloadedClasses |
|
4098 |
" |
|
9550 | 4099 |
|
9565 | 4100 |
"Modified: / 17-08-2006 / 16:48:43 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4101 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4102 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4103 |
replaceReferencesTo:anObject with:newRef |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4104 |
|toAdd| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4105 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4106 |
toAdd := OrderedCollection new. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4107 |
self keysAndValuesDo:[:key :val | |
10071 | 4108 |
(key == anObject) ifTrue:[ |
4109 |
self shouldImplement. |
|
4110 |
]. |
|
4111 |
(val == anObject ) ifTrue:[ |
|
4112 |
toAdd add:(key -> newRef) |
|
4113 |
]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4114 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4115 |
toAdd do:[:each | |
10071 | 4116 |
self at:(each key) put:(each value) |
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 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4120 |
saveEmergencyImage:aBoolean |
7758 | 4121 |
"set/clear the flag which controls if ST/X should save an |
4122 |
emergency image in case of a broken display connection. |
|
4123 |
The default is true. |
|
4124 |
This may be useful, if you work with an unsecure display |
|
4125 |
(serial line), and want to have a chance of proceeding after |
|
10071 | 4126 |
a crash. In multiheaded applications, this only affects |
7758 | 4127 |
crashes of the master Display connection (the initial connection); |
4128 |
errors on other displays are reported to the views and treated |
|
4129 |
like window destroy from the windowManager." |
|
3062
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
4130 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
4131 |
SaveEmergencyImage := aBoolean |
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
4132 |
|
5b8a2aa07108
write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents:
3044
diff
changeset
|
4133 |
"Modified: / 24.10.1997 / 18:22:26 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4134 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4135 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4136 |
systemOrganization |
7758 | 4137 |
"for partial ST80 compatibility; |
4138 |
In ST80, Smalltalk organization returns a systemOrganizer, which |
|
4139 |
keeps track of class-categories, while all classes return a classOrganizer |
|
4140 |
from #organization, which keeps track of method categories of that class. |
|
4141 |
Since in ST/X, Smalltalk is a class, there is now a conflict. |
|
4142 |
To make a workaround possible, use #systemOrganization when porting |
|
4143 |
VW apps to ST/X to get the class-categories. |
|
4144 |
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
|
4145 |
|
5a69787e857c
added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents:
3624
diff
changeset
|
4146 |
^ SystemOrganizer for:nil |
5a69787e857c
added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents:
3624
diff
changeset
|
4147 |
|
5a69787e857c
added hook make apps VW compatible w.r.t. system-organizaton.
Claus Gittinger <cg@exept.de>
parents:
3624
diff
changeset
|
4148 |
"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
|
4149 |
"Modified: / 20.6.1998 / 12:41:34 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4150 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4151 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4152 |
!Smalltalk class methodsFor:'system management-fileIn'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4153 |
|
7758 | 4154 |
fileIn:aFileName |
4155 |
"read in the named file - look for it in some standard places; |
|
4156 |
return true if ok, false if failed. |
|
4157 |
This method can load almost anything which makes sense: |
|
10071 | 4158 |
.st - source files |
4159 |
.cls - binary smalltalk bytecode files |
|
4160 |
.so - binary compiled machine code class libraries |
|
4161 |
[.class - java bytecode -- soon to come]" |
|
4162 |
||
4163 |
^ self fileIn:aFileName lazy:nil silent:nil logged:false |
|
3044 | 4164 |
|
4165 |
" |
|
4166 |
Smalltalk fileIn:'source/TicTacToe.st' |
|
4712 | 4167 |
Smalltalk fileIn:'binary/TicTacToe.cls' |
4168 |
Smalltalk fileIn:'binary/TicTacToe.so' |
|
3044 | 4169 |
" |
4170 |
||
4171 |
"Created: 28.10.1995 / 17:06:28 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4172 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4173 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4174 |
fileIn:aFileName inPackage:aPackageID |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4175 |
"read in the named file in a packages directory." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4176 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4177 |
|dir| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4178 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4179 |
dir := self getPackageDirectoryForPackage:aPackageID. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4180 |
dir isNil ifTrue:[^ false]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4181 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4182 |
dir := dir asFilename. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4183 |
^ (self fileIn:(dir construct:aFileName)) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4184 |
or:[ self fileIn:((dir construct:'source') construct:aFileName) ] |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4185 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4186 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4187 |
fileIn:aFileName lazy:lazy |
7758 | 4188 |
"read in the named file - look for it in some standard places; |
4189 |
return true if ok, false if failed. |
|
4190 |
If lazy is true, no code is generated for methods, instead stubs |
|
4191 |
are created which compile themself when first executed. This allows |
|
4192 |
for much faster fileIn (but slows down the first execution later). |
|
4193 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
4194 |
code which is known to be syntactically correct." |
|
4195 |
||
10071 | 4196 |
^ self fileIn:aFileName lazy:lazy silent:nil logged:false |
7758 | 4197 |
|
4198 |
" |
|
4199 |
Smalltalk fileIn:'source/TicTacToe.st' lazy:true |
|
3044 | 4200 |
" |
4201 |
||
4202 |
"Created: 28.10.1995 / 17:06:36 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4203 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4204 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4205 |
fileIn:aFileName lazy:lazy silent:silent |
7758 | 4206 |
"read in the named file - look for it in some standard places; |
4207 |
return true if ok, false if failed. |
|
4208 |
If lazy is true, no code is generated for methods, instead stubs |
|
4209 |
are created which compile themself when first executed. This allows |
|
4210 |
for much faster fileIn (but slows down the first execution later). |
|
4211 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
4212 |
code which is known to be syntactically correct. |
|
4213 |
If silent is true, no compiler messages are output to the transcript. |
|
4214 |
Giving nil for silent/lazy will use the current settings." |
|
4215 |
||
4216 |
^ self fileIn:aFileName lazy:lazy silent:silent logged:false |
|
4217 |
||
4218 |
"Created: 28.10.1995 / 17:06:41 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4219 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4220 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4221 |
fileIn:aFileNameOrString lazy:lazy silent:silent logged:logged |
7758 | 4222 |
"read in the named file - look for it in some standard places; |
4223 |
return true if ok, false if failed. |
|
4224 |
If lazy is true, no code is generated for methods, instead stubs |
|
4225 |
are created which compile themself when first executed. This allows |
|
4226 |
for much faster fileIn (but slows down the first execution later). |
|
4227 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
4228 |
code which is known to be syntactically correct. |
|
4229 |
If silent is true, no compiler messages are output to the transcript. |
|
4230 |
Giving nil for silent/lazy will use the current settings. |
|
4231 |
This method can load almost anything which makes sense: |
|
10071 | 4232 |
.st - source files |
4233 |
.cls - binary smalltalk bytecode files |
|
4234 |
.so - binary compiled machine code class libraries |
|
4235 |
[.class - java bytecode -- soon to come]" |
|
7758 | 4236 |
|
4237 |
|fileNameString aStream path morePath bos| |
|
4238 |
||
4239 |
fileNameString := aFileNameOrString asString. |
|
4240 |
||
4241 |
" |
|
4242 |
an object or shared object ? |
|
4243 |
" |
|
4244 |
(ObjectFileLoader notNil |
|
4245 |
and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[ |
|
10071 | 4246 |
"/ LoadBinaries ifFalse:[^ false]. |
4247 |
path := self getBinaryFileName:fileNameString. |
|
4248 |
path isNil ifTrue:[ |
|
4249 |
path := self getSystemFileName:fileNameString. |
|
4250 |
]. |
|
4251 |
path isNil ifTrue:[^ false]. |
|
4252 |
^ (ObjectFileLoader loadObjectFile:path) notNil |
|
7758 | 4253 |
]. |
4254 |
||
4255 |
(fileNameString asFilename hasSuffix:'cls') ifTrue:[ |
|
10071 | 4256 |
BinaryObjectStorage notNil ifTrue:[ |
4257 |
aStream := self systemFileStreamFor:fileNameString. |
|
7758 | 4258 |
"/ path := self getBinaryFileName:fileNameString. |
4259 |
"/ path isNil ifTrue:[^ false]. |
|
4260 |
"/ aStream := path asFilename readStream. |
|
10071 | 4261 |
aStream notNil ifTrue:[ |
4262 |
aStream binary. |
|
4263 |
bos := BinaryObjectStorage onOld:aStream. |
|
4264 |
bos next. |
|
4265 |
bos close. |
|
4266 |
^ true |
|
4267 |
]. |
|
4268 |
^ false |
|
4269 |
] |
|
7758 | 4270 |
]. |
4271 |
||
9837 | 4272 |
aStream := self systemFileStreamFor:fileNameString. |
3044 | 4273 |
aStream isNil ifTrue:[^ false]. |
9837 | 4274 |
|
4275 |
(fileNameString includes:$/) ifTrue:[ |
|
10071 | 4276 |
"/ temporarily prepend the files directory |
4277 |
"/ to the searchPath. |
|
4278 |
"/ This allows fileIn-driver files to refer to local |
|
4279 |
"/ files via a relative path, and drivers to fileIn other |
|
4280 |
"/ drivers ... |
|
4281 |
morePath := aStream pathName asFilename directoryName. |
|
9837 | 4282 |
]. |
3044 | 4283 |
^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath |
4284 |
||
4285 |
" |
|
4286 |
Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true |
|
4287 |
" |
|
4288 |
||
9837 | 4289 |
"Modified: / 08-09-2006 / 19:21:16 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4290 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4291 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4292 |
fileIn:aFileName logged:logged |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4293 |
"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
|
4294 |
return true if ok, false if failed. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4295 |
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
|
4296 |
|
10071 | 4297 |
^ self fileIn:aFileName lazy:nil silent:nil logged:logged |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4298 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4299 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4300 |
Smalltalk fileIn:'source/TicTacToe.st' logged:false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4301 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4302 |
! |
7758 | 4303 |
|
10471 | 4304 |
fileIn:aFileName silent:silent |
4305 |
"read in the named file - look for it in some standard places; |
|
4306 |
return true if ok, false if failed. |
|
4307 |
If silent is true, no compiler messages are output to the transcript." |
|
4308 |
||
4309 |
^ self fileIn:aFileName lazy:nil silent:silent logged:false |
|
4310 |
||
4311 |
" |
|
4312 |
Smalltalk fileIn:'source/TicTacToe.st' silent:true |
|
4313 |
" |
|
4314 |
||
4315 |
"Created: 28.10.1995 / 17:06:36 / cg" |
|
4316 |
! |
|
4317 |
||
7758 | 4318 |
fileInChanges |
4319 |
"read in the last changes file - bringing the system to the state it |
|
70 | 4320 |
had when left the last time. |
4321 |
WARNING: this method is rubbish: it should only read things after the |
|
10071 | 4322 |
last '**snapshot**' - entry |
4323 |
(instead of the complete changes file)." |
|
1 | 4324 |
|
70 | 4325 |
" |
400 | 4326 |
do NOT update the changes file now ... |
70 | 4327 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4328 |
self fileIn:ChangeFileName logged:false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4329 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4330 |
" |
10071 | 4331 |
Smalltalk fileInChanges |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4332 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4333 |
! |
1 | 4334 |
|
7758 | 4335 |
fileInClass:aClassName |
4336 |
"find a source/object file for aClassName and -if found - load it. |
|
10071 | 4337 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
7758 | 4338 |
finally source file (.st) in that order. |
4339 |
The file is first searched for using the class name, then the abbreviated name." |
|
4340 |
||
10071 | 4341 |
^ self |
4342 |
fileInClass:aClassName |
|
4343 |
package:nil |
|
4344 |
initialize:true |
|
4345 |
lazy:false |
|
4346 |
silent:nil |
|
7758 | 4347 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4348 |
"Modified: / 9.1.1998 / 14:41:46 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4349 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4350 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4351 |
fileInClass:aClassName fromObject:aFileName |
7758 | 4352 |
"read in the named object file and dynamic-link it into the system |
3044 | 4353 |
- look for it in some standard places. |
4354 |
Only install the named class from this object file. |
|
4355 |
Return true if ok, false if failed." |
|
4356 |
||
4357 |
|path ok| |
|
4358 |
||
4359 |
" |
|
4360 |
check if the dynamic loader class is in |
|
4361 |
" |
|
4362 |
(LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false]. |
|
4363 |
||
4364 |
(path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false]. |
|
4365 |
ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil. |
|
4366 |
ok ifTrue:[ |
|
10071 | 4367 |
SilentLoading ifFalse:[ |
4368 |
Transcript show:' loaded ' , aClassName , ' from ' ; showCR:aFileName. |
|
4369 |
] |
|
3044 | 4370 |
]. |
4371 |
^ ok |
|
4372 |
||
4373 |
" |
|
10071 | 4374 |
Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so' |
4375 |
Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so' |
|
3044 | 4376 |
" |
4377 |
||
4378 |
"Modified: 10.9.1996 / 20:43:52 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4379 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4380 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4381 |
fileInClass:aClassName initialize:doInit |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4382 |
"find a source/object file for aClassName and -if found - load it. |
10071 | 4383 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4384 |
finally source file (.st) in that order. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4385 |
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
|
4386 |
|
10071 | 4387 |
^ self |
4388 |
fileInClass:aClassName |
|
4389 |
package:nil |
|
4390 |
initialize:doInit |
|
4391 |
lazy:false |
|
4392 |
silent:nil |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4393 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4394 |
"Modified: / 9.1.1998 / 14:42:02 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4395 |
! |
3044 | 4396 |
|
7758 | 4397 |
fileInClass:aClassName initialize:doInit lazy:loadLazy |
4398 |
"find a source/object file for aClassName and -if found - load it. |
|
10071 | 4399 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
7758 | 4400 |
finally source file (.st) in that order. |
4401 |
The file is first searched for using the class name, then the abbreviated name." |
|
4402 |
||
10071 | 4403 |
^ self |
4404 |
fileInClass:aClassName |
|
4405 |
package:nil |
|
4406 |
initialize:doInit |
|
4407 |
lazy:loadLazy |
|
4408 |
silent:nil |
|
7758 | 4409 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4410 |
"Modified: / 9.1.1998 / 14:42:19 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4411 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4412 |
|
10071 | 4413 |
fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent |
7563 | 4414 |
"find a source/object file for aClassName and -if found - load it. |
10071 | 4415 |
Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and |
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4416 |
finally source file (.st), in that order. |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4417 |
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
|
4418 |
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
|
4419 |
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
|
4420 |
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
|
4421 |
nil uses the value from SilentLoading." |
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4422 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4423 |
^ self |
10071 | 4424 |
fileInClass:aClassName |
4425 |
package:nil |
|
4426 |
initialize:doInit |
|
4427 |
lazy:loadLazy |
|
4428 |
silent:beSilent |
|
3155
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4429 |
|
35befc38f4f1
added package-argument to fileIn methods.
Claus Gittinger <cg@exept.de>
parents:
3096
diff
changeset
|
4430 |
"Modified: / 9.1.1998 / 14:42:28 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4431 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4432 |
|
10295 | 4433 |
fileInClass:aClassName package:package |
4434 |
"find a source/object file for aClassName and -if found - load it. |
|
4435 |
search is in some standard places trying driver-file (.ld), object-file (.o) and |
|
4436 |
finally source file (.st) in that order. |
|
4437 |
The file is first searched for using the class name, then the abbreviated name." |
|
4438 |
||
4439 |
^ self |
|
4440 |
fileInClass:aClassName |
|
4441 |
package:package |
|
4442 |
initialize:true |
|
4443 |
lazy:false |
|
4444 |
silent:nil |
|
4445 |
||
4446 |
"Created: / 08-01-2007 / 10:06:09 / cg" |
|
4447 |
! |
|
4448 |
||
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4449 |
fileInClass:aClassName package:package initialize:doInit lazy:loadLazy silent:beSilent |
7758 | 4450 |
"find a source/object file for aClassName and -if found - load it. |
4451 |
This is the workhorse for autoloading. |
|
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4452 |
Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and |
7758 | 4453 |
finally source file (.st), in that order. |
4454 |
The file is first searched for using the class name, then the abbreviated name. |
|
4455 |
The argument doInit controlls if the class should be sent a #initialize after the |
|
4456 |
load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler |
|
4457 |
should not send notes to the transcript; it can be true, false or nil, where |
|
4458 |
nil uses the value from SilentLoading." |
|
4459 |
||
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4460 |
|classFileName alternativeClassFileName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4461 |
filenameToSet packageDir packageFile bos| |
7758 | 4462 |
|
4463 |
wasLazy := Compiler compileLazy:loadLazy. |
|
4464 |
beSilent notNil ifTrue:[ |
|
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4465 |
wasSilent := self silentLoading:beSilent. |
7763 | 4466 |
]. |
4467 |
||
4468 |
classFileName := Smalltalk fileNameForClass:aClassName. |
|
4469 |
(classFileName = aClassName) ifTrue:[ |
|
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4470 |
"/ no abbrev.stc translation for className |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4471 |
(aClassName includes:$:) ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4472 |
"/ a nameSpace name |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4473 |
alternativeClassFileName := classFileName copyFrom:(classFileName lastIndexOf:$:)+1 |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4474 |
]. |
10051 | 4475 |
]. |
4476 |
||
9598 | 4477 |
classFileName asFilename isAbsolute ifTrue:[ |
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4478 |
classFileName asFilename suffix notEmptyOrNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4479 |
ok := self fileIn:classFileName lazy:loadLazy silent:beSilent. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4480 |
] ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4481 |
ok := self fileIn:(classFileName,'.st') lazy:loadLazy silent:beSilent. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4482 |
] |
9598 | 4483 |
] ifFalse:[ |
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4484 |
classFileName := classFileName copyReplaceAll:$: with:$_. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4485 |
[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4486 |
Class withoutUpdatingChangesDo:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4487 |
|zarFn zar entry| |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4488 |
|
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4489 |
ok := false. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4490 |
|
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4491 |
package notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4492 |
packageDir := package asString. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4493 |
packageDir := packageDir copyReplaceAll:$: with:$/. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4494 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4495 |
|
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4496 |
Class packageQuerySignal answer:package do:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4497 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4498 |
then, if dynamic linking is available, |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4499 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4500 |
(LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4501 |
sharedLibExtension := ObjectFileLoader sharedLibraryExtension. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4502 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4503 |
first look for a class packages shared binary in binary/xxx.o |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4504 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4505 |
libName := self libraryFileNameOfClass:aClassName. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4506 |
libName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4507 |
(ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension)) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4508 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4509 |
sharedLibExtension ~= '.o' ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4510 |
ok := self fileInClass:aClassName fromObject:(libName, '.o') |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4511 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4512 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4513 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4514 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4515 |
then, look for a shared binary in binary/xxx.o |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4516 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4517 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4518 |
(ok := self fileInClass:aClassName fromObject:(classFileName, sharedLibExtension)) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4519 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4520 |
sharedLibExtension ~= '.o' ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4521 |
ok := self fileInClass:aClassName fromObject:(classFileName, '.o') |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4522 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4523 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4524 |
alternativeClassFileName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4525 |
(ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, sharedLibExtension)) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4526 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4527 |
sharedLibExtension ~= '.o' ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4528 |
ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, '.o') |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4529 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4530 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4531 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4532 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4533 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4534 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4535 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4536 |
|
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4537 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4538 |
if that did not work, look for a compiled-bytecode file ... |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4539 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4540 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4541 |
(ok := self fileIn:(classFileName , '.cls') lazy:loadLazy silent:beSilent) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4542 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4543 |
alternativeClassFileName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4544 |
ok := self fileIn:(alternativeClassFileName , '.cls') lazy:loadLazy silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4545 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4546 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4547 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4548 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4549 |
if that did not work, and the classes package is known, |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4550 |
look for an st-cls file |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4551 |
in a package subdir of the source-directory ... |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4552 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4553 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4554 |
(packageDir notNil and:[BinaryObjectStorage notNil]) ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4555 |
packageFile := self getPackageFileName:(packageDir , '/classes/' , classFileName , '.cls'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4556 |
packageFile isNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4557 |
packageFile := (packageDir , '/classes/' , classFileName , '.cls'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4558 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4559 |
(ok := self fileIn:packageFile lazy:loadLazy silent:beSilent) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4560 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4561 |
alternativeClassFileName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4562 |
packageFile := self getPackageFileName:(packageDir , '/classes/' , alternativeClassFileName , '.cls'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4563 |
packageFile isNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4564 |
packageFile := (packageDir , '/classes/' , alternativeClassFileName , '.cls'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4565 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4566 |
ok := self fileIn:packageFile lazy:loadLazy silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4567 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4568 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4569 |
|
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4570 |
zarFn := self getPackageFileName:(packageDir , '/classes.zip'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4571 |
zarFn notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4572 |
zar := ZipArchive oldFileNamed:zarFn. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4573 |
zar notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4574 |
entry := zar extract:(classFileName , '.cls'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4575 |
(entry isNil and:[alternativeClassFileName notNil]) ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4576 |
entry := zar extract:(alternativeClassFileName , '.cls'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4577 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4578 |
entry notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4579 |
bos := BinaryObjectStorage onOld:(entry asByteArray readStream). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4580 |
bos next. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4581 |
bos close. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4582 |
ok := true |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4583 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4584 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4585 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4586 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4587 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4588 |
|
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4589 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4590 |
if that did not work, look for an st-source file ... |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4591 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4592 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4593 |
filenameToSet := classFileName , '.st'. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4594 |
(ok := self fileIn:filenameToSet lazy:loadLazy silent:beSilent) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4595 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4596 |
alternativeClassFileName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4597 |
filenameToSet := alternativeClassFileName , '.st'. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4598 |
ok := self fileIn:filenameToSet lazy:loadLazy silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4599 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4600 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4601 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4602 |
... and in the standard source-directory |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4603 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4604 |
filenameToSet := 'source/' , classFileName , '.st'. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4605 |
(ok := self fileIn:filenameToSet lazy:loadLazy silent:beSilent) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4606 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4607 |
alternativeClassFileName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4608 |
filenameToSet := 'source/' , alternativeClassFileName , '.st'. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4609 |
ok := self fileIn:filenameToSet lazy:loadLazy silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4610 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4611 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4612 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4613 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4614 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4615 |
if that did not work, and the classes package is known, |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4616 |
look for an st-source file |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4617 |
in a package subdir of the source-directory ... |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4618 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4619 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4620 |
packageDir notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4621 |
packageFile := self getPackageFileName:(packageDir , '/source/' , classFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4622 |
packageFile isNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4623 |
packageFile := (packageDir , '/source/' , classFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4624 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4625 |
filenameToSet := packageFile. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4626 |
(ok := self fileIn:packageFile lazy:loadLazy silent:beSilent) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4627 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4628 |
alternativeClassFileName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4629 |
packageFile := self getPackageFileName:(packageDir , '/source/' , alternativeClassFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4630 |
packageFile isNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4631 |
packageFile := (packageDir , '/source/' , alternativeClassFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4632 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4633 |
filenameToSet := packageFile. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4634 |
ok := self fileIn:packageFile lazy:loadLazy silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4635 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4636 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4637 |
packageFile := self getPackageFileName:(packageDir , '/' , classFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4638 |
packageFile isNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4639 |
packageFile := (packageDir , '/' , classFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4640 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4641 |
filenameToSet := packageFile. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4642 |
(ok := self fileIn:packageFile lazy:loadLazy silent:beSilent) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4643 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4644 |
alternativeClassFileName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4645 |
packageFile := self getPackageFileName:(packageDir , '/' , alternativeClassFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4646 |
packageFile isNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4647 |
packageFile := (packageDir , '/' , alternativeClassFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4648 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4649 |
filenameToSet := packageFile. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4650 |
ok := self fileIn:packageFile lazy:loadLazy silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4651 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4652 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4653 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4654 |
... and in the standard source-directory |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4655 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4656 |
filenameToSet := 'source/' , packageDir , '/' , classFileName , '.st'. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4657 |
(ok := self fileIn:filenameToSet lazy:loadLazy silent:beSilent) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4658 |
ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4659 |
alternativeClassFileName notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4660 |
filenameToSet := 'source/' , packageDir , '/' , alternativeClassFileName , '.st'. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4661 |
ok := self fileIn:filenameToSet lazy:loadLazy silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4662 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4663 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4664 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4665 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4666 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4667 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4668 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4669 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4670 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4671 |
if that did not work, and the classes package is known, |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4672 |
look for a zipArchive containing a class entry. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4673 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4674 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4675 |
packageDir notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4676 |
zarFn := self getPackageFileName:(packageDir , '/source.zip'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4677 |
zarFn isNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4678 |
zarFn := packageDir asFilename withSuffix:'zip'. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4679 |
zarFn := self getSourceFileName:zarFn. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4680 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4681 |
zarFn notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4682 |
zar := ZipArchive oldFileNamed:zarFn. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4683 |
zar notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4684 |
entry := zar extract:(classFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4685 |
(entry isNil and:[alternativeClassFileName notNil]) ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4686 |
entry := zar extract:(alternativeClassFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4687 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4688 |
entry notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4689 |
filenameToSet := zarFn. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4690 |
ok := self |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4691 |
fileInStream:(entry asString readStream) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4692 |
lazy:loadLazy |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4693 |
silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4694 |
logged:false |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4695 |
addPath:nil |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4696 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4697 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4698 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4699 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4700 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4701 |
|
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4702 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4703 |
if that did not work, |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4704 |
look for a zipArchive containing a class entry. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4705 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4706 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4707 |
zarFn := self getSourceFileName:'source.zip'. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4708 |
zarFn notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4709 |
zar := ZipArchive oldFileNamed:zarFn. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4710 |
zar notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4711 |
entry := zar extract:(zarFn := classFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4712 |
(entry isNil and:[alternativeClassFileName notNil]) ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4713 |
entry := zar extract:(zarFn := alternativeClassFileName , '.st'). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4714 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4715 |
entry notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4716 |
filenameToSet := zarFn. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4717 |
ok := self |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4718 |
fileInStream:(entry asString readStream) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4719 |
lazy:loadLazy |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4720 |
silent:beSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4721 |
logged:false |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4722 |
addPath:nil |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4723 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4724 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4725 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4726 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4727 |
ok ifFalse:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4728 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4729 |
if there is a sourceCodeManager, ask it for the classes sourceCode |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4730 |
" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4731 |
(mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4732 |
inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4733 |
inStream notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4734 |
filenameToSet := nil. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4735 |
ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4736 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4737 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4738 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4739 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4740 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4741 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4742 |
] ensure:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4743 |
Compiler compileLazy:wasLazy. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4744 |
wasSilent notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4745 |
self silentLoading:wasSilent |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4746 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4747 |
]. |
9598 | 4748 |
]. |
4749 |
||
4750 |
ok ifTrue:[ |
|
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4751 |
newClass := self at:(aClassName asSymbol). |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4752 |
newClass notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4753 |
"set the classes name - but do not change if already set" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4754 |
filenameToSet notNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4755 |
newClass getClassFilename isNil ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4756 |
newClass setClassFilename:(filenameToSet asFilename baseName) |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4757 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4758 |
]. |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4759 |
|
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4760 |
doInit ifTrue:[ |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4761 |
newClass initialize |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4762 |
] |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4763 |
] |
3044 | 4764 |
]. |
4765 |
||
4766 |
^ newClass |
|
4767 |
||
10131
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4768 |
"Created: / 9.1.1998 / 14:40:32 / cg" |
b9f97a04561a
fileInClass:package:initialize:lazy:silent: - documentation
Stefan Vogel <sv@exept.de>
parents:
10127
diff
changeset
|
4769 |
"Modified: / 5.6.1999 / 14:53:01 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4770 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4771 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4772 |
fileInClassLibrary:aClassLibraryName |
7758 | 4773 |
"find an object file containing a binary class library in some standard places |
4774 |
and load it. This install all of its contained classes. |
|
4712 | 4775 |
Return true if ok, false if not. |
4776 |
Notice: the argument may not have an extension (by purpose); |
|
10071 | 4777 |
the sharedLib extension (.dll / .so / .sl) is added here, to |
4778 |
make the caller independent of the underlying operatingSystem." |
|
4712 | 4779 |
|
4780 |
|path fn| |
|
3044 | 4781 |
|
4782 |
ObjectFileLoader isNil ifTrue:[^ false]. |
|
4712 | 4783 |
|
6837 | 4784 |
fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix). |
6836 | 4785 |
fn := fn pathName. |
4712 | 4786 |
|
4787 |
path := self getBinaryFileName:fn. |
|
4788 |
path isNil ifTrue:[ |
|
10071 | 4789 |
path := self getSystemFileName:fn. |
4712 | 4790 |
]. |
4791 |
path isNil ifTrue:[^ false]. |
|
4792 |
||
4714 | 4793 |
^ (ObjectFileLoader loadObjectFile:path) notNil |
3044 | 4794 |
|
4795 |
" |
|
4796 |
Smalltalk fileInClassLibrary:'libtable' |
|
4797 |
Smalltalk fileInClassLibrary:'binary/libwidg3' |
|
4798 |
" |
|
4799 |
||
4800 |
"Modified: 8.1.1997 / 17:58:56 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4801 |
! |
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 |
fileInClassLibrary:aClassLibraryName inPackage:packageID |
7758 | 4804 |
"find an object file containing a binary class library in some standard places |
10429 | 4805 |
and load it. This installs all of its contained classes. |
7758 | 4806 |
Return true if ok, false if not. |
4807 |
Notice: the argument may not have an extension (by purpose); |
|
10429 | 4808 |
the sharedLib extension (.dll / .so / .sl) is added here, to |
4809 |
make the caller independent of the underlying operatingSystem." |
|
6025 | 4810 |
|
10451
cb5c7b091764
try local dll BEFORE package dll.
Claus Gittinger <cg@exept.de>
parents:
10432
diff
changeset
|
4811 |
|path baseName handle| |
6025 | 4812 |
|
4813 |
ObjectFileLoader isNil ifTrue:[^ false]. |
|
4814 |
||
10451
cb5c7b091764
try local dll BEFORE package dll.
Claus Gittinger <cg@exept.de>
parents:
10432
diff
changeset
|
4815 |
baseName := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix). |
cb5c7b091764
try local dll BEFORE package dll.
Claus Gittinger <cg@exept.de>
parents:
10432
diff
changeset
|
4816 |
baseName exists ifTrue:[ |
cb5c7b091764
try local dll BEFORE package dll.
Claus Gittinger <cg@exept.de>
parents:
10432
diff
changeset
|
4817 |
"/ load local file first... |
cb5c7b091764
try local dll BEFORE package dll.
Claus Gittinger <cg@exept.de>
parents:
10432
diff
changeset
|
4818 |
handle := (ObjectFileLoader loadObjectFile:baseName). |
cb5c7b091764
try local dll BEFORE package dll.
Claus Gittinger <cg@exept.de>
parents:
10432
diff
changeset
|
4819 |
handle notNil ifTrue:[^ true]. |
cb5c7b091764
try local dll BEFORE package dll.
Claus Gittinger <cg@exept.de>
parents:
10432
diff
changeset
|
4820 |
]. |
6025 | 4821 |
|
4822 |
path := self getPackageDirectoryForPackage:packageID. |
|
4823 |
path isNil ifTrue:[^ false]. |
|
10451
cb5c7b091764
try local dll BEFORE package dll.
Claus Gittinger <cg@exept.de>
parents:
10432
diff
changeset
|
4824 |
path := path asFilename construct:baseName. |
6025 | 4825 |
path exists ifFalse:[^ false]. |
4826 |
||
4827 |
^ (ObjectFileLoader loadObjectFile:path pathName) notNil |
|
4828 |
||
4829 |
" |
|
4830 |
Smalltalk fileInClassLibrary:'libtable' |
|
4831 |
Smalltalk fileInClassLibrary:'binary/libwidg3' |
|
4832 |
Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser' |
|
4833 |
" |
|
4834 |
||
4835 |
"Modified: 8.1.1997 / 17:58:56 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4836 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4837 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4838 |
fileInStream:streamArg |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4839 |
^ 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
|
4840 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4841 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4842 |
fileInStream:streamArg lazy:lazy silent:silent logged:logged addPath:morePath |
7758 | 4843 |
"read sourceCode from aStream; |
4844 |
return true if ok, false if failed. |
|
4845 |
If lazy is true, no code is generated for methods, instead stubs |
|
4846 |
are created which compile themself when first executed. This allows |
|
4847 |
for much faster fileIn (but slows down the first execution later). |
|
4848 |
Since no syntax checks are done when doing lazy fileIn, use this only for |
|
4849 |
code which is known to be syntactically correct. |
|
4850 |
If silent is true, no compiler messages are output to the transcript. |
|
4851 |
Giving nil for silent/lazy will use the current settings. |
|
4852 |
If morePath is nonNil, it is prepended to the systemPath temporarily during the |
|
4853 |
fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more) |
|
4854 |
using a relative path." |
|
4855 |
||
8445
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4856 |
|inStream decoder wasLazy wasSilent oldSystemPath oldRealPath encoding| |
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4857 |
|
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4858 |
inStream := streamArg. |
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4859 |
inStream isNil ifTrue:[^ false]. |
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4860 |
|
8711
c5f28b4c719d
guessEncoding now implemented in CharacterEncoder
Claus Gittinger <cg@exept.de>
parents:
8695
diff
changeset
|
4861 |
encoding := CharacterEncoder guessEncodingOfStream:inStream. |
8445
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4862 |
encoding notNil ifTrue:[ |
10071 | 4863 |
decoder := CharacterEncoder encoderFor:encoding. |
4864 |
inStream := EncodedStream stream:inStream encoder:decoder. |
|
4865 |
inStream skipEncodingChunk. |
|
8445
b6c4e1aa13af
care for encoding when filing in
Claus Gittinger <cg@exept.de>
parents:
8405
diff
changeset
|
4866 |
]. |
7758 | 4867 |
|
4868 |
lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy]. |
|
4869 |
silent notNil ifTrue:[wasSilent := self silentLoading:silent]. |
|
8317
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4870 |
morePath notNil ifTrue:[ |
10071 | 4871 |
oldSystemPath := SystemPath copy. |
4872 |
SystemPath addFirst:morePath. |
|
4873 |
oldRealPath := RealSystemPath. |
|
4874 |
RealSystemPath := nil. |
|
8317
af17d81a91f5
Fix when fileIn changes SystemPath
Stefan Vogel <sv@exept.de>
parents:
8278
diff
changeset
|
4875 |
]. |
617 | 4876 |
[ |
10071 | 4877 |
(Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[ |
4878 |
inStream fileIn. |
|
4879 |
] |
|
6421
58dca33cf0fc
#valueNowOrOnUnwindDo: -> #ensure:
Claus Gittinger <cg@exept.de>
parents:
6403
diff
changeset
|
4880 |
] ensure:[ |
10071 | 4881 |
morePath notNil ifTrue:[ |
4882 |
"take care, someone could have changed SystemPath during fileIn!!" |
|
4883 |
(SystemPath copyFrom:2) = oldSystemPath ifTrue:[ |
|
4884 |
SystemPath := oldSystemPath. |
|
4885 |
RealSystemPath := oldRealPath. |
|
4886 |
] ifFalse:[ |
|
4887 |
(oldSystemPath includes:morePath) ifFalse:[ |
|
4888 |
SystemPath remove:morePath ifAbsent:[]. |
|
4889 |
]. |
|
4890 |
RealSystemPath := nil. |
|
4891 |
]. |
|
4892 |
]. |
|
4893 |
lazy notNil ifTrue:[Compiler compileLazy:wasLazy]. |
|
4894 |
silent notNil ifTrue:[self silentLoading:wasSilent]. |
|
4895 |
inStream close |
|
617 | 4896 |
]. |
4897 |
^ true |
|
4898 |
||
4899 |
" |
|
4900 |
Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true |
|
4901 |
" |
|
1896 | 4902 |
|
4903 |
"Modified: 5.11.1996 / 20:03:35 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4904 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4905 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4906 |
isClassLibraryLoaded:name |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4907 |
"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
|
4908 |
|
10071 | 4909 |
ObjectMemory |
4910 |
binaryModuleInfo |
|
4911 |
do:[:entry | |
|
4912 |
entry type == #classLibrary ifTrue:[ |
|
4913 |
entry libraryName = name ifTrue:[ |
|
4914 |
^ true "/ already loaded |
|
4915 |
] |
|
4916 |
]. |
|
4917 |
]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4918 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4919 |
^ false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4920 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4921 |
" |
10071 | 4922 |
Smalltalk isClassLibraryLoaded:'libstx_libbasic' |
4923 |
Smalltalk isClassLibraryLoaded:'libstx_libwidg3' |
|
4924 |
Smalltalk isClassLibraryLoaded:'libstx_libboss' |
|
9638 | 4925 |
" |
4926 |
||
4927 |
"Modified: / 23-08-2006 / 15:54:46 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4928 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4929 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4930 |
loadClassLibraryIfAbsent:name |
7758 | 4931 |
"dynamically load a classLibrary, if not already loaded |
4932 |
and the system supports dynamic loading. |
|
4933 |
Return true, if the library is loaded, false if not. |
|
4934 |
This entry is called without system specific filename |
|
3044 | 4935 |
extensions - it is portable among different architectures |
10071 | 4936 |
as long as corresponding files (x.so / x.dll / x.sl / x.o) |
3044 | 4937 |
are be present ..." |
4938 |
||
5881
81a349eab73c
added #isClassLibraryLoaded:
Claus Gittinger <cg@exept.de>
parents:
5878
diff
changeset
|
4939 |
(self isClassLibraryLoaded:name) ifTrue:[ ^ true ]. "/ already loaded |
3044 | 4940 |
^ self fileInClassLibrary:name |
4941 |
||
4942 |
" |
|
4943 |
Smalltalk loadClassLibraryIfAbsent:'libbasic' |
|
4944 |
Smalltalk loadClassLibraryIfAbsent:'libwidg3' |
|
4945 |
" |
|
4946 |
||
4947 |
"Modified: 31.10.1996 / 16:57:24 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4948 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4949 |
|
10071 | 4950 |
secureFileIn:aFileName |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4951 |
"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
|
4952 |
Catch any error during fileIn. Return true if ok, false if failed" |
10071 | 4953 |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4954 |
|retVal| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4955 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4956 |
retVal := false. |
10071 | 4957 |
(SignalSet with:AbortOperationRequest with:TerminateProcessRequest) |
4958 |
handle:[:ex | ex return ] |
|
4959 |
do:[ retVal := self fileIn:aFileName ]. |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4960 |
^ retVal |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4961 |
! |
7758 | 4962 |
|
4963 |
silentFileIn:aFilename |
|
4964 |
"same as fileIn:, but do not output 'compiled...'-messages on Transcript. |
|
4965 |
Main use is during startup." |
|
4966 |
||
4967 |
|wasSilent| |
|
4968 |
||
4969 |
wasSilent := self silentLoading:true. |
|
4970 |
[ |
|
10071 | 4971 |
self fileIn:aFilename |
7758 | 4972 |
] ensure:[ |
10071 | 4973 |
self silentLoading:wasSilent |
7758 | 4974 |
] |
3044 | 4975 |
! ! |
4976 |
||
4977 |
!Smalltalk class methodsFor:'system management-files'! |
|
4978 |
||
7758 | 4979 |
bitmapFileStreamFor:aFileName |
4980 |
"search aFileName in some standard places; |
|
4981 |
return a readonly fileStream or nil if not found. |
|
4982 |
Searches in subdirectories named 'bitmaps' in the SystemPath. |
|
4983 |
Notice: this does not look in the package-specific bitmaps directories." |
|
4984 |
||
4985 |
|aString| |
|
4986 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4987 |
aString := self getBitmapFileName:aFileName. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4988 |
aString notNil ifTrue:[ |
10071 | 4989 |
^ aString asFilename readStreamOrNil |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4990 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4991 |
^ nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
4992 |
! |
7758 | 4993 |
|
4994 |
bitmapFromFileNamed:aFileName forClass:aClass |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
4995 |
"backward compatibility: |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
4996 |
search aFileName in some standard places: |
10071 | 4997 |
first in the redefinable bitmaps path, |
5089 | 4998 |
then in the classes own package directory if existing. |
5040 | 4999 |
Return an image or nil." |
5000 |
||
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5001 |
^ self imageFromFileNamed:aFileName forClass:aClass |
5040 | 5002 |
|
5003 |
" |
|
5004 |
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' forClass:View |
|
5005 |
" |
|
5006 |
! |
|
5007 |
||
7758 | 5008 |
bitmapFromFileNamed:aFileName inPackage:aPackage |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5009 |
"backward compatibility: |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5010 |
search aFileName in some standard places: |
10071 | 5011 |
first in the redefinable bitmaps path, |
7758 | 5012 |
then in the package directory if existing. |
5013 |
Return an image or nil." |
|
5014 |
||
5015 |
^ self imageFromFileNamed:aFileName inPackage:aPackage |
|
5016 |
||
5017 |
" |
|
5018 |
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview' |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5019 |
Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5020 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5021 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5022 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5023 |
classNameForFile:aFileName |
7758 | 5024 |
"return the className which corresponds to an abbreviated fileName, |
5025 |
or nil if no special translation applies. The given filename arg may |
|
5026 |
include a '.st' suffix (but no other)." |
|
5027 |
||
5028 |
|fn| |
|
5029 |
||
5030 |
(aFileName asFilename hasSuffix:'st') ifTrue:[ |
|
10071 | 5031 |
fn := aFileName copyWithoutLast:3 |
3044 | 5032 |
] ifFalse:[ |
10071 | 5033 |
fn := aFileName |
3044 | 5034 |
]. |
5035 |
^ self filenameAbbreviations keyAtEqualValue:fn ifAbsent:[fn]. |
|
5036 |
||
5037 |
" |
|
10071 | 5038 |
Smalltalk classNameForFile:'DrawObj' |
5039 |
Smalltalk classNameForFile:'DrawObj.st' |
|
5040 |
Smalltalk classNameForFile:'ArrColl.st' |
|
5041 |
Smalltalk classNameForFile:'ArrColl.chg' |
|
3044 | 5042 |
" |
5043 |
||
5044 |
"Modified: 11.12.1995 / 14:51:10 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5045 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5046 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5047 |
constructPathFor:aDirectoryName |
10071 | 5048 |
"search for aDirectory in SystemPath; |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5049 |
return a collection of pathes which include that directory." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5050 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5051 |
^ self realSystemPath select:[:dirName | |
10071 | 5052 |
|fullPath| |
5053 |
||
5054 |
fullPath := dirName asFilename construct:aDirectoryName. |
|
5055 |
"/ fullPath exists and:[fullPath isDirectory and:[fullPath isReadable]] |
|
5056 |
fullPath isDirectory and:[fullPath isReadable] |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5057 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5058 |
! |
7758 | 5059 |
|
5060 |
fileInFileStreamFor:aFileName |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5061 |
"obsolete |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5062 |
search aFileName in some standard places; |
7758 | 5063 |
return a readonly fileStream or nil if not found. |
5064 |
Searches in subdirectories named 'fileIn' in SystemPath" |
|
5065 |
||
5066 |
|aString| |
|
5067 |
||
5068 |
aString := self getFileInFileName:aFileName. |
|
5069 |
aString notNil ifTrue:[ |
|
10071 | 5070 |
^ aString asFilename readStreamOrNil |
7758 | 5071 |
]. |
5072 |
^ nil |
|
5073 |
! |
|
5074 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5075 |
fileNameForClass:aClassOrClassName |
7758 | 5076 |
"return a filename for aClassOrClassName" |
5077 |
||
10051 | 5078 |
|cls nonMetaclass nm nm1 nm2| |
7758 | 5079 |
|
5080 |
aClassOrClassName isBehavior ifTrue:[ |
|
10071 | 5081 |
nonMetaclass := aClassOrClassName theNonMetaclass. |
5082 |
nm1 := nonMetaclass name. |
|
5083 |
nm2 := nonMetaclass nameWithoutPrefix. |
|
7758 | 5084 |
] ifFalse:[ |
10071 | 5085 |
cls := Smalltalk classNamed:aClassOrClassName. |
5086 |
cls notNil ifTrue:[ |
|
5087 |
nonMetaclass := cls theNonMetaclass. |
|
5088 |
nm := nonMetaclass getClassFilename. |
|
5089 |
nm notNil ifTrue:[^ nm asFilename withoutSuffix baseName]. |
|
5090 |
nm1 := nonMetaclass name. |
|
5091 |
nm2 := nonMetaclass nameWithoutPrefix. |
|
5092 |
] ifFalse:[ |
|
5093 |
nm1 := aClassOrClassName. |
|
5094 |
nm2 := (aClassOrClassName copyFrom:(aClassOrClassName lastIndexOf:$:)+1). |
|
5095 |
]. |
|
7758 | 5096 |
]. |
5097 |
nm1 := nm1 asSymbol. |
|
5098 |
nm2 := nm2 asSymbol. |
|
5099 |
||
5100 |
CachedAbbreviations notNil ifTrue:[ |
|
10071 | 5101 |
(CachedAbbreviations includesKey:nm1) ifTrue:[ |
5102 |
^ (CachedAbbreviations at:nm1) asFilename baseName |
|
5103 |
]. |
|
5104 |
(CachedAbbreviations includesKey:nm2) ifTrue:[ |
|
5105 |
^ (CachedAbbreviations at:nm2) asFilename baseName |
|
5106 |
]. |
|
8084
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
5107 |
]. |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
5108 |
^ nm1 copyReplaceAll:$: with:$_ |
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
5109 |
|
617 | 5110 |
" |
10071 | 5111 |
Smalltalk fileNameForClass:#Complex |
5112 |
Smalltalk fileNameForClass:'SmallInteger' |
|
5113 |
Smalltalk fileNameForClass:'UnixOperatingSystem' |
|
5114 |
Smalltalk fileNameForClass:'Launcher' |
|
5115 |
Smalltalk fileNameForClass:'SomeUnknownClass' |
|
5116 |
Smalltalk fileNameForClass:OSI::FTAMOperation |
|
5117 |
Smalltalk fileNameForClass:'OSI::Foobar' |
|
617 | 5118 |
" |
5119 |
||
10054 | 5120 |
"Modified: / 06-10-2006 / 16:16:01 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5121 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5122 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5123 |
filenameAbbreviations |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5124 |
"return a dictionary containing the classname-to-filename |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5125 |
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
|
5126 |
to 14 chars)" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5127 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5128 |
CachedAbbreviations isNil ifTrue:[ |
10071 | 5129 |
self readAbbreviations |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5130 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5131 |
^ CachedAbbreviations |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5132 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5133 |
"flush with: |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5134 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5135 |
CachedAbbreviations := nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5136 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5137 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5138 |
Smalltalk filenameAbbreviations |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5139 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5140 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5141 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5142 |
flushPathCaches |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5143 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5144 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5145 |
"forget pathCaches - these are collections containing valid directory names, |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5146 |
where system files (resource, bitmaps etc.) are found. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5147 |
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
|
5148 |
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
|
5149 |
(for example, if you created a private resource directory)" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5150 |
|
10071 | 5151 |
RealSystemPath := ResourcePath := SourcePath := |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5152 |
BinaryPath := FileInPath := nil |
2378 | 5153 |
|
5154 |
" |
|
5155 |
Smalltalk flushPathCaches |
|
5156 |
" |
|
617 | 5157 |
! |
5158 |
||
7758 | 5159 |
getBinaryFileName:aFileName |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5160 |
"obsolete |
10071 | 5161 |
search aFileName in some standard places |
7758 | 5162 |
(subdirectories named 'binary' in SystemPath); |
5163 |
return the absolute filename or nil if none is found." |
|
5164 |
||
5165 |
BinaryPath isNil ifTrue:[ |
|
10071 | 5166 |
BinaryPath := self constructPathFor:BinaryDirName |
617 | 5167 |
]. |
5168 |
||
2928 | 5169 |
^ 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
|
5170 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5171 |
"Modified: 18.7.1996 / 15:53:49 / cg" |
453 | 5172 |
! |
5173 |
||
7758 | 5174 |
getBitmapFileName:aFileName |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5175 |
"for backward compatibility: |
10071 | 5176 |
search aFileName in some standard places |
7758 | 5177 |
(subdirectories named 'bitmaps' in SystemPath); |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5178 |
Return the pathName or nil if none is found." |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5179 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5180 |
^ self getBitmapFileName:aFileName forPackage:nil |
617 | 5181 |
|
5182 |
" |
|
5183 |
Smalltalk getBitmapFileName:'SBrowser.xbm' |
|
5184 |
" |
|
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5185 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5186 |
"Modified: 18.7.1996 / 15:53:55 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5187 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5188 |
|
9836 | 5189 |
getBitmapFileName:aFileName forPackage:aPackageIDOrNil |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5190 |
"for backward compatibility. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5191 |
search aFileName in some standard places: |
10071 | 5192 |
first in the redefinable bitmaps path, |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5193 |
then in the package directory if existing. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5194 |
Return a path or nil. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5195 |
Search order is: |
10072 | 5196 |
bitmaps/<pkg>/file |
5197 |
resources/<pkg>/bitmaps/file |
|
5198 |
<pkg>/bitmaps/file |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5199 |
" |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5200 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5201 |
|f dir packageDir pF| |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5202 |
|
10072 | 5203 |
((f := aFileName asString) startsWith:'bitmaps/') ifTrue:[ |
10162
0466d5acb174
getBitmapFileName: forPackage: fixed
Michael Beyl <mb@exept.de>
parents:
10157
diff
changeset
|
5204 |
f := f copyFrom:('bitmaps/' size + 1). |
10072 | 5205 |
]. |
5206 |
||
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5207 |
aPackageIDOrNil isNil ifTrue:[ |
10072 | 5208 |
"/ this will be an error in the future |
5209 |
"/ 'Smalltalk [warning]: bitmap file access without package: ' infoPrint. aFileName infoPrintCR. |
|
5210 |
"/ self halt. |
|
5211 |
||
5212 |
pF := self searchPath:(self realSystemPath) for:aFileName in:('bitmaps'). |
|
5213 |
pF notNil ifTrue:[ |
|
5214 |
^ pF. |
|
5215 |
]. |
|
5216 |
f ~= aFileName ifTrue:[ |
|
5217 |
pF := self searchPath:(self realSystemPath) for:f in:('bitmaps'). |
|
5218 |
pF notNil ifTrue:[ |
|
5219 |
^ pF. |
|
5220 |
]. |
|
5221 |
]. |
|
5222 |
^ nil |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5223 |
]. |
9836 | 5224 |
|
5225 |
packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/. |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5226 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5227 |
pF := self searchPath:(self realSystemPath) for:aFileName in:('bitmaps/',packageDir). |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5228 |
pF notNil ifTrue:[ |
10072 | 5229 |
^ pF. |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5230 |
]. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5231 |
pF := self searchPath:(self realSystemPath) for:aFileName in:('resources/',packageDir,'/bitmaps'). |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5232 |
pF notNil ifTrue:[ |
10072 | 5233 |
^ pF. |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5234 |
]. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5235 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5236 |
dir := self projectDirectoryForPackage:aPackageIDOrNil. |
9836 | 5237 |
dir notNil ifTrue:[ |
10072 | 5238 |
pF := (dir asFilename construct:'bitmaps') constructString:f. |
5239 |
pF asFilename exists ifTrue:[ |
|
5240 |
^ pF. |
|
5241 |
]. |
|
9836 | 5242 |
]. |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5243 |
^ nil |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5244 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5245 |
" |
10071 | 5246 |
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview' |
5247 |
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool' |
|
5248 |
Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies' |
|
5249 |
Smalltalk imageFromFileNamed:'CheckOn10_xp.xpm' inPackage:'stx:libwidg' |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5250 |
" |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5251 |
|
10072 | 5252 |
"Modified: / 11-10-2006 / 13:53:18 / cg" |
9836 | 5253 |
! |
5254 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5255 |
getFileInFileName:aFileName |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5256 |
"obsolete |
10071 | 5257 |
search aFileName in some standard places |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5258 |
(subdirectories named 'fileIn' in SystemPath); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5259 |
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
|
5260 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5261 |
FileInPath isNil ifTrue:[ |
10071 | 5262 |
FileInPath := self constructPathFor:FileInDirName |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5263 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5264 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5265 |
^ self searchPath:FileInPath for:aFileName in:FileInDirName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5266 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5267 |
"Modified: 18.7.1996 / 15:53:59 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5268 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5269 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5270 |
getPackageDirectoryForPackage:aPackageID |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5271 |
"search for a particular package; return its directory, or nil. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5272 |
Stand alone applications might get nil, if there are only binaries installed." |
5550
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
5273 |
|
10041
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5274 |
|checkForPackageDirectory module packageSubDirectory| |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5275 |
|
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5276 |
module := aPackageID asPackageId module. |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5277 |
packageSubDirectory := aPackageID asPackageId directory. |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5278 |
|
10071 | 5279 |
checkForPackageDirectory := |
5280 |
[:moduleDir | |
|
5281 |
|packageDir| |
|
5282 |
||
5283 |
(moduleDir exists and:[moduleDir isDirectory]) ifTrue:[ |
|
5284 |
packageDir := moduleDir construct:packageSubDirectory. |
|
5285 |
(packageDir exists and:[packageDir isDirectory]) ifTrue:[ |
|
5286 |
^ packageDir |
|
5287 |
] |
|
5288 |
]. |
|
5289 |
]. |
|
10041
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5290 |
|
5550
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
5291 |
self packagePath do:[:aPath | |
10071 | 5292 |
|moduleDir| |
5293 |
||
5294 |
moduleDir := aPath asFilename construct:module. |
|
5295 |
checkForPackageDirectory value:moduleDir. |
|
10041
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5296 |
]. |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5297 |
|
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5298 |
"/ not found - special case for the stx package... |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5299 |
module = 'stx' ifTrue:[ |
10071 | 5300 |
checkForPackageDirectory value:('../../' asFilename). |
10041
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5301 |
]. |
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5302 |
|
5550
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
5303 |
^ nil |
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
5304 |
|
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
5305 |
" |
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
5306 |
Smalltalk getPackageDirectoryForPackage:(Array package) |
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
5307 |
Smalltalk getPackageDirectoryForPackage:'stx:goodies/bitmaps' |
5785
872483483444
oops - getPackageDirectoryForPackage now cares for the case
Claus Gittinger <cg@exept.de>
parents:
5781
diff
changeset
|
5308 |
Smalltalk getPackageDirectoryForPackage:'stx:libview' |
5550
01ad51c71b0e
added #getPackageDirectoryForPackage:
Claus Gittinger <cg@exept.de>
parents:
5518
diff
changeset
|
5309 |
" |
10041
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5310 |
|
1ef0cb09523b
protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents:
9937
diff
changeset
|
5311 |
"Modified: / 06-10-2006 / 11:49:27 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5312 |
! |
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 |
getPackageFileName:aFileName |
10071 | 5315 |
"search aFileName in some standard places |
7758 | 5316 |
(packagePath and subdirectories named 'packages' in SystemPath); |
5317 |
return the absolute filename or nil if none is found." |
|
5318 |
||
5319 |
|f| |
|
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
5320 |
|
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
5321 |
"/ search along packagePath ... |
5052 | 5322 |
f := self searchPath:self packagePath for:aFileName in:nil. |
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
5323 |
f isNil ifTrue:[ |
10071 | 5324 |
"/ search under packages-directory along systemPath ... |
5325 |
f := self searchPath:self realSystemPath for:aFileName in:PackageDirName. |
|
5326 |
"/ kludge - allow for stx-directory to be named differently |
|
5327 |
f isNil ifTrue:[ |
|
5328 |
(aFileName startsWith:'stx') ifTrue:[ |
|
5329 |
(aFileName startsWith:'stx' , Filename separator) ifTrue:[ |
|
5330 |
f := '../..' asFilename construct:(aFileName copyFrom:5). |
|
5331 |
f exists ifTrue:[ |
|
5332 |
^ f pathName |
|
5333 |
]. |
|
5334 |
] |
|
5335 |
]. |
|
5336 |
]. |
|
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
5337 |
]. |
5878
b89d789e1705
always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents:
5860
diff
changeset
|
5338 |
(f notNil and:[(f := f asFilename) exists]) ifTrue:[ |
10071 | 5339 |
^ f pathName |
5878
b89d789e1705
always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents:
5860
diff
changeset
|
5340 |
]. |
b89d789e1705
always return a string from #getPackageFileName
Claus Gittinger <cg@exept.de>
parents:
5860
diff
changeset
|
5341 |
^ nil |
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
5342 |
|
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
5343 |
" |
10071 | 5344 |
Smalltalk getPackageFileName:'stx/libview/resources/normal.style' |
5345 |
Smalltalk getPackageFileName:'stx/libview/source.zip' |
|
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
5346 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5347 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5348 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5349 |
getResourceFileName:aFileName |
10071 | 5350 |
"search aFileName in some standard places |
8945 | 5351 |
(subdirectories named 'resources' in SystemPath); |
7758 | 5352 |
return the absolute filename or nil if none is found." |
5353 |
||
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5354 |
^ self getResourceFileName:aFileName forPackage:nil |
617 | 5355 |
|
5356 |
" |
|
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
5357 |
Smalltalk getResourceFileName:'SystemBrowser.rs' |
617 | 5358 |
" |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5359 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5360 |
"Modified: 18.7.1996 / 15:54:03 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5361 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5362 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5363 |
getResourceFileName:aFileName forClass:aClassOrNil |
10071 | 5364 |
"search aFileName in some standard places |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5365 |
(subdirectories named 'resource' in SystemPath); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5366 |
and in aClasses package directory. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5367 |
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
|
5368 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5369 |
|pkgOrNil| |
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 |
aClassOrNil notNil ifTrue:[ |
10071 | 5372 |
pkgOrNil := aClassOrNil package. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5373 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5374 |
^ self getResourceFileName:aFileName forPackage:pkgOrNil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5375 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5376 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5377 |
Smalltalk getResourceFileName:'SystemBrowser.rs' forClass:SystemBrowser |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5378 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5379 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5380 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5381 |
getResourceFileName:aFileName forPackage:aPackageIDOrNil |
10071 | 5382 |
"search aFileName in some standard places |
7758 | 5383 |
(subdirectories named 'resource' in SystemPath); |
5384 |
and in a packages directory. |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5385 |
Return the absolute filename or nil if none is found. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5386 |
Search order is: |
10072 | 5387 |
resources/<pkg>/file |
5388 |
<pkg>/resources/file |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5389 |
" |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5390 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5391 |
|pF f dir packageDir| |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5392 |
|
10072 | 5393 |
((f := aFileName asString) startsWith:'resources/') ifTrue:[ |
5394 |
f := aFileName copyFrom:('resources/' size + 1). |
|
5395 |
]. |
|
5396 |
||
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5397 |
aPackageIDOrNil isNil ifTrue:[ |
10072 | 5398 |
"/ this will be an error in the future |
5399 |
"/ 'Smalltalk [warning]: resource file access without package: ' infoPrint. aFileName infoPrintCR. |
|
5400 |
"/ self halt. |
|
5401 |
||
5402 |
pF := self searchPath:(self realSystemPath) for:aFileName in:('resources'). |
|
5403 |
pF notNil ifTrue:[ |
|
5404 |
^ pF. |
|
5405 |
]. |
|
5406 |
f ~= aFileName ifTrue:[ |
|
5407 |
pF := self searchPath:(self realSystemPath) for:f in:('resources'). |
|
5408 |
pF notNil ifTrue:[ |
|
5409 |
^ pF. |
|
5410 |
]. |
|
5411 |
]. |
|
5412 |
^ nil |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5413 |
]. |
8945 | 5414 |
|
5415 |
packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/. |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5416 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5417 |
pF := self searchPath:(self realSystemPath) for:aFileName in:('resources/',packageDir). |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5418 |
pF notNil ifTrue:[ |
10072 | 5419 |
^ pF. |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5420 |
]. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5421 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5422 |
dir := self projectDirectoryForPackage:aPackageIDOrNil. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5423 |
dir notNil ifTrue:[ |
10072 | 5424 |
pF := (dir asFilename construct:'resources') constructString:f. |
5425 |
pF asFilename exists ifTrue:[ |
|
5426 |
^ pF. |
|
5427 |
]. |
|
5428 |
pF := (dir asFilename construct:'styles') constructString:f. |
|
5429 |
pF asFilename exists ifTrue:[ |
|
5430 |
^ pF. |
|
5431 |
]. |
|
10197
95aac0260bfc
#getResorceFileName:forPackage - resolve in plain package directory also
Stefan Vogel <sv@exept.de>
parents:
10186
diff
changeset
|
5432 |
"resolve something like: 'ASN/definition.asn1'" |
95aac0260bfc
#getResorceFileName:forPackage - resolve in plain package directory also
Stefan Vogel <sv@exept.de>
parents:
10186
diff
changeset
|
5433 |
pF := dir asFilename constructString:f. |
95aac0260bfc
#getResorceFileName:forPackage - resolve in plain package directory also
Stefan Vogel <sv@exept.de>
parents:
10186
diff
changeset
|
5434 |
pF asFilename exists ifTrue:[ |
95aac0260bfc
#getResorceFileName:forPackage - resolve in plain package directory also
Stefan Vogel <sv@exept.de>
parents:
10186
diff
changeset
|
5435 |
^ pF. |
95aac0260bfc
#getResorceFileName:forPackage - resolve in plain package directory also
Stefan Vogel <sv@exept.de>
parents:
10186
diff
changeset
|
5436 |
]. |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5437 |
]. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5438 |
^ nil |
5043 | 5439 |
|
5440 |
" |
|
5065 | 5441 |
Smalltalk getResourceFileName:'SystemBrowser.rs' forPackage:'stx:libtool' |
5080 | 5442 |
Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview' |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5443 |
Smalltalk getResourceFileName:'mswindowsXP.style' forPackage:'stx:libview' |
8945 | 5444 |
Smalltalk getResourceFileName:'Foo.rs' forPackage:'stx:libview' |
5043 | 5445 |
" |
10072 | 5446 |
|
5447 |
"Modified: / 11-10-2006 / 13:53:43 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5448 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5449 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5450 |
getSourceFileName:aFileName |
10071 | 5451 |
"search aFileName in some standard places |
7563 | 5452 |
(subdirectories named 'source' in SystemPath); |
736 | 5453 |
return the absolute filename or nil if none is found. |
5454 |
This is used to find a sourceFile for a methods source, |
|
5455 |
if no sourceCodeManager is available." |
|
617 | 5456 |
|
2959 | 5457 |
|f| |
5458 |
||
617 | 5459 |
SourcePath isNil ifTrue:[ |
10071 | 5460 |
SourcePath := self constructPathFor:SourceDirName |
617 | 5461 |
]. |
5462 |
||
2959 | 5463 |
"/ first, try a source subdir along the path. |
4770 | 5464 |
SourcePath notNil ifTrue:[ |
10071 | 5465 |
f := self searchPath:SourcePath for:aFileName in:SourceDirName. |
4770 | 5466 |
]. |
2959 | 5467 |
f isNil ifTrue:[ |
10071 | 5468 |
"/ then, try it itself along the path. |
5469 |
f := self searchPath:self realSystemPath for:aFileName in:nil |
|
2959 | 5470 |
]. |
5471 |
^ f |
|
191 | 5472 |
|
5473 |
" |
|
10071 | 5474 |
Smalltalk getSourceFileName:'Smalltalk.st' |
5475 |
Smalltalk getSourceFileName:'ArrColl.st' |
|
191 | 5476 |
" |
1562
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5477 |
|
850a88ecff97
searchPath: dont use it, if fileName starts with "./" or "../"
Claus Gittinger <cg@exept.de>
parents:
1553
diff
changeset
|
5478 |
"Modified: 18.7.1996 / 15:54:07 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5479 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5480 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5481 |
getSystemFileName:aFileNameOrString |
7758 | 5482 |
"search aFileNameOrString in some standard places; |
5483 |
return the absolute filename or nil if none is found. |
|
5484 |
see comment in Smalltalk>>initSystemPath. |
|
5485 |
This should be used to access resources such as bitmaps, doc-files, |
|
5486 |
and other help files. |
|
5487 |
" |
|
5488 |
||
5489 |
"credits for this method go to Markus ...." |
|
5490 |
||
5491 |
|fn nameString| |
|
5492 |
||
5493 |
fn := aFileNameOrString asFilename. |
|
2933 | 5494 |
nameString := fn name. |
2896 | 5495 |
fn isAbsolute ifTrue:[ |
10071 | 5496 |
"dont use path for absolute file names" |
5497 |
||
5498 |
^ nameString |
|
191 | 5499 |
]. |
5500 |
||
617 | 5501 |
self realSystemPath do:[:dirName | |
10071 | 5502 |
|realName| |
5503 |
||
5504 |
realName := dirName asFilename construct:nameString. |
|
5505 |
"/ |
|
5506 |
"/ here, we also return true if its a directory |
|
5507 |
"/ (Even if unreadable). |
|
5508 |
"/ It could be that the file itself is still readable. |
|
5509 |
"/ |
|
5510 |
(realName isDirectory or:[realName isReadable]) ifTrue: [ |
|
5511 |
^ realName name |
|
5512 |
] |
|
191 | 5513 |
]. |
617 | 5514 |
^ nil |
4150 | 5515 |
|
5516 |
" |
|
5517 |
Smalltalk getSystemFileName:'doc/online/english/TOP.html' |
|
5518 |
Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm' |
|
10071 | 5519 |
Smalltalk getSystemFileName:'bitmaps/foo' |
5520 |
Smalltalk getSystemFileName:'resources/View.rs' |
|
5521 |
Smalltalk getSystemFileName:'resources/iris.style' |
|
4150 | 5522 |
" |
5523 |
||
5524 |
"Modified: / 6.5.1999 / 10:40:37 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5525 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5526 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5527 |
imageFromFileNamed:aFileName forClass:aClass |
7758 | 5528 |
"search aFileName in some standard places: |
5529 |
first in the redefinable bitmaps path, then in the classes |
|
5530 |
own package directory if existing. |
|
5089 | 5531 |
Return an image or nil." |
5532 |
||
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5533 |
|classPackage img| |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5534 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5535 |
classPackage := aClass package. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5536 |
img := self imageFromFileNamed:aFileName inPackage:classPackage. |
5113 | 5537 |
img isNil ifTrue:[ |
10071 | 5538 |
"/ try under the goodies package ... |
5539 |
classPackage ~= 'stx:goodies' ifTrue:[ |
|
5540 |
img := self imageFromFileNamed:aFileName inPackage:'stx:goodies'. |
|
5541 |
] |
|
5113 | 5542 |
]. |
5543 |
^ img |
|
5089 | 5544 |
|
5545 |
" |
|
5546 |
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' forClass:View |
|
5547 |
" |
|
8583
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 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5550 |
imageFromFileNamed:aFileName inPackage:aPackage |
7758 | 5551 |
"search aFileName in some standard places: |
10071 | 5552 |
first in the redefinable bitmaps path, |
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5553 |
then in the package directory if existing. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5554 |
Return an image or nil. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5555 |
Search order is: |
10071 | 5556 |
bitmaps/<pkg>/file |
5557 |
resources/<pkg>/bitmaps/file |
|
5558 |
<pkg>/bitmaps/file |
|
10069
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5559 |
" |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5560 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5561 |
|path| |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5562 |
|
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5563 |
path := self getBitmapFileName:aFileName forPackage:aPackage. |
15c0cdb1e9e9
bitmap file finding cleanup
Claus Gittinger <cg@exept.de>
parents:
10065
diff
changeset
|
5564 |
path notNil ifTrue:[ |
10071 | 5565 |
^ Image fromFile:path. |
9199 | 5566 |
]. |
5567 |
^ nil |
|
5089 | 5568 |
|
5569 |
" |
|
10071 | 5570 |
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview' |
5571 |
Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool' |
|
5572 |
Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies' |
|
5573 |
Smalltalk imageFromFileNamed:'CheckOn10_xp.xpm' inPackage:'stx:libwidg' |
|
5574 |
Smalltalk imageFromFileNamed:'ComboDn_xp.xpm' inPackage:'stx:libwidg' |
|
5089 | 5575 |
" |
9836 | 5576 |
|
5577 |
"Modified: / 08-09-2006 / 18:02:04 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5578 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5579 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5580 |
libraryFileNameOfClass:aClassOrClassName |
7758 | 5581 |
"for a given class, return the name of a classLibrary which contains |
5582 |
binary code for it. |
|
5583 |
Read the libinfo file 'liblist.stc' (which is created during the compilation process) |
|
5584 |
for an entry for aClassOrClassName. |
|
5585 |
Search for the className in the first col, and return the value found in |
|
5586 |
the 2nd col. |
|
5587 |
Return nil if no entry is found. |
|
5588 |
||
5589 |
A nil returns means that this class is either built-in or not present |
|
5590 |
in a package-class library (i.e. either as separate .o or separate .st file). |
|
5591 |
Otherwise, the returned name is the classLibrary object of that class. |
|
5592 |
The classes code can be loaded from that file if binary loading is supported." |
|
5593 |
||
5594 |
|aStream line words n aClassName| |
|
5595 |
||
5596 |
aClassOrClassName isBehavior ifTrue:[ |
|
10071 | 5597 |
aClassName := aClassOrClassName name |
7758 | 5598 |
] ifFalse:[ |
10071 | 5599 |
aClassName := aClassOrClassName |
617 | 5600 |
]. |
5601 |
aClassName := aClassName asString. |
|
5602 |
||
5603 |
#('include/liblist.stc') "/ filenames |
|
5604 |
with:#(2) "/ column |
|
5605 |
do:[:fileName :col | |
|
5606 |
||
10071 | 5607 |
aStream := self systemFileStreamFor:fileName. |
5608 |
aStream notNil ifTrue:[ |
|
5609 |
[aStream atEnd] whileFalse:[ |
|
5610 |
line := aStream nextLine. |
|
5611 |
line notNil ifTrue:[ |
|
5612 |
(line startsWith:'#') ifFalse:[ |
|
5613 |
words := line asCollectionOfWords. |
|
5614 |
(n := words size) > 1 ifTrue:[ |
|
5615 |
(words at:1) = aClassName ifTrue:[ |
|
5616 |
n >= col ifTrue:[ |
|
5617 |
aStream close. |
|
5618 |
^ (words at:col) withoutSeparators |
|
5619 |
] |
|
5620 |
] |
|
5621 |
] |
|
5622 |
] |
|
5623 |
] |
|
5624 |
]. |
|
5625 |
aStream close |
|
5626 |
]. |
|
617 | 5627 |
]. |
5628 |
||
5629 |
^ nil |
|
5630 |
||
5631 |
" |
|
10071 | 5632 |
Smalltalk libraryFileNameOfClass:'ClockView' |
5633 |
Smalltalk libraryFileNameOfClass:'Bag' |
|
617 | 5634 |
" |
5635 |
||
5636 |
"Modified: 6.11.1995 / 15:41:39 / cg" |
|
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 |
packagePath |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5640 |
"return a collection of additional directorynames, where smalltalk |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5641 |
looks for package directories. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5642 |
Notice, that directories named 'packages' under the systemPath are |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5643 |
always consulted - even if not in the packagePath" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5644 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5645 |
^ PackagePath |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5646 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5647 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5648 |
Smalltalk packagePath |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5649 |
Smalltalk packagePath addLast:'/opt/smalltalk' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5650 |
Smalltalk packagePath addFirst:'/usr/local/otherPackages' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5651 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5652 |
! |
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
5653 |
|
7758 | 5654 |
packagePath:aPath |
5655 |
"set the packagePath; |
|
5656 |
a collection of additional directorynames, where smalltalk |
|
5657 |
looks for package directories. |
|
5658 |
Notice, that directories named 'packages' under the systemPath are |
|
5659 |
always consulted - even if not in the packagePath" |
|
5660 |
||
5661 |
PackagePath := aPath asOrderedCollection |
|
5662 |
||
5663 |
" |
|
5664 |
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
|
5665 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5666 |
! |
7758 | 5667 |
|
5668 |
projectDirectoryForClass:aClass |
|
5669 |
"given a class, return the path to its package directory; |
|
5670 |
nil if not found." |
|
5671 |
||
5672 |
|pkg| |
|
5673 |
||
5674 |
pkg := aClass package. |
|
5675 |
pkg isNil ifTrue:[^ nil]. |
|
5038
d74e7c71ae75
added package directory handling
Claus Gittinger <cg@exept.de>
parents:
5037
diff
changeset
|
5676 |
|
5040 | 5677 |
^ self projectDirectoryForPackage:pkg. |
5678 |
||
5679 |
" |
|
10071 | 5680 |
Smalltalk projectDirectoryForClass:Array |
5040 | 5681 |
Smalltalk projectDirectoryForClass:View |
5682 |
" |
|
5683 |
! |
|
5684 |
||
7758 | 5685 |
projectDirectoryForPackage:aPackage |
5686 |
"given a packageID, return the path to its package directory; |
|
5687 |
nil if not found." |
|
5688 |
||
5689 |
|prj prjDir| |
|
5690 |
||
5691 |
"/ there might be a package specific resource directory ... |
|
5692 |
"/ in the directory, from which the project was loaded |
|
5693 |
prj := Project projectWithId:aPackage. |
|
5694 |
prj notNil ifTrue:[ |
|
10071 | 5695 |
prjDir := prj directory. |
7758 | 5696 |
]. |
5697 |
(prjDir notNil and:[prjDir asFilename exists]) ifFalse:[ |
|
10071 | 5698 |
prjDir := Smalltalk getPackageFileName:(aPackage copyReplaceAll:$: with:$/). |
7758 | 5699 |
]. |
5700 |
^ prjDir |
|
5701 |
||
5702 |
" |
|
10071 | 5703 |
Smalltalk projectDirectoryForPackage:'stx:libbasic' |
7758 | 5704 |
Smalltalk projectDirectoryForPackage:'exept:smartcard' |
10071 | 5705 |
Smalltalk projectDirectoryForPackage:'stx' |
5706 |
Smalltalk projectDirectoryForPackage:'bosch' |
|
10057 | 5707 |
" |
5708 |
||
5709 |
"Modified: / 07-10-2006 / 17:45:58 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5710 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5711 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5712 |
readAbbreviations |
7758 | 5713 |
"read classname to filename mappings from include/abbrev.stc. |
5714 |
sigh - all for those poor sys5.3 or MSDOS people with short filenames ..." |
|
5715 |
||
5716 |
"since installAutoloadedClasses also reads all abbreviations, use it" |
|
5717 |
||
5718 |
CachedAbbreviations := IdentityDictionary new. |
|
5719 |
self installAutoloadedClasses. |
|
5720 |
^ CachedAbbreviations. |
|
5721 |
||
5722 |
"/ |aStream f dirsConsulted| |
|
5723 |
"/ |
|
5724 |
"/ CachedAbbreviations := IdentityDictionary new. |
|
5725 |
"/ |
|
5726 |
"/ "/ new scheme: look for a directory called 'packages' |
|
5727 |
"/ "/ and enumerate its abbrev.stc files... |
|
5728 |
"/ dirsConsulted := Set new. |
|
5729 |
"/ f := Smalltalk getSystemFileName:'packages'. |
|
5730 |
"/ f notNil ifTrue:[ |
|
5731 |
"/ f := f asFilename. |
|
5732 |
"/ f isDirectory ifTrue:[ |
|
5733 |
"/ ('Smalltalk [info]: reading all class abbreviations found under ''' , f pathName ,'''') infoPrintCR. |
|
5734 |
"/ self recursiveReadAllAbbreviationsFrom:f. |
|
5735 |
"/ dirsConsulted add:f pathName. |
|
5736 |
"/ ]. |
|
5737 |
"/ ]. |
|
5738 |
"/ |
|
5739 |
"/ "/ and along the package-path |
|
5740 |
"/ self packagePath do:[:aPath | |
|
5741 |
"/ (dirsConsulted includes:aPath) ifFalse:[ |
|
5742 |
"/ ('Smalltalk [info]: reading all class abbreviations found under ''' , aPath ,'''') infoPrintCR. |
|
7613 | 5743 |
"/ self recursiveReadAllAbbreviationsFrom:aPath. |
5744 |
"/ dirsConsulted add:aPath |
|
5745 |
"/ ] |
|
5746 |
"/ ]. |
|
5747 |
"/ |
|
5748 |
"/ "/ old scheme: look for a single file called 'abbrev.stc' in the |
|
5749 |
"/ "/ include directory. This will vanish. |
|
5750 |
"/ |
|
5751 |
"/ aStream := self systemFileStreamFor:'include/abbrev.stc'. |
|
5752 |
"/ aStream notNil ifTrue:[ |
|
5753 |
"/ ('Smalltalk [info]: reading additional abbreviations from ''' , aStream pathName ,'''') infoPrintCR. |
|
5754 |
"/ self readAbbreviationsFromStream:aStream. |
|
5755 |
"/ aStream close. |
|
5756 |
"/"/ ] ifFalse:[ |
|
5757 |
"/"/ ('Smalltalk [warning]: no global''include/abbrev.stc'' file found') infoPrintCR |
|
5758 |
"/ ]. |
|
5759 |
"/ ^ CachedAbbreviations |
|
191 | 5760 |
|
5761 |
" |
|
617 | 5762 |
Smalltalk readAbbreviations |
191 | 5763 |
" |
617 | 5764 |
|
5091 | 5765 |
"Modified: / 10.12.1999 / 17:48:53 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5766 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5767 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5768 |
readAbbreviationsFromStream:aStream |
7758 | 5769 |
"read classname to filename mappings from aStream. |
5770 |
sigh - all for those poor sys5.3 or MSDOS people with short filenames ..." |
|
5771 |
||
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5772 |
|line words nm abbrev pkg s w| |
7758 | 5773 |
|
5774 |
[aStream atEnd] whileFalse:[ |
|
10071 | 5775 |
line := aStream nextLine. |
5776 |
line notNil ifTrue:[ |
|
5777 |
(line startsWith:'#') ifFalse:[ |
|
5778 |
||
5779 |
"/ must do it manually, caring for quoted strings. |
|
7758 | 5780 |
"/ words := line asCollectionOfWords. |
5781 |
||
10071 | 5782 |
words := OrderedCollection new. |
5783 |
s := line readStream. |
|
5784 |
[s atEnd] whileFalse:[ |
|
5785 |
s skipSeparators. |
|
5786 |
s peek == $' ifTrue:[ |
|
5787 |
s next. |
|
5788 |
w := s upTo:$'. |
|
5789 |
s skipSeparators. |
|
5790 |
] ifFalse:[ |
|
5791 |
w := s upToSeparator |
|
5792 |
]. |
|
5793 |
words add:w |
|
5794 |
]. |
|
5795 |
words size >= 3 ifTrue:[ |
|
5796 |
nm := (words at:1) withoutSeparators. |
|
5797 |
abbrev := (words at:2) withoutSeparators. |
|
5798 |
pkg := (words at:3) withoutSeparators. |
|
5799 |
self setFilename:abbrev forClass:nm package:pkg. |
|
5800 |
] ifFalse:[ |
|
5801 |
('Smalltalk [warning]: malformed line in ' , (aStream pathName)) infoPrintCR. |
|
5802 |
] |
|
5803 |
] |
|
5804 |
] |
|
4420 | 5805 |
]. |
5091 | 5806 |
|
5095
9bbf3cf594e5
no warning for same-abbrev, if packages differ.
Claus Gittinger <cg@exept.de>
parents:
5093
diff
changeset
|
5807 |
"Modified: / 13.12.1999 / 11:54:17 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5808 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5809 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5810 |
realSystemPath |
7758 | 5811 |
"return the realSystemPath - thats the directorynames from |
5812 |
SystemPath which exist and are readable" |
|
5813 |
||
5814 |
|nP| |
|
5815 |
||
5816 |
RealSystemPath isNil ifTrue:[ |
|
10071 | 5817 |
OperatingSystem isVMSlike ifTrue:[ |
5818 |
"/ temporary kludge: since we cannot currently |
|
5819 |
"/ check for existance of a name like 'volume:', |
|
5820 |
"/ leave those in the Path without a check. |
|
5821 |
RealSystemPath := SystemPath select:[:dirName | |
|
5822 |
|f| |
|
5823 |
||
5824 |
f := dirName asFilename. |
|
5825 |
f isVolumeOnly ifTrue:[ |
|
5826 |
true |
|
5827 |
] ifFalse:[ |
|
5828 |
(f isDirectory) and:[f isReadable] |
|
5829 |
] |
|
5830 |
] |
|
5831 |
] ifFalse:[ |
|
5832 |
RealSystemPath := SystemPath select:[:dirName | |
|
5833 |
|f| |
|
5834 |
||
5835 |
f := dirName asFilename. |
|
5836 |
(f isDirectory) and:[f isReadable] |
|
5837 |
]. |
|
5838 |
RealSystemPath := RealSystemPath collect:[:dirName | |
|
5839 |
|f| |
|
5840 |
||
5841 |
f := dirName asFilename pathName. |
|
5842 |
]. |
|
5843 |
"/ remove duplicates (but keep order) |
|
5844 |
nP := OrderedCollection new. |
|
5845 |
RealSystemPath do:[:p | |
|
5846 |
(nP includes:p) ifFalse:[ |
|
5847 |
nP add:p |
|
5848 |
] |
|
5849 |
]. |
|
5850 |
RealSystemPath := nP. |
|
5851 |
]. |
|
617 | 5852 |
]. |
5853 |
^ RealSystemPath |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5854 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5855 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5856 |
recursiveReadAllAbbreviationsFrom:aDirectory |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5857 |
self recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:15 |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5858 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5859 |
|
7758 | 5860 |
recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:maxLevels |
5861 |
"read all abbreviations from and under aDirectory." |
|
5862 |
||
5863 |
|abbrevStream dir directoryContents| |
|
5864 |
||
5865 |
maxLevels == 0 ifTrue:[ |
|
5866 |
"/ 'Smalltalk [warning]: max directory nesting reached.' infoPrintCR. |
|
10071 | 5867 |
^ self |
5075 | 5868 |
]. |
4957 | 5869 |
|
4458 | 5870 |
dir := aDirectory asFilename. |
5057 | 5871 |
dir exists ifFalse:[^ self]. |
4458 | 5872 |
|
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5873 |
[ |
10071 | 5874 |
abbrevStream := (dir construct:'abbrev.stc') asFilename readStream. |
5875 |
self readAbbreviationsFromStream:abbrevStream. |
|
5876 |
abbrevStream close. |
|
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5877 |
] 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
|
5878 |
|
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5879 |
[ |
10071 | 5880 |
directoryContents := dir directoryContents. |
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5881 |
] on:FileStream openErrorSignal do:[:ex| |
10071 | 5882 |
"non-accessable directory: we are done" |
5883 |
^ self |
|
7085
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5884 |
]. |
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5885 |
|
71d0e451114d
Handle openErrorSignal in preparition for change openErrorSignal
Stefan Vogel <sv@exept.de>
parents:
7054
diff
changeset
|
5886 |
directoryContents do:[:aFilename | |
10071 | 5887 |
|f| |
5888 |
||
5889 |
(#( |
|
5890 |
'doc' |
|
5891 |
'CVS' |
|
5892 |
'bitmaps' |
|
5893 |
'resources' |
|
5894 |
'source' |
|
5895 |
) includes:aFilename) ifFalse:[ |
|
5896 |
f := dir construct:aFilename. |
|
5897 |
f isDirectory ifTrue:[ |
|
5898 |
self recursiveReadAllAbbreviationsFrom:f maxLevels:maxLevels-1 |
|
5899 |
] |
|
5900 |
]. |
|
4458 | 5901 |
]. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5902 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5903 |
|
8952 | 5904 |
resourceDirectoryForPackage:aPackage |
5905 |
"given a packageID, return the path to its resource directory; |
|
5906 |
nil if not found." |
|
5907 |
||
5908 |
|prjDir rsrcDir| |
|
5909 |
||
5910 |
prjDir := self projectDirectoryForPackage:aPackage. |
|
5911 |
||
5912 |
(prjDir notNil |
|
5913 |
and:[(prjDir := prjDir asFilename) exists |
|
5914 |
and:[(rsrcDir := prjDir construct:'resources') exists]]) ifTrue:[ |
|
10071 | 5915 |
^ rsrcDir |
8952 | 5916 |
]. |
8953 | 5917 |
rsrcDir := self getSystemFileName:('resources/' , (aPackage copyReplaceAll:$: with:$/)). |
5918 |
rsrcDir notNil ifTrue:[ |
|
10071 | 5919 |
^ rsrcDir asFilename |
5920 |
]. |
|
5921 |
^ nil |
|
5922 |
||
5923 |
" |
|
5924 |
Smalltalk resourceDirectoryForPackage:'stx:libbasic' |
|
5925 |
Smalltalk resourceDirectoryForPackage:'exept:expecco' |
|
8952 | 5926 |
Smalltalk resourceDirectoryForPackage:'exept:smartcard' |
5927 |
" |
|
5928 |
! |
|
5929 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5930 |
resourceFileStreamFor:aFileName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5931 |
"search aFileName in some standard places; |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5932 |
return a readonly fileStream or nil if not found. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5933 |
Searches in subdirectories named 'resource' in SystemPath" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5934 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5935 |
^ self resourceFileStreamFor:aFileName forClass:nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5936 |
! |
7758 | 5937 |
|
5938 |
resourceFileStreamFor:aFileName forClass:aClassOrNil |
|
5939 |
"search aFileName in some standard places and in the classes |
|
5940 |
package-resource directory. |
|
5941 |
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
|
5942 |
Searches in subdirectories named 'resource' in SystemPath" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5943 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5944 |
|aString| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5945 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5946 |
aString := self getResourceFileName:aFileName forClass:aClassOrNil. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5947 |
aString notNil ifTrue:[ |
10071 | 5948 |
^ aString asFilename readStreamOrNil |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5949 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5950 |
^ nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5951 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5952 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5953 |
searchPath:aPath for:aFileName in:aDirName |
7758 | 5954 |
"search aPath for a subdirectory named aDirectory with a file |
5955 |
named aFileName" |
|
5956 |
||
5957 |
|f| |
|
5958 |
||
10071 | 5959 |
((f := aFileName asFilename) isAbsolute |
7758 | 5960 |
or:[f isExplicitRelative]) ifTrue:[ |
10071 | 5961 |
"/ |
5962 |
"/ dont use path for absolute or explicit .-relative file names |
|
5963 |
"/ |
|
5964 |
^ aFileName |
|
7758 | 5965 |
]. |
5966 |
||
5967 |
aPath notNil ifTrue:[ |
|
10071 | 5968 |
aPath do:[:dirName | |
5969 |
|realName dir| |
|
5970 |
||
5971 |
dir := dirName asFilename. |
|
5972 |
aDirName notNil ifTrue:[ |
|
5973 |
realName := (dir construct:aDirName) construct:aFileName. |
|
5974 |
] ifFalse:[ |
|
5975 |
realName := dir construct:aFileName. |
|
5976 |
]. |
|
5977 |
(realName isReadable) ifTrue:[ |
|
5978 |
^ realName name |
|
5979 |
] |
|
5980 |
]. |
|
7758 | 5981 |
]. |
5982 |
||
5983 |
^ nil. |
|
5984 |
||
5985 |
"Modified: / 29.4.1999 / 15:06:43 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5986 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
5987 |
|
10071 | 5988 |
setFilename:aFileNameString forClass:aClassNameString package:aPackageNameString |
9905
625e0c143984
abbrev conflict check was too harsh
Claus Gittinger <cg@exept.de>
parents:
9838
diff
changeset
|
5989 |
|classNameSymbol oldAbbrev oldPath newPath cls abbrevs| |
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5990 |
|
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5991 |
CachedAbbreviations isNil ifTrue:[ |
10071 | 5992 |
CachedAbbreviations := IdentityDictionary new. |
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5993 |
]. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5994 |
|
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5995 |
abbrevs := CachedAbbreviations. |
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
5996 |
aClassNameString ~= aFileNameString ifTrue:[ |
10071 | 5997 |
classNameSymbol := aClassNameString asSymbol. |
5998 |
oldAbbrev := abbrevs at:classNameSymbol ifAbsent:nil. |
|
5999 |
oldAbbrev notNil ifTrue:[ |
|
6000 |
oldAbbrev ~= aFileNameString ifTrue:[ |
|
6001 |
oldAbbrev asFilename isAbsolute |
|
6002 |
ifTrue:[ oldPath := oldAbbrev ] |
|
6003 |
ifFalse:[ oldPath := (self projectDirectoryForPackage:aPackageNameString) asFilename constructString: oldAbbrev ]. |
|
6004 |
aFileNameString asFilename isAbsolute |
|
6005 |
ifTrue:[ newPath := aFileNameString ] |
|
6006 |
ifFalse:[ newPath := (self projectDirectoryForPackage:aPackageNameString) asFilename constructString: aFileNameString ]. |
|
6007 |
||
6008 |
oldPath ~= newPath ifTrue:[ |
|
6009 |
StandAlone ifFalse:[ |
|
6010 |
('Smalltalk [warning]: autoload path change for: ',aClassNameString,' in package ',aPackageNameString) infoPrintCR. |
|
6011 |
('Smalltalk [info]: old: ',oldPath) infoPrintCR. |
|
6012 |
('Smalltalk [info]: new: ',newPath) infoPrintCR. |
|
6013 |
] |
|
6014 |
] |
|
6015 |
]. |
|
6016 |
"overwrite old abbreviation with new one, |
|
6017 |
to allow fixing of bad abbrev files" |
|
6018 |
]. |
|
6019 |
||
6020 |
cls := self classNamed:aFileNameString. |
|
6021 |
cls notNil ifTrue:[ |
|
6022 |
cls name ~= aClassNameString ifTrue:[ |
|
6023 |
"/ ok, there is a class named after this abbrev ... |
|
6024 |
"/ this is only a conflict, if the other class has no |
|
6025 |
"/ abbreviation (or the same). |
|
6026 |
(abbrevs at:(cls name asSymbol) ifAbsent:cls name) = aFileNameString ifTrue:[ |
|
6027 |
cls isNameSpace ifFalse:[ |
|
6028 |
aPackageNameString = cls package ifTrue:[ |
|
6029 |
StandAlone ifFalse:[ |
|
6030 |
('Smalltalk [warning]: conflict for: ' , cls name , |
|
6031 |
' in package ' , aPackageNameString) infoPrintCR. |
|
6032 |
('Smalltalk [warning]: (' , aClassNameString , ' -> ' , aFileNameString |
|
6033 |
, ')') infoPrintCR |
|
6034 |
] |
|
6035 |
] |
|
6036 |
] |
|
6037 |
] |
|
6038 |
] |
|
6039 |
]. |
|
6040 |
abbrevs at:classNameSymbol put:aFileNameString. |
|
8470
d79e917d4f36
Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents:
8445
diff
changeset
|
6041 |
] |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6042 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6043 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6044 |
sourceDirectoryNameOfClass:aClassOrClassName |
7758 | 6045 |
"for a given class, return the pathname relative to TOP of the classes source code. |
6046 |
Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process) |
|
6047 |
for an entry for aClassOrClassName. |
|
6048 |
Search for the className in the first col, and return the value found in |
|
6049 |
the 3rd col. |
|
6050 |
Return nil if no entry is found." |
|
6051 |
||
6052 |
|aStream line words n aClassName| |
|
6053 |
||
6054 |
aClassOrClassName isBehavior ifTrue:[ |
|
10071 | 6055 |
aClassName := aClassOrClassName name |
7758 | 6056 |
] ifFalse:[ |
10071 | 6057 |
aClassName := aClassOrClassName |
7758 | 6058 |
]. |
6059 |
aClassName := aClassName asString. |
|
6060 |
||
6061 |
#('include/abbrev.stc' 'include/liblist.stc') "/ filenames |
|
6062 |
with:#(3 2) "/ column |
|
6063 |
do:[:fileName :col | |
|
6064 |
||
10071 | 6065 |
aStream := self systemFileStreamFor:fileName. |
6066 |
aStream notNil ifTrue:[ |
|
6067 |
[aStream atEnd] whileFalse:[ |
|
6068 |
line := aStream nextLine. |
|
6069 |
line notNil ifTrue:[ |
|
6070 |
(line startsWith:'#') ifFalse:[ |
|
6071 |
words := line asCollectionOfWords. |
|
6072 |
(n := words size) > 1 ifTrue:[ |
|
6073 |
(words at:1) = aClassName ifTrue:[ |
|
6074 |
n >= col ifTrue:[ |
|
6075 |
aStream close. |
|
6076 |
^ (words at:col) withoutSeparators |
|
6077 |
] |
|
6078 |
] |
|
6079 |
] |
|
6080 |
] |
|
6081 |
] |
|
6082 |
]. |
|
6083 |
aStream close |
|
6084 |
]. |
|
617 | 6085 |
]. |
6086 |
||
6087 |
^ nil |
|
191 | 6088 |
|
6089 |
" |
|
10071 | 6090 |
Smalltalk sourceDirectoryNameOfClass:'ClockView' |
6091 |
Smalltalk sourceDirectoryNameOfClass:'Bag' |
|
6092 |
Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView' |
|
6093 |
Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass' |
|
617 | 6094 |
" |
6095 |
||
6096 |
"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
|
6097 |
"Modified: 9.12.1995 / 23:54:14 / cg" |
2033 | 6098 |
"Modified: 3.1.1997 / 11:26:44 / stefan" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6099 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6100 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6101 |
sourceFileStreamFor:aFileName |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6102 |
"search aFileName in some standard places; |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6103 |
return a readonly fileStream or nil if not found. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6104 |
Searches in subdirectories named 'source' in SystemPath" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6105 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6106 |
|aString| |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6107 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6108 |
aString := self getSourceFileName:aFileName. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6109 |
aString notNil ifTrue:[ |
10071 | 6110 |
^ aString asFilename readStreamOrNil |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6111 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6112 |
^ nil |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6113 |
! |
7758 | 6114 |
|
6115 |
systemFileStreamFor:aFileName |
|
6116 |
"search aFileName in some standard places; |
|
6117 |
return a readonly fileStream or nil if not found. |
|
6118 |
see comment in Smalltalk>>initSystemPath" |
|
6119 |
||
6120 |
|aString| |
|
6121 |
||
6122 |
aString := self getSystemFileName:aFileName. |
|
6123 |
aString notNil ifTrue:[ |
|
10071 | 6124 |
^ aString asFilename readStreamOrNil |
617 | 6125 |
]. |
6126 |
^ nil |
|
6127 |
! |
|
6128 |
||
7758 | 6129 |
systemPath |
6130 |
"return a collection of directorynames, where smalltalk |
|
10071 | 6131 |
looks for system files |
617 | 6132 |
(usually in subdirs such as resources, bitmaps, source etc.) |
6133 |
see comment in Smalltalk>>initSystemPath." |
|
6134 |
||
6135 |
^ SystemPath |
|
6136 |
||
6137 |
" |
|
6138 |
Smalltalk systemPath |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6139 |
Smalltalk systemPath addLast:'someOtherDirectoryPath' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6140 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6141 |
! |
617 | 6142 |
|
7758 | 6143 |
systemPath:aPath |
6144 |
"set the collection of directorynames, where smalltalk |
|
10071 | 6145 |
looks for system files |
7758 | 6146 |
(usually in subdirs such as resources, bitmaps, source etc.) |
6147 |
see comment in Smalltalk>>initSystemPath." |
|
6148 |
||
6149 |
SystemPath := aPath. |
|
6150 |
self flushPathCaches |
|
6151 |
||
6152 |
" |
|
6153 |
Smalltalk systemPath |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6154 |
Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath') |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6155 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6156 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6157 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6158 |
!Smalltalk class methodsFor:'system management-packages'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6159 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6160 |
knownPackages |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6161 |
^ KnownPackages ? #() |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6162 |
! |
7758 | 6163 |
|
6164 |
loadExtensionsForPackage:aPackageId |
|
9600 | 6165 |
|mgr packageDirName inStream| |
6166 |
||
10411
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6167 |
packageDirName := aPackageId copyReplaceAll:$: with:$/. |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6168 |
packageDirName := self getPackageFileName:packageDirName. |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6169 |
|
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6170 |
(packageDirName notNil and:[Class tryLocalSourceFirst]) ifTrue:[ |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6171 |
(self loadExtensionsFromDirectory:packageDirName) ifTrue:[ |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6172 |
^ true. |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6173 |
]. |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6174 |
packageDirName := nil. "do not try again" |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6175 |
]. |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6176 |
|
9600 | 6177 |
" |
6178 |
if there is a sourceCodeManager, ask it first for the extensions |
|
6179 |
" |
|
10411
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6180 |
mgr := Smalltalk at:#SourceCodeManager. |
afaedcfe3488
Load extensions from local sources, if Class>>#tryLocalSourcesFirst == true
Stefan Vogel <sv@exept.de>
parents:
10400
diff
changeset
|
6181 |
mgr notNil ifTrue:[ |
10391
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6182 |
SourceCodeManagerError handle:[:ex | |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6183 |
] do:[ |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6184 |
inStream := mgr getMostRecentSourceStreamForFile:'extensions.st' inPackage:aPackageId. |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6185 |
]. |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6186 |
inStream notNil ifTrue:[ |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6187 |
Class withoutUpdatingChangeSetDo:[ |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6188 |
inStream fileIn. |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6189 |
]. |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6190 |
inStream close. |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6191 |
SilentLoading ifFalse:[ |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6192 |
Transcript showCR:('loaded extensions for ',aPackageId,' from repository'). |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6193 |
]. |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6194 |
^ true |
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6195 |
] |
9600 | 6196 |
]. |
7758 | 6197 |
|
9600 | 6198 |
packageDirName notNil ifTrue:[ |
10391
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6199 |
^ self loadExtensionsFromDirectory:packageDirName |
9600 | 6200 |
]. |
6201 |
^ false |
|
10391
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6202 |
|
e605d4fbfdea
care for sourceCodeManager errors (no cvs-connection) when
Claus Gittinger <cg@exept.de>
parents:
10383
diff
changeset
|
6203 |
"Modified: / 18-02-2007 / 11:03:26 / cg" |
7758 | 6204 |
! |
6205 |
||
6206 |
loadExtensionsFromDirectory:packageDirOrString |
|
6207 |
|packageDir f| |
|
6208 |
||
6209 |
packageDir := packageDirOrString asFilename. |
|
6210 |
||
6211 |
f := packageDir construct:'extensions.st'. |
|
6212 |
f exists ifTrue:[ |
|
10071 | 6213 |
Class withoutUpdatingChangeSetDo:[ |
6214 |
f fileIn. |
|
6215 |
]. |
|
6216 |
SilentLoading ifFalse:[ |
|
6217 |
Transcript showCR:('loaded extensions: ' , f pathName). |
|
6218 |
]. |
|
6219 |
^ true |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6220 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6221 |
^ false |
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 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6224 |
loadPackage:aPackageIdOrPackage |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6225 |
"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
|
6226 |
Experimental." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6227 |
|
10046 | 6228 |
(aPackageIdOrPackage isString) ifTrue:[ |
10071 | 6229 |
^ self loadPackageWithId:aPackageIdOrPackage asAutoloaded:false |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6230 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6231 |
self shouldImplement. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6232 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6233 |
" |
10071 | 6234 |
Smalltalk loadPackage:'stx:libbasic' |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6235 |
Smalltalk loadPackage:'stx:goodies/persistency' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6236 |
Smalltalk loadPackage:'cg:cparser' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6237 |
Smalltalk loadPackage:'cg:rose' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6238 |
" |
7758 | 6239 |
! |
6240 |
||
6241 |
loadPackage:packageId fromAllSourceFilesInDirectory:aDirectory |
|
6242 |
"load all source files found in aDirectory and treat them like |
|
6243 |
a package. Allows for initial import of alien ST-code as a new package. |
|
6244 |
Experimental." |
|
6245 |
||
9028 | 6246 |
|p t new anyFail repeatCount| |
7758 | 6247 |
|
6248 |
"/ problem: dependencies. |
|
6249 |
"/ solution: repeat twice, so that superclasses are present the second time |
|
6250 |
||
6251 |
Class packageQuerySignal answer:packageId asSymbol do:[ |
|
10071 | 6252 |
|any| |
6253 |
||
6254 |
repeatCount := 0. |
|
6255 |
[ |
|
6256 |
repeatCount := repeatCount + 1. |
|
6257 |
anyFail := false. |
|
6258 |
aDirectory directoryContents do:[:file | |
|
6259 |
|fn| |
|
6260 |
||
6261 |
fn := aDirectory construct:file. |
|
6262 |
(fn hasSuffix:'st') ifTrue:[ |
|
6263 |
Metaclass confirmationQuerySignal answer:false |
|
6264 |
do:[ |
|
6265 |
Error |
|
6266 |
handle:[:ex | |
|
6267 |
anyFail := true |
|
6268 |
] |
|
6269 |
do:[ |
|
6270 |
(self fileIn:fn) ifFalse:[ |
|
6271 |
anyFail := true |
|
6272 |
] ifTrue:[ |
|
6273 |
any := true. |
|
6274 |
] |
|
6275 |
] |
|
6276 |
] |
|
6277 |
] |
|
6278 |
]. |
|
6279 |
any ifFalse:[ |
|
6280 |
^ false "/ no file found |
|
6281 |
] |
|
6282 |
] doWhile:[anyFail and:[repeatCount<2]]. |
|
6283 |
]. |
|
6284 |
||
4718 | 6285 |
new := (p := Project projectWithId:packageId) isNil. |
6286 |
new ifTrue:[ p := Project new]. |
|
6287 |
||
6288 |
p name:packageId. |
|
6289 |
p directory:aDirectory. |
|
4726 | 6290 |
p package:packageId. |
4718 | 6291 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
6292 |
p repositoryModule:(t first). |
|
6293 |
p repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
6294 |
p isLoaded:true. |
|
6295 |
||
6296 |
new ifTrue:[Project addLoadedProject:p]. |
|
6297 |
^ anyFail not |
|
8583
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 |
loadPackage:packageId fromClassLibrary:aFilename |
7758 | 6301 |
"load a package from a compiled classLib. |
6302 |
Experimental." |
|
6303 |
||
6304 |
|p t new| |
|
6305 |
||
6306 |
(self fileIn:aFilename) ifFalse:[ |
|
10071 | 6307 |
(self fileInClassLibrary:aFilename) ifFalse:[ |
6308 |
self warn:'Failed to load the package ', packageId printString. |
|
6309 |
^ false. |
|
6310 |
] |
|
7758 | 6311 |
]. |
6312 |
||
6313 |
new := (p := Project projectWithId:packageId) isNil. |
|
6314 |
new ifTrue:[ p := Project new]. |
|
6315 |
||
6316 |
p name:packageId. |
|
6317 |
p directory:aFilename directory. |
|
6318 |
p package:packageId. |
|
6319 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
|
6320 |
p repositoryModule:(t first). |
|
6321 |
p repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
6322 |
p isLoaded:true. |
|
4723 | 6323 |
|
6324 |
new ifTrue:[Project addLoadedProject:p]. |
|
6325 |
^ true |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6326 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6327 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6328 |
loadPackage:packageId fromLoadAllFile:aFilename |
7758 | 6329 |
"load a package from a loadAll - loader script. |
6330 |
Experimental." |
|
6331 |
||
6332 |
|p t new| |
|
6333 |
||
6334 |
Metaclass confirmationQuerySignal answer:false |
|
6335 |
do:[ |
|
10071 | 6336 |
(self fileIn:aFilename) ifFalse:[ |
6337 |
self warn:'Failed to load the package ', packageId printString. |
|
6338 |
^ false. |
|
6339 |
] |
|
7758 | 6340 |
]. |
6341 |
||
6342 |
new := (p := Project projectWithId:packageId) isNil. |
|
6343 |
new ifTrue:[ p := Project new]. |
|
6344 |
||
6345 |
p name:packageId. |
|
6346 |
p directory:aFilename directory. |
|
6347 |
p package:packageId. |
|
6348 |
t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'. |
|
6349 |
p repositoryModule:(t first). |
|
6350 |
p repositoryDirectory:(packageId copyFrom:t first size + 2). |
|
6351 |
p isLoaded:true. |
|
6352 |
||
6353 |
new ifTrue:[Project addLoadedProject:p]. |
|
6354 |
^ true |
|
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 |
loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6358 |
"load a package from a .zip delivery file. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6359 |
Experimental." |
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 |
"/ not yet implemented ... |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6362 |
^ false |
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 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6365 |
loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded |
8378 | 6366 |
|abbrevFile packageDir| |
6367 |
||
6368 |
packageDir := self packageDirectoryForPackageId:aPackageId. |
|
8380 | 6369 |
packageDir isNil ifTrue:[^ false]. |
8378 | 6370 |
|
6371 |
"/ abbrev.stc ? |
|
6372 |
abbrevFile := packageDir construct:'abbrev.stc'. |
|
6373 |
abbrevFile exists ifFalse:[^ false]. |
|
6374 |
||
6375 |
Smalltalk installAutoloadedClassesFrom:abbrevFile pathName. |
|
6376 |
||
6377 |
doLoadAsAutoloaded ifFalse:[ |
|
10071 | 6378 |
"/ force autoloading... |
6379 |
Smalltalk allClassesInPackage:aPackageId do:[:eachClass | eachClass autoload]. |
|
8378 | 6380 |
]. |
6381 |
||
6382 |
self loadExtensionsFromDirectory:packageDir. |
|
6383 |
SilentLoading ifFalse:[ |
|
10071 | 6384 |
Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName). |
8378 | 6385 |
]. |
6386 |
^ true |
|
9506 | 6387 |
|
6388 |
"Modified: / 10-08-2006 / 12:17:57 / cg" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6389 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6390 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6391 |
loadPackageWithId:aPackageId |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6392 |
"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
|
6393 |
Experimental." |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6394 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6395 |
^ self loadPackageWithId:aPackageId asAutoloaded:false |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6396 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6397 |
" |
10071 | 6398 |
Smalltalk loadPackageWithId:'stx:libbasic' |
7758 | 6399 |
Smalltalk loadPackageWithId:'stx:goodies/persistency' |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6400 |
Smalltalk loadPackageWithId:'cg:cparser' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6401 |
Smalltalk loadPackageWithId:'cg:rose' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6402 |
Smalltalk loadPackageWithId:'detemobil:smc' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6403 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6404 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6405 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6406 |
loadPackageWithId:aPackageId asAutoloaded:doLoadAsAutoloaded |
7758 | 6407 |
"make certain, that some particular package is loaded into the system. |
6408 |
Experimental." |
|
6409 |
||
10236 | 6410 |
|packageDir| |
10235
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6411 |
|
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6412 |
packageDir := self packageDirectoryForPackageId:aPackageId. |
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6413 |
packageDir isNil ifTrue:[ |
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6414 |
(aPackageId includes:$:) ifFalse:[ |
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6415 |
"/ assume stx |
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6416 |
packageDir := self packageDirectoryForPackageId:('stx:',aPackageId). |
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6417 |
]. |
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6418 |
]. |
d75bd16feaef
when loading, try library first, then the packagedefinition
Claus Gittinger <cg@exept.de>
parents:
10231
diff
changeset
|
6419 |
|
10236 | 6420 |
^ self |
6421 |
loadPackageWithId:aPackageId |
|
6422 |
fromDirectory:packageDir |
|
6423 |
asAutoloaded:doLoadAsAutoloaded. |
|
10071 | 6424 |
|
6425 |
" |
|
6426 |
Smalltalk loadPackageWithId:'stx:libbasic' |
|
5051
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6427 |
Smalltalk loadPackageWithId:'stx:goodies/persistency' |
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6428 |
Smalltalk loadPackageWithId:'exept:ctypes' |
81d5b5985154
package search fixed/improved
Claus Gittinger <cg@exept.de>
parents:
5047
diff
changeset
|
6429 |
" |
10186 | 6430 |
|
10236 | 6431 |
"Modified: / 07-12-2006 / 15:04:39 / cg" |
6432 |
! |
|
6433 |
||
6434 |
loadPackageWithId:aPackageId fromDirectory:packageDirOrStringOrNil asAutoloaded:doLoadAsAutoloaded |
|
10367
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6435 |
"load a package referenced by aPackageId - a string like 'stx:libbasic'. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6436 |
The package is either located in packageDirOrStringOrNil, or in the current directory" |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6437 |
|
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6438 |
|packageDir packageName shLibName filename |
10400 | 6439 |
projectDefinitionClass projectDefinitionClassName silent somethingHasBeenLoaded| |
7758 | 6440 |
|
10236 | 6441 |
packageDirOrStringOrNil notNil ifTrue:[ |
6442 |
packageDir := packageDirOrStringOrNil asFilename. |
|
6443 |
]. |
|
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
6444 |
silent := SilentLoading or:[ StandAlone ]. |
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
6445 |
|
10367
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6446 |
"For now: have to read the project definition first!! |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6447 |
The class library may contain subclasses of classes in prerequisite packages - |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6448 |
so the prerequisite packages have to be loaded first" |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6449 |
|
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6450 |
"normally there is a project definiton, use that one to pull in the rest" |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6451 |
|
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6452 |
"maybe, it is already in the image - autoloaded" |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6453 |
projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageId. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6454 |
|
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6455 |
"if not, file it in ..." |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6456 |
(projectDefinitionClass isNil and:[packageDir notNil]) ifTrue:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6457 |
projectDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageId. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6458 |
"/ try to load the project definition class |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6459 |
filename := (packageDir construct:projectDefinitionClassName) withSuffix:'st'. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6460 |
filename exists ifFalse:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6461 |
filename := ((packageDir construct:'source') construct:projectDefinitionClassName) withSuffix:'st'. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6462 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6463 |
filename exists ifTrue:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6464 |
Class withoutUpdatingChangesDo:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6465 |
filename fileIn. |
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
6466 |
]. |
10367
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6467 |
projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageId. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6468 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6469 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6470 |
|
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6471 |
projectDefinitionClass notNil ifTrue:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6472 |
projectDefinitionClass autoload. |
10400 | 6473 |
somethingHasBeenLoaded := projectDefinitionClass loadAsAutoloaded:doLoadAsAutoloaded. |
6474 |
(silent not and:[somethingHasBeenLoaded]) ifTrue:[ |
|
10202 | 6475 |
Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageId , ' from project definition'). |
6476 |
]. |
|
6477 |
^ true. |
|
10046 | 6478 |
]. |
6479 |
||
10367
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6480 |
"Is there a shared library (.dll or .so) ?" |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6481 |
shLibName := aPackageId asPackageId libraryName , ObjectFileLoader sharedLibraryExtension. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6482 |
|
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6483 |
filename := Filename currentDirectory construct:shLibName. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6484 |
filename exists ifFalse:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6485 |
packageDir notNil ifTrue:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6486 |
filename := packageDir construct:shLibName. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6487 |
filename exists ifFalse:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6488 |
filename := (packageDir construct:'objbc') construct:shLibName. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6489 |
] |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6490 |
] |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6491 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6492 |
filename exists ifTrue:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6493 |
(self loadPackage:aPackageId fromClassLibrary:filename) ifTrue:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6494 |
silent ifFalse:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6495 |
Transcript showCR:('loaded package: ' , aPackageId , ' from binary classLib file: ' , filename pathName). |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6496 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6497 |
doLoadAsAutoloaded ifFalse:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6498 |
"/ force autoloading... |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6499 |
Smalltalk allClassesDo:[:eachClass | |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6500 |
eachClass package == aPackageId ifTrue:[eachClass autoload]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6501 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6502 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6503 |
^ true |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6504 |
] |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6505 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6506 |
|
10236 | 6507 |
packageDir isNil ifTrue:[ |
6508 |
^ false. |
|
6509 |
]. |
|
6510 |
||
10071 | 6511 |
|
6512 |
"/ loadAll ? - well be soon obsolete |
|
10367
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6513 |
filename := packageDir construct:'loadAll'. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6514 |
filename exists ifFalse:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6515 |
filename := packageDir construct:'loadall'. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6516 |
]. |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6517 |
filename exists ifTrue:[ |
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6518 |
(self loadPackage:aPackageId fromLoadAllFile:filename) ifTrue:[ |
10221
f3a3ccfa9a47
when loading a package, try dll first.
Claus Gittinger <cg@exept.de>
parents:
10219
diff
changeset
|
6519 |
silent ifFalse:[ |
10367
2228ee94e567
Changed to read project definition files *before* class libraries,
Stefan Vogel <sv@exept.de>
parents:
10355
diff
changeset
|
6520 |
Transcript showCR:('loaded package: ' , aPackageId , ' from loadAll file: ' , filename pathName). |
10202 | 6521 |
]. |
6522 |
^ true |
|
6523 |
] |
|
7758 | 6524 |
]. |
10046 | 6525 |
|
6526 |
packageName := packageDir baseName. |
|
6527 |
||
10237 | 6528 |
"/ zip-file loading no longer supported |
6529 |
"/ "/ .zip ? |
|
6530 |
"/ f := (packageDir construct:packageName) withSuffix:'zip'. |
|
6531 |
"/ f exists ifTrue:[ |
|
6532 |
"/ (self loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded) ifTrue:[ |
|
6533 |
"/ silent ifFalse:[ |
|
6534 |
"/ Transcript showCR:('loaded package: ' , aPackageId , ' from zip file: ' , f pathName). |
|
6535 |
"/ ]. |
|
6536 |
"/ ^ true |
|
6537 |
"/ ] |
|
6538 |
"/ ]. |
|
6539 |
||
6540 |
"/ abbrev-file loading no longer supported |
|
6541 |
"/ "/ abbrev.stc ? |
|
6542 |
"/ (self loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded) ifTrue:[ |
|
6543 |
"/ ^ true |
|
6544 |
"/ ]. |
|
6545 |
||
6546 |
"/ any .so-file loading no longer supported |
|
6547 |
"/ "/ any .so ? -> load the first one found (maybe not a good idea) |
|
6548 |
"/ packageDir directoryContentsAsFilenamesDo:[:aFilename | |
|
6549 |
"/ (aFilename hasSuffix:ObjectFileLoader sharedLibrarySuffix) ifTrue:[ |
|
6550 |
"/ (self loadPackage:aPackageId fromClassLibrary:aFilename) ifTrue:[ |
|
6551 |
"/ silent ifFalse:[ |
|
6552 |
"/ Transcript showCR:('loaded package: ' , aPackageId , ' from binary classLib file: ' , aFilename pathName). |
|
6553 |
"/ ]. |
|
6554 |
"/ doLoadAsAutoloaded ifFalse:[ |
|
6555 |
"/ "/ force autoloading... |
|
6556 |
"/ Smalltalk allClassesDo:[:eachClass | |
|
6557 |
"/ eachClass package == aPackageId ifTrue:[ eachClass autoload]. |
|
6558 |
"/ ]. |
|
6559 |
"/ ]. |
|
6560 |
"/ ^ true |
|
6561 |
"/ ] |
|
6562 |
"/ ] |
|
6563 |
"/ ]. |
|
6564 |
||
6565 |
"/ source files-file loading no longer supported |
|
6566 |
"/ "/ source files |
|
6567 |
"/ (self loadPackage:aPackageId fromAllSourceFilesInDirectory:packageDir) ifTrue:[ |
|
6568 |
"/ silent ifFalse:[ |
|
6569 |
"/ Transcript showCR:('loaded package: ' , aPackageId , ' from source files in:' , packageDir pathName). |
|
6570 |
"/ ]. |
|
6571 |
"/ ^ true |
|
6572 |
"/ ]. |
|
10355
b1cb807fd03c
Make sure, that #silentLoading does not return nil
Stefan Vogel <sv@exept.de>
parents:
10329
diff
changeset
|
6573 |
|
4737 | 6574 |
^ false |
6575 |
||
4718 | 6576 |
" |
10071 | 6577 |
Smalltalk loadPackageWithId:'stx:libbasic' |
4718 | 6578 |
Smalltalk loadPackageWithId:'stx:goodies/persistency' |
4722 | 6579 |
Smalltalk loadPackageWithId:'exept:ctypes' |
4718 | 6580 |
" |
9819
39b29e0666bf
load from projectDefinition. if there is one
Claus Gittinger <cg@exept.de>
parents:
9805
diff
changeset
|
6581 |
|
10237 | 6582 |
"Modified: / 07-12-2006 / 15:08:24 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6583 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6584 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6585 |
packageDirectoryForPackageId:aPackageId |
8378 | 6586 |
|packageDirName packageDir| |
6587 |
||
6588 |
packageDirName := aPackageId copyReplaceAll:$: with:$/. |
|
6589 |
||
6590 |
packageDir := self getPackageFileName:packageDirName. |
|
6591 |
packageDir isNil ifTrue:[ |
|
10071 | 6592 |
"/ for convenience: try ../../.. as well |
6593 |
"/ (when executing in thedevelopment environment) |
|
6594 |
packageDir := '../../..' asFilename construct:packageDirName. |
|
6595 |
packageDir exists ifFalse:[ ^ nil]. |
|
8379 | 6596 |
]. |
6597 |
^ packageDir asFilename |
|
8378 | 6598 |
|
6599 |
" |
|
10071 | 6600 |
Smalltalk packageDirectoryForPackageId:'stx:libbasic' |
8378 | 6601 |
Smalltalk packageDirectoryForPackageId:'stx:goodies/persistency' |
6602 |
Smalltalk packageDirectoryForPackageId:'exept:ctypes' |
|
6603 |
" |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6604 |
! ! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6605 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6606 |
!Smalltalk class methodsFor:'system management-undeclared variables'! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6607 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6608 |
clearUndeclaredVariables |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6609 |
"remove all undeclared variables" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6610 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6611 |
(Smalltalk at:#Undeclared) do:[:eachKey | |
10071 | 6612 |
Smalltalk removeKey:(self undeclaredPrefix , eachKey) asSymbol. |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6613 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6614 |
(Smalltalk at:#Undeclared) removeAll. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6615 |
Smalltalk removeKey:#Undeclared. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6616 |
! |
7758 | 6617 |
|
6618 |
undeclaredPrefix |
|
7563 | 6619 |
"the prefix used for undeclared variables" |
6620 |
||
6621 |
^ 'Undeclared:::' |
|
6711 | 6622 |
|
6623 |
"Created: / 31.10.1997 / 01:13:10 / cg" |
|
7758 | 6624 |
! ! |
6625 |
||
6626 |
!Smalltalk class methodsFor:'time-versions'! |
|
6627 |
||
6628 |
configuration |
|
6629 |
"{ Pragma: +optSpace }" |
|
6630 |
||
6631 |
"for developers only: return the configuration, with which |
|
6632 |
this smalltalk was compiled." |
|
6633 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6634 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6635 |
extern char *__getConfigurationString(); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6636 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6637 |
RETURN (__MKSTRING(__getConfigurationString() COMMA_SND)); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6638 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6639 |
^ 'unknownOS/unknownCONF:unknownPACK' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6640 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6641 |
" |
10071 | 6642 |
Smalltalk configuration |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6643 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6644 |
! |
453 | 6645 |
|
7758 | 6646 |
copyrightString |
6647 |
"{ Pragma: +optSpace }" |
|
6648 |
||
6649 |
"return a copyright string" |
|
6650 |
||
6651 |
%{ /* NOCONTEXT */ |
|
6652 |
#ifndef __getCopyrightString |
|
6653 |
extern OBJ __getCopyrightString(); |
|
6654 |
#endif |
|
6655 |
||
6656 |
RETURN (__getCopyrightString()); |
|
6657 |
%}. |
|
6658 |
^ self primitiveFailed |
|
6659 |
||
6660 |
" |
|
6661 |
Smalltalk copyrightString |
|
6662 |
" |
|
6663 |
! |
|
6664 |
||
6665 |
distributorString |
|
6666 |
"{ Pragma: +optSpace }" |
|
7563 | 6667 |
|
6668 |
"return a string describing the distributor of this software" |
|
567 | 6669 |
|
6670 |
%{ /* NOCONTEXT */ |
|
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
6671 |
#ifndef __getDistributorString |
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
6672 |
extern OBJ __getDistributorString(); |
568 | 6673 |
#endif |
6674 |
||
829
fc386319f41c
removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents:
822
diff
changeset
|
6675 |
RETURN (__getDistributorString()); |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6676 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6677 |
^ 'eXept Software AG, Germany' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6678 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6679 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6680 |
Smalltalk distributorString |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6681 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6682 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6683 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6684 |
expirationTime |
7758 | 6685 |
"{ Pragma: +optSpace }" |
6686 |
||
6687 |
"for developers only: return the time when the system will expire. |
|
6688 |
after this time it will not run any longer. |
|
6689 |
It returns nil, if no expiration time has been set (system runs forever :-))" |
|
6690 |
||
6691 |
|exp| |
|
6692 |
||
10071 | 6693 |
%{ |
7758 | 6694 |
extern unsigned int __getExpirationTime(); |
6695 |
||
6696 |
exp = __MKUINT(__getExpirationTime()); |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6697 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6698 |
exp == 0 ifTrue:[ |
10071 | 6699 |
^ nil |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6700 |
]. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6701 |
^ 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
|
6702 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6703 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6704 |
Smalltalk expirationTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6705 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6706 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6707 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6708 |
fullVersionString |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6709 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6710 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6711 |
"return a full version string" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6712 |
|
10071 | 6713 |
^ 'Smalltalk/X release ' , self versionString , ' of ' , self versionDate |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6714 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6715 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6716 |
Smalltalk fullVersionString |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6717 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6718 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6719 |
"Created: / 27.10.1997 / 17:03:09 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6720 |
"Modified: / 27.10.1997 / 17:04:02 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6721 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6722 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6723 |
hello |
7758 | 6724 |
"{ Pragma: +optSpace }" |
6725 |
||
6726 |
"return a greeting string" |
|
6727 |
||
6728 |
"stupid: this should come from a resource file ... |
|
6729 |
but I dont use it here, to allow mini-systems without |
|
6730 |
Resource-stuff." |
|
6731 |
||
6732 |
|proto lang| |
|
6733 |
||
6734 |
lang := Language. |
|
6735 |
(lang == #de) ifTrue:[ |
|
10071 | 6736 |
proto := 'Willkommen bei %1 (Version %2 von %3)' |
7758 | 6737 |
] ifFalse:[ (lang == #fr) ifTrue:[ |
10071 | 6738 |
proto := 'Salut, Bienvenue à %1 (version %2 de %3)' |
7758 | 6739 |
] ifFalse:[ (lang == #it) ifTrue:[ |
10071 | 6740 |
proto := 'Ciao, benvenuto al %1 (versione %2 di %3)' |
7758 | 6741 |
] ifFalse:[ (lang == #es) ifTrue:[ |
8084
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
6742 |
"/ proto := 'Hola, bienvenida a %1 (versión %2 de %3)' |
5641 | 6743 |
] ifFalse:[ (lang == #es) ifTrue:[ |
8084
88bccdc5943d
fileNameForClass (when checking in): repl. colons by underlines
Claus Gittinger <cg@exept.de>
parents:
7999
diff
changeset
|
6744 |
"/ proto := 'Oi, benvindo a %1 (versão %2 de %3)' |
5641 | 6745 |
] ifFalse:[ (lang == #no) ifTrue:[ |
10071 | 6746 |
proto := 'Hei, verdenmottakelse til %1 (versjon %2 av %3)' |
5641 | 6747 |
]]]]]]. |
1307 | 6748 |
|
6749 |
"/ ... more needed here ... |
|
6750 |
||
6751 |
proto isNil ifTrue:[ |
|
10071 | 6752 |
proto := 'Hello World - here is %1 version %2 of %3'. |
453 | 6753 |
]. |
1307 | 6754 |
|
6187 | 6755 |
^ proto bindWith:('SmallTalk/X' allBold) |
10071 | 6756 |
with:(self versionString) |
6757 |
with:(self versionDate) |
|
6758 |
||
6759 |
" |
|
6760 |
Smalltalk language:#us. |
|
6761 |
Smalltalk hello |
|
6762 |
||
6763 |
Smalltalk language:#de. |
|
6764 |
Smalltalk hello |
|
6765 |
||
6766 |
Smalltalk language:#no. |
|
6767 |
Smalltalk hello |
|
5641 | 6768 |
|
1422 | 6769 |
Transcript showCR:(Smalltalk hello) |
6770 |
Stdout showCR:(Smalltalk hello) |
|
453 | 6771 |
" |
1307 | 6772 |
|
1412 | 6773 |
"Modified: 18.5.1996 / 14:25:13 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6774 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6775 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6776 |
imageRestartTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6777 |
"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
|
6778 |
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
|
6779 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6780 |
^ ImageRestartTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6781 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6782 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6783 |
Smalltalk imageStartTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6784 |
Smalltalk imageRestartTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6785 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6786 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6787 |
"Created: 13.12.1995 / 17:44:20 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6788 |
"Modified: 6.3.1996 / 11:56:35 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6789 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6790 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6791 |
imageSaveTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6792 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6793 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6794 |
"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
|
6795 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6796 |
^ ObjectMemory imageSaveTime |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6797 |
! |
7758 | 6798 |
|
6799 |
imageStartTime |
|
6800 |
"{ Pragma: +optSpace }" |
|
6801 |
||
6802 |
"return a timestamp for the moment when this system started the first time |
|
6803 |
(i.e. the first initial start without an image)" |
|
6804 |
||
6805 |
^ ImageStartTime |
|
6806 |
||
6807 |
" |
|
6808 |
Smalltalk imageStartTime |
|
6809 |
Smalltalk imageRestartTime |
|
6810 |
" |
|
6811 |
||
6812 |
"Created: 13.12.1995 / 17:44:14 / cg" |
|
6813 |
"Modified: 13.12.1995 / 17:45:47 / cg" |
|
6814 |
! |
|
6815 |
||
6816 |
majorVersionNr |
|
6817 |
"{ Pragma: +optSpace }" |
|
7563 | 6818 |
|
6819 |
"return the major version number. |
|
617 | 6820 |
This is only incremented for very fundamental changes, |
6821 |
which make old object files totally incompatible |
|
6822 |
(for example, if the layout/representation of fundamental |
|
3382 | 6823 |
classes changes). |
6824 |
||
3988 | 6825 |
ST/X revision Naming is: |
10071 | 6826 |
<major>.<minor>.<revision>.<release>" |
7362
1af5f648cdb2
major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents:
7348
diff
changeset
|
6827 |
|
1af5f648cdb2
major version bumb (due to class-layout change)
Claus Gittinger <cg@exept.de>
parents:
7348
diff
changeset
|
6828 |
^ 5 |
617 | 6829 |
|
6830 |
" |
|
6831 |
Smalltalk majorVersionNr |
|
6832 |
" |
|
1941
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
6833 |
|
51332fe23542
bumped version to 3 (I guess, nameSpaces are a major step)
Claus Gittinger <cg@exept.de>
parents:
1917
diff
changeset
|
6834 |
"Modified: 8.11.1996 / 19:59:21 / cg" |
617 | 6835 |
! |
6836 |
||
7758 | 6837 |
minorVersionNr |
6838 |
"{ Pragma: +optSpace }" |
|
6839 |
||
6840 |
"return the minor version number. |
|
6841 |
This is incremented for changes which make some old object |
|
6842 |
files incompatible, or the protocol changes such that some |
|
6843 |
classes need rework. |
|
6844 |
||
6845 |
ST/X revision Naming is: |
|
10071 | 6846 |
<major>.<minor>.<revision>.<release>" |
7981 | 6847 |
|
9531 | 6848 |
^ 3 |
7758 | 6849 |
|
6850 |
" |
|
6851 |
Smalltalk minorVersionNr |
|
6852 |
" |
|
6853 |
||
9531 | 6854 |
"Modified: / 16-08-2006 / 09:37:25 / cg" |
7758 | 6855 |
! |
6856 |
||
6857 |
releaseIdentification |
|
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6858 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6859 |
|
10071 | 6860 |
"for developers only: return the release |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6861 |
(to further identify the version in case of errors)" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6862 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6863 |
%{ /* NOCONTEXT */ |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6864 |
extern OBJ __getRel(); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6865 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6866 |
RETURN (__getRel()); |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6867 |
%}. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6868 |
^ 'ST/X_experimental' |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6869 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6870 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6871 |
Smalltalk releaseIdentification |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6872 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6873 |
! |
7758 | 6874 |
|
6875 |
releaseNr |
|
7563 | 6876 |
"{ Pragma: +optSpace }" |
6877 |
||
6878 |
"return the revision number. |
|
7758 | 6879 |
Incremented for releases which fix bugs/add features but did not find |
6880 |
their way to the outside world. |
|
3988 | 6881 |
|
6882 |
ST/X revision Naming is: |
|
10126 | 6883 |
<major>.<minor>.<revision>.<release>" |
6884 |
||
10383 | 6885 |
^ 1 |
617 | 6886 |
|
10071 | 6887 |
" |
6888 |
Smalltalk releaseNr |
|
617 | 6889 |
" |
732
29a49feab799
release bump - that seems to be a good one
Claus Gittinger <cg@exept.de>
parents:
728
diff
changeset
|
6890 |
|
10065 | 6891 |
"Created: / 10-12-1995 / 01:42:19 / cg" |
10383 | 6892 |
"Modified: / 10-02-2007 / 14:49:51 / cg" |
617 | 6893 |
! |
6894 |
||
7758 | 6895 |
revisionNr |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6896 |
"{ Pragma: +optSpace }" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6897 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6898 |
"return the revision number. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6899 |
Incremented for releases which fix bugs/add features |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6900 |
and represent a stable workable version which got published |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6901 |
to the outside world. |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6902 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6903 |
ST/X revision Naming is: |
10125 | 6904 |
<major>.<minor>.<revision>.<release>" |
6905 |
||
10422 | 6906 |
^ 5 |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6907 |
|
10071 | 6908 |
" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6909 |
Smalltalk revisionNr |
10071 | 6910 |
Smalltalk hello |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6911 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6912 |
|
10422 | 6913 |
"Modified: / 28-02-2007 / 23:43:51 / cg" |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6914 |
! |
617 | 6915 |
|
7758 | 6916 |
timeStamp |
6917 |
"return a string useful for timestamping a file. |
|
6918 |
The returned string is padded with spaces for a constant |
|
6919 |
length (to avoid changing a files size in fileOut with unchanged |
|
6920 |
class)." |
|
6921 |
||
6922 |
^ ('''' , self timeStampString , '''') paddedTo:80 with:(Character space) |
|
6923 |
! |
|
6924 |
||
6925 |
timeStamp:aStream |
|
6926 |
"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
|
6927 |
ST80 compatibility" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6928 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6929 |
aStream nextPutAll:(self timeStamp). |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6930 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6931 |
"Created: / 18.6.1998 / 17:22:58 / cg" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6932 |
! |
7758 | 6933 |
|
6934 |
timeStampString |
|
6935 |
"return a string useful for timestamping a file." |
|
6936 |
||
7962 | 6937 |
|dateString| |
6938 |
||
8115 | 6939 |
dateString := String streamContents:[:s | Date today printOn:s language:#en]. "/ MUST be english !!!! |
7962 | 6940 |
|
7758 | 6941 |
^ ('From Smalltalk/X, Version:' , (Smalltalk versionString) , ' on ' |
7962 | 6942 |
, dateString , ' at ' , Time now printString |
7758 | 6943 |
) |
6944 |
! |
|
6945 |
||
6946 |
versionDate |
|
6947 |
"{ Pragma: +optSpace }" |
|
6948 |
||
6949 |
"return the executables build date - thats the date when the smalltalk |
|
6950 |
executable was built" |
|
6951 |
||
6952 |
%{ /* NOCONTEXT */ |
|
6953 |
extern char *__getBuildDateString(); |
|
6954 |
||
6955 |
RETURN (__MKSTRING(__getBuildDateString() COMMA_SND) ); |
|
6956 |
%}. |
|
6957 |
^ 'today' |
|
6958 |
||
6959 |
" |
|
10071 | 6960 |
Smalltalk versionDate |
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6961 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6962 |
! |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6963 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6964 |
versionString |
7758 | 6965 |
"{ Pragma: +optSpace }" |
6966 |
||
8583
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6967 |
"return the version string" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6968 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6969 |
^ (self majorVersionNr printString , |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6970 |
'.', |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6971 |
self minorVersionNr printString , |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6972 |
'.', |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6973 |
self revisionNr printString) |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6974 |
|
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6975 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6976 |
Smalltalk versionString |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6977 |
" |
2952bfabeaf7
oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents:
8570
diff
changeset
|
6978 |
! |
7758 | 6979 |
|
6980 |
vmMajorVersionNr |
|
6981 |
"{ Pragma: +optSpace }" |
|
6982 |
||
6983 |
"return the VMs major version number." |
|
6984 |
%{ |
|
8913 | 6985 |
RETURN (__mkSmallInteger(4)); |
7758 | 6986 |
%}. |
6987 |
^ 4 |
|
6988 |
||
6989 |
" |
|
6990 |
Smalltalk vmMajorVersionNr |
|
6991 |
" |
|
2 | 6992 |
! ! |
453 | 6993 |
|
1750
36ff7e62388a
care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents:
1713
diff
changeset
|
6994 |
!Smalltalk class methodsFor:'documentation'! |
630 | 6995 |
|
1568
2ed24cca3dac
oops -checked in corrupt version
Claus Gittinger <cg@exept.de>
parents:
1567
diff
changeset
|
6996 |
version |
10471 | 6997 |
^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.816 2007-03-21 21:05:40 cg Exp $' |
630 | 6998 |
! ! |