Smalltalk.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 13 Mar 2013 00:42:41 +0000
branchjv
changeset 18028 e39da2aa21bc
parent 18027 3621469cc5e8
parent 14833 c718848b1051
child 18037 4cf874da38c9
permissions -rw-r--r--
Merged 3621469cc5e8 and a34396484b3c (branch default - CVS HEAD)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     1
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1988 by Claus Gittinger
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
     3
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
5363
0070ef95a033 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
    12
"{ Package: 'stx:libbasic' }"
0070ef95a033 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5333
diff changeset
    13
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    14
Object subclass:#Smalltalk
12795
30e3df06a822 changed: #start
Stefan Vogel <sv@exept.de>
parents: 12782
diff changeset
    15
	instanceVariableNames:''
30e3df06a822 changed: #start
Stefan Vogel <sv@exept.de>
parents: 12782
diff changeset
    16
	classVariableNames:'StartBlocks ImageStartBlocks ExitBlocks CachedClasses
30e3df06a822 changed: #start
Stefan Vogel <sv@exept.de>
parents: 12782
diff changeset
    17
		NumberOfClassesHint SystemPath StartupClass StartupSelector
30e3df06a822 changed: #start
Stefan Vogel <sv@exept.de>
parents: 12782
diff changeset
    18
		StartupArguments CommandLine CommandName CommandLineArguments
13091
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
    19
		CachedAbbreviations VerboseLoading SilentLoading Initializing
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
    20
		StandAlone HeadlessOperation IsPlugin IsSharedLibraryComponent
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
    21
		IsSTScript DebuggingStandAlone LogDoits LoadBinaries
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
    22
		RealSystemPath ResourcePath SourcePath BinaryPath FileInPath
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
    23
		PackagePath BinaryDirName ResourceDirName SourceDirName
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
    24
		BitmapDirName PackageDirName FileInDirName ChangeFileName
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
    25
		ImageStartTime ImageRestartTime DemoMode SaveEmergencyImage
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
    26
		SpecialObjectArray CallbackSignal KnownPackages
13368
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
    27
		ClassesFailedToInitialize HasNoConsole IgnoreHalt
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
    28
		PackageToPathMapping'
12795
30e3df06a822 changed: #start
Stefan Vogel <sv@exept.de>
parents: 12782
diff changeset
    29
	poolDictionaries:''
30e3df06a822 changed: #start
Stefan Vogel <sv@exept.de>
parents: 12782
diff changeset
    30
	category:'System-Support'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    31
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    32
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
    33
Smalltalk comment:''
8845
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
    34
!
17288e4e99eb remember, where autoload decl came from
Claus Gittinger <cg@exept.de>
parents: 8821
diff changeset
    35
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
    36
!Smalltalk class methodsFor:'documentation'!
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    37
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    38
copyright
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
    39
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    40
 COPYRIGHT (c) 1988 by Claus Gittinger
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
    41
	      All Rights Reserved
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    42
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    43
 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
    44
 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
    45
 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
    46
 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
    47
 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
    48
 hereby transferred.
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
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
    52
documentation
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    53
"
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    54
    This is one of the central classes in the system;
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    55
    it provides all system-startup, shutdown and maintenance support.
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    56
    Also global variables are (conceptionally) kept here.
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    57
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    58
    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
    59
    - my implementation of globals is totally different
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    60
      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
    61
      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
    62
      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
    63
      functions found there.
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    64
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    65
    However, it provides the known enumeration protocol.
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
    66
    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
    67
    to inherit more collection stuff ...
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
    68
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
    69
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    70
    [Instance variables:]
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    71
					none - all handling is done in the VM
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    72
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    73
    [Class variables:]
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
    74
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    75
	StartBlocks     <Collection>    blocks to be executed in a separate process after
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    76
					everything has been initialized. These blocks will
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    77
					be deleted after execution and therefore not be
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    78
					executed after an image restart. Initial processes
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    79
					(such as the Launcher) are usually started here.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    80
					These blocks are added by smalltalk.rc/private.rc etc.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    81
					via #addStartBlock during early initialization.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    82
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    83
	ImageStartBlocks
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    84
			<Collection>    blocks to be executed in a separate process after
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    85
					everything has been initialized. These blocks will be
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    86
					executed after an image restart.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    87
					These blocks are usually added by smalltalk_r.rc etc.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    88
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    89
	ExitBlocks      <Collection>    blocks to evaluate before system is
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    90
					left. Not currently used (GNU-ST compatibility).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    91
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    92
	SystemPath      <Collection>    path to search for system files (sources, bitmaps etc)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    93
					Set to a default here, but typically changed from some
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    94
					startup.rc file
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    95
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    96
	PackagePath     <Collection>    path to search for package.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    97
					This is going to replace the above systemPath, and a classes
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    98
					resources will eventually searched in its package directory.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
    99
					This list defines the path, where packages are searched for,
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   100
					initially this is something like /opt/smalltalk/packages.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   101
					Set to a default here, but typically changed from some
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   102
					startup.rc file
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   103
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   104
	StartupClass    <Class>         class and selector, where the system starts up
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   105
	StartupSelector <Symbol>        (right after VM initialization)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   106
	StartupArguments <Array>        If an image is saved while those being nonNil,
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   107
					the image will come up there.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   108
					Allows for customized images to be generated from a standard ST/X.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   109
					StandAlone programs also set those during initialization.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   110
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   111
	CommandLine          <String>   Unix (OS-) command line
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   112
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   113
	CommandName          <String>   the command (i.e. argv[0])
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   114
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   115
	CommandLineArguments <Array>    Unix (OS-) command line arguments broken into words
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   116
					CommandName has been stripped off.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   117
					(initially set by the VM)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   118
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   119
	SilentLoading   <Boolean>       OBSOLETE:
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   120
					suppresses messages during fileIn and in compiler
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   121
					(can be set to true from a customized main.c)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   122
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   123
	VerboseLoading   <Boolean>      generate messages during fileIn and in compiler
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   124
					(can be set to true from a customized main.c)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   125
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   126
	Initializing    <Boolean>       true while (re-)initializing
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   127
					Controls the behavior of certain error
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   128
					reporters (for example: suppress dialogBoxes)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   129
					while the system is not yet fit for full operation.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   130
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   131
	StandAlone      <Boolean>       true, if this is a standalone app;
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   132
					if true the process scheduler watches for
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   133
					which processes are still running, and
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   134
					exits ST/X, when the last non-background
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   135
					and non-system process exits.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   136
					Can be set in an application-specific startup script,
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   137
					or, for standAlone programs, by C-code during initialization.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   138
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   139
	HeadlessOperation               if true, a non-existing Display connection
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   140
			<Boolean>       will NOT lead to an error-exit during startup.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   141
					Default is false.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   142
					Can be set in an application-specific startup script,
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   143
					or, for standAlone programs, by C-code during initialization.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   144
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   145
	LogDoits        <Boolean>       if true, doits are also logged in the changes
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   146
					file. Default is false, since the changes file
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   147
					may become huge if every tiny doIt is saved there ...
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   148
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   149
	LoadBinaries    <Boolean>       if true, we attempt to load classes rom a binary
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   150
					file, if present. If false, this is always suppressed.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   151
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   152
	SaveEmergencyImage <Boolean>    if true (the default), an emergency image
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   153
					is saved, if the main Display looses its
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   154
					connection. This is useful if you have a
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   155
					flaky display connection (serial line)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   156
					and want to have your stuff saved automatically
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   157
					in case of a broken connection.
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
   158
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   159
    strictly private classVariables (helpers):
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   160
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   161
	CachedClasses   <Collection>    known classes (cached for faster class enumeration)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   162
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   163
	CachedAbbreviations
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   164
			<Dictionary>    className to filename mappings
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   165
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   166
	RealSystemPath  <Collection>    cached collection of directories along the path
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   167
					which really exist. Caching avoids long checks
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   168
					for existing directories on broken NFS volumes.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   169
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   170
	SourcePath      <Collection>    cached names of really existing directories
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   171
					These are remembered, as in NFS systems,
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   172
	ResourcePath                    the time to lookup files may become long
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   173
	BinaryPath                      (especially, if some directories are on machines
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   174
	FileInPath                      which are not up ...).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   175
					Therefore, the set of really
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   176
					existing directories is cached when the SystemPath
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   177
					is walked the first time.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   178
					A consequence is that you have to invoke
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   179
					flushSystemPath, when you create any of those
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   180
					directories while running
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   181
					(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
   182
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
   183
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1222
diff changeset
   184
    [author:]
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   185
	Claus Gittinger
3062
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   186
5b8a2aa07108 write an emergency snapshot image,
Claus Gittinger <cg@exept.de>
parents: 3044
diff changeset
   187
    [see also:]
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   188
	ObjectMemory
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   189
	StandaloneStartup
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   190
	GetOpt
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   191
	ReadEvalPrintLoop
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
   192
"
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   193
!
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   194
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   195
readme_resources
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   196
"
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   197
    What is a resource file:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   198
	resource files contain language transformation and sometimes
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   199
	UI-look specifics such as icons etc.
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   200
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   201
    Where are resources stored in the image:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   202
	Resource files are only read on demand (i.e. when needed) and only read once
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   203
	i.e. they are cached in the image).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   204
	The cached data is held in a per-class class-instVar named 'ClassResources'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   205
	With only a few exceptions, the only classes which need resources are the GUI
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   206
	classes under the SimpleView hierarchy.
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   207
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   208
    How does the system find resources:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   209
	The idea is that the system-provided resource files can be overwritten
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   210
	by the user or an application configuration.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   211
	This works via a hierarchy of directories where resources are searched for,
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   212
	with the systems standard resource-files being at the end of that chain.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   213
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   214
	When searching for a resource file for class X, the following files are searched
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   215
	in order:
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   216
		{ResourcePath} / resources / X.rs
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   217
		{SystemPath} / (CLASSES-PACKAGE-PATH) / X.rs
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   218
		{ResourcePath} / (CLASSES-PACKAGE-PATH) / X.rs
8945
519d441bdcb4 resources: also search for
Claus Gittinger <cg@exept.de>
parents: 8913
diff changeset
   219
"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   220
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   221
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
   222
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   223
!Smalltalk class methodsFor:'initialization'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   224
11057
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   225
basicInitializeSystem
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   226
    "initialize all other classes; setup dispatcher processes etc.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   227
     This one is the very first entry into the smalltalk world,
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   228
     right after startup, ususally immediately followed by Smalltalk>>start.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   229
     [with error handling, via the initializeSystem]
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   230
     Notice:
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   231
	this is not called when an image is restarted; in this
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   232
	case the show starts in Smalltalk>>restart."
11057
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   233
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
   234
    Compiler := ByteCodeCompiler.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
   235
    Compiler isNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   236
	"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   237
	 ByteCodeCompiler is not in the system (i.e. has not been linked in)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   238
	 this allows at least immediate evaluations for runtime systems without compiler
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   239
	 NOTICE: a parser is always needed, otherwise we cannot read resource files etc.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   240
	"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   241
	Compiler := Parser
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
   242
    ].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
   243
11057
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   244
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   245
    "/ start catching SIGSEGV and SIGBUS
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   246
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   247
    OperatingSystem enableHardSignalInterrupts.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   248
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   249
    self initGlobalsFromEnvironment.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   250
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   251
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   252
    "/ sorry - there are some, which MUST be initialized before ..
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   253
    "/ reason: if any error happens during init, we need Signals, Stdout etc. to be there
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   254
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   255
    Object initialize.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   256
    Stream initialize.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   257
    PositionableStream initialize.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   258
    Filename initialize.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   259
    ObjectMemory initialize.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   260
    OperatingSystem initialize.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   261
    ExternalStream initialize.
12745
e944659a6a52 changed: #basicInitializeSystem
Claus Gittinger <cg@exept.de>
parents: 12744
diff changeset
   262
    ProcessorScheduler initialize.
11057
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   263
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   264
    self initStandardStreams.    "/ setup Stdin, Stdout etc.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   265
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   266
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   267
    "/ sorry, path must be set before ...
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   268
    "/ reason: some classes need it during initialize (they might need resources, bitmaps etc)
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   269
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   270
    self initSystemPath.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   271
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   272
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   273
    "/ another one, to be initialized before others
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   274
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   275
    ProcessorScheduler initialize.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   276
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   277
    "/
14427
37ef5d66ea2a changed: #basicInitializeSystem
sr
parents: 14426
diff changeset
   278
    "/ in case, someone needs the objectFileLoader early
37ef5d66ea2a changed: #basicInitializeSystem
sr
parents: 14426
diff changeset
   279
    "/
37ef5d66ea2a changed: #basicInitializeSystem
sr
parents: 14426
diff changeset
   280
    ObjectFileLoader initialize.
37ef5d66ea2a changed: #basicInitializeSystem
sr
parents: 14426
diff changeset
   281
37ef5d66ea2a changed: #basicInitializeSystem
sr
parents: 14426
diff changeset
   282
    "/
11057
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   283
    "/ now, finally, initialize all other classes
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   284
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   285
    self initializeModules.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   286
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   287
    ImageStartTime := Timestamp now.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   288
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   289
    self initInterrupts.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   290
    self initUserPreferences.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   291
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   292
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   293
    "/ give classes a chance to perform 2nd-level initialization
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   294
    "/ now, we are certain, that all other classes have been initialized
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   295
    "/ (especially: streams and signals can now be used)
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   296
    "/
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   297
    ObjectMemory changed:#initialized.
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   298
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   299
    "Modified: / 08-01-1997 / 19:58:12 / stefan"
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   300
    "Modified: / 05-12-2006 / 21:48:58 / cg"
14427
37ef5d66ea2a changed: #basicInitializeSystem
sr
parents: 14426
diff changeset
   301
    "Modified: / 24-10-2012 / 18:45:15 / sr"
11057
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   302
!
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   303
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   304
initGlobalsFromEnvironment
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   305
    "setup globals from the shell-environment"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   306
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   307
    |envString i langString terrString|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   308
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   309
    StandAlone isNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   310
	StandAlone := false.
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   311
    ].
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
   312
    HeadlessOperation isNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   313
	HeadlessOperation := false.
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
   314
    ].
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   315
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   316
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   317
     extract Language and LanguageTerritory from LANG variable.
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   318
     valid are for example:
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   319
			    en_en / en
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   320
			    en_us
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   321
			    en_gb
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   322
			    de_de / de
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   323
			    de_at       (for Austria)
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   324
    "
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   325
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   326
    Language := #en.
994
6163ae7aaf9b territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   327
    LanguageTerritory := #us.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   328
5846
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   329
a972d0e7e06b Parsing of de_DE
Stefan Vogel <sv@exept.de>
parents: 5841
diff changeset
   330
    "Format of LANG is: language[_territory][.codeset][@modifier]
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   331
	language        ISO-639  Language code
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   332
	territory       ISO-3166 Contry code"
7779
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   333
6d88d32bdd64 Language stuff: use OperatingSystem>>getLanguage to get
Stefan Vogel <sv@exept.de>
parents: 7763
diff changeset
   334
    envString := OperatingSystem getLanguage.
3991
7b53bc45bf91 (isNil or:[isEmpty ]) -> (size == 0)
Claus Gittinger <cg@exept.de>
parents: 3988
diff changeset
   335
    envString size > 0 ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   336
	i := envString indexOf:$@.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   337
	(i ~~ 0) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   338
	    LanguageModifier := (envString copyFrom:(i + 1)) asLowercase asSymbol.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   339
	    envString := envString copyTo:(i - 1).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   340
	] ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   341
	    LanguageModifier := nil.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   342
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   343
	i := envString indexOf:$..
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   344
	(i ~~ 0) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   345
	    LanguageCodeset := (envString copyFrom:(i + 1)) asLowercase asSymbol.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   346
	    envString := envString copyTo:(i - 1).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   347
	] ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   348
	    LanguageCodeset := #'iso8859-1'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   349
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   350
	i := envString indexOf:$_.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   351
	(i == 0) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   352
	    langString := envString.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   353
	    terrString := envString
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   354
	] ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   355
	    langString := envString copyTo:(i - 1).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   356
	    terrString := envString copyFrom:(i + 1)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   357
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   358
	langString := langString asLowercase.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   359
	terrString := terrString asLowercase.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   360
	(langString = 'c' or:[terrString = 'c']) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   361
	    ('Smalltalk [info]: ignoring wrong LANG setting (',langString,'_',terrString,') - using english') infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   362
	] ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   363
	    Language := langString asSymbol.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   364
	    LanguageTerritory := terrString asSymbol
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   365
	]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   366
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   367
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   368
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   369
     Smalltalk initGlobalsFromEnvironment
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   370
    "
994
6163ae7aaf9b territory defaults to #us (instead of #usa)
Claus Gittinger <cg@exept.de>
parents: 977
diff changeset
   371
14011
d33d2c6497f4 changed: #initGlobalsFromEnvironment
Claus Gittinger <cg@exept.de>
parents: 13998
diff changeset
   372
    "Modified: / 14-02-2012 / 15:25:08 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   373
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   374
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   375
initInterrupts
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   376
    "initialize interrupts"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   377
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   378
    OperatingSystem enableUserInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   379
    OperatingSystem enableHardSignalInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   380
    OperatingSystem enableCrashSignalInterrupts.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   381
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   382
    ObjectMemory userInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   383
    ObjectMemory signalInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   384
    ObjectMemory recursionInterruptHandler:self.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   385
14805
33c5758318a6 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14793
diff changeset
   386
    OperatingSystem isOSXlike ifTrue:[
33c5758318a6 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14793
diff changeset
   387
        "/ OSX sends SIGABRT for NSExceptions
33c5758318a6 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14793
diff changeset
   388
        OperatingSystem operatingSystemSignal:(OperatingSystem sigABRT) install:NSException.
33c5758318a6 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14793
diff changeset
   389
        OperatingSystem enableAbortInterrupts.
33c5758318a6 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14793
diff changeset
   390
    ].
33c5758318a6 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14793
diff changeset
   391
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   392
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   393
     Smalltalk initInterrupts
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   394
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   395
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   396
    "Modified: 20.8.1997 / 09:35:49 / stefan"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   397
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   398
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   399
initStandardStreams
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   400
    "initialize some well-known streams"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   401
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   402
    Stdout := NonPositionableExternalStream forStdout.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   403
    Stderr := NonPositionableExternalStream forStderr.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   404
    Stdin := NonPositionableExternalStream forStdin.
10145
cca90547778e allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents: 10143
diff changeset
   405
    PrinterStream notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   406
	Printer := PrinterStream defaultPrinter.
10145
cca90547778e allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents: 10143
diff changeset
   407
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   408
    Transcript := Stderr
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   409
963
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   410
    "
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   411
     Smalltalk initStandardStreams
fef0f2ed2709 more for standAlone (nonGraphical) mode
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
   412
    "
10145
cca90547778e allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents: 10143
diff changeset
   413
cca90547778e allow for different OS's to initialize the Printer differently
Claus Gittinger <cg@exept.de>
parents: 10143
diff changeset
   414
    "Modified: / 25-10-2006 / 17:36:46 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   415
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   416
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   417
initStandardTools
10646
39e8fbfed83c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10645
diff changeset
   418
    "predefine some tools which we might need later
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   419
     - if the view-classes exist,
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   420
       they will redefine Inspector and Debugger for graphical interfaces"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   421
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   422
    Display notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   423
	InspectorView notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   424
	    Inspector := InspectorView
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   425
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   426
	DebugView notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   427
	    Debugger := DebugView
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   428
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   429
	"/ Display initialize
13303
1aa90c41dd35 changed: #initStandardTools
Claus Gittinger <cg@exept.de>
parents: 13212
diff changeset
   430
    ].
1aa90c41dd35 changed: #initStandardTools
Claus Gittinger <cg@exept.de>
parents: 13212
diff changeset
   431
1aa90c41dd35 changed: #initStandardTools
Claus Gittinger <cg@exept.de>
parents: 13212
diff changeset
   432
    "/ make the changeFilePath an absolute one,
1aa90c41dd35 changed: #initStandardTools
Claus Gittinger <cg@exept.de>
parents: 13212
diff changeset
   433
    "/ in case some stupid windows fileDialog changes the current directory...
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   434
    ObjectMemory
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   435
	nameForChanges:(Filename currentDirectory construct:ObjectMemory nameForChangesLocal)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   436
			    asAbsoluteFilename pathName
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   437
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   438
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   439
     Smalltalk initStandardTools
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   440
    "
13303
1aa90c41dd35 changed: #initStandardTools
Claus Gittinger <cg@exept.de>
parents: 13212
diff changeset
   441
1aa90c41dd35 changed: #initStandardTools
Claus Gittinger <cg@exept.de>
parents: 13212
diff changeset
   442
    "Modified: / 09-02-2011 / 20:44:47 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   443
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   444
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   445
initSystemPath
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   446
    "setup path where system files are searched for.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   447
     the default path is set to:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   448
	    .
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   449
	    <directory of exe>       (WIN32 only)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   450
	    $HOME                    (if defined)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   451
	    $HOME/.smalltalk         (if defined & existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   452
	    $SMALLTALK_LIBDIR        (if defined & existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   453
	    $STX_LIBDIR              (if defined & existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   454
	    $STX_TOPDIR              (if defined & existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   455
	    REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\<CurrentVersion>\LibDir') (WIN32 only)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   456
	    REGISTRY('HKEY_LOCAL_MACHINE\Software\eXept\Smalltalk/X\LibDir')                  (WIN32 only)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   457
	    <standard places>
9021
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   458
6541db62a929 systemPath setup changed
Claus Gittinger <cg@exept.de>
parents: 9020
diff changeset
   459
     standard places (unix):
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   460
	    /opt/smalltalk/<release> (if existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   461
	    /opt/smalltalk           (if existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   462
	    /usr/local/lib/smalltalk (if existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   463
	    /usr/lib/smalltalk       (if existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   464
	    /lib/smalltalk           (if existing)
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   465
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   466
     win32:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   467
	    \programs\exept\smalltalk (if existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   468
	    \programs\smalltalk       (if existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   469
	    \smalltalk                (if existing)
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   470
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   471
     vms:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   472
	    $stx:lib                 (if existing)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   473
	    $stx:root                (if existing)
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   474
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   475
     of course, it is possible to add entries from the 'smalltalk.rc'
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   476
     startup file; add expressions such as:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   477
	    Smalltalk systemPath addFirst:'/foo/bar/baz'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   478
	or:
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   479
	    Smalltalk systemPath addLast:'/fee/foe/foo'.
4001
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   480
fa75465bd263 made systemPath setup OS-specific
Claus Gittinger <cg@exept.de>
parents: 3991
diff changeset
   481
     However, smalltalk.rc itself must be found along the above path.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   482
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   483
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   484
    ChangeFileName := 'changes'.
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   485
    OperatingSystem isVMSlike ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   486
	BitmapDirName := 'bitmaps.dir'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   487
	BinaryDirName := 'binary.dir'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   488
	SourceDirName := 'source.dir'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   489
	ResourceDirName := 'resources.dir'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   490
	FileInDirName := 'filein.dir'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   491
	PackageDirName := 'packages.dir'.
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   492
    ] ifFalse:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   493
	BitmapDirName := 'bitmaps'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   494
	BinaryDirName := 'binary'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   495
	SourceDirName := 'source'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   496
	ResourceDirName := 'resources'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   497
	FileInDirName := 'fileIn'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   498
	PackageDirName := 'packages'.
2928
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   499
    ].
39c23e287c81 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2912
diff changeset
   500
680
6f5794a26d2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 657
diff changeset
   501
    SystemPath isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   502
	SystemPath := OperatingSystem defaultSystemPath.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   503
	self flushPathCaches
5139
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   504
    ].
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   505
5144
607e6fe053b5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   506
    PackagePath isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   507
	PackagePath := OperatingSystem defaultPackagePath.
5144
607e6fe053b5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5140
diff changeset
   508
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   509
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   510
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   511
     Smalltalk initSystemPath
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   512
     Smalltalk systemPath
11679
69e588cca61f Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents: 11670
diff changeset
   513
69e588cca61f Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents: 11670
diff changeset
   514
     OperatingSystem defaultSystemPath
69e588cca61f Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents: 11670
diff changeset
   515
     OperatingSystem defaultPackagePath
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   516
    "
5139
135e98726986 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 5138
diff changeset
   517
5145
23bca61caa40 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5144
diff changeset
   518
    "Modified: / 24.12.1999 / 00:23:35 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   519
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   520
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   521
initUserPreferences
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   522
    "setup other stuff"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   523
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   524
    LogDoits := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   525
    LoadBinaries := false.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   526
    SaveEmergencyImage := (StandAlone ~~ true).
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   527
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   528
    "Modified: / 24.10.1997 / 18:22:47 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   529
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   530
7526
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   531
initializeClass:aClass
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   532
    "sent from VM via #initializeModules"
97c36c93e3d9 *** empty log message ***
penk
parents: 7525
diff changeset
   533
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   534
    Error handle:[:ex |
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   535
	ObjectMemory printStackBacktrace.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   536
	ClassesFailedToInitialize isNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   537
	    ClassesFailedToInitialize := IdentitySet new.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   538
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   539
	ClassesFailedToInitialize add:aClass.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   540
	('Smalltalk [warning]: error during initialize of ' , aClass name,': ', ex description printString) errorPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   541
	ex suspendedContext fullPrintAll.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   542
	'------------------------------------------------' errorPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   543
	(Smalltalk commandLineArguments includes:'--debug') ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   544
	    ex reject
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   545
	].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   546
    ] do:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   547
	aClass initialize
13675
b5730280715d changed: #initializeClass:
Claus Gittinger <cg@exept.de>
parents: 13621
diff changeset
   548
    ].
b5730280715d changed: #initializeClass:
Claus Gittinger <cg@exept.de>
parents: 13621
diff changeset
   549
b5730280715d changed: #initializeClass:
Claus Gittinger <cg@exept.de>
parents: 13621
diff changeset
   550
    "Modified: / 11-09-2011 / 17:01:32 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   551
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   552
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   553
initializeModules
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   554
    "perform module specific initialization and
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   555
     send #initialize to all classes.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   556
     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
   557
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   558
    self initializeModulesOnce.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   559
    ClassesFailedToInitialize size > 0 ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   560
	('Smalltalk [info]: retry initialization of failed class(es)...') infoPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   561
	ClassesFailedToInitialize := nil.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   562
	self initializeModulesOnce.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   563
	ClassesFailedToInitialize size > 0 ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   564
	    ('Smalltalk [error]: class(es) persist to fail during initialize') errorPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   565
	]
10122
697f05af913b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10118
diff changeset
   566
    ].
697f05af913b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10118
diff changeset
   567
697f05af913b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10118
diff changeset
   568
    ProjectDefinition initializeAllProjectDefinitions.
697f05af913b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10118
diff changeset
   569
697f05af913b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10118
diff changeset
   570
    "Modified: / 23-10-2006 / 16:40:39 / cg"
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   571
!
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   572
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   573
initializeModulesOnce
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   574
    "perform module specific initialization and
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   575
     send #initialize to all classes.
7527
00be4f63fa1d *** empty log message ***
penk
parents: 7526
diff changeset
   576
     Notice: this is not called when an image is restarted"
4963
308de981ea7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
   577
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   578
%{
1688
8a42db1eea60 removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents: 1682
diff changeset
   579
    __init_registered_modules__(3);
4963
308de981ea7d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4959
diff changeset
   580
1481
90a28fd060bc *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1480
diff changeset
   581
    @global(DemoMode) = __getDemoMode() ? true : false;
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   582
    RETURN (self);
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   583
%}.
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   584
    ^ self primitiveFailed
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   585
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
   586
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   587
initializeSystem
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   588
    "initialize all other classes; setup dispatcher processes etc.
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   589
     This one is the very first entry into the smalltalk world,
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   590
     right after startup, ususally immediately followed by Smalltalk>>start.
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
   591
     Notice:
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   592
	this is not called when an image is restarted; in this
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   593
	case the show starts in Smalltalk>>restart."
211
58bb873aa83c *** empty log message ***
claus
parents: 202
diff changeset
   594
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   595
    |idx|
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   596
12861
5086a864ae3e changed:
Claus Gittinger <cg@exept.de>
parents: 12813
diff changeset
   597
    NumberOfClassesHint := 10000.
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
   598
3499
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   599
    Initializing := true.
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   600
    AbstractOperatingSystem initializeConcreteClass.
5f8715a97ff5 switching to OS-subclasses
Claus Gittinger <cg@exept.de>
parents: 3492
diff changeset
   601
5400
af8fdc4d3e02 kludge (for rel5)
Claus Gittinger <cg@exept.de>
parents: 5373
diff changeset
   602
    CommandLineArguments isNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   603
	CommandLineArguments := #('stx').
5400
af8fdc4d3e02 kludge (for rel5)
Claus Gittinger <cg@exept.de>
parents: 5373
diff changeset
   604
    ].
4006
c7ad38c52eb9 must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
   605
    CommandLine := CommandLineArguments copy.
c7ad38c52eb9 must set CommandLineArguments earlier (to be available in initializeSystem)
Claus Gittinger <cg@exept.de>
parents: 4001
diff changeset
   606
    CommandLineArguments := CommandLineArguments asOrderedCollection.
6842
a5110421e4ab more for standAlone start
Claus Gittinger <cg@exept.de>
parents: 6841
diff changeset
   607
    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
   608
4028
b46539f16af5 added --silentStartup argument
Claus Gittinger <cg@exept.de>
parents: 4026
diff changeset
   609
    SilentLoading := (CommandLineArguments includes:'--silentStartup').
13091
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
   610
    VerboseLoading := (CommandLineArguments includes:'--verboseLoading').
348
claus
parents: 345
diff changeset
   611
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   612
    DebuggingStandAlone := false.
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   613
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   614
    StandAlone ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   615
	InfoPrinting := false.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   616
	ObjectMemory infoPrinting:false.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   617
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   618
	idx := CommandLineArguments indexOf:'--debug'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   619
	idx ~~ 0 ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   620
	    DebuggingStandAlone := true.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   621
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   622
	DebuggingStandAlone ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   623
	    Inspector := MiniInspector.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   624
	    Debugger := MiniDebugger.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   625
	].
6841
37bc69fc9240 set StandAlone flag earlier (during initSystem);
Claus Gittinger <cg@exept.de>
parents: 6837
diff changeset
   626
    ] ifFalse:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   627
	"/
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   628
	"/ define low-level debugging tools - graphical classes are not prepared yet
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   629
	"/ to handle things.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   630
	"/ This will bring us into the MiniDebugger when an error occurs during startup.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   631
	"/
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   632
	Inspector := MiniInspector.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   633
	Debugger := MiniDebugger.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   634
    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   635
11057
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   636
    Error handle:[:ex |
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   637
	StandAlone ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   638
	    DebuggingStandAlone ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   639
		'Startup Error - use --debug command line argument for more info' errorPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   640
		Smalltalk exit:1.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   641
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   642
	    'Startup Error' errorPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   643
	    thisContext fullPrintAll.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   644
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   645
	ex reject.
11057
a87e5e1574ca startup error handling
Claus Gittinger <cg@exept.de>
parents: 11054
diff changeset
   646
    ] do:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   647
	self basicInitializeSystem
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   648
    ].
13091
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
   649
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
   650
    "Modified: / 12-10-2010 / 11:27:47 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   651
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   652
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   653
isInitialized
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   654
    "this returns true, if the system is properly initialized;
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   655
     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
   656
     not working correctly until initialized."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   657
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   658
    ^ Initializing not
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   659
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   660
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   661
reinitStandardStreams
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   662
    "reinitialize some well-known streams.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   663
     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
   664
     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
   665
     (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
   666
8710aba7876b oops - making id's real objects requires a store macro
Claus Gittinger <cg@exept.de>
parents: 457
diff changeset
   667
    Stdout reOpen. Stderr reOpen. Stdin reOpen.
161
ed36169f354d *** empty log message ***
claus
parents: 159
diff changeset
   668
! !
ed36169f354d *** empty log message ***
claus
parents: 159
diff changeset
   669
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
   670
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   671
!Smalltalk class methodsFor:'Compatibility-Squeak'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   672
10560
4421fed34095 +at:ifAbsentPut:
Claus Gittinger <cg@exept.de>
parents: 10538
diff changeset
   673
at:aKey ifAbsentPut:aBlock
11977
9d63f9ced280 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11867
diff changeset
   674
    "return the element indexed by aKey if present,
9d63f9ced280 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11867
diff changeset
   675
     if not present, store the result of evaluating valueBlock
9d63f9ced280 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11867
diff changeset
   676
     under aKey and return it."
9d63f9ced280 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11867
diff changeset
   677
10560
4421fed34095 +at:ifAbsentPut:
Claus Gittinger <cg@exept.de>
parents: 10538
diff changeset
   678
    ^ self at:aKey ifAbsent:[ self at:aKey put:aBlock value ].
4421fed34095 +at:ifAbsentPut:
Claus Gittinger <cg@exept.de>
parents: 10538
diff changeset
   679
4421fed34095 +at:ifAbsentPut:
Claus Gittinger <cg@exept.de>
parents: 10538
diff changeset
   680
    "Created: / 29-05-2007 / 12:41:12 / cg"
4421fed34095 +at:ifAbsentPut:
Claus Gittinger <cg@exept.de>
parents: 10538
diff changeset
   681
!
4421fed34095 +at:ifAbsentPut:
Claus Gittinger <cg@exept.de>
parents: 10538
diff changeset
   682
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   683
beep
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   684
    Screen current beep
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
garbageCollect
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   688
   ObjectMemory garbageCollect
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   689
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   690
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   691
garbageCollectMost
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   692
    "collect recently created garbage; return the amount of freeSpace.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   693
     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
   694
     newSpace + freeListSpace is returned."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   695
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   696
    ObjectMemory scavenge.
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
   697
    ^ ObjectMemory freeSpace
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   698
      + (ObjectMemory newSpaceSize - ObjectMemory newSpaceUsed)
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   699
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   700
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   701
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   702
isMorphic
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   703
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   704
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   705
10844
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   706
platformName
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   707
    "not yet fully implemented (I have to figure out, what squeak returns in each case...)"
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   708
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   709
    ^ OperatingSystem platformName asUppercaseFirst
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   710
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   711
    "
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   712
     Smalltalk platformName -> 'Win32'
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   713
    "
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   714
!
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   715
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   716
registerExternalObject: anObject
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   717
    "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
   718
     If it is already there, just return its index.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   719
     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
   720
     primitive code (via the global Smalltalk:SpecialObjectArray)"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   721
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   722
    | objects firstEmptyIndex obj sz newObjects |
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   723
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   724
    objects := SpecialObjectArray.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   725
    objects isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   726
	objects := Array new:5.
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   727
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   728
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   729
    "find the first empty slot and look if already registered"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   730
    firstEmptyIndex := 0.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   731
    1 to: objects size do: [:i |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   732
	obj := objects at: i.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   733
	obj == anObject ifTrue: [^ i].  "object already there, just return its index"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   734
	(obj == nil and: [firstEmptyIndex = 0]) ifTrue: [
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   735
	    firstEmptyIndex := i
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   736
	]
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   737
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   738
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   739
    "if no empty slots, expand the array"
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   740
    firstEmptyIndex = 0 ifTrue: [
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   741
	sz := objects size.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   742
	newObjects := objects species new: sz + 20.  "grow linearly"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   743
	newObjects replaceFrom: 1 to: sz with: objects startingAt: 1.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   744
	firstEmptyIndex := sz + 1.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   745
	SpecialObjectArray := newObjects.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   746
	objects := newObjects
4584
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   747
    ].
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   748
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   749
    objects at: firstEmptyIndex put: anObject.
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   750
    ^ firstEmptyIndex
789c83e8cae0 some squeak compatibility stuff
Claus Gittinger <cg@exept.de>
parents: 4524
diff changeset
   751
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   752
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   753
12358
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   754
removeClassNamed: aName
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   755
    "Invoked from fileouts:  if there is currently a class in the system named aName, then remove it.
12358
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   756
     If anything untoward happens, report it in the Transcript.  "
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   757
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   758
    | oldClass |
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   759
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   760
    (oldClass := self at: aName asSymbol ifAbsent: [nil]) isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   761
	Transcript showCR: 'Removal of class named ', aName, ' ignored because it does not exist.'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   762
	^ self
12358
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   763
    ].
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   764
    oldClass removeFromSystem
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   765
!
686986c54ccc added: #removeClassNamed:
Claus Gittinger <cg@exept.de>
parents: 12352
diff changeset
   766
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   767
renameClassNamed:oldName as:newName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   768
    self renameClass:(self at:oldName) to:newName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   769
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   770
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   771
unregisterExternalObject: anObject
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
   772
    "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
   773
     Do nothing if it isn't registered."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   774
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   775
    |objects|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   776
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   777
    anObject isNil ifTrue:[^ self].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   778
    objects := SpecialObjectArray.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   779
    1 to: objects size do: [:i |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   780
	(objects at: i) == anObject ifTrue: [
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   781
	    objects at: i put: nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   782
	]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   783
    ].
10844
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   784
!
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   785
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   786
windowSystemName
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   787
    "not yet fully implemented (I have to figure out, what squeak returns in each case...)"
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   788
11169
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
   789
    |platformName|
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
   790
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
   791
    platformName := Screen current platformName.
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
   792
    platformName = #WIN32 ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   793
	^ #Win32.
11169
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
   794
    ].
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
   795
    ^ platformName.
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
   796
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
   797
    "
11375
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
   798
     Smalltalk windowSystemName
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   799
				-> 'Win32'
10844
348d03bba747 squeak compatibility
Claus Gittinger <cg@exept.de>
parents: 10738
diff changeset
   800
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   801
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   802
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
   803
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   804
!Smalltalk class methodsFor:'Compatibility-V''Age'!
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   805
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   806
allClassesImplementing:aSelector
12304
b0dc1c58de1a changed: #allClassesImplementing:
Claus Gittinger <cg@exept.de>
parents: 12301
diff changeset
   807
    ^ self allClassesForWhich:[:cls | cls includesSelector:aSelector].
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
   808
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
   809
    "Modified: / 10-08-2006 / 12:12:17 / cg"
9090
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   810
!
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   811
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   812
declareConstant:constantName poolName:poolName value:value
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   813
    |pool|
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   814
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   815
    pool := self classNamed:poolName.
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   816
    pool declareConstant:constantName value:value
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   817
!
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   818
19cfbd910506 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9082
diff changeset
   819
declarePoolDictionary:poolDictionaryName
13998
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   820
    ^ SharedPool subclass:(poolDictionaryName asSymbol)
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   821
	instanceVariableNames:''
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   822
	classVariableNames:''
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   823
	poolDictionaries:''
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   824
	category:nil
13998
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   825
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   826
    "Modified: / 07-02-2012 / 15:56:16 / cg"
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   827
!
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   828
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   829
declareVariable:varName poolName:poolName
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   830
    |pool|
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   831
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   832
    pool := self classNamed:poolName.
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   833
    pool declareVariable:varName
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   834
890d42903662 added: #declareVariable:poolName:
Claus Gittinger <cg@exept.de>
parents: 13958
diff changeset
   835
    "Created: / 07-02-2012 / 15:57:05 / cg"
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   836
! !
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
   837
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
   838
7295
9ddb9543e369 category
Claus Gittinger <cg@exept.de>
parents: 7290
diff changeset
   839
!Smalltalk class methodsFor:'Compatibility-VW5.4'!
6094
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   840
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   841
defineClass:nameSymbol superclass:superclass indexedType:indexed private:private instanceVariableNames:instVars classInstanceVariableNames:classInstVars imports:imports category:category
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   842
    ^ self
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   843
	defineClass:nameSymbol
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   844
	superclass:superclass
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   845
	indexedType:indexed
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   846
	private:private
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   847
	instanceVariableNames:instVars
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   848
	classInstanceVariableNames:classInstVars
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   849
	imports:imports
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   850
	category:category
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   851
	attributes:nil
12033
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   852
!
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   853
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   854
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
   855
    |newClass|
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   856
79ebf84b51bd first attempt in supporting vw5.4 definitions
Claus Gittinger <cg@exept.de>
parents: 6080
diff changeset
   857
    indexed == #none ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   858
	newClass := superclass
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   859
	    subclass:nameSymbol
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   860
	    instanceVariableNames:instVars
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   861
	    classVariableNames:''
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   862
	    poolDictionaries:''
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   863
	    category:category
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   864
	    inEnvironment:self.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   865
	classInstVars size > 0 ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   866
	    newClass class instanceVariableNames:classInstVars.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   867
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   868
	^ newClass
6851
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   869
    ].
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   870
    self shouldImplement.
12033
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   871
!
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   872
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   873
defineNameSpace:nameSymbol private:private imports:imports category:category
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   874
    |newNameSpace|
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   875
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   876
    private ifTrue:[self halt].     "/ what to do ?
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   877
    imports withoutSeparators notEmpty ifTrue:[self halt].     "/ what to do ?
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   878
    newNameSpace := NameSpace name:nameSymbol.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   879
    newNameSpace setCategory:category.
12033
Claus Gittinger <cg@exept.de>
parents: 12023
diff changeset
   880
    ^ newNameSpace
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   881
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   882
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
   883
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   884
!Smalltalk class methodsFor:'accessing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   885
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   886
associationAt:aKey
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   887
    "return a key-value association for aKey.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   888
     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
   889
     simulated here."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   890
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   891
    |val|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   892
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   893
    val := self at:aKey ifAbsent:nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   894
    val isNil ifTrue:[^ nil].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   895
    ^ Association key:aKey value:val
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   896
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   897
    "Created: / 1.11.1997 / 13:27:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   898
!
3083
451912c492ae checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3062
diff changeset
   899
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   900
associationAt:aKey ifAbsent:exceptionBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   901
    "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
   902
     from exceptionBlock, if no such key is present.
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   903
     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
   904
     simulated here."
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   905
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   906
    |val|
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   907
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   908
    val := self at:aKey ifAbsent:nil.
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   909
    val isNil ifTrue:[^ exceptionBlock value].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   910
    ^ Association key:aKey value:val
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   911
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   912
    "Created: / 18.6.1998 / 17:05:24 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   913
!
3610
12f32c1fe72b added #associationAt:ifAbsent: for ST80 compatibility.
Claus Gittinger <cg@exept.de>
parents: 3565
diff changeset
   914
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   915
at:aKey
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
   916
    "retrieve the value stored under aKey, a symbol.
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
   917
     Return nil if not present
1956
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   918
     (this will be changed to trigger an error - better use #at:ifAbsent:)"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   919
6851
91662dfb3e80 Remove debug print.
Stefan Vogel <sv@exept.de>
parents: 6849
diff changeset
   920
    aKey class == String ifTrue:[self error:'expected symbol'].
6080
15ea3cbf6003 renamed: #allSelectorsAndMethodsDo: into: #instAndClassSelectorsAndMethodsDo:
Claus Gittinger <cg@exept.de>
parents: 6074
diff changeset
   921
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   922
%{  /* NOCONTEXT */
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   923
    RETURN ( __GLOBAL_GET(aKey) );
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
   924
%}.
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
   925
    ^ self primitiveFailed
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   926
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   927
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   928
at:aKey ifAbsent:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   929
    "retrieve the value stored at aKey.
7565
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
   930
     If there is nothing stored under this key, return the value of
cd76db5ee5cd *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7564
diff changeset
   931
     the evaluation of aBlock."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   932
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   933
    (self includesKey:aKey) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   934
	^ self at:aKey
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   935
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   936
    ^ aBlock value
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   937
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   938
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   939
     Smalltalk at:#fooBar                       <- returns nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   940
     Smalltalk at:#fooBar ifAbsent:['sorry']    <- no error
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   941
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   942
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   943
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   944
at:aKey ifPresent:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   945
    "try to retrieve the value stored at aKey.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   946
     If there is nothing stored under this key, do nothing.
4870
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   947
     Otherwise, evaluate aBlock, passing the retrieved value as argument."
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   948
13883
73d2c22a5438 changed: #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 13851
diff changeset
   949
    |val|
73d2c22a5438 changed: #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 13851
diff changeset
   950
4870
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   951
    (self includesKey:aKey) ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   952
	(val := self at:aKey) notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   953
	    ^ aBlock value:val
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
   954
	]
4870
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   955
    ].
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   956
    ^ nil
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   957
3f6a8c368925 added #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 4846
diff changeset
   958
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   959
     Smalltalk at:#fooBar ifPresent:[:what | Transcript showCR:what].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   960
     Smalltalk at:#Object ifPresent:[:what | Transcript showCR:what].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   961
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   962
13883
73d2c22a5438 changed: #at:ifPresent:
Claus Gittinger <cg@exept.de>
parents: 13851
diff changeset
   963
    "Modified: / 27-12-2011 / 10:14:30 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   964
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   965
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   966
at:aKey put:aValue
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   967
    "store the argument aValue under aKey, a symbol.
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
   968
     Return aValue (sigh)."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   969
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   970
    |oldValue|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   971
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   972
%{
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   973
    oldValue = __GLOBAL_SET(aKey, aValue, (OBJ *)0);
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   974
%}.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   975
    CachedClasses notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   976
	oldValue isBehavior ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   977
	    oldValue name == aKey ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   978
		CachedClasses remove:oldValue ifAbsent:[]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   979
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   980
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   981
	aValue isBehavior ifTrue:[
1956
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   982
"/            aValue isMeta ifTrue:[
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   983
"/                "/ this should not happen
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   984
"/                ('SMALLTALK: store a Metaclass: ' , aValue name , ' as ' , aKey) infoPrintCR.
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   985
"/            ].
4eed0b627d52 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1955
diff changeset
   986
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   987
	    aValue name == aKey ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   988
		CachedClasses add:aValue
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   989
	    ] ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   990
		CachedClasses := nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   991
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
   992
	].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
   993
    ].
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
   994
    ^ aValue.
1955
276d4ce9b40e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1945
diff changeset
   995
"/
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   996
"/%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   997
"/    (void) __GLOBAL_SET(aKey, aValue, (OBJ *)0);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   998
"/%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
   999
"/    CachedClasses := nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1000
"/    ^ aValue
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1001
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1002
    "Modified: 19.4.1996 / 11:31:49 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1003
!
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
includesKey:aKey
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1006
    "return true, if the key is known"
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
    "/ for debugging - this is a common mistake,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1009
    "/ to try to access a class by nameString, instead
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1010
    "/ of by symbol.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1011
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1012
    "/ aKey class == String ifTrue:[self halt].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1013
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1014
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1015
    RETURN ( __GLOBAL_KEYKNOWN(aKey) );
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1016
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1017
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1018
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1019
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1020
keyAtValue:anObject
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1021
    "return the symbol under which anObject is stored - or nil"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1022
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1023
    self keysDo:[:aKey |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1024
	(self at:aKey) == anObject ifTrue:[^ aKey]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1025
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1026
    ^ nil
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1027
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1028
    "Smalltalk keyAtValue:Object"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1029
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1030
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1031
keys
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1032
    "return a collection with all keys in the Smalltalk dictionary"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1033
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1034
    |keys|
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1035
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1036
    keys := IdentitySet new.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1037
    self keysDo:[:k | keys add:k].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1038
    ^ keys
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1039
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1040
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1041
removeKey:aKey
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1042
    "remove the association stored under the key-argument from the globals dictionary.
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1043
     WARNING:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1044
	this is somewhat dangerous: conceptionally, the association is removed,
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1045
	to which machine & byte compiled code refers if it accesses a global.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1046
	If there are still global accesses in some literalArray or from machine-compiled code,
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1047
	it continues to reference the globals value via that obsolete association and gets a nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1048
	value.  (which is correct)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1049
	However, if that global is later reintroduced, a new association will be created and
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1050
	the new global now referenced via the new association.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1051
	The old accesses will still see nil, although the globals value is actually non-nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1052
	(this is questionable).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1053
	To avoid this problem, the #removeClass: method never removed the key."
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1054
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1055
    CachedClasses := nil.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1056
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1057
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1058
    RETURN ( __GLOBAL_REMOVE(aKey) );
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
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1061
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1062
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1063
10538
7db2e140567f #startBlocks
Stefan Vogel <sv@exept.de>
parents: 10471
diff changeset
  1064
startBlocks
7db2e140567f #startBlocks
Stefan Vogel <sv@exept.de>
parents: 10471
diff changeset
  1065
    ^ StartBlocks
7db2e140567f #startBlocks
Stefan Vogel <sv@exept.de>
parents: 10471
diff changeset
  1066
!
7db2e140567f #startBlocks
Stefan Vogel <sv@exept.de>
parents: 10471
diff changeset
  1067
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1068
values
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1069
    "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
  1070
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1071
    |values|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1072
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1073
    values := OrderedCollection new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1074
    self do:[:v | values add:v].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1075
    ^ values
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1076
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1077
    "Created: 20.6.1997 / 16:58:28 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1078
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1079
13540
37ff6f12f224 changed: #start
Claus Gittinger <cg@exept.de>
parents: 13539
diff changeset
  1080
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1081
!Smalltalk class methodsFor:'browsing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1082
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1083
browseAllCallsOn:aSelectorSymbol
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1084
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1085
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1086
    "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
  1087
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1088
    UserPreferences systemBrowserClass browseAllCallsOn:aSelectorSymbol
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1089
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1090
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1091
     Smalltalk browseAllCallsOn:#at:put:
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1092
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1093
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1094
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1095
browseAllSelect:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1096
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1097
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1098
    "startup a browser for all methods for which aBlock returns true"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1099
6020
555c690e6616 UserPreference access
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  1100
    UserPreferences systemBrowserClass browseAllSelect:aBlock
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1101
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1102
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1103
     Smalltalk browseAllSelect:[:m | m literals isNil]
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1104
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1105
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1106
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1107
browseChanges
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1108
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1109
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1110
    "startup a changes browser"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1111
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1112
    ChangesBrowser notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1113
	ChangesBrowser open
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1114
    ] ifFalse:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1115
	self warn:'no ChangesBrowser built in'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1116
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1117
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1118
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1119
     Smalltalk browseChanges
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1120
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1121
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1122
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1123
browseClass:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1124
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1125
11375
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  1126
    "startup a browser on aClass.
11150
be60e4505904 comments
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  1127
     The broser will only show that class (i.e. be a singleClass-browser).
be60e4505904 comments
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  1128
     See browseInClass: for a full browser, which has aClass selected initially."
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1129
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1130
    UserPreferences systemBrowserClass browseClass:aClass
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1131
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1132
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1133
     Smalltalk browseClass:Array
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1134
    "
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1135
!
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1136
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1137
browseImplementorsMatching:aSelectorSymbolOrMatchPattern
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1138
    "{ Pragma: +optSpace }"
6819
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
  1139
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
  1140
    "startup a browser for all methods implementing a message matching"
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
  1141
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1142
    UserPreferences systemBrowserClass browseImplementorsMatching:aSelectorSymbolOrMatchPattern
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1143
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1144
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1145
     Smalltalk browseImplementorsOf:#'at:put:'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1146
     Smalltalk browseImplementorsMatching:#'at:*'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1147
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1148
!
6819
6b7885c187d5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6806
diff changeset
  1149
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1150
browseImplementorsOf:aSelectorSymbol
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1151
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1152
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1153
    "startup a browser for all methods implementing a particular message"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1154
6020
555c690e6616 UserPreference access
Claus Gittinger <cg@exept.de>
parents: 5940
diff changeset
  1155
    UserPreferences systemBrowserClass browseImplementorsOf:aSelectorSymbol
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1156
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1157
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1158
     Smalltalk browseImplementorsOf:#at:put:
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1159
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1160
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1161
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1162
browseInClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1163
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1164
11150
be60e4505904 comments
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  1165
    "startup a full browser showing aClass.
be60e4505904 comments
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  1166
     The browser will be a full browser with aClass initially selekted.
be60e4505904 comments
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  1167
     See browseClass: for a singleClass browser, which shows only a single class."
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1168
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1169
    UserPreferences systemBrowserClass openInClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1170
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1171
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1172
     Smalltalk browseInClass:Array
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1173
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1174
!
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1175
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1176
browseInClass:aClass selector:selector
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1177
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1178
11150
be60e4505904 comments
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  1179
    "startup a full browser showing aClass>>selector.
be60e4505904 comments
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  1180
     The browser will be a full browser with aClass initially selekted.
be60e4505904 comments
Claus Gittinger <cg@exept.de>
parents: 11108
diff changeset
  1181
     See browseClass: for a singleClass browser, which shows only a single class."
6970
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1182
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1183
    UserPreferences systemBrowserClass openInClass:aClass selector:selector
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1184
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1185
    "
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1186
     Smalltalk browseInClass:Array selector:#at:
ac358e651731 more browsing
Claus Gittinger <cg@exept.de>
parents: 6929
diff changeset
  1187
    "
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1188
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1189
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  1190
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1191
!Smalltalk class methodsFor:'class management'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1192
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1193
changeCategoryOf:aClass to:newCategory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1194
    "change a classes category, add a change record,
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1195
     send change notifications"
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1196
8405
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1197
    |ns oldCategory|
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1198
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1199
    oldCategory := aClass category.
079fd61dc699 *** empty log message ***
ca
parents: 8383
diff changeset
  1200
    oldCategory ~= newCategory ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1201
	aClass category:(newCategory withoutSeparators asSymbol).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1202
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1203
	"notify change of category"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1204
	ns := aClass environment ? self.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1205
	ns changed:#organization with:(aClass -> oldCategory).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1206
	ns ~~ self ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1207
	    self changed:#organization with:(aClass -> oldCategory).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1208
	]
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1209
    ].
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1210
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1211
    "
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1212
     Smalltalk changeCategoryOf:NewApplication to:#myApplications
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1213
    "
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1214
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1215
    "Modified: / 11.2.2000 / 11:36:27 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1216
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1217
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1218
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
  1219
    NameSpace name:name
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1220
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1221
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1222
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1223
flushCachedClass:aClass
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1224
    CachedClasses notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1225
	CachedClasses remove:aClass ifAbsent:[].
12700
5af24c64fbed changed:
Claus Gittinger <cg@exept.de>
parents: 12645
diff changeset
  1226
    ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1227
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1228
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1229
flushCachedClasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1230
    CachedClasses := nil.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1231
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1232
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1233
     Smalltalk flushCachedClasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1234
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1235
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1236
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1237
removeClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1238
    "remove the argument, aClass from the smalltalk dictionary;
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1239
     we have to flush the caches since these methods are now void.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1240
     Also, class variables of aClass are removed."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1241
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1242
    |sym cSym names oldName oldNameSym actualName wrongName ns ons|
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1243
4099
f6984fc5cb6c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4096
diff changeset
  1244
    aClass isNil ifTrue:[^ self].
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1245
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1246
    oldName := aClass name.
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1247
    sym := oldNameSym := oldName asSymbol.
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1248
    ((self at:oldNameSym) == aClass) ifFalse:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1249
	"check other name ..."
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1250
	(self includes:aClass) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1251
	    'Smalltalk [warning]: no such class: ' errorPrint. oldName errorPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1252
	    ^ self
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1253
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1254
	"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1255
	 the class has changed its name - without telling me ...
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1256
	 what should be done in this case ?
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1257
	"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1258
	'Smalltalk [warning]: class ' errorPrint. oldName errorPrint.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1259
	' has changed its name' errorPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1260
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1261
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1262
	"/ might be an alias (i.e. removing a compatibility name)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1263
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1264
	actualName := self keyAtValue:aClass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1265
	('Smalltalk [info]: ' , oldName , ' is actually stored as ' , actualName , '.') infoPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1266
	sym := actualName asSymbol.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1267
	oldName := actualName asString.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1268
	wrongName := true.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1269
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1270
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1271
    ns := aClass nameSpace.
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1272
    aClass topOwningClass notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1273
	ons := aClass topOwningClass nameSpace
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1274
    ].
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1275
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1276
    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
  1277
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1278
    "/
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1279
    "/ 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
  1280
    "/
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1281
    "/ self removeKey:sym.     "/ remove key - this actually fails, if there are
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1282
			       "/ still compiled code references."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1283
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1284
    "remove private classes"
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1285
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1286
    aClass privateClassesSorted do:[:somePrivateClass |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1287
	aClass privateClassesAt:(somePrivateClass nameWithoutPrefix) asSymbol put:nil.
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1288
    ].
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1289
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1290
    "remove class variables"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1291
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1292
    names := aClass classVariableString asCollectionOfWords.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1293
    names do:[:name |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1294
	cSym := aClass globalKeyForClassVar:name.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1295
	self at:cSym asSymbol put:nil.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1296
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1297
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1298
	"/ see comment in removeKey: on why we dont remove it here
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1299
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1300
	"/ self removeKey:cSym
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1301
    ].
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1302
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1303
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1304
"/    actually could get along with less flushing
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1305
"/    (entries for aClass and subclasses only)
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1306
"/    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
  1307
"/    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
  1308
"/    expensive then cache flushing.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1309
"/
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1310
"/    aClass allSubclassesDo:[:aSubclass |
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1311
"/        ObjectMemory flushInlineCachesForClass:aSubclass.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1312
"/        ObjectMemory flushMethodCacheFor:aSubclass
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1313
"/    ].
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1314
"/    ObjectMemory flushInlineCachesForClass:aClass.
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1315
"/    ObjectMemory flushMethodCacheFor:aClass
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1316
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1317
    ObjectMemory flushInlineCaches.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1318
    ObjectMemory flushMethodCache.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1319
7181
7382117bf3fa james' package changes
james
parents: 7126
diff changeset
  1320
    aClass addChangeRecordForClassRemove.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1321
    self changed:#classRemove with:aClass.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1322
7581
6912a7336e15 class category: sends a change notification;
Claus Gittinger <cg@exept.de>
parents: 7572
diff changeset
  1323
    aClass setCategory:#'* removed *'.
1655
fb6ee1b55ec4 use *-categories
Claus Gittinger <cg@exept.de>
parents: 1650
diff changeset
  1324
12700
5af24c64fbed changed:
Claus Gittinger <cg@exept.de>
parents: 12645
diff changeset
  1325
"/    self flushCachedClasses.
5af24c64fbed changed:
Claus Gittinger <cg@exept.de>
parents: 12645
diff changeset
  1326
"/    Class flushSubclassInfo.
5af24c64fbed changed:
Claus Gittinger <cg@exept.de>
parents: 12645
diff changeset
  1327
    self flushCachedClass:aClass.
5af24c64fbed changed:
Claus Gittinger <cg@exept.de>
parents: 12645
diff changeset
  1328
    Class flushSubclassInfoFor:aClass superclass.
5af24c64fbed changed:
Claus Gittinger <cg@exept.de>
parents: 12645
diff changeset
  1329
    Class flushSubclassInfoFor:aClass.
5326
8950253bef78 flush subclass info when removing classes
ca
parents: 5322
diff changeset
  1330
3627
452f2e1ff1b4 removeClass - care for aliases.
Claus Gittinger <cg@exept.de>
parents: 3626
diff changeset
  1331
    wrongName == true ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1332
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1333
	"/ an alias (i.e. removing a compatibility name)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1334
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1335
	"/ check if there are more refs to it ...
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1336
	[self includes:aClass] whileTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1337
	    actualName := self keyAtValue:aClass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1338
	    ('Smalltalk [info]: ' , aClass name , ' is also registered under the name ' , actualName
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1339
			  , ' - remove that binding too.') infoPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1340
	    self at:actualName put:nil.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1341
	].
4724
44793fe70787 recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents: 4723
diff changeset
  1342
    ].
44793fe70787 recompile ns classes after a class remove
Claus Gittinger <cg@exept.de>
parents: 4723
diff changeset
  1343
4781
631eb425ea4e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4770
diff changeset
  1344
    ns ~~ Smalltalk ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1345
	ons notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1346
	    ClassBuilder
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1347
		recompileGlobalAccessorsTo:oldNameSym
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1348
		in:ons
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1349
		except:nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1350
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1351
	(ns notNil and:[ns ~~ ons]) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1352
	    ClassBuilder
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1353
		recompileGlobalAccessorsTo:oldNameSym
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1354
		in:ns
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1355
		except:nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1356
	].
10182
bcb8791d473b code reuse
Claus Gittinger <cg@exept.de>
parents: 10173
diff changeset
  1357
    ].
bcb8791d473b code reuse
Claus Gittinger <cg@exept.de>
parents: 10173
diff changeset
  1358
bcb8791d473b code reuse
Claus Gittinger <cg@exept.de>
parents: 10173
diff changeset
  1359
    "Modified: / 18-11-2006 / 17:16:31 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1360
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1361
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1362
renameClass:aClass to:newName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1363
    "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
  1364
     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
  1365
     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
  1366
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1367
    |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
  1368
     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
  1369
     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
  1370
     oldMetaclass newMetaclass newCategory|
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1371
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1372
    "/ check for all intermediate namespaces / owning classes
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1373
    i1 := 1.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1374
    i2 := 1.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1375
    ns := self.
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1376
    [i2 ~~ 0] whileTrue:[
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1377
        i2 := newName indexOfSubCollection:'::' startingAt:i1.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1378
        i2 ~~ 0 ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1379
            nm := newName copyFrom:i1 to:i2-1.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1380
            ns isNameSpace ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1381
                subns := ns at:nm asSymbol ifAbsent:nil.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1382
                subns isNil ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1383
                    self error:'Nonexisting namespace: ',nm.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1384
                    ^ nil.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1385
                ].
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1386
            ] ifFalse:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1387
                subns := ns privateClassesAt:nm asSymbol.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1388
                subns isNil ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1389
                    self error:'Cannot create a namespace below a class'
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1390
                ]
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1391
            ].
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1392
            ns := subns.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1393
            i1 := i2 + 2.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1394
        ].
5253
c6b2933882fe rename with namespace involved;
Claus Gittinger <cg@exept.de>
parents: 5247
diff changeset
  1395
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1396
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1397
    oldName := aClass name.
6734
dd9fa2d81cb9 use #topNameSpace
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
  1398
    oldNameSpace := aClass topNameSpace.
2319
640bb389f90a recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1399
    oldBaseName := aClass nameWithoutNameSpacePrefix.
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1400
    oldBaseNameWithoutPrefix := aClass nameWithoutPrefix.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1401
    oldSym := oldName asSymbol.
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1402
    privateClasses := aClass privateClassesSorted.
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1403
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1404
    ((self at:oldSym) ~~ aClass) ifTrue:[
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1405
        'Smalltalk [warning]: rename failed - name is different from key' errorPrintCR.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1406
        ^ self
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1407
    ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1408
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1409
    "/ rename the class
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1410
1847
6e567214b167 care for className being a symbol, when renaming classes
Claus Gittinger <cg@exept.de>
parents: 1758
diff changeset
  1411
    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
  1412
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1413
    "/ change the owning class
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1414
    ns isNameSpace ifFalse:[
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1415
        aClass isPrivate ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1416
            aClass class setOwningClass:ns.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1417
        ] ifFalse:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1418
            "/ sigh - must make a PrivateMetaclass from Metaclass
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1419
            oldMetaclass := aClass class.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1420
            newMetaclass := PrivateMetaclass new.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1421
            newMetaclass flags:(oldMetaclass flags).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1422
            newMetaclass setSuperclass:(oldMetaclass superclass).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1423
            newMetaclass instSize:(oldMetaclass instSize).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1424
            newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1425
            newMetaclass setMethodDictionary:(oldMetaclass methodDictionary).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1426
            newMetaclass setSoleInstance:aClass.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1427
            newMetaclass setOwningClass:ns.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1428
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1429
            aClass changeClassTo:newMetaclass.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1430
            ObjectMemory flushCaches.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1431
        ]
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1432
    ] ifTrue:[
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1433
        aClass isPrivate ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1434
            newCategory := aClass topOwningClass category.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1435
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1436
            "/ sigh - must make a Metaclass from PrivateMetaclass
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1437
            oldMetaclass := aClass class.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1438
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1439
            newMetaclass := Metaclass new.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1440
            newMetaclass flags:(oldMetaclass flags).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1441
            newMetaclass setSuperclass:(oldMetaclass superclass).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1442
            newMetaclass instSize:(oldMetaclass instSize).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1443
            newMetaclass setInstanceVariableString:(oldMetaclass instanceVariableString).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1444
            newMetaclass setMethodDictionary:(oldMetaclass methodDictionary).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1445
            newMetaclass setSoleInstance:aClass.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1446
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1447
            aClass category:newCategory.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1448
            aClass changeClassTo:newMetaclass.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1449
            ObjectMemory flushCaches.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1450
        ]
5610
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1451
    ].
af0d91fe32fc rename fixed (if it implies a nameSpace or ownership change)
Claus Gittinger <cg@exept.de>
parents: 5601
diff changeset
  1452
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1453
    aClass setName:newSym.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1454
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1455
    "/ store it in Smalltalk
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1456
    self at:oldSym put:nil.
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  1457
878
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1458
    "/
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1459
    "/ 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
  1460
    "/
c09b016c6674 do not remove a global-assoc when classes are removed (see comment there)
Claus Gittinger <cg@exept.de>
parents: 857
diff changeset
  1461
    "/ self removeKey:oldSym.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1462
    self at:newSym put:aClass.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1463
1525
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1464
    "/ 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
  1465
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1466
    oldNameToNewName := IdentityDictionary new.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1467
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1468
    names := aClass classVariableString asCollectionOfWords.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1469
    names do:[:name |
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1470
        oldCVSym := (oldSym , ':' , name) asSymbol.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1471
        value := self at:oldCVSym.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1472
        self at:oldCVSym put:nil.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1473
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1474
        "/
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1475
        "/ see comment in #removeKey: on why we dont remove it it here
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1476
        "/
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1477
        "/ self removeKey:cSym.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1478
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1479
        newCVSym := (newSym , ':' , name) asSymbol.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1480
        self at:newCVSym put:value.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1481
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1482
        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
  1483
    ].
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1484
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1485
    "/ 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
  1486
935b12ecf8ff in renameClass: patch literals of all methods to access the renamed
Claus Gittinger <cg@exept.de>
parents: 1481
diff changeset
  1487
    oldNameToNewName keysAndValuesDo:[:oldNameSym :newNameSym |
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1488
        aClass withAllSubclasses do:[:aSubClass |
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1489
            Transcript showCR:'changing global accesses from ''' , oldNameSym , ''' into ''' , newNameSym , ''' in class: ''' , aSubClass name , ''' ...'.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1490
            aSubClass instAndClassSelectorsAndMethodsDo:[:sel :aMethod |
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1491
                aMethod changeLiteral:oldNameSym to:newNameSym
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1492
            ].
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1493
        ].
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1494
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1495
        "/ and also in privateClasses ? ...
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1496
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1497
"/        privateClasses size > 0 ifTrue:[
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1498
"/            privateClasses do:[:aPrivateClass |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1499
"/                aPrivateClass withAllSubclasses do:[:aSubClass |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1500
"/                    aSubClass class methodDictionary do:[:aMethod |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1501
"/                        aMethod changeLiteral:oldNameSym to:newNameSym
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1502
"/                    ].
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1503
"/                    aSubClass methodDictionary do:[:aMethod |
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1504
"/                        aMethod changeLiteral:oldNameSym to:newNameSym
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1505
"/                    ]
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1506
"/                ].
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1507
"/            ]
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1508
"/        ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1509
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1510
2270
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1511
    aClass addChangeRecordForClassRename:oldSym to:newSym.
76c239686353 when renaming a class, also rename any private classes.
Claus Gittinger <cg@exept.de>
parents: 2249
diff changeset
  1512
5333
d80386e06d21 rename into other namespace did not work
Claus Gittinger <cg@exept.de>
parents: 5328
diff changeset
  1513
    "/ 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
  1514
    aClass setEnvironment:nil.
6734
dd9fa2d81cb9 use #topNameSpace
Claus Gittinger <cg@exept.de>
parents: 6722
diff changeset
  1515
    newNameSpace := aClass topNameSpace.
2405
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1516
2485
9f4a11a4521f new #privateClasses semantic
Claus Gittinger <cg@exept.de>
parents: 2476
diff changeset
  1517
    privateClasses size > 0 ifTrue:[
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1518
        "/ must rename privateClasses as well
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1519
        Class withoutUpdatingChangesDo:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1520
            privateClasses do:[:aPrivateClass |
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1521
                self renameClass:aPrivateClass
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1522
                     to:(newSym , '::' , aPrivateClass nameWithoutPrefix).
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1523
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1524
                Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldName , '::' , aPrivateClass nameWithoutPrefix , ''' ...'.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1525
                aClass theNonMetaclass recompileMethodsAccessingGlobal:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1526
                aClass theMetaclass recompileMethodsAccessingGlobal:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1527
                aClass theNonMetaclass recompileMethodsAccessingGlobal:(aPrivateClass nameWithoutPrefix) asSymbol.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1528
                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
  1529
"/                ClassBuilder
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1530
"/                    recompileGlobalAccessorsTo:(oldName , '::' , aPrivateClass nameWithoutPrefix) asSymbol
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1531
"/                    in:newNameSpace
9822
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1532
"/                    except:nil.
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1533
            ]
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1534
        ]
2405
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1535
    ].
939f4e751ef3 dont forget to rename private classes as well.
Claus Gittinger <cg@exept.de>
parents: 2379
diff changeset
  1536
2319
640bb389f90a recompile when moving classes across namespaces
Claus Gittinger <cg@exept.de>
parents: 2317
diff changeset
  1537
    oldNameSpace ~~ newNameSpace ifTrue:[
5246
2ca7b20c4108 create namespaces as requried, when renaming a class
Claus Gittinger <cg@exept.de>
parents: 5214
diff changeset
  1538
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1539
        "/ all those referencing the class from the old nameSpace
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1540
        "/ must be recompiled ...
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1541
        "/ (to now access the global from smalltalk)
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1542
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1543
        oldNameSpace ~~ Smalltalk ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1544
            Transcript showCR:'recompiling methods in ''' , oldNameSpace name , ''' accessing ''' , oldName , ''' ...'.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1545
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1546
            ClassBuilder
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1547
                recompileGlobalAccessorsTo:oldName asSymbol
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1548
                in:oldNameSpace
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1549
                except:nil.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1550
        ].
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1551
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1552
        "/ all referencing the class in the new namespace
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1553
        "/ as well; to now access the new class.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1554
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1555
        (newNameSpace notNil and:[newNameSpace ~~ Smalltalk]) ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1556
            Transcript showCR:'recompiling methods in ''' , newNameSpace name , ''' accessing ''' , oldBaseName , ''' ...'.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1557
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1558
            ClassBuilder
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1559
                recompileGlobalAccessorsTo:oldBaseName asSymbol
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1560
                in:newNameSpace
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1561
                except:nil.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1562
        ].
3698
8bce45214d24 fixed renaming of a private class (must recompile owner)
Claus Gittinger <cg@exept.de>
parents: 3678
diff changeset
  1563
    ] ifFalse:[
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1564
        "/ all references to a global with my new name in my owning class
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1565
        "/ must now be redirected to myself.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1566
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1567
        aClass isPrivate ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1568
            newBaseName := aClass nameWithoutNameSpacePrefix.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1569
            newBaseNameWithoutPrefix := aClass nameWithoutPrefix.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1570
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1571
            Transcript showCR:'recompiling methods accessing ''' , oldBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1572
            aClass owningClass recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1573
            aClass owningClass class recompileMethodsAccessingGlobal:oldBaseNameWithoutPrefix.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1574
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1575
            Transcript showCR:'recompiling methods accessing ''' , oldBaseName , ''' in: ''' , aClass owningClass name , ''' ...'.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1576
            aClass owningClass recompileMethodsAccessingGlobal:oldBaseName.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1577
            aClass owningClass class recompileMethodsAccessingGlobal:oldBaseName.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1578
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1579
            Transcript showCR:'recompiling methods accessing ''' , newBaseNameWithoutPrefix , ''' in: ''' , aClass owningClass name , ''' ...'.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1580
            aClass owningClass recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1581
            aClass owningClass class recompileMethodsAccessingGlobal:newBaseNameWithoutPrefix.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1582
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1583
            Transcript showCR:'recompiling methods accessing ''' , newBaseName , ''' in: ''' , aClass owningClass name , ''' ...'.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1584
            aClass owningClass recompileMethodsAccessingGlobal:newBaseName.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1585
            aClass owningClass class recompileMethodsAccessingGlobal:newBaseName.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1586
        ]
4040
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1587
    ].
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1588
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1589
    aClass changed:#definition.
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1590
    "/ 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
  1591
    aClass allSubclassesDo:[:subClass |
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1592
        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
  1593
    ].
facae0a118da when a class is renamed, add change records for all subclasses
Claus Gittinger <cg@exept.de>
parents: 7992
diff changeset
  1594
    "/ 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
  1595
    aClass subclassesDo:[:subClass |
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1596
        subClass addChangeRecordForClass:subClass.
4040
b27f87d9772d must send a change-notifiction, when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 4028
diff changeset
  1597
    ].
5613
b534e427f028 change message when renaming a class
Claus Gittinger <cg@exept.de>
parents: 5611
diff changeset
  1598
    self changed:#definition.
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  1599
    self 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
  1600
9822
38acd1c5eeab recompile methods which access private classes when renaming a class.
Claus Gittinger <cg@exept.de>
parents: 9819
diff changeset
  1601
    "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
  1602
    "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
  1603
    "Modified: / 05-09-2006 / 12:52:25 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1604
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1605
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  1606
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1607
!Smalltalk class methodsFor:'copying'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1608
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1609
deepCopy
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1610
    "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
  1611
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1612
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1613
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1614
    "Modified: 18.5.1996 / 12:13:33 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1615
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1616
10952
16d46611f7ae deepCopy change
ab
parents: 10904
diff changeset
  1617
deepCopyUsing:aDictionary postCopySelector:postCopySelector
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1618
    "return a deep copy of the receiver.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1619
     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
  1620
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1621
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1622
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1623
    "Modified: 18.5.1996 / 12:13:36 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1624
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1625
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1626
shallowCopy
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1627
    "redefined to return self - there is only one Smalltalk dictionary"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1628
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1629
    ^ self
1410
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1630
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1631
    "Modified: 18.5.1996 / 12:13:39 / cg"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1632
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1633
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1634
simpleDeepCopy
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1635
    "redefined to return self - there is only one Smalltalk dictionary"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1636
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1637
    ^ self
1410
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1638
518bf8454809 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1307
diff changeset
  1639
    "Modified: 18.5.1996 / 12:13:42 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1640
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1641
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  1642
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  1643
!Smalltalk class methodsFor:'debugging ST/X'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1644
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1645
compileTrace:aBoolean
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1646
    "dump generated inline code (NOOP if VM was compiled without the trace-debug option)"
7325
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1647
%{
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1648
    extern char __compileTrace__;
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1649
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1650
    __compileTrace__ = (aBoolean == true) ? 1 : 0;
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1651
%}
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1652
    "
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1653
     Smalltalk compileTrace:true
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1654
     Smalltalk compileTrace:false
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1655
    "
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1656
!
f424d3e7978f checkin from browser
Claus Gittinger <cg@exept.de>
parents: 7295
diff changeset
  1657
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1658
debugBreakPoint
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1659
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1660
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1661
    "call the dummy debug function, on which a breakpoint
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1662
     can be put in adb, sdb, dbx or gdb.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1663
     WARNING: this method is for debugging only
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1664
	      it will be removed without notice."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1665
%{
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1666
    __PATCHUPCONTEXTS(__context);
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1667
    __debugBreakPoint__();
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1668
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1669
    ^ self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1670
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1671
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1672
exitWithCoreDump
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1673
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1674
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1675
    "abort program and dump core"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1676
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1677
    OperatingSystem exitWithCoreDump
4096
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1678
    "/ never returns
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1679
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1680
    "Be careful evaluating this
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1681
     Smalltalk exitWithCoreDump
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1682
    "
d292495070db exitWithCoreDump was duplicate
Claus Gittinger <cg@exept.de>
parents: 4067
diff changeset
  1683
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1684
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1685
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1686
fatalAbort
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1687
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1688
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1689
    "report a fatal-error, print a stack backtrace and exit with core dump.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1690
     (You may turn off the stack print with debugPrinting:false)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1691
%{
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1692
    __fatal0(__context, "fatalAbort");
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1693
    /* NEVER RETURNS */
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1694
%}.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1695
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1696
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1697
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1698
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1699
fatalAbort:aMessage
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1700
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1701
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1702
    "report a fatal-error; print a stack backtrace and exit with core dump
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1703
     (You may turn off the stack print with debugPrinting:false)"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1704
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1705
%{
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1706
    char *msg;
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1707
12481
805176d238d2 change __isString() to __isStringLike() in primitive code
Stefan Vogel <sv@exept.de>
parents: 12413
diff changeset
  1708
    if (__isStringLike(aMessage))
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1709
	msg = (char *) __stringVal(aMessage);
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1710
    else
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1711
	msg = "fatalAbort";
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1712
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1713
    __fatal0(__context, msg);
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  1714
    /* NEVER RETURNS */
5410
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1715
%}.
859c010edb47 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5406
diff changeset
  1716
    ^ self primitiveFailed
5441
e88302747bbd rel5 migration
Claus Gittinger <cg@exept.de>
parents: 5427
diff changeset
  1717
!
e88302747bbd rel5 migration
Claus Gittinger <cg@exept.de>
parents: 5427
diff changeset
  1718
13135
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1719
ignoreHalt
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1720
    "return true, if halts are ignored.
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1721
     Usually, this is done in standAlone applications"
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1722
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1723
    IgnoreHalt isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1724
	^  self isStandAloneApp
13135
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1725
    ].
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1726
    ^ IgnoreHalt
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1727
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1728
    "Created: / 18-11-2010 / 11:20:16 / cg"
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1729
!
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1730
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1731
ignoreHalt:aBoolean
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1732
    "control if halts are to be ignored;
13135
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1733
     usually, this is done in standAlone applications"
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1734
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1735
    IgnoreHalt := aBoolean
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1736
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1737
    "
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1738
     Smalltalk ignoreHalt:true.
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1739
     self halt.
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1740
     Smalltalk ignoreHalt:false.
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1741
     self halt.
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1742
    "
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1743
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1744
    "Created: / 18-11-2010 / 11:20:27 / cg"
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1745
!
1031ffdd98fd ignoreHalt is now a classVar
Claus Gittinger <cg@exept.de>
parents: 13129
diff changeset
  1746
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1747
vmInstructionTrace:aBoolean
13947
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  1748
    self halt:'not yet implemented'
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  1749
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  1750
    "Modified: / 19-01-2012 / 10:15:35 / cg"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1751
! !
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1752
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  1753
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1754
!Smalltalk class methodsFor:'enumerating'!
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1755
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1756
allBehaviorsDo:aBlock
5580
374e843aa424 allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents: 5579
diff changeset
  1757
    "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
  1758
374e843aa424 allBehaviorsDo now enumerates both classes and metaclasses
Claus Gittinger <cg@exept.de>
parents: 5579
diff changeset
  1759
    self allClassesAndMetaclassesDo:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1760
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1761
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1762
     Smalltalk allBehaviorsDo:[:aClass | aClass name printCR]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1763
    "
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1764
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1765
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1766
allClassCategories
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1767
    "return a set of all class categories in the system"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1768
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1769
    |allCategories|
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1770
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1771
    allCategories := Set new.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1772
    Smalltalk allClassesDo:[:cls |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1773
	|category|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1774
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1775
	category := cls category.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1776
	category notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1777
	    allCategories add:category.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1778
	].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1779
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1780
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1781
    ^ allCategories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1782
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1783
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1784
     Smalltalk allClassCategories
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1785
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1786
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1787
    "Created: / 17.11.2001 / 12:13:09 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1788
!
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1789
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1790
allClassesAndMetaclassesDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1791
    "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
  1792
5940
804fb27727a6 oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents: 5916
diff changeset
  1793
    |already|
804fb27727a6 oops - allClassesAndMetaclassesDo: evaluated block twice for
Claus Gittinger <cg@exept.de>
parents: 5916
diff changeset
  1794
12861
5086a864ae3e changed:
Claus Gittinger <cg@exept.de>
parents: 12813
diff changeset
  1795
    already := IdentitySet new:NumberOfClassesHint*2.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1796
    self allClassesDo:[:eachClass |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1797
	|cls|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1798
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1799
	cls := eachClass theNonMetaclass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1800
	(already includes:cls) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1801
	    aBlock value:cls.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1802
	    already add:cls.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1803
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1804
	cls := cls class.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1805
	(already includes:cls) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1806
	    aBlock value:cls.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1807
	    already add:cls.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1808
	].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1809
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1810
!
5579
26af506d271e added #allClassesAndMetaclasses
Claus Gittinger <cg@exept.de>
parents: 5550
diff changeset
  1811
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1812
allClassesDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1813
    "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
  1814
5765
152a485288d9 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5760
diff changeset
  1815
    self allClasses do:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1816
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1817
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1818
     Smalltalk allClassesDo:[:aClass | aClass name printCR]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1819
    "
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1820
!
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1821
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1822
allClassesForWhich:filter
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1823
    "return a collection with all classes in the system,
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1824
     for which filter evaluates to true."
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1825
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1826
    |collectedClasses|
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1827
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1828
    collectedClasses := OrderedCollection new.
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1829
    self allClassesForWhich:filter do:[:cls |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1830
	collectedClasses add:cls
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1831
    ].
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1832
    ^ collectedClasses
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1833
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1834
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1835
     Smalltalk
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1836
	allClassesForWhich:[:cls | cls name startsWith:'Po']
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1837
    "
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1838
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1839
    "Created: / 10-08-2006 / 12:11:31 / cg"
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1840
!
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1841
9292
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1842
allClassesForWhich:filter do:aBlock
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1843
    "evaluate the argument, aBlock for all classes in the system, for which filter evaluates to true."
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1844
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1845
    self allClassesDo:[:cls |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1846
	(filter value:cls) ifTrue:[ aBlock value:cls ].
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1847
    ].
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1848
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1849
    "
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1850
     Smalltalk
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1851
	allClassesForWhich:[:cls | cls name startsWith:'Po']
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1852
	do:[:aClass | Transcript showCR:aClass name]
9292
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1853
    "
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1854
!
55e130e5f24b +allClassesForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 9290
diff changeset
  1855
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1856
allClassesInCategory:aCategory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1857
    "return a collection of for all classes in aCategory;
1299
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1858
     The order of the classes is not defined."
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1859
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1860
    ^ self allClassesForWhich:[:cls | cls category = aCategory]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1861
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1862
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1863
     Smalltalk allClassesInCategory:'Views-Basic'
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1864
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1865
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1866
    "Modified: / 10-08-2006 / 12:13:32 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1867
!
1299
8f49ec04c9f8 documentation
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
  1868
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1869
allClassesInCategory:aCategory do:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1870
    "evaluate the argument, aBlock for all classes in the aCategory;
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1871
     The order of the classes is not defined."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1872
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1873
    aCategory notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1874
	self allClassesForWhich:[:cls | cls category = aCategory] do:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1875
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1876
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1877
    "
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1878
     Smalltalk allClassesInCategory:'Views-Basic' do:[:aClass | Transcript showCR:aClass]
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1879
    "
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1880
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1881
    "Modified: / 09-08-2006 / 17:18:50 / fm"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1882
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1883
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1884
allClassesInCategory:aCategory inOrderDo:aBlock
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1885
    "evaluate the argument, aBlock for all classes in aCategory;
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1886
     superclasses come first - then subclasses"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1887
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1888
    |classes|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1889
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1890
    aCategory notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1891
	classes := OrderedCollection new.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1892
	self allClassesInCategory:aCategory do:[:aClass |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1893
	    classes add:aClass
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1894
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1895
	classes topologicalSort:[:a :b | b isSubclassOf:a].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1896
	classes do:aBlock
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1897
    ]
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1898
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1899
    "
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  1900
     Smalltalk allClassesInCategory:'Views-Basic' inOrderDo:[:aClass | aClass name printCR]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  1901
    "
6217
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1902
e0f4f3959c49 reuse allClassesInCategory-stuff
Claus Gittinger <cg@exept.de>
parents: 6188
diff changeset
  1903
    "Modified: / 17.11.2001 / 12:18:15 / cg"
8583
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
allClassesInOrderDo:aBlock
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  1907
    "evaluate the argument, aBlock for all classes in the system;
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1908
     Evaluation order is by inheritance: superclasses come first."
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1909
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1910
    |already|
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1911
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1912
    already := IdentitySet new:NumberOfClassesHint.
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1913
    self allClassesDo:[:eachClass |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1914
	(already includes:eachClass) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1915
	    eachClass allSuperclasses reverseDo:[:eachSuperClass |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1916
		(already includes:eachSuperClass) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1917
		    already add:eachSuperClass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1918
		    aBlock value:eachSuperClass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1919
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1920
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1921
	    already add:eachClass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1922
	    aBlock value:eachClass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1923
	]
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1924
    ].
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1925
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1926
    "
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  1927
     Smalltalk allClassesInOrderDo:[:aClass | Transcript showCR:aClass name]
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  1928
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1929
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1930
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1931
allClassesInPackage:aPackageID
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1932
    "evaluate the argument, aBlock for all classes a package;
10087
eb69f28fda88 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10072
diff changeset
  1933
     The order of the classes is not defined.
eb69f28fda88 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10072
diff changeset
  1934
     The returned collection may include private classes"
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1935
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1936
    ^ self allClassesForWhich:[:cls | cls package = aPackageID]
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1937
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1938
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1939
     Smalltalk allClassesInPackage:'bosch:dapasx'
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1940
    "
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1941
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1942
    "Created: / 10-08-2006 / 12:14:10 / cg"
10087
eb69f28fda88 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10072
diff changeset
  1943
    "Modified: / 12-10-2006 / 23:48:43 / cg"
9506
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1944
!
93a214ce5997 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9496
diff changeset
  1945
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1946
allClassesInPackage:aPackageID do:aBlock
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1947
    "evaluate the argument, aBlock for all classes a package;
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1948
     The order of the classes is not defined."
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1949
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1950
    ^ self allClassesForWhich:[:cls | cls package = aPackageID] do:aBlock
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1951
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1952
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  1953
     Smalltalk allClassesInPackage:'bosch:dapasx' do:[:aClass | Transcript showCR:aClass]
9490
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1954
    "
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1955
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1956
    "Created: / 09-08-2006 / 17:14:17 / fm"
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1957
!
b49c5629be33 *** empty log message ***
fm
parents: 9468
diff changeset
  1958
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1959
allKeysDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1960
    "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
  1961
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1962
    ^ self keysDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1963
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1964
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1965
allMethodCategories
12298
c7d9adb49803 code cleanup
Claus Gittinger <cg@exept.de>
parents: 12287
diff changeset
  1966
    "return a set of all method-categories (protocols) in the system"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1967
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1968
    |allCategories|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1969
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1970
    allCategories := Set new.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1971
    Smalltalk allClassesDo:[:cls |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1972
	allCategories addAll:cls categories.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1973
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1974
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1975
    ^ allCategories.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1976
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1977
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1978
     Smalltalk allMethodCategories
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1979
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  1980
!
6722
8388292bc41d allClassesImplementing & allMethodCategories
Claus Gittinger <cg@exept.de>
parents: 6715
diff changeset
  1981
9259
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1982
allMethodsDo:aBlock
12298
c7d9adb49803 code cleanup
Claus Gittinger <cg@exept.de>
parents: 12287
diff changeset
  1983
    "enumerate all methods in all classes"
12000
21c4d24bdd34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11977
diff changeset
  1984
9259
7480ca3bdca9 allMethodsDo: utility
Claus Gittinger <cg@exept.de>
parents: 9254
diff changeset
  1985
    Smalltalk allClassesDo:[:eachClass |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1986
	eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1987
	    aBlock value:mthd
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1988
	]
12298
c7d9adb49803 code cleanup
Claus Gittinger <cg@exept.de>
parents: 12287
diff changeset
  1989
    ].
c7d9adb49803 code cleanup
Claus Gittinger <cg@exept.de>
parents: 12287
diff changeset
  1990
!
c7d9adb49803 code cleanup
Claus Gittinger <cg@exept.de>
parents: 12287
diff changeset
  1991
12300
e72e90ea410f changed: #allMethodsWithSelectorDo:
Claus Gittinger <cg@exept.de>
parents: 12299
diff changeset
  1992
allMethodsWithSelectorDo:aTwoArgBlock
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1993
    "enumerate all methods in all classes and evaluate aBlock
12300
e72e90ea410f changed: #allMethodsWithSelectorDo:
Claus Gittinger <cg@exept.de>
parents: 12299
diff changeset
  1994
     with method and selector as arguments."
12299
3ed13f5685b9 added: #allMethodsForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 12298
diff changeset
  1995
3ed13f5685b9 added: #allMethodsForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 12298
diff changeset
  1996
    Smalltalk allClassesDo:[:eachClass |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1997
	eachClass instAndClassSelectorsAndMethodsDo:[:sel :mthd |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1998
	    aTwoArgBlock value:mthd value:sel
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  1999
	]
12299
3ed13f5685b9 added: #allMethodsForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 12298
diff changeset
  2000
    ].
3ed13f5685b9 added: #allMethodsForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 12298
diff changeset
  2001
!
3ed13f5685b9 added: #allMethodsForWhich:do:
Claus Gittinger <cg@exept.de>
parents: 12298
diff changeset
  2002
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2003
associationsDo:aBlock
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2004
    "evaluate the argument, aBlock for all key/value pairs
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2005
     in the Smalltalk dictionary"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2006
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2007
    self keysDo:[:aKey |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2008
	aBlock value:(aKey -> (self at:aKey))
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2009
    ]
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2010
2588
090cf1da8036 handle abort signal in readEvalPrint loop
Claus Gittinger <cg@exept.de>
parents: 2572
diff changeset
  2011
    "Smalltalk associationsDo:[:assoc | assoc printCR]"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2012
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2013
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2014
basicKeys
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2015
    "for rel > 5 only"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2016
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2017
    self primitiveFailed
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2018
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2019
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2020
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2021
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2022
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2023
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2024
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2025
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2026
do:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2027
    "evaluate the argument, aBlock for all values in the Smalltalk dictionary"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2028
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2029
    |work|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2030
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2031
%{  /* 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
  2032
    __GLOBALS_DO(&aBlock, &work);
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  2033
    RETURN (self);
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  2034
%}.
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  2035
    self keysDo:[:aKey |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2036
	aBlock value:(self at:aKey)
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  2037
    ]
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2038
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2039
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2040
keysAndValuesDo:aBlock
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2041
    "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
  2042
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2043
    self keysDo:[:aKey |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2044
	aBlock value:aKey value:(self at:aKey)
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2045
    ]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2046
!
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2047
9077
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2048
keysAndValuesSelect:selectBlockWith2Args thenCollect:collectBlockWith2Args
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2049
    |collected|
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2050
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2051
    collected := OrderedCollection new.
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2052
    self keysAndValuesDo:[:eachKey :eachValue |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2053
	(selectBlockWith2Args value:eachKey value:eachValue) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2054
	    collected add:(collectBlockWith2Args value:eachKey value:eachValue)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2055
	].
9077
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2056
    ].
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2057
    ^ collected
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2058
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2059
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2060
     Smalltalk
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2061
	keysAndValuesSelect:[:nm :val | (nm startsWith:'Ab') and:[val notNil]]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2062
	thenCollect:[:nm :val | nm]
9077
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2063
    "
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2064
!
327b64542a83 +keysAndValuesSelect:thenCollect:
Claus Gittinger <cg@exept.de>
parents: 9054
diff changeset
  2065
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2066
keysDo:aBlock
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2067
    "evaluate the argument, aBlock for all keys in the Smalltalk dictionary"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2068
    |work|
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2069
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  2070
%{  /* 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
  2071
    __GLOBALKEYS_DO(&aBlock, &work);
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  2072
    RETURN (self);
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  2073
%}.
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  2074
    self basicKeys do:[:aKey |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2075
	aBlock value:aKey
5406
4a6995b61c0e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5400
diff changeset
  2076
    ]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2077
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2078
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  2079
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2080
!Smalltalk class methodsFor:'message control'!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2081
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2082
silentLoading
12408
6075522e358d changed:
Claus Gittinger <cg@exept.de>
parents: 12377
diff changeset
  2083
    "returns the Silentloading class variable, which globally controls if compilation
6075522e358d changed:
Claus Gittinger <cg@exept.de>
parents: 12377
diff changeset
  2084
     messages are shown on the transcript during a fileIn."
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2085
10355
b1cb807fd03c Make sure, that #silentLoading does not return nil
Stefan Vogel <sv@exept.de>
parents: 10329
diff changeset
  2086
     ^ SilentLoading ? false
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2087
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2088
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2089
silentLoading:aBoolean
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2090
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2091
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2092
    "allows access to the Silentloading class variable, which controls
12408
6075522e358d changed:
Claus Gittinger <cg@exept.de>
parents: 12377
diff changeset
  2093
     messages (especially during fileIn) onto the transcript.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2094
     You can save a snapshot with this flag set to true, which makes
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2095
     the image come up silent. Can also be set, to read in files unlogged."
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2096
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2097
    |prev|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2098
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2099
    prev := SilentLoading.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2100
    SilentLoading := aBoolean.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2101
    ^ prev
12409
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2102
!
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2103
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2104
silentlyLoadingDo:aBlock
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2105
    "evaluates aBlock with silent loading on - no compilation messages (except errors)
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2106
     are shown on the transcript"
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2107
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2108
    |sav|
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2109
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2110
    sav := SilentLoading.
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2111
    SilentLoading := true.
f414f3b7e6a0 added: #silentlyLoadingDo:
Claus Gittinger <cg@exept.de>
parents: 12408
diff changeset
  2112
    aBlock ensure:[ SilentLoading := sav ].
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2113
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2114
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  2115
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2116
!Smalltalk class methodsFor:'misc accessing'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2117
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2118
beHeadless:aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2119
    "set/clear the headlessOperation flag."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2120
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2121
    HeadlessOperation := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2122
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2123
10231
905030724b3d +isSTScript query.
Claus Gittinger <cg@exept.de>
parents: 10229
diff changeset
  2124
beSTScript:aBoolean
905030724b3d +isSTScript query.
Claus Gittinger <cg@exept.de>
parents: 10229
diff changeset
  2125
    "set/clear the isSTScript flag."
905030724b3d +isSTScript query.
Claus Gittinger <cg@exept.de>
parents: 10229
diff changeset
  2126
905030724b3d +isSTScript query.
Claus Gittinger <cg@exept.de>
parents: 10229
diff changeset
  2127
    IsSTScript := aBoolean
905030724b3d +isSTScript query.
Claus Gittinger <cg@exept.de>
parents: 10229
diff changeset
  2128
905030724b3d +isSTScript query.
Claus Gittinger <cg@exept.de>
parents: 10229
diff changeset
  2129
    "Created: / 06-12-2006 / 16:43:36 / cg"
905030724b3d +isSTScript query.
Claus Gittinger <cg@exept.de>
parents: 10229
diff changeset
  2130
!
905030724b3d +isSTScript query.
Claus Gittinger <cg@exept.de>
parents: 10229
diff changeset
  2131
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2132
standAloneApp:aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2133
    "set/clear the StandAlone flag."
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
    StandAlone := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2136
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2137
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  2138
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2139
!Smalltalk class methodsFor:'private-system management-packages'!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2140
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2141
knownPackages
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2142
    <resource: #obsolete>
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2143
    self obsoleteMethodWarning.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2144
    ^ KnownPackages ? #()
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2145
!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2146
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2147
loadExtensionsForPackage:aPackageId
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2148
    | extensionsLoaded |
13621
85297bc6cfa8 comment/format in: #loadExtensionsForPackage:
Claus Gittinger <cg@exept.de>
parents: 13602
diff changeset
  2149
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2150
    extensionsLoaded := false.
13621
85297bc6cfa8 comment/format in: #loadExtensionsForPackage:
Claus Gittinger <cg@exept.de>
parents: 13602
diff changeset
  2151
    ProgrammingLanguage allDo:[:lang|
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2152
	extensionsLoaded := extensionsLoaded | (self loadExtensionsForPackage:aPackageId language: lang)
13621
85297bc6cfa8 comment/format in: #loadExtensionsForPackage:
Claus Gittinger <cg@exept.de>
parents: 13602
diff changeset
  2153
    ].
85297bc6cfa8 comment/format in: #loadExtensionsForPackage:
Claus Gittinger <cg@exept.de>
parents: 13602
diff changeset
  2154
    ^ extensionsLoaded
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2155
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2156
    "Modified: / 18-02-2007 / 11:03:26 / cg"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2157
    "Modified: / 02-01-2010 / 10:43:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13621
85297bc6cfa8 comment/format in: #loadExtensionsForPackage:
Claus Gittinger <cg@exept.de>
parents: 13602
diff changeset
  2158
    "Modified (format): / 04-09-2011 / 09:19:24 / cg"
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2159
!
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2160
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2161
loadExtensionsForPackage:aPackageId language: language
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2162
    |mgr packageDirName inStream projectDefinition extensionsFilename mod dir
13621
85297bc6cfa8 comment/format in: #loadExtensionsForPackage:
Claus Gittinger <cg@exept.de>
parents: 13602
diff changeset
  2163
     extensionsRevisionString extensionsRevisionInfo|
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2164
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2165
    language supportsExtensionMethods ifFalse:[^false].
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2166
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2167
    packageDirName := aPackageId copyReplaceAll:$: with:$/.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2168
    packageDirName := self getPackageFileName:packageDirName.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2169
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2170
    (packageDirName notNil and:[Class tryLocalSourceFirst]) ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2171
	(self loadExtensionsFromDirectory:packageDirName language: language) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2172
	    ^ true.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2173
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2174
	packageDirName := nil.  "do not try again"
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2175
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2176
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2177
    "
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2178
     if there is a sourceCodeManager, ask it first for the extensions
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2179
    "
17882
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17869
diff changeset
  2180
    (Smalltalk at:#AbstractSourceCodeManager) notNil ifTrue:[
17993
956342c369a2 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17989
diff changeset
  2181
	mgr := AbstractSourceCodeManager managerForPackage: aPackageId
17882
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17869
diff changeset
  2182
    ].
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2183
    mgr notNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2184
	extensionsFilename := 'extensions.' , language sourceFileSuffix.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2185
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2186
	projectDefinition := ProjectDefinition definitionClassForPackage:aPackageId.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2187
	projectDefinition notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2188
	    mod := aPackageId asPackageId module.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2189
	    dir := aPackageId asPackageId directory.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2190
	    extensionsRevisionString := projectDefinition perform:(mgr nameOfVersionMethodForExtensions) ifNotUnderstood:nil.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2191
	    extensionsRevisionString notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2192
		extensionsRevisionInfo := mgr revisionInfoFromString:extensionsRevisionString inClass:nil.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2193
		extensionsRevisionInfo notNil ifTrue:[
17893
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2194
		    extensionsRevisionInfo fileName = extensionsFilename ifFalse:[
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2195
			"JV@2011-10-23: following condition is never satisfied for
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2196
			 filed-in packages. The whole scheme of extensionVersion_XXX
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2197
			 works ONLY for compiled packages as it depends on fact, that
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2198
			 extension Init() routine is called AFTER all classes are inited,
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2199
			 therefore the extensionVersion_XXX methods from extensions.st
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2200
			 overwrites methods coming from package definition class. All this
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2201
			 is so tricky and error prone, that we have to come up with better
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2202
			 solution!!"
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2203
			packageDirName notNil ifTrue:[
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2204
			    ^ self loadExtensionsFromDirectory:packageDirName language: language
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2205
			] ifFalse:[
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2206
			    ^ false
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2207
			]
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  2208
		    ]
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2209
		]
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2210
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2211
	    SourceCodeManagerError handle:[:ex |
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2212
	    ] do:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2213
		inStream := mgr streamForExtensionFile:extensionsFilename package:aPackageId directory:dir module:mod cache:true.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2214
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2215
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2216
	inStream isNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2217
	    SourceCodeManagerError handle:[:ex |
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2218
	    ] do:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2219
		inStream := mgr getMostRecentSourceStreamForFile:extensionsFilename inPackage:aPackageId.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2220
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2221
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2222
	inStream notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2223
	    Class withoutUpdatingChangeSetDo:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2224
		inStream fileIn.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2225
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2226
	    inStream close.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2227
	    VerboseLoading ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2228
		Transcript showCR:('loaded extensions for ',aPackageId,' from repository').
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2229
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2230
	    ^ true
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2231
	]
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2232
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2233
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2234
    packageDirName notNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2235
	^ self loadExtensionsFromDirectory:packageDirName language: language
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2236
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2237
    ^ false
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2238
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2239
    "Created: / 02-01-2010 / 10:41:47 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2240
    "Modified: / 19-03-2011 / 10:03:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13814
3d547c0d4634 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 13787
diff changeset
  2241
    "Modified: / 04-11-2011 / 13:41:29 / cg"
17889
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17882
diff changeset
  2242
    "Modified: / 23-10-2011 / 19:35:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2243
!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2244
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2245
loadExtensionsFromDirectory:packageDirOrString
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2246
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2247
    | extensionsLoaded |
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2248
    extensionsLoaded := false.
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2249
    ProgrammingLanguage allDo:
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2250
	[:lang|
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2251
	extensionsLoaded := extensionsLoaded | (self loadExtensionsFromDirectory: packageDirOrString language: lang)].
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2252
    ^extensionsLoaded
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2253
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2254
    "Modified: / 02-01-2010 / 10:40:33 / Jan Vrany <jan.vrany@fit.cvut.cz>"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2255
!
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2256
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2257
loadExtensionsFromDirectory:packageDirOrString language: language
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2258
    |packageDir f|
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2259
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2260
    packageDir := packageDirOrString asFilename.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2261
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2262
    f := packageDir / ('extensions.' , language sourceFileSuffix).
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2263
    f exists ifTrue:[
18020
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2264
        Class withoutUpdatingChangeSetDo:[
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2265
            f fileIn.
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2266
        ].
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2267
        VerboseLoading ifTrue:[
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2268
            Transcript showCR:('loaded extensions: ' , f pathName).
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2269
        ].
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2270
        ^ true
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2271
    ].
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2272
    ^ true"/false
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2273
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  2274
    "Created: / 02-01-2010 / 10:38:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13814
3d547c0d4634 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 13787
diff changeset
  2275
    "Modified: / 04-11-2011 / 13:41:19 / cg"
18020
83d385894f43 Bugfix: Smalltalk>>#loadExtensionsFromDirectory:language: when loading extensions.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  2276
    "Modified: / 31-01-2013 / 11:33:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2277
!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2278
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2279
loadPackage:aPackageStringArg asAutoloaded:doLoadAsAutoloaded
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2280
    "make certain, that some particular package is loaded into the system.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2281
     Return true on success, false otherwise."
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2282
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2283
    |packageId packageString packageDir def sourceCodeManager|
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2284
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2285
    packageId := aPackageStringArg asPackageId.
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2286
    packageString := packageId string.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2287
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2288
    "if I am here, so must my package"
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2289
    packageString = 'stx:libbasic' ifTrue:[^ true].
13129
0ac3f6a28aaf changed: #loadPackage:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13120
diff changeset
  2290
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2291
    "/ if there is a projectDefinition, let it load itself...
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2292
    def := packageId projectDefinitionClass.
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2293
    (def notNil and:[def isLoaded]) ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2294
        def loadAsAutoloaded:doLoadAsAutoloaded.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2295
        ^ true.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2296
    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2297
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2298
    packageDir := self packageDirectoryForPackageId:packageId.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2299
    packageDir isNil ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2300
        (packageString includes:$:) ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2301
            "/ assume stx
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2302
            packageDir := self packageDirectoryForPackageId:('stx:',packageString).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2303
        ].
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2304
    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2305
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2306
    (self
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2307
        loadPackage:packageString
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2308
        fromDirectory:packageDir
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2309
        asAutoloaded:doLoadAsAutoloaded) ifTrue: [^ true].
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2310
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2311
    AbstractSourceCodeManager notNil ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2312
        sourceCodeManager := AbstractSourceCodeManager sourceCodeManagerForPackage: packageString.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2313
        sourceCodeManager notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2314
            ^ sourceCodeManager loadPackageWithId: packageString fromRepositoryAsAutoloaded: doLoadAsAutoloaded
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2315
        ].
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2316
    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2317
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2318
    ^ false
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2319
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2320
    "
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2321
     Smalltalk loadPackageWithId:'stx:libbasic'
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2322
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2323
     Smalltalk loadPackageWithId:'exept:ctypes'
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2324
    "
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2325
13129
0ac3f6a28aaf changed: #loadPackage:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13120
diff changeset
  2326
    "Modified: / 16-11-2010 / 17:42:49 / cg"
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2327
!
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2328
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2329
loadPackage:packageId fromAllSourceFilesInDirectory:aDirectory
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2330
    "load all source files found in aDirectory and treat them like
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2331
     a package. Allows for initial import of alien ST-code as a new package.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2332
     Experimental."
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2333
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2334
    |p t new anyFail repeatCount|
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2335
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2336
    "/ problem: dependencies.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2337
    "/ solution: repeat twice, so that superclasses are present the second time
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2338
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2339
    Class packageQuerySignal answer:packageId asSymbol do:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2340
	|any|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2341
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2342
	repeatCount := 0.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2343
	[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2344
	    repeatCount := repeatCount + 1.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2345
	    anyFail := false.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2346
	    aDirectory directoryContents do:[:file |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2347
		|fn|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2348
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2349
		fn := aDirectory / file.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2350
		(fn hasSuffix:'st') ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2351
		    Metaclass confirmationQuerySignal answer:false
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2352
		    do:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2353
			Error
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2354
			    handle:[:ex |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2355
				anyFail := true
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2356
			    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2357
			    do:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2358
				(self fileIn:fn) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2359
				    anyFail := true
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2360
				] ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2361
				    any := true.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2362
				]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2363
			    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2364
		    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2365
		]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2366
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2367
	    any ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2368
		^ false "/ no file found
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2369
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2370
	] doWhile:[anyFail and:[repeatCount<2]].
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2371
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2372
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2373
    new := (p := Project projectWithId:packageId) isNil.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2374
    new ifTrue:[ p := Project new].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2375
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2376
    p name:packageId.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2377
    p directory:aDirectory.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2378
    p package:packageId.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2379
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2380
    p repositoryModule:(t first).
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2381
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2382
    p isLoaded:true.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2383
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2384
    new ifTrue:[Project addLoadedProject:p].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2385
    ^ anyFail not
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2386
!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2387
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2388
loadPackage:packageId fromClassLibrary:aFilename
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2389
    "load a package from a compiled classLib.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2390
     Experimental."
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2391
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2392
    |p t new|
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2393
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2394
    (self fileIn:aFilename) ifFalse:[
13370
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  2395
	(self fileInClassLibrary:aFilename) ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  2396
	    self warn:'Failed to load the package ', packageId printString.
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  2397
	    ^ false.
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  2398
	]
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2399
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2400
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2401
    new := (p := Project projectWithId:packageId) isNil.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2402
    new ifTrue:[ p := Project new].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2403
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2404
    p name:packageId.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2405
    p directory:aFilename directory.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2406
    p package:packageId.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2407
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2408
    p repositoryModule:(t first).
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2409
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2410
    p isLoaded:true.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2411
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2412
    new ifTrue:[Project addLoadedProject:p].
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2413
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2414
    ^ true
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2415
!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2416
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2417
loadPackage:aPackageString fromDirectory:packageDirOrStringOrNil asAutoloaded:doLoadAsAutoloaded
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2418
    "load a package referenced by aPackageString - a string like 'stx:libbasic'.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2419
     The package is either located in packageDirOrStringOrNil, or in the current directory (if nil).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2420
     Answer true, if the load succeeded, false if it failed"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2421
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2422
    |packageDir shLibName
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2423
     binaryClassLibraryFilename projectDefinitionFilename projectDefinitionClass projectDefinitionClassName silent somethingHasBeenLoaded
13060
488c6ad12c93 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13056
diff changeset
  2424
     loadOK loadErrorOccurred exePath|
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2425
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2426
    packageDirOrStringOrNil notNil ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2427
        packageDir := packageDirOrStringOrNil asFilename.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2428
    ].
13091
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
  2429
    VerboseLoading ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2430
        silent := false
13091
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
  2431
    ] ifFalse:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2432
        silent := (SilentLoading or:[ StandAlone ]) or:[ InfoPrinting not ].
13091
bc840cd6f1ae --verboseLoading command line arg (shlib loading trace)
Claus Gittinger <cg@exept.de>
parents: 13061
diff changeset
  2433
    ].
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2434
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2435
    "For now: have to read the project definition first!!
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2436
     The class library may contain subclasses of classes in prerequisite packages -
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2437
     so the prerequisite packages have to be loaded first"
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2438
    "normally there is a project definiton, use that one to pull in the rest"
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2439
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2440
    "maybe, it is already in the image - autoloaded"
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2441
    projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2442
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2443
false ifTrue:[
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2444
    "if not, file it in ..."
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2445
    (projectDefinitionClass isNil and:[packageDir notNil]) ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2446
        projectDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageString.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2447
        "/ try to load the project definition class
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2448
        projectDefinitionFilename := (packageDir / projectDefinitionClassName) withSuffix:'st'.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2449
        projectDefinitionFilename exists ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2450
            projectDefinitionFilename := (packageDir / 'source' / projectDefinitionClassName) withSuffix:'st'.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2451
        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2452
        projectDefinitionFilename exists ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2453
            Class withoutUpdatingChangesDo:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2454
                Smalltalk silentlyLoadingDo:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2455
                    projectDefinitionFilename fileIn.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2456
                ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2457
            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2458
            projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
14793
65d98e916d83 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14620
diff changeset
  2459
            projectDefinitionClass notNil ifTrue:[
65d98e916d83 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14620
diff changeset
  2460
                projectDefinitionClass loadDirectory:(projectDefinitionFilename asFilename directory)
65d98e916d83 class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14620
diff changeset
  2461
            ]
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2462
        ].
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2463
    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2464
    projectDefinitionClass notNil ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2465
        projectDefinitionClass autoload.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2466
        somethingHasBeenLoaded := projectDefinitionClass loadAsAutoloaded:doLoadAsAutoloaded.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2467
        (silent not and:[somethingHasBeenLoaded]) ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2468
            Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageString , ' from project definition').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2469
        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2470
        ^ true.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2471
    ].
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2472
].
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2473
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2474
    "/ no project-definition class.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2475
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2476
    "Is there a shared library (.dll or .so) ?"
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2477
    shLibName := aPackageString asPackageId libraryName asFilename
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2478
                        withSuffix:ObjectFileLoader sharedLibrarySuffix.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2479
13120
7fa4fe320d14 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2480
"/    silent ifFalse:[
7fa4fe320d14 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2481
"/        Transcript showCR:('looking for binary classLib file: ' , shLibName pathName).
7fa4fe320d14 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13092
diff changeset
  2482
"/    ].
13060
488c6ad12c93 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13056
diff changeset
  2483
    exePath := OperatingSystem pathOfSTXExecutable asFilename directory.
488c6ad12c93 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13056
diff changeset
  2484
    binaryClassLibraryFilename := exePath / shLibName.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2485
    binaryClassLibraryFilename exists ifFalse:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2486
        exePath baseName = 'bin' ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2487
            binaryClassLibraryFilename := exePath directory / 'lib' / shLibName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2488
        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2489
        binaryClassLibraryFilename exists ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2490
            binaryClassLibraryFilename := exePath directory / 'plugin' / shLibName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2491
            binaryClassLibraryFilename exists ifFalse:[
13060
488c6ad12c93 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13056
diff changeset
  2492
"/                binaryClassLibraryFilename := Filename currentDirectory / shLibName.
488c6ad12c93 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13056
diff changeset
  2493
"/                binaryClassLibraryFilename exists ifFalse:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2494
                    packageDir notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2495
                        binaryClassLibraryFilename := packageDir / shLibName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2496
                        binaryClassLibraryFilename exists ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2497
                            "/ mhmh - is this a good idea ? (temporary kludge)
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2498
                            ExternalAddress pointerSize == 4 ifTrue:[    
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2499
                                binaryClassLibraryFilename := packageDir / 'objbc' / shLibName.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2500
                                binaryClassLibraryFilename exists ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2501
                                    binaryClassLibraryFilename := packageDir / 'objvc' / shLibName.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2502
                                ]
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2503
                            ] ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2504
                                binaryClassLibraryFilename := packageDir / 'objmingw' / shLibName.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2505
                            ].
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2506
                        ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2507
                    ]
13060
488c6ad12c93 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13056
diff changeset
  2508
"/                ].
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2509
            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2510
        ].
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2511
        packageDir notNil ifTrue:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2512
            binaryClassLibraryFilename exists ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2513
                "/ look in package directory
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2514
                binaryClassLibraryFilename := packageDir / shLibName.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2515
                binaryClassLibraryFilename exists ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2516
                    ExternalAddress pointerSize == 4 ifTrue:[    
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2517
                        binaryClassLibraryFilename := packageDir / 'objbc' / shLibName.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2518
                        binaryClassLibraryFilename exists ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2519
                            binaryClassLibraryFilename := packageDir / 'objvc' / shLibName.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2520
                        ]
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2521
                    ] ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2522
                        binaryClassLibraryFilename := packageDir / 'objmingw' / shLibName.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2523
                    ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2524
                ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2525
            ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2526
        ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2527
    ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2528
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2529
    binaryClassLibraryFilename exists ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2530
        ObjectFileLoader::ObjectFileLoadErrorNotification handle:[:ex |
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2531
            loadErrorOccurred := true.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2532
            ex proceedWith:true.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2533
        ] do:[
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2534
            loadOK := (ObjectFileLoader loadObjectFile:binaryClassLibraryFilename) notNil.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2535
            "/ loadOK := self loadPackage:aPackageString fromClassLibrary:binaryClassLibraryFilename.
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2536
        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2537
        loadOK ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2538
            silent ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2539
                Transcript showCR:('loaded package: ' , aPackageString , ' from binary classLib file: ' , binaryClassLibraryFilename pathName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2540
            ].
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2541
            "now, all compiled classes have been loaded.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2542
             keep classes in the package which are autoloaded as autoloaded.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2543
             (so the code below is disabled)"
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2544
"/            doLoadAsAutoloaded ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2545
"/                "/ force autoloading...
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2546
"/                Smalltalk allClassesDo:[:eachClass |
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2547
"/                    eachClass package == aPackageString ifTrue:[eachClass autoload].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2548
"/                ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2549
"/            ].
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2550
            ^ true
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2551
        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2552
        loadErrorOccurred ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2553
            self breakPoint:#cg.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2554
            projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2555
            projectDefinitionClass notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2556
                "/ load prerequisites...
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2557
                projectDefinitionClass loadPreRequisitesAsAutoloaded:doLoadAsAutoloaded.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2558
                self breakPoint:#cg.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2559
            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2560
        ].
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2561
    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2562
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2563
    packageDir isNil ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2564
        ^ false.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2565
    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2566
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2567
    "fallback - go through the project definition"
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2568
    projectDefinitionClass isNil ifTrue:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2569
        projectDefinitionClassName := ProjectDefinition initialClassNameForDefinitionOf:aPackageString.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2570
        "/ try to load the project definition class
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2571
        projectDefinitionFilename := (packageDir / projectDefinitionClassName) withSuffix:'st'.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2572
        projectDefinitionFilename exists ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2573
            projectDefinitionFilename := (packageDir / 'source' / projectDefinitionClassName) withSuffix:'st'.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2574
        ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2575
        projectDefinitionFilename exists ifTrue:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2576
            Class withoutUpdatingChangesDo:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2577
                Smalltalk silentlyLoadingDo:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2578
                    projectDefinitionFilename fileIn.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2579
                ].
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  2580
            ].
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2581
            projectDefinitionClass := ProjectDefinition definitionClassForPackage:aPackageString.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2582
            projectDefinitionClass notNil ifTrue:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2583
                projectDefinitionClass loadDirectory:(projectDefinitionFilename asFilename directory)
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2584
            ]
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2585
        ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2586
    ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2587
    projectDefinitionClass notNil ifTrue:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2588
        projectDefinitionClass autoload.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2589
        somethingHasBeenLoaded := projectDefinitionClass loadAsAutoloaded:doLoadAsAutoloaded.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2590
        (silent not and:[somethingHasBeenLoaded]) ifTrue:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2591
            Transcript showCR:('Smalltalk [info]: loaded package: ' , aPackageString , ' from project definition').
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2592
        ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2593
        ^ true.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2594
    ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2595
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2596
"/ loadAll no longer supported
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2597
"/    loadAllFilename := packageDir / 'loadAll'.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2598
"/    loadAllFilename exists ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2599
"/        loadAllFilename := packageDir / 'loadall'.
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2600
"/    ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2601
"/    loadAllFilename exists ifTrue:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2602
"/        (self loadPackage:aPackageString fromLoadAllFile:loadAllFilename) ifTrue:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2603
"/            silent ifFalse:[
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2604
"/                Transcript showCR:('loaded package: ' , aPackageString , ' from loadAll file: ' , loadAllFilename pathName).
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2605
"/            ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2606
"/            ^ true
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2607
"/        ]
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2608
"/    ].
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2609
"/
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  2610
"/    packageName := packageDir baseName.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2611
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2612
"/ zip-file loading no longer supported
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2613
"/  "/ .zip ?
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2614
"/    f := (packageDir / packageName) withSuffix:'zip'.
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2615
"/    f exists ifTrue:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2616
"/        (self loadPackage:aPackageString fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded) ifTrue:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2617
"/            silent ifFalse:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2618
"/                Transcript showCR:('loaded package: ' , aPackageString , ' from zip file: ' , f pathName).
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2619
"/            ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2620
"/            ^ true
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2621
"/        ]
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2622
"/    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2623
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2624
"/ abbrev-file loading no longer supported
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2625
"/    "/ abbrev.stc ?
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2626
"/    (self loadPackageFromAbbrevFile:aPackageString asAutoloaded:doLoadAsAutoloaded) ifTrue:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2627
"/        ^ true
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2628
"/    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2629
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2630
"/ any .so-file loading no longer supported
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2631
"/    "/ any .so ?  -> load the first one found (maybe not a good idea)
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2632
"/    packageDir directoryContentsAsFilenamesDo:[:aFilename |
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2633
"/        (aFilename hasSuffix:ObjectFileLoader sharedLibrarySuffix) ifTrue:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2634
"/            (self loadPackage:aPackageString fromClassLibrary:aFilename) ifTrue:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2635
"/                silent ifFalse:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2636
"/                    Transcript showCR:('loaded package: ' , aPackageString , ' from binary classLib file: ' , aFilename pathName).
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2637
"/                ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2638
"/                doLoadAsAutoloaded ifFalse:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2639
"/                    "/ force autoloading...
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2640
"/                    Smalltalk allClassesDo:[:eachClass |
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2641
"/                        eachClass package == aPackageString ifTrue:[ eachClass autoload].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2642
"/                    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2643
"/                ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2644
"/                ^ true
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2645
"/            ]
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2646
"/        ]
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2647
"/    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2648
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2649
"/    "/ source files-file loading no longer supported
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2650
"/    "/ however, allow for autoload-stub loaded
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2651
"/    doLoadAsAutoloaded ifTrue:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2652
"/        self
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2653
"/            recursiveInstallAutoloadedClassesFrom:packageDir
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2654
"/            rememberIn:(Set new)
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2655
"/            maxLevels:2
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2656
"/            noAutoload:false
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2657
"/            packageTop:packageDir
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2658
"/            showSplashInLevels:0.
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2659
"/    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2660
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2661
"/    doLoadAsAutoloaded ifFalse:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2662
"/        "/ source files
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2663
"/        (self loadPackage:aPackageString fromAllSourceFilesInDirectory:packageDir) ifTrue:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2664
"/            silent ifFalse:[
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2665
"/                Transcript showCR:('loaded package: ' , aPackageString , ' from source files in:' , packageDir pathName).
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2666
"/            ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2667
"/            ^ true
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2668
"/        ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2669
"/    ].
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2670
"/    ^ true
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2671
12813
054a53cb88fd changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 12795
diff changeset
  2672
    Transcript showCR:('Smalltalk [info]: no projectDef, dll or loadAll found in: ' , aPackageString).
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2673
    ^ false
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2674
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2675
    "
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2676
     Smalltalk loadPackageWithId:'stx:libbasic'
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2677
     Smalltalk loadPackageWithId:'stx:goodies/persistency'
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2678
     Smalltalk loadPackageWithId:'exept:ctypes'
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2679
    "
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2680
13529
3fa8f8852e91 changed: #loadPackage:fromDirectory:asAutoloaded:
Claus Gittinger <cg@exept.de>
parents: 13528
diff changeset
  2681
    "Modified: / 29-07-2011 / 19:55:35 / cg"
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2682
!
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2683
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2684
loadPackage:packageId fromLoadAllFile:aFilename
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2685
    <resource: #obsolete>
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2686
    "load a package from a loadAll - loader script.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2687
     Experimental."
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2688
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2689
    |p t new|
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2690
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2691
    Metaclass confirmationQuerySignal answer:false
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2692
    do:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2693
	(self fileIn:aFilename) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2694
	    self warn:'Failed to load the package ', packageId printString.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2695
	    ^ false.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2696
	]
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2697
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2698
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2699
    new := (p := Project projectWithId:packageId) isNil.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2700
    new ifTrue:[ p := Project new].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2701
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2702
    p name:packageId.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2703
    p directory:aFilename directory.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2704
    p package:packageId.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2705
    t := packageId asCollectionOfSubstringsSeparatedByAny:'/\:'.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2706
    p repositoryModule:(t first).
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2707
    p repositoryDirectory:(packageId copyFrom:t first size + 2).
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2708
    p isLoaded:true.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2709
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2710
    new ifTrue:[Project addLoadedProject:p].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2711
    ^ true
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2712
!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2713
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2714
loadPackage:aPackageId fromZIPArchive:f asAutoloaded:doLoadAsAutoloaded
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2715
    "load a package from a .zip delivery file.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2716
     Experimental."
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2717
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2718
    "/ not yet implemented ...
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2719
    ^ false
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2720
!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2721
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2722
loadPackageFromAbbrevFile:aPackageId asAutoloaded:doLoadAsAutoloaded
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  2723
    <resource: #obsolete>
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2724
    |abbrevFile packageDir|
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2725
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2726
    packageDir := self packageDirectoryForPackageId:aPackageId.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2727
    packageDir isNil ifTrue:[^ false].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2728
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2729
    "/ abbrev.stc ?
12377
f9a9aea7ba0f changed:13 methods
Claus Gittinger <cg@exept.de>
parents: 12376
diff changeset
  2730
    abbrevFile := packageDir / 'abbrev.stc'.
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2731
    abbrevFile exists ifFalse:[^ false].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2732
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2733
    Smalltalk installAutoloadedClassesFrom:abbrevFile pathName.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2734
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2735
    doLoadAsAutoloaded ifFalse:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2736
	"/ force autoloading...
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2737
	Smalltalk allClassesInPackage:aPackageId do:[:eachClass | eachClass autoload].
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2738
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2739
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2740
    self loadExtensionsFromDirectory:packageDir.
13814
3d547c0d4634 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 13787
diff changeset
  2741
    VerboseLoading ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2742
	Transcript showCR:('loaded package: ' , aPackageId , ' from abbrev file: ' , abbrevFile pathName).
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2743
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2744
    ^ true
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2745
13814
3d547c0d4634 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 13787
diff changeset
  2746
    "Modified: / 04-11-2011 / 13:43:29 / cg"
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2747
! !
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  2748
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  2749
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2750
!Smalltalk class methodsFor:'queries'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2751
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2752
allClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2753
    "return an unordered collection of all classes in the system.
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2754
     Only globally anchored classes are returned
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2755
     (i.e. anonymous ones have to be aquired by Behavior allSubInstances)"
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2756
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2757
    |classes|
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2758
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2759
    "/ you may wonder, what this while is for, here ...
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2760
    "/ the reason is that if we modify the class hierarchy in
4067
732848627915 comment
Claus Gittinger <cg@exept.de>
parents: 4048
diff changeset
  2761
    "/ another view (background fileIn), while building up the
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2762
    "/ cachedClasses set, this may be flushed (invalidated) by the
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2763
    "/ other process in the meanwhile.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2764
    "/ If that happens, we restart the set-building here
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2765
    "/
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2766
    [(classes := CachedClasses) isNil] whileTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2767
	CachedClasses := classes := IdentitySet new:NumberOfClassesHint.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2768
	self keysAndValuesDo:[:eachName :eachGlobal |
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2769
	    (eachGlobal notNil and:[eachGlobal isBehavior]) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2770
		"/ sigh - would like to skip over aliases
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2771
		"/ but this cannot be done simply by comparing
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2772
		"/ the classes name against the store-key
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2773
		"/ i.e. cannot do:
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2774
		"/      anObject name == sym ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2775
		"/          classes add:anObject
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2776
		"/      ]
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2777
		"/ because that would lead to ignore all java
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2778
		"/ classes, which are stored under a different
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2779
		"/ key.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2780
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2781
		(eachGlobal name == eachName
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2782
		 or:[eachGlobal isJavaClass]) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2783
		    classes add:eachGlobal
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2784
		].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2785
	    ]
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2786
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  2787
	NumberOfClassesHint := classes size.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2788
    ].
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2789
    ^ classes
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2790
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2791
    "
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2792
     CachedClasses := nil.
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2793
     Smalltalk allClasses
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2794
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2795
    to get the list sorted by name:
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2796
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2797
     Smalltalk allClasses asSortedCollection:[:a :b | a name < b name]
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2798
    "
745
d16f199a1551 added imageStart & restart timestamps
Claus Gittinger <cg@exept.de>
parents: 736
diff changeset
  2799
13851
5ab434e0a636 changed: #mainStartup: for scripting stand alone apps
Claus Gittinger <cg@exept.de>
parents: 13850
diff changeset
  2800
    "Modified: / 06-12-2011 / 12:41:42 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2801
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2802
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2803
allClassesAndMetaclasses
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2804
    "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
  2805
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2806
    |classes|
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2807
8964
91b012315d91 Avoid rehashing of sets in #allClasses..
Stefan Vogel <sv@exept.de>
parents: 8960
diff changeset
  2808
    classes := IdentitySet new:NumberOfClassesHint*2.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2809
    self allClassesDo:[:eachClass |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2810
	classes add:(eachClass theNonMetaclass).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2811
	classes add:(eachClass theMetaclass).
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2812
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2813
    ^ classes
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2814
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2815
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2816
allClassesWithAllPrivateClasses
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  2817
    "return an unordered collection of all classes in the Smalltalk namespace.
10173
765b385fd1b8 changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents: 10169
diff changeset
  2818
     Only globally anchored classes are returned; Namespaces are not included.
4642
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2819
     (i.e. anonymous ones have to be aquired by Behavior allSubInstances)"
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2820
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2821
    ^ self allClasses select:[:aClass |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2822
	    |owner|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2823
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2824
	    (aClass isRealNameSpace not)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2825
	    and:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2826
		owner := aClass topOwningClass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2827
		(owner ? aClass) nameSpace == Smalltalk
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2828
	    ]
4642
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2829
      ]
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2830
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2831
    "
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2832
     Smalltalk allClassesWithAllPrivateClasses
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2833
    "
10173
765b385fd1b8 changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents: 10169
diff changeset
  2834
765b385fd1b8 changed #listAtCategoryNamed:
Claus Gittinger <cg@exept.de>
parents: 10169
diff changeset
  2835
    "Modified: / 10-11-2006 / 17:24:00 / cg"
4642
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2836
!
fa212209890c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4630
diff changeset
  2837
11153
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2838
allExtensionsForPackage:aProjectID
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2839
    |methods|
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2840
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2841
    methods := OrderedCollection new.
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2842
    self allClassesDo:[:eachClass |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2843
	methods addAll:(eachClass extensionsFrom:aProjectID).
11153
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2844
    ].
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2845
    ^ methods
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2846
!
ec11603c6e7e code reuse
Claus Gittinger <cg@exept.de>
parents: 11150
diff changeset
  2847
9227
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2848
allImplementorsOf:aSelector
12919
a7ea070197c9 comment/format in: #allImplementorsOf:
Claus Gittinger <cg@exept.de>
parents: 12911
diff changeset
  2849
    "return a collection of classes which implement the given selector"
a7ea070197c9 comment/format in: #allImplementorsOf:
Claus Gittinger <cg@exept.de>
parents: 12911
diff changeset
  2850
9227
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2851
    |implementors|
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2852
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2853
    implementors := OrderedCollection new.
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2854
    self allClassesDo:[:cls |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2855
	(cls includesSelector:aSelector) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2856
	    implementors add:cls.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2857
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2858
	(cls class includesSelector:aSelector) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2859
	    implementors add:cls class.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2860
	].
9227
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2861
    ].
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2862
    ^ implementors
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2863
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2864
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2865
     Smalltalk allImplementorsOf:#isNil
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2866
     (Smalltalk allImplementorsOf:#add:) size
9227
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2867
    "
12919
a7ea070197c9 comment/format in: #allImplementorsOf:
Claus Gittinger <cg@exept.de>
parents: 12911
diff changeset
  2868
a7ea070197c9 comment/format in: #allImplementorsOf:
Claus Gittinger <cg@exept.de>
parents: 12911
diff changeset
  2869
    "Modified: / 07-05-2010 / 10:56:09 / cg"
9227
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2870
!
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  2871
12376
fm
parents: 12358
diff changeset
  2872
allLoadedProjectIDs
fm
parents: 12358
diff changeset
  2873
fm
parents: 12358
diff changeset
  2874
    ^ self allProjectsIdsIncludingUnloadedClasses: false
fm
parents: 12358
diff changeset
  2875
fm
parents: 12358
diff changeset
  2876
fm
parents: 12358
diff changeset
  2877
    "
fm
parents: 12358
diff changeset
  2878
     Smalltalk allLoadedProjectIDs
fm
parents: 12358
diff changeset
  2879
    "
fm
parents: 12358
diff changeset
  2880
!
fm
parents: 12358
diff changeset
  2881
9254
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2882
allProjectIDs
12376
fm
parents: 12358
diff changeset
  2883
fm
parents: 12358
diff changeset
  2884
    ^ self allProjectsIdsIncludingUnloadedClasses: true
fm
parents: 12358
diff changeset
  2885
fm
parents: 12358
diff changeset
  2886
fm
parents: 12358
diff changeset
  2887
    "
fm
parents: 12358
diff changeset
  2888
     Smalltalk allProjectIDs
fm
parents: 12358
diff changeset
  2889
    "
fm
parents: 12358
diff changeset
  2890
!
fm
parents: 12358
diff changeset
  2891
fm
parents: 12358
diff changeset
  2892
allProjectsIdsIncludingUnloadedClasses: includeUnloadedClasses
fm
parents: 12358
diff changeset
  2893
    "Returns all projects ids.
fm
parents: 12358
diff changeset
  2894
     Excludes projects coming from unloaded classes if includeUnloadedClasses is false.
fm
parents: 12358
diff changeset
  2895
    "
fm
parents: 12358
diff changeset
  2896
9254
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2897
    |allProjects|
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2898
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2899
    allProjects := Set new.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2900
    self allClassesDo:[:eachClass |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2901
	|cls pkg|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2902
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2903
	eachClass isRealNameSpace ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2904
	    (includeUnloadedClasses or:[eachClass isLoaded]) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2905
		cls := eachClass theNonMetaclass.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2906
		cls isPrivate ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2907
		    cls := cls topOwningClass
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2908
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2909
		pkg := cls package.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2910
		pkg size > 0 ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2911
		    allProjects add:pkg.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2912
		] ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2913
		    "/ for now, nameSpaces are not in any package;
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2914
		    "/ this might change. Then, 0-sized packages are
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2915
		    "/ illegal, and the following should be enabled.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2916
		    "/ self halt
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2917
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2918
		cls isJavaClass ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2919
		    cls instAndClassSelectorsAndMethodsDo:[:sel :mthd |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2920
			allProjects add:mthd package asSymbol.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2921
		    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2922
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2923
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2924
	].
9254
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2925
    ].
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2926
    allProjects := allProjects asOrderedCollection sort.
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2927
    ^ allProjects
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2928
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2929
    "
12376
fm
parents: 12358
diff changeset
  2930
     Smalltalk allProjectsIdsIncludingUnloadedClasses: true
fm
parents: 12358
diff changeset
  2931
     Smalltalk allProjectsIdsIncludingUnloadedClasses: false
9254
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2932
    "
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2933
!
9fc5d873b646 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9252
diff changeset
  2934
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2935
cellAt:aName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2936
    "{ Pragma: +optSpace }"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2937
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2938
    "return the address of a global cell
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2939
     - used internally for compiler only"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2940
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2941
%{  /* NOCONTEXT */
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2942
    RETURN ( __GLOBAL_GETCELL(aName) );
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2943
%}.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2944
    ^ self primitiveFailed
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2945
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2946
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2947
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2948
classCategoryCompletion:aPartialCategory
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2949
    "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
  2950
     2 entries: 1st: the best (longest) match
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  2951
		2nd: collection consisting of matching categories"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2952
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2953
    ^ DoWhatIMeanSupport classCategoryCompletion:aPartialCategory inEnvironment:self
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2954
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2955
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2956
     Smalltalk classCategoryCompletion:'Sys'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2957
     Smalltalk classCategoryCompletion:'System'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  2958
     Smalltalk classCategoryCompletion:'System-BinaryStorage'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2959
    "
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2960
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  2961
    "Modified: / 10-08-2006 / 13:06:34 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2962
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  2963
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2964
classNamed:aString
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2965
    "return the class with name aString, or nil if absent.
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  2966
     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
  2967
     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
  2968
     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
  2969
     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
  2970
10127
70e1b66ceae1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10126
diff changeset
  2971
    |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
  2972
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2973
    "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
  2974
     But be careful, to not invent new symbols ..."
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2975
    sym := aString asSymbolIfInterned.
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  2976
    sym notNil ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2977
	cls := self at:sym ifAbsent:nil.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2978
	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
  2979
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2980
1480
df0bea6285f8 Change the name of a classes Metaclass from e.g. "SmallIntegerclass" to
Stefan Vogel <sv@exept.de>
parents: 1461
diff changeset
  2981
    (aString endsWith:' class') ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2982
	nonMeta := self classNamed:(aString copyWithoutLast:6).
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2983
	nonMeta notNil ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2984
	    ^ nonMeta theMetaclass
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2985
	].
13602
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  2986
    ].
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  2987
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  2988
    "no success yet. Try if this is a private class of an autoloaded class"
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  2989
    cls isNil ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2990
	idx := aString indexOfSubCollection:'::'.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2991
	idx ~~ 0 ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2992
	    prefix := aString copyTo:idx-1.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2993
	    nsNameSymbol := prefix asSymbolIfInterned.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2994
	    nsNameSymbol notNil ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2995
		rest := aString copyFrom:idx+2.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2996
		namespace := self at:prefix asSymbolIfInterned ifAbsent:nil.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2997
		"namespace may be the owner of a private class.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2998
		 NameSpaces and Behaviors have the same protocol"
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  2999
		[namespace isBehavior] whileTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3000
		    idx := rest indexOfSubCollection:'::'.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3001
		    idx ~~ 0 ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3002
			prefix := rest copyTo:idx-1.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3003
			rest := rest copyFrom:idx+2.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3004
			"this does an implicit autoload if required"
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3005
			namespace := namespace privateClassesAt:prefix.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3006
		    ] ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3007
			namespace isLoaded ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3008
			    cls := namespace privateClassesAt:rest.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3009
			    cls isBehavior ifTrue:[^ cls].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3010
			].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3011
			namespace := nil.   "force exit of loop"
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3012
		    ].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3013
		].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3014
	    ].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3015
	].
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3016
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3017
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  3018
    ^ nil
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  3019
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  3020
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3021
     Smalltalk classNamed:'Object'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3022
     Smalltalk classNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3023
     Smalltalk classNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData class'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3024
     Smalltalk classNamed:'Authentication::BasicAuthenticator'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3025
     Smalltalk classNamed:'fooBar'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3026
     Smalltalk classNamed:'true'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3027
     Smalltalk classNamed:'Object class'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3028
     Smalltalk classNamed:'Metaclass'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3029
     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
  3030
     Smalltalk classNamed:'Array class'
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  3031
    "
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  3032
9468
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  3033
    "Created: / 24-11-1995 / 17:30:22 / cg"
2472391c602c bumped revision
Claus Gittinger <cg@exept.de>
parents: 9377
diff changeset
  3034
    "Modified: / 19-06-1996 / 14:22:21 / stefan"
10127
70e1b66ceae1 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10126
diff changeset
  3035
    "Modified: / 23-10-2006 / 18:06:53 / cg"
13602
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  3036
    "Modified (comment): / 20-08-2011 / 16:43:07 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3037
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3038
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3039
classNames
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3040
    "return a collection of all classNames in the system"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3041
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3042
    ^ self allClasses collect:[:aClass | aClass name]
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3043
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3044
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3045
     Smalltalk classNames
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3046
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3047
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3048
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3049
classnameCompletion:aPartialClassName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3050
    "given a partial classname, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3051
     2 entries: 1st: the best (longest) match
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3052
		2nd: collection consisting of matching names"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3053
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3054
    ^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3055
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3056
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3057
classnameCompletion:aPartialClassName inEnvironment:anEnvironment
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3058
    "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
  3059
     2 entries: 1st: the best (longest) match
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3060
		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
  3061
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3062
    ^ DoWhatIMeanSupport classnameCompletion:aPartialClassName inEnvironment:anEnvironment
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3063
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3064
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3065
     Smalltalk classnameCompletion:'Arr'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3066
     Smalltalk classnameCompletion:'Arra'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3067
     Smalltalk classnameCompletion:'arra'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3068
     Smalltalk classnameCompletion:'*rray'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3069
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3070
     Smalltalk classnameCompletion:'Arr cl'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3071
     Smalltalk classnameCompletion:'*rray cl'
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  3072
    "
644
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  3073
9363244ef25d classNamed: fixed for metaclasses; handle matchCharacters in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
  3074
    "Created: 24.11.1995 / 17:24:45 / cg"
2523
04db1fd74e0d try ignoring case in classNameCompletion
Claus Gittinger <cg@exept.de>
parents: 2514
diff changeset
  3075
    "Modified: 3.4.1997 / 18:25:01 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3076
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3077
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3078
defaultNameSpace
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3079
    "return the default namespace, where new classes are installed,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3080
     if NO special nameSpace handler is present"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3081
9562
7d36dbb02bb3 code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents: 9550
diff changeset
  3082
    ^ Project defaultNameSpace.
7d36dbb02bb3 code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents: 9550
diff changeset
  3083
7d36dbb02bb3 code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents: 9550
diff changeset
  3084
    "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
  3085
    "Modified: / 17-08-2006 / 14:01:22 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3086
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3087
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3088
globalNameCompletion:aPartialGlobalName
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3089
    "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
  3090
     2 entries: 1st: the best (longest) match
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3091
		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
  3092
12614
b8fca618dcb6 changed: #globalNameCompletion:
Claus Gittinger <cg@exept.de>
parents: 12613
diff changeset
  3093
    ^ DoWhatIMeanSupport globalNameCompletion:aPartialGlobalName inEnvironment:self match:true
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3094
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3095
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3096
     Smalltalk globalnameCompletion:'Arr'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3097
     Smalltalk globalnameCompletion:'Arra'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3098
     Smalltalk globalnameCompletion:'arra'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3099
     Smalltalk globalnameCompletion:'*rray'
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3100
    "
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3101
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  3102
    "Created: / 24-11-1995 / 17:24:45 / cg"
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  3103
    "Modified: / 10-08-2006 / 13:05:39 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3104
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3105
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3106
globalnameCompletion:aPartialGlobalName
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3107
    "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
  3108
     2 entries: 1st: the best (longest) match
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3109
		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
  3110
8358
0afa3ee38c37 Mark obsolete methods
Stefan Vogel <sv@exept.de>
parents: 8317
diff changeset
  3111
    <resource:#obsolete>
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3112
    self obsoleteMethodWarning:'use #globalNameCompletion:'.
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  3113
    ^ 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
  3114
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3115
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3116
     Smalltalk globalnameCompletion:'Arr'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3117
     Smalltalk globalnameCompletion:'Arra'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3118
     Smalltalk globalnameCompletion:'arra'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3119
     Smalltalk globalnameCompletion:'*rray'
5736
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  3120
    "
d625e5505254 globalNamecompletion
Claus Gittinger <cg@exept.de>
parents: 5716
diff changeset
  3121
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  3122
    "Created: / 24-11-1995 / 17:24:45 / cg"
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  3123
    "Modified: / 10-08-2006 / 13:05:48 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3124
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3125
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3126
hasClassNamed:aString
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3127
    Symbol
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3128
	hasInterned:aString
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3129
	ifTrue:[:aSymbol | ^ (self at:aSymbol ifAbsent:[ nil ]) isClass ].
13602
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  3130
    ^ false
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  3131
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  3132
    "Created: / 26-08-2009 / 11:43:03 / Jaroslav Havlin <havlij6@fel.cvut.cz>"
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  3133
    "Modified: / 20-08-2011 / 16:41:31 / cg"
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  3134
!
5fe3c7ce7d7e comment/format in: #classNamed:
Claus Gittinger <cg@exept.de>
parents: 13601
diff changeset
  3135
9290
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  3136
hasNameSpaces
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  3137
    "can be redefined by dummy namespaces/environments, to suppress
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  3138
     the namespace display in a browser (PocketSmalltalk)"
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  3139
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  3140
    ^ true
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  3141
!
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  3142
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3143
hasNamespaces
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3144
    "can be redefined by dummy namespaces/environments, to suppress
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3145
     the namespace display in a browser (PocketSmalltalk)"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3146
9290
a7119f29fe2d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9259
diff changeset
  3147
    <resource:#obsolete>
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3148
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3149
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3150
10432
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3151
hasSelectorNameSpaces
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3152
    "for now return false
10999
e5cfd06920ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10998
diff changeset
  3153
     Selector namespaces are being implemented and supported by the VM,
10432
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3154
     but not yet fully supported by all tools...
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3155
     Therefore, for now, do not generate code which uses this feature."
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3156
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3157
    ^ false
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3158
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3159
    "Created: / 05-03-2007 / 13:26:28 / cg"
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3160
!
9d0a4de5e69c preps for selectorNamespaces.
Claus Gittinger <cg@exept.de>
parents: 10429
diff changeset
  3161
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3162
includes:something
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3163
    "this should come from Collection.
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3164
     will change the inheritance - Smalltalk is actually a collection"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3165
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3166
    self do:[:element | element = something ifTrue:[^ true]].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3167
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3168
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3169
10041
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  3170
isBrowserStartable
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  3171
    ^ false.
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  3172
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  3173
    "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
  3174
!
1ef0cb09523b protocol for startability via browser slightly changed
Claus Gittinger <cg@exept.de>
parents: 9937
diff changeset
  3175
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3176
isNameSpace
9227
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  3177
    "return true, if the receiver is a nameSpace."
3aca7dee958d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9211
diff changeset
  3178
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3179
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3180
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3181
    "Created: 11.10.1996 / 18:10:43 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3182
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3183
10169
142f2de83007 +isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 10162
diff changeset
  3184
isRealNameSpace
142f2de83007 +isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 10162
diff changeset
  3185
    "return true, if the receiver is a nameSpace, but not Smalltalk (which is also a class)."
142f2de83007 +isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 10162
diff changeset
  3186
142f2de83007 +isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 10162
diff changeset
  3187
    ^ false
142f2de83007 +isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 10162
diff changeset
  3188
142f2de83007 +isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 10162
diff changeset
  3189
    "Created: / 10-11-2006 / 17:02:19 / cg"
142f2de83007 +isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 10162
diff changeset
  3190
!
142f2de83007 +isRealNameSpace
Claus Gittinger <cg@exept.de>
parents: 10162
diff changeset
  3191
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3192
isTopLevelNameSpace
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3193
    ^ true
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3194
!
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3195
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3196
isTopLevelNamespace
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3197
    "obsolete - use isTopLevelNameSpace"
5365
95c615a40176 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 5363
diff changeset
  3198
7432
155245708ca3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7430
diff changeset
  3199
    <resource:#obsolete>
155245708ca3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7430
diff changeset
  3200
7999
475bba3ead9a moved all input completion methods from Smalltalk to DoWhatIMeanSupport.
Claus Gittinger <cg@exept.de>
parents: 7996
diff changeset
  3201
    self obsoleteMethodWarning:'use #isTopLevelNameSpace'.
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3202
    ^ true
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3203
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3204
    "Created: 11.10.1996 / 18:10:43 / cg"
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3205
!
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  3206
9081
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3207
keyIsClassVariableNameKey:aKey
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3208
    |i|
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3209
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3210
    i := aKey lastIndexOf:$:.
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3211
    i ~~ 0 ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3212
	i > 1 ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3213
	    (aKey at:(i-1)) == $: ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3214
		^ true.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3215
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3216
	].
9081
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3217
    ].
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3218
    ^ false.
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3219
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3220
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3221
     self keyIsClassVariableNameKey:'foo::bar'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3222
     self keyIsClassVariableNameKey:'foo:bar'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3223
     self keyIsClassVariableNameKey:':bar'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3224
     self keyIsClassVariableNameKey:'::bar'
9081
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3225
    "
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3226
!
c957b05ad97f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9080
diff changeset
  3227
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3228
loadedClassNamed:aString
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3229
    "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
  3230
     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
  3231
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3232
    |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
  3233
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3234
    "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
  3235
     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
  3236
    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
  3237
    sym notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3238
	cls := self at:sym ifAbsent:nil.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3239
	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
  3240
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3241
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3242
    (aString endsWith:' class') ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3243
	nonMeta := self loadedClassNamed:(aString copyWithoutLast:6).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3244
	nonMeta notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3245
	    ^ nonMeta theMetaclass
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3246
	].
9374
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3247
    ].
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3248
    ^ nil
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3249
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3250
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3251
     Smalltalk loadedClassNamed:'Object'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3252
     Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3253
     Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator::BasicAuthenticationData class'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3254
     Smalltalk loadedClassNamed:'Authentication::BasicAuthenticator'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3255
     Smalltalk loadedClassNamed:'fooBar'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3256
     Smalltalk loadedClassNamed:'true'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3257
     Smalltalk loadedClassNamed:'Object class'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3258
     Smalltalk loadedClassNamed:'Metaclass'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3259
     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
  3260
     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
  3261
    "
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3262
!
8198d65aadd3 #classNamed: now loads autoloaded classes if a (possibly) private class of an
Stefan Vogel <sv@exept.de>
parents: 9292
diff changeset
  3263
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3264
methodProtocolCompletion:aPartialProtocolName
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3265
    "given a partial method protocol name, return an array consisting of
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3266
     2 entries: 1st: the best (longest) match
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3267
		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
  3268
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  3269
    ^ DoWhatIMeanSupport methodProtocolCompletion:aPartialProtocolName inEnvironment:self
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3270
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3271
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3272
     Smalltalk methodProtocolCompletion:'doc'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3273
     Smalltalk methodProtocolCompletion:'docu'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3274
     Smalltalk methodProtocolCompletion:'documenta'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3275
    "
9508
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  3276
564f30f49b1b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9506
diff changeset
  3277
    "Modified: / 10-08-2006 / 13:05:20 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3278
!
5505
e99e8e9cbfef added #methodProtocolCompletion:
Claus Gittinger <cg@exept.de>
parents: 5504
diff changeset
  3279
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3280
numberOfGlobals
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3281
    "return the number of global variables in the system"
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3282
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3283
    |tally "{ Class: SmallInteger }" |
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3284
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3285
    tally := 0.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3286
    self do:[:obj | tally := tally + 1].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3287
    ^ tally
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3288
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3289
    "Smalltalk numberOfGlobals"
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3290
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3291
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3292
referencesAny:aCollection
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3293
    "redefined, since the references are only kept in the VM's symbol table"
3260
10e5199831ee added #referencesAny:
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  3294
10e5199831ee added #referencesAny:
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  3295
    self keysAndValuesDo:[:key :val |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3296
	aCollection do:[:anObject |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3297
	    (key == anObject) ifTrue:[^ true].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3298
	    (val == anObject ) ifTrue:[^ true].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3299
	]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3300
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3301
    ^ super referencesAny:aCollection
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3302
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3303
    "Created: / 2.2.1998 / 16:01:20 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3304
!
3260
10e5199831ee added #referencesAny:
Claus Gittinger <cg@exept.de>
parents: 3155
diff changeset
  3305
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3306
referencesDerivedInstanceOf:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3307
    "redefined, since the references are only kept in the VM's symbol table"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3308
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3309
    self keysAndValuesDo:[:key :val |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3310
	(key isKindOf:aClass) ifTrue:[^ true].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3311
	(val isKindOf:aClass) ifTrue:[^ true].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3312
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3313
    ^ super referencesDerivedInstanceOf:aClass
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3314
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3315
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3316
referencesInstanceOf:aClass
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3317
    "redefined, since the references are only kept in the VM's symbol table"
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3318
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3319
    self keysAndValuesDo:[:key :val |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3320
	(key isMemberOf:aClass) ifTrue:[^ true].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3321
	(val isMemberOf:aClass) ifTrue:[^ true].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3322
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3323
    ^ super referencesInstanceOf:aClass
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3324
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  3325
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3326
referencesObject:anObject
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3327
    "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
  3328
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  3329
    self keysAndValuesDo:[:key :val |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3330
	(key == anObject) ifTrue:[^ true].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3331
	(val == anObject ) ifTrue:[^ true].
6074
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  3332
    ].
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  3333
    ^ super referencesObject:anObject
d91c99700e3b renamed #references: (conflict with RB's #references)
Claus Gittinger <cg@exept.de>
parents: 6033
diff changeset
  3334
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3335
    "Modified: / 3.2.1998 / 14:22:46 / cg"
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3336
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3337
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3338
resolveName:nameIn inClass:aClass
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3339
    "resolve aName as if compiled within aClass;
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3340
     i.e. if it has a private class with this name, return it;
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3341
     if aName is known within the classes namespace, return that.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3342
     Otherwise, return a global with that name.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3343
     This should be used whereever Smalltalk>>at: used to be used,
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3344
     to resolve a global by name."
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3345
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  3346
    |aName sym cls ns|
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  3347
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  3348
    nameIn isNil ifTrue:[^ nil].
4356
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  3349
    nameIn isBehavior ifTrue:[^ nameIn].       "/ already resolved
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  3350
    aName := nameIn.
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  3351
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  3352
    (aName startsWith:'Smalltalk::') ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3353
	aName := aName copyFrom:12.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3354
	^ self at:(aName asSymbol) ifAbsent:nil.
4354
8e265dcb2536 fixed name resolving with Smalltalk:: as prefix
Claus Gittinger <cg@exept.de>
parents: 4334
diff changeset
  3355
    ].
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3356
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3357
    sym := aName asSymbol.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3358
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3359
    cls := aClass privateClassesAt:sym.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3360
    cls notNil ifTrue:[^ cls].
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3361
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3362
    ns := aClass nameSpace.
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3363
    (ns notNil and:[ns ~~ Smalltalk]) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3364
	ns isNameSpace ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3365
	    cls := ns at:sym ifAbsent:nil.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3366
	] ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3367
	    cls := ns privateClassesAt:sym
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3368
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3369
	cls notNil ifTrue:[^ cls].
3025
53b114d5be3e added #resolveClassNamed:
ca
parents: 3022
diff changeset
  3370
    ].
3026
7e1d4efc5ba5 *** empty log message ***
ca
parents: 3025
diff changeset
  3371
    ^ self at:sym ifAbsent:nil.
4356
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  3372
54d1f0b81638 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4355
diff changeset
  3373
    "Modified: / 9.7.1999 / 01:18:07 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3374
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3375
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3376
selectorCompletion:aPartialSymbolName
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3377
    "given a partial selector, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3378
     2 entries: 1st: the longest match
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3379
		2nd: collection consisting of matching implemented selectors"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3380
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3381
    ^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:self
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3382
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3383
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3384
selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3385
    "given a partial selector, return an array consisting of
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3386
     2 entries: 1st: the longest match
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3387
		2nd: collection consisting of matching implemented selectors"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3388
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3389
    ^ DoWhatIMeanSupport selectorCompletion:aPartialSymbolName inEnvironment:anEnvironment
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3390
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3391
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3392
     Smalltalk selectorCompletion:'at:p'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3393
     Smalltalk selectorCompletion:'nextP'
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3394
     Smalltalk selectorCompletion:'nextp'
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3395
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3396
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3397
    "Modified: / 7.6.1996 / 08:44:33 / stefan"
3565
966a108e3765 also do caseless selectorCompletion
Claus Gittinger <cg@exept.de>
parents: 3560
diff changeset
  3398
    "Modified: / 14.6.1998 / 15:54:03 / cg"
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  3399
! !
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  3400
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  3401
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3402
!Smalltalk class methodsFor:'queries-system'!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3403
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3404
dialectName
8736
e6e8a6754506 #dialectName answers a symbol
Stefan Vogel <sv@exept.de>
parents: 8712
diff changeset
  3405
    ^ #SmalltalkX
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3406
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3407
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3408
     Smalltalk dialectName
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3409
    "
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3410
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3411
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3412
dialectReleaseVersion
7348
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  3413
    ^ self versionString
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  3414
277bbf3b3de2 category
Claus Gittinger <cg@exept.de>
parents: 7325
diff changeset
  3415
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3416
     Smalltalk dialectReleaseVersion
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3417
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3418
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3419
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3420
isDolphinSmalltalk
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3421
    "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
  3422
     applications - add #isDolphinSmalltalk to your dolphin,
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3423
     returning true there."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3424
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3425
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3426
!
4970
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  3427
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3428
isSmalltalkMT
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3429
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3430
     applications - add #isSmalltalkMT to your smalltalk-MT,
4970
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  3431
     returning true there."
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  3432
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  3433
    ^ false
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  3434
!
c5ab8ead5b8e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4963
diff changeset
  3435
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3436
isSmalltalkV
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3437
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3438
     applications - add #isSmalltalkV to your smalltalkV,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3439
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3440
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3441
    ^ false
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3442
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3443
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3444
isSmalltalkX
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3445
    "return true here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3446
     applications - add #isSmalltalkX to your other smalltalks,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3447
     returning false there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3448
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3449
    ^ true
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3450
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3451
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3452
isSqueak
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3453
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3454
     applications - add #isSqueak to your squeak,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3455
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3456
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3457
    ^ false
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3458
!
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3459
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3460
isVisualAge
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3461
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3462
     applications - add #isVisualAge to your visualAge,
4431
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3463
     returning true there."
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3464
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3465
    ^ false
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3466
!
1c7ee9a97eda *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4430
diff changeset
  3467
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3468
isVisualWorks
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3469
    "return false here - this may be useful to write portable
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3470
     applications - add #isVisualWorks to your visualWorks,
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3471
     returning true there."
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3472
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3473
    ^ false
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3474
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3475
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  3476
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  3477
!Smalltalk class methodsFor:'startup'!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  3478
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3479
browserWindowStartup
13056
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3480
    "invoked, when st/x is started as a plugin in a (currently firefox) browser.
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3481
     In contrast to squeak (where a single window is used to show the display bitmap),
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3482
     the browser window is used as a pseudo root-window for a single aplication window.
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3483
     If required, that app must ensure that multiple apps (if any) are setup as a
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3484
     multiwindow application.
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3485
     Actually, control is transferred to PluginSupport, which is suppoesed to know what to do"
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3486
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3487
    |windowIDString numericWindowID windowID params idx process|
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3488
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3489
    idx := CommandLineArguments indexOf:'--browserWindow:'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3490
    windowIDString := CommandLineArguments at:idx+1.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3491
    numericWindowID := Integer fromString:windowIDString.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3492
    windowID := ExternalAddress newAddress:numericWindowID.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3493
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3494
    idx := CommandLineArguments indexOf:'--browserParameters:'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3495
    idx ~~ 0 ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3496
	params := Dictionary new.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3497
	(CommandLineArguments copyFrom:idx+1) pairWiseDo:[:key :value |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3498
	    params at:key put:value.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3499
	].
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3500
    ].
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3501
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3502
    'browserWindow is: ' errorPrint. windowID errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3503
    'browserParameters are: ' errorPrint. params errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3504
    'Display is: ' errorPrint. Display errorPrintCR.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3505
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3506
    process := [
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3507
	PluginSupport
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3508
	    startInBrowserWithWindowID:windowID
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  3509
	    parameters:params.
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3510
    ] newProcess.
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  3511
    process priority:(Processor userSchedulingPriority).
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3512
    process name:'browser start handler'.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3513
    process beGroupLeader.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3514
    process resume.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3515
    process := nil.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3516
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3517
    Processor dispatchLoop.
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3518
    Smalltalk exit.
13056
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3519
1fa92a4cd9cc comment in #browserWindowStartup
Claus Gittinger <cg@exept.de>
parents: 13014
diff changeset
  3520
    "Modified: / 11-09-2010 / 14:06:59 / cg"
9032
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3521
!
ef419ad5e15a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9030
diff changeset
  3522
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3523
displayInitializationDone
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3524
    "inform the restart, that the display has been initialized"
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3525
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3526
    CallbackSignal raiseRequest.
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3527
!
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3528
13893
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3529
executeStartBlocks
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3530
    |startBlocks|
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3531
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3532
    startBlocks := self startBlocks.
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3533
    startBlocks notNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3534
	'Smalltalk [info]: execute startBlocks...' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3535
	startBlocks do:[:aBlock|
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3536
	    Error handle:[:ex |
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3537
		InfoPrinting == true ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3538
		    'Smalltalk [warning]: error cought in startBlock: ' infoPrint.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3539
		    ex description infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3540
		    ex infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3541
		    thisContext fullPrintAll.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3542
		].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3543
	    ] do: aBlock
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3544
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3545
	startBlocks removeAll.
13893
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3546
    ].
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3547
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3548
    "Created: / 07-01-2012 / 12:58:39 / cg"
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3549
!
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3550
11375
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3551
hideSplashWindow
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3552
%{
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3553
#ifdef WIN32
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3554
    extern void __win32_hideSplashScreen();
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3555
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3556
    __win32_hideSplashScreen();
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3557
#endif
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3558
%}
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3559
!
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  3560
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3561
mainStartup:graphicalMode
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  3562
    "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
  3563
     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
  3564
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  3565
    |process imageName thisIsARestart idx|
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3566
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3567
    imageName := ObjectMemory imageName.
2249
cdb6c87f0707 send returnFromSnapshot notification later -
Claus Gittinger <cg@exept.de>
parents: 2212
diff changeset
  3568
    thisIsARestart := imageName notNil.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3569
10644
a67765a8a0d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10643
diff changeset
  3570
    graphicalMode ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3571
	Display isNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3572
	    (StartupClass notNil
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3573
	    and:[ (StartupClass perform:#isHeadless ifNotUnderstood:false) ]) ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3574
		self openDisplay.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3575
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3576
	].
10644
a67765a8a0d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10643
diff changeset
  3577
    ].
a67765a8a0d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10643
diff changeset
  3578
10645
48da7d0c8fb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10644
diff changeset
  3579
    StandAlone ifFalse:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3580
	"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3581
	 enable the graphical debugger/inspector
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3582
	 (they could have been (re)defined as autoloaded in the patches file)
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3583
	"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3584
	self initStandardTools.
10645
48da7d0c8fb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10644
diff changeset
  3585
    ].
48da7d0c8fb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10644
diff changeset
  3586
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3587
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  3588
     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
  3589
    "
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3590
    Display notNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3591
	Display deviceIOTimeoutErrorSignal handlerBlock:[:ex |
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3592
	    SaveEmergencyImage == true ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3593
		'Display [warning]: broken display connection - emergency save in ''crash.img''.' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3594
		ObjectMemory primSnapShotOn:'crash.img'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3595
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3596
	    'Display [warning]: broken display connection - exit.' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3597
	    self exit.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3598
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3599
	Display startDispatch.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3600
    ].
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3601
9016
2979527dbdf4 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9015
diff changeset
  3602
    idx := CommandLineArguments indexOf:'--browserWindow:'.
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3603
    IsPlugin := (idx ~~ 0).
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  3604
    IsPlugin ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3605
	'Smalltalk [info]: startup browser window...' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3606
	self browserWindowStartup.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3607
	"/ not reached
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  3608
    ].
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  3609
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3610
    Initializing := false.
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3611
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3612
    "/ 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
  3613
    "/ 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
  3614
    "/ 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
  3615
    "/ 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
  3616
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  3617
    process := [
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3618
	'Smalltalk [info]: startup process 1 active.' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3619
	StartBlocks notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3620
	    self executeStartBlocks.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3621
	    StartBlocks := nil.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3622
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3623
	ImageStartBlocks notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3624
	    'Smalltalk [info]: execute imageStartBlocks...' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3625
	    ImageStartBlocks do:[:aBlock|
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3626
		aBlock value
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3627
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3628
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3629
	StandAlone ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3630
	    (SilentLoading == true) ifFalse:[   "i.e. undefined counts as false"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3631
		thisIsARestart ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3632
		    Transcript cr.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3633
		    Transcript showCR:('Smalltalk restarted from:'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3634
					, imageName
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3635
					, ' (saved '
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3636
					, ObjectMemory imageSaveTime printString
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3637
					, ')' ).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3638
		] ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3639
		    Transcript showCR:(self hello).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3640
		    Transcript showCR:(self copyrightString).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3641
		].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3642
		Transcript cr.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3643
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3644
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3645
	    DemoMode==true ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3646
		Transcript showCR:'*** Restricted use:                              ***'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3647
		Transcript showCR:'*** This program may be used for education only. ***'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3648
		Transcript showCR:'*** Please read the files COPYRIGHT and LICENSE  ***'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3649
		Transcript showCR:'*** for more details.                            ***'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3650
		Transcript cr.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3651
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3652
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3653
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3654
	thisIsARestart ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3655
	    "/
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3656
	    "/ the final late notification - users can now assume that
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3657
	    "/ views, forms etc. have been recreated.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3658
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3659
	    ObjectMemory changed:#returnFromSnapshot.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3660
	]
7039
6f1c02381145 Do not keep reference to start block handler process.
Stefan Vogel <sv@exept.de>
parents: 7000
diff changeset
  3661
7040
d24ef75bc6c3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7039
diff changeset
  3662
    ] newProcess.
d24ef75bc6c3 *** empty log message ***
Stefan Vogel <sv@exept.de>
parents: 7039
diff changeset
  3663
9043
e6106f500263 do not use numeric process prios
Claus Gittinger <cg@exept.de>
parents: 9036
diff changeset
  3664
    process priority:(Processor userSchedulingPriority).
7043
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  3665
    process name:'start block handler'.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  3666
    process beGroupLeader.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  3667
    process resume.
d88be9c553d2 Release references to processes in #mainStartup:
Stefan Vogel <sv@exept.de>
parents: 7040
diff changeset
  3668
    process := nil.
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  3669
10139
a3f6265978ad Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents: 10131
diff changeset
  3670
    ObjectMemory startBackgroundCollectorAt:5.
a3f6265978ad Start bachgroundCollector and -Finalizer in mainStartup
Stefan Vogel <sv@exept.de>
parents: 10131
diff changeset
  3671
    ObjectMemory startBackgroundFinalizationAt:5.
1650
b4b36961d1bc Add StartBlocks and ImageStartBlocks.
Stefan Vogel <sv@exept.de>
parents: 1647
diff changeset
  3672
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3673
    "/ 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
  3674
    "/ message.
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  3675
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3676
    (StartupClass notNil and:[StartupSelector notNil]) ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3677
	"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3678
	 allow more customization by reading an image specific rc-file
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3679
	"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3680
	thisIsARestart ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3681
	    (imageName asFilename hasSuffix:'img') ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3682
		imageName := imageName copyWithoutLast:4
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3683
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3684
	    self fileIn:(imageName , '.rc')
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3685
	].
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3686
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3687
"/        Display notNil ifTrue:[
6559
2ec6d0d1b821 Changed Workstation initialization
Stefan Vogel <sv@exept.de>
parents: 6539
diff changeset
  3688
"/            Display exitOnLastClose:true.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3689
"/        ].
2086
4a9d8b5cada7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
  3690
"/        Processor exitWhenNoMoreUserProcesses:true.
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3691
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3692
	process := [
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3693
	    'Smalltalk [info]: startup process 2 active.' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3694
	    StandAlone ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3695
		AbortOperationRequest handle:[:ex |
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3696
		    'Smalltalk [info]: aborted - exit.' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3697
		    OperatingSystem exit:1
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3698
		] do:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3699
		    ('Smalltalk [info]: call ',StartupSelector,' of ',StartupClass name,' (1)') infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3700
		    StartupClass perform:StartupSelector withArguments:StartupArguments.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3701
		]
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3702
	    ] ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3703
		('Smalltalk [info]: call ',StartupSelector,' of ',StartupClass name,' (2)') infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3704
		StartupClass perform:StartupSelector withArguments:StartupArguments.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3705
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3706
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3707
	    "/
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3708
	    "/ non-GUI apps exit after the startup;
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3709
	    "/ assume that GUI apps have created & opened some view ...
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3710
	    "/
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3711
	    Display isNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3712
		'Smalltalk [info]: no Display - exit.' infoPrintCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3713
		Smalltalk exit.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3714
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3715
	    "/
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3716
	    "/ GUI apps exit after the last user process has finished
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3717
	    "/
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3718
	    Display exitOnLastClose:true.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3719
	    Processor exitWhenNoMoreUserProcesses:true.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3720
	] newProcess.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3721
	process priority:(Processor userSchedulingPriority).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3722
	process name:'main'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3723
	process beGroupLeader.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3724
	process resume.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3725
	process := nil.    "do not refer to process"
11681
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3726
    ].
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3727
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3728
    StandAlone ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3729
	Display notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3730
	    FlyByHelp notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3731
		FlyByHelp start
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3732
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3733
	].
12627
144e362477ff ask startupClass if splash window should be kept open
Claus Gittinger <cg@exept.de>
parents: 12614
diff changeset
  3734
    ].
11681
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3735
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3736
    "
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3737
     if view-classes exist, start dispatching;
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3738
     otherwise go into a read-eval-print loop
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3739
    "
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3740
    ((Display notNil and:[graphicalMode])
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3741
     or:[process notNil
13851
5ab434e0a636 changed: #mainStartup: for scripting stand alone apps
Claus Gittinger <cg@exept.de>
parents: 13850
diff changeset
  3742
     or:[HeadlessOperation
5ab434e0a636 changed: #mainStartup: for scripting stand alone apps
Claus Gittinger <cg@exept.de>
parents: 13850
diff changeset
  3743
     or:[StandAlone]]]) ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3744
	Processor dispatchLoop.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3745
	"done - the last process finished"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3746
	'Smalltalk [info]: last process finished - exit.' infoPrintCR.
11681
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3747
    ] ifFalse:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3748
	StandAlone ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3749
	    self readEvalPrint
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  3750
	]
11681
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3751
    ].
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3752
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3753
    self exit
4c274a7ef60c Fix stc compile error in prev change
Stefan Vogel <sv@exept.de>
parents: 11679
diff changeset
  3754
13526
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  3755
    "Created: / 18-07-1996 / 21:07:39 / cg"
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  3756
    "Modified: / 09-09-1996 / 17:42:50 / stefan"
13893
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  3757
    "Modified: / 07-01-2012 / 12:59:23 / cg"
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3758
!
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  3759
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3760
openDisplay
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3761
    "try to open a display connection.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3762
     If so, also read display- and keyboard.rc"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3763
13385
0fa57f2d37f2 changed: #openDisplay
Stefan Vogel <sv@exept.de>
parents: 13370
diff changeset
  3764
    |commandName|
0fa57f2d37f2 changed: #openDisplay
Stefan Vogel <sv@exept.de>
parents: 13370
diff changeset
  3765
0fa57f2d37f2 changed: #openDisplay
Stefan Vogel <sv@exept.de>
parents: 13370
diff changeset
  3766
    commandName := Smalltalk commandName.
0fa57f2d37f2 changed: #openDisplay
Stefan Vogel <sv@exept.de>
parents: 13370
diff changeset
  3767
    (commandName, ' [info]: opening display...') infoPrintCR.
10649
82b327ec636d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10646
diff changeset
  3768
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3769
    Display isNil ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3770
	Screen notNil ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3771
	    [
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3772
		Screen openDefaultDisplay:nil.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3773
	    ] on:Screen deviceOpenErrorSignal do:[:ex|
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3774
		('%1 [error]: No display connection to: %2' bindWith:commandName with:ex parameter) errorPrintCR.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3775
		(commandName, ' [info]: Either set the DISPLAY environment variable,') infoPrintCR.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3776
		(commandName, ' [info]: or start smalltalk with a -display argument.') infoPrintCR.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3777
		HeadlessOperation == true ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3778
		    OperatingSystem exit:1.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3779
		].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3780
	    ].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3781
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3782
	    Display notNil ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3783
		(self secureFileIn:'display.rc') ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3784
		    "/ 'Smalltalk [warning]: no display.rc found; screen setting might be wrong.' errorPrintCR.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3785
		    (self secureFileIn:'keyboard.rc') ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3786
			"/ 'Smalltalk [warning]: no keyboard.rc found; shortkey setting might be wrong.' errorPrintCR.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3787
		    ]
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3788
		]
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3789
	    ].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3790
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3791
    ]
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3792
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3793
    "Created: / 06-12-2006 / 15:38:17 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3794
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3795
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3796
readEvalPrint
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3797
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3798
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3799
    (ReadEvalPrintLoop new prompt:'ST> ') readEvalPrintLoop
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3800
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3801
    "Modified: / 07-12-2006 / 17:35:19 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3802
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3803
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3804
restart
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3805
    "startup after an image has been loaded;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3806
     there are three change-notifications made to dependents of ObjectMemory,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3807
     which allow a stepwise re-init: #earlyRestart, #restarted and #returnFromSnapshot.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3808
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3809
     #earlySystemInstallation is sent for ST80 compatibility
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3810
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3811
     #earlyRestart is send first, nothing has been setup yet.
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3812
		   (should be used to flush all device dependent entries)
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3813
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3814
     #restarted is send right after.
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3815
		   (should be used to recreate external resources (fds, bitmaps etc)
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3816
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3817
     #returnFromSnapshot is sent last
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3818
		   (should be used to restart processes, reOpen Streams which cannot
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3819
		    be automatically be reopened (i.e. Sockets, Pipes) and so on.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3820
		   (Notice that positionable fileStreams are already reopened and repositioned)
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3821
     "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3822
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3823
    |deb insp transcript idx|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3824
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3825
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3826
    "/ when we arrive here, all objects from our previous life
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3827
    "/ have been reloaded - however, some may still contain invalid device
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3828
    "/ handles, display information etc.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3829
    "/ also, dynamically loaded modules have not yet been reloaded yet.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3830
    "/ and the concrete OS, concrete FileName etc. are still refering to
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3831
    "/ the previous classes.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3832
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3833
    Initializing := true.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3834
    AbstractOperatingSystem initializeConcreteClass.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3835
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3836
    ImageRestartTime := Timestamp now.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3837
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3838
    CommandLine := CommandLineArguments copy.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3839
    CommandLineArguments := CommandLineArguments asOrderedCollection.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3840
    CommandName := CommandLineArguments removeFirst. "/ the command
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3841
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3842
    idx := CommandLineArguments indexOf:'-q'.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3843
    idx == 0 ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3844
	idx := CommandLineArguments indexOf:'--silent'.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3845
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3846
    idx ~~ 0 ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3847
	Object infoPrinting:false.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3848
	ObjectMemory infoPrinting:false.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3849
	CommandLineArguments removeAtIndex:idx.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3850
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3851
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3852
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3853
    "/ start catching SIGSEGV and SIGBUS
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3854
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3855
    OperatingSystem enableHardSignalInterrupts.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3856
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3857
    "/ reinit Filename
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3858
    Filename reinitialize.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3859
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3860
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3861
    "/ flush cached path directories (may have changed in the meanwhile)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3862
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3863
    self flushPathCaches.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3864
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3865
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3866
    "/ reinit the default streams: Stdin, Stdout and Stderr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3867
    "/ after that, we can write to stderr.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3868
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3869
    self reinitStandardStreams.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3870
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3871
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3872
    "/ redirect Transcript to Stderr during startup
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3873
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3874
    transcript := Transcript.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3875
    Transcript := Stderr.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3876
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3877
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3878
    "/ temporary switch back to dumb interface -
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3879
    "/ to handle errors while view-stuff is not yet reinitialized
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3880
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3881
    insp := Inspector.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3882
    deb := Debugger.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3883
    deb notNil ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3884
	deb reinitialize
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3885
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3886
    Inspector := MiniInspector.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3887
    Debugger := MiniDebugger.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3888
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3889
    "/ reload any dynamically loaded objects.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3890
    "/ this must be done before doing anything else below,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3891
    "/ because the Processor may restart processes which use
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3892
    "/ this code.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3893
    "/ Also, a dynamic object might be registered as dependent of
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3894
    "/ ObjectFileLoader; therefore, must reload before doing any notifications.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3895
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3896
    ObjectFileLoader notNil ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3897
	ObjectFileLoader reloadAllRememberedObjectFiles.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3898
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3899
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3900
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3901
    "/ invalidate all display connections.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3902
    "/ This is required to avoid trouble if someone accesses
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3903
    "/ a display during early startup.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3904
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3905
    Screen notNil ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3906
	Screen allScreens do:[:aDisplay |
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3907
	    aDisplay invalidateConnection
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3908
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3909
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3910
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3911
    ObjectMemory changed:#earlySystemInstallation.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3912
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3913
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3914
    "/ reinitialize the Processor - restartable processes
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3915
    "/ are now restarted here (but not yet scheduled).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3916
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3917
    Processor reinitialize.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3918
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3919
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3920
    "/ flush device handles & recreate OS resources (if possible)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3921
    "/ (mostly view/GC/color & font stuff)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3922
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3923
    ObjectMemory
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3924
	changed:#earlyRestart; changed:#restarted.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3925
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3926
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3927
    "/ start catching SIGINT and SIGQUIT
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3928
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3929
    OperatingSystem enableUserInterrupts.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3930
    OperatingSystem enableCrashSignalInterrupts.
12782
226df0172288 changed: #restart
Stefan Vogel <sv@exept.de>
parents: 12780
diff changeset
  3931
    ObjectMemory restoreGarbageCollectorSettings.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3932
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3933
    "/ give user a chance to re-customize things in smalltalk_r.rc.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3934
    "/ reading if smalltalk_r.rc may be suppressed by the --faststart argument.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3935
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3936
    idx := CommandLineArguments indexOf:'--faststart'.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3937
    idx == 0 ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3938
	idx := CommandLineArguments indexOf:'--fastStart'.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3939
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3940
    idx ~~ 0 ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3941
	CommandLineArguments removeAtIndex:idx.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3942
    ] ifFalse:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3943
	CallbackSignal := QuerySignal new.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3944
	[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3945
	    Class withoutUpdatingChangesDo:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3946
		(self fileIn:(self commandName , '_r.rc')) ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3947
		    "no _r.rc file where executable is; try default smalltalk_r.rc"
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3948
		    self fileIn:'smalltalk_r.rc'
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3949
		].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3950
	    ]
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3951
	] on:CallbackSignal do:[:ex|
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3952
	    "/ now, display and view-stuff works;
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3953
	    "/ back to the previous debugging interface
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3954
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3955
	    Inspector := insp.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3956
	    Debugger := deb.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3957
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3958
	    "/ reinstall Transcript, if not changed during restart.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3959
	    "/ if there was no Transcript, go to stderr
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3960
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3961
	    (transcript notNil and:[Transcript == Stderr]) ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3962
		Transcript := transcript.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3963
	    ].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3964
	    Initializing := false.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3965
	    ex proceed.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3966
	].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3967
	CallbackSignal := nil.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3968
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3969
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3970
    "/ reinitialization (restart) of Display is normally performed
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3971
    "/ in the restart script. If this has not been run for some reason,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3972
    "/ do in now.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3973
    Initializing ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3974
	Display notNil ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3975
	    [
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3976
		Display reinitializeFor:Screen defaultDisplayName.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3977
	    ] on:Screen deviceOpenErrorSignal do:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3978
		'Smalltalk [error]: Cannot restart connection to: ' errorPrint.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3979
		Screen defaultDisplayName errorPrintCR.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3980
		OperatingSystem exit:1.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3981
	    ].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3982
	].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3983
	"/ now, display and view-stuff works;
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3984
	"/ back to the previous debugging interface
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3985
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3986
	Inspector := insp.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3987
	Debugger := deb.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3988
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3989
	"/ reinstall Transcript, if not changed during restart.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3990
	"/ if there was no Transcript, go to stderr
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3991
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3992
	(transcript notNil and:[Transcript == Stderr]) ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3993
	    Transcript := transcript.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3994
	].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3995
	Initializing := false.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3996
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  3997
    Screen notNil ifTrue:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3998
	"clean up leftover screens (and views) that haven't been reopened.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  3999
	 Operate on a copy, since brokenConnection removes us from AllScreens"
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4000
	Screen allScreens copy do:[:eachDisplay |
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4001
	    eachDisplay isOpen ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4002
		'Smalltalk [info]: cannot reopen secondary display: ' errorPrint.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4003
		eachDisplay errorPrintCR.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4004
		eachDisplay cleanupAfterDispatch; brokenConnection.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4005
	    ]
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4006
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4007
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4008
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4009
    deb := insp := transcript := nil.   "avoid dangling refs"
13526
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  4010
    (StartupClass perform:#keepSplashWindowOpen ifNotUnderstood:[false]) ifFalse:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4011
	self hideSplashWindow.   "/ if there is one, it's now time to hide it
13526
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  4012
    ].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4013
    self mainStartup:true
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4014
13526
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  4015
    "Modified: / 03-08-1999 / 09:42:21 / stefan"
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  4016
    "Modified: / 29-07-2011 / 17:58:23 / cg"
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  4017
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  4018
11399
19962a6e2972 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4019
showSplashMessage:aString
19962a6e2972 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4020
    "put the message into the splash screen (if there is one).
19962a6e2972 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4021
     Use this for messages during startup"
19962a6e2972 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4022
19962a6e2972 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4023
    self showSplashMessage:aString color:nil.
19962a6e2972 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4024
!
19962a6e2972 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11393
diff changeset
  4025
11388
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4026
showSplashMessage:aMessageStringOrNil color:rgbValueOrNil
11389
4f63adbf978a comments
Claus Gittinger <cg@exept.de>
parents: 11388
diff changeset
  4027
    "put the message into the splash screen (if there is one)."
4f63adbf978a comments
Claus Gittinger <cg@exept.de>
parents: 11388
diff changeset
  4028
11388
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4029
%{
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4030
#ifdef WIN32
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4031
    extern void __win32_splashMessage();
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4032
    char *msg = (char *)0;
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4033
    int clr = 0;
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4034
12481
805176d238d2 change __isString() to __isStringLike() in primitive code
Stefan Vogel <sv@exept.de>
parents: 12413
diff changeset
  4035
    if (__isStringLike(aMessageStringOrNil)) {
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4036
	msg = __stringVal(aMessageStringOrNil);
11388
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4037
    }
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4038
    if (__isSmallInteger(rgbValueOrNil)) {
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4039
	clr = __intVal(rgbValueOrNil);
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4040
	__win32_splashMessageColor(clr);
11388
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4041
    }
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4042
    __win32_splashMessage(msg);
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4043
#endif
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4044
%}
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4045
!
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4046
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4047
splashInfo:aString
11389
4f63adbf978a comments
Claus Gittinger <cg@exept.de>
parents: 11388
diff changeset
  4048
    "like infoPrintCR,
4f63adbf978a comments
Claus Gittinger <cg@exept.de>
parents: 11388
diff changeset
  4049
     but in addition put the message into the splash screen (if there is one).
4f63adbf978a comments
Claus Gittinger <cg@exept.de>
parents: 11388
diff changeset
  4050
     Use this for info messages during startup"
4f63adbf978a comments
Claus Gittinger <cg@exept.de>
parents: 11388
diff changeset
  4051
12883
133a10b7bd12 changed: #splashInfo:
Claus Gittinger <cg@exept.de>
parents: 12867
diff changeset
  4052
    aString notNil ifTrue:[ aString infoPrintCR ].
11388
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4053
    self showSplashMessage:aString color:nil.
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4054
!
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4055
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4056
start
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4057
    "main startup, if there is a Display, initialize it
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4058
     and start dispatching; otherwise go into a read-eval-print loop."
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4059
9012
43ef70cac099 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9011
diff changeset
  4060
    |idx graphicalMode arg didReadRCFile|
960
e3b75f50d0cd changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
  4061
e3b75f50d0cd changes for standAlone operation
Claus Gittinger <cg@exept.de>
parents: 948
diff changeset
  4062
    graphicalMode := true.
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4063
    Initializing := true.
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4064
13526
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  4065
    (StartupClass perform:#keepSplashWindowOpen ifNotUnderstood:[false]) ifFalse:[
14545
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4066
        self hideSplashWindow.   "/ if there is one, it's now time to hide it
13526
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  4067
    ].
cfa0ed74dd6f changed:
Claus Gittinger <cg@exept.de>
parents: 13518
diff changeset
  4068
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4069
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4070
     while reading patches- and rc-file, do not add things into change-file
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4071
    "
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4072
    Class withoutUpdatingChangesDo:[
14545
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4073
        |commandFile defaultRC prevCatchSetting|
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4074
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4075
        didReadRCFile := false.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4076
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4077
        StandAlone ifFalse:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4078
            "/
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4079
            "/ look for any '-q', '-e' or '-f' command line arguments
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4080
            "/ and handle them;
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4081
            "/ read startup and patches file
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4082
            "/
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4083
            idx := CommandLineArguments indexOf:'-q'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4084
            idx == 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4085
                idx := CommandLineArguments indexOf:'--silent'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4086
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4087
            idx ~~ 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4088
                Object infoPrinting:false.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4089
                ObjectMemory infoPrinting:false.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4090
                CommandLineArguments removeAtIndex:idx.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4091
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4092
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4093
            "/ look for a '--repl' argument
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4094
            "/ then go into a read-eval-print loop immediately
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4095
            idx := CommandLineArguments indexOf:'--repl'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4096
            idx ~~ 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4097
                CommandLineArguments removeAtIndex:idx.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4098
                self startSchedulerAndBackgroundCollector.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4099
                self readEvalPrint.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4100
                self exit.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4101
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4102
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4103
            "/ look for a '-e filename' or '--execute filename' argument
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4104
            "/ this will force fileIn of filename only, no standard startup.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4105
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4106
            idx := CommandLineArguments indexOf:'-e'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4107
            idx == 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4108
                idx := CommandLineArguments indexOf:'--execute'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4109
                idx == 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4110
                    idx := CommandLineArguments indexOf:'--script'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4111
                    idx ~~ 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4112
                        SilentLoading := true.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4113
                    ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4114
                ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4115
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4116
            idx ~~ 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4117
                |process|
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4118
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4119
                CommandName := arg := CommandLineArguments at:idx + 1.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4120
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4121
                CommandLineArguments
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4122
                    removeAtIndex:idx+1; removeAtIndex:idx.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4123
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4124
                self startSchedulerAndBackgroundCollector.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4125
                Initializing := false.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4126
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4127
                process := [
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4128
                    arg = '-' ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4129
                        self fileInStream:Stdin
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4130
                               lazy:nil
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4131
                               silent:nil
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4132
                               logged:false
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4133
                               addPath:nil
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4134
                    ] ifFalse:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4135
                        IsSTScript := true.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4136
                        self fileIn:arg.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4137
                    ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4138
                    self exit.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4139
                ] newProcess.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4140
                process priority:(Processor userSchedulingPriority).
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4141
                process name:'main'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4142
                process beGroupLeader.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4143
                process resume.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4144
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4145
                Processor dispatchLoop.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4146
                self exit
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4147
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4148
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4149
            "/ look for a '-E expr' or '--eval expr' argument
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4150
            "/ this will force evaluation of expr only, no standard startup
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4151
            idx := CommandLineArguments indexOf:'-E'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4152
            idx == 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4153
                idx := CommandLineArguments indexOf:'--eval'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4154
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4155
            idx ~~ 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4156
                arg := CommandLineArguments at:idx + 1.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4157
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4158
                CommandLineArguments
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4159
                    removeAtIndex:idx+1; removeAtIndex:idx.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4160
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4161
                self startSchedulerAndBackgroundCollector.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4162
                Initializing := false.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4163
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4164
                self
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4165
                    fileInStream:arg readStream
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4166
                    lazy:nil
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4167
                    silent:nil
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4168
                    logged:false
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4169
                    addPath:nil.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4170
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4171
                self exit
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4172
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4173
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4174
            "look for a '-f filename' or '--file filename' argument
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4175
             this will force evaluation of filename instead of smalltalk.rc"
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4176
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4177
            idx := CommandLineArguments indexOf:'-f'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4178
            idx == 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4179
                idx := CommandLineArguments indexOf:'--file'.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4180
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4181
            idx ~~ 0 ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4182
                CommandName := commandFile := CommandLineArguments at:idx+1.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4183
                CommandLineArguments removeAtIndex:idx+1; removeAtIndex:idx.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4184
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4185
        ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4186
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4187
        commandFile notNil ifTrue:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4188
            self startSchedulerAndBackgroundCollector.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4189
            Initializing := false.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4190
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4191
            (self secureFileIn:commandFile) ifFalse:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4192
                ('Smalltalk [error]: startup file "', commandFile, '" not found.') errorPrintCR.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4193
                OperatingSystem exit:1.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4194
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4195
        ] ifFalse:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4196
            "/ look for <command>.rc
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4197
            "/ if not found, read smalltalk.rc (or stxapp.rc for standAlone operation)
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4198
17834
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4199
	    commandFile := self commandName asFilename withSuffix:'rc'.
17892
d86c8bd5ece3 Merged with CVS
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17889
diff changeset
  4200
	    (didReadRCFile := commandFile exists and:[self secureFileIn:commandFile]) ifFalse:[
17834
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4201
		StandAlone ifFalse:[
17893
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  4202
		    defaultRC := 'smalltalk.rc' "/asFilename
17834
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4203
		] ifTrue:[
17893
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  4204
		    defaultRC := 'stxapp.rc' "/asFilename
17834
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4205
		].
17893
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  4206
		"JV@2011-11-01: DO NOT check defaultRC exist - this prevents smalltalk to
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  4207
		    to be started with different working directory than stx/projects/smalltalk !!!!!!"
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  4208
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  4209
		"/didReadRCFile := defaultRC exists and:[self secureFileIn:defaultRC].
694f26d2219c Startup fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17892
diff changeset
  4210
		didReadRCFile := self secureFileIn:defaultRC.
17834
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4211
		didReadRCFile ifFalse:[
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4212
		    StandAlone ifFalse:[
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4213
			'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4214
			graphicalMode := false.
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4215
		    ]
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4216
		]
04ff72c5039a Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17831
diff changeset
  4217
	    ].
14545
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4218
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4219
            "/ ('StandAlone is %1' bindWith:StandAlone) printCR.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4220
            "/ ('Headless is %1' bindWith:HeadlessOperation) printCR.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4221
            "/ ('Display is %1' bindWith:Display) printCR.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4222
            "/ ('Screen is %1' bindWith:Screen) printCR.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4223
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4224
            didReadRCFile ifFalse:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4225
                'private.rc' asFilename exists ifTrue:[ self secureFileIn:'private.rc' ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4226
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4227
                "/
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4228
                "/ No RC file found;
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4229
                "/ Setup more default stuff
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4230
                "/
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4231
                StandAlone ifFalse:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4232
                    "/ its a smalltalk - proceed in interpreter.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4233
                    'Smalltalk [warning]: no startup rc-file found. Going into line-by-line interpreter.' infoPrintCR.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4234
                    graphicalMode := false.
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4235
                ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4236
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4237
                "/ setup more defaults...
13537
647c75f02ce7 changed:
Claus Gittinger <cg@exept.de>
parents: 13536
diff changeset
  4238
"/                ObjectMemory startBackgroundCollectorAt:5.
647c75f02ce7 changed:
Claus Gittinger <cg@exept.de>
parents: 13536
diff changeset
  4239
"/                ObjectMemory startBackgroundFinalizationAt:5.
14545
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4240
                self addStartBlock:[
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4241
                    self startSchedulerAndBackgroundCollector
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4242
                ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4243
            ].
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4244
        ].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4245
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4246
10644
a67765a8a0d3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10643
diff changeset
  4247
    HeadlessOperation ifTrue:[
14545
0844ac45df99 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14542
diff changeset
  4248
        graphicalMode := false.
2074
01f7e1396c18 fixed standalone startup (broke when startupblocks where invented ...)
Claus Gittinger <cg@exept.de>
parents: 2050
diff changeset
  4249
    ].
10645
48da7d0c8fb5 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10644
diff changeset
  4250
1578
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  4251
    self mainStartup:graphicalMode
9df8cc1ec5c4 start & restart actions merged into a common method.
Claus Gittinger <cg@exept.de>
parents: 1573
diff changeset
  4252
13564
4cd72a7fe49c changed: #start
Claus Gittinger <cg@exept.de>
parents: 13546
diff changeset
  4253
    "Modified: / 07-08-2011 / 16:55:21 / cg"
13536
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4254
!
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4255
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4256
startSchedulerAndBackgroundCollector
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4257
    Processor startTimeSlicing.
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4258
    Processor supportDynamicPriorities:true.
13537
647c75f02ce7 changed:
Claus Gittinger <cg@exept.de>
parents: 13536
diff changeset
  4259
647c75f02ce7 changed:
Claus Gittinger <cg@exept.de>
parents: 13536
diff changeset
  4260
    ObjectMemory startBackgroundCollectorAt:5.
647c75f02ce7 changed:
Claus Gittinger <cg@exept.de>
parents: 13536
diff changeset
  4261
    ObjectMemory startBackgroundFinalizationAt:5.
13536
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4262
    ObjectMemory backgroundCollectProcess priorityRange:(4 to:9).
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4263
    ObjectMemory backgroundFinalizationProcess priorityRange:(4 to:9).
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4264
839fe9c57304 added: #startSchedulerAndBackgroundCollector
Claus Gittinger <cg@exept.de>
parents: 13532
diff changeset
  4265
    "Created: / 31-07-2011 / 20:01:33 / cg"
11808
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4266
!
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4267
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4268
startStartBlockProcess
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4269
    "at the end of the smalltalk initialization, start all actions that
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4270
     were delayed until the ProcessorScheduler is running in a separate process"
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4271
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4272
    |p|
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4273
14b417cf2b51 Define #startStartBlockProcess
Stefan Vogel <sv@exept.de>
parents: 11690
diff changeset
  4274
    p :=
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4275
	[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4276
	    self executeStartBlocks.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4277
	] newProcess.
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  4278
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  4279
    p
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4280
	priority:(Processor userSchedulingPriority);
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4281
	name:'start block handler';
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4282
	beGroupLeader;
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4283
	resume.
13892
3a39b1ef1d6f changed:
Claus Gittinger <cg@exept.de>
parents: 13883
diff changeset
  4284
13893
580686880e8f added: #executeStartBlocks
Claus Gittinger <cg@exept.de>
parents: 13892
diff changeset
  4285
    "Modified: / 07-01-2012 / 12:59:01 / cg"
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  4286
! !
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  4287
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  4288
13947
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4289
!Smalltalk class methodsFor:'startup and exit'!
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4290
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4291
addExitBlock:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4292
    "{ Pragma: +optSpace }"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4293
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4294
    "add a block to be executed when Smalltalk finishes.
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4295
     This feature is currently not used anywhere - but could be useful for
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4296
     cleanup in stand alone applications.
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4297
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4298
     Better use: ObjectMemory>>#addDependent: and handle the change message
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4299
     #aboutToQuit."
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4300
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4301
    ExitBlocks isNil ifTrue:[
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4302
	ExitBlocks := OrderedCollection with:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4303
    ] ifFalse:[
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4304
	ExitBlocks add:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4305
    ]
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4306
!
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4307
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4308
addImageStartBlock:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4309
    "{ Pragma: +optSpace }"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4310
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4311
    "add a blocks to be executed in a separate process after
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4312
     everything has been initialized.
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4313
     These blocks will be executed after an image restart."
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4314
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4315
    ImageStartBlocks isNil ifTrue:[
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4316
	ImageStartBlocks := OrderedCollection with:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4317
    ] ifFalse:[
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4318
	ImageStartBlocks add:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4319
    ]
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4320
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4321
    "Created: 9.9.1996 / 16:48:20 / stefan"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4322
!
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4323
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4324
addStartBlock:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4325
    "add a block to be executed in a separate process after
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4326
     everything has been initialized. These blocks will
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4327
     be executed only once and not be executed after an image restart.
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4328
     Initial processes such as the launcher are usually started here
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4329
     (see smalltalk.rc / private.rc)."
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4330
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4331
    "{ Pragma: +optSpace }"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4332
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4333
    StartBlocks isNil ifTrue:[
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4334
	StartBlocks := OrderedCollection with:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4335
    ] ifFalse:[
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4336
	StartBlocks add:aBlock
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4337
    ]
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4338
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4339
    "Created: / 09-09-1996 / 16:46:53 / stefan"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4340
    "Modified (comment): / 18-08-2011 / 09:18:42 / cg"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4341
!
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4342
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4343
exit
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4344
    "{ Pragma: +optSpace }"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4345
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4346
    "finish the Smalltalk system"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4347
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4348
    self exit:0
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4349
    "not reached"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4350
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4351
    "Be careful evaluating this
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4352
     Smalltalk exit
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4353
    "
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4354
!
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4355
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4356
exit:statusInteger
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4357
    "{ Pragma: +optSpace }"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4358
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4359
    "finish the Smalltalk system"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4360
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4361
    ObjectMemory changed:#aboutToExit.  "/ for ST/X backward compatibility
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4362
    ObjectMemory changed:#aboutToQuit.  "/ for ST-80 compatibility
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4363
    ExitBlocks notNil ifTrue:[
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4364
	ExitBlocks do:[:aBlock |
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4365
	    aBlock value
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4366
	]
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4367
    ].
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4368
    OperatingSystem exit:statusInteger
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4369
    "not reached"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4370
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4371
    "Be careful evaluating this
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4372
     Smalltalk exit:1
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4373
    "
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4374
! !
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4375
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  4376
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  4377
!Smalltalk class methodsFor:'startup queries'!
1097
14711c00f386 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1095
diff changeset
  4378
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4379
commandLine
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4380
    "return the full command line arguments (with which ST/X was started)"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4381
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4382
    ^ CommandLine
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4383
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4384
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4385
     Smalltalk commandLine
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4386
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4387
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4388
    "Created: 19.7.1996 / 11:09:06 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4389
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4390
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4391
commandLineArgumentNamed:aString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4392
    "extract a named argument from the command line arguments."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4393
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4394
    |args index|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4395
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4396
    args := self commandLineArguments.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4397
    index := args indexOf:aString.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4398
    (index between:1 and:(args size - 1)) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4399
	^ args at:index+1
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4400
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4401
    ^ nil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4402
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4403
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4404
     self commandLineArgumentNamed:'-display'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4405
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4406
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4407
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4408
commandLineArguments
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4409
    "return the user command line arguments;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4410
     This is a collection of strings (separated command line words),
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4411
     from which the internal startup arguments have already been removed.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4412
     I.e. if started with: 'smalltalk -I -f xxx foo bar baz',
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4413
     the commandLineArguments will be #('foo' 'bar' 'baz').
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4414
     In contrast, the value returned by #commandLine will be the full set of words."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4415
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4416
    ^ CommandLineArguments
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4417
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4418
    "Modified: 19.7.1996 / 11:11:03 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4419
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4420
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4421
commandName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4422
    "return the excutables name - this is normally 'stx',
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4423
     but can be something else for standAlone apps."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4424
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4425
    ^ CommandName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4426
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4427
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4428
     Smalltalk commandName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4429
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4430
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4431
    "Modified: 19.7.1996 / 11:11:16 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4432
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4433
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4434
hasNoConsole
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4435
    "return true, if this is a console-less application (i.e. I am winstx)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4436
     i.e. there should be no writing to stdout/stderr"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4437
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4438
    ^ HasNoConsole ? false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4439
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4440
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  4441
     Smalltalk hasNoConsole
9054
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  4442
    "
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  4443
!
d9de09e49007 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9047
diff changeset
  4444
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4445
isHeadless
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4446
    "return true, if this is a headless application
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4447
     i.e. no default Display connection is required/used"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4448
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4449
    ^ HeadlessOperation ? false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4450
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4451
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  4452
     Smalltalk isHeadless
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  4453
    "
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  4454
!
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  4455
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4456
isPlugin
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4457
    "return true, if this is a plugin application
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4458
     i.e. running in a browserWindow"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4459
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4460
    ^ IsPlugin ? false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4461
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4462
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  4463
     Smalltalk isPlugin
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  4464
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4465
!
4957
d2470714f2da headless stuff
Stefan Vogel <sv@exept.de>
parents: 4956
diff changeset
  4466
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4467
isSTScript
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4468
    "return true, if this is stscript. i.e. the stx scripting engine."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4469
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4470
    ^ IsSTScript ? false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4471
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4472
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4473
     Smalltalk isSTScript
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4474
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4475
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4476
    "Created: / 06-12-2006 / 16:41:21 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4477
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4478
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4479
isSharedLibraryComponent
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4480
    "return true, if this is a shared library component of another application
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4481
     i.e. a dll within another app."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4482
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4483
    ^ IsSharedLibraryComponent ? false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4484
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4485
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4486
     Smalltalk isSharedLibraryComponent
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4487
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4488
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4489
    "Created: / 10-08-2006 / 13:09:34 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4490
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4491
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4492
isSmalltalkDevelopmentSystem
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4493
    "return true, if this is a real smalltalk system
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4494
     i.e. NOT a stripped or a linked application (such as the webServer)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4495
     and NOT a plugIn (i.e. running in a browser)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4496
     and NOT a sharedLibrary component (i.e. a dll in another app).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4497
     This is used to determine, wether debugging is possible or not."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4498
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4499
    self isPlugin ifTrue:[^ false].                     "/ I am a browser-plugin
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4500
    self isSharedLibraryComponent ifTrue:[^ false].     "/ I am a COM-ponent
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4501
    self isSTScript ifTrue:[^ true ].                   "/ I am stScript
10999
e5cfd06920ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10998
diff changeset
  4502
    ^ self isStandAloneApp not.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4503
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4504
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4505
     Smalltalk isSmalltalkDevelopmentSystem
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4506
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4507
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4508
    "Created: / 10-08-2006 / 13:12:49 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4509
    "Modified: / 06-12-2006 / 16:42:56 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4510
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4511
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4512
isStandAloneApp
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4513
    "return true, if this is a standAlone application
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4514
     i.e. a stripped & linked application (such as the webServer)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4515
     in contrast to a full smalltalk (development) system."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4516
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4517
    ^ StandAlone ? false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4518
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4519
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  4520
     Smalltalk isStandAloneApp
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  4521
    "
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4522
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  4523
13947
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4524
isStandAloneDebug
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4525
    "return true, if this is a standAlone application which
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4526
     was started with the -debug option."
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4527
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4528
    ^ DebuggingStandAlone ? false
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4529
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4530
    "
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4531
     Smalltalk isStandAloneDebug
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4532
    "
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4533
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4534
    "Created: / 19-01-2012 / 10:17:41 / cg"
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4535
!
efccef803a92 added: #isStandAloneDebug
Claus Gittinger <cg@exept.de>
parents: 13893
diff changeset
  4536
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4537
startupArguments
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4538
    "return the arguments passed to StartupClass when stx gets started.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4539
     Usually these are nil,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4540
     but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4541
     a simple way to configure and create stand-alone applications"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4542
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4543
    ^ StartupArguments
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4544
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4545
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  4546
     Smalltalk startupArguments
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  4547
    "
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4548
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4549
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4550
startupClass
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4551
    "return the class, that will get the start message when smalltalk
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4552
     starts and its non-nil. Usually this is nil,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4553
     but saving an image with a non-nil StartupClass/StartupSelector/StartupArgs allows for
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4554
     a simple way to configure and create stand-alone applications"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4555
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4556
    ^ StartupClass
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4557
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4558
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  4559
     Smalltalk startupClass
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  4560
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4561
!
8570
0a7f80cc592f version bump
ca
parents: 8567
diff changeset
  4562
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4563
startupClass:aClass selector:aSymbol arguments:anArrayOrNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4564
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4565
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4566
    "set the class, selector and arguments to be performed when smalltalk
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4567
     starts. Setting those before saving a snapshot, will make the saved
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4568
     image come up executing your application (instead of the normal mainloop)"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4569
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4570
    StartupClass := aClass.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4571
    StartupSelector := aSymbol.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4572
    StartupArguments := anArrayOrNil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4573
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4574
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4575
startupSelector
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4576
    "return the selector, that will be sent to StartupClass.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4577
     Usually this is nil,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4578
     but saving an image with a non-nil StartupClass/StartupSelector allows for
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4579
     a simple way to configure and create stand-alone applications"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4580
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4581
    ^ StartupSelector
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4582
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4583
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  4584
     Smalltalk startupSelector
9029
09b858d6135d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 9028
diff changeset
  4585
    "
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4586
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4587
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4588
wasStartedFromImage
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4589
    "return true, if this smalltalk was started from an image,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4590
     as opposed to a fresh and clean startup"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4591
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4592
    ^ ImageRestartTime notNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4593
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4594
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4595
     Smalltalk wasStartedFromImage
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4596
    "
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4597
! !
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4598
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  4599
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  4600
!Smalltalk class methodsFor:'system environment'!
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  4601
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4602
language
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4603
    "return the language setting"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4604
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4605
    ^ Language
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4606
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4607
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4608
     Smalltalk language
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4609
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4610
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4611
    "Modified: 26.4.1996 / 17:10:05 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4612
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4613
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4614
language:aLanguageSymbol
10991
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4615
    "set the language - send out change notifications"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4616
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4617
    Language := aLanguageSymbol asSymbol.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4618
    self changed:#Language
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4619
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4620
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4621
     Smalltalk language:#de
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4622
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4623
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4624
    "Modified: / 19-10-2006 / 23:17:29 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4625
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4626
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4627
language:aLanguageSymbol territory:aTerritorySymbol
10991
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4628
    "set the language & territory - send out change notifications"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4629
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4630
    Language := aLanguageSymbol asSymbol.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4631
    LanguageTerritory := aTerritorySymbol asSymbol.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4632
    self changed:#Language
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4633
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4634
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4635
     Smalltalk language:#de territory:#de
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4636
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4637
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4638
    "Created: / 19-10-2006 / 22:16:22 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4639
    "Modified: / 19-10-2006 / 23:17:36 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4640
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4641
13212
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4642
languageAndTerritory
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4643
    "return the language and territory in the format lang-terr (i.e. de-de, en-us)"
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4644
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4645
    ^ Language , '-' , (LanguageTerritory ? Language)
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4646
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4647
    "
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4648
     Smalltalk languageAndTerritory
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4649
    "
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4650
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4651
    "Created: / 16-01-2011 / 10:19:42 / cg"
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4652
!
e75edfda9b2e added: #languageAndTerritory
Claus Gittinger <cg@exept.de>
parents: 13135
diff changeset
  4653
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4654
languageTerritory
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4655
    "return the language territory setting"
7563
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4656
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4657
    ^ LanguageTerritory
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4658
!
Claus Gittinger <cg@exept.de>
parents: 7561
diff changeset
  4659
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4660
languageTerritory:aTerritorySymbol
10991
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4661
    "set the language territory - send out change notifications"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4662
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4663
    LanguageTerritory := aTerritorySymbol asSymbol.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4664
    self changed:#LanguageTerritory
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4665
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4666
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4667
     Time now
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4668
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4669
     Smalltalk languageTerritory:#us.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4670
     Time now
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4671
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4672
     Smalltalk languageTerritory:#de.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4673
     Time now
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4674
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4675
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4676
    "Modified: / 19-10-2006 / 23:17:40 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4677
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4678
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4679
setLanguage:aLanguageSymbol
10991
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4680
    "set the language without change notification"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4681
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4682
    Language := aLanguageSymbol.
10991
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4683
!
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4684
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4685
setLanguage:aLanguageSymbol territory:aTerritorySymbol
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4686
    "set the language & territory - no change notification"
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4687
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4688
    Language := aLanguageSymbol asSymbol.
98fe8942f27e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10971
diff changeset
  4689
    LanguageTerritory := aTerritorySymbol asSymbol.
1069
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  4690
! !
72db6bd8ce0a category changes
Claus Gittinger <cg@exept.de>
parents: 1004
diff changeset
  4691
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  4692
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  4693
!Smalltalk class methodsFor:'system management'!
70
73055652dd21 *** empty log message ***
claus
parents: 62
diff changeset
  4694
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4695
compressSources
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4696
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4697
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4698
    "compress the sources file, and remove all method source strings
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4699
     from the system and replace them by refs to a string in the source file.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4700
     This is a bit different in ST/X than in other smalltalks,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4701
     since we use per-class sourcefiles for the compiled classes,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4702
     and a mix of in-memory strings and one-for-all sourceFile for
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4703
     incremental compiled methods.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4704
     Therefore, only those sources which are not coming from compiled
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4705
     methods are put into the 'st.src' file - all others are untouched.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4706
     This is being automated - so dont care for now."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4707
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4708
    |newStream table source pos fileName|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4709
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4710
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4711
     first, find all methods which contain either a string-ref
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4712
     or an external string in the 'st.src' file
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4713
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4714
    newStream := 'src.tmp' asFilename writeStream.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4715
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4716
    table := IdentityDictionary new:100.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4717
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4718
    Method allSubInstancesDo:[:aMethod |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4719
	source := nil.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4720
	aMethod sourcePosition notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4721
	    aMethod sourceFilename = 'st.src' ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4722
		source := aMethod source.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4723
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4724
	] ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4725
	    source := aMethod source
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4726
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4727
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4728
	source notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4729
	    pos := newStream position1Based.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4730
	    newStream nextChunkPut:source.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4731
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4732
	    "
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4733
	     dont change the methods info - maybe some write error
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4734
	     occurs later, in that case we abort and leave everything
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4735
	     untouched.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4736
	    "
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4737
	    table at:aMethod put:pos
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4738
	]
11655
4306fb61b9f8 sync common source file before replacing the old copy
Stefan Vogel <sv@exept.de>
parents: 11624
diff changeset
  4739
    ].
4306fb61b9f8 sync common source file before replacing the old copy
Stefan Vogel <sv@exept.de>
parents: 11624
diff changeset
  4740
4306fb61b9f8 sync common source file before replacing the old copy
Stefan Vogel <sv@exept.de>
parents: 11624
diff changeset
  4741
    newStream syncData; close.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4742
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4743
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4744
     now, rename the new source file,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4745
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4746
    fileName := (ObjectMemory nameForSources).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4747
    'src.tmp' asFilename renameTo:fileName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4748
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4749
    "good - now go over all changed methods, and change their
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4750
     source reference"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4751
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4752
    table keysAndValuesDo:[:aMethod :pos |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4753
	aMethod localSourceFilename:fileName position:pos.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4754
"/        aMethod printCR.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4755
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4756
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4757
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4758
     Smalltalk compressSources
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4759
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4760
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4761
    "Modified: 16.1.1997 / 01:25:58 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4762
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4763
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4764
generateSingleSourceFile
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4765
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4766
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4767
    "generate the sources file, and remove all method source strings
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4768
     from the system and replace them by refs to a string in the source file.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4769
     This makes the image independent from the per-class source files
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4770
     and makes transportation of endUser applications easier, since
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4771
     only 3 files (executable, image and sourceFile) need to be
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4772
     transported."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4773
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4774
    |newStream table source pos fileName|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4775
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4776
    newStream := 'src.tmp' asFilename writeStream.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4777
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4778
    table := IdentityDictionary new:100.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4779
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4780
    Method allSubInstancesDo:[:aMethod |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4781
	source := aMethod source.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4782
	source notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4783
	    pos := newStream position1Based.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4784
	    newStream nextChunkPut:source.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4785
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4786
	    "
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4787
	     dont change the methods info - maybe some write error
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4788
	     occurs later, in that case we abort and leave everything
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4789
	     untouched.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4790
	    "
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4791
	    table at:aMethod put:pos
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4792
	]
11655
4306fb61b9f8 sync common source file before replacing the old copy
Stefan Vogel <sv@exept.de>
parents: 11624
diff changeset
  4793
    ].
4306fb61b9f8 sync common source file before replacing the old copy
Stefan Vogel <sv@exept.de>
parents: 11624
diff changeset
  4794
4306fb61b9f8 sync common source file before replacing the old copy
Stefan Vogel <sv@exept.de>
parents: 11624
diff changeset
  4795
    newStream syncData; close.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4796
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4797
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4798
     now, rename the new source file,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4799
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4800
    fileName := (ObjectMemory nameForSources).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4801
    'src.tmp' asFilename renameTo:fileName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4802
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4803
    "good - now go over all changed methods, and change their
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4804
     source reference"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4805
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4806
    table keysAndValuesDo:[:aMethod :pos |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4807
	aMethod localSourceFilename:fileName position:pos.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4808
"/        aMethod printCR.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4809
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4810
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4811
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4812
     Smalltalk generateSingleSourceFile
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4813
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4814
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4815
    "Modified: 16.1.1997 / 01:25:58 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4816
    "Created: 17.10.1997 / 13:00:56 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4817
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4818
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4819
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4820
    "create & install an autoload stub for a class named: clsName,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4821
     to be loaded from package.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4822
     If revisionOrNil is non-nil, set it up to load exactly that revision
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4823
     (otherwise, the newest revision will be loaded"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4824
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4825
    ^ self
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4826
	installAutoloadedClassNamed:clsName
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4827
	category:cat
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4828
	package:package
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4829
	revision:revisionOrNil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4830
	numClassInstVars:nil.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4831
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  4832
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4833
installAutoloadedClassNamed:clsName category:cat package:package revision:revisionOrNil numClassInstVars:numClassInstVarsOrNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4834
    "create & install an autoload stub for a class named: clsName,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4835
     to be loaded from package.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4836
     If revisionOrNil is non-nil, set it up to load exactly that revision
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4837
     (otherwise, the newest revision will be loaded"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4838
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4839
    |clsSym cls|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4840
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4841
    clsSym := clsName asSymbol.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4842
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4843
    "/ install if not already compiled-in
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4844
    (cls := self at:clsSym) isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4845
	Autoload subclass:clsSym
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4846
	    instanceVariableNames:''
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4847
	    classVariableNames:''
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4848
	    poolDictionaries:''
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4849
	    category:cat
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4850
	    inEnvironment:Smalltalk.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4851
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4852
	cls := self at:clsSym.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4853
	cls isNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4854
	    ('Smalltalk [warning]: failed to install ' , clsName , ' as autoloaded.') infoPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4855
	] ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4856
	    cls package:package asSymbol.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4857
	    revisionOrNil notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4858
		cls setBinaryRevision:revisionOrNil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4859
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4860
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4861
    ] ifFalse:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4862
	"/ class already present - however, if unloaded, check for category/package change
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4863
	cls isLoaded ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4864
	    package ~= cls package ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4865
		cls withoutUpdatingChangesDo:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4866
		    cls package:package asSymbol.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4867
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4868
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4869
	    cat ~= cls category ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4870
		cls withoutUpdatingChangesDo:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4871
		    cls category:cat.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4872
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4873
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4874
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4875
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4876
    ^ cls.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4877
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4878
    "Created: / 05-11-1998 / 15:10:25 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4879
    "Modified: / 16-01-2007 / 12:56:18 / cg"
11169
32fda240ee57 #installAutoloadedClassNamed:category:package:revision:numClassInstVars:
Stefan Vogel <sv@exept.de>
parents: 11153
diff changeset
  4880
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4881
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4882
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4883
installAutoloadedClasses
11679
69e588cca61f Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents: 11670
diff changeset
  4884
    "scan all packages and install all classes found there as
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4885
     autoloaded. This takes some time ..."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4886
11679
69e588cca61f Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents: 11670
diff changeset
  4887
    |dirsConsulted|
69e588cca61f Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents: 11670
diff changeset
  4888
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4889
    dirsConsulted := Set new.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4890
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4891
    "/ along the package-path
11679
69e588cca61f Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents: 11670
diff changeset
  4892
    self packagePath do:[:eachPathComponent |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4893
	(dirsConsulted includes:eachPathComponent) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4894
	    self
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4895
		recursiveInstallAutoloadedClassesFrom:eachPathComponent
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4896
		rememberIn:dirsConsulted
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4897
		maxLevels:15
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4898
		noAutoload:false
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4899
		packageTop:eachPathComponent
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4900
		showSplashInLevels:2.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4901
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4902
    ].
11388
292d92d3ed5e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11387
diff changeset
  4903
    self splashInfo:nil.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4904
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4905
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4906
     Smalltalk installAutoloadedClasses
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4907
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4908
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4909
    "Created: / 14.2.1997 / 17:32:57 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4910
    "Modified: / 13.12.1999 / 11:56:50 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4911
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4912
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4913
installAutoloadedClassesFrom:anAbbrevFilePath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4914
    "read the given abbreviation file; install all classes found there as
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4915
     autoloaded. This takes some time ..."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4916
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4917
    |f s|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4918
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4919
    f := self getSystemFileName:anAbbrevFilePath.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4920
    f isNil ifTrue:[f := self getPackageFileName:anAbbrevFilePath].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4921
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4922
    f notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4923
	f := f asFilename.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4924
	f isDirectory ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4925
	    f := f construct:'abbrev.stc'
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4926
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4927
	[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4928
	    s := f readStream.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4929
	    self installAutoloadedClassesFromStream:s.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4930
	    s close.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4931
	] on:FileStream openErrorSignal
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  4932
	do:[:ex| "do nothing"].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4933
    ]
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4934
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4935
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4936
     Smalltalk installAutoloadedClassesFrom:'include/abbrev.stc'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4937
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4938
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4939
    "Modified: / 5.11.1998 / 15:10:51 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4940
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4941
13531
6ab20c7e1dec added: #installAutoloadedClassesFromAbbrevFile:
Claus Gittinger <cg@exept.de>
parents: 13529
diff changeset
  4942
installAutoloadedClassesFromAbbrevFile:aFilename
6ab20c7e1dec added: #installAutoloadedClassesFromAbbrevFile:
Claus Gittinger <cg@exept.de>
parents: 13529
diff changeset
  4943
    aFilename readingFileDo:[:abbrevStream |
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  4944
	self installAutoloadedClassesFromStream:abbrevStream.
13531
6ab20c7e1dec added: #installAutoloadedClassesFromAbbrevFile:
Claus Gittinger <cg@exept.de>
parents: 13529
diff changeset
  4945
    ]
6ab20c7e1dec added: #installAutoloadedClassesFromAbbrevFile:
Claus Gittinger <cg@exept.de>
parents: 13529
diff changeset
  4946
6ab20c7e1dec added: #installAutoloadedClassesFromAbbrevFile:
Claus Gittinger <cg@exept.de>
parents: 13529
diff changeset
  4947
    "Created: / 29-07-2011 / 20:39:21 / cg"
6ab20c7e1dec added: #installAutoloadedClassesFromAbbrevFile:
Claus Gittinger <cg@exept.de>
parents: 13529
diff changeset
  4948
!
6ab20c7e1dec added: #installAutoloadedClassesFromAbbrevFile:
Claus Gittinger <cg@exept.de>
parents: 13529
diff changeset
  4949
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4950
installAutoloadedClassesFromStream:anAbbrevFileStream
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4951
    "read the given abbreviation file;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4952
     install all classes found there as autoloaded, and also update the
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4953
     abbreviation (className-to-fileName mapping) table.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4954
     This takes some time ..."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4955
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4956
    |s2 l abbrevFileName info clsName cls abbrev package cat numClassInstVars words w|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4957
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4958
    anAbbrevFileStream isFileStream ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4959
	abbrevFileName := anAbbrevFileStream pathName.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4960
	info := 'declared from: ', abbrevFileName.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4961
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4962
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4963
    KnownPackages isNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4964
	KnownPackages := Set new.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4965
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4966
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4967
    "/ yes, create any required nameSpace, without asking user.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4968
    Class createNameSpaceQuerySignal answer:true do:[
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4969
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4970
	[anAbbrevFileStream atEnd] whileFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4971
	    l := anAbbrevFileStream nextLine withoutSeparators.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4972
	    "Skip empty lines and comments"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4973
	    (l notEmpty and:[l first ~= $#]) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4974
		"/ must do it manually, caring for quoted strings.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4975
"/                words := line asCollectionOfWords.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  4976
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4977
		words := OrderedCollection new.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4978
		s2 := l readStream.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4979
		[s2 atEnd] whileFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4980
		    s2 skipSeparators.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4981
		    s2 peek == $' ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4982
			s2 next.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4983
			w := s2 upTo:$'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4984
			s2 skipSeparators.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4985
		    ] ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4986
			w := s2 upToSeparator
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4987
		    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4988
		    words add:w
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4989
		].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4990
		words size < 3 ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4991
		    'Smalltalk [warning]: bad abbrev entry' errorPrint.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4992
		    anAbbrevFileStream isFileStream ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4993
			' (in ''' errorPrint.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4994
			anAbbrevFileStream pathName errorPrint.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4995
			''')' errorPrint
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4996
		    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4997
		    ': ' errorPrint. l errorPrintCR
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4998
		] ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  4999
		    clsName := (words at:1) asSymbol.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5000
		    abbrev := (words at:2).
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5001
		    package := (words at:3) asSymbol.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5002
		    cat := words at:4 ifAbsent:nil.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5003
		    numClassInstVars := words at:5 ifAbsent:'0'.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5004
		    numClassInstVars := Integer readFrom:numClassInstVars onError:[0].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5005
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5006
"/                KnownPackages add:package.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5007
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5008
		    (cat size == 0) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5009
			cat := 'autoloaded'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5010
		    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5011
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5012
		    "/ on the fly, update the abbreviations
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5013
		    self setFilename:abbrev forClass:clsName package:package.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5014
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5015
		    "/ '  autoloaded: ' print. clsName print. ' in ' print. cat printCR.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5016
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5017
		    cls := self
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5018
			installAutoloadedClassNamed:clsName
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5019
			category:cat
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5020
			package:package
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5021
			revision:nil
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5022
			numClassInstVars:numClassInstVars.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5023
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5024
"/                    info notNil ifTrue:[
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5025
"/                        cls setComment:info.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5026
"/                    ].
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5027
		]
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5028
	    ]
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5029
	]
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  5030
    ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5031
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5032
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5033
loadBinaries
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5034
    "return true, if binaries should be loaded into the system,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5035
     false if this should be suppressed. The default is false (for now)."
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5036
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5037
    ^ LoadBinaries
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5038
!
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  5039
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5040
loadBinaries:aBoolean
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5041
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5042
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5043
    "turn on/off loading of binary objects"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5044
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5045
    aBoolean ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5046
	(ObjectFileLoader notNil and:[ObjectFileLoader canLoadObjectFiles]) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5047
	    LoadBinaries := true.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5048
	    ^ self
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5049
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5050
	'Smalltalk [info]: this system does not support binary loading' infoPrintCR.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5051
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5052
    LoadBinaries := false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5053
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5054
    "Modified: 10.1.1997 / 15:11:00 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5055
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5056
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5057
logDoits
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5058
    "return true if doits should go into the changes file
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5059
     as well as changes - by default, this is off, since
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5060
     it can blow up the changes file enormously ...
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5061
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5062
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5063
    ^ LogDoits
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5064
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5065
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5066
     LogDoits := false
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  5067
     LogDoits := true
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  5068
    "
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  5069
!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  5070
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5071
logDoits:aBoolean
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5072
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5073
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5074
    "turn on/off logging of doits in the changes file.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5075
     By default, this is off, since it can blow up the
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5076
     changes file enormously ...
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5077
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5078
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5079
    LogDoits := aBoolean
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5080
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5081
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5082
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5083
makeBytecodeMethods
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5084
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5085
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5086
    "walk over all methods and make each a bytecode method
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5087
     iff it does not contain primitive C code.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5088
     Experimental and not yet used."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5089
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5090
    Method allSubInstancesDo:[:aMethod |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5091
	|newMethod|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5092
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5093
	aMethod hasPrimitiveCode ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5094
	    newMethod := aMethod asByteCodeMethod.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5095
	    newMethod ~~ aMethod ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5096
		aMethod becomeSameAs:newMethod
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5097
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5098
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5099
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5100
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5101
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5102
     Smalltalk makeBytecodeMethods
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5103
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5104
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5105
    "Modified: 16.1.1997 / 01:25:58 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5106
    "Created: 17.10.1997 / 13:52:19 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5107
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5108
14269
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5109
recursiveInstallAutoloadedClassesFrom:aTopDirectory
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5110
    "scan all packages and install all classes found there as
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5111
     autoloaded. This takes some time ..."
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5112
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5113
    |dirsConsulted|
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5114
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5115
    dirsConsulted := Set new.
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5116
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5117
    self
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5118
	recursiveInstallAutoloadedClassesFrom:aTopDirectory
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5119
	rememberIn:dirsConsulted
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5120
	maxLevels:15
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5121
	noAutoload:false
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5122
	packageTop:nil
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5123
	showSplashInLevels:-1.
14269
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5124
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5125
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5126
    "
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5127
     Smalltalk recursiveInstallAutoloadedClassesFrom:'..\..\..\cg\private\euler'
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5128
    "
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5129
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5130
    "Created: / 31-07-2012 / 15:27:40 / cg"
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5131
!
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5132
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5133
recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5134
    "read all abbrev.stc files from and under aDirectory
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5135
     and install autoloaded classes.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5136
     If a file called NOAUTOLOAD is found, no classes there and below are installed as autoloaded
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5137
     (however, the directories are searched for packages)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5138
     If a file called NOPACKAGES is found, no further searching is done in that directory or below."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5139
11391
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5140
    self
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5141
	recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5142
	maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5143
	showSplashInLevels:0.
11391
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5144
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5145
    "
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5146
     Smalltalk installAutoloadedClasses
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5147
    "
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5148
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5149
    "Modified: / 17-08-2006 / 16:48:43 / cg"
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5150
!
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5151
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  5152
recursiveInstallAutoloadedClassesFrom:aDirectory rememberIn:dirsConsulted
11391
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5153
maxLevels:maxLevels noAutoload:noAutoloadIn packageTop:packageTopPath
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5154
showSplashInLevels:showSplashInLevels
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5155
    "read all abbrev.stc files from and under aDirectory
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5156
     and install autoloaded classes.
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5157
     If a file called NOAUTOLOAD is found, no classes there and below are installed as autoloaded
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5158
     (however, the directories are searched for packages)
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5159
     If a file called NOPACKAGES is found, no further searching is done in that directory or below."
529c3e286e9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11389
diff changeset
  5160
13531
6ab20c7e1dec added: #installAutoloadedClassesFromAbbrevFile:
Claus Gittinger <cg@exept.de>
parents: 13529
diff changeset
  5161
    |dir noAutoloadHere dirName pkgName directoryContents|
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5162
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5163
    maxLevels == 0 ifTrue:[
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5164
"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5165
	^ self
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5166
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5167
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5168
    dir := aDirectory asFilename.
11392
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5169
    dirName := dir pathName.
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5170
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5171
    (dirsConsulted includes:dirName) ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5172
	^ self
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5173
    ].
11392
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5174
    dirsConsulted add:dirName.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5175
12377
f9a9aea7ba0f changed:13 methods
Claus Gittinger <cg@exept.de>
parents: 12376
diff changeset
  5176
    (dir / 'NOPACKAGES') exists ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5177
	^ self.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5178
    ].
12377
f9a9aea7ba0f changed:13 methods
Claus Gittinger <cg@exept.de>
parents: 12376
diff changeset
  5179
    (dir / 'NOSUBAUTOLOAD') exists ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5180
	^ self.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5181
    ].
11392
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5182
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5183
    noAutoloadHere := noAutoloadIn.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5184
    noAutoloadHere ifFalse:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5185
	(dir / 'NOAUTOLOAD') exists ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5186
	    noAutoloadHere := true.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5187
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5188
    ] ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5189
	(dir / 'AUTOLOAD') exists ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5190
	    noAutoloadHere := false.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5191
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5192
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5193
12911
0822e257daeb comment/format in: #installAutoloadedClasses
Stefan Vogel <sv@exept.de>
parents: 12883
diff changeset
  5194
    ((dir / 'loadAll') exists or:[(dir / 'abbrev.stc') exists]) ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5195
	packageTopPath notNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5196
	    KnownPackages isNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5197
		KnownPackages := Set new.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5198
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5199
	    pkgName := dirName copyFrom:(packageTopPath asFilename pathName) size + 1 + 1.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5200
	    KnownPackages add:pkgName
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5201
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5202
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5203
11393
5964970e515c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11392
diff changeset
  5204
    showSplashInLevels >= 0 ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5205
	self showSplashMessage:('Smalltalk [info]: installing autoloaded classes found under "%1"...'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5206
				bindWith:(dirName contractAtBeginningTo:35)).
11392
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5207
    ].
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5208
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5209
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5210
    "/ suppress installation as autoloaded in this and everything
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5211
    "/ below; however, still traverse the directories to find packages ...
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5212
    "/
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5213
    noAutoloadHere ifFalse:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5214
	[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5215
	    self installAutoloadedClassesFromAbbrevFile:(dir / 'abbrev.stc').
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5216
	] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5217
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5218
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5219
    [
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5220
	directoryContents := dir directoryContents asSet.   "asSet to speed up remove"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5221
    ] on:FileStream openErrorSignal do:[:ex|
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5222
	"non-accessable directory: we are done"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5223
	^ self
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5224
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5225
12911
0822e257daeb comment/format in: #installAutoloadedClasses
Stefan Vogel <sv@exept.de>
parents: 12883
diff changeset
  5226
    directoryContents removeAllFoundIn:#(
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5227
			    'objbc'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5228
			    'objvc'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5229
			    'doc'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5230
			    'CVS'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5231
			    'bitmaps'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5232
			    'resources'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5233
			    'source'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5234
			    'not_delivered'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5235
			    'not_ported'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5236
			).
12911
0822e257daeb comment/format in: #installAutoloadedClasses
Stefan Vogel <sv@exept.de>
parents: 12883
diff changeset
  5237
    dir baseName = 'stx' ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5238
	directoryContents removeAllFoundIn:#(
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5239
			    'configurations'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5240
			    'include'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5241
			    'rules'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5242
			    'stc'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5243
			    'support'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5244
			).
12911
0822e257daeb comment/format in: #installAutoloadedClasses
Stefan Vogel <sv@exept.de>
parents: 12883
diff changeset
  5245
    ].
0822e257daeb comment/format in: #installAutoloadedClasses
Stefan Vogel <sv@exept.de>
parents: 12883
diff changeset
  5246
0822e257daeb comment/format in: #installAutoloadedClasses
Stefan Vogel <sv@exept.de>
parents: 12883
diff changeset
  5247
    directoryContents do:[:eachFilenameString |
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5248
	|f|
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5249
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5250
	f := dir / eachFilenameString.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5251
	f isDirectory ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5252
	     self
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5253
		recursiveInstallAutoloadedClassesFrom:f
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5254
		rememberIn:dirsConsulted
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5255
		maxLevels:maxLevels-1
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5256
		noAutoload:noAutoloadHere
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5257
		packageTop:packageTopPath
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5258
		showSplashInLevels:showSplashInLevels - 1.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5259
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5260
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5261
11393
5964970e515c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11392
diff changeset
  5262
    showSplashInLevels >= 0 ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5263
	self showSplashMessage:('Smalltalk [info]: installing autoloaded classes from "%1"...'
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5264
				bindWith:(dirName contractAtBeginningTo:35)).
11392
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5265
    ].
8c606db1cd2f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11391
diff changeset
  5266
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5267
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5268
     Smalltalk installAutoloadedClasses
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5269
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5270
14269
b540d11186f4 added: #recursiveInstallAutoloadedClassesFrom:
Claus Gittinger <cg@exept.de>
parents: 14210
diff changeset
  5271
    "Modified: / 31-07-2012 / 15:26:54 / cg"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5272
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5273
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5274
replaceReferencesTo:anObject with:newRef
12194
208afdcf182b comment/format in: #replaceReferencesTo:with:
Claus Gittinger <cg@exept.de>
parents: 12172
diff changeset
  5275
    "if the receiver refers to the argument, anObject, replace this reference with newRef.
208afdcf182b comment/format in: #replaceReferencesTo:with:
Claus Gittinger <cg@exept.de>
parents: 12172
diff changeset
  5276
     Return true, if any reference was changed.
208afdcf182b comment/format in: #replaceReferencesTo:with:
Claus Gittinger <cg@exept.de>
parents: 12172
diff changeset
  5277
     Notice: this does not change the class-reference."
208afdcf182b comment/format in: #replaceReferencesTo:with:
Claus Gittinger <cg@exept.de>
parents: 12172
diff changeset
  5278
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5279
    |toAdd|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5280
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5281
    toAdd := OrderedCollection new.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5282
    self keysAndValuesDo:[:key :val |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5283
	(key == anObject) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5284
	    self shouldImplement.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5285
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5286
	(val == anObject ) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5287
	    toAdd add:(key -> newRef)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5288
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5289
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5290
    toAdd do:[:each |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5291
	self at:(each key) put:(each value)
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5292
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5293
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5294
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5295
saveEmergencyImage:aBoolean
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5296
    "set/clear the flag which controls if ST/X should save an
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5297
     emergency image in case of a broken display connection.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5298
     The default is true.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5299
     This may be useful, if you work with an unsecure display
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5300
     (serial line), and want to have a chance of proceeding after
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5301
     a crash. In multiheaded applications, this only affects
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5302
     crashes of the master Display connection (the initial connection);
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5303
     errors on other displays are reported to the views and treated
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5304
     like window destroy from the windowManager."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5305
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5306
    SaveEmergencyImage := aBoolean
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5307
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5308
    "Modified: / 24.10.1997 / 18:22:26 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5309
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5310
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5311
systemOrganization
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5312
    "for partial ST80 compatibility;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5313
     In ST80, Smalltalk organization returns a systemOrganizer, which
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5314
     keeps track of class-categories, while all classes return a classOrganizer
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5315
     from #organization, which keeps track of method categories of that class.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5316
     Since in ST/X, Smalltalk is a class, there is now a conflict.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5317
     To make a workaround possible, use #systemOrganization when porting
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5318
     VW apps to ST/X to get the class-categories.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5319
     Read the documentation in SystemOrganizer for more info."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5320
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5321
    ^ SystemOrganizer for:nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5322
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5323
    "Created: / 20.6.1998 / 12:24:02 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5324
    "Modified: / 20.6.1998 / 12:41:34 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5325
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5326
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  5327
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5328
!Smalltalk class methodsFor:'system management-fileIn'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5329
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5330
fileIn:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5331
    "read in the named file - look for it in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5332
     return true if ok, false if failed.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5333
     This method can load almost anything which makes sense:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5334
	.st    - source files
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5335
	.cls   - binary smalltalk bytecode files
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5336
	.so    - binary compiled machine code class libraries
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5337
	[.class - java bytecode -- soon to come]"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5338
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5339
    ^ self fileIn:aFileName lazy:nil silent:nil logged:false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5340
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5341
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5342
     Smalltalk fileIn:'source/TicTacToe.st'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5343
     Smalltalk fileIn:'binary/TicTacToe.cls'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5344
     Smalltalk fileIn:'binary/TicTacToe.so'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5345
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5346
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5347
    "Created: 28.10.1995 / 17:06:28 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5348
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5349
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5350
fileIn:aFileName inPackage:aPackageID
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5351
    "read in the named file in a packages directory."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5352
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5353
    |dir|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5354
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5355
    dir := self getPackageDirectoryForPackage:aPackageID.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5356
    dir isNil ifTrue:[^ false].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5357
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5358
    dir := dir asFilename.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5359
    ^ (self fileIn:(dir construct:aFileName))
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5360
      or:[ self fileIn:((dir construct:'source') construct:aFileName) ]
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5361
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5362
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5363
fileIn:aFileName lazy:lazy
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5364
    "read in the named file - look for it in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5365
     return true if ok, false if failed.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5366
     If lazy is true, no code is generated for methods, instead stubs
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5367
     are created which compile themself when first executed. This allows
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5368
     for much faster fileIn (but slows down the first execution later).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5369
     Since no syntax checks are done when doing lazy fileIn, use this only for
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5370
     code which is known to be syntactically correct."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5371
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5372
    ^ self fileIn:aFileName lazy:lazy silent:nil logged:false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5373
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5374
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5375
     Smalltalk fileIn:'source/TicTacToe.st' lazy:true
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5376
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5377
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5378
    "Created: 28.10.1995 / 17:06:36 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5379
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5380
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5381
fileIn:aFileName lazy:lazy silent:silent
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5382
    "read in the named file - look for it in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5383
     return true if ok, false if failed.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5384
     If lazy is true, no code is generated for methods, instead stubs
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5385
     are created which compile themself when first executed. This allows
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5386
     for much faster fileIn (but slows down the first execution later).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5387
     Since no syntax checks are done when doing lazy fileIn, use this only for
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5388
     code which is known to be syntactically correct.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5389
     If silent is true, no compiler messages are output to the transcript.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5390
     Giving nil for silent/lazy will use the current settings."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5391
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5392
    ^ self fileIn:aFileName lazy:lazy silent:silent logged:false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5393
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5394
    "Created: 28.10.1995 / 17:06:41 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5395
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5396
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5397
fileIn:aFileNameOrString lazy:lazy silent:silent logged:logged
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5398
    "read in the named file - look for it in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5399
     return true if ok, false if failed.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5400
     If lazy is true, no code is generated for methods, instead stubs
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5401
     are created which compile themself when first executed. This allows
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5402
     for much faster fileIn (but slows down the first execution later).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5403
     Since no syntax checks are done when doing lazy fileIn, use this only for
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5404
     code which is known to be syntactically correct.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5405
     If silent is true, no compiler messages are output to the transcript.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5406
     Giving nil for silent/lazy will use the current settings.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5407
     This method can load almost anything which makes sense:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5408
	.st    - source files
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5409
	.cls   - binary smalltalk bytecode files
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5410
	.so    - binary compiled machine code class libraries
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5411
	[.class - java bytecode -- soon to come]"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5412
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5413
    |fileNameString aStream path morePath bos|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5414
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5415
    fileNameString := aFileNameOrString asString.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5416
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5417
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5418
     an object or shared object ?
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5419
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5420
    (ObjectFileLoader notNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5421
    and:[ObjectFileLoader hasValidBinaryExtension:fileNameString]) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5422
	"/ LoadBinaries ifFalse:[^ false].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5423
	path := self getBinaryFileName:fileNameString.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5424
	path isNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5425
	    path := self getSystemFileName:fileNameString.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5426
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5427
	path isNil ifTrue:[^ false].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5428
	^ (ObjectFileLoader loadObjectFile:path) notNil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5429
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5430
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5431
    (fileNameString asFilename hasSuffix:'cls') ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5432
	BinaryObjectStorage notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5433
	    aStream := self systemFileStreamFor:fileNameString.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5434
"/            path := self getBinaryFileName:fileNameString.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5435
"/            path isNil ifTrue:[^ false].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5436
"/            aStream := path asFilename readStream.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5437
	    aStream notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5438
		aStream binary.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5439
		bos := BinaryObjectStorage onOld:aStream.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5440
		bos next.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5441
		bos close.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5442
		^ true
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5443
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5444
	    ^ false
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5445
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5446
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5447
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5448
    aStream := self systemFileStreamFor:fileNameString.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5449
    aStream isNil ifTrue:[^ false].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5450
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5451
    (fileNameString includes:$/) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5452
	"/ temporarily prepend the files directory
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5453
	"/ to the searchPath.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5454
	"/ This allows fileIn-driver files to refer to local
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5455
	"/ files via a relative path, and drivers to fileIn other
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5456
	"/ drivers ...
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5457
	morePath := aStream pathName asFilename directoryName.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5458
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5459
    ^ self fileInStream:aStream lazy:lazy silent:silent logged:logged addPath:morePath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5460
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5461
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5462
     Smalltalk fileIn:'source/TicTacToe.st' lazy:true silent:true
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5463
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5464
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5465
    "Modified: / 08-09-2006 / 19:21:16 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5466
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5467
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5468
fileIn:aFileName logged:logged
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5469
    "read in the named file - look for it in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5470
     return true if ok, false if failed.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5471
     The argument logged controls, if the changefile is to be updated."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5472
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5473
    ^ self fileIn:aFileName lazy:nil silent:nil logged:logged
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5474
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5475
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5476
     Smalltalk fileIn:'source/TicTacToe.st' logged:false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5477
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5478
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5479
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5480
fileIn:aFileName silent:silent
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5481
    "read in the named file - look for it in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5482
     return true if ok, false if failed.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5483
     If silent is true, no compiler messages are output to the transcript."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5484
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5485
    ^ self fileIn:aFileName lazy:nil silent:silent logged:false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5486
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5487
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5488
     Smalltalk fileIn:'source/TicTacToe.st' silent:true
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5489
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5490
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5491
    "Created: 28.10.1995 / 17:06:36 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5492
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5493
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5494
fileInChanges
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5495
    "read in the last changes file - bringing the system to the state it
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5496
     had when left the last time.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5497
     WARNING: this method is rubbish: it should only read things after the
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5498
	      last '**snapshot**' - entry
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5499
	      (instead of the complete changes file)."
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5500
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5501
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5502
     do NOT update the changes file now ...
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5503
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5504
    self fileIn:ChangeFileName logged:false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5505
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5506
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  5507
     Smalltalk fileInChanges
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5508
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  5509
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  5510
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5511
fileInClass:aClassName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5512
    "find a source/object file for aClassName and -if found - load it.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5513
     search is in some standard places trying driver-file (.ld), object-file (.o) and
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5514
     finally source file (.st) in that order.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5515
     The file is first searched for using the class name, then the abbreviated name."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5516
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5517
    ^ self
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5518
	fileInClass:aClassName
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5519
	package:nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5520
	initialize:true
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5521
	lazy:false
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5522
	silent:nil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5523
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5524
    "Modified: / 9.1.1998 / 14:41:46 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5525
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5526
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5527
fileInClass:aClassName fromObject:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5528
    "read in the named object file and dynamic-link it into the system
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5529
     - look for it in some standard places.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5530
     Only install the named class from this object file.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5531
     Return true if ok, false if failed."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5532
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5533
    |path ok|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5534
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5535
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5536
     check if the dynamic loader class is in
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5537
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5538
    (LoadBinaries not or:[ObjectFileLoader isNil]) ifTrue:[^ false].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5539
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5540
    (path := self getBinaryFileName:aFileName) isNil ifTrue:[^ false].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5541
    ok := (ObjectFileLoader loadClass:aClassName fromObjectFile:path) notNil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5542
    ok ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5543
	VerboseLoading ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5544
	    Transcript show:'  loaded ' , aClassName , ' from ' ; showCR:aFileName.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5545
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5546
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5547
    ^ ok
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5548
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5549
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5550
     Smalltalk fileInClass:'AbstractPath' fromObject:'../../goodies/Paths/AbstrPath.so'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5551
     Smalltalk fileInClass:'ClockView' fromObject:'../../libwidg3/libwidg3.so'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5552
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5553
13814
3d547c0d4634 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 13787
diff changeset
  5554
    "Modified: / 04-11-2011 / 13:42:24 / cg"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5555
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5556
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5557
fileInClass:aClassName initialize:doInit
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5558
    "find a source/object file for aClassName and -if found - load it.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5559
     search is in some standard places trying driver-file (.ld), object-file (.o) and
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5560
     finally source file (.st) in that order.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5561
     The file is first searched for using the class name, then the abbreviated name."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5562
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5563
    ^ self
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5564
	fileInClass:aClassName
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5565
	package:nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5566
	initialize:doInit
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5567
	lazy:false
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5568
	silent:nil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5569
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5570
    "Modified: / 9.1.1998 / 14:42:02 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5571
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5572
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5573
fileInClass:aClassName initialize:doInit lazy:loadLazy
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5574
    "find a source/object file for aClassName and -if found - load it.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5575
     search is in some standard places trying driver-file (.ld), object-file (.o) and
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5576
     finally source file (.st) in that order.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5577
     The file is first searched for using the class name, then the abbreviated name."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5578
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5579
     ^ self
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5580
	fileInClass:aClassName
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5581
	package:nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5582
	initialize:doInit
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5583
	lazy:loadLazy
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5584
	silent:nil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5585
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5586
    "Modified: / 9.1.1998 / 14:42:19 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5587
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5588
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5589
fileInClass:aClassName initialize:doInit lazy:loadLazy silent:beSilent
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5590
    "find a source/object file for aClassName and -if found - load it.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5591
     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5592
     finally source file (.st), in that order.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5593
     The file is first searched for using the class name, then the abbreviated name.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5594
     The argument doInit controlls if the class should be sent a #initialize after the
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5595
     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5596
     should not send notes to the transcript; it can be true, false or nil, where
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5597
     nil uses the value from SilentLoading."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5598
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5599
    ^ self
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5600
	fileInClass:aClassName
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5601
	package:nil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5602
	initialize:doInit
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5603
	lazy:loadLazy
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5604
	silent:beSilent
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5605
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5606
    "Modified: / 9.1.1998 / 14:42:28 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5607
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5608
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5609
fileInClass:aClassName package:package
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5610
    "find a source/object file for aClassName and -if found - load it.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5611
     search is in some standard places trying driver-file (.ld), object-file (.o) and
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5612
     finally source file (.st) in that order.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5613
     The file is first searched for using the class name, then the abbreviated name."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5614
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5615
    ^ self
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5616
	fileInClass:aClassName
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5617
	package:package
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5618
	initialize:true
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5619
	lazy:false
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5620
	silent:nil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5621
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5622
    "Created: / 08-01-2007 / 10:06:09 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5623
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5624
10999
e5cfd06920ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10998
diff changeset
  5625
fileInClass:aClassName package:package initialize:doInit lazy:loadLazy silent:beSilent
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5626
    "find a source/object file for aClassName and -if found - load it.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5627
     This is the workhorse for autoloading.
10999
e5cfd06920ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10998
diff changeset
  5628
     Search is in some standard places, trying driver-file (.ld), object-file (.so / .o) and
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5629
     finally source file (.st), in that order.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5630
     The file is first searched for using the class name, then the abbreviated name.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5631
     The argument doInit controlls if the class should be sent a #initialize after the
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5632
     load; loadLazy tells if it should be loaded lazyly. beSilent tells if the compiler
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5633
     should not send notes to the transcript; it can be true, false or nil, where
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5634
     nil uses the value from SilentLoading."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5635
10999
e5cfd06920ca *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10998
diff changeset
  5636
    |classFileName alternativeClassFileName libName newClass ok wasLazy wasSilent sharedLibExtension inStream mgr
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5637
     filenameToSet packageDir packageFile bos|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5638
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5639
    wasLazy := Compiler compileLazy:loadLazy.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5640
    beSilent notNil ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5641
        wasSilent := self silentLoading:beSilent.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5642
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5643
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5644
    classFileName := Smalltalk fileNameForClass:aClassName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5645
    (classFileName = aClassName) ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5646
        "/ no abbrev.stc translation for className
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5647
        (aClassName includes:$:) ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5648
            "/ a nameSpace name
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5649
            alternativeClassFileName := classFileName copyFrom:(classFileName lastIndexOf:$:)+1
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5650
        ].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5651
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5652
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5653
    classFileName asFilename isAbsolute ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5654
        classFileName asFilename suffix notEmptyOrNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5655
            ok := self fileIn:classFileName lazy:loadLazy silent:beSilent.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5656
        ] ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5657
            ok := self fileInSourceFile:classFileName lazy:loadLazy silent:beSilent.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5658
        ]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5659
    ] ifFalse:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5660
        classFileName := classFileName copyReplaceAll:$: with:$_.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5661
        [
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5662
            Class withoutUpdatingChangesDo:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5663
                |zarFn zar entry|
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5664
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5665
                ok := false.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5666
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5667
                package notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5668
                    packageDir := package asPackageId projectDirectory.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5669
                    "/ packageDir := package asString.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5670
                    "/ packageDir := packageDir copyReplaceAll:$: with:$/.
14620
74b59031d46e class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14611
diff changeset
  5671
                    packageDir isNil ifTrue:[
74b59031d46e class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14611
diff changeset
  5672
                        packageDir := self packageDirectoryForPackageId:package
74b59031d46e class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14611
diff changeset
  5673
                    ].
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5674
                ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5675
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5676
                Class packageQuerySignal answer:package do:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5677
                    "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5678
                     then, if dynamic linking is available,
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5679
                    "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5680
                    (LoadBinaries and:[ObjectFileLoader notNil]) ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5681
                        sharedLibExtension := ObjectFileLoader sharedLibraryExtension.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5682
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5683
                         first look for a class packages shared binary in binary/xxx.o
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5684
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5685
                        libName := self libraryFileNameOfClass:aClassName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5686
                        libName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5687
                            (ok := self fileInClass:aClassName fromObject:(libName, sharedLibExtension))
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5688
                            ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5689
                                sharedLibExtension ~= '.o' ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5690
                                    ok := self fileInClass:aClassName fromObject:(libName, '.o')
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5691
                                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5692
                            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5693
                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5694
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5695
                         then, look for a shared binary in binary/xxx.o
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5696
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5697
                        ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5698
                            (ok := self fileInClass:aClassName fromObject:(classFileName, sharedLibExtension))
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5699
                            ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5700
                                sharedLibExtension ~= '.o' ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5701
                                    ok := self fileInClass:aClassName fromObject:(classFileName, '.o')
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5702
                                ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5703
                                ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5704
                                    alternativeClassFileName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5705
                                        (ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, sharedLibExtension))
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5706
                                        ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5707
                                            sharedLibExtension ~= '.o' ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5708
                                                ok := self fileInClass:aClassName fromObject:(alternativeClassFileName, '.o')
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5709
                                            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5710
                                        ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5711
                                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5712
                                ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5713
                            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5714
                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5715
                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5716
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5717
                    "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5718
                     if that did not work, look for a compiled-bytecode file ...
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5719
                    "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5720
                    ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5721
                        (ok := self fileIn:(classFileName , '.cls') lazy:loadLazy silent:beSilent)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5722
                        ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5723
                            alternativeClassFileName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5724
                                ok := self fileIn:(alternativeClassFileName , '.cls') lazy:loadLazy silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5725
                            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5726
                        ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5727
                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5728
                    "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5729
                     if that did not work, and the classes package is known,
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5730
                     look for an st-cls file
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5731
                     in a package subdir of the source-directory ...
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5732
                    "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5733
                    ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5734
                        (packageDir notNil and:[BinaryObjectStorage notNil]) ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5735
                            packageFile := self getPackageFileName:(packageDir , '/classes/' , classFileName , '.cls').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5736
                            packageFile isNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5737
                                packageFile := (packageDir , '/classes/' , classFileName , '.cls').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5738
                            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5739
                            (ok := self fileIn:packageFile lazy:loadLazy silent:beSilent)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5740
                            ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5741
                                alternativeClassFileName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5742
                                    packageFile := self getPackageFileName:(packageDir , '/classes/' , alternativeClassFileName , '.cls').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5743
                                    packageFile isNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5744
                                        packageFile := (packageDir , '/classes/' , alternativeClassFileName , '.cls').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5745
                                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5746
                                    ok := self fileIn:packageFile lazy:loadLazy silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5747
                                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5748
                            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5749
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5750
                            zarFn := self getPackageFileName:(packageDir , '/classes.zip').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5751
                            zarFn notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5752
                                zar := ZipArchive oldFileNamed:zarFn.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5753
                                zar notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5754
                                    entry := zar extract:(classFileName , '.cls').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5755
                                    (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5756
                                        entry := zar extract:(alternativeClassFileName , '.cls').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5757
                                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5758
                                    entry notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5759
                                        bos := BinaryObjectStorage onOld:(entry asByteArray readStream).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5760
                                        bos next.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5761
                                        bos close.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5762
                                        ok := true
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5763
                                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5764
                                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5765
                            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5766
                        ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5767
                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5768
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5769
                    "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5770
                     if that did not work, look for an st-source file ...
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5771
                    "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5772
                    ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5773
                        filenameToSet := classFileName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5774
                        (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5775
                        ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5776
                            alternativeClassFileName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5777
                                filenameToSet := alternativeClassFileName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5778
                                ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5779
                            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5780
                            ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5781
                                "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5782
                                 ... and in the standard source-directory
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5783
                                "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5784
                                filenameToSet := 'source/' , classFileName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5785
                                (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5786
                                ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5787
                                    alternativeClassFileName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5788
                                        filenameToSet := 'source/' , alternativeClassFileName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5789
                                        ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5790
                                    ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5791
                                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5792
                            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5793
                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5794
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5795
                         if that did not work, and the classes package is known,
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5796
                         look for an st-source file
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5797
                         in a package subdir of the source-directory ...
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5798
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5799
                        ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5800
                            packageDir notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5801
                                packageFile := self getPackageSourceFileName:(packageDir , '/source/' , classFileName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5802
                                packageFile isNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5803
                                    packageFile := (packageDir , '/source/' , classFileName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5804
                                ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5805
                                filenameToSet := packageFile.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5806
                                (ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5807
                                ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5808
                                    alternativeClassFileName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5809
                                        packageFile := self getPackageSourceFileName:(packageDir , '/source/' , alternativeClassFileName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5810
                                        packageFile isNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5811
                                            packageFile := (packageDir , '/source/' , alternativeClassFileName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5812
                                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5813
                                        filenameToSet := packageFile.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5814
                                        ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5815
                                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5816
                                    ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5817
                                        packageFile := self getPackageSourceFileName:(packageDir , '/' , classFileName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5818
                                        packageFile isNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5819
                                            packageFile := (packageDir , '/' , classFileName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5820
                                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5821
                                        filenameToSet := packageFile.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5822
                                        (ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5823
                                        ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5824
                                            alternativeClassFileName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5825
                                                packageFile := self getPackageFileName:(packageDir , '/' , alternativeClassFileName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5826
                                                packageFile isNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5827
                                                    packageFile := (packageDir , '/' , alternativeClassFileName).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5828
                                                ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5829
                                                filenameToSet := packageFile.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5830
                                                ok := self fileInSourceFile:packageFile lazy:loadLazy silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5831
                                            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5832
                                            ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5833
                                                "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5834
                                                 ... and in the standard source-directory
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5835
                                                "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5836
                                                filenameToSet := 'source/' , packageDir , '/' , classFileName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5837
                                                (ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5838
                                                ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5839
                                                    alternativeClassFileName notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5840
                                                        filenameToSet := 'source/' , packageDir , '/' , alternativeClassFileName.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5841
                                                        ok := self fileInSourceFile:filenameToSet lazy:loadLazy silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5842
                                                    ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5843
                                                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5844
                                            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5845
                                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5846
                                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5847
                                ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5848
                            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5849
                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5850
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5851
                         if that did not work, and the classes package is known,
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5852
                         look for a zipArchive containing a class entry.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5853
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5854
                        ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5855
                            packageDir notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5856
                                zarFn := self getPackageFileName:(packageDir , '/source.zip').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5857
                                zarFn isNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5858
                                    zarFn := packageDir asFilename withSuffix:'zip'.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5859
                                    zarFn := self getSourceFileName:zarFn.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5860
                                ].
14810
7966ceb7db51 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14805
diff changeset
  5861
                                (zarFn notNil and:[zarFn asFilename exists]) ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5862
                                    zar := ZipArchive oldFileNamed:zarFn.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5863
                                    zar notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5864
                                        entry := zar extract:(classFileName , '.st').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5865
                                        (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5866
                                            entry := zar extract:(alternativeClassFileName , '.st').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5867
                                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5868
                                        entry notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5869
                                            filenameToSet := zarFn.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5870
                                            ok := self
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5871
                                                    fileInStream:(entry asString readStream)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5872
                                                    lazy:loadLazy
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5873
                                                    silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5874
                                                    logged:false
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5875
                                                    addPath:nil
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5876
                                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5877
                                    ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5878
                                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5879
                            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5880
                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5881
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5882
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5883
                         if that did not work,
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5884
                         look for a zipArchive containing a class entry.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5885
                        "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5886
                        ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5887
                            zarFn := self getSourceFileName:'source.zip'.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5888
                            zarFn notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5889
                                zar := ZipArchive oldFileNamed:zarFn.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5890
                                zar notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5891
                                    entry := zar extract:(zarFn := classFileName , '.st').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5892
                                    (entry isNil and:[alternativeClassFileName notNil]) ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5893
                                        entry := zar extract:(zarFn := alternativeClassFileName , '.st').
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5894
                                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5895
                                    entry notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5896
                                        filenameToSet := zarFn.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5897
                                        ok := self
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5898
                                                fileInStream:(entry asString readStream)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5899
                                                lazy:loadLazy
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5900
                                                silent:beSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5901
                                                logged:false
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5902
                                                addPath:nil
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5903
                                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5904
                                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5905
                            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5906
                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5907
                        ok ifFalse:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5908
                            "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5909
                             if there is a sourceCodeManager, ask it for the classes sourceCode
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5910
                            "
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5911
                            (mgr := Smalltalk at:#SourceCodeManager) notNil ifTrue:[
14620
74b59031d46e class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14611
diff changeset
  5912
                                inStream := mgr getMostRecentSourceStreamForClassNamed:aClassName inPackage:package.
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5913
                                inStream notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5914
                                    filenameToSet := nil.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5915
                                    ok := self fileInStream:inStream lazy:loadLazy silent:beSilent logged:false addPath:nil.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5916
                                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5917
                            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5918
                        ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5919
                    ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5920
                ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5921
            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5922
        ] ensure:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5923
            Compiler compileLazy:wasLazy.
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5924
            wasSilent notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5925
                self silentLoading:wasSilent
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5926
            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5927
        ].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5928
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5929
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5930
    ok ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5931
        newClass := self at:(aClassName asSymbol).
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5932
        newClass notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5933
            "set the classes name - but do not change if already set"
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5934
            filenameToSet notNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5935
                newClass getClassFilename isNil ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5936
                    newClass setClassFilename:(filenameToSet asFilename baseName)
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5937
                ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5938
            ].
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5939
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5940
            doInit ifTrue:[
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5941
                newClass initialize
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5942
            ]
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  5943
        ]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5944
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5945
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5946
    ^ newClass
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5947
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  5948
    "Created: / 09-01-1998 / 14:40:32 / cg"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  5949
    "Modified: / 05-06-1999 / 14:53:01 / cg"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  5950
    "Modified: / 16-08-2009 / 14:52:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5951
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5952
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5953
fileInClassLibrary:aClassLibraryName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5954
    "find an object file containing a binary class library in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5955
     and load it. This install all of its contained classes.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5956
     Return true if ok, false if not.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5957
     Notice: the argument may not have an extension (by purpose);
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5958
	     the sharedLib extension (.dll / .so / .sl) is added here, to
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5959
	     make the caller independent of the underlying operatingSystem."
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5960
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5961
    |path fn|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5962
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5963
    ObjectFileLoader isNil ifTrue:[^ false].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5964
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5965
    fn := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5966
    fn := fn pathName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5967
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5968
    path := self getBinaryFileName:fn.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5969
    path isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  5970
	path := self getSystemFileName:fn.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5971
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5972
    path isNil ifTrue:[^ false].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5973
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5974
    ^ (ObjectFileLoader loadObjectFile:path) notNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5975
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5976
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5977
     Smalltalk fileInClassLibrary:'libtable'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5978
     Smalltalk fileInClassLibrary:'binary/libwidg3'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5979
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5980
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5981
    "Modified: 8.1.1997 / 17:58:56 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5982
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5983
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5984
fileInClassLibrary:aClassLibraryName inPackage:packageID
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5985
    "find an object file containing a binary class library in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5986
     and load it. This installs all of its contained classes.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5987
     Return true if ok, false if not.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5988
     Notice: the argument may not have an extension (by purpose);
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5989
	     the sharedLib extension (.dll / .so / .sl) is added here, to
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5990
	     make the caller independent of the underlying operatingSystem."
11689
d08d5db473c5 Find windows DLLs under package\objbc in development environment
Stefan Vogel <sv@exept.de>
parents: 11681
diff changeset
  5991
11690
b48d486944fc fix for previous revision
Stefan Vogel <sv@exept.de>
parents: 11689
diff changeset
  5992
    |baseName handle libraryFilename packagePath|
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5993
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5994
    ObjectFileLoader isNil ifTrue:[^ false].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5995
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5996
    baseName := aClassLibraryName asFilename withSuffix:(ObjectFileLoader sharedLibrarySuffix).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  5997
    baseName exists ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5998
	"/ load local file first...
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  5999
	handle := ObjectFileLoader loadObjectFile:baseName.
12744
80f6da0fee57 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 12700
diff changeset
  6000
    ].
80f6da0fee57 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 12700
diff changeset
  6001
    handle isNil ifTrue:[
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6002
	packagePath := self getPackageDirectoryForPackage:packageID.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6003
	packagePath isNil ifTrue:[^ false].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6004
	packagePath := packagePath asFilename.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6005
	libraryFilename := packagePath / baseName.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6006
	libraryFilename exists ifFalse:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6007
	    libraryFilename := nil.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6008
	    #('objbc' 'objvc') do:[:eachPossibleCompiledCodeDir |
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6009
		"in windows, with Borland compiler, DLLs in development environment are under objbc;
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6010
		 with MSVC, they are under objvc"
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6011
		libraryFilename isNil ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6012
		    libraryFilename := packagePath / eachPossibleCompiledCodeDir / baseName.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6013
		    libraryFilename exists ifFalse:[ libraryFilename := nil ]
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6014
		].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6015
	    ].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6016
	].
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6017
	(libraryFilename notNil and:[libraryFilename exists]) ifTrue:[
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6018
	    handle := ObjectFileLoader loadObjectFile:libraryFilename pathName.
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  6019
	].
12744
80f6da0fee57 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 12700
diff changeset
  6020
    ].
80f6da0fee57 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 12700
diff changeset
  6021
80f6da0fee57 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 12700
diff changeset
  6022
"/    handle notNil ifTrue:[
80f6da0fee57 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 12700
diff changeset
  6023
"/        Transcript showCR:('    Smalltalk: loaded %1.' bindWith:libraryFilename pathName).
80f6da0fee57 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 12700
diff changeset
  6024
"/    ].
80f6da0fee57 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 12700
diff changeset
  6025
    ^ handle notNil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6026
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6027
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6028
     Smalltalk fileInClassLibrary:'libtable'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6029
     Smalltalk fileInClassLibrary:'binary/libwidg3'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6030
     Smalltalk fileInClassLibrary:'refactoryBrowser' inPackage:'stx:goodies/refactoryBrowser'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6031
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6032
13787
1695a24d0fa7 changed: #fileInClassLibrary:inPackage:
Claus Gittinger <cg@exept.de>
parents: 13785
diff changeset
  6033
    "Modified: / 08-10-2011 / 00:08:51 / cg"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6034
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6035
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6036
fileInSourceFile:filename lazy:loadLazy silent:beSilent
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6037
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6038
    "Try all available programming languages"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6039
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6040
    ProgrammingLanguage allDo:
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6041
	[:lang| | f |
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6042
	f := (filename endsWith: ('.' , lang sourceFileSuffix))
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6043
		    ifTrue:[filename]
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6044
		    ifFalse:[filename , '.' , lang sourceFileSuffix].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6045
	(self fileIn:f lazy:loadLazy silent:beSilent)
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6046
		ifTrue:[^true]].
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6047
    ^false
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6048
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6049
    "Created: / 16-08-2009 / 14:45:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6050
!
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6051
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6052
fileInStream:streamArg
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6053
    ^ self fileInStream:streamArg lazy:nil silent:nil logged:false addPath:nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6054
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6055
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6056
fileInStream:streamArg lazy:lazy silent:silent logged:logged addPath:morePath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6057
    "read sourceCode from aStream;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6058
     return true if ok, false if failed.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6059
     If lazy is true, no code is generated for methods, instead stubs
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6060
     are created which compile themself when first executed. This allows
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6061
     for much faster fileIn (but slows down the first execution later).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6062
     Since no syntax checks are done when doing lazy fileIn, use this only for
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6063
     code which is known to be syntactically correct.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6064
     If silent is true, no compiler messages are output to the transcript.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6065
     Giving nil for silent/lazy will use the current settings.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6066
     If morePath is nonNil, it is prepended to the systemPath temporarily during the
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6067
     fileIn. This allows for st-expressions to refer to more files (i.e. fileIn more)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6068
     using a relative path."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6069
11427
ac373ee02301 refactored
Claus Gittinger <cg@exept.de>
parents: 11400
diff changeset
  6070
    |inStream wasLazy wasSilent oldSystemPath oldRealPath|
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6071
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6072
    inStream := streamArg.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6073
    inStream isNil ifTrue:[^ false].
12611
38d61d374d89 care for nonPositionable stream (stdin) in fileIn
Claus Gittinger <cg@exept.de>
parents: 12557
diff changeset
  6074
    inStream := EncodedStream isNil
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6075
		    ifTrue:[ inStream ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6076
		    ifFalse:[ EncodedStream decodedStreamFor:inStream ].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6077
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6078
    lazy notNil ifTrue:[wasLazy := Compiler compileLazy:lazy].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6079
    silent notNil ifTrue:[wasSilent := self silentLoading:silent].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6080
    morePath notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6081
	oldSystemPath := SystemPath copy.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6082
	SystemPath addFirst:morePath.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6083
	oldRealPath := RealSystemPath.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6084
	RealSystemPath := nil.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6085
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6086
    [
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6087
	(Class updateChangeFileQuerySignal , Class updateChangeListQuerySignal) answer:logged do:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6088
	    "JV: Changed to give ProgrammingLanguage to choose
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6089
	     proper reader"
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6090
	    (ProgrammingLanguage forStream: inStream)
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6091
		fileInStream: inStream
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6092
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6093
    ] ensure:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6094
	morePath notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6095
	    "take care, someone could have changed SystemPath during fileIn!!"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6096
	    (SystemPath copyFrom:2) = oldSystemPath ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6097
		SystemPath := oldSystemPath.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6098
		RealSystemPath := oldRealPath.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6099
	    ] ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6100
		(oldSystemPath includes:morePath) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6101
		    SystemPath remove:morePath ifAbsent:[].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6102
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6103
		RealSystemPath := nil.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6104
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6105
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6106
	lazy notNil ifTrue:[Compiler compileLazy:wasLazy].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6107
	silent notNil ifTrue:[self silentLoading:wasSilent].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6108
	inStream close
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6109
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6110
    ^ true
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6111
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6112
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6113
     Smalltalk fileInStream:('source/TicTacToe.st' asFilename readStream) lazy:true silent:true
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6114
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6115
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6116
    "Modified: / 05-11-1996 / 20:03:35 / cg"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6117
    "Modified: / 16-08-2009 / 11:06:05 / Jan Vrany <vranyj1@fel.cvut.cz>"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6118
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6119
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6120
isClassLibraryLoaded:name
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6121
    "return true, if a particular class library is already loaded"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6122
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6123
    ObjectMemory
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6124
	binaryModuleInfo
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6125
	    do:[:entry |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6126
		   entry type == #classLibrary ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6127
		       entry libraryName = name ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6128
			  ^ true        "/ already loaded
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6129
		       ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6130
		   ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6131
	       ].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6132
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6133
    ^ false
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6134
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6135
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6136
     Smalltalk isClassLibraryLoaded:'libstx_libbasic'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6137
     Smalltalk isClassLibraryLoaded:'libstx_libwidg3'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6138
     Smalltalk isClassLibraryLoaded:'libstx_libboss'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6139
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6140
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6141
    "Modified: / 23-08-2006 / 15:54:46 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6142
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6143
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6144
loadClassLibraryIfAbsent:name
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6145
    "dynamically load a classLibrary, if not already loaded
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6146
     and the system supports dynamic loading.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6147
     Return true, if the library is loaded, false if not.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6148
     This entry is called without system specific filename
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6149
     extensions - it is portable among different architectures
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6150
     as long as corresponding files (x.so / x.dll / x.sl / x.o)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6151
     are be present ..."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6152
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6153
    (self isClassLibraryLoaded:name) ifTrue:[ ^ true ].  "/ already loaded
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6154
    ^ self fileInClassLibrary:name
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6155
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6156
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6157
     Smalltalk loadClassLibraryIfAbsent:'libbasic'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6158
     Smalltalk loadClassLibraryIfAbsent:'libwidg3'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6159
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6160
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6161
    "Modified: 31.10.1996 / 16:57:24 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6162
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6163
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6164
secureFileIn:aFileName
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6165
    "read in the named file, looking for it at standard places.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6166
     Catch various errors during fileIn.
13000
28bd279e2574 changed: #secureFileIn:
Stefan Vogel <sv@exept.de>
parents: 12919
diff changeset
  6167
     Return true if ok, false if failed"
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6168
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6169
    |retVal|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6170
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6171
    retVal := false.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6172
    (SignalSet
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6173
	with:AbortOperationRequest
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6174
	with:TerminateProcessRequest
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6175
	with:Parser parseErrorSignal)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6176
	    handle:[:ex | ex return ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6177
	    do:[ retVal := self fileIn:aFileName ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6178
    ^ retVal
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6179
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6180
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6181
silentFileIn:aFilename
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6182
    "same as fileIn:, but do not output 'compiled...'-messages on Transcript.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6183
     Main use is during startup."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6184
13353
cf8d1605652f changed: #silentFileIn:
Stefan Vogel <sv@exept.de>
parents: 13323
diff changeset
  6185
    self silentlyLoadingDo:[
13370
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  6186
	self fileIn:aFilename
13353
cf8d1605652f changed: #silentFileIn:
Stefan Vogel <sv@exept.de>
parents: 13323
diff changeset
  6187
    ].
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  6188
! !
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  6189
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6190
3044
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  6191
!Smalltalk class methodsFor:'system management-files'!
a0bbac91639b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3033
diff changeset
  6192
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6193
bitmapFileStreamFor:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6194
    "search aFileName in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6195
     return a readonly fileStream or nil if not found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6196
     Searches in subdirectories named 'bitmaps' in the SystemPath.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6197
     Notice: this does not look in the package-specific bitmaps directories."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6198
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6199
    |aString|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6200
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6201
    aString := self getBitmapFileName:aFileName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6202
    aString notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6203
	^ aString asFilename readStreamOrNil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6204
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6205
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6206
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6207
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6208
bitmapFromFileNamed:aFileName forClass:aClass
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6209
    "backward compatibility:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6210
     search aFileName in some standard places:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6211
     first in the redefinable bitmaps path,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6212
     then in the classes own package directory if existing.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6213
     Return an image or nil."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6214
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6215
    ^ self imageFromFileNamed:aFileName forClass:aClass
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6216
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6217
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6218
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' forClass:View
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6219
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6220
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6221
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6222
bitmapFromFileNamed:aFileName inPackage:aPackage
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6223
    "backward compatibility:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6224
     search aFileName in some standard places:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6225
     first in the redefinable bitmaps path,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6226
     then in the package directory if existing.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6227
     Return an image or nil."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6228
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6229
    ^ self imageFromFileNamed:aFileName inPackage:aPackage
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6230
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6231
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6232
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6233
     Smalltalk bitmapFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6234
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6235
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6236
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6237
classNameForFile:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6238
    "return the className which corresponds to an abbreviated fileName,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6239
     or nil if no special translation applies. The given filename arg may
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6240
     include a '.st' suffix (but no other)."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6241
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6242
    |fn|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6243
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6244
    (aFileName asFilename hasSuffix:'st') ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6245
	fn := aFileName copyWithoutLast:3
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6246
    ] ifFalse:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6247
	fn := aFileName
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6248
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6249
    ^ self filenameAbbreviations keyAtEqualValue:fn ifAbsent:[fn].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6250
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6251
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6252
     Smalltalk classNameForFile:'DrawObj'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6253
     Smalltalk classNameForFile:'DrawObj.st'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6254
     Smalltalk classNameForFile:'ArrColl.st'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6255
     Smalltalk classNameForFile:'ArrColl.chg'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6256
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6257
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6258
    "Modified: 11.12.1995 / 14:51:10 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6259
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6260
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6261
constructPathFor:aDirectoryName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6262
    "search for aDirectory in SystemPath;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6263
     return a collection of pathes which include that directory."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6264
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6265
    ^ self realSystemPath select:[:dirName |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6266
	|fullPath|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6267
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6268
	fullPath := dirName asFilename construct:aDirectoryName.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6269
	"/ fullPath exists and:[fullPath isDirectory and:[fullPath isReadable]]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6270
	fullPath isDirectory and:[fullPath isReadable]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6271
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6272
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6273
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6274
fileInFileStreamFor:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6275
    "obsolete
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6276
     search aFileName in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6277
     return a readonly fileStream or nil if not found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6278
     Searches in subdirectories named 'fileIn' in SystemPath"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6279
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6280
    |aString|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6281
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6282
    aString := self getFileInFileName:aFileName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6283
    aString notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6284
	^ aString asFilename readStreamOrNil
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6285
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6286
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  6287
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6288
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6289
fileNameForClass:aClassOrClassName
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6290
    "return a actual or expected (or most wanted) filename for aClassOrClassName
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6291
     - only the base name (without directory part) and without suffix."
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6292
17996
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6293
    |cls nonMetaclass nm nameWithPrefix nameWithoutPrefix compatQuery compatPkg |
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6294
12301
5d077b04f6f0 changed: #fileNameForClass:
fm
parents: 12300
diff changeset
  6295
"/  This was added as an extension of libsvn - should be no longer needed
17971
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6296
"/  JV@2012-09-25: but it actually is. The problem is that class filename
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6297
"/  is stored in the class itself and used to generate abbrev.stc and
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6298
"/  prerequisites in makefiles. But if you renamed such a stc-compiled class,
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6299
"/  the filename remains the same, but SVN __ALWAYS__ keep container name
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6300
"/  and class name in sync. Therefore build files gets messed up. Indeed, this
17993
956342c369a2 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17989
diff changeset
  6301
"/  should be fixed in code that files-out the package and generates build files.
17971
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6302
"/  Certainly a hack, but do not remove this until fixed elsewhere
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6303
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6304
    compatQuery := Smalltalk classNamed: 'SVN::CompatModeQuery'.
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6305
    (compatQuery notNil
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6306
      and:[compatQuery isLoaded
17996
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6307
        and:[compatQuery query not]]) ifTrue:[
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6308
            nm := aClassOrClassName isBehavior
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6309
                ifTrue:[aClassOrClassName name]
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6310
                ifFalse:[aClassOrClassName].
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6311
            nm := nm copyReplaceAll:$: with:$_.
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6312
            ^nm
17971
cd3a53fb927c Fixed Smalltalk>>fileNameForClass: so it correctly handles class renames when the package is handled by SVN
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17966
diff changeset
  6313
    ].
17734
406b1590afe8 Merged with trunk r10476
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17732
diff changeset
  6314
17982
a28466dbdb64 Smalltal class>>fileNameForClass: honour new compat query for libscm
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17976
diff changeset
  6315
"/  Same for another query for new libscm...
a28466dbdb64 Smalltal class>>fileNameForClass: honour new compat query for libscm
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17976
diff changeset
  6316
    compatQuery := Smalltalk classNamed: 'SCMCompatModeQuery'.
a28466dbdb64 Smalltal class>>fileNameForClass: honour new compat query for libscm
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17976
diff changeset
  6317
    (compatQuery notNil
a28466dbdb64 Smalltal class>>fileNameForClass: honour new compat query for libscm
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17976
diff changeset
  6318
      and:[compatQuery isLoaded
17996
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6319
        and:[(compatPkg := compatQuery query) notNil]]) ifTrue:[
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6320
            nm := aClassOrClassName isBehavior
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6321
                ifTrue:[aClassOrClassName name]
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6322
                ifFalse:[aClassOrClassName].
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6323
            cls := Smalltalk at: nm asSymbol.
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6324
            (cls notNil and:[cls package == compatPkg]) ifTrue:[
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6325
                nm := nm copyReplaceAll:$: with:$_.
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6326
                ^nm
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6327
            ].
17982
a28466dbdb64 Smalltal class>>fileNameForClass: honour new compat query for libscm
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17976
diff changeset
  6328
    ].
12301
5d077b04f6f0 changed: #fileNameForClass:
fm
parents: 12300
diff changeset
  6329
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6330
    aClassOrClassName isBehavior ifTrue:[
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6331
        cls := aClassOrClassName.
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6332
    ] ifFalse:[
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6333
        cls := Smalltalk classNamed:aClassOrClassName.
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6334
        cls isNil ifTrue:[
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6335
            nameWithPrefix := aClassOrClassName.
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6336
            nameWithoutPrefix := (aClassOrClassName copyFrom:(aClassOrClassName lastIndexOf:$:)+1).
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6337
        ].
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6338
    ].
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6339
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6340
    cls notNil ifTrue:[
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6341
        nonMetaclass := cls theNonMetaclass.
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6342
        nm := nonMetaclass getClassFilename.
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6343
        nm isNil ifTrue:[
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6344
            cls revisionInfo notNil ifTrue:[
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6345
                nm := cls revisionInfo fileName.
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6346
            ].
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6347
        ].
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6348
        nm notNil ifTrue:[
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6349
            ^ nm asFilename withoutSuffix baseName
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6350
        ].
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6351
        nameWithPrefix := nonMetaclass name.
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6352
        nameWithoutPrefix := nonMetaclass nameWithoutPrefix.
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6353
    ].
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6354
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6355
    CachedAbbreviations notNil ifTrue:[
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6356
        nameWithPrefix := nameWithPrefix asSymbol.
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6357
        (CachedAbbreviations includesKey:nameWithPrefix) ifTrue:[
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6358
            ^ (CachedAbbreviations at:nameWithPrefix) asFilename baseName
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6359
        ].
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6360
        nameWithoutPrefix := nameWithoutPrefix asSymbol.
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6361
        (CachedAbbreviations includesKey:nameWithoutPrefix) ifTrue:[
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6362
            ^ (CachedAbbreviations at:nameWithoutPrefix) asFilename baseName
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  6363
        ].
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6364
    ].
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6365
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6366
    ^ nameWithPrefix copyReplaceAll:$: with:$_
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6367
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6368
    "
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6369
     Smalltalk fileNameForClass:#Complex
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6370
     Smalltalk fileNameForClass:'SmallInteger'
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6371
     Smalltalk fileNameForClass:'UnixOperatingSystem'
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6372
     Smalltalk fileNameForClass:'Launcher'
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6373
     Smalltalk fileNameForClass:'SomeUnknownClass'
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6374
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6375
     Smalltalk fileNameForClass:HTML::Encoder
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6376
     Smalltalk fileNameForClass:OSI::FTAMOperation
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6377
     Smalltalk fileNameForClass:'OSI::Foobar'
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6378
     Smalltalk fileNameForClass:(Workflow::UnsuccessfulFinishReasons)
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6379
     Workflow::UnsuccessfulFinishReasons classFilename
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6380
    "
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6381
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6382
    "Modified: / 06-10-2006 / 16:16:01 / cg"
17996
0fd959f71d7c - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17993
diff changeset
  6383
    "Modified: / 04-12-2012 / 17:44:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
17997
5c30feac5948 - Smalltalk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17996
diff changeset
  6384
    "Modified (format): / 05-12-2012 / 10:47:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
12022
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6385
!
205ac90337cc oops- fileNameForClass
Claus Gittinger <cg@exept.de>
parents: 12019
diff changeset
  6386
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6387
filenameAbbreviations
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6388
    "return a dictionary containing the classname-to-filename
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6389
     mappings. (needed for sys5.3 users, where filenames are limited
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6390
     to 14 chars)"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6391
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6392
    CachedAbbreviations isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6393
	self readAbbreviations
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6394
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6395
    ^ CachedAbbreviations
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6396
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6397
    "flush with:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6398
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6399
     CachedAbbreviations := nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6400
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6401
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6402
     Smalltalk filenameAbbreviations
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6403
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6404
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6405
13368
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6406
findPackageDirectoryForPackage:aPackage
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6407
    "find a packages directory along a number of standard places"
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6408
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6409
    |relDir|
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6410
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6411
    relDir := Smalltalk relativePackagePathForPackage:aPackage.
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6412
    relDir asFilename isAbsolute ifTrue:[^ relDir].
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6413
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6414
    ^ Smalltalk getPackageFileName:relDir.
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6415
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6416
    "
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6417
     Smalltalk findPackageDirectoryForPackage:'stx:libview/resources'
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6418
     Smalltalk findPackageDirectoryForPackage:'stx:libview'
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6419
    "
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6420
!
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  6421
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6422
flushPathCaches
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6423
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6424
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6425
    "forget pathCaches - these are collections containing valid directory names,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6426
     where system files (resource, bitmaps etc.) are found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6427
     A flush is only required, if a new system directory has been created while
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6428
     the system is active, and those files should override the others
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6429
     (for example, if you created a private resource directory)"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6430
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6431
    RealSystemPath := ResourcePath := SourcePath :=
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6432
    BinaryPath := FileInPath := nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6433
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6434
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6435
     Smalltalk flushPathCaches
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6436
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6437
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6438
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6439
getBinaryFileName:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6440
    "obsolete
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6441
     search aFileName in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6442
     (subdirectories named 'binary' in SystemPath);
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6443
     return the absolute filename or nil if none is found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6444
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6445
    BinaryPath isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6446
	BinaryPath := self constructPathFor:BinaryDirName
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6447
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6448
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6449
    ^ self searchPath:BinaryPath for:aFileName in:BinaryDirName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6450
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6451
    "Modified: 18.7.1996 / 15:53:49 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6452
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6453
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6454
getBitmapFileName:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6455
    "for backward compatibility:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6456
     search aFileName in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6457
     (subdirectories named 'bitmaps' in SystemPath);
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6458
     Return the pathName or nil if none is found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6459
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6460
    ^ self getBitmapFileName:aFileName forPackage:nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6461
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6462
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6463
     Smalltalk getBitmapFileName:'SBrowser.xbm'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6464
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6465
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6466
    "Modified: 18.7.1996 / 15:53:55 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6467
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6468
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6469
getBitmapFileName:aFileName forPackage:aPackageIDOrNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6470
    "for backward compatibility.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6471
     search aFileName in some standard places:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6472
     first in the redefinable bitmaps path,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6473
     then in the package directory if existing.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6474
     Return a path or nil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6475
     Search order is:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6476
	bitmaps/<pkg>/file
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6477
	resources/<pkg>/bitmaps/file
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6478
	<pkg>/bitmaps/file
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6479
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6480
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6481
    |f dir packageDir pF|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6482
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6483
    ((f := aFileName asString) startsWith:'bitmaps/') ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6484
	f := f copyFrom:('bitmaps/' size + 1).
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6485
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6486
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6487
    aPackageIDOrNil isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6488
	"/ this will be an error in the future
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6489
"/        'Smalltalk [warning]: bitmap file access without package: ' infoPrint. aFileName infoPrintCR.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6490
"/        self halt.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6491
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6492
	pF := self searchPath:(self realSystemPath) for:aFileName in:('bitmaps').
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6493
	pF notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6494
	    ^ pF.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6495
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6496
	f ~= aFileName ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6497
	    pF := self searchPath:(self realSystemPath) for:f in:('bitmaps').
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6498
	    pF notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6499
		^ pF.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6500
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6501
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6502
	^ nil
11077
14df4640ed89 image by package and filename access fixed
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  6503
    ].
14df4640ed89 image by package and filename access fixed
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  6504
14df4640ed89 image by package and filename access fixed
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  6505
    dir := self projectDirectoryForPackage:aPackageIDOrNil.
14df4640ed89 image by package and filename access fixed
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  6506
    dir notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6507
	pF := dir asFilename / f.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6508
	pF exists ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6509
	    ^ pF.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6510
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6511
	pF := dir asFilename / 'bitmaps' /f.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6512
	pF exists ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6513
	    ^ pF.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6514
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6515
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6516
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6517
    packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6518
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6519
    pF := self searchPath:(self realSystemPath) for:aFileName in:('bitmaps/',packageDir).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6520
    pF notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6521
	^ pF.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6522
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6523
    pF := self searchPath:(self realSystemPath) for:aFileName in:('resources/',packageDir,'/bitmaps').
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6524
    pF notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6525
	^ pF.
11077
14df4640ed89 image by package and filename access fixed
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  6526
    ].
14df4640ed89 image by package and filename access fixed
Claus Gittinger <cg@exept.de>
parents: 11057
diff changeset
  6527
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6528
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6529
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6530
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6531
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6532
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6533
     Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6534
     Smalltalk imageFromFileNamed:'CheckOn10_xp.xpm' inPackage:'stx:libwidg'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6535
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6536
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6537
    "Modified: / 11-10-2006 / 13:53:18 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6538
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6539
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6540
getFileInFileName:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6541
    "obsolete
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6542
     search aFileName in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6543
     (subdirectories named 'fileIn' in SystemPath);
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6544
     return the absolute filename or nil if none is found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6545
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6546
    FileInPath isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6547
	FileInPath := self constructPathFor:FileInDirName
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6548
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6549
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6550
    ^ self searchPath:FileInPath for:aFileName in:FileInDirName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6551
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6552
    "Modified: 18.7.1996 / 15:53:59 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6553
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6554
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6555
getPackageDirectoryForPackage:aPackageID
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6556
    "search for a particular package; return its directory, or nil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6557
     Stand alone applications might get nil, if there are only binaries installed."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6558
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6559
    |checkForPackageDirectory module packageSubDirectory|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6560
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6561
    module := aPackageID asPackageId module.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6562
    packageSubDirectory := aPackageID asPackageId directory.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6563
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6564
    checkForPackageDirectory :=
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6565
	[:moduleDir |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6566
	    |packageDir|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6567
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6568
	    moduleDir isDirectory ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6569
		packageDir := moduleDir / packageSubDirectory.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6570
		packageDir isDirectory ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6571
		    ^ packageDir
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6572
		]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6573
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6574
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6575
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6576
    self packagePath do:[:aPath |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6577
	|moduleDir|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6578
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6579
	moduleDir := aPath asFilename / module.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6580
	checkForPackageDirectory value:moduleDir.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6581
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6582
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6583
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6584
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6585
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6586
     Smalltalk getPackageDirectoryForPackage:(Array package)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6587
     Smalltalk getPackageDirectoryForPackage:'stx:goodies/bitmaps'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6588
     Smalltalk getPackageDirectoryForPackage:'stx:libview'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6589
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6590
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6591
    "Modified: / 06-10-2006 / 11:49:27 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6592
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6593
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6594
getPackageFileName:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6595
    "search aFileName in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6596
     (packagePath and subdirectories named 'packages' in SystemPath);
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6597
     return the absolute filename or nil if none is found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6598
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6599
    |f|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6600
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6601
    "/ search along packagePath ...
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6602
    f := self searchPath:self packagePath for:aFileName in:nil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6603
    f isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6604
	"/ search under packages-directory along systemPath ...
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6605
	f := self searchPath:self realSystemPath for:aFileName in:PackageDirName.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6606
	"/ kludge - allow for stx-directory to be named differently
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6607
	f isNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6608
	    (aFileName startsWith:('stx' , Filename separator)) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6609
		f := '../..' asFilename / (aFileName copyFrom:5).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6610
		f exists ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6611
		    ^ f pathName
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6612
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6613
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6614
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6615
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6616
    (f notNil and:[(f := f asFilename) exists]) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6617
	^ f pathName
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6618
    ].
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  6619
    ^ nil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6620
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6621
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6622
     Smalltalk getPackageFileName:'stx/libview/resources/normal.style'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6623
     Smalltalk getPackageFileName:'stx/libview/source.zip'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6624
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6625
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6626
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6627
getPackageSourceFileName:filenameWithoutSuffix
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6628
    "search aFileName in some standard places and try all available languages"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6629
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6630
    ProgrammingLanguage allDo:
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6631
	[:lang| | file |
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6632
	file := self getPackageFileName: filenameWithoutSuffix , '.' , lang sourceFileSuffix.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  6633
	file ifNotNil:[^file]].
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6634
    ^nil
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6635
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6636
    "Created: / 16-08-2009 / 14:44:58 / Jan Vrany <vranyj1@fel.cvut.cz>"
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6637
!
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  6638
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6639
getResourceFileName:aFileName
12547
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6640
    <resource: #obsolete>
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6641
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6642
    "search aFileName in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6643
     (subdirectories named 'resources' in SystemPath);
12547
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6644
     return the absolute filename or nil if none is found.
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6645
     Obsolete: you must now provide a package argument."
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6646
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6647
    self obsoleteMethodWarning:'use getResourceFileName:forPackage:'.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6648
    ^ self getResourceFileName:aFileName forPackage:nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6649
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6650
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6651
     Smalltalk getResourceFileName:'SystemBrowser.rs'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6652
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6653
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6654
    "Modified: 18.7.1996 / 15:54:03 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6655
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6656
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6657
getResourceFileName:aFileName forClass:aClassOrNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6658
    "search aFileName in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6659
     (subdirectories named 'resource' in SystemPath);
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6660
     and in aClasses package directory.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6661
     Return the absolute filename or nil if none is found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6662
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6663
    |pkgOrNil|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6664
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6665
    aClassOrNil notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6666
	pkgOrNil := aClassOrNil package.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6667
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6668
    ^ self getResourceFileName:aFileName forPackage:pkgOrNil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6669
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6670
    "
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6671
     Smalltalk getResourceFileName:'de.rs' forClass:SystemBrowser
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6672
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6673
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6674
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6675
getResourceFileName:aFileName forPackage:aPackageIDOrNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6676
    "search aFileName in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6677
     (subdirectories named 'resource' in SystemPath);
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6678
     and in a packages directory.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6679
     Return the absolute filename or nil if none is found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6680
     Search order is:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6681
	resources/<pkg>/file
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6682
	<pkg>/resources/file
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6683
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6684
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6685
    |pF f dir packageDir|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6686
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6687
    ((f := aFileName asString) startsWith:'resources/') ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6688
	f := aFileName copyFrom:('resources/' size + 1).
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6689
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6690
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6691
    aPackageIDOrNil isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6692
	"/ this will be an error in the future
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6693
"/        'Smalltalk [warning]: resource file access without package: ' infoPrint. aFileName infoPrintCR.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6694
"/        self halt.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6695
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6696
	pF := self searchPath:(self realSystemPath) for:aFileName in:('resources').
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6697
	pF notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6698
	    ^ pF.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6699
	].
12547
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6700
"/        pF := self searchPath:(self realSystemPath) for:aFileName in:('resources/styles').
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6701
"/        pF notNil ifTrue:[
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6702
"/            ^ pF.
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6703
"/        ].
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6704
	f ~= aFileName ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6705
	    pF := self searchPath:(self realSystemPath) for:f in:('resources').
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6706
	    pF notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6707
		^ pF.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6708
	    ].
12547
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6709
"/            pF := self searchPath:(self realSystemPath) for:f in:('resources/styles').
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6710
"/            pF notNil ifTrue:[
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6711
"/                ^ pF.
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6712
"/            ].
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6713
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6714
	^ nil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6715
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6716
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6717
    packageDir := aPackageIDOrNil copyReplaceAll:$: with:$/.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6718
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6719
    pF := self searchPath:(self realSystemPath) for:aFileName in:('resources/',packageDir).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6720
    pF notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6721
	^ pF.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6722
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6723
12547
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6724
    "/ the following code finds the file within the IDE's own hierarchy
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6725
    dir := self projectDirectoryForPackage:aPackageIDOrNil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6726
    dir notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6727
	dir := dir asFilename.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6728
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6729
	(pF := dir / 'resources' / f) exists ifTrue:[ ^ pF name ].
12547
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6730
"/        (pF := dir / 'styles' / f) exists ifTrue:[ ^ pF name ].
12377
f9a9aea7ba0f changed:13 methods
Claus Gittinger <cg@exept.de>
parents: 12376
diff changeset
  6731
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6732
	"resolve something like: 'ASN/definition.asn1'"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6733
	(pF := dir / f) exists ifTrue:[ ^ pF name ].
12377
f9a9aea7ba0f changed:13 methods
Claus Gittinger <cg@exept.de>
parents: 12376
diff changeset
  6734
    ].
f9a9aea7ba0f changed:13 methods
Claus Gittinger <cg@exept.de>
parents: 12376
diff changeset
  6735
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6736
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6737
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6738
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6739
     Smalltalk getResourceFileName:'SystemBrowser.rs' forPackage:'stx:libtool'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6740
     Smalltalk getResourceFileName:'normal.style' forPackage:'stx:libview'
12547
30fda24cebb5 comment/format in: #getResourceFileName:forClass:
Claus Gittinger <cg@exept.de>
parents: 12539
diff changeset
  6741
     Smalltalk getResourceFileName:'styles/normal.style' forPackage:'stx:libview'
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6742
     Smalltalk getResourceFileName:'styles/mswindowsXP.style' forPackage:'stx:libview'
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6743
     Smalltalk getResourceFileName:'Foo.rs' forPackage:'stx:libview'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6744
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6745
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6746
    "Modified: / 11-10-2006 / 13:53:43 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6747
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6748
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6749
getSourceFileName:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6750
    "search aFileName in some standard places
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6751
     (subdirectories named 'source' in SystemPath);
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6752
     return the absolute filename or nil if none is found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6753
     This is used to find a sourceFile for a methods source,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6754
     if no sourceCodeManager is available."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6755
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6756
    |f|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6757
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6758
    SourcePath isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6759
	SourcePath := self constructPathFor:SourceDirName
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6760
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6761
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6762
    "/ first, try a source subdir along the path.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6763
    SourcePath notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6764
	f := self searchPath:SourcePath for:aFileName in:SourceDirName.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6765
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6766
    f isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6767
	"/ then, try it itself along the path.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6768
	f := self searchPath:self realSystemPath for:aFileName in:nil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6769
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6770
    ^ f
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6771
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6772
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6773
     Smalltalk getSourceFileName:'Smalltalk.st'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6774
     Smalltalk getSourceFileName:'ArrColl.st'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6775
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6776
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6777
    "Modified: 18.7.1996 / 15:54:07 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6778
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6779
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6780
getSystemFileName:aFileNameOrString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6781
    "search aFileNameOrString in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6782
     return the absolute filename or nil if none is found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6783
     see comment in Smalltalk>>initSystemPath.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6784
     This should be used to access resources such as bitmaps, doc-files,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6785
     and other help files.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6786
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6787
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6788
    "credits for this method go to Markus ...."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6789
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6790
    |fn nameString|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6791
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6792
    fn := aFileNameOrString asFilename.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6793
    nameString := fn name.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6794
    fn isAbsolute ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6795
	"dont use path for absolute file names"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6796
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6797
	^ nameString
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6798
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6799
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6800
    self realSystemPath do:[:dirName |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6801
	|realName|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6802
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6803
	realName := dirName asFilename / nameString.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6804
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6805
	"/ here, we also return true if its a directory
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6806
	"/ (Even if unreadable).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6807
	"/ It could be that the file itself is still readable.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6808
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6809
	(realName isDirectory or:[realName isReadable]) ifTrue: [
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6810
	    ^ realName name
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6811
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6812
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6813
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6814
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6815
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6816
     Smalltalk getSystemFileName:'doc/online/english/TOP.html'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6817
     Smalltalk getSystemFileName:'bitmaps/SBrowser.xbm'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6818
     Smalltalk getSystemFileName:'bitmaps/foo'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6819
     Smalltalk getSystemFileName:'resources/View.rs'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6820
     Smalltalk getSystemFileName:'resources/iris.style'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6821
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6822
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6823
    "Modified: / 6.5.1999 / 10:40:37 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6824
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6825
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6826
imageFromFileNamed:aFileName forClass:aClass
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6827
    "search aFileName in some standard places:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6828
     first in the redefinable bitmaps path, then in the classes
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6829
     own package directory if existing.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6830
     Return an image or nil."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6831
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6832
    |classPackage img|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6833
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6834
    classPackage := aClass package.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6835
    img := self imageFromFileNamed:aFileName inPackage:classPackage.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6836
    img isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6837
	"/ try under the goodies package ...
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6838
	classPackage ~= 'stx:goodies' ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6839
	    img := self imageFromFileNamed:aFileName inPackage:'stx:goodies'.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6840
	]
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6841
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6842
    ^ img
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6843
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6844
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6845
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' forClass:View
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6846
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6847
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6848
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6849
imageFromFileNamed:aFileName inPackage:aPackage
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6850
    "search aFileName in some standard places:
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6851
     first in the redefinable bitmaps path,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6852
     then in the package directory if existing.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6853
     Return an image or nil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6854
     Search order is:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6855
	bitmaps/<pkg>/file
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6856
	resources/<pkg>/bitmaps/file
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6857
	<pkg>/bitmaps/file
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6858
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6859
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6860
    |path|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6861
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6862
    path := self getBitmapFileName:aFileName forPackage:aPackage.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6863
    path notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6864
	^ Image fromFile:path.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6865
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6866
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6867
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6868
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6869
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libview'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6870
     Smalltalk imageFromFileNamed:'SmalltalkX.xbm' inPackage:'stx:libtool'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6871
     Smalltalk imageFromFileNamed:'bitmaps/gifImages/garfield.gif' inPackage:'stx:goodies'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6872
     Smalltalk imageFromFileNamed:'CheckOn10_xp.xpm' inPackage:'stx:libwidg'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6873
     Smalltalk imageFromFileNamed:'ComboDn_xp.xpm' inPackage:'stx:libwidg'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6874
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6875
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6876
    "Modified: / 08-09-2006 / 18:02:04 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6877
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6878
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6879
libraryFileNameOfClass:aClassOrClassName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6880
    "for a given class, return the name of a classLibrary which contains
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6881
     binary code for it.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6882
     Read the libinfo file 'liblist.stc' (which is created during the compilation process)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6883
     for an entry for aClassOrClassName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6884
     Search for the className in the first col, and return the value found in
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6885
     the 2nd col.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6886
     Return nil if no entry is found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6887
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6888
     A nil returns means that this class is either built-in or not present
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6889
     in a package-class library (i.e. either as separate .o or separate .st file).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6890
     Otherwise, the returned name is the classLibrary object of that class.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6891
     The classes code can be loaded from that file if binary loading is supported."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6892
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6893
    |aStream line words n aClassName|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6894
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6895
    aClassOrClassName isBehavior ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6896
	aClassName := aClassOrClassName name
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6897
    ] ifFalse:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6898
	aClassName := aClassOrClassName
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6899
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6900
    aClassName := aClassName asString.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6901
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6902
    #('include/liblist.stc')    "/ filenames
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6903
    with:#(2)                   "/ column
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6904
    do:[:fileName :col |
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6905
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6906
	aStream := self systemFileStreamFor:fileName.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6907
	aStream notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6908
	    [aStream atEnd] whileFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6909
		line := aStream nextLine.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6910
		line notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6911
		    (line startsWith:'#') ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6912
			words := line asCollectionOfWords.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6913
			(n := words size) > 1 ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6914
			    (words at:1) = aClassName ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6915
				n >= col ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6916
				    aStream close.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6917
				    ^ (words at:col) withoutSeparators
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6918
				]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6919
			    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6920
			]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6921
		    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6922
		]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6923
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6924
	    aStream close
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6925
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6926
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6927
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6928
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6929
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6930
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6931
     Smalltalk libraryFileNameOfClass:'ClockView'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6932
     Smalltalk libraryFileNameOfClass:'Bag'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6933
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6934
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6935
    "Modified: 6.11.1995 / 15:41:39 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6936
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6937
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6938
packagePath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6939
    "return a collection of additional directorynames, where smalltalk
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6940
     looks for package directories.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6941
     Notice, that directories named 'packages' under the systemPath are
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6942
     always consulted - even if not in the packagePath"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6943
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6944
    ^ PackagePath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6945
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6946
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6947
     Smalltalk packagePath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6948
     Smalltalk packagePath addLast:'/opt/smalltalk'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6949
     Smalltalk packagePath addFirst:'/usr/local/otherPackages'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6950
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6951
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6952
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6953
packagePath:aPath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6954
    "set the packagePath;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6955
     a collection of additional directorynames, where smalltalk
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6956
     looks for package directories.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6957
     Notice, that directories named 'packages' under the systemPath are
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6958
     always consulted - even if not in the packagePath"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6959
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6960
    PackagePath := aPath asOrderedCollection
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6961
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6962
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6963
     Smalltalk packagePath:#( '.' '/opt/stx' '/opt/smalltalk' '/usr/local/otherPackages')
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6964
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6965
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6966
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6967
projectDirectoryForClass:aClass
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6968
    "given a class, return the path to its package directory;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6969
     nil if not found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6970
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6971
    |pkg|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6972
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6973
    pkg := aClass package.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6974
    pkg isNil ifTrue:[^ nil].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6975
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6976
    ^ self projectDirectoryForPackage:pkg.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6977
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6978
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6979
     Smalltalk projectDirectoryForClass:Array
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6980
     Smalltalk projectDirectoryForClass:View
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6981
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6982
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6983
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6984
projectDirectoryForPackage:aPackage
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6985
    "given a packageID, return the path to its package directory;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6986
     nil if not found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6987
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6988
    |prj prjDir|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6989
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6990
    "/ there might be a package specific resource directory ...
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6991
    "/ in the directory, from which the project was loaded
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6992
    prj := Project projectWithId:aPackage.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6993
    prj notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6994
	prjDir := prj directory.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6995
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6996
    (prjDir notNil and:[prjDir asFilename exists]) ifFalse:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  6997
	prjDir := Smalltalk getPackageFileName:(aPackage copyReplaceAll:$: with:$/).
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6998
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  6999
    ^ prjDir
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7000
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7001
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7002
     Smalltalk projectDirectoryForPackage:'stx:libbasic'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7003
     Smalltalk projectDirectoryForPackage:'exept:smartcard'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7004
     Smalltalk projectDirectoryForPackage:'stx'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7005
     Smalltalk projectDirectoryForPackage:'bosch'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7006
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7007
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7008
    "Modified: / 07-10-2006 / 17:45:58 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7009
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7010
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7011
readAbbreviations
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7012
    "read classname to filename mappings from include/abbrev.stc.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7013
     sigh - all for those poor sys5.3 or MSDOS people with short filenames ..."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7014
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7015
    "since installAutoloadedClasses also reads all abbreviations, use it"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7016
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7017
    CachedAbbreviations := IdentityDictionary new.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7018
    self installAutoloadedClasses.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7019
    ^ CachedAbbreviations.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7020
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7021
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7022
     Smalltalk readAbbreviations
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7023
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7024
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7025
    "Modified: / 10.12.1999 / 17:48:53 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7026
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7027
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7028
readAbbreviationsFromStream:aStream
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7029
    "read classname to filename mappings from aStream.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7030
     sigh - all for those poor sys5.3 or MSDOS people with short filenames ..."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7031
11375
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  7032
    self
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7033
	withAbbreviationsFromStream:aStream
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7034
	do:[:className :abbrev :pkg |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7035
	    self setFilename:abbrev forClass:className package:pkg.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7036
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7037
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7038
    "Modified: / 13.12.1999 / 11:54:17 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7039
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7040
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7041
realSystemPath
11679
69e588cca61f Do not use relative pathnames when searching for packages, etc.
Stefan Vogel <sv@exept.de>
parents: 11670
diff changeset
  7042
    "return the realSystemPath - thats the directory names from
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7043
     SystemPath which exist and are readable"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7044
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7045
    |nP|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7046
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7047
    RealSystemPath isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7048
	OperatingSystem isVMSlike ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7049
	    "/ temporary kludge: since we cannot currently
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7050
	    "/ check for existance of a name like 'volume:',
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7051
	    "/ leave those in the Path without a check.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7052
	    RealSystemPath := SystemPath select:[:dirName |  |f|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7053
		f := dirName asFilename.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7054
		f isVolumeOnly or:[(f isDirectory) and:[f isReadable]]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7055
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7056
	] ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7057
	    RealSystemPath := SystemPath
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7058
		select:[:eachDirectoryName |  |f|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7059
		    f := eachDirectoryName asFilename.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7060
		    (f isDirectory) and:[f isReadable]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7061
		] thenCollect:[:eachDirectoryName|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7062
		    eachDirectoryName asFilename pathName.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7063
		].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7064
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7065
	    "/ remove duplicates (but keep order)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7066
	    nP := OrderedCollection new.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7067
	    RealSystemPath do:[:p |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7068
		(nP includes:p) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7069
		    nP add:p
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7070
		]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7071
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7072
	    (nP includes:'.') ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7073
		nP add:'.'
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7074
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7075
	    RealSystemPath := nP.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7076
	].
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  7077
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  7078
    ^ RealSystemPath
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7079
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7080
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7081
recursiveReadAllAbbreviationsFrom:aDirectory
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7082
    self recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:15
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7083
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7084
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7085
recursiveReadAllAbbreviationsFrom:aDirectory maxLevels:maxLevels
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7086
    "read all abbreviations from and under aDirectory."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7087
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7088
    |abbrevStream dir directoryContents|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7089
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7090
    maxLevels == 0 ifTrue:[
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7091
"/        'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7092
	^ self
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7093
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7094
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7095
    dir := aDirectory asFilename.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7096
    dir exists ifFalse:[^ self].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7097
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7098
    [
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7099
	abbrevStream := (dir / 'abbrev.stc') asFilename readStream.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7100
	self readAbbreviationsFromStream:abbrevStream.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7101
	abbrevStream close.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7102
    ] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7103
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7104
    [
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7105
	directoryContents := dir directoryContents.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7106
    ] on:FileStream openErrorSignal do:[:ex|
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7107
	"non-accessable directory: we are done"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7108
	^ self
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7109
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7110
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7111
    directoryContents do:[:aFilename |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7112
	|f|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7113
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7114
	(#(
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7115
	    'doc'
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7116
	    'CVS'
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7117
	    'bitmaps'
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7118
	    'resources'
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7119
	    'source'
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7120
	) includes:aFilename) ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7121
	    f := dir / aFilename.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7122
	    f isDirectory ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7123
		self recursiveReadAllAbbreviationsFrom:f maxLevels:maxLevels-1
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7124
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7125
	].
4458
6f46b35f787c checkin from browser
Claus Gittinger <cg@exept.de>
parents: 4431
diff changeset
  7126
    ].
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7127
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7128
13368
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7129
relativePackagePathForPackage:aPackage
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7130
    |path|
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7131
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7132
    PackageToPathMapping notNil ifTrue:[
13370
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  7133
	path := PackageToPathMapping at:aPackage ifAbsent:nil.
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  7134
	PackageToPathMapping notNil ifTrue:[^ path].
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  7135
    ].
Claus Gittinger <cg@exept.de>
parents: 13368
diff changeset
  7136
    ^ aPackage copyReplaceAll:$: with:$/.
13368
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7137
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7138
    "
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7139
     PackageToPathMapping := Dictionary new.
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7140
     PackageToPathMapping at:'expeccoNET:server' put:'expeccoNET_oldVersion/server'.
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7141
     PackageToPathMapping at:'expeccoNET:server/ui' put:'expeccoNET_oldVersion/server/ui'.
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7142
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7143
     Smalltalk relativePackagePathForPackage:'stx:libview/resources'
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7144
     Smalltalk relativePackagePathForPackage:'stx:libview'
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7145
    "
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7146
!
00d9e3385e76 class definition
Claus Gittinger <cg@exept.de>
parents: 13353
diff changeset
  7147
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7148
resourceDirectoryForPackage:aPackage
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7149
    "given a packageID, return the path to its resource directory;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7150
     nil if not found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7151
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7152
    |prjDir rsrcDir|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7153
11183
9a4e7475a655 care for nil project when asked for a resource directory
Claus Gittinger <cg@exept.de>
parents: 11174
diff changeset
  7154
    aPackage notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7155
	prjDir := self projectDirectoryForPackage:aPackage.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7156
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7157
	(prjDir notNil
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7158
	and:[(prjDir := prjDir asFilename) exists
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7159
	and:[(rsrcDir := prjDir / 'resources') exists]]) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7160
	    ^ rsrcDir
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7161
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7162
	rsrcDir := self getSystemFileName:('resources/' , (aPackage copyReplaceAll:$: with:$/)).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7163
	rsrcDir notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7164
	    ^ rsrcDir asFilename
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7165
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7166
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7167
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7168
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7169
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7170
     Smalltalk resourceDirectoryForPackage:'stx:libbasic'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7171
     Smalltalk resourceDirectoryForPackage:'exept:expecco'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7172
     Smalltalk resourceDirectoryForPackage:'exept:smartcard'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7173
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7174
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7175
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7176
resourceFileStreamFor:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7177
    "search aFileName in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7178
     return a readonly fileStream or nil if not found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7179
     Searches in subdirectories named 'resource' in SystemPath"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7180
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7181
    ^ self resourceFileStreamFor:aFileName forClass:nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7182
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7183
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7184
resourceFileStreamFor:aFileName forClass:aClassOrNil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7185
    "search aFileName in some standard places and in the classes
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7186
     package-resource directory.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7187
     Return a readonly fileStream or nil if not found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7188
     Searches in subdirectories named 'resource' in SystemPath"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7189
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7190
    |aString|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7191
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7192
    aString := self getResourceFileName:aFileName forClass:aClassOrNil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7193
    aString notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7194
	^ aString asFilename readStreamOrNil
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7195
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7196
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7197
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7198
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7199
searchPath:aPath for:aFileName in:aDirName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7200
    "search aPath for a subdirectory named aDirectory with a file
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7201
     named aFileName"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7202
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7203
    |f|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7204
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7205
    ((f := aFileName asFilename) isAbsolute
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7206
    or:[f isExplicitRelative]) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7207
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7208
	"/ dont use path for absolute or explicit .-relative file names
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7209
	"/
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7210
	^ aFileName
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7211
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7212
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7213
    aPath notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7214
	aPath do:[:dirName |
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7215
	    |realName dir|
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7216
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7217
	    dir := dirName asFilename.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7218
	    aDirName notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7219
		realName := dir / aDirName / aFileName.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7220
	    ] ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7221
		realName := dir / aFileName.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7222
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7223
	    (realName isReadable) ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7224
		^ realName name
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7225
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7226
	].
11108
a803fa13937a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11093
diff changeset
  7227
    ].
a803fa13937a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11093
diff changeset
  7228
a803fa13937a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11093
diff changeset
  7229
"/ not needed - executing dir is always in SearchPath
12377
f9a9aea7ba0f changed:13 methods
Claus Gittinger <cg@exept.de>
parents: 12376
diff changeset
  7230
"/    realName := Filename currentDirectory / aFileName.
11108
a803fa13937a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11093
diff changeset
  7231
"/    (realName isReadable) ifTrue:[
a803fa13937a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11093
diff changeset
  7232
"/        ^ realName name
a803fa13937a *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11093
diff changeset
  7233
"/    ].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7234
    ^ nil.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7235
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7236
    "Modified: / 29.4.1999 / 15:06:43 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7237
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7238
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7239
setFilename:aFileNameString forClass:aClassNameString package:aPackageNameString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7240
    |classNameSymbol oldAbbrev oldPath newPath cls abbrevs|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7241
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7242
    CachedAbbreviations isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7243
	CachedAbbreviations := IdentityDictionary new.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7244
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7245
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7246
    abbrevs := CachedAbbreviations.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7247
    aClassNameString ~= aFileNameString ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7248
	classNameSymbol := aClassNameString asSymbol.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7249
	oldAbbrev := abbrevs at:classNameSymbol ifAbsent:nil.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7250
	oldAbbrev notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7251
	    oldAbbrev ~= aFileNameString ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7252
		oldAbbrev asFilename isAbsolute
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7253
		    ifTrue:[ oldPath := oldAbbrev ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7254
		    ifFalse:[ oldPath := (self projectDirectoryForPackage:aPackageNameString) asFilename constructString: oldAbbrev ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7255
		aFileNameString asFilename isAbsolute
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7256
		    ifTrue:[ newPath := aFileNameString ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7257
		    ifFalse:[ newPath := (self projectDirectoryForPackage:aPackageNameString) asFilename constructString: aFileNameString ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7258
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7259
		oldPath ~= newPath ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7260
		    StandAlone ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7261
			('Smalltalk [warning]: autoload path change for: ',aClassNameString,' in package ',aPackageNameString) infoPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7262
			('Smalltalk [info]: old: ',oldPath) infoPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7263
			('Smalltalk [info]: new: ',newPath) infoPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7264
		    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7265
		]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7266
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7267
	    "overwrite old abbreviation with new one,
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7268
	     to allow fixing of bad abbrev files"
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7269
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7270
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7271
	cls := self classNamed:aFileNameString.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7272
	cls notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7273
	    cls name ~= aClassNameString ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7274
		"/ ok, there is a class named after this abbrev ...
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7275
		"/ this is only a conflict, if the other class has no
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7276
		"/ abbreviation (or the same).
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7277
		(abbrevs at:(cls name asSymbol) ifAbsent:cls name) = aFileNameString ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7278
		    cls isNameSpace ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7279
			aPackageNameString = cls package ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7280
			    StandAlone ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7281
				('Smalltalk [warning]: conflict for: ' , cls name ,
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7282
				    ' in package ' , aPackageNameString) infoPrintCR.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7283
				('Smalltalk [warning]: (' , aClassNameString , ' -> ' , aFileNameString
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7284
				    , ')') infoPrintCR
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7285
			    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7286
			]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7287
		    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7288
		]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7289
	    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7290
	].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7291
	abbrevs at:classNameSymbol put:aFileNameString.
8470
d79e917d4f36 Define #setFilename:forClass:package: to define an abbreviation.
Stefan Vogel <sv@exept.de>
parents: 8445
diff changeset
  7292
    ]
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7293
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7294
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7295
sourceDirectoryNameOfClass:aClassOrClassName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7296
    "for a given class, return the pathname relative to TOP of the classes source code.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7297
     Read the files 'abbrev.stc' and 'liblist.stc' (which are created during the compilation process)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7298
     for an entry for aClassOrClassName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7299
     Search for the className in the first col, and return the value found in
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7300
     the 3rd col.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7301
     Return nil if no entry is found."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7302
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7303
    |aStream line words n aClassName|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7304
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7305
    aClassOrClassName isBehavior ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7306
	aClassName := aClassOrClassName name
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7307
    ] ifFalse:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7308
	aClassName := aClassOrClassName
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7309
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7310
    aClassName := aClassName asString.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7311
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7312
    #('include/abbrev.stc' 'include/liblist.stc')    "/ filenames
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7313
    with:#(3 2)                   "/ column
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7314
    do:[:fileName :col |
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7315
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7316
	aStream := self systemFileStreamFor:fileName.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7317
	aStream notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7318
	    [aStream atEnd] whileFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7319
		line := aStream nextLine.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7320
		line notNil ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7321
		    (line startsWith:'#') ifFalse:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7322
			words := line asCollectionOfWords.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7323
			(n := words size) > 1 ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7324
			    (words at:1) = aClassName ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7325
				n >= col ifTrue:[
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7326
				    aStream close.
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7327
				    ^ (words at:col) withoutSeparators
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7328
				]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7329
			    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7330
			]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7331
		    ]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7332
		]
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7333
	    ].
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7334
	    aStream close
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7335
	].
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7336
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7337
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7338
    ^ nil
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7339
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7340
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7341
     Smalltalk sourceDirectoryNameOfClass:'ClockView'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7342
     Smalltalk sourceDirectoryNameOfClass:'Bag'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7343
     Smalltalk sourceDirectoryNameOfClass:'GLWireCubeDemoView'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7344
     Smalltalk sourceDirectoryNameOfClass:'SomeNonExistingClass'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7345
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7346
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7347
    "Created: 6.11.1995 / 15:43:30 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7348
    "Modified: 9.12.1995 / 23:54:14 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7349
    "Modified: 3.1.1997 / 11:26:44 / stefan"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7350
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7351
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7352
sourceFileStreamFor:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7353
    "search aFileName in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7354
     return a readonly fileStream or nil if not found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7355
     Searches in subdirectories named 'source' in SystemPath"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7356
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7357
    |aString|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7358
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7359
    aString := self getSourceFileName:aFileName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7360
    aString notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7361
	^ aString asFilename readStreamOrNil
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7362
    ].
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7363
    ^ nil
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7364
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7365
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7366
systemFileStreamFor:aFileName
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7367
    "search aFileName in some standard places;
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7368
     return a readonly fileStream or nil if not found.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7369
     see comment in Smalltalk>>initSystemPath"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7370
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7371
    |aString|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7372
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7373
    aString := self getSystemFileName:aFileName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7374
    aString notNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7375
	^ aString asFilename readStreamOrNil
617
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  7376
    ].
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  7377
    ^ nil
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  7378
!
427245e28240 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 597
diff changeset
  7379
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7380
systemPath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7381
    "return a collection of directorynames, where smalltalk
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7382
     looks for system files
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7383
     (usually in subdirs such as resources, bitmaps, source etc.)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7384
     see comment in Smalltalk>>initSystemPath."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7385
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7386
    ^ SystemPath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7387
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7388
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7389
     Smalltalk systemPath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7390
     Smalltalk systemPath addLast:'someOtherDirectoryPath'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7391
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7392
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7393
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7394
systemPath:aPath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7395
    "set the collection of directorynames, where smalltalk
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7396
     looks for system files
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7397
     (usually in subdirs such as resources, bitmaps, source etc.)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7398
     see comment in Smalltalk>>initSystemPath."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7399
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7400
    SystemPath := aPath.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7401
    self flushPathCaches
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7402
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7403
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7404
     Smalltalk systemPath
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7405
     Smalltalk systemPath:(Smalltalk systemPath copy addLast:'someOtherDirectoryPath')
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7406
    "
11301
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7407
!
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7408
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7409
withAbbreviationsFromStream:aStream do:aBlock
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7410
    "read classname to filename mappings from aStream.
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7411
     Evaluate aBlock for each tuple:
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7412
	class-name , abbrev-name, package
11301
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7413
     Sigh - all for those poor sys5.3 or MSDOS people with short filenames..."
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7414
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7415
    |line lineNo words nm abbrev pkg category size s w|
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7416
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7417
    lineNo := 0.
11301
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7418
    [aStream atEnd] whileFalse:[
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7419
	line := aStream nextLine.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7420
	lineNo := lineNo + 1.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7421
	line notEmptyOrNil ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7422
	    (line startsWith:'#') ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7423
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7424
		"/ must do it manually, caring for quoted strings.
11301
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7425
"/                words := line asCollectionOfWords.
f65ffb560925 refactored abbreviation-reading
Claus Gittinger <cg@exept.de>
parents: 11232
diff changeset
  7426
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7427
		words := OrderedCollection new.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7428
		s := line readStream.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7429
		[s atEnd] whileFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7430
		    s skipSeparators.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7431
		    s peek == $' ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7432
			s next.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7433
			w := s upTo:$'.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7434
			s skipSeparators.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7435
		    ] ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7436
			w := s upToSeparator
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7437
		    ].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7438
		    words add:w
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7439
		].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7440
		words size >= 3 ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7441
		    nm := (words at:1) withoutSeparators.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7442
		    abbrev := (words at:2) withoutSeparators.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7443
		    pkg := (words at:3) withoutSeparators.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7444
		    aBlock argumentCount = 3 ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7445
			aBlock value:nm value:abbrev value:pkg.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7446
		    ] ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7447
			words size >= 4 ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7448
			    category := words at:4.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7449
			].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7450
			words size = 5 ifTrue:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7451
			    size := (words at:5) asNumber
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7452
			].
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7453
			aBlock value:nm value:abbrev value:pkg value: category value: size
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7454
		    ]
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7455
		] ifFalse:[
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7456
		    ('Smalltalk [warning]: malformed line ', lineNo printString , ' in ' , (aStream pathName)) infoPrintCR.
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7457
		]
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7458
	    ]
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7459
	]
13518
b81bc64782b1 not ifTrue -> ifFalse (trying the rewrite tool ;-)
Claus Gittinger <cg@exept.de>
parents: 13506
diff changeset
  7460
    ].
b81bc64782b1 not ifTrue -> ifFalse (trying the rewrite tool ;-)
Claus Gittinger <cg@exept.de>
parents: 13506
diff changeset
  7461
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7462
    "Modified: / 06-03-2011 / 18:17:58 / Jan Vrany <jan.vrany@fit.cvut.cz>"
13546
8993c10243a2 changed: #withAbbreviationsFromStream:do:
Claus Gittinger <cg@exept.de>
parents: 13540
diff changeset
  7463
    "Modified: / 04-08-2011 / 21:35:00 / cg"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7464
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7465
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  7466
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7467
!Smalltalk class methodsFor:'system management-packages'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7468
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7469
loadPackage:aPackageIdOrPackage
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7470
    "make certain, that some particular package is loaded into the system.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7471
     Return true if loaded, false otherwise."
11668
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7472
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7473
    ^ self loadPackage:aPackageIdOrPackage asAutoloaded:false
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7474
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7475
    "
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7476
     Smalltalk loadPackage:'stx:libbasic'
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7477
     Smalltalk loadPackage:'stx:goodies/persistency'
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7478
     Smalltalk loadPackage:'cg:cparser'
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7479
     Smalltalk loadPackage:'cg:rose'
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7480
    "
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7481
!
a7f22eab5b72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 11667
diff changeset
  7482
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7483
packageDirectoryForPackageId:aPackageId
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7484
    "used by classes to find the location of their resource- and bitmap directories.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7485
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7486
     Notice that the directory structure is different between the development
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7487
     environment (top for packages is ../../../stx) and delivered stand alone executables,
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7488
     where the top is specified via a shell environment variable, and is typically ../lib.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7489
     At runtime, Smalltalk knows about the systemPath setting."
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7490
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7491
    |packageDirName packageDir|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7492
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  7493
    packageDirName := aPackageId asPackageId string copyReplaceAll:$: with:$/.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7494
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7495
    packageDir := self getPackageFileName:packageDirName.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7496
    packageDir isNil ifTrue:[
14589
058231c234cb class: Smalltalk
Claus Gittinger <cg@exept.de>
parents: 14546
diff changeset
  7497
        ^ nil.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7498
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7499
    ^ packageDir asFilename
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7500
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7501
    "
11375
bcdaeec8353c splash support
Claus Gittinger <cg@exept.de>
parents: 11367
diff changeset
  7502
     Smalltalk packageDirectoryForPackageId:'stx:libbasic'
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7503
     Smalltalk packageDirectoryForPackageId:'stx:goodies/persistency'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7504
     Smalltalk packageDirectoryForPackageId:'exept:ctypes'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7505
    "
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7506
!
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7507
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7508
unloadPackage:aPackageIdOrPackage
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7509
    |projectDefinition|
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7510
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7511
    projectDefinition := aPackageIdOrPackage.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7512
    projectDefinition isProjectDefinition ifFalse:[
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  7513
        projectDefinition := projectDefinition asPackageId projectDefinitionClass.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  7514
        projectDefinition isNil ifTrue:[
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  7515
            'Smalltalk [info] trying to unload non-existing package: ' infoPrint. aPackageIdOrPackage infoPrintCR.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  7516
            ^ self.
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  7517
        ].
12250
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7518
    ].
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7519
    projectDefinition unloadPackage.
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7520
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7521
    "
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7522
     Smalltalk loadPackage:'stx:goodies/persistency'
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7523
     Smalltalk unloadPackage:'stx:goodies/persistency'
1a21bcbad053 added: #unloadPackage:
Claus Gittinger <cg@exept.de>
parents: 12194
diff changeset
  7524
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7525
! !
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7526
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  7527
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7528
!Smalltalk class methodsFor:'system management-undeclared variables'!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7529
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7530
clearUndeclaredVariables
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7531
    "remove all undeclared variables"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7532
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7533
    (Smalltalk at:#Undeclared) do:[:eachKey |
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7534
	Smalltalk removeKey:(self undeclaredPrefix , eachKey) asSymbol.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7535
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7536
    (Smalltalk at:#Undeclared) removeAll.
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7537
    Smalltalk removeKey:#Undeclared.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7538
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7539
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7540
undeclaredPrefix
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7541
    "the prefix used for undeclared variables"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7542
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7543
    ^ 'Undeclared:::'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7544
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7545
    "Created: / 31.10.1997 / 01:13:10 / cg"
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7546
! !
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7547
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  7548
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7549
!Smalltalk class methodsFor:'time-versions'!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7550
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7551
configuration
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7552
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7553
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7554
    "for developers only: return the configuration, with which
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7555
     this smalltalk was compiled."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7556
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7557
%{  /* NOCONTEXT */
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7558
    extern char *__getConfigurationString();
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7559
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7560
    RETURN (__MKSTRING(__getConfigurationString() COMMA_SND));
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7561
%}.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7562
    ^ 'unknownOS/unknownCONF:unknownPACK'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7563
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7564
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  7565
     Smalltalk configuration
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7566
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7567
!
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  7568
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7569
copyrightString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7570
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7571
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7572
    "return a copyright string"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7573
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7574
%{  /* NOCONTEXT */
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7575
#ifndef __getCopyrightString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7576
    extern OBJ __getCopyrightString();
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7577
#endif
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7578
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7579
    RETURN (__getCopyrightString());
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7580
%}.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7581
    ^ self primitiveFailed
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7582
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7583
    "
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7584
     Smalltalk copyrightString
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7585
    "
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7586
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7587
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7588
distributorString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7589
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7590
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7591
    "return a string describing the distributor of this software"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7592
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7593
%{  /* NOCONTEXT */
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7594
#ifndef __getDistributorString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7595
    extern OBJ __getDistributorString();
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7596
#endif
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7597
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7598
    RETURN (__getDistributorString());
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7599
%}.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7600
    ^ 'eXept Software AG, Germany'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7601
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7602
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7603
     Smalltalk distributorString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7604
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7605
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7606
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7607
expirationTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7608
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7609
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7610
    "for developers only: return the time when the system will expire.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7611
     after this time it will not run any longer.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7612
     It returns nil, if no expiration time has been set (system runs forever :-))"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7613
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7614
    |exp|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7615
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7616
%{
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7617
    extern unsigned int __getExpirationTime();
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7618
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7619
    exp = __MKUINT(__getExpirationTime());
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7620
%}.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7621
    exp == 0 ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7622
	^ nil
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7623
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7624
    ^ Timestamp new fromOSTime:(exp * 1000). "OSTime is ms since 1970"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7625
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7626
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7627
     Smalltalk expirationTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7628
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7629
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7630
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7631
fullVersionString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7632
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7633
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7634
    "return a full version string"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7635
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7636
    ^ 'Smalltalk/X release ' , self versionString , ' of ' , self versionDate
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7637
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7638
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7639
     Smalltalk fullVersionString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7640
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7642
    "Created: / 27.10.1997 / 17:03:09 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7643
    "Modified: / 27.10.1997 / 17:04:02 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7644
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7645
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7646
hello
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7647
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7648
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7649
    "return a greeting string"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7650
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7651
    "stupid: this should come from a resource file ...
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7652
     but I dont use it here, to allow mini-systems without
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7653
     Resource-stuff."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7654
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7655
    |proto lang|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7656
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7657
    lang := Language.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7658
    (lang == #de) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7659
	proto := 'Willkommen bei %1 (Version %2 von %3)'
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7660
    ] ifFalse:[ (lang == #fr) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7661
	proto := 'Salut, Bienvenue à %1 (version %2 de %3)'
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7662
    ] ifFalse:[ (lang == #it) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7663
	proto := 'Ciao, benvenuto al %1 (versione %2 di %3)'
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7664
    ] ifFalse:[ (lang == #es) ifTrue:[
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7665
"/        proto := 'Hola, bienvenida a %1 (versión %2 de %3)'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7666
    ] ifFalse:[ (lang == #es) ifTrue:[
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7667
"/        proto := 'Oi, benvindo a %1 (versão %2 de %3)'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7668
    ] ifFalse:[ (lang == #no) ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7669
	proto := 'Hei, verdenmottakelse til %1 (versjon %2 av %3)'
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7670
    ]]]]]].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7671
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7672
    "/ ... more needed here ...
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7673
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7674
    proto isNil ifTrue:[
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7675
	proto := 'Hello World - here is %1 version %2 of %3'.
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7676
    ].
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7677
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7678
    ^ proto bindWith:('SmallTalk/X' allBold)
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7679
		with:(self versionString)
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7680
		with:(self versionDate)
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7681
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7682
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7683
     Smalltalk language:#us.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7684
     Smalltalk hello
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7685
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7686
     Smalltalk language:#de.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7687
     Smalltalk hello
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7688
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7689
     Smalltalk language:#no.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7690
     Smalltalk hello
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7691
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7692
     Transcript showCR:(Smalltalk hello)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7693
     Stdout showCR:(Smalltalk hello)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7694
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7695
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7696
    "Modified: 18.5.1996 / 14:25:13 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7697
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7698
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7699
imageRestartTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7700
    "return a timestamp for the moment when this image was restarted.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7701
     If we do not execute from an image (i.e. fresh start), return nil."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7702
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7703
    ^ ImageRestartTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7704
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7705
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7706
     Smalltalk imageStartTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7707
     Smalltalk imageRestartTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7708
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7709
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7710
    "Created: 13.12.1995 / 17:44:20 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7711
    "Modified: 6.3.1996 / 11:56:35 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7712
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7713
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7714
imageSaveTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7715
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7716
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7717
    "return a timestamp for the moment when this image was saved"
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7718
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7719
    ^ ObjectMemory imageSaveTime
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7720
!
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7721
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7722
imageStartTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7723
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7724
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7725
    "return a timestamp for the moment when this system started the first time
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7726
     (i.e. the first initial start without an image)"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7727
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7728
    ^ ImageStartTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7729
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7730
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7731
     Smalltalk imageStartTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7732
     Smalltalk imageRestartTime
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7733
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7734
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7735
    "Created: 13.12.1995 / 17:44:14 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7736
    "Modified: 13.12.1995 / 17:45:47 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7737
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7738
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7739
majorVersionNr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7740
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7741
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7742
    "return the major version number.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7743
     This is only incremented for very fundamental changes,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7744
     which make old object files totally incompatible
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7745
     (for example, if the layout/representation of fundamental
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7746
      classes changes).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7747
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7748
     ST/X revision Naming is:
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7749
	<major>.<minor>.<revision>.<release>"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7750
12867
2b9cbcea983b version bump - layout of Class, Method and Context changed.
Claus Gittinger <cg@exept.de>
parents: 12861
diff changeset
  7751
    ^ 6
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7752
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7753
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7754
     Smalltalk majorVersionNr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7755
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7756
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7757
    "Modified: 8.11.1996 / 19:59:21 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7758
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7759
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7760
minorVersionNr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7761
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7762
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7763
    "return the minor version number.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7764
     This is incremented for changes which make some old object
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7765
     files incompatible, or the protocol changes such that some
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7766
     classes need rework.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7767
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7768
     ST/X revision Naming is:
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7769
	<major>.<minor>.<revision>.<release>"
13489
32ea9770aed5 changed:
Claus Gittinger <cg@exept.de>
parents: 13415
diff changeset
  7770
32ea9770aed5 changed:
Claus Gittinger <cg@exept.de>
parents: 13415
diff changeset
  7771
    ^ 2
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7772
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7773
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7774
     Smalltalk minorVersionNr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7775
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7776
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7777
    "Modified: / 16-08-2006 / 09:37:25 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7778
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7779
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7780
releaseIdentification
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7781
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7782
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7783
    "for developers only: return the release
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7784
     (to further identify the version in case of errors)"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7785
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7786
%{  /* NOCONTEXT */
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7787
    extern OBJ __getRel();
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7788
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7789
    RETURN (__getRel());
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7790
%}.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7791
    ^ 'ST/X_experimental'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7792
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7793
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7794
     Smalltalk releaseIdentification
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7795
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7796
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7797
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7798
releaseNr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7799
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7800
14542
8ed2cefffa0c class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14529
diff changeset
  7801
    "return the release number.
8ed2cefffa0c class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14529
diff changeset
  7802
     Now releaseNr is the build number (BUILD_NUMBER from Jenkins)
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7803
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7804
     ST/X revision Naming is:
14529
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7805
        <major>.<minor>.<revision>.<release>"
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7806
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7807
    |releaseNumber|
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7808
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7809
    releaseNumber := Smalltalk versionBuildNumber.
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7810
    releaseNumber isEmpty ifTrue:[
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7811
        ^ 0.
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7812
    ].
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7813
    ^ releaseNumber
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7814
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7815
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7816
     Smalltalk releaseNr
12867
2b9cbcea983b version bump - layout of Class, Method and Context changed.
Claus Gittinger <cg@exept.de>
parents: 12861
diff changeset
  7817
     Smalltalk versionString
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7818
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7819
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7820
    "Created: / 10-12-1995 / 01:42:19 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7821
    "Modified: / 10-02-2007 / 14:49:51 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7822
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7823
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7824
revisionNr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7825
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7826
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7827
    "return the revision number.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7828
     Incremented for releases which fix bugs/add features
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7829
     and represent a stable workable version which got published
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7830
     to the outside world.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7831
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7832
     ST/X revision Naming is:
14432
ac02f979ac12 debugging code removed
Claus Gittinger <cg@exept.de>
parents: 14431
diff changeset
  7833
	<major>.<minor>.<revision>.<release>"
14210
06966b03a12c changed: #revisionNr
Claus Gittinger <cg@exept.de>
parents: 14020
diff changeset
  7834
17960
23f7bba9741b Smalltalk>>versionString changed to 6.2.3b
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17956
diff changeset
  7835
    ^ 3
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7836
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7837
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7838
     Smalltalk revisionNr
13323
68e5bb82f5f7 changed: #loadPackage:fromClassLibrary:
Stefan Vogel <sv@exept.de>
parents: 13303
diff changeset
  7839
     Smalltalk hello string
13014
fe6484596968 changed: #revisionNr
Claus Gittinger <cg@exept.de>
parents: 13000
diff changeset
  7840
    "
fe6484596968 changed: #revisionNr
Claus Gittinger <cg@exept.de>
parents: 13000
diff changeset
  7841
14210
06966b03a12c changed: #revisionNr
Claus Gittinger <cg@exept.de>
parents: 14020
diff changeset
  7842
    "Modified: / 18-07-2012 / 19:09:42 / cg"
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7843
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7844
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7845
timeStamp
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7846
    "return a string useful for timestamping a file.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7847
     The returned string is padded with spaces for a constant
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7848
     length (to avoid changing a files size in fileOut with unchanged
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7849
     class)."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7850
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7851
    ^ ('''' , self timeStampString , '''') paddedTo:80 with:(Character space)
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7852
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7853
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7854
timeStamp:aStream
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7855
    "write a string useful for timestamping a file onto aStream.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7856
     ST80 compatibility"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7857
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7858
    aStream nextPutAll:(self timeStamp).
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7859
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7860
    "Created: / 18.6.1998 / 17:22:58 / cg"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7861
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7862
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7863
timeStampString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7864
    "return a string useful for timestamping a file."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7865
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7866
    |dateString|
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7867
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7868
    dateString := String streamContents:[:s | Date today printOn:s language:#en].  "/ MUST be english !!!!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7869
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7870
    ^ ('From Smalltalk/X, Version:' , (Smalltalk versionString) , ' on '
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7871
       , dateString , ' at ' , Time now printString
7758
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7872
       )
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7873
!
526f0a3a74a4 *** empty log message ***
penk
parents: 7757
diff changeset
  7874
14529
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7875
versionBuildNumber
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7876
    "{ Pragma: +optSpace }"
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7877
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7878
    "return the executables build number - that's the jenkins build #.
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7879
     Empty if not built by jenkins"
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7880
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7881
%{  /* NOCONTEXT */
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7882
    extern char *__getBuildNumberString();
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7883
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7884
    RETURN (__MKSTRING(__getBuildNumberString() COMMA_SND) );
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7885
%}.
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7886
    ^ ''
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7887
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7888
    "
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7889
     Smalltalk versionBuildNumber
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7890
    "
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7891
!
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7892
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7893
versionDate
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7894
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7895
14522
ae3c24478338 build number
Claus Gittinger <cg@exept.de>
parents: 14487
diff changeset
  7896
    "return the executables build date - that's the date when the smalltalk
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7897
     executable was built"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7898
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7899
%{  /* NOCONTEXT */
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7900
    extern char *__getBuildDateString();
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7901
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7902
    RETURN (__MKSTRING(__getBuildDateString() COMMA_SND) );
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7903
%}.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7904
    ^ 'today'
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7905
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7906
    "
10071
c3ac1c847c22 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10069
diff changeset
  7907
     Smalltalk versionDate
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7908
    "
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7909
!
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7910
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7911
versionString
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7912
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7913
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7914
    "return the version string"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7915
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7916
    ^ (self majorVersionNr printString ,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7917
       '.',
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7918
       self minorVersionNr printString ,
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7919
       '.',
14529
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7920
       self revisionNr printString,
18011
deb0c3355881 Merged branch 'default' (CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 17997 14620
diff changeset
  7921
       'jv.',
14529
93eb58ca1886 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14522
diff changeset
  7922
       self releaseNr printString)
13771
42c23bea6aaf *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 13675
diff changeset
  7923
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7924
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7925
    "
8583
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7926
     Smalltalk versionString
2952bfabeaf7 oops - garbage was checked in
Claus Gittinger <cg@exept.de>
parents: 8570
diff changeset
  7927
    "
10641
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7928
!
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7929
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7930
vmMajorVersionNr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7931
    "{ Pragma: +optSpace }"
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7932
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7933
    "return the VMs major version number."
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7934
%{
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7935
    RETURN (__mkSmallInteger(4));
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7936
%}.
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7937
    ^ 4
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7938
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7939
    "
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7940
     Smalltalk vmMajorVersionNr
e2a4830afe72 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 10640
diff changeset
  7941
    "
2
claus
parents: 1
diff changeset
  7942
! !
453
57381f377c3f fix logged-arg (was nil)
Claus Gittinger <cg@exept.de>
parents: 452
diff changeset
  7943
18027
3621469cc5e8 Merged fa8a879502cb and b010cb2aa396 (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18021 14810
diff changeset
  7944
1750
36ff7e62388a care for privateClasses in remove
Claus Gittinger <cg@exept.de>
parents: 1713
diff changeset
  7945
!Smalltalk class methodsFor:'documentation'!
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 617
diff changeset
  7946
13532
638f9bfab880 changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels:
Claus Gittinger <cg@exept.de>
parents: 13531
diff changeset
  7947
version
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  7948
    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1010 2013-03-05 09:41:57 stefan Exp $'
13532
638f9bfab880 changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels:
Claus Gittinger <cg@exept.de>
parents: 13531
diff changeset
  7949
!
638f9bfab880 changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels:
Claus Gittinger <cg@exept.de>
parents: 13531
diff changeset
  7950
12172
d90a72004f43 changed: #fileNameForClass:
Claus Gittinger <cg@exept.de>
parents: 12033
diff changeset
  7951
version_CVS
14833
c718848b1051 class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14810
diff changeset
  7952
    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.1010 2013-03-05 09:41:57 stefan Exp $'
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7953
!
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7954
18019
f12a52a26621 Hack in: Smalltalk>#fileInClass:package:initialize:lazy:silent: - do no try .zip if it does not exist.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  7955
version_HG
f12a52a26621 Hack in: Smalltalk>#fileInClass:package:initialize:lazy:silent: - do no try .zip if it does not exist.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  7956
f12a52a26621 Hack in: Smalltalk>#fileInClass:package:initialize:lazy:silent: - do no try .zip if it does not exist.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 18011
diff changeset
  7957
    ^ '$Changeset: <not expanded> $'
13415
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7958
!
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7959
ba3e5e6dd910 Jan's changes
vrany
parents: 13385
diff changeset
  7960
version_SVN
13489
32ea9770aed5 changed:
Claus Gittinger <cg@exept.de>
parents: 13415
diff changeset
  7961
    ^ '§ Id: Smalltalk.st 10648 2011-06-23 15:55:10Z vranyj1  §'
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 617
diff changeset
  7962
! !
14611
5c3a6b7ed01d class: Smalltalk
Stefan Vogel <sv@exept.de>
parents: 14589
diff changeset
  7963